[debian-edu-commits] debian-edu/italc.git (#5) - upstream (branch) updated: upstream/2.0.0-2-gdc28405

Mike Gabriel sunweaver at alioth.debian.org
Mon Aug 12 01:33:10 UTC 2013


The branch, upstream has been updated
       via  dc284054e25eafed6499de6851945a7b33609e65 (commit)
      from  b230503bc7356c2190c824545500f3a42ee28a5a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dc284054e25eafed6499de6851945a7b33609e65
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun Aug 11 08:39:20 2013 +0200

    Imported Upstream version 2.0.0

-----------------------------------------------------------------------

Summary of changes:
 CMakeLists.txt                                     |  345 +
 INSTALL                                            |  113 +-
 Makefile.am                                        |  107 -
 Makefile.in                                        |  897 -
 README                                             |    6 +-
 README.LZO                                         |   27 +-
 acinclude.m4                                       |  769 -
 aclocal.m4                                         |  969 -
 build_mingw32                                      |    4 +-
 build_mingw64                                      |    4 +-
 cmake/modules/DetectMachine.cmake                  |   44 +
 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 +
 config.guess                                       | 1502 --
 config.h.in                                        |  457 -
 config.sub                                         | 1714 --
 configure                                          |22973 --------------------
 configure.in                                       |  544 -
 contrib/README.txt                                 |   28 +
 contrib/en-US/italc.adml                           |  198 +
 contrib/italc.admx                                 |  327 +
 depcomp                                            |  630 -
 doc/AutomatedSetupWithIMC.txt                      |   49 +
 doc/ControllingIMCAtTheCommandline.txt             |   70 +
 doc/CrossCompilingForWindows.txt                   |   39 +
 doc/UsingPathVariables.txt                         |   30 +
 iTALC.nsi.in                                       |   84 +-
 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/Makefile.am                                    |  259 -
 ica/Makefile.in                                    | 1598 --
 ica/helpers/CMakeLists.txt                         |    4 +
 ica/helpers/ItalcAuthHelper.cpp                    |   78 +
 ica/ica.1                                          |    4 +-
 ica/ica.rc                                         |   35 +
 ica/ica.rc.in                                      |   12 +-
 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                             |  659 +
 ica/src/DemoServer.h                               |  143 +
 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                         |  370 +
 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/demo_client.cpp                            |   88 -
 ica/src/demo_client.h                              |   51 -
 ica/src/demo_server.cpp                            |  586 -
 ica/src/demo_server.h                              |  155 -
 ica/src/ica_main.cpp                               |  360 -
 ica/src/ica_main.h                                 |   44 -
 ica/src/isd_server.cpp                             | 1158 -
 ica/src/isd_server.h                               |  133 -
 ica/src/ivs.cpp                                    |  240 -
 ica/src/ivs.h                                      |   76 -
 ica/src/local_system_ica.cpp                       |  513 -
 ica/src/local_system_ica.h                         |   38 -
 ica/src/system_service.cpp                         |  883 -
 ica/src/system_service.h                           |  177 -
 ica/win32/CMakeLists.txt                           |   39 +
 ica/win32/README                                   |   11 -
 ica/win32/VNCHelp.h                                |    1 -
 ica/win32/addon/logger/logmessages.dsw             |   29 +
 ica/win32/addon/logger/messages.h                  |   66 +
 ica/win32/addon/logger/messages.mc                 |   26 +
 ica/win32/addon/logger/messages.rc                 |    2 +
 ica/win32/addon/ms-logon/MSLogonACL/.cvsignore     |    4 +
 ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.cpp |  117 +
 ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.dsw |   29 +
 ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.h   |   28 +
 ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.rc  |  116 +
 ica/win32/addon/ms-logon/MSLogonACL/buildtime.h    |    3 +
 ica/win32/addon/ms-logon/MSLogonACL/buildtime.in   |    2 +
 ica/win32/addon/ms-logon/MSLogonACL/resource.h     |   15 +
 .../addon/ms-logon/MSLogonACL/vncExportACL.cpp     |  220 +
 ica/win32/addon/ms-logon/MSLogonACL/vncExportACL.h |   56 +
 .../addon/ms-logon/MSLogonACL/vncImportACL.cpp     |  498 +
 ica/win32/addon/ms-logon/MSLogonACL/vncImportACL.h |   87 +
 ica/win32/addon/ms-logon/authSSP/.cvsignore        |    4 +
 ica/win32/addon/ms-logon/authSSP/Auth_Seq.h        |   43 +
 ica/win32/addon/ms-logon/authSSP/EventLogging.cpp  |  158 +
 ica/win32/addon/ms-logon/authSSP/EventLogging.h    |   59 +
 .../ms-logon/authSSP/GenClientServerContext.cpp    |  370 +
 .../ms-logon/authSSP/GenClientServerContext.h      |   72 +
 ica/win32/addon/ms-logon/authSSP/Readme.txt        |   16 +
 ica/win32/addon/ms-logon/authSSP/authSSP.cpp       |  332 +
 ica/win32/addon/ms-logon/authSSP/authSSP.def       |    5 +
 ica/win32/addon/ms-logon/authSSP/authSSP.dsw       |   29 +
 ica/win32/addon/ms-logon/authSSP/authSSP.h         |   98 +
 ica/win32/addon/ms-logon/authSSP/authSSP.rc        |  116 +
 ica/win32/addon/ms-logon/authSSP/buildtime.in      |    2 +
 ica/win32/addon/ms-logon/authSSP/resource.h        |   15 +
 .../addon/ms-logon/authSSP/vncAccessControl.cpp    |  216 +
 .../addon/ms-logon/authSSP/vncAccessControl.h      |   45 +
 ica/win32/addon/ms-logon/authSSP/vncSSP.cpp        |  108 +
 ica/win32/addon/ms-logon/authSSP/vncSSP.h          |   52 +
 .../addon/ms-logon/authSSP/vncSecurityEditor.cpp   |  168 +
 .../addon/ms-logon/authSSP/vncSecurityEditor.h     |   71 +
 .../ms-logon/authSSP/vncSecurityEditorProps.h      |   66 +
 ica/win32/addon/ms-logon/authadm/authadmin.cpp     |  111 +
 ica/win32/addon/ms-logon/authadm/authadmin.def     |    4 +
 ica/win32/addon/ms-logon/authadm/authadmin.dsw     |   29 +
 ica/win32/addon/ms-logon/authadm/authadmin.h       |   23 +
 ica/win32/addon/ms-logon/authadm/authadmin.rc      |  112 +
 ica/win32/addon/ms-logon/authadm/resource.h        |   15 +
 ica/win32/addon/ms-logon/ldapauth/ldapAuth.cpp     |  638 +
 ica/win32/addon/ms-logon/ldapauth/ldapAuth.h       |   55 +
 ica/win32/addon/ms-logon/ldapauth/ldapAuth.rc      |  112 +
 ica/win32/addon/ms-logon/ldapauth/ldapauth.def     |    5 +
 ica/win32/addon/ms-logon/ldapauth/ldapauth.dsw     |   29 +
 ica/win32/addon/ms-logon/ldapauth/resource.h       |   15 +
 ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.cpp |  614 +
 ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.h   |   57 +
 ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.rc  |  112 +
 ica/win32/addon/ms-logon/ldapauth9x/ldapauth9x.def |    5 +
 ica/win32/addon/ms-logon/ldapauth9x/resource.h     |   15 +
 .../addon/ms-logon/ldapauthNT4/ldapAuthnt4.cpp     |  656 +
 ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.h |   55 +
 .../addon/ms-logon/ldapauthNT4/ldapAuthnt4.rc      |  112 +
 .../addon/ms-logon/ldapauthNT4/ldapauthnt4.def     |    5 +
 .../addon/ms-logon/ldapauthNT4/ldapauthnt4.dsw     |   29 +
 ica/win32/addon/ms-logon/ldapauthNT4/resource.h    |   15 +
 ica/win32/addon/ms-logon/logging/logging.cpp       |  314 +
 ica/win32/addon/ms-logon/logging/logging.def       |    8 +
 ica/win32/addon/ms-logon/logging/logging.dsw       |   29 +
 ica/win32/addon/ms-logon/logging/logging.h         |   38 +
 ica/win32/addon/ms-logon/logging/logging.rc        |  112 +
 ica/win32/addon/ms-logon/logging/resource.h        |   15 +
 ica/win32/addon/ms-logon/testauth/ntlogon.cpp      |  232 +
 ica/win32/addon/ms-logon/testauth/resource.h       |   15 +
 ica/win32/addon/ms-logon/testauth/testauth.dsw     |   53 +
 ica/win32/addon/ms-logon/testauth/testauth.rc      |  112 +
 ica/win32/addon/ms-logon/workgrpdomnt4/resource.h  |   15 +
 .../addon/ms-logon/workgrpdomnt4/workgrpdomnt4.cpp |  886 +
 .../addon/ms-logon/workgrpdomnt4/workgrpdomnt4.def |    4 +
 .../addon/ms-logon/workgrpdomnt4/workgrpdomnt4.dsw |   29 +
 .../addon/ms-logon/workgrpdomnt4/workgrpdomnt4.h   |  100 +
 .../addon/ms-logon/workgrpdomnt4/workgrpdomnt4.rc  |  112 +
 ica/win32/addon/versioninfo.h                      |   76 +
 ica/win32/common/Clipboard.cpp                     |  762 +
 ica/win32/common/Clipboard.h                       |  168 +
 ica/win32/common/ScopeGuard.h                      |  320 +
 ica/win32/common/win32_helpers.cpp                 |   99 +
 ica/win32/common/win32_helpers.h                   |   72 +
 ica/win32/keysymdef.h                              |    1 -
 ica/win32/libjpeg/jpeglib.h                        |    1 -
 ica/win32/rdr/Exception.h                          |   71 +
 ica/win32/rdr/FdInStream.cxx                       |  387 +
 ica/win32/rdr/FdInStream.h                         |   89 +
 ica/win32/rdr/FdOutStream.cxx                      |  114 +
 ica/win32/rdr/FdOutStream.h                        |   53 +
 ica/win32/rdr/FixedMemOutStream.h                  |   52 +
 ica/win32/rdr/InStream.cxx                         |   35 +
 ica/win32/rdr/InStream.h                           |  145 +
 ica/win32/rdr/Makefile.bcc32                       |   33 +
 ica/win32/rdr/Makefile.in                          |   18 +
 ica/win32/rdr/MemInStream.h                        |   47 +
 ica/win32/rdr/MemOutStream.h                       |   82 +
 ica/win32/rdr/NullOutStream.cxx                    |   60 +
 ica/win32/rdr/NullOutStream.h                      |   42 +
 ica/win32/rdr/OutStream.h                          |  154 +
 ica/win32/rdr/ZlibInStream.cxx                     |  125 +
 ica/win32/rdr/ZlibInStream.h                       |   61 +
 ica/win32/rdr/ZlibOutStream.cxx                    |  145 +
 ica/win32/rdr/ZlibOutStream.h                      |   59 +
 ica/win32/rdr/types.h                              |   36 +
 ica/win32/rectlist.h                               |    1 -
 ica/win32/src/DynamicFn.cpp                        |   40 -
 ica/win32/src/DynamicFn.h                          |   46 -
 ica/win32/src/Log.cpp                              |  248 -
 ica/win32/src/Log.h                                |   99 -
 ica/win32/src/MinMax.cpp                           |   44 -
 ica/win32/src/MinMax.h                             |   37 -
 ica/win32/src/ParseHost.c                          |   51 -
 ica/win32/src/ParseHost.h                          |   42 -
 ica/win32/src/RectList.cpp                         |   59 -
 ica/win32/src/RectList.h                           |   39 -
 ica/win32/src/TsSessions.cpp                       |   88 -
 ica/win32/src/TsSessions.h                         |   54 -
 ica/win32/src/VNCHooks/SharedData.cpp              |   49 -
 ica/win32/src/VNCHooks/SharedData.h                |   42 -
 ica/win32/src/VNCHooks/VNCHooks.cpp                | 1371 --
 ica/win32/src/VNCHooks/VNCHooks.h                  |   78 -
 ica/win32/src/VSocket.cpp                          |  691 -
 ica/win32/src/VSocket.h                            |  182 -
 ica/win32/src/VTypes.h                             |   88 -
 ica/win32/src/VideoDriver.cpp                      |  766 -
 ica/win32/src/VideoDriver.h                        |  230 -
 ica/win32/src/WinVNC.cpp                           |  414 -
 ica/win32/src/WinVNC.h                             |   97 -
 ica/win32/src/d3des.h                              |   51 -
 ica/win32/src/d3des_w32.c                          |  440 -
 ica/win32/src/omnithread/nt.cpp                    |  833 -
 ica/win32/src/omnithread/nt.h                      |   60 -
 ica/win32/src/omnithread/omnithread.h              |  502 -
 ica/win32/src/resource.h                           |  164 -
 ica/win32/src/rfb.h                                |   87 -
 ica/win32/src/stdhdrs.cpp                          |   38 -
 ica/win32/src/stdhdrs.h                            |   65 -
 ica/win32/src/tableinitcmtemplate.cpp              |   91 -
 ica/win32/src/tableinittctemplate.cpp              |  122 -
 ica/win32/src/tabletranstemplate.cpp               |   99 -
 ica/win32/src/translate.cpp                        |  137 -
 ica/win32/src/translate.h                          |   81 -
 ica/win32/src/vncBuffer.cpp                        |  533 -
 ica/win32/src/vncBuffer.h                          |  135 -
 ica/win32/src/vncClient.cpp                        | 2565 ---
 ica/win32/src/vncClient.h                          |  237 -
 ica/win32/src/vncDesktop.cpp                       | 3164 ---
 ica/win32/src/vncDesktop.h                         |  277 -
 ica/win32/src/vncEncodeCoRRE.cpp                   |  549 -
 ica/win32/src/vncEncodeCoRRE.h                     |   85 -
 ica/win32/src/vncEncodeHexT.cpp                    |  412 -
 ica/win32/src/vncEncodeHexT.h                      |   75 -
 ica/win32/src/vncEncodeRRE.cpp                     |  347 -
 ica/win32/src/vncEncodeRRE.h                       |   69 -
 ica/win32/src/vncEncodeTight.cpp                   | 1599 --
 ica/win32/src/vncEncodeTight.h                     |  191 -
 ica/win32/src/vncEncodeZlib.cpp                    |  276 -
 ica/win32/src/vncEncodeZlib.h                      |   86 -
 ica/win32/src/vncEncoder.cpp                       |  669 -
 ica/win32/src/vncEncoder.h                         |  128 -
 ica/win32/src/vncInstHandler.cpp                   |   94 -
 ica/win32/src/vncInstHandler.h                     |   57 -
 ica/win32/src/vncKeymap.cpp                        |  376 -
 ica/win32/src/vncKeymap.h                          |   40 -
 ica/win32/src/vncPasswd.h                          |  104 -
 ica/win32/src/vncRegion.cpp                        |  206 -
 ica/win32/src/vncRegion.h                          |   76 -
 ica/win32/src/vncServer.cpp                        | 1744 --
 ica/win32/src/vncServer.h                          |  466 -
 ica/win32/src/vncService.cpp                       | 1430 --
 ica/win32/src/vncService.h                         |  149 -
 ica/win32/src/vncSockConnect.cpp                   |  141 -
 ica/win32/src/vncSockConnect.h                     |   69 -
 ica/win32/src/vncTimedMsgBox.h                     |   44 -
 ica/win32/src/vncauth.h                            |   39 -
 ica/win32/src/vncauth_w32.c                        |  134 -
 ica/win32/ultravnc-italc.cpp                       |  112 +
 ica/win32/ultravnc.cpp                             |  236 +
 ica/win32/vncCorbaConnect.h                        |    6 -
 ica/win32/vncHTTPConnect.h                         |    3 -
 ica/win32/vncMenu.h                                |   13 -
 ica/win32/win32vnc.cpp                             |  211 -
 ica/win32/winvnc/DSMPlugin/DSMPlugin.cpp           |  525 +
 ica/win32/winvnc/DSMPlugin/DSMPlugin.h             |  194 +
 ica/win32/winvnc/Makefile.bcc32                    |  117 +
 ica/win32/winvnc/building.txt                      |   40 +
 .../qplatformdefs.h => ica/win32/winvnc/crtdbg.h   |    0
 ica/win32/winvnc/history.txt                       |  740 +
 ica/win32/winvnc/libjpeg-turbo-win/jpeglib.h       |    2 +
 ica/win32/winvnc/lzo/minilzo.h                     |    2 +
 ica/win32/winvnc/omnithread/nt.cpp                 |  965 +
 ica/win32/winvnc/omnithread/nt.h                   |   82 +
 ica/win32/winvnc/omnithread/omnithread.h           |  659 +
 ica/win32/winvnc/omnithread/threaddata.cpp         |   83 +
 ica/win32/winvnc/rfb/zrleEncode.h                  |  352 +
 ica/win32/winvnc/rfb/zywrletemplate.c              |  804 +
 ica/win32/winvnc/vnchooks/Makefile.bcc32           |    9 +
 ica/win32/winvnc/vnchooks/SharedData.cpp           |   42 +
 ica/win32/winvnc/vnchooks/SharedData.h             |   33 +
 ica/win32/winvnc/vnchooks/VNCHooks-bcc32.def       |    7 +
 ica/win32/winvnc/vnchooks/VNCHooks-vc.def          |    7 +
 ica/win32/winvnc/vnchooks/VNCHooks.cpp             | 1180 +
 ica/win32/winvnc/vnchooks/VNCHooks.def             |    7 +
 ica/win32/winvnc/vnchooks/VNCHooks.h               |   73 +
 ica/win32/winvnc/vnchooks/resource.h               |   15 +
 ica/win32/winvnc/vnchooks/vnchooks.dsp             |  123 +
 ica/win32/winvnc/vnchooks/vnchooks.rc              |  109 +
 ica/win32/winvnc/vnchooks/vnchooks.vcproj          |  717 +
 ica/win32/winvnc/vnchooks/vnchooksVS2005.vcproj    |  505 +
 .../winvnc/vnchooks/vnchooks_vs90_Debug_Win32.lnt  |   12 +
 .../vnchooks/vnchooks_vs90_Release_Win32.lnt       |   12 +
 ica/win32/winvnc/winvnc.dsw                        |  260 +
 ica/win32/winvnc/winvnc.sln                        |  345 +
 ica/win32/winvnc/winvnc.sln.vloptions              |    2 +
 ica/win32/winvnc/winvnc/CpuUsage.cpp               |  215 +
 ica/win32/winvnc/winvnc/CpuUsage.h                 |   89 +
 ica/win32/winvnc/winvnc/Dtwinver.cpp               | 2074 ++
 ica/win32/winvnc/winvnc/Dtwinver.h                 |  363 +
 ica/win32/winvnc/winvnc/HideDesktop.cpp            |  425 +
 ica/win32/winvnc/winvnc/HideDesktop.h              |   56 +
 ica/win32/winvnc/winvnc/IPC.cpp                    |  200 +
 ica/win32/winvnc/winvnc/IPC.h                      |   62 +
 ica/win32/winvnc/winvnc/Localization.h             |  202 +
 ica/win32/winvnc/winvnc/TextChat.cpp               |  852 +
 ica/win32/winvnc/winvnc/TextChat.h                 |   76 +
 ica/win32/winvnc/winvnc/Timer.cpp                  |   39 +
 ica/win32/winvnc/winvnc/Timer.h                    |  123 +
 ica/win32/winvnc/winvnc/WINVNC.DSW                 |   29 +
 ica/win32/winvnc/winvnc/benchmark.cpp              |  152 +
 ica/win32/winvnc/winvnc/black_layered.cpp          |  334 +
 ica/win32/winvnc/winvnc/buildtime.cpp              |   22 +
 ica/win32/winvnc/winvnc/d3des.c                    |  440 +
 ica/win32/winvnc/winvnc/d3des.h                    |   51 +
 ica/win32/winvnc/winvnc/getinfo.cpp                |  589 +
 ica/win32/winvnc/winvnc/helpers.cpp                |  610 +
 ica/win32/winvnc/winvnc/httpconnect.cpp            | 1485 ++
 ica/win32/winvnc/winvnc/httpconnect.h              |  227 +
 ica/win32/winvnc/winvnc/inifile.cpp                |  213 +
 ica/win32/winvnc/winvnc/inifile.h                  |   64 +
 ica/win32/winvnc/winvnc/initipp.cpp                |  186 +
 ica/win32/winvnc/winvnc/keysymdef.h                | 1595 ++
 ica/win32/winvnc/winvnc/minmax.h                   |   48 +
 ica/win32/winvnc/winvnc/read_write_ini.cpp         |  308 +
 ica/win32/winvnc/winvnc/res/AuthPanel.class        |  Bin 0 -> 2916 bytes
 ica/win32/winvnc/winvnc/res/ButtonPanel.class      |  Bin 0 -> 3209 bytes
 ica/win32/winvnc/winvnc/res/DH.class               |  Bin 0 -> 2404 bytes
 ica/win32/winvnc/winvnc/res/FTPFrame.class         |  Bin 0 -> 20602 bytes
 ica/win32/winvnc/winvnc/res/Finger.cur             |  Bin 0 -> 326 bytes
 ica/win32/winvnc/winvnc/res/RecordingFrame.class   |  Bin 0 -> 5971 bytes
 ica/win32/winvnc/winvnc/res/SessionRecorder.class  |  Bin 0 -> 2642 bytes
 ica/win32/winvnc/winvnc/res/clipboardframe.class   |  Bin 0 -> 2591 bytes
 ica/win32/winvnc/winvnc/res/descipher.class        |  Bin 0 -> 8245 bytes
 ica/win32/winvnc/winvnc/res/ding_dong.wav          |  Bin 0 -> 118662 bytes
 ica/win32/winvnc/winvnc/res/ftpframe$strcomp.class |  Bin 0 -> 618 bytes
 ica/win32/winvnc/winvnc/res/icon2.ico              |  Bin 0 -> 297086 bytes
 ica/win32/winvnc/winvnc/res/optionsframe.class     |  Bin 0 -> 6870 bytes
 ica/win32/winvnc/winvnc/res/rfbproto.class         |  Bin 0 -> 25244 bytes
 ica/win32/winvnc/winvnc/res/runas.bmp              |  Bin 0 -> 124342 bytes
 ica/win32/winvnc/winvnc/res/vnc-1.bmp              |  Bin 0 -> 12342 bytes
 ica/win32/winvnc/winvnc/res/vnccanvas.class        |  Bin 0 -> 21431 bytes
 ica/win32/winvnc/winvnc/res/vncviewer.class        |  Bin 0 -> 16030 bytes
 ica/win32/winvnc/winvnc/res/vncviewer.jar          |  Bin 0 -> 65311 bytes
 ica/win32/winvnc/winvnc/res/world3a.ico            |  Bin 0 -> 297086 bytes
 ica/win32/winvnc/winvnc/resource.h                 |  312 +
 ica/win32/winvnc/winvnc/rfb.h                      |   86 +
 ica/win32/winvnc/winvnc/rfbMisc.h                  |  124 +
 ica/win32/winvnc/winvnc/rfbRect.h                  |  117 +
 ica/win32/winvnc/winvnc/rfbRegion.h                |   31 +
 ica/win32/winvnc/winvnc/rfbRegion_X11.cxx          |  210 +
 ica/win32/winvnc/winvnc/rfbRegion_X11.h            |   87 +
 ica/win32/winvnc/winvnc/rfbRegion_win32.cpp        |  280 +
 ica/win32/winvnc/winvnc/rfbRegion_win32.h          |   93 +
 ica/win32/winvnc/winvnc/rfbUpdateTracker.cpp       |  224 +
 ica/win32/winvnc/winvnc/rfbUpdateTracker.h         |  112 +
 ica/win32/winvnc/winvnc/security.cpp               |  158 +
 ica/win32/winvnc/winvnc/service.cpp                | 1065 +
 ica/win32/winvnc/winvnc/service_motor.cpp          |  898 +
 ica/win32/winvnc/winvnc/stdhdrs.cpp                |   28 +
 ica/win32/winvnc/winvnc/stdhdrs.h                  |  104 +
 ica/win32/winvnc/winvnc/tableinitcmtemplate.cpp    |   96 +
 ica/win32/winvnc/winvnc/tableinittctemplate.cpp    |  122 +
 ica/win32/winvnc/winvnc/tabletranstemplate.cpp     |   96 +
 ica/win32/winvnc/winvnc/translate.cpp              |  184 +
 ica/win32/winvnc/winvnc/translate.h                |   81 +
 ica/win32/winvnc/winvnc/videodriver.cpp            |  977 +
 ica/win32/winvnc/winvnc/videodriver.h              |  103 +
 ica/win32/winvnc/winvnc/videodrivercheck.cpp       |  177 +
 ica/win32/winvnc/winvnc/vistahook.cpp              |  481 +
 ica/win32/winvnc/winvnc/vncDesktopSW.cpp           |  226 +
 ica/win32/winvnc/winvnc/vncEncodeTight.cpp         | 1614 ++
 ica/win32/winvnc/winvnc/vncEncodeTight.h           |  199 +
 ica/win32/winvnc/winvnc/vncEncodeUltra.cpp         |  406 +
 ica/win32/winvnc/winvnc/vncEncodeUltra.h           |  107 +
 ica/win32/winvnc/winvnc/vncEncodeUltra2.cpp        |  319 +
 ica/win32/winvnc/winvnc/vncEncodeUltra2.h          |   74 +
 ica/win32/winvnc/winvnc/vncEncodeZlib.cpp          |  683 +
 ica/win32/winvnc/winvnc/vncEncodeZlib.h            |  123 +
 ica/win32/winvnc/winvnc/vncEncodeZlibHex.cpp       |  645 +
 ica/win32/winvnc/winvnc/vncEncodeZlibHex.h         |  114 +
 ica/win32/winvnc/winvnc/vncListDlg.cpp             |  169 +
 ica/win32/winvnc/winvnc/vncListDlg.h               |   47 +
 ica/win32/winvnc/winvnc/vncMultiMonitor.cpp        |  156 +
 ica/win32/winvnc/winvnc/vncOSVersion.cpp           |   63 +
 ica/win32/winvnc/winvnc/vncOSVersion.h             |   30 +
 ica/win32/winvnc/winvnc/vncabout.cpp               |  220 +
 ica/win32/winvnc/winvnc/vncabout.h                 |   58 +
 ica/win32/winvnc/winvnc/vncacceptdialog.cpp        |  204 +
 ica/win32/winvnc/winvnc/vncacceptdialog.h          |   73 +
 ica/win32/winvnc/winvnc/vncauth.c                  |  187 +
 ica/win32/winvnc/winvnc/vncauth.h                  |   48 +
 ica/win32/winvnc/winvnc/vncbuffer.cpp              | 1201 +
 ica/win32/winvnc/winvnc/vncbuffer.h                |  158 +
 ica/win32/winvnc/winvnc/vncclient.cpp              | 6099 ++++++
 ica/win32/winvnc/winvnc/vncclient.h                |  605 +
 ica/win32/winvnc/winvnc/vncconndialog.cpp          |  402 +
 ica/win32/winvnc/winvnc/vncconndialog.h            |   69 +
 ica/win32/winvnc/winvnc/vncdesktop.cpp             | 2459 +++
 ica/win32/winvnc/winvnc/vncdesktop.h               |  537 +
 ica/win32/winvnc/winvnc/vncdesktopsink.cpp         |  751 +
 ica/win32/winvnc/winvnc/vncdesktopthread.cpp       | 1334 ++
 ica/win32/winvnc/winvnc/vncdesktopthread.h         |  132 +
 ica/win32/winvnc/winvnc/vncencodecorre.cpp         |  522 +
 ica/win32/winvnc/winvnc/vncencodecorre.h           |   81 +
 ica/win32/winvnc/winvnc/vncencodehext.cpp          |  411 +
 ica/win32/winvnc/winvnc/vncencodehext.h            |   72 +
 ica/win32/winvnc/winvnc/vncencodemgr.h             |  923 +
 ica/win32/winvnc/winvnc/vncencoder.cpp             |  445 +
 ica/win32/winvnc/winvnc/vncencoder.h               |  139 +
 ica/win32/winvnc/winvnc/vncencoderCursor.cpp       |  280 +
 ica/win32/winvnc/winvnc/vncencoderre.cpp           |  333 +
 ica/win32/winvnc/winvnc/vncencoderre.h             |   66 +
 ica/win32/winvnc/winvnc/vncencodezrle.cpp          |  221 +
 ica/win32/winvnc/winvnc/vncencodezrle.h            |   49 +
 ica/win32/winvnc/winvnc/vnchttpconnect.cpp         |  664 +
 ica/win32/winvnc/winvnc/vnchttpconnect.h           |   70 +
 ica/win32/winvnc/winvnc/vncinsthandler.cpp         |   65 +
 ica/win32/winvnc/winvnc/vncinsthandler.h           |   52 +
 ica/win32/winvnc/winvnc/vnckeymap.cpp              |  832 +
 ica/win32/winvnc/winvnc/vnckeymap.h                |   37 +
 ica/win32/winvnc/winvnc/vnclog.cpp                 |  302 +
 ica/win32/winvnc/winvnc/vnclog.h                   |  109 +
 ica/win32/winvnc/winvnc/vnclogon.cpp               |  143 +
 ica/win32/winvnc/winvnc/vnclogon.h                 |   25 +
 ica/win32/winvnc/winvnc/vncmemcpy.h                |   57 +
 ica/win32/winvnc/winvnc/vncmenu.cpp                | 2012 ++
 ica/win32/winvnc/winvnc/vncmenu.h                  |  140 +
 ica/win32/winvnc/winvnc/vncntlm.cpp                | 1127 +
 ica/win32/winvnc/winvnc/vncpasswd.h                |  106 +
 ica/win32/winvnc/winvnc/vncproperties.cpp          | 2612 +++
 ica/win32/winvnc/winvnc/vncproperties.h            |  185 +
 ica/win32/winvnc/winvnc/vncpropertiesPoll.cpp      | 1049 +
 ica/win32/winvnc/winvnc/vncpropertiesPoll.h        |  119 +
 ica/win32/winvnc/winvnc/vncserver.cpp              | 2723 +++
 ica/win32/winvnc/winvnc/vncserver.h                |  614 +
 ica/win32/winvnc/winvnc/vncservice.cpp             |  953 +
 ica/win32/winvnc/winvnc/vncservice.h               |  122 +
 ica/win32/winvnc/winvnc/vncsetauth.cpp             |  685 +
 ica/win32/winvnc/winvnc/vncsetauth.h               |   98 +
 ica/win32/winvnc/winvnc/vncsockconnect.cpp         |  227 +
 ica/win32/winvnc/winvnc/vncsockconnect.h           |   68 +
 ica/win32/winvnc/winvnc/vnctimedmsgbox.cpp         |   84 +
 ica/win32/winvnc/winvnc/vnctimedmsgbox.h           |   42 +
 ica/win32/winvnc/winvnc/vsocket.cpp                | 1143 +
 ica/win32/winvnc/winvnc/vsocket.h                  |  224 +
 ica/win32/winvnc/winvnc/vtypes.h                   |   87 +
 ica/win32/winvnc/winvnc/winvnc.cpp                 | 1129 +
 ica/win32/winvnc/winvnc/winvnc.dsp                 |  791 +
 ica/win32/winvnc/winvnc/winvnc.exe.manifest        |   31 +
 ica/win32/winvnc/winvnc/winvnc.exe.x64.manifest    |   15 +
 ica/win32/winvnc/winvnc/winvnc.exe.x86.manifest    |   31 +
 ica/win32/winvnc/winvnc/winvnc.h                   |  104 +
 ica/win32/winvnc/winvnc/winvnc.rc                  |  708 +
 ica/win32/winvnc/winvnc/winvnc.vcproj              | 4444 ++++
 ica/win32/winvnc/winvnc/winvncVS2005.vcproj        | 3213 +++
 ica/win32/winvnc/winvnc/winvnc_fr.rc               |  686 +
 .../winvnc/winvnc/winvnc_vs90_Release_Win32.lnt    |   80 +
 ica/win32/winvnc/winvncvs2005.sln                  |  681 +
 ica/win32/{ => winvnc}/zlib/zlib.h                 |    0
 ica/x11/AUTHORS                                    |   50 +
 ica/x11/ChangeLog                                  | 6672 ++++++
 ica/x11/{libvncserver => common}/d3des.c           |    0
 ica/x11/{libvncserver => common}/d3des.h           |    0
 ica/x11/common/lzoconf.h                           |  446 +
 ica/x11/common/lzodefs.h                           | 1852 ++
 ica/x11/common/minilzo.c                           | 4562 ++++
 ica/x11/common/minilzo.h                           |  109 +
 ica/x11/common/vncauth.c                           |  211 +
 ica/x11/common/zywrletemplate.c                    |  828 +
 ica/x11/libvncclient/listen.c                      |    1 +
 ica/x11/libvncclient/minilzo.c                     | 2935 ---
 ica/x11/libvncclient/rfbproto.c                    |  311 +-
 ica/x11/libvncclient/sockets.c                     |   62 +-
 ica/x11/libvncclient/tls.c                         |   59 +-
 ica/x11/libvncclient/ultra.c                       |   10 +-
 ica/x11/libvncclient/vncviewer.c                   |    4 +
 ica/x11/libvncclient/zrle.c                        |    4 +-
 ica/x11/libvncserver/auth.c                        |   18 +-
 ica/x11/libvncserver/corre.c                       |   88 +-
 ica/x11/libvncserver/httpd.c                       |    3 +
 ica/x11/libvncserver/main.c                        |   82 +-
 ica/x11/libvncserver/private.h                     |    9 -
 ica/x11/libvncserver/rfbserver.c                   |  102 +-
 ica/x11/libvncserver/rre.c                         |   90 +-
 ica/x11/libvncserver/scale.c                       |    2 +-
 ica/x11/libvncserver/scale.h                       |    2 +-
 ica/x11/libvncserver/sockets.c                     |   92 +-
 ica/x11/libvncserver/stats.c                       |    4 +-
 ica/x11/libvncserver/ultra.c                       |   63 +-
 ica/x11/libvncserver/vncauth.c                     |  208 -
 ica/x11/libvncserver/zrle.c                        |    3 -
 ica/x11/libvncserver/zrleencodetemplate.c          |    6 -
 ica/x11/libvncserver/zywrletemplate.c              |  824 -
 ica/x11/x11vnc.c                                   |   46 +-
 ica/x11/x11vnc/8to24.c                             |    8 +-
 ica/x11/x11vnc/ChangeLog                           |   38 +-
 ica/x11/x11vnc/README                              |  688 +-
 ica/x11/x11vnc/RELEASE-NOTES                       | 1553 ++
 ica/x11/x11vnc/appshare.c                          |    8 +-
 ica/x11/x11vnc/avahi.c                             |    1 -
 ica/x11/x11vnc/cleanup.c                           |   17 +-
 ica/x11/x11vnc/connections.c                       |   82 +
 ica/x11/x11vnc/connections.h                       |    1 +
 ica/x11/x11vnc/enc.h                               |    3 +-
 ica/x11/x11vnc/gui.c                               |    8 +-
 ica/x11/x11vnc/help.c                              |  236 +-
 ica/x11/x11vnc/inet.c                              |   57 +
 ica/x11/x11vnc/inet.h                              |    2 +
 ica/x11/x11vnc/keyboard.c                          |   24 +-
 ica/x11/x11vnc/keyboard.h                          |    2 +-
 ica/x11/x11vnc/linuxfb.c                           |    1 +
 ica/x11/x11vnc/macosx.c                            |   36 +-
 ica/x11/x11vnc/macosxCG.c                          |  425 +-
 ica/x11/x11vnc/macosxCG.h                          |    2 +-
 ica/x11/x11vnc/macosx_opengl.c                     |  176 +
 ica/x11/x11vnc/macosx_opengl.h                     |   41 +
 ica/x11/x11vnc/options.c                           |    6 +
 ica/x11/x11vnc/options.h                           |    6 +
 ica/x11/x11vnc/pointer.c                           |   10 +-
 ica/x11/x11vnc/rates.c                             |    7 +
 ica/x11/x11vnc/remote.c                            |   42 +-
 ica/x11/x11vnc/scan.c                              |   16 +-
 ica/x11/x11vnc/screen.c                            |   49 +-
 ica/x11/x11vnc/sslcmds.c                           |    8 +
 ica/x11/x11vnc/sslhelper.c                         |   20 +-
 ica/x11/x11vnc/ssltools.h                          |   71 +-
 ica/x11/x11vnc/uinput.c                            |  401 +-
 ica/x11/x11vnc/uinput.h                            |    1 +
 ica/x11/x11vnc/unixpw.c                            |   10 +-
 ica/x11/x11vnc/user.c                              |    9 +
 ica/x11/x11vnc/util.c                              |   25 +
 ica/x11/x11vnc/util.h                              |    4 +-
 ica/x11/x11vnc/v4l.c                               |   18 +-
 ica/x11/x11vnc/x11vnc.1                            |  251 +-
 ica/x11/x11vnc/x11vnc.c                            |   83 +-
 ica/x11/x11vnc/x11vnc.h                            |   49 +-
 ica/x11/x11vnc/x11vnc_defs.c                       |    4 +-
 ica/x11/x11vnc/xevents.c                           |    1 +
 ica/x11/x11vnc/xevents.h                           |    1 +
 ica/x11/x11vnc/xrecord.c                           |    6 +-
 ica/x11/x11vnc/xrecord.h                           |    2 +-
 ica/x11/x11vnc/xwrappers.c                         |   55 +-
 ima/CMakeLists.txt                                 |   30 +
 ima/Makefile.am                                    |  129 -
 ima/Makefile.in                                    | 1061 -
 ima/dialogs/ClientSettingsDialog.ui                |  250 +
 ima/dialogs/Config.ui                              |  572 +
 ima/dialogs/MainWindow.ui                          |    5 +-
 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/dialogs/about.ui                               |  230 -
 ima/dialogs/client_settings.ui                     |  609 -
 ima/dialogs/config.ui                              |  677 -
 ima/dialogs/overview.ui                            |  214 -
 ima/dialogs/remote_logon.ui                        |  270 -
 ima/dialogs/snapshots.ui                           |  135 -
 ima/dialogs/support.ui                             |  194 -
 ima/dialogs/text_message.ui                        |  189 -
 ima/italc.1                                        |    4 +-
 ima/italc.qrc                                      |   18 -
 ima/italc.rc                                       |   26 +
 ima/italc.rc.in                                    |    2 +-
 ima/resources/analog.png                           |  Bin 10528 -> 0 bytes
 ima/resources/apply.png                            |  Bin 1266 -> 0 bytes
 ima/resources/demoquality.png                      |  Bin 803 -> 0 bytes
 ima/resources/high.png                             |  Bin 886 -> 0 bytes
 ima/resources/isdn.png                             |  Bin 1198 -> 0 bytes
 ima/resources/lan.png                              |  Bin 3975 -> 0 bytes
 ima/resources/low.png                              |  Bin 850 -> 0 bytes
 ima/resources/medium.png                           |  Bin 855 -> 0 bytes
 ima/resources/modem.png                            |  Bin 3772 -> 0 bytes
 ima/resources/ok.png                               |  Bin 808 -> 0 bytes
 ima/resources/reload.png                           |  Bin 9077 -> 0 bytes
 ima/resources/splash.png                           |  Bin 63631 -> 42774 bytes
 ima/resources/vpn.png                              |  Bin 1397 -> 0 bytes
 ima/resources/{fullscreen.png => window.png}       |  Bin 1010 -> 1010 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                                |  244 +
 ima/src/Dialogs.h                                  |  152 +
 ima/src/MainToolBar.cpp                            |    4 -
 ima/src/MainWindow.cpp                             |  277 +-
 ima/src/MainWindow.h                               |   76 +-
 ima/src/OverviewWidget.cpp                         |   47 +
 ima/src/OverviewWidget.h                           |   42 +
 ima/src/RemoteControlWidget.cpp                    |  419 +
 ima/src/RemoteControlWidget.h                      |  123 +
 ima/src/RunCommandsDialog.cpp                      |   53 +
 ima/src/RunCommandsDialog.h                        |   48 +
 ima/src/SideBar.cpp                                |    5 -
 ima/src/SideBarWidget.cpp                          |    8 +-
 ima/src/SideBarWidget.h                            |    6 +-
 ima/src/SnapshotList.cpp                           |  135 +
 ima/src/SnapshotList.h                             |   61 +
 ima/src/ToolButton.cpp                             |  446 +
 ima/src/ToolButton.h                               |  143 +
 ima/src/classroom_manager.cpp                      | 2225 --
 ima/src/classroom_manager.h                        |  348 -
 ima/src/client.cpp                                 | 1328 --
 ima/src/client.h                                   |  411 -
 ima/src/cmd_input_dialog.cpp                       |  108 -
 ima/src/cmd_input_dialog.h                         |   61 -
 ima/src/config_widget.cpp                          |  139 -
 ima/src/config_widget.h                            |   50 -
 ima/src/dialogs.cpp                                |  184 -
 ima/src/dialogs.h                                  |  158 -
 ima/src/local_system_ima.cpp                       |   55 -
 ima/src/local_system_ima.h                         |   36 -
 ima/src/main.cpp                                   |   99 +-
 ima/src/overview_widget.cpp                        |   49 -
 ima/src/overview_widget.h                          |   42 -
 ima/src/remote_control_widget.cpp                  |  385 -
 ima/src/remote_control_widget.h                    |  123 -
 ima/src/snapshot_list.cpp                          |  176 -
 ima/src/snapshot_list.h                            |   69 -
 ima/src/tool_button.cpp                            |  447 -
 ima/src/tool_button.h                              |  142 -
 imc/CMakeLists.txt                                 |   31 +
 imc/Forms/KeyFileAssistant.ui                      |  973 +
 imc/Forms/LogonGroupEditor.ui                      |  214 +
 imc/Forms/MainWindow.ui                            | 1633 ++
 imc/Resources/Authentication.png                   |  Bin 0 -> 2696 bytes
 imc/Resources/General.png                          |  Bin 0 -> 4042 bytes
 imc/Resources/Paths.png                            |  Bin 0 -> 1592 bytes
 imc/Resources/Vnc.png                              |  Bin 0 -> 4331 bytes
 imc/Resources/arrow-right.png                      |  Bin 0 -> 527 bytes
 imc/Resources/document-open.png                    |  Bin 0 -> 639 bytes
 imc/Resources/document-save.png                    |  Bin 0 -> 563 bytes
 imc/Resources/edit-clear.png                       |  Bin 0 -> 802 bytes
 imc/Resources/go-next.png                          |  Bin 0 -> 721 bytes
 imc/Resources/go-previous.png                      |  Bin 0 -> 634 bytes
 imc/Resources/help-hint.png                        |  Bin 0 -> 2925 bytes
 imc/Resources/imc.ico                              |  Bin 0 -> 122726 bytes
 imc/Resources/imc.png                              |  Bin 0 -> 17432 bytes
 imc/Resources/kbugbuster.png                       |  Bin 0 -> 3166 bytes
 imc/Resources/preferences-other.png                |  Bin 0 -> 945 bytes
 imc/Resources/system-shutdown.png                  |  Bin 0 -> 775 bytes
 imc/Resources/task-accepted.png                    |  Bin 0 -> 924 bytes
 imc/Resources/tools-wizard.png                     |  Bin 0 -> 797 bytes
 imc/imc.qrc                                        |   21 +
 imc/imc.rc                                         |   26 +
 imc/imc.rc.in                                      |   26 +
 imc/src/FileSystemBrowser.cpp                      |  101 +
 imc/src/FileSystemBrowser.h                        |   74 +
 imc/src/ImcCore.cpp                                |  248 +
 imc/src/ImcCore.h                                  |   57 +
 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                             |  674 +
 imc/src/MainWindow.h                               |   79 +
 imc/src/SystemConfigurationModifier.cpp            |  582 +
 imc/src/SystemConfigurationModifier.h              |   41 +
 imc/src/Win32AclEditor.cpp                         |  157 +
 imc/src/Win32AclEditor.h                           |   58 +
 imc/src/main.cpp                                   |  233 +
 imc/src/netfw.h                                    | 4563 ++++
 install-sh                                         |  520 -
 italcconfig.h.in                                   |  106 +
 lib/CMakeLists.txt                                 |   45 +
 lib/ItalcCore.qrc                                  |   51 +
 lib/Makefile.am                                    |  125 -
 lib/Makefile.in                                    |  901 -
 lib/dialogs/AboutDialog.ui                         |  262 +
 lib/dialogs/PasswordDialog.ui                      |  136 +
 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                  |  100 +
 lib/include/Configuration/UiMapping.h              |   78 +
 lib/include/Configuration/XmlStore.h               |   53 +
 lib/include/DecoratedMessageBox.h                  |   55 +
 lib/include/DsaKey.h                               |  161 +
 lib/include/FastQImage.h                           |  222 +
 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/ItalcConfiguration.h                   |  129 +
 lib/include/ItalcCore.h                            |  169 +
 lib/include/ItalcCoreConnection.h                  |  132 +
 lib/include/ItalcRfbExt.h                          |   82 +
 lib/include/ItalcVncConnection.h                   |  246 +
 lib/include/LocalSystem.h                          |  200 +
 lib/include/LockWidget.h                           |   63 +
 lib/include/Logger.h                               |  128 +
 lib/include/LogonAuthentication.h                  |   37 +
 lib/include/PasswordDialog.h                       |   56 +
 lib/include/ProgressWidget.h                       |   61 +
 lib/include/QtUserEvents.h                         |   55 +
 lib/include/QuadTree.h                             |    4 +
 lib/include/Snapshot.h                             |   73 +
 lib/include/SocketDevice.h                         |  117 +
 lib/include/SystemKeyTrapper.h                     |   90 +
 lib/include/VncView.h                              |  151 +
 lib/include/debug.h                                |   38 -
 lib/include/dsa_key.h                              |  161 -
 lib/include/fast_qimage.h                          |  220 -
 lib/include/inject.h                               |   44 -
 lib/include/isd_base.h                             |  292 -
 lib/include/isd_connection.h                       |  171 -
 lib/include/italc_rfb_ext.h                        |   97 -
 lib/include/ivs_connection.h                       |  259 -
 lib/include/local_system.h                         |  104 -
 lib/include/lock_widget.h                          |   74 -
 lib/include/lzoconf.h                              |  417 -
 lib/include/lzodefs.h                              | 1807 --
 lib/include/messagebox.h                           |   65 -
 lib/include/minilzo.h                              |  106 -
 lib/include/progress_widget.h                      |   61 -
 lib/include/qt_features.h                          |   50 -
 lib/include/qt_user_events.h                       |   57 -
 lib/include/rfb/dh.h                               |   83 +
 lib/include/rfb/rfb.h                              |   23 +-
 lib/include/rfb/rfbclient.h                        |   11 +-
 lib/include/rfb/rfbint.h                           |   17 +
 lib/include/rfb/rfbproto.h                         |  162 +-
 lib/include/system_key_trapper.h                   |   87 -
 lib/include/types.h                                |   54 -
 lib/include/vncview.h                              |  173 -
 lib/italc_core.qrc                                 |   64 -
 {ima => lib}/resources/authors.png                 |  Bin 1383 -> 1383 bytes
 lib/resources/ca.qm                                |  Bin 75680 -> 0 bytes
 lib/resources/ca.ts                                | 1427 --
 lib/resources/cs.qm                                |  Bin 71920 -> 39561 bytes
 lib/resources/cs.ts                                | 1837 +-
 lib/resources/de.qm                                |  Bin 68878 -> 74498 bytes
 lib/resources/de.ts                                | 1819 +-
 lib/resources/el.qm                                |  Bin 75699 -> 46828 bytes
 lib/resources/el.ts                                | 1847 +-
 lib/resources/es.qm                                |  Bin 78320 -> 41239 bytes
 lib/resources/es.ts                                | 1878 +-
 lib/resources/fi.qm                                |  Bin 62714 -> 42907 bytes
 lib/resources/fi.ts                                | 1814 +-
 lib/resources/fr.qm                                |  Bin 79164 -> 44879 bytes
 lib/resources/fr.ts                                | 1874 +-
 lib/resources/he.qm                                |  Bin 69852 -> 0 bytes
 lib/resources/he.ts                                | 1463 --
 ima/resources/logo.png => lib/resources/icon64.png |  Bin 3975 -> 3975 bytes
 lib/resources/it.qm                                |  Bin 77479 -> 80570 bytes
 lib/resources/it.ts                                | 1840 +-
 {ima => lib}/resources/license.png                 |  Bin 3626 -> 3626 bytes
 {ima => lib}/resources/locale.png                  |  Bin 1559 -> 1559 bytes
 lib/resources/nl.qm                                |    1 +
 lib/resources/nl.ts                                | 1751 ++
 lib/resources/nn.qm                                |  Bin 72258 -> 28313 bytes
 lib/resources/nn.ts                                | 1842 +-
 lib/resources/pl.qm                                |  Bin 73790 -> 41165 bytes
 lib/resources/pl.ts                                | 1865 +-
 lib/resources/pt_br.qm                             |  Bin 68676 -> 67015 bytes
 lib/resources/pt_br.ts                             | 1860 +-
 lib/resources/qt_ar.qm                             |  Bin 34743 -> 0 bytes
 lib/resources/qt_ca.qm                             |  Bin 79766 -> 0 bytes
 lib/resources/qt_da.qm                             |  Bin 113560 -> 0 bytes
 lib/resources/qt_de.qm                             |  Bin 273899 -> 0 bytes
 lib/resources/qt_es.qm                             |  Bin 82602 -> 0 bytes
 lib/resources/qt_fr.qm                             |  Bin 161917 -> 0 bytes
 lib/resources/qt_iw.qm                             |  Bin 26226 -> 0 bytes
 lib/resources/qt_ja_JP.qm                          |  Bin 128199 -> 0 bytes
 lib/resources/qt_pl.qm                             |  Bin 241844 -> 0 bytes
 lib/resources/qt_pt.qm                             |  Bin 70301 -> 0 bytes
 lib/resources/qt_ru.qm                             |  Bin 169673 -> 0 bytes
 lib/resources/qt_sk.qm                             |  Bin 77113 -> 0 bytes
 lib/resources/qt_sl.qm                             |  Bin 165791 -> 0 bytes
 lib/resources/qt_sv.qm                             |  Bin 65830 -> 0 bytes
 lib/resources/qt_uk.qm                             |  Bin 79110 -> 0 bytes
 lib/resources/qt_zh_CN.qm                          |  Bin 112483 -> 0 bytes
 lib/resources/qt_zh_TW.qm                          |  Bin 112498 -> 0 bytes
 lib/resources/ru.qm                                |  Bin 73387 -> 45853 bytes
 lib/resources/ru.ts                                | 1869 +-
 lib/resources/sk.qm                                |  Bin 72449 -> 39352 bytes
 lib/resources/sk.ts                                | 1837 +-
 lib/resources/sl.qm                                |  Bin 65960 -> 39934 bytes
 lib/resources/sl.ts                                | 1805 +-
 lib/resources/sr_SR.qm                             |  Bin 80557 -> 0 bytes
 lib/resources/sr_SR.ts                             | 1431 --
 lib/resources/sv.qm                                |  Bin 834 -> 63325 bytes
 lib/resources/sv.ts                                | 1700 +-
 lib/resources/tr.qm                                |  Bin 63445 -> 44541 bytes
 lib/resources/tr.ts                                | 1805 +-
 lib/resources/uk.qm                                |  Bin 79699 -> 81737 bytes
 lib/resources/uk.ts                                | 1824 +-
 lib/resources/zh_cn.qm                             |  Bin 51100 -> 30420 bytes
 lib/resources/zh_cn.ts                             | 1801 +-
 lib/resources/zh_tw.qm                             |  Bin 0 -> 56587 bytes
 lib/resources/zh_tw.ts                             | 1781 ++
 lib/src/3rdparty/XEventLog.cpp                     |  428 +
 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                    |  142 +
 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                    |  123 +
 lib/src/Ipc/Slave.cpp                              |  126 +
 lib/src/Ipc/SlaveLauncher.cpp                      |   63 +
 lib/src/ItalcConfiguration.cpp                     |  125 +
 lib/src/ItalcCore.cpp                              |  314 +
 lib/src/ItalcCoreConnection.cpp                    |  354 +
 lib/src/ItalcVncConnection.cpp                     |  868 +
 lib/src/LocalSystem.cpp                            | 1179 +
 lib/src/LockWidget.cpp                             |  157 +
 lib/src/Logger.cpp                                 |  253 +
 lib/src/LogonAuthentication.cpp                    |   94 +
 lib/src/PasswordDialog.cpp                         |  100 +
 lib/src/ProgressWidget.cpp                         |  102 +
 lib/src/Snapshot.cpp                               |  160 +
 lib/src/SystemKeyTrapper.cpp                       |  380 +
 lib/src/VncView.cpp                                |  819 +
 lib/src/dh.cpp                                     |  178 +
 lib/src/dsa_key.cpp                                |  860 -
 lib/src/fast_qimage.cpp                            |  865 -
 lib/src/inject.cpp                                 |  654 -
 lib/src/isd_base.cpp                               |  106 -
 lib/src/isd_connection.cpp                         | 1037 -
 lib/src/ivs_connection.cpp                         | 1837 --
 lib/src/local_system.cpp                           |  858 -
 lib/src/lock_widget.cpp                            |  152 -
 lib/src/messagebox.cpp                             |  140 -
 lib/src/minilzo.c                                  | 4112 ----
 lib/src/progress_widget.cpp                        |  110 -
 lib/src/system_key_trapper.cpp                     |  311 -
 lib/src/vncview.cpp                                |  846 -
 ltmain.sh                                          | 8413 -------
 m4/libtool.m4                                      | 7377 -------
 m4/ltoptions.m4                                    |  368 -
 m4/ltsugar.m4                                      |  123 -
 m4/ltversion.m4                                    |   23 -
 m4/lt~obsolete.m4                                  |   92 -
 missing                                            |  376 -
 nsis/header.bmp                                    |  Bin 0 -> 34254 bytes
 nsis/welcome-page.bmp                              |  Bin 0 -> 206038 bytes
 setup/Makefile.am                                  |   60 -
 setup/Makefile.in                                  |  593 -
 setup/dialogs/page_key_dirs.ui                     |  359 -
 setup/dialogs/page_security_options.ui             |  286 -
 setup/dialogs/page_setup_finished.ui               |  166 -
 setup/dialogs/page_welcome.ui                      |  165 -
 setup/dialogs/wizard.ui                            |  119 -
 setup/resources/back.png                           |  Bin 809 -> 0 bytes
 setup/resources/cancel.png                         |  Bin 842 -> 0 bytes
 setup/resources/fileopen.png                       |  Bin 1356 -> 0 bytes
 setup/resources/next.png                           |  Bin 1188 -> 0 bytes
 setup/resources/page_artwork_welcome.png           |  Bin 16742 -> 0 bytes
 setup/resources/page_security_options.png          |  Bin 24105 -> 0 bytes
 setup/resources/page_setup_finished.png            |  Bin 20868 -> 0 bytes
 setup/resources/setup.png                          |  Bin 2842 -> 0 bytes
 setup/resources/usbdrive.png                       |  Bin 2251 -> 0 bytes
 setup/setup.ico                                    |  Bin 39438 -> 0 bytes
 setup/setup.qrc                                    |   14 -
 setup/setup.rc.in                                  |   26 -
 setup/src/dialogs.cpp                              |  616 -
 setup/src/dialogs.h                                |  175 -
 setup/src/main.cpp                                 |   87 -
 tightvnc4win_integrate                             |   97 -
 tightvnc4win_italc.diff                            |  800 -
 918 files changed, 179587 insertions(+), 131949 deletions(-)
 create mode 100644 CMakeLists.txt
 delete mode 100644 Makefile.am
 delete mode 100644 Makefile.in
 delete mode 100644 NEWS
 delete mode 100644 acinclude.m4
 delete mode 100644 aclocal.m4
 create mode 100644 cmake/modules/DetectMachine.cmake
 create mode 100644 cmake/modules/FindPAM.cmake
 create mode 100644 cmake/modules/MinGWCrossCompile.cmake
 create mode 100644 cmake/modules/Qt4Hacks.cmake
 create mode 100644 cmake/modules/Win32Toolchain.cmake
 create mode 100644 cmake/modules/Win64Toolchain.cmake
 delete mode 100755 config.guess
 delete mode 100644 config.h.in
 delete mode 100755 config.sub
 delete mode 100755 configure
 delete mode 100644 configure.in
 create mode 100644 contrib/README.txt
 create mode 100644 contrib/en-US/italc.adml
 create mode 100644 contrib/italc.admx
 delete mode 100755 depcomp
 create mode 100644 doc/AutomatedSetupWithIMC.txt
 create mode 100644 doc/ControllingIMCAtTheCommandline.txt
 create mode 100644 doc/CrossCompilingForWindows.txt
 create mode 100644 doc/UsingPathVariables.txt
 create mode 100644 ica/CMakeLists.txt
 create mode 100644 ica/JavaViewer/AuthPanel.java
 create mode 100644 ica/JavaViewer/ButtonPanel.java
 create mode 100644 ica/JavaViewer/ChangeLog
 create mode 100644 ica/JavaViewer/ClipboardFrame.java
 create mode 100644 ica/JavaViewer/DH.java
 create mode 100644 ica/JavaViewer/DesCipher.java
 create mode 100644 ica/JavaViewer/FTPFrame.java
 create mode 100644 ica/JavaViewer/LICENCE.TXT
 create mode 100644 ica/JavaViewer/MANIFEST.MF
 create mode 100644 ica/JavaViewer/OptionsFrame.java
 create mode 100644 ica/JavaViewer/README
 create mode 100644 ica/JavaViewer/RecordingFrame.java
 create mode 100644 ica/JavaViewer/RfbProto.java
 create mode 100644 ica/JavaViewer/SessionRecorder.java
 create mode 100644 ica/JavaViewer/VncCanvas.java
 create mode 100644 ica/JavaViewer/VncViewer.java
 create mode 100644 ica/JavaViewer/dir.mk
 create mode 100644 ica/JavaViewer/hextile.vnc
 create mode 100644 ica/JavaViewer/index.vnc
 create mode 100644 ica/JavaViewer/mk.bat
 create mode 100644 ica/JavaViewer/noshared.vnc
 create mode 100644 ica/JavaViewer/run.bat
 create mode 100644 ica/JavaViewer/runapplet.bat
 create mode 100644 ica/JavaViewer/shared.vnc
 create mode 100644 ica/JavaViewer/tight.vnc
 create mode 100644 ica/JavaViewer/zlib.vnc
 delete mode 100644 ica/Makefile.am
 delete mode 100644 ica/Makefile.in
 create mode 100644 ica/helpers/CMakeLists.txt
 create mode 100644 ica/helpers/ItalcAuthHelper.cpp
 create mode 100644 ica/ica.rc
 create mode 100644 ica/src/AccessDialogSlave.cpp
 create mode 100644 ica/src/AccessDialogSlave.h
 create mode 100644 ica/src/DemoClient.cpp
 create mode 100644 ica/src/DemoClient.h
 create mode 100644 ica/src/DemoClientSlave.cpp
 create mode 100644 ica/src/DemoClientSlave.h
 create mode 100644 ica/src/DemoServer.cpp
 create mode 100644 ica/src/DemoServer.h
 create mode 100644 ica/src/DemoServerMaster.cpp
 create mode 100644 ica/src/DemoServerMaster.h
 create mode 100644 ica/src/DemoServerSlave.cpp
 create mode 100644 ica/src/DemoServerSlave.h
 create mode 100644 ica/src/DesktopAccessPermission.cpp
 create mode 100644 ica/src/DesktopAccessPermission.h
 create mode 100644 ica/src/IcaMain.cpp
 create mode 100644 ica/src/IcaSlave.h
 create mode 100644 ica/src/InputLockSlave.cpp
 create mode 100644 ica/src/InputLockSlave.h
 create mode 100644 ica/src/ItalcCoreServer.cpp
 create mode 100644 ica/src/ItalcCoreServer.h
 create mode 100644 ica/src/ItalcSlaveManager.cpp
 create mode 100644 ica/src/ItalcSlaveManager.h
 create mode 100644 ica/src/ItalcVncServer.cpp
 create mode 100644 ica/src/ItalcVncServer.h
 create mode 100644 ica/src/LocalSystemIca.cpp
 create mode 100644 ica/src/MessageBoxSlave.cpp
 create mode 100644 ica/src/MessageBoxSlave.h
 create mode 100644 ica/src/RfbItalcCursor.cpp
 create mode 100644 ica/src/RfbItalcCursor.h
 create mode 100644 ica/src/RfbLZORLE.cpp
 create mode 100644 ica/src/RfbLZORLE.h
 create mode 100644 ica/src/ScreenLockSlave.cpp
 create mode 100644 ica/src/ScreenLockSlave.h
 create mode 100644 ica/src/ScreenLockSlaveLauncher.cpp
 create mode 100644 ica/src/ScreenLockSlaveLauncher.h
 create mode 100644 ica/src/SystemTrayIconSlave.cpp
 create mode 100644 ica/src/SystemTrayIconSlave.h
 create mode 100644 ica/src/WindowsService.cpp
 create mode 100644 ica/src/WindowsService.h
 delete mode 100644 ica/src/demo_client.cpp
 delete mode 100644 ica/src/demo_client.h
 delete mode 100644 ica/src/demo_server.cpp
 delete mode 100644 ica/src/demo_server.h
 delete mode 100644 ica/src/ica_main.cpp
 delete mode 100644 ica/src/ica_main.h
 delete mode 100644 ica/src/isd_server.cpp
 delete mode 100644 ica/src/isd_server.h
 delete mode 100644 ica/src/ivs.cpp
 delete mode 100644 ica/src/ivs.h
 delete mode 100644 ica/src/local_system_ica.cpp
 delete mode 100644 ica/src/local_system_ica.h
 delete mode 100644 ica/src/system_service.cpp
 delete mode 100644 ica/src/system_service.h
 create mode 100644 ica/win32/CMakeLists.txt
 delete mode 100644 ica/win32/FileTransferItemInfo.h
 delete mode 100644 ica/win32/README
 delete mode 100644 ica/win32/VNCHelp.h
 delete mode 100644 ica/win32/WallpaperUtils.h
 create mode 100644 ica/win32/addon/logger/logmessages.dsw
 create mode 100644 ica/win32/addon/logger/messages.h
 create mode 100644 ica/win32/addon/logger/messages.mc
 create mode 100644 ica/win32/addon/logger/messages.rc
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/.cvsignore
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.cpp
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.dsw
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.h
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.rc
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/buildtime.h
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/buildtime.in
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/resource.h
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/vncExportACL.cpp
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/vncExportACL.h
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/vncImportACL.cpp
 create mode 100644 ica/win32/addon/ms-logon/MSLogonACL/vncImportACL.h
 create mode 100644 ica/win32/addon/ms-logon/authSSP/.cvsignore
 create mode 100644 ica/win32/addon/ms-logon/authSSP/Auth_Seq.h
 create mode 100644 ica/win32/addon/ms-logon/authSSP/EventLogging.cpp
 create mode 100644 ica/win32/addon/ms-logon/authSSP/EventLogging.h
 create mode 100644 ica/win32/addon/ms-logon/authSSP/GenClientServerContext.cpp
 create mode 100644 ica/win32/addon/ms-logon/authSSP/GenClientServerContext.h
 create mode 100644 ica/win32/addon/ms-logon/authSSP/Readme.txt
 create mode 100644 ica/win32/addon/ms-logon/authSSP/authSSP.cpp
 create mode 100644 ica/win32/addon/ms-logon/authSSP/authSSP.def
 create mode 100644 ica/win32/addon/ms-logon/authSSP/authSSP.dsw
 create mode 100644 ica/win32/addon/ms-logon/authSSP/authSSP.h
 create mode 100644 ica/win32/addon/ms-logon/authSSP/authSSP.rc
 create mode 100644 ica/win32/addon/ms-logon/authSSP/buildtime.in
 create mode 100644 ica/win32/addon/ms-logon/authSSP/resource.h
 create mode 100644 ica/win32/addon/ms-logon/authSSP/vncAccessControl.cpp
 create mode 100644 ica/win32/addon/ms-logon/authSSP/vncAccessControl.h
 create mode 100644 ica/win32/addon/ms-logon/authSSP/vncSSP.cpp
 create mode 100644 ica/win32/addon/ms-logon/authSSP/vncSSP.h
 create mode 100644 ica/win32/addon/ms-logon/authSSP/vncSecurityEditor.cpp
 create mode 100644 ica/win32/addon/ms-logon/authSSP/vncSecurityEditor.h
 create mode 100644 ica/win32/addon/ms-logon/authSSP/vncSecurityEditorProps.h
 create mode 100644 ica/win32/addon/ms-logon/authadm/authadmin.cpp
 create mode 100644 ica/win32/addon/ms-logon/authadm/authadmin.def
 create mode 100644 ica/win32/addon/ms-logon/authadm/authadmin.dsw
 create mode 100644 ica/win32/addon/ms-logon/authadm/authadmin.h
 create mode 100644 ica/win32/addon/ms-logon/authadm/authadmin.rc
 create mode 100644 ica/win32/addon/ms-logon/authadm/resource.h
 create mode 100644 ica/win32/addon/ms-logon/ldapauth/ldapAuth.cpp
 create mode 100644 ica/win32/addon/ms-logon/ldapauth/ldapAuth.h
 create mode 100644 ica/win32/addon/ms-logon/ldapauth/ldapAuth.rc
 create mode 100644 ica/win32/addon/ms-logon/ldapauth/ldapauth.def
 create mode 100644 ica/win32/addon/ms-logon/ldapauth/ldapauth.dsw
 create mode 100644 ica/win32/addon/ms-logon/ldapauth/resource.h
 create mode 100644 ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.cpp
 create mode 100644 ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.h
 create mode 100644 ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.rc
 create mode 100644 ica/win32/addon/ms-logon/ldapauth9x/ldapauth9x.def
 create mode 100644 ica/win32/addon/ms-logon/ldapauth9x/resource.h
 create mode 100644 ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.cpp
 create mode 100644 ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.h
 create mode 100644 ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.rc
 create mode 100644 ica/win32/addon/ms-logon/ldapauthNT4/ldapauthnt4.def
 create mode 100644 ica/win32/addon/ms-logon/ldapauthNT4/ldapauthnt4.dsw
 create mode 100644 ica/win32/addon/ms-logon/ldapauthNT4/resource.h
 create mode 100644 ica/win32/addon/ms-logon/logging/logging.cpp
 create mode 100644 ica/win32/addon/ms-logon/logging/logging.def
 create mode 100644 ica/win32/addon/ms-logon/logging/logging.dsw
 create mode 100644 ica/win32/addon/ms-logon/logging/logging.h
 create mode 100644 ica/win32/addon/ms-logon/logging/logging.rc
 create mode 100644 ica/win32/addon/ms-logon/logging/resource.h
 create mode 100644 ica/win32/addon/ms-logon/testauth/ntlogon.cpp
 create mode 100644 ica/win32/addon/ms-logon/testauth/resource.h
 create mode 100644 ica/win32/addon/ms-logon/testauth/testauth.dsw
 create mode 100644 ica/win32/addon/ms-logon/testauth/testauth.rc
 create mode 100644 ica/win32/addon/ms-logon/workgrpdomnt4/resource.h
 create mode 100644 ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.cpp
 create mode 100644 ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.def
 create mode 100644 ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.dsw
 create mode 100644 ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.h
 create mode 100644 ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.rc
 create mode 100644 ica/win32/addon/versioninfo.h
 create mode 100644 ica/win32/common/Clipboard.cpp
 create mode 100644 ica/win32/common/Clipboard.h
 create mode 100644 ica/win32/common/ScopeGuard.h
 create mode 100644 ica/win32/common/win32_helpers.cpp
 create mode 100644 ica/win32/common/win32_helpers.h
 delete mode 100644 ica/win32/crtdbg.h
 delete mode 100644 ica/win32/keysymdef.h
 delete mode 100644 ica/win32/libjpeg/jpeglib.h
 create mode 100644 ica/win32/rdr/Exception.h
 create mode 100644 ica/win32/rdr/FdInStream.cxx
 create mode 100644 ica/win32/rdr/FdInStream.h
 create mode 100644 ica/win32/rdr/FdOutStream.cxx
 create mode 100644 ica/win32/rdr/FdOutStream.h
 create mode 100644 ica/win32/rdr/FixedMemOutStream.h
 create mode 100644 ica/win32/rdr/InStream.cxx
 create mode 100644 ica/win32/rdr/InStream.h
 create mode 100644 ica/win32/rdr/Makefile.bcc32
 create mode 100644 ica/win32/rdr/Makefile.in
 create mode 100644 ica/win32/rdr/MemInStream.h
 create mode 100644 ica/win32/rdr/MemOutStream.h
 create mode 100644 ica/win32/rdr/NullOutStream.cxx
 create mode 100644 ica/win32/rdr/NullOutStream.h
 create mode 100644 ica/win32/rdr/OutStream.h
 create mode 100644 ica/win32/rdr/ZlibInStream.cxx
 create mode 100644 ica/win32/rdr/ZlibInStream.h
 create mode 100644 ica/win32/rdr/ZlibOutStream.cxx
 create mode 100644 ica/win32/rdr/ZlibOutStream.h
 create mode 100644 ica/win32/rdr/types.h
 delete mode 100644 ica/win32/rectlist.h
 delete mode 100644 ica/win32/src/DynamicFn.cpp
 delete mode 100644 ica/win32/src/DynamicFn.h
 delete mode 100644 ica/win32/src/Log.cpp
 delete mode 100644 ica/win32/src/Log.h
 delete mode 100644 ica/win32/src/MinMax.cpp
 delete mode 100644 ica/win32/src/MinMax.h
 delete mode 100644 ica/win32/src/ParseHost.c
 delete mode 100644 ica/win32/src/ParseHost.h
 delete mode 100644 ica/win32/src/RectList.cpp
 delete mode 100644 ica/win32/src/RectList.h
 delete mode 100644 ica/win32/src/TsSessions.cpp
 delete mode 100644 ica/win32/src/TsSessions.h
 delete mode 100644 ica/win32/src/VNCHooks/SharedData.cpp
 delete mode 100644 ica/win32/src/VNCHooks/SharedData.h
 delete mode 100644 ica/win32/src/VNCHooks/VNCHooks.cpp
 delete mode 100644 ica/win32/src/VNCHooks/VNCHooks.h
 delete mode 100644 ica/win32/src/VSocket.cpp
 delete mode 100644 ica/win32/src/VSocket.h
 delete mode 100644 ica/win32/src/VTypes.h
 delete mode 100644 ica/win32/src/VideoDriver.cpp
 delete mode 100644 ica/win32/src/VideoDriver.h
 delete mode 100644 ica/win32/src/WinVNC.cpp
 delete mode 100644 ica/win32/src/WinVNC.h
 delete mode 100644 ica/win32/src/d3des.h
 delete mode 100644 ica/win32/src/d3des_w32.c
 delete mode 100644 ica/win32/src/omnithread/nt.cpp
 delete mode 100644 ica/win32/src/omnithread/nt.h
 delete mode 100644 ica/win32/src/omnithread/omnithread.h
 delete mode 100644 ica/win32/src/resource.h
 delete mode 100644 ica/win32/src/rfb.h
 delete mode 100644 ica/win32/src/stdhdrs.cpp
 delete mode 100644 ica/win32/src/stdhdrs.h
 delete mode 100644 ica/win32/src/tableinitcmtemplate.cpp
 delete mode 100644 ica/win32/src/tableinittctemplate.cpp
 delete mode 100644 ica/win32/src/tabletranstemplate.cpp
 delete mode 100644 ica/win32/src/translate.cpp
 delete mode 100644 ica/win32/src/translate.h
 delete mode 100644 ica/win32/src/vncBuffer.cpp
 delete mode 100644 ica/win32/src/vncBuffer.h
 delete mode 100644 ica/win32/src/vncClient.cpp
 delete mode 100644 ica/win32/src/vncClient.h
 delete mode 100644 ica/win32/src/vncDesktop.cpp
 delete mode 100644 ica/win32/src/vncDesktop.h
 delete mode 100644 ica/win32/src/vncEncodeCoRRE.cpp
 delete mode 100644 ica/win32/src/vncEncodeCoRRE.h
 delete mode 100644 ica/win32/src/vncEncodeHexT.cpp
 delete mode 100644 ica/win32/src/vncEncodeHexT.h
 delete mode 100644 ica/win32/src/vncEncodeRRE.cpp
 delete mode 100644 ica/win32/src/vncEncodeRRE.h
 delete mode 100644 ica/win32/src/vncEncodeTight.cpp
 delete mode 100644 ica/win32/src/vncEncodeTight.h
 delete mode 100644 ica/win32/src/vncEncodeZlib.cpp
 delete mode 100644 ica/win32/src/vncEncodeZlib.h
 delete mode 100644 ica/win32/src/vncEncoder.cpp
 delete mode 100644 ica/win32/src/vncEncoder.h
 delete mode 100644 ica/win32/src/vncInstHandler.cpp
 delete mode 100644 ica/win32/src/vncInstHandler.h
 delete mode 100644 ica/win32/src/vncKeymap.cpp
 delete mode 100644 ica/win32/src/vncKeymap.h
 delete mode 100644 ica/win32/src/vncPasswd.h
 delete mode 100644 ica/win32/src/vncRegion.cpp
 delete mode 100644 ica/win32/src/vncRegion.h
 delete mode 100644 ica/win32/src/vncServer.cpp
 delete mode 100644 ica/win32/src/vncServer.h
 delete mode 100644 ica/win32/src/vncService.cpp
 delete mode 100644 ica/win32/src/vncService.h
 delete mode 100644 ica/win32/src/vncSockConnect.cpp
 delete mode 100644 ica/win32/src/vncSockConnect.h
 delete mode 100644 ica/win32/src/vncTimedMsgBox.h
 delete mode 100644 ica/win32/src/vncauth.h
 delete mode 100644 ica/win32/src/vncauth_w32.c
 create mode 100644 ica/win32/ultravnc-italc.cpp
 create mode 100644 ica/win32/ultravnc.cpp
 delete mode 100644 ica/win32/vncAcceptDialog.h
 delete mode 100644 ica/win32/vncCorbaConnect.h
 delete mode 100644 ica/win32/vncEncodeZlibHex.h
 delete mode 100644 ica/win32/vncHTTPConnect.h
 delete mode 100644 ica/win32/vncMenu.h
 delete mode 100644 ica/win32/vncPasswd.h
 delete mode 100644 ica/win32/win32vnc.cpp
 create mode 100644 ica/win32/winvnc/DSMPlugin/DSMPlugin.cpp
 create mode 100644 ica/win32/winvnc/DSMPlugin/DSMPlugin.h
 create mode 100644 ica/win32/winvnc/Makefile.bcc32
 create mode 100644 ica/win32/winvnc/building.txt
 rename ima/src/qplatformdefs.h => ica/win32/winvnc/crtdbg.h (100%)
 create mode 100644 ica/win32/winvnc/history.txt
 create mode 100644 ica/win32/winvnc/libjpeg-turbo-win/jpeglib.h
 create mode 100644 ica/win32/winvnc/lzo/minilzo.h
 create mode 100644 ica/win32/winvnc/omnithread/nt.cpp
 create mode 100644 ica/win32/winvnc/omnithread/nt.h
 create mode 100644 ica/win32/winvnc/omnithread/omnithread.h
 create mode 100644 ica/win32/winvnc/omnithread/threaddata.cpp
 create mode 100644 ica/win32/winvnc/rfb/zrleEncode.h
 create mode 100644 ica/win32/winvnc/rfb/zywrletemplate.c
 create mode 100644 ica/win32/winvnc/vnchooks/Makefile.bcc32
 create mode 100644 ica/win32/winvnc/vnchooks/SharedData.cpp
 create mode 100644 ica/win32/winvnc/vnchooks/SharedData.h
 create mode 100644 ica/win32/winvnc/vnchooks/VNCHooks-bcc32.def
 create mode 100644 ica/win32/winvnc/vnchooks/VNCHooks-vc.def
 create mode 100644 ica/win32/winvnc/vnchooks/VNCHooks.cpp
 create mode 100644 ica/win32/winvnc/vnchooks/VNCHooks.def
 create mode 100644 ica/win32/winvnc/vnchooks/VNCHooks.h
 create mode 100644 ica/win32/winvnc/vnchooks/resource.h
 create mode 100644 ica/win32/winvnc/vnchooks/vnchooks.dsp
 create mode 100644 ica/win32/winvnc/vnchooks/vnchooks.rc
 create mode 100644 ica/win32/winvnc/vnchooks/vnchooks.vcproj
 create mode 100644 ica/win32/winvnc/vnchooks/vnchooksVS2005.vcproj
 create mode 100644 ica/win32/winvnc/vnchooks/vnchooks_vs90_Debug_Win32.lnt
 create mode 100644 ica/win32/winvnc/vnchooks/vnchooks_vs90_Release_Win32.lnt
 create mode 100644 ica/win32/winvnc/winvnc.dsw
 create mode 100644 ica/win32/winvnc/winvnc.sln
 create mode 100644 ica/win32/winvnc/winvnc.sln.vloptions
 create mode 100644 ica/win32/winvnc/winvnc/CpuUsage.cpp
 create mode 100644 ica/win32/winvnc/winvnc/CpuUsage.h
 create mode 100644 ica/win32/winvnc/winvnc/Dtwinver.cpp
 create mode 100644 ica/win32/winvnc/winvnc/Dtwinver.h
 create mode 100644 ica/win32/winvnc/winvnc/HideDesktop.cpp
 create mode 100644 ica/win32/winvnc/winvnc/HideDesktop.h
 create mode 100644 ica/win32/winvnc/winvnc/IPC.cpp
 create mode 100644 ica/win32/winvnc/winvnc/IPC.h
 create mode 100644 ica/win32/winvnc/winvnc/Localization.h
 create mode 100644 ica/win32/winvnc/winvnc/TextChat.cpp
 create mode 100644 ica/win32/winvnc/winvnc/TextChat.h
 create mode 100644 ica/win32/winvnc/winvnc/Timer.cpp
 create mode 100644 ica/win32/winvnc/winvnc/Timer.h
 create mode 100644 ica/win32/winvnc/winvnc/WINVNC.DSW
 create mode 100644 ica/win32/winvnc/winvnc/benchmark.cpp
 create mode 100644 ica/win32/winvnc/winvnc/black_layered.cpp
 create mode 100644 ica/win32/winvnc/winvnc/buildtime.cpp
 create mode 100644 ica/win32/winvnc/winvnc/d3des.c
 create mode 100644 ica/win32/winvnc/winvnc/d3des.h
 create mode 100644 ica/win32/winvnc/winvnc/getinfo.cpp
 create mode 100644 ica/win32/winvnc/winvnc/helpers.cpp
 create mode 100644 ica/win32/winvnc/winvnc/httpconnect.cpp
 create mode 100644 ica/win32/winvnc/winvnc/httpconnect.h
 create mode 100644 ica/win32/winvnc/winvnc/inifile.cpp
 create mode 100644 ica/win32/winvnc/winvnc/inifile.h
 create mode 100644 ica/win32/winvnc/winvnc/initipp.cpp
 create mode 100644 ica/win32/winvnc/winvnc/keysymdef.h
 create mode 100644 ica/win32/winvnc/winvnc/minmax.h
 create mode 100644 ica/win32/winvnc/winvnc/read_write_ini.cpp
 create mode 100644 ica/win32/winvnc/winvnc/res/AuthPanel.class
 create mode 100644 ica/win32/winvnc/winvnc/res/ButtonPanel.class
 create mode 100644 ica/win32/winvnc/winvnc/res/DH.class
 create mode 100644 ica/win32/winvnc/winvnc/res/FTPFrame.class
 create mode 100644 ica/win32/winvnc/winvnc/res/Finger.cur
 create mode 100644 ica/win32/winvnc/winvnc/res/RecordingFrame.class
 create mode 100644 ica/win32/winvnc/winvnc/res/SessionRecorder.class
 create mode 100644 ica/win32/winvnc/winvnc/res/clipboardframe.class
 create mode 100644 ica/win32/winvnc/winvnc/res/descipher.class
 create mode 100644 ica/win32/winvnc/winvnc/res/ding_dong.wav
 create mode 100644 ica/win32/winvnc/winvnc/res/ftpframe$strcomp.class
 create mode 100644 ica/win32/winvnc/winvnc/res/icon2.ico
 create mode 100644 ica/win32/winvnc/winvnc/res/optionsframe.class
 create mode 100644 ica/win32/winvnc/winvnc/res/rfbproto.class
 create mode 100644 ica/win32/winvnc/winvnc/res/runas.bmp
 create mode 100644 ica/win32/winvnc/winvnc/res/vnc-1.bmp
 create mode 100644 ica/win32/winvnc/winvnc/res/vnccanvas.class
 create mode 100644 ica/win32/winvnc/winvnc/res/vncviewer.class
 create mode 100644 ica/win32/winvnc/winvnc/res/vncviewer.jar
 create mode 100644 ica/win32/winvnc/winvnc/res/world3a.ico
 create mode 100644 ica/win32/winvnc/winvnc/resource.h
 create mode 100644 ica/win32/winvnc/winvnc/rfb.h
 create mode 100644 ica/win32/winvnc/winvnc/rfbMisc.h
 create mode 100644 ica/win32/winvnc/winvnc/rfbRect.h
 create mode 100644 ica/win32/winvnc/winvnc/rfbRegion.h
 create mode 100644 ica/win32/winvnc/winvnc/rfbRegion_X11.cxx
 create mode 100644 ica/win32/winvnc/winvnc/rfbRegion_X11.h
 create mode 100644 ica/win32/winvnc/winvnc/rfbRegion_win32.cpp
 create mode 100644 ica/win32/winvnc/winvnc/rfbRegion_win32.h
 create mode 100644 ica/win32/winvnc/winvnc/rfbUpdateTracker.cpp
 create mode 100644 ica/win32/winvnc/winvnc/rfbUpdateTracker.h
 create mode 100644 ica/win32/winvnc/winvnc/security.cpp
 create mode 100644 ica/win32/winvnc/winvnc/service.cpp
 create mode 100644 ica/win32/winvnc/winvnc/service_motor.cpp
 create mode 100644 ica/win32/winvnc/winvnc/stdhdrs.cpp
 create mode 100644 ica/win32/winvnc/winvnc/stdhdrs.h
 create mode 100644 ica/win32/winvnc/winvnc/tableinitcmtemplate.cpp
 create mode 100644 ica/win32/winvnc/winvnc/tableinittctemplate.cpp
 create mode 100644 ica/win32/winvnc/winvnc/tabletranstemplate.cpp
 create mode 100644 ica/win32/winvnc/winvnc/translate.cpp
 create mode 100644 ica/win32/winvnc/winvnc/translate.h
 create mode 100644 ica/win32/winvnc/winvnc/videodriver.cpp
 create mode 100644 ica/win32/winvnc/winvnc/videodriver.h
 create mode 100644 ica/win32/winvnc/winvnc/videodrivercheck.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vistahook.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncDesktopSW.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncEncodeTight.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncEncodeTight.h
 create mode 100644 ica/win32/winvnc/winvnc/vncEncodeUltra.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncEncodeUltra.h
 create mode 100644 ica/win32/winvnc/winvnc/vncEncodeUltra2.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncEncodeUltra2.h
 create mode 100644 ica/win32/winvnc/winvnc/vncEncodeZlib.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncEncodeZlib.h
 create mode 100644 ica/win32/winvnc/winvnc/vncEncodeZlibHex.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncEncodeZlibHex.h
 create mode 100644 ica/win32/winvnc/winvnc/vncListDlg.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncListDlg.h
 create mode 100644 ica/win32/winvnc/winvnc/vncMultiMonitor.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncOSVersion.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncOSVersion.h
 create mode 100644 ica/win32/winvnc/winvnc/vncabout.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncabout.h
 create mode 100644 ica/win32/winvnc/winvnc/vncacceptdialog.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncacceptdialog.h
 create mode 100644 ica/win32/winvnc/winvnc/vncauth.c
 create mode 100644 ica/win32/winvnc/winvnc/vncauth.h
 create mode 100644 ica/win32/winvnc/winvnc/vncbuffer.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncbuffer.h
 create mode 100644 ica/win32/winvnc/winvnc/vncclient.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncclient.h
 create mode 100644 ica/win32/winvnc/winvnc/vncconndialog.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncconndialog.h
 create mode 100644 ica/win32/winvnc/winvnc/vncdesktop.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncdesktop.h
 create mode 100644 ica/win32/winvnc/winvnc/vncdesktopsink.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncdesktopthread.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncdesktopthread.h
 create mode 100644 ica/win32/winvnc/winvnc/vncencodecorre.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncencodecorre.h
 create mode 100644 ica/win32/winvnc/winvnc/vncencodehext.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncencodehext.h
 create mode 100644 ica/win32/winvnc/winvnc/vncencodemgr.h
 create mode 100644 ica/win32/winvnc/winvnc/vncencoder.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncencoder.h
 create mode 100644 ica/win32/winvnc/winvnc/vncencoderCursor.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncencoderre.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncencoderre.h
 create mode 100644 ica/win32/winvnc/winvnc/vncencodezrle.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncencodezrle.h
 create mode 100644 ica/win32/winvnc/winvnc/vnchttpconnect.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vnchttpconnect.h
 create mode 100644 ica/win32/winvnc/winvnc/vncinsthandler.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncinsthandler.h
 create mode 100644 ica/win32/winvnc/winvnc/vnckeymap.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vnckeymap.h
 create mode 100644 ica/win32/winvnc/winvnc/vnclog.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vnclog.h
 create mode 100644 ica/win32/winvnc/winvnc/vnclogon.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vnclogon.h
 create mode 100644 ica/win32/winvnc/winvnc/vncmemcpy.h
 create mode 100644 ica/win32/winvnc/winvnc/vncmenu.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncmenu.h
 create mode 100644 ica/win32/winvnc/winvnc/vncntlm.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncpasswd.h
 create mode 100644 ica/win32/winvnc/winvnc/vncproperties.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncproperties.h
 create mode 100644 ica/win32/winvnc/winvnc/vncpropertiesPoll.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncpropertiesPoll.h
 create mode 100644 ica/win32/winvnc/winvnc/vncserver.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncserver.h
 create mode 100644 ica/win32/winvnc/winvnc/vncservice.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncservice.h
 create mode 100644 ica/win32/winvnc/winvnc/vncsetauth.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncsetauth.h
 create mode 100644 ica/win32/winvnc/winvnc/vncsockconnect.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vncsockconnect.h
 create mode 100644 ica/win32/winvnc/winvnc/vnctimedmsgbox.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vnctimedmsgbox.h
 create mode 100644 ica/win32/winvnc/winvnc/vsocket.cpp
 create mode 100644 ica/win32/winvnc/winvnc/vsocket.h
 create mode 100644 ica/win32/winvnc/winvnc/vtypes.h
 create mode 100644 ica/win32/winvnc/winvnc/winvnc.cpp
 create mode 100644 ica/win32/winvnc/winvnc/winvnc.dsp
 create mode 100644 ica/win32/winvnc/winvnc/winvnc.exe.manifest
 create mode 100644 ica/win32/winvnc/winvnc/winvnc.exe.x64.manifest
 create mode 100644 ica/win32/winvnc/winvnc/winvnc.exe.x86.manifest
 create mode 100644 ica/win32/winvnc/winvnc/winvnc.h
 create mode 100644 ica/win32/winvnc/winvnc/winvnc.rc
 create mode 100644 ica/win32/winvnc/winvnc/winvnc.vcproj
 create mode 100644 ica/win32/winvnc/winvnc/winvncVS2005.vcproj
 create mode 100644 ica/win32/winvnc/winvnc/winvnc_fr.rc
 create mode 100644 ica/win32/winvnc/winvnc/winvnc_vs90_Release_Win32.lnt
 create mode 100644 ica/win32/winvnc/winvncvs2005.sln
 rename ica/win32/{ => winvnc}/zlib/zlib.h (100%)
 create mode 100644 ica/x11/AUTHORS
 create mode 100644 ica/x11/ChangeLog
 rename ica/x11/{libvncserver => common}/d3des.c (100%)
 rename ica/x11/{libvncserver => common}/d3des.h (100%)
 create mode 100644 ica/x11/common/lzoconf.h
 create mode 100644 ica/x11/common/lzodefs.h
 create mode 100644 ica/x11/common/minilzo.c
 create mode 100644 ica/x11/common/minilzo.h
 create mode 100644 ica/x11/common/vncauth.c
 create mode 100644 ica/x11/common/zywrletemplate.c
 delete mode 100644 ica/x11/libvncclient/minilzo.c
 delete mode 100644 ica/x11/libvncserver/vncauth.c
 delete mode 100644 ica/x11/libvncserver/zywrletemplate.c
 create mode 100644 ica/x11/x11vnc/RELEASE-NOTES
 create mode 100644 ica/x11/x11vnc/macosx_opengl.c
 create mode 100644 ica/x11/x11vnc/macosx_opengl.h
 create mode 100644 ima/CMakeLists.txt
 delete mode 100644 ima/Makefile.am
 delete mode 100644 ima/Makefile.in
 create mode 100644 ima/dialogs/ClientSettingsDialog.ui
 create mode 100644 ima/dialogs/Config.ui
 create mode 100644 ima/dialogs/Overview.ui
 create mode 100644 ima/dialogs/RemoteLogonDialog.ui
 create mode 100644 ima/dialogs/RunCommandsDialog.ui
 create mode 100644 ima/dialogs/Snapshots.ui
 create mode 100644 ima/dialogs/SupportDialog.ui
 create mode 100644 ima/dialogs/TextMessageDialog.ui
 delete mode 100644 ima/dialogs/about.ui
 delete mode 100644 ima/dialogs/client_settings.ui
 delete mode 100644 ima/dialogs/config.ui
 delete mode 100644 ima/dialogs/overview.ui
 delete mode 100644 ima/dialogs/remote_logon.ui
 delete mode 100644 ima/dialogs/snapshots.ui
 delete mode 100644 ima/dialogs/support.ui
 delete mode 100644 ima/dialogs/text_message.ui
 create mode 100644 ima/italc.rc
 delete mode 100644 ima/resources/analog.png
 delete mode 100644 ima/resources/apply.png
 delete mode 100644 ima/resources/demoquality.png
 delete mode 100644 ima/resources/high.png
 delete mode 100644 ima/resources/isdn.png
 delete mode 100644 ima/resources/lan.png
 delete mode 100644 ima/resources/low.png
 delete mode 100644 ima/resources/medium.png
 delete mode 100644 ima/resources/modem.png
 delete mode 100644 ima/resources/ok.png
 delete mode 100644 ima/resources/reload.png
 delete mode 100644 ima/resources/vpn.png
 copy ima/resources/{fullscreen.png => window.png} (100%)
 create mode 100644 ima/src/ClassroomManager.cpp
 create mode 100644 ima/src/ClassroomManager.h
 create mode 100644 ima/src/Client.cpp
 create mode 100644 ima/src/Client.h
 create mode 100644 ima/src/ConfigWidget.cpp
 create mode 100644 ima/src/ConfigWidget.h
 create mode 100644 ima/src/Dialogs.cpp
 create mode 100644 ima/src/Dialogs.h
 create mode 100644 ima/src/OverviewWidget.cpp
 create mode 100644 ima/src/OverviewWidget.h
 create mode 100644 ima/src/RemoteControlWidget.cpp
 create mode 100644 ima/src/RemoteControlWidget.h
 create mode 100644 ima/src/RunCommandsDialog.cpp
 create mode 100644 ima/src/RunCommandsDialog.h
 create mode 100644 ima/src/SnapshotList.cpp
 create mode 100644 ima/src/SnapshotList.h
 create mode 100644 ima/src/ToolButton.cpp
 create mode 100644 ima/src/ToolButton.h
 delete mode 100644 ima/src/classroom_manager.cpp
 delete mode 100644 ima/src/classroom_manager.h
 delete mode 100644 ima/src/client.cpp
 delete mode 100644 ima/src/client.h
 delete mode 100644 ima/src/cmd_input_dialog.cpp
 delete mode 100644 ima/src/cmd_input_dialog.h
 delete mode 100644 ima/src/config_widget.cpp
 delete mode 100644 ima/src/config_widget.h
 delete mode 100644 ima/src/dialogs.cpp
 delete mode 100644 ima/src/dialogs.h
 delete mode 100644 ima/src/local_system_ima.cpp
 delete mode 100644 ima/src/local_system_ima.h
 delete mode 100644 ima/src/overview_widget.cpp
 delete mode 100644 ima/src/overview_widget.h
 delete mode 100644 ima/src/remote_control_widget.cpp
 delete mode 100644 ima/src/remote_control_widget.h
 delete mode 100644 ima/src/snapshot_list.cpp
 delete mode 100644 ima/src/snapshot_list.h
 delete mode 100644 ima/src/tool_button.cpp
 delete mode 100644 ima/src/tool_button.h
 create mode 100644 imc/CMakeLists.txt
 create mode 100644 imc/Forms/KeyFileAssistant.ui
 create mode 100644 imc/Forms/LogonGroupEditor.ui
 create mode 100644 imc/Forms/MainWindow.ui
 create mode 100644 imc/Resources/Authentication.png
 create mode 100644 imc/Resources/General.png
 create mode 100644 imc/Resources/Paths.png
 create mode 100644 imc/Resources/Vnc.png
 create mode 100644 imc/Resources/arrow-right.png
 create mode 100644 imc/Resources/document-open.png
 create mode 100644 imc/Resources/document-save.png
 create mode 100644 imc/Resources/edit-clear.png
 create mode 100644 imc/Resources/go-next.png
 create mode 100644 imc/Resources/go-previous.png
 create mode 100644 imc/Resources/help-hint.png
 create mode 100644 imc/Resources/imc.ico
 create mode 100644 imc/Resources/imc.png
 create mode 100644 imc/Resources/kbugbuster.png
 create mode 100644 imc/Resources/preferences-other.png
 create mode 100644 imc/Resources/system-shutdown.png
 create mode 100644 imc/Resources/task-accepted.png
 create mode 100644 imc/Resources/tools-wizard.png
 create mode 100644 imc/imc.qrc
 create mode 100644 imc/imc.rc
 create mode 100644 imc/imc.rc.in
 create mode 100644 imc/src/FileSystemBrowser.cpp
 create mode 100644 imc/src/FileSystemBrowser.h
 create mode 100644 imc/src/ImcCore.cpp
 create mode 100644 imc/src/ImcCore.h
 create mode 100644 imc/src/KeyDirectoriesPage.cpp
 create mode 100644 imc/src/KeyDirectoriesPage.h
 create mode 100644 imc/src/KeyFileAssistant.cpp
 create mode 100644 imc/src/KeyFileAssistant.h
 create mode 100644 imc/src/KeyFileAssistantModePage.cpp
 create mode 100644 imc/src/KeyFileAssistantModePage.h
 create mode 100644 imc/src/LogonAclSettings.h
 create mode 100644 imc/src/LogonGroupEditor.cpp
 create mode 100644 imc/src/LogonGroupEditor.h
 create mode 100644 imc/src/MainWindow.cpp
 create mode 100644 imc/src/MainWindow.h
 create mode 100644 imc/src/SystemConfigurationModifier.cpp
 create mode 100644 imc/src/SystemConfigurationModifier.h
 create mode 100644 imc/src/Win32AclEditor.cpp
 create mode 100644 imc/src/Win32AclEditor.h
 create mode 100644 imc/src/main.cpp
 create mode 100644 imc/src/netfw.h
 delete mode 100755 install-sh
 create mode 100644 italcconfig.h.in
 create mode 100644 lib/CMakeLists.txt
 create mode 100644 lib/ItalcCore.qrc
 delete mode 100644 lib/Makefile.am
 delete mode 100644 lib/Makefile.in
 create mode 100644 lib/dialogs/AboutDialog.ui
 create mode 100644 lib/dialogs/PasswordDialog.ui
 create mode 100644 lib/include/AboutDialog.h
 create mode 100644 lib/include/AuthenticationCredentials.h
 create mode 100644 lib/include/Configuration/LocalStore.h
 create mode 100644 lib/include/Configuration/Object.h
 create mode 100644 lib/include/Configuration/Store.h
 create mode 100644 lib/include/Configuration/UiMapping.h
 create mode 100644 lib/include/Configuration/XmlStore.h
 create mode 100644 lib/include/DecoratedMessageBox.h
 create mode 100644 lib/include/DsaKey.h
 create mode 100644 lib/include/FastQImage.h
 create mode 100644 lib/include/Inject.h
 create mode 100644 lib/include/Ipc/Core.h
 create mode 100644 lib/include/Ipc/Master.h
 create mode 100644 lib/include/Ipc/QtSlaveLauncher.h
 create mode 100644 lib/include/Ipc/Slave.h
 create mode 100644 lib/include/Ipc/SlaveLauncher.h
 create mode 100644 lib/include/ItalcConfiguration.h
 create mode 100644 lib/include/ItalcCore.h
 create mode 100644 lib/include/ItalcCoreConnection.h
 create mode 100644 lib/include/ItalcRfbExt.h
 create mode 100644 lib/include/ItalcVncConnection.h
 create mode 100644 lib/include/LocalSystem.h
 create mode 100644 lib/include/LockWidget.h
 create mode 100644 lib/include/Logger.h
 create mode 100644 lib/include/LogonAuthentication.h
 create mode 100644 lib/include/PasswordDialog.h
 create mode 100644 lib/include/ProgressWidget.h
 create mode 100644 lib/include/QtUserEvents.h
 create mode 100644 lib/include/Snapshot.h
 create mode 100644 lib/include/SocketDevice.h
 create mode 100644 lib/include/SystemKeyTrapper.h
 create mode 100644 lib/include/VncView.h
 delete mode 100644 lib/include/debug.h
 delete mode 100644 lib/include/dsa_key.h
 delete mode 100644 lib/include/fast_qimage.h
 delete mode 100644 lib/include/inject.h
 delete mode 100644 lib/include/isd_base.h
 delete mode 100644 lib/include/isd_connection.h
 delete mode 100644 lib/include/italc_rfb_ext.h
 delete mode 100644 lib/include/ivs_connection.h
 delete mode 100644 lib/include/local_system.h
 delete mode 100644 lib/include/lock_widget.h
 delete mode 100644 lib/include/lzoconf.h
 delete mode 100644 lib/include/lzodefs.h
 delete mode 100644 lib/include/messagebox.h
 delete mode 100644 lib/include/minilzo.h
 delete mode 100644 lib/include/progress_widget.h
 delete mode 100644 lib/include/qt_features.h
 delete mode 100644 lib/include/qt_user_events.h
 create mode 100644 lib/include/rfb/dh.h
 create mode 100644 lib/include/rfb/rfbint.h
 delete mode 100644 lib/include/system_key_trapper.h
 delete mode 100644 lib/include/types.h
 delete mode 100644 lib/include/vncview.h
 delete mode 100644 lib/italc_core.qrc
 rename {ima => lib}/resources/authors.png (100%)
 delete mode 100644 lib/resources/ca.qm
 delete mode 100644 lib/resources/ca.ts
 delete mode 100644 lib/resources/he.qm
 delete mode 100644 lib/resources/he.ts
 rename ima/resources/logo.png => lib/resources/icon64.png (100%)
 rename {ima => lib}/resources/license.png (100%)
 rename {ima => lib}/resources/locale.png (100%)
 create mode 100644 lib/resources/nl.qm
 create mode 100644 lib/resources/nl.ts
 delete mode 100644 lib/resources/qt_ar.qm
 delete mode 100644 lib/resources/qt_ca.qm
 delete mode 100644 lib/resources/qt_da.qm
 delete mode 100644 lib/resources/qt_de.qm
 delete mode 100644 lib/resources/qt_es.qm
 delete mode 100644 lib/resources/qt_fr.qm
 delete mode 100644 lib/resources/qt_iw.qm
 delete mode 100644 lib/resources/qt_ja_JP.qm
 delete mode 100644 lib/resources/qt_pl.qm
 delete mode 100644 lib/resources/qt_pt.qm
 delete mode 100644 lib/resources/qt_ru.qm
 delete mode 100644 lib/resources/qt_sk.qm
 delete mode 100644 lib/resources/qt_sl.qm
 delete mode 100644 lib/resources/qt_sv.qm
 delete mode 100644 lib/resources/qt_uk.qm
 delete mode 100644 lib/resources/qt_zh_CN.qm
 delete mode 100644 lib/resources/qt_zh_TW.qm
 delete mode 100644 lib/resources/sr_SR.qm
 delete mode 100644 lib/resources/sr_SR.ts
 create mode 100644 lib/resources/zh_tw.qm
 create mode 100644 lib/resources/zh_tw.ts
 create mode 100644 lib/src/3rdparty/XEventLog.cpp
 create mode 100644 lib/src/3rdparty/XEventLog.h
 create mode 100644 lib/src/AboutDialog.cpp
 create mode 100644 lib/src/AuthenticationCredentials.cpp
 create mode 100644 lib/src/Configuration/LocalStore.cpp
 create mode 100644 lib/src/Configuration/Object.cpp
 create mode 100644 lib/src/Configuration/XmlStore.cpp
 create mode 100644 lib/src/DecoratedMessageBox.cpp
 create mode 100644 lib/src/DsaKey.cpp
 create mode 100644 lib/src/FastQImage.cpp
 create mode 100644 lib/src/Inject.cpp
 create mode 100644 lib/src/Ipc/Core.cpp
 create mode 100644 lib/src/Ipc/Master.cpp
 create mode 100644 lib/src/Ipc/QtSlaveLauncher.cpp
 create mode 100644 lib/src/Ipc/Slave.cpp
 create mode 100644 lib/src/Ipc/SlaveLauncher.cpp
 create mode 100644 lib/src/ItalcConfiguration.cpp
 create mode 100644 lib/src/ItalcCore.cpp
 create mode 100644 lib/src/ItalcCoreConnection.cpp
 create mode 100644 lib/src/ItalcVncConnection.cpp
 create mode 100644 lib/src/LocalSystem.cpp
 create mode 100644 lib/src/LockWidget.cpp
 create mode 100644 lib/src/Logger.cpp
 create mode 100644 lib/src/LogonAuthentication.cpp
 create mode 100644 lib/src/PasswordDialog.cpp
 create mode 100644 lib/src/ProgressWidget.cpp
 create mode 100644 lib/src/Snapshot.cpp
 create mode 100644 lib/src/SystemKeyTrapper.cpp
 create mode 100644 lib/src/VncView.cpp
 create mode 100644 lib/src/dh.cpp
 delete mode 100644 lib/src/dsa_key.cpp
 delete mode 100644 lib/src/fast_qimage.cpp
 delete mode 100644 lib/src/inject.cpp
 delete mode 100644 lib/src/isd_base.cpp
 delete mode 100644 lib/src/isd_connection.cpp
 delete mode 100644 lib/src/ivs_connection.cpp
 delete mode 100644 lib/src/local_system.cpp
 delete mode 100644 lib/src/lock_widget.cpp
 delete mode 100644 lib/src/messagebox.cpp
 delete mode 100644 lib/src/minilzo.c
 delete mode 100644 lib/src/progress_widget.cpp
 delete mode 100644 lib/src/system_key_trapper.cpp
 delete mode 100644 lib/src/vncview.cpp
 delete mode 100755 ltmain.sh
 delete mode 100644 m4/libtool.m4
 delete mode 100644 m4/ltoptions.m4
 delete mode 100644 m4/ltsugar.m4
 delete mode 100644 m4/ltversion.m4
 delete mode 100644 m4/lt~obsolete.m4
 delete mode 100755 missing
 create mode 100644 nsis/header.bmp
 create mode 100644 nsis/welcome-page.bmp
 delete mode 100644 setup/Makefile.am
 delete mode 100644 setup/Makefile.in
 delete mode 100644 setup/dialogs/page_key_dirs.ui
 delete mode 100644 setup/dialogs/page_security_options.ui
 delete mode 100644 setup/dialogs/page_setup_finished.ui
 delete mode 100644 setup/dialogs/page_welcome.ui
 delete mode 100644 setup/dialogs/wizard.ui
 delete mode 100644 setup/resources/back.png
 delete mode 100644 setup/resources/cancel.png
 delete mode 100644 setup/resources/fileopen.png
 delete mode 100644 setup/resources/next.png
 delete mode 100644 setup/resources/page_artwork_welcome.png
 delete mode 100644 setup/resources/page_security_options.png
 delete mode 100644 setup/resources/page_setup_finished.png
 delete mode 100644 setup/resources/setup.png
 delete mode 100644 setup/resources/usbdrive.png
 delete mode 100644 setup/setup.ico
 delete mode 100644 setup/setup.qrc
 delete mode 100644 setup/setup.rc.in
 delete mode 100644 setup/src/dialogs.cpp
 delete mode 100644 setup/src/dialogs.h
 delete mode 100644 setup/src/main.cpp
 delete mode 100755 tightvnc4win_integrate
 delete mode 100644 tightvnc4win_italc.diff

The diff of changes is:
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..e47f92b
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,345 @@
+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 "0")
+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(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)
+
+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 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)
+
+INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/lib/include ${ZLIB_INCLUDE_DIR} ${JPEG_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR})
+LINK_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_BINARY_DIR}/lib)
+LINK_LIBRARIES(${QT_LIBRARIES} ${ZLIB_LIBRARIES} ${JPEG_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/INSTALL b/INSTALL
index 01ba570..9394ea6 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,9 +2,10 @@ 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 setup.exe which will guide
-you through the installation.
+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:
 
@@ -29,23 +30,23 @@ Requirements:
 - zlib1g-dev/zlib-devel
 - libssl-dev/openssl-devel
 
-Of course GCC/G++ (at least 3.3) must not be missing... 
+Of course GCC/G++ must not be missing...
 
 
 Building:
 
-It's the same as with most other opensource-software: run configure by invoking
+	mkdir build
+	cd build
+	cmake ..
 
-./configure
+If some requirements are not fullfilled, CMake will inform you about it and
+you will have to install the missing software before continuing.
 
-If some requirements are not fullfilled, configure will inform you about it and
-you have to install the missing software before continuing.
+After CMake ran successfully you can run
 
-After configure ran successfully you can run
+	make install
 
-make install
-
-Make sure you're doing the "make install" as root! This will install iTALC
+Make sure you're issuing the "make install" as root! This will install iTALC
 directly on the computer.
 
 
@@ -58,117 +59,113 @@ Installing iTALC
 
 Requirements:
 
-Of course you should have some computers, connected via TCP/IP-network... :-)
+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,
+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,
+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 clients you only have to install the packages italc:
 
 on DPKG-based systems:
 
 
-apt-get install italc-client
+	apt-get install italc-client
 
 
 on RPM-based systems:
 
-rpm -i italc...rpm
+	rpm -i italc...rpm
 
 
-On the master-computer you additionally need italc-master.
+On the master computer you additionally need italc-master.
 
-apt-get install italc-master
+	apt-get install italc-master
 
 or
 
-rpm -i italc-master...rpm
+	rpm -i italc-master...rpm
 
 
 
-Setup an iTALC-client
+Setup an iTALC client
 ----------------------
 
-On clients you have to make sure that the iTALC-Client-Application (ICA),
-provided by package italc, is being started when either X is started or a
-user logs on.
-There're several methods for doing this (this is why it's not done
+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.
-   This method isn't recommend, because then ICA runs with the user's
+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/kde3/kdm/Xsetup or
+   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 5900 of the
+You can easily test whether all is fine by running telnet on port 11100 of the
 according compter.
 
 example:
 
-telnet 192.168.1.2 5900
+	telnet 192.168.1.2 11100
 
 
 You should see something like "RFB 003.008".
 
 
 
-Setup iTALC-authentication
+Setup iTALC authentication
 ----------------------------
 
-iTALC uses a sophisticated authentication-concept to make sure only
+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
+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
 
-ica -role teacher -createkeypair
+	imc -role teacher -createkeypair
 
-which will create a key-pair in /etc/italc/keys.
+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 sub-directories 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
+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)
+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 sub-directories and files. In most cases you would have to create a
+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.
+this group has read permissions.
 
 
 
-Setup clients and classrooms (i.e. client-groups)
+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
+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 'global-client-config.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).
-
+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).
 
- 
-If there're still any problems, unsolved questions etc., mail me!
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index e7b1262..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,107 +0,0 @@
-AUTOMAKE_OPTIONS = foreign 1.4
-
-SUBDIRS = lib ica ima setup $(subdirs) $(EXTRA_TARGETS)
-
-ACLOCAL_AMFLAGS = -I m4
-
-EXTRA_DIST = build_mingw32 build_mingw64 tightvnc4win_integrate tightvnc4win_italc.diff README.LZO
-
-nobase_doc_DATA = AUTHORS ChangeLog COPYING INSTALL README README.LZO TODO
-
-%.ts:
-	cd lib && make $@
-
-%.qm:
-	cd lib && make $@
-
-
-dist-hook:
-	rm -rf `find $(distdir) -name *.moc`
-	rm -rf `find $(distdir) -name *_qrc.cpp`
-
-# strip all binaries after installation
-install-exec-hook:
-	cd $(DESTDIR)$(bindir) ; \
-	strip ica; \
-	strip italc
-
-
-if HAVE_RPM
-$(PACKAGE)-$(VERSION).tar.gz: dist
-
-# Rule to build RPM distribution package
-rpm: $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE).spec
-	cp $(PACKAGE)-$(VERSION).tar.gz @RPMSOURCEDIR@
-	rpmbuild -ba $(PACKAGE).spec
-endif
-
-
-#CLEANFILES = config.log config.status
-clean: clean-recursive
-	rm -f config.log
-	rm -f config.status
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-if BUILD_WIN32
-win32-pkg: all
-	mkdir -p tmp/italc
-	cp lib/italc_core.dll tmp/italc
-	cp ica/.libs/ica.exe tmp/italc
-	cp ica/vnchooks.dll tmp/italc
-	cp ima/.libs/italc.exe tmp/italc
-	cp setup/.libs/setup.exe tmp/italc
-	cp /opt/mingw32/bin/QtCore4.dll tmp/italc
-	cp /opt/mingw32/bin/QtGui4.dll tmp/italc
-	cp /opt/mingw32/bin/QtNetwork4.dll tmp/italc
-	cp /opt/mingw32/bin/QtXml4.dll tmp/italc
-	cp /opt/mingw32/bin/libeay32.dll tmp/italc
-	cp /opt/mingw32/bin/libjpeg-8.dll tmp/italc
-	cp /opt/mingw32/bin/libssl32.dll tmp/italc
-	cp /opt/mingw32/bin/zlib1.dll tmp/italc
-	cp -L COPYING tmp/italc/LICENSE.TXT
-	cp -L README tmp/italc/README.TXT
-	/opt/mingw32/bin/i686-w64-mingw32-strip tmp/italc/ica.exe
-	/opt/mingw32/bin/i686-w64-mingw32-strip tmp/italc/italc.exe
-	/opt/mingw32/bin/i686-w64-mingw32-strip tmp/italc/setup.exe
-	mv tmp/italc tmp/italc-$(VERSION)
-	cd tmp && zip -9 ../$(PACKAGE)-$(VERSION)-bin-win32.zip italc-$(VERSION)/*
-	rm -rf tmp
-
-win32-nsi: win32-pkg
-	unzip $(PACKAGE)-$(VERSION)-bin-win32.zip
-	makensis iTALC.nsi
-	rm -rf italc-$(VERSION)
-	mv italc-$(VERSION)-setup.exe italc-$(VERSION)-win32-setup.exe
-
-
-win64-pkg: all
-	mkdir -p tmp/italc
-	cp lib/italc_core.dll tmp/italc
-	cp ica/.libs/ica.exe tmp/italc
-	cp ica/vnchooks.dll tmp/italc
-	cp ima/.libs/italc.exe tmp/italc
-	cp setup/.libs/setup.exe tmp/italc
-	cp /opt/mingw64/bin/QtCore4.dll tmp/italc
-	cp /opt/mingw64/bin/QtGui4.dll tmp/italc
-	cp /opt/mingw64/bin/QtNetwork4.dll tmp/italc
-	cp /opt/mingw64/bin/QtXml4.dll tmp/italc
-	cp /opt/mingw64/bin/libeay32.dll tmp/italc
-	cp /opt/mingw64/bin/libjpeg-8.dll tmp/italc
-	cp /opt/mingw64/bin/libssl32.dll tmp/italc
-	cp /opt/mingw64/bin/zlib1.dll tmp/italc
-	cp -L COPYING tmp/italc/LICENSE.TXT
-	cp -L README tmp/italc/README.TXT
-	/opt/mingw64/bin/x86_64-w64-mingw32-strip tmp/italc/ica.exe
-	/opt/mingw64/bin/x86_64-w64-mingw32-strip tmp/italc/italc.exe
-	/opt/mingw64/bin/x86_64-w64-mingw32-strip tmp/italc/setup.exe
-	mv tmp/italc tmp/italc-$(VERSION)
-	cd tmp && zip -9 ../$(PACKAGE)-$(VERSION)-bin-win64.zip italc-$(VERSION)/*
-	rm -rf tmp
-
-win64-nsi: win64-pkg
-	unzip $(PACKAGE)-$(VERSION)-bin-win64.zip
-	makensis iTALC.nsi
-	rm -rf italc-$(VERSION)
-	mv italc-$(VERSION)-setup.exe italc-$(VERSION)-win64-setup.exe
-endif
diff --git a/Makefile.in b/Makefile.in
deleted file mode 100644
index df43440..0000000
--- a/Makefile.in
+++ /dev/null
@@ -1,897 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = .
-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
-	$(srcdir)/iTALC.nsi.in $(srcdir)/italc.spec.in \
-	$(top_srcdir)/configure \
-	$(top_srcdir)/ima/data/italc.desktop.in \
-	$(top_srcdir)/ima/data/italc.in AUTHORS COPYING ChangeLog \
-	INSTALL NEWS TODO config.guess config.sub depcomp install-sh \
-	ltmain.sh missing
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = italc.spec iTALC.nsi ima/data/italc \
-	ima/data/italc.desktop
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
-	html-recursive info-recursive install-data-recursive \
-	install-dvi-recursive install-exec-recursive \
-	install-html-recursive install-info-recursive \
-	install-pdf-recursive install-ps-recursive install-recursive \
-	installcheck-recursive installdirs-recursive pdf-recursive \
-	ps-recursive uninstall-recursive
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(docdir)"
-DATA = $(nobase_doc_DATA)
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
-  distclean-recursive maintainer-clean-recursive
-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
-	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir dist dist-all distcheck
-ETAGS = etags
-CTAGS = ctags
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
-  { test ! -d "$(distdir)" \
-    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr "$(distdir)"; }; }
-am__relativize = \
-  dir0=`pwd`; \
-  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
-  sed_rest='s,^[^/]*/*,,'; \
-  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
-  sed_butlast='s,/*[^/]*$$,,'; \
-  while test -n "$$dir1"; do \
-    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
-    if test "$$first" != "."; then \
-      if test "$$first" = ".."; then \
-        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
-        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
-      else \
-        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
-        if test "$$first2" = "$$first"; then \
-          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
-        else \
-          dir2="../$$dir2"; \
-        fi; \
-        dir0="$$dir0"/"$$first"; \
-      fi; \
-    fi; \
-    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
-  done; \
-  reldir="$$dir2"
-DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
-distuninstallcheck_listfiles = find . -type f -print
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LRELEASE = @LRELEASE@
-LTLIBOBJS = @LTLIBOBJS@
-LUPDATE = @LUPDATE@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-MOC = @MOC@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-QT_CXXFLAGS = @QT_CXXFLAGS@
-QT_LDADD = @QT_LDADD@
-QT_LIB_GUI = @QT_LIB_GUI@
-RANLIB = @RANLIB@
-RCC = @RCC@
-RPMSOURCEDIR = @RPMSOURCEDIR@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-UIC = @UIC@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign 1.4
-SUBDIRS = lib ica ima setup $(subdirs) $(EXTRA_TARGETS)
-ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = build_mingw32 build_mingw64 tightvnc4win_integrate tightvnc4win_italc.diff README.LZO
-nobase_doc_DATA = AUTHORS ChangeLog COPYING INSTALL README README.LZO TODO
-all: config.h
-	$(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-am--refresh:
-	@:
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
-	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
-		&& exit 0; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    echo ' $(SHELL) ./config.status'; \
-	    $(SHELL) ./config.status;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	$(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	$(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-config.h: stamp-h1
-	@if test ! -f $@; then \
-	  rm -f stamp-h1; \
-	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
-	else :; fi
-
-stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
-	@rm -f stamp-h1
-	cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in:  $(am__configure_deps) 
-	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
-	rm -f stamp-h1
-	touch $@
-
-distclean-hdr:
-	-rm -f config.h stamp-h1
-italc.spec: $(top_builddir)/config.status $(srcdir)/italc.spec.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
-iTALC.nsi: $(top_builddir)/config.status $(srcdir)/iTALC.nsi.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
-ima/data/italc: $(top_builddir)/config.status $(top_srcdir)/ima/data/italc.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
-ima/data/italc.desktop: $(top_builddir)/config.status $(top_srcdir)/ima/data/italc.desktop.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-distclean-libtool:
-	-rm -f libtool config.lt
-install-nobase_docDATA: $(nobase_doc_DATA)
-	@$(NORMAL_INSTALL)
-	test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
-	@list='$(nobase_doc_DATA)'; test -n "$(docdir)" || list=; \
-	$(am__nobase_list) | while read dir files; do \
-	  xfiles=; for file in $$files; do \
-	    if test -f "$$file"; then xfiles="$$xfiles $$file"; \
-	    else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
-	  test -z "$$xfiles" || { \
-	    test "x$$dir" = x. || { \
-	      echo "$(MKDIR_P) '$(DESTDIR)$(docdir)/$$dir'"; \
-	      $(MKDIR_P) "$(DESTDIR)$(docdir)/$$dir"; }; \
-	    echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(docdir)/$$dir'"; \
-	    $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(docdir)/$$dir" || exit $$?; }; \
-	done
-
-uninstall-nobase_docDATA:
-	@$(NORMAL_UNINSTALL)
-	@list='$(nobase_doc_DATA)'; test -n "$(docdir)" || list=; \
-	$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(docdir)" && rm -f $$files
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
-$(RECURSIVE_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	target=`echo $@ | sed s/-recursive//`; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    dot_seen=yes; \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done; \
-	if test "$$dot_seen" = "no"; then \
-	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
-	fi; test -z "$$fail"
-
-$(RECURSIVE_CLEAN_TARGETS):
-	@fail= failcom='exit 1'; \
-	for f in x $$MAKEFLAGS; do \
-	  case $$f in \
-	    *=* | --[!k]*);; \
-	    *k*) failcom='fail=yes';; \
-	  esac; \
-	done; \
-	dot_seen=no; \
-	case "$@" in \
-	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
-	  *) list='$(SUBDIRS)' ;; \
-	esac; \
-	rev=''; for subdir in $$list; do \
-	  if test "$$subdir" = "."; then :; else \
-	    rev="$$subdir $$rev"; \
-	  fi; \
-	done; \
-	rev="$$rev ."; \
-	target=`echo $@ | sed s/-recursive//`; \
-	for subdir in $$rev; do \
-	  echo "Making $$target in $$subdir"; \
-	  if test "$$subdir" = "."; then \
-	    local_target="$$target-am"; \
-	  else \
-	    local_target="$$target"; \
-	  fi; \
-	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-	  || eval $$failcom; \
-	done && test -z "$$fail"
-tags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
-	done
-ctags-recursive:
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
-	done
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
-	  include_option=--etags-include; \
-	  empty_fix=.; \
-	else \
-	  include_option=--include; \
-	  empty_fix=; \
-	fi; \
-	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test ! -f $$subdir/TAGS || \
-	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
-	  fi; \
-	done; \
-	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	$(am__remove_distdir)
-	test -d "$(distdir)" || mkdir "$(distdir)"
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
-	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
-	    $(am__relativize); \
-	    new_distdir=$$reldir; \
-	    dir1=$$subdir; dir2="$(top_distdir)"; \
-	    $(am__relativize); \
-	    new_top_distdir=$$reldir; \
-	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
-	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
-	    ($(am__cd) $$subdir && \
-	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$new_top_distdir" \
-	        distdir="$$new_distdir" \
-		am__remove_distdir=: \
-		am__skip_length_check=: \
-		am__skip_mode_fix=: \
-	        distdir) \
-	      || exit 1; \
-	  fi; \
-	done
-	$(MAKE) $(AM_MAKEFLAGS) \
-	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
-	  dist-hook
-	-test -n "$(am__skip_mode_fix)" \
-	|| find "$(distdir)" -type d ! -perm -755 \
-		-exec chmod u+rwx,go+rx {} \; -o \
-	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
-	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
-	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
-	|| chmod -R a+r "$(distdir)"
-dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
-
-dist-bzip2: distdir
-	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
-	$(am__remove_distdir)
-
-dist-lzma: distdir
-	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-	$(am__remove_distdir)
-
-dist-xz: distdir
-	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
-	$(am__remove_distdir)
-
-dist-tarZ: distdir
-	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-	$(am__remove_distdir)
-
-dist-shar: distdir
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-	$(am__remove_distdir)
-
-dist-zip: distdir
-	-rm -f $(distdir).zip
-	zip -rq $(distdir).zip $(distdir)
-	$(am__remove_distdir)
-
-dist dist-all: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration.  Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
-	case '$(DIST_ARCHIVES)' in \
-	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
-	*.tar.bz2*) \
-	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
-	*.tar.lzma*) \
-	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
-	*.tar.xz*) \
-	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
-	*.tar.Z*) \
-	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
-	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
-	*.zip*) \
-	  unzip $(distdir).zip ;;\
-	esac
-	chmod -R a-w $(distdir); chmod a+w $(distdir)
-	mkdir $(distdir)/_build
-	mkdir $(distdir)/_inst
-	chmod a-w $(distdir)
-	test -d $(distdir)/_build || exit 0; \
-	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
-	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build \
-	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
-	    $(DISTCHECK_CONFIGURE_FLAGS) \
-	  && $(MAKE) $(AM_MAKEFLAGS) \
-	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
-	  && $(MAKE) $(AM_MAKEFLAGS) check \
-	  && $(MAKE) $(AM_MAKEFLAGS) install \
-	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
-	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
-	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
-	        distuninstallcheck \
-	  && chmod -R a-w "$$dc_install_base" \
-	  && ({ \
-	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
-	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
-	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
-	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
-	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
-	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
-	  && rm -rf "$$dc_destdir" \
-	  && $(MAKE) $(AM_MAKEFLAGS) dist \
-	  && rm -rf $(DIST_ARCHIVES) \
-	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
-	  && cd "$$am__cwd" \
-	  || exit 1
-	$(am__remove_distdir)
-	@(echo "$(distdir) archives ready for distribution: "; \
-	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
-	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
-distuninstallcheck:
-	@$(am__cd) '$(distuninstallcheck_dir)' \
-	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
-	   || { echo "ERROR: files left after uninstall:" ; \
-	        if test -n "$(DESTDIR)"; then \
-	          echo "  (check DESTDIR support)"; \
-	        fi ; \
-	        $(distuninstallcheck_listfiles) ; \
-	        exit 1; } >&2
-distcleancheck: distclean
-	@if test '$(srcdir)' = . ; then \
-	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
-	  exit 1 ; \
-	fi
-	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
-	  || { echo "ERROR: files left in build directory after distclean:" ; \
-	       $(distcleancheck_listfiles) ; \
-	       exit 1; } >&2
-check-am: all-am
-check: check-recursive
-all-am: Makefile $(DATA) config.h
-installdirs: installdirs-recursive
-installdirs-am:
-	for dir in "$(DESTDIR)$(docdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-distclean: distclean-recursive
-	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-hdr \
-	distclean-libtool distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am:
-
-html: html-recursive
-
-html-am:
-
-info: info-recursive
-
-info-am:
-
-install-data-am: install-nobase_docDATA
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am:
-
-install-exec-am:
-	@$(NORMAL_INSTALL)
-	$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
-install-html: install-html-recursive
-
-install-html-am:
-
-install-info: install-info-recursive
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am:
-
-install-ps: install-ps-recursive
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
-	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-	-rm -rf $(top_srcdir)/autom4te.cache
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-recursive
-
-pdf-am:
-
-ps: ps-recursive
-
-ps-am:
-
-uninstall-am: uninstall-nobase_docDATA
-
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
-	ctags-recursive install-am install-exec-am install-strip \
-	tags-recursive
-
-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am am--refresh check check-am clean clean-generic \
-	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
-	dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
-	dist-zip distcheck distclean distclean-generic distclean-hdr \
-	distclean-libtool distclean-tags distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-exec-hook \
-	install-html install-html-am install-info install-info-am \
-	install-man install-nobase_docDATA install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am uninstall-nobase_docDATA
-
-
-%.ts:
-	cd lib && make $@
-
-%.qm:
-	cd lib && make $@
-
-dist-hook:
-	rm -rf `find $(distdir) -name *.moc`
-	rm -rf `find $(distdir) -name *_qrc.cpp`
-
-# strip all binaries after installation
-install-exec-hook:
-	cd $(DESTDIR)$(bindir) ; \
-	strip ica; \
-	strip italc
-
- at HAVE_RPM_TRUE@$(PACKAGE)-$(VERSION).tar.gz: dist
-
-# Rule to build RPM distribution package
- at HAVE_RPM_TRUE@rpm: $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE).spec
- at HAVE_RPM_TRUE@	cp $(PACKAGE)-$(VERSION).tar.gz @RPMSOURCEDIR@
- at HAVE_RPM_TRUE@	rpmbuild -ba $(PACKAGE).spec
-
-#CLEANFILES = config.log config.status
-clean: clean-recursive
-	rm -f config.log
-	rm -f config.status
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
- at BUILD_WIN32_TRUE@win32-pkg: all
- at BUILD_WIN32_TRUE@	mkdir -p tmp/italc
- at BUILD_WIN32_TRUE@	cp lib/italc_core.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp ica/.libs/ica.exe tmp/italc
- at BUILD_WIN32_TRUE@	cp ica/vnchooks.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp ima/.libs/italc.exe tmp/italc
- at BUILD_WIN32_TRUE@	cp setup/.libs/setup.exe tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw32/bin/QtCore4.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw32/bin/QtGui4.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw32/bin/QtNetwork4.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw32/bin/QtXml4.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw32/bin/libeay32.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw32/bin/libjpeg-8.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw32/bin/libssl32.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw32/bin/zlib1.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp -L COPYING tmp/italc/LICENSE.TXT
- at BUILD_WIN32_TRUE@	cp -L README tmp/italc/README.TXT
- at BUILD_WIN32_TRUE@	/opt/mingw32/bin/i686-w64-mingw32-strip tmp/italc/ica.exe
- at BUILD_WIN32_TRUE@	/opt/mingw32/bin/i686-w64-mingw32-strip tmp/italc/italc.exe
- at BUILD_WIN32_TRUE@	/opt/mingw32/bin/i686-w64-mingw32-strip tmp/italc/setup.exe
- at BUILD_WIN32_TRUE@	mv tmp/italc tmp/italc-$(VERSION)
- at BUILD_WIN32_TRUE@	cd tmp && zip -9 ../$(PACKAGE)-$(VERSION)-bin-win32.zip italc-$(VERSION)/*
- at BUILD_WIN32_TRUE@	rm -rf tmp
-
- at BUILD_WIN32_TRUE@win32-nsi: win32-pkg
- at BUILD_WIN32_TRUE@	unzip $(PACKAGE)-$(VERSION)-bin-win32.zip
- at BUILD_WIN32_TRUE@	makensis iTALC.nsi
- at BUILD_WIN32_TRUE@	rm -rf italc-$(VERSION)
- at BUILD_WIN32_TRUE@	mv italc-$(VERSION)-setup.exe italc-$(VERSION)-win32-setup.exe
-
- at BUILD_WIN32_TRUE@win64-pkg: all
- at BUILD_WIN32_TRUE@	mkdir -p tmp/italc
- at BUILD_WIN32_TRUE@	cp lib/italc_core.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp ica/.libs/ica.exe tmp/italc
- at BUILD_WIN32_TRUE@	cp ica/vnchooks.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp ima/.libs/italc.exe tmp/italc
- at BUILD_WIN32_TRUE@	cp setup/.libs/setup.exe tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw64/bin/QtCore4.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw64/bin/QtGui4.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw64/bin/QtNetwork4.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw64/bin/QtXml4.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw64/bin/libeay32.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw64/bin/libjpeg-8.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw64/bin/libssl32.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp /opt/mingw64/bin/zlib1.dll tmp/italc
- at BUILD_WIN32_TRUE@	cp -L COPYING tmp/italc/LICENSE.TXT
- at BUILD_WIN32_TRUE@	cp -L README tmp/italc/README.TXT
- at BUILD_WIN32_TRUE@	/opt/mingw64/bin/x86_64-w64-mingw32-strip tmp/italc/ica.exe
- at BUILD_WIN32_TRUE@	/opt/mingw64/bin/x86_64-w64-mingw32-strip tmp/italc/italc.exe
- at BUILD_WIN32_TRUE@	/opt/mingw64/bin/x86_64-w64-mingw32-strip tmp/italc/setup.exe
- at BUILD_WIN32_TRUE@	mv tmp/italc tmp/italc-$(VERSION)
- at BUILD_WIN32_TRUE@	cd tmp && zip -9 ../$(PACKAGE)-$(VERSION)-bin-win64.zip italc-$(VERSION)/*
- at BUILD_WIN32_TRUE@	rm -rf tmp
-
- at BUILD_WIN32_TRUE@win64-nsi: win64-pkg
- at BUILD_WIN32_TRUE@	unzip $(PACKAGE)-$(VERSION)-bin-win64.zip
- at BUILD_WIN32_TRUE@	makensis iTALC.nsi
- at BUILD_WIN32_TRUE@	rm -rf italc-$(VERSION)
- at BUILD_WIN32_TRUE@	mv italc-$(VERSION)-setup.exe italc-$(VERSION)-win64-setup.exe
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/NEWS b/NEWS
deleted file mode 100644
index e69de29..0000000
diff --git a/README b/README
index 81948f6..0523133 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-iTALC 1.0.13 - Intelligent Teaching and Learning with Computers
+iTALC 2.0.0 - Intelligent Teaching and Learning with Computers
 ===============================================================
 
 
@@ -48,10 +48,10 @@ How to build, install and setup iTALC
 ---------------------------------------
 
 * Linux:
-   configure, make and make install - see INSTALL for details.
+   run CMake, make and make install - see INSTALL for details.
 
 * Windows:
-   run setup.exe
+   run setup file
 
 
 
diff --git a/README.LZO b/README.LZO
index 3700f28..c0bf7ee 100644
--- a/README.LZO
+++ b/README.LZO
@@ -6,8 +6,8 @@
  Author  : Markus Franz Xaver Johannes Oberhumer
            <markus at oberhumer.com>
            http://www.oberhumer.com/opensource/lzo/
- Version : 2.03
- Date    : 30 Apr 2008
+ 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
@@ -24,10 +24,10 @@
 
  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.
+ Note: you also must distribute this file ('README.LZO') with your project.
 
- minilzo.o compiles to about 6 kB (using gcc or Visual C on a i386), and
- the sources are about 30 kB when packed with zip - so there's no more
+ 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
@@ -49,15 +49,15 @@
  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(char *) != sizeof(long)'.
+ 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_CHAR_P=8' to your Makefile.
+ 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
+ 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.in.
+ how to set up configure.ac.
 
 
  Appendix B: list of public functions available in miniLZO
@@ -87,7 +87,7 @@
     lzo_memset()
 
 
- Appendix C: suggested macros for `configure.in' when using Autoconf
+ Appendix C: suggested macros for 'configure.ac' when using Autoconf
  -------------------------------------------------------------------
  Checks for typedefs and structures
     AC_CHECK_TYPE(ptrdiff_t,long)
@@ -110,8 +110,9 @@
 
  Appendix D: Copyright
  ---------------------
- LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer
+ 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.
diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644
index 848d63d..0000000
--- a/acinclude.m4
+++ /dev/null
@@ -1,769 +0,0 @@
-# Check for Qt compiler flags, linker flags, and binary packages
-AC_DEFUN([gw_CHECK_QT],
-[
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([AC_PATH_X])
-
-AC_MSG_CHECKING([QTDIR])
-AC_ARG_WITH([qtdir], [  --with-qtdir=DIR        Qt installation directory [default=$QTDIR]], QTDIR=$withval)
-# Check that QTDIR is defined or that --with-qtdir given
-if test x"$QTDIR" = x ; then
-	# some usual Qt-locations
-	QT_SEARCH="/usr /usr/lib/qt /usr/lib64/qt4 /usr/lib/qt4 /usr/X11R6 /usr/local/Trolltech/Qt-4.2.0 /usr/local/Trolltech/Qt-4.2.1 /usr/local/Trolltech/Qt-4.2.2 /usr/local/Trolltech/Qt-4.2.3 /usr/local/Trolltech/Qt-4.3.0 /usr/local/Trolltech/Qt-4.3.1 /usr/local/Trolltech/Qt-4.3.2"
-else
-	QT_SEARCH=$QTDIR
-	QTDIR=""
-fi
-for i in $QT_SEARCH ; do
-	QT_INCLUDE_SEARCH="include/qt4 include"
-	for j in $QT_INCLUDE_SEARCH ; do
-	        if test -f $i/$j/Qt/qglobal.h -a x$QTDIR = x ; then
-			QTDIR=$i
-			QT_INCLUDES=$i/$j
-		fi
-	done
-done
-if test x"$QTDIR" = x ; then
-	AC_MSG_ERROR([*** QTDIR must be defined, or --with-qtdir option given])
-fi
-AC_MSG_RESULT([$QTDIR])
-
-# Change backslashes in QTDIR to forward slashes to prevent escaping
-# problems later on in the build process, mainly for Cygwin build
-# environment using MSVC as the compiler
-QTDIR=`echo $QTDIR | sed 's/\\\\/\\//g'`
-
-AC_MSG_CHECKING([Qt includes])
-# Check where includes are located
-if test x"$QT_INCLUDES" = x ; then
-	AC_MSG_ERROR([*** could not find Qt-includes! Make sure you have the Qt-devel-files installed!])
-fi
-AC_MSG_RESULT([$QT_INCLUDES])
-
-
-if test -z "$QTHOSTDIR" ; then
-	case "${prefix}" in
-		/opt/mingw*)
-			QTHOSTDIR=${prefix}
-			;;
-		*)
-			if test -n "$QTDIR" ; then
-				QTHOSTDIR="$QTDIR"
-			else
-				QTHOSTDIR=/usr
-			fi
-			;;
-	esac
-fi
-
-
-# Check that moc is in path
-AC_CHECK_PROG(MOC, moc-qt4, $QTHOSTDIR/bin/moc-qt4,,$QTHOSTDIR/bin/)
-if test x$MOC = x ; then
-	AC_CHECK_PROG(MOC, moc, $QTHOSTDIR/bin/moc,,$QTHOSTDIR/bin/)
-	if test x$MOC = x ; then
-        	AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!])
-	fi
-fi
-
-# Check that uic is in path
-AC_CHECK_PROG(UIC, uic-qt4, $QTHOSTDIR/bin/uic-qt4,,$QTHOSTDIR/bin/)
-if test x$UIC = x ; then
-	AC_CHECK_PROG(UIC, uic, $QTHOSTDIR/bin/uic,,$QTHOSTDIR/bin/)
-	if test x$UIC = x ; then
-        	AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!])
-	fi
-fi
-
-# Check that rcc is in path
-AC_CHECK_PROG(RCC, rcc-qt4, $QTHOSTDIR/bin/rcc-qt4,,$QTHOSTDIR/bin/)
-if test x$RCC = x ; then
-	AC_CHECK_PROG(RCC, rcc, $QTHOSTDIR/bin/rcc,,$QTHOSTDIR/bin/)
-	if test x$RCC = x ; then
-        	AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!])
-	fi
-fi
-
-# lupdate is the Qt translation-update utility.
-AC_CHECK_PROG(LUPDATE, lupdate-qt4, $QTHOSTDIR/bin/lupdate-qt4,,$QTHOSTDIR/bin/)
-if test x$LUPDATE = x ; then
-	AC_CHECK_PROG(LUPDATE, lupdate, $QTHOSTDIR/bin/lupdate,,$QTHOSTDIR/bin/)
-	if test x$LUPDATE = x ; then
-	        AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!])
-	fi
-fi
-
-# lrelease is the Qt translation-release utility.
-AC_CHECK_PROG(LRELEASE, lrelease-qt4, $QTHOSTDIR/bin/lrelease-qt4,,$QTHOSTDIR/bin/)
-if test x$LRELEASE = x ; then
-	AC_CHECK_PROG(LRELEASE, lrelease, $QTHOSTDIR/bin/lrelease,,$QTHOSTDIR/bin/)
-	if test x$LRELEASE = x ; then
-	        AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!])
-	fi
-fi
-
-# construct CXXFLAGS
-QT_CXXFLAGS="-I$QT_INCLUDES -I$QT_INCLUDES/Qt -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_XML_LIB -DQT_THREAD_SUPPORT"
-
-AC_MSG_CHECKING([QT_CXXFLAGS])
-AC_MSG_RESULT([$QT_CXXFLAGS])
-
-
-# check libraries
-AC_MSG_CHECKING([Qt4 libraries])
-
-case "${host}" in
-      *mingw32)
-        QT_LIBS=`ls $QTDIR/lib/libQt*.a 2> /dev/null` 
-        if test "x$QT_LIBS" = x;  then
-            AC_MSG_ERROR([*** Couldn't find any Qt4 libraries])
-        fi
-	QT_LIB="-L$QTDIR/bin -lQtCore4 -lQtXml4 -lQtNetwork4 -lws2_32"
-	QT_LIB_GUI="-lQtGui4"
-	# Check that windres is in path
-	AC_PATH_PROGS([WINDRES],[${host}-windres windres],,[${prefix}/bin:$PATH])
-	if test x$WINDRES = x ; then
-		AC_MSG_ERROR([*** not found! Make sure you have mingw32 binutils installed!])
-	fi
-        ;;
-    *)
-       	QT_LIBS=`ls $QTDIR/lib64/libQt*.so 2> /dev/null` 
-        if test "x$QT_LIBS" = x;  then
-        	QT_LIBS=`ls $QTDIR/lib/libQt*.so 2> /dev/null` 
-            	if test "x$QT_LIBS" = x;  then
-			AC_MSG_ERROR([*** Couldn't find any Qt4 libraries])
-            	fi
-		QT_LIB="-L$QTDIR/lib -L$QTDIR/lib/qt4"
-	else
-		QT_LIB="-L$QTDIR/lib64 -L$QTDIR/lib64/qt4"
-        fi
- 	QT_LIB="$QT_LIB -lQtCore -lQtXml -lQtNetwork"
-	QT_LIB_GUI="-lQtGui"
-        ;;
-esac
-AC_MSG_RESULT([found: $QT_LIB])
-
-QT_LDADD="$QT_LIB"
-
-
-
-
-AC_SUBST(QT_CXXFLAGS)
-AC_SUBST(QT_LDADD)
-AC_SUBST(QT_LIB_GUI)
-
-])
-
-
-AH_TEMPLATE(socklen_t, [The type for socklen])
-AC_DEFUN([AC_TYPE_SOCKLEN_T],
-[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
-[
-  AC_TRY_COMPILE(
-  [#include <sys/types.h>
-   #include <sys/socket.h>],
-  [socklen_t len = 42; return 0;],
-  ac_cv_type_socklen_t=yes,
-  ac_cv_type_socklen_t=no)
-])
-  if test $ac_cv_type_socklen_t != yes; then
-    AC_DEFINE(socklen_t, int)
-  fi
-])
-
-
-
-
-dnl Available from the GNU Autoconf Macro Archive at:
-dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_compile_check_sizeof.html
-dnl
-AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
-[changequote(<<, >>)dnl
-dnl The name to #define.
-define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
-dnl The cache variable name.
-define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
-changequote([, ])dnl
-AC_MSG_CHECKING(size of $1)
-AC_CACHE_VAL(AC_CV_NAME,
-[for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence.
-  AC_TRY_COMPILE([#include "confdefs.h"
-#include <sys/types.h>
-$2
-], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
-  if test x$AC_CV_NAME != x ; then break; fi
-done
-])
-if test x$AC_CV_NAME = x ; then
-  AC_MSG_ERROR([cannot determine a size for $1])
-fi
-AC_MSG_RESULT($AC_CV_NAME)
-AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
-undefine([AC_TYPE_NAME])dnl
-undefine([AC_CV_NAME])dnl
-])
-
-
-
-
-dnl Available from the GNU Autoconf Macro Archive at:
-dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_create_stdint_h.html
-dnl
-AC_DEFUN([AC_CREATE_STDINT_H],
-[# ------ AC CREATE STDINT H -------------------------------------
-AC_MSG_CHECKING([for stdint-types....])
-ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
-if test "$ac_stdint_h" = "stdint.h" ; then
- AC_MSG_RESULT("(are you sure you want them in ./stdint.h?)")
-elif test "$ac_stdint_h" = "inttypes.h" ; then
- AC_MSG_RESULT("(are you sure you want them in ./inttypes.h?)")
-else
- AC_MSG_RESULT("(putting them into $ac_stdint_h)")
-fi
-
-inttype_headers=`echo inttypes.h sys/inttypes.h sys/inttypes.h $2 \
-| sed -e 's/,/ /g'`
-
- ac_cv_header_stdint_x="no-file"
- ac_cv_header_stdint_o="no-file"
- ac_cv_header_stdint_u="no-file"
- for i in stdint.h $inttype_headers ; do
-   unset ac_cv_type_uintptr_t
-   unset ac_cv_type_uint64_t
-   _AC_CHECK_TYPE_NEW(uintptr_t,[ac_cv_header_stdint_x=$i],dnl
-     continue,[#include <$i>])
-   AC_CHECK_TYPE(uint64_t,[and64="(uint64_t too)"],[and64=""],[#include<$i>])
-   AC_MSG_RESULT(... seen our uintptr_t in $i $and64)
-   break;
- done
- if test "$ac_cv_header_stdint_x" = "no-file" ; then
- for i in stdint.h $inttype_headers ; do
-   unset ac_cv_type_uint32_t
-   unset ac_cv_type_uint64_t
-   AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],dnl
-     continue,[#include <$i>])
-   AC_CHECK_TYPE(uint64_t,[and64="(uint64_t too)"],[and64=""],[#include<$i>])
-   AC_MSG_RESULT(... seen our uint32_t in $i $and64)
-   break;
- done
- if test "$ac_cv_header_stdint_o" = "no-file" ; then
- for i in sys/types.h $inttype_headers ; do
-   unset ac_cv_type_u_int32_t
-   unset ac_cv_type_u_int64_t
-   AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],dnl
-     continue,[#include <$i>])
-   AC_CHECK_TYPE(uint64_t,[and64="(u_int64_t too)"],[and64=""],[#include<$i>])
-   AC_MSG_RESULT(... seen our u_int32_t in $i $and64)
-   break;
- done
- fi
- fi
-
-# ----------------- DONE inttypes.h checks MAYBE C basic types --------
-
-if test "$ac_cv_header_stdint_x" = "no-file" ; then
-   AC_COMPILE_CHECK_SIZEOF(char)
-   AC_COMPILE_CHECK_SIZEOF(short)
-   AC_COMPILE_CHECK_SIZEOF(int)
-   AC_COMPILE_CHECK_SIZEOF(long)
-   AC_COMPILE_CHECK_SIZEOF(void*)
-   ac_cv_header_stdint_test="yes"
-else
-   ac_cv_header_stdint_test="no"
-fi
-
-# ----------------- DONE inttypes.h checks START header -------------
-_ac_stdint_h=AS_TR_CPP(_$ac_stdint_h)
-AC_MSG_RESULT(creating $ac_stdint_h : $_ac_stdint_h)
-echo "#ifndef" $_ac_stdint_h >$ac_stdint_h
-echo "#define" $_ac_stdint_h "1" >>$ac_stdint_h
-echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint_h
-echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint_h
-if test "$GCC" = "yes" ; then
-  echo "/* generated using a gnu compiler version" `$CC --version` "*/" \
-  >>$ac_stdint_h
-else
-  echo "/* generated using $CC */" >>$ac_stdint_h
-fi
-echo "" >>$ac_stdint_h
-
-if test "$ac_cv_header_stdint_x" != "no-file" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_x"
-elif  test "$ac_cv_header_stdint_o" != "no-file" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_o"
-elif  test "$ac_cv_header_stdint_u" != "no-file" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_u"
-else
-   ac_cv_header_stdint="stddef.h"
-fi
-
-# ----------------- See if int_least and int_fast types are present
-unset ac_cv_type_int_least32_t
-unset ac_cv_type_int_fast32_t
-AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
-AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
-
-if test "$ac_cv_header_stdint" != "stddef.h" ; then
-if test "$ac_cv_header_stdint" != "stdint.h" ; then
-AC_MSG_RESULT(..adding include stddef.h)
-   echo "#include <stddef.h>" >>$ac_stdint_h
-fi ; fi
-AC_MSG_RESULT(..adding include $ac_cv_header_stdint)
-   echo "#include <$ac_cv_header_stdint>" >>$ac_stdint_h
-echo "" >>$ac_stdint_h
-
-# ----------------- DONE header START basic int types -------------
-if test "$ac_cv_header_stdint_x" = "no-file" ; then
-   AC_MSG_RESULT(... need to look at C basic types)
-dnl ac_cv_header_stdint_test="yes" # moved up before creating the file
-else
-   AC_MSG_RESULT(... seen good stdint.h inttypes)
-dnl ac_cv_header_stdint_test="no"  # moved up before creating the file
-fi
-
-if test "$ac_cv_header_stdint_u" != "no-file" ; then
-   AC_MSG_RESULT(... seen bsd/sysv typedefs)
-   cat >>$ac_stdint_h <<EOF
-
-/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
-typedef u_int8_t uint8_t;
-typedef u_int16_t uint16_t;
-typedef u_int32_t uint32_t;
-EOF
-    cat >>$ac_stdint_h <<EOF
-
-/* glibc compatibility */
-#ifndef __int8_t_defined
-#define __int8_t_defined
-#endif
-EOF
-fi
-
-ac_cv_sizeof_x="$ac_cv_sizeof_char:$ac_cv_sizeof_short"
-ac_cv_sizeof_X="$ac_cv_sizeof_x:$ac_cv_sizeof_int"
-ac_cv_sizeof_X="$ac_cv_sizeof_X:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long"
-if test "$ac_cv_header_stdint" = "stddef.h" ; then
-#   we must guess all the basic types. Apart from byte-adressable system,
-# there a few 32-bit-only dsp-systems. nibble-addressable systems are way off.
-    cat >>$ac_stdint_h <<EOF
-/* ------------ BITSPECIFIC INTTYPES SECTION --------------- */
-EOF
-    t="typedefs for a"
-    case "$ac_cv_sizeof_X" in
-     1:2:2:2:4) AC_MSG_RESULT(..adding $t normal 16-bit system)
-                cat >>$ac_stdint_h <<EOF
-/*              a normal 16-bit system                       */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned long   uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          long    int32_t;
-#endif
-EOF
-;;
-     1:2:2:4:4) AC_MSG_RESULT(..adding $t 32-bit system derived from a 16-bit)
-                cat >>$ac_stdint_h <<EOF
-/*              a 32-bit system derived from a 16-bit        */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-EOF
-;;
-     1:2:4:4:4) AC_MSG_RESULT(..adding $t normal 32-bit system)
-                cat >>$ac_stdint_h <<EOF
-/*              a normal 32-bit system                       */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-EOF
-;;
-     1:2:4:4:8) AC_MSG_RESULT(..adding $t 32-bit system prepared for 64-bit)
-                cat >>$ac_stdint_h <<EOF
-
-/*              a 32-bit system prepared for 64-bit          */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-EOF
-;;
-     1:2:4:8:8) AC_MSG_RESULT(..adding $t normal 64-bit system)
-                cat >>$ac_stdint_h <<EOF
-
-/*              a normal 64-bit system                       */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-EOF
-;;
-     1:2:4:8:4) AC_MSG_RESULT(..adding $t 64-bit system derived from a 32-bit)
-                cat >>$ac_stdint_h <<EOF
-
-/*              a 64-bit system derived from a 32-bit system */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-EOF
-;;
-  *)
-    AC_MSG_ERROR([ $ac_cv_sizeof_X dnl
- what is that a system? contact the author, quick! http://ac-archive.sf.net])
-    exit 1
-;;
-   esac
-fi
-
-# ------------- DONE basic int types START int64_t types ------------
-if test "$ac_cv_type_uint64_t" = "yes"
-then AC_MSG_RESULT(... seen good uint64_t)
-     cat >>$ac_stdint_h <<EOF
-
-/* system headers have good uint64_t */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#endif
-EOF
-
-elif test "$ac_cv_type_u_int64_t" = "yes"
-then AC_MSG_RESULT(..adding typedef u_int64_t uint64_t)
-     cat >>$ac_stdint_h <<EOF
-
-/* system headers have an u_int64_t */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef u_int64_t uint64_t;
-#endif
-EOF
-else AC_MSG_RESULT(..adding generic uint64_t runtime checks)
-     cat >>$ac_stdint_h <<EOF
-
-/* -------------------- 64 BIT GENERIC SECTION -------------------- */
-/* here are some common heuristics using compiler runtime specifics */
-#if defined __STDC_VERSION__ && defined __STDC_VERSION__ > 199901L
-
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
-
-#elif !defined __STRICT_ANSI__
-#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
-
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#endif
-
-#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
-dnl /* note: all ELF-systems seem to have loff-support which needs 64-bit */
-
-#if !defined _NO_LONGLONG
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
-#endif
-
-#elif defined __alpha || (defined __mips && defined _ABIN32)
-
-#if !defined _NO_LONGLONG
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
-#endif
-  /* compiler/cpu type ... or just ISO C99 */
-#endif
-#endif
-EOF
-
-# plus a default 64-bit for systems that are likely to be 64-bit ready
-  case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" in
-    1:2:8:8) AC_MSG_RESULT(..adding uint64_t default, normal 64-bit system)
-cat >>$ac_stdint_h <<EOF
-/* DEFAULT: */
-/* seen normal 64-bit system, CC has sizeof(long and void*) == 8 bytes */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
-EOF
-;;
-    1:2:4:8) AC_MSG_RESULT(..adding uint64_t default, typedef to long)
-cat >>$ac_stdint_h <<EOF
-/* DEFAULT: */
-/* seen 32-bit system prepared for 64-bit, CC has sizeof(long) == 8 bytes */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
-EOF
-;;
-    1:2:8:4) AC_MSG_RESULT(..adding uint64_t default, typedef long long)
-cat >>$ac_stdint_h <<EOF
-/* DEFAULT: */
-/* seen 64-bit derived from a 32-bit, CC has sizeof(long) == 4 bytes */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
-EOF
-;;
-   *)
-cat >>$ac_stdint_h <<EOF
-/* NOTE: */
-/* the configure-checks for the basic types did not make us believe */
-/* that we could add a fallback to a 'long long' typedef to int64_t */
-EOF
-  esac
-fi
-
-# ------------- DONE int64_t types START intptr types ------------
-if test "$ac_cv_header_stdint_x" = "no-file" ; then
-  cat >>$ac_stdint_h <<EOF
-
-/* -------------------------- INPTR SECTION --------------------------- */
-EOF
-  case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp" in
-  1:2:2)
-    a="int16_t" ; cat >>$ac_stdint_h <<EOF
-/* we tested sizeof(void*) to be of 2 chars, hence we declare it 16-bit */
-
-typedef uint16_t uintptr_t;
-typedef  int16_t  intptr_t;
-EOF
-;;
-  1:2:4)
-    a="int32_t" ; cat >>$ac_stdint_h <<EOF
-/* we tested sizeof(void*) to be of 4 chars, hence we declare it 32-bit */
-
-typedef uint32_t uintptr_t;
-typedef  int32_t  intptr_t;
-EOF
-;;
-  1:2:8)
-    a="int64_t" ; cat >>$ac_stdint_h <<EOF
-/* we tested sizeof(void*) to be of 8 chars, hence we declare it 64-bit */
-
-typedef uint64_t uintptr_t;
-typedef  int64_t  intptr_t;
-EOF
-;;
-  *)
-    a="long" ; cat >>$ac_stdint_h <<EOF
-/* we tested sizeof(void*) but got no guess, hence we declare it as if long */
-
-typedef unsigned long uintptr_t;
-typedef          long  intptr_t;
-EOF
-;;
-  esac
-AC_MSG_RESULT(..adding typedef $a intptr_t)
-fi
-
-# ------------- DONE intptr types START int_least types ------------
-if test "$ac_cv_type_int_least32_t" = "no"; then
-AC_MSG_RESULT(..adding generic int_least-types)
-     cat >>$ac_stdint_h <<EOF
-
-/* --------------GENERIC INT_LEAST ------------------ */
-
-typedef  int8_t    int_least8_t;
-typedef  int16_t   int_least16_t;
-typedef  int32_t   int_least32_t;
-#ifdef _HAVE_INT64_T
-typedef  int64_t   int_least64_t;
-#endif
-
-typedef uint8_t   uint_least8_t;
-typedef uint16_t  uint_least16_t;
-typedef uint32_t  uint_least32_t;
-#ifdef _HAVE_INT64_T
-typedef uint64_t  uint_least64_t;
-#endif
-EOF
-fi
-
-# ------------- DONE intptr types START int_least types ------------
-if test "$ac_cv_type_int_fast32_t" = "no"; then
-AC_MSG_RESULT(..adding generic int_fast-types)
-     cat >>$ac_stdint_h <<EOF
-
-/* --------------GENERIC INT_FAST ------------------ */
-
-typedef  int8_t    int_fast8_t;
-typedef  int32_t   int_fast16_t;
-typedef  int32_t   int_fast32_t;
-#ifdef _HAVE_INT64_T
-typedef  int64_t   int_fast64_t;
-#endif
-
-typedef uint8_t   uint_fast8_t;
-typedef uint32_t  uint_fast16_t;
-typedef uint32_t  uint_fast32_t;
-#ifdef _HAVE_INT64_T
-typedef uint64_t  uint_fast64_t;
-#endif
-EOF
-fi
-
-if test "$ac_cv_header_stdint_x" = "no-file" ; then
-     cat >>$ac_stdint_h <<EOF
-
-#ifdef _HAVE_INT64_T
-typedef int64_t        intmax_t;
-typedef uint64_t      uintmax_t;
-#else
-typedef long int       intmax_t;
-typedef unsigned long uintmax_t;
-#endif
-EOF
-fi
-
-AC_MSG_RESULT(... DONE $ac_stdint_h)
-   cat >>$ac_stdint_h <<EOF
-
-  /* once */
-#endif
-#endif
-EOF
-])
-
-
-dnl quote from SunOS-5.8 sys/inttypes.h:
-dnl Use at your own risk.  As of February 1996, the committee is squarely
-dnl behind the fixed sized types; the "least" and "fast" types are still being
-dnl discussed.  The probability that the "fast" types may be removed before
-dnl the standard is finalized is high enough that they are not currently
-dnl implemented.
-
-dnl Available from the GNU Autoconf Macro Archive at:
-dnl http://www.gnu.org/software/ac-archive/htmldoc/ax_prefix_config_h.html
-dnl
-AC_DEFUN([AX_PREFIX_CONFIG_H],[AC_REQUIRE([AC_CONFIG_HEADER])
-AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl
-AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl
-AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl
-AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl
-AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl
-AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl
-AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl
-m4_pushdef([_script],[conftest.prefix])dnl
-m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
-_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)`
-_DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`
-_PKG=`echo ifelse($2, , LibVNCServer, $2)`
-_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`
-_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:"  -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
-_INP=`echo ifelse($3, , _, $3)`
-if test "$ac_prefix_conf_INP" = "_"; then
-   for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
-     test -f "$ac_prefix_conf_INP" && continue
-     case $ac_file in
-        *.h) test -f $ac_file && _INP=$ac_file ;;
-        *)
-     esac
-   done
-fi
-if test "$_INP" = "_"; then
-   case "$_OUT" in
-      */*) _INP=`basename "$_OUT"`
-      ;;
-      *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"`
-      ;;
-      *) _INP=config.h
-      ;;
-   esac
-fi
-if test -z "$_PKG" ; then
-   AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])
-else
-  if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then
-     _INP="$srcdir/$_INP"
-  fi fi
-  AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)
-  if test -f $_INP ; then
-    echo "s/@%:@undef  *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/" > _script
-    # no! these are things like socklen_t, const, vfork
-    # echo "s/@%:@undef  *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/" >> _script
-    echo "s/@%:@def[]ine  *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1 \\" >> _script
-    echo "@%:@def[]ine $_UPP""_\\1 \\2 \\" >> _script
-    echo "@%:@endif/" >>_script
-    # no! these are things like socklen_t, const, vfork
-    # echo "s/@%:@def[]ine  *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1 \\" >> _script
-    # echo "@%:@define $_LOW""_\\1 \\2 \\" >> _script
-    # echo "@%:@endif/" >> _script
-    # now executing _script on _DEF input to create _OUT output file
-    echo "@%:@ifndef $_DEF"      >$tmp/pconfig.h
-    echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h
-    echo ' ' >>$tmp/pconfig.h
-    echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h
-
-    sed -f _script $_INP >>$tmp/pconfig.h
-    echo ' ' >>$tmp/pconfig.h
-    echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h
-    echo "@%:@endif" >>$tmp/pconfig.h
-    if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then
-      AC_MSG_NOTICE([$_OUT is unchanged])
-    else
-      ac_dir=`AS_DIRNAME(["$_OUT"])`
-      AS_MKDIR_P(["$ac_dir"])
-      rm -f "$_OUT"
-      mv $tmp/pconfig.h "$_OUT"
-    fi
-#    cp _script _configs.sed
-  else
-    AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])
-  fi
-  rm -f conftest.*
-fi
-m4_popdef([_symbol])dnl
-m4_popdef([_script])dnl
-AS_VAR_POPDEF([_INP])dnl
-AS_VAR_POPDEF([_UPP])dnl
-AS_VAR_POPDEF([_LOW])dnl
-AS_VAR_POPDEF([_PKG])dnl
-AS_VAR_POPDEF([_DEF])dnl
-AS_VAR_POPDEF([_OUT])dnl
-],[PACKAGE="$PACKAGE"])])
-
-
diff --git a/aclocal.m4 b/aclocal.m4
deleted file mode 100644
index 7b99184..0000000
--- a/aclocal.m4
+++ /dev/null
@@ -1,969 +0,0 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-m4_ifndef([AC_AUTOCONF_VERSION],
-  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
-[m4_warning([this file was generated for autoconf 2.67.
-You have another version of autoconf.  It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
-
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.1], [],
-      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too.  Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.1])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
-  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
-
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory.  The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run.  This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-#    fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-#    fails if $ac_aux_dir is absolute,
-#    fails when called from a subdirectory in a VPATH build with
-#          a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
-#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-#   MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH.  The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL                                            -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 9
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
-  $1_TRUE=
-  $1_FALSE='#'
-else
-  $1_TRUE='#'
-  $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
-  AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 10
-
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery.  Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
-               [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_$1_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
-  fi
-  am__universal=false
-  m4_case([$1], [CC],
-    [case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac],
-    [CXX],
-    [case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac])
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_$1_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-])
-
-# Generate code to set up dependency tracking.              -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-#serial 5
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
-  # are listed without --file.  Let's play safe and only enable the eval
-  # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
-  shift
-  for mf
-  do
-    # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
-    # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`AS_DIRNAME("$mf")`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`AS_DIRNAME(["$file"])`
-      AS_MKDIR_P([$dirpart/$fdir])
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
-  done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
-     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 8
-
-# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
-AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
-
-# Do all the work for Automake.                             -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 16
-
-# This macro actually does too much.  Some checks are only needed if
-# your package does certain things.  But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out.  PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition.  After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
-dnl Autoconf wants to disallow AM_ names.  We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
-  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
-  # is not polluted with repeated "-I."
-  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
-  # test to see if srcdir already configured
-  if test -f $srcdir/config.status; then
-    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-  fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
-  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-			     [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
-		  [_AM_DEPENDENCIES(CC)],
-		  [define([AC_PROG_CC],
-			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
-		  [_AM_DEPENDENCIES(CXX)],
-		  [define([AC_PROG_CXX],
-			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-		  [_AM_DEPENDENCIES(OBJC)],
-		  [define([AC_PROG_OBJC],
-			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
-])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
-  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated.  The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $_am_arg | $_am_arg:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
-  esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\	*)
-    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
-  *)
-    install_sh="\${SHELL} $am_aux_dir/install-sh"
-  esac
-fi
-AC_SUBST(install_sh)])
-
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot.  For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
-  am__leading_dot=.
-else
-  am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Check to see how 'make' treats includes.	            -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-	@echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\	*)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
-else
-  am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
-fi
-])
-
-# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
-  [[\\/$]]* | ?:[[\\/]]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
-# Helper functions for option handling.                     -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 4
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# ------------------------------
-# Set option NAME.  Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane.    -*- Autoconf -*-
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 5
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name.  Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
-  *[[\\\"\#\$\&\'\`$am_lf]]*)
-    AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
-  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
-    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments.  Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
-
-   test "$[2]" = conftest.file
-   )
-then
-   # Ok.
-   :
-else
-   AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT(yes)])
-
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
-# specify the program used to strip binaries.  This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
-if test "$cross_compiling" != no; then
-  AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball.                            -*- Autoconf -*-
-
-# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 2
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-#     tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-#     $(am__untar) < result.tar
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
-     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
-     [m4_case([$1], [ustar],, [pax],,
-              [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
-  case $_am_tool in
-  gnutar)
-    for _am_tar in tar gnutar gtar;
-    do
-      AM_RUN_LOG([$_am_tar --version]) && break
-    done
-    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
-    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
-    am__untar="$_am_tar -xf -"
-    ;;
-  plaintar)
-    # Must skip GNU tar: if it does not support --format= it doesn't create
-    # ustar tarball either.
-    (tar --version) >/dev/null 2>&1 && continue
-    am__tar='tar chf - "$$tardir"'
-    am__tar_='tar chf - "$tardir"'
-    am__untar='tar xf -'
-    ;;
-  pax)
-    am__tar='pax -L -x $1 -w "$$tardir"'
-    am__tar_='pax -L -x $1 -w "$tardir"'
-    am__untar='pax -r'
-    ;;
-  cpio)
-    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
-    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
-    am__untar='cpio -i -H $1 -d'
-    ;;
-  none)
-    am__tar=false
-    am__tar_=false
-    am__untar=false
-    ;;
-  esac
-
-  # If the value was cached, stop now.  We just wanted to have am__tar
-  # and am__untar set.
-  test -n "${am_cv_prog_tar_$1}" && break
-
-  # tar/untar a dummy directory, and stop if the command works
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  echo GrepMe > conftest.dir/file
-  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
-  rm -rf conftest.dir
-  if test -s conftest.tar; then
-    AM_RUN_LOG([$am__untar <conftest.tar])
-    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
-  fi
-done
-rm -rf conftest.dir
-
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
-m4_include([m4/libtool.m4])
-m4_include([m4/ltoptions.m4])
-m4_include([m4/ltsugar.m4])
-m4_include([m4/ltversion.m4])
-m4_include([m4/lt~obsolete.m4])
-m4_include([acinclude.m4])
diff --git a/build_mingw32 b/build_mingw32
index c05b268..42d0e16 100755
--- a/build_mingw32
+++ b/build_mingw32
@@ -1,4 +1,6 @@
 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/
 
-./configure --prefix=$MINGW --build=`./config.guess` --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-qtdir=$MINGW --with-win32 CFLAGS="-Wno-write-strings" CXXFLAGS="-Wno-write-strings"
diff --git a/build_mingw64 b/build_mingw64
index 7b5c9d9..5639b40 100755
--- a/build_mingw64
+++ b/build_mingw64
@@ -1,4 +1,6 @@
 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/
 
-./configure --prefix=$MINGW --build=`./config.guess` --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-qtdir=$MINGW --with-win32 CFLAGS="-Wno-write-strings" CXXFLAGS="-Wno-write-strings"
diff --git a/cmake/modules/DetectMachine.cmake b/cmake/modules/DetectMachine.cmake
new file mode 100644
index 0000000..e0d4586
--- /dev/null
+++ b/cmake/modules/DetectMachine.cmake
@@ -0,0 +1,44 @@
+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)
+    IF(ITALC_HOST_X86_64)
+        SET(LIB_DIR lib64)
+    ELSE(ITALC_HOST_X86_64)
+        SET(LIB_DIR lib)
+    ENDIF(ITALC_HOST_X86_64)
+ENDIF(CMAKE_INSTALL_LIBDIR)
+
diff --git a/cmake/modules/FindPAM.cmake b/cmake/modules/FindPAM.cmake
new file mode 100644
index 0000000..3499836
--- /dev/null
+++ b/cmake/modules/FindPAM.cmake
@@ -0,0 +1,74 @@
+# - 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
new file mode 100644
index 0000000..ebc0c99
--- /dev/null
+++ b/cmake/modules/MinGWCrossCompile.cmake
@@ -0,0 +1,35 @@
+# 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
new file mode 100644
index 0000000..852832f
--- /dev/null
+++ b/cmake/modules/Qt4Hacks.cmake
@@ -0,0 +1,44 @@
+ 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
new file mode 100644
index 0000000..e2b837b
--- /dev/null
+++ b/cmake/modules/Win32Toolchain.cmake
@@ -0,0 +1,6 @@
+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
new file mode 100644
index 0000000..40bf539
--- /dev/null
+++ b/cmake/modules/Win64Toolchain.cmake
@@ -0,0 +1,10 @@
+SET(MINGW_PREFIX /opt/mingw64)
+SET(MINGW_PLATFORM win64)
+
+SET(CMAKE_SYSTEM_PROCESSOR x86_64)
+
+SET(WIN64 TRUE)
+
+
+INCLUDE(MinGWCrossCompile)
+
diff --git a/config.guess b/config.guess
deleted file mode 100755
index c2246a4..0000000
--- a/config.guess
+++ /dev/null
@@ -1,1502 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-#   Free Software Foundation, Inc.
-
-timestamp='2009-12-30'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the 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.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner.  Please send patches (context
-# diff format) to <config-patches at gnu.org> and include a ChangeLog
-# entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub.  If it succeeds, it prints the system name on stdout, and
-# exits with 0.  Otherwise, it exits with 1.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )	# Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help" >&2
-       exit 1 ;;
-    * )
-       break ;;
-  esac
-done
-
-if test $# != 0; then
-  echo "$me: too many arguments$help" >&2
-  exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-	for c in cc gcc c89 c99 ; do
-	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-	     CC_FOR_BUILD="$c"; break ;
-	  fi ;
-	done ;
-	if test x"$CC_FOR_BUILD" = x ; then
-	  CC_FOR_BUILD=no_compiler_found ;
-	fi
-	;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi at noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
-	PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
-    *:NetBSD:*:*)
-	# NetBSD (nbsd) targets should (where applicable) match one or
-	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
-	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
-	# switched to ELF, *-*-netbsd* would select the old
-	# object file format.  This provides both forward
-	# compatibility and a consistent mechanism for selecting the
-	# object file format.
-	#
-	# Note: NetBSD doesn't particularly care about the vendor
-	# portion of the name.  We always set it to "unknown".
-	sysctl="sysctl -n hw.machine_arch"
-	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
-	case "${UNAME_MACHINE_ARCH}" in
-	    armeb) machine=armeb-unknown ;;
-	    arm*) machine=arm-unknown ;;
-	    sh3el) machine=shl-unknown ;;
-	    sh3eb) machine=sh-unknown ;;
-	    sh5el) machine=sh5le-unknown ;;
-	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
-	esac
-	# The Operating System including object format, if it has switched
-	# to ELF recently, or will in the future.
-	case "${UNAME_MACHINE_ARCH}" in
-	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		eval $set_cc_for_build
-		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
-			| grep -q __ELF__
-		then
-		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
-		    # Return netbsd for either.  FIX?
-		    os=netbsd
-		else
-		    os=netbsdelf
-		fi
-		;;
-	    *)
-	        os=netbsd
-		;;
-	esac
-	# The OS release
-	# Debian GNU/NetBSD machines have a different userland, and
-	# thus, need a distinct triplet. However, they do not need
-	# kernel version information, so it can be replaced with a
-	# suitable tag, in the style of linux-gnu.
-	case "${UNAME_VERSION}" in
-	    Debian*)
-		release='-gnu'
-		;;
-	    *)
-		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
-		;;
-	esac
-	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
-	# contains redundant information, the shorter form:
-	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}"
-	exit ;;
-    *:OpenBSD:*:*)
-	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
-	exit ;;
-    *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
-	exit ;;
-    *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
-	exit ;;
-    macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
-	exit ;;
-    *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
-	exit ;;
-    alpha:OSF1:*:*)
-	case $UNAME_RELEASE in
-	*4.0)
-		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
-		;;
-	*5.*)
-	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
-		;;
-	esac
-	# According to Compaq, /usr/sbin/psrinfo has been available on
-	# OSF/1 and Tru64 systems produced since 1995.  I hope that
-	# covers most systems running today.  This code pipes the CPU
-	# types through head -n 1, so we only detect the type of CPU 0.
-	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
-	case "$ALPHA_CPU_TYPE" in
-	    "EV4 (21064)")
-		UNAME_MACHINE="alpha" ;;
-	    "EV4.5 (21064)")
-		UNAME_MACHINE="alpha" ;;
-	    "LCA4 (21066/21068)")
-		UNAME_MACHINE="alpha" ;;
-	    "EV5 (21164)")
-		UNAME_MACHINE="alphaev5" ;;
-	    "EV5.6 (21164A)")
-		UNAME_MACHINE="alphaev56" ;;
-	    "EV5.6 (21164PC)")
-		UNAME_MACHINE="alphapca56" ;;
-	    "EV5.7 (21164PC)")
-		UNAME_MACHINE="alphapca57" ;;
-	    "EV6 (21264)")
-		UNAME_MACHINE="alphaev6" ;;
-	    "EV6.7 (21264A)")
-		UNAME_MACHINE="alphaev67" ;;
-	    "EV6.8CB (21264C)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.8AL (21264B)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.8CX (21264D)")
-		UNAME_MACHINE="alphaev68" ;;
-	    "EV6.9A (21264/EV69A)")
-		UNAME_MACHINE="alphaev69" ;;
-	    "EV7 (21364)")
-		UNAME_MACHINE="alphaev7" ;;
-	    "EV7.9 (21364A)")
-		UNAME_MACHINE="alphaev79" ;;
-	esac
-	# A Pn.n version is a patched version.
-	# A Vn.n version is a released version.
-	# A Tn.n version is a released field test version.
-	# A Xn.n version is an unreleased experimental baselevel.
-	# 1.2 uses "1.2" for uname -r.
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	exit ;;
-    Alpha\ *:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# Should we change UNAME_MACHINE based on the output of uname instead
-	# of the specific Alpha model?
-	echo alpha-pc-interix
-	exit ;;
-    21064:Windows_NT:50:3)
-	echo alpha-dec-winnt3.5
-	exit ;;
-    Amiga*:UNIX_System_V:4.0:*)
-	echo m68k-unknown-sysv4
-	exit ;;
-    *:[Aa]miga[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-amigaos
-	exit ;;
-    *:[Mm]orph[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-morphos
-	exit ;;
-    *:OS/390:*:*)
-	echo i370-ibm-openedition
-	exit ;;
-    *:z/VM:*:*)
-	echo s390-ibm-zvmoe
-	exit ;;
-    *:OS400:*:*)
-        echo powerpc-ibm-os400
-	exit ;;
-    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-	echo arm-acorn-riscix${UNAME_RELEASE}
-	exit ;;
-    arm:riscos:*:*|arm:RISCOS:*:*)
-	echo arm-unknown-riscos
-	exit ;;
-    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
-	echo hppa1.1-hitachi-hiuxmpp
-	exit ;;
-    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
-	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-	if test "`(/bin/universe) 2>/dev/null`" = att ; then
-		echo pyramid-pyramid-sysv3
-	else
-		echo pyramid-pyramid-bsd
-	fi
-	exit ;;
-    NILE*:*:*:dcosx)
-	echo pyramid-pyramid-svr4
-	exit ;;
-    DRS?6000:unix:4.0:6*)
-	echo sparc-icl-nx6
-	exit ;;
-    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
-	case `/usr/bin/uname -p` in
-	    sparc) echo sparc-icl-nx7; exit ;;
-	esac ;;
-    s390x:SunOS:*:*)
-	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4H:SunOS:5.*:*)
-	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-	echo i386-pc-auroraux${UNAME_RELEASE}
-	exit ;;
-    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	eval $set_cc_for_build
-	SUN_ARCH="i386"
-	# If there is a compiler, see if it is configured for 64-bit objects.
-	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-	# This test works for both compilers.
-	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		SUN_ARCH="x86_64"
-	    fi
-	fi
-	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:6*:*)
-	# According to config.sub, this is the proper way to canonicalize
-	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
-	# it's likely to be more like Solaris than SunOS4.
-	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    sun4*:SunOS:*:*)
-	case "`/usr/bin/arch -k`" in
-	    Series*|S4*)
-		UNAME_RELEASE=`uname -v`
-		;;
-	esac
-	# Japanese Language versions have a version number like `4.1.3-JL'.
-	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
-	exit ;;
-    sun3*:SunOS:*:*)
-	echo m68k-sun-sunos${UNAME_RELEASE}
-	exit ;;
-    sun*:*:4.2BSD:*)
-	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
-	case "`/bin/arch`" in
-	    sun3)
-		echo m68k-sun-sunos${UNAME_RELEASE}
-		;;
-	    sun4)
-		echo sparc-sun-sunos${UNAME_RELEASE}
-		;;
-	esac
-	exit ;;
-    aushp:SunOS:*:*)
-	echo sparc-auspex-sunos${UNAME_RELEASE}
-	exit ;;
-    # The situation for MiNT is a little confusing.  The machine name
-    # can be virtually everything (everything which is not
-    # "atarist" or "atariste" at least should have a processor
-    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
-    # to the lowercase version "mint" (or "freemint").  Finally
-    # the system name "TOS" denotes a system which is actually not
-    # MiNT.  But MiNT is downward compatible to TOS, so this should
-    # be no problem.
-    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
-        exit ;;
-    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-        echo m68k-atari-mint${UNAME_RELEASE}
-	exit ;;
-    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-        echo m68k-milan-mint${UNAME_RELEASE}
-        exit ;;
-    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-        echo m68k-hades-mint${UNAME_RELEASE}
-        exit ;;
-    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-        echo m68k-unknown-mint${UNAME_RELEASE}
-        exit ;;
-    m68k:machten:*:*)
-	echo m68k-apple-machten${UNAME_RELEASE}
-	exit ;;
-    powerpc:machten:*:*)
-	echo powerpc-apple-machten${UNAME_RELEASE}
-	exit ;;
-    RISC*:Mach:*:*)
-	echo mips-dec-mach_bsd4.3
-	exit ;;
-    RISC*:ULTRIX:*:*)
-	echo mips-dec-ultrix${UNAME_RELEASE}
-	exit ;;
-    VAX*:ULTRIX*:*:*)
-	echo vax-dec-ultrix${UNAME_RELEASE}
-	exit ;;
-    2020:CLIX:*:* | 2430:CLIX:*:*)
-	echo clipper-intergraph-clix${UNAME_RELEASE}
-	exit ;;
-    mips:*:*:UMIPS | mips:*:*:RISCos)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h>  /* for printf() prototype */
-	int main (int argc, char *argv[]) {
-#else
-	int main (argc, argv) int argc; char *argv[]; {
-#endif
-	#if defined (host_mips) && defined (MIPSEB)
-	#if defined (SYSTYPE_SYSV)
-	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
-	#endif
-	#if defined (SYSTYPE_SVR4)
-	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
-	#endif
-	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
-	#endif
-	#endif
-	  exit (-1);
-	}
-EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c &&
-	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-	  SYSTEM_NAME=`$dummy $dummyarg` &&
-	    { echo "$SYSTEM_NAME"; exit; }
-	echo mips-mips-riscos${UNAME_RELEASE}
-	exit ;;
-    Motorola:PowerMAX_OS:*:*)
-	echo powerpc-motorola-powermax
-	exit ;;
-    Motorola:*:4.3:PL8-*)
-	echo powerpc-harris-powermax
-	exit ;;
-    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
-	echo powerpc-harris-powermax
-	exit ;;
-    Night_Hawk:Power_UNIX:*:*)
-	echo powerpc-harris-powerunix
-	exit ;;
-    m88k:CX/UX:7*:*)
-	echo m88k-harris-cxux7
-	exit ;;
-    m88k:*:4*:R4*)
-	echo m88k-motorola-sysv4
-	exit ;;
-    m88k:*:3*:R3*)
-	echo m88k-motorola-sysv3
-	exit ;;
-    AViiON:dgux:*:*)
-        # DG/UX returns AViiON for all architectures
-        UNAME_PROCESSOR=`/usr/bin/uname -p`
-	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
-	then
-	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-	       [ ${TARGET_BINARY_INTERFACE}x = x ]
-	    then
-		echo m88k-dg-dgux${UNAME_RELEASE}
-	    else
-		echo m88k-dg-dguxbcs${UNAME_RELEASE}
-	    fi
-	else
-	    echo i586-dg-dgux${UNAME_RELEASE}
-	fi
- 	exit ;;
-    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
-	echo m88k-dolphin-sysv3
-	exit ;;
-    M88*:*:R3*:*)
-	# Delta 88k system running SVR3
-	echo m88k-motorola-sysv3
-	exit ;;
-    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
-	echo m88k-tektronix-sysv3
-	exit ;;
-    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
-	echo m68k-tektronix-bsd
-	exit ;;
-    *:IRIX*:*:*)
-	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
-	exit ;;
-    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
-	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
-    i*86:AIX:*:*)
-	echo i386-ibm-aix
-	exit ;;
-    ia64:AIX:*:*)
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
-	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-	fi
-	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
-	exit ;;
-    *:AIX:2:3)
-	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		eval $set_cc_for_build
-		sed 's/^		//' << EOF >$dummy.c
-		#include <sys/systemcfg.h>
-
-		main()
-			{
-			if (!__power_pc())
-				exit(1);
-			puts("powerpc-ibm-aix3.2.5");
-			exit(0);
-			}
-EOF
-		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
-		then
-			echo "$SYSTEM_NAME"
-		else
-			echo rs6000-ibm-aix3.2.5
-		fi
-	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
-		echo rs6000-ibm-aix3.2.4
-	else
-		echo rs6000-ibm-aix3.2
-	fi
-	exit ;;
-    *:AIX:*:[456])
-	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
-		IBM_ARCH=rs6000
-	else
-		IBM_ARCH=powerpc
-	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
-	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
-	fi
-	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
-	exit ;;
-    *:AIX:*:*)
-	echo rs6000-ibm-aix
-	exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
-	echo romp-ibm-bsd4.4
-	exit ;;
-    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
-	exit ;;                             # report: romp-ibm BSD 4.3
-    *:BOSX:*:*)
-	echo rs6000-bull-bosx
-	exit ;;
-    DPX/2?00:B.O.S.:*:*)
-	echo m68k-bull-sysv3
-	exit ;;
-    9000/[34]??:4.3bsd:1.*:*)
-	echo m68k-hp-bsd
-	exit ;;
-    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
-	echo m68k-hp-bsd4.4
-	exit ;;
-    9000/[34678]??:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	case "${UNAME_MACHINE}" in
-	    9000/31? )            HP_ARCH=m68000 ;;
-	    9000/[34]?? )         HP_ARCH=m68k ;;
-	    9000/[678][0-9][0-9])
-		if [ -x /usr/bin/getconf ]; then
-		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                    case "${sc_cpu_version}" in
-                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
-                      532)                      # CPU_PA_RISC2_0
-                        case "${sc_kernel_bits}" in
-                          32) HP_ARCH="hppa2.0n" ;;
-                          64) HP_ARCH="hppa2.0w" ;;
-			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
-                        esac ;;
-                    esac
-		fi
-		if [ "${HP_ARCH}" = "" ]; then
-		    eval $set_cc_for_build
-		    sed 's/^              //' << EOF >$dummy.c
-
-              #define _HPUX_SOURCE
-              #include <stdlib.h>
-              #include <unistd.h>
-
-              int main ()
-              {
-              #if defined(_SC_KERNEL_BITS)
-                  long bits = sysconf(_SC_KERNEL_BITS);
-              #endif
-                  long cpu  = sysconf (_SC_CPU_VERSION);
-
-                  switch (cpu)
-              	{
-              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
-              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-              	case CPU_PA_RISC2_0:
-              #if defined(_SC_KERNEL_BITS)
-              	    switch (bits)
-              		{
-              		case 64: puts ("hppa2.0w"); break;
-              		case 32: puts ("hppa2.0n"); break;
-              		default: puts ("hppa2.0"); break;
-              		} break;
-              #else  /* !defined(_SC_KERNEL_BITS) */
-              	    puts ("hppa2.0"); break;
-              #endif
-              	default: puts ("hppa1.0"); break;
-              	}
-                  exit (0);
-              }
-EOF
-		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
-		    test -z "$HP_ARCH" && HP_ARCH=hppa
-		fi ;;
-	esac
-	if [ ${HP_ARCH} = "hppa2.0w" ]
-	then
-	    eval $set_cc_for_build
-
-	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
-	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
-	    # generating 64-bit code.  GNU and HP use different nomenclature:
-	    #
-	    # $ CC_FOR_BUILD=cc ./config.guess
-	    # => hppa2.0w-hp-hpux11.23
-	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
-	    # => hppa64-hp-hpux11.23
-
-	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
-		grep -q __LP64__
-	    then
-		HP_ARCH="hppa2.0w"
-	    else
-		HP_ARCH="hppa64"
-	    fi
-	fi
-	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
-	exit ;;
-    ia64:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	echo ia64-hp-hpux${HPUX_REV}
-	exit ;;
-    3050*:HI-UX:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#include <unistd.h>
-	int
-	main ()
-	{
-	  long cpu = sysconf (_SC_CPU_VERSION);
-	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
-	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
-	     results, however.  */
-	  if (CPU_IS_PA_RISC (cpu))
-	    {
-	      switch (cpu)
-		{
-		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
-		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
-		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
-		  default: puts ("hppa-hitachi-hiuxwe2"); break;
-		}
-	    }
-	  else if (CPU_IS_HP_MC68K (cpu))
-	    puts ("m68k-hitachi-hiuxwe2");
-	  else puts ("unknown-hitachi-hiuxwe2");
-	  exit (0);
-	}
-EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
-		{ echo "$SYSTEM_NAME"; exit; }
-	echo unknown-hitachi-hiuxwe2
-	exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
-	echo hppa1.1-hp-bsd
-	exit ;;
-    9000/8??:4.3bsd:*:*)
-	echo hppa1.0-hp-bsd
-	exit ;;
-    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
-	echo hppa1.0-hp-mpeix
-	exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
-	echo hppa1.1-hp-osf
-	exit ;;
-    hp8??:OSF1:*:*)
-	echo hppa1.0-hp-osf
-	exit ;;
-    i*86:OSF1:*:*)
-	if [ -x /usr/sbin/sysversion ] ; then
-	    echo ${UNAME_MACHINE}-unknown-osf1mk
-	else
-	    echo ${UNAME_MACHINE}-unknown-osf1
-	fi
-	exit ;;
-    parisc*:Lites*:*:*)
-	echo hppa1.1-hp-lites
-	exit ;;
-    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
-	echo c1-convex-bsd
-        exit ;;
-    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-        exit ;;
-    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
-	echo c34-convex-bsd
-        exit ;;
-    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
-	echo c38-convex-bsd
-        exit ;;
-    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
-	echo c4-convex-bsd
-        exit ;;
-    CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*[A-Z]90:*:*:*)
-	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
-	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-	      -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*T3E:*:*:*)
-	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    CRAY*SV1:*:*:*)
-	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    *:UNICOS/mp:*:*)
-	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
-	exit ;;
-    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
-        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-        exit ;;
-    5000:UNIX_System_V:4.*:*)
-        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
-        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
-	exit ;;
-    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
-	exit ;;
-    sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi${UNAME_RELEASE}
-	exit ;;
-    *:BSD/OS:*:*)
-	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
-	exit ;;
-    *:FreeBSD:*:*)
-	case ${UNAME_MACHINE} in
-	    pc98)
-		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	    amd64)
-		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	    *)
-		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	esac
-	exit ;;
-    i*:CYGWIN*:*)
-	echo ${UNAME_MACHINE}-pc-cygwin
-	exit ;;
-    *:MINGW*:*)
-	echo ${UNAME_MACHINE}-pc-mingw32
-	exit ;;
-    i*:windows32*:*)
-    	# uname -m includes "-pc" on this system.
-    	echo ${UNAME_MACHINE}-mingw32
-	exit ;;
-    i*:PW*:*)
-	echo ${UNAME_MACHINE}-pc-pw32
-	exit ;;
-    *:Interix*:*)
-    	case ${UNAME_MACHINE} in
-	    x86)
-		echo i586-pc-interix${UNAME_RELEASE}
-		exit ;;
-	    authenticamd | genuineintel | EM64T)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
-		exit ;;
-	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
-		exit ;;
-	esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-	echo i${UNAME_MACHINE}-pc-mks
-	exit ;;
-    8664:Windows_NT:*)
-	echo x86_64-pc-mks
-	exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-	# UNAME_MACHINE based on the output of uname instead of i386?
-	echo i586-pc-interix
-	exit ;;
-    i*:UWIN*:*)
-	echo ${UNAME_MACHINE}-pc-uwin
-	exit ;;
-    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	echo x86_64-unknown-cygwin
-	exit ;;
-    p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin
-	exit ;;
-    prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-	exit ;;
-    *:GNU:*:*)
-	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
-	exit ;;
-    *:GNU/*:*:*)
-	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
-	exit ;;
-    i*86:Minix:*:*)
-	echo ${UNAME_MACHINE}-pc-minix
-	exit ;;
-    alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
-	  EV5)   UNAME_MACHINE=alphaev5 ;;
-	  EV56)  UNAME_MACHINE=alphaev56 ;;
-	  PCA56) UNAME_MACHINE=alphapca56 ;;
-	  PCA57) UNAME_MACHINE=alphapca56 ;;
-	  EV6)   UNAME_MACHINE=alphaev6 ;;
-	  EV67)  UNAME_MACHINE=alphaev67 ;;
-	  EV68*) UNAME_MACHINE=alphaev68 ;;
-        esac
-	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
-	exit ;;
-    arm*:Linux:*:*)
-	eval $set_cc_for_build
-	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
-	    | grep -q __ARM_EABI__
-	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
-	else
-	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
-	fi
-	exit ;;
-    avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    cris:Linux:*:*)
-	echo cris-axis-linux-gnu
-	exit ;;
-    crisv32:Linux:*:*)
-	echo crisv32-axis-linux-gnu
-	exit ;;
-    frv:Linux:*:*)
-    	echo frv-unknown-linux-gnu
-	exit ;;
-    i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
-	exit ;;
-    ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    mips:Linux:*:* | mips64:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#undef CPU
-	#undef ${UNAME_MACHINE}
-	#undef ${UNAME_MACHINE}el
-	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=${UNAME_MACHINE}el
-	#else
-	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=${UNAME_MACHINE}
-	#else
-	CPU=
-	#endif
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
-	;;
-    or32:Linux:*:*)
-	echo or32-unknown-linux-gnu
-	exit ;;
-    padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
-	exit ;;
-    parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
-	exit ;;
-    parisc:Linux:*:* | hppa:Linux:*:*)
-	# Look for CPU level
-	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
-	esac
-	exit ;;
-    ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
-	exit ;;
-    ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
-	exit ;;
-    s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
-	exit ;;
-    sh64*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
-	exit ;;
-    x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
-	exit ;;
-    xtensa*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
-	exit ;;
-    i*86:DYNIX/ptx:4*:*)
-	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
-	# earlier versions are messed up and put the nodename in both
-	# sysname and nodename.
-	echo i386-sequent-sysv4
-	exit ;;
-    i*86:UNIX_SV:4.2MP:2.*)
-        # Unixware is an offshoot of SVR4, but it has its own version
-        # number series starting with 2...
-        # I am not positive that other SVR4 systems won't match this,
-	# I just have to hope.  -- rms.
-        # Use sysv4.2uw... so that sysv4* matches it.
-	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
-	exit ;;
-    i*86:OS/2:*:*)
-	# If we were able to find `uname', then EMX Unix compatibility
-	# is probably installed.
-	echo ${UNAME_MACHINE}-pc-os2-emx
-	exit ;;
-    i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
-	exit ;;
-    i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
-	exit ;;
-    i*86:syllable:*:*)
-	echo ${UNAME_MACHINE}-pc-syllable
-	exit ;;
-    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    i*86:*DOS:*:*)
-	echo ${UNAME_MACHINE}-pc-msdosdjgpp
-	exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
-	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
-	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
-	fi
-	exit ;;
-    i*86:*:5:[678]*)
-    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
-	case `/bin/uname -X | grep "^Machine"` in
-	    *486*)	     UNAME_MACHINE=i486 ;;
-	    *Pentium)	     UNAME_MACHINE=i586 ;;
-	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
-	esac
-	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
-	exit ;;
-    i*86:*:3.2:*)
-	if test -f /usr/options/cb.name; then
-		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
-	elif /bin/uname -X 2>/dev/null >/dev/null ; then
-		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
-		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
-		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
-			&& UNAME_MACHINE=i586
-		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
-			&& UNAME_MACHINE=i686
-		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
-			&& UNAME_MACHINE=i686
-		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
-	else
-		echo ${UNAME_MACHINE}-pc-sysv32
-	fi
-	exit ;;
-    pc:*:*:*)
-	# Left here for compatibility:
-        # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i586.
-	# Note: whatever this is, it MUST be the same as what config.sub
-	# prints for the "djgpp" host, or else GDB configury will decide that
-	# this is a cross-build.
-	echo i586-pc-msdosdjgpp
-        exit ;;
-    Intel:Mach:3*:*)
-	echo i386-pc-mach3
-	exit ;;
-    paragon:*:*:*)
-	echo i860-intel-osf1
-	exit ;;
-    i860:*:4.*:*) # i860-SVR4
-	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
-	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
-	fi
-	exit ;;
-    mini*:CTIX:SYS*5:*)
-	# "miniframe"
-	echo m68010-convergent-sysv
-	exit ;;
-    mc68k:UNIX:SYSTEM5:3.51m)
-	echo m68k-convergent-sysv
-	exit ;;
-    M680?0:D-NIX:5.3:*)
-	echo m68k-diab-dnix
-	exit ;;
-    M68*:*:R3V[5678]*:*)
-	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
-    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
-	OS_REL=''
-	test -r /etc/.relid \
-	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
-    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
-        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-          && { echo i486-ncr-sysv4; exit; } ;;
-    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
-	OS_REL='.3'
-	test -r /etc/.relid \
-	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
-	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
-    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    mc68030:UNIX_System_V:4.*:*)
-	echo m68k-atari-sysv4
-	exit ;;
-    TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	echo powerpc-unknown-lynxos${UNAME_RELEASE}
-	exit ;;
-    SM[BE]S:UNIX_SV:*:*)
-	echo mips-dde-sysv${UNAME_RELEASE}
-	exit ;;
-    RM*:ReliantUNIX-*:*:*)
-	echo mips-sni-sysv4
-	exit ;;
-    RM*:SINIX-*:*:*)
-	echo mips-sni-sysv4
-	exit ;;
-    *:SINIX-*:*:*)
-	if uname -p 2>/dev/null >/dev/null ; then
-		UNAME_MACHINE=`(uname -p) 2>/dev/null`
-		echo ${UNAME_MACHINE}-sni-sysv4
-	else
-		echo ns32k-sni-sysv
-	fi
-	exit ;;
-    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
-                      # says <Richard.M.Bartel at ccMail.Census.GOV>
-        echo i586-unisys-sysv4
-        exit ;;
-    *:UNIX_System_V:4*:FTX*)
-	# From Gerald Hewes <hewes at openmarket.com>.
-	# How about differentiating between stratus architectures? -djm
-	echo hppa1.1-stratus-sysv4
-	exit ;;
-    *:*:*:FTX*)
-	# From seanf at swdc.stratus.com.
-	echo i860-stratus-sysv4
-	exit ;;
-    i*86:VOS:*:*)
-	# From Paul.Green at stratus.com.
-	echo ${UNAME_MACHINE}-stratus-vos
-	exit ;;
-    *:VOS:*:*)
-	# From Paul.Green at stratus.com.
-	echo hppa1.1-stratus-vos
-	exit ;;
-    mc68*:A/UX:*:*)
-	echo m68k-apple-aux${UNAME_RELEASE}
-	exit ;;
-    news*:NEWS-OS:6*:*)
-	echo mips-sony-newsos6
-	exit ;;
-    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
-	if [ -d /usr/nec ]; then
-	        echo mips-nec-sysv${UNAME_RELEASE}
-	else
-	        echo mips-unknown-sysv${UNAME_RELEASE}
-	fi
-        exit ;;
-    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
-	echo powerpc-be-beos
-	exit ;;
-    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
-	echo powerpc-apple-beos
-	exit ;;
-    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
-	echo i586-pc-beos
-	exit ;;
-    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
-	echo i586-pc-haiku
-	exit ;;
-    SX-4:SUPER-UX:*:*)
-	echo sx4-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-5:SUPER-UX:*:*)
-	echo sx5-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-6:SUPER-UX:*:*)
-	echo sx6-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-7:SUPER-UX:*:*)
-	echo sx7-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-8:SUPER-UX:*:*)
-	echo sx8-nec-superux${UNAME_RELEASE}
-	exit ;;
-    SX-8R:SUPER-UX:*:*)
-	echo sx8r-nec-superux${UNAME_RELEASE}
-	exit ;;
-    Power*:Rhapsody:*:*)
-	echo powerpc-apple-rhapsody${UNAME_RELEASE}
-	exit ;;
-    *:Rhapsody:*:*)
-	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
-	exit ;;
-    *:Darwin:*:*)
-	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
-	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
-	exit ;;
-    *:procnto*:*:* | *:QNX:[0123456789]*:*)
-	UNAME_PROCESSOR=`uname -p`
-	if test "$UNAME_PROCESSOR" = "x86"; then
-		UNAME_PROCESSOR=i386
-		UNAME_MACHINE=pc
-	fi
-	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
-	exit ;;
-    *:QNX:*:4*)
-	echo i386-pc-qnx
-	exit ;;
-    NSE-?:NONSTOP_KERNEL:*:*)
-	echo nse-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-	echo nsr-tandem-nsk${UNAME_RELEASE}
-	exit ;;
-    *:NonStop-UX:*:*)
-	echo mips-compaq-nonstopux
-	exit ;;
-    BS2000:POSIX*:*:*)
-	echo bs2000-siemens-sysv
-	exit ;;
-    DS/*:UNIX_System_V:*:*)
-	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
-	exit ;;
-    *:Plan9:*:*)
-	# "uname -m" is not consistent, so use $cputype instead. 386
-	# is converted to i386 for consistency with other x86
-	# operating systems.
-	if test "$cputype" = "386"; then
-	    UNAME_MACHINE=i386
-	else
-	    UNAME_MACHINE="$cputype"
-	fi
-	echo ${UNAME_MACHINE}-unknown-plan9
-	exit ;;
-    *:TOPS-10:*:*)
-	echo pdp10-unknown-tops10
-	exit ;;
-    *:TENEX:*:*)
-	echo pdp10-unknown-tenex
-	exit ;;
-    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
-	echo pdp10-dec-tops20
-	exit ;;
-    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
-	echo pdp10-xkl-tops20
-	exit ;;
-    *:TOPS-20:*:*)
-	echo pdp10-unknown-tops20
-	exit ;;
-    *:ITS:*:*)
-	echo pdp10-unknown-its
-	exit ;;
-    SEI:*:*:SEIUX)
-        echo mips-sei-seiux${UNAME_RELEASE}
-	exit ;;
-    *:DragonFly:*:*)
-	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
-	exit ;;
-    *:*VMS:*:*)
-    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case "${UNAME_MACHINE}" in
-	    A*) echo alpha-dec-vms ; exit ;;
-	    I*) echo ia64-dec-vms ; exit ;;
-	    V*) echo vax-dec-vms ; exit ;;
-	esac ;;
-    *:XENIX:*:SysV)
-	echo i386-pc-xenix
-	exit ;;
-    i*86:skyos:*:*)
-	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
-	exit ;;
-    i*86:rdos:*:*)
-	echo ${UNAME_MACHINE}-pc-rdos
-	exit ;;
-    i*86:AROS:*:*)
-	echo ${UNAME_MACHINE}-pc-aros
-	exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-          "4"
-#else
-	  ""
-#endif
-         ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches at gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo               = `(hostinfo) 2>/dev/null`
-/bin/universe          = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch              = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/config.h.in b/config.h.in
deleted file mode 100644
index c6d3517..0000000
--- a/config.h.in
+++ /dev/null
@@ -1,457 +0,0 @@
-/* config.h.in.  Generated from configure.in by autoheader.  */
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Enable 24 bit per pixel in native framebuffer */
-#undef ALLOW24BPP
-
-/* Enable BackChannel communication */
-#undef BACKCHANNEL
-
-/* Build iTALC for Linux */
-#undef BUILD_LINUX
-
-/* Build iTALC for Win32 */
-#undef BUILD_WIN32
-
-/* enable debugging */
-#undef ENABLE_DEBUG
-
-/* work around when write() returns ENOENT but does not mean it */
-#undef ENOENT_WORKAROUND
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#undef HAVE_ARPA_INET_H
-
-/* Avahi/mDNS client build environment present */
-#undef HAVE_AVAHI
-
-/* Define to 1 if you have the `crypt' function. */
-#undef HAVE_CRYPT
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
-#undef HAVE_DOPRNT
-
-/* DPMS extension build environment present */
-#undef HAVE_DPMS
-
-/* Define to 1 if you have the openssl/dsa.h header file. */
-#undef HAVE_DSA_H
-
-/* Define to 1 if you have the `dup2' function. */
-#undef HAVE_DUP2
-
-/* Define to 1 if you have the <errno.h> header file. */
-#undef HAVE_ERRNO_H
-
-/* FBPM extension build environment present */
-#undef HAVE_FBPM
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define to 1 if you have the `floor' function. */
-#undef HAVE_FLOOR
-
-/* Define to 1 if you have the `fork' function. */
-#undef HAVE_FORK
-
-/* Define to 1 if you have the `ftime' function. */
-#undef HAVE_FTIME
-
-/* Define to 1 if you have the `geteuid' function. */
-#undef HAVE_GETEUID
-
-/* Define to 1 if you have the `gethostbyname' function. */
-#undef HAVE_GETHOSTBYNAME
-
-/* Define to 1 if you have the `gethostname' function. */
-#undef HAVE_GETHOSTNAME
-
-/* Define to 1 if you have the `getpwnam' function. */
-#undef HAVE_GETPWNAM
-
-/* Define to 1 if you have the `getpwuid' function. */
-#undef HAVE_GETPWUID
-
-/* Define to 1 if you have the `getspnam' function. */
-#undef HAVE_GETSPNAM
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#undef HAVE_GETTIMEOFDAY
-
-/* Define to 1 if you have the `getuid' function. */
-#undef HAVE_GETUID
-
-/* Define to 1 if you have the `grantpt' function. */
-#undef HAVE_GRANTPT
-
-/* Define to 1 if you have the `inet_ntoa' function. */
-#undef HAVE_INET_NTOA
-
-/* Define to 1 if you have the `initgroups' function. */
-#undef HAVE_INITGROUPS
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* IRIX XReadDisplay available */
-#undef HAVE_IRIX_XREADDISPLAY
-
-/* Define to 1 if you have jpeglib.h header file. */
-#undef HAVE_JPEGLIB_H
-
-/* libcrypt library present */
-#undef HAVE_LIBCRYPT
-
-/* Define to 1 if you have the `cygipc' library (-lcygipc). */
-#undef HAVE_LIBCYGIPC
-
-/* libjpeg present */
-#undef HAVE_LIBJPEG
-
-/* Define to 1 if you have the `nsl' library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Define to 1 if you have the `pthread' library (-lpthread). */
-#undef HAVE_LIBPTHREAD
-
-/* Define to 1 if you have the `socket' library (-lsocket). */
-#undef HAVE_LIBSOCKET
-
-/* openssl libssl present */
-#undef HAVE_LIBSSL
-
-/* XDAMAGE extension build environment present */
-#undef HAVE_LIBXDAMAGE
-
-/* XFIXES extension build environment present */
-#undef HAVE_LIBXFIXES
-
-/* XINERAMA extension build environment present */
-#undef HAVE_LIBXINERAMA
-
-/* XRANDR extension build environment present */
-#undef HAVE_LIBXRANDR
-
-/* DEC-XTRAP extension build environment present */
-#undef HAVE_LIBXTRAP
-
-/* libz present */
-#undef HAVE_LIBZ
-
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
-/* linux fb device build environment present */
-#undef HAVE_LINUX_FB_H
-
-/* linux/input.h present */
-#undef HAVE_LINUX_INPUT_H
-
-/* linux uinput device build environment present */
-#undef HAVE_LINUX_UINPUT_H
-
-/* video4linux build environment present */
-#undef HAVE_LINUX_VIDEODEV_H
-
-/* build MacOS X native display support */
-#undef HAVE_MACOSX_NATIVE_DISPLAY
-
-/* Define to 1 if you have the `memcmp' function. */
-#undef HAVE_MEMCMP
-
-/* Define to 1 if you have the `memcpy' function. */
-#undef HAVE_MEMCPY
-
-/* Define to 1 if you have the `memmove' function. */
-#undef HAVE_MEMMOVE
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `memset' function. */
-#undef HAVE_MEMSET
-
-/* Define to 1 if you have the `mkfifo' function. */
-#undef HAVE_MKFIFO
-
-/* Define to 1 if you have the `mmap' function. */
-#undef HAVE_MMAP
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#undef HAVE_NETDB_H
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
-/* Define to 1 if you have the `pow' function. */
-#undef HAVE_POW
-
-/* Define to 1 if you have the `putenv' function. */
-#undef HAVE_PUTENV
-
-/* Define to 1 if you have the <pwd.h> header file. */
-#undef HAVE_PWD_H
-
-/* RECORD extension build environment present */
-#undef HAVE_RECORD
-
-/* Define to 1 if you have the `select' function. */
-#undef HAVE_SELECT
-
-/* Define to 1 if you have the `seteuid' function. */
-#undef HAVE_SETEUID
-
-/* Define to 1 if you have the `setpgrp' function. */
-#undef HAVE_SETPGRP
-
-/* Define to 1 if you have the `setsid' function. */
-#undef HAVE_SETSID
-
-/* Define to 1 if you have the `setutxent' function. */
-#undef HAVE_SETUTXENT
-
-/* Define to 1 if you have the `socket' function. */
-#undef HAVE_SOCKET
-
-/* Solaris XReadScreen available */
-#undef HAVE_SOLARIS_XREADSCREEN
-
-/* Define to 1 if `stat' has the bug that it succeeds when given the
-   zero-length file name argument. */
-#undef HAVE_STAT_EMPTY_STRING_BUG
-
-/* Define to 1 if stdbool.h conforms to C99. */
-#undef HAVE_STDBOOL_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strchr' function. */
-#undef HAVE_STRCHR
-
-/* Define to 1 if you have the `strdup' function. */
-#undef HAVE_STRDUP
-
-/* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
-
-/* Define to 1 if you have the `strftime' function. */
-#undef HAVE_STRFTIME
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strpbrk' function. */
-#undef HAVE_STRPBRK
-
-/* Define to 1 if you have the `strrchr' function. */
-#undef HAVE_STRRCHR
-
-/* Define to 1 if you have the `strstr' function. */
-#undef HAVE_STRSTR
-
-/* Define to 1 if you have the <syslog.h> header file. */
-#undef HAVE_SYSLOG_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/timeb.h> header file. */
-#undef HAVE_SYS_TIMEB_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define to 1 if you have the <time.h> header file. */
-#undef HAVE_TIME_H
-
-/* Define to 1 if you have the `uname' function. */
-#undef HAVE_UNAME
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the <utmpx.h> header file. */
-#undef HAVE_UTMPX_H
-
-/* Define to 1 if you have the `vfork' function. */
-#undef HAVE_VFORK
-
-/* Define to 1 if you have the <vfork.h> header file. */
-#undef HAVE_VFORK_H
-
-/* Define to 1 if you have the `vprintf' function. */
-#undef HAVE_VPRINTF
-
-/* Define to 1 if you have the `waitpid' function. */
-#undef HAVE_WAITPID
-
-/* Define to 1 if `fork' works. */
-#undef HAVE_WORKING_FORK
-
-/* Define to 1 if `vfork' works. */
-#undef HAVE_WORKING_VFORK
-
-/* X11 build environment present */
-#undef HAVE_X11
-
-/* XKEYBOARD extension build environment present */
-#undef HAVE_XKEYBOARD
-
-/* MIT-SHM extension build environment present */
-#undef HAVE_XSHM
-
-/* XTEST extension build environment present */
-#undef HAVE_XTEST
-
-/* XTEST extension has XTestGrabControl */
-#undef HAVE_XTESTGRABCONTROL
-
-/* Define to 1 if you have zlib.h header file. */
-#undef HAVE_ZLIB_H
-
-/* Define to 1 if the system has the type `_Bool'. */
-#undef HAVE__BOOL
-
-/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
-   slash. */
-#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#undef LT_OBJDIR
-
-/* Need a typedef for in_addr_t */
-#undef NEED_INADDR_T
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* The number of bytes in type char */
-#undef SIZEOF_CHAR
-
-/* The number of bytes in type int */
-#undef SIZEOF_INT
-
-/* The number of bytes in type long */
-#undef SIZEOF_LONG
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* The size of `ptrdiff_t', as computed by sizeof. */
-#undef SIZEOF_PTRDIFF_T
-
-/* The number of bytes in type short */
-#undef SIZEOF_SHORT
-
-/* The size of `size_t', as computed by sizeof. */
-#undef SIZEOF_SIZE_T
-
-/* The number of bytes in type void* */
-#undef SIZEOF_VOIDP
-
-/* The size of `void *', as computed by sizeof. */
-#undef SIZEOF_VOID_P
-
-/* The size of `__int64', as computed by sizeof. */
-#undef SIZEOF___INT64
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Version number of package */
-#undef VERSION
-
-/* Build iTALC for Win32 */
-#undef WIN32
-
-/* Disable TightVNCFileTransfer protocol */
-#undef WITH_TIGHTVNC_FILETRANSFER
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Define to 1 if the X Window System is missing or not being used. */
-#undef X_DISPLAY_MISSING
-
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
-   calls it, or to nothing if 'inline' is not supported under any name.  */
-#ifndef __cplusplus
-#undef inline
-#endif
-
-/* Define to `long int' if <sys/types.h> does not define. */
-#undef off_t
-
-/* Define to `int' if <sys/types.h> does not define. */
-#undef pid_t
-
-/* Define to `long' if <sys/types.h> does not define. */
-#undef ptrdiff_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-/* The type for socklen */
-#undef socklen_t
-
-/* Define as `fork' if `vfork' does not work. */
-#undef vfork
diff --git a/config.sub b/config.sub
deleted file mode 100755
index c2d1257..0000000
--- a/config.sub
+++ /dev/null
@@ -1,1714 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-#   Free Software Foundation, Inc.
-
-timestamp='2010-01-22'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine.  It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the 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.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches at gnu.org>.  Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support.  The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
-       $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
-  -h, --help         print this help, then exit
-  -t, --time-stamp   print date of last modification, then exit
-  -v, --version      print version number, then exit
-
-Report bugs and patches to <config-patches at gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
-  case $1 in
-    --time-stamp | --time* | -t )
-       echo "$timestamp" ; exit ;;
-    --version | -v )
-       echo "$version" ; exit ;;
-    --help | --h* | -h )
-       echo "$usage"; exit ;;
-    -- )     # Stop option processing
-       shift; break ;;
-    - )	# Use stdin as input.
-       break ;;
-    -* )
-       echo "$me: invalid option $1$help"
-       exit 1 ;;
-
-    *local*)
-       # First pass through any local machine types.
-       echo $1
-       exit ;;
-
-    * )
-       break ;;
-  esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
-    exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
-    exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
-  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
-  kopensolaris*-gnu* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-	-sun*os*)
-		# Prevent following clause from handling this invalid input.
-		;;
-	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze)
-		os=
-		basic_machine=$1
-		;;
-        -bluegene*)
-	        os=-cnk
-		;;
-	-sim | -cisco | -oki | -wec | -winbond)
-		os=
-		basic_machine=$1
-		;;
-	-scout)
-		;;
-	-wrs)
-		os=-vxworks
-		basic_machine=$1
-		;;
-	-chorusos*)
-		os=-chorusos
-		basic_machine=$1
-		;;
- 	-chorusrdb)
- 		os=-chorusrdb
-		basic_machine=$1
- 		;;
-	-hiux*)
-		os=-hiuxwe2
-		;;
-	-sco6)
-		os=-sco5v6
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5)
-		os=-sco3.2v5
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco4)
-		os=-sco3.2v4
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2.[4-9]*)
-		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2v[4-9]*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco*)
-		os=-sco3.2v2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-udk*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-isc)
-		os=-isc2.2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-clix*)
-		basic_machine=clipper-intergraph
-		;;
-	-isc*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-lynx*)
-		os=-lynxos
-		;;
-	-ptx*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
-		;;
-	-windowsnt*)
-		os=`echo $os | sed -e 's/windowsnt/winnt/'`
-		;;
-	-psos*)
-		os=-psos
-		;;
-	-mint | -mint[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
-	# Recognize the basic CPU types without company name.
-	# Some are omitted here because they have special meanings below.
-	1750a | 580 \
-	| a29k \
-	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-	| am33_2.0 \
-	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
-	| bfin \
-	| c4x | clipper \
-	| d10v | d30v | dlx | dsp16xx \
-	| fido | fr30 | frv \
-	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-	| i370 | i860 | i960 | ia64 \
-	| ip2k | iq2000 \
-	| lm32 \
-	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep | metag \
-	| mips | mipsbe | mipseb | mipsel | mipsle \
-	| mips16 \
-	| mips64 | mips64el \
-	| mips64octeon | mips64octeonel \
-	| mips64orion | mips64orionel \
-	| mips64r5900 | mips64r5900el \
-	| mips64vr | mips64vrel \
-	| mips64vr4100 | mips64vr4100el \
-	| mips64vr4300 | mips64vr4300el \
-	| mips64vr5000 | mips64vr5000el \
-	| mips64vr5900 | mips64vr5900el \
-	| mipsisa32 | mipsisa32el \
-	| mipsisa32r2 | mipsisa32r2el \
-	| mipsisa64 | mipsisa64el \
-	| mipsisa64r2 | mipsisa64r2el \
-	| mipsisa64sb1 | mipsisa64sb1el \
-	| mipsisa64sr71k | mipsisa64sr71kel \
-	| mipstx39 | mipstx39el \
-	| mn10200 | mn10300 \
-	| moxie \
-	| mt \
-	| msp430 \
-	| nios | nios2 \
-	| ns16k | ns32k \
-	| or32 \
-	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
-	| pyramid \
-	| rx \
-	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu | strongarm \
-	| tahoe | thumb | tic4x | tic80 | tron \
-	| ubicom32 \
-	| v850 | v850e \
-	| we32k \
-	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
-	| z8k | z80)
-		basic_machine=$basic_machine-unknown
-		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
-		# Motorola 68HC11/12.
-		basic_machine=$basic_machine-unknown
-		os=-none
-		;;
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
-		;;
-	ms1)
-		basic_machine=mt-unknown
-		;;
-
-	# We use `pc' rather than `unknown'
-	# because (1) that's what they normally are, and
-	# (2) the word "unknown" tends to confuse beginning users.
-	i*86 | x86_64)
-	  basic_machine=$basic_machine-pc
-	  ;;
-	# Object if more than one company name word.
-	*-*-*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
-		;;
-	# Recognize the basic CPU types with company name.
-	580-* \
-	| a29k-* \
-	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
-	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* | avr32-* \
-	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
-	| clipper-* | craynv-* | cydra-* \
-	| d10v-* | d30v-* | dlx-* \
-	| elxsi-* \
-	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-	| h8300-* | h8500-* \
-	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-	| i*86-* | i860-* | i960-* | ia64-* \
-	| ip2k-* | iq2000-* \
-	| lm32-* \
-	| m32c-* | m32r-* | m32rle-* \
-	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
-	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-	| mips16-* \
-	| mips64-* | mips64el-* \
-	| mips64octeon-* | mips64octeonel-* \
-	| mips64orion-* | mips64orionel-* \
-	| mips64r5900-* | mips64r5900el-* \
-	| mips64vr-* | mips64vrel-* \
-	| mips64vr4100-* | mips64vr4100el-* \
-	| mips64vr4300-* | mips64vr4300el-* \
-	| mips64vr5000-* | mips64vr5000el-* \
-	| mips64vr5900-* | mips64vr5900el-* \
-	| mipsisa32-* | mipsisa32el-* \
-	| mipsisa32r2-* | mipsisa32r2el-* \
-	| mipsisa64-* | mipsisa64el-* \
-	| mipsisa64r2-* | mipsisa64r2el-* \
-	| mipsisa64sb1-* | mipsisa64sb1el-* \
-	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
-	| mipstx39-* | mipstx39el-* \
-	| mmix-* \
-	| mt-* \
-	| msp430-* \
-	| nios-* | nios2-* \
-	| none-* | np1-* | ns16k-* | ns32k-* \
-	| orion-* \
-	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
-	| pyramid-* \
-	| romp-* | rs6000-* | rx-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
-	| tahoe-* | thumb-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile-* | tilegx-* \
-	| tron-* \
-	| ubicom32-* \
-	| v850-* | v850e-* | vax-* \
-	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
-	| xstormy16-* | xtensa*-* \
-	| ymp-* \
-	| z8k-* | z80-*)
-		;;
-	# Recognize the basic CPU types without company name, with glob match.
-	xtensa*)
-		basic_machine=$basic_machine-unknown
-		;;
-	# Recognize the various machine names and aliases which stand
-	# for a CPU type and a company and sometimes even an OS.
-	386bsd)
-		basic_machine=i386-unknown
-		os=-bsd
-		;;
-	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-		basic_machine=m68000-att
-		;;
-	3b*)
-		basic_machine=we32k-att
-		;;
-	a29khif)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-    	abacus)
-		basic_machine=abacus-unknown
-		;;
-	adobe68k)
-		basic_machine=m68010-adobe
-		os=-scout
-		;;
-	alliant | fx80)
-		basic_machine=fx80-alliant
-		;;
-	altos | altos3068)
-		basic_machine=m68k-altos
-		;;
-	am29k)
-		basic_machine=a29k-none
-		os=-bsd
-		;;
-	amd64)
-		basic_machine=x86_64-pc
-		;;
-	amd64-*)
-		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	amdahl)
-		basic_machine=580-amdahl
-		os=-sysv
-		;;
-	amiga | amiga-*)
-		basic_machine=m68k-unknown
-		;;
-	amigaos | amigados)
-		basic_machine=m68k-unknown
-		os=-amigaos
-		;;
-	amigaunix | amix)
-		basic_machine=m68k-unknown
-		os=-sysv4
-		;;
-	apollo68)
-		basic_machine=m68k-apollo
-		os=-sysv
-		;;
-	apollo68bsd)
-		basic_machine=m68k-apollo
-		os=-bsd
-		;;
-	aros)
-		basic_machine=i386-pc
-		os=-aros
-		;;
-	aux)
-		basic_machine=m68k-apple
-		os=-aux
-		;;
-	balance)
-		basic_machine=ns32k-sequent
-		os=-dynix
-		;;
-	blackfin)
-		basic_machine=bfin-unknown
-		os=-linux
-		;;
-	blackfin-*)
-		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	bluegene*)
-		basic_machine=powerpc-ibm
-		os=-cnk
-		;;
-	c90)
-		basic_machine=c90-cray
-		os=-unicos
-		;;
-        cegcc)
-		basic_machine=arm-unknown
-		os=-cegcc
-		;;
-	convex-c1)
-		basic_machine=c1-convex
-		os=-bsd
-		;;
-	convex-c2)
-		basic_machine=c2-convex
-		os=-bsd
-		;;
-	convex-c32)
-		basic_machine=c32-convex
-		os=-bsd
-		;;
-	convex-c34)
-		basic_machine=c34-convex
-		os=-bsd
-		;;
-	convex-c38)
-		basic_machine=c38-convex
-		os=-bsd
-		;;
-	cray | j90)
-		basic_machine=j90-cray
-		os=-unicos
-		;;
-	craynv)
-		basic_machine=craynv-cray
-		os=-unicosmp
-		;;
-	cr16)
-		basic_machine=cr16-unknown
-		os=-elf
-		;;
-	crds | unos)
-		basic_machine=m68k-crds
-		;;
-	crisv32 | crisv32-* | etraxfs*)
-		basic_machine=crisv32-axis
-		;;
-	cris | cris-* | etrax*)
-		basic_machine=cris-axis
-		;;
-	crx)
-		basic_machine=crx-unknown
-		os=-elf
-		;;
-	da30 | da30-*)
-		basic_machine=m68k-da30
-		;;
-	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-		basic_machine=mips-dec
-		;;
-	decsystem10* | dec10*)
-		basic_machine=pdp10-dec
-		os=-tops10
-		;;
-	decsystem20* | dec20*)
-		basic_machine=pdp10-dec
-		os=-tops20
-		;;
-	delta | 3300 | motorola-3300 | motorola-delta \
-	      | 3300-motorola | delta-motorola)
-		basic_machine=m68k-motorola
-		;;
-	delta88)
-		basic_machine=m88k-motorola
-		os=-sysv3
-		;;
-	dicos)
-		basic_machine=i686-pc
-		os=-dicos
-		;;
-	djgpp)
-		basic_machine=i586-pc
-		os=-msdosdjgpp
-		;;
-	dpx20 | dpx20-*)
-		basic_machine=rs6000-bull
-		os=-bosx
-		;;
-	dpx2* | dpx2*-bull)
-		basic_machine=m68k-bull
-		os=-sysv3
-		;;
-	ebmon29k)
-		basic_machine=a29k-amd
-		os=-ebmon
-		;;
-	elxsi)
-		basic_machine=elxsi-elxsi
-		os=-bsd
-		;;
-	encore | umax | mmax)
-		basic_machine=ns32k-encore
-		;;
-	es1800 | OSE68k | ose68k | ose | OSE)
-		basic_machine=m68k-ericsson
-		os=-ose
-		;;
-	fx2800)
-		basic_machine=i860-alliant
-		;;
-	genix)
-		basic_machine=ns32k-ns
-		;;
-	gmicro)
-		basic_machine=tron-gmicro
-		os=-sysv
-		;;
-	go32)
-		basic_machine=i386-pc
-		os=-go32
-		;;
-	h3050r* | hiux*)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	h8300hms)
-		basic_machine=h8300-hitachi
-		os=-hms
-		;;
-	h8300xray)
-		basic_machine=h8300-hitachi
-		os=-xray
-		;;
-	h8500hms)
-		basic_machine=h8500-hitachi
-		os=-hms
-		;;
-	harris)
-		basic_machine=m88k-harris
-		os=-sysv3
-		;;
-	hp300-*)
-		basic_machine=m68k-hp
-		;;
-	hp300bsd)
-		basic_machine=m68k-hp
-		os=-bsd
-		;;
-	hp300hpux)
-		basic_machine=m68k-hp
-		os=-hpux
-		;;
-	hp3k9[0-9][0-9] | hp9[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k2[0-9][0-9] | hp9k31[0-9])
-		basic_machine=m68000-hp
-		;;
-	hp9k3[2-9][0-9])
-		basic_machine=m68k-hp
-		;;
-	hp9k6[0-9][0-9] | hp6[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k7[0-79][0-9] | hp7[0-79][0-9])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k78[0-9] | hp78[0-9])
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][13679] | hp8[0-9][13679])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][0-9] | hp8[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hppa-next)
-		os=-nextstep3
-		;;
-	hppaosf)
-		basic_machine=hppa1.1-hp
-		os=-osf
-		;;
-	hppro)
-		basic_machine=hppa1.1-hp
-		os=-proelf
-		;;
-	i370-ibm* | ibm*)
-		basic_machine=i370-ibm
-		;;
-# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
-	i*86v32)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv32
-		;;
-	i*86v4*)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv4
-		;;
-	i*86v)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv
-		;;
-	i*86sol2)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-solaris2
-		;;
-	i386mach)
-		basic_machine=i386-mach
-		os=-mach
-		;;
-	i386-vsta | vsta)
-		basic_machine=i386-unknown
-		os=-vsta
-		;;
-	iris | iris4d)
-		basic_machine=mips-sgi
-		case $os in
-		    -irix*)
-			;;
-		    *)
-			os=-irix4
-			;;
-		esac
-		;;
-	isi68 | isi)
-		basic_machine=m68k-isi
-		os=-sysv
-		;;
-	m68knommu)
-		basic_machine=m68k-unknown
-		os=-linux
-		;;
-	m68knommu-*)
-		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	m88k-omron*)
-		basic_machine=m88k-omron
-		;;
-	magnum | m3230)
-		basic_machine=mips-mips
-		os=-sysv
-		;;
-	merlin)
-		basic_machine=ns32k-utek
-		os=-sysv
-		;;
-        microblaze)
-		basic_machine=microblaze-xilinx
-		;;
-	mingw32)
-		basic_machine=i386-pc
-		os=-mingw32
-		;;
-	mingw32ce)
-		basic_machine=arm-unknown
-		os=-mingw32ce
-		;;
-	miniframe)
-		basic_machine=m68000-convergent
-		;;
-	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-	mips3*-*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-		;;
-	mips3*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-		;;
-	monitor)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	morphos)
-		basic_machine=powerpc-unknown
-		os=-morphos
-		;;
-	msdos)
-		basic_machine=i386-pc
-		os=-msdos
-		;;
-	ms1-*)
-		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-		;;
-	mvs)
-		basic_machine=i370-ibm
-		os=-mvs
-		;;
-	ncr3000)
-		basic_machine=i486-ncr
-		os=-sysv4
-		;;
-	netbsd386)
-		basic_machine=i386-unknown
-		os=-netbsd
-		;;
-	netwinder)
-		basic_machine=armv4l-rebel
-		os=-linux
-		;;
-	news | news700 | news800 | news900)
-		basic_machine=m68k-sony
-		os=-newsos
-		;;
-	news1000)
-		basic_machine=m68030-sony
-		os=-newsos
-		;;
-	news-3600 | risc-news)
-		basic_machine=mips-sony
-		os=-newsos
-		;;
-	necv70)
-		basic_machine=v70-nec
-		os=-sysv
-		;;
-	next | m*-next )
-		basic_machine=m68k-next
-		case $os in
-		    -nextstep* )
-			;;
-		    -ns2*)
-		      os=-nextstep2
-			;;
-		    *)
-		      os=-nextstep3
-			;;
-		esac
-		;;
-	nh3000)
-		basic_machine=m68k-harris
-		os=-cxux
-		;;
-	nh[45]000)
-		basic_machine=m88k-harris
-		os=-cxux
-		;;
-	nindy960)
-		basic_machine=i960-intel
-		os=-nindy
-		;;
-	mon960)
-		basic_machine=i960-intel
-		os=-mon960
-		;;
-	nonstopux)
-		basic_machine=mips-compaq
-		os=-nonstopux
-		;;
-	np1)
-		basic_machine=np1-gould
-		;;
-	nsr-tandem)
-		basic_machine=nsr-tandem
-		;;
-	op50n-* | op60c-*)
-		basic_machine=hppa1.1-oki
-		os=-proelf
-		;;
-	openrisc | openrisc-*)
-		basic_machine=or32-unknown
-		;;
-	os400)
-		basic_machine=powerpc-ibm
-		os=-os400
-		;;
-	OSE68000 | ose68000)
-		basic_machine=m68000-ericsson
-		os=-ose
-		;;
-	os68k)
-		basic_machine=m68k-none
-		os=-os68k
-		;;
-	pa-hitachi)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	paragon)
-		basic_machine=i860-intel
-		os=-osf
-		;;
-	parisc)
-		basic_machine=hppa-unknown
-		os=-linux
-		;;
-	parisc-*)
-		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	pbd)
-		basic_machine=sparc-tti
-		;;
-	pbb)
-		basic_machine=m68k-tti
-		;;
-	pc532 | pc532-*)
-		basic_machine=ns32k-pc532
-		;;
-	pc98)
-		basic_machine=i386-pc
-		;;
-	pc98-*)
-		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium | p5 | k5 | k6 | nexgen | viac3)
-		basic_machine=i586-pc
-		;;
-	pentiumpro | p6 | 6x86 | athlon | athlon_*)
-		basic_machine=i686-pc
-		;;
-	pentiumii | pentium2 | pentiumiii | pentium3)
-		basic_machine=i686-pc
-		;;
-	pentium4)
-		basic_machine=i786-pc
-		;;
-	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumpro-* | p6-* | 6x86-* | athlon-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pentium4-*)
-		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	pn)
-		basic_machine=pn-gould
-		;;
-	power)	basic_machine=power-ibm
-		;;
-	ppc)	basic_machine=powerpc-unknown
-		;;
-	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppcle | powerpclittle | ppc-le | powerpc-little)
-		basic_machine=powerpcle-unknown
-		;;
-	ppcle-* | powerpclittle-*)
-		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64)	basic_machine=powerpc64-unknown
-		;;
-	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
-		basic_machine=powerpc64le-unknown
-		;;
-	ppc64le-* | powerpc64little-*)
-		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ps2)
-		basic_machine=i386-ibm
-		;;
-	pw32)
-		basic_machine=i586-unknown
-		os=-pw32
-		;;
-	rdos)
-		basic_machine=i386-pc
-		os=-rdos
-		;;
-	rom68k)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	rm[46]00)
-		basic_machine=mips-siemens
-		;;
-	rtpc | rtpc-*)
-		basic_machine=romp-ibm
-		;;
-	s390 | s390-*)
-		basic_machine=s390-ibm
-		;;
-	s390x | s390x-*)
-		basic_machine=s390x-ibm
-		;;
-	sa29200)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	sb1)
-		basic_machine=mipsisa64sb1-unknown
-		;;
-	sb1el)
-		basic_machine=mipsisa64sb1el-unknown
-		;;
-	sde)
-		basic_machine=mipsisa32-sde
-		os=-elf
-		;;
-	sei)
-		basic_machine=mips-sei
-		os=-seiux
-		;;
-	sequent)
-		basic_machine=i386-sequent
-		;;
-	sh)
-		basic_machine=sh-hitachi
-		os=-hms
-		;;
-	sh5el)
-		basic_machine=sh5le-unknown
-		;;
-	sh64)
-		basic_machine=sh64-unknown
-		;;
-	sparclite-wrs | simso-wrs)
-		basic_machine=sparclite-wrs
-		os=-vxworks
-		;;
-	sps7)
-		basic_machine=m68k-bull
-		os=-sysv2
-		;;
-	spur)
-		basic_machine=spur-unknown
-		;;
-	st2000)
-		basic_machine=m68k-tandem
-		;;
-	stratus)
-		basic_machine=i860-stratus
-		os=-sysv4
-		;;
-	sun2)
-		basic_machine=m68000-sun
-		;;
-	sun2os3)
-		basic_machine=m68000-sun
-		os=-sunos3
-		;;
-	sun2os4)
-		basic_machine=m68000-sun
-		os=-sunos4
-		;;
-	sun3os3)
-		basic_machine=m68k-sun
-		os=-sunos3
-		;;
-	sun3os4)
-		basic_machine=m68k-sun
-		os=-sunos4
-		;;
-	sun4os3)
-		basic_machine=sparc-sun
-		os=-sunos3
-		;;
-	sun4os4)
-		basic_machine=sparc-sun
-		os=-sunos4
-		;;
-	sun4sol2)
-		basic_machine=sparc-sun
-		os=-solaris2
-		;;
-	sun3 | sun3-*)
-		basic_machine=m68k-sun
-		;;
-	sun4)
-		basic_machine=sparc-sun
-		;;
-	sun386 | sun386i | roadrunner)
-		basic_machine=i386-sun
-		;;
-	sv1)
-		basic_machine=sv1-cray
-		os=-unicos
-		;;
-	symmetry)
-		basic_machine=i386-sequent
-		os=-dynix
-		;;
-	t3e)
-		basic_machine=alphaev5-cray
-		os=-unicos
-		;;
-	t90)
-		basic_machine=t90-cray
-		os=-unicos
-		;;
-	tic54x | c54x*)
-		basic_machine=tic54x-unknown
-		os=-coff
-		;;
-	tic55x | c55x*)
-		basic_machine=tic55x-unknown
-		os=-coff
-		;;
-	tic6x | c6x*)
-		basic_machine=tic6x-unknown
-		os=-coff
-		;;
-        # This must be matched before tile*.
-        tilegx*)
-		basic_machine=tilegx-unknown
-		os=-linux-gnu
-		;;
-	tile*)
-		basic_machine=tile-unknown
-		os=-linux-gnu
-		;;
-	tx39)
-		basic_machine=mipstx39-unknown
-		;;
-	tx39el)
-		basic_machine=mipstx39el-unknown
-		;;
-	toad1)
-		basic_machine=pdp10-xkl
-		os=-tops20
-		;;
-	tower | tower-32)
-		basic_machine=m68k-ncr
-		;;
-	tpf)
-		basic_machine=s390x-ibm
-		os=-tpf
-		;;
-	udi29k)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	ultra3)
-		basic_machine=a29k-nyu
-		os=-sym1
-		;;
-	v810 | necv810)
-		basic_machine=v810-nec
-		os=-none
-		;;
-	vaxv)
-		basic_machine=vax-dec
-		os=-sysv
-		;;
-	vms)
-		basic_machine=vax-dec
-		os=-vms
-		;;
-	vpp*|vx|vx-*)
-		basic_machine=f301-fujitsu
-		;;
-	vxworks960)
-		basic_machine=i960-wrs
-		os=-vxworks
-		;;
-	vxworks68)
-		basic_machine=m68k-wrs
-		os=-vxworks
-		;;
-	vxworks29k)
-		basic_machine=a29k-wrs
-		os=-vxworks
-		;;
-	w65*)
-		basic_machine=w65-wdc
-		os=-none
-		;;
-	w89k-*)
-		basic_machine=hppa1.1-winbond
-		os=-proelf
-		;;
-	xbox)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	xps | xps100)
-		basic_machine=xps100-honeywell
-		;;
-	ymp)
-		basic_machine=ymp-cray
-		os=-unicos
-		;;
-	z8k-*-coff)
-		basic_machine=z8k-unknown
-		os=-sim
-		;;
-	z80-*-coff)
-		basic_machine=z80-unknown
-		os=-sim
-		;;
-	none)
-		basic_machine=none-none
-		os=-none
-		;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-	w89k)
-		basic_machine=hppa1.1-winbond
-		;;
-	op50n)
-		basic_machine=hppa1.1-oki
-		;;
-	op60c)
-		basic_machine=hppa1.1-oki
-		;;
-	romp)
-		basic_machine=romp-ibm
-		;;
-	mmix)
-		basic_machine=mmix-knuth
-		;;
-	rs6000)
-		basic_machine=rs6000-ibm
-		;;
-	vax)
-		basic_machine=vax-dec
-		;;
-	pdp10)
-		# there are many clones, so DEC is not a safe bet
-		basic_machine=pdp10-unknown
-		;;
-	pdp11)
-		basic_machine=pdp11-dec
-		;;
-	we32k)
-		basic_machine=we32k-att
-		;;
-	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-		basic_machine=sh-unknown
-		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-		basic_machine=sparc-sun
-		;;
-	cydra)
-		basic_machine=cydra-cydrome
-		;;
-	orion)
-		basic_machine=orion-highlevel
-		;;
-	orion105)
-		basic_machine=clipper-highlevel
-		;;
-	mac | mpw | mac-mpw)
-		basic_machine=m68k-apple
-		;;
-	pmac | pmac-mpw)
-		basic_machine=powerpc-apple
-		;;
-	*-unknown)
-		# Make sure to match an already-canonicalized machine name.
-		;;
-	*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
-		;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-	*-digital*)
-		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
-		;;
-	*-commodore*)
-		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
-		;;
-	*)
-		;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
-        # First match some system type aliases
-        # that might get confused with valid system types.
-	# -solaris* is a basic system type, with this one exception.
-        -auroraux)
-	        os=-auroraux
-		;;
-	-solaris1 | -solaris1.*)
-		os=`echo $os | sed -e 's|solaris1|sunos4|'`
-		;;
-	-solaris)
-		os=-solaris2
-		;;
-	-svr4*)
-		os=-sysv4
-		;;
-	-unixware*)
-		os=-sysv4.2uw
-		;;
-	-gnu/linux*)
-		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
-		;;
-	# First accept the basic system types.
-	# The portable systems comes first.
-	# Each alternative MUST END IN A *, to match a version number.
-	# -sysv* is not here because it comes later, after sysvr4.
-	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
-	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* \
-	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -openbsd* | -solidbsd* \
-	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
-	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
-	# Remember, each alternative MUST END IN *, to match a version number.
-		;;
-	-qnx*)
-		case $basic_machine in
-		    x86-* | i*86-*)
-			;;
-		    *)
-			os=-nto$os
-			;;
-		esac
-		;;
-	-nto-qnx*)
-		;;
-	-nto*)
-		os=`echo $os | sed -e 's|nto|nto-qnx|'`
-		;;
-	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
-		;;
-	-mac*)
-		os=`echo $os | sed -e 's|mac|macos|'`
-		;;
-	-linux-dietlibc)
-		os=-linux-dietlibc
-		;;
-	-linux*)
-		os=`echo $os | sed -e 's|linux|linux-gnu|'`
-		;;
-	-sunos5*)
-		os=`echo $os | sed -e 's|sunos5|solaris2|'`
-		;;
-	-sunos6*)
-		os=`echo $os | sed -e 's|sunos6|solaris3|'`
-		;;
-	-opened*)
-		os=-openedition
-		;;
-        -os400*)
-		os=-os400
-		;;
-	-wince*)
-		os=-wince
-		;;
-	-osfrose*)
-		os=-osfrose
-		;;
-	-osf*)
-		os=-osf
-		;;
-	-utek*)
-		os=-bsd
-		;;
-	-dynix*)
-		os=-bsd
-		;;
-	-acis*)
-		os=-aos
-		;;
-	-atheos*)
-		os=-atheos
-		;;
-	-syllable*)
-		os=-syllable
-		;;
-	-386bsd)
-		os=-bsd
-		;;
-	-ctix* | -uts*)
-		os=-sysv
-		;;
-	-nova*)
-		os=-rtmk-nova
-		;;
-	-ns2 )
-		os=-nextstep2
-		;;
-	-nsk*)
-		os=-nsk
-		;;
-	# Preserve the version number of sinix5.
-	-sinix5.*)
-		os=`echo $os | sed -e 's|sinix|sysv|'`
-		;;
-	-sinix*)
-		os=-sysv4
-		;;
-        -tpf*)
-		os=-tpf
-		;;
-	-triton*)
-		os=-sysv3
-		;;
-	-oss*)
-		os=-sysv3
-		;;
-	-svr4)
-		os=-sysv4
-		;;
-	-svr3)
-		os=-sysv3
-		;;
-	-sysvr4)
-		os=-sysv4
-		;;
-	# This must come after -sysvr4.
-	-sysv*)
-		;;
-	-ose*)
-		os=-ose
-		;;
-	-es1800*)
-		os=-ose
-		;;
-	-xenix)
-		os=-xenix
-		;;
-	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-		os=-mint
-		;;
-	-aros*)
-		os=-aros
-		;;
-	-kaos*)
-		os=-kaos
-		;;
-	-zvmoe)
-		os=-zvmoe
-		;;
-	-dicos*)
-		os=-dicos
-		;;
-        -nacl*)
-	        ;;
-	-none)
-		;;
-	*)
-		# Get rid of the `-' at the beginning of $os.
-		os=`echo $os | sed 's/[^-]*-//'`
-		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
-		exit 1
-		;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system.  Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
-        score-*)
-		os=-elf
-		;;
-        spu-*)
-		os=-elf
-		;;
-	*-acorn)
-		os=-riscix1.2
-		;;
-	arm*-rebel)
-		os=-linux
-		;;
-	arm*-semi)
-		os=-aout
-		;;
-        c4x-* | tic4x-*)
-        	os=-coff
-		;;
-	# This must come before the *-dec entry.
-	pdp10-*)
-		os=-tops20
-		;;
-	pdp11-*)
-		os=-none
-		;;
-	*-dec | vax-*)
-		os=-ultrix4.2
-		;;
-	m68*-apollo)
-		os=-domain
-		;;
-	i386-sun)
-		os=-sunos4.0.2
-		;;
-	m68000-sun)
-		os=-sunos3
-		# This also exists in the configure program, but was not the
-		# default.
-		# os=-sunos4
-		;;
-	m68*-cisco)
-		os=-aout
-		;;
-        mep-*)
-		os=-elf
-		;;
-	mips*-cisco)
-		os=-elf
-		;;
-	mips*-*)
-		os=-elf
-		;;
-	or32-*)
-		os=-coff
-		;;
-	*-tti)	# must be before sparc entry or we get the wrong os.
-		os=-sysv3
-		;;
-	sparc-* | *-sun)
-		os=-sunos4.1.1
-		;;
-	*-be)
-		os=-beos
-		;;
-	*-haiku)
-		os=-haiku
-		;;
-	*-ibm)
-		os=-aix
-		;;
-    	*-knuth)
-		os=-mmixware
-		;;
-	*-wec)
-		os=-proelf
-		;;
-	*-winbond)
-		os=-proelf
-		;;
-	*-oki)
-		os=-proelf
-		;;
-	*-hp)
-		os=-hpux
-		;;
-	*-hitachi)
-		os=-hiux
-		;;
-	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-		os=-sysv
-		;;
-	*-cbm)
-		os=-amigaos
-		;;
-	*-dg)
-		os=-dgux
-		;;
-	*-dolphin)
-		os=-sysv3
-		;;
-	m68k-ccur)
-		os=-rtu
-		;;
-	m88k-omron*)
-		os=-luna
-		;;
-	*-next )
-		os=-nextstep
-		;;
-	*-sequent)
-		os=-ptx
-		;;
-	*-crds)
-		os=-unos
-		;;
-	*-ns)
-		os=-genix
-		;;
-	i370-*)
-		os=-mvs
-		;;
-	*-next)
-		os=-nextstep3
-		;;
-	*-gould)
-		os=-sysv
-		;;
-	*-highlevel)
-		os=-bsd
-		;;
-	*-encore)
-		os=-bsd
-		;;
-	*-sgi)
-		os=-irix
-		;;
-	*-siemens)
-		os=-sysv4
-		;;
-	*-masscomp)
-		os=-rtu
-		;;
-	f30[01]-fujitsu | f700-fujitsu)
-		os=-uxpv
-		;;
-	*-rom68k)
-		os=-coff
-		;;
-	*-*bug)
-		os=-coff
-		;;
-	*-apple)
-		os=-macos
-		;;
-	*-atari*)
-		os=-mint
-		;;
-	*)
-		os=-none
-		;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-	*-unknown)
-		case $os in
-			-riscix*)
-				vendor=acorn
-				;;
-			-sunos*)
-				vendor=sun
-				;;
-			-cnk*|-aix*)
-				vendor=ibm
-				;;
-			-beos*)
-				vendor=be
-				;;
-			-hpux*)
-				vendor=hp
-				;;
-			-mpeix*)
-				vendor=hp
-				;;
-			-hiux*)
-				vendor=hitachi
-				;;
-			-unos*)
-				vendor=crds
-				;;
-			-dgux*)
-				vendor=dg
-				;;
-			-luna*)
-				vendor=omron
-				;;
-			-genix*)
-				vendor=ns
-				;;
-			-mvs* | -opened*)
-				vendor=ibm
-				;;
-			-os400*)
-				vendor=ibm
-				;;
-			-ptx*)
-				vendor=sequent
-				;;
-			-tpf*)
-				vendor=ibm
-				;;
-			-vxsim* | -vxworks* | -windiss*)
-				vendor=wrs
-				;;
-			-aux*)
-				vendor=apple
-				;;
-			-hms*)
-				vendor=hitachi
-				;;
-			-mpw* | -macos*)
-				vendor=apple
-				;;
-			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-				vendor=atari
-				;;
-			-vos*)
-				vendor=stratus
-				;;
-		esac
-		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
-		;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/configure b/configure
deleted file mode 100755
index 26f0b4c..0000000
--- a/configure
+++ /dev/null
@@ -1,22973 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for italc 1.0.13.
-#
-# Report bugs to <http://italc.sourceforge.net/>.
-#
-#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-case $0 in #((
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test "x$CONFIG_SHELL" = x; then
-  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-"
-  as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
-  exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1"
-  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
-  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
-  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
-  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
-  if (eval "$as_required") 2>/dev/null; then :
-  as_have_required=yes
-else
-  as_have_required=no
-fi
-  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  as_found=:
-  case $as_dir in #(
-	 /*)
-	   for as_base in sh bash ksh sh5; do
-	     # Try only shells that exist, to save several forks.
-	     as_shell=$as_dir/$as_base
-	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  CONFIG_SHELL=$as_shell as_have_required=yes
-		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  break 2
-fi
-fi
-	   done;;
-       esac
-  as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
-	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
-  CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
-      if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-    if test x$as_have_required = xno; then :
-  $as_echo "$0: This script requires a shell more modern than all"
-  $as_echo "$0: the shells that I found on your system."
-  if test x${ZSH_VERSION+set} = xset ; then
-    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
-    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
-  else
-    $as_echo "$0: Please tell bug-autoconf at gnu.org and
-$0: http://italc.sourceforge.net/ about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
-  fi
-  exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
-  as_lineno_1=$LINENO as_lineno_1a=$LINENO
-  as_lineno_2=$LINENO as_lineno_2a=$LINENO
-  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
-  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
-  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
-  case `echo 'xy\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='	';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -p'
-  fi
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$lt_ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
-  ;;
-esac
-
-ECHO=${lt_ECHO-echo}
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $ECHO works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "$0" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<_LT_EOF
-$*
-_LT_EOF
-  exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$lt_ECHO"; then
-  if test "X${echo_test_string+set}" != Xset; then
-    # find a string as large as possible, as long as the shell can cope with it
-    for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
-      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
-	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
-      then
-        break
-      fi
-    done
-  fi
-
-  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-     test "X$echo_testing_string" = "X$echo_test_string"; then
-    :
-  else
-    # The Solaris, AIX, and Digital Unix default echo programs unquote
-    # backslashes.  This makes it impossible to quote backslashes using
-    #   echo "$something" | sed 's/\\/\\\\/g'
-    #
-    # So, first we look for a working echo in the user's PATH.
-
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for dir in $PATH /usr/ucb; do
-      IFS="$lt_save_ifs"
-      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        ECHO="$dir/echo"
-        break
-      fi
-    done
-    IFS="$lt_save_ifs"
-
-    if test "X$ECHO" = Xecho; then
-      # We didn't find a better echo, so look for alternatives.
-      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        # This shell has a builtin print -r that does the trick.
-        ECHO='print -r'
-      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
-	   test "X$CONFIG_SHELL" != X/bin/ksh; then
-        # If we have ksh, try running configure again with it.
-        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-        export ORIGINAL_CONFIG_SHELL
-        CONFIG_SHELL=/bin/ksh
-        export CONFIG_SHELL
-        exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
-      else
-        # Try using printf.
-        ECHO='printf %s\n'
-        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	  # Cool, printf works
-	  :
-        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	  export CONFIG_SHELL
-	  SHELL="$CONFIG_SHELL"
-	  export SHELL
-	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
-        elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
-        else
-	  # maybe with a smaller string...
-	  prev=:
-
-	  for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
-	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
-	    then
-	      break
-	    fi
-	    prev="$cmd"
-	  done
-
-	  if test "$prev" != 'sed 50q "$0"'; then
-	    echo_test_string=`eval $prev`
-	    export echo_test_string
-	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
-	  else
-	    # Oops.  We lost completely, so just stick with echo.
-	    ECHO=echo
-	  fi
-        fi
-      fi
-    fi
-  fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-lt_ECHO=$ECHO
-if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
-   lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
-fi
-
-
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='italc'
-PACKAGE_TARNAME='italc'
-PACKAGE_VERSION='1.0.13'
-PACKAGE_STRING='italc 1.0.13'
-PACKAGE_BUGREPORT='http://italc.sourceforge.net/'
-PACKAGE_URL=''
-
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-#  include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-#  include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='am__EXEEXT_FALSE
-am__EXEEXT_TRUE
-LTLIBOBJS
-RPMSOURCEDIR
-HAVE_RPM_FALSE
-HAVE_RPM_TRUE
-OSX_FALSE
-OSX_TRUE
-LINUX_FALSE
-LINUX_TRUE
-CYGIPC_FALSE
-CYGIPC_TRUE
-LIBOBJS
-HAVE_LIBPTHREAD_FALSE
-HAVE_LIBPTHREAD_TRUE
-HAVE_LIBEAY32_FALSE
-HAVE_LIBEAY32_TRUE
-HAVE_LIBSSL_FALSE
-HAVE_LIBSSL_TRUE
-HAVE_LIBJPEG_FALSE
-HAVE_LIBJPEG_TRUE
-HAVE_LIBZ_FALSE
-HAVE_LIBZ_TRUE
-HAVE_X_FALSE
-HAVE_X_TRUE
-QT_LIB_GUI
-QT_LDADD
-QT_CXXFLAGS
-WINDRES
-LRELEASE
-LUPDATE
-RCC
-UIC
-MOC
-X_EXTRA_LIBS
-X_LIBS
-X_PRE_LIBS
-X_CFLAGS
-XMKMF
-DEBUG_FALSE
-DEBUG_TRUE
-BUILD_LINUX_FALSE
-BUILD_LINUX_TRUE
-BUILD_WIN32_FALSE
-BUILD_WIN32_TRUE
-CXXCPP
-CPP
-OTOOL64
-OTOOL
-LIPO
-NMEDIT
-DSYMUTIL
-lt_ECHO
-RANLIB
-AR
-LN_S
-NM
-ac_ct_DUMPBIN
-DUMPBIN
-LD
-FGREP
-EGREP
-GREP
-SED
-LIBTOOL
-OBJDUMP
-DLLTOOL
-AS
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-am__fastdepCXX_FALSE
-am__fastdepCXX_TRUE
-CXXDEPMODE
-ac_ct_CXX
-CXXFLAGS
-CXX
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_dependency_tracking
-enable_shared
-enable_static
-with_pic
-enable_fast_install
-with_gnu_ld
-enable_libtool_lock
-with_backchannel
-with_24bpp
-with_linux
-with_win32
-enable_debug
-with_x
-with_qtdir
-with_xkeyboard
-with_xinerama
-with_xrandr
-with_xfixes
-with_xdamage
-with_xtrap
-with_xrecord
-with_fbpm
-with_dpms
-with_v4l
-with_fbdev
-with_uinput
-with_macosx_native
-with_crypt
-with_pthread
-'
-      ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CXX
-CXXFLAGS
-CCC
-CPP
-CXXCPP
-XMKMF'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval $ac_prev=\$ac_option
-    ac_prev=
-    continue
-  fi
-
-  case $ac_option in
-  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *=)   ac_optarg= ;;
-  *)    ac_optarg=yes ;;
-  esac
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case $ac_dashdash$ac_option in
-  --)
-    ac_dashdash=yes ;;
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir=$ac_optarg ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias=$ac_optarg ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file=$ac_optarg ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -datadir | --datadir | --datadi | --datad)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=*)
-    datadir=$ac_optarg ;;
-
-  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
-  | --dataroo | --dataro | --datar)
-    ac_prev=datarootdir ;;
-  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
-  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
-    datarootdir=$ac_optarg ;;
-
-  -disable-* | --disable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=no ;;
-
-  -docdir | --docdir | --docdi | --doc | --do)
-    ac_prev=docdir ;;
-  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
-    docdir=$ac_optarg ;;
-
-  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
-    ac_prev=dvidir ;;
-  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
-    dvidir=$ac_optarg ;;
-
-  -enable-* | --enable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=\$ac_optarg ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix=$ac_optarg ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias=$ac_optarg ;;
-
-  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
-    ac_prev=htmldir ;;
-  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
-  | --ht=*)
-    htmldir=$ac_optarg ;;
-
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir=$ac_optarg ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir=$ac_optarg ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir=$ac_optarg ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir=$ac_optarg ;;
-
-  -localedir | --localedir | --localedi | --localed | --locale)
-    ac_prev=localedir ;;
-  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
-    localedir=$ac_optarg ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst | --locals)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
-    localstatedir=$ac_optarg ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir=$ac_optarg ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir=$ac_optarg ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix=$ac_optarg ;;
-
-  -program-prefix | --program-prefix | --program-prefi | --program-pref \
-  | --program-pre | --program-pr | --program-p)
-    ac_prev=program_prefix ;;
-  -program-prefix=* | --program-prefix=* | --program-prefi=* \
-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix=$ac_optarg ;;
-
-  -program-suffix | --program-suffix | --program-suffi | --program-suff \
-  | --program-suf | --program-su | --program-s)
-    ac_prev=program_suffix ;;
-  -program-suffix=* | --program-suffix=* | --program-suffi=* \
-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix=$ac_optarg ;;
-
-  -program-transform-name | --program-transform-name \
-  | --program-transform-nam | --program-transform-na \
-  | --program-transform-n | --program-transform- \
-  | --program-transform | --program-transfor \
-  | --program-transfo | --program-transf \
-  | --program-trans | --program-tran \
-  | --progr-tra | --program-tr | --program-t)
-    ac_prev=program_transform_name ;;
-  -program-transform-name=* | --program-transform-name=* \
-  | --program-transform-nam=* | --program-transform-na=* \
-  | --program-transform-n=* | --program-transform-=* \
-  | --program-transform=* | --program-transfor=* \
-  | --program-transfo=* | --program-transf=* \
-  | --program-trans=* | --program-tran=* \
-  | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name=$ac_optarg ;;
-
-  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
-    ac_prev=pdfdir ;;
-  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
-    pdfdir=$ac_optarg ;;
-
-  -psdir | --psdir | --psdi | --psd | --ps)
-    ac_prev=psdir ;;
-  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
-    psdir=$ac_optarg ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir=$ac_optarg ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir=$ac_optarg ;;
-
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site=$ac_optarg ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir=$ac_optarg ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir=$ac_optarg ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias=$ac_optarg ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers | -V)
-    ac_init_version=: ;;
-
-  -with-* | --with-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=\$ac_optarg ;;
-
-  -without-* | --without-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=no ;;
-
-  --x)
-    # Obsolete; use --with-x.
-    with_x=yes ;;
-
-  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
-  | --x-incl | --x-inc | --x-in | --x-i)
-    ac_prev=x_includes ;;
-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes=$ac_optarg ;;
-
-  -x-libraries | --x-libraries | --x-librarie | --x-librari \
-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
-    ac_prev=x_libraries ;;
-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries=$ac_optarg ;;
-
-  -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-    # Reject names that are not valid shell variable names.
-    case $ac_envvar in #(
-      '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
-    esac
-    eval $ac_envvar=\$ac_optarg
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-    ;;
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
-  case $enable_option_checking in
-    no) ;;
-    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
-    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
-  esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
-		datadir sysconfdir sharedstatedir localstatedir includedir \
-		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
-do
-  eval ac_val=\$$ac_var
-  # Remove trailing slashes.
-  case $ac_val in
-    */ )
-      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
-      eval $ac_var=\$ac_val;;
-  esac
-  # Be sure to have absolute directory names.
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* )  continue;;
-    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
-  esac
-  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_myself" : 'X\(//\)[^/]' \| \
-	 X"$as_myself" : 'X\(//\)$' \| \
-	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  srcdir=$ac_confdir
-  if test ! -r "$srcdir/$ac_unique_file"; then
-    srcdir=..
-  fi
-else
-  ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
-  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
-	pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
-  srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
-  eval ac_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_env_${ac_var}_value=\$${ac_var}
-  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures italc 1.0.13 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking ...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --bindir=DIR            user executables [EPREFIX/bin]
-  --sbindir=DIR           system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR        program executables [EPREFIX/libexec]
-  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --libdir=DIR            object code libraries [EPREFIX/lib]
-  --includedir=DIR        C header files [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR           info documentation [DATAROOTDIR/info]
-  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/italc]
-  --htmldir=DIR           html documentation [DOCDIR]
-  --dvidir=DIR            dvi documentation [DOCDIR]
-  --pdfdir=DIR            pdf documentation [DOCDIR]
-  --psdir=DIR             ps documentation [DOCDIR]
-_ACEOF
-
-  cat <<\_ACEOF
-
-Program names:
-  --program-prefix=PREFIX            prepend PREFIX to installed program names
-  --program-suffix=SUFFIX            append SUFFIX to installed program names
-  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
-
-X features:
-  --x-includes=DIR    X include files are in DIR
-  --x-libraries=DIR   X library files are in DIR
-
-System types:
-  --build=BUILD     configure for building on BUILD [guessed]
-  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-  case $ac_init_help in
-     short | recursive ) echo "Configuration of italc 1.0.13:";;
-   esac
-  cat <<\_ACEOF
-
-Optional Features:
-  --disable-option-checking  ignore unrecognized --enable/--with options
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
-  --enable-shared[=PKGS]  build shared libraries [default=yes]
-  --enable-static[=PKGS]  build static libraries [default=yes]
-  --enable-fast-install[=PKGS]
-                          optimize for fast installation [default=yes]
-  --disable-libtool-lock  avoid locking (might break parallel builds)
-  --enable-debug		enable debugging
-
-Optional Packages:
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-pic              try to use only PIC/non-PIC objects [default=use
-                          both]
-  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --without-backchannel	disable backchannel method
-  --without-24bpp	disable 24 bpp framebuffers
-  --with-linux		explicit build iTALC for Linux
-  --with-win32		explicit build iTALC for Win32
-  --with-x                use the X Window System
-  --with-qtdir=DIR        Qt installation directory default=$QTDIR
-  --without-xkeyboard     disable xkeyboard extension support
-  --without-xinerama      disable xinerama extension support
-  --without-xrandr        disable xrandr extension support
-  --without-xfixes        disable xfixes extension support
-  --without-xdamage       disable xdamage extension support
-  --without-xtrap         disable xtrap extension support
-  --without-xrecord       disable xrecord extension support
-  --without-fbpm          disable fbpm extension support
-  --without-dpms          disable dpms extension support
-  --without-v4l           disable video4linux support
-  --without-fbdev         disable linux fb device support
-  --without-uinput        disable linux uinput device support
-  --without-macosx-native disable MacOS X native display support
-  --without-crypt         disable support for libcrypt
-  --without-pthread       disable support for libpthread
-
-Some influential environment variables:
-  CC          C compiler command
-  CFLAGS      C compiler flags
-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-              nonstandard directory <lib dir>
-  LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
-              you have headers in a nonstandard directory <include dir>
-  CXX         C++ compiler command
-  CXXFLAGS    C++ compiler flags
-  CPP         C preprocessor
-  CXXCPP      C++ preprocessor
-  XMKMF       Path to xmkmf, Makefile generator for X Window System
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to <http://italc.sourceforge.net/>.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" ||
-      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
-      continue
-    ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-    cd "$ac_dir" || { ac_status=$?; continue; }
-    # Check for guested configure.
-    if test -f "$ac_srcdir/configure.gnu"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
-    elif test -f "$ac_srcdir/configure"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure" --help=recursive
-    else
-      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi || ac_status=$?
-    cd "$ac_pwd" || { ac_status=$?; break; }
-  done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
-  cat <<\_ACEOF
-italc configure 1.0.13
-generated by GNU Autoconf 2.67
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
-  exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_cxx_try_compile LINENO
-# ----------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-       $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=$ac_status
-fi
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_c_check_func
-
-# ac_fn_cxx_try_cpp LINENO
-# ------------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_cpp
-
-# ac_fn_cxx_try_link LINENO
-# -------------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_link
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval "test \"\${$3+set}\"" = set; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_header_compiler=yes
-else
-  ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  ac_header_preproc=yes
-else
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
-  yes:no: )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## -------------------------------------------- ##
-## Report this to http://italc.sourceforge.net/ ##
-## -------------------------------------------- ##"
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof ($2))
-	 return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
-	    return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_c_check_type
-
-# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
-# --------------------------------------------
-# Tries to find the compile-time value of EXPR in a program that includes
-# INCLUDES, setting VAR accordingly. Returns whether the value could be
-# computed
-ac_fn_c_compute_int ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if test "$cross_compiling" = yes; then
-    # Depending upon the size, compute the lo and hi bounds.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=$ac_mid; break
-else
-  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
-			if test $ac_lo -le $ac_mid; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_lo=$ac_mid; break
-else
-  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
-			if test $ac_mid -le $ac_hi; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  ac_lo= ac_hi=
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_hi=$ac_mid
-else
-  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in #((
-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
-'') ac_retval=1 ;;
-esac
-  else
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (($2) < 0)
-    {
-      long int i = longval ();
-      if (i != ($2))
-	return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ($2))
-	return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
-else
-  ac_retval=1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-rm -f conftest.val
-
-  fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_compute_int
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by italc $as_me 1.0.13, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
-
-  $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    $as_echo "PATH: $as_dir"
-  done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
-  for ac_arg
-  do
-    case $ac_arg in
-    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-    | -silent | --silent | --silen | --sile | --sil)
-      continue ;;
-    *\'*)
-      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    case $ac_pass in
-    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
-    2)
-      as_fn_append ac_configure_args1 " '$ac_arg'"
-      if test $ac_must_keep_next = true; then
-	ac_must_keep_next=false # Got value, back to normal.
-      else
-	case $ac_arg in
-	  *=* | --config-cache | -C | -disable-* | --disable-* \
-	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-	  | -with-* | --with-* | -without-* | --without-* | --x)
-	    case "$ac_configure_args0 " in
-	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-	    esac
-	    ;;
-	  -* ) ac_must_keep_next=true ;;
-	esac
-      fi
-      as_fn_append ac_configure_args " '$ac_arg'"
-      ;;
-    esac
-  done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.  We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
-  # Save into config.log some information that might help in debugging.
-  {
-    echo
-
-    $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
-    echo
-    # The following way of writing the cache mishandles newlines in values,
-(
-  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
-      esac ;;
-    esac
-  done
-  (set) 2>&1 |
-    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
-      sed -n \
-	"s/'\''/'\''\\\\'\'''\''/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
-      ;; #(
-    *)
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
-      ;;
-    esac |
-    sort
-)
-    echo
-
-    $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
-    echo
-    for ac_var in $ac_subst_vars
-    do
-      eval ac_val=\$$ac_var
-      case $ac_val in
-      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-      esac
-      $as_echo "$ac_var='\''$ac_val'\''"
-    done | sort
-    echo
-
-    if test -n "$ac_subst_files"; then
-      $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
-      echo
-      for ac_var in $ac_subst_files
-      do
-	eval ac_val=\$$ac_var
-	case $ac_val in
-	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-	esac
-	$as_echo "$ac_var='\''$ac_val'\''"
-      done | sort
-      echo
-    fi
-
-    if test -s confdefs.h; then
-      $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
-      echo
-      cat confdefs.h
-      echo
-    fi
-    test "$ac_signal" != 0 &&
-      $as_echo "$as_me: caught signal $ac_signal"
-    $as_echo "$as_me: exit $exit_status"
-  } >&5
-  rm -f core *.core core.conftest.* &&
-    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
-    exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
-  # We do not want a PATH search for config.site.
-  case $CONFIG_SITE in #((
-    -*)  ac_site_file1=./$CONFIG_SITE;;
-    */*) ac_site_file1=$CONFIG_SITE;;
-    *)   ac_site_file1=./$CONFIG_SITE;;
-  esac
-elif test "x$prefix" != xNONE; then
-  ac_site_file1=$prefix/share/config.site
-  ac_site_file2=$prefix/etc/config.site
-else
-  ac_site_file1=$ac_default_prefix/share/config.site
-  ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
-  test "x$ac_site_file" = xNONE && continue
-  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
-    sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file" \
-      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
-  fi
-done
-
-if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special files
-  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
-  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
-    case $cache_file in
-      [\\/]* | ?:[\\/]* ) . "$cache_file";;
-      *)                      . "./$cache_file";;
-    esac
-  fi
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
-  >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
-  eval ac_old_set=\$ac_cv_env_${ac_var}_set
-  eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val=\$ac_cv_env_${ac_var}_value
-  eval ac_new_val=\$ac_env_${ac_var}_value
-  case $ac_old_set,$ac_new_set in
-    set,)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,set)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,);;
-    *)
-      if test "x$ac_old_val" != "x$ac_new_val"; then
-	# differences in whitespace do not lead to failure.
-	ac_old_val_w=`echo x $ac_old_val`
-	ac_new_val_w=`echo x $ac_new_val`
-	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	  ac_cache_corrupted=:
-	else
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
-	  eval $ac_var=\$ac_old_val
-	fi
-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
-$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
-$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
-      fi;;
-  esac
-  # Pass precious variables to config.status.
-  if test "$ac_new_set" = set; then
-    case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-    *) ac_arg=$ac_var=$ac_new_val ;;
-    esac
-    case " $ac_configure_args " in
-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
-    esac
-  fi
-done
-if $ac_cache_corrupted; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-am__api_version='1.11'
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
-  if test -f "$ac_dir/install-sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f "$ac_dir/install.sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
-
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
-  ./ | .// | /[cC]/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
-	  if test $ac_prog = install &&
-	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # AIX install.  It has an incompatible calling convention.
-	    :
-	  elif test $ac_prog = install &&
-	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # program-specific install script used by HP pwplus--don't use.
-	    :
-	  else
-	    rm -rf conftest.one conftest.two conftest.dir
-	    echo one > conftest.one
-	    echo two > conftest.two
-	    mkdir conftest.dir
-	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
-	      test -s conftest.one && test -s conftest.two &&
-	      test -s conftest.dir/conftest.one &&
-	      test -s conftest.dir/conftest.two
-	    then
-	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	      break 3
-	    fi
-	  fi
-	fi
-      done
-    done
-    ;;
-esac
-
-  done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    INSTALL=$ac_install_sh
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name.  Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
-  *[\\\"\#\$\&\'\`$am_lf]*)
-    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
-esac
-case $srcdir in
-  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
-esac
-
-# Do `set' in a subshell so we don't clobber the current shell's
-# arguments.  Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" "$LINENO" 5
-   fi
-
-   test "$2" = conftest.file
-   )
-then
-   # Ok.
-   :
-else
-   as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-test "$program_prefix" != NONE &&
-  program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
-  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\	*)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
-else
-  am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\	*)
-    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
-  *)
-    install_sh="\${SHELL} $am_aux_dir/install-sh"
-  esac
-fi
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
-  if test "${ac_cv_path_mkdir+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in mkdir gmkdir; do
-	 for ac_exec_ext in '' $ac_executable_extensions; do
-	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
-	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
-	     'mkdir (GNU coreutils) '* | \
-	     'mkdir (coreutils) '* | \
-	     'mkdir (fileutils) '4.1*)
-	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
-	       break 3;;
-	   esac
-	 done
-       done
-  done
-IFS=$as_save_IFS
-
-fi
-
-  test -d ./--version && rmdir ./--version
-  if test "${ac_cv_path_mkdir+set}" = set; then
-    MKDIR_P="$ac_cv_path_mkdir -p"
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for MKDIR_P within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    MKDIR_P="$ac_install_sh -d"
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
-for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
-	@echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
-  *@@@%%%=?*=@@@%%%*)
-    eval ac_cv_prog_make_${ac_make}_set=yes;;
-  *)
-    eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-  SET_MAKE=
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
-  am__leading_dot=.
-else
-  am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
-  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
-  # is not polluted with repeated "-I."
-  am__isrc=' -I$(srcdir)'
-  # test to see if srcdir already configured
-  if test -f $srcdir/config.status; then
-    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
-  fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE=italc
- VERSION=1.0.13
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-
-ac_config_headers="$ac_config_headers config.h"
-
-
-ac_config_headers="$ac_config_headers "
-
-
-ac_config_commands="$ac_config_commands lib/include/rfb/rfbconfig.h"
-
-
-
-
-if ! test -z "${prefix}" -o "${prefix}" = "NONE" ; then
-	CFLAGS="$CFLAGS -I${prefix}/include"
-	CPPFLAGS="$CFLAGS -I${prefix}/include"
-	CXXFLAGS="$CXXFLAGS -I${prefix}/include"
-	LDFLAGS="$LDFLAGS -L${prefix}/bin"
-fi
-
-
-# Checks for programs.
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  fi
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CC" && break
-done
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-  esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link_default") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile.  We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
-	;;
-    [ab].out )
-	# We found the default executable, but exeext='' is most
-	# certainly right.
-	break;;
-    *.* )
-	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
-	then :; else
-	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	fi
-	# We set ac_cv_exeext here because the later test for it is not
-	# safe: cross compilers may not add the suffix if given an `-o'
-	# argument, so we may need to know it at that point already.
-	# Even if this section looks crufty: it has the advantage of
-	# actually working.
-	break;;
-    * )
-	break;;
-  esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
-  ac_file=''
-fi
-if test -z "$ac_file"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  break;;
-    * ) break;;
-  esac
-done
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
-  { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-  if { ac_try='./conftest$ac_cv_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  for ac_file in conftest.o conftest.obj conftest.*; do
-  test -f "$ac_file" || continue;
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GCC=yes
-else
-  GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-else
-  CFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  ac_c_werror_flag=$ac_save_c_werror_flag
-	 CFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-	@echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
-  enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-fi
- if test "x$enable_dependency_tracking" != xno; then
-  AMDEP_TRUE=
-  AMDEP_FALSE='#'
-else
-  AMDEP_TRUE='#'
-  AMDEP_FALSE=
-fi
-
-
-
-depcc="$CC"   am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
-else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
-fi
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
-  if test -n "$CCC"; then
-    CXX=$CCC
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CXX" && break
-  done
-fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CXX" && break
-done
-
-  if test "x$ac_ct_CXX" = x; then
-    CXX="g++"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CXX=$ac_ct_CXX
-  fi
-fi
-
-  fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GXX=yes
-else
-  GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
-   ac_cxx_werror_flag=yes
-   ac_cv_prog_cxx_g=no
-   CXXFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-else
-  CXXFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
-  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-	 CXXFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-depcc="$CXX"  am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CXX_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CXX_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
-else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
-fi
-
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
-  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$host_alias" = x; then
-  ac_cv_host=$ac_cv_build
-else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AS+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AS"; then
-  ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AS="${ac_tool_prefix}as"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AS"; then
-  ac_ct_AS=$AS
-  # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_AS+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AS"; then
-  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_AS="as"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
-$as_echo "$ac_ct_AS" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_AS" = x; then
-    AS="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AS=$ac_ct_AS
-  fi
-else
-  AS="$ac_cv_prog_AS"
-fi
-
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DLLTOOL"; then
-  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
-  ac_ct_DLLTOOL=$DLLTOOL
-  # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DLLTOOL"; then
-  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_DLLTOOL" = x; then
-    DLLTOOL="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DLLTOOL=$ac_ct_DLLTOOL
-  fi
-else
-  DLLTOOL="$ac_cv_prog_DLLTOOL"
-fi
-
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OBJDUMP"; then
-  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
-  ac_ct_OBJDUMP=$OBJDUMP
-  # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OBJDUMP"; then
-  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_OBJDUMP="objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OBJDUMP" = x; then
-    OBJDUMP="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OBJDUMP=$ac_ct_OBJDUMP
-  fi
-else
-  OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-  ;;
-esac
-
-test -z "$AS" && AS=as
-
-
-
-
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-
-case `pwd` in
-  *\ * | *\	*)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.2.6b'
-macro_revision='1.3017'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if test "${ac_cv_path_SED+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-     for ac_i in 1 2 3 4 5 6 7; do
-       ac_script="$ac_script$as_nl$ac_script"
-     done
-     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     { ac_script=; unset ac_script;}
-     if test -z "$SED"; then
-  ac_path_SED_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
-# Check for GNU ac_path_SED and select it if it is found.
-  # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
-  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo '' >> "conftest.nl"
-    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_SED_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_SED="$ac_path_SED"
-      ac_path_SED_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_SED_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_SED"; then
-    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
-  fi
-else
-  ac_cv_path_SED=$SED
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
-  rm -f conftest.sed
-
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$GREP"; then
-  ac_path_GREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in grep ggrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
-# Check for GNU ac_path_GREP and select it if it is found.
-  # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'GREP' >> "conftest.nl"
-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_GREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_GREP="$ac_path_GREP"
-      ac_path_GREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_GREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_GREP"; then
-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-   then ac_cv_path_EGREP="$GREP -E"
-   else
-     if test -z "$EGREP"; then
-  ac_path_EGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in egrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
-  # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'EGREP' >> "conftest.nl"
-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_EGREP="$ac_path_EGREP"
-      ac_path_EGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_EGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_EGREP=$EGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if test "${ac_cv_path_FGREP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
-   then ac_cv_path_FGREP="$GREP -F"
-   else
-     if test -z "$FGREP"; then
-  ac_path_FGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in fgrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
-  # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'FGREP' >> "conftest.nl"
-    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_FGREP="$ac_path_FGREP"
-      ac_path_FGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_FGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_FGREP"; then
-    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_FGREP=$FGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
-
-
-test -z "$GREP" && GREP=grep
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if test "${lt_cv_path_NM+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DUMPBIN"; then
-  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$DUMPBIN" && break
-  done
-fi
-if test -z "$DUMPBIN"; then
-  ac_ct_DUMPBIN=$DUMPBIN
-  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DUMPBIN"; then
-  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_DUMPBIN" && break
-done
-
-  if test "x$ac_ct_DUMPBIN" = x; then
-    DUMPBIN=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DUMPBIN=$ac_ct_DUMPBIN
-  fi
-fi
-
-
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
-  fi
-fi
-test -z "$NM" && NM=nm
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if test "${lt_cv_nm_interface+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:5636: $ac_compile\"" >&5)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:5639: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:5642: output\"" >&5)
-  cat conftest.out >&5
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-    i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
-	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-
-fi
-
-if test -n $lt_cv_sys_max_cmd_len ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-
-
-
-
-
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
-
-
-
-
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OBJDUMP"; then
-  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
-  ac_ct_OBJDUMP=$OBJDUMP
-  # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OBJDUMP"; then
-  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_OBJDUMP="objdump"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OBJDUMP" = x; then
-    OBJDUMP="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OBJDUMP=$ac_ct_OBJDUMP
-  fi
-else
-  OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if test "${lt_cv_deplibs_check_method+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[4-9]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[45]*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  ;;
-
-cegcc)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[3-9]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd* | netbsdelf*-gnu)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AR="${ac_tool_prefix}ar"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_AR="ar"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AR=$ac_ct_AR
-  fi
-else
-  AR="$ac_cv_prog_AR"
-fi
-
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-test -z "$STRIP" && STRIP=:
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-test -z "$RANLIB" && RANLIB=:
-
-
-
-
-
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[BCDT]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[ABCDGISTW]'
-  ;;
-hpux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDEGRST]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[BCDEGRST]'
-  ;;
-osf*)
-  symcode='[BCDEGQRST]'
-  ;;
-solaris*)
-  symcode='[BDRT]'
-  ;;
-sco3.2v5*)
-  symcode='[DT]'
-  ;;
-sysv4.2uw2*)
-  symcode='[DT]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[ABDT]'
-  ;;
-sysv4)
-  symcode='[DFNSTU]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK '"\
-"     {last_section=section; section=\$ 3};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
-  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-	mv -f "$nlist"T "$nlist"
-      else
-	rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<_LT_EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
-	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
-	  cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols.  */
-const struct {
-  const char *name;
-  void       *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[] =
-{
-  { "@PROGRAM@", (void *) 0 },
-_LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-	  cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-	  # Now try linking the two files.
-	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
-	  LIBS="conftstm.$ac_objext"
-	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
-	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
-	    pipe_works=yes
-	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
-	else
-	  echo "cannot find nm_test_func in $nlist" >&5
-	fi
-      else
-	echo "cannot find nm_test_var in $nlist" >&5
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
-    fi
-  else
-    echo "$progname: failed program was:" >&5
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
-  enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-	HPUX_IA64_MODE="32"
-	;;
-      *ELF-64*)
-	HPUX_IA64_MODE="64"
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '#line 6845 "configure"' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -melf32bsmip"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -melf32bmipn32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -melf64bmip"
-	;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -32"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -n32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -64"
-	  ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_i386_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
-	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
-	    LD="${LD-ld} -m elf32ppclinux"
-	    ;;
-	  s390x-*linux*)
-	    LD="${LD-ld} -m elf_s390"
-	    ;;
-	  sparc64-*linux*)
-	    LD="${LD-ld} -m elf32_sparc"
-	    ;;
-	esac
-	;;
-      *64-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_x86_64_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_x86_64"
-	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
-	    LD="${LD-ld} -m elf64ppc"
-	    ;;
-	  s390*-*linux*|s390*-*tpf*)
-	    LD="${LD-ld} -m elf64_s390"
-	    ;;
-	  sparc*-*linux*)
-	    LD="${LD-ld} -m elf64_sparc"
-	    ;;
-	esac
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_cc_needs_belf=yes
-else
-  lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-     ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-sparc*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
-      *)
-	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-	  LD="${LD-ld} -64"
-	fi
-	;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
-
-need_locks="$enable_libtool_lock"
-
-
-  case $host_os in
-    rhapsody* | darwin*)
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$DSYMUTIL"; then
-  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
-  ac_ct_DSYMUTIL=$DSYMUTIL
-  # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_DSYMUTIL"; then
-  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_DSYMUTIL" = x; then
-    DSYMUTIL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    DSYMUTIL=$ac_ct_DSYMUTIL
-  fi
-else
-  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_NMEDIT+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NMEDIT"; then
-  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
-  ac_ct_NMEDIT=$NMEDIT
-  # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_NMEDIT"; then
-  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_NMEDIT="nmedit"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_NMEDIT" = x; then
-    NMEDIT=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    NMEDIT=$ac_ct_NMEDIT
-  fi
-else
-  NMEDIT="$ac_cv_prog_NMEDIT"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
-set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_LIPO+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LIPO"; then
-  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-LIPO=$ac_cv_prog_LIPO
-if test -n "$LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_LIPO"; then
-  ac_ct_LIPO=$LIPO
-  # Extract the first word of "lipo", so it can be a program name with args.
-set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_LIPO"; then
-  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_LIPO="lipo"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
-if test -n "$ac_ct_LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_LIPO" = x; then
-    LIPO=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    LIPO=$ac_ct_LIPO
-  fi
-else
-  LIPO="$ac_cv_prog_LIPO"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OTOOL+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OTOOL"; then
-  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL=$ac_cv_prog_OTOOL
-if test -n "$OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL"; then
-  ac_ct_OTOOL=$OTOOL
-  # Extract the first word of "otool", so it can be a program name with args.
-set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OTOOL"; then
-  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_OTOOL="otool"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
-if test -n "$ac_ct_OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OTOOL" = x; then
-    OTOOL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OTOOL=$ac_ct_OTOOL
-  fi
-else
-  OTOOL="$ac_cv_prog_OTOOL"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OTOOL64+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$OTOOL64"; then
-  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL64=$ac_cv_prog_OTOOL64
-if test -n "$OTOOL64"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL64"; then
-  ac_ct_OTOOL64=$OTOOL64
-  # Extract the first word of "otool64", so it can be a program name with args.
-set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_OTOOL64"; then
-  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_OTOOL64="otool64"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
-if test -n "$ac_ct_OTOOL64"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_OTOOL64" = x; then
-    OTOOL64=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    OTOOL64=$ac_ct_OTOOL64
-  fi
-else
-  OTOOL64="$ac_cv_prog_OTOOL64"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-	# By default we will add the -single_module flag. You can override
-	# by either setting the environment variable LT_MULTI_MODULE
-	# non-empty at configure time, or by adding -multi_module to the
-	# link flags.
-	rm -rf libconftest.dylib*
-	echo "int foo(void){return 1;}" > conftest.c
-	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&5
-	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
-	  lt_cv_apple_cc_single_mod=yes
-	else
-	  cat conftest.err >&5
-	fi
-	rm -rf libconftest.dylib*
-	rm -f conftest.*
-      fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  lt_cv_ld_exported_symbols_list=yes
-else
-  lt_cv_ld_exported_symbols_list=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-	LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
-    case $host_os in
-    rhapsody* | darwin1.[012])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[012]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    if test "$DSYMUTIL" != ":"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
-fi
-
-    done
-    ac_cv_prog_CPP=$CPP
-
-fi
-  CPP=$ac_cv_prog_CPP
-else
-  ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in dlfcn.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
-  if test -n "$CCC"; then
-    CXX=$CCC
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CXX" && break
-  done
-fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CXX" && break
-done
-
-  if test "x$ac_ct_CXX" = x; then
-    CXX="g++"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CXX=$ac_ct_CXX
-  fi
-fi
-
-  fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GXX=yes
-else
-  GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
-   ac_cxx_werror_flag=yes
-   ac_cv_prog_cxx_g=no
-   CXXFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-else
-  CXXFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
-  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-	 CXXFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-depcc="$CXX"  am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CXX_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
-
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CXX_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
-else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
-fi
-
-
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
-  if test "${ac_cv_prog_CXXCPP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CXXCPP needs to be expanded
-    for CXXCPP in "$CXX -E" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
-fi
-
-    done
-    ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
-  CXXCPP=$ac_cv_prog_CXXCPP
-else
-  ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-_lt_caught_CXX_error=yes; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-else
-  _lt_caught_CXX_error=yes
-fi
-
-
-
-
-
-# Set options
-
-
-
-        enable_dlopen=no
-
-
-
-            # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
-  enableval=$enable_shared; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_shared=yes
-fi
-
-
-
-
-
-
-
-
-
-  # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
-  enableval=$enable_static; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_static=yes
-fi
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
-  withval=$with_pic; pic_mode="$withval"
-else
-  pic_mode=default
-fi
-
-
-test -z "$pic_mode" && pic_mode=default
-
-
-
-
-
-
-
-  # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
-  enableval=$enable_fast_install; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_fast_install=yes
-fi
-
-
-
-
-
-
-
-
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if test "${lt_cv_objdir+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-_LT_EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-_LT_EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  else
-    MAGIC_CMD=:
-  fi
-fi
-
-  fi
-  ;;
-esac
-
-# Use C for the default configuration in the libtool script
-
-lt_save_CC="$CC"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-
-lt_prog_compiler_no_builtin_flag=
-
-if test "$GCC" = yes; then
-  lt_prog_compiler_no_builtin_flag=' -fno-builtin'
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_rtti_exceptions=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8899: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:8903: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
-     fi
-   fi
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
-    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
-    :
-fi
-
-fi
-
-
-
-
-
-
-  lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl='-Wl,'
-    lt_prog_compiler_static='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            lt_prog_compiler_pic='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic='-DDLL_EXPORT'
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic='-fno-common'
-      ;;
-
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic='-fPIC'
-	;;
-      esac
-      ;;
-
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared=no
-      enable_shared=no
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic='-fPIC -shared'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic=-Kconform_pic
-      fi
-      ;;
-
-    *)
-      lt_prog_compiler_pic='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static='-Bstatic'
-      else
-	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic='-DDLL_EXPORT'
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
-      case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
-      ecc*)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-KPIC'
-	lt_prog_compiler_static='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-fPIC'
-	lt_prog_compiler_static='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='--shared'
-	lt_prog_compiler_static='--static'
-	;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-fpic'
-	lt_prog_compiler_static='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static='-non_shared'
-        ;;
-      xl*)
-	# IBM XL C 8.0/Fortran 10.1 on PPC
-	lt_prog_compiler_wl='-Wl,'
-	lt_prog_compiler_pic='-qpic'
-	lt_prog_compiler_static='-qstaticlink'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C 5.9
-	  lt_prog_compiler_pic='-KPIC'
-	  lt_prog_compiler_static='-Bstatic'
-	  lt_prog_compiler_wl='-Wl,'
-	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  lt_prog_compiler_pic='-KPIC'
-	  lt_prog_compiler_static='-Bstatic'
-	  lt_prog_compiler_wl=''
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    newsos6)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic='-fPIC -shared'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    rdos*)
-      lt_prog_compiler_static='-non_shared'
-      ;;
-
-    solaris*)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      lt_prog_compiler_wl='-Qoption ld '
-      lt_prog_compiler_pic='-PIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	lt_prog_compiler_pic='-Kconform_pic'
-	lt_prog_compiler_static='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    unicos*)
-      lt_prog_compiler_wl='-Wl,'
-      lt_prog_compiler_can_build_shared=no
-      ;;
-
-    uts4*)
-      lt_prog_compiler_pic='-pic'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
-    *)
-      lt_prog_compiler_can_build_shared=no
-      ;;
-    esac
-  fi
-
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic=
-    ;;
-  *)
-    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-    ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
-$as_echo "$lt_prog_compiler_pic" >&6; }
-
-
-
-
-
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic_works=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9238: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:9242: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works=yes
-     fi
-   fi
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
-    case $lt_prog_compiler_pic in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
-     esac
-else
-    lt_prog_compiler_pic=
-     lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
-    :
-else
-    lt_prog_compiler_static=
-fi
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9343: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:9347: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9398: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:9402: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
-  runpath_var=
-  allow_undefined_flag=
-  always_export_symbols=no
-  archive_cmds=
-  archive_expsym_cmds=
-  compiler_needs_object=no
-  enable_shared_with_static_runtimes=no
-  export_dynamic_flag_spec=
-  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  hardcode_automatic=no
-  hardcode_direct=no
-  hardcode_direct_absolute=no
-  hardcode_libdir_flag_spec=
-  hardcode_libdir_flag_spec_ld=
-  hardcode_libdir_separator=
-  hardcode_minus_L=no
-  hardcode_shlibpath_var=unsupported
-  inherit_rpath=no
-  link_all_deplibs=unknown
-  module_cmds=
-  module_expsym_cmds=
-  old_archive_from_new_cmds=
-  old_archive_from_expsyms_cmds=
-  thread_safe_flag_spec=
-  whole_archive_flag_spec=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  linux* | k*bsd*-gnu)
-    link_all_deplibs=no
-    ;;
-  esac
-
-  ld_shlibs=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      whole_archive_flag_spec=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>&1` in
-      *GNU\ gold*) supports_anon_versioning=yes ;;
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[3-9]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	ld_shlibs=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            archive_expsym_cmds=''
-        ;;
-      m68k)
-            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_minus_L=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec='-L$libdir'
-      allow_undefined_flag=unsupported
-      always_export_symbols=no
-      enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    interix[3-9]*)
-      hardcode_direct=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
-      tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
-	case $cc_basename in
-	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
-	esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
-      then
-	tmp_addflag=
-	tmp_sharedflag='-shared'
-	case $cc_basename,$host_cpu in
-        pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	lf95*)				# Lahey Fortran 8.1
-	  whole_archive_flag_spec=
-	  tmp_sharedflag='--shared' ;;
-	xl[cC]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
-	  tmp_sharedflag='-qmkshrobj'
-	  tmp_addflag= ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	  compiler_needs_object=yes
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	esac
-	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-        if test "x$supports_anon_versioning" = xyes; then
-          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-        fi
-
-	case $cc_basename in
-	xlf*)
-	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec=
-	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
-	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-	  fi
-	  ;;
-	esac
-      else
-        ld_shlibs=no
-      fi
-      ;;
-
-    netbsd* | netbsdelf*-gnu)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-	ld_shlibs=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-	ld_shlibs=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  # For security reasons, it is highly recommended that you always
-	  # use absolute paths for naming shared libraries, and exclude the
-	  # DT_RUNPATH tag from executables and libraries.  But doing so
-	  # requires that you compile everything twice, which is a pain.
-	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  else
-	    ld_shlibs=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs=no
-      fi
-      ;;
-    esac
-
-    if test "$ld_shlibs" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec=
-      export_dynamic_flag_spec=
-      whole_archive_flag_spec=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag=unsupported
-      always_export_symbols=yes
-      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct=unsupported
-      fi
-      ;;
-
-    aix[4-9]*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-	else
-	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-	    aix_use_runtimelinking=yes
-	    break
-	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      archive_cmds=''
-      hardcode_direct=yes
-      hardcode_direct_absolute=yes
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      file_list_spec='${wl}-f,'
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	  # We have reworked collect2
-	  :
-	  else
-	  # We have old collect2
-	  hardcode_direct=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  hardcode_minus_L=yes
-	  hardcode_libdir_flag_spec='-L$libdir'
-	  hardcode_libdir_separator=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-	link_all_deplibs=no
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      export_dynamic_flag_spec='${wl}-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-      else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an
-	 # empty executable.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag=' ${wl}-bernotok'
-	  allow_undefined_flag=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec='$convenience'
-	  archive_cmds_need_lc=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            archive_expsym_cmds=''
-        ;;
-      m68k)
-            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            hardcode_libdir_flag_spec='-L$libdir'
-            hardcode_minus_L=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[45]*)
-      export_dynamic_flag_spec=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec=' '
-      allow_undefined_flag=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_from_new_cmds='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes=yes
-      ;;
-
-    darwin* | rhapsody*)
-
-
-  archive_cmds_need_lc=no
-  hardcode_direct=no
-  hardcode_automatic=yes
-  hardcode_shlibpath_var=unsupported
-  whole_archive_flag_spec=''
-  link_all_deplibs=yes
-  allow_undefined_flag="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=echo
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-
-  else
-  ld_shlibs=no
-  fi
-
-      ;;
-
-    dgux*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
-
-    freebsd1*)
-      ld_shlibs=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_direct=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L=yes
-      export_dynamic_flag_spec='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	hardcode_libdir_flag_spec_ld='+b $libdir'
-	hardcode_libdir_separator=:
-	hardcode_direct=yes
-	hardcode_direct_absolute=yes
-	export_dynamic_flag_spec='${wl}-E'
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	hardcode_minus_L=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  hardcode_direct=no
-	  hardcode_shlibpath_var=no
-	  ;;
-	*)
-	  hardcode_direct=yes
-	  hardcode_direct_absolute=yes
-	  export_dynamic_flag_spec='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	# Try to use the -exported_symbol ld option, if it does not
-	# work, assume that -exports_file does not work either and
-	# implicitly export all symbols.
-        save_LDFLAGS="$LDFLAGS"
-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int foo(void) {}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-        LDFLAGS="$save_LDFLAGS"
-      else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      inherit_rpath=yes
-      link_all_deplibs=yes
-      ;;
-
-    netbsd* | netbsdelf*-gnu)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    newsos6)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      hardcode_shlibpath_var=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-	hardcode_direct=yes
-	hardcode_shlibpath_var=no
-	hardcode_direct_absolute=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec='${wl}-E'
-	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	     ;;
-	  esac
-	fi
-      else
-	ld_shlibs=no
-      fi
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      allow_undefined_flag=unsupported
-      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-      else
-	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec='-rpath $libdir'
-      fi
-      archive_cmds_need_lc='no'
-      hardcode_libdir_separator=:
-      ;;
-
-    solaris*)
-      no_undefined_flag=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-	case `$CC -V 2>&1` in
-	*"Compilers 5.0"*)
-	  wlarc=''
-	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-	  ;;
-	*)
-	  wlarc='${wl}'
-	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-	  ;;
-	esac
-      fi
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_shlibpath_var=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
-	# but is careful enough not to reorder.
-	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	else
-	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      link_all_deplibs=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_direct=yes
-      hardcode_minus_L=yes
-      hardcode_shlibpath_var=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds='$CC -r -o $output$reload_objs'
-	  hardcode_direct=no
-        ;;
-	motorola)
-	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var=no
-      export_dynamic_flag_spec='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='${wl}-z,text'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag='${wl}-z,text'
-      allow_undefined_flag='${wl}-z,nodefs'
-      archive_cmds_need_lc=no
-      hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-R,$libdir'
-      hardcode_libdir_separator=':'
-      link_all_deplibs=yes
-      export_dynamic_flag_spec='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_shlibpath_var=no
-      ;;
-
-    *)
-      ld_shlibs=no
-      ;;
-    esac
-
-    if test x$host_vendor = xsni; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	export_dynamic_flag_spec='${wl}-Blargedynsym'
-	;;
-      esac
-    fi
-  fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
-
-with_gnu_ld=$with_gnu_ld
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-      $RM conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl
-	pic_flag=$lt_prog_compiler_pic
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag
-        allow_undefined_flag=
-        if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
-  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-        then
-	  archive_cmds_need_lc=no
-        else
-	  archive_cmds_need_lc=yes
-        fi
-        allow_undefined_flag=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $RM conftest*
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
-$as_echo "$archive_cmds_need_lc" >&6; }
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-if test "$GCC" = yes; then
-  case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
-      test -d "$lt_sys_path" && \
-	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[lt_foo]++; }
-  if (lt_freq[lt_foo] == 1) { print lt_foo; }
-}'`
-  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[4-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix[3-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # Some binutils ld are patched to set DT_RUNPATH
-  save_LDFLAGS=$LDFLAGS
-  save_libdir=$libdir
-  eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
-       LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
-  shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
-   test -n "$runpath_var" ||
-   test "X$hardcode_automatic" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test "$hardcode_action" = relink ||
-   test "$inherit_rpath" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-
-
-
-
-  if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-    ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-    ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
-else
-  ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-
-fi
-
-    ;;
-
-  *)
-    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = x""yes; then :
-  lt_cv_dlopen="shl_load"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dld_shl_load=yes
-else
-  ac_cv_lib_dld_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
-else
-  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = x""yes; then :
-  lt_cv_dlopen="dlopen"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dl_dlopen=yes
-else
-  ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_svld_dlopen=yes
-else
-  ac_cv_lib_svld_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dld_dld_link=yes
-else
-  ac_cv_lib_dld_dld_link=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if test "${lt_cv_dlopen_self+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line 11782 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}
-_LT_EOF
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if test "${lt_cv_dlopen_self_static+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  	  if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line 11878 "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}
-_LT_EOF
-  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&5 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
-      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP" ; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    fi
-    ;;
-  *)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    ;;
-  esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-  # Report which library types will actually be built
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
-  test "$can_build_shared" = "no" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test "$enable_shared" = yes && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[4-9]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
-    fi
-    ;;
-  esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
-  # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-
-
-
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-compiler_needs_object_CXX=no
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_direct_absolute_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-inherit_rpath_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="int some_variable = 0;"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-  # save warnings/boilerplate of simple test code
-  ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-  ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_LD=$LD
-  lt_save_GCC=$GCC
-  GCC=$GXX
-  lt_save_with_gnu_ld=$with_gnu_ld
-  lt_save_path_LD=$lt_cv_path_LD
-  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-  else
-    $as_unset lt_cv_prog_gnu_ld
-  fi
-  if test -n "${lt_cv_path_LDCXX+set}"; then
-    lt_cv_path_LD=$lt_cv_path_LDCXX
-  else
-    $as_unset lt_cv_path_LD
-  fi
-  test -z "${LDCXX+set}" || LD=$LDCXX
-  CC=${CXX-"c++"}
-  compiler=$CC
-  compiler_CXX=$CC
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-  if test -n "$compiler"; then
-    # We don't want -fno-exception when compiling C++ code, so set the
-    # no_builtin_flag separately
-    if test "$GXX" = yes; then
-      lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-    else
-      lt_prog_compiler_no_builtin_flag_CXX=
-    fi
-
-    if test "$GXX" = yes; then
-      # Set up default GNU C++ configuration
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-      # Check if GNU C++ uses GNU ld as the underlying linker, since the
-      # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
-        # If archive_cmds runs LD, not CC, wlarc should be empty
-        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-        #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
-
-        # ancient GNU ld didn't support --whole-archive et. al.
-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
-	  $GREP 'no-whole-archive' > /dev/null; then
-          whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-        else
-          whole_archive_flag_spec_CXX=
-        fi
-      else
-        with_gnu_ld=no
-        wlarc=
-
-        # A generic and very simple default shared library creation
-        # command for GNU C++ for the case where it uses the native
-        # linker, instead of GNU ld.  If possible, this setting should
-        # overridden to take advantage of the native linker features on
-        # the platform it is being used on.
-        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      fi
-
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-
-    else
-      GXX=no
-      with_gnu_ld=no
-      wlarc=
-    fi
-
-    # PORTME: fill in a description of your system's C++ link characteristics
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-    ld_shlibs_CXX=yes
-    case $host_os in
-      aix3*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-      aix[4-9]*)
-        if test "$host_cpu" = ia64; then
-          # On IA64, the linker does run time linking by default, so we don't
-          # have to do anything special.
-          aix_use_runtimelinking=no
-          exp_sym_flag='-Bexport'
-          no_entry_flag=""
-        else
-          aix_use_runtimelinking=no
-
-          # Test if we are trying to use run time linking or normal
-          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
-          case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	    for ld_flag in $LDFLAGS; do
-	      case $ld_flag in
-	      *-brtl*)
-	        aix_use_runtimelinking=yes
-	        break
-	        ;;
-	      esac
-	    done
-	    ;;
-          esac
-
-          exp_sym_flag='-bexport'
-          no_entry_flag='-bnoentry'
-        fi
-
-        # When large executables or shared objects are built, AIX ld can
-        # have problems creating the table of contents.  If linking a library
-        # or program results in "error TOC overflow" add -mminimal-toc to
-        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-        archive_cmds_CXX=''
-        hardcode_direct_CXX=yes
-        hardcode_direct_absolute_CXX=yes
-        hardcode_libdir_separator_CXX=':'
-        link_all_deplibs_CXX=yes
-        file_list_spec_CXX='${wl}-f,'
-
-        if test "$GXX" = yes; then
-          case $host_os in aix4.[012]|aix4.[012].*)
-          # We only want to do this on AIX 4.2 and lower, the check
-          # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	    # We have reworked collect2
-	    :
-	  else
-	    # We have old collect2
-	    hardcode_direct_CXX=unsupported
-	    # It fails to find uninstalled libraries when the uninstalled
-	    # path is not listed in the libpath.  Setting hardcode_minus_L
-	    # to unsupported forces relinking
-	    hardcode_minus_L_CXX=yes
-	    hardcode_libdir_flag_spec_CXX='-L$libdir'
-	    hardcode_libdir_separator_CXX=
-	  fi
-          esac
-          shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
-	  fi
-        else
-          # not using gcc
-          if test "$host_cpu" = ia64; then
-	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	  # chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-          else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
-	    else
-	      shared_flag='${wl}-bM:SRE'
-	    fi
-          fi
-        fi
-
-        export_dynamic_flag_spec_CXX='${wl}-bexpall'
-        # It seems that -bexpall does not export symbols beginning with
-        # underscore (_), so it is better to generate a list of symbols to
-	# export.
-        always_export_symbols_CXX=yes
-        if test "$aix_use_runtimelinking" = yes; then
-          # Warning - without using the other runtime loading flags (-brtl),
-          # -berok will link without error, but may produce a broken library.
-          allow_undefined_flag_CXX='-berok'
-          # Determine the default libpath from the value encoded in an empty
-          # executable.
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-          hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-        else
-          if test "$host_cpu" = ia64; then
-	    hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
-	    allow_undefined_flag_CXX="-z nodefs"
-	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-          else
-	    # Determine the default libpath from the value encoded in an
-	    # empty executable.
-	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-	    # Warning - without using the other run time loading flags,
-	    # -berok will link without error, but may produce a broken library.
-	    no_undefined_flag_CXX=' ${wl}-bernotok'
-	    allow_undefined_flag_CXX=' ${wl}-berok'
-	    # Exported symbols can be pulled into shared objects from archives
-	    whole_archive_flag_spec_CXX='$convenience'
-	    archive_cmds_need_lc_CXX=yes
-	    # This is similar to how AIX traditionally builds its shared
-	    # libraries.
-	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-          fi
-        fi
-        ;;
-
-      beos*)
-	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	  allow_undefined_flag_CXX=unsupported
-	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	  # support --undefined.  This deserves some investigation.  FIXME
-	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	else
-	  ld_shlibs_CXX=no
-	fi
-	;;
-
-      chorus*)
-        case $cc_basename in
-          *)
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	  ;;
-        esac
-        ;;
-
-      cygwin* | mingw* | pw32* | cegcc*)
-        # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
-        # as there is no search path for DLLs.
-        hardcode_libdir_flag_spec_CXX='-L$libdir'
-        allow_undefined_flag_CXX=unsupported
-        always_export_symbols_CXX=no
-        enable_shared_with_static_runtimes_CXX=yes
-
-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-          archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-          # If the export-symbols file already is a .def file (1st line
-          # is EXPORTS), use it as is; otherwise, prepend...
-          archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    cp $export_symbols $output_objdir/$soname.def;
-          else
-	    echo EXPORTS > $output_objdir/$soname.def;
-	    cat $export_symbols >> $output_objdir/$soname.def;
-          fi~
-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-        else
-          ld_shlibs_CXX=no
-        fi
-        ;;
-      darwin* | rhapsody*)
-
-
-  archive_cmds_need_lc_CXX=no
-  hardcode_direct_CXX=no
-  hardcode_automatic_CXX=yes
-  hardcode_shlibpath_var_CXX=unsupported
-  whole_archive_flag_spec_CXX=''
-  link_all_deplibs_CXX=yes
-  allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=echo
-    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-       if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-    fi
-
-  else
-  ld_shlibs_CXX=no
-  fi
-
-	;;
-
-      dgux*)
-        case $cc_basename in
-          ec++*)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          ghcx*)
-	    # Green Hills C++ Compiler
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-        esac
-        ;;
-
-      freebsd[12]*)
-        # C++ shared libraries reported to be fairly broken before
-	# switch to ELF
-        ld_shlibs_CXX=no
-        ;;
-
-      freebsd-elf*)
-        archive_cmds_need_lc_CXX=no
-        ;;
-
-      freebsd* | dragonfly*)
-        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-        # conventions
-        ld_shlibs_CXX=yes
-        ;;
-
-      gnu*)
-        ;;
-
-      hpux9*)
-        hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-        hardcode_libdir_separator_CXX=:
-        export_dynamic_flag_spec_CXX='${wl}-E'
-        hardcode_direct_CXX=yes
-        hardcode_minus_L_CXX=yes # Not in the search PATH,
-				             # but as the default
-				             # location of the library.
-
-        case $cc_basename in
-          CC*)
-            # FIXME: insert proper C++ library support
-            ld_shlibs_CXX=no
-            ;;
-          aCC*)
-            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            # Commands to make compiler produce verbose output that lists
-            # what "hidden" libraries, object files and flags are used when
-            # linking a shared library.
-            #
-            # There doesn't appear to be a way to prevent this compiler from
-            # explicitly linking system object files so we need to strip them
-            # from the output so that they don't get included in the library
-            # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-            ;;
-          *)
-            if test "$GXX" = yes; then
-              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            else
-              # FIXME: insert proper C++ library support
-              ld_shlibs_CXX=no
-            fi
-            ;;
-        esac
-        ;;
-
-      hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-	  hardcode_libdir_separator_CXX=:
-
-          case $host_cpu in
-            hppa*64*|ia64*)
-              ;;
-            *)
-	      export_dynamic_flag_spec_CXX='${wl}-E'
-              ;;
-          esac
-        fi
-        case $host_cpu in
-          hppa*64*|ia64*)
-            hardcode_direct_CXX=no
-            hardcode_shlibpath_var_CXX=no
-            ;;
-          *)
-            hardcode_direct_CXX=yes
-            hardcode_direct_absolute_CXX=yes
-            hardcode_minus_L_CXX=yes # Not in the search PATH,
-					         # but as the default
-					         # location of the library.
-            ;;
-        esac
-
-        case $cc_basename in
-          CC*)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          aCC*)
-	    case $host_cpu in
-	      hppa*64*)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      ia64*)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      *)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	    esac
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-	    ;;
-          *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
-	        case $host_cpu in
-	          hppa*64*)
-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          ia64*)
-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          *)
-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	        esac
-	      fi
-	    else
-	      # FIXME: insert proper C++ library support
-	      ld_shlibs_CXX=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      interix[3-9]*)
-	hardcode_direct_CXX=no
-	hardcode_shlibpath_var_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_CXX='${wl}-E'
-	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-	# Instead, shared libraries are loaded at an image base (0x10000000 by
-	# default) and relocated if they conflict, which is a slow very memory
-	# consuming and fragmenting process.  To avoid this, we pick a random,
-	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	;;
-      irix5* | irix6*)
-        case $cc_basename in
-          CC*)
-	    # SGI C++
-	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	      else
-	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
-	      fi
-	    fi
-	    link_all_deplibs_CXX=yes
-	    ;;
-        esac
-        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-        hardcode_libdir_separator_CXX=:
-        inherit_rpath_CXX=yes
-        ;;
-
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	    old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-	    ;;
-	  icpc* | ecpc* )
-	    # Intel C++
-	    with_gnu_ld=yes
-	    # version 8.0 and above of icpc choke on multiply defined symbols
-	    # if we add $predep_objects and $postdep_objects, however 7.1 and
-	    # earlier do not add the objects themselves.
-	    case `$CC -V 2>&1` in
-	      *"Version 7."*)
-	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	      *)  # Version 8.0 or newer
-	        tmp_idyn=
-	        case $host_cpu in
-		  ia64*) tmp_idyn=' -i_dynamic';;
-		esac
-	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	    esac
-	    archive_cmds_need_lc_CXX=no
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	    ;;
-          pgCC* | pgcpp*)
-            # Portland Group C++ compiler
-	    case `$CC -V` in
-	    *pgCC\ [1-5]* | *pgcpp\ [1-5]*)
-	      prelink_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
-	      old_archive_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
-		$RANLIB $oldlib'
-	      archive_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      archive_expsym_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-	      ;;
-	    *) # Version 6 will use weak symbols
-	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-	      ;;
-	    esac
-
-	    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-            ;;
-	  cxx*)
-	    # Compaq C++
-	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-	    runpath_var=LD_RUN_PATH
-	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-	    hardcode_libdir_separator_CXX=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-	    ;;
-	  xl*)
-	    # IBM XL 8.0 on PPC, with GNU ld
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
-	      archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	    fi
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      no_undefined_flag_CXX=' -zdefs'
-	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-	      hardcode_libdir_flag_spec_CXX='-R$libdir'
-	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	      compiler_needs_object_CXX=yes
-
-	      # Not sure whether something based on
-	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-	      # would be better.
-	      output_verbose_link_cmd='echo'
-
-	      # Archives containing C++ object files must be created using
-	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	      # necessary to make sure instantiated templates are included
-	      # in the archive.
-	      old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-
-      lynxos*)
-        # FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-
-      m88k*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-	;;
-
-      mvs*)
-        case $cc_basename in
-          cxx*)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-	  *)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-	esac
-	;;
-
-      netbsd*)
-        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	  archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-	  wlarc=
-	  hardcode_libdir_flag_spec_CXX='-R$libdir'
-	  hardcode_direct_CXX=yes
-	  hardcode_shlibpath_var_CXX=no
-	fi
-	# Workaround some broken pre-1.5 toolchains
-	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-	;;
-
-      *nto* | *qnx*)
-        ld_shlibs_CXX=yes
-	;;
-
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	ld_shlibs_CXX=no
-	;;
-
-      openbsd*)
-	if test -f /usr/libexec/ld.so; then
-	  hardcode_direct_CXX=yes
-	  hardcode_shlibpath_var_CXX=no
-	  hardcode_direct_absolute_CXX=yes
-	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    export_dynamic_flag_spec_CXX='${wl}-E'
-	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-	  fi
-	  output_verbose_link_cmd=echo
-	else
-	  ld_shlibs_CXX=no
-	fi
-	;;
-
-      osf3* | osf4* | osf5*)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	    hardcode_libdir_separator_CXX=:
-
-	    # Archives containing C++ object files must be created using
-	    # the KAI C++ compiler.
-	    case $host in
-	      osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
-	      *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
-	    esac
-	    ;;
-          RCC*)
-	    # Rational C++ 2.4.1
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          cxx*)
-	    case $host in
-	      osf3*)
-	        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-		;;
-	      *)
-	        allow_undefined_flag_CXX=' -expect_unresolved \*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
-	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-		;;
-	    esac
-
-	    hardcode_libdir_separator_CXX=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-	    ;;
-	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	      case $host in
-	        osf3*)
-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-		  ;;
-	        *)
-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-		  ;;
-	      esac
-
-	      hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	      hardcode_libdir_separator_CXX=:
-
-	      # Commands to make compiler produce verbose output that lists
-	      # what "hidden" libraries, object files and flags are used when
-	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-
-	    else
-	      # FIXME: insert proper C++ library support
-	      ld_shlibs_CXX=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      psos*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-
-      sunos4*)
-        case $cc_basename in
-          CC*)
-	    # Sun C++ 4.x
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          lcc*)
-	    # Lucid
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-        esac
-        ;;
-
-      solaris*)
-        case $cc_basename in
-          CC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-            archive_cmds_need_lc_CXX=yes
-	    no_undefined_flag_CXX=' -zdefs'
-	    archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	    archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	    hardcode_libdir_flag_spec_CXX='-R$libdir'
-	    hardcode_shlibpath_var_CXX=no
-	    case $host_os in
-	      solaris2.[0-5] | solaris2.[0-5].*) ;;
-	      *)
-		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
-	        # Supported since Solaris 2.6 (maybe 2.5.1?)
-		whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
-	        ;;
-	    esac
-	    link_all_deplibs_CXX=yes
-
-	    output_verbose_link_cmd='echo'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-	    ;;
-          gcx*)
-	    # Green Hills C++ Compiler
-	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-	    # The C++ compiler must be used to create the archive.
-	    old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
-	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	        # platform.
-	        archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-	      fi
-
-	      hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
-	      case $host_os in
-		solaris2.[0-5] | solaris2.[0-5].*) ;;
-		*)
-		  whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-		  ;;
-	      esac
-	    fi
-	    ;;
-        esac
-        ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag_CXX='${wl}-z,text'
-      archive_cmds_need_lc_CXX=no
-      hardcode_shlibpath_var_CXX=no
-      runpath_var='LD_RUN_PATH'
-
-      case $cc_basename in
-        CC*)
-	  archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-      esac
-      ;;
-
-      sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
-	# link with -lc, and that would cause any symbols used from libc to
-	# always be unresolved, which means just about no library would
-	# ever link correctly.  If we're not using GNU ld we use -z text
-	# though, which does catch some bad symbols but isn't as heavy-handed
-	# as -z defs.
-	no_undefined_flag_CXX='${wl}-z,text'
-	allow_undefined_flag_CXX='${wl}-z,nodefs'
-	archive_cmds_need_lc_CXX=no
-	hardcode_shlibpath_var_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
-	hardcode_libdir_separator_CXX=':'
-	link_all_deplibs_CXX=yes
-	export_dynamic_flag_spec_CXX='${wl}-Bexport'
-	runpath_var='LD_RUN_PATH'
-
-	case $cc_basename in
-          CC*)
-	    archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    ;;
-	  *)
-	    archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    ;;
-	esac
-      ;;
-
-      tandem*)
-        case $cc_basename in
-          NCC*)
-	    # NonStop-UX NCC 3.20
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    ld_shlibs_CXX=no
-	    ;;
-        esac
-        ;;
-
-      vxworks*)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-
-      *)
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-        ;;
-    esac
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-    test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-    GCC_CXX="$GXX"
-    LD_CXX="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    # Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-_LT_EOF
-
-if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  for p in `eval "$output_verbose_link_cmd"`; do
-    case $p in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
-	 prev=$p
-	 continue
-       else
-	 prev=
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$compiler_lib_search_path_CXX"; then
-	     compiler_lib_search_path_CXX="${prev}${p}"
-	   else
-	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$postdeps_CXX"; then
-	   postdeps_CXX="${prev}${p}"
-	 else
-	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
-	 fi
-       fi
-       ;;
-
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 if test -z "$predep_objects_CXX"; then
-	   predep_objects_CXX="$p"
-	 else
-	   predep_objects_CXX="$predep_objects_CXX $p"
-	 fi
-       else
-	 if test -z "$postdep_objects_CXX"; then
-	   postdep_objects_CXX="$p"
-	 else
-	   postdep_objects_CXX="$postdep_objects_CXX $p"
-	 fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$RM -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix[3-9]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  predep_objects_CXX=
-  postdep_objects_CXX=
-  postdeps_CXX=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
- compiler_lib_search_dirs_CXX=
-if test -n "${compiler_lib_search_path_CXX}"; then
- compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    lt_prog_compiler_wl_CXX='-Wl,'
-    lt_prog_compiler_static_CXX='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_CXX='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            lt_prog_compiler_pic_CXX='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_CXX='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      lt_prog_compiler_pic_CXX=
-      ;;
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_CXX=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	;;
-      *)
-	lt_prog_compiler_pic_CXX='-fPIC'
-	;;
-      esac
-      ;;
-    *qnx* | *nto*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      lt_prog_compiler_pic_CXX='-fPIC -shared'
-      ;;
-    *)
-      lt_prog_compiler_pic_CXX='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[4-9]*)
-	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
-	  # AIX 5 now supports IA64 processor
-	  lt_prog_compiler_static_CXX='-Bstatic'
-	else
-	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
-	fi
-	;;
-      chorus*)
-	case $cc_basename in
-	cxch68*)
-	  # Green Hills C++ Compiler
-	  # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-	  ;;
-	esac
-	;;
-      dgux*)
-	case $cc_basename in
-	  ec++*)
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    ;;
-	  ghcx*)
-	    # Green Hills C++ Compiler
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      freebsd* | dragonfly*)
-	# FreeBSD uses GNU C++
-	;;
-      hpux9* | hpux10* | hpux11*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
-	      lt_prog_compiler_pic_CXX='+Z'
-	    fi
-	    ;;
-	  aCC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-	    case $host_cpu in
-	    hppa*64*|ia64*)
-	      # +Z the default
-	      ;;
-	    *)
-	      lt_prog_compiler_pic_CXX='+Z'
-	      ;;
-	    esac
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      interix*)
-	# This is c89, which is MS Visual C++ (no shared libs)
-	# Anyone wants to do a port?
-	;;
-      irix5* | irix6* | nonstopux*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    # CC pic flag -KPIC is the default.
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-	case $cc_basename in
-	  KCC*)
-	    # KAI C++ Compiler
-	    lt_prog_compiler_wl_CXX='--backend -Wl,'
-	    lt_prog_compiler_pic_CXX='-fPIC'
-	    ;;
-	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-static'
-	    ;;
-	  icpc* )
-	    # Intel C++, used to be incompatible with GCC.
-	    # ICC 10 doesn't accept -KPIC any more.
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-fPIC'
-	    lt_prog_compiler_static_CXX='-static'
-	    ;;
-	  pgCC* | pgcpp*)
-	    # Portland Group C++ compiler
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-fpic'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	  cxx*)
-	    # Compaq C++
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    lt_prog_compiler_pic_CXX=
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    ;;
-	  xlc* | xlC*)
-	    # IBM XL 8.0 on PPC
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-qpic'
-	    lt_prog_compiler_static_CXX='-qstaticlink'
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      lt_prog_compiler_pic_CXX='-KPIC'
-	      lt_prog_compiler_static_CXX='-Bstatic'
-	      lt_prog_compiler_wl_CXX='-Qoption ld '
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-      lynxos*)
-	;;
-      m88k*)
-	;;
-      mvs*)
-	case $cc_basename in
-	  cxx*)
-	    lt_prog_compiler_pic_CXX='-W c,exportall'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      netbsd* | netbsdelf*-gnu)
-	;;
-      *qnx* | *nto*)
-        # QNX uses GNU C++, but need to define -shared option too, otherwise
-        # it will coredump.
-        lt_prog_compiler_pic_CXX='-fPIC -shared'
-        ;;
-      osf3* | osf4* | osf5*)
-	case $cc_basename in
-	  KCC*)
-	    lt_prog_compiler_wl_CXX='--backend -Wl,'
-	    ;;
-	  RCC*)
-	    # Rational C++ 2.4.1
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  cxx*)
-	    # Digital/Compaq C++
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    lt_prog_compiler_pic_CXX=
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      psos*)
-	;;
-      solaris*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    lt_prog_compiler_wl_CXX='-Qoption ld '
-	    ;;
-	  gcx*)
-	    # Green Hills C++ Compiler
-	    lt_prog_compiler_pic_CXX='-PIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sunos4*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.x
-	    lt_prog_compiler_pic_CXX='-pic'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	  lcc*)
-	    # Lucid
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	esac
-	;;
-      tandem*)
-	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      vxworks*)
-	;;
-      *)
-	lt_prog_compiler_can_build_shared_CXX=no
-	;;
-    esac
-  fi
-
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_CXX=
-    ;;
-  *)
-    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
-    ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5
-$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
-
-
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
-if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_pic_works_CXX=no
-   ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13834: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:13838: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works_CXX=yes
-     fi
-   fi
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
-    case $lt_prog_compiler_pic_CXX in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
-     esac
-else
-    lt_prog_compiler_pic_CXX=
-     lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_static_works_CXX=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works_CXX=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works_CXX=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
-    :
-else
-    lt_prog_compiler_static_CXX=
-fi
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o_CXX=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13933: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:13937: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_CXX=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_prog_compiler_c_o_CXX=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13985: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:13989: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_CXX=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
-  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix[4-9]*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    export_symbols_cmds_CXX="$ltdll_cmds"
-  ;;
-  cygwin* | mingw* | cegcc*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  linux* | k*bsd*-gnu)
-    link_all_deplibs_CXX=no
-  ;;
-  *)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-with_gnu_ld_CXX=$with_gnu_ld
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_CXX=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_CXX in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-      $RM conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_CXX
-	pic_flag=$lt_prog_compiler_pic_CXX
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
-        allow_undefined_flag_CXX=
-        if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
-  (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-        then
-	  archive_cmds_need_lc_CXX=no
-        else
-	  archive_cmds_need_lc_CXX=yes
-        fi
-        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $RM conftest*
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5
-$as_echo "$archive_cmds_need_lc_CXX" >&6; }
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[4-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix[3-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # Some binutils ld are patched to set DT_RUNPATH
-  save_LDFLAGS=$LDFLAGS
-  save_libdir=$libdir
-  eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
-       LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
-  shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" ||
-   test -n "$runpath_var_CXX" ||
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct_CXX" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_CXX=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_CXX=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_CXX=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
-$as_echo "$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink ||
-   test "$inherit_rpath_CXX" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-
-
-
-
-
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-
-
-
-
-
-
-
-
-
-
-        ac_config_commands="$ac_config_commands libtool"
-
-
-
-
-# Only expand once:
-
-
-
-
-
-
-# Check whether --with-backchannel was given.
-if test "${with_backchannel+set}" = set; then :
-  withval=$with_backchannel;
-else
-   with_backchannel=yes
-fi
-
-if test "x$with_backchannel" = "xyes"; then
-	$as_echo "#define BACKCHANNEL 1" >>confdefs.h
-
-fi
-
-
-# Check whether --with-24bpp was given.
-if test "${with_24bpp+set}" = set; then :
-  withval=$with_24bpp;
-else
-   with_24bpp=yes
-fi
-
-if test "x$with_24bpp" = "xyes"; then
-	$as_echo "#define ALLOW24BPP 1" >>confdefs.h
-
-fi
-
-
-
-
-
-
-# Check whether --with-linux was given.
-if test "${with_linux+set}" = set; then :
-  withval=$with_linux;  build_linux=true
-else
-   build_linux=false
-fi
-
-
-# Check whether --with-win32 was given.
-if test "${with_win32+set}" = set; then :
-  withval=$with_win32;  build_win32=true
-else
-   build_win32=false
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking platform to build for" >&5
-$as_echo_n "checking platform to build for... " >&6; }
-
-EXTRAFLAGS="-g -O2 -Wall"
-if test "x$build_win32" = "xtrue" ; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Win32, will enable support for it" >&5
-$as_echo "Win32, will enable support for it" >&6; }
-	$as_echo "#define BUILD_WIN32 1" >>confdefs.h
-
-	$as_echo "#define WIN32 1" >>confdefs.h
-
-	build_linux="false"
-	build_win32="true"
-else
-	EXTRAFLAGS="$EXTRAFLAGS -fPIC"
-
-	if test `uname -s | tr -s 'LINUX' 'linux'` = "linux" -o "x$build_linux" = "xtrue" ; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux, will enable support for it" >&5
-$as_echo "Linux, will enable support for it" >&6; }
-		$as_echo "#define BUILD_LINUX 1" >>confdefs.h
-
-		build_linux="true"
-		build_win32="false"
-	fi
-fi
-
-CFLAGS="$CFLAGS $EXTRAFLAGS"
-CXXFLAGS="$CXXFLAGS $EXTRAFLAGS"
-
- if test "$build_win32" = "true"; then
-  BUILD_WIN32_TRUE=
-  BUILD_WIN32_FALSE='#'
-else
-  BUILD_WIN32_TRUE='#'
-  BUILD_WIN32_FALSE=
-fi
-
- if test "$build_linux" = "true"; then
-  BUILD_LINUX_TRUE=
-  BUILD_LINUX_FALSE='#'
-else
-  BUILD_LINUX_TRUE='#'
-  BUILD_LINUX_FALSE=
-fi
-
-
-
-
-# Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then :
-  enableval=$enable_debug;  enable_debug=true
-else
-   enable_debug=false
-fi
-
- if test "$enable_debug" = "true"; then
-  DEBUG_TRUE=
-  DEBUG_FALSE='#'
-else
-  DEBUG_TRUE='#'
-  DEBUG_FALSE=
-fi
-
-
-
-
-
-HAVE_X="false"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
-$as_echo_n "checking for X... " >&6; }
-
-
-# Check whether --with-x was given.
-if test "${with_x+set}" = set; then :
-  withval=$with_x;
-fi
-
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
-  # The user explicitly disabled X.
-  have_x=disabled
-else
-  case $x_includes,$x_libraries in #(
-    *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5 ;; #(
-    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=no ac_x_libraries=no
-rm -f -r conftest.dir
-if mkdir conftest.dir; then
-  cd conftest.dir
-  cat >Imakefile <<'_ACEOF'
-incroot:
-	@echo incroot='${INCROOT}'
-usrlibdir:
-	@echo usrlibdir='${USRLIBDIR}'
-libdir:
-	@echo libdir='${LIBDIR}'
-_ACEOF
-  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-    for ac_var in incroot usrlibdir libdir; do
-      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
-    done
-    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
-    for ac_extension in a so sl dylib la dll; do
-      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
-	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
-	ac_im_usrlibdir=$ac_im_libdir; break
-      fi
-    done
-    # Screen out bogus values from the imake configuration.  They are
-    # bogus both because they are the default anyway, and because
-    # using them would break gcc on systems where it needs fixed includes.
-    case $ac_im_incroot in
-	/usr/include) ac_x_includes= ;;
-	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
-    esac
-    case $ac_im_usrlibdir in
-	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
-	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
-    esac
-  fi
-  cd ..
-  rm -f -r conftest.dir
-fi
-
-# Standard set of common directories for X headers.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-ac_x_header_dirs='
-/usr/X11/include
-/usr/X11R7/include
-/usr/X11R6/include
-/usr/X11R5/include
-/usr/X11R4/include
-
-/usr/include/X11
-/usr/include/X11R7
-/usr/include/X11R6
-/usr/include/X11R5
-/usr/include/X11R4
-
-/usr/local/X11/include
-/usr/local/X11R7/include
-/usr/local/X11R6/include
-/usr/local/X11R5/include
-/usr/local/X11R4/include
-
-/usr/local/include/X11
-/usr/local/include/X11R7
-/usr/local/include/X11R6
-/usr/local/include/X11R5
-/usr/local/include/X11R4
-
-/usr/X386/include
-/usr/x386/include
-/usr/XFree86/include/X11
-
-/usr/include
-/usr/local/include
-/usr/unsupported/include
-/usr/athena/include
-/usr/local/x11r5/include
-/usr/lpp/Xamples/include
-
-/usr/openwin/include
-/usr/openwin/share/include'
-
-if test "$ac_x_includes" = no; then
-  # Guess where to find include files, by looking for Xlib.h.
-  # First, try using that file with no special directory specified.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <X11/Xlib.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
-  for ac_dir in $ac_x_header_dirs; do
-  if test -r "$ac_dir/X11/Xlib.h"; then
-    ac_x_includes=$ac_dir
-    break
-  fi
-done
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-fi # $ac_x_includes = no
-
-if test "$ac_x_libraries" = no; then
-  # Check for the libraries.
-  # See if we find them without any special options.
-  # Don't add to $LIBS permanently.
-  ac_save_LIBS=$LIBS
-  LIBS="-lX11 $LIBS"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <X11/Xlib.h>
-int
-main ()
-{
-XrmInitialize ()
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  LIBS=$ac_save_LIBS
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
-  LIBS=$ac_save_LIBS
-for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
-do
-  # Don't even attempt the hair of trying to link an X program!
-  for ac_extension in a so sl dylib la dll; do
-    if test -r "$ac_dir/libX11.$ac_extension"; then
-      ac_x_libraries=$ac_dir
-      break 2
-    fi
-  done
-done
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi # $ac_x_libraries = no
-
-case $ac_x_includes,$ac_x_libraries in #(
-  no,* | *,no | *\'*)
-    # Didn't find X, or a directory has "'" in its name.
-    ac_cv_have_x="have_x=no";; #(
-  *)
-    # Record where we found X for the cache.
-    ac_cv_have_x="have_x=yes\
-	ac_x_includes='$ac_x_includes'\
-	ac_x_libraries='$ac_x_libraries'"
-esac
-fi
-;; #(
-    *) have_x=yes;;
-  esac
-  eval "$ac_cv_have_x"
-fi # $with_x != no
-
-if test "$have_x" != yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
-$as_echo "$have_x" >&6; }
-  no_x=yes
-else
-  # If each of the values was on the command line, it overrides each guess.
-  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
-  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
-  # Update the cache value to reflect the command line values.
-  ac_cv_have_x="have_x=yes\
-	ac_x_includes='$x_includes'\
-	ac_x_libraries='$x_libraries'"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
-$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
-fi
-
-if test "$no_x" = yes; then
-  # Not all programs may use this symbol, but it does not hurt to define it.
-
-$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h
-
-  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
-else
-  if test -n "$x_includes"; then
-    X_CFLAGS="$X_CFLAGS -I$x_includes"
-  fi
-
-  # It would also be nice to do this for all -L options, not just this one.
-  if test -n "$x_libraries"; then
-    X_LIBS="$X_LIBS -L$x_libraries"
-    # For Solaris; some versions of Sun CC require a space after -R and
-    # others require no space.  Words are not sufficient . . . .
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5
-$as_echo_n "checking whether -R must be followed by a space... " >&6; }
-    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
-    ac_xsave_c_werror_flag=$ac_c_werror_flag
-    ac_c_werror_flag=yes
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-       X_LIBS="$X_LIBS -R$x_libraries"
-else
-  LIBS="$ac_xsave_LIBS -R $x_libraries"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	  X_LIBS="$X_LIBS -R $x_libraries"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5
-$as_echo "neither works" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    ac_c_werror_flag=$ac_xsave_c_werror_flag
-    LIBS=$ac_xsave_LIBS
-  fi
-
-  # Check for system-dependent libraries X programs must link with.
-  # Do this before checking for the system-independent R6 libraries
-  # (-lICE), since we may need -lsocket or whatever for X linking.
-
-  if test "$ISC" = yes; then
-    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
-  else
-    # Martyn Johnson says this is needed for Ultrix, if the X
-    # libraries were built with DECnet support.  And Karl Berry says
-    # the Alpha needs dnet_stub (dnet does not exist).
-    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XOpenDisplay ();
-int
-main ()
-{
-return XOpenDisplay ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
-if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dnet_dnet_ntoa=yes
-else
-  ac_cv_lib_dnet_dnet_ntoa=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
-fi
-
-    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
-if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet_stub  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dnet_stub_dnet_ntoa=yes
-else
-  ac_cv_lib_dnet_stub_dnet_ntoa=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
-fi
-
-    fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LIBS="$ac_xsave_LIBS"
-
-    # msh at cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
-    # to get the SysV transport functions.
-    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
-    # needs -lnsl.
-    # The nsl library prevents programs from opening the X display
-    # on Irix 5.2, according to T.E. Dickey.
-    # The functions gethostbyname, getservbyname, and inet_addr are
-    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
-    ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = x""yes; then :
-
-fi
-
-    if test $ac_cv_func_gethostbyname = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_nsl_gethostbyname=yes
-else
-  ac_cv_lib_nsl_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
-fi
-
-      if test $ac_cv_lib_nsl_gethostbyname = no; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
-$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
-if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_bsd_gethostbyname=yes
-else
-  ac_cv_lib_bsd_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
-$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
-if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
-fi
-
-      fi
-    fi
-
-    # lieder at skyler.mavd.honeywell.com says without -lsocket,
-    # socket/setsockopt and other routines are undefined under SCO ODT
-    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
-    # on later versions), says Simon Leinen: it contains gethostby*
-    # variants that don't use the name server (or something).  -lsocket
-    # must be given before -lnsl if both are needed.  We assume that
-    # if connect needs -lnsl, so does gethostbyname.
-    ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
-if test "x$ac_cv_func_connect" = x""yes; then :
-
-fi
-
-    if test $ac_cv_func_connect = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
-$as_echo_n "checking for connect in -lsocket... " >&6; }
-if test "${ac_cv_lib_socket_connect+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char connect ();
-int
-main ()
-{
-return connect ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_socket_connect=yes
-else
-  ac_cv_lib_socket_connect=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
-$as_echo "$ac_cv_lib_socket_connect" >&6; }
-if test "x$ac_cv_lib_socket_connect" = x""yes; then :
-  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
-fi
-
-    fi
-
-    # Guillermo Gomez says -lposix is necessary on A/UX.
-    ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove"
-if test "x$ac_cv_func_remove" = x""yes; then :
-
-fi
-
-    if test $ac_cv_func_remove = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
-$as_echo_n "checking for remove in -lposix... " >&6; }
-if test "${ac_cv_lib_posix_remove+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lposix  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char remove ();
-int
-main ()
-{
-return remove ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_posix_remove=yes
-else
-  ac_cv_lib_posix_remove=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
-$as_echo "$ac_cv_lib_posix_remove" >&6; }
-if test "x$ac_cv_lib_posix_remove" = x""yes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
-fi
-
-    fi
-
-    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
-if test "x$ac_cv_func_shmat" = x""yes; then :
-
-fi
-
-    if test $ac_cv_func_shmat = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
-$as_echo_n "checking for shmat in -lipc... " >&6; }
-if test "${ac_cv_lib_ipc_shmat+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lipc  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shmat ();
-int
-main ()
-{
-return shmat ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ipc_shmat=yes
-else
-  ac_cv_lib_ipc_shmat=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
-$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
-if test "x$ac_cv_lib_ipc_shmat" = x""yes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
-fi
-
-    fi
-  fi
-
-  # Check for libraries that X11R6 Xt/Xaw programs need.
-  ac_save_LDFLAGS=$LDFLAGS
-  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
-  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
-  # check for ICE first), but we must link in the order -lSM -lICE or
-  # we get undefined symbols.  So assume we have SM if we have ICE.
-  # These have to be linked with before -lX11, unlike the other
-  # libraries we check for below, so use a different variable.
-  # John Interrante, Karl Berry
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
-$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
-if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char IceConnectionNumber ();
-int
-main ()
-{
-return IceConnectionNumber ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ICE_IceConnectionNumber=yes
-else
-  ac_cv_lib_ICE_IceConnectionNumber=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
-$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
-if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then :
-  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
-fi
-
-  LDFLAGS=$ac_save_LDFLAGS
-
-fi
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking QTDIR" >&5
-$as_echo_n "checking QTDIR... " >&6; }
-
-# Check whether --with-qtdir was given.
-if test "${with_qtdir+set}" = set; then :
-  withval=$with_qtdir; QTDIR=$withval
-fi
-
-# Check that QTDIR is defined or that --with-qtdir given
-if test x"$QTDIR" = x ; then
-	# some usual Qt-locations
-	QT_SEARCH="/usr /usr/lib/qt /usr/lib64/qt4 /usr/lib/qt4 /usr/X11R6 /usr/local/Trolltech/Qt-4.2.0 /usr/local/Trolltech/Qt-4.2.1 /usr/local/Trolltech/Qt-4.2.2 /usr/local/Trolltech/Qt-4.2.3 /usr/local/Trolltech/Qt-4.3.0 /usr/local/Trolltech/Qt-4.3.1 /usr/local/Trolltech/Qt-4.3.2"
-else
-	QT_SEARCH=$QTDIR
-	QTDIR=""
-fi
-for i in $QT_SEARCH ; do
-	QT_INCLUDE_SEARCH="include/qt4 include"
-	for j in $QT_INCLUDE_SEARCH ; do
-	        if test -f $i/$j/Qt/qglobal.h -a x$QTDIR = x ; then
-			QTDIR=$i
-			QT_INCLUDES=$i/$j
-		fi
-	done
-done
-if test x"$QTDIR" = x ; then
-	as_fn_error $? "*** QTDIR must be defined, or --with-qtdir option given" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $QTDIR" >&5
-$as_echo "$QTDIR" >&6; }
-
-# Change backslashes in QTDIR to forward slashes to prevent escaping
-# problems later on in the build process, mainly for Cygwin build
-# environment using MSVC as the compiler
-QTDIR=`echo $QTDIR | sed 's/\\\\/\\//g'`
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Qt includes" >&5
-$as_echo_n "checking Qt includes... " >&6; }
-# Check where includes are located
-if test x"$QT_INCLUDES" = x ; then
-	as_fn_error $? "*** could not find Qt-includes! Make sure you have the Qt-devel-files installed!" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT_INCLUDES" >&5
-$as_echo "$QT_INCLUDES" >&6; }
-
-
-if test -z "$QTHOSTDIR" ; then
-	case "${prefix}" in
-		/opt/mingw*)
-			QTHOSTDIR=${prefix}
-			;;
-		*)
-			if test -n "$QTDIR" ; then
-				QTHOSTDIR="$QTDIR"
-			else
-				QTHOSTDIR=/usr
-			fi
-			;;
-	esac
-fi
-
-
-# Check that moc is in path
-# Extract the first word of "moc-qt4", so it can be a program name with args.
-set dummy moc-qt4; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_MOC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MOC"; then
-  ac_cv_prog_MOC="$MOC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $QTHOSTDIR/bin/
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_MOC="$QTHOSTDIR/bin/moc-qt4"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MOC=$ac_cv_prog_MOC
-if test -n "$MOC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5
-$as_echo "$MOC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x$MOC = x ; then
-	# Extract the first word of "moc", so it can be a program name with args.
-set dummy moc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_MOC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MOC"; then
-  ac_cv_prog_MOC="$MOC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $QTHOSTDIR/bin/
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_MOC="$QTHOSTDIR/bin/moc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MOC=$ac_cv_prog_MOC
-if test -n "$MOC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5
-$as_echo "$MOC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-	if test x$MOC = x ; then
-        	as_fn_error $? "*** not found! Make sure you have Qt-devel-tools installed!" "$LINENO" 5
-	fi
-fi
-
-# Check that uic is in path
-# Extract the first word of "uic-qt4", so it can be a program name with args.
-set dummy uic-qt4; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_UIC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$UIC"; then
-  ac_cv_prog_UIC="$UIC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $QTHOSTDIR/bin/
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_UIC="$QTHOSTDIR/bin/uic-qt4"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-UIC=$ac_cv_prog_UIC
-if test -n "$UIC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UIC" >&5
-$as_echo "$UIC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x$UIC = x ; then
-	# Extract the first word of "uic", so it can be a program name with args.
-set dummy uic; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_UIC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$UIC"; then
-  ac_cv_prog_UIC="$UIC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $QTHOSTDIR/bin/
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_UIC="$QTHOSTDIR/bin/uic"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-UIC=$ac_cv_prog_UIC
-if test -n "$UIC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UIC" >&5
-$as_echo "$UIC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-	if test x$UIC = x ; then
-        	as_fn_error $? "*** not found! Make sure you have Qt-devel-tools installed!" "$LINENO" 5
-	fi
-fi
-
-# Check that rcc is in path
-# Extract the first word of "rcc-qt4", so it can be a program name with args.
-set dummy rcc-qt4; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RCC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RCC"; then
-  ac_cv_prog_RCC="$RCC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $QTHOSTDIR/bin/
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RCC="$QTHOSTDIR/bin/rcc-qt4"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-RCC=$ac_cv_prog_RCC
-if test -n "$RCC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RCC" >&5
-$as_echo "$RCC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x$RCC = x ; then
-	# Extract the first word of "rcc", so it can be a program name with args.
-set dummy rcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RCC+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RCC"; then
-  ac_cv_prog_RCC="$RCC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $QTHOSTDIR/bin/
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RCC="$QTHOSTDIR/bin/rcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-RCC=$ac_cv_prog_RCC
-if test -n "$RCC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RCC" >&5
-$as_echo "$RCC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-	if test x$RCC = x ; then
-        	as_fn_error $? "*** not found! Make sure you have Qt-devel-tools installed!" "$LINENO" 5
-	fi
-fi
-
-# lupdate is the Qt translation-update utility.
-# Extract the first word of "lupdate-qt4", so it can be a program name with args.
-set dummy lupdate-qt4; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_LUPDATE+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LUPDATE"; then
-  ac_cv_prog_LUPDATE="$LUPDATE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $QTHOSTDIR/bin/
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_LUPDATE="$QTHOSTDIR/bin/lupdate-qt4"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-LUPDATE=$ac_cv_prog_LUPDATE
-if test -n "$LUPDATE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LUPDATE" >&5
-$as_echo "$LUPDATE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x$LUPDATE = x ; then
-	# Extract the first word of "lupdate", so it can be a program name with args.
-set dummy lupdate; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_LUPDATE+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LUPDATE"; then
-  ac_cv_prog_LUPDATE="$LUPDATE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $QTHOSTDIR/bin/
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_LUPDATE="$QTHOSTDIR/bin/lupdate"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-LUPDATE=$ac_cv_prog_LUPDATE
-if test -n "$LUPDATE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LUPDATE" >&5
-$as_echo "$LUPDATE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-	if test x$LUPDATE = x ; then
-	        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!" >&5
-$as_echo "$as_me: WARNING: *** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!" >&2;}
-	fi
-fi
-
-# lrelease is the Qt translation-release utility.
-# Extract the first word of "lrelease-qt4", so it can be a program name with args.
-set dummy lrelease-qt4; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_LRELEASE+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LRELEASE"; then
-  ac_cv_prog_LRELEASE="$LRELEASE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $QTHOSTDIR/bin/
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_LRELEASE="$QTHOSTDIR/bin/lrelease-qt4"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-LRELEASE=$ac_cv_prog_LRELEASE
-if test -n "$LRELEASE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LRELEASE" >&5
-$as_echo "$LRELEASE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x$LRELEASE = x ; then
-	# Extract the first word of "lrelease", so it can be a program name with args.
-set dummy lrelease; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_LRELEASE+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$LRELEASE"; then
-  ac_cv_prog_LRELEASE="$LRELEASE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $QTHOSTDIR/bin/
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_LRELEASE="$QTHOSTDIR/bin/lrelease"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-LRELEASE=$ac_cv_prog_LRELEASE
-if test -n "$LRELEASE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LRELEASE" >&5
-$as_echo "$LRELEASE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-	if test x$LRELEASE = x ; then
-	        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!" >&5
-$as_echo "$as_me: WARNING: *** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!" >&2;}
-	fi
-fi
-
-# construct CXXFLAGS
-QT_CXXFLAGS="-I$QT_INCLUDES -I$QT_INCLUDES/Qt -D_REENTRANT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_XML_LIB -DQT_THREAD_SUPPORT"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking QT_CXXFLAGS" >&5
-$as_echo_n "checking QT_CXXFLAGS... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $QT_CXXFLAGS" >&5
-$as_echo "$QT_CXXFLAGS" >&6; }
-
-
-# check libraries
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Qt4 libraries" >&5
-$as_echo_n "checking Qt4 libraries... " >&6; }
-
-case "${host}" in
-      *mingw32)
-        QT_LIBS=`ls $QTDIR/lib/libQt*.a 2> /dev/null`
-        if test "x$QT_LIBS" = x;  then
-            as_fn_error $? "*** Couldn't find any Qt4 libraries" "$LINENO" 5
-        fi
-	QT_LIB="-L$QTDIR/bin -lQtCore4 -lQtXml4 -lQtNetwork4 -lws2_32"
-	QT_LIB_GUI="-lQtGui4"
-	# Check that windres is in path
-	for ac_prog in ${host}-windres windres
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_WINDRES+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $WINDRES in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_WINDRES="$WINDRES" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="${prefix}/bin:$PATH"
-for as_dir in $as_dummy
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_WINDRES="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-WINDRES=$ac_cv_path_WINDRES
-if test -n "$WINDRES"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5
-$as_echo "$WINDRES" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$WINDRES" && break
-done
-
-	if test x$WINDRES = x ; then
-		as_fn_error $? "*** not found! Make sure you have mingw32 binutils installed!" "$LINENO" 5
-	fi
-        ;;
-    *)
-       	QT_LIBS=`ls $QTDIR/lib64/libQt*.so 2> /dev/null`
-        if test "x$QT_LIBS" = x;  then
-        	QT_LIBS=`ls $QTDIR/lib/libQt*.so 2> /dev/null`
-            	if test "x$QT_LIBS" = x;  then
-			as_fn_error $? "*** Couldn't find any Qt4 libraries" "$LINENO" 5
-            	fi
-		QT_LIB="-L$QTDIR/lib -L$QTDIR/lib/qt4"
-	else
-		QT_LIB="-L$QTDIR/lib64 -L$QTDIR/lib64/qt4"
-        fi
- 	QT_LIB="$QT_LIB -lQtCore -lQtXml -lQtNetwork"
-	QT_LIB_GUI="-lQtGui"
-        ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: found: $QT_LIB" >&5
-$as_echo "found: $QT_LIB" >&6; }
-
-QT_LDADD="$QT_LIB"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-xkeyboard was given.
-if test "${with_xkeyboard+set}" = set; then :
-  withval=$with_xkeyboard;
-fi
-
-
-# Check whether --with-xinerama was given.
-if test "${with_xinerama+set}" = set; then :
-  withval=$with_xinerama;
-fi
-
-
-# Check whether --with-xrandr was given.
-if test "${with_xrandr+set}" = set; then :
-  withval=$with_xrandr;
-fi
-
-
-# Check whether --with-xfixes was given.
-if test "${with_xfixes+set}" = set; then :
-  withval=$with_xfixes;
-fi
-
-
-# Check whether --with-xdamage was given.
-if test "${with_xdamage+set}" = set; then :
-  withval=$with_xdamage;
-fi
-
-
-# Check whether --with-xtrap was given.
-if test "${with_xtrap+set}" = set; then :
-  withval=$with_xtrap;
-fi
-
-
-# Check whether --with-xrecord was given.
-if test "${with_xrecord+set}" = set; then :
-  withval=$with_xrecord;
-fi
-
-
-# Check whether --with-fbpm was given.
-if test "${with_fbpm+set}" = set; then :
-  withval=$with_fbpm;
-fi
-
-
-# Check whether --with-dpms was given.
-if test "${with_dpms+set}" = set; then :
-  withval=$with_dpms;
-fi
-
-
-# Check whether --with-v4l was given.
-if test "${with_v4l+set}" = set; then :
-  withval=$with_v4l;
-fi
-
-
-# Check whether --with-fbdev was given.
-if test "${with_fbdev+set}" = set; then :
-  withval=$with_fbdev;
-fi
-
-
-# Check whether --with-uinput was given.
-if test "${with_uinput+set}" = set; then :
-  withval=$with_uinput;
-fi
-
-
-# Check whether --with-macosx-native was given.
-if test "${with_macosx_native+set}" = set; then :
-  withval=$with_macosx_native;
-fi
-
-
-if test "x$with_x" = "xno"; then
-	HAVE_X="false"
-elif test "$X_CFLAGS" != "-DX_DISPLAY_MISSING"; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XGetImage in -lX11" >&5
-$as_echo_n "checking for XGetImage in -lX11... " >&6; }
-if test "${ac_cv_lib_X11_XGetImage+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lX11 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XGetImage ();
-int
-main ()
-{
-return XGetImage ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_X11_XGetImage=yes
-else
-  ac_cv_lib_X11_XGetImage=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XGetImage" >&5
-$as_echo "$ac_cv_lib_X11_XGetImage" >&6; }
-if test "x$ac_cv_lib_X11_XGetImage" = x""yes; then :
-  $as_echo "#define HAVE_X11 1" >>confdefs.h
- HAVE_X="true"
-else
-  HAVE_X="false"
-fi
-
-
-	if test $HAVE_X = "true"; then
-		X_PRELIBS="$X_PRELIBS -lXext"
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShmGetImage in -lXext" >&5
-$as_echo_n "checking for XShmGetImage in -lXext... " >&6; }
-if test "${ac_cv_lib_Xext_XShmGetImage+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXext $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XShmGetImage ();
-int
-main ()
-{
-return XShmGetImage ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xext_XShmGetImage=yes
-else
-  ac_cv_lib_Xext_XShmGetImage=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShmGetImage" >&5
-$as_echo "$ac_cv_lib_Xext_XShmGetImage" >&6; }
-if test "x$ac_cv_lib_Xext_XShmGetImage" = x""yes; then :
-  $as_echo "#define HAVE_XSHM 1" >>confdefs.h
-
-fi
-
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XReadScreen in -lXext" >&5
-$as_echo_n "checking for XReadScreen in -lXext... " >&6; }
-if test "${ac_cv_lib_Xext_XReadScreen+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXext $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XReadScreen ();
-int
-main ()
-{
-return XReadScreen ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xext_XReadScreen=yes
-else
-  ac_cv_lib_Xext_XReadScreen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XReadScreen" >&5
-$as_echo "$ac_cv_lib_Xext_XReadScreen" >&6; }
-if test "x$ac_cv_lib_Xext_XReadScreen" = x""yes; then :
-  $as_echo "#define HAVE_SOLARIS_XREADSCREEN 1" >>confdefs.h
-
-fi
-
-
-		ac_fn_c_check_header_compile "$LINENO" "X11/extensions/readdisplay.h" "ac_cv_header_X11_extensions_readdisplay_h" "#include <X11/Xlib.h>
-"
-if test "x$ac_cv_header_X11_extensions_readdisplay_h" = x""yes; then :
-  $as_echo "#define HAVE_IRIX_XREADDISPLAY 1" >>confdefs.h
-
-fi
-
-
-
-		if test "x$with_fbpm" != "xno"; then
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FBPMForceLevel in -lXext" >&5
-$as_echo_n "checking for FBPMForceLevel in -lXext... " >&6; }
-if test "${ac_cv_lib_Xext_FBPMForceLevel+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXext $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char FBPMForceLevel ();
-int
-main ()
-{
-return FBPMForceLevel ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xext_FBPMForceLevel=yes
-else
-  ac_cv_lib_Xext_FBPMForceLevel=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_FBPMForceLevel" >&5
-$as_echo "$ac_cv_lib_Xext_FBPMForceLevel" >&6; }
-if test "x$ac_cv_lib_Xext_FBPMForceLevel" = x""yes; then :
-  $as_echo "#define HAVE_FBPM 1" >>confdefs.h
-
-fi
-
-		fi
-
-		if test "x$with_dpms" != "xno"; then
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DPMSForceLevel in -lXext" >&5
-$as_echo_n "checking for DPMSForceLevel in -lXext... " >&6; }
-if test "${ac_cv_lib_Xext_DPMSForceLevel+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXext $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char DPMSForceLevel ();
-int
-main ()
-{
-return DPMSForceLevel ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xext_DPMSForceLevel=yes
-else
-  ac_cv_lib_Xext_DPMSForceLevel=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_DPMSForceLevel" >&5
-$as_echo "$ac_cv_lib_Xext_DPMSForceLevel" >&6; }
-if test "x$ac_cv_lib_Xext_DPMSForceLevel" = x""yes; then :
-  $as_echo "#define HAVE_DPMS 1" >>confdefs.h
-
-fi
-
-		fi
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XTestGrabControl in -lXtst" >&5
-$as_echo_n "checking for XTestGrabControl in -lXtst... " >&6; }
-if test "${ac_cv_lib_Xtst_XTestGrabControl+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXtst $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XTestGrabControl ();
-int
-main ()
-{
-return XTestGrabControl ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xtst_XTestGrabControl=yes
-else
-  ac_cv_lib_Xtst_XTestGrabControl=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xtst_XTestGrabControl" >&5
-$as_echo "$ac_cv_lib_Xtst_XTestGrabControl" >&6; }
-if test "x$ac_cv_lib_Xtst_XTestGrabControl" = x""yes; then :
-  X_PRELIBS="-lXtst $X_PRELIBS"
-			$as_echo "#define HAVE_XTESTGRABCONTROL 1" >>confdefs.h
- HAVE_XTESTGRABCONTROL="true"
-fi
-
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XTestFakeKeyEvent in -lXtst" >&5
-$as_echo_n "checking for XTestFakeKeyEvent in -lXtst... " >&6; }
-if test "${ac_cv_lib_Xtst_XTestFakeKeyEvent+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXtst $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XTestFakeKeyEvent ();
-int
-main ()
-{
-return XTestFakeKeyEvent ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xtst_XTestFakeKeyEvent=yes
-else
-  ac_cv_lib_Xtst_XTestFakeKeyEvent=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xtst_XTestFakeKeyEvent" >&5
-$as_echo "$ac_cv_lib_Xtst_XTestFakeKeyEvent" >&6; }
-if test "x$ac_cv_lib_Xtst_XTestFakeKeyEvent" = x""yes; then :
-  X_PRELIBS="-lXtst $X_PRELIBS"
-			$as_echo "#define HAVE_XTEST 1" >>confdefs.h
- HAVE_XTEST="true"
-fi
-
-
-		if test "x$with_xrecord" != "xno"; then
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRecordEnableContextAsync in -lXtst" >&5
-$as_echo_n "checking for XRecordEnableContextAsync in -lXtst... " >&6; }
-if test "${ac_cv_lib_Xtst_XRecordEnableContextAsync+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXtst $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XRecordEnableContextAsync ();
-int
-main ()
-{
-return XRecordEnableContextAsync ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xtst_XRecordEnableContextAsync=yes
-else
-  ac_cv_lib_Xtst_XRecordEnableContextAsync=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xtst_XRecordEnableContextAsync" >&5
-$as_echo "$ac_cv_lib_Xtst_XRecordEnableContextAsync" >&6; }
-if test "x$ac_cv_lib_Xtst_XRecordEnableContextAsync" = x""yes; then :
-  X_PRELIBS="-lXtst $X_PRELIBS"
-				$as_echo "#define HAVE_RECORD 1" >>confdefs.h
-
-fi
-
-		fi
-
-		# we use XTRAP on X11R5, or user can set X11VNC_USE_XTRAP
-		if test "x$with_xtrap" != "xno"; then
-		    if test ! -z "$X11VNC_USE_XTRAP" -o -z "$HAVE_XTESTGRABCONTROL"; then
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XETrapSetGrabServer in -lXTrap" >&5
-$as_echo_n "checking for XETrapSetGrabServer in -lXTrap... " >&6; }
-if test "${ac_cv_lib_XTrap_XETrapSetGrabServer+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXTrap $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XETrapSetGrabServer ();
-int
-main ()
-{
-return XETrapSetGrabServer ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_XTrap_XETrapSetGrabServer=yes
-else
-  ac_cv_lib_XTrap_XETrapSetGrabServer=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_XTrap_XETrapSetGrabServer" >&5
-$as_echo "$ac_cv_lib_XTrap_XETrapSetGrabServer" >&6; }
-if test "x$ac_cv_lib_XTrap_XETrapSetGrabServer" = x""yes; then :
-  X_PRELIBS="$X_PRELIBS -lXTrap"
-				$as_echo "#define HAVE_LIBXTRAP 1" >>confdefs.h
-
-fi
-
-			# tru64 uses libXETrap.so
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XETrapSetGrabServer in -lXETrap" >&5
-$as_echo_n "checking for XETrapSetGrabServer in -lXETrap... " >&6; }
-if test "${ac_cv_lib_XETrap_XETrapSetGrabServer+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXETrap $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XETrapSetGrabServer ();
-int
-main ()
-{
-return XETrapSetGrabServer ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_XETrap_XETrapSetGrabServer=yes
-else
-  ac_cv_lib_XETrap_XETrapSetGrabServer=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_XETrap_XETrapSetGrabServer" >&5
-$as_echo "$ac_cv_lib_XETrap_XETrapSetGrabServer" >&6; }
-if test "x$ac_cv_lib_XETrap_XETrapSetGrabServer" = x""yes; then :
-  X_PRELIBS="$X_PRELIBS -lXETrap"
-				$as_echo "#define HAVE_LIBXTRAP 1" >>confdefs.h
-
-fi
-
-		    fi
-		fi
-
-		if test "x$with_xkeyboard" != "xno"; then
-			saved_CPPFLAGS="$CPPFLAGS"
-			CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-			ac_fn_c_check_header_compile "$LINENO" "X11/XKBlib.h" "ac_cv_header_X11_XKBlib_h" "#include <X11/Xlib.h>
-"
-if test "x$ac_cv_header_X11_XKBlib_h" = x""yes; then :
-  HAVE_XKBLIB_H="true"
-else
-  HAVE_XKBLIB_H="false"
-fi
-
-
-			CPPFLAGS="$saved_CPPFLAGS"
-			if test $HAVE_XKBLIB_H = "true"; then
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XkbSelectEvents in -lX11" >&5
-$as_echo_n "checking for XkbSelectEvents in -lX11... " >&6; }
-if test "${ac_cv_lib_X11_XkbSelectEvents+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lX11 $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XkbSelectEvents ();
-int
-main ()
-{
-return XkbSelectEvents ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_X11_XkbSelectEvents=yes
-else
-  ac_cv_lib_X11_XkbSelectEvents=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XkbSelectEvents" >&5
-$as_echo "$ac_cv_lib_X11_XkbSelectEvents" >&6; }
-if test "x$ac_cv_lib_X11_XkbSelectEvents" = x""yes; then :
-  $as_echo "#define HAVE_XKEYBOARD 1" >>confdefs.h
-
-fi
-
-			fi
-		fi
-
-		if test "x$with_xinerama" != "xno"; then
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XineramaQueryScreens in -lXinerama" >&5
-$as_echo_n "checking for XineramaQueryScreens in -lXinerama... " >&6; }
-if test "${ac_cv_lib_Xinerama_XineramaQueryScreens+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXinerama $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XineramaQueryScreens ();
-int
-main ()
-{
-return XineramaQueryScreens ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xinerama_XineramaQueryScreens=yes
-else
-  ac_cv_lib_Xinerama_XineramaQueryScreens=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xinerama_XineramaQueryScreens" >&5
-$as_echo "$ac_cv_lib_Xinerama_XineramaQueryScreens" >&6; }
-if test "x$ac_cv_lib_Xinerama_XineramaQueryScreens" = x""yes; then :
-  X_PRELIBS="$X_PRELIBS -lXinerama"
-				$as_echo "#define HAVE_LIBXINERAMA 1" >>confdefs.h
-
-fi
-
-		fi
-
-		if test "x$with_xrandr" != "xno"; then
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRSelectInput in -lXrandr" >&5
-$as_echo_n "checking for XRRSelectInput in -lXrandr... " >&6; }
-if test "${ac_cv_lib_Xrandr_XRRSelectInput+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXrandr $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XRRSelectInput ();
-int
-main ()
-{
-return XRRSelectInput ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xrandr_XRRSelectInput=yes
-else
-  ac_cv_lib_Xrandr_XRRSelectInput=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrandr_XRRSelectInput" >&5
-$as_echo "$ac_cv_lib_Xrandr_XRRSelectInput" >&6; }
-if test "x$ac_cv_lib_Xrandr_XRRSelectInput" = x""yes; then :
-  X_PRELIBS="$X_PRELIBS -lXrandr"
-				$as_echo "#define HAVE_LIBXRANDR 1" >>confdefs.h
-
-fi
-
-		fi
-
-		if test "x$with_xfixes" != "xno"; then
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XFixesGetCursorImage in -lXfixes" >&5
-$as_echo_n "checking for XFixesGetCursorImage in -lXfixes... " >&6; }
-if test "${ac_cv_lib_Xfixes_XFixesGetCursorImage+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXfixes $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XFixesGetCursorImage ();
-int
-main ()
-{
-return XFixesGetCursorImage ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xfixes_XFixesGetCursorImage=yes
-else
-  ac_cv_lib_Xfixes_XFixesGetCursorImage=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xfixes_XFixesGetCursorImage" >&5
-$as_echo "$ac_cv_lib_Xfixes_XFixesGetCursorImage" >&6; }
-if test "x$ac_cv_lib_Xfixes_XFixesGetCursorImage" = x""yes; then :
-  X_PRELIBS="$X_PRELIBS -lXfixes"
-				$as_echo "#define HAVE_LIBXFIXES 1" >>confdefs.h
- HAVE_LIBXFIXES="true"
-fi
-
-		fi
-
-		if test "x$with_xdamage" != "xno"; then
-			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XDamageQueryExtension in -lXdamage" >&5
-$as_echo_n "checking for XDamageQueryExtension in -lXdamage... " >&6; }
-if test "${ac_cv_lib_Xdamage_XDamageQueryExtension+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXdamage $X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XDamageQueryExtension ();
-int
-main ()
-{
-return XDamageQueryExtension ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xdamage_XDamageQueryExtension=yes
-else
-  ac_cv_lib_Xdamage_XDamageQueryExtension=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xdamage_XDamageQueryExtension" >&5
-$as_echo "$ac_cv_lib_Xdamage_XDamageQueryExtension" >&6; }
-if test "x$ac_cv_lib_Xdamage_XDamageQueryExtension" = x""yes; then :
-  X_PRELIBS="$X_PRELIBS -lXdamage"
-				$as_echo "#define HAVE_LIBXDAMAGE 1" >>confdefs.h
- HAVE_LIBXDAMAGE="true"
-fi
-
-		fi
-
-		if test ! -z "$HAVE_LIBXFIXES" -o ! -z "$HAVE_LIBXDAMAGE"; then
-			# need /usr/sfw/lib in RPATH for Solaris 10 and later
-			case `(uname -sr) 2>/dev/null` in
-			"SunOS 5"*) X_EXTRA_LIBS="$X_EXTRA_LIBS -R/usr/sfw/lib" ;;
-			esac
-		fi
-
-		# currently only x11vnc uses crypt() or libssl:
-
-
-# Check whether --with-crypt was given.
-if test "${with_crypt+set}" = set; then :
-  withval=$with_crypt;
-fi
-
-		if test "x$with_crypt" != "xno"; then
-			for ac_func in crypt
-do :
-  ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt"
-if test "x$ac_cv_func_crypt" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_CRYPT 1
-_ACEOF
- HAVE_LIBC_CRYPT="true"
-fi
-done
-
-			if test -z "$HAVE_LIBC_CRYPT"; then
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5
-$as_echo_n "checking for crypt in -lcrypt... " >&6; }
-if test "${ac_cv_lib_crypt_crypt+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypt  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char crypt ();
-int
-main ()
-{
-return crypt ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_crypt_crypt=yes
-else
-  ac_cv_lib_crypt_crypt=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5
-$as_echo "$ac_cv_lib_crypt_crypt" >&6; }
-if test "x$ac_cv_lib_crypt_crypt" = x""yes; then :
-  X_PRELIBS="$X_PRELIBS -lcrypt"
-					$as_echo "#define HAVE_LIBCRYPT 1" >>confdefs.h
-
-fi
-
-			fi
-		fi
-
-		X_LIBS="$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS"
-	fi
-fi
-
-
- if test $HAVE_X != "false"; then
-  HAVE_X_TRUE=
-  HAVE_X_FALSE='#'
-else
-  HAVE_X_TRUE='#'
-  HAVE_X_FALSE=
-fi
-
-
-if test "$build_win32" != "true" -a "x$HAVE_X" = "xfalse" -a "x$with_x" != "xno"; then
-	as_fn_error $? "
-==========================================================================
-A working X window system build environment is required to build iTALC.
-Make sure any required X development packages are installed.  If they are
-installed in non-standard locations, one can use the --x-includes=DIR
-and --x-libraries=DIR configure options or set the CPPFLAGS and LDFLAGS
-environment variables to indicate where the X window system header files
-and libraries may be found.  On 64+32 bit machines you may need to point
-to lib64 or lib32 directories to pick up the correct word size.
-
-If you want to build iTALC without X support (e.g. for -rawfb use only
-or for native Mac OS X), specify the --without-x configure option.
-==========================================================================
-" "$LINENO" 5
-fi
-
-if test "$build_win32" != "true" -a "x$HAVE_X" = "xtrue" -a "x$HAVE_XTEST" != "xtrue"; then
-	as_fn_error $? "
-==========================================================================
-A working build environment for the XTEST extension was not found (libXtst).
-An iTALC 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.
-==========================================================================
-" "$LINENO" 5
-fi
-
-if test "x$with_v4l" != "xno"; then
-	ac_fn_c_check_header_mongrel "$LINENO" "linux/videodev.h" "ac_cv_header_linux_videodev_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_videodev_h" = x""yes; then :
-  $as_echo "#define HAVE_LINUX_VIDEODEV_H 1" >>confdefs.h
-
-fi
-
-
-fi
-
-if test "x$with_fbdev" != "xno"; then
-	ac_fn_c_check_header_mongrel "$LINENO" "linux/fb.h" "ac_cv_header_linux_fb_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_fb_h" = x""yes; then :
-  $as_echo "#define HAVE_LINUX_FB_H 1" >>confdefs.h
-
-fi
-
-
-fi
-
-if test "x$with_uinput" != "xno"; then
-	ac_fn_c_check_header_mongrel "$LINENO" "linux/input.h" "ac_cv_header_linux_input_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_input_h" = x""yes; then :
-  $as_echo "#define HAVE_LINUX_INPUT_H 1" >>confdefs.h
- HAVE_LINUX_INPUT_H="true"
-fi
-
-
-	if test "x$HAVE_LINUX_INPUT_H" = "xtrue"; then
-		ac_fn_c_check_header_compile "$LINENO" "linux/uinput.h" "ac_cv_header_linux_uinput_h" "#include <linux/input.h>
-"
-if test "x$ac_cv_header_linux_uinput_h" = x""yes; then :
-  $as_echo "#define HAVE_LINUX_UINPUT_H 1" >>confdefs.h
-
-fi
-
-
-	fi
-fi
-
-if test "x$with_macosx_native" != "xno"; then
-	$as_echo "#define HAVE_MACOSX_NATIVE_DISPLAY 1" >>confdefs.h
-
-fi
-
-
-
-
-#AC_ARG_WITH(avahi,
-#[  --without-avahi         disable support for Avahi/mDNS]
-#[  --with-avahi=DIR        use avahi include/library files in DIR],,)
-#if test "x$with_avahi" != "xno"; then
-#	printf "checking for avahi... "
-#	if test ! -z "$with_avahi" -a "x$with_avahi" != "xyes"; then
-#		AVAHI_CFLAGS="-I$with_avahi/include"
-#		AVAHI_LIBS="-L$with_avahi/lib -lavahi-common -lavahi-client"
-#		echo "using $with_avahi"
-#		with_avahi=yes
-#	elif pkg-config --atleast-version=0.6.4 avahi-client >/dev/null 2>&1; then
-#		AVAHI_CFLAGS=`pkg-config --cflags avahi-client`
-#		AVAHI_LIBS=`pkg-config --libs avahi-client`
-#		with_avahi=yes
-#		echo yes
-#	else
-#		with_avahi=no
-#		echo no
-#	fi
-#fi
-#if test "x$with_avahi" = "xyes"; then
-#	AC_DEFINE(HAVE_AVAHI)
-#	AC_SUBST(AVAHI_CFLAGS)
-#	AC_SUBST(AVAHI_LIBS)
-#fi
-
-
-
-# Checks for libraries and header files
-
-
-
-
-
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_zlib_h" = x""yes; then :
-  HAVE_ZLIB_H="true"
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default"
-if test "x$ac_cv_header_jpeglib_h" = x""yes; then :
-  HAVE_JPEGLIB_H="true"
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "openssl/dsa.h" "ac_cv_header_openssl_dsa_h" "$ac_includes_default"
-if test "x$ac_cv_header_openssl_dsa_h" = x""yes; then :
-  HAVE_DSA_H="true"
-fi
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5
-$as_echo_n "checking for deflate in -lz... " >&6; }
-if test "${ac_cv_lib_z_deflate+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char deflate ();
-int
-main ()
-{
-return deflate ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_z_deflate=yes
-else
-  ac_cv_lib_z_deflate=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5
-$as_echo "$ac_cv_lib_z_deflate" >&6; }
-if test "x$ac_cv_lib_z_deflate" = x""yes; then :
-  HAVE_LIBZ="true"
-else
-  HAVE_ZLIB_H=""
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_CreateCompress in -ljpeg" >&5
-$as_echo_n "checking for jpeg_CreateCompress in -ljpeg... " >&6; }
-if test "${ac_cv_lib_jpeg_jpeg_CreateCompress+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ljpeg  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char jpeg_CreateCompress ();
-int
-main ()
-{
-return jpeg_CreateCompress ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_jpeg_jpeg_CreateCompress=yes
-else
-  ac_cv_lib_jpeg_jpeg_CreateCompress=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_CreateCompress" >&5
-$as_echo "$ac_cv_lib_jpeg_jpeg_CreateCompress" >&6; }
-if test "x$ac_cv_lib_jpeg_jpeg_CreateCompress" = x""yes; then :
-  HAVE_LIBJPEG="true"
-else
-  HAVE_JPEGLIB_H=""
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
-$as_echo_n "checking for SSL_library_init in -lssl... " >&6; }
-if test "${ac_cv_lib_ssl_SSL_library_init+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lssl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char SSL_library_init ();
-int
-main ()
-{
-return SSL_library_init ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ssl_SSL_library_init=yes
-else
-  ac_cv_lib_ssl_SSL_library_init=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5
-$as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; }
-if test "x$ac_cv_lib_ssl_SSL_library_init" = x""yes; then :
-  HAVE_LIBSSL="true"
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RAND_file_name in -lcrypto" >&5
-$as_echo_n "checking for RAND_file_name in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_RAND_file_name+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char RAND_file_name ();
-int
-main ()
-{
-return RAND_file_name ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_crypto_RAND_file_name=yes
-else
-  ac_cv_lib_crypto_RAND_file_name=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_RAND_file_name" >&5
-$as_echo "$ac_cv_lib_crypto_RAND_file_name" >&6; }
-if test "x$ac_cv_lib_crypto_RAND_file_name" = x""yes; then :
-  HAVE_LIBCRYPTO="true"
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DSA_new in -leay32" >&5
-$as_echo_n "checking for DSA_new in -leay32... " >&6; }
-if test "${ac_cv_lib_eay32_DSA_new+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-leay32  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char DSA_new ();
-int
-main ()
-{
-return DSA_new ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_eay32_DSA_new=yes
-else
-  ac_cv_lib_eay32_DSA_new=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_eay32_DSA_new" >&5
-$as_echo "$ac_cv_lib_eay32_DSA_new" >&6; }
-if test "x$ac_cv_lib_eay32_DSA_new" = x""yes; then :
-  HAVE_LIBEAY32="true"
-fi
-
-if test \( -z "$HAVE_LIBSSL" -o -z "$HAVE_LIBCRYPTO" \) -a \( -z "$HAVE_LIBEAY32" \) ; then
-	HAVE_DSA_H=""
-fi
-
-
-if test -z "$HAVE_ZLIB_H" ; then
-	as_fn_error $? "*** you do not have installed libz and/or development-files are missing!" "$LINENO" 5
-fi
-
-if test -z "$HAVE_JPEGLIB_H" ; then
-	as_fn_error $? "*** you do not have installed libjpeg and/or development-files are missing!" "$LINENO" 5
-fi
-
-if test -z "$HAVE_DSA_H" ; then
-	as_fn_error $? "*** you do not have installed the OpenSSL-library and/or development-files are missing!" "$LINENO" 5
-fi
-
-$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
-
-$as_echo "#define HAVE_ZLIB_H 1" >>confdefs.h
-
-$as_echo "#define HAVE_LIBJPEG 1" >>confdefs.h
-
-$as_echo "#define HAVE_JPEGLIB_H 1" >>confdefs.h
-
-$as_echo "#define HAVE_LIBSSL 1" >>confdefs.h
-
-$as_echo "#define HAVE_DSA_H 1" >>confdefs.h
-
-
-
-# Check whether --with-pthread was given.
-if test "${with_pthread+set}" = set; then :
-  withval=$with_pthread;
-fi
-
-
-if test "x$with_pthread" != "xno"; then
-	ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
-if test "x$ac_cv_header_pthread_h" = x""yes; then :
-  HAVE_PTHREAD_H="true"
-fi
-
-
-	if test ! -z "$HAVE_PTHREAD_H"; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lpthread" >&5
-$as_echo_n "checking for pthread_mutex_lock in -lpthread... " >&6; }
-if test "${ac_cv_lib_pthread_pthread_mutex_lock+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_mutex_lock ();
-int
-main ()
-{
-return pthread_mutex_lock ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_pthread_pthread_mutex_lock=yes
-else
-  ac_cv_lib_pthread_pthread_mutex_lock=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_lock" >&5
-$as_echo "$ac_cv_lib_pthread_pthread_mutex_lock" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_mutex_lock" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBPTHREAD 1
-_ACEOF
-
-  LIBS="-lpthread $LIBS"
-
-fi
-
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_lock in -lpthread" >&5
-$as_echo_n "checking for pthread_mutex_lock in -lpthread... " >&6; }
-if test "${ac_cv_lib_pthread_pthread_mutex_lock+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_mutex_lock ();
-int
-main ()
-{
-return pthread_mutex_lock ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_pthread_pthread_mutex_lock=yes
-else
-  ac_cv_lib_pthread_pthread_mutex_lock=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_lock" >&5
-$as_echo "$ac_cv_lib_pthread_pthread_mutex_lock" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_mutex_lock" = x""yes; then :
-  HAVE_LIBPTHREAD="true"
-fi
-
-	fi
-fi
-
-
- if test ! -z "$HAVE_ZLIB_H"; then
-  HAVE_LIBZ_TRUE=
-  HAVE_LIBZ_FALSE='#'
-else
-  HAVE_LIBZ_TRUE='#'
-  HAVE_LIBZ_FALSE=
-fi
-
- if test ! -z "$HAVE_LIBJPEG"; then
-  HAVE_LIBJPEG_TRUE=
-  HAVE_LIBJPEG_FALSE='#'
-else
-  HAVE_LIBJPEG_TRUE='#'
-  HAVE_LIBJPEG_FALSE=
-fi
-
- if test -n "$HAVE_LIBSSL" -a -n "$HAVE_LIBCRYPTO"; then
-  HAVE_LIBSSL_TRUE=
-  HAVE_LIBSSL_FALSE='#'
-else
-  HAVE_LIBSSL_TRUE='#'
-  HAVE_LIBSSL_FALSE=
-fi
-
- if test ! -z "$HAVE_LIBEAY32"; then
-  HAVE_LIBEAY32_TRUE=
-  HAVE_LIBEAY32_FALSE='#'
-else
-  HAVE_LIBEAY32_TRUE='#'
-  HAVE_LIBEAY32_FALSE=
-fi
-
- if test ! -z "$HAVE_LIBPTHREAD"; then
-  HAVE_LIBPTHREAD_TRUE=
-  HAVE_LIBPTHREAD_FALSE='#'
-else
-  HAVE_LIBPTHREAD_TRUE='#'
-  HAVE_LIBPTHREAD_FALSE=
-fi
-
-
-
-
-# Checks for header files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-for ac_header in arpa/inet.h fcntl.h limits.h memory.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h pwd.h sys/types.h utmpx.h sys/wait.h time.h errno.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-# Checks for typedefs, structures, and compiler characteristics.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
-$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if test "${ac_cv_header_stdbool_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdbool.h>
-#ifndef bool
- "error: bool is not defined"
-#endif
-#ifndef false
- "error: false is not defined"
-#endif
-#if false
- "error: false is not 0"
-#endif
-#ifndef true
- "error: true is not defined"
-#endif
-#if true != 1
- "error: true is not 1"
-#endif
-#ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
-#endif
-
-	struct s { _Bool s: 1; _Bool t; } s;
-
-	char a[true == 1 ? 1 : -1];
-	char b[false == 0 ? 1 : -1];
-	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-	char d[(bool) 0.5 == true ? 1 : -1];
-	bool e = &s;
-	char f[(_Bool) 0.0 == false ? 1 : -1];
-	char g[true];
-	char h[sizeof (_Bool)];
-	char i[sizeof s.t];
-	enum { j = false, k = true, l = false * true, m = true * 256 };
-	/* The following fails for
-	   HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
-	_Bool n[m];
-	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-#	if defined __xlc__ || defined __GNUC__
-	 /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-	    reported by James Lemley on 2005-10-05; see
-	    http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-	    This test is not quite right, since xlc is allowed to
-	    reject this program, as the initializer for xlcbug is
-	    not one of the forms that C requires support for.
-	    However, doing the test right would require a runtime
-	    test, and that would make cross-compilation harder.
-	    Let us hope that IBM fixes the xlc bug, and also adds
-	    support for this kind of constant expression.  In the
-	    meantime, this test will reject xlc, which is OK, since
-	    our stdbool.h substitute should suffice.  We also test
-	    this with GCC, where it should work, to detect more
-	    quickly whether someone messes up the test in the
-	    future.  */
-	 char digs[] = "0123456789";
-	 int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-#	endif
-	/* Catch a bug in an HP-UX C compiler.  See
-	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-	 */
-	_Bool q = true;
-	_Bool *pq = &q;
-
-int
-main ()
-{
-
-	*pq |= q;
-	*pq |= ! q;
-	/* Refer to every declared value, to avoid compiler optimizations.  */
-	return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-		+ !m + !n + !o + !p + !q + !pq);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdbool_h=yes
-else
-  ac_cv_header_stdbool_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
-$as_echo "$ac_cv_header_stdbool_h" >&6; }
-ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = x""yes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE__BOOL 1
-_ACEOF
-
-
-fi
-
-if test $ac_cv_header_stdbool_h = yes; then
-
-$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if test "${ac_cv_c_const+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
-  typedef int charset[2];
-  const charset cs;
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *pcpcc;
-  char **ppc;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  pcpcc = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++pcpcc;
-  ppc = (char**) pcpcc;
-  pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-    *t++ = 0;
-    if (s) return 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-    if (!foo) return 0;
-  }
-  return !cs[0] && !zero.x;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_const=yes
-else
-  ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if test "${ac_cv_c_inline+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
-    ;;
-esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_bigendian=unknown
-    # See if we're dealing with a universal compiler.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-	       not a universal capable compiler
-	     #endif
-	     typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-	# Check for potential -arch flags.  It is not universal unless
-	# there are at least two -arch flags with different values.
-	ac_arch=
-	ac_prev=
-	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
-	 if test -n "$ac_prev"; then
-	   case $ac_word in
-	     i?86 | x86_64 | ppc | ppc64)
-	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
-		 ac_arch=$ac_word
-	       else
-		 ac_cv_c_bigendian=universal
-		 break
-	       fi
-	       ;;
-	   esac
-	   ac_prev=
-	 elif test "x$ac_word" = "x-arch"; then
-	   ac_prev=arch
-	 fi
-       done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if sys/param.h defines the BYTE_ORDER macro.
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-	     #include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
-		     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
-		     && LITTLE_ENDIAN)
-	      bogus endian macros
-	     #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-		#include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
-		 not big endian
-		#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
-	      bogus endian macros
-	     #endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to _BIG_ENDIAN or not.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
-		 not big endian
-		#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # Compile a test program.
-      if test "$cross_compiling" = yes; then :
-  # Try to guess by grepping values from an object file.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-short int ascii_mm[] =
-		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-		short int ascii_ii[] =
-		  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-		int use_ascii (int i) {
-		  return ascii_mm[i] + ascii_ii[i];
-		}
-		short int ebcdic_ii[] =
-		  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-		short int ebcdic_mm[] =
-		  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-		int use_ebcdic (int i) {
-		  return ebcdic_mm[i] + ebcdic_ii[i];
-		}
-		extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
-	      ac_cv_c_bigendian=yes
-	    fi
-	    if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-	      if test "$ac_cv_c_bigendian" = unknown; then
-		ac_cv_c_bigendian=no
-	      else
-		# finding both strings is unlikely to happen, but who knows?
-		ac_cv_c_bigendian=unknown
-	      fi
-	    fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-
-	     /* Are we little or big endian?  From Harbison&Steele.  */
-	     union
-	     {
-	       long int l;
-	       char c[sizeof (long int)];
-	     } u;
-	     u.l = 1;
-	     return u.c[sizeof (long int) - 1] == 1;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_bigendian=no
-else
-  ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-    fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
-   yes)
-     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
-   no)
-      ;; #(
-   universal)
-
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-
-     ;; #(
-   *)
-     as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5  ;;
- esac
-
-ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define ptrdiff_t long
-_ACEOF
-
-fi
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
-$as_echo_n "checking size of short... " >&6; }
-if test "${ac_cv_sizeof_short+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_short" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (short)
-See \`config.log' for more details" "$LINENO" 5 ; }
-   else
-     ac_cv_sizeof_short=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
-$as_echo "$ac_cv_sizeof_short" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SHORT $ac_cv_sizeof_short
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
-$as_echo_n "checking size of int... " >&6; }
-if test "${ac_cv_sizeof_int+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_int" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (int)
-See \`config.log' for more details" "$LINENO" 5 ; }
-   else
-     ac_cv_sizeof_int=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
-$as_echo "$ac_cv_sizeof_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
-$as_echo_n "checking size of long... " >&6; }
-if test "${ac_cv_sizeof_long+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_long" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long)
-See \`config.log' for more details" "$LINENO" 5 ; }
-   else
-     ac_cv_sizeof_long=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
-$as_echo "$ac_cv_sizeof_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
-$as_echo_n "checking size of long long... " >&6; }
-if test "${ac_cv_sizeof_long_long+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_long_long" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long long)
-See \`config.log' for more details" "$LINENO" 5 ; }
-   else
-     ac_cv_sizeof_long_long=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
-$as_echo "$ac_cv_sizeof_long_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of __int64" >&5
-$as_echo_n "checking size of __int64... " >&6; }
-if test "${ac_cv_sizeof___int64+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (__int64))" "ac_cv_sizeof___int64"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type___int64" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (__int64)
-See \`config.log' for more details" "$LINENO" 5 ; }
-   else
-     ac_cv_sizeof___int64=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof___int64" >&5
-$as_echo "$ac_cv_sizeof___int64" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF___INT64 $ac_cv_sizeof___int64
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5
-$as_echo_n "checking size of void *... " >&6; }
-if test "${ac_cv_sizeof_void_p+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_void_p" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (void *)
-See \`config.log' for more details" "$LINENO" 5 ; }
-   else
-     ac_cv_sizeof_void_p=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
-$as_echo "$ac_cv_sizeof_void_p" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
-$as_echo_n "checking size of size_t... " >&6; }
-if test "${ac_cv_sizeof_size_t+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_size_t" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (size_t)
-See \`config.log' for more details" "$LINENO" 5 ; }
-   else
-     ac_cv_sizeof_size_t=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
-$as_echo "$ac_cv_sizeof_size_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ptrdiff_t" >&5
-$as_echo_n "checking size of ptrdiff_t... " >&6; }
-if test "${ac_cv_sizeof_ptrdiff_t+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ptrdiff_t))" "ac_cv_sizeof_ptrdiff_t"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_ptrdiff_t" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (ptrdiff_t)
-See \`config.log' for more details" "$LINENO" 5 ; }
-   else
-     ac_cv_sizeof_ptrdiff_t=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ptrdiff_t" >&5
-$as_echo "$ac_cv_sizeof_ptrdiff_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_PTRDIFF_T $ac_cv_sizeof_ptrdiff_t
-_ACEOF
-
-
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = x""yes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
-$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
-if test "${ac_cv_header_sys_wait_h+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/wait.h>
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
-
-int
-main ()
-{
-  int s;
-  wait (&s);
-  s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_sys_wait_h=yes
-else
-  ac_cv_header_sys_wait_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5
-$as_echo "$ac_cv_header_sys_wait_h" >&6; }
-if test $ac_cv_header_sys_wait_h = yes; then
-
-$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5
-$as_echo_n "checking for socklen_t... " >&6; }
-if test "${ac_cv_type_socklen_t+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-   #include <sys/socket.h>
-int
-main ()
-{
-socklen_t len = 42; return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_type_socklen_t=yes
-else
-  ac_cv_type_socklen_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_socklen_t" >&5
-$as_echo "$ac_cv_type_socklen_t" >&6; }
-  if test $ac_cv_type_socklen_t != yes; then
-    $as_echo "#define socklen_t int" >>confdefs.h
-
-  fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
-$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if test "${ac_cv_header_time+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_time=yes
-else
-  ac_cv_header_time=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
-$as_echo "$ac_cv_header_time" >&6; }
-if test $ac_cv_header_time = yes; then
-
-$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
-
-fi
-
-ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = x""yes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define off_t long int
-_ACEOF
-
-fi
-
-# ------ AC CREATE STDINT H -------------------------------------
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint-types...." >&5
-$as_echo_n "checking for stdint-types....... " >&6; }
-ac_stdint_h=`echo lib/include/rfb/rfbint.h`
-if test "$ac_stdint_h" = "stdint.h" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"(are you sure you want them in ./stdint.h?)\"" >&5
-$as_echo "\"(are you sure you want them in ./stdint.h?)\"" >&6; }
-elif test "$ac_stdint_h" = "inttypes.h" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"(are you sure you want them in ./inttypes.h?)\"" >&5
-$as_echo "\"(are you sure you want them in ./inttypes.h?)\"" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"(putting them into $ac_stdint_h)\"" >&5
-$as_echo "\"(putting them into $ac_stdint_h)\"" >&6; }
-fi
-
-inttype_headers=`echo inttypes.h sys/inttypes.h sys/inttypes.h  \
-| sed -e 's/,/ /g'`
-
- ac_cv_header_stdint_x="no-file"
- ac_cv_header_stdint_o="no-file"
- ac_cv_header_stdint_u="no-file"
- for i in stdint.h $inttype_headers ; do
-   unset ac_cv_type_uintptr_t
-   unset ac_cv_type_uint64_t
-   ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#include <$i>
-"
-if test "x$ac_cv_type_uintptr_t" = x""yes; then :
-  ac_cv_header_stdint_x=$i
-else
-       continue
-fi
-
-   ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i>
-"
-if test "x$ac_cv_type_uint64_t" = x""yes; then :
-  and64="(uint64_t too)"
-else
-  and64=""
-fi
-
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen our uintptr_t in $i $and64" >&5
-$as_echo "... seen our uintptr_t in $i $and64" >&6; }
-   break;
- done
- if test "$ac_cv_header_stdint_x" = "no-file" ; then
- for i in stdint.h $inttype_headers ; do
-   unset ac_cv_type_uint32_t
-   unset ac_cv_type_uint64_t
-   ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "#include <$i>
-"
-if test "x$ac_cv_type_uint32_t" = x""yes; then :
-  ac_cv_header_stdint_o=$i
-else
-       continue
-fi
-
-   ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i>
-"
-if test "x$ac_cv_type_uint64_t" = x""yes; then :
-  and64="(uint64_t too)"
-else
-  and64=""
-fi
-
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen our uint32_t in $i $and64" >&5
-$as_echo "... seen our uint32_t in $i $and64" >&6; }
-   break;
- done
- if test "$ac_cv_header_stdint_o" = "no-file" ; then
- for i in sys/types.h $inttype_headers ; do
-   unset ac_cv_type_u_int32_t
-   unset ac_cv_type_u_int64_t
-   ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "#include <$i>
-"
-if test "x$ac_cv_type_u_int32_t" = x""yes; then :
-  ac_cv_header_stdint_u=$i
-else
-       continue
-fi
-
-   ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i>
-"
-if test "x$ac_cv_type_uint64_t" = x""yes; then :
-  and64="(u_int64_t too)"
-else
-  and64=""
-fi
-
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen our u_int32_t in $i $and64" >&5
-$as_echo "... seen our u_int32_t in $i $and64" >&6; }
-   break;
- done
- fi
- fi
-
-# ----------------- DONE inttypes.h checks MAYBE C basic types --------
-
-if test "$ac_cv_header_stdint_x" = "no-file" ; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5
-$as_echo_n "checking size of char... " >&6; }
-if test "${ac_cv_sizeof_char+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include "confdefs.h"
-#include <sys/types.h>
-
-
-int
-main ()
-{
-switch (0) case 0: case (sizeof (char) == $ac_size):;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sizeof_char=$ac_size
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  if test x$ac_cv_sizeof_char != x ; then break; fi
-done
-
-fi
-
-if test x$ac_cv_sizeof_char = x ; then
-  as_fn_error $? "cannot determine a size for char" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5
-$as_echo "$ac_cv_sizeof_char" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_CHAR $ac_cv_sizeof_char
-_ACEOF
-
-
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
-$as_echo_n "checking size of short... " >&6; }
-if test "${ac_cv_sizeof_short+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include "confdefs.h"
-#include <sys/types.h>
-
-
-int
-main ()
-{
-switch (0) case 0: case (sizeof (short) == $ac_size):;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sizeof_short=$ac_size
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  if test x$ac_cv_sizeof_short != x ; then break; fi
-done
-
-fi
-
-if test x$ac_cv_sizeof_short = x ; then
-  as_fn_error $? "cannot determine a size for short" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
-$as_echo "$ac_cv_sizeof_short" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SHORT $ac_cv_sizeof_short
-_ACEOF
-
-
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
-$as_echo_n "checking size of int... " >&6; }
-if test "${ac_cv_sizeof_int+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include "confdefs.h"
-#include <sys/types.h>
-
-
-int
-main ()
-{
-switch (0) case 0: case (sizeof (int) == $ac_size):;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sizeof_int=$ac_size
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  if test x$ac_cv_sizeof_int != x ; then break; fi
-done
-
-fi
-
-if test x$ac_cv_sizeof_int = x ; then
-  as_fn_error $? "cannot determine a size for int" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
-$as_echo "$ac_cv_sizeof_int" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
-
-
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
-$as_echo_n "checking size of long... " >&6; }
-if test "${ac_cv_sizeof_long+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include "confdefs.h"
-#include <sys/types.h>
-
-
-int
-main ()
-{
-switch (0) case 0: case (sizeof (long) == $ac_size):;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sizeof_long=$ac_size
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  if test x$ac_cv_sizeof_long != x ; then break; fi
-done
-
-fi
-
-if test x$ac_cv_sizeof_long = x ; then
-  as_fn_error $? "cannot determine a size for long" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
-$as_echo "$ac_cv_sizeof_long" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-_ACEOF
-
-
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5
-$as_echo_n "checking size of void*... " >&6; }
-if test "${ac_cv_sizeof_voidp+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include "confdefs.h"
-#include <sys/types.h>
-
-
-int
-main ()
-{
-switch (0) case 0: case (sizeof (void*) == $ac_size):;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sizeof_voidp=$ac_size
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  if test x$ac_cv_sizeof_voidp != x ; then break; fi
-done
-
-fi
-
-if test x$ac_cv_sizeof_voidp = x ; then
-  as_fn_error $? "cannot determine a size for void*" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5
-$as_echo "$ac_cv_sizeof_voidp" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_VOIDP $ac_cv_sizeof_voidp
-_ACEOF
-
-
-   ac_cv_header_stdint_test="yes"
-else
-   ac_cv_header_stdint_test="no"
-fi
-
-# ----------------- DONE inttypes.h checks START header -------------
-_ac_stdint_h=`$as_echo "_$ac_stdint_h" | $as_tr_cpp`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: creating $ac_stdint_h : $_ac_stdint_h" >&5
-$as_echo "creating $ac_stdint_h : $_ac_stdint_h" >&6; }
-echo "#ifndef" $_ac_stdint_h >$ac_stdint_h
-echo "#define" $_ac_stdint_h "1" >>$ac_stdint_h
-echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint_h
-echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint_h
-if test "$GCC" = "yes" ; then
-  echo "/* generated using a gnu compiler version" `$CC --version` "*/" \
-  >>$ac_stdint_h
-else
-  echo "/* generated using $CC */" >>$ac_stdint_h
-fi
-echo "" >>$ac_stdint_h
-
-if test "$ac_cv_header_stdint_x" != "no-file" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_x"
-elif  test "$ac_cv_header_stdint_o" != "no-file" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_o"
-elif  test "$ac_cv_header_stdint_u" != "no-file" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_u"
-else
-   ac_cv_header_stdint="stddef.h"
-fi
-
-# ----------------- See if int_least and int_fast types are present
-unset ac_cv_type_int_least32_t
-unset ac_cv_type_int_fast32_t
-ac_fn_c_check_type "$LINENO" "int_least32_t" "ac_cv_type_int_least32_t" "#include <$ac_cv_header_stdint>
-"
-if test "x$ac_cv_type_int_least32_t" = x""yes; then :
-
-fi
-
-ac_fn_c_check_type "$LINENO" "int_fast32_t" "ac_cv_type_int_fast32_t" "#include<$ac_cv_header_stdint>
-"
-if test "x$ac_cv_type_int_fast32_t" = x""yes; then :
-
-fi
-
-
-if test "$ac_cv_header_stdint" != "stddef.h" ; then
-if test "$ac_cv_header_stdint" != "stdint.h" ; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding include stddef.h" >&5
-$as_echo "..adding include stddef.h" >&6; }
-   echo "#include <stddef.h>" >>$ac_stdint_h
-fi ; fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding include $ac_cv_header_stdint" >&5
-$as_echo "..adding include $ac_cv_header_stdint" >&6; }
-   echo "#include <$ac_cv_header_stdint>" >>$ac_stdint_h
-echo "" >>$ac_stdint_h
-
-# ----------------- DONE header START basic int types -------------
-if test "$ac_cv_header_stdint_x" = "no-file" ; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... need to look at C basic types" >&5
-$as_echo "... need to look at C basic types" >&6; }
-else
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen good stdint.h inttypes" >&5
-$as_echo "... seen good stdint.h inttypes" >&6; }
-fi
-
-if test "$ac_cv_header_stdint_u" != "no-file" ; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen bsd/sysv typedefs" >&5
-$as_echo "... seen bsd/sysv typedefs" >&6; }
-   cat >>$ac_stdint_h <<EOF
-
-/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
-typedef u_int8_t uint8_t;
-typedef u_int16_t uint16_t;
-typedef u_int32_t uint32_t;
-EOF
-    cat >>$ac_stdint_h <<EOF
-
-/* glibc compatibility */
-#ifndef __int8_t_defined
-#define __int8_t_defined
-#endif
-EOF
-fi
-
-ac_cv_sizeof_x="$ac_cv_sizeof_char:$ac_cv_sizeof_short"
-ac_cv_sizeof_X="$ac_cv_sizeof_x:$ac_cv_sizeof_int"
-ac_cv_sizeof_X="$ac_cv_sizeof_X:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long"
-if test "$ac_cv_header_stdint" = "stddef.h" ; then
-#   we must guess all the basic types. Apart from byte-adressable system,
-# there a few 32-bit-only dsp-systems. nibble-addressable systems are way off.
-    cat >>$ac_stdint_h <<EOF
-/* ------------ BITSPECIFIC INTTYPES SECTION --------------- */
-EOF
-    t="typedefs for a"
-    case "$ac_cv_sizeof_X" in
-     1:2:2:2:4) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding $t normal 16-bit system" >&5
-$as_echo "..adding $t normal 16-bit system" >&6; }
-                cat >>$ac_stdint_h <<EOF
-/*              a normal 16-bit system                       */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned long   uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          long    int32_t;
-#endif
-EOF
-;;
-     1:2:2:4:4) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding $t 32-bit system derived from a 16-bit" >&5
-$as_echo "..adding $t 32-bit system derived from a 16-bit" >&6; }
-                cat >>$ac_stdint_h <<EOF
-/*              a 32-bit system derived from a 16-bit        */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-EOF
-;;
-     1:2:4:4:4) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding $t normal 32-bit system" >&5
-$as_echo "..adding $t normal 32-bit system" >&6; }
-                cat >>$ac_stdint_h <<EOF
-/*              a normal 32-bit system                       */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-EOF
-;;
-     1:2:4:4:8) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding $t 32-bit system prepared for 64-bit" >&5
-$as_echo "..adding $t 32-bit system prepared for 64-bit" >&6; }
-                cat >>$ac_stdint_h <<EOF
-
-/*              a 32-bit system prepared for 64-bit          */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-EOF
-;;
-     1:2:4:8:8) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding $t normal 64-bit system" >&5
-$as_echo "..adding $t normal 64-bit system" >&6; }
-                cat >>$ac_stdint_h <<EOF
-
-/*              a normal 64-bit system                       */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-EOF
-;;
-     1:2:4:8:4) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding $t 64-bit system derived from a 32-bit" >&5
-$as_echo "..adding $t 64-bit system derived from a 32-bit" >&6; }
-                cat >>$ac_stdint_h <<EOF
-
-/*              a 64-bit system derived from a 32-bit system */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-EOF
-;;
-  *)
-    as_fn_error $? " $ac_cv_sizeof_X  what is that a system? contact the author, quick! http://ac-archive.sf.net" "$LINENO" 5
-    exit 1
-;;
-   esac
-fi
-
-# ------------- DONE basic int types START int64_t types ------------
-if test "$ac_cv_type_uint64_t" = "yes"
-then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ... seen good uint64_t" >&5
-$as_echo "... seen good uint64_t" >&6; }
-     cat >>$ac_stdint_h <<EOF
-
-/* system headers have good uint64_t */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#endif
-EOF
-
-elif test "$ac_cv_type_u_int64_t" = "yes"
-then { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding typedef u_int64_t uint64_t" >&5
-$as_echo "..adding typedef u_int64_t uint64_t" >&6; }
-     cat >>$ac_stdint_h <<EOF
-
-/* system headers have an u_int64_t */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef u_int64_t uint64_t;
-#endif
-EOF
-else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding generic uint64_t runtime checks" >&5
-$as_echo "..adding generic uint64_t runtime checks" >&6; }
-     cat >>$ac_stdint_h <<EOF
-
-/* -------------------- 64 BIT GENERIC SECTION -------------------- */
-/* here are some common heuristics using compiler runtime specifics */
-#if defined __STDC_VERSION__ && defined __STDC_VERSION__ > 199901L
-
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
-
-#elif !defined __STRICT_ANSI__
-#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
-
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-#endif
-
-#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
-
-#if !defined _NO_LONGLONG
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
-#endif
-
-#elif defined __alpha || (defined __mips && defined _ABIN32)
-
-#if !defined _NO_LONGLONG
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
-#endif
-  /* compiler/cpu type ... or just ISO C99 */
-#endif
-#endif
-EOF
-
-# plus a default 64-bit for systems that are likely to be 64-bit ready
-  case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp:$ac_cv_sizeof_long" in
-    1:2:8:8) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding uint64_t default" >&5
-$as_echo "..adding uint64_t default" >&6; }
-cat >>$ac_stdint_h <<EOF
-/* DEFAULT: */
-/* seen normal 64-bit system, CC has sizeof(long and void*) == 8 bytes */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
-EOF
-;;
-    1:2:4:8) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding uint64_t default" >&5
-$as_echo "..adding uint64_t default" >&6; }
-cat >>$ac_stdint_h <<EOF
-/* DEFAULT: */
-/* seen 32-bit system prepared for 64-bit, CC has sizeof(long) == 8 bytes */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
-EOF
-;;
-    1:2:8:4) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding uint64_t default" >&5
-$as_echo "..adding uint64_t default" >&6; }
-cat >>$ac_stdint_h <<EOF
-/* DEFAULT: */
-/* seen 64-bit derived from a 32-bit, CC has sizeof(long) == 4 bytes */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
-EOF
-;;
-   *)
-cat >>$ac_stdint_h <<EOF
-/* NOTE: */
-/* the configure-checks for the basic types did not make us believe */
-/* that we could add a fallback to a 'long long' typedef to int64_t */
-EOF
-  esac
-fi
-
-# ------------- DONE int64_t types START intptr types ------------
-if test "$ac_cv_header_stdint_x" = "no-file" ; then
-  cat >>$ac_stdint_h <<EOF
-
-/* -------------------------- INPTR SECTION --------------------------- */
-EOF
-  case "$ac_cv_sizeof_x:$ac_cv_sizeof_voidp" in
-  1:2:2)
-    a="int16_t" ; cat >>$ac_stdint_h <<EOF
-/* we tested sizeof(void*) to be of 2 chars, hence we declare it 16-bit */
-
-typedef uint16_t uintptr_t;
-typedef  int16_t  intptr_t;
-EOF
-;;
-  1:2:4)
-    a="int32_t" ; cat >>$ac_stdint_h <<EOF
-/* we tested sizeof(void*) to be of 4 chars, hence we declare it 32-bit */
-
-typedef uint32_t uintptr_t;
-typedef  int32_t  intptr_t;
-EOF
-;;
-  1:2:8)
-    a="int64_t" ; cat >>$ac_stdint_h <<EOF
-/* we tested sizeof(void*) to be of 8 chars, hence we declare it 64-bit */
-
-typedef uint64_t uintptr_t;
-typedef  int64_t  intptr_t;
-EOF
-;;
-  *)
-    a="long" ; cat >>$ac_stdint_h <<EOF
-/* we tested sizeof(void*) but got no guess, hence we declare it as if long */
-
-typedef unsigned long uintptr_t;
-typedef          long  intptr_t;
-EOF
-;;
-  esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding typedef $a intptr_t" >&5
-$as_echo "..adding typedef $a intptr_t" >&6; }
-fi
-
-# ------------- DONE intptr types START int_least types ------------
-if test "$ac_cv_type_int_least32_t" = "no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding generic int_least-types" >&5
-$as_echo "..adding generic int_least-types" >&6; }
-     cat >>$ac_stdint_h <<EOF
-
-/* --------------GENERIC INT_LEAST ------------------ */
-
-typedef  int8_t    int_least8_t;
-typedef  int16_t   int_least16_t;
-typedef  int32_t   int_least32_t;
-#ifdef _HAVE_INT64_T
-typedef  int64_t   int_least64_t;
-#endif
-
-typedef uint8_t   uint_least8_t;
-typedef uint16_t  uint_least16_t;
-typedef uint32_t  uint_least32_t;
-#ifdef _HAVE_INT64_T
-typedef uint64_t  uint_least64_t;
-#endif
-EOF
-fi
-
-# ------------- DONE intptr types START int_least types ------------
-if test "$ac_cv_type_int_fast32_t" = "no"; then
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ..adding generic int_fast-types" >&5
-$as_echo "..adding generic int_fast-types" >&6; }
-     cat >>$ac_stdint_h <<EOF
-
-/* --------------GENERIC INT_FAST ------------------ */
-
-typedef  int8_t    int_fast8_t;
-typedef  int32_t   int_fast16_t;
-typedef  int32_t   int_fast32_t;
-#ifdef _HAVE_INT64_T
-typedef  int64_t   int_fast64_t;
-#endif
-
-typedef uint8_t   uint_fast8_t;
-typedef uint32_t  uint_fast16_t;
-typedef uint32_t  uint_fast32_t;
-#ifdef _HAVE_INT64_T
-typedef uint64_t  uint_fast64_t;
-#endif
-EOF
-fi
-
-if test "$ac_cv_header_stdint_x" = "no-file" ; then
-     cat >>$ac_stdint_h <<EOF
-
-#ifdef _HAVE_INT64_T
-typedef int64_t        intmax_t;
-typedef uint64_t      uintmax_t;
-#else
-typedef long int       intmax_t;
-typedef unsigned long uintmax_t;
-#endif
-EOF
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ... DONE $ac_stdint_h" >&5
-$as_echo "... DONE $ac_stdint_h" >&6; }
-   cat >>$ac_stdint_h <<EOF
-
-  /* once */
-#endif
-#endif
-EOF
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_addr_t" >&5
-$as_echo_n "checking for in_addr_t... " >&6; }
-if test "${_cv_inaddrt+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-
-                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <netinet/in.h>
-int
-main ()
-{
-in_addr_t foo; return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  _cv_inaddrt=yes
-else
-  _cv_inaddrt=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext,
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_cv_inaddrt" >&5
-$as_echo "$_cv_inaddrt" >&6; }
-
-if test $_cv_inaddrt = no ; then
-  $as_echo "#define NEED_INADDR_T 1" >>confdefs.h
-
-fi
-
-
-# Checks for library functions.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
-$as_echo_n "checking for working memcmp... " >&6; }
-if test "${ac_cv_func_memcmp_working+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_memcmp_working=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-
-  /* Some versions of memcmp are not 8-bit clean.  */
-  char c0 = '\100', c1 = '\200', c2 = '\201';
-  if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
-    return 1;
-
-  /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
-     or more and with at least one buffer not starting on a 4-byte boundary.
-     William Lewis provided this test program.   */
-  {
-    char foo[21];
-    char bar[21];
-    int i;
-    for (i = 0; i < 4; i++)
-      {
-	char *a = foo + i;
-	char *b = bar + i;
-	strcpy (a, "--------01111111");
-	strcpy (b, "--------10000000");
-	if (memcmp (a, b, 16) >= 0)
-	  return 1;
-      }
-    return 0;
-  }
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_memcmp_working=yes
-else
-  ac_cv_func_memcmp_working=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5
-$as_echo "$ac_cv_func_memcmp_working" >&6; }
-test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
-  *" memcmp.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
- ;;
-esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
-$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -f conftest.sym conftest.file
-echo >conftest.file
-if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-struct stat sbuf;
-     /* Linux will dereference the symlink and fail, as required by POSIX.
-	That is better in the sense that it means we will not
-	have to compile and use the lstat wrapper.  */
-     return lstat ("conftest.sym/", &sbuf) == 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_lstat_dereferences_slashed_symlink=yes
-else
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-else
-  # If the `ln -s' command failed, then we probably don't even
-  # have an lstat function.
-  ac_cv_func_lstat_dereferences_slashed_symlink=no
-fi
-rm -f conftest.sym conftest.file
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5
-$as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; }
-
-test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
-
-cat >>confdefs.h <<_ACEOF
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
-_ACEOF
-
-
-if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
-  case " $LIBOBJS " in
-  *" lstat.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS lstat.$ac_objext"
- ;;
-esac
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat accepts an empty string" >&5
-$as_echo_n "checking whether stat accepts an empty string... " >&6; }
-if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_stat_empty_string_bug=yes
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-struct stat sbuf;
-  return stat ("", &sbuf) == 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_stat_empty_string_bug=no
-else
-  ac_cv_func_stat_empty_string_bug=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_stat_empty_string_bug" >&5
-$as_echo "$ac_cv_func_stat_empty_string_bug" >&6; }
-if test $ac_cv_func_stat_empty_string_bug = yes; then
-  case " $LIBOBJS " in
-  *" stat.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS stat.$ac_objext"
- ;;
-esac
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STAT_EMPTY_STRING_BUG 1
-_ACEOF
-
-fi
-
-for ac_func in strftime
-do :
-  ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
-if test "x$ac_cv_func_strftime" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
-
-else
-  # strftime is in -lintl on SCO UNIX.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
-$as_echo_n "checking for strftime in -lintl... " >&6; }
-if test "${ac_cv_lib_intl_strftime+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char strftime ();
-int
-main ()
-{
-return strftime ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_intl_strftime=yes
-else
-  ac_cv_lib_intl_strftime=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
-$as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test "x$ac_cv_lib_intl_strftime" = x""yes; then :
-  $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
-
-LIBS="-lintl $LIBS"
-fi
-
-fi
-done
-
-for ac_func in vprintf
-do :
-  ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
-if test "x$ac_cv_func_vprintf" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_VPRINTF 1
-_ACEOF
-
-ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
-if test "x$ac_cv_func__doprnt" = x""yes; then :
-
-$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
-
-fi
-
-fi
-done
-
-
-ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
-if test "x$ac_cv_type_pid_t" = x""yes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define pid_t int
-_ACEOF
-
-fi
-
-for ac_header in vfork.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
-if test "x$ac_cv_header_vfork_h" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_VFORK_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_func in fork vfork
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-if test "x$ac_cv_func_fork" = xyes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
-$as_echo_n "checking for working fork... " >&6; }
-if test "${ac_cv_func_fork_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_fork_works=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-
-	  /* By Ruediger Kuhlmann. */
-	  return fork () < 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_fork_works=yes
-else
-  ac_cv_func_fork_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5
-$as_echo "$ac_cv_func_fork_works" >&6; }
-
-else
-  ac_cv_func_fork_works=$ac_cv_func_fork
-fi
-if test "x$ac_cv_func_fork_works" = xcross; then
-  case $host in
-    *-*-amigaos* | *-*-msdosdjgpp*)
-      # Override, as these systems have only a dummy fork() stub
-      ac_cv_func_fork_works=no
-      ;;
-    *)
-      ac_cv_func_fork_works=yes
-      ;;
-  esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
-$as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
-fi
-ac_cv_func_vfork_works=$ac_cv_func_vfork
-if test "x$ac_cv_func_vfork" = xyes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
-$as_echo_n "checking for working vfork... " >&6; }
-if test "${ac_cv_func_vfork_works+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_vfork_works=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Thanks to Paul Eggert for this test.  */
-$ac_includes_default
-#include <sys/wait.h>
-#ifdef HAVE_VFORK_H
-# include <vfork.h>
-#endif
-/* On some sparc systems, changes by the child to local and incoming
-   argument registers are propagated back to the parent.  The compiler
-   is told about this with #include <vfork.h>, but some compilers
-   (e.g. gcc -O) don't grok <vfork.h>.  Test for this by using a
-   static variable whose address is put into a register that is
-   clobbered by the vfork.  */
-static void
-#ifdef __cplusplus
-sparc_address_test (int arg)
-# else
-sparc_address_test (arg) int arg;
-#endif
-{
-  static pid_t child;
-  if (!child) {
-    child = vfork ();
-    if (child < 0) {
-      perror ("vfork");
-      _exit(2);
-    }
-    if (!child) {
-      arg = getpid();
-      write(-1, "", 0);
-      _exit (arg);
-    }
-  }
-}
-
-int
-main ()
-{
-  pid_t parent = getpid ();
-  pid_t child;
-
-  sparc_address_test (0);
-
-  child = vfork ();
-
-  if (child == 0) {
-    /* Here is another test for sparc vfork register problems.  This
-       test uses lots of local variables, at least as many local
-       variables as main has allocated so far including compiler
-       temporaries.  4 locals are enough for gcc 1.40.3 on a Solaris
-       4.1.3 sparc, but we use 8 to be safe.  A buggy compiler should
-       reuse the register of parent for one of the local variables,
-       since it will think that parent can't possibly be used any more
-       in this routine.  Assigning to the local variable will thus
-       munge parent in the parent process.  */
-    pid_t
-      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
-      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
-    /* Convince the compiler that p..p7 are live; otherwise, it might
-       use the same hardware register for all 8 local variables.  */
-    if (p != p1 || p != p2 || p != p3 || p != p4
-	|| p != p5 || p != p6 || p != p7)
-      _exit(1);
-
-    /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
-       from child file descriptors.  If the child closes a descriptor
-       before it execs or exits, this munges the parent's descriptor
-       as well.  Test for this by closing stdout in the child.  */
-    _exit(close(fileno(stdout)) != 0);
-  } else {
-    int status;
-    struct stat st;
-
-    while (wait(&status) != child)
-      ;
-    return (
-	 /* Was there some problem with vforking?  */
-	 child < 0
-
-	 /* Did the child fail?  (This shouldn't happen.)  */
-	 || status
-
-	 /* Did the vfork/compiler bug occur?  */
-	 || parent != getpid()
-
-	 /* Did the file descriptor bug occur?  */
-	 || fstat(fileno(stdout), &st) != 0
-	 );
-  }
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_vfork_works=yes
-else
-  ac_cv_func_vfork_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5
-$as_echo "$ac_cv_func_vfork_works" >&6; }
-
-fi;
-if test "x$ac_cv_func_fork_works" = xcross; then
-  ac_cv_func_vfork_works=$ac_cv_func_vfork
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
-$as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
-fi
-
-if test "x$ac_cv_func_vfork_works" = xyes; then
-
-$as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h
-
-else
-
-$as_echo "#define vfork fork" >>confdefs.h
-
-fi
-if test "x$ac_cv_func_fork_works" = xyes; then
-
-$as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
-
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_nsl_gethostbyname=yes
-else
-  ac_cv_lib_nsl_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
-
-  LIBS="-lnsl $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
-$as_echo_n "checking for socket in -lsocket... " >&6; }
-if test "${ac_cv_lib_socket_socket+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char socket ();
-int
-main ()
-{
-return socket ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_socket_socket=yes
-else
-  ac_cv_lib_socket_socket=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
-$as_echo "$ac_cv_lib_socket_socket" >&6; }
-if test "x$ac_cv_lib_socket_socket" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSOCKET 1
-_ACEOF
-
-  LIBS="-lsocket $LIBS"
-
-fi
-
-for ac_func in ftime mkfifo dup2 floor gethostbyname gethostname gettimeofday inet_ntoa memcmp memmove memcpy memset mmap pow putenv select socket strchr strdup strerror strpbrk strrchr strstr uname setsid getpwuid getpwnam getuid geteuid waitpid setutxent setpgrp seteuid grantpt getspnam initgroups
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-# check, if shmget is in cygipc.a
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmget in -lcygipc" >&5
-$as_echo_n "checking for shmget in -lcygipc... " >&6; }
-if test "${ac_cv_lib_cygipc_shmget+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcygipc  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shmget ();
-int
-main ()
-{
-return shmget ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_cygipc_shmget=yes
-else
-  ac_cv_lib_cygipc_shmget=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cygipc_shmget" >&5
-$as_echo "$ac_cv_lib_cygipc_shmget" >&6; }
-if test "x$ac_cv_lib_cygipc_shmget" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCYGIPC 1
-_ACEOF
-
-  LIBS="-lcygipc $LIBS"
-
-fi
-
- if test "$HAVE_CYGIPC" = "true"; then
-  CYGIPC_TRUE=
-  CYGIPC_FALSE='#'
-else
-  CYGIPC_TRUE='#'
-  CYGIPC_FALSE=
-fi
-
-
-# Check if /dev/vcsa1 exists, if so, define LINUX
- if test -c /dev/vcsa1; then
-  LINUX_TRUE=
-  LINUX_FALSE='#'
-else
-  LINUX_TRUE='#'
-  LINUX_FALSE=
-fi
-
-
-# Check for OS X specific header
-ac_fn_c_check_header_mongrel "$LINENO" "ApplicationServices/ApplicationServices.h" "ac_cv_header_ApplicationServices_ApplicationServices_h" "$ac_includes_default"
-if test "x$ac_cv_header_ApplicationServices_ApplicationServices_h" = x""yes; then :
-  HAVE_OSX="true"
-fi
-
-
- if test "$HAVE_OSX" = "true"; then
-  OSX_TRUE=
-  OSX_FALSE='#'
-else
-  OSX_TRUE='#'
-  OSX_FALSE=
-fi
-
-
-# Check for OS X specific header
-ac_fn_c_check_header_mongrel "$LINENO" "ApplicationServices/ApplicationServices.h" "ac_cv_header_ApplicationServices_ApplicationServices_h" "$ac_includes_default"
-if test "x$ac_cv_header_ApplicationServices_ApplicationServices_h" = x""yes; then :
-  HAVE_OSX="true"
-fi
-
-
- if test "$HAVE_OSX" = "true"; then
-  OSX_TRUE=
-  OSX_FALSE='#'
-else
-  OSX_TRUE='#'
-  OSX_FALSE=
-fi
-
-
-# On Solaris 2.7, write() returns ENOENT when it really means EAGAIN
-
-case `(uname -sr) 2>/dev/null` in
-    "SunOS 5.7")
-	$as_echo "#define ENOENT_WORKAROUND 1" >>confdefs.h
-
-    ;;
-esac
-
-uname_s=`(uname -s) 2>/dev/null`
-if test "x$uname_s" = "xHP-UX"; then
-	# need -lsec for getspnam()
-	LDFLAGS="$LDFLAGS -lsec"
-fi
-
-# Check for rpm SOURCES path
-echo -n "checking for rpm sources path... "
-RPMSOURCEDIR="NOT-FOUND"
-for directory in packages OpenLinux redhat RedHat rpm RPM "" ; do
-	if test -d /usr/src/${directory}/SOURCES; then
-		RPMSOURCEDIR="/usr/src/${directory}/SOURCES/"
-	fi
-done
-echo "$RPMSOURCEDIR"
- if test "$RPMSOURCEDIR" != "NOT-FOUND"; then
-  HAVE_RPM_TRUE=
-  HAVE_RPM_FALSE='#'
-else
-  HAVE_RPM_TRUE='#'
-  HAVE_RPM_FALSE=
-fi
-
-
-
-docdir="$datadir/$PACKAGE/doc"
-
-
-#AC_CONFIG_SUBDIRS(lupus)
-
-ac_config_files="$ac_config_files Makefile italc.spec iTALC.nsi lib/Makefile ica/Makefile ima/Makefile ima/data/italc ima/data/italc.desktop setup/Makefile ica/ica.rc ima/italc.rc setup/setup.rc"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
-  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
-      esac ;;
-    esac
-  done
-
-  (set) 2>&1 |
-    case $as_nl`(ac_space=' '; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
-      # `set' does not quote correctly, so add quotes: double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \.
-      sed -n \
-	"s/'/'\\\\''/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;; #(
-    *)
-      # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
-      ;;
-    esac |
-    sort
-) |
-  sed '
-     /^ac_cv_env_/b end
-     t clear
-     :clear
-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
-     t end
-     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
-  if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
-      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-  fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-  # 1. Remove the extension, and $U if already installed.
-  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
-  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
-  #    will be set to the directory where LIBOBJS objects are built.
-  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
- if test -n "$EXEEXT"; then
-  am__EXEEXT_TRUE=
-  am__EXEEXT_FALSE='#'
-else
-  am__EXEEXT_TRUE='#'
-  am__EXEEXT_FALSE=
-fi
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${BUILD_WIN32_TRUE}" && test -z "${BUILD_WIN32_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_WIN32\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${BUILD_LINUX_TRUE}" && test -z "${BUILD_LINUX_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_LINUX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then
-  as_fn_error $? "conditional \"DEBUG\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_X_TRUE}" && test -z "${HAVE_X_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_X\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_LIBZ_TRUE}" && test -z "${HAVE_LIBZ_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_LIBZ\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_LIBJPEG_TRUE}" && test -z "${HAVE_LIBJPEG_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_LIBJPEG\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_LIBSSL_TRUE}" && test -z "${HAVE_LIBSSL_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_LIBSSL\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_LIBEAY32_TRUE}" && test -z "${HAVE_LIBEAY32_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_LIBEAY32\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_LIBPTHREAD_TRUE}" && test -z "${HAVE_LIBPTHREAD_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_LIBPTHREAD\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-if test -z "${CYGIPC_TRUE}" && test -z "${CYGIPC_FALSE}"; then
-  as_fn_error $? "conditional \"CYGIPC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${LINUX_TRUE}" && test -z "${LINUX_FALSE}"; then
-  as_fn_error $? "conditional \"LINUX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${OSX_TRUE}" && test -z "${OSX_FALSE}"; then
-  as_fn_error $? "conditional \"OSX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${OSX_TRUE}" && test -z "${OSX_FALSE}"; then
-  as_fn_error $? "conditional \"OSX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_RPM_TRUE}" && test -z "${HAVE_RPM_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_RPM\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: ${CONFIG_STATUS=./config.status}
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-case $0 in #((
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
-  case `echo 'xy\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='	';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -p'
-  fi
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by italc $as_me 1.0.13, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration.  Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number and configuration settings, then exit
-      --config     print configuration, then exit
-  -q, --quiet, --silent
-                   do not print progress messages
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-      --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
-      --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to <http://italc.sourceforge.net/>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-italc config.status 1.0.13
-configured by $0, generated by GNU Autoconf 2.67,
-  with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2010 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=?*)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  --*=)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=
-    ac_shift=:
-    ;;
-  *)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
-    ;;
-  esac
-
-  case $ac_option in
-  # Handling of the options.
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    ac_cs_recheck=: ;;
-  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    $as_echo "$ac_cs_version"; exit ;;
-  --config | --confi | --conf | --con | --co | --c )
-    $as_echo "$ac_cs_config"; exit ;;
-  --debug | --debu | --deb | --de | --d | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    '') as_fn_error $? "missing file argument" ;;
-    esac
-    as_fn_append CONFIG_FILES " '$ac_optarg'"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
-    ac_need_defaults=false;;
-  --he | --h)
-    # Conflict between --help and --header
-    as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
-  --help | --hel | -h )
-    $as_echo "$ac_cs_usage"; exit ;;
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil | --si | --s)
-    ac_cs_silent=: ;;
-
-  # This is an error.
-  -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
-  *) as_fn_append ac_config_targets " $1"
-     ac_need_defaults=false ;;
-
-  esac
-  shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
-  exec 6>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-  shift
-  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
-  CONFIG_SHELL='$SHELL'
-  export CONFIG_SHELL
-  exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-  $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-PACKAGE="$PACKAGE"
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`'
-DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
-macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
-enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
-host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
-host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
-host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
-build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
-build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
-build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
-SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
-Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
-GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
-EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
-FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
-LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
-NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
-LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
-exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
-AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
-STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
-compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
-GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
-objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
-SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
-ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
-need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
-LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
-libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
-fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
-need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
-version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
-striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`'
-predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`'
-postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`'
-predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`'
-postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`'
-LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`'
-
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# Quote evaled strings.
-for var in SED \
-GREP \
-EGREP \
-FGREP \
-LD \
-NM \
-LN_S \
-lt_SP2NL \
-lt_NL2SP \
-reload_flag \
-deplibs_check_method \
-file_magic_cmd \
-AR \
-AR_FLAGS \
-STRIP \
-RANLIB \
-CC \
-CFLAGS \
-compiler \
-lt_cv_sys_global_symbol_pipe \
-lt_cv_sys_global_symbol_to_cdecl \
-lt_cv_sys_global_symbol_to_c_name_address \
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-SHELL \
-ECHO \
-lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_wl \
-lt_prog_compiler_pic \
-lt_prog_compiler_static \
-lt_cv_prog_compiler_c_o \
-need_locks \
-DSYMUTIL \
-NMEDIT \
-LIPO \
-OTOOL \
-OTOOL64 \
-shrext_cmds \
-export_dynamic_flag_spec \
-whole_archive_flag_spec \
-compiler_needs_object \
-with_gnu_ld \
-allow_undefined_flag \
-no_undefined_flag \
-hardcode_libdir_flag_spec \
-hardcode_libdir_flag_spec_ld \
-hardcode_libdir_separator \
-fix_srcfile_path \
-exclude_expsyms \
-include_expsyms \
-file_list_spec \
-variables_saved_for_relink \
-libname_spec \
-library_names_spec \
-soname_spec \
-finish_eval \
-old_striplib \
-striplib \
-compiler_lib_search_dirs \
-predep_objects \
-postdep_objects \
-predeps \
-postdeps \
-compiler_lib_search_path \
-LD_CXX \
-compiler_CXX \
-lt_prog_compiler_no_builtin_flag_CXX \
-lt_prog_compiler_wl_CXX \
-lt_prog_compiler_pic_CXX \
-lt_prog_compiler_static_CXX \
-lt_cv_prog_compiler_c_o_CXX \
-export_dynamic_flag_spec_CXX \
-whole_archive_flag_spec_CXX \
-compiler_needs_object_CXX \
-with_gnu_ld_CXX \
-allow_undefined_flag_CXX \
-no_undefined_flag_CXX \
-hardcode_libdir_flag_spec_CXX \
-hardcode_libdir_flag_spec_ld_CXX \
-hardcode_libdir_separator_CXX \
-fix_srcfile_path_CXX \
-exclude_expsyms_CXX \
-include_expsyms_CXX \
-file_list_spec_CXX \
-compiler_lib_search_dirs_CXX \
-predep_objects_CXX \
-postdep_objects_CXX \
-predeps_CXX \
-postdeps_CXX \
-compiler_lib_search_path_CXX; do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
-    *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Double-quote double-evaled strings.
-for var in reload_cmds \
-old_postinstall_cmds \
-old_postuninstall_cmds \
-old_archive_cmds \
-extract_expsyms_cmds \
-old_archive_from_new_cmds \
-old_archive_from_expsyms_cmds \
-archive_cmds \
-archive_expsym_cmds \
-module_cmds \
-module_expsym_cmds \
-export_symbols_cmds \
-prelink_cmds \
-postinstall_cmds \
-postuninstall_cmds \
-finish_cmds \
-sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec \
-old_archive_cmds_CXX \
-old_archive_from_new_cmds_CXX \
-old_archive_from_expsyms_cmds_CXX \
-archive_cmds_CXX \
-archive_expsym_cmds_CXX \
-module_cmds_CXX \
-module_expsym_cmds_CXX \
-export_symbols_cmds_CXX \
-prelink_cmds_CXX; do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
-    *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Fix-up fallback echo if it was mangled by the above quoting rules.
-case \$lt_ECHO in
-*'\\\$0 --fallback-echo"')  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
-  ;;
-esac
-
-ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-
-    PACKAGE='$PACKAGE'
-    VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
-    RM='$RM'
-    ofile='$ofile'
-
-
-
-
-
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
-  case $ac_config_target in
-    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
-    "lib/include/rfb/rfbconfig.h") CONFIG_COMMANDS="$CONFIG_COMMANDS lib/include/rfb/rfbconfig.h" ;;
-    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
-    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-    "italc.spec") CONFIG_FILES="$CONFIG_FILES italc.spec" ;;
-    "iTALC.nsi") CONFIG_FILES="$CONFIG_FILES iTALC.nsi" ;;
-    "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
-    "ica/Makefile") CONFIG_FILES="$CONFIG_FILES ica/Makefile" ;;
-    "ima/Makefile") CONFIG_FILES="$CONFIG_FILES ima/Makefile" ;;
-    "ima/data/italc") CONFIG_FILES="$CONFIG_FILES ima/data/italc" ;;
-    "ima/data/italc.desktop") CONFIG_FILES="$CONFIG_FILES ima/data/italc.desktop" ;;
-    "setup/Makefile") CONFIG_FILES="$CONFIG_FILES setup/Makefile" ;;
-    "ica/ica.rc") CONFIG_FILES="$CONFIG_FILES ica/ica.rc" ;;
-    "ima/italc.rc") CONFIG_FILES="$CONFIG_FILES ima/italc.rc" ;;
-    "setup/setup.rc") CONFIG_FILES="$CONFIG_FILES setup/setup.rc" ;;
-
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
-  esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
-  tmp=
-  trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
-  trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
-  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
-}  ||
-{
-  tmp=./conf$$-$RANDOM
-  (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
-  eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\\r'
-else
-  ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
-_ACEOF
-
-
-{
-  echo "cat >conf$$subs.awk <<_ACEOF" &&
-  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
-  echo "_ACEOF"
-} >conf$$subs.sh ||
-  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
-  . ./conf$$subs.sh ||
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
-  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
-  if test $ac_delim_n = $ac_delim_num; then
-    break
-  elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
-  N
-  s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
-  for (key in S) S_is_set[key] = 1
-  FS = ""
-
-}
-{
-  line = $ 0
-  nfields = split(line, field, "@")
-  substed = 0
-  len = length(field[1])
-  for (i = 2; i < nfields; i++) {
-    key = field[i]
-    keylen = length(key)
-    if (S_is_set[key]) {
-      value = S[key]
-      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
-      len += length(value) + length(field[++i])
-      substed = 1
-    } else
-      len += 1 + keylen
-  }
-
-  print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
-  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
-  cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
-h
-s///
-s/^/:/
-s/[	 ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[	 ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[	 ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
-    break
-  elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any.  Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  for (key in D) D_is_set[key] = 1
-  FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
-  line = \$ 0
-  split(line, arg, " ")
-  if (arg[1] == "#") {
-    defundef = arg[2]
-    mac1 = arg[3]
-  } else {
-    defundef = substr(arg[1], 2)
-    mac1 = arg[2]
-  }
-  split(mac1, mac2, "(") #)
-  macro = mac2[1]
-  prefix = substr(line, 1, index(line, defundef) - 1)
-  if (D_is_set[macro]) {
-    # Preserve the white space surrounding the "#".
-    print prefix "define", macro P[macro] D[macro]
-    next
-  } else {
-    # Replace #undef with comments.  This is necessary, for example,
-    # in the case of _POSIX_SOURCE, which is predefined and required
-    # on some systems where configure will not decide to define it.
-    if (defundef == "undef") {
-      print "/*", prefix defundef, macro, "*/"
-      next
-    }
-  }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
-  case $ac_tag in
-  :[FHLC]) ac_mode=$ac_tag; continue;;
-  esac
-  case $ac_mode$ac_tag in
-  :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
-  :[FH]-) ac_tag=-:-;;
-  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
-  esac
-  ac_save_IFS=$IFS
-  IFS=:
-  set x $ac_tag
-  IFS=$ac_save_IFS
-  shift
-  ac_file=$1
-  shift
-
-  case $ac_mode in
-  :L) ac_source=$1;;
-  :[FH])
-    ac_file_inputs=
-    for ac_f
-    do
-      case $ac_f in
-      -) ac_f="$tmp/stdin";;
-      *) # Look for the file first in the build tree, then in the source tree
-	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
-	 # because $ac_f cannot contain `:'.
-	 test -f "$ac_f" ||
-	   case $ac_f in
-	   [\\/$]*) false;;
-	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
-	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
-      esac
-      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      as_fn_append ac_file_inputs " '$ac_f'"
-    done
-
-    # Let's still pretend it is `configure' which instantiates (i.e., don't
-    # use $as_me), people would be surprised to read:
-    #    /* config.h.  Generated by config.status.  */
-    configure_input='Generated from '`
-	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
-	`' by configure.'
-    if test x"$ac_file" != x-; then
-      configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
-    fi
-    # Neutralize special characters interpreted by sed in replacement strings.
-    case $configure_input in #(
-    *\&* | *\|* | *\\* )
-       ac_sed_conf_input=`$as_echo "$configure_input" |
-       sed 's/[\\\\&|]/\\\\&/g'`;; #(
-    *) ac_sed_conf_input=$configure_input;;
-    esac
-
-    case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
-    esac
-    ;;
-  esac
-
-  ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  as_dir="$ac_dir"; as_fn_mkdir_p
-  ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
-  case $ac_mode in
-  :F)
-  #
-  # CONFIG_FILE
-  #
-
-  case $INSTALL in
-  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
-  esac
-  ac_MKDIR_P=$MKDIR_P
-  case $MKDIR_P in
-  [\\/$]* | ?:[\\/]* ) ;;
-  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
-  esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
-  p
-  q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  ac_datarootdir_hack='
-  s&@datadir@&$datadir&g
-  s&@docdir@&$docdir&g
-  s&@infodir@&$infodir&g
-  s&@localedir@&$localedir&g
-  s&@mandir@&$mandir&g
-  s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&2;}
-
-  rm -f "$tmp/stdin"
-  case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
-  esac \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-  :H)
-  #
-  # CONFIG_HEADER
-  #
-  if test x"$ac_file" != x-; then
-    {
-      $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
-    else
-      rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
-	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    fi
-  else
-    $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error $? "could not create -" "$LINENO" 5
-  fi
-# Compute "$ac_file"'s index in $config_headers.
-_am_arg="$ac_file"
-_am_stamp_count=1
-for _am_header in $config_headers :; do
-  case $_am_header in
-    $_am_arg | $_am_arg:* )
-      break ;;
-    * )
-      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
-  esac
-done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$_am_arg" : 'X\(//\)[^/]' \| \
-	 X"$_am_arg" : 'X\(//\)$' \| \
-	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-
-  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
-  esac
-
-
-  case $ac_file$ac_mode in
-    "lib/include/rfb/rfbconfig.h":C) ac_prefix_conf_OUT=`echo lib/include/rfb/rfbconfig.h`
-ac_prefix_conf_DEF=`echo _$ac_prefix_conf_OUT | sed -e "y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:" -e "s/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g"`
-ac_prefix_conf_PKG=`echo LibVNCServer`
-ac_prefix_conf_LOW=`echo _$ac_prefix_conf_PKG | sed -e "y:ABCDEFGHIJKLMNOPQRSTUVWXYZ-:abcdefghijklmnopqrstuvwxyz_:"`
-ac_prefix_conf_UPP=`echo $ac_prefix_conf_PKG | sed -e "y:abcdefghijklmnopqrstuvwxyz-:ABCDEFGHIJKLMNOPQRSTUVWXYZ_:"  -e "/^[0123456789]/s/^/_/"`
-ac_prefix_conf_INP=`echo _`
-if test "$ac_prefix_conf_INP" = "_"; then
-   for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
-     test -f "$ac_prefix_conf_INP" && continue
-     case $ac_file in
-        *.h) test -f $ac_file && ac_prefix_conf_INP=$ac_file ;;
-        *)
-     esac
-   done
-fi
-if test "$ac_prefix_conf_INP" = "_"; then
-   case "$ac_prefix_conf_OUT" in
-      */*) ac_prefix_conf_INP=`basename "$ac_prefix_conf_OUT"`
-      ;;
-      *-*) ac_prefix_conf_INP=`echo "$ac_prefix_conf_OUT" | sed -e "s/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*-//"`
-      ;;
-      *) ac_prefix_conf_INP=config.h
-      ;;
-   esac
-fi
-if test -z "$ac_prefix_conf_PKG" ; then
-   as_fn_error $? "no prefix for _PREFIX_PKG_CONFIG_H" "$LINENO" 5
-else
-  if test ! -f "$ac_prefix_conf_INP" ; then if test -f "$srcdir/$ac_prefix_conf_INP" ; then
-     ac_prefix_conf_INP="$srcdir/$ac_prefix_conf_INP"
-  fi fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&5
-$as_echo "$as_me: creating $ac_prefix_conf_OUT - prefix $ac_prefix_conf_UPP for $ac_prefix_conf_INP defines" >&6;}
-  if test -f $ac_prefix_conf_INP ; then
-    echo "s/#undef  *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]\\)/#undef $ac_prefix_conf_UPP""_\\1/" > conftest.prefix
-    # no! these are things like socklen_t, const, vfork
-    # echo "s/#undef  *\\([m4_cr_letters]\\)/#undef $_LOW""_\\1/" >> _script
-    echo "s/#define  *\\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*\\)\\(.*\\)/#ifndef $ac_prefix_conf_UPP""_\\1 \\" >> conftest.prefix
-    echo "#define $ac_prefix_conf_UPP""_\\1 \\2 \\" >> conftest.prefix
-    echo "#endif/" >>conftest.prefix
-    # no! these are things like socklen_t, const, vfork
-    # echo "s/#def[]ine  *\\([m4_cr_letters][_symbol]*\\)\\(.*\\)/#ifndef $_LOW""_\\1 \\" >> _script
-    # echo "#define $_LOW""_\\1 \\2 \\" >> _script
-    # echo "#endif/" >> _script
-    # now executing _script on _DEF input to create _OUT output file
-    echo "#ifndef $ac_prefix_conf_DEF"      >$tmp/pconfig.h
-    echo "#define $ac_prefix_conf_DEF 1" >>$tmp/pconfig.h
-    echo ' ' >>$tmp/pconfig.h
-    echo /'*' $ac_prefix_conf_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h
-
-    sed -f conftest.prefix $ac_prefix_conf_INP >>$tmp/pconfig.h
-    echo ' ' >>$tmp/pconfig.h
-    echo '/* once:' $ac_prefix_conf_DEF '*/' >>$tmp/pconfig.h
-    echo "#endif" >>$tmp/pconfig.h
-    if cmp -s $ac_prefix_conf_OUT $tmp/pconfig.h 2>/dev/null; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_prefix_conf_OUT is unchanged" >&5
-$as_echo "$as_me: $ac_prefix_conf_OUT is unchanged" >&6;}
-    else
-      ac_dir=`$as_dirname -- "$ac_prefix_conf_OUT" ||
-$as_expr X"$ac_prefix_conf_OUT" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_prefix_conf_OUT" : 'X\(//\)[^/]' \| \
-	 X"$ac_prefix_conf_OUT" : 'X\(//\)$' \| \
-	 X"$ac_prefix_conf_OUT" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_prefix_conf_OUT" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      as_dir="$ac_dir"; as_fn_mkdir_p
-      rm -f "$ac_prefix_conf_OUT"
-      mv $tmp/pconfig.h "$ac_prefix_conf_OUT"
-    fi
-#    cp _script _configs.sed
-  else
-    as_fn_error $? "input file $ac_prefix_conf_INP does not exist - skip generating $ac_prefix_conf_OUT" "$LINENO" 5
-  fi
-  rm -f conftest.*
-fi
- ;;
-    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
-  # are listed without --file.  Let's play safe and only enable the eval
-  # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
-  shift
-  for mf
-  do
-    # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
-    # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$mf" : 'X\(//\)[^/]' \| \
-	 X"$mf" : 'X\(//\)$' \| \
-	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$file" : 'X\(//\)[^/]' \| \
-	 X"$file" : 'X\(//\)$' \| \
-	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
-  done
-}
- ;;
-    "libtool":C)
-
-    # See if we are running on zsh, and set the options which allow our
-    # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
-      setopt NO_GLOB_SUBST
-    fi
-
-    cfgfile="${ofile}T"
-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
-    $RM "$cfgfile"
-
-    cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags="CXX "
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Assembler program.
-AS=$AS
-
-# DLL creation program.
-DLLTOOL=$DLLTOOL
-
-# Object dumper program.
-OBJDUMP=$OBJDUMP
-
-# Which release of libtool.m4 was used?
-macro_version=$macro_version
-macro_revision=$macro_revision
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# What type of objects to build.
-pic_mode=$pic_mode
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="\$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP=$lt_GREP
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# A literal string matcher.
-FGREP=$lt_FGREP
-
-# A BSD- or MS-compatible name lister.
-NM=$lt_NM
-
-# Whether we need soft or hard links.
-LN_S=$lt_LN_S
-
-# What is the maximum length of a command?
-max_cmd_len=$max_cmd_len
-
-# Object file suffix (normally "o").
-objext=$ac_objext
-
-# Executable file suffix (normally "").
-exeext=$exeext
-
-# whether the shell understands "unset".
-lt_unset=$lt_unset
-
-# turn spaces into newlines.
-SP2NL=$lt_lt_SP2NL
-
-# turn newlines into spaces.
-NL2SP=$lt_lt_NL2SP
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == "file_magic".
-file_magic_cmd=$lt_file_magic_cmd
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A symbol stripping program.
-STRIP=$lt_STRIP
-
-# Commands used to install an old-style archive.
-RANLIB=$lt_RANLIB
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# A C compiler.
-LTCC=$lt_CC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_CFLAGS
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# An echo program that does not interpret backslashes.
-ECHO=$lt_ECHO
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=$MAGIC_CMD
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL=$lt_DSYMUTIL
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT=$lt_NMEDIT
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO=$lt_LIPO
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL=$lt_OTOOL
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=$lt_OTOOL64
-
-# Old archive suffix (normally "a").
-libext=$libext
-
-# Shared library suffix (normally ".so").
-shrext_cmds=$lt_shrext_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink=$lt_variables_saved_for_relink
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Library versioning type.
-version_type=$version_type
-
-# Shared library runtime path variable.
-runpath_var=$runpath_var
-
-# Shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=$lt_postinstall_cmds
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=$lt_finish_eval
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds
-
-# A language specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking.  This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects
-postdep_objects=$lt_postdep_objects
-predeps=$lt_predeps
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
-  case $host_os in
-  aix3*)
-    cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-_LT_EOF
-    ;;
-  esac
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  case $xsi_shell in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-  func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-  # positional parameters, so assign one to ordinary parameter first.
-  func_stripname_result=${3}
-  func_stripname_result=${func_stripname_result#"${1}"}
-  func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=${1%%=*}
-  func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  case ${1} in
-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-    *)    func_lo2o_result=${1} ;;
-  esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=$(( $* ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=${#1}
-}
-
-_LT_EOF
-    ;;
-  *) # Bourne compatible functions.
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-  case ${2} in
-    .*) func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
-    *)  func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
-  esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[^=]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
-  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=`expr "$@"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$1+=\$2"
-}
-_LT_EOF
-    ;;
-  *)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$1=\$$1\$2"
-}
-
-_LT_EOF
-    ;;
-  esac
-
-
-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  mv -f "$cfgfile" "$ofile" ||
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-
-
-    cat <<_LT_EOF >> "$ofile"
-
-# ### BEGIN LIBTOOL TAG CONFIG: CXX
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds_CXX
-
-# A language specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object_CXX
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld_CXX
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking.  This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute_CXX
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath_CXX
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path_CXX
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds_CXX
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec_CXX
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects_CXX
-postdep_objects=$lt_postdep_objects_CXX
-predeps=$lt_predeps_CXX
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# ### END LIBTOOL TAG CONFIG: CXX
-_LT_EOF
-
- ;;
-
-  esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
-  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded.  So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status.  When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
-  ac_cs_success=:
-  ac_config_status_args=
-  test "$silent" = yes &&
-    ac_config_status_args="$ac_config_status_args --quiet"
-  exec 5>/dev/null
-  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
-  exec 5>>config.log
-  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
-  # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
-
-echo
-echo
-echo " ============================="
-echo " ===  iTALC - INFORMATION  ==================================================="
-echo " ============================="
-echo " ="
-echo " = iTALC was configured successfully! Now try to build it by typing"
-echo " = 'make' and wait until it is finished."
-echo " = Then either install iTALC by typing 'make install' or copy the binaries by"
-echo " = hand as described in INSTALL."
-echo " ="
-echo " = If there're any problems, please contact an iTALC-developer (see AUTHORS)"
-echo " ="
-echo
-
diff --git a/configure.in b/configure.in
deleted file mode 100644
index dc9effb..0000000
--- a/configure.in
+++ /dev/null
@@ -1,544 +0,0 @@
-                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.50)
-AC_INIT(italc, 1.0.13, http://italc.sourceforge.net/)
-AM_INIT_AUTOMAKE(italc, 1.0.13)
-AM_CONFIG_HEADER(config.h)
-AC_CONFIG_MACRO_DIR([m4])
-AX_PREFIX_CONFIG_H([lib/include/rfb/rfbconfig.h])
-
-
-
-if ! test -z "${prefix}" -o "${prefix}" = "NONE" ; then
-	CFLAGS="$CFLAGS -I${prefix}/include"
-	CPPFLAGS="$CFLAGS -I${prefix}/include"
-	CXXFLAGS="$CXXFLAGS -I${prefix}/include"
-	LDFLAGS="$LDFLAGS -L${prefix}/bin"
-fi
-
-
-# Checks for programs.
-AC_PROG_CC
-AC_PROG_CXX
-
-AC_LIBTOOL_WIN32_DLL
-AC_PROG_LIBTOOL
-
-
-AH_TEMPLATE(BACKCHANNEL, [Enable BackChannel communication])
-AC_ARG_WITH(backchannel,
-	[  --without-backchannel	disable backchannel method],
-	, [ with_backchannel=yes ])
-if test "x$with_backchannel" = "xyes"; then
-	AC_DEFINE(BACKCHANNEL)
-fi
-AH_TEMPLATE(ALLOW24BPP, [Enable 24 bit per pixel in native framebuffer])
-AC_ARG_WITH(24bpp,
-	[  --without-24bpp	disable 24 bpp framebuffers],
-	, [ with_24bpp=yes ])
-if test "x$with_24bpp" = "xyes"; then
-	AC_DEFINE(ALLOW24BPP)
-fi
-
-
-AH_TEMPLATE(BUILD_LINUX, [Build iTALC for Linux])
-AH_TEMPLATE(BUILD_WIN32, [Build iTALC for Win32])
-AH_TEMPLATE(WIN32, [Build iTALC for Win32])
-AC_ARG_WITH(linux,
-	[  --with-linux		explicit build iTALC for Linux], [ build_linux=true ], [ build_linux=false ])
-AC_ARG_WITH(win32,
-	[  --with-win32		explicit build iTALC for Win32], [ build_win32=true ], [ build_win32=false ])
-AC_MSG_CHECKING([platform to build for])
-
-EXTRAFLAGS="-g -O2 -Wall"
-if test "x$build_win32" = "xtrue" ; then
-	AC_MSG_RESULT([Win32, will enable support for it])
-	AC_DEFINE(BUILD_WIN32)
-	AC_DEFINE(WIN32)
-	build_linux="false"
-	build_win32="true"
-else
-	EXTRAFLAGS="$EXTRAFLAGS -fPIC"
-
-	if test `uname -s | tr -s 'LINUX' 'linux'` = "linux" -o "x$build_linux" = "xtrue" ; then
-		AC_MSG_RESULT([Linux, will enable support for it])
-		AC_DEFINE(BUILD_LINUX)
-		build_linux="true"
-		build_win32="false"
-	fi
-fi
-
-CFLAGS="$CFLAGS $EXTRAFLAGS"
-CXXFLAGS="$CXXFLAGS $EXTRAFLAGS"
-
-AM_CONDITIONAL(BUILD_WIN32, test "$build_win32" = "true")
-AM_CONDITIONAL(BUILD_LINUX, test "$build_linux" = "true")
-
-
-AH_TEMPLATE(ENABLE_DEBUG, [enable debugging])
-AC_ARG_ENABLE(debug,
-	[  --enable-debug		enable debugging], [ enable_debug=true ], [ enable_debug=false ])
-AM_CONDITIONAL(DEBUG, test "$enable_debug" = "true")
-
-
-AH_TEMPLATE(WITH_TIGHTVNC_FILETRANSFER, [Disable TightVNCFileTransfer protocol])
-
-HAVE_X="false"
-AC_PATH_XTRA
-gw_CHECK_QT
-AH_TEMPLATE(HAVE_X11, [X11 build environment present])
-AH_TEMPLATE(HAVE_XSHM, [MIT-SHM extension build environment present])
-AH_TEMPLATE(HAVE_XTEST, [XTEST extension build environment present])
-AH_TEMPLATE(HAVE_XTESTGRABCONTROL, [XTEST extension has XTestGrabControl])
-AH_TEMPLATE(HAVE_XKEYBOARD, [XKEYBOARD extension build environment present])
-AH_TEMPLATE(HAVE_LIBXINERAMA, [XINERAMA extension build environment present])
-AH_TEMPLATE(HAVE_LIBXRANDR, [XRANDR extension build environment present])
-AH_TEMPLATE(HAVE_LIBXFIXES, [XFIXES extension build environment present])
-AH_TEMPLATE(HAVE_LIBXDAMAGE, [XDAMAGE extension build environment present])
-AH_TEMPLATE(HAVE_LIBXTRAP, [DEC-XTRAP extension build environment present])
-AH_TEMPLATE(HAVE_RECORD, [RECORD extension build environment present])
-AH_TEMPLATE(HAVE_SOLARIS_XREADSCREEN, [Solaris XReadScreen available])
-AH_TEMPLATE(HAVE_IRIX_XREADDISPLAY, [IRIX XReadDisplay available])
-AH_TEMPLATE(HAVE_FBPM, [FBPM extension build environment present])
-AH_TEMPLATE(HAVE_DPMS, [DPMS extension build environment present])
-AH_TEMPLATE(HAVE_LINUX_VIDEODEV_H, [video4linux build environment present])
-AH_TEMPLATE(HAVE_LINUX_FB_H, [linux fb device build environment present])
-AH_TEMPLATE(HAVE_LINUX_INPUT_H, [linux/input.h present])
-AH_TEMPLATE(HAVE_LINUX_UINPUT_H, [linux uinput device build environment present])
-AH_TEMPLATE(HAVE_MACOSX_NATIVE_DISPLAY, [build MacOS X native display support])
-
-AC_ARG_WITH(xkeyboard,
-[  --without-xkeyboard     disable xkeyboard extension support],,)
-AC_ARG_WITH(xinerama,
-[  --without-xinerama      disable xinerama extension support],,)
-AC_ARG_WITH(xrandr,
-[  --without-xrandr        disable xrandr extension support],,)
-AC_ARG_WITH(xfixes,
-[  --without-xfixes        disable xfixes extension support],,)
-AC_ARG_WITH(xdamage,
-[  --without-xdamage       disable xdamage extension support],,)
-AC_ARG_WITH(xtrap,
-[  --without-xtrap         disable xtrap extension support],,)
-AC_ARG_WITH(xrecord,
-[  --without-xrecord       disable xrecord extension support],,)
-AC_ARG_WITH(fbpm,
-[  --without-fbpm          disable fbpm extension support],,)
-AC_ARG_WITH(dpms,
-[  --without-dpms          disable dpms extension support],,)
-AC_ARG_WITH(v4l,
-[  --without-v4l           disable video4linux support],,)
-AC_ARG_WITH(fbdev,
-[  --without-fbdev         disable linux fb device support],,)
-AC_ARG_WITH(uinput,
-[  --without-uinput        disable linux uinput device support],,)
-AC_ARG_WITH(macosx-native,
-[  --without-macosx-native disable MacOS X native display support],,)
-
-if test "x$with_x" = "xno"; then
-	HAVE_X="false"
-elif test "$X_CFLAGS" != "-DX_DISPLAY_MISSING"; then
-	AC_CHECK_LIB(X11, XGetImage, [AC_DEFINE(HAVE_X11) HAVE_X="true"],
-		HAVE_X="false",
-		$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-
-	if test $HAVE_X = "true"; then
-		X_PRELIBS="$X_PRELIBS -lXext"
-
-		AC_CHECK_LIB(Xext, XShmGetImage, 
-			[AC_DEFINE(HAVE_XSHM)], ,
-			$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-
-		AC_CHECK_LIB(Xext, XReadScreen, 
-			[AC_DEFINE(HAVE_SOLARIS_XREADSCREEN)], ,
-			$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-
-		AC_CHECK_HEADER(X11/extensions/readdisplay.h,
-			[AC_DEFINE(HAVE_IRIX_XREADDISPLAY)], ,
-			[#include <X11/Xlib.h>])
-
-		if test "x$with_fbpm" != "xno"; then
-			AC_CHECK_LIB(Xext, FBPMForceLevel, 
-				[AC_DEFINE(HAVE_FBPM)], ,
-				$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-		fi
-
-		if test "x$with_dpms" != "xno"; then
-			AC_CHECK_LIB(Xext, DPMSForceLevel, 
-				[AC_DEFINE(HAVE_DPMS)], ,
-				$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-		fi
-
-		AC_CHECK_LIB(Xtst, XTestGrabControl, 
-			X_PRELIBS="-lXtst $X_PRELIBS"
-			[AC_DEFINE(HAVE_XTESTGRABCONTROL) HAVE_XTESTGRABCONTROL="true"], ,
-			$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-
-		AC_CHECK_LIB(Xtst, XTestFakeKeyEvent, 
-			X_PRELIBS="-lXtst $X_PRELIBS"
-			[AC_DEFINE(HAVE_XTEST) HAVE_XTEST="true"], ,
-			$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-
-		if test "x$with_xrecord" != "xno"; then
-			AC_CHECK_LIB(Xtst, XRecordEnableContextAsync, 
-				X_PRELIBS="-lXtst $X_PRELIBS"
-				[AC_DEFINE(HAVE_RECORD)], ,
-				$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-		fi
-
-		# we use XTRAP on X11R5, or user can set X11VNC_USE_XTRAP
-		if test "x$with_xtrap" != "xno"; then
-		    if test ! -z "$X11VNC_USE_XTRAP" -o -z "$HAVE_XTESTGRABCONTROL"; then
-			AC_CHECK_LIB(XTrap, XETrapSetGrabServer, 
-				X_PRELIBS="$X_PRELIBS -lXTrap"
-				[AC_DEFINE(HAVE_LIBXTRAP)], ,
-				$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-			# tru64 uses libXETrap.so
-			AC_CHECK_LIB(XETrap, XETrapSetGrabServer, 
-				X_PRELIBS="$X_PRELIBS -lXETrap"
-				[AC_DEFINE(HAVE_LIBXTRAP)], ,
-				$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-		    fi
-		fi
-
-		if test "x$with_xkeyboard" != "xno"; then
-			saved_CPPFLAGS="$CPPFLAGS"
-			CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-			AC_CHECK_HEADER(X11/XKBlib.h, HAVE_XKBLIB_H="true",
-				HAVE_XKBLIB_H="false", [#include <X11/Xlib.h>])
-			CPPFLAGS="$saved_CPPFLAGS"
-			if test $HAVE_XKBLIB_H = "true"; then
-				AC_CHECK_LIB(X11, XkbSelectEvents,
-					[AC_DEFINE(HAVE_XKEYBOARD)], ,
-					$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-			fi
-		fi
-
-		if test "x$with_xinerama" != "xno"; then
-			AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
-				X_PRELIBS="$X_PRELIBS -lXinerama"
-				[AC_DEFINE(HAVE_LIBXINERAMA)], ,
-				$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-		fi
-
-		if test "x$with_xrandr" != "xno"; then
-			AC_CHECK_LIB(Xrandr, XRRSelectInput,
-				X_PRELIBS="$X_PRELIBS -lXrandr"
-				[AC_DEFINE(HAVE_LIBXRANDR)], ,
-				$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-		fi
-
-		if test "x$with_xfixes" != "xno"; then
-			AC_CHECK_LIB(Xfixes, XFixesGetCursorImage,
-				X_PRELIBS="$X_PRELIBS -lXfixes"
-				[AC_DEFINE(HAVE_LIBXFIXES) HAVE_LIBXFIXES="true"], ,
-				$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-		fi
-
-		if test "x$with_xdamage" != "xno"; then
-			AC_CHECK_LIB(Xdamage, XDamageQueryExtension,
-				X_PRELIBS="$X_PRELIBS -lXdamage"
-				[AC_DEFINE(HAVE_LIBXDAMAGE) HAVE_LIBXDAMAGE="true"], ,
-				$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS)
-		fi
-
-		if test ! -z "$HAVE_LIBXFIXES" -o ! -z "$HAVE_LIBXDAMAGE"; then
-			# need /usr/sfw/lib in RPATH for Solaris 10 and later
-			case `(uname -sr) 2>/dev/null` in
-			"SunOS 5"*) X_EXTRA_LIBS="$X_EXTRA_LIBS -R/usr/sfw/lib" ;;
-			esac
-		fi
-
-		# currently only x11vnc uses crypt() or libssl:
-		AH_TEMPLATE(HAVE_LIBCRYPT, [libcrypt library present])
-		AC_ARG_WITH(crypt,
-		[  --without-crypt         disable support for libcrypt],,)
-		if test "x$with_crypt" != "xno"; then
-			AC_CHECK_FUNCS([crypt], HAVE_LIBC_CRYPT="true")
-			if test -z "$HAVE_LIBC_CRYPT"; then
-				AC_CHECK_LIB(crypt, crypt,
-					X_PRELIBS="$X_PRELIBS -lcrypt"
-					[AC_DEFINE(HAVE_LIBCRYPT)], ,)
-			fi
-		fi
-
-		X_LIBS="$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS"
-	fi
-fi
-
-AC_SUBST(X_LIBS)
-AM_CONDITIONAL(HAVE_X, test $HAVE_X != "false")
-
-if test "$build_win32" != "true" -a "x$HAVE_X" = "xfalse" -a "x$with_x" != "xno"; then
-	AC_MSG_ERROR([
-==========================================================================
-A working X window system build environment is required to build iTALC.
-Make sure any required X development packages are installed.  If they are
-installed in non-standard locations, one can use the --x-includes=DIR
-and --x-libraries=DIR configure options or set the CPPFLAGS and LDFLAGS
-environment variables to indicate where the X window system header files
-and libraries may be found.  On 64+32 bit machines you may need to point
-to lib64 or lib32 directories to pick up the correct word size.
-
-If you want to build iTALC without X support (e.g. for -rawfb use only
-or for native Mac OS X), specify the --without-x configure option.
-==========================================================================
-])
-fi
-
-if test "$build_win32" != "true" -a "x$HAVE_X" = "xtrue" -a "x$HAVE_XTEST" != "xtrue"; then
-	AC_MSG_ERROR([
-==========================================================================
-A working build environment for the XTEST extension was not found (libXtst).
-An iTALC 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.
-==========================================================================
-])
-fi
-
-if test "x$with_v4l" != "xno"; then
-	AC_CHECK_HEADER(linux/videodev.h,
-		[AC_DEFINE(HAVE_LINUX_VIDEODEV_H)],,)
-fi
-
-if test "x$with_fbdev" != "xno"; then
-	AC_CHECK_HEADER(linux/fb.h,
-		[AC_DEFINE(HAVE_LINUX_FB_H)],,)
-fi
-
-if test "x$with_uinput" != "xno"; then
-	AC_CHECK_HEADER(linux/input.h,
-		[AC_DEFINE(HAVE_LINUX_INPUT_H) HAVE_LINUX_INPUT_H="true"],,)
-	if test "x$HAVE_LINUX_INPUT_H" = "xtrue"; then
-		AC_CHECK_HEADER(linux/uinput.h,
-			[AC_DEFINE(HAVE_LINUX_UINPUT_H)],, [#include <linux/input.h>])
-	fi
-fi
-
-if test "x$with_macosx_native" != "xno"; then
-	AC_DEFINE(HAVE_MACOSX_NATIVE_DISPLAY)
-fi
-
-
-
-AH_TEMPLATE(HAVE_AVAHI, [Avahi/mDNS client build environment present])
-#AC_ARG_WITH(avahi,
-#[  --without-avahi         disable support for Avahi/mDNS]
-#[  --with-avahi=DIR        use avahi include/library files in DIR],,)
-#if test "x$with_avahi" != "xno"; then
-#	printf "checking for avahi... "
-#	if test ! -z "$with_avahi" -a "x$with_avahi" != "xyes"; then
-#		AVAHI_CFLAGS="-I$with_avahi/include"
-#		AVAHI_LIBS="-L$with_avahi/lib -lavahi-common -lavahi-client"
-#		echo "using $with_avahi"
-#		with_avahi=yes
-#	elif pkg-config --atleast-version=0.6.4 avahi-client >/dev/null 2>&1; then
-#		AVAHI_CFLAGS=`pkg-config --cflags avahi-client`
-#		AVAHI_LIBS=`pkg-config --libs avahi-client`
-#		with_avahi=yes
-#		echo yes
-#	else
-#		with_avahi=no
-#		echo no
-#	fi
-#fi
-#if test "x$with_avahi" = "xyes"; then
-#	AC_DEFINE(HAVE_AVAHI)
-#	AC_SUBST(AVAHI_CFLAGS)
-#	AC_SUBST(AVAHI_LIBS)
-#fi
-
-
-
-# Checks for libraries and header files
-AH_TEMPLATE(HAVE_ZLIB_H, [Define to 1 if you have zlib.h header file.])
-AH_TEMPLATE(HAVE_JPEGLIB_H, [Define to 1 if you have jpeglib.h header file.])
-AH_TEMPLATE(HAVE_DSA_H, [Define to 1 if you have the openssl/dsa.h header file.])
-AH_TEMPLATE(HAVE_LIBZ, [libz present])
-AH_TEMPLATE(HAVE_LIBJPEG, [libjpeg present])
-AH_TEMPLATE(HAVE_LIBSSL, [openssl libssl present])
-
-AC_CHECK_HEADER(zlib.h, HAVE_ZLIB_H="true")
-AC_CHECK_HEADER(jpeglib.h, HAVE_JPEGLIB_H="true")
-AC_CHECK_HEADER(openssl/dsa.h, HAVE_DSA_H="true")
-
-
-AC_CHECK_LIB(z, deflate, HAVE_LIBZ="true", HAVE_ZLIB_H="")
-AC_CHECK_LIB(jpeg, jpeg_CreateCompress, HAVE_LIBJPEG="true", HAVE_JPEGLIB_H="")
-AC_CHECK_LIB(ssl, SSL_library_init, HAVE_LIBSSL="true")
-AC_CHECK_LIB(crypto, RAND_file_name, HAVE_LIBCRYPTO="true")
-AC_CHECK_LIB(eay32, DSA_new, HAVE_LIBEAY32="true")
-if test \( -z "$HAVE_LIBSSL" -o -z "$HAVE_LIBCRYPTO" \) -a \( -z "$HAVE_LIBEAY32" \) ; then
-	HAVE_DSA_H=""
-fi
-
-
-if test -z "$HAVE_ZLIB_H" ; then
-	AC_MSG_ERROR([*** you do not have installed libz and/or development-files are missing!])
-fi
-
-if test -z "$HAVE_JPEGLIB_H" ; then
-	AC_MSG_ERROR([*** you do not have installed libjpeg and/or development-files are missing!])
-fi
-
-if test -z "$HAVE_DSA_H" ; then
-	AC_MSG_ERROR([*** you do not have installed the OpenSSL-library and/or development-files are missing!])
-fi
-
-AC_DEFINE(HAVE_LIBZ)
-AC_DEFINE(HAVE_ZLIB_H)
-AC_DEFINE(HAVE_LIBJPEG)
-AC_DEFINE(HAVE_JPEGLIB_H)
-AC_DEFINE(HAVE_LIBSSL)
-AC_DEFINE(HAVE_DSA_H)
-
-AC_ARG_WITH(pthread,
-[  --without-pthread       disable support for libpthread],,)
-
-if test "x$with_pthread" != "xno"; then
-	AC_CHECK_HEADER(pthread.h, HAVE_PTHREAD_H="true")
-	if test ! -z "$HAVE_PTHREAD_H"; then
-		AC_CHECK_LIB(pthread, pthread_mutex_lock)
-		AC_CHECK_LIB(pthread, pthread_mutex_lock, HAVE_LIBPTHREAD="true")
-	fi
-fi
-
-
-AM_CONDITIONAL(HAVE_LIBZ, test ! -z "$HAVE_ZLIB_H")
-AM_CONDITIONAL(HAVE_LIBJPEG, test ! -z "$HAVE_LIBJPEG")
-AM_CONDITIONAL(HAVE_LIBSSL, test -n "$HAVE_LIBSSL" -a -n "$HAVE_LIBCRYPTO")
-AM_CONDITIONAL(HAVE_LIBEAY32, test ! -z "$HAVE_LIBEAY32")
-AM_CONDITIONAL(HAVE_LIBPTHREAD, test ! -z "$HAVE_LIBPTHREAD")
-
-
-
-# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h memory.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h sys/timeb.h syslog.h unistd.h pwd.h sys/types.h utmpx.h sys/wait.h time.h errno.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_HEADER_STDBOOL
-AC_C_CONST
-AC_C_INLINE
-AC_C_BIGENDIAN
-AC_CHECK_TYPE(ptrdiff_t,long)
-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)
-AC_TYPE_SIZE_T
-AC_HEADER_SYS_WAIT
-AC_TYPE_SOCKLEN_T
-AC_HEADER_TIME
-AC_TYPE_OFF_T
-AC_CREATE_STDINT_H(lib/include/rfb/rfbint.h)
-AC_CACHE_CHECK([for in_addr_t],
-        _cv_inaddrt, [
-                AC_TRY_COMPILE([#include <sys/types.h>
-#include <netinet/in.h>],
-                        [in_addr_t foo; return 0;],
-                                        [_cv_inaddrt=yes],
-                                        [_cv_inaddrt=no]),
-        ])
-AH_TEMPLATE(NEED_INADDR_T, [Need a typedef for in_addr_t])
-if test $_cv_inaddrt = no ; then
-  AC_DEFINE(NEED_INADDR_T)
-fi
-
-
-# Checks for library functions.
-AC_FUNC_MEMCMP
-AC_FUNC_STAT
-AC_FUNC_STRFTIME
-AC_FUNC_VPRINTF
-AC_FUNC_FORK
-
-AC_CHECK_LIB(nsl,gethostbyname)
-AC_CHECK_LIB(socket,socket)
-AC_CHECK_FUNCS([ftime mkfifo dup2 floor gethostbyname gethostname gettimeofday inet_ntoa memcmp memmove memcpy memset mmap pow putenv select socket strchr strdup strerror strpbrk strrchr strstr uname setsid getpwuid getpwnam getuid geteuid waitpid setutxent setpgrp seteuid grantpt getspnam initgroups])
-
-# check, if shmget is in cygipc.a
-AC_CHECK_LIB(cygipc,shmget)
-AM_CONDITIONAL(CYGIPC, test "$HAVE_CYGIPC" = "true")
-
-# Check if /dev/vcsa1 exists, if so, define LINUX
-AM_CONDITIONAL(LINUX, test -c /dev/vcsa1)
-
-# Check for OS X specific header
-AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h, HAVE_OSX="true")
-AM_CONDITIONAL(OSX, test "$HAVE_OSX" = "true")
-
-# Check for OS X specific header
-AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h, HAVE_OSX="true")
-AM_CONDITIONAL(OSX, test "$HAVE_OSX" = "true")
-
-# On Solaris 2.7, write() returns ENOENT when it really means EAGAIN
-AH_TEMPLATE(ENOENT_WORKAROUND, [work around when write() returns ENOENT but does not mean it])
-case `(uname -sr) 2>/dev/null` in
-    "SunOS 5.7")
-	AC_DEFINE(ENOENT_WORKAROUND)
-    ;;
-esac
-
-uname_s=`(uname -s) 2>/dev/null`
-if test "x$uname_s" = "xHP-UX"; then
-	# need -lsec for getspnam()
-	LDFLAGS="$LDFLAGS -lsec"
-fi
-
-# Check for rpm SOURCES path
-echo -n "checking for rpm sources path... "
-RPMSOURCEDIR="NOT-FOUND"
-for directory in packages OpenLinux redhat RedHat rpm RPM "" ; do
-	if test -d /usr/src/${directory}/SOURCES; then
-		RPMSOURCEDIR="/usr/src/${directory}/SOURCES/"
-	fi
-done
-echo "$RPMSOURCEDIR"
-AM_CONDITIONAL(HAVE_RPM, test "$RPMSOURCEDIR" != "NOT-FOUND")
-AC_SUBST(RPMSOURCEDIR)
-
-docdir="$datadir/$PACKAGE/doc"
-AC_SUBST(docdir)
-
-#AC_CONFIG_SUBDIRS(lupus)
-
-AC_CONFIG_FILES([Makefile
-		 italc.spec
-		 iTALC.nsi
-		 lib/Makefile
-		 ica/Makefile
-		 ima/Makefile
-		 ima/data/italc
-		 ima/data/italc.desktop
-		 setup/Makefile
-		 ica/ica.rc
-		 ima/italc.rc
-		 setup/setup.rc
-		 ])
-AC_OUTPUT
-
-echo
-echo
-echo " ============================="
-echo " ===  iTALC - INFORMATION  ==================================================="
-echo " ============================="
-echo " ="
-echo " = iTALC was configured successfully! Now try to build it by typing"
-echo " = 'make' and wait until it is finished."
-echo " = Then either install iTALC by typing 'make install' or copy the binaries by"
-echo " = hand as described in INSTALL."
-echo " ="
-echo " = If there're any problems, please contact an iTALC-developer (see AUTHORS)"
-echo " ="
-echo
-
diff --git a/contrib/README.txt b/contrib/README.txt
new file mode 100644
index 0000000..6494e18
--- /dev/null
+++ b/contrib/README.txt
@@ -0,0 +1,28 @@
+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
new file mode 100644
index 0000000..65506cf
--- /dev/null
+++ b/contrib/en-US/italc.adml
@@ -0,0 +1,198 @@
+<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
new file mode 100644
index 0000000..59359ff
--- /dev/null
+++ b/contrib/italc.admx
@@ -0,0 +1,327 @@
+<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/depcomp b/depcomp
deleted file mode 100755
index df8eea7..0000000
--- a/depcomp
+++ /dev/null
@@ -1,630 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2009-04-28.21; # UTC
-
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
-# Software Foundation, Inc.
-
-# 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, 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, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
-
-case $1 in
-  '')
-     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
-     exit 1;
-     ;;
-  -h | --h*)
-    cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
-  depmode     Dependency tracking mode.
-  source      Source file read by `PROGRAMS ARGS'.
-  object      Object file output by `PROGRAMS ARGS'.
-  DEPDIR      directory where to store dependencies.
-  depfile     Dependency file to output.
-  tmpdepfile  Temporary file to use when outputing dependencies.
-  libtool     Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake at gnu.org>.
-EOF
-    exit $?
-    ;;
-  -v | --v*)
-    echo "depcomp $scriptversion"
-    exit $?
-    ;;
-esac
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
-  echo "depcomp: Variables source, object and depmode must be set" 1>&2
-  exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
-  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Some modes work just like other modes, but use different flags.  We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write.  Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
-  # HP compiler uses -M and no extra arg.
-  gccflag=-M
-  depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
-   # This is just like dashmstdout with a different argument.
-   dashmflag=-xM
-   depmode=dashmstdout
-fi
-
-cygpath_u="cygpath -u -f -"
-if test "$depmode" = msvcmsys; then
-   # This is just like msvisualcpp but w/o cygpath translation.
-   # Just convert the backslash-escaped backslashes to single forward
-   # slashes to satisfy depend.m4
-   cygpath_u="sed s,\\\\\\\\,/,g"
-   depmode=msvisualcpp
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff.  Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am.  Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
-  for arg
-  do
-    case $arg in
-    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
-    *)  set fnord "$@" "$arg" ;;
-    esac
-    shift # fnord
-    shift # $arg
-  done
-  "$@"
-  stat=$?
-  if test $stat -eq 0; then :
-  else
-    rm -f "$tmpdepfile"
-    exit $stat
-  fi
-  mv "$tmpdepfile" "$depfile"
-  ;;
-
-gcc)
-## There are various ways to get dependency output from gcc.  Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-##   up in a subdir.  Having to rename by hand is ugly.
-##   (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-##   -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-##   than renaming).
-  if test -z "$gccflag"; then
-    gccflag=-MD,
-  fi
-  "$@" -Wp,"$gccflag$tmpdepfile"
-  stat=$?
-  if test $stat -eq 0; then :
-  else
-    rm -f "$tmpdepfile"
-    exit $stat
-  fi
-  rm -f "$depfile"
-  echo "$object : \\" > "$depfile"
-  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
-  sed -e 's/^[^:]*: / /' \
-      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header).  We avoid this by adding
-## dummy dependencies for each header file.  Too bad gcc doesn't do
-## this for us directly.
-  tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'.  On the theory
-## that the space means something, we add a space to the output as
-## well.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-hp)
-  # This case exists only to let depend.m4 do its work.  It works by
-  # looking at the text of this script.  This case will never be run,
-  # since it is checked for above.
-  exit 1
-  ;;
-
-sgi)
-  if test "$libtool" = yes; then
-    "$@" "-Wp,-MDupdate,$tmpdepfile"
-  else
-    "$@" -MDupdate "$tmpdepfile"
-  fi
-  stat=$?
-  if test $stat -eq 0; then :
-  else
-    rm -f "$tmpdepfile"
-    exit $stat
-  fi
-  rm -f "$depfile"
-
-  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
-    echo "$object : \\" > "$depfile"
-
-    # Clip off the initial element (the dependent).  Don't try to be
-    # clever and replace this with sed code, as IRIX sed won't handle
-    # lines with more than a fixed number of characters (4096 in
-    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
-    # the IRIX cc adds comments like `#:fec' to the end of the
-    # dependency line.
-    tr ' ' '
-' < "$tmpdepfile" \
-    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
-    tr '
-' ' ' >> "$depfile"
-    echo >> "$depfile"
-
-    # The second pass generates a dummy entry for each header file.
-    tr ' ' '
-' < "$tmpdepfile" \
-   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> "$depfile"
-  else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
-  fi
-  rm -f "$tmpdepfile"
-  ;;
-
-aix)
-  # The C for AIX Compiler uses -M and outputs the dependencies
-  # in a .u file.  In older versions, this file always lives in the
-  # current directory.  Also, the AIX compiler puts `$object:' at the
-  # start of each line; $object doesn't have directory information.
-  # Version 6 uses the directory in both cases.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-  if test "$libtool" = yes; then
-    tmpdepfile1=$dir$base.u
-    tmpdepfile2=$base.u
-    tmpdepfile3=$dir.libs/$base.u
-    "$@" -Wc,-M
-  else
-    tmpdepfile1=$dir$base.u
-    tmpdepfile2=$dir$base.u
-    tmpdepfile3=$dir$base.u
-    "$@" -M
-  fi
-  stat=$?
-
-  if test $stat -eq 0; then :
-  else
-    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
-    exit $stat
-  fi
-
-  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
-  do
-    test -f "$tmpdepfile" && break
-  done
-  if test -f "$tmpdepfile"; then
-    # Each line is of the form `foo.o: dependent.h'.
-    # Do two passes, one to just change these to
-    # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-    # That's a tab and a space in the [].
-    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-  else
-    # The sourcefile does not contain any dependencies, so just
-    # store a dummy comment line, to avoid errors with the Makefile
-    # "include basename.Plo" scheme.
-    echo "#dummy" > "$depfile"
-  fi
-  rm -f "$tmpdepfile"
-  ;;
-
-icc)
-  # Intel's C compiler understands `-MD -MF file'.  However on
-  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
-  # ICC 7.0 will fill foo.d with something like
-  #    foo.o: sub/foo.c
-  #    foo.o: sub/foo.h
-  # which is wrong.  We want:
-  #    sub/foo.o: sub/foo.c
-  #    sub/foo.o: sub/foo.h
-  #    sub/foo.c:
-  #    sub/foo.h:
-  # ICC 7.1 will output
-  #    foo.o: sub/foo.c sub/foo.h
-  # and will wrap long lines using \ :
-  #    foo.o: sub/foo.c ... \
-  #     sub/foo.h ... \
-  #     ...
-
-  "$@" -MD -MF "$tmpdepfile"
-  stat=$?
-  if test $stat -eq 0; then :
-  else
-    rm -f "$tmpdepfile"
-    exit $stat
-  fi
-  rm -f "$depfile"
-  # Each line is of the form `foo.o: dependent.h',
-  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
-  # Do two passes, one to just change these to
-  # `$object: dependent.h' and one to simply `dependent.h:'.
-  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
-  # Some versions of the HPUX 10.20 sed can't process this invocation
-  # correctly.  Breaking it into two sed invocations is a workaround.
-  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
-    sed -e 's/$/ :/' >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-hp2)
-  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
-  # compilers, which have integrated preprocessors.  The correct option
-  # to use with these is +Maked; it writes dependencies to a file named
-  # 'foo.d', which lands next to the object file, wherever that
-  # happens to be.
-  # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-  if test "$libtool" = yes; then
-    tmpdepfile1=$dir$base.d
-    tmpdepfile2=$dir.libs/$base.d
-    "$@" -Wc,+Maked
-  else
-    tmpdepfile1=$dir$base.d
-    tmpdepfile2=$dir$base.d
-    "$@" +Maked
-  fi
-  stat=$?
-  if test $stat -eq 0; then :
-  else
-     rm -f "$tmpdepfile1" "$tmpdepfile2"
-     exit $stat
-  fi
-
-  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
-  do
-    test -f "$tmpdepfile" && break
-  done
-  if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
-    sed -ne '2,${
-	       s/^ *//
-	       s/ \\*$//
-	       s/$/:/
-	       p
-	     }' "$tmpdepfile" >> "$depfile"
-  else
-    echo "#dummy" > "$depfile"
-  fi
-  rm -f "$tmpdepfile" "$tmpdepfile2"
-  ;;
-
-tru64)
-   # The Tru64 compiler uses -MD to generate dependencies as a side
-   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
-   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
-   # dependencies in `foo.d' instead, so we check for that too.
-   # Subdirectories are respected.
-   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-   test "x$dir" = "x$object" && dir=
-   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
-   if test "$libtool" = yes; then
-      # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
-      # handle both shared and static libraries in a single compilation.
-      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
-      #
-      # With libtool 1.5 this exception was removed, and libtool now
-      # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
-      # in $dir$base.o.d.  We have to check for both files, because
-      # one of the two compilations can be disabled.  We should prefer
-      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
-      # automatically cleaned when .libs/ is deleted, while ignoring
-      # the former would cause a distcleancheck panic.
-      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
-      tmpdepfile2=$dir$base.o.d          # libtool 1.5
-      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
-      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
-      "$@" -Wc,-MD
-   else
-      tmpdepfile1=$dir$base.o.d
-      tmpdepfile2=$dir$base.d
-      tmpdepfile3=$dir$base.d
-      tmpdepfile4=$dir$base.d
-      "$@" -MD
-   fi
-
-   stat=$?
-   if test $stat -eq 0; then :
-   else
-      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-      exit $stat
-   fi
-
-   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
-   do
-     test -f "$tmpdepfile" && break
-   done
-   if test -f "$tmpdepfile"; then
-      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
-      # That's a tab and a space in the [].
-      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
-   else
-      echo "#dummy" > "$depfile"
-   fi
-   rm -f "$tmpdepfile"
-   ;;
-
-#nosideeffect)
-  # This comment above is used by automake to tell side-effect
-  # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
-  # Important note: in order to support this mode, a compiler *must*
-  # always write the preprocessed file to stdout, regardless of -o.
-  "$@" || exit $?
-
-  # Remove the call to Libtool.
-  if test "$libtool" = yes; then
-    while test "X$1" != 'X--mode=compile'; do
-      shift
-    done
-    shift
-  fi
-
-  # Remove `-o $object'.
-  IFS=" "
-  for arg
-  do
-    case $arg in
-    -o)
-      shift
-      ;;
-    $object)
-      shift
-      ;;
-    *)
-      set fnord "$@" "$arg"
-      shift # fnord
-      shift # $arg
-      ;;
-    esac
-  done
-
-  test -z "$dashmflag" && dashmflag=-M
-  # Require at least two characters before searching for `:'
-  # in the target name.  This is to cope with DOS-style filenames:
-  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
-  "$@" $dashmflag |
-    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
-  rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-dashXmstdout)
-  # This case only exists to satisfy depend.m4.  It is never actually
-  # run, as this mode is specially recognized in the preamble.
-  exit 1
-  ;;
-
-makedepend)
-  "$@" || exit $?
-  # Remove any Libtool call
-  if test "$libtool" = yes; then
-    while test "X$1" != 'X--mode=compile'; do
-      shift
-    done
-    shift
-  fi
-  # X makedepend
-  shift
-  cleared=no eat=no
-  for arg
-  do
-    case $cleared in
-    no)
-      set ""; shift
-      cleared=yes ;;
-    esac
-    if test $eat = yes; then
-      eat=no
-      continue
-    fi
-    case "$arg" in
-    -D*|-I*)
-      set fnord "$@" "$arg"; shift ;;
-    # Strip any option that makedepend may not understand.  Remove
-    # the object too, otherwise makedepend will parse it as a source file.
-    -arch)
-      eat=yes ;;
-    -*|$object)
-      ;;
-    *)
-      set fnord "$@" "$arg"; shift ;;
-    esac
-  done
-  obj_suffix=`echo "$object" | sed 's/^.*\././'`
-  touch "$tmpdepfile"
-  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
-  rm -f "$depfile"
-  cat < "$tmpdepfile" > "$depfile"
-  sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly.  Breaking it into two sed invocations is a workaround.
-    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
-  rm -f "$tmpdepfile" "$tmpdepfile".bak
-  ;;
-
-cpp)
-  # Important note: in order to support this mode, a compiler *must*
-  # always write the preprocessed file to stdout.
-  "$@" || exit $?
-
-  # Remove the call to Libtool.
-  if test "$libtool" = yes; then
-    while test "X$1" != 'X--mode=compile'; do
-      shift
-    done
-    shift
-  fi
-
-  # Remove `-o $object'.
-  IFS=" "
-  for arg
-  do
-    case $arg in
-    -o)
-      shift
-      ;;
-    $object)
-      shift
-      ;;
-    *)
-      set fnord "$@" "$arg"
-      shift # fnord
-      shift # $arg
-      ;;
-    esac
-  done
-
-  "$@" -E |
-    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
-    sed '$ s: \\$::' > "$tmpdepfile"
-  rm -f "$depfile"
-  echo "$object : \\" > "$depfile"
-  cat < "$tmpdepfile" >> "$depfile"
-  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-msvisualcpp)
-  # Important note: in order to support this mode, a compiler *must*
-  # always write the preprocessed file to stdout.
-  "$@" || exit $?
-
-  # Remove the call to Libtool.
-  if test "$libtool" = yes; then
-    while test "X$1" != 'X--mode=compile'; do
-      shift
-    done
-    shift
-  fi
-
-  IFS=" "
-  for arg
-  do
-    case "$arg" in
-    -o)
-      shift
-      ;;
-    $object)
-      shift
-      ;;
-    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
-	set fnord "$@"
-	shift
-	shift
-	;;
-    *)
-	set fnord "$@" "$arg"
-	shift
-	shift
-	;;
-    esac
-  done
-  "$@" -E 2>/dev/null |
-  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
-  rm -f "$depfile"
-  echo "$object : \\" > "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
-  echo "	" >> "$depfile"
-  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
-  rm -f "$tmpdepfile"
-  ;;
-
-msvcmsys)
-  # This case exists only to let depend.m4 do its work.  It works by
-  # looking at the text of this script.  This case will never be run,
-  # since it is checked for above.
-  exit 1
-  ;;
-
-none)
-  exec "$@"
-  ;;
-
-*)
-  echo "Unknown depmode $depmode" 1>&2
-  exit 1
-  ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/doc/AutomatedSetupWithIMC.txt b/doc/AutomatedSetupWithIMC.txt
new file mode 100644
index 0000000..547b596
--- /dev/null
+++ b/doc/AutomatedSetupWithIMC.txt
@@ -0,0 +1,49 @@
+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
+
+   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
new file mode 100644
index 0000000..42cde99
--- /dev/null
+++ b/doc/ControllingIMCAtTheCommandline.txt
@@ -0,0 +1,70 @@
+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
new file mode 100644
index 0000000..cf38da3
--- /dev/null
+++ b/doc/CrossCompilingForWindows.txt
@@ -0,0 +1,39 @@
+Cross compiling iTALC for Windows on Linux
+==========================================
+
+- Create an Ubuntu 10.04 installation, e.g. by using the netboot installer at
+
+    http://archive.ubuntu.com/ubuntu/dists/lucid/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 lucid 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-pthreads
+  * gcj
+
+- 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
new file mode 100644
index 0000000..cd48021
--- /dev/null
+++ b/doc/UsingPathVariables.txt
@@ -0,0 +1,30 @@
+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
index c7a5fcb..f8e3820 100644
--- a/iTALC.nsi.in
+++ b/iTALC.nsi.in
@@ -1,17 +1,12 @@
-############################################################################################
-#      NSIS Installation Script created by NSIS Quick Setup Script Generator v1.09.18
-#               Entirely Edited with NullSoft Scriptable Installation System
-#              by Vlasis K. Barkas aka Red Wine red_wine at freemail.gr Sep 2006
-############################################################################################
-
+!define DLLDIR "@MINGW_PREFIX@/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-2010"
+!define COPYRIGHT "© Tobias Doerffel 2004-2011"
 !define DESCRIPTION "Intelligent Teaching and Learning with Computers"
-!define LICENSE_TXT "COPYING"
-!define INSTALLER_NAME "italc-${VERSION}-setup.exe"
+!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"
@@ -31,12 +26,12 @@ VIAddVersionKey "FileVersion"  "${VERSION}"
 
 SetCompressor /SOLID Lzma
 Name "${APP_NAME}"
-Caption "${APP_NAME}"
+Caption "${APP_NAME} ${VERSION}"
 OutFile "${INSTALLER_NAME}"
-BrandingText "${APP_NAME}"
+BrandingText "${APP_NAME} ${VERSION}"
 XPStyle on
 InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
-InstallDir "$PROGRAMFILES\iTALC"
+InstallDir "$PROGRAMFILES64\iTALC"
 ShowInstDetails show
 
 ######################################################################
@@ -46,6 +41,11 @@ ShowInstDetails show
 !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"
@@ -70,8 +70,8 @@ ShowInstDetails show
 !insertmacro MUI_PAGE_INSTFILES
 
 !define MUI_FINISHPAGE_RUN
-!define MUI_FINISHPAGE_RUN_TEXT "Run key setup tool now"
-!define MUI_FINISHPAGE_RUN_FUNCTION "RunKeySetupTool"
+!define MUI_FINISHPAGE_RUN_TEXT "Run iTALC Management Console now"
+!define MUI_FINISHPAGE_RUN_FUNCTION "RunIMC"
 
 !insertmacro MUI_PAGE_FINISH
 
@@ -145,24 +145,36 @@ Section "iTALC Service"
 SectionIn RO
 ${INSTALL_TYPE}
 ExecWait '"$INSTDIR\ica.exe" -quiet -unregisterservice'
-SetOverwrite ifnewer
+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-8.dll"
+File "${DLLDIR}\libeay32.dll"
+File "${DLLDIR}\libssl32.dll"
+# core components
 File "italc-${VERSION}\ica.exe"
-File "italc-${VERSION}\zlib1.dll"
-File "italc-${VERSION}\libjpeg-8.dll"
-File "italc-${VERSION}\QtXml4.dll"
-File "italc-${VERSION}\libeay32.dll"
-File "italc-${VERSION}\QtNetwork4.dll"
-File "italc-${VERSION}\QtCore4.dll"
-File "italc-${VERSION}\libssl32.dll"
-File "italc-${VERSION}\LICENSE.TXT"
 File "italc-${VERSION}\vnchooks.dll"
-File "italc-${VERSION}\setup.exe"
+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"
-File "italc-${VERSION}\italc_core.dll"
-File "italc-${VERSION}\QtGui4.dll"
+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"
@@ -185,8 +197,8 @@ CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${MAIN_APP_EXE}"
 !endif
 SectionEnd
 
-Function RunKeySetupTool
-	Exec '"$INSTDIR\setup.exe"'
+Function RunIMC
+	Exec '"$INSTDIR\imc.exe"'
 FunctionEnd
 
 ######################################################################
@@ -198,7 +210,7 @@ WriteUninstaller "$INSTDIR\uninstall.exe"
 !ifdef REG_START_MENU
 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 CreateDirectory "$SMPROGRAMS\$SM_Folder"
-CreateShortCut "$SMPROGRAMS\$SM_Folder\iTALC Key Setup Tool.lnk" "$INSTDIR\setup.exe"
+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"
@@ -207,7 +219,7 @@ CreateShortCut "$SMPROGRAMS\$SM_Folder\iTALC Website.lnk" "$INSTDIR\iTALC websit
 
 !ifndef REG_START_MENU
 CreateDirectory "$SMPROGRAMS\iTALC"
-CreateShortCut "$SMPROGRAMS\iTALC\iTALC Key Setup Tool.lnk" "$INSTDIR\setup.exe"
+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"
@@ -226,6 +238,7 @@ 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
@@ -238,14 +251,17 @@ 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\setup.exe"
+Delete "$INSTDIR\imc.exe"
 Delete "$INSTDIR\italc.exe"
 Delete "$INSTDIR\README.TXT"
-Delete "$INSTDIR\italc_core.dll"
+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"
 
@@ -253,7 +269,7 @@ RmDir "$INSTDIR"
 !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 Key Setup Tool.lnk"
+Delete "$SMPROGRAMS\$SM_Folder\iTALC Management Console.lnk"
 Delete "$SMPROGRAMS\$SM_Folder\iTALC Website.lnk"
 Delete "$DESKTOP\iTALC.lnk"
 
@@ -262,7 +278,7 @@ RmDir "$SMPROGRAMS\$SM_Folder"
 
 !ifndef REG_START_MENU
 Delete "$SMPROGRAMS\iTALC\iTALC.lnk"
-Delete "$SMPROGRAMS\iTALC\iTALC Key Setup Tool.lnk"
+Delete "$SMPROGRAMS\iTALC\iTALC Management Console.lnk"
 Delete "$SMPROGRAMS\iTALC\Uninstall iTALC.lnk"
 Delete "$SMPROGRAMS\iTALC\iTALC Website.lnk"
 Delete "$DESKTOP\iTALC.lnk"
diff --git a/ica/CMakeLists.txt b/ica/CMakeLists.txt
new file mode 100644
index 0000000..9bcdbac
--- /dev/null
+++ b/ica/CMakeLists.txt
@@ -0,0 +1,187 @@
+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)
+	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
new file mode 100644
index 0000000..b36fc26
--- /dev/null
+++ b/ica/JavaViewer/AuthPanel.java
@@ -0,0 +1,166 @@
+//
+//  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
new file mode 100644
index 0000000..87d6285
--- /dev/null
+++ b/ica/JavaViewer/ButtonPanel.java
@@ -0,0 +1,172 @@
+//  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
new file mode 100644
index 0000000..16369d0
--- /dev/null
+++ b/ica/JavaViewer/ChangeLog
@@ -0,0 +1,44 @@
+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
new file mode 100644
index 0000000..70a4ca6
--- /dev/null
+++ b/ica/JavaViewer/ClipboardFrame.java
@@ -0,0 +1,133 @@
+//
+//  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
new file mode 100644
index 0000000..987d20d
--- /dev/null
+++ b/ica/JavaViewer/DH.java
@@ -0,0 +1,182 @@
+// 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
new file mode 100644
index 0000000..d753970
--- /dev/null
+++ b/ica/JavaViewer/DesCipher.java
@@ -0,0 +1,524 @@
+//
+// 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
new file mode 100644
index 0000000..03c23c4
--- /dev/null
+++ b/ica/JavaViewer/FTPFrame.java
@@ -0,0 +1,1344 @@
+// 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
new file mode 100644
index 0000000..71e95a1
--- /dev/null
+++ b/ica/JavaViewer/LICENCE.TXT
@@ -0,0 +1,340 @@
+		    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
new file mode 100644
index 0000000..4e87fdf
--- /dev/null
+++ b/ica/JavaViewer/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: VncViewer
+
diff --git a/ica/JavaViewer/OptionsFrame.java b/ica/JavaViewer/OptionsFrame.java
new file mode 100644
index 0000000..d7c41eb
--- /dev/null
+++ b/ica/JavaViewer/OptionsFrame.java
@@ -0,0 +1,398 @@
+//
+//  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
new file mode 100644
index 0000000..b6ab1d7
--- /dev/null
+++ b/ica/JavaViewer/README
@@ -0,0 +1,444 @@
+
+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
new file mode 100644
index 0000000..2da158d
--- /dev/null
+++ b/ica/JavaViewer/RecordingFrame.java
@@ -0,0 +1,309 @@
+//
+//  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
new file mode 100644
index 0000000..b5556e4
--- /dev/null
+++ b/ica/JavaViewer/RfbProto.java
@@ -0,0 +1,1935 @@
+//  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
new file mode 100644
index 0000000..b6a593d
--- /dev/null
+++ b/ica/JavaViewer/SessionRecorder.java
@@ -0,0 +1,193 @@
+//
+//  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
new file mode 100644
index 0000000..78562b6
--- /dev/null
+++ b/ica/JavaViewer/VncCanvas.java
@@ -0,0 +1,1698 @@
+//
+//  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
new file mode 100644
index 0000000..cb28a8a
--- /dev/null
+++ b/ica/JavaViewer/VncViewer.java
@@ -0,0 +1,994 @@
+
+//  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
new file mode 100644
index 0000000..cf383d6
--- /dev/null
+++ b/ica/JavaViewer/dir.mk
@@ -0,0 +1,20 @@
+#
+# 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
new file mode 100644
index 0000000..5392c8f
--- /dev/null
+++ b/ica/JavaViewer/hextile.vnc
@@ -0,0 +1,19 @@
+<!-- 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
new file mode 100644
index 0000000..614b774
--- /dev/null
+++ b/ica/JavaViewer/index.vnc
@@ -0,0 +1,16 @@
+<!-- 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
new file mode 100644
index 0000000..7bb682e
--- /dev/null
+++ b/ica/JavaViewer/mk.bat
@@ -0,0 +1,2 @@
+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
new file mode 100644
index 0000000..df145c7
--- /dev/null
+++ b/ica/JavaViewer/noshared.vnc
@@ -0,0 +1,17 @@
+<!-- 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
new file mode 100644
index 0000000..78b0653
--- /dev/null
+++ b/ica/JavaViewer/run.bat
@@ -0,0 +1 @@
+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
new file mode 100644
index 0000000..9e1b7ff
--- /dev/null
+++ b/ica/JavaViewer/runapplet.bat
@@ -0,0 +1,2 @@
+c:\sam\jdk1.3.1_15\bin\appletviewer.exe vncviewer.jar
+
diff --git a/ica/JavaViewer/shared.vnc b/ica/JavaViewer/shared.vnc
new file mode 100644
index 0000000..0b518b3
--- /dev/null
+++ b/ica/JavaViewer/shared.vnc
@@ -0,0 +1,17 @@
+<!-- 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
new file mode 100644
index 0000000..3dcbae1
--- /dev/null
+++ b/ica/JavaViewer/tight.vnc
@@ -0,0 +1,18 @@
+<!-- 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
new file mode 100644
index 0000000..991d375
--- /dev/null
+++ b/ica/JavaViewer/zlib.vnc
@@ -0,0 +1,18 @@
+<!-- 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/Makefile.am b/ica/Makefile.am
deleted file mode 100644
index 379064c..0000000
--- a/ica/Makefile.am
+++ /dev/null
@@ -1,259 +0,0 @@
-AUTOMAKE_OPTIONS = foreign
-
-bin_PROGRAMS = ica
-
-
-if BUILD_LINUX
-
-IVS_INCLUDES = -I$(srcdir)/x11 -I$(srcdir)/x11/x11vnc -I$(srcdir)/x11/libvncserver
-
-IVS_SRCS =	$(srcdir)/x11/x11vnc.c				\
-		$(srcdir)/x11/x11vnc/appshare.c			\
-		$(srcdir)/x11/libvncserver/auth.c		\
-		$(srcdir)/x11/libvncserver/cargs.c		\
-		$(srcdir)/x11/libvncserver/corre.c		\
-		$(srcdir)/x11/libvncserver/cursor.c		\
-		$(srcdir)/x11/libvncserver/cutpaste.c		\
-		$(srcdir)/x11/libvncserver/d3des.c		\
-		$(srcdir)/x11/libvncserver/draw.c		\
-		$(srcdir)/x11/libvncserver/font.c		\
-		$(srcdir)/x11/libvncserver/hextile.c		\
-		$(srcdir)/x11/libvncserver/httpd.c		\
-		$(srcdir)/x11/libvncserver/main.c		\
-		$(srcdir)/x11/libvncserver/rfbregion.c		\
-		$(srcdir)/x11/libvncserver/rfbserver.c		\
-		$(srcdir)/x11/libvncserver/rre.c		\
-		$(srcdir)/x11/libvncserver/scale.c		\
-		$(srcdir)/x11/libvncserver/selbox.c		\
-		$(srcdir)/x11/libvncserver/sockets.c		\
-		$(srcdir)/x11/libvncserver/stats.c		\
-		$(srcdir)/x11/libvncserver/translate.c		\
-		$(srcdir)/x11/libvncserver/ultra.c		\
-		$(srcdir)/x11/libvncserver/vncauth.c		\
-		$(srcdir)/x11/libvncserver/d3des.h		\
-		$(srcdir)/x11/libvncserver/private.h		\
-		$(srcdir)/x11/libvncserver/scale.h		\
-		$(srcdir)/x11/libvncserver/zrleoutstream.h	\
-		$(srcdir)/x11/libvncserver/zrlepalettehelper.h	\
-		$(srcdir)/x11/libvncserver/zrletypes.h		\
-		$(srcdir)/x11/libvncserver/zlib.c		\
-		$(srcdir)/x11/libvncserver/zrle.c		\
-		$(srcdir)/x11/libvncserver/zrleoutstream.c	\
-		$(srcdir)/x11/libvncserver/zrlepalettehelper.c	\
-		$(srcdir)/x11/libvncserver/tight.c		\
-		$(srcdir)/x11/rfb/rfbregion.h			\
-		$(srcdir)/x11/rfb/default8x16.h
-
-
-if HAVE_LIBPTHREAD
-PTHREADLDADD = -lpthread
-endif
-
-IVSLDADD = @X_LIBS@ $(PTHREADLDADD)
-
-
-else
-
-
-IVS_INCLUDES = -I$(srcdir)/win32 -I$(srcdir)/win32/src -I$(srcdir)/win32/src/omnithread -I$(srcdir)/win32/src/VNCHooks
-
-IVS_SRCS =	$(srcdir)/win32/win32vnc.cpp			\
-		$(srcdir)/win32/src/d3des_w32.c			\
-		$(srcdir)/win32/src/vncauth_w32.c		\
-		$(srcdir)/win32/src/vncEncodeZlib.cpp		\
-		$(srcdir)/win32/src/vncEncodeRRE.cpp		\
-		$(srcdir)/win32/src/vncEncodeTight.cpp		\
-		$(srcdir)/win32/src/vncEncodeCoRRE.cpp		\
-		$(srcdir)/win32/src/vncEncodeHexT.cpp
-
-
-IVSLDADD = -lkernel32 -lwsock32 -luser32 -lgdi32 -lpsapi -lnetapi32
-
-VNCHooks.o: $(srcdir)/win32/src/VNCHooks/VNCHooks.cpp
-	$(CXX) $(INCLUDES) $(AM_CXXFLAGS) $< -c -o $@
-
-SharedData.o: $(srcdir)/win32/src/VNCHooks/SharedData.cpp
-	$(CXX) $(INCLUDES) $(AM_CXXFLAGS) $< -c -o $@
-
-vnchooks.dll: VNCHooks.o SharedData.o
-	$(CXX) VNCHooks.o SharedData.o -shared -Wl,-no-undefined -Wl,-enable-runtime-pseudo-reloc -Wl,-enable-auto-image-base -Wl,--out-implib,libvnchooks.a -lgdi32 -o $@ && $(STRIP) $@
-
-endif
-
-
-if HAVE_LIBSSL
-LIBSSL_LDADD = -lssl -lcrypto
-endif
-
-if HAVE_LIBEAY32
-LIBSSL_LDADD = -leay32
-endif
-
-if BUILD_WIN32
-ica_win_resources.o: ica.rc vnchooks.dll
-	$(WINDRES) -o $@ $<
-
-WIN32_RES_LDADD = ica_win_resources.o -L. -lvnchooks
-endif
-
-ica_LDADD = $(QT_LDADD) $(QT_LIB_GUI) -lz -ljpeg $(LIBSSL_LDADD) $(IVSLDADD) $(WIN32_RES_LDADD) -L../lib -litalc_core
-ica_LDFLAGS = $(LDFLAGS) -mwindows -rpath $(pkglibdir)
-
-AM_CXXFLAGS = $(QT_CXXFLAGS) -O2 -DBUILD_ICA $(CXXFLAGS_ADD)
-AM_CFLAGS = -O2 -DBUILD_ICA -DVNCSHARED -DFOREVER -DNOREPEAT=0 -DNOPW=1 -DREMOTE_CONTROL=0 -DEXTERNAL_COMMANDS=0 -DFILEXFER=0 -DNOGUI -DSMALL_FOOTPRINT=1 -w
-
-INCLUDES = $(IVS_INCLUDES) -I$(srcdir)/../lib/include -I$(srcdir)/../lib/include/rfb -I$(srcdir)/src -I$(top_srcdir)
-
-
-
-%.moc: $(srcdir)/%.h
-	$(MOC) -o $@ $<
-
-
-ica_MOC =	src/isd_server.moc 			\
-		src/demo_server.moc			\
-		src/demo_client.moc
-
-
-./ica_qrc.cpp: ica.qrc
-	$(RCC) $< > $@
-
-
-ica_SOURCES =		$(srcdir)/src/ica_main.cpp		\
-			$(srcdir)/src/ivs.cpp			\
-			$(srcdir)/src/isd_server.cpp		\
-			$(srcdir)/src/local_system_ica.cpp	\
-			$(srcdir)/src/system_service.cpp	\
-			$(srcdir)/src/demo_server.cpp		\
-			$(srcdir)/src/demo_client.cpp		\
-			$(srcdir)/src/ivs.h			\
-			$(srcdir)/src/isd_server.h		\
-			$(srcdir)/src/local_system_ica.h	\
-			$(srcdir)/src/demo_server.h		\
-			$(srcdir)/src/demo_client.h		\
-			$(srcdir)/src/system_service.h		\
-			$(srcdir)/src/ica_main.h		\
-			$(srcdir)/ica.qrc			\
-			$(srcdir)/ica_qrc.cpp			\
-			$(wildcard $(srcdir)/resources/*)	\
-			$(IVS_SRCS)
-
-
-CLEANFILES = ./ica_qrc.cpp $(ica_MOC) vnchooks.dll libvnchooks.a
-BUILT_SOURCES = ./ica_qrc.cpp $(ica_MOC)
-
-
-man_MANS=ica.1
-
-
-EXTRA_DIST =	$(man_MANS)						\
-		$(srcdir)/x11/README					\
-		$(srcdir)/win32/README					\
-		$(srcdir)/x11/libvncclient/corre.c			\
-		$(srcdir)/x11/libvncclient/cursor.c			\
-		$(srcdir)/x11/libvncclient/tls.h			\
-		$(srcdir)/x11/libvncclient/tls.c			\
-		$(srcdir)/x11/libvncclient/listen.c			\
-		$(srcdir)/x11/libvncclient/rfbproto.c		\
-		$(srcdir)/x11/libvncclient/sockets.c		\
-		$(srcdir)/x11/libvncclient/vncviewer.c		\
-		$(srcdir)/x11/libvncclient/hextile.c		\
-		$(srcdir)/x11/libvncclient/minilzo.c		\
-		$(srcdir)/x11/libvncclient/rre.c			\
-		$(srcdir)/x11/libvncclient/tight.c			\
-		$(srcdir)/x11/libvncclient/ultra.c			\
-		$(srcdir)/x11/libvncclient/zlib.c			\
-		$(srcdir)/x11/libvncclient/zrle.c			\
-		$(srcdir)/x11/libvncserver/tableinit24.c		\
-		$(srcdir)/x11/libvncserver/tableinittctemplate.c	\
-		$(srcdir)/x11/libvncserver/tabletranstemplate.c		\
-		$(srcdir)/x11/libvncserver/tableinitcmtemplate.c	\
-		$(srcdir)/x11/libvncserver/tabletrans24template.c	\
-		$(srcdir)/x11/libvncserver/zrleencodetemplate.c		\
-		$(srcdir)/x11/libvncserver/zywrletemplate.c		\
-		$(srcdir)/x11/libvncserver/zlib.c			\
-		$(srcdir)/x11/libvncserver/zrle.c			\
-		$(srcdir)/x11/libvncserver/zrleoutstream.c		\
-		$(srcdir)/x11/libvncserver/zrlepalettehelper.c		\
-		$(srcdir)/x11/libvncserver/tight.c			\
-		$(wildcard $(srcdir)/x11/x11vnc/*)			\
-		$(srcdir)/win32/src/tableinitcmtemplate.cpp		\
-		$(srcdir)/win32/src/tabletranstemplate.cpp		\
-		$(srcdir)/win32/src/tableinittctemplate.cpp		\
-		$(srcdir)/win32/src/vncKeymap.cpp			\
-		$(srcdir)/win32/src/VSocket.cpp				\
-		$(srcdir)/win32/src/WinVNC.cpp				\
-		$(srcdir)/win32/src/VideoDriver.cpp			\
-		$(srcdir)/win32/src/vncService.cpp			\
-		$(srcdir)/win32/src/vncInstHandler.cpp			\
-		$(srcdir)/win32/src/vncServer.cpp			\
-		$(srcdir)/win32/src/vncClient.cpp			\
-		$(srcdir)/win32/src/stdhdrs.cpp				\
-		$(srcdir)/win32/src/RectList.cpp			\
-		$(srcdir)/win32/src/translate.cpp			\
-		$(srcdir)/win32/src/Log.cpp				\
-		$(srcdir)/win32/src/vncEncoder.cpp			\
-		$(srcdir)/win32/src/vncBuffer.cpp			\
-		$(srcdir)/win32/src/vncRegion.cpp			\
-		$(srcdir)/win32/src/vncSockConnect.cpp			\
-		$(srcdir)/win32/src/vncDesktop.cpp			\
-		$(srcdir)/win32/src/VNCHooks/VNCHooks.cpp		\
-		$(srcdir)/win32/src/VNCHooks/SharedData.cpp		\
-		$(srcdir)/win32/src/MinMax.cpp				\
-		$(srcdir)/win32/src/DynamicFn.cpp			\
-		$(srcdir)/win32/src/TsSessions.cpp			\
-		$(srcdir)/win32/src/VSocket.h				\
-		$(srcdir)/win32/src/stdhdrs.h				\
-		$(srcdir)/win32/src/vncBuffer.h				\
-		$(srcdir)/win32/src/Log.h				\
-		$(srcdir)/win32/src/resource.h				\
-		$(srcdir)/win32/src/rfb.h				\
-		$(srcdir)/win32/src/vncServer.h				\
-		$(srcdir)/win32/src/vncDesktop.h			\
-		$(srcdir)/win32/src/vncEncodeTight.h			\
-		$(srcdir)/win32/src/vncEncodeHexT.h			\
-		$(srcdir)/win32/src/WinVNC.h				\
-		$(srcdir)/win32/src/VideoDriver.h			\
-		$(srcdir)/win32/src/DynamicFn.h				\
-		$(srcdir)/win32/src/TsSessions.h			\
-		$(srcdir)/win32/src/vncKeymap.h				\
-		$(srcdir)/win32/src/vncClient.h				\
-		$(srcdir)/win32/src/vncRegion.h				\
-		$(srcdir)/win32/src/vncInstHandler.h			\
-		$(srcdir)/win32/src/RectList.h				\
-		$(srcdir)/win32/src/vncEncodeZlib.h			\
-		$(srcdir)/win32/src/vncSockConnect.h			\
-		$(srcdir)/win32/src/vncEncodeRRE.h			\
-		$(srcdir)/win32/src/vncService.h			\
-		$(srcdir)/win32/src/translate.h				\
-		$(srcdir)/win32/src/vncEncoder.h			\
-		$(srcdir)/win32/src/vncEncodeCoRRE.h			\
-		$(srcdir)/win32/src/vncTimedMsgBox.h			\
-		$(srcdir)/win32/src/VTypes.h				\
-		$(srcdir)/win32/src/VNCHooks/SharedData.h		\
-		$(srcdir)/win32/src/VNCHooks/VNCHooks.h			\
-		$(srcdir)/win32/src/MinMax.h				\
-		$(srcdir)/win32/src/d3des.h				\
-		$(srcdir)/win32/src/vncPasswd.h				\
-		$(srcdir)/win32/src/vncauth.h				\
-		$(srcdir)/win32/src/ParseHost.c				\
-		$(srcdir)/win32/src/ParseHost.h				\
-		$(srcdir)/win32/src/omnithread/nt.cpp			\
-		$(srcdir)/win32/src/omnithread/nt.h			\
-		$(srcdir)/win32/src/omnithread/omnithread.h		\
-		$(srcdir)/win32/zlib/zlib.h				\
-		$(srcdir)/win32/libjpeg/jpeglib.h			\
-		$(srcdir)/win32/crtdbg.h				\
-		$(srcdir)/win32/FileTransferItemInfo.h			\
-		$(srcdir)/win32/keysymdef.h				\
-		$(srcdir)/win32/rectlist.h				\
-		$(srcdir)/win32/vncAcceptDialog.h			\
-		$(srcdir)/win32/vncCorbaConnect.h			\
-		$(srcdir)/win32/vncEncodeZlibHex.h			\
-		$(srcdir)/win32/VNCHelp.h				\
-		$(srcdir)/win32/vncHTTPConnect.h			\
-		$(srcdir)/win32/vncMenu.h				\
-		$(srcdir)/win32/vncPasswd.h				\
-		$(srcdir)/win32/WallpaperUtils.h
-
-
diff --git a/ica/Makefile.in b/ica/Makefile.in
deleted file mode 100644
index 130af3a..0000000
--- a/ica/Makefile.in
+++ /dev/null
@@ -1,1598 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = ica$(EXEEXT)
-subdir = ica
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-	$(srcdir)/ica.rc.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = ica.rc
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
-PROGRAMS = $(bin_PROGRAMS)
-am__ica_SOURCES_DIST = $(srcdir)/src/ica_main.cpp \
-	$(srcdir)/src/ivs.cpp $(srcdir)/src/isd_server.cpp \
-	$(srcdir)/src/local_system_ica.cpp \
-	$(srcdir)/src/system_service.cpp $(srcdir)/src/demo_server.cpp \
-	$(srcdir)/src/demo_client.cpp $(srcdir)/src/ivs.h \
-	$(srcdir)/src/isd_server.h $(srcdir)/src/local_system_ica.h \
-	$(srcdir)/src/demo_server.h $(srcdir)/src/demo_client.h \
-	$(srcdir)/src/system_service.h $(srcdir)/src/ica_main.h \
-	$(srcdir)/ica.qrc $(srcdir)/ica_qrc.cpp $(wildcard \
-	$(srcdir)/resources/*) $(srcdir)/win32/win32vnc.cpp \
-	$(srcdir)/win32/src/d3des_w32.c \
-	$(srcdir)/win32/src/vncauth_w32.c \
-	$(srcdir)/win32/src/vncEncodeZlib.cpp \
-	$(srcdir)/win32/src/vncEncodeRRE.cpp \
-	$(srcdir)/win32/src/vncEncodeTight.cpp \
-	$(srcdir)/win32/src/vncEncodeCoRRE.cpp \
-	$(srcdir)/win32/src/vncEncodeHexT.cpp $(srcdir)/x11/x11vnc.c \
-	$(srcdir)/x11/x11vnc/appshare.c \
-	$(srcdir)/x11/libvncserver/auth.c \
-	$(srcdir)/x11/libvncserver/cargs.c \
-	$(srcdir)/x11/libvncserver/corre.c \
-	$(srcdir)/x11/libvncserver/cursor.c \
-	$(srcdir)/x11/libvncserver/cutpaste.c \
-	$(srcdir)/x11/libvncserver/d3des.c \
-	$(srcdir)/x11/libvncserver/draw.c \
-	$(srcdir)/x11/libvncserver/font.c \
-	$(srcdir)/x11/libvncserver/hextile.c \
-	$(srcdir)/x11/libvncserver/httpd.c \
-	$(srcdir)/x11/libvncserver/main.c \
-	$(srcdir)/x11/libvncserver/rfbregion.c \
-	$(srcdir)/x11/libvncserver/rfbserver.c \
-	$(srcdir)/x11/libvncserver/rre.c \
-	$(srcdir)/x11/libvncserver/scale.c \
-	$(srcdir)/x11/libvncserver/selbox.c \
-	$(srcdir)/x11/libvncserver/sockets.c \
-	$(srcdir)/x11/libvncserver/stats.c \
-	$(srcdir)/x11/libvncserver/translate.c \
-	$(srcdir)/x11/libvncserver/ultra.c \
-	$(srcdir)/x11/libvncserver/vncauth.c \
-	$(srcdir)/x11/libvncserver/d3des.h \
-	$(srcdir)/x11/libvncserver/private.h \
-	$(srcdir)/x11/libvncserver/scale.h \
-	$(srcdir)/x11/libvncserver/zrleoutstream.h \
-	$(srcdir)/x11/libvncserver/zrlepalettehelper.h \
-	$(srcdir)/x11/libvncserver/zrletypes.h \
-	$(srcdir)/x11/libvncserver/zlib.c \
-	$(srcdir)/x11/libvncserver/zrle.c \
-	$(srcdir)/x11/libvncserver/zrleoutstream.c \
-	$(srcdir)/x11/libvncserver/zrlepalettehelper.c \
-	$(srcdir)/x11/libvncserver/tight.c \
-	$(srcdir)/x11/rfb/rfbregion.h $(srcdir)/x11/rfb/default8x16.h
- at BUILD_LINUX_FALSE@am__objects_1 = win32vnc.$(OBJEXT) \
- at BUILD_LINUX_FALSE@	d3des_w32.$(OBJEXT) vncauth_w32.$(OBJEXT) \
- at BUILD_LINUX_FALSE@	vncEncodeZlib.$(OBJEXT) \
- at BUILD_LINUX_FALSE@	vncEncodeRRE.$(OBJEXT) \
- at BUILD_LINUX_FALSE@	vncEncodeTight.$(OBJEXT) \
- at BUILD_LINUX_FALSE@	vncEncodeCoRRE.$(OBJEXT) \
- at BUILD_LINUX_FALSE@	vncEncodeHexT.$(OBJEXT)
- at BUILD_LINUX_TRUE@am__objects_1 = x11vnc.$(OBJEXT) appshare.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	auth.$(OBJEXT) cargs.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	corre.$(OBJEXT) cursor.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	cutpaste.$(OBJEXT) d3des.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	draw.$(OBJEXT) font.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	hextile.$(OBJEXT) httpd.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	main.$(OBJEXT) rfbregion.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	rfbserver.$(OBJEXT) rre.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	scale.$(OBJEXT) selbox.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	sockets.$(OBJEXT) stats.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	translate.$(OBJEXT) ultra.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	vncauth.$(OBJEXT) zlib.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	zrle.$(OBJEXT) zrleoutstream.$(OBJEXT) \
- at BUILD_LINUX_TRUE@	zrlepalettehelper.$(OBJEXT) tight.$(OBJEXT)
-am_ica_OBJECTS = ica_main.$(OBJEXT) ivs.$(OBJEXT) isd_server.$(OBJEXT) \
-	local_system_ica.$(OBJEXT) system_service.$(OBJEXT) \
-	demo_server.$(OBJEXT) demo_client.$(OBJEXT) ica_qrc.$(OBJEXT) \
-	$(am__objects_1)
-ica_OBJECTS = $(am_ica_OBJECTS)
-am__DEPENDENCIES_1 =
- at BUILD_LINUX_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
- at BUILD_WIN32_TRUE@am__DEPENDENCIES_3 = ica_win_resources.o
-ica_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_3)
-ica_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(ica_LDFLAGS) \
-	$(LDFLAGS) -o $@
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(ica_SOURCES)
-DIST_SOURCES = $(am__ica_SOURCES_DIST)
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-man1dir = $(mandir)/man1
-NROFF = nroff
-MANS = $(man_MANS)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LRELEASE = @LRELEASE@
-LTLIBOBJS = @LTLIBOBJS@
-LUPDATE = @LUPDATE@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-MOC = @MOC@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-QT_CXXFLAGS = @QT_CXXFLAGS@
-QT_LDADD = @QT_LDADD@
-QT_LIB_GUI = @QT_LIB_GUI@
-RANLIB = @RANLIB@
-RCC = @RCC@
-RPMSOURCEDIR = @RPMSOURCEDIR@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-UIC = @UIC@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign
- at BUILD_LINUX_FALSE@IVS_INCLUDES = -I$(srcdir)/win32 -I$(srcdir)/win32/src -I$(srcdir)/win32/src/omnithread -I$(srcdir)/win32/src/VNCHooks
- at BUILD_LINUX_TRUE@IVS_INCLUDES = -I$(srcdir)/x11 -I$(srcdir)/x11/x11vnc -I$(srcdir)/x11/libvncserver
- at BUILD_LINUX_FALSE@IVS_SRCS = $(srcdir)/win32/win32vnc.cpp			\
- at BUILD_LINUX_FALSE@		$(srcdir)/win32/src/d3des_w32.c			\
- at BUILD_LINUX_FALSE@		$(srcdir)/win32/src/vncauth_w32.c		\
- at BUILD_LINUX_FALSE@		$(srcdir)/win32/src/vncEncodeZlib.cpp		\
- at BUILD_LINUX_FALSE@		$(srcdir)/win32/src/vncEncodeRRE.cpp		\
- at BUILD_LINUX_FALSE@		$(srcdir)/win32/src/vncEncodeTight.cpp		\
- at BUILD_LINUX_FALSE@		$(srcdir)/win32/src/vncEncodeCoRRE.cpp		\
- at BUILD_LINUX_FALSE@		$(srcdir)/win32/src/vncEncodeHexT.cpp
-
- at BUILD_LINUX_TRUE@IVS_SRCS = $(srcdir)/x11/x11vnc.c				\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/x11vnc/appshare.c			\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/auth.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/cargs.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/corre.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/cursor.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/cutpaste.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/d3des.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/draw.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/font.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/hextile.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/httpd.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/main.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/rfbregion.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/rfbserver.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/rre.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/scale.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/selbox.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/sockets.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/stats.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/translate.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/ultra.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/vncauth.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/d3des.h		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/private.h		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/scale.h		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/zrleoutstream.h	\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/zrlepalettehelper.h	\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/zrletypes.h		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/zlib.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/zrle.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/zrleoutstream.c	\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/zrlepalettehelper.c	\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/libvncserver/tight.c		\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/rfb/rfbregion.h			\
- at BUILD_LINUX_TRUE@		$(srcdir)/x11/rfb/default8x16.h
-
- at BUILD_LINUX_TRUE@@HAVE_LIBPTHREAD_TRUE at PTHREADLDADD = -lpthread
- at BUILD_LINUX_FALSE@IVSLDADD = -lkernel32 -lwsock32 -luser32 -lgdi32 -lpsapi -lnetapi32
- at BUILD_LINUX_TRUE@IVSLDADD = @X_LIBS@ $(PTHREADLDADD)
- at HAVE_LIBEAY32_TRUE@LIBSSL_LDADD = -leay32
- at HAVE_LIBSSL_TRUE@LIBSSL_LDADD = -lssl -lcrypto
- at BUILD_WIN32_TRUE@WIN32_RES_LDADD = ica_win_resources.o -L. -lvnchooks
-ica_LDADD = $(QT_LDADD) $(QT_LIB_GUI) -lz -ljpeg $(LIBSSL_LDADD) $(IVSLDADD) $(WIN32_RES_LDADD) -L../lib -litalc_core
-ica_LDFLAGS = $(LDFLAGS) -mwindows -rpath $(pkglibdir)
-AM_CXXFLAGS = $(QT_CXXFLAGS) -O2 -DBUILD_ICA $(CXXFLAGS_ADD)
-AM_CFLAGS = -O2 -DBUILD_ICA -DVNCSHARED -DFOREVER -DNOREPEAT=0 -DNOPW=1 -DREMOTE_CONTROL=0 -DEXTERNAL_COMMANDS=0 -DFILEXFER=0 -DNOGUI -DSMALL_FOOTPRINT=1 -w
-INCLUDES = $(IVS_INCLUDES) -I$(srcdir)/../lib/include -I$(srcdir)/../lib/include/rfb -I$(srcdir)/src -I$(top_srcdir)
-ica_MOC = src/isd_server.moc 			\
-		src/demo_server.moc			\
-		src/demo_client.moc
-
-ica_SOURCES = $(srcdir)/src/ica_main.cpp		\
-			$(srcdir)/src/ivs.cpp			\
-			$(srcdir)/src/isd_server.cpp		\
-			$(srcdir)/src/local_system_ica.cpp	\
-			$(srcdir)/src/system_service.cpp	\
-			$(srcdir)/src/demo_server.cpp		\
-			$(srcdir)/src/demo_client.cpp		\
-			$(srcdir)/src/ivs.h			\
-			$(srcdir)/src/isd_server.h		\
-			$(srcdir)/src/local_system_ica.h	\
-			$(srcdir)/src/demo_server.h		\
-			$(srcdir)/src/demo_client.h		\
-			$(srcdir)/src/system_service.h		\
-			$(srcdir)/src/ica_main.h		\
-			$(srcdir)/ica.qrc			\
-			$(srcdir)/ica_qrc.cpp			\
-			$(wildcard $(srcdir)/resources/*)	\
-			$(IVS_SRCS)
-
-CLEANFILES = ./ica_qrc.cpp $(ica_MOC) vnchooks.dll libvnchooks.a
-BUILT_SOURCES = ./ica_qrc.cpp $(ica_MOC)
-man_MANS = ica.1
-EXTRA_DIST = $(man_MANS)						\
-		$(srcdir)/x11/README					\
-		$(srcdir)/win32/README					\
-		$(srcdir)/x11/libvncclient/corre.c			\
-		$(srcdir)/x11/libvncclient/cursor.c			\
-		$(srcdir)/x11/libvncclient/tls.h			\
-		$(srcdir)/x11/libvncclient/tls.c			\
-		$(srcdir)/x11/libvncclient/listen.c			\
-		$(srcdir)/x11/libvncclient/rfbproto.c		\
-		$(srcdir)/x11/libvncclient/sockets.c		\
-		$(srcdir)/x11/libvncclient/vncviewer.c		\
-		$(srcdir)/x11/libvncclient/hextile.c		\
-		$(srcdir)/x11/libvncclient/minilzo.c		\
-		$(srcdir)/x11/libvncclient/rre.c			\
-		$(srcdir)/x11/libvncclient/tight.c			\
-		$(srcdir)/x11/libvncclient/ultra.c			\
-		$(srcdir)/x11/libvncclient/zlib.c			\
-		$(srcdir)/x11/libvncclient/zrle.c			\
-		$(srcdir)/x11/libvncserver/tableinit24.c		\
-		$(srcdir)/x11/libvncserver/tableinittctemplate.c	\
-		$(srcdir)/x11/libvncserver/tabletranstemplate.c		\
-		$(srcdir)/x11/libvncserver/tableinitcmtemplate.c	\
-		$(srcdir)/x11/libvncserver/tabletrans24template.c	\
-		$(srcdir)/x11/libvncserver/zrleencodetemplate.c		\
-		$(srcdir)/x11/libvncserver/zywrletemplate.c		\
-		$(srcdir)/x11/libvncserver/zlib.c			\
-		$(srcdir)/x11/libvncserver/zrle.c			\
-		$(srcdir)/x11/libvncserver/zrleoutstream.c		\
-		$(srcdir)/x11/libvncserver/zrlepalettehelper.c		\
-		$(srcdir)/x11/libvncserver/tight.c			\
-		$(wildcard $(srcdir)/x11/x11vnc/*)			\
-		$(srcdir)/win32/src/tableinitcmtemplate.cpp		\
-		$(srcdir)/win32/src/tabletranstemplate.cpp		\
-		$(srcdir)/win32/src/tableinittctemplate.cpp		\
-		$(srcdir)/win32/src/vncKeymap.cpp			\
-		$(srcdir)/win32/src/VSocket.cpp				\
-		$(srcdir)/win32/src/WinVNC.cpp				\
-		$(srcdir)/win32/src/VideoDriver.cpp			\
-		$(srcdir)/win32/src/vncService.cpp			\
-		$(srcdir)/win32/src/vncInstHandler.cpp			\
-		$(srcdir)/win32/src/vncServer.cpp			\
-		$(srcdir)/win32/src/vncClient.cpp			\
-		$(srcdir)/win32/src/stdhdrs.cpp				\
-		$(srcdir)/win32/src/RectList.cpp			\
-		$(srcdir)/win32/src/translate.cpp			\
-		$(srcdir)/win32/src/Log.cpp				\
-		$(srcdir)/win32/src/vncEncoder.cpp			\
-		$(srcdir)/win32/src/vncBuffer.cpp			\
-		$(srcdir)/win32/src/vncRegion.cpp			\
-		$(srcdir)/win32/src/vncSockConnect.cpp			\
-		$(srcdir)/win32/src/vncDesktop.cpp			\
-		$(srcdir)/win32/src/VNCHooks/VNCHooks.cpp		\
-		$(srcdir)/win32/src/VNCHooks/SharedData.cpp		\
-		$(srcdir)/win32/src/MinMax.cpp				\
-		$(srcdir)/win32/src/DynamicFn.cpp			\
-		$(srcdir)/win32/src/TsSessions.cpp			\
-		$(srcdir)/win32/src/VSocket.h				\
-		$(srcdir)/win32/src/stdhdrs.h				\
-		$(srcdir)/win32/src/vncBuffer.h				\
-		$(srcdir)/win32/src/Log.h				\
-		$(srcdir)/win32/src/resource.h				\
-		$(srcdir)/win32/src/rfb.h				\
-		$(srcdir)/win32/src/vncServer.h				\
-		$(srcdir)/win32/src/vncDesktop.h			\
-		$(srcdir)/win32/src/vncEncodeTight.h			\
-		$(srcdir)/win32/src/vncEncodeHexT.h			\
-		$(srcdir)/win32/src/WinVNC.h				\
-		$(srcdir)/win32/src/VideoDriver.h			\
-		$(srcdir)/win32/src/DynamicFn.h				\
-		$(srcdir)/win32/src/TsSessions.h			\
-		$(srcdir)/win32/src/vncKeymap.h				\
-		$(srcdir)/win32/src/vncClient.h				\
-		$(srcdir)/win32/src/vncRegion.h				\
-		$(srcdir)/win32/src/vncInstHandler.h			\
-		$(srcdir)/win32/src/RectList.h				\
-		$(srcdir)/win32/src/vncEncodeZlib.h			\
-		$(srcdir)/win32/src/vncSockConnect.h			\
-		$(srcdir)/win32/src/vncEncodeRRE.h			\
-		$(srcdir)/win32/src/vncService.h			\
-		$(srcdir)/win32/src/translate.h				\
-		$(srcdir)/win32/src/vncEncoder.h			\
-		$(srcdir)/win32/src/vncEncodeCoRRE.h			\
-		$(srcdir)/win32/src/vncTimedMsgBox.h			\
-		$(srcdir)/win32/src/VTypes.h				\
-		$(srcdir)/win32/src/VNCHooks/SharedData.h		\
-		$(srcdir)/win32/src/VNCHooks/VNCHooks.h			\
-		$(srcdir)/win32/src/MinMax.h				\
-		$(srcdir)/win32/src/d3des.h				\
-		$(srcdir)/win32/src/vncPasswd.h				\
-		$(srcdir)/win32/src/vncauth.h				\
-		$(srcdir)/win32/src/ParseHost.c				\
-		$(srcdir)/win32/src/ParseHost.h				\
-		$(srcdir)/win32/src/omnithread/nt.cpp			\
-		$(srcdir)/win32/src/omnithread/nt.h			\
-		$(srcdir)/win32/src/omnithread/omnithread.h		\
-		$(srcdir)/win32/zlib/zlib.h				\
-		$(srcdir)/win32/libjpeg/jpeglib.h			\
-		$(srcdir)/win32/crtdbg.h				\
-		$(srcdir)/win32/FileTransferItemInfo.h			\
-		$(srcdir)/win32/keysymdef.h				\
-		$(srcdir)/win32/rectlist.h				\
-		$(srcdir)/win32/vncAcceptDialog.h			\
-		$(srcdir)/win32/vncCorbaConnect.h			\
-		$(srcdir)/win32/vncEncodeZlibHex.h			\
-		$(srcdir)/win32/VNCHelp.h				\
-		$(srcdir)/win32/vncHTTPConnect.h			\
-		$(srcdir)/win32/vncMenu.h				\
-		$(srcdir)/win32/vncPasswd.h				\
-		$(srcdir)/win32/WallpaperUtils.h
-
-all: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ica/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign ica/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-ica.rc: $(top_builddir)/config.status $(srcdir)/ica.rc.in
-	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p || test -f $$p1; \
-	  then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' `; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-ica$(EXEEXT): $(ica_OBJECTS) $(ica_DEPENDENCIES) 
-	@rm -f ica$(EXEEXT)
-	$(ica_LINK) $(ica_OBJECTS) $(ica_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/appshare.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/auth.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cargs.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/corre.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cursor.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cutpaste.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/d3des.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/d3des_w32.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/demo_client.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/demo_server.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/draw.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/font.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/hextile.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/httpd.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ica_main.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ica_qrc.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/isd_server.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ivs.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/local_system_ica.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rfbregion.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rfbserver.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/rre.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/scale.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/selbox.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sockets.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stats.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/system_service.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tight.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/translate.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ultra.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vncEncodeCoRRE.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vncEncodeHexT.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vncEncodeRRE.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vncEncodeTight.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vncEncodeZlib.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vncauth.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vncauth_w32.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/win32vnc.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/x11vnc.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zlib.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zrle.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zrleoutstream.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zrlepalettehelper.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
-
-d3des_w32.o: $(srcdir)/win32/src/d3des_w32.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT d3des_w32.o -MD -MP -MF $(DEPDIR)/d3des_w32.Tpo -c -o d3des_w32.o `test -f '$(srcdir)/win32/src/d3des_w32.c' || echo '$(srcdir)/'`$(srcdir)/win32/src/d3des_w32.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/d3des_w32.Tpo $(DEPDIR)/d3des_w32.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/win32/src/d3des_w32.c' object='d3des_w32.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o d3des_w32.o `test -f '$(srcdir)/win32/src/d3des_w32.c' || echo '$(srcdir)/'`$(srcdir)/win32/src/d3des_w32.c
-
-d3des_w32.obj: $(srcdir)/win32/src/d3des_w32.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT d3des_w32.obj -MD -MP -MF $(DEPDIR)/d3des_w32.Tpo -c -o d3des_w32.obj `if test -f '$(srcdir)/win32/src/d3des_w32.c'; then $(CYGPATH_W) '$(srcdir)/win32/src/d3des_w32.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/d3des_w32.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/d3des_w32.Tpo $(DEPDIR)/d3des_w32.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/win32/src/d3des_w32.c' object='d3des_w32.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o d3des_w32.obj `if test -f '$(srcdir)/win32/src/d3des_w32.c'; then $(CYGPATH_W) '$(srcdir)/win32/src/d3des_w32.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/d3des_w32.c'; fi`
-
-vncauth_w32.o: $(srcdir)/win32/src/vncauth_w32.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vncauth_w32.o -MD -MP -MF $(DEPDIR)/vncauth_w32.Tpo -c -o vncauth_w32.o `test -f '$(srcdir)/win32/src/vncauth_w32.c' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncauth_w32.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/vncauth_w32.Tpo $(DEPDIR)/vncauth_w32.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/win32/src/vncauth_w32.c' object='vncauth_w32.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vncauth_w32.o `test -f '$(srcdir)/win32/src/vncauth_w32.c' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncauth_w32.c
-
-vncauth_w32.obj: $(srcdir)/win32/src/vncauth_w32.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vncauth_w32.obj -MD -MP -MF $(DEPDIR)/vncauth_w32.Tpo -c -o vncauth_w32.obj `if test -f '$(srcdir)/win32/src/vncauth_w32.c'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncauth_w32.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncauth_w32.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/vncauth_w32.Tpo $(DEPDIR)/vncauth_w32.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/win32/src/vncauth_w32.c' object='vncauth_w32.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vncauth_w32.obj `if test -f '$(srcdir)/win32/src/vncauth_w32.c'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncauth_w32.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncauth_w32.c'; fi`
-
-x11vnc.o: $(srcdir)/x11/x11vnc.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT x11vnc.o -MD -MP -MF $(DEPDIR)/x11vnc.Tpo -c -o x11vnc.o `test -f '$(srcdir)/x11/x11vnc.c' || echo '$(srcdir)/'`$(srcdir)/x11/x11vnc.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/x11vnc.Tpo $(DEPDIR)/x11vnc.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/x11vnc.c' object='x11vnc.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o x11vnc.o `test -f '$(srcdir)/x11/x11vnc.c' || echo '$(srcdir)/'`$(srcdir)/x11/x11vnc.c
-
-x11vnc.obj: $(srcdir)/x11/x11vnc.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT x11vnc.obj -MD -MP -MF $(DEPDIR)/x11vnc.Tpo -c -o x11vnc.obj `if test -f '$(srcdir)/x11/x11vnc.c'; then $(CYGPATH_W) '$(srcdir)/x11/x11vnc.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/x11vnc.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/x11vnc.Tpo $(DEPDIR)/x11vnc.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/x11vnc.c' object='x11vnc.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o x11vnc.obj `if test -f '$(srcdir)/x11/x11vnc.c'; then $(CYGPATH_W) '$(srcdir)/x11/x11vnc.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/x11vnc.c'; fi`
-
-appshare.o: $(srcdir)/x11/x11vnc/appshare.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT appshare.o -MD -MP -MF $(DEPDIR)/appshare.Tpo -c -o appshare.o `test -f '$(srcdir)/x11/x11vnc/appshare.c' || echo '$(srcdir)/'`$(srcdir)/x11/x11vnc/appshare.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/appshare.Tpo $(DEPDIR)/appshare.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/x11vnc/appshare.c' object='appshare.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o appshare.o `test -f '$(srcdir)/x11/x11vnc/appshare.c' || echo '$(srcdir)/'`$(srcdir)/x11/x11vnc/appshare.c
-
-appshare.obj: $(srcdir)/x11/x11vnc/appshare.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT appshare.obj -MD -MP -MF $(DEPDIR)/appshare.Tpo -c -o appshare.obj `if test -f '$(srcdir)/x11/x11vnc/appshare.c'; then $(CYGPATH_W) '$(srcdir)/x11/x11vnc/appshare.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/x11vnc/appshare.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/appshare.Tpo $(DEPDIR)/appshare.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/x11vnc/appshare.c' object='appshare.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o appshare.obj `if test -f '$(srcdir)/x11/x11vnc/appshare.c'; then $(CYGPATH_W) '$(srcdir)/x11/x11vnc/appshare.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/x11vnc/appshare.c'; fi`
-
-auth.o: $(srcdir)/x11/libvncserver/auth.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT auth.o -MD -MP -MF $(DEPDIR)/auth.Tpo -c -o auth.o `test -f '$(srcdir)/x11/libvncserver/auth.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/auth.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/auth.Tpo $(DEPDIR)/auth.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/auth.c' object='auth.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o auth.o `test -f '$(srcdir)/x11/libvncserver/auth.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/auth.c
-
-auth.obj: $(srcdir)/x11/libvncserver/auth.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT auth.obj -MD -MP -MF $(DEPDIR)/auth.Tpo -c -o auth.obj `if test -f '$(srcdir)/x11/libvncserver/auth.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/auth.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/auth.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/auth.Tpo $(DEPDIR)/auth.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/auth.c' object='auth.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o auth.obj `if test -f '$(srcdir)/x11/libvncserver/auth.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/auth.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/auth.c'; fi`
-
-cargs.o: $(srcdir)/x11/libvncserver/cargs.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cargs.o -MD -MP -MF $(DEPDIR)/cargs.Tpo -c -o cargs.o `test -f '$(srcdir)/x11/libvncserver/cargs.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/cargs.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cargs.Tpo $(DEPDIR)/cargs.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/cargs.c' object='cargs.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cargs.o `test -f '$(srcdir)/x11/libvncserver/cargs.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/cargs.c
-
-cargs.obj: $(srcdir)/x11/libvncserver/cargs.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cargs.obj -MD -MP -MF $(DEPDIR)/cargs.Tpo -c -o cargs.obj `if test -f '$(srcdir)/x11/libvncserver/cargs.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/cargs.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/cargs.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cargs.Tpo $(DEPDIR)/cargs.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/cargs.c' object='cargs.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cargs.obj `if test -f '$(srcdir)/x11/libvncserver/cargs.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/cargs.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/cargs.c'; fi`
-
-corre.o: $(srcdir)/x11/libvncserver/corre.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT corre.o -MD -MP -MF $(DEPDIR)/corre.Tpo -c -o corre.o `test -f '$(srcdir)/x11/libvncserver/corre.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/corre.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/corre.Tpo $(DEPDIR)/corre.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/corre.c' object='corre.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o corre.o `test -f '$(srcdir)/x11/libvncserver/corre.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/corre.c
-
-corre.obj: $(srcdir)/x11/libvncserver/corre.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT corre.obj -MD -MP -MF $(DEPDIR)/corre.Tpo -c -o corre.obj `if test -f '$(srcdir)/x11/libvncserver/corre.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/corre.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/corre.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/corre.Tpo $(DEPDIR)/corre.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/corre.c' object='corre.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o corre.obj `if test -f '$(srcdir)/x11/libvncserver/corre.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/corre.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/corre.c'; fi`
-
-cursor.o: $(srcdir)/x11/libvncserver/cursor.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cursor.o -MD -MP -MF $(DEPDIR)/cursor.Tpo -c -o cursor.o `test -f '$(srcdir)/x11/libvncserver/cursor.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/cursor.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cursor.Tpo $(DEPDIR)/cursor.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/cursor.c' object='cursor.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cursor.o `test -f '$(srcdir)/x11/libvncserver/cursor.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/cursor.c
-
-cursor.obj: $(srcdir)/x11/libvncserver/cursor.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cursor.obj -MD -MP -MF $(DEPDIR)/cursor.Tpo -c -o cursor.obj `if test -f '$(srcdir)/x11/libvncserver/cursor.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/cursor.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/cursor.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cursor.Tpo $(DEPDIR)/cursor.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/cursor.c' object='cursor.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cursor.obj `if test -f '$(srcdir)/x11/libvncserver/cursor.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/cursor.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/cursor.c'; fi`
-
-cutpaste.o: $(srcdir)/x11/libvncserver/cutpaste.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cutpaste.o -MD -MP -MF $(DEPDIR)/cutpaste.Tpo -c -o cutpaste.o `test -f '$(srcdir)/x11/libvncserver/cutpaste.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/cutpaste.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cutpaste.Tpo $(DEPDIR)/cutpaste.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/cutpaste.c' object='cutpaste.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cutpaste.o `test -f '$(srcdir)/x11/libvncserver/cutpaste.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/cutpaste.c
-
-cutpaste.obj: $(srcdir)/x11/libvncserver/cutpaste.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cutpaste.obj -MD -MP -MF $(DEPDIR)/cutpaste.Tpo -c -o cutpaste.obj `if test -f '$(srcdir)/x11/libvncserver/cutpaste.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/cutpaste.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/cutpaste.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cutpaste.Tpo $(DEPDIR)/cutpaste.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/cutpaste.c' object='cutpaste.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cutpaste.obj `if test -f '$(srcdir)/x11/libvncserver/cutpaste.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/cutpaste.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/cutpaste.c'; fi`
-
-d3des.o: $(srcdir)/x11/libvncserver/d3des.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT d3des.o -MD -MP -MF $(DEPDIR)/d3des.Tpo -c -o d3des.o `test -f '$(srcdir)/x11/libvncserver/d3des.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/d3des.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/d3des.Tpo $(DEPDIR)/d3des.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/d3des.c' object='d3des.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o d3des.o `test -f '$(srcdir)/x11/libvncserver/d3des.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/d3des.c
-
-d3des.obj: $(srcdir)/x11/libvncserver/d3des.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT d3des.obj -MD -MP -MF $(DEPDIR)/d3des.Tpo -c -o d3des.obj `if test -f '$(srcdir)/x11/libvncserver/d3des.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/d3des.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/d3des.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/d3des.Tpo $(DEPDIR)/d3des.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/d3des.c' object='d3des.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o d3des.obj `if test -f '$(srcdir)/x11/libvncserver/d3des.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/d3des.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/d3des.c'; fi`
-
-draw.o: $(srcdir)/x11/libvncserver/draw.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT draw.o -MD -MP -MF $(DEPDIR)/draw.Tpo -c -o draw.o `test -f '$(srcdir)/x11/libvncserver/draw.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/draw.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/draw.Tpo $(DEPDIR)/draw.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/draw.c' object='draw.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o draw.o `test -f '$(srcdir)/x11/libvncserver/draw.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/draw.c
-
-draw.obj: $(srcdir)/x11/libvncserver/draw.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT draw.obj -MD -MP -MF $(DEPDIR)/draw.Tpo -c -o draw.obj `if test -f '$(srcdir)/x11/libvncserver/draw.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/draw.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/draw.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/draw.Tpo $(DEPDIR)/draw.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/draw.c' object='draw.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o draw.obj `if test -f '$(srcdir)/x11/libvncserver/draw.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/draw.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/draw.c'; fi`
-
-font.o: $(srcdir)/x11/libvncserver/font.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT font.o -MD -MP -MF $(DEPDIR)/font.Tpo -c -o font.o `test -f '$(srcdir)/x11/libvncserver/font.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/font.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/font.Tpo $(DEPDIR)/font.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/font.c' object='font.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o font.o `test -f '$(srcdir)/x11/libvncserver/font.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/font.c
-
-font.obj: $(srcdir)/x11/libvncserver/font.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT font.obj -MD -MP -MF $(DEPDIR)/font.Tpo -c -o font.obj `if test -f '$(srcdir)/x11/libvncserver/font.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/font.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/font.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/font.Tpo $(DEPDIR)/font.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/font.c' object='font.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o font.obj `if test -f '$(srcdir)/x11/libvncserver/font.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/font.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/font.c'; fi`
-
-hextile.o: $(srcdir)/x11/libvncserver/hextile.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hextile.o -MD -MP -MF $(DEPDIR)/hextile.Tpo -c -o hextile.o `test -f '$(srcdir)/x11/libvncserver/hextile.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/hextile.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/hextile.Tpo $(DEPDIR)/hextile.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/hextile.c' object='hextile.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hextile.o `test -f '$(srcdir)/x11/libvncserver/hextile.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/hextile.c
-
-hextile.obj: $(srcdir)/x11/libvncserver/hextile.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hextile.obj -MD -MP -MF $(DEPDIR)/hextile.Tpo -c -o hextile.obj `if test -f '$(srcdir)/x11/libvncserver/hextile.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/hextile.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/hextile.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/hextile.Tpo $(DEPDIR)/hextile.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/hextile.c' object='hextile.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hextile.obj `if test -f '$(srcdir)/x11/libvncserver/hextile.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/hextile.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/hextile.c'; fi`
-
-httpd.o: $(srcdir)/x11/libvncserver/httpd.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT httpd.o -MD -MP -MF $(DEPDIR)/httpd.Tpo -c -o httpd.o `test -f '$(srcdir)/x11/libvncserver/httpd.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/httpd.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/httpd.Tpo $(DEPDIR)/httpd.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/httpd.c' object='httpd.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o httpd.o `test -f '$(srcdir)/x11/libvncserver/httpd.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/httpd.c
-
-httpd.obj: $(srcdir)/x11/libvncserver/httpd.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT httpd.obj -MD -MP -MF $(DEPDIR)/httpd.Tpo -c -o httpd.obj `if test -f '$(srcdir)/x11/libvncserver/httpd.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/httpd.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/httpd.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/httpd.Tpo $(DEPDIR)/httpd.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/httpd.c' object='httpd.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o httpd.obj `if test -f '$(srcdir)/x11/libvncserver/httpd.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/httpd.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/httpd.c'; fi`
-
-main.o: $(srcdir)/x11/libvncserver/main.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT main.o -MD -MP -MF $(DEPDIR)/main.Tpo -c -o main.o `test -f '$(srcdir)/x11/libvncserver/main.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/main.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/main.Tpo $(DEPDIR)/main.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/main.c' object='main.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o main.o `test -f '$(srcdir)/x11/libvncserver/main.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/main.c
-
-main.obj: $(srcdir)/x11/libvncserver/main.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT main.obj -MD -MP -MF $(DEPDIR)/main.Tpo -c -o main.obj `if test -f '$(srcdir)/x11/libvncserver/main.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/main.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/main.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/main.Tpo $(DEPDIR)/main.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/main.c' object='main.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o main.obj `if test -f '$(srcdir)/x11/libvncserver/main.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/main.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/main.c'; fi`
-
-rfbregion.o: $(srcdir)/x11/libvncserver/rfbregion.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rfbregion.o -MD -MP -MF $(DEPDIR)/rfbregion.Tpo -c -o rfbregion.o `test -f '$(srcdir)/x11/libvncserver/rfbregion.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/rfbregion.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/rfbregion.Tpo $(DEPDIR)/rfbregion.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/rfbregion.c' object='rfbregion.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rfbregion.o `test -f '$(srcdir)/x11/libvncserver/rfbregion.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/rfbregion.c
-
-rfbregion.obj: $(srcdir)/x11/libvncserver/rfbregion.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rfbregion.obj -MD -MP -MF $(DEPDIR)/rfbregion.Tpo -c -o rfbregion.obj `if test -f '$(srcdir)/x11/libvncserver/rfbregion.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/rfbregion.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/rfbregion.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/rfbregion.Tpo $(DEPDIR)/rfbregion.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/rfbregion.c' object='rfbregion.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rfbregion.obj `if test -f '$(srcdir)/x11/libvncserver/rfbregion.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/rfbregion.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/rfbregion.c'; fi`
-
-rfbserver.o: $(srcdir)/x11/libvncserver/rfbserver.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rfbserver.o -MD -MP -MF $(DEPDIR)/rfbserver.Tpo -c -o rfbserver.o `test -f '$(srcdir)/x11/libvncserver/rfbserver.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/rfbserver.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/rfbserver.Tpo $(DEPDIR)/rfbserver.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/rfbserver.c' object='rfbserver.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rfbserver.o `test -f '$(srcdir)/x11/libvncserver/rfbserver.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/rfbserver.c
-
-rfbserver.obj: $(srcdir)/x11/libvncserver/rfbserver.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rfbserver.obj -MD -MP -MF $(DEPDIR)/rfbserver.Tpo -c -o rfbserver.obj `if test -f '$(srcdir)/x11/libvncserver/rfbserver.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/rfbserver.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/rfbserver.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/rfbserver.Tpo $(DEPDIR)/rfbserver.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/rfbserver.c' object='rfbserver.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rfbserver.obj `if test -f '$(srcdir)/x11/libvncserver/rfbserver.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/rfbserver.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/rfbserver.c'; fi`
-
-rre.o: $(srcdir)/x11/libvncserver/rre.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rre.o -MD -MP -MF $(DEPDIR)/rre.Tpo -c -o rre.o `test -f '$(srcdir)/x11/libvncserver/rre.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/rre.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/rre.Tpo $(DEPDIR)/rre.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/rre.c' object='rre.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rre.o `test -f '$(srcdir)/x11/libvncserver/rre.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/rre.c
-
-rre.obj: $(srcdir)/x11/libvncserver/rre.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rre.obj -MD -MP -MF $(DEPDIR)/rre.Tpo -c -o rre.obj `if test -f '$(srcdir)/x11/libvncserver/rre.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/rre.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/rre.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/rre.Tpo $(DEPDIR)/rre.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/rre.c' object='rre.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rre.obj `if test -f '$(srcdir)/x11/libvncserver/rre.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/rre.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/rre.c'; fi`
-
-scale.o: $(srcdir)/x11/libvncserver/scale.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT scale.o -MD -MP -MF $(DEPDIR)/scale.Tpo -c -o scale.o `test -f '$(srcdir)/x11/libvncserver/scale.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/scale.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/scale.Tpo $(DEPDIR)/scale.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/scale.c' object='scale.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o scale.o `test -f '$(srcdir)/x11/libvncserver/scale.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/scale.c
-
-scale.obj: $(srcdir)/x11/libvncserver/scale.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT scale.obj -MD -MP -MF $(DEPDIR)/scale.Tpo -c -o scale.obj `if test -f '$(srcdir)/x11/libvncserver/scale.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/scale.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/scale.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/scale.Tpo $(DEPDIR)/scale.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/scale.c' object='scale.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o scale.obj `if test -f '$(srcdir)/x11/libvncserver/scale.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/scale.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/scale.c'; fi`
-
-selbox.o: $(srcdir)/x11/libvncserver/selbox.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT selbox.o -MD -MP -MF $(DEPDIR)/selbox.Tpo -c -o selbox.o `test -f '$(srcdir)/x11/libvncserver/selbox.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/selbox.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/selbox.Tpo $(DEPDIR)/selbox.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/selbox.c' object='selbox.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o selbox.o `test -f '$(srcdir)/x11/libvncserver/selbox.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/selbox.c
-
-selbox.obj: $(srcdir)/x11/libvncserver/selbox.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT selbox.obj -MD -MP -MF $(DEPDIR)/selbox.Tpo -c -o selbox.obj `if test -f '$(srcdir)/x11/libvncserver/selbox.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/selbox.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/selbox.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/selbox.Tpo $(DEPDIR)/selbox.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/selbox.c' object='selbox.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o selbox.obj `if test -f '$(srcdir)/x11/libvncserver/selbox.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/selbox.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/selbox.c'; fi`
-
-sockets.o: $(srcdir)/x11/libvncserver/sockets.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sockets.o -MD -MP -MF $(DEPDIR)/sockets.Tpo -c -o sockets.o `test -f '$(srcdir)/x11/libvncserver/sockets.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/sockets.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/sockets.Tpo $(DEPDIR)/sockets.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/sockets.c' object='sockets.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sockets.o `test -f '$(srcdir)/x11/libvncserver/sockets.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/sockets.c
-
-sockets.obj: $(srcdir)/x11/libvncserver/sockets.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sockets.obj -MD -MP -MF $(DEPDIR)/sockets.Tpo -c -o sockets.obj `if test -f '$(srcdir)/x11/libvncserver/sockets.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/sockets.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/sockets.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/sockets.Tpo $(DEPDIR)/sockets.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/sockets.c' object='sockets.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sockets.obj `if test -f '$(srcdir)/x11/libvncserver/sockets.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/sockets.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/sockets.c'; fi`
-
-stats.o: $(srcdir)/x11/libvncserver/stats.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stats.o -MD -MP -MF $(DEPDIR)/stats.Tpo -c -o stats.o `test -f '$(srcdir)/x11/libvncserver/stats.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/stats.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/stats.Tpo $(DEPDIR)/stats.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/stats.c' object='stats.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stats.o `test -f '$(srcdir)/x11/libvncserver/stats.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/stats.c
-
-stats.obj: $(srcdir)/x11/libvncserver/stats.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stats.obj -MD -MP -MF $(DEPDIR)/stats.Tpo -c -o stats.obj `if test -f '$(srcdir)/x11/libvncserver/stats.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/stats.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/stats.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/stats.Tpo $(DEPDIR)/stats.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/stats.c' object='stats.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stats.obj `if test -f '$(srcdir)/x11/libvncserver/stats.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/stats.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/stats.c'; fi`
-
-translate.o: $(srcdir)/x11/libvncserver/translate.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT translate.o -MD -MP -MF $(DEPDIR)/translate.Tpo -c -o translate.o `test -f '$(srcdir)/x11/libvncserver/translate.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/translate.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/translate.Tpo $(DEPDIR)/translate.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/translate.c' object='translate.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o translate.o `test -f '$(srcdir)/x11/libvncserver/translate.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/translate.c
-
-translate.obj: $(srcdir)/x11/libvncserver/translate.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT translate.obj -MD -MP -MF $(DEPDIR)/translate.Tpo -c -o translate.obj `if test -f '$(srcdir)/x11/libvncserver/translate.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/translate.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/translate.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/translate.Tpo $(DEPDIR)/translate.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/translate.c' object='translate.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o translate.obj `if test -f '$(srcdir)/x11/libvncserver/translate.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/translate.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/translate.c'; fi`
-
-ultra.o: $(srcdir)/x11/libvncserver/ultra.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ultra.o -MD -MP -MF $(DEPDIR)/ultra.Tpo -c -o ultra.o `test -f '$(srcdir)/x11/libvncserver/ultra.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/ultra.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ultra.Tpo $(DEPDIR)/ultra.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/ultra.c' object='ultra.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ultra.o `test -f '$(srcdir)/x11/libvncserver/ultra.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/ultra.c
-
-ultra.obj: $(srcdir)/x11/libvncserver/ultra.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ultra.obj -MD -MP -MF $(DEPDIR)/ultra.Tpo -c -o ultra.obj `if test -f '$(srcdir)/x11/libvncserver/ultra.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/ultra.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/ultra.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/ultra.Tpo $(DEPDIR)/ultra.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/ultra.c' object='ultra.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ultra.obj `if test -f '$(srcdir)/x11/libvncserver/ultra.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/ultra.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/ultra.c'; fi`
-
-vncauth.o: $(srcdir)/x11/libvncserver/vncauth.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vncauth.o -MD -MP -MF $(DEPDIR)/vncauth.Tpo -c -o vncauth.o `test -f '$(srcdir)/x11/libvncserver/vncauth.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/vncauth.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/vncauth.Tpo $(DEPDIR)/vncauth.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/vncauth.c' object='vncauth.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vncauth.o `test -f '$(srcdir)/x11/libvncserver/vncauth.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/vncauth.c
-
-vncauth.obj: $(srcdir)/x11/libvncserver/vncauth.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vncauth.obj -MD -MP -MF $(DEPDIR)/vncauth.Tpo -c -o vncauth.obj `if test -f '$(srcdir)/x11/libvncserver/vncauth.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/vncauth.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/vncauth.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/vncauth.Tpo $(DEPDIR)/vncauth.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/vncauth.c' object='vncauth.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vncauth.obj `if test -f '$(srcdir)/x11/libvncserver/vncauth.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/vncauth.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/vncauth.c'; fi`
-
-zlib.o: $(srcdir)/x11/libvncserver/zlib.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zlib.o -MD -MP -MF $(DEPDIR)/zlib.Tpo -c -o zlib.o `test -f '$(srcdir)/x11/libvncserver/zlib.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/zlib.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/zlib.Tpo $(DEPDIR)/zlib.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/zlib.c' object='zlib.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zlib.o `test -f '$(srcdir)/x11/libvncserver/zlib.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/zlib.c
-
-zlib.obj: $(srcdir)/x11/libvncserver/zlib.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zlib.obj -MD -MP -MF $(DEPDIR)/zlib.Tpo -c -o zlib.obj `if test -f '$(srcdir)/x11/libvncserver/zlib.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/zlib.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/zlib.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/zlib.Tpo $(DEPDIR)/zlib.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/zlib.c' object='zlib.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zlib.obj `if test -f '$(srcdir)/x11/libvncserver/zlib.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/zlib.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/zlib.c'; fi`
-
-zrle.o: $(srcdir)/x11/libvncserver/zrle.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zrle.o -MD -MP -MF $(DEPDIR)/zrle.Tpo -c -o zrle.o `test -f '$(srcdir)/x11/libvncserver/zrle.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/zrle.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/zrle.Tpo $(DEPDIR)/zrle.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/zrle.c' object='zrle.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zrle.o `test -f '$(srcdir)/x11/libvncserver/zrle.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/zrle.c
-
-zrle.obj: $(srcdir)/x11/libvncserver/zrle.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zrle.obj -MD -MP -MF $(DEPDIR)/zrle.Tpo -c -o zrle.obj `if test -f '$(srcdir)/x11/libvncserver/zrle.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/zrle.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/zrle.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/zrle.Tpo $(DEPDIR)/zrle.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/zrle.c' object='zrle.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zrle.obj `if test -f '$(srcdir)/x11/libvncserver/zrle.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/zrle.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/zrle.c'; fi`
-
-zrleoutstream.o: $(srcdir)/x11/libvncserver/zrleoutstream.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zrleoutstream.o -MD -MP -MF $(DEPDIR)/zrleoutstream.Tpo -c -o zrleoutstream.o `test -f '$(srcdir)/x11/libvncserver/zrleoutstream.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/zrleoutstream.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/zrleoutstream.Tpo $(DEPDIR)/zrleoutstream.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/zrleoutstream.c' object='zrleoutstream.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zrleoutstream.o `test -f '$(srcdir)/x11/libvncserver/zrleoutstream.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/zrleoutstream.c
-
-zrleoutstream.obj: $(srcdir)/x11/libvncserver/zrleoutstream.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zrleoutstream.obj -MD -MP -MF $(DEPDIR)/zrleoutstream.Tpo -c -o zrleoutstream.obj `if test -f '$(srcdir)/x11/libvncserver/zrleoutstream.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/zrleoutstream.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/zrleoutstream.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/zrleoutstream.Tpo $(DEPDIR)/zrleoutstream.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/zrleoutstream.c' object='zrleoutstream.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zrleoutstream.obj `if test -f '$(srcdir)/x11/libvncserver/zrleoutstream.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/zrleoutstream.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/zrleoutstream.c'; fi`
-
-zrlepalettehelper.o: $(srcdir)/x11/libvncserver/zrlepalettehelper.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zrlepalettehelper.o -MD -MP -MF $(DEPDIR)/zrlepalettehelper.Tpo -c -o zrlepalettehelper.o `test -f '$(srcdir)/x11/libvncserver/zrlepalettehelper.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/zrlepalettehelper.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/zrlepalettehelper.Tpo $(DEPDIR)/zrlepalettehelper.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/zrlepalettehelper.c' object='zrlepalettehelper.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zrlepalettehelper.o `test -f '$(srcdir)/x11/libvncserver/zrlepalettehelper.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/zrlepalettehelper.c
-
-zrlepalettehelper.obj: $(srcdir)/x11/libvncserver/zrlepalettehelper.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zrlepalettehelper.obj -MD -MP -MF $(DEPDIR)/zrlepalettehelper.Tpo -c -o zrlepalettehelper.obj `if test -f '$(srcdir)/x11/libvncserver/zrlepalettehelper.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/zrlepalettehelper.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/zrlepalettehelper.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/zrlepalettehelper.Tpo $(DEPDIR)/zrlepalettehelper.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/zrlepalettehelper.c' object='zrlepalettehelper.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zrlepalettehelper.obj `if test -f '$(srcdir)/x11/libvncserver/zrlepalettehelper.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/zrlepalettehelper.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/zrlepalettehelper.c'; fi`
-
-tight.o: $(srcdir)/x11/libvncserver/tight.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tight.o -MD -MP -MF $(DEPDIR)/tight.Tpo -c -o tight.o `test -f '$(srcdir)/x11/libvncserver/tight.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/tight.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/tight.Tpo $(DEPDIR)/tight.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/tight.c' object='tight.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tight.o `test -f '$(srcdir)/x11/libvncserver/tight.c' || echo '$(srcdir)/'`$(srcdir)/x11/libvncserver/tight.c
-
-tight.obj: $(srcdir)/x11/libvncserver/tight.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tight.obj -MD -MP -MF $(DEPDIR)/tight.Tpo -c -o tight.obj `if test -f '$(srcdir)/x11/libvncserver/tight.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/tight.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/tight.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/tight.Tpo $(DEPDIR)/tight.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/x11/libvncserver/tight.c' object='tight.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tight.obj `if test -f '$(srcdir)/x11/libvncserver/tight.c'; then $(CYGPATH_W) '$(srcdir)/x11/libvncserver/tight.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/x11/libvncserver/tight.c'; fi`
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-ica_main.o: $(srcdir)/src/ica_main.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ica_main.o -MD -MP -MF $(DEPDIR)/ica_main.Tpo -c -o ica_main.o `test -f '$(srcdir)/src/ica_main.cpp' || echo '$(srcdir)/'`$(srcdir)/src/ica_main.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/ica_main.Tpo $(DEPDIR)/ica_main.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/ica_main.cpp' object='ica_main.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ica_main.o `test -f '$(srcdir)/src/ica_main.cpp' || echo '$(srcdir)/'`$(srcdir)/src/ica_main.cpp
-
-ica_main.obj: $(srcdir)/src/ica_main.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ica_main.obj -MD -MP -MF $(DEPDIR)/ica_main.Tpo -c -o ica_main.obj `if test -f '$(srcdir)/src/ica_main.cpp'; then $(CYGPATH_W) '$(srcdir)/src/ica_main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/ica_main.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/ica_main.Tpo $(DEPDIR)/ica_main.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/ica_main.cpp' object='ica_main.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ica_main.obj `if test -f '$(srcdir)/src/ica_main.cpp'; then $(CYGPATH_W) '$(srcdir)/src/ica_main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/ica_main.cpp'; fi`
-
-ivs.o: $(srcdir)/src/ivs.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ivs.o -MD -MP -MF $(DEPDIR)/ivs.Tpo -c -o ivs.o `test -f '$(srcdir)/src/ivs.cpp' || echo '$(srcdir)/'`$(srcdir)/src/ivs.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/ivs.Tpo $(DEPDIR)/ivs.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/ivs.cpp' object='ivs.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ivs.o `test -f '$(srcdir)/src/ivs.cpp' || echo '$(srcdir)/'`$(srcdir)/src/ivs.cpp
-
-ivs.obj: $(srcdir)/src/ivs.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ivs.obj -MD -MP -MF $(DEPDIR)/ivs.Tpo -c -o ivs.obj `if test -f '$(srcdir)/src/ivs.cpp'; then $(CYGPATH_W) '$(srcdir)/src/ivs.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/ivs.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/ivs.Tpo $(DEPDIR)/ivs.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/ivs.cpp' object='ivs.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ivs.obj `if test -f '$(srcdir)/src/ivs.cpp'; then $(CYGPATH_W) '$(srcdir)/src/ivs.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/ivs.cpp'; fi`
-
-isd_server.o: $(srcdir)/src/isd_server.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT isd_server.o -MD -MP -MF $(DEPDIR)/isd_server.Tpo -c -o isd_server.o `test -f '$(srcdir)/src/isd_server.cpp' || echo '$(srcdir)/'`$(srcdir)/src/isd_server.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/isd_server.Tpo $(DEPDIR)/isd_server.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/isd_server.cpp' object='isd_server.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o isd_server.o `test -f '$(srcdir)/src/isd_server.cpp' || echo '$(srcdir)/'`$(srcdir)/src/isd_server.cpp
-
-isd_server.obj: $(srcdir)/src/isd_server.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT isd_server.obj -MD -MP -MF $(DEPDIR)/isd_server.Tpo -c -o isd_server.obj `if test -f '$(srcdir)/src/isd_server.cpp'; then $(CYGPATH_W) '$(srcdir)/src/isd_server.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/isd_server.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/isd_server.Tpo $(DEPDIR)/isd_server.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/isd_server.cpp' object='isd_server.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o isd_server.obj `if test -f '$(srcdir)/src/isd_server.cpp'; then $(CYGPATH_W) '$(srcdir)/src/isd_server.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/isd_server.cpp'; fi`
-
-local_system_ica.o: $(srcdir)/src/local_system_ica.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT local_system_ica.o -MD -MP -MF $(DEPDIR)/local_system_ica.Tpo -c -o local_system_ica.o `test -f '$(srcdir)/src/local_system_ica.cpp' || echo '$(srcdir)/'`$(srcdir)/src/local_system_ica.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/local_system_ica.Tpo $(DEPDIR)/local_system_ica.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/local_system_ica.cpp' object='local_system_ica.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o local_system_ica.o `test -f '$(srcdir)/src/local_system_ica.cpp' || echo '$(srcdir)/'`$(srcdir)/src/local_system_ica.cpp
-
-local_system_ica.obj: $(srcdir)/src/local_system_ica.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT local_system_ica.obj -MD -MP -MF $(DEPDIR)/local_system_ica.Tpo -c -o local_system_ica.obj `if test -f '$(srcdir)/src/local_system_ica.cpp'; then $(CYGPATH_W) '$(srcdir)/src/local_system_ica.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/local_system_ica.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/local_system_ica.Tpo $(DEPDIR)/local_system_ica.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/local_system_ica.cpp' object='local_system_ica.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o local_system_ica.obj `if test -f '$(srcdir)/src/local_system_ica.cpp'; then $(CYGPATH_W) '$(srcdir)/src/local_system_ica.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/local_system_ica.cpp'; fi`
-
-system_service.o: $(srcdir)/src/system_service.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT system_service.o -MD -MP -MF $(DEPDIR)/system_service.Tpo -c -o system_service.o `test -f '$(srcdir)/src/system_service.cpp' || echo '$(srcdir)/'`$(srcdir)/src/system_service.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/system_service.Tpo $(DEPDIR)/system_service.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/system_service.cpp' object='system_service.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o system_service.o `test -f '$(srcdir)/src/system_service.cpp' || echo '$(srcdir)/'`$(srcdir)/src/system_service.cpp
-
-system_service.obj: $(srcdir)/src/system_service.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT system_service.obj -MD -MP -MF $(DEPDIR)/system_service.Tpo -c -o system_service.obj `if test -f '$(srcdir)/src/system_service.cpp'; then $(CYGPATH_W) '$(srcdir)/src/system_service.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/system_service.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/system_service.Tpo $(DEPDIR)/system_service.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/system_service.cpp' object='system_service.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o system_service.obj `if test -f '$(srcdir)/src/system_service.cpp'; then $(CYGPATH_W) '$(srcdir)/src/system_service.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/system_service.cpp'; fi`
-
-demo_server.o: $(srcdir)/src/demo_server.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT demo_server.o -MD -MP -MF $(DEPDIR)/demo_server.Tpo -c -o demo_server.o `test -f '$(srcdir)/src/demo_server.cpp' || echo '$(srcdir)/'`$(srcdir)/src/demo_server.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/demo_server.Tpo $(DEPDIR)/demo_server.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/demo_server.cpp' object='demo_server.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o demo_server.o `test -f '$(srcdir)/src/demo_server.cpp' || echo '$(srcdir)/'`$(srcdir)/src/demo_server.cpp
-
-demo_server.obj: $(srcdir)/src/demo_server.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT demo_server.obj -MD -MP -MF $(DEPDIR)/demo_server.Tpo -c -o demo_server.obj `if test -f '$(srcdir)/src/demo_server.cpp'; then $(CYGPATH_W) '$(srcdir)/src/demo_server.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/demo_server.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/demo_server.Tpo $(DEPDIR)/demo_server.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/demo_server.cpp' object='demo_server.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o demo_server.obj `if test -f '$(srcdir)/src/demo_server.cpp'; then $(CYGPATH_W) '$(srcdir)/src/demo_server.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/demo_server.cpp'; fi`
-
-demo_client.o: $(srcdir)/src/demo_client.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT demo_client.o -MD -MP -MF $(DEPDIR)/demo_client.Tpo -c -o demo_client.o `test -f '$(srcdir)/src/demo_client.cpp' || echo '$(srcdir)/'`$(srcdir)/src/demo_client.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/demo_client.Tpo $(DEPDIR)/demo_client.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/demo_client.cpp' object='demo_client.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o demo_client.o `test -f '$(srcdir)/src/demo_client.cpp' || echo '$(srcdir)/'`$(srcdir)/src/demo_client.cpp
-
-demo_client.obj: $(srcdir)/src/demo_client.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT demo_client.obj -MD -MP -MF $(DEPDIR)/demo_client.Tpo -c -o demo_client.obj `if test -f '$(srcdir)/src/demo_client.cpp'; then $(CYGPATH_W) '$(srcdir)/src/demo_client.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/demo_client.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/demo_client.Tpo $(DEPDIR)/demo_client.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/demo_client.cpp' object='demo_client.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o demo_client.obj `if test -f '$(srcdir)/src/demo_client.cpp'; then $(CYGPATH_W) '$(srcdir)/src/demo_client.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/demo_client.cpp'; fi`
-
-ica_qrc.o: $(srcdir)/ica_qrc.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ica_qrc.o -MD -MP -MF $(DEPDIR)/ica_qrc.Tpo -c -o ica_qrc.o `test -f '$(srcdir)/ica_qrc.cpp' || echo '$(srcdir)/'`$(srcdir)/ica_qrc.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/ica_qrc.Tpo $(DEPDIR)/ica_qrc.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/ica_qrc.cpp' object='ica_qrc.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ica_qrc.o `test -f '$(srcdir)/ica_qrc.cpp' || echo '$(srcdir)/'`$(srcdir)/ica_qrc.cpp
-
-ica_qrc.obj: $(srcdir)/ica_qrc.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ica_qrc.obj -MD -MP -MF $(DEPDIR)/ica_qrc.Tpo -c -o ica_qrc.obj `if test -f '$(srcdir)/ica_qrc.cpp'; then $(CYGPATH_W) '$(srcdir)/ica_qrc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/ica_qrc.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/ica_qrc.Tpo $(DEPDIR)/ica_qrc.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/ica_qrc.cpp' object='ica_qrc.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ica_qrc.obj `if test -f '$(srcdir)/ica_qrc.cpp'; then $(CYGPATH_W) '$(srcdir)/ica_qrc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/ica_qrc.cpp'; fi`
-
-win32vnc.o: $(srcdir)/win32/win32vnc.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT win32vnc.o -MD -MP -MF $(DEPDIR)/win32vnc.Tpo -c -o win32vnc.o `test -f '$(srcdir)/win32/win32vnc.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/win32vnc.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/win32vnc.Tpo $(DEPDIR)/win32vnc.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/win32vnc.cpp' object='win32vnc.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o win32vnc.o `test -f '$(srcdir)/win32/win32vnc.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/win32vnc.cpp
-
-win32vnc.obj: $(srcdir)/win32/win32vnc.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT win32vnc.obj -MD -MP -MF $(DEPDIR)/win32vnc.Tpo -c -o win32vnc.obj `if test -f '$(srcdir)/win32/win32vnc.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/win32vnc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/win32vnc.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/win32vnc.Tpo $(DEPDIR)/win32vnc.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/win32vnc.cpp' object='win32vnc.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o win32vnc.obj `if test -f '$(srcdir)/win32/win32vnc.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/win32vnc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/win32vnc.cpp'; fi`
-
-vncEncodeZlib.o: $(srcdir)/win32/src/vncEncodeZlib.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncEncodeZlib.o -MD -MP -MF $(DEPDIR)/vncEncodeZlib.Tpo -c -o vncEncodeZlib.o `test -f '$(srcdir)/win32/src/vncEncodeZlib.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncEncodeZlib.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncEncodeZlib.Tpo $(DEPDIR)/vncEncodeZlib.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/src/vncEncodeZlib.cpp' object='vncEncodeZlib.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncEncodeZlib.o `test -f '$(srcdir)/win32/src/vncEncodeZlib.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncEncodeZlib.cpp
-
-vncEncodeZlib.obj: $(srcdir)/win32/src/vncEncodeZlib.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncEncodeZlib.obj -MD -MP -MF $(DEPDIR)/vncEncodeZlib.Tpo -c -o vncEncodeZlib.obj `if test -f '$(srcdir)/win32/src/vncEncodeZlib.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncEncodeZlib.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncEncodeZlib.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncEncodeZlib.Tpo $(DEPDIR)/vncEncodeZlib.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/src/vncEncodeZlib.cpp' object='vncEncodeZlib.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncEncodeZlib.obj `if test -f '$(srcdir)/win32/src/vncEncodeZlib.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncEncodeZlib.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncEncodeZlib.cpp'; fi`
-
-vncEncodeRRE.o: $(srcdir)/win32/src/vncEncodeRRE.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncEncodeRRE.o -MD -MP -MF $(DEPDIR)/vncEncodeRRE.Tpo -c -o vncEncodeRRE.o `test -f '$(srcdir)/win32/src/vncEncodeRRE.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncEncodeRRE.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncEncodeRRE.Tpo $(DEPDIR)/vncEncodeRRE.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/src/vncEncodeRRE.cpp' object='vncEncodeRRE.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncEncodeRRE.o `test -f '$(srcdir)/win32/src/vncEncodeRRE.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncEncodeRRE.cpp
-
-vncEncodeRRE.obj: $(srcdir)/win32/src/vncEncodeRRE.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncEncodeRRE.obj -MD -MP -MF $(DEPDIR)/vncEncodeRRE.Tpo -c -o vncEncodeRRE.obj `if test -f '$(srcdir)/win32/src/vncEncodeRRE.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncEncodeRRE.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncEncodeRRE.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncEncodeRRE.Tpo $(DEPDIR)/vncEncodeRRE.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/src/vncEncodeRRE.cpp' object='vncEncodeRRE.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncEncodeRRE.obj `if test -f '$(srcdir)/win32/src/vncEncodeRRE.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncEncodeRRE.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncEncodeRRE.cpp'; fi`
-
-vncEncodeTight.o: $(srcdir)/win32/src/vncEncodeTight.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncEncodeTight.o -MD -MP -MF $(DEPDIR)/vncEncodeTight.Tpo -c -o vncEncodeTight.o `test -f '$(srcdir)/win32/src/vncEncodeTight.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncEncodeTight.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncEncodeTight.Tpo $(DEPDIR)/vncEncodeTight.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/src/vncEncodeTight.cpp' object='vncEncodeTight.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncEncodeTight.o `test -f '$(srcdir)/win32/src/vncEncodeTight.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncEncodeTight.cpp
-
-vncEncodeTight.obj: $(srcdir)/win32/src/vncEncodeTight.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncEncodeTight.obj -MD -MP -MF $(DEPDIR)/vncEncodeTight.Tpo -c -o vncEncodeTight.obj `if test -f '$(srcdir)/win32/src/vncEncodeTight.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncEncodeTight.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncEncodeTight.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncEncodeTight.Tpo $(DEPDIR)/vncEncodeTight.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/src/vncEncodeTight.cpp' object='vncEncodeTight.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncEncodeTight.obj `if test -f '$(srcdir)/win32/src/vncEncodeTight.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncEncodeTight.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncEncodeTight.cpp'; fi`
-
-vncEncodeCoRRE.o: $(srcdir)/win32/src/vncEncodeCoRRE.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncEncodeCoRRE.o -MD -MP -MF $(DEPDIR)/vncEncodeCoRRE.Tpo -c -o vncEncodeCoRRE.o `test -f '$(srcdir)/win32/src/vncEncodeCoRRE.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncEncodeCoRRE.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncEncodeCoRRE.Tpo $(DEPDIR)/vncEncodeCoRRE.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/src/vncEncodeCoRRE.cpp' object='vncEncodeCoRRE.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncEncodeCoRRE.o `test -f '$(srcdir)/win32/src/vncEncodeCoRRE.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncEncodeCoRRE.cpp
-
-vncEncodeCoRRE.obj: $(srcdir)/win32/src/vncEncodeCoRRE.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncEncodeCoRRE.obj -MD -MP -MF $(DEPDIR)/vncEncodeCoRRE.Tpo -c -o vncEncodeCoRRE.obj `if test -f '$(srcdir)/win32/src/vncEncodeCoRRE.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncEncodeCoRRE.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncEncodeCoRRE.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncEncodeCoRRE.Tpo $(DEPDIR)/vncEncodeCoRRE.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/src/vncEncodeCoRRE.cpp' object='vncEncodeCoRRE.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncEncodeCoRRE.obj `if test -f '$(srcdir)/win32/src/vncEncodeCoRRE.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncEncodeCoRRE.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncEncodeCoRRE.cpp'; fi`
-
-vncEncodeHexT.o: $(srcdir)/win32/src/vncEncodeHexT.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncEncodeHexT.o -MD -MP -MF $(DEPDIR)/vncEncodeHexT.Tpo -c -o vncEncodeHexT.o `test -f '$(srcdir)/win32/src/vncEncodeHexT.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncEncodeHexT.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncEncodeHexT.Tpo $(DEPDIR)/vncEncodeHexT.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/src/vncEncodeHexT.cpp' object='vncEncodeHexT.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncEncodeHexT.o `test -f '$(srcdir)/win32/src/vncEncodeHexT.cpp' || echo '$(srcdir)/'`$(srcdir)/win32/src/vncEncodeHexT.cpp
-
-vncEncodeHexT.obj: $(srcdir)/win32/src/vncEncodeHexT.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncEncodeHexT.obj -MD -MP -MF $(DEPDIR)/vncEncodeHexT.Tpo -c -o vncEncodeHexT.obj `if test -f '$(srcdir)/win32/src/vncEncodeHexT.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncEncodeHexT.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncEncodeHexT.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncEncodeHexT.Tpo $(DEPDIR)/vncEncodeHexT.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/win32/src/vncEncodeHexT.cpp' object='vncEncodeHexT.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncEncodeHexT.obj `if test -f '$(srcdir)/win32/src/vncEncodeHexT.cpp'; then $(CYGPATH_W) '$(srcdir)/win32/src/vncEncodeHexT.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/win32/src/vncEncodeHexT.cpp'; fi`
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-man1: $(man_MANS)
-	@$(NORMAL_INSTALL)
-	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list=''; test -n "$(man1dir)" || exit 0; \
-	{ for i in $$list; do echo "$$i"; done; \
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.1[a-z]*$$/p'; \
-	} | while read p; do \
-	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; echo "$$p"; \
-	done | \
-	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
-	sed 'N;N;s,\n, ,g' | { \
-	list=; while read file base inst; do \
-	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
-	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
-	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
-	  fi; \
-	done; \
-	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
-	while read files; do \
-	  test -z "$$files" || { \
-	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
-	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
-	done; }
-
-uninstall-man1:
-	@$(NORMAL_UNINSTALL)
-	@list=''; test -n "$(man1dir)" || exit 0; \
-	files=`{ for i in $$list; do echo "$$i"; done; \
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.1[a-z]*$$/p'; \
-	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	test -z "$$files" || { \
-	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
-	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@list='$(MANS)'; if test -n "$$list"; then \
-	  list=`for p in $$list; do \
-	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-	  if test -n "$$list" && \
-	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
-	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
-	    exit 1; \
-	  else :; fi; \
-	else :; fi
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(PROGRAMS) $(MANS)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man1
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-man
-
-uninstall-man: uninstall-man1
-
-.MAKE: all check install install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic clean-libtool ctags distclean distclean-compile \
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-binPROGRAMS install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-man1 install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am uninstall-binPROGRAMS uninstall-man \
-	uninstall-man1
-
-
- at BUILD_LINUX_FALSE@VNCHooks.o: $(srcdir)/win32/src/VNCHooks/VNCHooks.cpp
- at BUILD_LINUX_FALSE@	$(CXX) $(INCLUDES) $(AM_CXXFLAGS) $< -c -o $@
-
- at BUILD_LINUX_FALSE@SharedData.o: $(srcdir)/win32/src/VNCHooks/SharedData.cpp
- at BUILD_LINUX_FALSE@	$(CXX) $(INCLUDES) $(AM_CXXFLAGS) $< -c -o $@
-
- at BUILD_LINUX_FALSE@vnchooks.dll: VNCHooks.o SharedData.o
- at BUILD_LINUX_FALSE@	$(CXX) VNCHooks.o SharedData.o -shared -Wl,-no-undefined -Wl,-enable-runtime-pseudo-reloc -Wl,-enable-auto-image-base -Wl,--out-implib,libvnchooks.a -lgdi32 -o $@ && $(STRIP) $@
-
- at BUILD_WIN32_TRUE@ica_win_resources.o: ica.rc vnchooks.dll
- at BUILD_WIN32_TRUE@	$(WINDRES) -o $@ $<
-
-%.moc: $(srcdir)/%.h
-	$(MOC) -o $@ $<
-
-./ica_qrc.cpp: ica.qrc
-	$(RCC) $< > $@
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/ica/helpers/CMakeLists.txt b/ica/helpers/CMakeLists.txt
new file mode 100644
index 0000000..6fc4a7c
--- /dev/null
+++ b/ica/helpers/CMakeLists.txt
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 0000000..9705d32
--- /dev/null
+++ b/ica/helpers/ItalcAuthHelper.cpp
@@ -0,0 +1,78 @@
+#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
index 095a1f4..301b5fe 100644
--- a/ica/ica.1
+++ b/ica/ica.1
@@ -37,11 +37,11 @@ is the software which needs to run on clients in order to access them using iTAL
 Set role under which ICA should run where \fIrole\fP has to be "teacher", "admin", "supporter" or "other". This is mainly used in combination with the \fB-createkeypair\fP option.
 .IP "\fB\-ivsport\fP \fIport\fP
 .IP
-Set port at which the iTALC-VNC-server should listen. Default: 5900
+Set port at which the iTALC-VNC-server should listen. Default: 11100
 .
 .IP "\fB\-isdport\fP \fIport\fP
 .IP
-Set port at which the iTALC-service-daemon should listen. Default: 5800
+Set port at which the iTALC-service-daemon should listen. Default: 11200
 .
 .IP \fB-noshm\fR
 .IP
diff --git a/ica/ica.rc b/ica/ica.rc
new file mode 100644
index 0000000..c07ae70
--- /dev/null
+++ b/ica/ica.rc
@@ -0,0 +1,35 @@
+#include <windows.h>
+#include "win32/winvnc/winvnc/resource.h"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// JAVAARCHIVE
+//
+
+IDR_VNCVIEWER_JAR       JAVAARCHIVE             "JavaViewer/VncViewer.jar"
+
+
+
+VS_VERSION_INFO	VERSIONINFO
+  FILEVERSION	2,0,0,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-2011 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
index 0ebd2ac..38f1041 100644
--- a/ica/ica.rc.in
+++ b/ica/ica.rc.in
@@ -1,7 +1,17 @@
 #include <windows.h>
+#include "win32/winvnc/winvnc/resource.h"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// JAVAARCHIVE
+//
+
+IDR_VNCVIEWER_JAR       JAVAARCHIVE             "JavaViewer/VncViewer.jar"
+
+
 
 VS_VERSION_INFO	VERSIONINFO
-  FILEVERSION	1,0,13,0
+  FILEVERSION	2,0,0,0
   FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
   FILEOS	VOS_NT_WINDOWS32
   FILETYPE	VFT_APP
diff --git a/ica/src/AccessDialogSlave.cpp b/ica/src/AccessDialogSlave.cpp
new file mode 100644
index 0000000..62637f8
--- /dev/null
+++ b/ica/src/AccessDialogSlave.cpp
@@ -0,0 +1,123 @@
+/*
+ * 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
new file mode 100644
index 0000000..7de24db
--- /dev/null
+++ b/ica/src/AccessDialogSlave.h
@@ -0,0 +1,51 @@
+/*
+ * 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
new file mode 100644
index 0000000..a3225f0
--- /dev/null
+++ b/ica/src/DemoClient.cpp
@@ -0,0 +1,117 @@
+/*
+ * 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
new file mode 100644
index 0000000..1ba6799
--- /dev/null
+++ b/ica/src/DemoClient.h
@@ -0,0 +1,54 @@
+/*
+ * DemoClient.h - client for demo-server
+ *
+ * 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.
+ *
+ */
+
+
+#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
new file mode 100644
index 0000000..71c7e18
--- /dev/null
+++ b/ica/src/DemoClientSlave.cpp
@@ -0,0 +1,57 @@
+/*
+ * 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
new file mode 100644
index 0000000..66842f4
--- /dev/null
+++ b/ica/src/DemoClientSlave.h
@@ -0,0 +1,53 @@
+/*
+ * DemoClientSlave.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_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
new file mode 100644
index 0000000..0483967
--- /dev/null
+++ b/ica/src/DemoServer.cpp
@@ -0,0 +1,659 @@
+/*
+ * DemoServer.cpp - 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.
+ *
+ */
+
+#include <QtCore/QDateTime>
+#include <QtNetwork/QTcpSocket>
+#include <QtCore/QTimer>
+#include <QtGui/QCursor>
+
+#include "DemoServer.h"
+#include "ItalcCoreServer.h"
+#include "ItalcVncConnection.h"
+#include "QuadTree.h"
+#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] )
+{
+	start();
+}
+
+
+
+
+DemoServerClient::~DemoServerClient()
+{
+	exit();
+	wait();
+	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,
+			Swap16IfLE( 1 )
+		} ;
+
+		m_sock->write( (const char *) &m, sizeof( m ) );
+
+		const rfbRectangle rr =
+		{
+			Swap16IfLE( m_lastCursorPos.x() ),
+			Swap16IfLE( m_lastCursorPos.y() ),
+			Swap16IfLE( 0 ),
+			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
+	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();
+	}
+
+	// no we gonna post all changed rects!
+	const rfbFramebufferUpdateMsg m =
+	{
+		rfbFramebufferUpdate,
+		0,
+		Swap16IfLE( r.size() +
+				( m_cursorShapeChanged ? 1 : 0 ) )
+	} ;
+
+	SocketDevice sd( qtcpsocketDispatcher, m_sock );
+	sd.write( (const char *) &m, sz_rfbFramebufferUpdateMsg );
+
+	// process each rect
+	for( QVector<QuadTreeRect>::const_iterator it = r.begin(); it != r.end(); ++it )
+	{
+		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;
+		const rfbRectangle rr =
+		{
+			Swap16IfLE( rx ),
+			Swap16IfLE( ry ),
+			Swap16IfLE( rw ),
+			Swap16IfLE( rh )
+		} ;
+
+		const rfbFramebufferUpdateRectHeader rhdr =
+		{
+			rr,
+			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 );
+	uint8_t rle_cnt = 0;
+	uint8_t rle_sub = 1;
+	uint8_t *out = new uint8_t[rw * rh * sizeof( QRgb )+16];
+	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;
+	uint8_t *comp = new uint8_t[bytes_lzo];
+	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 ) );
+	delete[] out;
+	delete[] comp;
+
+		}
+		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 =
+		{
+			Swap16IfLE( m_cursorHotX ),
+			Swap16IfLE( m_cursorHotY ),
+			Swap16IfLE( cur.width() ),
+			Swap16IfLE( cur.height() )
+		} ;
+
+		const rfbFramebufferUpdateRectHeader rh =
+		{
+			rr,
+			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( deleteLater() ) );
+
+	// 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();
+}
+
+
diff --git a/ica/src/DemoServer.h b/ica/src/DemoServer.h
new file mode 100644
index 0000000..e911211
--- /dev/null
+++ b/ica/src/DemoServer.h
@@ -0,0 +1,143 @@
+/*
+ * 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;
+
+} ;
+
+
+#endif
+
diff --git a/ica/src/DemoServerMaster.cpp b/ica/src/DemoServerMaster.cpp
new file mode 100644
index 0000000..f4233b0
--- /dev/null
+++ b/ica/src/DemoServerMaster.cpp
@@ -0,0 +1,75 @@
+/*
+ * 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
new file mode 100644
index 0000000..916cf46
--- /dev/null
+++ b/ica/src/DemoServerMaster.h
@@ -0,0 +1,69 @@
+/*
+ * 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
new file mode 100644
index 0000000..87cd544
--- /dev/null
+++ b/ica/src/DemoServerSlave.cpp
@@ -0,0 +1,132 @@
+/*
+ * 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
new file mode 100644
index 0000000..2ad01a1
--- /dev/null
+++ b/ica/src/DemoServerSlave.h
@@ -0,0 +1,52 @@
+/*
+ * 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
new file mode 100644
index 0000000..a4f50d0
--- /dev/null
+++ b/ica/src/DesktopAccessPermission.cpp
@@ -0,0 +1,93 @@
+/*
+ * 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
new file mode 100644
index 0000000..588f4d7
--- /dev/null
+++ b/ica/src/DesktopAccessPermission.h
@@ -0,0 +1,62 @@
+/*
+ * 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
new file mode 100644
index 0000000..cc3f831
--- /dev/null
+++ b/ica/src/IcaMain.cpp
@@ -0,0 +1,327 @@
+/*
+ * 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
new file mode 100644
index 0000000..b292ad4
--- /dev/null
+++ b/ica/src/IcaSlave.h
@@ -0,0 +1,46 @@
+/*
+ * 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
new file mode 100644
index 0000000..2cd4ab8
--- /dev/null
+++ b/ica/src/InputLockSlave.cpp
@@ -0,0 +1,51 @@
+/*
+ * 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
new file mode 100644
index 0000000..7b71ddd
--- /dev/null
+++ b/ica/src/InputLockSlave.h
@@ -0,0 +1,53 @@
+/*
+ * 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
new file mode 100644
index 0000000..8e09a6c
--- /dev/null
+++ b/ica/src/ItalcCoreServer.cpp
@@ -0,0 +1,461 @@
+/*
+ * 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
new file mode 100644
index 0000000..efb77a3
--- /dev/null
+++ b/ica/src/ItalcCoreServer.h
@@ -0,0 +1,86 @@
+/*
+ * 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
new file mode 100644
index 0000000..265a848
--- /dev/null
+++ b/ica/src/ItalcSlaveManager.cpp
@@ -0,0 +1,292 @@
+/*
+ * 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
new file mode 100644
index 0000000..ff2e7a0
--- /dev/null
+++ b/ica/src/ItalcSlaveManager.h
@@ -0,0 +1,129 @@
+/*
+ * 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
new file mode 100644
index 0000000..c63608a
--- /dev/null
+++ b/ica/src/ItalcVncServer.cpp
@@ -0,0 +1,370 @@
+/*
+ * ItalcVncServer.cpp - implementation of 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.
+ *
+ */
+
+#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=" ) )
+		{
+			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() );
+	}
+
+	if( plainVnc == false )
+	{
+		// register iTALC protocol extension
+		rfbProtocolExtension pe;
+		pe.newClient = italcCoreNewClient;
+		pe.init = NULL;
+		pe.enablePseudoEncoding = NULL;
+		pe.pseudoEncodings = NULL;
+		pe.handleMessage = lvs_italcHandleMessage;
+		pe.close = NULL;
+		pe.usage = NULL;
+		pe.processArgument = NULL;
+		pe.next = NULL;
+		rfbRegisterProtocolExtension( &pe );
+	}
+
+	// register handler for iTALC's security-type
+	rfbSecurityHandler shi = { rfbSecTypeItalc, lvs_italcSecurityHandler, NULL };
+	rfbRegisterSecurityHandler( &shi );
+
+#ifndef ITALC_BUILD_WIN32
+	// register handler for MS Logon II security type
+	rfbSecurityHandler shmsl = { rfbUltraVNC_MsLogonIIAuth, lvs_msLogonIISecurityHandler, NULL };
+	rfbRegisterSecurityHandler( &shmsl );
+
+	rfbSecurityHandler shmsl_legacy = { rfbMSLogon, lvs_msLogonIISecurityHandler, NULL };
+	rfbRegisterSecurityHandler( &shmsl_legacy );
+#endif
+
+	// run x11vnc-server
+	x11vnc_main( argc, argv );
+
+}
+
+
+
+void ItalcVncServer::runVncReflector( int srcPort, int dstPort )
+{
+#ifdef ITALC_BUILD_WIN32
+	pthread_win32_process_attach_np();
+	pthread_win32_thread_attach_np();
+#endif
+
+	QStringList args;
+	args << "-viewonly"
+		<< "-reflect"
+		<< QString( "localhost:%1" ).arg( srcPort );
+	if( ItalcCore::config->isDemoServerMultithreaded() )
+	{
+		args << "-threads";
+	}
+
+	while( 1 )
+	{
+		runX11vnc( args, dstPort, true );
+	}
+
+#ifdef ITALC_BUILD_WIN32
+	pthread_win32_thread_detach_np();
+	pthread_win32_process_detach_np();
+#endif
+}
+
+
+
+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
new file mode 100644
index 0000000..e9b88ce
--- /dev/null
+++ b/ica/src/ItalcVncServer.h
@@ -0,0 +1,53 @@
+/*
+ * 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
new file mode 100644
index 0000000..732bdba
--- /dev/null
+++ b/ica/src/LocalSystemIca.cpp
@@ -0,0 +1,193 @@
+/*
+ * 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
new file mode 100644
index 0000000..826454d
--- /dev/null
+++ b/ica/src/MessageBoxSlave.cpp
@@ -0,0 +1,56 @@
+/*
+ * 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
new file mode 100644
index 0000000..b61165e
--- /dev/null
+++ b/ica/src/MessageBoxSlave.h
@@ -0,0 +1,50 @@
+/*
+ * 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
new file mode 100644
index 0000000..05a9ac4
--- /dev/null
+++ b/ica/src/RfbItalcCursor.cpp
@@ -0,0 +1,71 @@
+/*
+ * 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
new file mode 100644
index 0000000..ae3cc73
--- /dev/null
+++ b/ica/src/RfbItalcCursor.h
@@ -0,0 +1,41 @@
+/*
+ * 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
new file mode 100644
index 0000000..df4133e
--- /dev/null
+++ b/ica/src/RfbLZORLE.cpp
@@ -0,0 +1,188 @@
+/*
+ * 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
new file mode 100644
index 0000000..e98d4aa
--- /dev/null
+++ b/ica/src/RfbLZORLE.h
@@ -0,0 +1,50 @@
+/*
+ * 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
new file mode 100644
index 0000000..9eeca05
--- /dev/null
+++ b/ica/src/ScreenLockSlave.cpp
@@ -0,0 +1,51 @@
+/*
+ * 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
new file mode 100644
index 0000000..5b90877
--- /dev/null
+++ b/ica/src/ScreenLockSlave.h
@@ -0,0 +1,53 @@
+/*
+ * 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
new file mode 100644
index 0000000..1189cc5
--- /dev/null
+++ b/ica/src/ScreenLockSlaveLauncher.cpp
@@ -0,0 +1,129 @@
+/*
+ * 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
new file mode 100644
index 0000000..ec695b4
--- /dev/null
+++ b/ica/src/ScreenLockSlaveLauncher.h
@@ -0,0 +1,63 @@
+/*
+ * 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
new file mode 100644
index 0000000..365162d
--- /dev/null
+++ b/ica/src/SystemTrayIconSlave.cpp
@@ -0,0 +1,69 @@
+/*
+ * 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
new file mode 100644
index 0000000..1c416f7
--- /dev/null
+++ b/ica/src/SystemTrayIconSlave.h
@@ -0,0 +1,54 @@
+/*
+ * 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
new file mode 100644
index 0000000..2c7a4b0
--- /dev/null
+++ b/ica/src/WindowsService.cpp
@@ -0,0 +1,826 @@
+/*
+ * 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
new file mode 100644
index 0000000..2ec3504
--- /dev/null
+++ b/ica/src/WindowsService.h
@@ -0,0 +1,125 @@
+/*
+ * 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/demo_client.cpp b/ica/src/demo_client.cpp
deleted file mode 100644
index a4f20a5..0000000
--- a/ica/src/demo_client.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * demo_client.cpp - client for demo-server
- *
- * Copyright (c) 2006-2008 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 "demo_client.h"
-#include "vncview.h"
-#include "lock_widget.h"
-#include "local_system.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, TRUE );
-	m_toplevel->resize( QApplication::desktop()->availableGeometry( m_toplevel ).size() );
-
-	QVBoxLayout * toplevel_layout = new QVBoxLayout;
-	toplevel_layout->setMargin( 0 );
-	toplevel_layout->setSpacing( 0 );
-	toplevel_layout->addWidget( new vncView( _host, m_toplevel, TRUE ) );
-
-	m_toplevel->setLayout( toplevel_layout );
-
-	connect( m_toplevel, SIGNAL( destroyed( QObject * ) ),
-			this, SLOT( viewDestroyed( QObject * ) ) );
-	if( !_fullscreen )
-	{
-		m_toplevel->showMaximized();
-		localSystem::activateWindow( m_toplevel );
-
-	}
-}
-
-
-
-
-demoClient::~demoClient()
-{
-	delete m_toplevel;
-}
-
-
-
-
-void demoClient::viewDestroyed( QObject * _obj )
-{
-	if( m_toplevel == _obj )
-	{
-		m_toplevel = NULL;
-	}
-	deleteLater();
-}
-
-
-
-#include "demo_client.moc"
diff --git a/ica/src/demo_client.h b/ica/src/demo_client.h
deleted file mode 100644
index 73c8df2..0000000
--- a/ica/src/demo_client.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * demo_client.h - client for demo-server
- *           
- * Copyright (c) 2006 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 demoClient : public QObject
-{
-	Q_OBJECT
-public:
-	demoClient( const QString & _host, bool _fullscreen );
-	virtual ~demoClient();
-
-
-private slots:
-	void viewDestroyed( QObject * );
-
-
-private:
-	QWidget * m_toplevel;
-
-} ;
-
-
-#endif
-
diff --git a/ica/src/demo_server.cpp b/ica/src/demo_server.cpp
deleted file mode 100644
index 66e4349..0000000
--- a/ica/src/demo_server.cpp
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- * demo_server.cpp - 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.
- *
- */
-
-
-#include <QtCore/QDateTime>
-#include <QtCore/QTimer>
-#include <QtCore/QVector>
-#include <QtGui/QCursor>
-
-
-#include "demo_server.h"
-#include "QuadTree.h"
-#include "isd_server.h"
-#include "italc_rfb_ext.h"
-#include "minilzo.h"
-#include "ivs.h"
-
-
-const int CURSOR_UPDATE_TIME = 35;
-
-int demoServer::s_numOfInstances = 0;
-
-
-demoServer::demoServer( IVS * _ivs_conn, int _quality, quint16 _port,
-							QTcpSocket * _parent ) :
-	QTcpServer( _parent ),
-	m_conn( new ivsConnection(
-			QHostAddress( QHostAddress::LocalHost ).toString() +
-					":" + QString::number(
-						_ivs_conn->serverPort() ),
-			static_cast<ivsConnection::quality>(
-				ivsConnection::QualityDemoLow +
-						qBound( 0, _quality, 2 ) ),
-				_ivs_conn->runningInSeparateProcess() ) ),
-	m_updaterThread( new updaterThread( m_conn ) )
-{
-	++s_numOfInstances;
-
-	if( listen( QHostAddress::Any, _port ) == FALSE )
-	{
-		qCritical( "demoServer::demoServer(): "
-					"could not start demo-server!" );
-		return;
-	}
-
-	m_updaterThread->start(/* QThread::HighPriority*/ );
-
-	checkForCursorMovement();
-}
-
-
-
-
-demoServer::~demoServer()
-{
-	QList<demoServerClient *> l;
-	while( !( l = findChildren<demoServerClient *>() ).isEmpty() )
-	{
-		delete l.front();
-	}
-	--s_numOfInstances;
-
-	delete m_updaterThread;
-	delete m_conn;
-}
-
-
-
-
-void demoServer::checkForCursorMovement( void )
-{
-	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::incomingConnection( int _sd )
-{
-	new demoServerClient( _sd, m_conn, this );
-}
-
-
-
-
-
-
-demoServer::updaterThread::updaterThread( ivsConnection * _ic ) :
-	QThread(),
-	m_conn( _ic ),
-	m_quit( FALSE )
-{
-}
-
-
-
-
-demoServer::updaterThread::~updaterThread()
-{
-	m_quit = TRUE;
-	wait();
-}
-
-
-
-
-void demoServer::updaterThread::run( void )
-{
-	int i = 0;
-	while( !m_quit )
-	{
-		while( !m_quit && m_conn->state() != ivsConnection::Connected &&
-				m_conn->open() != ivsConnection::Connected )
-		{
-			qWarning( "demoServer::updaterThread::run(): "
-					"could not connect to local IVS!" );
-			sleep( 1 );
-		}
-		msleep( 20 );
-		m_conn->handleServerMessages( ( i = ( i + 1 ) % 2 ) == 0 );
-	}
-	m_conn->gracefulClose();
-}
-
-
-
-
-
-
-
-
-
-
-
-demoServerClient::demoServerClient( int _sd, const ivsConnection * _conn,
-							demoServer * _parent ) :
-	QThread( _parent ),
-	m_ds( _parent ),
-	m_dataMutex(),
-	m_changedRegion(),
-	m_cursorShapeChanged( TRUE ),
-	m_socketDescriptor( _sd ),
-	m_sock( NULL ),
-	m_conn( _conn ),
-	m_otherEndianess( FALSE ),
-	m_lzoWorkMem( new Q_UINT8[sizeof( lzo_align_t ) *
-			( ( ( LZO1X_1_MEM_COMPRESS ) +
-			    		( sizeof( lzo_align_t ) - 1 ) ) /
-				 		sizeof( lzo_align_t ) ) ] )
-{
-	start();
-}
-
-
-
-
-demoServerClient::~demoServerClient()
-{
-	exit();
-	wait();
-	delete[] m_lzoWorkMem;
-}
-
-
-
-
-void demoServerClient::updateRegion( const RectList &reg )
-{
-	m_dataMutex.lock();
-	m_changedRegion += reg;
-	m_dataMutex.unlock();
-}
-
-
-
-
-void demoServerClient::updateCursorShape( void )
-{
-	m_dataMutex.lock();
-	m_cursorShapeChanged = TRUE;
-	m_dataMutex.unlock();
-}
-
-
-
-
-void demoServerClient::moveCursor( void )
-{
-	QPoint p = m_ds->cursorPos();
-	if( p != m_lastCursorPos )
-	{
-		m_dataMutex.lock();
-		m_lastCursorPos = p;
-		const rfbFramebufferUpdateMsg m =
-		{
-			rfbFramebufferUpdate,
-			0,
-			swap16IfLE( 1 )
-		} ;
-
-		m_sock->write( (const char *) &m, sizeof( m ) );
-
-		const rfbRectangle rr =
-		{
-			swap16IfLE( m_lastCursorPos.x() ),
-			swap16IfLE( m_lastCursorPos.y() ),
-			swap16IfLE( 0 ),
-			swap16IfLE( 0 )
-		} ;
-
-		const rfbFramebufferUpdateRectHeader rh =
-		{
-			rr,
-			swap32IfLE( rfbEncodingPointerPos )
-		} ;
-
-		m_sock->write( (const char *) &rh, sizeof( rh ) );
-		m_sock->waitForBytesWritten();
-		m_dataMutex.unlock();
-	}
-}
-
-
-
-
-void demoServerClient::processClient( void )
-{
-	m_dataMutex.lock();
-	while( m_sock->bytesAvailable() > 0 )
-	{
-		Q_UINT8 cmd;
-		if( m_sock->read( (char *) &cmd, sizeof( cmd ) ) <= 0 )
-		{
-			qWarning( "demoServerClient::processClient(): "
-							"could not read cmd" );
-			continue;
-		}
-
-		if( cmd != rfbFramebufferUpdateRequest )
-		{
-			continue;
-		}
-
-		if( m_changedRegion.isEmpty() )
-		{
-			continue;
-		}
-
-		// 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
-		QuadTree q( 0, 0, m_conn->screen().width()-1, m_conn->screen().height()-1, 4 );
-		q.addRects( m_changedRegion );
-		const QVector<QuadTreeRect> r = q.rects();
-
-		// no we gonna post all changed rects!
-		const rfbFramebufferUpdateMsg m =
-		{
-			rfbFramebufferUpdate,
-			0,
-			swap16IfLE( r.size() +
-					( m_cursorShapeChanged ? 1 : 0 ) )
-		} ;
-
-		m_sock->write( (const char *) &m, sizeof( m ) );
-		// process each rect
-		for( QVector<QuadTreeRect>::const_iterator it = r.begin();
-							it != r.end(); ++it )
-		{
-			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;
-			const rfbRectangle rr =
-			{
-				swap16IfLE( rx ),
-				swap16IfLE( ry ),
-				swap16IfLE( rw ),
-				swap16IfLE( rh )
-			} ;
-
-			const rfbFramebufferUpdateRectHeader rhdr =
-			{
-				rr,
-				swap32IfLE( rfbEncodingItalc )
-			} ;
-
-			m_sock->write( (const char *) &rhdr, sizeof( rhdr ) );
-
-			const QImage & i = m_conn->screen();
-			italcRectEncodingHeader hdr = { 0, 0, 0 } ;
-
-			// we only compress if it's enough data, otherwise
-			// there's too much overhead
-			if( rw * rh > 1024 )
-			{
-
-	hdr.compressed = 1;
-	QRgb last_pix = *( (QRgb *) i.scanLine( ry ) + rx );
-	Q_UINT8 rle_cnt = 0;
-	Q_UINT8 rle_sub = 1;
-	Q_UINT8 * out = new Q_UINT8[rw * rh * sizeof( QRgb )+16];
-	Q_UINT8 * 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;
-//printf("%d %d\n",hdr.bytesRLE, w*h*sizeof(QRgb)+16);
-	lzo_uint bytes_lzo = hdr.bytesRLE + hdr.bytesRLE / 16 + 67;
-	Q_UINT8 * comp = new Q_UINT8[bytes_lzo];
-	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 );
-
-	m_sock->write( (const char *) &hdr, sizeof( hdr ) );
-	m_sock->write( (const char *) comp, swap32IfLE( hdr.bytesLZO ) );
-	delete[] out;
-	delete[] comp;
-
-			}
-			else
-			{
-	m_sock->write( (const char *) &hdr, sizeof( hdr ) );
-	if( m_otherEndianess )
-	{
-		Q_UINT32 * buf = new Q_UINT32[rw];
-		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 )
-			{
-				buf[x] = swap32( *src );
-			}
-			m_sock->write( (const char *) buf, rw * sizeof( QRgb ) );
-		}
-		delete[] buf;
-	}
-	else
-	{
-		for( int y = 0; y < rh; ++y )
-		{
-			m_sock->write( (const char *)
-				( (const QRgb *) i.scanLine( ry + y ) + rx ),
-							rw * sizeof( QRgb ) );
-		}
-	}
-			}
-		}
-
-		if( m_cursorShapeChanged )
-		{
-			const QImage cur = m_conn->cursorShape();
-			const rfbRectangle rr =
-			{
-				swap16IfLE( m_conn->cursorHotSpot().x() ),
-				swap16IfLE( m_conn->cursorHotSpot().y() ),
-				swap16IfLE( cur.width() ),
-				swap16IfLE( cur.height() )
-			} ;
-
-			const rfbFramebufferUpdateRectHeader rh =
-			{
-				rr,
-				swap32IfLE( rfbEncodingItalcCursor )
-			} ;
-
-			m_sock->write( (const char *) &rh, sizeof( rh ) );
-
-			QDataStream ds( m_sock );
-			ds << cur;
-		}
-
-		// reset vars
-		m_changedRegion.clear();
-		m_cursorShapeChanged = FALSE;
-	}
-	m_sock->waitForBytesWritten();
-
-	m_dataMutex.unlock();
-}
-
-
-
-
-void demoServerClient::run( void )
-{
-	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 );
-	if( !isdServer::protocolInitialization( sd,
-						ItalcAuthHostBased, TRUE ) )
-	{
-		qCritical( "demoServerClient:::run(): "
-					"protocol initialization failed" );
-		deleteLater();
-		return;
-	}
-
-	rfbClientInitMsg ci;
-
-	if( !sd.read( (char *) &ci, sizeof( ci ) ) )
-	{
-		deleteLater();
-		return;
-	}
-
-	rfbServerInitMsg si = m_conn->m_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.nameLength = swap32IfLE( si.nameLength );
-	si.format.bigEndian = ( QSysInfo::ByteOrder == QSysInfo::BigEndian )
-									? 1 : 0;
-	if( !sd.write( ( const char *) &si, sizeof( si ) ) )
-	{
-		deleteLater();
-		return;
-	}
-
-	char * desktop_name = new char[m_conn->m_si.nameLength+1];
-	desktop_name[0] = 0;
-
-	if( !sd.write( desktop_name, m_conn->m_si.nameLength ) )
-	{
-		delete[] desktop_name;
-		deleteLater();
-		return;
-	}
-
-	delete[] desktop_name;
-
-
-	rfbSetPixelFormatMsg spf;
-
-	if( !sd.read( (char *) &spf, sizeof( spf ) ) )
-	{
-		deleteLater();
-		return;
-	}
-
-	// we have to do server-side endianess-conversion in case it differs
-	// between client and server
-	if( spf.format.bigEndian != si.format.bigEndian )
-	{
-		m_otherEndianess = TRUE;
-	}
-
-	char buf[sizeof( rfbSetPixelFormatMsg ) + MAX_ENCODINGS *
-							sizeof( Q_UINT32 )];
-	rfbSetEncodingsMsg * se = (rfbSetEncodingsMsg *) buf;
-
-	if( !sd.read( (char *) se, sizeof( *se ) ) )
-	{
-		deleteLater();
-		return;
-	}
-	se->nEncodings = swap16IfLE( se->nEncodings );
-
-	Q_UINT32 * encs = (Q_UINT32 *)( &buf[sizeof(rfbSetEncodingsMsg)] );
-
-	if( !sd.read( (char *) encs, se->nEncodings * sizeof( Q_UINT32 ) ) )
-	{
-		deleteLater();
-		return;
-	}
-
-	bool has_italc_encoding = FALSE;
-	for( Q_UINT32 i = 0; i < se->nEncodings; ++i )
-	{
-		if( swap32IfLE( encs[i] ) == rfbEncodingItalc )
-		{
-			has_italc_encoding = TRUE;
-		}
-	}
-
-	if( !has_italc_encoding )
-	{
-		qCritical( "demoServerClient::run(): "
-					"client has no italc-encoding" );
-		deleteLater();
-		return;
-	}
-
-	// for some reason we have to do this to make the following connection
-	// working
-
-	connect( m_conn, SIGNAL( cursorShapeChanged() ),
-			this, SLOT( updateCursorShape() ),
-							Qt::QueuedConnection );
-	connect( m_conn, SIGNAL( regionUpdated( const RectList & ) ),
-			this, SLOT( updateRegion( const RectList & ) ),
-							Qt::QueuedConnection );
-
-	ml.unlock();
-
-	// first time send a key-frame
-	updateRegion( RectList() << m_conn->screen().rect() );
-
-	//connect( m_sock, SIGNAL( readyRead() ), this, SLOT( processClient() ) );
-	connect( m_sock, SIGNAL( disconnected() ),
-						this, SLOT( deleteLater() ) );
-
-	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 );
-	//moveCursor();
-	//processClient();
-	// now run our own event-loop for optimal scheduling
-	exec();
-}
-
-
-
-#include "demo_server.moc"
-
diff --git a/ica/src/demo_server.h b/ica/src/demo_server.h
deleted file mode 100644
index 629a51c..0000000
--- a/ica/src/demo_server.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * demo_server.h - multi-threaded slim VNC-server for demo-purposes (optimized
- *                 for lot of clients accessing server in read-only-mode)
- *           
- * Copyright (c) 2006-2008 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/QMutex>
-#include <QtCore/QPair>
-#include <QtCore/QReadWriteLock>
-#include <QtCore/QThread>
-#include <QtNetwork/QTcpServer>
-
-#include "ivs_connection.h"
-
-
-class IVS;
-
-
-// there's one instance of a demo-server on the iTALC-master
-class demoServer : public QTcpServer
-{
-	Q_OBJECT
-public:
-	demoServer( IVS * _ivs_conn, int _quality, quint16 _port,
-							QTcpSocket * _parent );
-	virtual ~demoServer();
-
-	inline QPoint cursorPos( void )
-	{
-		m_cursorLock.lockForRead();
-		QPoint p = m_cursorPos;
-		m_cursorLock.unlock();
-		return( p );
-	}
-
-	static int numOfInstances( void )
-	{
-		return( s_numOfInstances );
-	}
-
-
-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 );
-
-
-private:
-	virtual void incomingConnection( int _sd );
-
-	static int s_numOfInstances;
-
-	ivsConnection * m_conn;
-	QReadWriteLock m_cursorLock;
-	QPoint m_cursorPos;
-
-	// this thread is just responsible for updating IVS-connection's screen
-	class updaterThread : public QThread
-	{
-	public:
-		updaterThread( ivsConnection * _ic );
-		virtual ~updaterThread();
-
-	private:
-		virtual void run( void );
-		ivsConnection * m_conn;
-		volatile bool m_quit;
-	} * m_updaterThread;
-
-
-	friend class updaterThread;
-
-} ;
-
-
-
-// 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 _sd, const ivsConnection * _conn,
-							demoServer * _parent );
-	virtual ~demoServerClient();
-
-
-private slots:
-	// connected to regionUpdated(...)-signal of demo-server's
-	// IVS-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 updateRegion( const RectList &reg );
-
-	// called whenever ivsConnection::cursorShapeChanged() is emitted
-	void updateCursorShape( void );
-
-	// 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( void );
-
-	// connected to readyRead()-signal of our client-socket and called as
-	// soon as the clients sends something (e.g. an update-request)
-	void processClient( void );
-
-
-private:
-	// thread-entry-point - does some initializations and then enters
-	// event-loop of thread
-	virtual void run( void );
-
-	demoServer * m_ds;
-	QMutex m_dataMutex;
-	RectList m_changedRegion;
-	QPoint m_lastCursorPos;
-	volatile bool m_cursorShapeChanged;
-
-	int m_socketDescriptor;
-	QTcpSocket * m_sock;
-	const ivsConnection * m_conn;
-	bool m_otherEndianess;
-	Q_UINT8 * m_lzoWorkMem;
-
-} ;
-
-
-#endif
-
diff --git a/ica/src/ica_main.cpp b/ica/src/ica_main.cpp
deleted file mode 100644
index 01168e1..0000000
--- a/ica/src/ica_main.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * ica_main.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.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <QtCore/QLocale>
-#include <QtGui/QApplication>
-#include <QtNetwork/QHostInfo>
-
-
-#include "ica_main.h"
-#include "system_service.h"
-#include "isd_server.h"
-#include "ivs.h"
-#include "local_system_ica.h"
-#include "lock_widget.h"
-#include "debug.h"
-#include "system_key_trapper.h"
-#include "dsa_key.h"
-#include "messagebox.h"
-
-#ifdef SYSTEMTRAY_SUPPORT
-#include <QtGui/QSystemTrayIcon>
-#endif
-
-
-int __isd_port = PortOffsetISD;
-int __ivs_port = PortOffsetIVS;
-
-#ifdef BUILD_LINUX
-bool __rx11vs = FALSE;
-#endif
-
-QString __app_name = "iTALC Client";
-const QString SERVICE_ARG = "-service";
-
-#include <QtCore/QProcess>
-
-int serviceMain( systemService * _srv )
-{
-	int c = 1;
-	char * * v = new char *[1];
-	v[0] = _srv->argv()[0];
-	return( ICAMain( c, v ) );
-}
-
-
-#ifdef BUILD_WIN32
-
-// event-filter which makes ICA ignore quit- end end-session-messages for not
-// quitting at user logoff
-bool eventFilter( void * _msg, long * _result )
-{
-	DWORD msg = ( ( MSG *) _msg )->message;
-	if(/* msg == WM_QUIT ||*/msg == WM_ENDSESSION )
-	{
-		return( TRUE );
-	}
-	return( FALSE );
-}
-
-#endif
-
-
-int ICAMain( int argc, char * * argv )
-{
-#ifdef DEBUG
-#ifdef BUILD_LINUX
-	extern int _Xdebug;
-	_Xdebug = 1;
-#endif
-#endif
-
-	// decide whether to create a QCoreApplication or QApplication
-	bool core_app = FALSE;
-	for( int i = 1; i < argc; ++i )
-	{
-		if( QString( argv[i] ) == "-rx11vs" ||
-			QString( argv[i] ) == "-createkeypair" ||
-			QString( argv[i] ) == "-h" ||
-			QString( argv[i] ) == "--version" ||
-			QString( argv[i] ) == "-v" )
-		{
-			core_app = TRUE;
-		}
-	}
-
-	if( !core_app )
-	{
-		systemService s( "icas", SERVICE_ARG, __app_name,
-					"", serviceMain, argc, argv );
-		if( s.evalArgs( argc, argv ) || argc == 0 )
-		{
-			return( 0 );
-		}
-	}
-
-	QCoreApplication * app = NULL;
-
-	if( core_app )
-	{
-		app = new QCoreApplication( argc, argv );
-	}
-	else
-	{
-		QApplication * a = new QApplication( argc, argv );
-		a->setQuitOnLastWindowClosed( FALSE );
-		if( QLocale::system().language() == QLocale::Hebrew ||
-			QLocale::system().language() == QLocale::Arabic )
-		{
-			QApplication::setLayoutDirection( Qt::RightToLeft );
-		}
-		app = a;
-	}
-
-#ifdef BUILD_WIN32
-	app->setEventFilter( eventFilter );
-#endif
-
-	localSystem::initialize();
-
-	if( localSystem::parameter( "ivsport" ).toInt() > 0 )
-	{
-		__ivs_port = localSystem::parameter( "ivsport" ).toInt();
-	}
-	if( localSystem::parameter( "isdport" ).toInt() > 0 )
-	{
-		__isd_port = localSystem::parameter( "isdport" ).toInt();
-	}
-
-	QStringListIterator arg_it( QCoreApplication::arguments() );
-	arg_it.next();
-	while( argc > 1 && arg_it.hasNext() )
-	{
-		const QString & a = arg_it.next();
-		if( a == "-isdport" && arg_it.hasNext() )
-		{
-			__isd_port = arg_it.next().toInt();
-		}
-		else if( ( a == "-ivsport" || a == "-rfbport" ) &&
-							arg_it.hasNext() )
-		{
-			__ivs_port = arg_it.next().toInt();
-		}
-#ifdef BUILD_LINUX
-		else if( a == "-rx11vs" )
-		{
-			__rx11vs = TRUE;
-		}
-		else if( a == ACCESS_DIALOG_ARG && arg_it.hasNext() )
-		{
-			return( isdServer::showAccessDialog( arg_it.next() ) );
-		}
-#endif
-		else if( a == "-role" )
-		{
-			if( arg_it.hasNext() )
-			{
-				const QString role = arg_it.next();
-				if( role == "teacher" )
-				{
-					__role = ISD::RoleTeacher;
-				}
-				else if( role == "admin" )
-				{
-					__role = ISD::RoleAdmin;
-				}
-				else if( role == "supporter" )
-				{
-					__role = ISD::RoleSupporter;
-				}
-			}
-			else
-			{
-				printf( "-role needs an argument:\n"
-					"	teacher\n"
-					"	admin\n"
-					"	supporter\n\n" );
-				return( -1 );
-			}
-		}
-		else if( a == "-createkeypair" )
-		{
-			ISD::userRoles role = ( __role != ISD::RoleOther ) ?
-						__role : ISD::RoleTeacher;
-			bool user_path = arg_it.hasNext();
-			QString priv = user_path ? arg_it.next() :
-					localSystem::privateKeyPath( role );
-			QString pub = user_path ?
-					( arg_it.hasNext() ? 
-						arg_it.next() : priv + ".pub" )
-				:
-					localSystem::publicKeyPath( role );
-			printf( "\n\ncreating new key-pair ... \n" );
-			privateDSAKey pkey( 1024 );
-			if( !pkey.isValid() )
-			{
-				printf( "key generation failed!\n" );
-				return( -1 );
-			}
-			pkey.save( priv );
-			publicDSAKey( pkey ).save( pub );
-			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( 0 );
-		}
-#ifdef BUILD_LINUX
-		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( 0 );
-		}
-#endif
-		else if( a == "-v" || a == "--version" )
-		{
-			printf( "%s\n", PACKAGE_VERSION );
-			return( 0 );
-		}
-		else if( a == "-l" || a == "--lock" )
-		{
-			lockWidget l;
-			return app->exec();
-		}
-		else
-		{
-			printf( "Unrecognized commandline-argument %s\n",
-						a.toUtf8().constData() );
-			return( -1 );
-		}
-	}
-	
-#ifdef BUILD_LINUX
-	if( __rx11vs )
-	{
-#if 1
-		IVS( __ivs_port, argc, argv, TRUE );
-		return( 0 );
-#else
-		IVS * i = new IVS( __ivs_port, argc, argv );
-		i->start( IVS::HighestPriority );
-		return( app->exec() );
-#endif
-	}
-#endif
-
-#ifdef SYSTEMTRAY_SUPPORT
-	QIcon icon( ":/resources/icon16.png" );
-	icon.addFile( ":/resources/icon22.png" );
-	icon.addFile( ":/resources/icon32.png" );
-
-	QSystemTrayIcon sti( icon );
-	__systray_icon = &sti;
-	__systray_icon->setToolTip(
-				QApplication::tr( "iTALC Client %1 on %2:%3" ).
-					arg( PACKAGE_VERSION ).
-					arg( QHostInfo::localHostName() ).
-					arg( QString::number( __ivs_port ) ) );
-	__systray_icon->show();
-#endif
-
-	new isdServer( __ivs_port, argc, argv );
-
-	return( app->exec() );
-}
-
-
-
-// platform-specific startup-code follows
-
-#ifdef BUILD_WIN32
-
-#include <windows.h>
-
-
-extern HINSTANCE	hAppInstance;
-extern DWORD		mainthreadId;
-
-
-int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
-						PSTR szCmdLine, int iCmdShow )
-{
-	// save the application instance and main thread id
-	hAppInstance = hInstance;
-	mainthreadId = GetCurrentThreadId();
-
-	const int pathlen = 2048;
-	char path[pathlen];
-	if( GetModuleFileName( NULL, path, pathlen ) == 0 )
-	{
-		qCritical( "WinMain(...): "
-				"could not determine module-filename!" ); 
-		return -1;
-	}
-
-	QStringList cmdline = QString( szCmdLine ).toLower().split( ' ' );
-	cmdline.push_front( path );
-
-	char * * argv = new char *[cmdline.size()];
-	int argc = 0;
-	for( QStringList::iterator it = cmdline.begin(); it != cmdline.end();
-								++it, ++argc )
-	{
-		argv[argc] = new char[it->length() + 1];
-		strcpy( argv[argc], it->toUtf8().constData() );
-	}
-
-	return( ICAMain( argc, argv ) );
-}
-
-
-#else
-
-
-int main( int argc, char * * argv )
-{
-	return( ICAMain( argc, argv ) );
-}
-
-
-#endif
-
-
diff --git a/ica/src/ica_main.h b/ica/src/ica_main.h
deleted file mode 100644
index 049fb29..0000000
--- a/ica/src/ica_main.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * ica_main.h - declaration of ICAMain and other global stuff
- *           
- * Copyright (c) 2006 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 _ICA_MAIN_H
-#define _ICA_MAIN_H
-
-int ICAMain( int _argc, char * * _argv );
-
-#ifdef BUILD_LINUX
-
-#define ACCESS_DIALOG_ARG "-accessdialog"
-
-extern bool __rx11vs;
-
-#endif
-
-
-extern int __isd_port;
-extern int __ivs_port;
-
-#endif
-
diff --git a/ica/src/isd_server.cpp b/ica/src/isd_server.cpp
deleted file mode 100644
index 280c91a..0000000
--- a/ica/src/isd_server.cpp
+++ /dev/null
@@ -1,1158 +0,0 @@
-/*
- * isd_server.cpp - ISD Server
- *
- * 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.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef BUILD_WIN32
-
-#define _WIN32_WINNT 0x0501
-#include <windows.h>
-#include <psapi.h>
-#endif
-
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDir>
-#include <QtCore/QProcess>
-#include <QtCore/QTemporaryFile>
-#include <QtCore/QTimer>
-#include <QtGui/QMessageBox>
-#include <QtGui/QPushButton>
-#include <QtNetwork/QHostInfo>
-#include <QtNetwork/QTcpSocket>
-
-#include "isd_server.h"
-#include "isd_connection.h"
-#include "dsa_key.h"
-#include "local_system_ica.h"
-#include "ivs.h"
-#include "lock_widget.h"
-#include "messagebox.h"
-#include "demo_client.h"
-#include "demo_server.h"
-#include "ica_main.h"
-
-static isdServer * __isd_server = NULL;
-
-QStringList isdServer::s_allowedDemoClients;
-
-
-
-isdServer::isdServer( const quint16 _ivs_port, int _argc, char * * _argv ) :
-	QTcpServer(),
-	m_readyReadMapper( this ),
-	m_ivs( NULL ),
-	m_demoClient( NULL ),
-#ifdef BUILD_WIN32
-	m_lockDesktop( NULL ),
-	m_origThreadDesktop( NULL ),
-	m_origInputDesktop( NULL ),
-	m_lockProcess( NULL )
-#else
-	m_lockWidget( NULL )
-#endif
-{
-	if( __isd_server ||
-			listen( QHostAddress::Any, __isd_port ) == FALSE )
-	{
-		// uh oh, already an ISD running or port isn't available...
-		qCritical( "isdServer::isdServer(...): "
-				"could not start ISD server: %s",
-					errorString().toUtf8().constData() );
-		messageBox::trySysTrayMessage( tr( "ISD-server error" ),
-			tr( "The ISD-server could not be started because "
-				"port %1 is already in use. Please make sure "
-				"that no other application is using this "
-				"port and try again." ).
-					arg( QString::number( __isd_port ) ),
-							messageBox::Critical );
-	}
-
-	connect( this, SIGNAL( newConnection() ),
-			this, SLOT( acceptNewConnection() ) );
-
-	connect( &m_readyReadMapper, SIGNAL( mapped( QObject * ) ),
-			this, SLOT( processClient( QObject * ) ) );
-
-	QTimer * t = new QTimer( this );
-	connect( t, SIGNAL( timeout() ), this,
-					SLOT( checkForPendingActions() ) );
-	// as things like creating a demo-window, remote-control-view etc. can
-	// only be done by GUI-thread we push all actions into a list and
-	// process this list later in a slot called by the GUI-thread every 500s
-	t->start( 300 );
-
-	// finally we set the global pointer to ourself
-	__isd_server = this;
-
-	m_ivs = new IVS( _ivs_port, _argc, _argv );
-	m_ivs->start(/* QThread::HighPriority*/ );
-}
-
-
-
-
-isdServer::~isdServer()
-{
-	// this unlocks display and frees resources
-	unlockDisplay();
-
-	delete m_ivs;
-	__isd_server = NULL;
-}
-
-
-
-
-#ifdef BUILD_WIN32
-static HANDLE runProcessAsLoggedOnUser( const QString & _cmd,
-								const QString & _desktop = "winsta0\\default" )
-{
-	// run process as the user which is logged on
-	DWORD aProcesses[1024], cbNeeded;
-
-	if( !EnumProcesses( aProcesses, sizeof( aProcesses ), &cbNeeded ) )
-	{
-		return NULL;
-	}
-
-	DWORD cProcesses = cbNeeded / sizeof(DWORD);
-
-	for( DWORD i = 0; i < cProcesses; i++ )
-	{
-		HANDLE hProcess = OpenProcess( PROCESS_ALL_ACCESS, false, aProcesses[i] );
-		HMODULE hMod;
-		if( hProcess == NULL ||
-			!EnumProcessModules( hProcess, &hMod, sizeof( hMod ), &cbNeeded ) )
-        {
-			continue;
-		}
-
-		TCHAR szProcessName[MAX_PATH];
-		GetModuleBaseName( hProcess, hMod, szProcessName, 
-                       		  sizeof( szProcessName ) / sizeof( TCHAR) );
-		for( TCHAR * ptr = szProcessName; *ptr; ++ptr )
-		{
-			*ptr = tolower( *ptr );
-		}
-
-		if( strcmp( szProcessName, "explorer.exe" ) )
-		{
-			CloseHandle( hProcess );
-			continue;
-		}
-	
-		HANDLE hToken;
-		OpenProcessToken( hProcess, MAXIMUM_ALLOWED, &hToken );
-		ImpersonateLoggedOnUser( hToken );
-
-		STARTUPINFO si;
-		PROCESS_INFORMATION pi;
-		ZeroMemory( &si, sizeof( STARTUPINFO ) );
-		si.cb= sizeof( STARTUPINFO );
-		si.lpDesktop = (CHAR *) qstrdup( _desktop.toUtf8().constData() );
-		HANDLE hNewToken = NULL;
-
-		DuplicateTokenEx( hToken, MAXIMUM_ALLOWED, NULL,
-					SecurityImpersonation, TokenPrimary,
-								&hNewToken );
-
-		CreateProcessAsUser(
-				hNewToken,            // client's access token
-				NULL,              // file to execute
-				(CHAR *)_cmd.toUtf8().constData(),     // command line
-				NULL,              // pointer to process SECURITY_ATTRIBUTES
-				NULL,              // pointer to thread SECURITY_ATTRIBUTES
-				FALSE,             // handles are not inheritable
-				NORMAL_PRIORITY_CLASS | CREATE_NEW_CONSOLE,   // creation flags
-				NULL,              // pointer to new environment block 
-				NULL,              // name of current directory 
-				&si,               // pointer to STARTUPINFO structure
-				&pi                // receives information about new process
-				);
-
-		delete[] si.lpDesktop;
-
-		CloseHandle( hNewToken );
-		RevertToSelf();
-		CloseHandle( hToken );
-		CloseHandle( hProcess );
-
-		return pi.hProcess;
-	}
-
-	return NULL;
-}
-#endif
-
-
-int isdServer::processClient( socketDispatcher _sd, void * _user )
-{
-	socketDevice sdev( _sd, _user );
-	char cmd;
-	if( sdev.read( &cmd, sizeof( cmd ) ) == 0 )
-	{
-		qCritical( "isdServer::processClient(...): couldn't read "
-					"iTALC-request from client..." );
-		return( FALSE );
-	}
-
-	if( cmd == rfbItalcServiceRequest )
-	{
-		return( processClient( _sd, _user ) );
-	}
-
-	// in every case receive message-arguments, even if it's an empty list
-	// because this is at leat the int32 with number of items in the list
-	ISD::msg msg_in( &sdev, static_cast<ISD::commands>( cmd ) );
-	msg_in.receive();
-
-	QString action;
-
-	switch( cmd )
-	{
-		case ISD::GetUserInformation:
-		{
-			ISD::msg( &sdev, ISD::UserInformation ).
-					addArg( "username",
-						localSystem::currentUser() ).
-					addArg( "homedir", QDir::homePath() ).
-									send();
-			break;
-		}
-
-		case ISD::ExecCmds:
-		{
-			const QString cmds = msg_in.arg( "cmds" ).toString();
-			if( !cmds.isEmpty() )
-			{
-				foreach( const QString & cmd, cmds.split( '\n' ) )
-				{
-#ifdef BUILD_WIN32
-					HANDLE hProcess = runProcessAsLoggedOnUser( cmd );
-					if( hProcess )
-					{
-						CloseHandle( hProcess );
-					}
-#else
-					QProcess::startDetached( cmd );
-#endif
-				}
-			}
-			break;
-		}
-
-		case ISD::StartFullScreenDemo:
-		case ISD::StartWindowDemo:
-		{
-			QString port = msg_in.arg( "port" ).toString();
-			if( port == "" )
-			{
-				port = "5858";
-			}
-			if( !port.contains( ':' ) )
-			{
-				const int MAX_HOST_LEN = 255;
-				char host[MAX_HOST_LEN+1];
-				_sd( host, MAX_HOST_LEN, SocketGetPeerAddress,
-									_user );
-				host[MAX_HOST_LEN] = 0;
-				action = host + QString( ":" ) + port;
-			}
-			else
-			{
-				action = port;
-			}
-			break;
-		}
-
-		case ISD::DisplayTextMessage:
-			action = msg_in.arg( "msg" ).toString();
-			break;
-
-		case ISD::LockDisplay:
-		case ISD::UnlockDisplay:
-		case ISD::StopDemo:
-			action = "123";	// something to make the action being
-					// added to action-list processed by
-					// GUI-thread
-			break;
-
-		case ISD::LogonUserCmd:
-			localSystem::logonUser(
-					msg_in.arg( "uname" ).toString(),
-					msg_in.arg( "passwd" ).toString(),
-					msg_in.arg( "domain" ).toString() );
-			break;
-
-		case ISD::LogoutUser:
-			localSystem::logoutUser();
-			break;
-
-		case ISD::WakeOtherComputer:
-			localSystem::broadcastWOLPacket( 
-					msg_in.arg( "mac" ).toString() );
-			break;
-
-		case ISD::PowerDownComputer:
-			localSystem::powerDown();
-			break;
-
-		case ISD::RestartComputer:
-			localSystem::reboot();
-			break;
-
-		case ISD::DisableLocalInputs:
-			localSystem::disableLocalInputs(
-					msg_in.arg( "disabled" ).toBool() );
-			break;
-
-		case ISD::SetRole:
-		{
-			const int role = msg_in.arg( "role" ).toInt();
-			if( role > ISD::RoleNone && role < ISD::RoleCount )
-			{
-				__role = static_cast<ISD::userRoles>( role );
-#ifdef BUILD_LINUX
-				// under Linux/X11, IVS runs in separate process
-				// therefore we need to restart it with new
-				// role, bad hack but there's no clean solution
-				// for the time being
-				m_ivs->restart();
-#endif
-			}
-			break;
-		}
-
-		case ISD::DemoServer_Run:
-			if( _sd == &qtcpsocketDispatcher )
-			{
-				// start demo-server on local IVS and make it
-				// child of our socket so that it automatically
-				// gets destroyed as soon as the socket is
-				// closed and thus destroyed
-				QTcpSocket * ts = static_cast<QTcpSocket *>(
-								_user );
-				new demoServer( m_ivs,
-					msg_in.arg( "quality" ).toInt(),
-					msg_in.arg( "port" ).toInt(), ts );
-			}
-			else
-			{
-				qCritical( "socket-dispatcher is not a "
-						"qtcpsocketDispatcher!\n" );
-			}
-			break;
-
-		case ISD::HideTrayIcon:
-#ifdef SYSTEMTRAY_SUPPORT
-			if( _sd == &qtcpsocketDispatcher )
-			{
-				// start demo-server on local IVS and make it
-				// child of our socket so that it automatically
-				// gets destroyed as soon as the socket is
-				// closed and thus destroyed
-				QTcpSocket * ts = static_cast<QTcpSocket *>(
-								_user );
-				__systray_icon->hide();
-				connect( ts, SIGNAL( disconnected() ),
-					__systray_icon, SLOT( show() ) );
-			}
-			else
-			{
-				qCritical( "socket-dispatcher is not a "
-						"qtcpsocketDispatcher!\n" );
-			}
-#endif
-			break;
-
-			break;
-
-		case ISD::DemoServer_AllowClient:
-			allowDemoClient( msg_in.arg( "client" ).toString() );
-			break;
-
-		case ISD::DemoServer_DenyClient:
-			denyDemoClient( msg_in.arg( "client" ).toString() );
-			break;
-
-		default:
-			qCritical( "isdServer::processClient(...): "
-					"cmd %d not implemented!", cmd );
-			break;
-	}
-
-	if( !action.isEmpty() )
-	{
-		m_actionMutex.lock();
-		m_pendingActions.push_back( qMakePair(
-				static_cast<ISD::commands>( cmd ), action ) );
-		m_actionMutex.unlock();
-	}
-
-	return( TRUE );
-}
-
-
-
-
-bool isdServer::protocolInitialization( socketDevice & _sd,
-					italcAuthTypes _auth_type,
-					bool _demo_server )
-{
-	if( _demo_server )
-	{
-		idsProtocolVersionMsg pv;
-		sprintf( pv, idsProtocolVersionFormat, idsProtocolMajorVersion,
-						idsProtocolMinorVersion );
-		_sd.write( pv, sz_idsProtocolVersionMsg );
-
-		idsProtocolVersionMsg pv_cl;
-		_sd.read( pv_cl, sz_idsProtocolVersionMsg );
-		pv_cl[sz_idsProtocolVersionMsg] = 0;
-		if( memcmp( pv, pv_cl, sz_idsProtocolVersionMsg ) )
-		{
-			qCritical( "isdServer::protocolInitialization(...): "
-							"invalid client!" );
-			return FALSE;
-		}
-	}
-	else
-	{
-		isdProtocolVersionMsg pv;
-		sprintf( pv, isdProtocolVersionFormat, isdProtocolMajorVersion,
-						isdProtocolMinorVersion );
-		_sd.write( pv, sz_isdProtocolVersionMsg );
-
-		isdProtocolVersionMsg pv_cl;
-		_sd.read( pv_cl, sz_isdProtocolVersionMsg );
-		pv_cl[sz_isdProtocolVersionMsg] = 0;
-		if( memcmp( pv, pv_cl, sz_isdProtocolVersionMsg ) )
-		{
-			qCritical( "isdServer::protocolInitialization(...): "
-							"invalid client!" );
-			return FALSE;
-		}
-	}
-
-
-	const char sec_type_list[2] = { 1, rfbSecTypeItalc } ;
-	_sd.write( sec_type_list, sizeof( sec_type_list ) );
-
-	Q_UINT8 chosen = 0;
-	_sd.read( (char *) &chosen, sizeof( chosen ) );
-
-	const int MAX_HOST_LEN = 255;
-	char host[MAX_HOST_LEN+1];
-	_sd.sockDispatcher()( host, MAX_HOST_LEN, SocketGetPeerAddress,
-								_sd.user() );
-	host[MAX_HOST_LEN] = 0;
-
-
-	if( chosen != rfbSecTypeItalc )
-	{
-		errorMsgAuth( host );
-		qCritical( "isdServer::protocolInitialization(...): "
-			"client wants unknown security type %d", chosen );
-		return( FALSE );
-	}
-
-	if( chosen != rfbSecTypeItalc ||
-		!authSecTypeItalc( _sd.sockDispatcher(), _sd.user(),
-								_auth_type ) )
-	{
-		errorMsgAuth( host );
-		return( FALSE );
-	}
-
-	return( TRUE );
-}
-
-
-
-
-bool isdServer::authSecTypeItalc( socketDispatcher _sd, void * _user,
-						italcAuthTypes _auth_type )
-{
-	// 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;
-	static QStringList __denied_hosts, __allowed_hosts;
-
-	socketDevice sdev( _sd, _user );
-	sdev.write( QVariant( (int) _auth_type ) );
-
-	italcAuthResults result = ItalcAuthFailed;
-
-	italcAuthTypes chosen = static_cast<italcAuthTypes>(
-							sdev.read().toInt() );
-	if( chosen == ItalcAuthAppInternalChallenge ||
-		chosen == ItalcAuthChallengeViaAuthFile )
-	{
-		_auth_type = chosen;
-	}
-	else if( chosen == ItalcAuthDSA && _auth_type == ItalcAuthLocalDSA )
-	{
-		// this case is ok as well
-	}
-	else if( chosen != _auth_type )
-	{
-		errorMsgAuth( host );
-		qCritical( "isdServer::authSecTypeItalc(...): "
-				"client chose other auth-type than offered!" );
-		return( result );
-	}
-
-	switch( _auth_type )
-	{
-		// no authentication
-		case ItalcAuthNone:
-			result = ItalcAuthOK;
-			break;
-
-		// host has to be in list of allowed hosts
-		case ItalcAuthHostBased:
-		{
-			if( s_allowedDemoClients.isEmpty() )
-			{
-				break;
-			}
-			QStringList allowed;
-			foreach( const QString a, s_allowedDemoClients )
-			{
-				const QString h = a.split( ':' )[0];
-				if( !allowed.contains( h ) )
-				{
-					allowed.push_back( h );
-				}
-			}
-			// already valid IP?
-			if( QHostAddress().setAddress( host ) )
-			{
-				if( allowed.contains( host ) )
-				{
-					result = ItalcAuthOK;
-				}
-			}
-			else
-			{
-			// create a list of all known addresses of host
-			QList<QHostAddress> addr =
-					QHostInfo::fromName( host ).addresses();
-			if( !addr.isEmpty() )
-			{
-				// check each address for existence in allowed-
-				// client-list
-				foreach( const QHostAddress a, addr )
-				{
-	if( allowed.contains( a.toString() ) ||
-		a.toString() == QHostAddress( QHostAddress::LocalHost ).toString() )
-					{
-						result = ItalcAuthOK;
-						break;
-					}
-				}
-			}
-			}
-			break;
-		}
-
-		// authentication via DSA-challenge/-response
-		case ItalcAuthLocalDSA:
-		case ItalcAuthDSA:
-		{
-			// generate data to sign and send to client
-			const QByteArray chall = dsaKey::generateChallenge();
-			sdev.write( QVariant( chall ) );
-
-			// get user-role
-			const ISD::userRoles urole =
-				static_cast<ISD::userRoles>(
-							sdev.read().toInt() );
-			if( __role != ISD::RoleOther &&
-					_auth_type != ItalcAuthLocalDSA )
-			{
-				if( __denied_hosts.contains( host ) )
-				{
-					result = ItalcAuthFailed;
-					break;
-				}
-				if( !__allowed_hosts.contains( host ) )
-				{
-					bool failed = TRUE;
-					switch(
-#ifdef BUILD_LINUX
-	QProcess::execute( QCoreApplication::applicationFilePath() +
-					QString( " %1 %2" ).
-						arg( ACCESS_DIALOG_ARG ).
-								arg( host ) )
-#else
-					showAccessDialog( host )
-#endif
-									)
-					{
-						case Always:
-							__allowed_hosts += host;
-						case Yes:
-							failed = FALSE;
-							break;
-						case Never:
-							__denied_hosts += host;
-						case No:
-							break;
-					}
-					if( failed )
-					{
-						result = ItalcAuthFailed;
-						break;
-					}
-				}
-				else
-				{
-					result = ItalcAuthFailed;
-				}
-			}
-			
-			// 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();
-			// (publicKeyPath does range-checking of urole)
-			publicDSAKey pub_key( localSystem::publicKeyPath(
-								urole ) );
-			result = pub_key.verifySignature( chall, sig ) ?
-						ItalcAuthOK : ItalcAuthFailed;
-			break;
-		}
-
-		// used for demo-purposes (demo-server connects to local IVS)
-		case ItalcAuthAppInternalChallenge:
-		{
-			// generate challenge
-			__appInternalChallenge = dsaKey::generateChallenge();
-			sdev.write( QVariant() );
-			// is our client able to read this byte-array? if so,
-			// it's for sure running inside the same app
-			result = ( sdev.read().toByteArray() ==
-						__appInternalChallenge ) ?
-						ItalcAuthOK : ItalcAuthFailed;
-			break;
-		}
-
-		// used for demo-purposes (demo-server connects to local IVS)
-		case ItalcAuthChallengeViaAuthFile:
-		{
-			// generate challenge
-			QByteArray chall = dsaKey::generateChallenge();
-			QTemporaryFile tf;
-			tf.setPermissions( QFile::ReadOwner |
-							QFile::WriteOwner );
-			tf.open();
-			tf.write( chall );
-			tf.flush();
-			sdev.write( tf.fileName() );
-			// is our client able to read the file? if so,
-			// it's running as the same user as this piece of
-			// code does so we can assume that it's our parent-
-			// process
-			result = ( sdev.read().toByteArray() == chall ) ?
-						ItalcAuthOK : ItalcAuthFailed;
-			break;
-		}
-	}
-
-	sdev.write( QVariant( (int) result ) );
-	if( result != ItalcAuthOK )
-	{
-		errorMsgAuth( host );
-	}
-
-	return( result == ItalcAuthOK );
-}
-
-
-
-
-quint16 isdServer::isdPort( void )
-{
-	return( __isd_server ? __isd_server->serverPort() : PortOffsetISD );
-}
-
-
-
-
-isdServer::accessDialogResult isdServer::showAccessDialog(
-							const QString & _host )
-{
-	QMessageBox m( QMessageBox::Question,
-			tr( "Confirm access" ),
-			tr( "Somebody at host %1 tries to access your screen. "
-				"Do you want to grant him/her access?" ).
-								arg( _host ),
-				QMessageBox::Yes | QMessageBox::No );
-
-	QPushButton * never_btn = m.addButton( tr( "Never for this session" ),
-							QMessageBox::NoRole );
-	QPushButton * always_btn = m.addButton( tr( "Always for this session" ),
-							QMessageBox::YesRole );
-	m.setDefaultButton( never_btn );
-	m.setEscapeButton( m.button( QMessageBox::No ) );
-
-	localSystem::activateWindow( &m );
-
-	const int res = m.exec();
-	if( m.clickedButton() == never_btn )
-	{
-		return( Never );
-	}
-	else if( m.clickedButton() == always_btn )
-	{
-		return( Always );
-	}
-	else if( res == QMessageBox::No )
-	{
-		return( No );
-	}
-	return( Yes );
-}
-
-
-
-
-void isdServer::acceptNewConnection( void )
-{
-	QTcpSocket * sock = nextPendingConnection();
-	socketDevice sd( qtcpsocketDispatcher, sock );
-
-	if( !protocolInitialization( sd, ItalcAuthLocalDSA ) )
-	{
-		delete sock;
-		return;
-	}
-
-	// now we're ready to start the normal interaction with the client,
-	// so make sure, we get informed about new requests
-	connect( sock, SIGNAL( readyRead() ),
-			&m_readyReadMapper, SLOT( map() ) );
-	connect( sock, SIGNAL( disconnected() ),
-			sock, SLOT( deleteLater() ) );
-	m_readyReadMapper.setMapping( sock, sock );
-}
-
-
-
-
-void isdServer::processClient( QObject * _sock )
-{
-	QTcpSocket * sock = qobject_cast<QTcpSocket *>( _sock );
-	while( sock->bytesAvailable() > 0 )
-	{
-		processClient( qtcpsocketDispatcher, sock );
-	}
-}
-
-
-
-
-void isdServer::checkForPendingActions( void )
-{
-	QMutexLocker ml( &m_actionMutex );
-	while( !m_pendingActions.isEmpty() )
-	{
-		QString data = m_pendingActions.front().second;
-		switch( m_pendingActions.front().first )
-		{
-			case ISD::StartFullScreenDemo:
-			case ISD::StartWindowDemo:
-				startDemo( data,
-	( m_pendingActions.front().first == ISD::StartFullScreenDemo ) );
-				break;
-
-			case ISD::StopDemo:
-				stopDemo();
-				break;
-
-			case ISD::LockDisplay:
-				lockDisplay();
-				break;
-
-			case ISD::UnlockDisplay:
-				unlockDisplay();
-				break;
-
-			case ISD::DisplayTextMessage:
-				displayTextMessage( data );
-				break;
-
-			default:
-				qWarning( "isdServer::checkForPendingActions():"
-						" unhandled command %d",
-					(int) m_pendingActions.front().first );
-				break;
-		}
-		m_pendingActions.removeFirst();
-	}
-#ifdef BUILD_WIN32
-	if( m_lockDesktop )
-	{
-		SwitchDesktop( m_lockDesktop );
-	}
-#endif
-}
-
-
-
-
-void isdServer::demoWindowClosed( QObject * )
-{
-	m_demoClient = NULL;
-}
-
-
-
-
-void isdServer::startDemo( const QString & _master_host, bool _fullscreen )
-{
-	delete m_demoClient;
-	m_demoClient = NULL;
-	// if a demo-server is started, it's likely that the demo was started
-	// on master-computer as well therefore we deny starting a demo on
-	// hosts on which a demo-server is running
-	if( demoServer::numOfInstances() > 0 )
-	{
-		return;
-	}
-
-	m_demoClient = new demoClient( _master_host, _fullscreen );
-	connect( m_demoClient, SIGNAL( destroyed( QObject * ) ),
-				this, SLOT( demoWindowClosed( QObject * ) ) );
-}
-
-
-
-
-void isdServer::stopDemo( void )
-{
-	delete m_demoClient;
-	m_demoClient = NULL;
-}
-
-
-
-void isdServer::lockDisplay( void )
-{
-	if( demoServer::numOfInstances() )
-	{
-		return;
-	}
-
-#ifdef BUILD_WIN32
-	m_origThreadDesktop = GetThreadDesktop( GetCurrentThreadId() );
-	m_origInputDesktop = OpenInputDesktop( 0, FALSE, DESKTOP_SWITCHDESKTOP );
-
-	char desktopName[] = "LockDesktop";
-	m_lockDesktop = CreateDesktop( desktopName, NULL, NULL, 0, GENERIC_ALL, NULL );
-	SetThreadDesktop( m_lockDesktop );
-
-	m_lockProcess =
-		runProcessAsLoggedOnUser(
-					QCoreApplication::applicationFilePath().
-							replace( '/', QDir::separator() ) + " --lock",
-					desktopName );
-
-	SwitchDesktop( m_lockDesktop );
-#else
-	delete m_lockWidget;
-	m_lockWidget = new lockWidget();
-#endif
-}
-
-
-
-
-void isdServer::unlockDisplay()
-{
-#ifdef BUILD_WIN32
-	SwitchDesktop( m_origInputDesktop );
-	SetThreadDesktop( m_origThreadDesktop );
-
-	TerminateProcess( m_lockProcess, 0 );
-	CloseDesktop( m_lockDesktop );
-#else
-	delete m_lockWidget;
-	m_lockWidget = NULL;
-#endif
-}
-
-
-
-
-void isdServer::displayTextMessage( const QString & _msg )
-{
-	new messageBox( tr( "Message from teacher" ), _msg,
-					QPixmap( ":/resources/message.png" ) );
-}
-
-
-
-
-void isdServer::allowDemoClient( const QString & _host )
-{
-	const QString h = _host.split( ':' )[0];
-	const QString p = _host.contains( ':' ) ? ':'+_host.split( ':' )[1] : "";
-	// already valid IP?
-	if( QHostAddress().setAddress( h ) )
-	{
-		if( !s_allowedDemoClients.contains( _host ) )
-		{
-			s_allowedDemoClients.push_back( _host );
-		}
-		return;
-	}
-	foreach( const QHostAddress a,
-				QHostInfo::fromName( h ).addresses() )
-	{
-		const QString h2 = a.toString();
-		if( !s_allowedDemoClients.contains( h2+p ) )
-		{
-			s_allowedDemoClients.push_back( h2+p );
-		}
-	}
-}
-
-
-
-
-void isdServer::denyDemoClient( const QString & _host )
-{
-	const QString h = _host.split( ':' )[0];
-	const QString p = _host.contains( ':' ) ? ':'+_host.split( ':' )[1] : "";
-	// already valid IP?
-	if( QHostAddress().setAddress( h ) )
-	{
-		s_allowedDemoClients.removeAll( _host );
-		return;
-	}
-	foreach( const QHostAddress a,
-				QHostInfo::fromName( h ).addresses() )
-	{
-		s_allowedDemoClients.removeAll( a.toString()+p );
-	}
-}
-
-
-
-
-void isdServer::errorMsgAuth( const QString & _ip )
-{
-	messageBox::trySysTrayMessage( tr( "Authentication error" ),
-			tr( "Somebody (IP: %1) tried to access this computer "
-					"but could not authenticate itself "
-					"successfully!" ).arg( QString( _ip ) ),
-						messageBox::Critical );
-}
-
-
-
-
-#ifdef BUILD_LINUX
-// helper-class which forwards commands destined to ISD-server. We need this
-// when running VNC-server in separate process and VNC-server receives iTALC-
-// commands which it can't process
-class isdForwarder : public isdConnection
-{
-public:
-	isdForwarder() :
-		isdConnection( QHostAddress( QHostAddress::LocalHost ).
-						toString() + ":" +
-						QString::number( __isd_port ) )
-	{
-	}
-
-
-	int processClient( socketDispatcher _sd, void * _user )
-	{
-		socketDevice sdev( _sd, _user );
-		char cmd;
-		if( sdev.read( &cmd, sizeof( cmd ) ) == 0 )
-		{
-			qCritical( "isdForwarder::processClient(...): "
-				"couldn't read iTALC-request from client..." );
-			return( FALSE );
-		}
-
-		if( cmd == rfbItalcServiceRequest )
-		{
-			return( processClient( _sd, _user ) );
-		}
-
-		// in every case receive message-arguments, even if it's an empty list
-		// because this is at leat the int32 with number of items in the list
-		ISD::msg msg_in( &sdev, static_cast<ISD::commands>( cmd ) );
-		msg_in.receive();
-
-		switch( cmd )
-		{
-			case ISD::GetUserInformation:
-		ISD::msg( &sdev, ISD::UserInformation ).
-				addArg( "username",
-					localSystem::currentUser() ).
-				addArg( "homedir", QDir::homePath() ).send();
-				break;
-
-			case ISD::ExecCmds:
-				execCmds( msg_in.arg( "cmds" ).toString() );
-				break;
-
-			case ISD::StartFullScreenDemo:
-			case ISD::StartWindowDemo:
-			{
-				const int MAX_HOST_LEN = 255;
-				char host[MAX_HOST_LEN+1];
-				_sd( host, MAX_HOST_LEN, SocketGetPeerAddress,
-									_user );
-				host[MAX_HOST_LEN] = 0;
-				QString port = msg_in.arg( "port" ).toString();
-				if( port == "" )
-				{
-					port = "5858";
-				}
-				startDemo( host + QString( ":" ) + port,
-					cmd == ISD::StartFullScreenDemo );
-				break;
-			}
-
-			case ISD::DisplayTextMessage:
-				displayTextMessage( msg_in.arg( "msg" ).
-								toString() );
-				break;
-
-			case ISD::LockDisplay:
-				lockDisplay();
-				break;
-
-			case ISD::UnlockDisplay:
-				unlockDisplay();
-				break;
-
-			case ISD::StopDemo:
-				stopDemo();
-				break;
-
-			case ISD::LogonUserCmd:
-				logonUser( msg_in.arg( "uname" ).toString(),
-					msg_in.arg( "passwd" ).toString(),
-					msg_in.arg( "domain" ).toString() );
-				break;
-
-			case ISD::LogoutUser:
-				logoutUser();
-				break;
-
-			case ISD::WakeOtherComputer:
-				wakeOtherComputer( 
-					msg_in.arg( "mac" ).toString() );
-				break;
-
-			case ISD::PowerDownComputer:
-				powerDownComputer();
-				break;
-
-			case ISD::RestartComputer:
-				restartComputer();
-				break;
-
-			case ISD::DemoServer_Run:
-				demoServerRun( msg_in.arg( "quality" ).toInt(),
-						msg_in.arg( "port" ).toInt() );
-				break;
-
-			case ISD::DemoServer_AllowClient:
-				demoServerAllowClient(
-					msg_in.arg( "client" ).toString() );
-				break;
-
-			case ISD::DemoServer_DenyClient:
-				demoServerDenyClient(
-					msg_in.arg( "client" ).toString() );
-				break;
-
-			default:
-				qCritical( "isdForwarder::processClient(...): "
-					"cmd %d not implemented!", cmd );
-				break;
-		}
-
-		return( TRUE );
-	}
-
-
-protected:
-	virtual states authAgainstServer( const italcAuthTypes _try_auth_type )
-	{
-		return( isdConnection::authAgainstServer(
-					ItalcAuthChallengeViaAuthFile ) );
-	}
-
-} ;
-
-static isdForwarder * __isd_forwarder = NULL;
-
-#endif
-
-
-int processItalcClient( socketDispatcher _sd, void * _user )
-{
-	if( __isd_server )
-	{
-		return( __isd_server->processClient( _sd, _user ) );
-	}
-
-#ifdef BUILD_LINUX
-	if( !__isd_forwarder )
-	{
-		__isd_forwarder = new isdForwarder();
-	}
-
-	if( __isd_forwarder->state() != isdForwarder::Connected )
-	{
-		__isd_forwarder->open();
-	}
-
-	//__isd_forwarder->handleServerMessages();
-
-	return( __isd_forwarder->processClient( _sd, _user ) );
-#endif
-	return( 0 );
-}
-
-
-
-
-#include "isd_server.moc"
-
diff --git a/ica/src/isd_server.h b/ica/src/isd_server.h
deleted file mode 100644
index 32e479f..0000000
--- a/ica/src/isd_server.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * isd_server.h - ISD Server
- *
- * 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 _ISD_SERVER_H
-#define _ISD_SERVER_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef BUILD_WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
-#include <QtCore/QList>
-#include <QtCore/QMutex>
-#include <QtCore/QPair>
-#include <QtCore/QSignalMapper>
-#include <QtCore/QStringList>
-#include <QtNetwork/QTcpServer>
-
-#include "isd_base.h"
-
-
-class IVS;
-class demoClient;
-class demoServer;
-class lockWidget;
-
-
-class isdServer : public QTcpServer
-{
-	Q_OBJECT
-public:
-	enum accessDialogResult
-	{
-		Yes,
-		No,
-		Always,
-		Never
-	} ;
-
-	isdServer( const quint16 _ivs_port, int _argc, char * * _argv );
-	virtual ~isdServer();
-
-	int processClient( socketDispatcher _sd, void * _user );
-
-	static bool protocolInitialization( socketDevice & _sd,
-						italcAuthTypes _auth_type,
-						bool _demo_server = FALSE );
-	static bool authSecTypeItalc( socketDispatcher _sd, void * _user,
-				italcAuthTypes _auth_type = ItalcAuthDSA );
-
-	static quint16 isdPort( void );
-
-	static accessDialogResult showAccessDialog( const QString & _host );
-
-
-private slots:
-	void acceptNewConnection( void );
-	void processClient( QObject * _sock );
-
-	void checkForPendingActions( void );
-
-	void demoWindowClosed( QObject * );
-
-	// client-functions
-	void startDemo( const QString & _master_host, bool _fullscreen );
-	void stopDemo( void );
-
-	void lockDisplay( void );
-	void unlockDisplay( void );
-
-	void displayTextMessage( const QString & _msg );
-
-
-private:
-	void allowDemoClient( const QString & _host );
-	void denyDemoClient( const QString & _host );
-
-	static void errorMsgAuth( const QString & _ip );
-
-
-	static QStringList s_allowedDemoClients;
-
-	QMutex m_actionMutex;
-	QList<QPair<ISD::commands, QString> > m_pendingActions;
-
-	QSignalMapper m_readyReadMapper;
-
-	IVS * m_ivs;
-	demoClient * m_demoClient;
-
-#ifdef BUILD_WIN32
-	HDESK m_lockDesktop;
-	HDESK m_origThreadDesktop;
-	HDESK m_origInputDesktop;
-	HANDLE m_lockProcess;
-#else
-	lockWidget * m_lockWidget;
-#endif
-
-} ;
-
-
-
-int processItalcClient( socketDispatcher _sd, void * user );
-
-
-#endif
-
diff --git a/ica/src/ivs.cpp b/ica/src/ivs.cpp
deleted file mode 100644
index 086ca61..0000000
--- a/ica/src/ivs.cpp
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * ivs.cpp - implementation of IVS, a VNC-server-abstraction for platform-
- *           independent VNC-server-usage
- *
- * Copyright (c) 2006-2008 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.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QProcess>
-#include <QtCore/QStringList>
-
-
-#include "ivs.h"
-
-
-#ifdef BUILD_LINUX
-
-extern "C" int x11vnc_main( int argc, char * * argv );
-
-#include "rfb/rfb.h"
-#include "isd_server.h"
-#include "local_system.h"
-
-
-rfbClientPtr __client = NULL;
-
-
-qint64 libvncClientDispatcher( 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 );
-
-}
-
-
-rfbBool isdNewClient( struct _rfbClientRec *, void * * )
-{
-	return( TRUE );
-}
-
-
-rfbBool isdHandleMessage( struct _rfbClientRec * _client, void * _data,
-				const rfbClientToServerMsg * _message )
-{
-	if( _message->type == rfbItalcServiceRequest )
-	{
-		return( processItalcClient( libvncClientDispatcher, _client ) );
-	}
-	return( FALSE );
-}
-
-
-void isdAuthAgainstServer( struct _rfbClientRec * _client )
-{
-	if( isdServer::authSecTypeItalc( libvncClientDispatcher, _client,
-								ItalcAuthDSA ) )
-	{
-		_client->state = rfbClientRec::RFB_INITIALISATION;
-		__client = _client;
-	}
-}
-
-
-
-#elif BUILD_WIN32
-
-extern int WinVNCAppMain( void );
-
-#endif
-
-
-
-IVS::IVS( const quint16 _ivs_port, int _argc, char * * _argv,
-							bool _no_threading ) :
-	QThread(),
-	m_argc( _argc ),
-	m_argv( _argv ),
-	m_port( _ivs_port ),
-	m_runningInSeparateProcess( FALSE )
-{
-	if( _no_threading )
-	{
-		run();
-	}
-}
-
-
-
-
-IVS::~IVS()
-{
-}
-
-
-
-
-void IVS::run( void )
-{
-#ifdef BUILD_LINUX
-	QStringList cmdline;
-
-	m_runningInSeparateProcess = TRUE;
-
-	// filter some options
-	for( int i = 0; i < m_argc; ++i )
-	{
-		QString option = m_argv[i];
-		if( option == "-noshm" || option == "-solid" ||
-				option == "-xrandr" || option == "-onetile" )
-		{
-			cmdline.append( m_argv[i] );
-		}
-		else if( option == "-rx11vs" )
-		{
-			m_runningInSeparateProcess = FALSE;
-		}
-	}
-
-	cmdline/* << "-forever"	// do not quit after 1st conn.
-		<< "-shared"	// allow multiple clients
-		<< "-nopw"	// do not display warning
-		<< "-repeat"	// do not disable autorepeat*/
-		<< "-nosel"	// do not exchange clipboard-contents
-		<< "-nosetclipboard"	// do not exchange clipboard-contents
-/*		<< "-speeds" << ",5000,1"	// FB-rate: 7 MB/s
-						// LAN: 5 MB/s
-						// latency: 1 ms*/
-/*		<< "-wait" << "25"	// time between screen-pools*/
-/*		<< "-readtimeout" << "60" // timeout for disconn.*/
-/*			<< "-threads"	// enable threaded libvncserver*/
-/*		<< "-noremote"	// do not accept remote-cmds
-		<< "-nocmds"	// do not run ext. cmds*/
-		<< "-rfbport" << QString::number( m_port )
-				// set port where the VNC-server should listen
-		;
-	if( m_runningInSeparateProcess )
-	{
-		cmdline << "-rx11vs" << "-isdport" <<
-				QString::number( isdServer::isdPort() ) <<
-				"-role" << localSystem::userRoleName( __role );
-		while( 1 )
-		{
-			QProcess p;
-			p.setProcessChannelMode( QProcess::ForwardedChannels );
-			p.start( QCoreApplication::applicationFilePath() +
-					" -rx11vs " + cmdline.join( " " ) );
-			m_restart = FALSE;
-			while( p.state() != QProcess::NotRunning )
-			{
-				sleep( 1 );
-				if( m_restart )
-				{
-					p.terminate();
-					sleep( 1 );
-					p.kill();
-					break;
-				}
-			}
-		}
-		return;
-	}
-#if 0
-	cmdline	<< "-dbg";// << "-o" << "/tmp/italc_client_x11vnc.log";
-#endif
-
-	char * old_av = m_argv[0];
-	m_argv = new char *[cmdline.size()+1];
-	m_argc = 1;
-	m_argv[0] = old_av;
-
-	for( QStringList::iterator it = cmdline.begin();
-				it != cmdline.end(); ++it, ++m_argc )
-	{
-		m_argv[m_argc] = new char[it->length() + 1];
-		strcpy( m_argv[m_argc], it->toUtf8().constData() );
-	}
-
-	// register iTALC-protocol-extension
-	rfbProtocolExtension pe;
-	pe.newClient = isdNewClient;
-	pe.init = NULL;
-	pe.enablePseudoEncoding = NULL;
-	pe.pseudoEncodings = NULL;
-	pe.handleMessage = isdHandleMessage;
-	pe.close = NULL;
-	pe.usage = NULL;
-	pe.processArgument = NULL;
-	pe.next = NULL;
-	rfbRegisterProtocolExtension( &pe );
-
-	// register handler for iTALC's security-type
-	rfbSecurityHandler sh = {
-			rfbSecTypeItalc, isdAuthAgainstServer, NULL };
-	rfbRegisterSecurityHandler( &sh );
-
-	// run x11vnc-server
-	x11vnc_main( m_argc, m_argv );
-#elif BUILD_WIN32
-	// run winvnc-server
-	WinVNCAppMain();
-#endif
-}
-
-
diff --git a/ica/src/ivs.h b/ica/src/ivs.h
deleted file mode 100644
index 3c726a5..0000000
--- a/ica/src/ivs.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * ivs.h - class IVS, a VNC-server-abstraction for platform-independent
- *         VNC-server-usage
- *           
- * Copyright (c) 2006-2007 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 _IVS_H
-#define _IVS_H
-
-#include <QtCore/QThread>
-
-
-
-class IVS : public QThread
-{
-public:
-	IVS( const quint16 _ivs_port, int _argc, char * * _argv,
-						bool _no_threading = FALSE );
-	virtual ~IVS();
-
-	quint16 serverPort( void ) const
-	{
-		return( m_port );
-	}
-
-	bool runningInSeparateProcess( void ) const
-	{
-		return( m_runningInSeparateProcess );
-	}
-
-#ifdef BUILD_LINUX
-	void restart( void )
-	{
-		m_restart = TRUE;
-	}
-#endif
-
-
-private:
-	virtual void run( void );
-
-	int m_argc;
-	char * * m_argv;
-
-	quint16 m_port;
-	bool m_runningInSeparateProcess;
-
-#ifdef BUILD_LINUX
-	bool m_restart;
-#endif
-
-} ;
-
-
-#endif
-
diff --git a/ica/src/local_system_ica.cpp b/ica/src/local_system_ica.cpp
deleted file mode 100644
index f58c000..0000000
--- a/ica/src/local_system_ica.cpp
+++ /dev/null
@@ -1,513 +0,0 @@
-/*
- * local_system_ica.cpp - namespace localSystem, providing an interface for
- *                        transparent usage of operating-system-specific
- *                        functions
- *
- * Copyright (c) 2007-2008 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.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef BUILD_WIN32
-#define _WIN32_WINNT 0x0501
-#include <winsock2.h>
-#endif
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QProcess>
-
-#ifdef 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 "local_system.h"
-#include "system_key_trapper.h"
-#include "system_service.h"
-
-/*
-
-void getUserName( char * * _str )
-{
-	if( !_str )
-	{
-		return;
-	}
-	*_str = NULL;
-
-	DWORD aProcesses[1024], cbNeeded;
-
-	if( !EnumProcesses( aProcesses, sizeof( aProcesses ), &cbNeeded ) )
-	{
-		return;
-	}
-
-	DWORD cProcesses = cbNeeded / sizeof(DWORD);
-
-	for( DWORD i = 0; i < cProcesses; i++ )
-	{
-		HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
-								PROCESS_VM_READ,
-							false, aProcesses[i] );
-		HMODULE hMod;
-		if( hProcess == NULL ||
-			!EnumProcessModules( hProcess, &hMod, sizeof( hMod ),
-								&cbNeeded ) )
-	        {
-			continue;
-		}
-
-		TCHAR szProcessName[MAX_PATH];
-		GetModuleBaseName( hProcess, hMod, szProcessName, 
-                       		  sizeof( szProcessName ) / sizeof( TCHAR) );
-		for( TCHAR * ptr = szProcessName; *ptr; ++ptr )
-		{
-			*ptr = tolower( *ptr );
-		}
-
-		if( strcmp( szProcessName, "explorer.exe" ) )
-		{
-			CloseHandle( hProcess );
-			continue;
-		}
-	
-		HANDLE hToken;
-		OpenProcessToken( hProcess, TOKEN_READ, &hToken );
-		DWORD len = 0;
-
-		GetTokenInformation( hToken, TokenUser, NULL, 0, &len ) ;
-		if( len <= 0 )
-		{
-			CloseHandle( hToken );
-			CloseHandle( hProcess );
-			continue;
-		}
-		char * buf = new char[len];
-		if( buf == NULL )
-		{
-			CloseHandle( hToken );
-			CloseHandle( hProcess );
-			continue;
-		}
-		if ( !GetTokenInformation( hToken, TokenUser, buf, len, &len ) )
-		{
-			delete[] buf;
-			CloseHandle( hToken );
-			CloseHandle( hProcess );
-			continue;
-		}
-
-		PSID psid = ((TOKEN_USER*) buf)->User.Sid;
-
-		DWORD accname_len = 0;
-		DWORD domname_len = 0;
-		SID_NAME_USE nu;
-		LookupAccountSid( NULL, psid, NULL, &accname_len, NULL,
-							&domname_len, &nu );
-		if( accname_len == 0 || domname_len == 0 )
-		{
-			delete[] buf;
-			CloseHandle( hToken );
-			CloseHandle( hProcess );
-			continue;
-		}
-		char * accname = new char[accname_len];
-		char * domname = new char[domname_len];
-		if( accname == NULL || domname == NULL )
-		{
-			delete[] buf;
-			delete[] accname;
-			delete[] domname;
-			CloseHandle( hToken );
-			CloseHandle( hProcess );
-			continue;
-		}
-		LookupAccountSid( NULL, psid, accname, &accname_len,
-						domname, &domname_len, &nu );
-		WCHAR wszDomain[256];
-		MultiByteToWideChar( CP_ACP, 0, domname,
-			strlen( domname ) + 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 domcontroller = NULL;
-		if( NetGetDCName( NULL, wszDomain, &domcontroller ) !=
-								NERR_Success )
-		{
-			domcontroller = NULL;
-		}
-		LPUSER_INFO_2 pBuf = NULL;
-		NET_API_STATUS nStatus = NetUserGetInfo( (LPWSTR)domcontroller,
-						wszUser, 2, (LPBYTE *) &pBuf );
-		if( nStatus == NERR_Success && pBuf != NULL )
-		{
-			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 )
-				{
-					*_str = new char[2*accname_len+4];
-					sprintf( *_str, "%s (%s)", accname,
-								accname );
-				}
-				else
-				{
-					*_str = new char[len+accname_len+4];
-					sprintf( *_str, "%s (%s)", mbstr,
-								accname );
-				}
-				delete[] mbstr;
-			}
-			else
-			{
-				*_str = new char[2*accname_len+4];
-				sprintf( *_str, "%s (%s)", accname, accname );
-			}
-		}
-		if( pBuf != NULL )
-		{
-			NetApiBufferFree( pBuf );
-		}
-		if( domcontroller != NULL )
-		{
-			NetApiBufferFree( domcontroller );
-		}
-		delete[] accname;
-		delete[] domname;
-		FreeSid( psid );
-		delete[] buf;
-		CloseHandle( hToken );
-		CloseHandle( hProcess );
-	}
-}
-
-
-
-class userPollThread : public QThread
-{
-public:
-	userPollThread() : QThread()
-	{
-		start( LowPriority );
-	}
-
-	const QString & name( void )
-	{
-		QMutexLocker m( &m_mutex );
-		return( m_name );
-	}
-
-
-private:
-	virtual void run( void )
-	{
-		while( 1 )
-		{
-			char * name = NULL;
-			getUserName( &name );
-			if( name )
-			{
-				QMutexLocker m( &m_mutex );
-				m_name = name;
-				m_name.detach();
-				delete[] name;
-			}
-			Sleep( 5000 );
-		} // end while( 1 )
-
-	}
-
-	QString m_name;
-	QMutex m_mutex;
-
-}  static * __user_poll_thread = NULL;
-
-
-
-static BOOL WINAPI consoleCtrlHandler( DWORD _dwCtrlType )
-{
-	switch( _dwCtrlType )
-	{
-		case CTRL_LOGOFF_EVENT: return TRUE;
-		default: return FALSE;
-	}
-}
-*/
-
-
-#include "vncKeymap.h"
-
-extern vncServer * __server;
-extern __declspec(dllimport) BOOL __localInputsDisabled;
-
-static inline void pressKey( int _key, bool _down )
-{
-	if( !__server )
-	{
-		return;
-	}
-	vncKeymap::keyEvent( _key, _down, __server );
-	localSystem::sleep( 50 );
-}
-
-#else
-
-#include "local_system.h"
-
-#ifdef HAVE_X11
-#include <X11/Xlib.h>
-#else
-#define KeySym int
-#endif
-
-#ifdef 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
-
-
-extern QString __sessCurUser;
-
-namespace localSystem
-{
-
-
-void initialize( void )
-{
-	initialize( pressKey, "italc_client.log" );
-#ifdef BUILD_WIN32
-//	__user_poll_thread = new userPollThread();
-
-//	SetConsoleCtrlHandler( consoleCtrlHandler, TRUE );
-#endif
-
-}
-
-
-
-
-
-QString currentUser( void )
-{
-	QString ret = "unknown";
-
-#ifdef BUILD_WIN32
-	return __sessCurUser;
-/*
-	if( __user_poll_thread && !__user_poll_thread->name().isEmpty() )
-	{
-		ret = __user_poll_thread->name();
-	}
-*/
-#else
-
-	char * user_name = getenv( "USER" );
-#ifdef HAVE_PWD_H
-	struct passwd * pw_entry = NULL;
-	if( user_name )
-	{
-		pw_entry = getpwnam( user_name );
-	}
-	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") )
-		{
-			return( "" );
-		}
-
-		return( QString( "%1 (%2)" ).
-				arg( QString::fromUtf8( pw_entry->pw_gecos ) ).
-				arg( QString::fromUtf8( pw_entry->pw_name ) ) );
-	}
-#endif
-	if( user_name )
-	{
-		return QString::fromUtf8( user_name );
-	}
-
-#endif
-
-	return( ret );
-}
-
-
-
-
-void disableLocalInputs( bool _disabled )
-{
-#ifdef 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
-}
-
-
-
-void powerDown( void )
-{
-#ifdef BUILD_WIN32
-	enablePrivilege( SE_SHUTDOWN_NAME, TRUE );
-	ExitWindowsEx( EWX_POWEROFF | SHUTDOWN_FLAGS, SHUTDOWN_REASON );
-/*	InitiateSystemShutdown( NULL,	// local machine
-				NULL,	// message for shutdown-box
-				0,	// no timeout or possibility to abort
-					// system-shutdown
-				TRUE,	// force closing all apps
-				FALSE	// do not reboot
-				);*/
-	enablePrivilege( SE_SHUTDOWN_NAME, FALSE );
-#else
-	if( currentUser() == "root (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
-	}
-#endif
-}
-
-
-
-
-void logoutUser( void )
-{
-#ifdef 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
-#endif
-}
-
-
-
-void reboot( void )
-{
-#ifdef BUILD_WIN32
-	enablePrivilege( SE_SHUTDOWN_NAME, TRUE );
-	ExitWindowsEx( EWX_REBOOT | SHUTDOWN_FLAGS, SHUTDOWN_REASON );
-/*	InitiateSystemShutdown( NULL,	// local machine
-				NULL,	// message for shutdown-box
-				0,	// no timeout or possibility to abort
-					// system-shutdown
-				TRUE,	// force closing all apps
-				TRUE	// reboot
-				);*/
-	enablePrivilege( SE_SHUTDOWN_NAME, FALSE );
-#else
-	if( currentUser() == "root (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
-	}
-#endif
-}
-
-
-
-
-
-} // end of namespace localSystem
-
diff --git a/ica/src/local_system_ica.h b/ica/src/local_system_ica.h
deleted file mode 100644
index bda776b..0000000
--- a/ica/src/local_system_ica.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * local_system_ica.h - misc. platform-specific stuff
- *
- * Copyright (c) 2007 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_ICA_H
-#define _LOCAL_SYSTEM_ICA_H
-
-#include "local_system.h"
-
-namespace localSystem
-{
-	void initialize( void );
-
-	void disableLocalInputs( bool _disabled );
-}
-
-#endif
diff --git a/ica/src/system_service.cpp b/ica/src/system_service.cpp
deleted file mode 100644
index 53fa025..0000000
--- a/ica/src/system_service.cpp
+++ /dev/null
@@ -1,883 +0,0 @@
-/*
- * system_service.cpp - implementation of systemService-class
- *
- * 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 NO_GUI
-#include <QtGui/QApplication>
-#include <QtGui/QMessageBox>
-#else
-#include <QtCore/QCoreApplication>
-#endif
-#include <QtCore/QLocale>
-#include <QtCore/QProcess>
-#include <QtCore/QTranslator>
-
-#include "system_service.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#ifdef BUILD_WIN32
-PFN_WTSQuerySessionInformation pfnWTSQuerySessionInformation = NULL;
-PFN_WTSFreeMemory pfnWTSFreeMemory = NULL;
-#endif
-
-
-systemService::systemService(
-			const QString & _service_name,
-			const QString & _service_arg,
-			const QString & _service_display_name,
-			const QString & _service_dependencies,
-			service_main _sm,
-			int _argc,
-			char * * _argv )
-		:
-	m_name( _service_name ),
-	m_arg( _service_arg ),
-	m_displayName( _service_display_name ),
-	m_dependencies( _service_dependencies ),
-	m_serviceMain( _sm ),
-	m_running( FALSE ),
-	m_quiet( FALSE ),
-	m_argc( _argc ),
-	m_argv( _argv )
-{
-}
-
-
-
-
-bool systemService::evalArgs( int & _argc, char * * _argv )
-{
-	if( _argc > 1 )
-	{
-		const int oac = _argc;
-		_argc = 0;
-		const QString a = _argv[1];
-		if( a == m_arg )
-		{
-			return( runAsService() );
-		}
-#ifndef NO_GUI
-		QApplication app( _argc, _argv );
-		const QString loc = QLocale::system().name().left( 2 );
-		QTranslator app_tr;
-		app_tr.load( ":/resources/" + loc + ".qm" );
-		app.installTranslator( &app_tr );
-
-		QTranslator qt_tr;
-		qt_tr.load( ":/resources/qt_" + loc + ".qm" );
-		app.installTranslator( &qt_tr );
-#endif
-		for( int i = 1; i < oac; ++i )
-		{
-			const QString a = _argv[i];
-			if( a == m_arg )
-			{
-				return( runAsService() );
-			}
-			else if( a == "-registerservice" )
-			{
-				return( install() );
-			}
-			else if( a == "-unregisterservice" )
-			{
-				return( remove() );
-			}
-			else if( a == "-startservice" )
-			{
-				return( start() );
-			}
-			else if( a == "-stopservice" )
-			{
-				return( stop() );
-			}
-			else if( a == "-quiet" )
-			{
-				m_quiet = TRUE;
-			}
-		}
-		_argc = oac;
-	}
-	return( FALSE );
-}
-
-
-
-#ifdef BUILD_LINUX
-
-
-#include <QtCore/QFile>
-#include <QtCore/QFileInfo>
-
-
-inline bool isDebian( void )
-{
-	return( QFileInfo( "/etc/debian_version" ).exists() ||
-		QFileInfo( "/etc/ubuntu_version" ).exists() );
-}
-
-
-bool systemService::install( void )
-{
-	const QString sn = "/etc/init.d/" + m_name;
-	QFile f( sn );
-	f.open( QFile::WriteOnly | QFile::Truncate );
-	f.write( QString( "%1 %2\n" ).
-			arg( QCoreApplication::applicationFilePath() ).
-			arg( m_arg ).toUtf8() );
-	f.setPermissions( QFile::ReadOwner | QFile::WriteOwner |
-							QFile::ExeOwner |
-				QFile::ReadGroup | QFile::ExeGroup |
-				QFile::ReadOther | QFile::ExeOther );
-	f.close();
-#ifdef NO_GUI
-	if( isDebian() )
-	{
-		return( QProcess::execute( QString( "update-rc.d %1 defaults 50" ).
-								arg( m_name ) ) == 0 );
-	}
-#else
-	if( isDebian() )
-	{
-		QFile f( "/etc/X11/default-display-manager" );
-		f.open( QFile::ReadOnly );
-		const QString dm = QString( f.readAll() ).section( '/', -1 );
-		f.close();
-		if( dm == "kdm" )
-		{
-			QFile f( "/etc/kde3/kdm/Xsetup" );
-			f.open( QFile::WriteOnly );
-			f.seek( f.size() );
-			return( f.write( QString( "%1 %2" ).arg( sn ).arg( "start" ).
-								toUtf8() ) > 0 );
-		}
-		else if( dm == "gdm" )
-		{
-		}
-		else if( dm == "xdm" )
-		{
-		}
-		else
-		{
-		}
-	}
-#endif
-	return( FALSE );
-}
-
-
-bool systemService::remove( void )
-{
-	// TODO
-	return( FALSE );
-}
-
-
-
-
-bool systemService::start( void )
-{
-	return( QProcess::execute( QString( "/etc/init.d/%1 start" ).
-							arg( m_name ) ) == 0 );
-}
-
-
-
-
-bool systemService::stop( void )
-{
-	return( QProcess::execute( QString( "/etc/init.d/%1 stop" ).
-							arg( m_name ) ) == 0 );
-}
-
-
-
-
-bool systemService::runAsService( void )
-{
-	if( m_running || m_serviceMain == NULL )
-	{
-		return( FALSE );
-	}
-	m_serviceMain( this );
-	m_running = FALSE;
-	return( TRUE );
-}
-
-
-
-
-void systemService::serviceMainThread( void * _arg )
-{
-	systemService * _this = static_cast<systemService *>( _arg );
-	_this->m_serviceMain( _this );
-}
-
-
-
-
-#elif BUILD_WIN32
-
-
-#include <stdio.h>
-//#include "omnithread.h"
-
-
-systemService * 	systemService::s_this = NULL;
-SERVICE_STATUS		systemService::s_status;
-SERVICE_STATUS_HANDLE	systemService::s_statusHandle;
-DWORD			systemService::s_error = 0;
-DWORD			systemService::s_serviceThread = (DWORD) NULL;
-
-
-
-bool systemService::install( void )
-{
-	const unsigned int pathlength = 2048;
-	char path[pathlength];
-	char servicecmd[pathlength];
-
-	// TODO: replace by QCoreApplication::instance()->applicationFilePath()
-	// Get the filename of this executable
-	if( GetModuleFileName( NULL, path, pathlength -
-				( m_arg.length() + 2 ) ) == 0 )
-	{
-#ifndef NO_GUI
-		QMessageBox::critical( NULL, __app_name,
-			QApplication::tr( "Unable to register service '%1'." ).
-							arg( m_displayName ) );
-#endif
-		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 )
-	{
-#ifndef NO_GUI
-		QMessageBox::critical( NULL, __app_name,
-				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 ) );
-#endif
-		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)
-	{
-#ifndef NO_GUI
-		DWORD error = GetLastError();
-		if( error == ERROR_SERVICE_EXISTS && !m_quiet )
-		{
-			QMessageBox::warning( NULL, __app_name,
-				QApplication::tr(
-					"The service '%1' is already "
-						"registered." ).
-							arg( m_displayName ) );
-		}
-		else
-		{
-			QMessageBox::critical( NULL, __app_name,
-				QApplication::tr(
-					"The service '%1' could not "
-					"be registered." ).
-							arg( m_displayName ) );
-		}
-#else
-		GetLastError();
-#endif
-		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
-#ifndef NO_GUI
-	if( !m_quiet )
-	{
-		QMessageBox::information( NULL, __app_name,
-			QApplication::tr(
-				"The service '%1' was successfully registered."
-						).arg( m_displayName ) );
-	}
-#endif
-
-	return( TRUE );
-}
-
-
-
-
-bool systemService::remove( void )
-{
-	// 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 )
-				{
-#ifndef NO_GUI
-	QMessageBox::critical( NULL, __app_name,
-		QApplication::tr( "The service '%1' could not be stopped." ).
-							arg( m_displayName ) );
-#endif
-					suc = FALSE;
-				}
-			}
-
-			// Now remove the service from the SCM
-			if( suc && DeleteService( hservice ) )
-			{
-#ifndef NO_GUI
-	if( !m_quiet )
-	{
-		QMessageBox::information( NULL, __app_name,
-			QApplication::tr( "The service '%1' has been "
-						"unregistered." ).
-							arg( m_displayName ) );
-	}
-#endif
-			}
-			else
-			{
-				DWORD error = GetLastError();
-				if( error == ERROR_SERVICE_MARKED_FOR_DELETE )
-				{
-#ifndef NO_GUI
-	if( !m_quiet )
-	{
-		QMessageBox::critical( NULL, __app_name,
-			QApplication::tr( "The service '%1' isn't registered "
-						"and therefore can't be "
-						"unregistered." ).
-							arg( m_displayName ) );
-	}
-#endif
-				}
-				else
-				{
-#ifndef NO_GUI
-	QMessageBox::critical( NULL, __app_name,
-		QApplication::tr( "The service '%1' could not be "
-							"unregistered." ).
-						arg( m_displayName ) );
-#endif
-				}
-				suc = FALSE;
-			}
-			CloseServiceHandle( hservice );
-		}
-		else
-		{
-#ifndef NO_GUI
-	QMessageBox::critical( NULL, __app_name,
-		QApplication::tr( "The service '%1' could not be found." ).
-							arg( m_displayName ) );
-#endif
-			suc = FALSE;
-		}
-		CloseServiceHandle( hsrvmanager );
-	}
-	else
-	{
-#ifndef NO_GUI
-		QMessageBox::critical( NULL, __app_name,
-			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 ) );
-#endif
-		suc = FALSE;
-	}
-	return( suc );
-}
-
-
-
-bool systemService::start( void )
-{
-	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 )
-			{
-#ifndef NO_GUI
-	QMessageBox::critical( NULL, __app_name,
-		QApplication::tr( "The service '%1' could not be started." ).
-							arg( m_displayName ) );
-#endif
-				return( FALSE );
-			}
-		}
-		else
-		{
-#ifndef NO_GUI
-			QMessageBox::critical( NULL, __app_name,
-		QApplication::tr( "The service '%1' could not be found." ).
-							arg( m_displayName ) );
-#endif
-			CloseServiceHandle( hsrvmanager );
-			return( FALSE );
-		}
-	}
-	else
-	{
-#ifndef NO_GUI
-		QMessageBox::critical( NULL, __app_name,
-			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 )  );
-#endif
-		return( FALSE );
-	}*/
-	return( TRUE );
-}
-
-
-
-
-bool systemService::stop( void )
-{
-	// 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 )
-				{
-#ifndef NO_GUI
-	QMessageBox::critical( NULL, __app_name,
-		QApplication::tr( "The service '%1' could not be stopped." ).
-						arg( m_displayName ) );
-#endif
-					CloseServiceHandle( hservice );
-					CloseServiceHandle( hsrvmanager );
-					return( FALSE );
-				}
-			}
-			CloseServiceHandle( hservice );
-		}
-		else
-		{
-#ifndef NO_GUI
-			QMessageBox::critical( NULL, __app_name,
-		QApplication::tr( "The service '%1' could not be found." ).
-						arg( m_displayName ) );
-#endif
-			CloseServiceHandle( hsrvmanager );
-			return( FALSE );
-		}
-		CloseServiceHandle( hsrvmanager );
-	}
-	else
-	{
-#ifndef NO_GUI
-		QMessageBox::critical( NULL, __app_name,
-			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 ) );
-#endif
-		return( FALSE );
-	}
-	return( TRUE );
-}
-
-
-
-
-bool systemService::runAsService( void )
-{
-	if( m_running || m_serviceMain == NULL )
-	{
-		return( FALSE );
-	}
-	m_running = TRUE;
-
-	// Create a service entry table
-	SERVICE_TABLE_ENTRY dispatchTable[] =
-	{
-		{ m_name.toLocal8Bit().data(), (LPSERVICE_MAIN_FUNCTION) main },
-		{ NULL, NULL }
-	} ;
-
-	s_this = this;
-
-	// call the service control dispatcher with our entry table
-	if( !StartServiceCtrlDispatcher( dispatchTable ) )
-	{
-		qCritical( "systemService::runAsService(): "
-					"StartServiceCtrlDispatcher failed." );
-		return( FALSE );
-	}
-
-	return( TRUE );
-}
-
-
-
-
-
-
-void systemService::serviceMainThread( void * _arg )
-{
-	// Save the current thread identifier
-	s_serviceThread = GetCurrentThreadId();
-	
-	// report the status to the service control manager.
-	if( !reportStatus(	SERVICE_RUNNING,	// service state
-				NO_ERROR,		// exit code
-				0 ) )			// wait hint
-	{
-		return;
-	}
-
-	systemService * _this = static_cast<systemService *>( _arg );
-	_this->m_serviceMain( _this );
-
-	// Mark that we're no longer running
-	s_serviceThread = (DWORD) NULL;
-
-	// Tell the service manager that we've stopped.
-	reportStatus( SERVICE_STOPPED, s_error, 0 );
-}
-
-
-
-void WINAPI systemService::main( DWORD _argc, char * * _argv )
-{
-	HMODULE hWTSAPI32 = LoadLibrary("wtsapi32.dll");
-	if( hWTSAPI32 )
-	{
-		pfnWTSQuerySessionInformation = (PFN_WTSQuerySessionInformation) 
-			GetProcAddress(hWTSAPI32,"WTSQuerySessionInformationA");
-		pfnWTSFreeMemory = (PFN_WTSFreeMemory) 
-      		GetProcAddress(hWTSAPI32,"WTSFreeMemory");
-	}
-	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 = NO_ERROR;
-	s_status.dwControlsAccepted = 0;
-	s_status.dwWin32ExitCode = NO_ERROR;
-	s_status.dwCheckPoint = 0;
-	s_status.dwWaitHint = 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, s_error, 0 );
-		return;
-	}
-
-	serviceMainThread( s_this );
-}
-
-
-
-
-QString __sessCurUser;
-
-// Service control routine
-DWORD WINAPI systemService::serviceCtrl( DWORD _ctrlcode, DWORD dwEventType,
-							LPVOID lpEventData,
-							LPVOID lpContext )
-{
-	// What control code have we been sent?
-	switch( _ctrlcode )
-	{
-		case SERVICE_CONTROL_STOP:
-			// STOP : The service must stop
-			s_status.dwCurrentState = SERVICE_STOP_PENDING;
-			// Post a quit message to the main service thread
-			if( s_serviceThread )
-			{
-				PostThreadMessage( s_serviceThread, WM_QUIT, 0,
-									0 );
-			}
-			break;
-
-		case SERVICE_CONTROL_INTERROGATE:
-			// Service control manager just wants to know our state
-			break;
-			
-		case SERVICE_CONTROL_SESSIONCHANGE:
-			WTSSESSION_NOTIFICATION wtsno;
-			CopyMemory( &wtsno, lpEventData,
-					sizeof( WTSSESSION_NOTIFICATION ) );
-			
-			switch( dwEventType )
-			{
-				case WTS_SESSION_LOGOFF:
-					__sessCurUser = "";
-					break;
-				case WTS_SESSION_LOGON:
-					LPTSTR pBuffer = NULL;
-					DWORD dwBufferLen;
-	BOOL bRes = (*pfnWTSQuerySessionInformation)( WTS_CURRENT_SERVER_HANDLE,
-							wtsno.dwSessionId,
-							WTSUserName,
-							&pBuffer,
-							&dwBufferLen );
-					if( bRes != FALSE )
-					{
-						__sessCurUser = pBuffer;
-					}
-					(*pfnWTSFreeMemory)( pBuffer );
-					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 systemService::reportStatus( DWORD _state, DWORD _exit_code,
-							DWORD _wait_hint )
-{
-	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
-	{
-		if( QSysInfo::WindowsVersion == QSysInfo::WV_2000 )
-		{
-			s_status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
-		}
-		else
-		{
-			s_status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SESSIONCHANGE;
-		}
-	}
-
-	// Save the new status we've been given
-	s_status.dwCurrentState = _state;
-	s_status.dwWin32ExitCode = _exit_code;
-	s_status.dwWaitHint = _wait_hint;
-
-	// 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++;
-	}
-
-	// Tell the SCM our new status
-	if( !( result = SetServiceStatus( s_statusHandle, &s_status ) ) )
-	{
-		qCritical( "systemService::reportStatus(...): "
-						"SetServiceStatus failed." );
-	}
-
-	return( result );
-}
-
-
-#endif
-
diff --git a/ica/src/system_service.h b/ica/src/system_service.h
deleted file mode 100644
index c2c6178..0000000
--- a/ica/src/system_service.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * system_service.h - convenient class for using app as system-service
- *           
- * Copyright (c) 2006 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
- *  
- * This file is part of iTALC - http://italc.sourceforge.net
- * This file is part of LUPUS - http://lupus.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_SERVICE_H
-#define _SYSTEM_SERVICE_H
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef BUILD_WIN32
-#include <windows.h>
-#include <QtCore/QFile>
-#include <QtCore/QTextStream>
-
-#define WTS_SESSION_LOGON 0x5
-#define WTS_SESSION_LOGOFF 0x6
-#define WTS_CURRENT_SERVER_HANDLE 0
-
-typedef enum _WTS_INFO_CLASS
-{
-	WTSInitialProgram       = 0,
-	WTSApplicationName      = 1,
-	WTSWorkingDirectory     = 2,
-	WTSOEMId                = 3,
-	WTSSessionId            = 4,
-	WTSUserName             = 5,
-	WTSWinStationName       = 6,
-	WTSDomainName           = 7,
-	WTSConnectState         = 8,
-	WTSClientBuildNumber    = 9,
-	WTSClientName           = 10,
-	WTSClientDirectory      = 11,
-	WTSClientProductId      = 12,
-	WTSClientHardwareId     = 13,
-	WTSClientAddress        = 14,
-	WTSClientDisplay        = 15,
-	WTSClientProtocolType   = 16,
-	WTSIdleTime             = 17,
-	WTSLogonTime            = 18,
-	WTSIncomingBytes        = 19,
-	WTSOutgoingBytes        = 20,
-	WTSIncomingFrames       = 21,
-	WTSOutgoingFrames       = 22,
-	WTSClientInfo           = 23,
-	WTSSessionInfo          = 24 
-} WTS_INFO_CLASS;
-
-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;
-
-#endif
-
-#include <QtCore/QString>
-#include <QtCore/QThread>
-
-
-class systemService
-{
-public:
-	typedef int( * service_main )( systemService * );
-
-	systemService( const QString & _service_name,
-			const QString & _service_arg = QString::null,
-			const QString & _service_display_name = QString::null,
-			const QString & _service_dependencies = QString::null,
-			service_main _sm = NULL,
-			int _argc = 0,
-			char * * _argv = NULL );
-	//~systemService( void );
-
-	// install service - will start at next reboot
-	bool install( void );
-
-	// unregister service
-	bool remove( void );
-
-	// re-install service
-	bool reinstall( void )
-	{
-		return( remove() && install() );
-	}
-
-	// start service if possible
-	bool start( void );
-
-	// stop service if possible
-	bool stop( void );
-
-	// re-start service
-	bool restart( void )
-	{
-		return( stop() && start() );
-	}
-
-	bool runAsService( void );
-
-	bool evalArgs( int & _argc, char * * _argv );
-
-	inline int & argc( void )
-	{
-		return( m_argc );
-	}
-
-	inline char * * argv( void )
-	{
-		return( m_argv );
-	}
-
-
-private:
-	const QString m_name;
-	const QString m_arg;
-	const QString m_displayName;
-	const QString m_dependencies;
-	service_main m_serviceMain;
-	bool m_running;
-	bool m_quiet;
-
-	int m_argc;
-	char * * m_argv;
-
-
-	typedef void ( * workThreadFunctionPtr )( void * );
-
-	static void serviceMainThread( void * );
-
-#ifdef BUILD_WIN32
-	static void WINAPI main( DWORD, char * * );
-	static DWORD WINAPI serviceCtrl( DWORD _ctrlcode, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext );
-	static bool reportStatus( DWORD _state, DWORD _exit_code,
-							DWORD _wait_hint );
-
-	// we assume that a process won't contain more than one services
-	// therefore we can make these members static
-	static systemService *		s_this;
-	static SERVICE_STATUS		s_status;
-	static SERVICE_STATUS_HANDLE	s_statusHandle;
-	static DWORD			s_error;
-	static DWORD			s_serviceThread;
-#endif
-
-} ;
-
-extern QString __app_name;
-
-
-#endif
-
diff --git a/ica/win32/CMakeLists.txt b/ica/win32/CMakeLists.txt
new file mode 100644
index 0000000..6064ddb
--- /dev/null
+++ b/ica/win32/CMakeLists.txt
@@ -0,0 +1,39 @@
+SET(CMAKE_MODULE_LINKER_FLAGS -Wl,-export-all-symbols)
+
+IF(ITALC_BUILD_WIN32)
+	LINK_LIBRARIES(-ladvapi32)
+ENDIF(ITALC_BUILD_WIN32)
+
+SET(VH_WINRC "${CMAKE_CURRENT_BINARY_DIR}/vnchooksrc.obj")
+ADD_CUSTOM_COMMAND(OUTPUT ${VH_WINRC}
+						COMMAND ${WINDRES}
+							-I${CMAKE_CURRENT_SOURCE_DIR}
+							-o${VH_WINRC}
+							-i${CMAKE_CURRENT_SOURCE_DIR}/winvnc/vnchooks/vnchooks.rc)
+
+ADD_LIBRARY(vnchooks MODULE
+				${CMAKE_CURRENT_SOURCE_DIR}/winvnc/vnchooks/VNCHooks.cpp
+				${CMAKE_CURRENT_SOURCE_DIR}/winvnc/vnchooks/SharedData.cpp
+				${VH_WINRC})
+SET_TARGET_PROPERTIES(vnchooks PROPERTIES PREFIX "")
+
+
+ADD_DEFINITIONS(-DAUTHSSP_EXPORTS -DULTRAVNC_ITALC_SUPPORT)
+SET(AUTHSSP_WINRC "${CMAKE_CURRENT_BINARY_DIR}/authssprc.obj")
+ADD_CUSTOM_COMMAND(OUTPUT ${AUTHSSP_WINRC}
+						COMMAND ${WINDRES}
+							-I${CMAKE_CURRENT_SOURCE_DIR}
+							-o${AUTHSSP_WINRC}
+							-i${CMAKE_CURRENT_SOURCE_DIR}/addon/ms-logon/authSSP/authSSP.rc)
+
+ADD_LIBRARY(authSSP MODULE
+				${CMAKE_CURRENT_SOURCE_DIR}/addon/ms-logon/authSSP/authSSP.cpp
+				${CMAKE_CURRENT_SOURCE_DIR}/addon/ms-logon/authSSP/EventLogging.cpp
+				${CMAKE_CURRENT_SOURCE_DIR}/addon/ms-logon/authSSP/GenClientServerContext.cpp
+				${CMAKE_CURRENT_SOURCE_DIR}/addon/ms-logon/authSSP/vncAccessControl.cpp
+				${CMAKE_CURRENT_SOURCE_DIR}/addon/ms-logon/authSSP/vncSSP.cpp
+				${AUTHSSP_WINRC})
+TARGET_LINK_LIBRARIES(authSSP ItalcCore)
+SET_TARGET_PROPERTIES(authSSP PROPERTIES PREFIX "")
+
+
diff --git a/ica/win32/FileTransferItemInfo.h b/ica/win32/FileTransferItemInfo.h
deleted file mode 100644
index e69de29..0000000
diff --git a/ica/win32/README b/ica/win32/README
deleted file mode 100644
index ec7733a..0000000
--- a/ica/win32/README
+++ /dev/null
@@ -1,11 +0,0 @@
-Almost all of the code that can be found in sub-directories is taken from the
-TightVNC-project.
-
-Copyright (C) 1999 AT&T Laboratories Cambridge.
-Copyright (C) 2000 Tridia Corp.
-Copyright (C) 2002-2003 RealVNC Ltd.
-Copyright (C) 2001-2004 HorizonLive.com, Inc.
-Copyright (C) 2000-2006 Constantin Kaplinsky.
-Copyright (C) 2000-2006 TightVNC Group
-
-
diff --git a/ica/win32/VNCHelp.h b/ica/win32/VNCHelp.h
deleted file mode 100644
index b3e0ab9..0000000
--- a/ica/win32/VNCHelp.h
+++ /dev/null
@@ -1 +0,0 @@
-typedef int VNCHelp;
diff --git a/ica/win32/WallpaperUtils.h b/ica/win32/WallpaperUtils.h
deleted file mode 100644
index e69de29..0000000
diff --git a/ica/win32/addon/logger/logmessages.dsw b/ica/win32/addon/logger/logmessages.dsw
new file mode 100644
index 0000000..3b312d3
--- /dev/null
+++ b/ica/win32/addon/logger/logmessages.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "logmessages"=".\logmessages.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/addon/logger/messages.h b/ica/win32/addon/logger/messages.h
new file mode 100644
index 0000000..1ffe922
--- /dev/null
+++ b/ica/win32/addon/logger/messages.h
@@ -0,0 +1,66 @@
+//
+//  Values are 32 bit values laid out as follows:
+//
+//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
+//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+//  +---+-+-+-----------------------+-------------------------------+
+//  |Sev|C|R|     Facility          |               Code            |
+//  +---+-+-+-----------------------+-------------------------------+
+//
+//  where
+//
+//      Sev - is the severity code
+//
+//          00 - Success
+//          01 - Informational
+//          10 - Warning
+//          11 - Error
+//
+//      C - is the Customer code flag
+//
+//      R - is a reserved bit
+//
+//      Facility - is the facility code
+//
+//      Code - is the facility's status code
+//
+//
+// Define the facility codes
+//
+
+
+//
+// Define the severity codes
+//
+
+
+//
+// MessageId: MY_MSG1
+//
+// MessageText:
+//
+// 
+// %1
+//
+#define MY_MSG1                          0x00640001L
+
+//
+// MessageId: MY_MSG2
+//
+// MessageText:
+//
+// 
+// %1
+//
+#define MY_MSG2                          0x00640002L
+
+//
+// MessageId: MY_MSG3
+//
+// MessageText:
+//
+// 
+// %1
+//
+#define MY_MSG3                          0x00640003L
+
diff --git a/ica/win32/addon/logger/messages.mc b/ica/win32/addon/logger/messages.mc
new file mode 100644
index 0000000..357479e
--- /dev/null
+++ b/ica/win32/addon/logger/messages.mc
@@ -0,0 +1,26 @@
+FacilityNames=( MY_PROGS=100 )
+MessageID=1
+Facility=MY_PROGS
+SymbolicName=MY_MSG1
+Language=English
+
+%1
+.
+
+FacilityNames=( MY_PROGS=100 )
+MessageID=2
+Facility=MY_PROGS
+SymbolicName=MY_MSG2
+Language=English
+
+%1
+.
+
+FacilityNames=( MY_PROGS=100 )
+MessageID=3
+Facility=MY_PROGS
+SymbolicName=MY_MSG3
+Language=English
+
+%1
+.
diff --git a/ica/win32/addon/logger/messages.rc b/ica/win32/addon/logger/messages.rc
new file mode 100644
index 0000000..a928b13
--- /dev/null
+++ b/ica/win32/addon/logger/messages.rc
@@ -0,0 +1,2 @@
+LANGUAGE 0x9,0x1
+1 11 "MSG00001.bin"
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/.cvsignore b/ica/win32/addon/ms-logon/MSLogonACL/.cvsignore
new file mode 100644
index 0000000..8567875
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/.cvsignore
@@ -0,0 +1,4 @@
+buildtime.h
+*.ncb
+*.opt
+*.plg
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.cpp b/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.cpp
new file mode 100644
index 0000000..6a33a4d
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.cpp
@@ -0,0 +1,117 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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 <locale.h>
+#include <wchar.h>
+#include <tchar.h>
+#include "MSLogonACL.h"
+#include "vncImportACL.h"
+#include "vncExportACL.h"
+
+
+int _tmain(int argc, TCHAR *argv[])
+{
+	setlocale( LC_ALL, "" );
+	bool append = false;
+	int rc = 1;
+
+	if (argc > 1) {
+		if (_tcsicmp(argv[1], _T("/i")) == 0 || _tcsicmp(argv[1], _T("-i")) == 0) {
+			if (argc < 4) {
+				return 1;
+			} else {
+				if (_tcsicmp(argv[2], _T("/a")) == 0 || _tcsicmp(argv[2], _T("-a")) == 0)
+					append = true;
+				else if (_tcsicmp(argv[2], _T("/o")) == 0 || _tcsicmp(argv[2], _T("-o")) == 0)
+					; //override
+				else {
+					usage_(argv[0]);
+					return 1;
+				}
+				if (!_tfreopen(argv[3], _T("r"), stdin)) {
+					_tprintf(_T("Error opening file %s"), argv[3]);
+					usage_(argv[0]);
+					return 1;
+				}
+			}
+			rc = import_(append);
+		} else if (_tcsicmp(argv[1], _T("/e")) == 0 || _tcsicmp(argv[1], _T("-e")) == 0) {
+			if (argc > 2)
+				if (!_tfreopen(argv[2], _T("w"), stdout)) {
+					_tprintf(_T("Error opening file %s"), argv[2]);
+					usage_(argv[0]);
+					return 1;
+				}
+			rc = export_();
+		} else {
+			usage_(argv[0]);
+		}
+	} else {
+		usage_(argv[0]);
+	}
+	return rc;
+}
+
+int 
+import_(bool append){
+	int rc = 0;
+	vncImportACL importAcl;
+	PACL pACL = NULL; //?
+
+
+		if (append)
+			importAcl.GetOldACL();
+		if (importAcl.ScanInput())
+			rc |= 2;
+		pACL = importAcl.BuildACL();
+		importAcl.SetACL(pACL);
+
+		HeapFree(GetProcessHeap(), 0, pACL);
+
+	return rc;
+}
+
+int
+export_()
+{
+	PACL pACL = NULL;
+
+	vncExportACL exportAcl;
+	exportAcl.GetACL(&pACL);
+	exportAcl.PrintAcl(pACL);
+	if (pACL)
+		LocalFree(pACL);
+
+	return 0;
+}
+
+
+void usage_(const TCHAR *appname){
+	_tprintf(_T("Usage:\n%s /e <file>\n\t for exporting an ACL to an (optional) file.\n"), appname);
+	_tprintf(_T("%s /i <mode> <file>\n\t for importing an ACL where mode is either\n"), appname);
+	_tprintf(_T("\t/o for override or /a for append and file holds the ACEs.\n"));
+	_tprintf(_T("For the format of the ACEs first configure some groups/users\n"));
+	_tprintf(_T("with the graphical VNC Properties and then export the ACL.\n"));
+	_tprintf(_T("The computer name can be replaced by a \".\" (a dot),\n"));
+	_tprintf(_T("the computer's domain name by \"..\" (two dots).\n"));
+}
+
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.dsw b/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.dsw
new file mode 100644
index 0000000..031dd50
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN!
+
+###############################################################################
+
+Project: "MSLogonACL"=".\MSLogonACL.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.h b/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.h
new file mode 100644
index 0000000..e4e585b
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.h
@@ -0,0 +1,28 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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/
+/*
+ *  MSLogonACL.h
+ */
+
+void usage_(const TCHAR *appname);
+int export_();
+int import_(bool append);
\ No newline at end of file
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.rc b/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.rc
new file mode 100644
index 0000000..a4dc1d7
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/MSLogonACL.rc
@@ -0,0 +1,116 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+// Defines STR_COMPANYNAME, STR_FILEVERSION, STR_PRODUCTVERSION, STR_COPYRIGHT,
+// STR_SPECIALBUILD, FILEVERSION, PRODUCTVERSION
+#include "../../versioninfo.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION INT_FILEVERSION
+ PRODUCTVERSION INT_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+#if isRC == 1
+#include "buildtime.h" // defines macro BUILDTIME
+            VALUE "Buildtime", BUILDTIME
+#endif
+            VALUE "Comments", "Imports/exports ACL for UltraVNC's MS-Logon II\0"
+            VALUE "CompanyName", STR_COMPANYNAME
+            VALUE "FileDescription", "MSLogonACL\0"
+            VALUE "FileVersion", STR_FILEVERSION
+            VALUE "InternalName", "MSLogonACL\0"
+            VALUE "LegalCopyright", STR_COPYRIGHT
+            VALUE "OriginalFilename", "MSLogonACL.exe\0"
+            VALUE "ProductName", "UltraVNC MSLogonACL\0"
+            VALUE "ProductVersion", STR_PRODUCTVERSION
+#if isRC == 1
+			VALUE "SpecialBuild", STR_SPECIALBUILD
+#endif
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/buildtime.h b/ica/win32/addon/ms-logon/MSLogonACL/buildtime.h
new file mode 100644
index 0000000..71dc4e4
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/buildtime.h
@@ -0,0 +1,3 @@
+
+
+#define BUILDTIME "Jan 10 2011" " " "21:27:14" "\0"
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/buildtime.in b/ica/win32/addon/ms-logon/MSLogonACL/buildtime.in
new file mode 100644
index 0000000..8df4748
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/buildtime.in
@@ -0,0 +1,2 @@
+#define BUILDTIMEMACRO #define BUILDTIME __DATE__ " " __TIME__ "\0"
+BUILDTIMEMACRO
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/resource.h b/ica/win32/addon/ms-logon/MSLogonACL/resource.h
new file mode 100644
index 0000000..e0c1b03
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by MSLogonACL.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/vncExportACL.cpp b/ica/win32/addon/ms-logon/MSLogonACL/vncExportACL.cpp
new file mode 100644
index 0000000..9d8d08f
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/vncExportACL.cpp
@@ -0,0 +1,220 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2004 Martin Scharpf. All Rights Reserved.
+//  Based on Felix Kasza's DumpACL (http://win32.mvps.org/security/dumpacl.html).
+//
+//  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 <wchar.h>
+#include <tchar.h>
+#include "vncExportACL.h"
+
+// Get ACL from regkey HKLM\Software\ORL\WinVNC3\ACL
+bool vncExportACL::GetACL(PACL *pACL){
+	HKEY hk = NULL; 
+	DWORD dwValueLength = SECURITY_DESCRIPTOR_MIN_LENGTH;
+	
+	_ftprintf(stderr, _T("== Entering GetACL\n"));
+	__try{
+		
+		if (ERROR_SUCCESS != RegOpenKeyEx( HKEY_LOCAL_MACHINE,
+			_T("Software\\ORL\\WinVNC3"),
+			0, KEY_QUERY_VALUE, &hk )){
+			_ftprintf(stderr, _T("== Error %d: RegOpenKeyEx\n"), GetLastError());
+			__leave;
+		}
+		// Read the ACL value from the VNC registry key
+		// First call to RegQueryValueEx just gets the buffer length.
+		if (ERROR_SUCCESS != RegQueryValueEx(hk,	// subkey handle 
+            _T("ACL"),				// value name 
+            0,                      // must be zero 
+            0,						// value type , not needed here
+			NULL,					// 
+            &dwValueLength)){       // length of value data 
+			_ftprintf(stderr, _T("== Error %d: RegQueryValueEx 1\tValueLength = %d\n"), 
+				GetLastError(), dwValueLength);
+			__leave;
+		}
+		*pACL = (PACL) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueLength);
+		
+		if (ERROR_SUCCESS != RegQueryValueEx(hk,	// subkey handle 
+            _T("ACL"),								// value name 
+            0,										// must be zero 
+            0,										// value type 
+			(LPBYTE) *pACL,
+            &dwValueLength)){						// length of value data 
+			_ftprintf(stderr, _T("== Error %d: RegQueryValueEx 2\n"), GetLastError());
+			__leave;
+		}
+		_ftprintf(stderr, _T("== RegQueryValueEx passed\tdwValueLength = %d\n"), dwValueLength);
+
+	} __finally {
+		if (hk)
+			RegCloseKey(hk); 
+	}
+	return true;
+}
+
+
+
+const TCHAR *vncExportACL::SidToText( PSID psid )
+{
+	// S-rev- + SIA + subauthlen*maxsubauth + terminator
+	static TCHAR buf[15 + 12 + 12*SID_MAX_SUB_AUTHORITIES + 1];
+	TCHAR *p = &buf[0];
+	PSID_IDENTIFIER_AUTHORITY psia;
+	DWORD numSubAuths, i;
+
+	// Validate the binary SID.
+
+	if (!IsValidSid(psid))
+		return FALSE;
+
+	psia = GetSidIdentifierAuthority(psid);
+
+	p = buf;
+	p += _sntprintf(p, &buf[sizeof buf] - p, _T("S-%lu-"), 0x0f & *((byte *)psid));
+
+	if ((psia->Value[0] != 0) || (psia->Value[1] != 0))
+		p += _sntprintf( p, &buf[sizeof buf] - p, _T("0x%02hx%02hx%02hx%02hx%02hx%02hx"),
+			(USHORT) psia->Value[0], (USHORT) psia->Value[1],
+			(USHORT) psia->Value[2], (USHORT) psia->Value[3],
+			(USHORT) psia->Value[4], (USHORT) psia->Value[5] );
+	else
+		p += _sntprintf(p, &buf[sizeof buf] - p, _T("%lu"), (ULONG) (psia->Value[5]) +
+			(ULONG) (psia->Value[4] << 8) + (ULONG) (psia->Value[3] << 16) +
+			(ULONG) (psia->Value[2] << 24));
+
+	// Add SID subauthorities to the string.
+
+	numSubAuths = *GetSidSubAuthorityCount(psid);
+	for (i = 0; i < numSubAuths; ++ i)
+		p += _sntprintf(p, &buf[sizeof buf] - p, _T("-%lu"), *GetSidSubAuthority(psid, i));
+
+	return buf;
+}
+
+void vncExportACL::PrintSid(PSID psid)
+{
+	TCHAR name[256], domain[256];
+	DWORD cbname = sizeof name, cbdomain = sizeof domain, rc;
+	SID_NAME_USE sidUse;
+
+	//!! next line has hardcoded server name !!
+	// NULL server name is usually appropriate, though.
+	if (LookupAccountSid(NULL, psid, name, &cbname, domain, &cbdomain, &sidUse))
+	{
+		//Todo: Check if WellKnownSID and reserve special names for them.
+
+/*		switch ( sidUse )
+		{
+			case SidTypeWellKnownGroup:	type = "well-known group"; break;
+			default:					type = "bad sidUse value"; break;
+		}
+*/
+		LPWKSTA_INFO_100 wkstainfo = NULL;
+		NET_API_STATUS nStatus;
+		TCHAR langroup[MAXLEN];
+		TCHAR computername[MAXLEN];
+
+		nStatus = NetWkstaGetInfo( 0 , 100 , (LPBYTE *) &wkstainfo);
+		if (nStatus == NERR_Success){
+			_tcsncpy(langroup, wkstainfo->wki100_langroup, MAXLEN);
+			_tcsncpy(computername, wkstainfo->wki100_computername, MAXLEN);
+			langroup[MAXLEN - 1] = _T('\0');
+			computername[MAXLEN - 1] = _T('\0');
+			// replace computername with a dot
+			if (_tcsicmp(computername, domain) == 0)
+				_tcscpy(domain,_T("."));
+			else if (_tcsicmp(langroup, domain) == 0)
+				_tcscpy(domain, _T(".."));
+		}
+		else
+			_tprintf(_T("NetWkstaGetInfo() returned %lu \n"), wkstainfo);
+
+		NetApiBufferFree(wkstainfo);
+		wkstainfo = NULL;
+
+		// If domain or username contains whitespace, print enclosing quotes
+		if (_tcschr(domain, _T(' ')) || _tcschr(name, _T(' ')))
+			_tprintf(_T("\"%s%s%s\"\n"), domain, (domain == 0 || *domain == _T('\0'))? _T(""): _T("\\"), name);
+		else
+			_tprintf(_T("%s%s%s\n"), domain, (domain == 0 || *domain == _T('\0'))? _T(""): _T("\\"), name);
+	}
+	else
+	{
+		rc = GetLastError();
+		_tprintf(_T("[%s] *** error %lu\n"), SidToText( psid ), rc);
+	}
+}
+
+void vncExportACL::PrintAce(int index, PACL acl){
+
+	ACE_HEADER *ace;
+	TCHAR *type;
+	PSID psid;
+
+	if (!GetAce(acl, index, (void **) &ace)) {
+		_tprintf(_T("DACL, entry %d: GetAce() failed, gle == %lu\n"),
+			index, GetLastError());
+		return;
+	}
+
+	switch ( ace->AceType ) {
+		case ACCESS_ALLOWED_ACE_TYPE:
+			type = _T("allow");
+			psid = &((ACCESS_ALLOWED_ACE *) ace)->SidStart;
+			break;
+		case ACCESS_DENIED_ACE_TYPE:
+			type = _T("deny");
+			psid = &((ACCESS_DENIED_ACE *) ace)->SidStart;
+			break;
+		default:
+			type = _T("invalid");
+			psid = &((ACCESS_ALLOWED_ACE *) ace)->SidStart;
+			break;
+	}
+	_tprintf(_T("%s\t"), type);
+
+	_tprintf(_T("0x%08lX\t"), ((ACCESS_ALLOWED_ACE *) ace)->Mask);
+
+	PrintSid( psid );
+}
+
+
+
+void vncExportACL::PrintAcl(PACL acl)
+{
+	DWORD i;
+	ACL_SIZE_INFORMATION aci;
+
+	if ( acl == 0 )
+		return;
+
+	if (!GetAclInformation( acl, &aci, sizeof aci, AclSizeInformation))	{
+		_tprintf(_T("GAI(): gle == %lu\n"), GetLastError());
+		return;
+	}
+
+	for ( i = 0; i < aci.AceCount; ++ i )
+		PrintAce(i, acl);
+
+}
+
+
+
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/vncExportACL.h b/ica/win32/addon/ms-logon/MSLogonACL/vncExportACL.h
new file mode 100644
index 0000000..ebfd788
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/vncExportACL.h
@@ -0,0 +1,56 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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/
+/* 
+ *  vncExportACL.h
+ */
+
+#define _WIN32_WINNT	0x0500
+#define WINVER			0x0500
+
+#include <windows.h>
+#include <aclapi.h>
+#include <stdio.h>
+#include <string.h>
+#include <lm.h>
+
+#define MAXLEN 256
+#define lenof(a) (sizeof(a) / sizeof((a)[0]) )
+
+class vncExportACL{
+public:
+	// returns the address of a !!static!!, non-thread-local, buffer with
+	// the text representation of the SID that was passed in
+	const TCHAR *SidToText( PSID psid );
+	
+	// Translates a SID and terminates it with a linefeed. No provision is
+	// made to dump the SID in textual form if LookupAccountSid() fails.
+	void PrintSid( PSID psid );
+	
+	// Displays the index-th (0-based) ACE from ACL
+	void PrintAce(int index, PACL acl);
+	
+	// Dumps an entire ACL
+	void PrintAcl(PACL acl);
+	
+	bool GetACL(PACL *pACL);
+	
+};
\ No newline at end of file
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/vncImportACL.cpp b/ica/win32/addon/ms-logon/MSLogonACL/vncImportACL.cpp
new file mode 100644
index 0000000..63c0d9d
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/vncImportACL.cpp
@@ -0,0 +1,498 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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 <wchar.h>
+#include <tchar.h>
+#include "vncImportACL.h"
+
+vncImportACL::vncImportACL(){
+	lastAllowACE = NULL;
+	lastDenyACE = NULL;
+}
+
+vncImportACL::~vncImportACL(){
+	_ftprintf(stderr, _T("deleting ACE_DATA linked lists\n"));
+	ACE_DATA *tmp = NULL;
+	for (ACE_DATA *i = lastDenyACE; i != NULL; i = tmp){
+		if (i->pSID)
+			delete i->pSID;
+		tmp = i->next;
+		delete i;
+	}
+	for (ACE_DATA *j = lastAllowACE; j != NULL; j = tmp){
+		if (j->pSID)
+			delete j->pSID;
+		tmp = j->next;
+		delete j;
+	}
+
+}
+
+void vncImportACL::GetOldACL(){
+	PACL pOldACL = NULL;
+	ACL_SIZE_INFORMATION asi;
+	HKEY hk = NULL; 
+	DWORD dwValueLength = SECURITY_DESCRIPTOR_MIN_LENGTH;
+	
+	__try{
+		
+		if (ERROR_SUCCESS != RegOpenKeyEx( HKEY_LOCAL_MACHINE,
+			_T("Software\\ORL\\WinVNC3"),
+			0, KEY_QUERY_VALUE, &hk )){
+			__leave;
+		}
+		// Read the ACL value from the VNC registry key
+		// First call to RegQueryValueEx just gets the buffer length.
+		if (ERROR_SUCCESS != RegQueryValueEx(hk,	// subkey handle 
+            _T("ACL"),					// value name 
+            0,                      // must be zero 
+            0,						// value type , not needed here
+			NULL,					// 
+            &dwValueLength)){       // length of value data 
+			__leave;
+		}
+		pOldACL = (PACL) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueLength);
+		
+		if (ERROR_SUCCESS != RegQueryValueEx(hk,	// subkey handle 
+            _T("ACL"),					// value name 
+            0,										// must be zero 
+            0,										// value type 
+			(LPBYTE) pOldACL,
+            &dwValueLength)){						// length of value data 
+			__leave;
+		}
+
+	} __finally {
+		if (hk)
+			RegCloseKey(hk); 
+	}
+
+	if ( pOldACL == NULL )
+		return;
+
+	if (!GetAclInformation( pOldACL, &asi, sizeof asi, AclSizeInformation))	{
+		_ftprintf(stderr, _T("GAI(): gle == %lu\n"), GetLastError());
+		return;
+	}
+
+	for (DWORD i = 0; i < asi.AceCount; ++ i)
+		ReadAce(i, pOldACL);
+
+	HeapFree(GetProcessHeap(), 0, pOldACL);
+}
+
+void vncImportACL::ReadAce(int index, PACL pACL){
+	ACE_HEADER *ace;
+	//char *type;
+	//PSID psid;
+	ACE_DATA * pACEdata;
+
+	if (!GetAce( pACL, index, (void **) &ace)) {
+		_ftprintf(stderr, _T("DACL, entry %d: GetAce() failed, gle == %lu\n"),
+			index, GetLastError());
+		return;
+	}
+
+	pACEdata = new ACE_DATA;
+	switch ( ace->AceType ) {
+		case ACCESS_ALLOWED_ACE_TYPE:
+			pACEdata->type = ACCESS_ALLOWED;
+			pACEdata->pSID = CopySID(&((ACCESS_ALLOWED_ACE *) ace)->SidStart);
+			pACEdata->mask = ((ACCESS_ALLOWED_ACE *) ace)->Mask;
+			pACEdata->next = lastAllowACE;
+			lastAllowACE   = pACEdata;
+			break;
+		case ACCESS_DENIED_ACE_TYPE:
+			pACEdata->type = ACCESS_DENIED;
+			pACEdata->pSID = CopySID(&((ACCESS_DENIED_ACE *) ace)->SidStart);
+			pACEdata->mask = ((ACCESS_DENIED_ACE *) ace)->Mask;
+			pACEdata->next = lastDenyACE;
+			lastDenyACE   = pACEdata;
+			break;
+		default:
+			_ftprintf(stderr, _T("Error: Unknown ACE type\n"));
+			delete pACEdata;
+			break;
+	}
+}
+
+PSID vncImportACL::CopySID(PSID pSID){
+	PSID pNewSID = NULL;
+	DWORD sidLength = 0;
+
+	if (IsValidSid(pSID)){
+		sidLength = GetLengthSid(pSID);
+		pNewSID = (PSID) new char[sidLength];
+		CopySid(sidLength, pNewSID, pSID);
+	}
+	return pNewSID;
+}
+
+int vncImportACL::ScanInput(){
+	int rc = 0;
+	vncScanInput scanInput;
+
+	do {
+		TCHAR linebuf[MAXLEN];
+		TCHAR *line = linebuf;
+		TCHAR *token[3];
+		TCHAR accesstype[MAXLEN];
+		TCHAR accessmaskstring[MAXLEN];
+		TCHAR domainaccount[MAXLEN];
+		DWORD accessmask = 0;
+		token[0] = accesstype;
+		token[1] = accessmaskstring;
+		token[2] = domainaccount;
+
+		if (!scanInput.GetLine(line)) {
+			rc |= 1;
+			break;
+		}
+		scanInput.RemoveNewline(line);
+		scanInput.RemoveComment(line);
+		if (scanInput.isEmptyLine(line))
+			continue;
+		if (scanInput.Tokenize(line, token)
+			&& _stscanf(accessmaskstring, _T("%x"), &accessmask) == 1) {
+			FillAceData(accesstype, accessmask, domainaccount);
+		} else {
+			_tprintf(_T("Error tokenizing line\n"));
+			rc |= 2;
+		}
+	} while(!feof(stdin));
+	return rc;
+}
+
+PACL vncImportACL::BuildACL(){
+	PACL pACL = NULL;
+	// Need canonical order and normalization??
+	// Solution canonical order: aceAllowStart and aceDenyStart?
+	// Solution normalization: Check for multiple occurrance of SID
+	// in allow list and deny list and merge them.
+	long aclSize = 8; // For ACL header
+
+	for (ACE_DATA *i = lastDenyACE; i != NULL; i = i->next){
+		aclSize += GetLengthSid(i->pSID) + sizeof(ACCESS_DENIED_ACE) - sizeof(DWORD);
+	}
+	for (ACE_DATA *j = lastAllowACE; j != NULL; j = j->next){
+		aclSize += GetLengthSid(j->pSID) + sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD);
+	}
+
+	pACL = (PACL) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,	aclSize);
+	
+	// Initialize the new ACL.
+	if (InitializeAcl(pACL, aclSize, ACL_REVISION)) {
+		// Add the access-denied ACEs to the ACL.
+		for (ACE_DATA *i = lastDenyACE; i != NULL; i = i->next){
+			//Todo: add error handling.
+			AddAccessDeniedAce(pACL, ACL_REVISION, i->mask, i->pSID);
+		}
+		for (ACE_DATA *j = lastAllowACE; j != NULL; j = j->next){
+			//Todo: add error handling.
+			AddAccessAllowedAce(pACL, ACL_REVISION, j->mask, j->pSID);
+		}
+	}
+	return pACL;
+}
+
+bool vncImportACL::SetACL(PACL pACL){
+	HKEY hk = NULL; 
+	bool isSaveOK = false;
+	DWORD  dwDisposition;
+
+    ACL_SIZE_INFORMATION AclInformation = {0, 0, 0};
+	DWORD nAclInformationLength = sizeof(AclInformation);
+
+	// Todo: Better error handling
+	if (pACL)
+		GetAclInformation(pACL, &AclInformation, nAclInformationLength, AclSizeInformation);
+
+	__try{
+		//if (ERROR_SUCCESS != RegOpenKeyEx( HKEY_LOCAL_MACHINE,
+		//	_T("Software\\ORL\\WinVNC3"),
+		//	0, KEY_SET_VALUE, &hk )){
+		//	_ftprintf(stderr, _T("Error %d: RegOpenKeyEx\n"), GetLastError());
+		//	__leave;
+		//}
+		
+		if (ERROR_SUCCESS != RegCreateKeyEx( HKEY_LOCAL_MACHINE,
+			_T("Software\\ORL\\WinVNC3"),
+			0, NULL, 0, KEY_SET_VALUE, NULL, &hk, &dwDisposition )){
+			_ftprintf(stderr, _T("Error %d: RegOpenKeyEx\n"), GetLastError());
+			__leave;
+		}
+
+		// Add the ACL value to the VNC registry key
+		if (ERROR_SUCCESS != RegSetValueEx(hk,
+            _T("ACL"),
+            0,
+            REG_BINARY,
+			(LPBYTE) pACL,
+            AclInformation.AclBytesInUse)){
+			_ftprintf(stderr, _T("Error %d: RegSetValueEx\n"), GetLastError());
+			__leave;
+		}
+		isSaveOK = true;
+		_ftprintf(stderr, _T("RegSetValueEx passed\n"));
+	} __finally {
+		if (hk)
+			RegCloseKey(hk); 
+	}
+	return isSaveOK;
+}
+
+bool vncImportACL::FillAceData(const TCHAR *type, 
+				 DWORD mask, 
+				 const TCHAR *user){
+	ACE_TYPE acetype;
+	TCHAR *domainaccount = NULL;
+	PSID pSID = NULL;
+
+	//type
+	if (_tcsicmp(type, _T("allow")) == 0)
+		acetype = ACCESS_ALLOWED;
+	else if (_tcsicmp(type, _T("deny")) == 0)
+		acetype = ACCESS_DENIED;
+	else {
+		_ftprintf(stderr, _T("error with ACE type, neither 'allow' nor 'deny'\n"));
+		return false;
+	}
+
+	//mask
+	mask &= ALL_RIGHTS;
+
+	// if name starts with ".\", replace the dot with the computername.
+	// if name starts with "..\", replace the dots with the domainname.
+	if (_tcsncmp(user, _T(".\\"), 2) == 0)
+		domainaccount = AddComputername(user);
+	else if  (_tcsncmp(user, _T("..\\"), 2) == 0)
+		domainaccount = AddDomainname(user);
+	else {
+		domainaccount = new TCHAR[_tcslen(user)+1];
+		_tcscpy(domainaccount,user);
+	}
+	pSID = GetSID(domainaccount);
+	if (!pSID)
+		return false;
+	_tprintf(_T("account: %s, mask: %x, type: %s\n"), 
+		domainaccount, mask, acetype == ACCESS_ALLOWED ? _T("allow") : _T("deny"));
+	ACE_DATA *ace = new ACE_DATA;
+	ace->type = acetype;
+	ace->mask = mask;
+	ace->pSID = pSID;
+	switch (acetype){
+	case ACCESS_ALLOWED:
+		ace->next = lastAllowACE;
+		lastAllowACE = ace;
+		break;
+	case ACCESS_DENIED:
+		ace->next = lastDenyACE;
+		lastDenyACE = ace;
+		break;
+	default:
+		break;
+	}
+
+	delete [] domainaccount;
+	domainaccount = NULL;
+
+	return true; // Needs better error signalling.
+}
+
+PSID vncImportACL::GetSID(const TCHAR *domainaccount){
+	PSID pSid = NULL;
+	unsigned long ulDomLen = 0;
+	unsigned long ulSidLen = 0;
+	SID_NAME_USE peUse;
+	TCHAR *domain = NULL;
+
+	// Get accounts's SID
+	// First call to LookupAccountName is expected to fail.
+	// Sets pSid and domain size
+	LookupAccountName(NULL, domainaccount, pSid, &ulSidLen,
+		domain, &ulDomLen, &peUse);
+	pSid = (PSID)new TCHAR[ulSidLen];
+	domain = new TCHAR[ulDomLen];
+	LookupAccountName(NULL, domainaccount,
+		pSid, &ulSidLen, domain, &ulDomLen, &peUse);
+	if (!IsValidSid(pSid)){
+		_ftprintf(stderr, _T("%s: SID not valid.\n"), domainaccount);
+		delete [] pSid;
+				pSid = NULL;
+	}
+	delete [] domain;
+
+	return pSid;
+}
+
+// SplitString splits a string 'input' on the first occurence of char 'separator'
+// into string 'head' and 'tail' (removing the separator).
+// If separator is not found, head = "" and tail = input.
+const TCHAR * vncImportACL::SplitString(const TCHAR *input, TCHAR separator, TCHAR *head){
+	const TCHAR * tail;
+	int l;
+
+	tail = _tcschr(input, separator);
+	if (tail){
+		l = tail - input;
+		// get rid of separator
+		tail = tail + 1; 
+		_tcsncpy(head, input, l);
+		head[l] = _T('\0');
+	} else {
+		tail   = input;
+		head[0] = _T('\0');
+	}
+	return tail;
+}
+
+TCHAR *vncImportACL::AddComputername(const TCHAR *user){
+	unsigned long buflen = MAXLEN;
+	TCHAR computername[MAXLEN];
+	if (!GetComputerName(computername, &buflen)){
+		_ftprintf(stderr, _T("GetComputerName error %i\n"), GetLastError());
+		return NULL;
+	}
+	_ftprintf(stderr, _T("Detected computername = %s\n"), computername);
+	// Length of computername and user minus beginning dot plus terminating '\0'.
+	TCHAR *domainaccount = new TCHAR[_tcslen(computername) + _tcslen(user)];
+	_tcscpy(domainaccount, computername);
+	_tcscat(domainaccount, user + 1);
+
+	return domainaccount;
+}
+
+TCHAR *vncImportACL::AddDomainname(const TCHAR *user){
+	unsigned long buflen = MAXLEN;
+	TCHAR domain[MAXLEN * sizeof(wchar_t)];
+	LPWKSTA_INFO_100 wkstainfo = NULL;
+	NET_API_STATUS nStatus;
+
+	nStatus = NetWkstaGetInfo( 0 , 100 , (LPBYTE *) &wkstainfo);
+	if (nStatus == NERR_Success)
+		_tcsncpy(domain, wkstainfo->wki100_langroup, MAXLEN);
+	else
+		_ftprintf(stderr, _T("NetWkstaGetInfo() returned %lu \n"), wkstainfo);
+	domain[MAXLEN - 1] = _T('\0');
+	_ftprintf(stderr, _T("Detected domain = %s\n"),domain);
+	NetApiBufferFree(wkstainfo);
+	wkstainfo = NULL;
+
+	// Length of domainname and user minus beginning dots plus terminating '\0'.
+	TCHAR *domainaccount = new TCHAR[_tcslen(domain) + _tcslen(user) - 1];
+	_tcscpy(domainaccount, domain);
+	_tcscat(domainaccount, user + 2);
+
+	return domainaccount;
+}
+
+// vncScanInput struct
+
+bool vncScanInput::GetLine(TCHAR *line){
+	line[0] = _T('\0');
+	_fgetts(line, MAXLEN, stdin);
+	return ferror(stdin) ? false : true;
+}
+
+bool vncScanInput::isEmptyLine(TCHAR *line){
+	for (unsigned int i = 0; i < _tcslen(line); i++)
+		if (line[i] != _T(' ') && line[i] != _T('\t'))
+			return false;
+	return true;
+}
+
+void vncScanInput::RemoveComment(TCHAR *line){
+	if (TCHAR *comment = _tcschr(line, _T(';')))
+		*comment = _T('\0');
+}
+
+void vncScanInput::RemoveNewline(TCHAR *line){
+	if (line[_tcslen(line)-1] == _T('\n'))
+		line[_tcslen(line)-1] = _T('\0');
+}
+
+bool vncScanInput::Tokenize(const TCHAR *line, TCHAR **token){
+	int tokenCount = 0;
+
+	// Loop until the end of line or until 4th token found
+	for (; _tcslen(line) > 0 && tokenCount < 4;) {
+		int len = 0;
+		switch (*line) {
+		case _T(' ') :
+		case _T('\t'): 
+			line++; // Eat whitespace
+			break;
+		case _T('"') : 
+			line++; // Eat opening quote
+			len = GetQuoteLength(line);
+			tokenCount = AddToken(token, tokenCount, &line, len);
+			line++; // Eat closing quote
+			break;
+		default:
+			len = GetWordLength(line);
+			tokenCount = AddToken(token, tokenCount, &line, len);
+			break;
+		}
+	}
+	return (tokenCount == 3 && _tcslen(line) == 0) ? true : false;
+}
+
+int vncScanInput::GetWordLength(const TCHAR *line){
+	int length = 0;
+	int blength = 0;
+	int tlength = 0;
+	
+	const TCHAR *nextblank = _tcschr(line, _T(' '));
+	const TCHAR *nexttab   = _tcschr(line, _T('\t'));
+	if (nextblank) 
+		blength = nextblank - line;
+	if (nexttab)
+		tlength = nexttab - line;
+	if (nextblank && nexttab) // Found blank and tab
+		length = __min(blength, tlength);
+	else if (nextblank) // Found only a blank
+		length = blength;
+	else if (nexttab) // Found only a tab
+		length = tlength;
+	if (!length) // Found neither blank nor tab
+		length = _tcslen(line);
+	return length;
+}
+
+int vncScanInput::GetQuoteLength(const TCHAR *line){
+	const TCHAR *eoq = _tcschr(line, _T('"'));
+	int len = 0;
+	if (eoq)
+		len = eoq - line;
+	return len;
+}
+
+int vncScanInput::AddToken(TCHAR **token, int tokenCount, const TCHAR **line, int len){
+	if (len) {
+		if (tokenCount < 3) {
+			_tcsncpy(token[tokenCount], *line, len);
+			token[tokenCount][len] = _T('\0');
+		}
+		*line += len; // Eat token
+		tokenCount++;
+	}
+	return tokenCount;
+}
\ No newline at end of file
diff --git a/ica/win32/addon/ms-logon/MSLogonACL/vncImportACL.h b/ica/win32/addon/ms-logon/MSLogonACL/vncImportACL.h
new file mode 100644
index 0000000..3058f7f
--- /dev/null
+++ b/ica/win32/addon/ms-logon/MSLogonACL/vncImportACL.h
@@ -0,0 +1,87 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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/
+/*
+ * vncImportACL.h: 
+ */
+#define _WIN32_WINNT	0x0500	//??
+#define WINVER		0x0500	//??
+
+#include <windows.h>
+#include <aclapi.h>
+#include <stdio.h>
+#include <string.h>
+#include <lm.h>
+
+#define MAXLEN 256
+#define lenof(a) (sizeof(a) / sizeof((a)[0]) )
+
+
+#define ViewOnly	1
+#define Interact	2
+#define ALL_RIGHTS (ViewOnly | Interact)
+
+class vncImportACL {
+private:
+	enum ACE_TYPE {
+		ACCESS_ALLOWED,
+			ACCESS_DENIED
+	};
+	
+	typedef struct _ACE_DATA {
+		ACE_TYPE type;
+		DWORD mask;
+		PSID pSID;
+		struct _ACE_DATA *next;
+	} ACE_DATA;
+
+	ACE_DATA *lastAllowACE;
+	ACE_DATA *lastDenyACE;
+
+public:	
+	vncImportACL();
+	~vncImportACL();
+
+	void GetOldACL();
+	void ReadAce(int index, PACL pACL);
+	PSID CopySID(PSID pSID);
+	int ScanInput();
+	bool FillAceData(const TCHAR *accesstype, 
+		DWORD accessmask, 
+		const TCHAR *domainaccount);
+	PSID GetSID(const TCHAR *domainaccount);
+	PACL BuildACL(void);
+	bool SetACL(PACL pACL);
+	const TCHAR * SplitString(const TCHAR *input, TCHAR separator, TCHAR *head);
+	TCHAR *AddComputername(const TCHAR *user);
+	TCHAR *AddDomainname(const TCHAR *user);
+};
+
+struct vncScanInput{
+	bool isEmptyLine(TCHAR *line);
+	void RemoveComment(TCHAR *line);
+	void RemoveNewline(TCHAR *line);
+	int GetQuoteLength(const TCHAR *line);
+	int GetWordLength(const TCHAR *line);
+	bool GetLine(TCHAR *line);
+	bool Tokenize(const TCHAR *line, TCHAR **tokens);
+	int AddToken(TCHAR **token, int tokenCount, const TCHAR **line, int len);
+};
diff --git a/ica/win32/addon/ms-logon/authSSP/.cvsignore b/ica/win32/addon/ms-logon/authSSP/.cvsignore
new file mode 100644
index 0000000..8567875
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/.cvsignore
@@ -0,0 +1,4 @@
+buildtime.h
+*.ncb
+*.opt
+*.plg
diff --git a/ica/win32/addon/ms-logon/authSSP/Auth_Seq.h b/ica/win32/addon/ms-logon/authSSP/Auth_Seq.h
new file mode 100644
index 0000000..148e796
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/Auth_Seq.h
@@ -0,0 +1,43 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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/
+
+typedef struct _AUTH_SEQ {
+   BOOL fInitialized;
+   BOOL fHaveCredHandle;
+   BOOL fHaveCtxtHandle;
+   CredHandle hcred;
+   struct _SecHandle hctxt;
+} AUTH_SEQ, *PAUTH_SEQ;
+
+typedef struct _Fn {
+ACCEPT_SECURITY_CONTEXT_FN       _AcceptSecurityContext;
+ACQUIRE_CREDENTIALS_HANDLE_FN    _AcquireCredentialsHandle;
+COMPLETE_AUTH_TOKEN_FN           _CompleteAuthToken;
+INITIALIZE_SECURITY_CONTEXT_FN   _InitializeSecurityContext;
+DELETE_SECURITY_CONTEXT_FN       _DeleteSecurityContext;
+FREE_CONTEXT_BUFFER_FN           _FreeContextBuffer;
+FREE_CREDENTIALS_HANDLE_FN       _FreeCredentialsHandle;
+QUERY_SECURITY_PACKAGE_INFO_FN   _QuerySecurityPackageInfo;
+IMPERSONATE_SECURITY_CONTEXT_FN  _ImpersonateSecurityContext;
+REVERT_SECURITY_CONTEXT_FN       _RevertSecurityContext;
+} Fn;
+
diff --git a/ica/win32/addon/ms-logon/authSSP/EventLogging.cpp b/ica/win32/addon/ms-logon/authSSP/EventLogging.cpp
new file mode 100644
index 0000000..12921a8
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/EventLogging.cpp
@@ -0,0 +1,158 @@
+/////////////////////////////////////////////////////////////////////////////
+//	Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. All Rights Reserved.
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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 "EventLogging.h"
+
+#ifdef ULTRAVNC_ITALC_SUPPORT
+#include "Logger.h"
+
+#else
+
+EventLogging::EventLogging()
+{
+	// returns a handle that links the source to the registry 
+	m_hEventLinker = RegisterEventSource(NULL,_T("UltraVnc"));
+
+}
+
+EventLogging::~EventLogging()
+{
+	// Releases the handle to the registry
+	DeregisterEventSource(m_hEventLinker);
+}
+
+
+
+void EventLogging::LogIt(WORD CategoryID, DWORD EventID, LPCTSTR *ArrayOfStrings,
+						 UINT NumOfArrayStr,LPVOID RawData,DWORD RawDataSize)
+{
+
+	// Writes data to the event log
+	ReportEvent(m_hEventLinker,EVENTLOG_INFORMATION_TYPE,CategoryID,
+		EventID,NULL,1,RawDataSize,ArrayOfStrings,RawData);	
+
+}
+
+
+void EventLogging::AddEventSourceToRegistry(LPCTSTR lpszSourceName)
+{
+    HKEY  hk;
+    DWORD dwData;
+    TCHAR szBuf[MAX_PATH];
+    TCHAR szKey[255] =_T("SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\");
+    TCHAR szServicePath[MAX_PATH];
+
+    lstrcat(szKey, _T("UltraVnc"));
+
+    if(RegCreateKey(HKEY_LOCAL_MACHINE, szKey, &hk) != ERROR_SUCCESS)
+    {
+        return;
+    }
+
+    if (GetModuleFileName(NULL, szServicePath, MAX_PATH))
+		{
+			TCHAR* p = _tcsrchr(szServicePath, '\\');
+			if (p == NULL) return;
+			*p = '\0';
+			_tcscat (szServicePath,_T("\\logmessages.dll"));
+		}
+    lstrcpy(szBuf, szServicePath);
+
+    // Add the name to the EventMessageFile subkey.
+    if(RegSetValueEx(hk,
+                     _T("EventMessageFile"),
+                     0,
+                     REG_EXPAND_SZ,
+                     (LPBYTE) szBuf,
+                     (lstrlen(szBuf) + 1) * sizeof(TCHAR)) != ERROR_SUCCESS)
+    {
+        RegCloseKey(hk);
+        return;
+    }
+
+    dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE |EVENTLOG_INFORMATION_TYPE;
+    if(RegSetValueEx(hk,
+                     _T("TypesSupported"),
+                     0,
+                     REG_DWORD,
+                     (LPBYTE)&dwData,
+                     sizeof(DWORD)) != ERROR_SUCCESS)
+    {
+        
+    } RegCloseKey(hk);
+}
+
+#endif
+
+void LOG(long EventID, const TCHAR *format, ...) {
+    FILE *file;
+	TCHAR szMslogonLog[MAX_PATH];
+	LPCTSTR ps[3];
+	TCHAR textbuf[2 * MAXLEN] = _T("");
+	char texttowrite[2 * MAXLEN] = "";
+	TCHAR szTimestamp[MAXLEN] = _T("");
+	TCHAR szText[MAXLEN] = _T("");
+	SYSTEMTIME time;
+
+	va_list ap;
+	va_start(ap, format);
+	_vstprintf(szText, format, ap);
+	va_end(ap);
+#ifdef ULTRAVNC_ITALC_SUPPORT
+	ilog( Info, szText );
+#else
+	ps[0] = szText;
+    EventLogging log;
+	log.AddEventSourceToRegistry(NULL);
+	log.LogIt(1,EventID, ps,1,NULL,0);
+	if (GetModuleFileName(NULL, szMslogonLog, MAX_PATH))
+	{
+		TCHAR *p = _tcsrchr(szMslogonLog, '\\');
+		if (p != NULL)
+		{
+			*p = '\0';
+			_tcscat (szMslogonLog,_T("\\mslogon.log"));
+		}
+	}
+	file = _tfopen(szMslogonLog, _T("a"));
+	if(file!=NULL) 
+	{
+		// Prepend timestamp to message
+		GetLocalTime(& time);
+		_stprintf(szTimestamp,_T("%.2d/%.2d/%d %.2d:%.2d:%.2d  "), 
+			time.wDay, time.wMonth, time.wYear, time.wHour, time.wMinute, time.wSecond);
+		_tcscpy(textbuf,szTimestamp);
+		_tcscat(textbuf,szText);
+
+		// Write ANSI
+#if defined UNICODE || defined _UNICODE
+		wcstombs(texttowrite, textbuf, 2 * MAXLEN);
+#else
+		strcpy(texttowrite, texttowrite);
+#endif
+		fwrite(texttowrite, sizeof(char), strlen(texttowrite),file);
+		fclose(file);
+	}
+#endif
+}
+  
diff --git a/ica/win32/addon/ms-logon/authSSP/EventLogging.h b/ica/win32/addon/ms-logon/authSSP/EventLogging.h
new file mode 100644
index 0000000..b3e1261
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/EventLogging.h
@@ -0,0 +1,59 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. All Rights Reserved.
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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 <windows.h>
+#include <stdio.h>
+#include <lmcons.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <tchar.h>
+#include <lm.h>
+#include <stdio.h>
+#define SECURITY_WIN32
+#include <sspi.h>
+#ifndef SEC_I_COMPLETE_NEEDED
+#include <issperr.h>
+#include <time.h>
+#endif
+#ifndef __GNUC__
+#pragma hdrstop
+#endif
+#include <stdarg.h>
+
+#define MAXLEN 256
+#define MAX_PREFERRED_LENGTH    ((DWORD) -1)
+#define BUFSIZE 1024
+
+class EventLogging
+{
+public:
+	EventLogging();
+	virtual ~EventLogging();
+	virtual void LogIt(WORD CategoryID, DWORD EventID, LPCTSTR *ArrayOfStrings,
+		UINT NumOfArrayStr = 0,LPVOID RawData = NULL,DWORD RawDataSize = 0);
+	HANDLE m_hEventLinker;
+	void AddEventSourceToRegistry(LPCTSTR lpszSourceName);
+
+};
+
+void LOG(long EvenID, const TCHAR *format, ...);
diff --git a/ica/win32/addon/ms-logon/authSSP/GenClientServerContext.cpp b/ica/win32/addon/ms-logon/authSSP/GenClientServerContext.cpp
new file mode 100644
index 0000000..9009bb2
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/GenClientServerContext.cpp
@@ -0,0 +1,370 @@
+/////////////////////////////////////////////////////////////////////////////
+//	Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. All Rights Reserved.
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+// /macine-vnc Greg Wood (wood at agressiv.com)
+
+#include "GenClientServerContext.h"
+extern Fn fn;
+
+#define __try
+#define __leave goto cleanup
+#define __finally cleanup:
+
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+					 ) {
+    switch (ul_reason_for_call)
+	{
+		case DLL_PROCESS_ATTACH:
+		case DLL_THREAD_ATTACH:
+		case DLL_THREAD_DETACH:
+		case DLL_PROCESS_DETACH:
+			break;
+    }
+    return TRUE;
+}
+
+void UnloadSecurityDll(HMODULE hModule) {
+
+   if (hModule)
+      FreeLibrary(hModule);
+
+   fn._AcceptSecurityContext      = NULL;
+   fn._AcquireCredentialsHandle   = NULL;
+   fn._CompleteAuthToken          = NULL;
+   fn._DeleteSecurityContext      = NULL;
+   fn._FreeContextBuffer          = NULL;
+   fn._FreeCredentialsHandle      = NULL;
+   fn._InitializeSecurityContext  = NULL;
+   fn._QuerySecurityPackageInfo   = NULL;
+   fn._ImpersonateSecurityContext = NULL;
+   fn._RevertSecurityContext	  = NULL;
+}
+
+HMODULE LoadSecurityDll() {
+
+    HMODULE hModule;
+    BOOL    fAllFunctionsLoaded = FALSE; 
+	TCHAR   lpszDLL[MAXLEN];
+	OSVERSIONINFO VerInfo;
+
+	fn._AcceptSecurityContext      = NULL;
+	fn._AcquireCredentialsHandle   = NULL;
+	fn._CompleteAuthToken          = NULL;
+	fn._DeleteSecurityContext      = NULL;
+	fn._FreeContextBuffer          = NULL;
+	fn._FreeCredentialsHandle      = NULL;
+	fn._InitializeSecurityContext  = NULL;
+	fn._QuerySecurityPackageInfo   = NULL;
+	fn._ImpersonateSecurityContext = NULL;
+	fn._RevertSecurityContext	   = NULL;
+
+	// 
+	//  Find out which security DLL to use, depending on
+	//  whether we are on NT or Win95 or 2000 or XP or .NET Server
+	//  We have to use security.dll on Windows NT 4.0.
+	//  All other operating systems, we have to use Secur32.dll
+	// 
+	VerInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+	if (!GetVersionEx (&VerInfo))   // If this fails, something has gone wrong
+		return FALSE;
+
+	if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT &&
+		VerInfo.dwMajorVersion == 4 &&
+		VerInfo.dwMinorVersion == 0){
+			lstrcpy (lpszDLL, _T("security.dll"));
+		} else {
+			lstrcpy (lpszDLL, _T("secur32.dll"));
+		}
+
+	hModule = LoadLibrary(lpszDLL);
+	if (!hModule)
+		return NULL;
+
+   __try {
+
+      fn._AcceptSecurityContext = (ACCEPT_SECURITY_CONTEXT_FN) 
+            GetProcAddress(hModule, "AcceptSecurityContext");
+      if (!fn._AcceptSecurityContext)
+         __leave;
+
+#ifdef UNICODE
+      fn._AcquireCredentialsHandle = (ACQUIRE_CREDENTIALS_HANDLE_FN)
+            GetProcAddress(hModule, "AcquireCredentialsHandleW");
+#else
+      fn._AcquireCredentialsHandle = (ACQUIRE_CREDENTIALS_HANDLE_FN)
+            GetProcAddress(hModule, "AcquireCredentialsHandleA");
+#endif
+      if (!fn._AcquireCredentialsHandle)
+         __leave;
+
+      // CompleteAuthToken, ImpersonateSecurityContext and RevertSecurityContext
+	  // are not present on Windows 9x Secur32.dll
+      // Do not check for the availablity of the functions if it is NULL;
+      fn._CompleteAuthToken = (COMPLETE_AUTH_TOKEN_FN) 
+            GetProcAddress(hModule, "CompleteAuthToken");
+
+      fn._ImpersonateSecurityContext = (IMPERSONATE_SECURITY_CONTEXT_FN) 
+            GetProcAddress(hModule, "ImpersonateSecurityContext");
+
+      fn._RevertSecurityContext = (REVERT_SECURITY_CONTEXT_FN) 
+            GetProcAddress(hModule, "RevertSecurityContext");
+
+      fn._DeleteSecurityContext = (DELETE_SECURITY_CONTEXT_FN) 
+            GetProcAddress(hModule, "DeleteSecurityContext");
+      if (!fn._DeleteSecurityContext)
+         __leave;
+
+      fn._FreeContextBuffer = (FREE_CONTEXT_BUFFER_FN) 
+            GetProcAddress(hModule, "FreeContextBuffer");
+      if (!fn._FreeContextBuffer)
+         __leave;
+
+      fn._FreeCredentialsHandle = (FREE_CREDENTIALS_HANDLE_FN) 
+            GetProcAddress(hModule, "FreeCredentialsHandle");
+      if (!fn._FreeCredentialsHandle)
+         __leave;
+
+#ifdef UNICODE
+      fn._InitializeSecurityContext = (INITIALIZE_SECURITY_CONTEXT_FN)
+            GetProcAddress(hModule, "InitializeSecurityContextW");
+#else
+      fn._InitializeSecurityContext = (INITIALIZE_SECURITY_CONTEXT_FN) 
+            GetProcAddress(hModule, "InitializeSecurityContextA");
+#endif
+      if (!fn._InitializeSecurityContext)
+         __leave;
+
+#ifdef UNICODE
+      fn._QuerySecurityPackageInfo = (QUERY_SECURITY_PACKAGE_INFO_FN)
+            GetProcAddress(hModule, "QuerySecurityPackageInfoW");
+#else
+      fn._QuerySecurityPackageInfo = (QUERY_SECURITY_PACKAGE_INFO_FN)
+            GetProcAddress(hModule, "QuerySecurityPackageInfoA");
+#endif
+      if (!fn._QuerySecurityPackageInfo)
+         __leave;
+
+      fAllFunctionsLoaded = TRUE;
+
+   } __finally {
+
+      if (!fAllFunctionsLoaded) {
+         UnloadSecurityDll(hModule);
+         hModule = NULL;
+      }
+
+   }
+   
+   return hModule;
+}
+
+BOOL GenClientContext(PAUTH_SEQ pAS, PSEC_WINNT_AUTH_IDENTITY pAuthIdentity,
+      PVOID pIn, DWORD cbIn, PVOID pOut, PDWORD pcbOut, PBOOL pfDone) {
+
+/*++
+
+ Routine Description:
+
+   Optionally takes an input buffer coming from the server and returns
+   a buffer of information to send back to the server.  Also returns
+   an indication of whether or not the context is complete.
+
+ Return Value:
+
+   Returns TRUE if successful; otherwise FALSE.
+
+--*/ 
+
+   SECURITY_STATUS ss;
+   TimeStamp       tsExpiry;
+   SecBufferDesc   sbdOut;
+   SecBuffer       sbOut;
+   SecBufferDesc   sbdIn;
+   SecBuffer       sbIn;
+   ULONG           fContextAttr;
+
+   if (!pAS->fInitialized) {
+      ss = fn._AcquireCredentialsHandle(NULL, (SEC_CHAR *) _T("NTLM"), 
+            SECPKG_CRED_OUTBOUND, NULL, pAuthIdentity, NULL, NULL,
+            &pAS->hcred, &tsExpiry);
+      if (ss < 0) {
+         fprintf(stderr, "AcquireCredentialsHandle failed with %08X\n", (int) ss);
+         return FALSE;
+      }
+
+      pAS->fHaveCredHandle = TRUE;
+   }
+
+   // Prepare output buffer
+   sbdOut.ulVersion = 0;
+   sbdOut.cBuffers = 1;
+   sbdOut.pBuffers = &sbOut;
+
+   sbOut.cbBuffer = *pcbOut;
+   sbOut.BufferType = SECBUFFER_TOKEN;
+   sbOut.pvBuffer = pOut;
+
+   // Prepare input buffer
+   if (pAS->fInitialized)  {
+      sbdIn.ulVersion = 0;
+      sbdIn.cBuffers = 1;
+      sbdIn.pBuffers = &sbIn;
+
+      sbIn.cbBuffer = cbIn;
+      sbIn.BufferType = SECBUFFER_TOKEN;
+      sbIn.pvBuffer = pIn;
+   }
+
+   ss = fn._InitializeSecurityContext(&pAS->hcred, 
+         pAS->fInitialized ? &pAS->hctxt : NULL, NULL, 0, 0, 
+         SECURITY_NATIVE_DREP, pAS->fInitialized ? &sbdIn : NULL,
+         0, &pAS->hctxt, &sbdOut, &fContextAttr, &tsExpiry);
+   if (ss < 0)  { 
+      // Todo: Better error reporting.
+      return FALSE;
+   }
+
+   pAS->fHaveCtxtHandle = TRUE;
+
+   // If necessary, complete token
+   if (ss == SEC_I_COMPLETE_NEEDED || ss == SEC_I_COMPLETE_AND_CONTINUE) {
+
+      if (fn._CompleteAuthToken) {
+         ss = fn._CompleteAuthToken(&pAS->hctxt, &sbdOut);
+         if (ss < 0)  {
+            fprintf(stderr, "CompleteAuthToken failed with %08X\n", (int) ss);
+            return FALSE;
+         }
+      }
+      else {
+         fprintf (stderr, "CompleteAuthToken not supported.\n");
+         return FALSE;
+      }
+   }
+
+   *pcbOut = sbOut.cbBuffer;
+
+   if (!pAS->fInitialized)
+      pAS->fInitialized = TRUE;
+
+   *pfDone = !(ss == SEC_I_CONTINUE_NEEDED 
+         || ss == SEC_I_COMPLETE_AND_CONTINUE );
+
+   return TRUE;
+}
+
+BOOL GenServerContext(PAUTH_SEQ pAS, PVOID pIn, DWORD cbIn, PVOID pOut,
+      PDWORD pcbOut, PBOOL pfDone) {
+
+/*++
+
+ Routine Description:
+
+    Takes an input buffer coming from the client and returns a buffer
+    to be sent to the client.  Also returns an indication of whether or
+    not the context is complete.
+
+ Return Value:
+
+    Returns TRUE if successful; otherwise FALSE.
+
+--*/ 
+
+   SECURITY_STATUS ss;
+   TimeStamp       tsExpiry;
+   SecBufferDesc   sbdOut;
+   SecBuffer       sbOut;
+   SecBufferDesc   sbdIn;
+   SecBuffer       sbIn;
+   ULONG           fContextAttr;
+
+   if (!pAS->fInitialized)  {
+      
+      ss = fn._AcquireCredentialsHandle(NULL, (SEC_CHAR *) _T("NTLM"), 
+            SECPKG_CRED_INBOUND, NULL, NULL, NULL, NULL, &pAS->hcred, 
+            &tsExpiry);
+      if (ss < 0) {
+         fprintf(stderr, "AcquireCredentialsHandle failed with %08X\n", (int) ss);
+         return FALSE;
+      }
+
+      pAS->fHaveCredHandle = TRUE;
+   }
+
+   // Prepare output buffer
+   sbdOut.ulVersion = 0;
+   sbdOut.cBuffers = 1;
+   sbdOut.pBuffers = &sbOut;
+
+   sbOut.cbBuffer = *pcbOut;
+   sbOut.BufferType = SECBUFFER_TOKEN;
+   sbOut.pvBuffer = pOut;
+
+   // Prepare input buffer
+   sbdIn.ulVersion = 0;
+   sbdIn.cBuffers = 1;
+   sbdIn.pBuffers = &sbIn;
+
+   sbIn.cbBuffer = cbIn;
+   sbIn.BufferType = SECBUFFER_TOKEN;
+   sbIn.pvBuffer = pIn;
+
+   ss = fn._AcceptSecurityContext(&pAS->hcred, 
+         pAS->fInitialized ? &pAS->hctxt : NULL, &sbdIn, 0, 
+         SECURITY_NATIVE_DREP, &pAS->hctxt, &sbdOut, &fContextAttr, 
+         &tsExpiry);
+   if (ss < 0)  {
+      fprintf(stderr, "AcceptSecurityContext failed with %08X\n", (int) ss);
+      return FALSE;
+   }
+
+   pAS->fHaveCtxtHandle = TRUE;
+
+   // If necessary, complete token
+   if (ss == SEC_I_COMPLETE_NEEDED || ss == SEC_I_COMPLETE_AND_CONTINUE) {
+      
+      if (fn._CompleteAuthToken) {
+         ss = fn._CompleteAuthToken(&pAS->hctxt, &sbdOut);
+         if (ss < 0)  {
+            fprintf(stderr, "CompleteAuthToken failed with %08X\n", (int) ss);
+            return FALSE;
+         }
+      }
+      else {
+         fprintf (stderr, "CompleteAuthToken not supported.\n");
+         return FALSE;
+      }
+   }
+
+   *pcbOut = sbOut.cbBuffer;
+
+   if (!pAS->fInitialized)
+      pAS->fInitialized = TRUE;
+
+   *pfDone = !(ss = SEC_I_CONTINUE_NEEDED 
+         || ss == SEC_I_COMPLETE_AND_CONTINUE);
+
+   return TRUE;
+}
+
diff --git a/ica/win32/addon/ms-logon/authSSP/GenClientServerContext.h b/ica/win32/addon/ms-logon/authSSP/GenClientServerContext.h
new file mode 100644
index 0000000..0525953
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/GenClientServerContext.h
@@ -0,0 +1,72 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. All Rights Reserved.
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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 <windows.h>
+#include <stdio.h>
+#include <lmcons.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <tchar.h>
+#include <lm.h>
+#include <stdio.h>
+#define SECURITY_WIN32
+#include <security.h>
+#include <sspi.h>
+#ifndef SEC_I_COMPLETE_NEEDED
+#include <issperr.h>
+#include <time.h>
+#endif
+#include <aclapi.h>
+#ifndef __GNUC__
+#pragma hdrstop
+#endif
+
+#define MAXLEN 256
+#define MAX_PREFERRED_LENGTH    ((DWORD) -1)
+#define BUFSIZE 1024
+
+typedef DWORD (__stdcall *NetApiBufferFree_t)( void *buf );
+
+typedef DWORD (__stdcall *NetWkstaGetInfoNT_t)( wchar_t *server, DWORD level, byte **buf );
+typedef DWORD (__stdcall *NetWkstaGetInfo95_t)( char *domain,DWORD level, byte **buf );
+
+#include "Auth_Seq.h"
+
+BOOL GenClientContext(PAUTH_SEQ pAS, 
+					  PSEC_WINNT_AUTH_IDENTITY pAuthIdentity,
+					  PVOID pIn, 
+					  DWORD cbIn, 
+					  PVOID pOut, 
+					  PDWORD pcbOut, 
+					  PBOOL pfDone);
+
+BOOL GenServerContext(PAUTH_SEQ pAS, 
+					  PVOID pIn, 
+					  DWORD cbIn, 
+					  PVOID pOut,
+					  PDWORD pcbOut, 
+					  PBOOL pfDone);
+
+void UnloadSecurityDll(HMODULE hModule);
+
+HMODULE LoadSecurityDll();
diff --git a/ica/win32/addon/ms-logon/authSSP/Readme.txt b/ica/win32/addon/ms-logon/authSSP/Readme.txt
new file mode 100644
index 0000000..473f889
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/Readme.txt
@@ -0,0 +1,16 @@
+Idea for AuthSSP.dll:
+Authenticate user with SSPI
+Impersonate this user
+Check access rights against this user with the impersonation/access token.
+During logon/impersonation, group membership expansion (for the token) occurs:
+- Universal groups anywhere in the forest
+- Global groups
+- Domain local groups in the user's domain
+- Local groups
+- This expansion includes all nested groups
+
+Changing the CUPG (now CUPSD) interface: No longer passing one group after the other but pass a SecurityDescriptor for NT/W2k/XP. 
+This allows for just one Windows logon attempt to check authentication and authorization.
+
+AuthSSP.dll is only used if there's a DWORD regkey HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\NewMSLogon set to 1.
+Then all other authentication methods are skipped.
\ No newline at end of file
diff --git a/ica/win32/addon/ms-logon/authSSP/authSSP.cpp b/ica/win32/addon/ms-logon/authSSP/authSSP.cpp
new file mode 100644
index 0000000..54e9483
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/authSSP.cpp
@@ -0,0 +1,332 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. All Rights Reserved.
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+// /macine-vnc Greg Wood (wood at agressiv.com)
+#include "authSSP.h"
+
+/*
+ *  AuthSSP.cpp: Domainuser could be 'domain\user', just 'user' or
+ *  UPN-style 'user at domain'. Should work with Windows NT 4 and better.
+ *  NT 4 does not support UPN-style names.
+ */
+
+Fn fn;
+
+BOOL CUPSD2(const char * domainuser, 
+		  const char *password, 
+		  PSECURITY_DESCRIPTOR psdSD,
+		  PBOOL isAuthenticated,
+		  PDWORD pdwAccessGranted)	// returns bitmask with accessrights
+{
+	char domain[MAXLEN];
+	const char *user = 0;
+	domain[0] = '\0';
+	TCHAR user2[MAXLEN];
+	TCHAR domain2[MAXLEN];
+	TCHAR password2[MAXLEN];
+
+	user = SplitString(domainuser,'\\',domain);
+
+#if defined (_UNICODE) || defined (UNICODE)
+	mbstowcs(user2, user, MAXLEN);
+	mbstowcs(domain2, domain, MAXLEN);
+	mbstowcs(password2, password, MAXLEN);
+#else
+	strcpy(user2, user);
+	strcpy(domain2, domain);
+	strcpy(password2, password);
+#endif
+
+	// On NT4, prepend computer- or domainname if username is unqualified.
+	if (isNT4() && _tcscmp(domain2, _T("")) == 0) {
+		if (!QualifyName(user2, domain2)) {
+			_tcscpy(domain2, _T("\0"));
+		}
+	}
+	return SSPLogonUser(domain2, user2, password2, psdSD, isAuthenticated, pdwAccessGranted);
+}
+
+
+BOOL WINAPI SSPLogonUser(LPTSTR szDomain, 
+						 LPTSTR szUser, 
+						 LPTSTR szPassword, 
+						 PSECURITY_DESCRIPTOR psdSD,
+						 PBOOL isAuthenticated,
+						 PDWORD pdwAccessGranted)	// returns bitmask with accessrights
+{
+	AUTH_SEQ    asServer   = {0};
+	AUTH_SEQ    asClient   = {0};
+	BOOL        fDone      = FALSE;
+	BOOL        fResult    = FALSE;
+	DWORD       cbOut      = 0;
+	DWORD       cbIn       = 0;
+	DWORD       cbMaxToken = 0;
+	PVOID       pClientBuf = NULL;
+	PVOID       pServerBuf = NULL;
+	PSecPkgInfo pSPI       = NULL;
+	HMODULE     hModule    = NULL;
+	SEC_WINNT_AUTH_IDENTITY ai;
+
+#define __try
+#define __leave goto cleanup
+#define __finally cleanup:
+	__try {
+		
+		hModule = LoadSecurityDll();
+		if (!hModule)
+			__leave;
+		
+		// Get max token size
+		fn._QuerySecurityPackageInfo((SEC_CHAR *)_T("NTLM"), &pSPI);
+		cbMaxToken = pSPI->cbMaxToken;
+		
+		// Allocate buffers for client and server messages
+		pClientBuf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbMaxToken);
+		pServerBuf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbMaxToken);
+		
+		// Initialize auth identity structure
+		// Marscha 2004: Seems to work with szDomain = "" or even szDomain = "anyDomain", 
+		// but I found no MS documentation for this 'feature'.
+		ZeroMemory(&ai, sizeof(ai));
+#if defined(UNICODE) || defined(_UNICODE)
+		ai.Domain = (unsigned short *)szDomain;
+		ai.DomainLength = lstrlen(szDomain);
+		ai.User = (unsigned short *)szUser;
+		ai.UserLength = lstrlen(szUser);
+		ai.Password = (unsigned short *)szPassword;
+		ai.PasswordLength = lstrlen(szPassword);
+		ai.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
+#else      
+		ai.Domain = (unsigned char *)szDomain;
+		ai.DomainLength = lstrlen(szDomain);
+		ai.User = (unsigned char *)szUser;
+		ai.UserLength = lstrlen(szUser);
+		ai.Password = (unsigned char *)szPassword;
+		ai.PasswordLength = lstrlen(szPassword);
+		ai.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
+#endif
+
+		// Prepare client message (negotiate) .
+		cbOut = cbMaxToken;
+		if (!GenClientContext(&asClient, &ai, NULL, 0, pClientBuf, &cbOut, &fDone))
+			__leave;
+		
+		// Prepare server message (challenge) .
+		cbIn = cbOut;
+		cbOut = cbMaxToken;
+		if (!GenServerContext(&asServer, pClientBuf, cbIn, pServerBuf, &cbOut, 
+            &fDone))
+			__leave;
+		// Most likely failure: AcceptServerContext fails with SEC_E_LOGON_DENIED
+		// in the case of bad szUser or szPassword.
+		// Unexpected Result: Logon will succeed if you pass in a bad szUser and 
+		// the guest account is enabled in the specified domain.
+		
+		// Prepare client message (authenticate) .
+		cbIn = cbOut;
+		cbOut = cbMaxToken;
+		if (!GenClientContext(&asClient, &ai, pServerBuf, cbIn, pClientBuf, &cbOut,
+            &fDone))
+			__leave;
+		
+		// Prepare server message (authentication) .
+		cbIn = cbOut;
+		cbOut = cbMaxToken;
+		if (!GenServerContext(&asServer, pClientBuf, cbIn, pServerBuf, &cbOut, 
+            &fDone))
+			__leave;
+		
+		*isAuthenticated = TRUE;
+
+		// Check authorization
+		if (IsImpersonationAllowed()) {
+			if (ImpersonateAndCheckAccess(&(asServer.hctxt), psdSD, pdwAccessGranted))
+				fResult = TRUE;
+		} else {
+			// Todo: Make alternative access check
+			if (ImpersonateAndCheckAccess(&(asServer.hctxt), psdSD, pdwAccessGranted))
+				fResult = TRUE;
+		}
+
+	} __finally {
+
+		// Clean up resources
+		if (pSPI)
+			fn._FreeContextBuffer(pSPI);
+		
+		if (asClient.fHaveCtxtHandle)
+			fn._DeleteSecurityContext(&asClient.hctxt);
+		
+		if (asClient.fHaveCredHandle)
+			fn._FreeCredentialsHandle(&asClient.hcred);
+		
+		if (asServer.fHaveCtxtHandle)
+			fn._DeleteSecurityContext(&asServer.hctxt);
+		
+		if (asServer.fHaveCredHandle)
+			fn._FreeCredentialsHandle(&asServer.hcred);
+		
+		if (hModule)
+			UnloadSecurityDll(hModule);
+		
+		HeapFree(GetProcessHeap(), 0, pClientBuf);
+		HeapFree(GetProcessHeap(), 0, pServerBuf);
+		SecureZeroMemory(&ai, sizeof(ai));
+	}
+
+	return fResult;
+}
+
+BOOL ImpersonateAndCheckAccess(PCtxtHandle phContext, 
+							   PSECURITY_DESCRIPTOR psdSD, 
+							   PDWORD pdwAccessGranted) {
+	HANDLE hToken = NULL;
+	
+	// AccessCheck() variables
+	DWORD           dwAccessDesired = MAXIMUM_ALLOWED;
+	PRIVILEGE_SET   PrivilegeSet;
+	DWORD           dwPrivSetSize = sizeof(PRIVILEGE_SET);
+	BOOL            fAccessGranted = FALSE;
+	GENERIC_MAPPING GenericMapping = { vncGenericRead, vncGenericWrite, 
+									   vncGenericExecute, vncGenericAll };
+	
+	// This only does something if we want to use generic access
+	// rights, like GENERIC_ALL, in our call to AccessCheck().
+	MapGenericMask(&dwAccessDesired, &GenericMapping);
+	
+	// AccessCheck() requires an impersonation token.
+	if ((fn._ImpersonateSecurityContext(phContext) == SEC_E_OK)
+		&& OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &hToken)
+		&& AccessCheck(psdSD, hToken, dwAccessDesired, &GenericMapping,
+		&PrivilegeSet, &dwPrivSetSize, pdwAccessGranted, &fAccessGranted)) {
+		// Restrict access to relevant rights only
+		fAccessGranted = AreAnyAccessesGranted(*pdwAccessGranted, ViewOnly | Interact);
+	}
+	
+	// End impersonation
+	fn._RevertSecurityContext(phContext);
+	
+	// Close handles
+	if (hToken)
+		CloseHandle(hToken);
+	
+	return fAccessGranted;
+}
+
+// SplitString splits a string 'input' on the first occurence of char 'separator'
+// into string 'head' and 'tail' (removing the separator).
+// If separator is not found, head = "" and tail = input.
+const char *SplitString(const char *input, char separator, char *head){
+	const char *tail;
+	int l;
+
+	tail = strchr(input, separator);
+	if (tail){
+		l = tail - input;
+		// get rid of separator
+		tail = tail + 1; 
+		strncpy(head, input, l);
+		head[l] = '\0';
+	} else {
+		tail   = input;
+		head[0] = '\0';
+	}
+	return tail;
+}
+
+bool IsImpersonationAllowed() {
+	bool isImpersonationAllowed = false;
+	HANDLE hToken = NULL;
+	DWORD dwReturnLength = 0;
+	LUID impersonatePrivilege;
+	TOKEN_PRIVILEGES *ptp = NULL;
+
+	if (!LookupPrivilegeValue(NULL, _T("SeImpersonatePrivilege"), &impersonatePrivilege)
+		&& GetLastError() == ERROR_NO_SUCH_PRIVILEGE) {
+		// Assume that SeImpersonatePrivilege is not implemented with this OS/SP.
+		isImpersonationAllowed = true;
+	} else {
+		if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)
+			&& !GetTokenInformation(hToken, TokenPrivileges, NULL, 0, &dwReturnLength)
+			&& GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
+			ptp = (TOKEN_PRIVILEGES *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwReturnLength);
+			if (GetTokenInformation(hToken, TokenPrivileges, ptp, dwReturnLength, &dwReturnLength)) {
+				for (unsigned int i = 0; i < ptp->PrivilegeCount; i++) {
+					// Luid.LowPart/HighPart is ugly. To be improved/changed.
+					if ((ptp->Privileges[i].Luid.LowPart == impersonatePrivilege.LowPart)
+						&& (ptp->Privileges[i].Luid.HighPart == impersonatePrivilege.HighPart)
+						&& (ptp->Privileges[i].Attributes & SE_PRIVILEGE_ENABLED))
+						isImpersonationAllowed = true;
+				}
+			}
+		}
+	}
+	// Close handles
+	if (hToken)
+		CloseHandle(hToken);
+	if (ptp)
+		HeapFree(GetProcessHeap(), 0, ptp);
+
+	return isImpersonationAllowed;
+}
+
+bool QualifyName(const TCHAR *user, LPTSTR DomName) {
+	PSID pSid = NULL;
+	DWORD cbSid = 0;
+	DWORD cbDomName = MAXLEN;
+	SID_NAME_USE sidUse;
+	bool isNameQualified = false;
+
+	__try {
+		// Get Sid buffer size
+		LookupAccountName(NULL, user, pSid, &cbSid, DomName, &cbDomName, &sidUse);
+		if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+			__leave;
+		if (!(pSid = (PSID) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbSid)))
+			__leave;
+		if (cbDomName > MAXLEN)
+			__leave;
+		// Get DomName
+		if (!LookupAccountName(NULL, user, pSid, &cbSid, DomName, &cbDomName, &sidUse))
+			__leave;
+		isNameQualified = true;
+	} __finally {
+		HeapFree(GetProcessHeap(), 0, pSid);
+	}
+
+	return isNameQualified;
+}
+
+bool isNT4() {
+	OSVERSIONINFO VerInfo;
+
+	VerInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+	if (!GetVersionEx (&VerInfo))   // If this fails, something has gone wrong
+		return false;
+	
+	if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT &&
+		VerInfo.dwMajorVersion == 4 &&
+		VerInfo.dwMinorVersion == 0)
+		return true;
+	else
+		return false;
+}
diff --git a/ica/win32/addon/ms-logon/authSSP/authSSP.def b/ica/win32/addon/ms-logon/authSSP/authSSP.def
new file mode 100644
index 0000000..79341d3
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/authSSP.def
@@ -0,0 +1,5 @@
+LIBRARY   AuthSSP
+
+             EXPORTS
+ 			   CUPSD
+			   vncEditSecurity
diff --git a/ica/win32/addon/ms-logon/authSSP/authSSP.dsw b/ica/win32/addon/ms-logon/authSSP/authSSP.dsw
new file mode 100644
index 0000000..e38e319
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/authSSP.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "authSSP"=".\authSSP.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/addon/ms-logon/authSSP/authSSP.h b/ica/win32/addon/ms-logon/authSSP/authSSP.h
new file mode 100644
index 0000000..cbfb924
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/authSSP.h
@@ -0,0 +1,98 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. All Rights Reserved.
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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 <windows.h>
+#include <stdio.h>
+#include <lmcons.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <tchar.h>
+#include <lm.h>
+#define SECURITY_WIN32
+#include <security.h>
+#include <sspi.h>
+#ifndef SEC_I_COMPLETE_NEEDED
+#include <issperr.h>
+#include <time.h>
+#endif
+#include <aclapi.h>
+#ifndef __GNUC__
+#pragma hdrstop
+#endif
+
+#include "Auth_Seq.h"
+
+#define MAXLEN 256
+
+BOOL CUPSD2(const char * domainuser, 
+					   const char *password, 
+					   PSECURITY_DESCRIPTOR psdSD,
+					   PBOOL isAuthenticated,
+					   PDWORD pdwAccessGranted);
+
+BOOL WINAPI SSPLogonUser(LPTSTR szDomain, 
+						 LPTSTR szUser, 
+						 LPTSTR szPassword, 
+						 PSECURITY_DESCRIPTOR psdSD, 
+						 PBOOL isAuthenticated,
+						 PDWORD pdwAccessGranted);
+
+BOOL ImpersonateAndCheckAccess(PCtxtHandle phContext, 
+							   PSECURITY_DESCRIPTOR psdSD, 
+							   PDWORD pdwAccessGranted);
+
+BOOL GenClientContext(PAUTH_SEQ pAS, 
+					  PSEC_WINNT_AUTH_IDENTITY pAuthIdentity,
+					  PVOID pIn, 
+					  DWORD cbIn, 
+					  PVOID pOut, 
+					  PDWORD pcbOut, 
+					  PBOOL pfDone);
+
+BOOL GenServerContext(PAUTH_SEQ pAS, 
+					  PVOID pIn, 
+					  DWORD cbIn, 
+					  PVOID pOut,
+					  PDWORD pcbOut, 
+					  PBOOL pfDone);
+
+void UnloadSecurityDll(HMODULE hModule);
+
+HMODULE LoadSecurityDll();
+
+const char * SplitString(const char *input, char separator, char *head);
+bool IsImpersonationAllowed();
+ 
+#define ViewOnly 0x0001
+#define	Interact 0x0002
+#define vncGenericRead (STANDARD_RIGHTS_READ | ViewOnly)
+#define	vncGenericWrite	(STANDARD_RIGHTS_WRITE | Interact)
+#define	vncGenericExecute (STANDARD_RIGHTS_EXECUTE)
+#define	vncGenericAll (STANDARD_RIGHTS_ALL | ViewOnly | Interact)
+
+void LOG(long EvenID, const TCHAR *format, ...);
+
+bool QualifyName(const TCHAR *user, LPTSTR DomName);
+bool isNT4();
+
+
diff --git a/ica/win32/addon/ms-logon/authSSP/authSSP.rc b/ica/win32/addon/ms-logon/authSSP/authSSP.rc
new file mode 100644
index 0000000..220e480
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/authSSP.rc
@@ -0,0 +1,116 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+// Defines STR_COMPANYNAME, STR_FILEVERSION, STR_PRODUCTVERSION, STR_COPYRIGHT,
+// STR_SPECIALBUILD, FILEVERSION, PRODUCTVERSION
+#include "../../versioninfo.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION INT_FILEVERSION
+ PRODUCTVERSION INT_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+#if isRC == 1
+#include "buildtime.h" // Defines macro BUILDTIME
+            VALUE "Buildtime", BUILDTIME
+#endif
+            VALUE "Comments", "Cross-domain Windows authentication for UltraVNC\0"
+            VALUE "CompanyName", STR_COMPANYNAME
+            VALUE "FileDescription", "MS-Logon II for UltraVNC\0"
+            VALUE "FileVersion", STR_FILEVERSION
+            VALUE "InternalName", "authSSP\0"
+            VALUE "LegalCopyright", STR_COPYRIGHT
+            VALUE "OriginalFilename", "authSSP.dll\0"
+            VALUE "ProductName", "UltraVNC authSSP\0"
+            VALUE "ProductVersion", STR_PRODUCTVERSION
+#if isRC == 1
+			VALUE "SpecialBuild", STR_SPECIALBUILD
+#endif
+			END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/addon/ms-logon/authSSP/buildtime.in b/ica/win32/addon/ms-logon/authSSP/buildtime.in
new file mode 100644
index 0000000..8df4748
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/buildtime.in
@@ -0,0 +1,2 @@
+#define BUILDTIMEMACRO #define BUILDTIME __DATE__ " " __TIME__ "\0"
+BUILDTIMEMACRO
diff --git a/ica/win32/addon/ms-logon/authSSP/resource.h b/ica/win32/addon/ms-logon/authSSP/resource.h
new file mode 100644
index 0000000..decb8f5
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by authSSP.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/addon/ms-logon/authSSP/vncAccessControl.cpp b/ica/win32/addon/ms-logon/authSSP/vncAccessControl.cpp
new file mode 100644
index 0000000..97e416d
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/vncAccessControl.cpp
@@ -0,0 +1,216 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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 "vncAccessControl.h"
+
+#define __try
+#define __leave goto cleanup
+#define __finally cleanup:
+
+/*
+ * GetACL: Gets ACL from reg and puts it in class variable pACL.
+ */
+PACL
+vncAccessControl::GetACL(void){
+	HKEY hk = NULL; 
+	PACL pInitACL = NULL;
+	DWORD dwValueLength = 0;
+
+	__try{
+		if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\iTALC Solutions\\iTALC\\Authentication"),
+			0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS){
+			__leave;
+		}
+
+		// Read the ACL value from the VNC registry key
+		// First call to RegQueryValueEx just gets the buffer length.
+		if (RegQueryValueEx(hk, _T("LogonACL"), 0, 0, NULL, &dwValueLength) 
+			!= ERROR_SUCCESS){
+			__leave;
+		}
+		if (dwValueLength >= sizeof(ACL))
+			pInitACL = (PACL) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueLength);
+		else {
+			__leave;
+		}
+		if (RegQueryValueEx(hk, _T("LogonACL"), 0, 0, (LPBYTE) pInitACL, &dwValueLength)
+			!= ERROR_SUCCESS){
+			__leave;
+		}
+
+	} __finally {
+		if (hk)
+			RegCloseKey(hk); 
+	}
+	return pInitACL;
+}
+
+
+
+/*
+ * GetSD: Accessor function for SecurityDescriptor
+ *        Creates an (absolute) SD from the GetACL return value
+ */
+PSECURITY_DESCRIPTOR
+vncAccessControl::GetSD(){
+	PSECURITY_DESCRIPTOR pSD;
+	PSECURITY_DESCRIPTOR pSelfRelativeSD;
+	PACL pACL = NULL;
+	DWORD dwBufferLength = 0;
+
+	// If we can't retrieve a valid ACL we create an empty one (i.e. no access).
+	if (!(pACL = GetACL()) || !IsValidAcl(pACL)) {
+		pACL = (PACL) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,	sizeof(ACL));
+		// Initialize the new ACL.
+		if (!InitializeAcl(pACL, sizeof(ACL), ACL_REVISION)) {
+			; // Todo: Report an error.
+		}
+	}
+
+	// Construct SD
+	pSD = HeapAlloc(GetProcessHeap(), 
+		HEAP_ZERO_MEMORY, SECURITY_DESCRIPTOR_MIN_LENGTH);
+	if(InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION) &&
+		// Set our ACL to the SD.
+		SetSecurityDescriptorDacl(pSD, TRUE, pACL, FALSE) &&
+		// AccessCheck() is picky about what is in the SD.
+		SetSecurityDescriptorOwner(pSD, GetOwnerSID(), FALSE) &&
+		SetSecurityDescriptorGroup(pSD, GetOwnerSID(), FALSE)) {
+	} else {
+		// Todo: Report an error.
+	}
+	// Make SD self-relative and use LocalAlloc
+	MakeSelfRelativeSD(pSD, NULL, &dwBufferLength);
+	pSelfRelativeSD = (PSECURITY_DESCRIPTOR) LocalAlloc(0, dwBufferLength);
+	MakeSelfRelativeSD(pSD, pSelfRelativeSD, &dwBufferLength);
+	FreeSD(pSD);
+	return pSelfRelativeSD;
+}
+
+/*
+ * SetSD: Changes the class variable pACL and the reg key.
+ *        The ACL is the DACL of the provided SD.
+ */
+BOOL
+vncAccessControl::SetSD(PSECURITY_DESCRIPTOR pSD){
+	BOOL isOK = FALSE;
+	BOOL bDaclPresent = FALSE;
+	BOOL bDaclDefaulted = FALSE;
+	PACL pDACL = NULL;
+
+	GetSecurityDescriptorDacl(pSD, &bDaclPresent, &pDACL, &bDaclDefaulted);
+
+	if (bDaclPresent && pDACL && IsValidAcl(pDACL) && StoreACL(pDACL))
+		isOK = TRUE;
+	return isOK;
+}
+
+/*
+ * GetOwnerSID: Helperfunction for SD creation
+ */
+PSID
+vncAccessControl::GetOwnerSID(void){
+	PSID pAdminSid = NULL;
+	SID_IDENTIFIER_AUTHORITY SIDAuth = { SECURITY_NT_AUTHORITY };
+	// Create a SID for the BUILTIN\Administrators group.
+	AllocateAndInitializeSid( &SIDAuth, 2,
+		SECURITY_BUILTIN_DOMAIN_RID,
+		DOMAIN_ALIAS_RID_ADMINS,
+		0, 0, 0, 0, 0, 0, &pAdminSid);
+	return pAdminSid;
+}
+
+/*
+ * StoreACL: Stores the value of the class variable pACL in the registry.
+ * Returns TRUE if successful.
+ */
+BOOL 
+vncAccessControl::StoreACL(PACL pACL){
+    HKEY hk = NULL; 
+	BOOL isSaveOK = FALSE;
+
+    ACL_SIZE_INFORMATION AclInfo = {0, 0, 0};
+	DWORD nAclInformationLength = sizeof(AclInfo);
+
+	// Todo: Better error handling
+	if (pACL)
+		GetAclInformation(pACL, &AclInfo, nAclInformationLength, AclSizeInformation);
+
+	__try{ if (RegCreateKey(HKEY_LOCAL_MACHINE, _T("Software\\iTALC Solutions\\iTALC\\Authentication"), &hk)
+			!= ERROR_SUCCESS){
+			__leave;
+		}
+		  if (hk)
+		  RegCloseKey(hk);
+
+		if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\iTALC Solutions\\iTALC\\Authentication"), 0, KEY_SET_VALUE, &hk)
+			!= ERROR_SUCCESS){
+			__leave;
+		}
+		
+		if (RegSetValueEx(hk, _T("LogonACL"), 0, REG_BINARY, (LPBYTE) pACL, AclInfo.AclBytesInUse)
+			!= ERROR_SUCCESS){
+			__leave;
+		}
+		isSaveOK = TRUE;
+	} __finally {
+		if (hk)
+			RegCloseKey(hk); 
+	}
+	return isSaveOK;
+} 
+
+/*
+ * FreeSD: Frees the memory of an absolute SD.
+ */
+void
+vncAccessControl::FreeSD(PSECURITY_DESCRIPTOR pSD){
+	PSID pOwnerSID = NULL;
+	PSID pGroupSID = NULL;
+	PACL pDACL = NULL;
+	PACL pSACL = NULL;
+	BOOL bOwnerDefaulted = FALSE;
+	BOOL bGroupDefaulted = FALSE;
+	BOOL bDaclPresent = FALSE;
+	BOOL bDaclDefaulted = FALSE;
+	BOOL bSaclPresent = FALSE;
+	BOOL bSaclDefaulted = FALSE;
+	
+	if (pSD) {
+		GetSecurityDescriptorOwner(pSD, &pOwnerSID, &bOwnerDefaulted);
+		GetSecurityDescriptorGroup(pSD, &pGroupSID, &bGroupDefaulted);
+		GetSecurityDescriptorDacl(pSD, &bDaclPresent, &pDACL, &bDaclDefaulted);
+		GetSecurityDescriptorSacl(pSD, &bSaclPresent, &pSACL, &bSaclDefaulted);
+	}
+	// Clean up
+	if (pSD)
+		HeapFree(GetProcessHeap(), 0, pSD);
+	if (bDaclPresent && pDACL)
+		HeapFree(GetProcessHeap(), 0, pDACL);
+	if (bSaclPresent && pSACL)
+		HeapFree(GetProcessHeap(), 0, pSACL);
+	if (pOwnerSID)
+		HeapFree(GetProcessHeap(), 0, pOwnerSID);
+	if (pGroupSID)
+		HeapFree(GetProcessHeap(), 0, pGroupSID);
+
+}
diff --git a/ica/win32/addon/ms-logon/authSSP/vncAccessControl.h b/ica/win32/addon/ms-logon/authSSP/vncAccessControl.h
new file mode 100644
index 0000000..c2a57b7
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/vncAccessControl.h
@@ -0,0 +1,45 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. All Rights Reserved.
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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 <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <tchar.h>
+
+#define ViewOnly 0x0001
+#define Interact 0x0002
+
+// 
+class vncAccessControl
+{
+public:
+	PSECURITY_DESCRIPTOR GetSD();
+	BOOL SetSD(PSECURITY_DESCRIPTOR pSD);
+
+protected:
+	void FreeSD(PSECURITY_DESCRIPTOR pSD);
+	PACL GetACL(void);
+	BOOL StoreACL(PACL pACL);
+	PSID GetOwnerSID(void);
+};
+
diff --git a/ica/win32/addon/ms-logon/authSSP/vncSSP.cpp b/ica/win32/addon/ms-logon/authSSP/vncSSP.cpp
new file mode 100644
index 0000000..404ef8b
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/vncSSP.cpp
@@ -0,0 +1,108 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2004 Martin Scharpf. All Rights Reserved.
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+// /macine-vnc Greg Wood (wood at agressiv.com)
+//#include "..\..\winvnc\stdhdrs.h"
+#include <objbase.h> // for CoInitialize/CoUninitialize ???
+#include <time.h>
+#include "vncSSP.h"
+// From vncAccessControl.h
+#define ViewOnly 0x0001
+#define Interact 0x0002
+
+//#include "..\..\winvnc\localization.h" // Act : add localization on messages
+
+CheckUserPasswordSDFn CheckUserPasswordSD = 0;
+
+const TCHAR REGISTRY_KEY [] = _T("Software\\UltraVnc");
+
+AUTHSSP_API
+int CUPSD(const char * userin, const char *password, const char *machine)
+{
+	DWORD dwAccessGranted = 0;
+	BOOL isAccessOK = FALSE;
+	BOOL isAuthenticated = FALSE;
+	bool isViewOnly = false;
+	bool isInteract = false;
+	TCHAR machine2[MAXSTRING];
+	TCHAR user2[MAXSTRING];
+#if defined(UNICODE) || defined(_UNICODE)
+	mbstowcs(machine2, machine, MAXSTRING);
+	mbstowcs(user2, userin, MAXSTRING);
+#else
+	strcpy(machine2, machine);
+	strcpy(user2, userin);
+#endif
+
+	OSVERSIONINFO VerInfo;
+	VerInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+	if (!GetVersionEx (&VerInfo)) {  // If this fails, something has gone wrong
+		return FALSE;
+	}
+	
+	if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) { // WinNT 3.51 or better 
+		vncAccessControl vncAC;
+		isAccessOK = CUPSD2(userin, password, vncAC.GetSD(), &isAuthenticated, &dwAccessGranted);
+		// This logging should be moved to LOGLOGONUSER etc.
+            time_t current;
+			time(&current);
+			char* timestr = ctime(&current);
+			timestr[24] = '\0'; // remove newline
+			LOG(0, "%s - CUPSD2: Access is %u, user %s is %sauthenticated, access granted is 0x%x\n",
+				timestr, isAccessOK, userin, isAuthenticated ? "" : "not ", (int) dwAccessGranted);
+	} else { // message text to be moved to localization.h
+		MessageBox(NULL, _T("New MS-Logon currently not supported on Win9x"), _T("Warning"), MB_OK);
+		return FALSE;
+	}
+
+	if (isAccessOK) {
+		if (dwAccessGranted & ViewOnly) isViewOnly = true;
+		if (dwAccessGranted & Interact) isInteract = true;
+	}
+	
+	//LookupAccountName(NULL, user2, Sid, cbSid, DomainName, cbDomainName, peUse);
+
+	if (isInteract)	{
+		LOG(0x00640001L, _T("Connection received from %s using %s account\n"), machine2, user2);
+	} else if (isViewOnly) {
+		LOG(0x00640001L, _T("Connection received from %s using %s account\n"), machine2, user2);
+		isAccessOK = 2;
+	} else {
+		LOG(0x00640002L, _T("Invalid attempt (not %s) from client %s using %s account\n"), 
+			isAuthenticated ? _T("authorized") : _T("authenticated"), machine2, user2);
+	}
+	return isAccessOK;
+}
+	
+
+TCHAR *AddToModuleDir(TCHAR *filename, int length){
+	TCHAR *szCurrentDir = new TCHAR[length];
+	if (GetModuleFileName(NULL, szCurrentDir, length))
+	{
+		TCHAR *p = _tcsrchr(szCurrentDir, '\\');
+		*p = '\0';
+		_tcscat(szCurrentDir,_T("\\"));
+		_tcscat(szCurrentDir, filename);
+	}
+	filename = szCurrentDir;
+	return filename;
+}
diff --git a/ica/win32/addon/ms-logon/authSSP/vncSSP.h b/ica/win32/addon/ms-logon/authSSP/vncSSP.h
new file mode 100644
index 0000000..c23e895
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/vncSSP.h
@@ -0,0 +1,52 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. All Rights Reserved.
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+// /macine-vnc Greg Wood (wood at agressiv.com)
+//
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the AUTHSSP_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// AUTHSSP_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef AUTHSSP_EXPORTS
+#define AUTHSSP_API __declspec(dllexport)
+#else
+#define AUTHSSP_API __declspec(dllimport)
+#endif
+
+#include <tchar.h>
+#include "vncAccessControl.h"
+
+typedef BOOL (*CheckUserPasswordSDFn)(const char * domainuser,
+									  const char *password,
+									  PSECURITY_DESCRIPTOR psdSD,
+									  PBOOL isAuthenticated,
+									  PDWORD pdwAccessGranted);
+
+#define MAXSTRING 254
+
+extern "C" AUTHSSP_API int CUPSD(const char * userin, const char *password, const char *machine);
+void LOG(long EvenID, const TCHAR *format, ...);
+TCHAR * AddToModuleDir(TCHAR *filename, int length);
+
+extern BOOL CUPSD2(const char*userin, const char *password, PSECURITY_DESCRIPTOR psdSD, PBOOL pisAuthenticated, PDWORD pdwAccessGranted);
diff --git a/ica/win32/addon/ms-logon/authSSP/vncSecurityEditor.cpp b/ica/win32/addon/ms-logon/authSSP/vncSecurityEditor.cpp
new file mode 100644
index 0000000..d5d5219
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/vncSecurityEditor.cpp
@@ -0,0 +1,168 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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 "vncSecurityEditor.h"
+#include "vncSecurityEditorProps.h"
+#include "vncAccessControl.h"
+
+
+typedef PSECURITY_DESCRIPTOR (*vncGetSDFn)(void);
+typedef BOOL (*vncSetSDFn)(PSECURITY_DESCRIPTOR pSD);
+vncGetSDFn vncGetSDdll = NULL;
+vncSetSDFn vncSetSDdll = NULL;
+
+HINSTANCE g_hInst;
+
+STDMETHODIMP vncSecurityInfo::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) vncSecurityInfo::AddRef()
+{
+	return ++m_cRefs;
+}
+STDMETHODIMP_(ULONG) vncSecurityInfo::Release()
+{
+	ULONG n = --m_cRefs;
+	if ( 0 == n )
+		delete this;
+	return n;
+}
+
+STDMETHODIMP 
+vncSecurityInfo::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	= 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 
+vncSecurityInfo::GetSecurity(SECURITY_INFORMATION ri, 
+							 PSECURITY_DESCRIPTOR *ppsd, 
+							 BOOL bDefault){
+	vncAccessControl vncAC;
+	return (*ppsd = vncAC.GetSD()) ? S_OK : E_FAIL;
+}
+
+STDMETHODIMP 
+vncSecurityInfo::SetSecurity(SECURITY_INFORMATION ri, void* psd){
+	vncAccessControl vncAC;
+	return vncAC.SetSD((PSECURITY_DESCRIPTOR) psd) ? S_OK : E_FAIL;
+}
+
+STDMETHODIMP 
+vncSecurityInfo::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 
+vncSecurityInfo::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 
+vncSecurityInfo::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 
+vncSecurityInfo::GetInheritTypes(SI_INHERIT_TYPE** ppInheritTypes, ULONG* pcInheritTypes){
+	// We don't need inheritance here.
+	*ppInheritTypes = NULL;
+	*pcInheritTypes = 0;
+	return S_OK;
+}
+
+AUTHSSP_API void vncEditSecurity(HWND hwnd, HINSTANCE hInstance) {
+	if (CheckAclUI()) {
+		g_hInst = hInstance;
+		// Convert ISecurityInformation implementation into property pages
+		vncSecurityInfo* psi = 
+			new vncSecurityInfo(L"UltraVNC Server", L"UltraVNC 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("UltraVNC Security Editor");
+			psh.nPages		= sizeof hpsp / sizeof *hpsp;
+			psh.phpage		= hpsp;
+			
+			PropertySheet(&psh);
+			
+	} else {
+		MessageBox(NULL, _T("aclui.dll (function EditSecurity()) not available\n")
+			_T("with this Operatingsystem/Servicepack.\n")
+			_T("Use ACL import/export utility instead."),
+			//sz_ID_WINVNC_ERROR,
+			_T("Error"),
+			MB_OK | MB_ICONEXCLAMATION);
+	}
+}
+
+bool CheckAclUI()
+{
+	HMODULE hModule = LoadLibrary(_T("aclui.dll"));
+	if (hModule)
+	{
+		FARPROC test=NULL;
+		test=GetProcAddress( hModule, "EditSecurity" );
+		FreeLibrary(hModule);
+		if (test) { 
+			return true;
+		}
+	}
+	return false;
+}
+
diff --git a/ica/win32/addon/ms-logon/authSSP/vncSecurityEditor.h b/ica/win32/addon/ms-logon/authSSP/vncSecurityEditor.h
new file mode 100644
index 0000000..0ae614f
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/vncSecurityEditor.h
@@ -0,0 +1,71 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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/
+
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the AUTHSSP_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// AUTHSSP_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef AUTHSSP_EXPORTS
+#define AUTHSSP_API __declspec(dllexport)
+#else
+#define AUTHSSP_API __declspec(dllimport)
+#endif
+
+#include <windows.h>
+#include <aclui.h>
+#include <aclapi.h>
+#include <stdio.h>
+
+struct vncSecurityInfo : ISecurityInformation
+{
+	long  m_cRefs;
+	const wchar_t* const m_pszObjectName;
+	const wchar_t* const m_pszPageTitle;
+	
+	vncSecurityInfo(const wchar_t* pszObjectName,
+		const wchar_t* pszPageTitle = 0 )
+		: m_cRefs(0),
+		m_pszObjectName(pszObjectName),
+		m_pszPageTitle(pszPageTitle) {}
+
+	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);
+};
+
+AUTHSSP_API void vncEditSecurity(HWND hwnd, HINSTANCE hInstance);
+
+bool CheckAclUI();
+extern TCHAR *AddToModuleDir(TCHAR *filename, int length);
\ No newline at end of file
diff --git a/ica/win32/addon/ms-logon/authSSP/vncSecurityEditorProps.h b/ica/win32/addon/ms-logon/authSSP/vncSecurityEditorProps.h
new file mode 100644
index 0000000..7507aae
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authSSP/vncSecurityEditorProps.h
@@ -0,0 +1,66 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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/
+
+// This table maps permissions onto strings.
+// Notice the first entry, which includes all permissions; it maps to a string "Full Control".
+// I love this feature of being able to provide multiple permissions in one entry,
+// if you use it carefully, it's pretty powerful - the access control editor will
+// automatically keep the permission checkboxes synchronized, which makes it clear
+// to the user what is going on (if they pay close enough attention).
+//
+// Notice that I included standard permissions - don't forget them...
+// Notice that I left some of the more esoteric permissions for the Advanced dialog,
+// and that I only show "Full Control" in the basic permissions editor.
+// This is consistent with the way the file acl editor works.
+SI_ACCESS g_vncAccess[] = {	
+	// these are a easy-to-swallow listing of basic rights for VNC
+//	{ &GUID_NULL, 0x00000007, L"Full control", SI_ACCESS_GENERAL  },	// Full Control
+	{ &GUID_NULL, 0x00000003, L"Full control", SI_ACCESS_GENERAL  },	// Full Control
+	{ &GUID_NULL, 0x00000003, L"Interact",     SI_ACCESS_GENERAL  },	// Write
+	{ &GUID_NULL, 0x00000001, L"View",     SI_ACCESS_GENERAL  },	// Read
+//	{ &GUID_NULL, 0x00000004, L"Filetransfer",     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
+};
+
+const DWORD ViewOnly	   = 0x0001;
+const DWORD Interact	   = 0x0002;
+
+const DWORD GenericRead    = STANDARD_RIGHTS_READ |
+							 ViewOnly;
+
+const DWORD GenericWrite   = STANDARD_RIGHTS_WRITE |
+							 Interact;
+
+const DWORD GenericExecute = STANDARD_RIGHTS_EXECUTE;
+
+const DWORD GenericAll     = STANDARD_RIGHTS_REQUIRED |
+							  GenericRead |
+							  GenericWrite |
+							  GenericExecute;
+
diff --git a/ica/win32/addon/ms-logon/authadm/authadmin.cpp b/ica/win32/addon/ms-logon/authadm/authadmin.cpp
new file mode 100644
index 0000000..926a58b
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authadm/authadmin.cpp
@@ -0,0 +1,111 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+// /macine-vnc Greg Wood (wood at agressiv.com)
+#include "authadmin.h"
+#include "lm.h"
+
+typedef struct _WKSTA_INFO_100_NT {
+  DWORD     wki100_platform_id;
+  wchar_t *    wki100_computername;
+  wchar_t *    wki100_langroup;
+  DWORD     wki100_ver_major;
+  DWORD     wki100_ver_minor;
+}WKSTA_INFO_100_NT;
+
+
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+					 )
+{
+    switch (ul_reason_for_call)
+	{
+		case DLL_PROCESS_ATTACH:
+		case DLL_THREAD_ATTACH:
+		case DLL_THREAD_DETACH:
+		case DLL_PROCESS_DETACH:
+			break;
+    }
+    return TRUE;
+}
+
+
+bool IsAdmin() { 
+       SC_HANDLE hSC;
+       hSC = OpenSCManager(
+             NULL,
+              NULL,
+              GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE
+              );
+    if( hSC == NULL ) {
+                  return FALSE;
+    }   
+         CloseServiceHandle( hSC );
+         return TRUE;
+}
+
+AUTHADMIN_API
+BOOL CUGP(char * userin,char *password,char *machine,char *groupin,int locdom)
+{
+	DWORD dwLogonType;
+	DWORD dwLogonProvider;
+	HANDLE hToken;
+	bool returnvalue=false;
+	dwLogonType     = LOGON32_LOGON_INTERACTIVE;
+	dwLogonProvider = LOGON32_PROVIDER_DEFAULT;
+
+	byte *buf = 0;
+	byte *buf2 = 0;
+	char domain[MAXLEN * sizeof(wchar_t)];
+	DWORD rcdomain = NetGetDCName( 0, 0, &buf );
+	NetApiBufferFree( buf );
+	printf("Logonuser: % s %s \n", userin, ".");
+			if (LogonUser(userin, ".", password, dwLogonType, dwLogonProvider, &hToken))
+					if (ImpersonateLoggedOnUser(hToken))
+				{
+					returnvalue=IsAdmin();
+					RevertToSelf();
+					CloseHandle(hToken);
+				}
+	if (returnvalue==true) return returnvalue;
+	if (!rcdomain)
+		{
+			DWORD result=NetWkstaGetInfo( 0 , 100 , &buf2 ) ;
+				if (!result)
+				{
+					wcstombs( domain, ((WKSTA_INFO_100_NT *) buf2)->wki100_langroup, MAXLEN );
+					NetApiBufferFree( buf2 );
+					printf("Logonuser: % s %s \n", userin, domain);
+					if (LogonUser(userin, domain, password, dwLogonType, dwLogonProvider, &hToken))
+						if (ImpersonateLoggedOnUser(hToken))
+							{
+								returnvalue=IsAdmin();
+								RevertToSelf();
+								CloseHandle(hToken);
+							}
+				}
+
+		}
+	
+	return returnvalue;
+	
+}
\ No newline at end of file
diff --git a/ica/win32/addon/ms-logon/authadm/authadmin.def b/ica/win32/addon/ms-logon/authadm/authadmin.def
new file mode 100644
index 0000000..6c97f3b
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authadm/authadmin.def
@@ -0,0 +1,4 @@
+LIBRARY   Authadmin
+
+             EXPORTS
+               CUGP
diff --git a/ica/win32/addon/ms-logon/authadm/authadmin.dsw b/ica/win32/addon/ms-logon/authadm/authadmin.dsw
new file mode 100644
index 0000000..8194c6b
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authadm/authadmin.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "authadmin"=".\authadmin.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/addon/ms-logon/authadm/authadmin.h b/ica/win32/addon/ms-logon/authadm/authadmin.h
new file mode 100644
index 0000000..15f9bb4
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authadm/authadmin.h
@@ -0,0 +1,23 @@
+
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the AUTHLOGONUSER_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// AUTHLOGONUSER_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef AUTHADMIN_EXPORTS
+#define AUTHADMIN_API __declspec(dllexport)
+#else
+#define AUTHADMIN_API __declspec(dllimport)
+#endif
+#pragma comment( lib, "netapi32.lib" )
+#if defined( UNICODE ) || defined( _UNICODE )
+#error Sorry -- please compile as an ANSI program.
+#endif
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#define MAXLEN 256
+
+AUTHADMIN_API
+BOOL CUGP(char * userin,char *password,char *machine,char * group,int locdom);
diff --git a/ica/win32/addon/ms-logon/authadm/authadmin.rc b/ica/win32/addon/ms-logon/authadm/authadmin.rc
new file mode 100644
index 0000000..e6aa3d3
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authadm/authadmin.rc
@@ -0,0 +1,112 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+// Defines STR_COMPANYNAME, STR_FILEVERSION, STR_PRODUCTVERSION, STR_COPYRIGHT,
+// STR_SPECIALBUILD, FILEVERSION, PRODUCTVERSION
+#include "../../versioninfo.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION INT_FILEVERSION
+ PRODUCTVERSION INT_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+            VALUE "Comments", "Local admin authentication for UltraVNC\0"
+            VALUE "CompanyName", STR_COMPANYNAME
+            VALUE "FileDescription", "MS-Logon I for UltraVNC\0"
+            VALUE "FileVersion", STR_FILEVERSION
+            VALUE "InternalName", "authadmin\0"
+            VALUE "LegalCopyright", STR_COPYRIGHT
+            VALUE "OriginalFilename", "authadmin.dll\0"
+            VALUE "ProductName", "UltraVNC authadmin\0"
+            VALUE "ProductVersion", STR_PRODUCTVERSION
+#if isRC == 1
+			VALUE "SpecialBuild", STR_SPECIALBUILD
+#endif
+			END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/addon/ms-logon/authadm/resource.h b/ica/win32/addon/ms-logon/authadm/resource.h
new file mode 100644
index 0000000..decb8f5
--- /dev/null
+++ b/ica/win32/addon/ms-logon/authadm/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by authSSP.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/addon/ms-logon/ldapauth/ldapAuth.cpp b/ica/win32/addon/ms-logon/ldapauth/ldapAuth.cpp
new file mode 100644
index 0000000..180e246
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth/ldapAuth.cpp
@@ -0,0 +1,638 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+// /macine-vnc Greg Wood (wood at agressiv.com)
+
+
+#include "ldapauth.h"
+
+/////////////////////////
+
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+					 )
+{
+    switch (ul_reason_for_call)
+	{
+		case DLL_PROCESS_ATTACH:
+		case DLL_THREAD_ATTACH:
+		case DLL_THREAD_DETACH:
+		case DLL_PROCESS_DETACH:
+			break;
+    }
+    return TRUE;
+}
+
+
+
+
+LDAPAUTH_API
+BOOL CUGP(char * userin,char *password,char *machine, char * groupin,int locdom)
+{
+	OSVERSIONINFO ovi = { sizeof ovi };
+	GetVersionEx( &ovi );
+	if (ovi.dwPlatformId == VER_PLATFORM_WIN32_NT &&
+      ovi.dwMajorVersion >= 5 )
+	{
+	//Handle the command line arguments.
+	LPOLESTR pszBuffer = new OLECHAR[MAX_PATH*2];
+	LPOLESTR pszBuffer2 = new OLECHAR[MAX_PATH*2];
+	LPOLESTR pszBuffer3 = new OLECHAR[MAX_PATH*2];
+	LPOLESTR pszBuffer4 = new OLECHAR[MAX_PATH*2];
+	mbstowcs( (wchar_t *) pszBuffer, userin, MAX_PATH );
+	mbstowcs( (wchar_t *) pszBuffer2, password, MAX_PATH );
+	mbstowcs( (wchar_t *) pszBuffer3, machine, MAX_PATH );
+	mbstowcs( (wchar_t *) pszBuffer4, groupin, MAX_PATH );
+	HRESULT hr = S_OK;
+	//Get rootDSE and the domain container's DN.
+	IADs *pObject = NULL;
+	IADs *pObjectUser = NULL;
+	IADs *pObjectGroup = NULL;
+	IDirectorySearch *pDS = NULL;
+	LPOLESTR szPath = new OLECHAR[MAX_PATH];
+	LPOLESTR myPath = new OLECHAR[MAX_PATH];
+	VARIANT var;
+	
+	wcscpy(szPath,L"LDAP://");
+	wcscat(szPath,L"rootDSE");
+	wprintf(szPath);
+	wprintf(L"\n");
+
+	hr = ADsOpenObject(szPath,
+					pszBuffer,
+					pszBuffer2,
+					ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
+					IID_IADs,
+					(void**)&pObject);
+	if (FAILED(hr))
+		{
+			wprintf(L"Bind to domain failed %i\n",hr);
+
+			if (pObject) pObject->Release();
+			delete [] pszBuffer;
+			delete [] pszBuffer2;
+			delete [] pszBuffer3;
+			delete [] pszBuffer4;
+			delete [] szPath;
+			delete [] myPath;
+			return false;
+		}
+	hr = pObject->Get(L"defaultNamingContext",&var);
+
+	if (SUCCEEDED(hr))
+		{
+			wcscpy(szPath,L"LDAP://");
+			wcscat(szPath,var.bstrVal);
+			VariantClear(&var);
+			if (pObject)
+				{
+					pObject->Release();
+					pObject = NULL;
+				}
+			wprintf( szPath);
+			wprintf(L"\n");
+			//Bind to the root of the current domain.
+			hr = ADsOpenObject(szPath,pszBuffer,pszBuffer2,
+					 ADS_SECURE_AUTHENTICATION,IID_IDirectorySearch,(void**)&pDS);
+			if (SUCCEEDED(hr))
+				{
+					if (SUCCEEDED(hr))
+						{
+							hr =  FindUserByName(pDS, pszBuffer, &pObjectUser);
+							if (FAILED(hr))
+								{
+									wprintf(L"User not found %i\n",hr);
+									delete [] pszBuffer;
+									delete [] pszBuffer2;
+									delete [] pszBuffer3;
+									delete [] szPath;
+									delete [] myPath;
+									if (pDS) pDS->Release();
+									if (pObjectUser) pObjectUser->Release();
+									return false;
+								}
+							if (pObjectUser) pObjectUser->Release();
+							///////////////////// VNCACCESS
+							hr =  FindGroup(pDS, pszBuffer, &pObjectGroup,pszBuffer4);
+							if (pObjectGroup)
+										{
+											pObjectGroup->Release();
+											pObjectGroup = NULL;
+										}
+							if (FAILED(hr)) wprintf(L"group not found\n");
+							if (SUCCEEDED(hr))
+								{
+									wprintf(L"Group found OK\n");
+									IADsGroup *     pIADsG;
+									hr = ADsOpenObject( gbsGroup,pszBuffer, pszBuffer2, 
+											ADS_SECURE_AUTHENTICATION,IID_IADsGroup, (void**) &pIADsG);
+									if (SUCCEEDED(hr))
+										{
+											VARIANT_BOOL bMember = FALSE;  
+											hr = pIADsG->IsMember(gbsMember,&bMember);
+											if (SUCCEEDED(hr))
+												{
+													if (bMember == -1)
+														{
+															wprintf(L"Object \n\n%s\n\n IS a member of the following Group:\n\n%s\n\n",gbsMember,gbsGroup);
+															delete [] pszBuffer;
+															delete [] pszBuffer2;
+															delete [] pszBuffer3;
+															delete [] szPath;
+															delete [] myPath;
+															if (pDS) pDS->Release();
+															return true;
+														}
+													else
+														{
+															BSTR bsMemberGUID = NULL;
+															IDirectoryObject * pDOMember = NULL;
+															hr = ADsOpenObject( gbsMember,pszBuffer, pszBuffer2, 
+																	ADS_SECURE_AUTHENTICATION,IID_IDirectoryObject, (void**) &pDOMember);
+															if (SUCCEEDED(hr))
+																{
+																	hr = GetObjectGuid(pDOMember,bsMemberGUID);
+																	pDOMember->Release();
+																	pDOMember  = NULL;
+																	if (RecursiveIsMember(pIADsG,bsMemberGUID,gbsMember,true, pszBuffer, pszBuffer2))
+																		{
+																			delete [] pszBuffer;
+																			delete [] pszBuffer2;
+																			delete [] pszBuffer3;
+																			delete [] szPath;
+																			delete [] myPath;
+																			if (pDS) pDS->Release();
+																			return true;
+																		}
+																}
+													}//else bmember
+											}//ismember
+									}//iadsgroup 
+							}//Findgroup
+							wprintf(L"USER not found in group\n");
+							
+						}//user
+				}
+		if (pDS) pDS->Release();
+		}
+		/*LOGFAILED(pszBuffer3,pszBuffer);*/
+		delete [] pszBuffer;
+		delete [] pszBuffer2;
+		delete [] pszBuffer3;
+		delete [] szPath;
+		delete [] myPath;
+		return false;
+	}
+	return false;
+}
+
+HRESULT FindUserByName(IDirectorySearch *pSearchBase, //Container to search
+					   LPOLESTR szFindUser, //Name of user to find.
+					   IADs **ppUser) //Return a pointer to the user
+{
+    HRESULT hrObj = E_FAIL;
+    HRESULT hr = E_FAIL;
+	if ((!pSearchBase)||(!szFindUser))
+		return E_INVALIDARG;
+	//Create search filter
+	LPOLESTR pszSearchFilter = new OLECHAR[MAX_PATH];
+	LPOLESTR szADsPath = new OLECHAR[MAX_PATH];
+	wcscpy(pszSearchFilter, L"(&(objectCategory=person)(objectClass=user)(samAccountName=");
+	wcscat(pszSearchFilter, szFindUser);
+	wcscat(pszSearchFilter,	L"))");
+    //Search entire subtree from root.
+	ADS_SEARCHPREF_INFO SearchPrefs;
+	SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
+	SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
+	SearchPrefs.vValue.Integer = ADS_SCOPE_SUBTREE;
+    DWORD dwNumPrefs = 1;
+	// COL for iterations
+    ADS_SEARCH_COLUMN col;
+    // Handle used for searching
+    ADS_SEARCH_HANDLE hSearch;
+	// Set the search preference
+    hr = pSearchBase->SetSearchPreference( &SearchPrefs, dwNumPrefs);
+    if (FAILED(hr))
+        return hr;
+	// Set attributes to return
+	CONST DWORD dwAttrNameSize = 1;
+    LPOLESTR pszAttribute[dwAttrNameSize] = {L"ADsPath"};
+
+    // Execute the search
+    hr = pSearchBase->ExecuteSearch(pszSearchFilter,
+		                          pszAttribute,
+								  dwAttrNameSize,
+								  &hSearch
+								  );
+	if (SUCCEEDED(hr))
+	{    
+
+    // Call IDirectorySearch::GetNextRow() to retrieve the next row 
+    //of data
+        while( pSearchBase->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
+		{
+            // loop through the array of passed column names,
+            // print the data for each column
+            for (DWORD x = 0; x < dwAttrNameSize; x++)
+            {
+			    // Get the data for this column
+                hr = pSearchBase->GetColumn( hSearch, pszAttribute[x], &col );
+			    if ( SUCCEEDED(hr) )
+			    {
+				    // Print the data for the column and free the column
+					// Note the attribute we asked for is type CaseIgnoreString.
+                    wcscpy(szADsPath, col.pADsValues->CaseIgnoreString); 
+					hr = ADsOpenObject(szADsPath,
+									 NULL,
+									 NULL,
+									 ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
+									 IID_IADs,
+									 (void**)ppUser);
+					if (SUCCEEDED(hr))
+					{ 
+                       wprintf(L"%s: %s\r\n",pszAttribute[x],col.pADsValues->CaseIgnoreString); 
+					   hrObj = S_OK;
+					   gbsMember=SysAllocString(col.pADsValues->CaseIgnoreString);
+					}
+				    pSearchBase->FreeColumn( &col );
+			    }
+			    else
+				    hr = E_FAIL;
+            }
+		}
+		// Close the search handle to clean up
+        pSearchBase->CloseSearchHandle(hSearch);
+	}
+	if (FAILED(hrObj))
+		hr = hrObj;
+    return hr;
+}
+
+HRESULT FindGroup(IDirectorySearch *pSearchBase, //Container to search
+					   LPOLESTR szFindUser, //Name of user to find.
+					   IADs **ppUser,LPOLESTR szGroup) //Return a pointer to the user
+{
+    HRESULT hrObj = E_FAIL;
+    HRESULT hr = E_FAIL;
+	if ((!pSearchBase)||(!szFindUser))
+		return E_INVALIDARG;
+	//Create search filter
+	LPOLESTR pszSearchFilter = new OLECHAR[MAX_PATH];
+	LPOLESTR szADsPath = new OLECHAR[MAX_PATH];
+	wcscpy(pszSearchFilter, L"(&(objectClass=group)(cn=");
+	wcscat(pszSearchFilter,szGroup);
+	wcscat(pszSearchFilter,	L"))");
+    //Search entire subtree from root.
+	ADS_SEARCHPREF_INFO SearchPrefs;
+	SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
+	SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
+	SearchPrefs.vValue.Integer = ADS_SCOPE_SUBTREE;
+    DWORD dwNumPrefs = 1;
+	// COL for iterations
+    ADS_SEARCH_COLUMN col;
+    // Handle used for searching
+    ADS_SEARCH_HANDLE hSearch;
+	// Set the search preference
+    hr = pSearchBase->SetSearchPreference( &SearchPrefs, dwNumPrefs);
+    if (FAILED(hr))
+        return hr;
+	// Set attributes to return
+	CONST DWORD dwAttrNameSize = 1;
+    LPOLESTR pszAttribute[dwAttrNameSize] = {L"ADsPath"};
+
+    // Execute the search
+    hr = pSearchBase->ExecuteSearch(pszSearchFilter,
+		                          pszAttribute,
+								  dwAttrNameSize,
+								  &hSearch
+								  );
+	if (SUCCEEDED(hr))
+	{    
+
+    // Call IDirectorySearch::GetNextRow() to retrieve the next row 
+    //of data
+        while( pSearchBase->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
+		{
+            // loop through the array of passed column names,
+            // print the data for each column
+            for (DWORD x = 0; x < dwAttrNameSize; x++)
+            {
+			    // Get the data for this column
+                hr = pSearchBase->GetColumn( hSearch, pszAttribute[x], &col );
+			    if ( SUCCEEDED(hr) )
+			    {
+				    // Print the data for the column and free the column
+					// Note the attribute we asked for is type CaseIgnoreString.
+                    wcscpy(szADsPath, col.pADsValues->CaseIgnoreString); 
+					hr = ADsOpenObject(szADsPath,
+									 NULL,
+									 NULL,
+									 ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
+									 IID_IADs,
+									 (void**)ppUser);
+					if (SUCCEEDED(hr))
+					{ 
+                       wprintf(L"%s: %s\r\n",pszAttribute[x],col.pADsValues->CaseIgnoreString); 
+					   hrObj = S_OK;
+					   gbsGroup=SysAllocString(col.pADsValues->CaseIgnoreString);
+					}
+				    pSearchBase->FreeColumn( &col );
+			    }
+			    else
+				    hr = E_FAIL;
+            }
+		}
+		// Close the search handle to clean up
+        pSearchBase->CloseSearchHandle(hSearch);
+	}
+	if (FAILED(hrObj))
+		hr = hrObj;
+    return hr;
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/*  RecursiveIsMember()                       - Recursively scans the members of passed IADsGroup ptr
+                                                and any groups that belong to the passed ptr- for membership
+                                                of Passed group.
+                                                Will return a TRUE if the member is found in the passed group,
+                                                or if the passed member is a member of any group which is a member
+                                                of the passed group.
+    Parameters
+ 
+        IADsGroup *     pADsGroup       - Group from which to verify members.
+        LPWSTR          pwszMember      - LDAP path for object to verify membership.
+        BOOL            bVerbose        - IF TRUE, will output verbose information for the scan.
+ 
+    OPTIONAL Parameters
+ 
+       LPOLESTR  pwszUser           - User Name and Password, if the parameters are not passed, 
+       LPOLESTER pwszPassword       - binding will use ADsGetObject; if the parameters are
+                                    - specified, ADsOpenObject is used, passing user name and password.
+*/
+ 
+BOOL RecursiveIsMember(IADsGroup * pADsGroup,LPWSTR pwszMemberGUID,LPWSTR pwszMemberPath, 
+                                             BOOL bVerbose, LPOLESTR  pwszUser, LPOLESTR pwszPassword)
+{
+    HRESULT         hr                = S_OK;     // COM Result Code
+    IADsMembers *   pADsMembers       = NULL;     // Ptr to Members of the IADsGroup
+    BOOL            fContinue         = TRUE;     // Looping Variable
+    IEnumVARIANT *  pEnumVariant      = NULL;     // Ptr to the Enum variant
+    IUnknown *      pUnknown          = NULL;     // IUnknown for getting the ENUM initially
+    VARIANT         VariantArray[FETCH_NUM];      // Variant array for temp holding returned data
+    ULONG           ulElementsFetched = NULL;     // Number of elements retrieved
+    BSTR            bsGroupPath       = NULL;
+    BOOL            bRet              = FALSE;
+
+    if(!pADsGroup || !pwszMemberGUID || !pwszMemberPath)
+    {
+        return FALSE;
+    }
+ 
+    // Get the path of the object passed in
+    hr = pADsGroup->get_ADsPath(&bsGroupPath);
+ 
+    if (!SUCCEEDED(hr))
+        return hr;
+ 
+    if (bVerbose)
+    {
+        WCHAR pwszOutput[2048];
+        wsprintf(pwszOutput,L"Checking the Group:\n\n%s\n\n for the member:\n\n%s\n\n",bsGroupPath,pwszMemberPath);
+        PrintBanner(pwszOutput);
+    }
+ 
+    // Get an interface pointer to the IADsCollection of members
+    hr = pADsGroup->Members(&pADsMembers);
+ 
+    if (SUCCEEDED(hr))
+    {
+        // Query the IADsCollection of members for a new ENUM Interface
+        // Be aware that the enum comes back as an IUnknown *
+        hr = pADsMembers->get__NewEnum(&pUnknown);
+ 
+        if (SUCCEEDED(hr))
+        {
+            // QI the IUnknown * for an IEnumVARIANT interface
+            hr = pUnknown->QueryInterface(IID_IEnumVARIANT, (void **)&pEnumVariant);
+ 
+            if (SUCCEEDED(hr))
+            {
+                // While have not hit errors or end of data....
+                while (fContinue) 
+                {
+                   ulElementsFetched = 0;
+                    // Get a "batch" number of group members-number of rows specified by FETCH_NUM
+                    hr = ADsEnumerateNext(pEnumVariant, FETCH_NUM, VariantArray, &ulElementsFetched);
+ 
+                    if (ulElementsFetched )
+                    {
+                        // Loop through the current batch-printing the path for each member.
+                        for (ULONG i = 0; i < ulElementsFetched; i++ ) 
+                        {
+                            IDispatch * pDispatch         = NULL; // ptr for holding dispath of element
+                            BSTR        bstrCurrentPath   = NULL; // Holds path of object
+                            BSTR        bstrGuidCurrent   = NULL; // Holds path of object
+                            IDirectoryObject * pIDOCurrent = NULL;// Holds the current object          
+ 
+                            // Get the dispatch ptr for the variant
+                            pDispatch = VariantArray[i].pdispVal;
+//                            assert(HAS_BIT_STYLE(VariantArray[i].vt,VT_DISPATCH));
+ 
+                            // Get the IADs interface for the "member" of this group
+                            hr = pDispatch->QueryInterface(IID_IDirectoryObject,
+                                                           (VOID **) &pIDOCurrent ) ;
+ 
+                            if (SUCCEEDED(hr))
+                            {
+                                // Get the GUID for the current object
+                                hr = GetObjectGuid(pIDOCurrent,bstrGuidCurrent);
+ 
+                                if (FAILED(hr))
+                                    return hr;
+ 
+                                IADs * pIADsCurrent = NULL;
+ 
+                                // Retrieve the IADs Interface for the current object
+                                hr = pIDOCurrent->QueryInterface(IID_IADs,(void**)&pIADsCurrent);
+                                if (FAILED(hr))
+                                    return hr;
+ 
+                                // Get the ADsPath property for this member
+                                hr = pIADsCurrent->get_ADsPath(&bstrCurrentPath);
+ 
+                                if (SUCCEEDED(hr))
+                                {
+                                    if (bVerbose)
+                                        wprintf(L"Comparing:\n\n%s\nWITH:\n%s\n\n",bstrGuidCurrent,pwszMemberGUID);
+                                    
+                                    // Verify that the member of this group is Equal to passed.
+                                    if (_wcsicmp(bstrGuidCurrent,pwszMemberGUID)==0)
+                                    {
+                                        if (bVerbose)
+                                            wprintf(L"!!!!!Object:\n\n%s\n\nIs a member of\n\n%s\n\n",pwszMemberPath,bstrGuidCurrent);   
+ 
+                                        bRet = TRUE;
+                                        break;
+                                    }
+                                    else // Otherwise, bind to this and see if it is a group.
+                                    {    // If is it a group then the QI to IADsGroup succeeds
+                                        
+                                        IADsGroup * pIADsGroupAsMember = NULL;
+                                        
+                                        if (pwszUser)
+                                            hr = ADsOpenObject( bstrCurrentPath,
+                                                                pwszUser, 
+                                                                pwszPassword, 
+                                                                ADS_SECURE_AUTHENTICATION,
+                                                                IID_IADsGroup, 
+                                                                (void**) &pIADsGroupAsMember);
+                                        else
+                                            hr = ADsGetObject( bstrCurrentPath, IID_IADsGroup,(void **)&pIADsGroupAsMember);
+ 
+                                        // If bind was completed, then this is a group.
+                                        if (SUCCEEDED(hr))
+                                        {
+                                            // Recursively call this group to verify this group.
+                                            BOOL bRetRecurse;
+                                            bRetRecurse = RecursiveIsMember(pIADsGroupAsMember,pwszMemberGUID,pwszMemberPath,bVerbose,pwszUser ,pwszPassword );
+                                            
+                                            if (bRetRecurse)
+                                            {
+                                                bRet = TRUE;
+                                                break;
+                                            }
+                                            pIADsGroupAsMember->Release();
+                                            pIADsGroupAsMember = NULL;
+                                        }
+                                    }
+                                    SysFreeString(bstrCurrentPath);
+                                    bstrCurrentPath = NULL;
+ 
+                                    SysFreeString(bstrGuidCurrent);
+                                    bstrGuidCurrent = NULL;
+                                }
+                                // Release
+                                pIDOCurrent->Release();
+                                pIDOCurrent = NULL;
+                                if (pIADsCurrent)
+                                {
+                                    pIADsCurrent->Release();
+                                    pIADsCurrent = NULL;
+                                }
+                            }
+                         }
+                        // Clear the variant array.
+                        memset(VariantArray, 0, sizeof(VARIANT)*FETCH_NUM);
+                    }
+                    else
+                        fContinue = FALSE;
+                }
+                pEnumVariant->Release();
+                pEnumVariant = NULL;
+            }
+            pUnknown->Release();
+            pUnknown = NULL;
+        }
+        pADsMembers ->Release();
+        pADsMembers  = NULL;
+    }
+ 
+    // Free the group path if retrieved.
+    if (bsGroupPath)
+    {
+        SysFreeString(bsGroupPath);
+        bsGroupPath = NULL;
+    }
+    return bRet;
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/*  GetObjectGuid()    - Retrieves the GUID, in string form, from the passed Directory Object.
+                         Returns S_OK on success.
+ 
+    Parameters
+ 
+        IDirectoryObject *  pDO     -   Directory Object from where GUID is retrieved.
+        BSTR             &  bsGuid  -   Returned GUID            
+*/
+ 
+HRESULT GetObjectGuid(IDirectoryObject * pDO,BSTR &bsGuid)
+{
+ 
+    GUID *pObjectGUID   = NULL;
+    PADS_ATTR_INFO      pAttributeEntries;
+    LPWSTR              pAttributeName = L"objectGUID";  // Get the GUID for the object.
+    DWORD               dwAttributesReturned = 0;
+    HRESULT             hr;
+
+    if(!pDO)
+    {
+        return E_FAIL;
+    }
+
+    hr = pDO->GetObjectAttributes(  &pAttributeName, // objectGUID
+                                    1, //Only objectGUID
+                                    &pAttributeEntries, // Returned attributes
+                                    &dwAttributesReturned // Number of attributes returned
+                                    );
+ 
+    if (SUCCEEDED(hr) && dwAttributesReturned>0)
+    {
+        // Be sure the right type was retrieved--objectGUID is ADSTYPE_OCTET_STRING
+        if (pAttributeEntries->dwADsType == ADSTYPE_OCTET_STRING)
+        {
+            // Get COM converted string version of the GUID
+            // lpvalue should be LPBYTE. Should be able to cast it to ptr to GUID.
+            pObjectGUID = (GUID*)(pAttributeEntries->pADsValues[0].OctetString.lpValue);
+            
+            // OLE str to fit a GUID
+            
+            LPOLESTR szGUID = new WCHAR [64];
+            szGUID[0]=NULL;
+            // Convert GUID to string.
+            ::StringFromGUID2(*pObjectGUID, szGUID, 39); 
+            bsGuid = SysAllocString(szGUID);
+            
+            delete [] szGUID;
+         }
+    }
+ 
+    return hr;
+ 
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/*  PrintBanner()   -       Prints a banner to the screen
+ 
+    Parameters
+ 
+                LPOLESTR pwszBanner   - String to print
+*/
+void PrintBanner(LPOLESTR pwszBanner)
+{
+    _putws(L"");
+    _putws(L"////////////////////////////////////////////////////");
+    wprintf(L"\t");
+    _putws(pwszBanner);
+    _putws(L"////////////////////////////////////////////////////\n");
+}
diff --git a/ica/win32/addon/ms-logon/ldapauth/ldapAuth.h b/ica/win32/addon/ms-logon/ldapauth/ldapAuth.h
new file mode 100644
index 0000000..4dfd9db
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth/ldapAuth.h
@@ -0,0 +1,55 @@
+
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the AUTH_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// AUTH_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef LDAPAUTH_EXPORTS
+#define LDAPAUTH_API __declspec(dllexport)
+#else
+#define LDAPAUTH_API __declspec(dllimport)
+#endif
+
+#include <windows.h>
+#include <stdio.h>
+#include <tchar.h>
+#include <wchar.h>
+#include <math.h>
+#include <objbase.h>
+#include <activeds.h>
+#include <Dsgetdc.h>
+#include <sddl.h>
+#include <assert.h>
+
+
+#define MAXLEN 256
+//#define MAX_PREFERRED_LENGTH    ((DWORD) -1)
+//#define NERR_Success            0
+//#define LG_INCLUDE_INDIRECT 1
+#define BUFSIZE 1024
+
+#define FETCH_NUM 100
+void PrintBanner(LPOLESTR pwszBanner);
+HRESULT GetObjectGuid(IDirectoryObject * pDO,BSTR &bsGuid);
+BOOL RecursiveIsMember(IADsGroup * pADsGroup,LPWSTR pwszMemberGUID,LPWSTR pwszMemberPath, 
+                                             BOOL bVerbose, LPOLESTR  pwszUser, LPOLESTR pwszPassword);
+
+HRESULT FindUserByName(IDirectorySearch *pSearchBase, //Container to search
+					   LPOLESTR szFindUser, //Name of user to find.
+					   IADs **ppUser); //Return a pointer to the user
+
+
+HRESULT FindGroup(IDirectorySearch *pSearchBase, //Container to search
+					   LPOLESTR szFindUser, //Name of user to find.
+					   IADs **ppUser,LPOLESTR szGroup); //Return a pointer to the user
+
+BSTR gbsGroup     = NULL; // <Group to check> This is the LDAP path for the group to check
+	BSTR gbsMember    = NULL; // <Member to check> 
+	BSTR gbsUSER      = NULL;
+	BSTR gbsPASS      = NULL; // <Password used for binding to the DC>
+
+
+
+LDAPAUTH_API BOOL CUGP(char * userin,char *password,char *machine,char *group,int locdom);
+
diff --git a/ica/win32/addon/ms-logon/ldapauth/ldapAuth.rc b/ica/win32/addon/ms-logon/ldapauth/ldapAuth.rc
new file mode 100644
index 0000000..c3d9193
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth/ldapAuth.rc
@@ -0,0 +1,112 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+// Defines STR_COMPANYNAME, STR_FILEVERSION, STR_PRODUCTVERSION, STR_COPYRIGHT,
+// STR_SPECIALBUILD, FILEVERSION, PRODUCTVERSION
+#include "../../versioninfo.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION INT_FILEVERSION
+ PRODUCTVERSION INT_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+            VALUE "Comments", "Active Directory authentication for UltraVNC\0"
+            VALUE "CompanyName", STR_COMPANYNAME
+            VALUE "FileDescription", "MS-Logon I for UltraVNC\0"
+            VALUE "FileVersion", STR_FILEVERSION
+            VALUE "InternalName", "ldapAuth\0"
+            VALUE "LegalCopyright", STR_COPYRIGHT
+            VALUE "OriginalFilename", "ldapAuth.dll\0"
+            VALUE "ProductName", "UltraVNC ldapAuth\0"
+            VALUE "ProductVersion", STR_PRODUCTVERSION
+#if isRC == 1
+			VALUE "SpecialBuild", STR_SPECIALBUILD
+#endif
+			END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/addon/ms-logon/ldapauth/ldapauth.def b/ica/win32/addon/ms-logon/ldapauth/ldapauth.def
new file mode 100644
index 0000000..ae7ef10
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth/ldapauth.def
@@ -0,0 +1,5 @@
+LIBRARY   LDAPAuth
+
+             EXPORTS
+               CUGP
+			   
diff --git a/ica/win32/addon/ms-logon/ldapauth/ldapauth.dsw b/ica/win32/addon/ms-logon/ldapauth/ldapauth.dsw
new file mode 100644
index 0000000..8c28815
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth/ldapauth.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "ldapauth"=".\ldapauth.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/addon/ms-logon/ldapauth/resource.h b/ica/win32/addon/ms-logon/ldapauth/resource.h
new file mode 100644
index 0000000..decb8f5
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by authSSP.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.cpp b/ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.cpp
new file mode 100644
index 0000000..7d2d3bb
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.cpp
@@ -0,0 +1,614 @@
+//ldapAuth9x.cpp
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+// /macine-vnc Greg Wood (wood at agressiv.com)
+
+
+#include "ldapauth9x.h"
+
+/////////////////////////
+
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+                                         )
+{
+    switch (ul_reason_for_call)
+        {
+                case DLL_PROCESS_ATTACH:
+                case DLL_THREAD_ATTACH:
+                case DLL_THREAD_DETACH:
+                case DLL_PROCESS_DETACH:
+                        break;
+    }
+    return TRUE;
+}
+
+
+
+
+LDAPAUTH9X_API
+BOOL CUGP(char * userin,char *password,char *machine, char * groupin,int locdom)
+{
+        OSVERSIONINFO ovi = { sizeof ovi };
+        GetVersionEx( &ovi );
+        //if (ovi.dwPlatformId == VER_PLATFORM_WIN32_NT &&
+    //  ovi.dwMajorVersion >= 5 )
+        if ( 5 >= 5 )
+        {
+        //Handle the command line arguments.
+        LPOLESTR pszBuffer = new OLECHAR[MAX_PATH*2];
+        LPOLESTR pszBuffer2 = new OLECHAR[MAX_PATH*2];
+        LPOLESTR pszBuffer3 = new OLECHAR[MAX_PATH*2];
+        LPOLESTR pszBuffer4 = new OLECHAR[MAX_PATH*2];
+        mbstowcs( (wchar_t *) pszBuffer, userin, MAX_PATH );
+        mbstowcs( (wchar_t *) pszBuffer2, password, MAX_PATH );
+        mbstowcs( (wchar_t *) pszBuffer3, machine, MAX_PATH );
+        mbstowcs( (wchar_t *) pszBuffer4, groupin, MAX_PATH );
+        HRESULT hr = S_OK;
+        //Get rootDSE and the domain container's DN.
+        IADs *pObject = NULL;
+        IADs *pObjectUser = NULL;
+        IADs *pObjectGroup = NULL;
+        IDirectorySearch *pDS = NULL;
+        LPOLESTR szPath = new OLECHAR[MAX_PATH];
+        LPOLESTR myPath = new OLECHAR[MAX_PATH];
+        
+        wcscpy(szPath,L"LDAP://dc1.ad.local/dc=ad,dc=local"); //set to root of domain or search path
+        wprintf(szPath);
+        wprintf(L"\n");
+        //VariantClear(&var);
+        if (pObject)
+                {
+                        pObject->Release();
+                        pObject = NULL;
+                }
+        wprintf( szPath);
+        wprintf(L"\n");
+        //Bind to the root of the current domain.
+        hr = ADsOpenObject(szPath,pszBuffer,pszBuffer2,
+                         ADS_SECURE_AUTHENTICATION,IID_IDirectorySearch,(void**)&pDS);
+        if (SUCCEEDED(hr))
+                {
+                        if (SUCCEEDED(hr))
+                                {
+                                        hr =  FindUserByName(pDS, pszBuffer, pszBuffer, pszBuffer2, &pObjectUser);
+                                        if (FAILED(hr))
+                                                {
+                                                        wprintf(L"User not found %i\n",hr);
+                                                        delete [] pszBuffer;
+                                                        delete [] pszBuffer2;
+                                                        delete [] pszBuffer3;
+                                                        delete [] szPath;
+                                                        delete [] myPath;
+                                                        if (pDS) pDS->Release();
+                                                        if (pObjectUser) pObjectUser->Release();
+                                                        return false;
+                                                }
+                                        if (pObjectUser) pObjectUser->Release();
+                                        ///////////////////// VNCACCESS
+                                        hr =  FindGroup(pDS, pszBuffer, pszBuffer, pszBuffer2, &pObjectGroup,pszBuffer4);
+                                        if (pObjectGroup)
+                                                                {
+                                                                        pObjectGroup->Release();
+                                                                        pObjectGroup = NULL;
+                                                                }
+                                        if (FAILED(hr)) wprintf(L"group not found\n");
+                                        if (SUCCEEDED(hr))
+                                                {
+                                                        wprintf(L"Group found OK\n");
+                                                        IADsGroup *     pIADsG;
+                                                        hr = ADsOpenObject( gbsGroup,pszBuffer, pszBuffer2, 
+                                                                        ADS_SECURE_AUTHENTICATION,IID_IADsGroup, (void**) &pIADsG);
+                                                        if (SUCCEEDED(hr))
+                                                                {
+                                                                        VARIANT_BOOL bMember = FALSE;  
+                                                                        hr = pIADsG->IsMember(gbsMember,&bMember);
+                                                                        if (SUCCEEDED(hr))
+                                                                                {
+                                                                                        if (bMember == -1)
+                                                                                                {
+                                                                                                        wprintf(L"Object \n\n%s\n\n IS a member of the following Group:\n\n%s\n\n",gbsMember,gbsGroup);
+                                                                                                        delete [] pszBuffer;
+                                                                                                        delete [] pszBuffer2;
+                                                                                                        delete [] pszBuffer3;
+                                                                                                        delete [] szPath;
+                                                                                                        delete [] myPath;
+                                                                                                        if (pDS) pDS->Release();
+                                                                                                        return true;
+                                                                                                }
+                                                                                        else
+                                                                                                {
+                                                                                                        BSTR bsMemberGUID = NULL;
+                                                                                                        IDirectoryObject * pDOMember = NULL;
+                                                                                                        hr = ADsOpenObject( gbsMember,pszBuffer, pszBuffer2, 
+                                                                                                                        ADS_SECURE_AUTHENTICATION,IID_IDirectoryObject, (void**) &pDOMember);
+                                                                                                        if (SUCCEEDED(hr))
+                                                                                                                {
+                                                                                                                        hr = GetObjectGuid(pDOMember,bsMemberGUID);
+                                                                                                                        pDOMember->Release();
+                                                                                                                        pDOMember  = NULL;
+                                                                                                                        if (RecursiveIsMember(pIADsG,bsMemberGUID,gbsMember,true, pszBuffer, pszBuffer2))
+                                                                                                                                {
+                                                                                                                                        delete [] pszBuffer;
+                                                                                                                                        delete [] pszBuffer2;
+                                                                                                                                        delete [] pszBuffer3;
+                                                                                                                                        delete [] szPath;
+                                                                                                                                        delete [] myPath;
+                                                                                                                                        if (pDS) pDS->Release();
+                                                                                                                                        return true;
+                                                                                                                                }
+                                                                                                                }
+                                                                                        }//else bmember
+                                                                        }//ismember
+                                                        }//iadsgroup 
+                                        }//Findgroup
+                                        wprintf(L"USER not found in group\n");
+                                        
+                                }//user
+                }
+        if (pDS) pDS->Release();
+
+                /*LOGFAILED(pszBuffer3,pszBuffer);*/
+                delete [] pszBuffer;
+                delete [] pszBuffer2;
+                delete [] pszBuffer3;
+                delete [] szPath;
+                delete [] myPath;
+                return false;
+        }
+        return false;
+}
+
+HRESULT FindUserByName(IDirectorySearch *pSearchBase, //Container to search
+                                           LPOLESTR szFindUser, LPOLESTR  pwszUser, LPOLESTR pwszPassword, //Name of user to find.
+                                           IADs **ppUser) //Return a pointer to the user
+{
+    HRESULT hrObj = E_FAIL;
+    HRESULT hr = E_FAIL;
+        if ((!pSearchBase)||(!szFindUser))
+                return E_INVALIDARG;
+        //Create search filter
+        LPOLESTR pszSearchFilter = new OLECHAR[MAX_PATH];
+        LPOLESTR szADsPath = new OLECHAR[MAX_PATH];
+        wcscpy(pszSearchFilter, L"(&(objectClass=user)(samAccountName=");
+        wcscat(pszSearchFilter, szFindUser);
+        wcscat(pszSearchFilter, L"))");
+    //Search entire subtree from root.
+        ADS_SEARCHPREF_INFO SearchPrefs;
+        SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
+        SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
+        SearchPrefs.vValue.Integer = ADS_SCOPE_SUBTREE;
+    DWORD dwNumPrefs = 1;
+        // COL for iterations
+    ADS_SEARCH_COLUMN col;
+    // Handle used for searching
+    ADS_SEARCH_HANDLE hSearch;
+        // Set the search preference
+    hr = pSearchBase->SetSearchPreference( &SearchPrefs, dwNumPrefs);
+    if (FAILED(hr))
+        return hr;
+        // Set attributes to return
+        CONST DWORD dwAttrNameSize = 1;
+    LPOLESTR pszAttribute[dwAttrNameSize] = {L"ADsPath"};
+
+    // Execute the search
+        wprintf(pszSearchFilter);
+        wprintf(L"\n");
+    hr = pSearchBase->ExecuteSearch(pszSearchFilter,
+                                          pszAttribute,
+                                                                  dwAttrNameSize,
+                                                                  &hSearch
+                                                                  );
+        if (SUCCEEDED(hr))
+        {    
+
+    // Call IDirectorySearch::GetNextRow() to retrieve the next row 
+    //of data
+        while( pSearchBase->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
+                {
+            // loop through the array of passed column names,
+            // print the data for each column
+            for (DWORD x = 0; x < dwAttrNameSize; x++)
+            {
+                            // Get the data for this column
+                hr = pSearchBase->GetColumn( hSearch, pszAttribute[x], &col );
+                            if ( SUCCEEDED(hr) )
+                            {
+                                    // Print the data for the column and free the column
+                                        // Note the attribute we asked for is type CaseIgnoreString.
+                    wcscpy(szADsPath, col.pADsValues->CaseIgnoreString); 
+                                        hr = ADsOpenObject(szADsPath,
+                                                                         pwszUser,
+                                                                         pwszPassword,
+                                                                         ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
+                                                                         IID_IADs,
+                                                                         (void**)ppUser);
+                                        if (SUCCEEDED(hr))
+                                        { 
+                       wprintf(L"%s: %s\r\n",pszAttribute[x],col.pADsValues->CaseIgnoreString); 
+                                           hrObj = S_OK;
+                                           gbsMember=SysAllocString(col.pADsValues->CaseIgnoreString);
+                                        }
+                                    pSearchBase->FreeColumn( &col );
+                            }
+                            else
+                                    hr = E_FAIL;
+            }
+                }
+                // Close the search handle to clean up
+        pSearchBase->CloseSearchHandle(hSearch);
+        }
+        if (FAILED(hrObj))
+                hr = hrObj;
+    return hr;
+}
+
+HRESULT FindGroup(IDirectorySearch *pSearchBase, //Container to search
+                                           LPOLESTR szFindUser, LPOLESTR  pwszUser, LPOLESTR pwszPassword, //Name of user to find.
+                                           IADs **ppUser,LPOLESTR szGroup) //Return a pointer to the user
+{
+    HRESULT hrObj = E_FAIL;
+    HRESULT hr = E_FAIL;
+        if ((!pSearchBase)||(!szFindUser))
+                return E_INVALIDARG;
+        //Create search filter
+        LPOLESTR pszSearchFilter = new OLECHAR[MAX_PATH];
+        LPOLESTR szADsPath = new OLECHAR[MAX_PATH];
+        wcscpy(pszSearchFilter, L"(&(objectClass=group)(cn=");
+        wcscat(pszSearchFilter,szGroup);
+        wcscat(pszSearchFilter, L"))");
+    //Search entire subtree from root.
+        ADS_SEARCHPREF_INFO SearchPrefs;
+        SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
+        SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
+        SearchPrefs.vValue.Integer = ADS_SCOPE_SUBTREE;
+    DWORD dwNumPrefs = 1;
+        // COL for iterations
+    ADS_SEARCH_COLUMN col;
+    // Handle used for searching
+    ADS_SEARCH_HANDLE hSearch;
+        // Set the search preference
+    hr = pSearchBase->SetSearchPreference( &SearchPrefs, dwNumPrefs);
+    if (FAILED(hr))
+        return hr;
+        // Set attributes to return
+        CONST DWORD dwAttrNameSize = 1;
+    LPOLESTR pszAttribute[dwAttrNameSize] = {L"ADsPath"};
+
+    // Execute the search
+    hr = pSearchBase->ExecuteSearch(pszSearchFilter,
+                                          pszAttribute,
+                                                                  dwAttrNameSize,
+                                                                  &hSearch
+                                                                  );
+        if (SUCCEEDED(hr))
+        {    
+
+    // Call IDirectorySearch::GetNextRow() to retrieve the next row 
+    //of data
+        while( pSearchBase->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
+                {
+            // loop through the array of passed column names,
+            // print the data for each column
+            for (DWORD x = 0; x < dwAttrNameSize; x++)
+            {
+                            // Get the data for this column
+                hr = pSearchBase->GetColumn( hSearch, pszAttribute[x], &col );
+                            if ( SUCCEEDED(hr) )
+                            {
+                                    // Print the data for the column and free the column
+                                        // Note the attribute we asked for is type CaseIgnoreString.
+                    wcscpy(szADsPath, col.pADsValues->CaseIgnoreString); 
+                                        hr = ADsOpenObject(szADsPath,
+                                                                         pwszUser,
+                                                                         pwszPassword,
+                                                                         ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
+                                                                         IID_IADs,
+                                                                         (void**)ppUser);
+                                        if (SUCCEEDED(hr))
+                                        { 
+                       wprintf(L"%s: %s\r\n",pszAttribute[x],col.pADsValues->CaseIgnoreString); 
+                                           hrObj = S_OK;
+                                           gbsGroup=SysAllocString(col.pADsValues->CaseIgnoreString);
+                                        }
+                                    pSearchBase->FreeColumn( &col );
+                            }
+                            else
+                                    hr = E_FAIL;
+            }
+                }
+                // Close the search handle to clean up
+        pSearchBase->CloseSearchHandle(hSearch);
+        }
+        if (FAILED(hrObj))
+                hr = hrObj;
+    return hr;
+}
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/*  RecursiveIsMember()                       - Recursively scans the members of passed IADsGroup ptr
+                                                and any groups that belong to the passed ptr- for membership
+                                                of Passed group.
+                                                Will return a TRUE if the member is found in the passed group,
+                                                or if the passed member is a member of any group which is a member
+                                                of the passed group.
+    Parameters
+ 
+        IADsGroup *     pADsGroup       - Group from which to verify members.
+        LPWSTR          pwszMember      - LDAP path for object to verify membership.
+        BOOL            bVerbose        - IF TRUE, will output verbose information for the scan.
+ 
+    OPTIONAL Parameters
+ 
+       LPOLESTR  pwszUser           - User Name and Password, if the parameters are not passed, 
+       LPOLESTER pwszPassword       - binding will use ADsGetObject; if the parameters are
+                                    - specified, ADsOpenObject is used, passing user name and password.
+*/
+ 
+BOOL RecursiveIsMember(IADsGroup * pADsGroup,LPWSTR pwszMemberGUID,LPWSTR pwszMemberPath, 
+                                             BOOL bVerbose, LPOLESTR  pwszUser, LPOLESTR pwszPassword)
+{
+    HRESULT         hr                = S_OK;     // COM Result Code
+    IADsMembers *   pADsMembers       = NULL;     // Ptr to Members of the IADsGroup
+    BOOL            fContinue         = TRUE;     // Looping Variable
+    IEnumVARIANT *  pEnumVariant      = NULL;     // Ptr to the Enum variant
+    IUnknown *      pUnknown          = NULL;     // IUnknown for getting the ENUM initially
+    VARIANT         VariantArray[FETCH_NUM];      // Variant array for temp holding returned data
+    ULONG           ulElementsFetched = NULL;     // Number of elements retrieved
+    BSTR            bsGroupPath       = NULL;
+    BOOL            bRet              = FALSE;
+
+    if(!pADsGroup || !pwszMemberGUID || !pwszMemberPath)
+    {
+        return FALSE;
+    }
+ 
+    // Get the path of the object passed in
+    hr = pADsGroup->get_ADsPath(&bsGroupPath);
+ 
+    if (!SUCCEEDED(hr))
+        return hr;
+ 
+    if (bVerbose)
+    {
+        WCHAR pwszOutput[2048];
+        wsprintf(pwszOutput,L"Checking the Group:\n\n%s\n\n for the member:\n\n%s\n\n",bsGroupPath,pwszMemberPath);
+        PrintBanner(pwszOutput);
+    }
+ 
+    // Get an interface pointer to the IADsCollection of members
+    hr = pADsGroup->Members(&pADsMembers);
+ 
+    if (SUCCEEDED(hr))
+    {
+        // Query the IADsCollection of members for a new ENUM Interface
+        // Be aware that the enum comes back as an IUnknown *
+        hr = pADsMembers->get__NewEnum(&pUnknown);
+ 
+        if (SUCCEEDED(hr))
+        {
+            // QI the IUnknown * for an IEnumVARIANT interface
+            hr = pUnknown->QueryInterface(IID_IEnumVARIANT, (void **)&pEnumVariant);
+ 
+            if (SUCCEEDED(hr))
+            {
+                // While have not hit errors or end of data....
+                while (fContinue) 
+                {
+                   ulElementsFetched = 0;
+                    // Get a "batch" number of group members-number of rows specified by FETCH_NUM
+                    hr = ADsEnumerateNext(pEnumVariant, FETCH_NUM, VariantArray, &ulElementsFetched);
+ 
+                    if (ulElementsFetched )
+                    {
+                        // Loop through the current batch-printing the path for each member.
+                        for (ULONG i = 0; i < ulElementsFetched; i++ ) 
+                        {
+                            IDispatch * pDispatch         = NULL; // ptr for holding dispath of element
+                            BSTR        bstrCurrentPath   = NULL; // Holds path of object
+                            BSTR        bstrGuidCurrent   = NULL; // Holds path of object
+                            IDirectoryObject * pIDOCurrent = NULL;// Holds the current object          
+ 
+                            // Get the dispatch ptr for the variant
+                            pDispatch = VariantArray[i].pdispVal;
+//                            assert(HAS_BIT_STYLE(VariantArray[i].vt,VT_DISPATCH));
+ 
+                            // Get the IADs interface for the "member" of this group
+                            hr = pDispatch->QueryInterface(IID_IDirectoryObject,
+                                                           (VOID **) &pIDOCurrent ) ;
+ 
+                            if (SUCCEEDED(hr))
+                            {
+                                // Get the GUID for the current object
+                                hr = GetObjectGuid(pIDOCurrent,bstrGuidCurrent);
+ 
+                                if (FAILED(hr))
+                                    return hr;
+ 
+                                IADs * pIADsCurrent = NULL;
+ 
+                                // Retrieve the IADs Interface for the current object
+                                hr = pIDOCurrent->QueryInterface(IID_IADs,(void**)&pIADsCurrent);
+                                if (FAILED(hr))
+                                    return hr;
+ 
+                                // Get the ADsPath property for this member
+                                hr = pIADsCurrent->get_ADsPath(&bstrCurrentPath);
+ 
+                                if (SUCCEEDED(hr))
+                                {
+                                    if (bVerbose)
+                                        wprintf(L"Comparing:\n\n%s\nWITH:\n%s\n\n",bstrGuidCurrent,pwszMemberGUID);
+                                    
+                                    // Verify that the member of this group is Equal to passed.
+                                    if (_wcsicmp(bstrGuidCurrent,pwszMemberGUID)==0)
+                                    {
+                                        if (bVerbose)
+                                            wprintf(L"!!!!!Object:\n\n%s\n\nIs a member of\n\n%s\n\n",pwszMemberPath,bstrGuidCurrent);   
+ 
+                                        bRet = TRUE;
+                                        break;
+                                    }
+                                    else // Otherwise, bind to this and see if it is a group.
+                                    {    // If is it a group then the QI to IADsGroup succeeds
+                                        
+                                        IADsGroup * pIADsGroupAsMember = NULL;
+                                        
+                                        if (pwszUser)
+                                            hr = ADsOpenObject( bstrCurrentPath,
+                                                                pwszUser, 
+                                                                pwszPassword, 
+                                                                ADS_SECURE_AUTHENTICATION,
+                                                                IID_IADsGroup, 
+                                                                (void**) &pIADsGroupAsMember);
+                                        else
+                                            hr = ADsGetObject( bstrCurrentPath, IID_IADsGroup,(void **)&pIADsGroupAsMember);
+ 
+                                        // If bind was completed, then this is a group.
+                                        if (SUCCEEDED(hr))
+                                        {
+                                            // Recursively call this group to verify this group.
+                                            BOOL bRetRecurse;
+                                            bRetRecurse = RecursiveIsMember(pIADsGroupAsMember,pwszMemberGUID,pwszMemberPath,bVerbose,pwszUser ,pwszPassword );
+                                            
+                                            if (bRetRecurse)
+                                            {
+                                                bRet = TRUE;
+                                                break;
+                                            }
+                                            pIADsGroupAsMember->Release();
+                                            pIADsGroupAsMember = NULL;
+                                        }
+                                    }
+                                    SysFreeString(bstrCurrentPath);
+                                    bstrCurrentPath = NULL;
+ 
+                                    SysFreeString(bstrGuidCurrent);
+                                    bstrGuidCurrent = NULL;
+                                }
+                                // Release
+                                pIDOCurrent->Release();
+                                pIDOCurrent = NULL;
+                                if (pIADsCurrent)
+                                {
+                                    pIADsCurrent->Release();
+                                    pIADsCurrent = NULL;
+                                }
+                            }
+                         }
+                        // Clear the variant array.
+                        memset(VariantArray, 0, sizeof(VARIANT)*FETCH_NUM);
+                    }
+                    else
+                        fContinue = FALSE;
+                }
+                pEnumVariant->Release();
+                pEnumVariant = NULL;
+            }
+            pUnknown->Release();
+            pUnknown = NULL;
+        }
+        pADsMembers ->Release();
+        pADsMembers  = NULL;
+    }
+ 
+    // Free the group path if retrieved.
+    if (bsGroupPath)
+    {
+        SysFreeString(bsGroupPath);
+        bsGroupPath = NULL;
+    }
+    return bRet;
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/*  GetObjectGuid()    - Retrieves the GUID, in string form, from the passed Directory Object.
+                         Returns S_OK on success.
+ 
+    Parameters
+ 
+        IDirectoryObject *  pDO     -   Directory Object from where GUID is retrieved.
+        BSTR             &  bsGuid  -   Returned GUID            
+*/
+ 
+HRESULT GetObjectGuid(IDirectoryObject * pDO,BSTR &bsGuid)
+{
+ 
+    GUID *pObjectGUID   = NULL;
+    PADS_ATTR_INFO      pAttributeEntries;
+    LPWSTR              pAttributeName = L"objectGUID";  // Get the GUID for the object.
+    DWORD               dwAttributesReturned = 0;
+    HRESULT             hr;
+
+    if(!pDO)
+    {
+        return E_FAIL;
+    }
+
+    hr = pDO->GetObjectAttributes(  &pAttributeName, // objectGUID
+                                    1, //Only objectGUID
+                                    &pAttributeEntries, // Returned attributes
+                                    &dwAttributesReturned // Number of attributes returned
+                                    );
+ 
+    if (SUCCEEDED(hr) && dwAttributesReturned>0)
+    {
+        // Be sure the right type was retrieved--objectGUID is ADSTYPE_OCTET_STRING
+        if (pAttributeEntries->dwADsType == ADSTYPE_OCTET_STRING)
+        {
+            // Get COM converted string version of the GUID
+            // lpvalue should be LPBYTE. Should be able to cast it to ptr to GUID.
+            pObjectGUID = (GUID*)(pAttributeEntries->pADsValues[0].OctetString.lpValue);
+            
+            // OLE str to fit a GUID
+            
+            LPOLESTR szGUID = new WCHAR [64];
+            szGUID[0]=NULL;
+            // Convert GUID to string.
+            ::StringFromGUID2(*pObjectGUID, szGUID, 39); 
+            bsGuid = SysAllocString(szGUID);
+            
+            delete [] szGUID;
+         }
+    }
+ 
+    return hr;
+ 
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/*  PrintBanner()   -       Prints a banner to the screen
+ 
+    Parameters
+ 
+                LPOLESTR pwszBanner   - String to print
+*/
+void PrintBanner(LPOLESTR pwszBanner)
+{
+    _putws(L"");
+    _putws(L"////////////////////////////////////////////////////");
+    wprintf(L"\t");
+    _putws(pwszBanner);
+    _putws(L"////////////////////////////////////////////////////\n");
+}
\ No newline at end of file
diff --git a/ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.h b/ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.h
new file mode 100644
index 0000000..22e251c
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.h
@@ -0,0 +1,57 @@
+
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the AUTH_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// AUTH_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef LDAPAUTH9X_EXPORTS
+#define LDAPAUTH9X_API __declspec(dllexport)
+#else
+#define LDAPAUTH9X_API __declspec(dllimport)
+#endif
+
+#include <windows.h>
+#include <stdio.h>
+#include <tchar.h>
+#include <wchar.h>
+#include <math.h>
+#include <objbase.h>
+#include <activeds.h>
+#include <Dsgetdc.h>
+#include <sddl.h>
+#include <assert.h>
+
+
+#define MAXLEN 256
+//#define MAX_PREFERRED_LENGTH    ((DWORD) -1)
+//#define NERR_Success            0
+//#define LG_INCLUDE_INDIRECT 1
+#define BUFSIZE 1024
+
+#define FETCH_NUM 100
+void PrintBanner(LPOLESTR pwszBanner);
+HRESULT GetObjectGuid(IDirectoryObject * pDO,BSTR &bsGuid);
+BOOL RecursiveIsMember(IADsGroup * pADsGroup,LPWSTR pwszMemberGUID,LPWSTR pwszMemberPath, 
+                                             BOOL bVerbose, LPOLESTR  pwszUser, LPOLESTR pwszPassword);
+
+HRESULT FindGroup(IDirectorySearch *pSearchBase, //Container to search
+                                           LPOLESTR szFindUser, LPOLESTR  pwszUser, LPOLESTR pwszPassword, //Name of user to find.
+                                           IADs **ppUser,LPOLESTR szGroup); //Return a pointer to the user
+
+
+
+HRESULT FindUserByName(IDirectorySearch *pSearchBase, //Container to search
+                                           LPOLESTR szFindUser, LPOLESTR  pwszUser, LPOLESTR pwszPassword, //Name of user to find.
+                                           IADs **ppUser); //Return a pointer to the user
+
+
+BSTR gbsGroup     = NULL; // <Group to check> This is the LDAP path for the group to check
+	BSTR gbsMember    = NULL; // <Member to check> 
+	BSTR gbsUSER      = NULL;
+	BSTR gbsPASS      = NULL; // <Password used for binding to the DC>
+
+
+
+LDAPAUTH9X_API BOOL CUGP(char * userin,char *password,char *machine,char *group,int locdom);
+
diff --git a/ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.rc b/ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.rc
new file mode 100644
index 0000000..3ede046
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth9x/ldapAuth9x.rc
@@ -0,0 +1,112 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+// Defines STR_COMPANYNAME, STR_FILEVERSION, STR_PRODUCTVERSION, STR_COPYRIGHT,
+// STR_SPECIALBUILD, FILEVERSION, PRODUCTVERSION
+#include "../../versioninfo.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION INT_FILEVERSION
+ PRODUCTVERSION INT_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+            VALUE "Comments", "Active Directory authentication for UltraVNC on Win9x\0"
+            VALUE "CompanyName", STR_COMPANYNAME
+            VALUE "FileDescription", "MS-Logon I for UltraVNC\0"
+            VALUE "FileVersion", STR_FILEVERSION
+            VALUE "InternalName", "ldapAuth9x\0"
+            VALUE "LegalCopyright", STR_COPYRIGHT
+            VALUE "OriginalFilename", "ldapAuth9x.dll\0"
+            VALUE "ProductName", "UltraVNC ldapAuth9x\0"
+            VALUE "ProductVersion", STR_PRODUCTVERSION
+#if isRC == 1
+			VALUE "SpecialBuild", STR_SPECIALBUILD
+#endif
+			END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/addon/ms-logon/ldapauth9x/ldapauth9x.def b/ica/win32/addon/ms-logon/ldapauth9x/ldapauth9x.def
new file mode 100644
index 0000000..170b08b
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth9x/ldapauth9x.def
@@ -0,0 +1,5 @@
+LIBRARY   LDAPAuth9x
+
+             EXPORTS
+               CUGP
+			   
diff --git a/ica/win32/addon/ms-logon/ldapauth9x/resource.h b/ica/win32/addon/ms-logon/ldapauth9x/resource.h
new file mode 100644
index 0000000..decb8f5
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauth9x/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by authSSP.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.cpp b/ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.cpp
new file mode 100644
index 0000000..48c6f96
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.cpp
@@ -0,0 +1,656 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+// /macine-vnc Greg Wood (wood at agressiv.com)
+
+
+#include "ldapauthnt4.h"
+
+/////////////////////////
+
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+					 )
+{
+    switch (ul_reason_for_call)
+	{
+		case DLL_PROCESS_ATTACH:
+		case DLL_THREAD_ATTACH:
+		case DLL_THREAD_DETACH:
+		case DLL_PROCESS_DETACH:
+			break;
+    }
+    return TRUE;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////// 
+
+
+
+LDAPAUTHNT4_API
+BOOL CUGP(char * userin,char *password,char *machine,char *groupin,int locdom)
+{
+
+	{
+	//Handle the command line arguments.
+	LPOLESTR pszBuffer = new OLECHAR[MAX_PATH*2];
+	LPOLESTR pszBuffer2 = new OLECHAR[MAX_PATH*2];
+	LPOLESTR pszBuffer3 = new OLECHAR[MAX_PATH*2];
+	LPOLESTR pszBuffer4 = new OLECHAR[MAX_PATH*2];
+	mbstowcs( (wchar_t *) pszBuffer, userin, MAX_PATH );
+	mbstowcs( (wchar_t *) pszBuffer2, password, MAX_PATH );
+	mbstowcs( (wchar_t *) pszBuffer3, machine, MAX_PATH );
+	mbstowcs( (wchar_t *) pszBuffer4, groupin, MAX_PATH );
+	HRESULT hr = S_OK;
+	//Get rootDSE and the domain container's DN.
+	IADs *pObject = NULL;
+	IADs *pObjectUser = NULL;
+	IADs *pObjectGroup = NULL;
+	IDirectorySearch *pDS = NULL;
+	LPOLESTR szPath = new OLECHAR[MAX_PATH];
+	LPOLESTR myPath = new OLECHAR[MAX_PATH];
+	VARIANT var;
+	////////////FIND SERVER NEEDED FOR NT4
+	DWORD dwRet;
+	PDOMAIN_CONTROLLER_INFO pdci;
+	dwRet = DsGetDcName(NULL, NULL, NULL, NULL	, DS_PDC_REQUIRED, &pdci);
+	if (ERROR_SUCCESS!=dwRet) 
+		{
+			wprintf(L"PDC not found try a rediscover \n");
+			dwRet = DsGetDcName(NULL, NULL, NULL, NULL	, DS_DIRECTORY_SERVICE_REQUIRED|DS_FORCE_REDISCOVERY, &pdci);
+			if (ERROR_SUCCESS!=dwRet)
+			{
+				wprintf(L"PDC not found \n");
+				delete [] pszBuffer;
+				delete [] pszBuffer2;
+				delete [] pszBuffer3;
+				delete [] pszBuffer4;
+				delete [] szPath;
+				delete [] myPath;
+				return false;
+			}
+		}
+	//////////////////////////////////////////
+	wcscpy(szPath,L"LDAP://");
+	wcscat(szPath,pdci->DomainControllerName+2);
+	wcscat(szPath,L"/rootDSE");
+	wprintf(szPath);
+	wprintf(L"\n");
+
+	hr = ADsOpenObject(szPath,
+					pszBuffer,
+					pszBuffer2,
+					ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
+					IID_IADs,
+					(void**)&pObject);
+	if (FAILED(hr))
+		{
+			bool result=false;
+			delete [] pszBuffer;
+			delete [] pszBuffer2;
+			delete [] pszBuffer3;
+			delete [] pszBuffer4;
+			delete [] szPath;
+			delete [] myPath;
+			return result;
+		}
+	hr = pObject->Get(L"defaultNamingContext",&var);
+
+	if (SUCCEEDED(hr))
+		{
+			wcscpy(szPath,L"LDAP://");
+			wcscat(szPath,pdci->DomainControllerName+2);
+			wcscat(szPath,L"/");
+			wcscat(szPath,var.bstrVal);
+			VariantClear(&var);
+			if (pObject)
+				{
+					pObject->Release();
+					pObject = NULL;
+				}
+			wprintf( szPath);
+			wprintf(L"\n");
+			//Bind to the root of the current domain.
+			hr = ADsOpenObject(szPath,pszBuffer,pszBuffer2,
+					 ADS_SECURE_AUTHENTICATION,IID_IDirectorySearch,(void**)&pDS);
+			if (SUCCEEDED(hr))
+				{
+					if (SUCCEEDED(hr))
+						{
+							hr =  FindUserByName(pDS, pszBuffer, &pObjectUser );
+							if (FAILED(hr))
+								{
+									delete [] pszBuffer;
+									delete [] pszBuffer2;
+									delete [] pszBuffer3;
+									delete [] pszBuffer4;
+									delete [] szPath;
+									delete [] myPath;
+									if (pDS) pDS->Release();
+									if (pObjectUser) pObjectUser->Release();
+									return false;
+								}
+							if (pObjectUser) pObjectUser->Release();
+							///////////////////// VNCACCESS
+							hr =  FindGroup(pDS, pszBuffer, &pObjectGroup,pszBuffer4);
+							if (pObjectGroup)
+										{
+											pObjectGroup->Release();
+											pObjectGroup = NULL;
+										}
+							if (SUCCEEDED(hr))
+								{
+									wprintf(L"FindGroup OK\n");
+									IADsGroup *     pIADsG;
+									hr = ADsOpenObject( gbsGroup,pszBuffer, pszBuffer2, 
+											ADS_SECURE_AUTHENTICATION,IID_IADsGroup, (void**) &pIADsG);
+									if (SUCCEEDED(hr))
+										{
+											VARIANT_BOOL bMember = FALSE;  
+											hr = pIADsG->IsMember(gbsMember,&bMember);
+											if (SUCCEEDED(hr))
+												{
+													if (bMember == -1)
+														{
+															wprintf(L"Object \n\n%s\n\n IS a member of the following Group:\n\n%s\n\n",gbsMember,gbsGroup);
+															delete [] pszBuffer;
+															delete [] pszBuffer2;
+															delete [] pszBuffer3;
+															delete [] pszBuffer4;
+															delete [] szPath;
+															delete [] myPath;
+															if (pDS) pDS->Release();
+															return true;
+														}
+													else
+														{
+															BSTR bsMemberGUID = NULL;
+															IDirectoryObject * pDOMember = NULL;
+															hr = ADsOpenObject( gbsMember,pszBuffer, pszBuffer2, 
+																	ADS_SECURE_AUTHENTICATION,IID_IDirectoryObject, (void**) &pDOMember);
+															if (SUCCEEDED(hr))
+																{
+																	hr = GetObjectGuid(pDOMember,bsMemberGUID);
+																	pDOMember->Release();
+																	pDOMember  = NULL;
+																	if (RecursiveIsMember(pIADsG,bsMemberGUID,gbsMember,true, pszBuffer, pszBuffer2))
+																		{
+																			delete [] pszBuffer;
+																			delete [] pszBuffer2;
+																			delete [] pszBuffer3;
+																			delete [] pszBuffer4;
+																			delete [] szPath;
+																			delete [] myPath;
+																			if (pDS) pDS->Release();
+																			return true;
+																		}
+																}
+													}//else bmember
+											}//ismember
+									}//iadsgroup 
+							}//Findgroup
+							
+						}//user
+				}
+		if (pDS) pDS->Release();
+		}
+	delete [] pszBuffer;
+	delete [] pszBuffer2;
+	delete [] pszBuffer3;
+	delete [] pszBuffer4;
+	delete [] szPath;
+	delete [] myPath;
+	return false;
+	}
+	return false;
+}
+
+HRESULT FindUserByName(IDirectorySearch *pSearchBase, //Container to search
+					   LPOLESTR szFindUser, //Name of user to find.
+					   IADs **ppUser) //Return a pointer to the user
+{
+    HRESULT hrObj = E_FAIL;
+    HRESULT hr = E_FAIL;
+	if ((!pSearchBase)||(!szFindUser))
+		return E_INVALIDARG;
+	//Create search filter
+	LPOLESTR pszSearchFilter = new OLECHAR[MAX_PATH];
+	LPOLESTR szADsPath = new OLECHAR[MAX_PATH];
+	wcscpy(pszSearchFilter, L"(&(objectCategory=person)(objectClass=user)(samAccountName=");
+	wcscat(pszSearchFilter, szFindUser);
+	wcscat(pszSearchFilter,	L"))");
+    //Search entire subtree from root.
+	ADS_SEARCHPREF_INFO SearchPrefs;
+	SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
+	SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
+	SearchPrefs.vValue.Integer = ADS_SCOPE_SUBTREE;
+    DWORD dwNumPrefs = 1;
+	// COL for iterations
+    ADS_SEARCH_COLUMN col;
+    // Handle used for searching
+    ADS_SEARCH_HANDLE hSearch;
+	// Set the search preference
+    hr = pSearchBase->SetSearchPreference( &SearchPrefs, dwNumPrefs);
+    if (FAILED(hr))
+        return hr;
+	// Set attributes to return
+	CONST DWORD dwAttrNameSize = 1;
+    LPOLESTR pszAttribute[dwAttrNameSize] = {L"ADsPath"};
+
+    // Execute the search
+    hr = pSearchBase->ExecuteSearch(pszSearchFilter,
+		                          pszAttribute,
+								  dwAttrNameSize,
+								  &hSearch
+								  );
+	if (SUCCEEDED(hr))
+	{    
+
+    // Call IDirectorySearch::GetNextRow() to retrieve the next row 
+    //of data
+        while( pSearchBase->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
+		{
+            // loop through the array of passed column names,
+            // print the data for each column
+            for (DWORD x = 0; x < dwAttrNameSize; x++)
+            {
+			    // Get the data for this column
+                hr = pSearchBase->GetColumn( hSearch, pszAttribute[x], &col );
+			    if ( SUCCEEDED(hr) )
+			    {
+				    // Print the data for the column and free the column
+					// Note the attribute we asked for is type CaseIgnoreString.
+                    wcscpy(szADsPath, col.pADsValues->CaseIgnoreString); 
+					hr = ADsOpenObject(szADsPath,
+									 NULL,
+									 NULL,
+									 ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
+									 IID_IADs,
+									 (void**)ppUser);
+					if (SUCCEEDED(hr))
+					{ 
+                       wprintf(L"%s: %s\r\n",pszAttribute[x],col.pADsValues->CaseIgnoreString); 
+					   hrObj = S_OK;
+					   gbsMember=SysAllocString(col.pADsValues->CaseIgnoreString);
+					}
+				    pSearchBase->FreeColumn( &col );
+			    }
+			    else
+				    hr = E_FAIL;
+            }
+		}
+		// Close the search handle to clean up
+        pSearchBase->CloseSearchHandle(hSearch);
+	}
+	if (FAILED(hrObj))
+		hr = hrObj;
+    return hr;
+}
+
+HRESULT FindGroup(IDirectorySearch *pSearchBase, //Container to search
+					   LPOLESTR szFindUser, //Name of user to find.
+					   IADs **ppUser,LPOLESTR szGroup) //Return a pointer to the user
+{
+    HRESULT hrObj = E_FAIL;
+    HRESULT hr = E_FAIL;
+	if ((!pSearchBase)||(!szFindUser))
+		return E_INVALIDARG;
+	//Create search filter
+	LPOLESTR pszSearchFilter = new OLECHAR[MAX_PATH];
+	LPOLESTR szADsPath = new OLECHAR[MAX_PATH];
+	wcscpy(pszSearchFilter, L"(&(objectClass=group)(cn=");
+	wcscat(pszSearchFilter,	szGroup);
+	wcscat(pszSearchFilter,	L"))");
+    //Search entire subtree from root.
+	ADS_SEARCHPREF_INFO SearchPrefs;
+	SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
+	SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
+	SearchPrefs.vValue.Integer = ADS_SCOPE_SUBTREE;
+    DWORD dwNumPrefs = 1;
+	// COL for iterations
+    ADS_SEARCH_COLUMN col;
+    // Handle used for searching
+    ADS_SEARCH_HANDLE hSearch;
+	// Set the search preference
+    hr = pSearchBase->SetSearchPreference( &SearchPrefs, dwNumPrefs);
+    if (FAILED(hr))
+        return hr;
+	// Set attributes to return
+	CONST DWORD dwAttrNameSize = 1;
+    LPOLESTR pszAttribute[dwAttrNameSize] = {L"ADsPath"};
+
+    // Execute the search
+    hr = pSearchBase->ExecuteSearch(pszSearchFilter,
+		                          pszAttribute,
+								  dwAttrNameSize,
+								  &hSearch
+								  );
+	if (SUCCEEDED(hr))
+	{    
+
+    // Call IDirectorySearch::GetNextRow() to retrieve the next row 
+    //of data
+        while( pSearchBase->GetNextRow( hSearch) != S_ADS_NOMORE_ROWS )
+		{
+            // loop through the array of passed column names,
+            // print the data for each column
+            for (DWORD x = 0; x < dwAttrNameSize; x++)
+            {
+			    // Get the data for this column
+                hr = pSearchBase->GetColumn( hSearch, pszAttribute[x], &col );
+			    if ( SUCCEEDED(hr) )
+			    {
+				    // Print the data for the column and free the column
+					// Note the attribute we asked for is type CaseIgnoreString.
+                    wcscpy(szADsPath, col.pADsValues->CaseIgnoreString); 
+					hr = ADsOpenObject(szADsPath,
+									 NULL,
+									 NULL,
+									 ADS_SECURE_AUTHENTICATION, //Use Secure Authentication
+									 IID_IADs,
+									 (void**)ppUser);
+					if (SUCCEEDED(hr))
+					{ 
+                       wprintf(L"%s: %s\r\n",pszAttribute[x],col.pADsValues->CaseIgnoreString); 
+					   hrObj = S_OK;
+					   gbsGroup=SysAllocString(col.pADsValues->CaseIgnoreString);
+					}
+				    pSearchBase->FreeColumn( &col );
+			    }
+			    else
+				    hr = E_FAIL;
+            }
+		}
+		// Close the search handle to clean up
+        pSearchBase->CloseSearchHandle(hSearch);
+	}
+	if (FAILED(hrObj))
+		hr = hrObj;
+    return hr;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/*  RecursiveIsMember()                       - Recursively scans the members of passed IADsGroup ptr
+                                                and any groups that belong to the passed ptr- for membership
+                                                of Passed group.
+                                                Will return a TRUE if the member is found in the passed group,
+                                                or if the passed member is a member of any group which is a member
+                                                of the passed group.
+    Parameters
+ 
+        IADsGroup *     pADsGroup       - Group from which to verify members.
+        LPWSTR          pwszMember      - LDAP path for object to verify membership.
+        BOOL            bVerbose        - IF TRUE, will output verbose information for the scan.
+ 
+    OPTIONAL Parameters
+ 
+       LPOLESTR  pwszUser           - User Name and Password, if the parameters are not passed, 
+       LPOLESTER pwszPassword       - binding will use ADsGetObject; if the parameters are
+                                    - specified, ADsOpenObject is used, passing user name and password.
+*/
+ 
+BOOL RecursiveIsMember(IADsGroup * pADsGroup,LPWSTR pwszMemberGUID,LPWSTR pwszMemberPath, 
+                                             BOOL bVerbose, LPOLESTR  pwszUser, LPOLESTR pwszPassword)
+{
+    HRESULT         hr                = S_OK;     // COM Result Code
+    IADsMembers *   pADsMembers       = NULL;     // Ptr to Members of the IADsGroup
+    BOOL            fContinue         = TRUE;     // Looping Variable
+    IEnumVARIANT *  pEnumVariant      = NULL;     // Ptr to the Enum variant
+    IUnknown *      pUnknown          = NULL;     // IUnknown for getting the ENUM initially
+    VARIANT         VariantArray[FETCH_NUM];      // Variant array for temp holding returned data
+    ULONG           ulElementsFetched = NULL;     // Number of elements retrieved
+    BSTR            bsGroupPath       = NULL;
+    BOOL            bRet              = FALSE;
+
+    if(!pADsGroup || !pwszMemberGUID || !pwszMemberPath)
+    {
+        return FALSE;
+    }
+ 
+    // Get the path of the object passed in
+    hr = pADsGroup->get_ADsPath(&bsGroupPath);
+ 
+    if (!SUCCEEDED(hr))
+        return hr;
+ 
+    if (bVerbose)
+    {
+        WCHAR pwszOutput[2048];
+        wsprintf(pwszOutput,L"Checking the Group:\n\n%s\n\n for the member:\n\n%s\n\n",bsGroupPath,pwszMemberPath);
+        PrintBanner(pwszOutput);
+    }
+ 
+    // Get an interface pointer to the IADsCollection of members
+    hr = pADsGroup->Members(&pADsMembers);
+ 
+    if (SUCCEEDED(hr))
+    {
+        // Query the IADsCollection of members for a new ENUM Interface
+        // Be aware that the enum comes back as an IUnknown *
+        hr = pADsMembers->get__NewEnum(&pUnknown);
+ 
+        if (SUCCEEDED(hr))
+        {
+            // QI the IUnknown * for an IEnumVARIANT interface
+            hr = pUnknown->QueryInterface(IID_IEnumVARIANT, (void **)&pEnumVariant);
+ 
+            if (SUCCEEDED(hr))
+            {
+                // While have not hit errors or end of data....
+                while (fContinue) 
+                {
+                   ulElementsFetched = 0;
+                    // Get a "batch" number of group members-number of rows specified by FETCH_NUM
+                    hr = ADsEnumerateNext(pEnumVariant, FETCH_NUM, VariantArray, &ulElementsFetched);
+ 
+                    if (ulElementsFetched )
+                    {
+                        // Loop through the current batch-printing the path for each member.
+                        for (ULONG i = 0; i < ulElementsFetched; i++ ) 
+                        {
+                            IDispatch * pDispatch         = NULL; // ptr for holding dispath of element
+                            BSTR        bstrCurrentPath   = NULL; // Holds path of object
+                            BSTR        bstrGuidCurrent   = NULL; // Holds path of object
+                            IDirectoryObject * pIDOCurrent = NULL;// Holds the current object          
+ 
+                            // Get the dispatch ptr for the variant
+                            pDispatch = VariantArray[i].pdispVal;
+//                            assert(HAS_BIT_STYLE(VariantArray[i].vt,VT_DISPATCH));
+ 
+                            // Get the IADs interface for the "member" of this group
+                            hr = pDispatch->QueryInterface(IID_IDirectoryObject,
+                                                           (VOID **) &pIDOCurrent ) ;
+ 
+                            if (SUCCEEDED(hr))
+                            {
+                                // Get the GUID for the current object
+                                hr = GetObjectGuid(pIDOCurrent,bstrGuidCurrent);
+ 
+                                if (FAILED(hr))
+                                    return hr;
+ 
+                                IADs * pIADsCurrent = NULL;
+ 
+                                // Retrieve the IADs Interface for the current object
+                                hr = pIDOCurrent->QueryInterface(IID_IADs,(void**)&pIADsCurrent);
+                                if (FAILED(hr))
+                                    return hr;
+ 
+                                // Get the ADsPath property for this member
+                                hr = pIADsCurrent->get_ADsPath(&bstrCurrentPath);
+ 
+                                if (SUCCEEDED(hr))
+                                {
+                                    if (bVerbose)
+                                        wprintf(L"Comparing:\n\n%s\nWITH:\n%s\n\n",bstrGuidCurrent,pwszMemberGUID);
+                                    
+                                    // Verify that the member of this group is Equal to passed.
+                                    if (_wcsicmp(bstrGuidCurrent,pwszMemberGUID)==0)
+                                    {
+                                        if (bVerbose)
+                                            wprintf(L"!!!!!Object:\n\n%s\n\nIs a member of\n\n%s\n\n",pwszMemberPath,bstrGuidCurrent);   
+ 
+                                        bRet = TRUE;
+                                        break;
+                                    }
+                                    else // Otherwise, bind to this and see if it is a group.
+                                    {    // If is it a group then the QI to IADsGroup succeeds
+                                        
+                                        IADsGroup * pIADsGroupAsMember = NULL;
+                                        
+                                        if (pwszUser)
+                                            hr = ADsOpenObject( bstrCurrentPath,
+                                                                pwszUser, 
+                                                                pwszPassword, 
+                                                                ADS_SECURE_AUTHENTICATION,
+                                                                IID_IADsGroup, 
+                                                                (void**) &pIADsGroupAsMember);
+                                        else
+                                            hr = ADsGetObject( bstrCurrentPath, IID_IADsGroup,(void **)&pIADsGroupAsMember);
+ 
+                                        // If bind was completed, then this is a group.
+                                        if (SUCCEEDED(hr))
+                                        {
+                                            // Recursively call this group to verify this group.
+                                            BOOL bRetRecurse;
+                                            bRetRecurse = RecursiveIsMember(pIADsGroupAsMember,pwszMemberGUID,pwszMemberPath,bVerbose,pwszUser ,pwszPassword );
+                                            
+                                            if (bRetRecurse)
+                                            {
+                                                bRet = TRUE;
+                                                break;
+                                            }
+                                            pIADsGroupAsMember->Release();
+                                            pIADsGroupAsMember = NULL;
+                                        }
+                                    }
+                                    SysFreeString(bstrCurrentPath);
+                                    bstrCurrentPath = NULL;
+ 
+                                    SysFreeString(bstrGuidCurrent);
+                                    bstrGuidCurrent = NULL;
+                                }
+                                // Release
+                                pIDOCurrent->Release();
+                                pIDOCurrent = NULL;
+                                if (pIADsCurrent)
+                                {
+                                    pIADsCurrent->Release();
+                                    pIADsCurrent = NULL;
+                                }
+                            }
+                         }
+                        // Clear the variant array.
+                        memset(VariantArray, 0, sizeof(VARIANT)*FETCH_NUM);
+                    }
+                    else
+                        fContinue = FALSE;
+                }
+                pEnumVariant->Release();
+                pEnumVariant = NULL;
+            }
+            pUnknown->Release();
+            pUnknown = NULL;
+        }
+        pADsMembers ->Release();
+        pADsMembers  = NULL;
+    }
+ 
+    // Free the group path if retrieved.
+    if (bsGroupPath)
+    {
+        SysFreeString(bsGroupPath);
+        bsGroupPath = NULL;
+    }
+    return bRet;
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/*  GetObjectGuid()    - Retrieves the GUID, in string form, from the passed Directory Object.
+                         Returns S_OK on success.
+ 
+    Parameters
+ 
+        IDirectoryObject *  pDO     -   Directory Object from where GUID is retrieved.
+        BSTR             &  bsGuid  -   Returned GUID            
+*/
+ 
+HRESULT GetObjectGuid(IDirectoryObject * pDO,BSTR &bsGuid)
+{
+ 
+    GUID *pObjectGUID   = NULL;
+    PADS_ATTR_INFO      pAttributeEntries;
+    LPWSTR              pAttributeName = L"objectGUID";  // Get the GUID for the object.
+    DWORD               dwAttributesReturned = 0;
+    HRESULT             hr;
+
+    if(!pDO)
+    {
+        return E_FAIL;
+    }
+
+    hr = pDO->GetObjectAttributes(  &pAttributeName, // objectGUID
+                                    1, //Only objectGUID
+                                    &pAttributeEntries, // Returned attributes
+                                    &dwAttributesReturned // Number of attributes returned
+                                    );
+ 
+    if (SUCCEEDED(hr) && dwAttributesReturned>0)
+    {
+        // Be sure the right type was retrieved--objectGUID is ADSTYPE_OCTET_STRING
+        if (pAttributeEntries->dwADsType == ADSTYPE_OCTET_STRING)
+        {
+            // Get COM converted string version of the GUID
+            // lpvalue should be LPBYTE. Should be able to cast it to ptr to GUID.
+            pObjectGUID = (GUID*)(pAttributeEntries->pADsValues[0].OctetString.lpValue);
+            
+            // OLE str to fit a GUID
+            
+            LPOLESTR szGUID = new WCHAR [64];
+            szGUID[0]=NULL;
+            // Convert GUID to string.
+            ::StringFromGUID2(*pObjectGUID, szGUID, 39); 
+            bsGuid = SysAllocString(szGUID);
+            
+            delete [] szGUID;
+         }
+    }
+ 
+    return hr;
+ 
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////
+/*  PrintBanner()   -       Prints a banner to the screen
+ 
+    Parameters
+ 
+                LPOLESTR pwszBanner   - String to print
+*/
+void PrintBanner(LPOLESTR pwszBanner)
+{
+    _putws(L"");
+    _putws(L"////////////////////////////////////////////////////");
+    wprintf(L"\t");
+    _putws(pwszBanner);
+    _putws(L"////////////////////////////////////////////////////\n");
+}
diff --git a/ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.h b/ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.h
new file mode 100644
index 0000000..a8eca66
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.h
@@ -0,0 +1,55 @@
+
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the AUTH_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// AUTH_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef LDAPAUTHNT4_EXPORTS
+#define LDAPAUTHNT4_API __declspec(dllexport)
+#else
+#define LDAPAUTHNT4_API __declspec(dllimport)
+#endif
+
+#include <windows.h>
+#include <stdio.h>
+#include <tchar.h>
+#include <wchar.h>
+#include <math.h>
+#include <objbase.h>
+#include <activeds.h>
+#include <Dsgetdc.h>
+#include <sddl.h>
+#include <assert.h>
+
+
+#define MAXLEN 256
+//#define MAX_PREFERRED_LENGTH    ((DWORD) -1)
+//#define NERR_Success            0
+//#define LG_INCLUDE_INDIRECT 1
+#define BUFSIZE 1024
+
+#define FETCH_NUM 100
+void PrintBanner(LPOLESTR pwszBanner);
+HRESULT GetObjectGuid(IDirectoryObject * pDO,BSTR &bsGuid);
+BOOL RecursiveIsMember(IADsGroup * pADsGroup,LPWSTR pwszMemberGUID,LPWSTR pwszMemberPath, 
+                                             BOOL bVerbose, LPOLESTR  pwszUser, LPOLESTR pwszPassword);
+
+HRESULT FindUserByName(IDirectorySearch *pSearchBase, //Container to search
+					   LPOLESTR szFindUser, //Name of user to find.
+					   IADs **ppUser); //Return a pointer to the user
+
+
+HRESULT FindGroup(IDirectorySearch *pSearchBase, //Container to search
+					   LPOLESTR szFindUser, //Name of user to find.
+					   IADs **ppUser,LPOLESTR szGroup); //Return a pointer to the user
+
+BSTR gbsGroup     = NULL; // <Group to check> This is the LDAP path for the group to check
+	BSTR gbsMember    = NULL; // <Member to check> 
+	BSTR gbsUSER      = NULL;
+	BSTR gbsPASS      = NULL; // <Password used for binding to the DC>
+
+
+
+LDAPAUTHNT4_API BOOL CUGP(char * userin,char *password,char *machine,char *group,int locdom);
+
diff --git a/ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.rc b/ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.rc
new file mode 100644
index 0000000..bcb37a5
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauthNT4/ldapAuthnt4.rc
@@ -0,0 +1,112 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+// Defines STR_COMPANYNAME, STR_FILEVERSION, STR_PRODUCTVERSION, STR_COPYRIGHT,
+// STR_SPECIALBUILD, FILEVERSION, PRODUCTVERSION
+#include "../../versioninfo.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION INT_FILEVERSION
+ PRODUCTVERSION INT_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+            VALUE "Comments", "Active Directory authentication for UltraVNC on WinNT4\0"
+            VALUE "CompanyName", STR_COMPANYNAME
+            VALUE "FileDescription", "MS-Logon I for UltraVNC\0"
+            VALUE "FileVersion", STR_FILEVERSION
+            VALUE "InternalName", "ldapAuthnt4\0"
+            VALUE "LegalCopyright", STR_COPYRIGHT
+            VALUE "OriginalFilename", "ldapAuthnt4.dll\0"
+            VALUE "ProductName", "UltraVNC ldapAuthnt4\0"
+            VALUE "ProductVersion", STR_PRODUCTVERSION
+#if isRC == 1
+			VALUE "SpecialBuild", STR_SPECIALBUILD
+#endif
+			END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/addon/ms-logon/ldapauthNT4/ldapauthnt4.def b/ica/win32/addon/ms-logon/ldapauthNT4/ldapauthnt4.def
new file mode 100644
index 0000000..3875c08
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauthNT4/ldapauthnt4.def
@@ -0,0 +1,5 @@
+LIBRARY   LDAPAuthnt4
+
+             EXPORTS
+               CUGP
+			   
diff --git a/ica/win32/addon/ms-logon/ldapauthNT4/ldapauthnt4.dsw b/ica/win32/addon/ms-logon/ldapauthNT4/ldapauthnt4.dsw
new file mode 100644
index 0000000..e990c2b
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauthNT4/ldapauthnt4.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "ldapauthnt4"=".\ldapauthnt4.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/addon/ms-logon/ldapauthNT4/resource.h b/ica/win32/addon/ms-logon/ldapauthNT4/resource.h
new file mode 100644
index 0000000..decb8f5
--- /dev/null
+++ b/ica/win32/addon/ms-logon/ldapauthNT4/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by authSSP.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/addon/ms-logon/logging/logging.cpp b/ica/win32/addon/ms-logon/logging/logging.cpp
new file mode 100644
index 0000000..006367b
--- /dev/null
+++ b/ica/win32/addon/ms-logon/logging/logging.cpp
@@ -0,0 +1,314 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+// /macine-vnc Greg Wood (wood at agressiv.com)
+#include "logging.h"
+
+/////////////////////////
+
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+					 )
+{
+    switch (ul_reason_for_call)
+	{
+		case DLL_PROCESS_ATTACH:
+		case DLL_THREAD_ATTACH:
+		case DLL_THREAD_DETACH:
+		case DLL_PROCESS_DETACH:
+			break;
+    }
+    return TRUE;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////// 
+
+//////////////////////////////////////////////////////////////////////
+
+EventLogging::EventLogging()
+{
+	// returns a handle that links the source to the registry 
+	m_hEventLinker = RegisterEventSource(NULL,"UltraVnc");
+
+}
+
+EventLogging::~EventLogging()
+{
+	// Releases the handle to the registry
+	DeregisterEventSource(m_hEventLinker);
+}
+
+
+
+void EventLogging::LogIt(WORD CategoryID, DWORD EventID, LPCTSTR *ArrayOfStrings,
+						 UINT NumOfArrayStr,LPVOID RawData,DWORD RawDataSize)
+{
+
+	// Writes data to the event log
+	ReportEvent(m_hEventLinker,EVENTLOG_INFORMATION_TYPE,CategoryID,
+		EventID,NULL,1,RawDataSize,ArrayOfStrings,RawData);	
+
+}
+
+
+void EventLogging::AddEventSourceToRegistry(LPCTSTR lpszSourceName)
+{
+    HKEY  hk;
+    DWORD dwData;
+    TCHAR szBuf[MAX_PATH];
+    TCHAR szKey[255] =_T("SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\");
+    TCHAR szServicePath[MAX_PATH];
+
+    lstrcat(szKey, _T("UltraVnc"));
+
+    if(RegCreateKey(HKEY_LOCAL_MACHINE, szKey, &hk) != ERROR_SUCCESS)
+    {
+        return;
+    }
+
+    if (GetModuleFileName(NULL, szServicePath, MAX_PATH))
+		{
+			char* p = strrchr(szServicePath, '\\');
+			if (p == NULL) return;
+			*p = '\0';
+			strcat (szServicePath,"\\logmessages.dll");
+		}
+	//printf(szServicePath);
+    lstrcpy(szBuf, szServicePath);
+
+    // Add the name to the EventMessageFile subkey.
+    if(RegSetValueEx(hk,
+                     _T("EventMessageFile"),
+                     0,
+                     REG_EXPAND_SZ,
+                     (LPBYTE) szBuf,
+                     (lstrlen(szBuf) + 1) * sizeof(TCHAR)) != ERROR_SUCCESS)
+    {
+        RegCloseKey(hk);
+        return;
+    }
+
+    dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE |EVENTLOG_INFORMATION_TYPE;
+    if(RegSetValueEx(hk,
+                     _T("TypesSupported"),
+                     0,
+                     REG_DWORD,
+                     (LPBYTE)&dwData,
+                     sizeof(DWORD)) != ERROR_SUCCESS)
+    {
+        
+    } RegCloseKey(hk);
+}
+
+
+
+/////////////////////////
+///////////////////////
+LOGGING_API
+void LOGEXIT(char *machine)
+{
+	    FILE *file;
+		const char* ps[3];
+		char texttowrite[512];
+		SYSTEMTIME time;
+		GetLocalTime(& time);
+		char			szText[256];
+		sprintf(szText,"%d/%d/%d %d:%.2d   ", time.wDay,time.wMonth,time.wYear,time.wHour,time.wMinute );
+		strcpy(texttowrite,szText);
+		strcat(texttowrite,"Client ");
+		strcat(texttowrite,machine);
+		strcat(texttowrite," disconnected");
+		strcat(texttowrite,"\n");
+		ps[0] = texttowrite;
+	    EventLogging log;
+		log.AddEventSourceToRegistry(NULL);
+		log.LogIt(1,0x00640003L, ps,1,NULL,0);
+
+		char szMslogonLog[MAX_PATH];
+		if (GetModuleFileName(NULL, szMslogonLog, MAX_PATH))
+		{
+			char* p = strrchr(szMslogonLog, '\\');
+			if (p != NULL)
+			{
+				*p = '\0';
+				strcat (szMslogonLog,"\\mslogon.log");
+			}
+		}
+		file = fopen(szMslogonLog, "a");
+		if(file!=NULL) 
+			{
+				fwrite( texttowrite, sizeof( char ), strlen(texttowrite),file);
+				fclose(file);
+			}
+}
+
+LOGGING_API
+void LOGLOGON(char *machine)
+{
+		FILE *file;
+		const char* ps[3];
+		char texttowrite[512];
+		SYSTEMTIME time;
+		GetLocalTime(& time);
+		char			szText[256];
+		sprintf(szText,"%d/%d/%d %d:%.2d   ", time.wDay,time.wMonth,time.wYear,time.wHour,time.wMinute );
+		strcpy(texttowrite,szText);
+		strcat(texttowrite,"Connection received from ");
+		strcat(texttowrite,machine);
+		strcat(texttowrite,"\n");
+		ps[0] = texttowrite;
+	    EventLogging log;
+		log.AddEventSourceToRegistry(NULL);
+		log.LogIt(1,0x00640001L, ps,1,NULL,0);
+		char szMslogonLog[MAX_PATH];
+		if (GetModuleFileName(NULL, szMslogonLog, MAX_PATH))
+		{
+			char* p = strrchr(szMslogonLog, '\\');
+			if (p != NULL)
+			{
+				*p = '\0';
+				strcat (szMslogonLog,"\\mslogon.log");
+			}
+		}
+		file = fopen(szMslogonLog, "a");
+		if(file!=NULL) 
+			{
+				fwrite( texttowrite, sizeof( char ), strlen(texttowrite),file);
+				fclose(file);
+			}
+}
+
+LOGGING_API
+void LOGFAILED(char *machine)
+{
+		FILE *file;
+		const char* ps[3];
+		char texttowrite[512];
+		SYSTEMTIME time;
+		GetLocalTime(& time);
+		char			szText[256];
+		sprintf(szText,"%d/%d/%d %d:%.2d   ", time.wDay,time.wMonth,time.wYear,time.wHour,time.wMinute );
+		strcpy(texttowrite,szText);
+		strcat(texttowrite,"Invalid attempt from client ");
+		strcat(texttowrite,machine);
+		strcat(texttowrite,"\n");
+		ps[0] = texttowrite;
+	    EventLogging log;
+		log.AddEventSourceToRegistry(NULL);
+		log.LogIt(1,0x00640002L, ps,1,NULL,0);
+		char szMslogonLog[MAX_PATH];
+		if (GetModuleFileName(NULL, szMslogonLog, MAX_PATH))
+		{
+			char* p = strrchr(szMslogonLog, '\\');
+			if (p != NULL)
+			{
+				*p = '\0';
+				strcat (szMslogonLog,"\\mslogon.log");
+			}
+		}
+		file = fopen(szMslogonLog, "a");
+		if(file!=NULL) 
+			{
+				fwrite( texttowrite, sizeof( char ), strlen(texttowrite),file);
+				fclose(file);
+			}
+}
+
+LOGGING_API
+void LOGLOGONUSER(char *machine,char *user)
+{
+		FILE *file;
+		const char* ps[3];
+		char texttowrite[512];
+		SYSTEMTIME time;
+		GetLocalTime(& time);
+		char			szText[256];
+		sprintf(szText,"%d/%d/%d %d:%.2d   ", time.wDay,time.wMonth,time.wYear,time.wHour,time.wMinute );
+		strcpy(texttowrite,szText);
+		strcat(texttowrite,"Connection received from ");
+		strcat(texttowrite,machine);
+		strcat(texttowrite," using ");
+		strcat(texttowrite,user);
+		strcat(texttowrite," account ");
+		strcat(texttowrite,"\n");
+		ps[0] = texttowrite;
+	    EventLogging log;
+		log.AddEventSourceToRegistry(NULL);
+		log.LogIt(1,0x00640001L, ps,1,NULL,0);
+		char szMslogonLog[MAX_PATH];
+		if (GetModuleFileName(NULL, szMslogonLog, MAX_PATH))
+		{
+			char* p = strrchr(szMslogonLog, '\\');
+			if (p != NULL)
+			{
+				*p = '\0';
+				strcat (szMslogonLog,"\\mslogon.log");
+			}
+		}
+		file = fopen(szMslogonLog, "a");
+		if(file!=NULL) 
+			{
+				fwrite( texttowrite, sizeof( char ), strlen(texttowrite),file);
+				fclose(file);
+			}
+}
+
+LOGGING_API
+void LOGFAILEDUSER(char *machine, char *user)
+{
+		FILE *file;
+		const char* ps[3];
+		char texttowrite[512];
+		SYSTEMTIME time;
+		GetLocalTime(& time);
+		char			szText[256];
+		sprintf(szText,"%d/%d/%d %d:%.2d   ", time.wDay,time.wMonth,time.wYear,time.wHour,time.wMinute );
+		strcpy(texttowrite,szText);
+		strcat(texttowrite,"Invalid attempt from client ");
+		strcat(texttowrite,machine);
+		strcat(texttowrite," using ");
+		strcat(texttowrite,user);
+		strcat(texttowrite," account ");
+		strcat(texttowrite,"\n");
+		ps[0] = texttowrite;
+	    EventLogging log;
+		log.AddEventSourceToRegistry(NULL);
+		log.LogIt(1,0x00640002L, ps,1,NULL,0);
+		char szMslogonLog[MAX_PATH];
+		if (GetModuleFileName(NULL, szMslogonLog, MAX_PATH))
+		{
+			char* p = strrchr(szMslogonLog, '\\');
+			if (p != NULL)
+			{
+				*p = '\0';
+				strcat (szMslogonLog,"\\mslogon.log");
+			}
+		}
+		file = fopen(szMslogonLog, "a");
+		if(file!=NULL) 
+			{
+				fwrite( texttowrite, sizeof( char ), strlen(texttowrite),file);
+				fclose(file);
+			}
+}
+
diff --git a/ica/win32/addon/ms-logon/logging/logging.def b/ica/win32/addon/ms-logon/logging/logging.def
new file mode 100644
index 0000000..8397053
--- /dev/null
+++ b/ica/win32/addon/ms-logon/logging/logging.def
@@ -0,0 +1,8 @@
+LIBRARY   Logging
+
+             EXPORTS
+			   LOGEXIT
+			   LOGLOGON
+			   LOGFAILED
+			   LOGLOGONUSER
+			   LOGFAILEDUSER
diff --git a/ica/win32/addon/ms-logon/logging/logging.dsw b/ica/win32/addon/ms-logon/logging/logging.dsw
new file mode 100644
index 0000000..fca3661
--- /dev/null
+++ b/ica/win32/addon/ms-logon/logging/logging.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "logging"=".\logging.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/addon/ms-logon/logging/logging.h b/ica/win32/addon/ms-logon/logging/logging.h
new file mode 100644
index 0000000..befd57c
--- /dev/null
+++ b/ica/win32/addon/ms-logon/logging/logging.h
@@ -0,0 +1,38 @@
+
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the AUTH_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// AUTH_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef LOGGING_EXPORTS
+#define LOGGING_API __declspec(dllexport)
+#else
+#define LOGGING_API __declspec(dllimport)
+#endif
+#if defined( UNICODE ) || defined( _UNICODE )
+#error Sorry -- please compile as an ANSI program.
+#endif
+#include <windows.h>
+#include <stdio.h>
+#include <lmcons.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <tchar.h>
+#include <lm.h>
+#include <stdio.h>
+#pragma hdrstop
+LOGGING_API void LOGEXIT(char *machine);
+
+class EventLogging
+{
+public:
+	EventLogging();
+	virtual ~EventLogging();
+	virtual void LogIt(WORD CategoryID, DWORD EventID, LPCTSTR *ArrayOfStrings,
+		UINT NumOfArrayStr = 0,LPVOID RawData = NULL,DWORD RawDataSize = 0);
+	HANDLE m_hEventLinker;
+	void AddEventSourceToRegistry(LPCTSTR lpszSourceName);
+
+};
+
diff --git a/ica/win32/addon/ms-logon/logging/logging.rc b/ica/win32/addon/ms-logon/logging/logging.rc
new file mode 100644
index 0000000..3dc9118
--- /dev/null
+++ b/ica/win32/addon/ms-logon/logging/logging.rc
@@ -0,0 +1,112 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+// Defines STR_COMPANYNAME, STR_FILEVERSION, STR_PRODUCTVERSION, STR_COPYRIGHT,
+// STR_SPECIALBUILD, FILEVERSION, PRODUCTVERSION
+#include "../../versioninfo.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION INT_FILEVERSION
+ PRODUCTVERSION INT_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+            VALUE "Comments", "Logging for UltraVNC MS-Logon\0"
+            VALUE "CompanyName", STR_COMPANYNAME
+            VALUE "FileDescription", "Logging for UltraVNC MS-Logon\0"
+            VALUE "FileVersion", STR_FILEVERSION
+            VALUE "InternalName", "logging\0"
+            VALUE "LegalCopyright", STR_COPYRIGHT
+            VALUE "OriginalFilename", "logging.dll\0"
+            VALUE "ProductName", "UltraVNC logging\0"
+            VALUE "ProductVersion", STR_PRODUCTVERSION
+#if isRC == 1
+			VALUE "SpecialBuild", STR_SPECIALBUILD
+#endif
+			END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/addon/ms-logon/logging/resource.h b/ica/win32/addon/ms-logon/logging/resource.h
new file mode 100644
index 0000000..decb8f5
--- /dev/null
+++ b/ica/win32/addon/ms-logon/logging/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by authSSP.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/addon/ms-logon/testauth/ntlogon.cpp b/ica/win32/addon/ms-logon/testauth/ntlogon.cpp
new file mode 100644
index 0000000..7cba6d7
--- /dev/null
+++ b/ica/win32/addon/ms-logon/testauth/ntlogon.cpp
@@ -0,0 +1,232 @@
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+typedef BOOL (*CheckUserGroupPasswordFn)( char * userin,char *password,char *machine,char *group,int lodom);
+CheckUserGroupPasswordFn CheckUserGroupPassword = 0;
+bool CheckAD()
+{
+	HMODULE hModule = LoadLibrary("Activeds.dll");
+	if (hModule)
+	{
+		FreeLibrary(hModule);
+		return true;
+	}
+	return false;
+}
+
+bool CheckNetapi95()
+{
+	HMODULE hModule = LoadLibrary("netapi32.dll");
+	if (hModule)
+	{
+		FreeLibrary(hModule);
+		return true;
+	}
+	return false;
+}
+
+bool CheckDsGetDcNameW()
+{
+	HMODULE hModule = LoadLibrary("netapi32.dll");
+	if (hModule)
+	{
+		FARPROC test=NULL;
+		test=GetProcAddress( hModule, "DsGetDcNameW" );
+		FreeLibrary(hModule);
+		if (test) return true;
+	}
+	return false;
+}
+
+bool CheckNetApiNT()
+{
+	HMODULE hModule = LoadLibrary("radmin32.dll");
+	if (hModule)
+	{
+		FreeLibrary(hModule);
+		return true;
+	}
+	return false;
+}
+
+int main(int argc, char* argv[])
+{
+	char pszBuffer[256];
+	char pszBuffer2[256];
+	char pszBuffer3[256];
+	char pszBuffer4[256];
+	int locdom;
+	if (argc<5) 
+	{
+		printf("Enter user name : ");
+		gets(pszBuffer);
+		printf("\nEnter password : ");
+		gets(pszBuffer2);
+		printf("\n");
+		printf("Enter group : ");
+		gets(pszBuffer3);
+		printf("\n");
+		printf("loc=1 dom=3 local+domain=3 : ");
+		gets(pszBuffer4);
+		printf("\n");
+	if (0==strcmp("", pszBuffer)) 
+	{
+		return 0;
+	}
+	if (0==strcmp("", pszBuffer2)) 
+	{
+		return 0;
+	}
+	if (0==strcmp("", pszBuffer3)) 
+	{
+		return 0;
+	}
+	if (0==strcmp("", pszBuffer4)) 
+	{
+		return 0;
+	}
+	}
+	else
+	{
+		strcpy(pszBuffer,argv[1]);
+		strcpy(pszBuffer2,argv[2]);
+		strcpy(pszBuffer3,argv[3]);
+		strcpy(pszBuffer4,argv[4]);
+	}
+	locdom=atoi(pszBuffer4);
+	if (!CheckNetapi95() && !CheckNetApiNT())
+	{
+		printf("Netapi not found,radmin32.dll is missing \n");
+	}
+
+	///////////////////////////////////////
+	////// BASIC LOCAL GROUPS
+	BOOL returnvalue;
+	{
+	returnvalue=false;
+	printf("\nTrying authlogonuser.dll \n");
+		printf("This only works on XP> \n");
+		printf("test is runnning as application and not a service \n");
+		printf("------------------------ \n");
+		printf("------------------------ \n");
+		HMODULE hModule = LoadLibrary("authlogonuser.dll");
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				HRESULT hr = CoInitialize(NULL);
+				returnvalue=CheckUserGroupPassword(pszBuffer,pszBuffer2,"test",pszBuffer3,locdom);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else printf("authlogonuser.dll not found");
+	if (returnvalue==1) printf("based on auth.dll user has access ");
+	else printf("based on authlogonuser.dll user has NO access ");
+	}
+	if (returnvalue==1) printf("\n-------------------------\n");
+	if (returnvalue==1) printf("For testing we cont, but access was already granted\n");
+	if (returnvalue==1) printf("-------------------------\n");
+
+	returnvalue=false;
+	printf("\nTrying auth.dll \n");
+		printf("------------------------ \n");
+		printf("------------------------ \n");
+		HMODULE hModule = LoadLibrary("auth.dll");
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				HRESULT hr = CoInitialize(NULL);
+				returnvalue=CheckUserGroupPassword(pszBuffer,pszBuffer2,"test",pszBuffer3,locdom);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else printf("auth.dll not found");
+	if (returnvalue==1) printf("based on auth.dll user has access ");
+	else printf("based on auth.dll user has NO access ");
+	if (returnvalue==1) printf("\n-------------------------\n");
+	if (returnvalue==1) printf("For testing we cont, but access was already granted\n");
+	if (returnvalue==1) printf("-------------------------\n");
+	returnvalue=false;
+	if (CheckAD())
+	{
+		printf("\nTrying authaddll \n");
+		printf("------------------------ \n");
+		printf("------------------------ \n");
+		HMODULE hModule = LoadLibrary("authad.dll");
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				HRESULT hr = CoInitialize(NULL);
+				returnvalue=CheckUserGroupPassword(pszBuffer,pszBuffer2,"test",pszBuffer3,locdom);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else printf("authad.dll not found");
+		if (returnvalue==1) printf("based on authad.dll user has access ");
+		else printf("based on authad.dll user has NO access ");
+
+	}
+	if (returnvalue==1) printf("\n-------------------------\n");
+	if (returnvalue==1) printf("For testing we cont, but access was already granted\n");
+	if (returnvalue==1) printf("-------------------------\n");
+	if (locdom==2 || locdom==3)
+	{
+	returnvalue=false;
+	OSVERSIONINFO VerInfo;
+	VerInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+	if (!GetVersionEx (&VerInfo))   // If this fails, something has gone wrong
+	{
+		  return FALSE;
+	}
+	if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && VerInfo.dwMajorVersion == 4)
+	{
+		if (CheckAD() && CheckDsGetDcNameW())
+		{
+			printf("\nTrying ldapauthNT4 .dll \n");
+		printf("------------------------ \n");
+		printf("------------------------ \n");
+		HMODULE hModule = LoadLibrary("ldapauthnt4.dll");
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				HRESULT hr = CoInitialize(NULL);
+				returnvalue=CheckUserGroupPassword(pszBuffer,pszBuffer2,"test",pszBuffer3,locdom);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else printf("ldapauthnt4.dll not found");
+		if (returnvalue==1) printf("based on ldapauthnt4.dll user has access ");
+		else printf("based on ldapauthnt4.dll user has NO access ");
+		}
+
+	}
+	if (returnvalue==1) printf("\n-------------------------\n");
+	if (returnvalue==1) printf("For testing we cont, but access was already granted\n");
+	if (returnvalue==1) printf("-------------------------\n");
+	returnvalue=false;
+	if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && VerInfo.dwMajorVersion >= 5)
+	{
+		if (CheckAD())
+		{
+			printf("\nTrying ldapauth .dll \n");
+		printf("------------------------ \n");
+		printf("------------------------ \n");
+		HMODULE hModule = LoadLibrary("ldapauth.dll");
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				HRESULT hr = CoInitialize(NULL);
+				returnvalue=CheckUserGroupPassword(pszBuffer,pszBuffer2,"test",pszBuffer3,locdom);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else printf("ldapauth.dll not found");
+		if (returnvalue==1) printf("based on ldapauth.dll user has access ");
+		else printf("based on ldapauth.dll user has NO access ");
+		}
+	}
+	}
+	printf("Enter to quit ");
+	gets(pszBuffer);
+	return 0;
+}
diff --git a/ica/win32/addon/ms-logon/testauth/resource.h b/ica/win32/addon/ms-logon/testauth/resource.h
new file mode 100644
index 0000000..decb8f5
--- /dev/null
+++ b/ica/win32/addon/ms-logon/testauth/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by authSSP.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/addon/ms-logon/testauth/testauth.dsw b/ica/win32/addon/ms-logon/testauth/testauth.dsw
new file mode 100644
index 0000000..44e72c5
--- /dev/null
+++ b/ica/win32/addon/ms-logon/testauth/testauth.dsw
@@ -0,0 +1,53 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "auth"="..\auth\auth.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "authad"="..\authad\authad.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testauth"=".\testauth.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/addon/ms-logon/testauth/testauth.rc b/ica/win32/addon/ms-logon/testauth/testauth.rc
new file mode 100644
index 0000000..3cdefbf
--- /dev/null
+++ b/ica/win32/addon/ms-logon/testauth/testauth.rc
@@ -0,0 +1,112 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+// Defines STR_COMPANYNAME, STR_FILEVERSION, STR_PRODUCTVERSION, STR_COPYRIGHT,
+// STR_SPECIALBUILD, FILEVERSION, PRODUCTVERSION
+#include "../../versioninfo.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION INT_FILEVERSION
+ PRODUCTVERSION INT_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+            VALUE "Comments", "Test utility for UltraVNC's MS-Logon I\0"
+            VALUE "CompanyName", STR_COMPANYNAME
+            VALUE "FileDescription", "MS-Logon I for UltraVNC\0"
+            VALUE "FileVersion", STR_FILEVERSION
+            VALUE "InternalName", "testauth\0"
+            VALUE "LegalCopyright", STR_COPYRIGHT
+            VALUE "OriginalFilename", "testauth.dll\0"
+            VALUE "ProductName", "UltraVNC testauth\0"
+            VALUE "ProductVersion", STR_PRODUCTVERSION
+#if isRC == 1
+			VALUE "SpecialBuild", STR_SPECIALBUILD
+#endif
+			END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/addon/ms-logon/workgrpdomnt4/resource.h b/ica/win32/addon/ms-logon/workgrpdomnt4/resource.h
new file mode 100644
index 0000000..decb8f5
--- /dev/null
+++ b/ica/win32/addon/ms-logon/workgrpdomnt4/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by authSSP.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.cpp b/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.cpp
new file mode 100644
index 0000000..efc1c9e
--- /dev/null
+++ b/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.cpp
@@ -0,0 +1,886 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+// /macine-vnc Greg Wood (wood at agressiv.com)
+#include "workgrpdomnt4.h"
+
+/////////////////////////
+
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+					 )
+{
+    switch (ul_reason_for_call)
+	{
+		case DLL_PROCESS_ATTACH:
+		case DLL_THREAD_ATTACH:
+		case DLL_THREAD_DETACH:
+		case DLL_PROCESS_DETACH:
+			break;
+    }
+    return TRUE;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////// 
+
+
+void UnloadSecurityDll(HMODULE hModule) {
+
+   if (hModule)
+      FreeLibrary(hModule);
+
+   _AcceptSecurityContext      = NULL;
+   _AcquireCredentialsHandle   = NULL;
+   _CompleteAuthToken          = NULL;
+   _DeleteSecurityContext      = NULL;
+   _FreeContextBuffer          = NULL;
+   _FreeCredentialsHandle      = NULL;
+   _InitializeSecurityContext  = NULL;
+   _QuerySecurityPackageInfo   = NULL;
+}
+
+//////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////
+
+
+HMODULE LoadSecurityDll() {
+
+    HMODULE hModule;
+    BOOL    fAllFunctionsLoaded = FALSE; 
+	TCHAR   lpszDLL[MAX_PATH];
+	OSVERSIONINFO VerInfo;
+
+   _AcceptSecurityContext      = NULL;
+   _AcquireCredentialsHandle   = NULL;
+   _CompleteAuthToken          = NULL;
+   _DeleteSecurityContext      = NULL;
+   _FreeContextBuffer          = NULL;
+   _FreeCredentialsHandle      = NULL;
+   _InitializeSecurityContext  = NULL;
+   _QuerySecurityPackageInfo   = NULL;
+
+   // 
+   //  Find out which security DLL to use, depending on
+   //  whether we are on NT or Win95 or 2000 or XP or .NET Server
+   //  We have to use security.dll on Windows NT 4.0.
+   //  All other operating systems, we have to use Secur32.dll
+   // 
+   VerInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+   if (!GetVersionEx (&VerInfo))   // If this fails, something has gone wrong
+   {
+      return FALSE;
+   }
+
+   if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT &&
+      VerInfo.dwMajorVersion == 4 &&
+      VerInfo.dwMinorVersion == 0)
+   {
+      lstrcpy (lpszDLL, _T("security.dll"));
+   }
+   else
+   {
+      lstrcpy (lpszDLL, _T("secur32.dll"));
+   }
+
+
+   hModule = LoadLibrary(lpszDLL);
+   if (!hModule)
+      return NULL;
+
+   __try {
+
+      _AcceptSecurityContext = (ACCEPT_SECURITY_CONTEXT_FN) 
+            GetProcAddress(hModule, "AcceptSecurityContext");
+      if (!_AcceptSecurityContext)
+         __leave;
+
+#ifdef UNICODE
+      _AcquireCredentialsHandle = (ACQUIRE_CREDENTIALS_HANDLE_FN)
+            GetProcAddress(hModule, "AcquireCredentialsHandleW");
+#else
+      _AcquireCredentialsHandle = (ACQUIRE_CREDENTIALS_HANDLE_FN)
+            GetProcAddress(hModule, "AcquireCredentialsHandleA");
+#endif
+      if (!_AcquireCredentialsHandle)
+         __leave;
+
+      // CompleteAuthToken is not present on Windows 9x Secur32.dll
+      // Do not check for the availablity of the function if it is NULL;
+      _CompleteAuthToken = (COMPLETE_AUTH_TOKEN_FN) 
+            GetProcAddress(hModule, "CompleteAuthToken");
+
+      _DeleteSecurityContext = (DELETE_SECURITY_CONTEXT_FN) 
+            GetProcAddress(hModule, "DeleteSecurityContext");
+      if (!_DeleteSecurityContext)
+         __leave;
+
+      _FreeContextBuffer = (FREE_CONTEXT_BUFFER_FN) 
+            GetProcAddress(hModule, "FreeContextBuffer");
+      if (!_FreeContextBuffer)
+         __leave;
+
+      _FreeCredentialsHandle = (FREE_CREDENTIALS_HANDLE_FN) 
+            GetProcAddress(hModule, "FreeCredentialsHandle");
+      if (!_FreeCredentialsHandle)
+         __leave;
+
+#ifdef UNICODE
+      _InitializeSecurityContext = (INITIALIZE_SECURITY_CONTEXT_FN)
+            GetProcAddress(hModule, "InitializeSecurityContextW");
+#else
+      _InitializeSecurityContext = (INITIALIZE_SECURITY_CONTEXT_FN) 
+            GetProcAddress(hModule, "InitializeSecurityContextA");
+#endif
+      if (!_InitializeSecurityContext)
+         __leave;
+
+#ifdef UNICODE
+      _QuerySecurityPackageInfo = (QUERY_SECURITY_PACKAGE_INFO_FN)
+            GetProcAddress(hModule, "QuerySecurityPackageInfoW");
+#else
+      _QuerySecurityPackageInfo = (QUERY_SECURITY_PACKAGE_INFO_FN)
+            GetProcAddress(hModule, "QuerySecurityPackageInfoA");
+#endif
+      if (!_QuerySecurityPackageInfo)
+         __leave;
+
+      fAllFunctionsLoaded = TRUE;
+
+   } __finally {
+
+      if (!fAllFunctionsLoaded) {
+         UnloadSecurityDll(hModule);
+         hModule = NULL;
+      }
+
+   }
+   
+   return hModule;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////// 
+
+
+BOOL GenClientContext(PAUTH_SEQ pAS, PSEC_WINNT_AUTH_IDENTITY pAuthIdentity,
+      PVOID pIn, DWORD cbIn, PVOID pOut, PDWORD pcbOut, PBOOL pfDone) {
+
+/*++
+
+ Routine Description:
+
+   Optionally takes an input buffer coming from the server and returns
+   a buffer of information to send back to the server.  Also returns
+   an indication of whether or not the context is complete.
+
+ Return Value:
+
+   Returns TRUE if successful; otherwise FALSE.
+
+--*/ 
+
+   SECURITY_STATUS ss;
+   TimeStamp       tsExpiry;
+   SecBufferDesc   sbdOut;
+   SecBuffer       sbOut;
+   SecBufferDesc   sbdIn;
+   SecBuffer       sbIn;
+   ULONG           fContextAttr;
+
+   if (!pAS->fInitialized) {
+      
+      ss = _AcquireCredentialsHandle(NULL, _T("NTLM"), 
+            SECPKG_CRED_OUTBOUND, NULL, pAuthIdentity, NULL, NULL,
+            &pAS->hcred, &tsExpiry);
+      if (ss < 0) {
+         fprintf(stderr, "AcquireCredentialsHandle failed with %08X\n", ss);
+         return FALSE;
+      }
+
+      pAS->fHaveCredHandle = TRUE;
+   }
+
+   // Prepare output buffer
+   sbdOut.ulVersion = 0;
+   sbdOut.cBuffers = 1;
+   sbdOut.pBuffers = &sbOut;
+
+   sbOut.cbBuffer = *pcbOut;
+   sbOut.BufferType = SECBUFFER_TOKEN;
+   sbOut.pvBuffer = pOut;
+
+   // Prepare input buffer
+   if (pAS->fInitialized)  {
+      sbdIn.ulVersion = 0;
+      sbdIn.cBuffers = 1;
+      sbdIn.pBuffers = &sbIn;
+
+      sbIn.cbBuffer = cbIn;
+      sbIn.BufferType = SECBUFFER_TOKEN;
+      sbIn.pvBuffer = pIn;
+   }
+
+   ss = _InitializeSecurityContext(&pAS->hcred, 
+         pAS->fInitialized ? &pAS->hctxt : NULL, NULL, 0, 0, 
+         SECURITY_NATIVE_DREP, pAS->fInitialized ? &sbdIn : NULL,
+         0, &pAS->hctxt, &sbdOut, &fContextAttr, &tsExpiry);
+   if (ss < 0)  { 
+      // <winerror.h>
+      fprintf(stderr, "InitializeSecurityContext failed with %08X\n", ss);
+      return FALSE;
+   }
+
+   pAS->fHaveCtxtHandle = TRUE;
+
+   // If necessary, complete token
+   if (ss == SEC_I_COMPLETE_NEEDED || ss == SEC_I_COMPLETE_AND_CONTINUE) {
+
+      if (_CompleteAuthToken) {
+         ss = _CompleteAuthToken(&pAS->hctxt, &sbdOut);
+         if (ss < 0)  {
+            fprintf(stderr, "CompleteAuthToken failed with %08X\n", ss);
+            return FALSE;
+         }
+      }
+      else {
+         fprintf (stderr, "CompleteAuthToken not supported.\n");
+         return FALSE;
+      }
+   }
+
+   *pcbOut = sbOut.cbBuffer;
+
+   if (!pAS->fInitialized)
+      pAS->fInitialized = TRUE;
+
+   *pfDone = !(ss == SEC_I_CONTINUE_NEEDED 
+         || ss == SEC_I_COMPLETE_AND_CONTINUE );
+
+   return TRUE;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////// 
+
+
+BOOL GenServerContext(PAUTH_SEQ pAS, PVOID pIn, DWORD cbIn, PVOID pOut,
+      PDWORD pcbOut, PBOOL pfDone) {
+
+/*++
+
+ Routine Description:
+
+    Takes an input buffer coming from the client and returns a buffer
+    to be sent to the client.  Also returns an indication of whether or
+    not the context is complete.
+
+ Return Value:
+
+    Returns TRUE if successful; otherwise FALSE.
+
+--*/ 
+
+   SECURITY_STATUS ss;
+   TimeStamp       tsExpiry;
+   SecBufferDesc   sbdOut;
+   SecBuffer       sbOut;
+   SecBufferDesc   sbdIn;
+   SecBuffer       sbIn;
+   ULONG           fContextAttr;
+
+   if (!pAS->fInitialized)  {
+      
+      ss = _AcquireCredentialsHandle(NULL, _T("NTLM"), 
+            SECPKG_CRED_INBOUND, NULL, NULL, NULL, NULL, &pAS->hcred, 
+            &tsExpiry);
+      if (ss < 0) {
+         fprintf(stderr, "AcquireCredentialsHandle failed with %08X\n", ss);
+         return FALSE;
+      }
+
+      pAS->fHaveCredHandle = TRUE;
+   }
+
+   // Prepare output buffer
+   sbdOut.ulVersion = 0;
+   sbdOut.cBuffers = 1;
+   sbdOut.pBuffers = &sbOut;
+
+   sbOut.cbBuffer = *pcbOut;
+   sbOut.BufferType = SECBUFFER_TOKEN;
+   sbOut.pvBuffer = pOut;
+
+   // Prepare input buffer
+   sbdIn.ulVersion = 0;
+   sbdIn.cBuffers = 1;
+   sbdIn.pBuffers = &sbIn;
+
+   sbIn.cbBuffer = cbIn;
+   sbIn.BufferType = SECBUFFER_TOKEN;
+   sbIn.pvBuffer = pIn;
+
+   ss = _AcceptSecurityContext(&pAS->hcred, 
+         pAS->fInitialized ? &pAS->hctxt : NULL, &sbdIn, 0, 
+         SECURITY_NATIVE_DREP, &pAS->hctxt, &sbdOut, &fContextAttr, 
+         &tsExpiry);
+   if (ss < 0)  {
+      fprintf(stderr, "AcceptSecurityContext failed with %08X\n", ss);
+      return FALSE;
+   }
+
+   pAS->fHaveCtxtHandle = TRUE;
+
+   // If necessary, complete token
+   if (ss == SEC_I_COMPLETE_NEEDED || ss == SEC_I_COMPLETE_AND_CONTINUE) {
+      
+      if (_CompleteAuthToken) {
+         ss = _CompleteAuthToken(&pAS->hctxt, &sbdOut);
+         if (ss < 0)  {
+            fprintf(stderr, "CompleteAuthToken failed with %08X\n", ss);
+            return FALSE;
+         }
+      }
+      else {
+         fprintf (stderr, "CompleteAuthToken not supported.\n");
+         return FALSE;
+      }
+   }
+
+   *pcbOut = sbOut.cbBuffer;
+
+   if (!pAS->fInitialized)
+      pAS->fInitialized = TRUE;
+
+   *pfDone = !(ss = SEC_I_CONTINUE_NEEDED 
+         || ss == SEC_I_COMPLETE_AND_CONTINUE);
+
+   return TRUE;
+}
+
+/////////////////////////////////////////////////////////////////////////////// 
+
+BOOL WINAPI SSPLogonUser(LPTSTR szDomain, LPTSTR szUser, LPTSTR szPassword) {
+
+   AUTH_SEQ    asServer   = {0};
+   AUTH_SEQ    asClient   = {0};
+   BOOL        fDone      = FALSE;
+   BOOL        fResult    = FALSE;
+   DWORD       cbOut      = 0;
+   DWORD       cbIn       = 0;
+   DWORD       cbMaxToken = 0;
+   PVOID       pClientBuf = NULL;
+   PVOID       pServerBuf = NULL;
+   PSecPkgInfo pSPI       = NULL;
+   HMODULE     hModule    = NULL;
+
+   SEC_WINNT_AUTH_IDENTITY ai;
+   __try {
+
+      hModule = LoadSecurityDll();
+      if (!hModule)
+         __leave;
+
+      // Get max token size
+      _QuerySecurityPackageInfo(_T("NTLM"), &pSPI);
+      cbMaxToken = pSPI->cbMaxToken;
+      _FreeContextBuffer(pSPI);
+
+      // Allocate buffers for client and server messages
+      pClientBuf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbMaxToken);
+      pServerBuf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbMaxToken);
+
+      // Initialize auth identity structure
+      ZeroMemory(&ai, sizeof(ai));
+#if defined(UNICODE) || defined(_UNICODE)
+      ai.Domain = szDomain;
+      ai.DomainLength = lstrlen(szDomain);
+      ai.User = szUser;
+      ai.UserLength = lstrlen(szUser);
+      ai.Password = szPassword;
+      ai.PasswordLength = lstrlen(szPassword);
+      ai.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
+#else      
+      ai.Domain = (unsigned char *)szDomain;
+      ai.DomainLength = lstrlen(szDomain);
+      ai.User = (unsigned char *)szUser;
+      ai.UserLength = lstrlen(szUser);
+      ai.Password = (unsigned char *)szPassword;
+      ai.PasswordLength = lstrlen(szPassword);
+      ai.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
+#endif
+
+      // Prepare client message (negotiate) .
+      cbOut = cbMaxToken;
+      if (!GenClientContext(&asClient, &ai, NULL, 0, pClientBuf, &cbOut, &fDone))
+         __leave;
+
+      // Prepare server message (challenge) .
+      cbIn = cbOut;
+      cbOut = cbMaxToken;
+      if (!GenServerContext(&asServer, pClientBuf, cbIn, pServerBuf, &cbOut, 
+            &fDone))
+         __leave;
+         // Most likely failure: AcceptServerContext fails with SEC_E_LOGON_DENIED
+         // in the case of bad szUser or szPassword.
+         // Unexpected Result: Logon will succeed if you pass in a bad szUser and 
+         // the guest account is enabled in the specified domain.
+
+      // Prepare client message (authenticate) .
+      cbIn = cbOut;
+      cbOut = cbMaxToken;
+      if (!GenClientContext(&asClient, &ai, pServerBuf, cbIn, pClientBuf, &cbOut,
+            &fDone))
+         __leave;
+
+      // Prepare server message (authentication) .
+      cbIn = cbOut;
+      cbOut = cbMaxToken;
+      if (!GenServerContext(&asServer, pClientBuf, cbIn, pServerBuf, &cbOut, 
+            &fDone))
+         __leave;
+
+      fResult = TRUE;
+
+   } __finally {
+
+      // Clean up resources
+      if (asClient.fHaveCtxtHandle)
+         _DeleteSecurityContext(&asClient.hctxt);
+
+      if (asClient.fHaveCredHandle)
+         _FreeCredentialsHandle(&asClient.hcred);
+
+      if (asServer.fHaveCtxtHandle)
+         _DeleteSecurityContext(&asServer.hctxt);
+
+      if (asServer.fHaveCredHandle)
+         _FreeCredentialsHandle(&asServer.hcred);
+
+      if (hModule)
+         UnloadSecurityDll(hModule);
+
+      HeapFree(GetProcessHeap(), 0, pClientBuf);
+      HeapFree(GetProcessHeap(), 0, pServerBuf);
+
+   }
+
+   return fResult;
+}
+
+/////////////////////////////////////////////////////////////////////////////// 
+WORKGRPDOMNT4_API
+BOOL CUGP(char * userin,char *password,char *machine, char *groupin, int locdom)
+{             
+//	FILE *file;
+	bool isNT = true;
+	bool isXP =false;
+	bool access_vnc=FALSE;
+	bool laccess_vnc=FALSE;
+	bool localdatabase=false;
+	ad_access=false;
+	OSVERSIONINFO ovi = { sizeof ovi };
+	// determine OS and load appropriate library
+
+	GetVersionEx( &ovi );
+	if ( ovi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
+		isNT = false;
+	if (ovi.dwPlatformId == VER_PLATFORM_WIN32_NT &&
+      ovi.dwMajorVersion == 5 &&
+      ovi.dwMinorVersion >= 1) isXP=true;
+
+	HINSTANCE hNet = 0, hLoc = 0;
+
+	if ( isNT )
+		{
+		hNet = LoadLibrary( "netapi32.dll" );
+		}
+	else
+		{
+		hLoc = LoadLibrary( "rlocal32.dll" );
+		hNet = LoadLibrary( "radmin32.dll" );
+		}
+
+	if ( hNet == 0 )
+	{
+		printf( "LoadLibrary( %s ) failed, gle = %lu\n",
+			isNT? "netapi32.dll": "radmin32.dll", GetLastError() );
+		return false;
+	}
+
+	// locate needed functions
+	NetApiBufferFree_t NetApiBufferFree = 0;
+	NetGetDCNameNT_t NetGetDCNameNT = 0;
+	NetGetDCName95_t NetGetDCName95 = 0;
+	NetUserGetGroupsNT_t NetUserGetGroupsNT = 0;
+	NetUserGetGroupsNT_t2 NetUserGetGroupsNT2 = 0;
+	NetUserGetGroups95_t NetUserGetGroups95 = 0;
+	NetWkstaGetInfoNT_t NetWkstaGetInfoNT = 0;
+	NetWkstaGetInfo95_t NetWkstaGetInfo95 = 0;
+
+	NetApiBufferFree = (NetApiBufferFree_t) GetProcAddress( hNet, "NetApiBufferFree" );
+	if ( NetApiBufferFree == 0 )
+	{
+		printf( "Oops! GetProcAddress() failed\n" );
+		return false;
+	}
+	
+	if ( isNT )
+	{
+		NetGetDCNameNT = (NetGetDCNameNT_t) GetProcAddress( hNet, "NetGetDCName" );
+		NetUserGetGroupsNT = (NetUserGetGroupsNT_t) GetProcAddress( hNet, "NetUserGetLocalGroups" );
+		NetUserGetGroupsNT2 = (NetUserGetGroupsNT_t2) GetProcAddress( hNet, "NetUserGetGroups" );
+		NetWkstaGetInfoNT = (NetWkstaGetInfoNT_t)GetProcAddress( hNet,"NetWkstaGetInfo" );
+		if ( NetGetDCNameNT == 0 || NetUserGetGroupsNT == 0 || NetWkstaGetInfoNT==0 ||NetUserGetGroupsNT2 == 0)
+		{
+			printf( "Oops! Some functions not found ...\n" );
+			return false;
+		}
+	}
+	else
+	{
+		NetGetDCName95 = (NetGetDCName95_t) GetProcAddress( hLoc, "LocalNetGetDCName" );
+		NetUserGetGroups95 = (NetUserGetGroups95_t) GetProcAddress( hNet, "NetUserGetGroupsA" );
+		NetWkstaGetInfo95 = (NetWkstaGetInfo95_t)GetProcAddress( hNet,"NetWkstaGetInfoA" );
+
+		if ( NetGetDCName95 == 0 || NetUserGetGroups95 == 0 ||NetWkstaGetInfo95 == 0)
+		{
+			printf( "Oops! Some functions not found ...\n" );
+			return false;
+		}
+	}
+	// find PDC if necessary; else set up server name for call
+
+
+	byte *buf = 0;
+	DWORD rc,rc2,read, total,i,rcdomain;
+	char server[MAXLEN * sizeof(wchar_t)];
+	char user[MAXLEN * sizeof(wchar_t)];
+	char group[MAXLEN * sizeof(wchar_t)];
+	char groupname[MAXLEN];
+	char domain[MAXLEN * sizeof(wchar_t)];
+
+	
+	if ( isNT )	mbstowcs( (wchar_t *) user, userin, MAXLEN );
+	else strcpy( user, userin );
+
+	if ( isNT )	mbstowcs( (wchar_t *) group, groupin, MAXLEN );
+	else strcpy( group, groupin );
+	////////////////////////////////////////////////////////////////////////////////////////////
+	////NT
+	////////////////////////////////////////////////////////////////////////////////////////////
+if ( isNT )
+		{
+
+			printf("Client NT4 or later \n");
+			///////////////// search DC ///////////////////////////////////
+			rcdomain = NetGetDCNameNT( 0, 0, &buf );
+			if (rcdomain==2453) printf( "No domain controler found\n");
+			if (!rcdomain)
+			{
+			printf("Domain controler found");
+			wcscpy( (wchar_t *) server, (wchar_t *) buf );
+			wprintf((wchar_t *)server);
+			printf("\n------------------------------\n");
+			}
+			printf("Checking Local groups for ");
+			printf("user: %S\n", _wcsupr((wchar_t *)user));
+			printf("group: %S\n", _wcsupr((wchar_t *)group));
+
+			//////////////////////////////////////////////////////////////////
+			///////////////// Local groups ///////////////////////////////////
+			//////////////////////////////////////////////////////////////////
+			//////////////////////////////////////////////////////////////////
+			if (locdom==1 || locdom==3){
+				LOCALGROUP_MEMBERS_INFO_2 *bufLMI, *cur;
+				DWORD read, total, resumeh, rc, i;
+				wchar_t	tempbuf[MAXLEN];
+				wchar_t seperator[MAXLEN];      
+				
+				netlocalgroupgetmembers_t netlocalgroupgetmembers;
+				HINSTANCE h = LoadLibrary ("netapi32.dll");
+				netlocalgroupgetmembers = (netlocalgroupgetmembers_t) GetProcAddress (h, "NetLocalGroupGetMembers");
+
+				////////////////////// GROUPS///////////////////////////////////////
+				mbstowcs( seperator,  "\\", 5 );
+				///////////////////////GROUP1/////////////////////////////////////
+				resumeh = 0;
+				do
+				{
+					bufLMI = NULL;
+					rc = netlocalgroupgetmembers( NULL, (wchar_t *)group, 2, (BYTE **) &bufLMI,BUFSIZE, &read, &total, &resumeh );
+					if ( rc == ERROR_MORE_DATA || rc == ERROR_SUCCESS )
+						{
+							
+							for ( i = 0, cur = bufLMI; i < read; ++ i, ++ cur )
+								{
+									// Note: the capital S in the format string will expect Unicode
+									// strings, as this is a program written/compiled for ANSI.
+									_wcsupr(cur->lgrmi2_domainandname);
+									wcscpy(tempbuf,cur->lgrmi2_domainandname);
+									wchar_t *t=wcsstr(tempbuf,seperator);
+									t++;
+									printf( "%S\n", t );
+									if (wcscmp(_wcsupr(t), _wcsupr((wchar_t *)user))==0) 
+										{
+											laccess_vnc=TRUE;
+											printf( "Local: User found in group \n" );
+										}
+								}
+					if ( bufLMI != NULL )
+					NetApiBufferFree( bufLMI );
+						}
+				} while ( rc == ERROR_MORE_DATA );
+				
+				///////////////////////////////////////////////////////////////////////
+			if ( h != 0 )FreeLibrary( h);
+			}
+
+
+			if ( !rcdomain){
+				DWORD rc;
+				printf( "New added ----  just for testing \n");
+				wcscpy( (wchar_t *) server, (wchar_t *) buf );
+				byte *buf2 = 0;
+				rc2 = NetWkstaGetInfoNT( 0 , 100 , &buf2 ) ;
+				if( rc2 ) printf( "NetWkstaGetInfoA() returned %lu \n", rc2);
+				else wcstombs( domain, ((WKSTA_INFO_100_NT *) buf2)->wki100_langroup, MAXLEN );
+				NetApiBufferFree( buf2 );
+				domain[MAXLEN - 1] = '\0';
+				printf("Detected domain = %s\n",domain);
+				buf2 = 0;
+				char userdomain[MAXLEN * sizeof(wchar_t)];
+				char userdom[MAXLEN];
+				strcpy(userdom,domain);
+				strcat(userdom,"\\");
+				strcat(userdom,userin);
+				mbstowcs( (wchar_t *) userdomain, userdom, MAXLEN );
+				printf( "%S\n", userdomain);
+				rc = NetUserGetGroupsNT( NULL ,(wchar_t *) userdomain, 0, 1,&buf2, MAX_PREFERRED_LENGTH, &read, &total);
+				if ( rc == NERR_Success)
+					{
+						for ( i = 0; i < read; ++ i )
+							{
+								wcstombs( groupname, ((LPLOCALGROUP_USERS_INFO_0_NT *) buf2)[i].grui0_name, MAXLEN );	
+								groupname[MAXLEN - 1] = '\0'; // because strncpy won't do this if overflow
+#ifdef _MSC_VER
+								_strupr(groupname);
+								_strupr(groupin);
+#else
+								_strupr(groupname);
+								_strupr(groupin);
+#endif
+								printf( "compare %s %s\n", groupname, group);
+								if (strcmp(groupname, groupin)==0) 
+								{
+									printf( "match ...\n" );
+									laccess_vnc=TRUE;
+								}
+								else printf( "no match ...\n" );
+							}
+						if (laccess_vnc==TRUE) printf( "group found ...\n" );
+						else printf( "No group found \n" );
+
+					}
+				NetApiBufferFree( buf2 );
+				
+			}
+	
+
+			 if (locdom==2 || locdom==3) if ( !rcdomain){
+				DWORD rc;
+				printf( "New added ----  just for testing \n");
+				wcscpy( (wchar_t *) server, (wchar_t *) buf );
+				byte *buf2 = 0;
+				rc2 = NetWkstaGetInfoNT( 0 , 100 , &buf2 ) ;
+				if( rc2 ) printf( "NetWkstaGetInfoA() returned %lu \n", rc2);
+				else wcstombs( domain, ((WKSTA_INFO_100_NT *) buf2)->wki100_langroup, MAXLEN );
+				NetApiBufferFree( buf2 );
+				domain[MAXLEN - 1] = '\0';
+				printf("Detected domain = %s\n",domain);
+				buf2 = 0;
+				char userdomain[MAXLEN * sizeof(wchar_t)];
+				char userdom[MAXLEN];
+				//strcpy(userdom,domain);
+				//strcat(userdom,"\\");
+				strcpy(userdom,userin);
+				mbstowcs( (wchar_t *) userdomain, userdom, MAXLEN );
+				printf( "%S\n", userdomain);
+				rc = NetUserGetGroupsNT2( (wchar_t *)server,(wchar_t *) userdomain, 0,&buf2, MAX_PREFERRED_LENGTH, &read, &total);
+				if ( rc == NERR_Success)
+					{
+						for ( i = 0; i < read; ++ i )
+							{
+								wcstombs( groupname, ((LPLOCALGROUP_USERS_INFO_0_NT *) buf2)[i].grui0_name, MAXLEN );	
+								groupname[MAXLEN - 1] = '\0'; // because strncpy won't do this if overflow
+#ifdef _MSC_VER
+								_strupr(groupname);
+								_strupr(groupin);
+#else
+								_strupr(groupname);
+								_strupr(groupin);
+#endif
+								printf( "compare %s %s\n", groupname, group);
+								if (strcmp(groupname, groupin)==0) 
+								{
+									printf( "match ...\n" );
+									laccess_vnc=TRUE;
+								}
+								else printf( "no match ...\n" );
+							}
+						if (laccess_vnc==TRUE) printf( "group found ...\n" );
+						else printf( "No group found \n" );
+
+					}
+				NetApiBufferFree( buf2 );
+				
+			}
+		}
+	////////////////////////////////////////////////////////////////////////////////////////////
+	////9.X
+	////////////////////////////////////////////////////////////////////////////////////////////
+	if (locdom==2 || locdom==3) if ( !isNT )
+		{
+			rc = NetGetDCName95( 0, &buf );
+			if ( rc ) printf( "NetGetDCName95() returned %lu\n", rc );
+			if (rc==2453) 
+			{
+				printf( "No domain controler found\n");
+				return false;
+			}
+			if ( !rc )
+			{
+				strcpy( server, (char *) buf );
+				byte *buf2 = 0;
+				rc = NetWkstaGetInfo95( 0 , 100 , &buf2 ) ;
+				if( rc ) printf( "NetWkstaGetInfoA() returned %lu \n", rc);
+				else  strncpy( domain, ((WKSTA_INFO_100_95 *) buf2)->wki100_langroup, MAXLEN );
+				NetApiBufferFree( buf2 );
+				domain[MAXLEN - 1] = '\0';
+				NetApiBufferFree( buf );
+				buf = 0;
+				buf2 = 0;
+				////////////////////////////////////////////
+				rc = NetUserGetGroups95( server,user, 0, &buf2, 2024, &read, &total);
+				if ( rc == NERR_Success)
+					{
+						for ( i = 0; i < read; ++ i )
+							{ 
+								strncpy( groupname, ((LPLOCALGROUP_USERS_INFO_0_95 *) buf2)[i].grui0_name, MAXLEN );
+								groupname[MAXLEN - 1] = '\0'; // because strncpy won't do this if overflow
+#ifdef _MSC_VER
+							_strupr(groupname);
+#else
+							_strupr(groupname);
+#endif
+								printf( "%s\n", groupname);
+								if (strcmp(groupname, group)==0) laccess_vnc=TRUE;
+							}
+						if (access_vnc==TRUE) printf( "NT: Domain group found ...\n" );
+						else printf( "No Domain group found \n" );
+					}
+				NetApiBufferFree( buf2 );
+				buf2=0;
+			}
+		}
+		
+	
+	if (buf)NetApiBufferFree( buf );
+	if ( hNet != 0 )
+		FreeLibrary( hNet );
+	if ( hLoc != 0 )
+		FreeLibrary( hLoc );
+	//check user
+	if (isNT)
+	{
+
+#if _MSC_VER < 1400
+		wcstombs( user, (unsigned short *)user, MAXLEN);	
+#else
+		wcstombs( user, (const wchar_t *)user, MAXLEN);	
+#endif
+	}
+
+	BOOL logon_OK=false;
+	BOOL passwd_OK=false;
+#ifdef _MSC_VER
+	_strupr(user);
+#else
+	_strupr(user);
+#endif
+	passwd_OK=false;
+	if (isXP)
+		{
+			LOGONUSER LU=NULL;
+			HMODULE  shell1 = LoadLibrary("advapi32.dll");
+			if(shell1!=NULL) LU = (LOGONUSER)GetProcAddress((HINSTANCE)shell1,"LogonUserA");
+			if (LU!=NULL)
+			{
+			HANDLE token;
+			if (locdom==2 || locdom==3 ||locdom==1) 
+				if (LU(user,domain,password,LOGON32_LOGON_INTERACTIVE,LOGON32_PROVIDER_DEFAULT,&token))
+				{	passwd_OK=true;
+					if (passwd_OK==TRUE) printf( "Domain password check OK \n" );
+					else printf( "Domain password check Failed \n" );
+				}
+			if (locdom==1 || locdom==3) 
+				if (LU(user,".",password,LOGON32_LOGON_INTERACTIVE,LOGON32_PROVIDER_DEFAULT,&token))
+				{
+				passwd_OK=true;
+				if (passwd_OK==TRUE) printf( "Local password check OK \n" );
+				}
+			}
+			FreeLibrary(shell1);
+
+		}
+	else
+	{
+		if (locdom==2 || locdom==3 || locdom==1)
+		if (SSPLogonUser(domain,user, password))
+		{	passwd_OK=true;
+			if (passwd_OK==TRUE) printf( "Domain password check OK \n" );		
+		}
+		else printf( "Domain password check Failed \n" );
+
+		if (locdom==1 || locdom==3)
+		if (SSPLogonUser(".",user, password))
+		{
+			passwd_OK=true;
+			if (passwd_OK==TRUE) printf( "Local password check OK \n" );
+		}
+		else printf( "Local password check Failed \n" );
+		if (locdom==2 || locdom==3)if (SSPLogonUser(domain,"isdiua", "hegbfsa")) {passwd_OK=false;printf( "Guest account block \n" );}
+		if (locdom==1 || locdom==3)if (SSPLogonUser(".","isdiua", "hegbfsa")) {passwd_OK=false;printf( "Guest account block \n" );}
+	}
+	if (access_vnc==TRUE || laccess_vnc==TRUE || ad_access==TRUE)
+	{
+		if (passwd_OK) 
+		{
+		logon_OK=true;
+		printf( "Acces to vnc  OK \n" );
+		}
+	}
+	return logon_OK;
+	
+}
+
+
diff --git a/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.def b/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.def
new file mode 100644
index 0000000..016011b
--- /dev/null
+++ b/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.def
@@ -0,0 +1,4 @@
+LIBRARY   workgrpdomnt4
+
+             EXPORTS
+               CUGP
diff --git a/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.dsw b/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.dsw
new file mode 100644
index 0000000..5104fee
--- /dev/null
+++ b/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "workgrpdomnt4"=".\workgrpdomnt4.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.h b/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.h
new file mode 100644
index 0000000..c4886e2
--- /dev/null
+++ b/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.h
@@ -0,0 +1,100 @@
+
+// The following ifdef block is the standard way of creating macros which make exporting 
+// from a DLL simpler. All files within this DLL are compiled with the AUTH_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see 
+// AUTH_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef WORKGRPDOMNT4_EXPORTS
+#define WORKGRPDOMNT4_API __declspec(dllexport)
+#else
+#define WORKGRPDOMNT4_API __declspec(dllimport)
+#endif
+#pragma comment( lib, "netapi32.lib" )
+#if defined( UNICODE ) || defined( _UNICODE )
+#error Sorry -- please compile as an ANSI program.
+#endif
+#include <windows.h>
+#include <stdio.h>
+#include <lmcons.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <tchar.h>
+#include <lm.h>
+#include <stdio.h>
+#define SECURITY_WIN32
+#include <sspi.h>
+#ifndef SEC_I_COMPLETE_NEEDED
+#include <issperr.h>
+#include <time.h>
+#endif
+#pragma hdrstop
+
+#define MAXLEN 256
+#define MAX_PREFERRED_LENGTH    ((DWORD) -1)
+#define NERR_Success            0
+//#define LG_INCLUDE_INDIRECT 1
+#define BUFSIZE 1024
+
+typedef DWORD (__stdcall *NetApiBufferFree_t)( void *buf );
+typedef DWORD (__stdcall *NetGetDCNameNT_t)( wchar_t *server, wchar_t *domain, byte **buf );
+typedef DWORD (__stdcall *NetGetDCName95_t)( char *domain, byte **buf );
+typedef DWORD (__stdcall *NetUserGetGroupsNT_t)( wchar_t *server,wchar_t *user, DWORD level,DWORD flags, byte **buf,DWORD prefmaxlen, DWORD *entriesread, DWORD *totalentries);
+typedef DWORD (__stdcall *NetUserGetGroupsNT_t2)( wchar_t *server,wchar_t *user, DWORD level, byte **buf,DWORD prefmaxlen, DWORD *entriesread, DWORD *totalentries);
+
+typedef DWORD (__stdcall *NetUserGetGroups95_t)( char *server,char *user, DWORD level, byte **buf,DWORD prefmaxlen, DWORD *entriesread, DWORD *totalentries);
+typedef DWORD (__stdcall *NetWkstaGetInfoNT_t)( wchar_t *server, DWORD level, byte **buf );
+typedef DWORD (__stdcall *NetWkstaGetInfo95_t)( char *domain,DWORD level, byte **buf );
+typedef DWORD (__stdcall *netlocalgroupgetmembers_t)(LPWSTR,LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
+
+typedef struct _LPLOCALGROUP_USERS_INFO_0_NT
+{
+	wchar_t *grui0_name;
+}LPLOCALGROUP_USERS_INFO_0_NT;
+typedef struct _LPLOCALGROUP_USERS_INFO_0_95
+{
+	char *grui0_name;
+}LPLOCALGROUP_USERS_INFO_0_95;
+typedef struct _WKSTA_INFO_100_95 {
+  DWORD     wki100_platform_id;
+  char *    wki100_computername;
+  char *    wki100_langroup;
+  DWORD     wki100_ver_major;
+  DWORD     wki100_ver_minor;
+}WKSTA_INFO_100_95;
+typedef struct _WKSTA_INFO_100_NT {
+  DWORD     wki100_platform_id;
+  wchar_t *    wki100_computername;
+  wchar_t *    wki100_langroup;
+  DWORD     wki100_ver_major;
+  DWORD     wki100_ver_minor;
+}WKSTA_INFO_100_NT;
+typedef struct _AUTH_SEQ {
+   BOOL fInitialized;
+   BOOL fHaveCredHandle;
+   BOOL fHaveCtxtHandle;
+   CredHandle hcred;
+   struct _SecHandle hctxt;
+} AUTH_SEQ, *PAUTH_SEQ;
+
+typedef BOOL (WINAPI *LOGONUSER)(
+        LPTSTR lpszUsername,    // user name
+        LPTSTR lpszDomain,      // domain or server
+        LPTSTR lpszPassword,    // password
+        DWORD dwLogonType,      // type of logon operation
+        DWORD dwLogonProvider,  // logon provider
+        PHANDLE phToken );        // receive tokens handle
+
+
+ACCEPT_SECURITY_CONTEXT_FN       _AcceptSecurityContext;
+ACQUIRE_CREDENTIALS_HANDLE_FN    _AcquireCredentialsHandle;
+COMPLETE_AUTH_TOKEN_FN           _CompleteAuthToken;
+DELETE_SECURITY_CONTEXT_FN       _DeleteSecurityContext;
+FREE_CONTEXT_BUFFER_FN           _FreeContextBuffer;
+FREE_CREDENTIALS_HANDLE_FN       _FreeCredentialsHandle;
+INITIALIZE_SECURITY_CONTEXT_FN   _InitializeSecurityContext;
+QUERY_SECURITY_PACKAGE_INFO_FN   _QuerySecurityPackageInfo;
+
+bool ad_access;
+WORKGRPDOMNT4_API BOOL CUGP(char * userin,char *password,char *machine, char *group, int locdom);
+
diff --git a/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.rc b/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.rc
new file mode 100644
index 0000000..53a2fc9
--- /dev/null
+++ b/ica/win32/addon/ms-logon/workgrpdomnt4/workgrpdomnt4.rc
@@ -0,0 +1,112 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+// Defines STR_COMPANYNAME, STR_FILEVERSION, STR_PRODUCTVERSION, STR_COPYRIGHT,
+// STR_SPECIALBUILD, FILEVERSION, PRODUCTVERSION
+#include "../../versioninfo.h"
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION INT_FILEVERSION
+ PRODUCTVERSION INT_PRODUCTVERSION
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+            VALUE "Comments", "Workgroup and NT4 domain authentication for UltraVNC\0"
+            VALUE "CompanyName", STR_COMPANYNAME
+            VALUE "FileDescription", "MS-Logon I for UltraVNC\0"
+            VALUE "FileVersion", STR_FILEVERSION
+            VALUE "InternalName", "workgrpdomnt4\0"
+            VALUE "LegalCopyright", STR_COPYRIGHT
+            VALUE "OriginalFilename", "workgrpdomnt4.dll\0"
+            VALUE "ProductName", "UltraVNC workgrpdomnt4\0"
+            VALUE "ProductVersion", STR_PRODUCTVERSION
+#if isRC == 1
+			VALUE "SpecialBuild", STR_SPECIALBUILD
+#endif
+			END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/addon/versioninfo.h b/ica/win32/addon/versioninfo.h
new file mode 100644
index 0000000..1f4c7b2
--- /dev/null
+++ b/ica/win32/addon/versioninfo.h
@@ -0,0 +1,76 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2004 Martin Scharpf, B. Braun Melsungen AG. All Rights Reserved.
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+
+/* versioninfo.h: Defines 
+	STR_COMPANYNAME, 
+    STR_FILEVERSION,
+	STR_PRODUCTVERSION,
+	STR_COPYRIGHT,
+	STR_SPECIALBUILD,
+	INT_FILEVERSION,
+	INT_PRODUCTVERSION */
+
+#ifndef ULTRAVNC_VERSIONINFO_H
+#define ULTRAVNC_VERSIONINFO_H
+
+// ======================== Define Version here =======================
+#define MAJ 1
+#define MIN 0
+#define V3 90
+#define V4 0 // Used as ReleaseCandidate minor version in SpecialBuildDescription
+
+// Set to 1 if ReleaseCandidate (toggles visibility of SpecialBuildDescription)
+#define isRC 0
+
+// =========== No further configuration needed below this line =================
+
+// some helper macros (see http://http://gcc.gnu.org/onlinedocs/cpp/Stringification.html)
+#define XSTR(x) STR(x)
+#define STR(x) #x
+
+// Concatenate tokens
+#define CAT2(A,B) A.B
+#define CAT4(A,B,C,D) A.B.C.D
+
+#define INT_VERSION MAJ,MIN,V3,V4
+#define STR_VERSION CAT4(MAJ,MIN,V3,V4)
+#define STR_MAINVER CAT2(MAJ,MIN)
+#define STR_RC_VERSION CAT2(V3,V4)
+
+#define INT_FILEVERSION INT_VERSION
+#define INT_PRODUCTVERSION INT_VERSION
+
+#define STR_FILEVERSION XSTR(STR_VERSION) "\0"
+#define STR_PRODUCTVERSION XSTR(STR_VERSION) "\0"
+#define STR_COPYRIGHT "Copyright © 2002-2005 UltraVNC team members\0"
+#define STR_SPECIALBUILD "v" XSTR(STR_MAINVER) " ReleaseCandidate " XSTR(STR_RC_VERSION) "\0"
+#if isRC == 1
+#define STR_ABOUT_SERVER_VERSION XSTR(UltraVNC Win32 Server v STR_MAINVER RC STR_RC_VERSION)
+#define STR_ABOUT_VIEWER_VERSION XSTR(UltraVNC Win32 Viewer v STR_MAINVER RC STR_RC_VERSION)
+#else
+#define STR_ABOUT_SERVER_VERSION XSTR(UltraVNC Win32 Server v STR_VERSION)
+#define STR_ABOUT_VIEWER_VERSION XSTR(UltraVNC Win32 Viewer v STR_VERSION)
+#endif
+#define STR_COMPANYNAME "UltraVNC\0"
+
+#endif // ULTRAVNC_VERSIONINFO_H
diff --git a/ica/win32/common/Clipboard.cpp b/ica/win32/common/Clipboard.cpp
new file mode 100644
index 0000000..98fad1a
--- /dev/null
+++ b/ica/win32/common/Clipboard.cpp
@@ -0,0 +1,762 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+
+// Clipboard.h
+
+// adzm - July 2010
+//
+// Common classes for dealing with the clipboard, including serializing and deserializing compressed data, hashing and comparing, etc.
+// Used by server and viewer.
+
+#include "Clipboard.h"
+
+
+#define VC_EXTRALEAN
+#include <windows.h>
+
+#include <string>
+
+#include <rdr/MemInStream.h>
+#include <rdr/ZlibOutStream.h>
+#include <rdr/ZlibInStream.h>
+#ifdef IPP
+#include "..\..\ipp_zlib\src\zlib\zlib.h"
+#else
+#include <zlib/zlib.h>
+#endif
+
+
+ExtendedClipboardDataMessage::ExtendedClipboardDataMessage()
+	: m_pExtendedData(NULL), m_nInternalLength(0), m_pCurrentPos(NULL), m_pData(NULL)
+{
+	EnsureBufferLength(sz_rfbExtendedClipboardData);
+	m_pCurrentPos += sz_rfbExtendedClipboardData;
+}
+
+ExtendedClipboardDataMessage::~ExtendedClipboardDataMessage()
+{
+	delete[] m_pData;
+}
+
+void ExtendedClipboardDataMessage::Reset()
+{
+	delete[] m_pData;
+	m_pData = NULL;
+	m_pCurrentPos = NULL;
+	m_pExtendedData = NULL;
+	m_pCurrentPos = NULL;
+	m_nInternalLength = 0;
+
+	EnsureBufferLength(sz_rfbExtendedClipboardData);
+	m_pCurrentPos += sz_rfbExtendedClipboardData;
+}
+
+void ExtendedClipboardDataMessage::AddFlag(CARD32 flag)
+{
+	m_pExtendedData->flags |= Swap32IfLE(flag);
+}
+
+bool ExtendedClipboardDataMessage::HasFlag(CARD32 flag)
+{
+	return (m_pExtendedData->flags & Swap32IfLE(flag)) ? true : false;
+}
+
+int ExtendedClipboardDataMessage::GetMessageLength()
+{
+	return GetDataLength() - sz_rfbExtendedClipboardData;
+}
+
+int ExtendedClipboardDataMessage::GetDataLength()
+{
+	return m_pCurrentPos - m_pData;
+}
+
+const BYTE* ExtendedClipboardDataMessage::GetData()
+{
+	return m_pData;
+}
+
+BYTE* ExtendedClipboardDataMessage::GetBuffer()
+{
+	return m_pData;
+}
+
+int ExtendedClipboardDataMessage::GetBufferLength()
+{
+	return m_nInternalLength;
+}
+
+const BYTE* ExtendedClipboardDataMessage::GetCurrentPos()
+{
+	return m_pCurrentPos;
+}
+
+void ExtendedClipboardDataMessage::AppendInt(CARD32 val)
+{
+	EnsureBufferLength(GetDataLength() + sizeof(val));
+
+	val = Swap32IfLE(val);
+
+	memcpy(m_pCurrentPos, &val, sizeof(val));
+	m_pCurrentPos += sizeof(val);
+}
+
+void ExtendedClipboardDataMessage::AppendBytes(BYTE* pData, int length)
+{
+	EnsureBufferLength(GetDataLength() + length, false);
+
+	memcpy(m_pCurrentPos, pData, length);
+	m_pCurrentPos += length;
+}
+
+void ExtendedClipboardDataMessage::Advance(int len)
+{
+	EnsureBufferLength(GetDataLength() + len, false);
+	m_pCurrentPos += len;
+}
+
+CARD32 ExtendedClipboardDataMessage::ReadInt()
+{
+	CARD32 val = 0;
+
+	memcpy(&val, m_pCurrentPos, sizeof(val));
+
+	m_pCurrentPos += sizeof(val);
+
+	return Swap32IfLE(val);
+}
+
+void ExtendedClipboardDataMessage::EnsureBufferLength(int len, bool bGrowBeyond)
+{
+	if (m_nInternalLength < len) {
+		int nCurrentOffset = GetDataLength();
+
+		int nNewLength = bGrowBeyond ? len * 2 : len;
+		BYTE* pNewBuffer = new BYTE[nNewLength];
+		::ZeroMemory(pNewBuffer, nNewLength);
+
+		if (m_pData) {
+			memcpy(pNewBuffer, m_pData, GetDataLength());
+			delete[] m_pData;
+		}
+
+		m_pData = pNewBuffer;
+		m_pExtendedData = (rfbExtendedClipboardData*)m_pData;
+		m_pCurrentPos = m_pData + nCurrentOffset;
+		m_nInternalLength = nNewLength;
+	}
+}
+
+int ExtendedClipboardDataMessage::CountFormats()
+{
+	CARD32 flags = GetFlags();
+
+	flags = flags & 0x0000FFFF;
+
+	// from Brian W. Kernighan
+	int c = 0;
+	for (c = 0; flags; c++) {
+		flags &= flags - 1;
+	}
+
+	return c;
+}
+
+CARD32 ExtendedClipboardDataMessage::GetFlags()
+{
+	return Swap32IfLE(m_pExtendedData->flags);
+}
+
+const UINT ClipboardSettings::formatUnicodeText =	CF_UNICODETEXT;
+const UINT ClipboardSettings::formatRTF =			RegisterClipboardFormat("Rich Text Format");
+const UINT ClipboardSettings::formatHTML =			RegisterClipboardFormat("HTML Format");
+const UINT ClipboardSettings::formatDIB =			CF_DIBV5;
+
+const int ClipboardSettings::defaultLimitText =		((int)0x00A00000); // 10 megabytes uncompressed. Pretty huge, but not a problem for a LAN. Better than the previous no limit, though.
+const int ClipboardSettings::defaultLimitRTF =		((int)0x00200000); // Limit these to 2 megabytes so they don't end up adding too much strain by being enabled by default
+const int ClipboardSettings::defaultLimitHTML =		((int)0x00200000); // besides, every 2mb rtf/html data I have seen will DEFLATE very well.
+const int ClipboardSettings::defaultLimitDIB =		((int)0x00000000); // no DIB by default
+
+const int ClipboardSettings::defaultLimit =			((int)0x00200000);
+
+ClipboardSettings::ClipboardSettings(CARD32 caps)
+	: m_bSupportsEx(false)
+	, m_nLimitText(defaultLimitText)
+	, m_nLimitRTF(defaultLimitRTF)
+	, m_nLimitHTML(defaultLimitHTML)
+	, m_nLimitDIB(defaultLimitDIB)
+	, m_nRequestedLimitText(m_nLimitText)
+	, m_nRequestedLimitRTF(m_nLimitRTF)
+	, m_nRequestedLimitHTML(m_nLimitHTML)
+	, m_nRequestedLimitDIB(m_nLimitDIB)
+	, m_myCaps(caps)
+	, m_remoteCaps(ClipboardSettings::defaultCaps)
+{
+}
+
+CARD32 ClipboardSettings::defaultCaps = 
+	(clipCaps | clipRequest | clipProvide)  // capabilities
+	| 
+	(clipText | clipRTF | clipHTML | clipDIB); // supports Unicode text, RTF, and HTML, and DIB
+CARD32 ClipboardSettings::defaultViewerCaps = defaultCaps | clipNotify;
+CARD32 ClipboardSettings::defaultServerCaps = defaultCaps | clipPeek;
+
+
+void ClipboardSettings::PrepareCapsPacket(ExtendedClipboardDataMessage& extendedDataMessage)
+{
+	// messages and formats that we can handle
+	extendedDataMessage.m_pExtendedData->flags = Swap32IfLE(m_myCaps);
+
+	// now include our limits in order of enum value
+	extendedDataMessage.AppendInt(m_nLimitText);
+	extendedDataMessage.AppendInt(m_nLimitRTF);
+	extendedDataMessage.AppendInt(m_nLimitHTML);
+	extendedDataMessage.AppendInt(m_nLimitDIB);
+}
+
+void ClipboardSettings::HandleCapsPacket(ExtendedClipboardDataMessage& extendedDataMessage, bool bSetLimits)
+{
+	int nCount = extendedDataMessage.CountFormats();
+
+	m_remoteCaps = extendedDataMessage.GetFlags();	
+
+	if (m_remoteCaps & clipText) {
+		m_nRequestedLimitText = (int)extendedDataMessage.ReadInt();		
+		nCount--;
+	} else {
+		m_nRequestedLimitText = 0;
+	}
+	if (m_remoteCaps & clipRTF) {
+		m_nRequestedLimitRTF = (int)extendedDataMessage.ReadInt();
+		nCount--;
+	} else {
+		m_nRequestedLimitRTF = 0;
+	}
+	if (m_remoteCaps & clipHTML) {
+		m_nRequestedLimitHTML = (int)extendedDataMessage.ReadInt();
+		nCount--;
+	} else {
+		m_nRequestedLimitHTML = 0;
+	}
+	if (m_remoteCaps & clipDIB) {
+		m_nRequestedLimitDIB = (int)extendedDataMessage.ReadInt();
+		nCount--;
+	} else {
+		m_nRequestedLimitDIB = 0;
+	}
+
+	if (bSetLimits) {
+		m_nLimitText = m_nRequestedLimitText;
+		m_nLimitRTF = m_nRequestedLimitRTF;
+		m_nLimitHTML = m_nRequestedLimitHTML;
+		m_nLimitDIB = m_nRequestedLimitDIB;
+	}
+
+	// read any unsupported values
+	while (nCount) {
+		extendedDataMessage.ReadInt();
+		nCount--;
+	}
+}
+
+ClipboardHolder::ClipboardHolder(HWND hwndOwner)
+{
+	m_bIsOpen = ::OpenClipboard(hwndOwner) ? true : false;
+}
+
+ClipboardHolder::~ClipboardHolder()
+{
+	if (m_bIsOpen) {
+		::CloseClipboard();
+	}
+}
+
+ClipboardData::ClipboardData()
+	: m_crc(0)
+	, m_lengthText(0)
+	, m_lengthRTF(0)
+	, m_lengthHTML(0)
+	, m_lengthDIB(0)
+	, m_pDataText(NULL)
+	, m_pDataRTF(NULL)
+	, m_pDataHTML(NULL)
+	, m_pDataDIB(NULL)
+{
+}
+
+ClipboardData::~ClipboardData()
+{
+	FreeData();
+}
+
+void ClipboardData::FreeData()
+{
+	delete[] m_pDataText;
+	delete[] m_pDataRTF;
+	delete[] m_pDataHTML;
+	delete[] m_pDataDIB;
+
+	m_pDataText = NULL;
+	m_pDataRTF = NULL;
+	m_pDataHTML = NULL;
+	m_pDataDIB = NULL;
+}
+
+bool ClipboardData::Load(HWND hwndOwner) // will return false on failure
+{
+	// This can be improved by not making copies of the clipboard data and simply keeping the handles open; however
+	// I seemed to notice some issues with having multiple clipboard format data handles open when an application 
+	// uses clipboard formats that it must render on demand. Regardless, I am not too concerned about this now.
+
+	ClipboardHolder holder(hwndOwner);
+
+	if (!holder.m_bIsOpen) {
+		return false;
+	}
+
+	m_crc = 0;
+	FreeData();
+	
+	m_crc = crc32(0L, Z_NULL, 0);
+
+	// text
+	{
+		m_lengthText = 0;
+
+		HANDLE hText = NULL;
+		if (IsClipboardFormatAvailable(ClipboardSettings::formatUnicodeText)) {
+			hText = ::GetClipboardData(ClipboardSettings::formatUnicodeText);
+		}
+
+		if (hText) {
+			BYTE* pData = (BYTE*)GlobalLock(hText);
+			int nLength = (int)GlobalSize(hText);
+
+			if (pData != NULL && nLength > 0) {
+
+				// Convert from UTF-16 to UTF-8
+				int nConvertedSize = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)pData, -1, NULL, 0, NULL, NULL);
+
+				if (nConvertedSize > 0) {				
+					m_pDataText = new BYTE[nConvertedSize];
+					//memcpy(m_pDataText, pData, nLength);
+
+					int nFinalConvertedSize = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)pData, -1, (LPSTR)m_pDataText, nConvertedSize, NULL, NULL);
+
+					if (nFinalConvertedSize > 0) {
+						m_lengthText = nFinalConvertedSize;
+
+						m_crc = crc32(m_crc, m_pDataText, nFinalConvertedSize);
+					} else {
+						delete[] m_pDataText;
+					}
+				}
+
+				GlobalUnlock(hText);
+			}
+		}
+	}
+
+	// RTF
+	{
+		m_lengthRTF = 0;
+
+		HANDLE hRTF = NULL;
+		if (IsClipboardFormatAvailable(ClipboardSettings::formatRTF)) {
+			hRTF = ::GetClipboardData(ClipboardSettings::formatRTF);
+		}
+
+		if (hRTF) {
+			BYTE* pData = (BYTE*)GlobalLock(hRTF);
+			int nLength = (int)GlobalSize(hRTF);
+
+			if (pData != NULL && nLength > 0) {
+				
+				m_pDataRTF = new BYTE[nLength];
+				memcpy(m_pDataRTF, pData, nLength);
+
+				m_lengthRTF = nLength;
+
+				GlobalUnlock(hRTF);
+			}
+		}
+	}
+
+	// HTML
+	{
+		m_lengthHTML = 0;
+
+		HANDLE hHTML = NULL;
+		if (IsClipboardFormatAvailable(ClipboardSettings::formatHTML)) {
+			hHTML = ::GetClipboardData(ClipboardSettings::formatHTML);
+		}
+
+		if (hHTML) {
+			BYTE* pData = (BYTE*)GlobalLock(hHTML);
+			int nLength = (int)GlobalSize(hHTML);
+
+			if (pData != NULL && nLength > 0) {
+				
+				m_pDataHTML = new BYTE[nLength];
+				memcpy(m_pDataHTML, pData, nLength);
+
+				m_lengthHTML = nLength;
+
+				GlobalUnlock(hHTML);
+			}
+		}
+	}
+
+	// DIB
+	{
+		m_lengthDIB = 0;
+
+		HANDLE hDIB = NULL;
+		if (IsClipboardFormatAvailable(ClipboardSettings::formatDIB)) {
+			hDIB = ::GetClipboardData(ClipboardSettings::formatDIB);
+		}
+
+		if (hDIB) {
+			BYTE* pData = (BYTE*)GlobalLock(hDIB);
+			int nLength = (int)GlobalSize(hDIB);
+
+			if (pData != NULL && nLength > 0) {
+				
+				m_pDataDIB = new BYTE[nLength];
+				memcpy(m_pDataDIB, pData, nLength);
+
+				m_lengthDIB = nLength;
+
+				GlobalUnlock(hDIB);
+			}
+		}
+	}
+
+	return m_lengthText + m_lengthRTF + m_lengthHTML + m_lengthDIB > 0;
+}
+
+bool ClipboardData::Restore(HWND hwndOwner, ExtendedClipboardDataMessage& extendedClipboardDataMessage)
+{
+	ClipboardHolder holder(hwndOwner);
+
+	if (!holder.m_bIsOpen) {
+		return false;
+	}
+
+	if (!::EmptyClipboard()) {
+		return false;
+	}
+
+	m_lengthText = m_lengthRTF = m_lengthHTML = m_lengthDIB = 0;
+
+	int nCompressedDataLength = extendedClipboardDataMessage.GetBufferLength() - extendedClipboardDataMessage.GetDataLength();
+
+	m_crc = crc32(0L, Z_NULL, 0);
+	if (nCompressedDataLength == 0) {
+		// no data beyond the flags
+		return true;
+	}
+
+	rdr::MemInStream inStream(extendedClipboardDataMessage.GetCurrentPos(), nCompressedDataLength);
+	rdr::ZlibInStream compressedStream;
+
+	compressedStream.setUnderlying(&inStream, nCompressedDataLength);
+
+	int length = 0;
+	bool bFailed = false;
+	if (extendedClipboardDataMessage.HasFlag(clipText)) {
+		length = (int)compressedStream.readU32();
+
+		if (length > 0) {
+			// get the incoming UTF-8 text
+			BYTE* pIncomingText = new BYTE[length];
+			compressedStream.readBytes(pIncomingText, length);
+
+			m_crc = crc32(m_crc, pIncomingText, length);
+
+			// now we have to translate to UTF-16
+			int nConvertedSize = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)pIncomingText, length, NULL, 0);
+
+			if (nConvertedSize > 0) {
+				HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, nConvertedSize * sizeof(wchar_t));
+
+				if (hData) {
+					BYTE* pData = (BYTE*)GlobalLock(hData);
+
+					if (pData) {
+						int nFinalConvertedSize = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)pIncomingText, length, (LPWSTR)pData, nConvertedSize);
+
+						GlobalUnlock(hData);
+
+						if (nFinalConvertedSize > 0) {
+							if (::SetClipboardData(ClipboardSettings::formatUnicodeText, hData)) {
+								hData = NULL;
+								m_lengthText = nConvertedSize * sizeof(wchar_t);
+							} else {
+								bFailed = true;
+							}
+						}
+					}
+				}
+
+				if (hData) {
+					GlobalFree(hData);
+				}
+			}
+			if (pIncomingText) {
+				delete[] pIncomingText;
+			}
+			if (bFailed) {
+				return false;
+			}
+		}
+	}
+
+	if (extendedClipboardDataMessage.HasFlag(clipRTF)) {
+		length = (int)compressedStream.readU32();
+
+		if (length > 0) {
+			HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, length);
+
+			if (!hData) return false;
+
+			BYTE* pData = (BYTE*)GlobalLock(hData);
+
+			if (pData) {
+				compressedStream.readBytes(pData, length);
+
+				GlobalUnlock(hData);
+
+				if (::SetClipboardData(ClipboardSettings::formatRTF, hData)) {
+					hData = NULL;
+					m_lengthRTF = length;
+				} else {
+					bFailed = true;
+				}
+			}
+
+			if (hData) {
+				GlobalFree(hData);
+			}
+		}
+	}
+	
+	if (extendedClipboardDataMessage.HasFlag(clipHTML)) {
+		length = (int)compressedStream.readU32();
+
+		if (length > 0) {
+			HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, length);
+
+			if (!hData) return false;
+
+			BYTE* pData = (BYTE*)GlobalLock(hData);
+
+			if (pData) {
+				compressedStream.readBytes(pData, length);
+
+				GlobalUnlock(hData);
+
+				if (!::SetClipboardData(ClipboardSettings::formatHTML, hData)) {
+					hData = NULL;
+					m_lengthHTML = length;
+				} else {
+					bFailed = true;
+				}
+			}
+
+			if (hData) {
+				GlobalFree(hData);
+			}
+		}
+	}
+
+	if (extendedClipboardDataMessage.HasFlag(clipDIB)) {
+		length = (int)compressedStream.readU32();
+
+		if (length > 0) {
+			HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, length);
+
+			if (!hData) return false;
+
+			BYTE* pData = (BYTE*)GlobalLock(hData);
+
+			if (pData) {
+				compressedStream.readBytes(pData, length);
+
+				GlobalUnlock(hData);
+
+				if (!::SetClipboardData(ClipboardSettings::formatDIB, hData)) {
+					hData = NULL;
+					m_lengthDIB = length;
+				} else {
+					bFailed = true;
+				}
+			}
+
+			if (hData) {
+				GlobalFree(hData);
+			}
+		}
+	}
+
+	// we can ignore everything else
+
+	return true;
+}
+
+Clipboard::Clipboard(CARD32 caps)
+	: settings(caps)
+	, m_crc(0)
+	, m_bNeedToProvide(false)
+	, m_bNeedToNotify(false)
+	, m_notifiedRemoteFormats(0)
+{
+}
+
+// returns true if something changed
+bool Clipboard::UpdateClipTextEx(ClipboardData& clipboardData, CARD32 overrideFlags)
+{
+	if (m_crc == clipboardData.m_crc && overrideFlags == 0) {
+		return false;
+	}
+
+	if (overrideFlags & clipPeek) {
+		// don't reset anything regarding providing new data, just 'include' any
+		// formats into the notify response.
+		if (clipboardData.m_lengthText != 0) {
+			extendedClipboardDataNotifyMessage.AddFlag(clipText);
+			m_bNeedToNotify = true;
+		}
+		if (clipboardData.m_lengthRTF != 0) {
+			extendedClipboardDataNotifyMessage.AddFlag(clipRTF);
+			m_bNeedToNotify = true;
+		}
+		if (clipboardData.m_lengthHTML != 0) {
+			extendedClipboardDataNotifyMessage.AddFlag(clipHTML);
+			m_bNeedToNotify = true;
+		}
+		if (clipboardData.m_lengthDIB != 0) {
+			extendedClipboardDataNotifyMessage.AddFlag(clipDIB);
+			m_bNeedToNotify = true;
+		}
+	} else {
+
+		m_bNeedToProvide = false;
+		m_bNeedToNotify = false;
+		extendedClipboardDataMessage.Reset();
+		extendedClipboardDataNotifyMessage.Reset();
+
+		extendedClipboardDataMessage.AddFlag(clipProvide);
+		extendedClipboardDataNotifyMessage.AddFlag(clipNotify);
+
+		rdr::MemOutStream memStream;
+		{
+			rdr::ZlibOutStream compressedStream(&memStream, 0, 9); //Z_BEST_COMPRESSION
+
+			if (clipboardData.m_lengthText != 0) {
+				extendedClipboardDataNotifyMessage.AddFlag(clipText);
+
+				if (clipboardData.m_lengthText <= settings.m_nLimitText || (overrideFlags & clipText)) {
+					compressedStream.writeU32(clipboardData.m_lengthText);
+					compressedStream.writeBytes(clipboardData.m_pDataText, clipboardData.m_lengthText);
+					extendedClipboardDataMessage.AddFlag(clipText);
+					m_bNeedToProvide = true;
+				} else {
+					m_bNeedToNotify = true;
+				}
+			}
+			if (clipboardData.m_lengthRTF != 0) {
+				extendedClipboardDataNotifyMessage.AddFlag(clipRTF);
+
+				if (clipboardData.m_lengthRTF <= settings.m_nLimitRTF || (overrideFlags & clipRTF)) {
+					compressedStream.writeU32(clipboardData.m_lengthRTF);
+					compressedStream.writeBytes(clipboardData.m_pDataRTF, clipboardData.m_lengthRTF);
+					extendedClipboardDataMessage.AddFlag(clipRTF);
+					m_bNeedToProvide = true;
+				} else {
+					m_bNeedToNotify = true;
+				}
+			}
+			if (clipboardData.m_lengthHTML != 0) {
+				extendedClipboardDataNotifyMessage.AddFlag(clipHTML);
+
+				if (clipboardData.m_lengthHTML <= settings.m_nLimitHTML || (overrideFlags & clipHTML)) {
+					compressedStream.writeU32(clipboardData.m_lengthHTML);
+					compressedStream.writeBytes(clipboardData.m_pDataHTML, clipboardData.m_lengthHTML);
+					extendedClipboardDataMessage.AddFlag(clipHTML);
+					m_bNeedToProvide = true;
+				} else {
+					m_bNeedToNotify = true;
+				}
+			}
+			if (clipboardData.m_lengthDIB != 0) {
+				extendedClipboardDataNotifyMessage.AddFlag(clipDIB);
+
+				if (clipboardData.m_lengthDIB <= settings.m_nLimitDIB || (overrideFlags & clipDIB)) {
+					compressedStream.writeU32(clipboardData.m_lengthDIB);
+					compressedStream.writeBytes(clipboardData.m_pDataDIB, clipboardData.m_lengthDIB);
+					extendedClipboardDataMessage.AddFlag(clipDIB);
+					m_bNeedToProvide = true;
+				} else {
+					m_bNeedToNotify = true;
+				}
+			}
+
+			compressedStream.flush();
+		}
+
+		if (m_bNeedToProvide) {
+			extendedClipboardDataMessage.AppendBytes((BYTE*)memStream.data(), memStream.length());
+			memStream.clear();
+		}
+
+		m_strLastCutText = "";
+		if (!settings.m_bSupportsEx && clipboardData.m_lengthText > 0 && clipboardData.m_lengthText < settings.m_nLimitText) {			
+			// now we have to translate to UTF-16
+			int nConvertedSize = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)clipboardData.m_pDataText, clipboardData.m_lengthText, NULL, 0);
+
+			if (nConvertedSize > 0) {
+				wchar_t* clipStr = new wchar_t[nConvertedSize];
+				int nFinalConvertedSize = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)clipboardData.m_pDataText, clipboardData.m_lengthText, (LPWSTR)clipStr, nConvertedSize);
+
+				if (nFinalConvertedSize > 0) {
+					std::wstring wstrClipboard(clipStr);
+					m_strLastCutText.assign(wstrClipboard.begin(), wstrClipboard.end());
+				}
+
+				delete[] clipStr;
+			}
+		}
+
+		m_crc = clipboardData.m_crc;
+
+		if ( (!(settings.m_remoteCaps & clipNotify)) || (overrideFlags != 0) ) {
+			m_bNeedToNotify = false;
+			extendedClipboardDataNotifyMessage.Reset();
+		}
+	}
+
+	return m_bNeedToProvide || m_bNeedToNotify;
+}
diff --git a/ica/win32/common/Clipboard.h b/ica/win32/common/Clipboard.h
new file mode 100644
index 0000000..f7f930b
--- /dev/null
+++ b/ica/win32/common/Clipboard.h
@@ -0,0 +1,168 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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/
+//
+////////////////////////////////////////////////////////////////////////////
+
+
+// Clipboard.h
+
+// adzm - July 2010
+//
+// Common classes for dealing with the clipboard, including serializing and deserializing compressed data, hashing and comparing, etc.
+// Used by server and viewer.
+
+#pragma once
+
+#define VC_EXTRALEAN
+#include <windows.h>
+#include <string>
+#include <rdr/MemOutStream.h>
+#include "rfb.h"
+
+struct ExtendedClipboardDataMessage {
+	ExtendedClipboardDataMessage();
+	~ExtendedClipboardDataMessage();
+
+	void Reset();
+	void AddFlag(CARD32 flag);
+	bool HasFlag(CARD32 flag);
+
+	int GetMessageLength();	// does not include rfbExtendedClipboardData
+	int GetDataLength();	// does include rfbExtendedClipboardData
+	const BYTE* GetData();
+
+	BYTE* GetBuffer();		// writable buffer
+	int GetBufferLength();	// does include rfbExtendedClipboardData
+
+	const BYTE* GetCurrentPos();
+
+	rfbExtendedClipboardData* m_pExtendedData;
+
+	void AppendInt(CARD32 val); // swaps if LE
+	void AppendBytes(BYTE* pData, int length);
+	void Advance(int len);
+	CARD32 ReadInt();
+
+	void EnsureBufferLength(int len, bool bGrowBeyond = true);
+
+	int CountFormats();
+	CARD32 GetFlags();
+
+protected:
+
+	int m_nInternalLength;
+	BYTE* m_pCurrentPos;
+	BYTE* m_pData;
+};
+
+struct ClipboardSettings {
+	ClipboardSettings(CARD32 caps);
+
+	static CARD32 defaultCaps;
+	static CARD32 defaultViewerCaps;
+	static CARD32 defaultServerCaps;
+
+	static const UINT formatDIB;
+	static const UINT formatHTML;
+	static const UINT formatRTF;
+	static const UINT formatUnicodeText;
+
+	static const int defaultLimitText;
+	static const int defaultLimitRTF;
+	static const int defaultLimitHTML;
+	static const int defaultLimitDIB;
+
+	static const int defaultLimit;
+
+	///////
+
+	bool m_bSupportsEx;
+
+	int m_nLimitText;
+	int m_nLimitRTF;
+	int m_nLimitHTML;
+	int m_nLimitDIB;
+
+	int m_nRequestedLimitText;
+	int m_nRequestedLimitRTF;
+	int m_nRequestedLimitHTML;
+	int m_nRequestedLimitDIB;
+
+	CARD32 m_myCaps;
+
+	CARD32 m_remoteCaps; // messages and formats that will be handled by the remote application
+
+	void PrepareCapsPacket(ExtendedClipboardDataMessage& extendedDataMessage);
+
+	void HandleCapsPacket(ExtendedClipboardDataMessage& extendedDataMessage, bool bSetLimits);
+};
+
+struct ClipboardHolder {
+	ClipboardHolder(HWND hwndOwner);
+
+	~ClipboardHolder();
+
+	bool m_bIsOpen;
+};
+
+struct ClipboardData {
+	ClipboardData();
+
+	~ClipboardData();
+
+	DWORD m_crc;
+
+	int m_lengthText;
+	int m_lengthRTF;
+	int m_lengthHTML;
+	int m_lengthDIB;
+
+	BYTE* m_pDataText;
+	BYTE* m_pDataRTF;
+	BYTE* m_pDataHTML;
+	BYTE* m_pDataDIB;
+
+	void FreeData();
+
+	bool Load(HWND hwndOwner); // will return false on failure
+
+	bool Restore(HWND hwndOwner, ExtendedClipboardDataMessage& extendedClipboardDataMessage);
+};
+
+struct Clipboard {
+	Clipboard(CARD32 caps);
+
+	bool UpdateClipTextEx(ClipboardData& clipboardData, CARD32 overrideFlags = 0); // returns true if something changed
+
+	ClipboardSettings settings;
+	DWORD m_crc;
+	std::string m_strLastCutText; // for non-extended clipboards
+
+	bool m_bNeedToProvide;
+	bool m_bNeedToNotify;
+
+	CARD32 m_notifiedRemoteFormats;
+
+	ExtendedClipboardDataMessage extendedClipboardDataMessage;
+	ExtendedClipboardDataMessage extendedClipboardDataNotifyMessage;
+};
+
diff --git a/ica/win32/common/ScopeGuard.h b/ica/win32/common/ScopeGuard.h
new file mode 100644
index 0000000..da7a2e2
--- /dev/null
+++ b/ica/win32/common/ScopeGuard.h
@@ -0,0 +1,320 @@
+#ifndef SCOPEGUARD_H_
+#define SCOPEGUARD_H_
+
+/*
+  Scopeguard, by Andrei Alexandrescu and Petru Marginean, December 2000.
+  Modified by Joshua Lehrer, FactSet Research Systems, November 2005.
+*/
+
+template <class T>
+class RefHolder
+{
+	T& ref_;
+public:
+	RefHolder(T& ref) : ref_(ref) {}
+	operator T& () const 
+	{
+		return ref_;
+	}
+private:
+    // Disable assignment - not implemented
+    RefHolder& operator=(const RefHolder&);
+};
+
+template <class T>
+inline RefHolder<T> ByRef(T& t)
+{
+	return RefHolder<T>(t);
+}
+
+class ScopeGuardImplBase
+{
+	ScopeGuardImplBase& operator =(const ScopeGuardImplBase&);
+protected:
+	~ScopeGuardImplBase()
+	{
+	}
+	ScopeGuardImplBase(const ScopeGuardImplBase& other) throw() 
+		: dismissed_(other.dismissed_)
+	{
+		other.Dismiss();
+	}
+	template <typename J>
+	static void SafeExecute(J& j) throw() 
+	{
+		if (!j.dismissed_)
+			try
+			{
+				j.Execute();
+			}
+			catch(...)
+			{
+			}
+	}
+	
+	mutable bool dismissed_;
+public:
+	ScopeGuardImplBase() throw() : dismissed_(false) 
+	{
+	}
+	void Dismiss() const throw() 
+	{
+		dismissed_ = true;
+	}
+};
+
+typedef const ScopeGuardImplBase& ScopeGuard;
+
+template <typename F>
+class ScopeGuardImpl0 : public ScopeGuardImplBase
+{
+public:
+	static ScopeGuardImpl0<F> MakeGuard(F fun)
+	{
+		return ScopeGuardImpl0<F>(fun);
+	}
+	~ScopeGuardImpl0() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute() 
+	{
+		fun_();
+	}
+protected:
+	ScopeGuardImpl0(F fun) : fun_(fun) 
+	{
+	}
+	F fun_;
+};
+
+template <typename F> 
+inline ScopeGuardImpl0<F> MakeGuard(F fun)
+{
+	return ScopeGuardImpl0<F>::MakeGuard(fun);
+}
+
+template <typename F, typename P1>
+class ScopeGuardImpl1 : public ScopeGuardImplBase
+{
+public:
+	static ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1)
+	{
+		return ScopeGuardImpl1<F, P1>(fun, p1);
+	}
+	~ScopeGuardImpl1() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute()
+	{
+		fun_(p1_);
+	}
+protected:
+	ScopeGuardImpl1(F fun, P1 p1) : fun_(fun), p1_(p1) 
+	{
+	}
+	F fun_;
+	const P1 p1_;
+};
+
+template <typename F, typename P1> 
+inline ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1)
+{
+	return ScopeGuardImpl1<F, P1>::MakeGuard(fun, p1);
+}
+
+template <typename F, typename P1, typename P2>
+class ScopeGuardImpl2: public ScopeGuardImplBase
+{
+public:
+	static ScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2)
+	{
+		return ScopeGuardImpl2<F, P1, P2>(fun, p1, p2);
+	}
+	~ScopeGuardImpl2() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute()
+	{
+		fun_(p1_, p2_);
+	}
+protected:
+	ScopeGuardImpl2(F fun, P1 p1, P2 p2) : fun_(fun), p1_(p1), p2_(p2) 
+	{
+	}
+	F fun_;
+	const P1 p1_;
+	const P2 p2_;
+};
+
+template <typename F, typename P1, typename P2>
+inline ScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2)
+{
+	return ScopeGuardImpl2<F, P1, P2>::MakeGuard(fun, p1, p2);
+}
+
+template <typename F, typename P1, typename P2, typename P3>
+class ScopeGuardImpl3 : public ScopeGuardImplBase
+{
+public:
+	static ScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
+	{
+		return ScopeGuardImpl3<F, P1, P2, P3>(fun, p1, p2, p3);
+	}
+	~ScopeGuardImpl3() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute()
+	{
+		fun_(p1_, p2_, p3_);
+	}
+protected:
+	ScopeGuardImpl3(F fun, P1 p1, P2 p2, P3 p3) : fun_(fun), p1_(p1), p2_(p2), p3_(p3) 
+	{
+	}
+	F fun_;
+	const P1 p1_;
+	const P2 p2_;
+	const P3 p3_;
+};
+
+template <typename F, typename P1, typename P2, typename P3>
+inline ScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
+{
+	return ScopeGuardImpl3<F, P1, P2, P3>::MakeGuard(fun, p1, p2, p3);
+}
+
+//************************************************************
+
+template <class Obj, typename MemFun>
+class ObjScopeGuardImpl0 : public ScopeGuardImplBase
+{
+public:
+	static ObjScopeGuardImpl0<Obj, MemFun> MakeObjGuard(Obj& obj, MemFun memFun)
+	{
+		return ObjScopeGuardImpl0<Obj, MemFun>(obj, memFun);
+	}
+	~ObjScopeGuardImpl0() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute() 
+	{
+		(obj_.*memFun_)();
+	}
+protected:
+	ObjScopeGuardImpl0(Obj& obj, MemFun memFun) 
+		: obj_(obj), memFun_(memFun) {}
+	Obj& obj_;
+	MemFun memFun_;
+};
+
+template <class Obj, typename MemFun>
+inline ObjScopeGuardImpl0<Obj, MemFun> MakeObjGuard(Obj& obj, MemFun memFun)
+{
+	return ObjScopeGuardImpl0<Obj, MemFun>::MakeObjGuard(obj, memFun);
+}
+
+template <typename Ret, class Obj1, class Obj2>
+inline ObjScopeGuardImpl0<Obj1,Ret(Obj2::*)()> MakeGuard(Ret(Obj2::*memFun)(), Obj1 &obj) {
+  return ObjScopeGuardImpl0<Obj1,Ret(Obj2::*)()>::MakeObjGuard(obj,memFun);
+}
+
+template <typename Ret, class Obj1, class Obj2>
+inline ObjScopeGuardImpl0<Obj1,Ret(Obj2::*)()> MakeGuard(Ret(Obj2::*memFun)(), Obj1 *obj) {
+  return ObjScopeGuardImpl0<Obj1,Ret(Obj2::*)()>::MakeObjGuard(*obj,memFun);
+}
+
+template <class Obj, typename MemFun, typename P1>
+class ObjScopeGuardImpl1 : public ScopeGuardImplBase
+{
+public:
+	static ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
+	{
+		return ObjScopeGuardImpl1<Obj, MemFun, P1>(obj, memFun, p1);
+	}
+	~ObjScopeGuardImpl1() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute() 
+	{
+		(obj_.*memFun_)(p1_);
+	}
+protected:
+	ObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1) 
+		: obj_(obj), memFun_(memFun), p1_(p1) {}
+	Obj& obj_;
+	MemFun memFun_;
+	const P1 p1_;
+};
+
+template <class Obj, typename MemFun, typename P1>
+inline ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
+{
+	return ObjScopeGuardImpl1<Obj, MemFun, P1>::MakeObjGuard(obj, memFun, p1);
+}
+
+template <typename Ret, class Obj1, class Obj2, typename P1a, typename P1b>
+inline ObjScopeGuardImpl1<Obj1,Ret(Obj2::*)(P1a),P1b> MakeGuard(Ret(Obj2::*memFun)(P1a), Obj1 &obj, P1b p1) {
+  return ObjScopeGuardImpl1<Obj1,Ret(Obj2::*)(P1a),P1b>::MakeObjGuard(obj,memFun,p1);
+}
+
+template <typename Ret, class Obj1, class Obj2, typename P1a, typename P1b>
+inline ObjScopeGuardImpl1<Obj1,Ret(Obj2::*)(P1a),P1b> MakeGuard(Ret(Obj2::*memFun)(P1a), Obj1 *obj, P1b p1) {
+  return ObjScopeGuardImpl1<Obj1,Ret(Obj2::*)(P1a),P1b>::MakeObjGuard(*obj,memFun,p1);
+}
+
+template <class Obj, typename MemFun, typename P1, typename P2>
+class ObjScopeGuardImpl2 : public ScopeGuardImplBase
+{
+public:
+	static ObjScopeGuardImpl2<Obj, MemFun, P1, P2> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
+	{
+		return ObjScopeGuardImpl2<Obj, MemFun, P1, P2>(obj, memFun, p1, p2);
+	}
+	~ObjScopeGuardImpl2() throw() 
+	{
+		SafeExecute(*this);
+	}
+	void Execute() 
+	{
+		(obj_.*memFun_)(p1_, p2_);
+	}
+protected:
+	ObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2) 
+		: obj_(obj), memFun_(memFun), p1_(p1), p2_(p2) {}
+	Obj& obj_;
+	MemFun memFun_;
+	const P1 p1_;
+	const P2 p2_;
+};
+
+template <class Obj, typename MemFun, typename P1, typename P2>
+inline ObjScopeGuardImpl2<Obj, MemFun, P1, P2> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
+{
+	return ObjScopeGuardImpl2<Obj, MemFun, P1, P2>::MakeObjGuard(obj, memFun, p1, p2);
+}
+
+template <typename Ret, class Obj1, class Obj2, typename P1a, typename P1b, typename P2a, typename P2b>
+inline ObjScopeGuardImpl2<Obj1,Ret(Obj2::*)(P1a,P2a),P1b,P2b> MakeGuard(Ret(Obj2::*memFun)(P1a,P2a), Obj1 &obj, P1b p1, P2b p2) {
+  return ObjScopeGuardImpl2<Obj1,Ret(Obj2::*)(P1a,P2a),P1b,P2b>::MakeObjGuard(obj,memFun,p1,p2);
+}
+
+template <typename Ret, class Obj1, class Obj2, typename P1a, typename P1b, typename P2a, typename P2b>
+inline ObjScopeGuardImpl2<Obj1,Ret(Obj2::*)(P1a,P2a),P1b,P2b> MakeGuard(Ret(Obj2::*memFun)(P1a,P2a), Obj1 *obj, P1b p1, P2b p2) {
+  return ObjScopeGuardImpl2<Obj1,Ret(Obj2::*)(P1a,P2a),P1b,P2b>::MakeObjGuard(*obj,memFun,p1,p2);
+}
+
+
+#define CONCATENATE_DIRECT(s1, s2) s1##s2
+#define CONCATENATE(s1, s2) CONCATENATE_DIRECT(s1, s2)
+#define ANONYMOUS_VARIABLE(str) CONCATENATE(str, __LINE__)
+
+#define ON_BLOCK_EXIT ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeGuard
+#define ON_BLOCK_EXIT_OBJ ScopeGuard ANONYMOUS_VARIABLE(scopeGuard) = MakeObjGuard
+
+#endif //SCOPEGUARD_H_
diff --git a/ica/win32/common/win32_helpers.cpp b/ica/win32/common/win32_helpers.cpp
new file mode 100644
index 0000000..5e1d041
--- /dev/null
+++ b/ica/win32/common/win32_helpers.cpp
@@ -0,0 +1,99 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include <windows.h>
+#include "win32_helpers.h"
+
+namespace helper {
+
+void SafeSetMsgResult(HWND hwnd, LPARAM result)
+{
+#ifndef _X64
+	SetWindowLong(hwnd, DWL_MSGRESULT, result);
+#else
+	SetWindowLongPtr(hwnd, DWLP_MSGRESULT, result);
+#endif
+}
+
+void SafeSetWindowUserData(HWND hwnd, LPARAM lParam)
+{
+#ifndef _X64
+	SetWindowLong(hwnd, GWL_USERDATA, lParam);
+#else
+	SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
+#endif
+}
+
+HINSTANCE SafeGetWindowInstance(HWND hWnd)
+{
+#ifndef _X64
+    HINSTANCE hInstance = (HINSTANCE)GetWindowLong(hWnd,GWL_HINSTANCE);
+#else
+    HINSTANCE hInstance = (HINSTANCE)GetWindowLongPtr(hWnd,GWLP_HINSTANCE);
+#endif
+    return hInstance;
+}
+
+LONG SafeGetWindowProc(HWND hWnd)
+{
+#ifndef _X64
+    LONG pWndProc = GetWindowLong(hWnd, GWL_WNDPROC);
+#else
+    LONG pWndProc = GetWindowLongPtr(hWnd, GWLP_WNDPROC);
+#endif
+    return pWndProc;
+}
+
+void SafeSetWindowProc(HWND hWnd, LONG pWndProc)
+{
+#ifndef _X64
+    SetWindowLong(hWnd, GWL_WNDPROC, pWndProc);
+#else
+    SetWindowLongPtr(hWnd, GWLP_WNDPROC, pWndProc);
+#endif
+}
+
+void close_handle(HANDLE& h)
+{
+    if (h != INVALID_HANDLE_VALUE) 
+    {
+        ::CloseHandle(h);
+        h = INVALID_HANDLE_VALUE;
+    }
+}
+
+DynamicFnBase::DynamicFnBase(const TCHAR* dllName, const char* fnName) : fnPtr(0), dllHandle(0) {
+  dllHandle = LoadLibrary(dllName);
+  if (!dllHandle) {
+    return;
+  }
+  fnPtr = (void *) GetProcAddress(dllHandle, fnName);
+}
+
+DynamicFnBase::~DynamicFnBase() {
+  if (dllHandle)
+    FreeLibrary(dllHandle);
+}
+
+} // namespace helper
diff --git a/ica/win32/common/win32_helpers.h b/ica/win32/common/win32_helpers.h
new file mode 100644
index 0000000..b3c91da
--- /dev/null
+++ b/ica/win32/common/win32_helpers.h
@@ -0,0 +1,72 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#if !defined(UVNC_COMMON_H)
+#define UVNC_COMMON_H
+
+namespace helper {
+
+template<typename T> inline T *SafeGetWindowUserData(HWND hwnd)
+{
+    T *pUserData;
+#ifndef _X64
+	pUserData = (T *) GetWindowLong(hwnd, GWL_USERDATA);
+#else
+	pUserData = (T *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+#endif
+
+    return pUserData;
+}
+
+void SafeSetWindowUserData(HWND hwnd, LPARAM lParam);
+
+// DWL_MSGRESULT
+void SafeSetMsgResult(HWND hwnd, LPARAM result);
+// GWL_HINSTANCE
+HINSTANCE SafeGetWindowInstance(HWND hWnd);
+// GWL_WNDPROC
+LONG SafeGetWindowProc(HWND hWnd);
+void SafeSetWindowProc(HWND hWnd, LONG pWndProc);
+
+void close_handle(HANDLE& h);
+
+    class DynamicFnBase {
+    public:
+      DynamicFnBase(const TCHAR* dllName, const char* fnName);
+      ~DynamicFnBase();
+      bool isValid() const {return fnPtr != 0;}
+    protected:
+      void* fnPtr;
+      HMODULE dllHandle;
+    };
+
+    template<typename T> class DynamicFn : public DynamicFnBase {
+    public:
+      DynamicFn(const TCHAR* dllName, const char* fnName) : DynamicFnBase(dllName, fnName) {}
+      T operator *() const {return (T)fnPtr;};
+    };
+
+}
+
+#endif
diff --git a/ica/win32/crtdbg.h b/ica/win32/crtdbg.h
deleted file mode 100644
index e69de29..0000000
diff --git a/ica/win32/keysymdef.h b/ica/win32/keysymdef.h
deleted file mode 100644
index 5196871..0000000
--- a/ica/win32/keysymdef.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "rfb/keysym.h"
diff --git a/ica/win32/libjpeg/jpeglib.h b/ica/win32/libjpeg/jpeglib.h
deleted file mode 100644
index e54ba1b..0000000
--- a/ica/win32/libjpeg/jpeglib.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <jpeglib.h>
diff --git a/ica/win32/rdr/Exception.h b/ica/win32/rdr/Exception.h
new file mode 100644
index 0000000..9413236
--- /dev/null
+++ b/ica/win32/rdr/Exception.h
@@ -0,0 +1,71 @@
+//
+// 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 __RDR_EXCEPTION_H__
+#define __RDR_EXCEPTION_H__
+
+#include <stdio.h>
+#include <string.h>
+
+namespace rdr {
+
+  struct Exception {
+    enum { len = 256 };
+    char str_[len];
+    Exception(const char* s=0, const char* e="rdr::Exception") {
+      str_[0] = 0;
+      strncat(str_, e, len-1);
+      if (s) {
+        strncat(str_, ": ", len-1-strlen(str_));
+        strncat(str_, s, len-1-strlen(str_));
+      }
+    }
+    virtual const char* str() const { return str_; }
+  };
+
+  struct SystemException : public Exception {
+    int err;
+    SystemException(const char* s, int err_) : err(err_) {
+      str_[0] = 0;
+      strncat(str_, "rdr::SystemException: ", len-1);
+      strncat(str_, s, len-1-strlen(str_));
+      strncat(str_, ": ", len-1-strlen(str_));
+      strncat(str_, strerror(err), len-1-strlen(str_));
+      strncat(str_, " (", len-1-strlen(str_));
+      char buf[20];
+      sprintf(buf,"%d",err);
+      strncat(str_, buf, len-1-strlen(str_));
+      strncat(str_, ")", len-1-strlen(str_));
+    }
+  }; 
+
+  struct TimedOut : public Exception {
+    TimedOut(const char* s=0) : Exception(s,"rdr::TimedOut") {}
+  };
+ 
+  struct EndOfStream : public Exception {
+    EndOfStream(const char* s=0) : Exception(s,"rdr::EndOfStream") {}
+  };
+
+  struct FrameException : public Exception {
+    FrameException(const char* s=0) : Exception(s,"rdr::FrameException") {}
+  };
+
+}
+
+#endif
diff --git a/ica/win32/rdr/FdInStream.cxx b/ica/win32/rdr/FdInStream.cxx
new file mode 100644
index 0000000..5e3285c
--- /dev/null
+++ b/ica/win32/rdr/FdInStream.cxx
@@ -0,0 +1,387 @@
+// Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+// 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.
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/types.h>
+#ifdef _WIN32
+// adzm 2010-08 - use winsock2
+#include <winsock2.h>
+#include <sys/timeb.h>
+#define read(s,b,l) recv(s,(char*)b,l,0)
+#undef errno
+#define errno WSAGetLastError()
+#else
+#include <unistd.h>
+#include <sys/time.h>
+#endif
+
+// XXX should use autoconf HAVE_SYS_SELECT_H
+#ifdef _AIX
+#include <sys/select.h>
+#endif
+
+#include "FdInStream.h"
+#include "Exception.h"
+
+using namespace rdr;
+
+enum { DEFAULT_BUF_SIZE = 8192,
+       MIN_BULK_SIZE = 1024 };
+
+FdInStream::FdInStream(int fd_, int timeout_, int bufSize_)
+  : fd(fd_), timeout(timeout_), blockCallback(0), blockCallbackArg(0),
+    timing(false), timeWaitedIn100us(5), timedKbits(0),
+    bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
+{
+	ptr = end = start = new U8[bufSize];
+
+	// sf at 2002
+	m_fDSMMode = false;
+	m_fReadFromNetRectBuf = false;
+	m_nNetRectBufOffset = 0;
+	m_nReadSize = 0;
+
+	m_nBytesRead = 0; // For stats
+}
+
+FdInStream::FdInStream(int fd_, void (*blockCallback_)(void*),
+                       void* blockCallbackArg_, int bufSize_)
+  : fd(fd_), timeout(0), blockCallback(blockCallback_),
+    blockCallbackArg(blockCallbackArg_),
+    timing(false), timeWaitedIn100us(5), timedKbits(0),
+    bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
+{
+	ptr = end = start = new U8[bufSize];
+	
+	// sf at 2002
+	m_fDSMMode = false;
+	m_fReadFromNetRectBuf = false;
+	m_nNetRectBufOffset = 0;
+	m_nReadSize = 0;
+	
+}
+
+FdInStream::~FdInStream()
+{
+  delete [] start;
+}
+
+void
+FdInStream::Update_socket()
+{
+  // test, not used
+  //fd=INVALID_SOCKET;
+}
+
+
+int FdInStream::pos()
+{
+  return offset + ptr - start;
+}
+
+void FdInStream::readBytes(void* data, int length)
+{
+	// sf at 2003 - Seems to fix the ZRLE+DSM bug... 
+	if (!m_fDSMMode)
+	{
+		if (length < MIN_BULK_SIZE)
+		{
+			InStream::readBytes(data, length);
+			return;
+		}
+	}
+	
+	U8* dataPtr = (U8*)data;
+	
+	int	n = end - ptr;
+	if (n > length) n = length;
+	
+	memcpy(dataPtr, ptr, n);
+	dataPtr += n;
+	length -= n;
+	ptr += n;
+
+	while (length > 0) {
+		n = readWithTimeoutOrCallback(dataPtr, length);
+		dataPtr += n;
+		length -= n;
+		offset += n;
+	}
+}
+
+
+int FdInStream::overrun(int itemSize, int nItems)
+{
+  if (itemSize > bufSize)
+    throw Exception("FdInStream overrun: max itemSize exceeded");
+
+  if (end - ptr != 0)
+    memmove(start, ptr, end - ptr);
+
+  offset += ptr - start;
+  end -= ptr - start;
+  ptr = start;
+
+  while (end < start + itemSize) {
+    int n = readWithTimeoutOrCallback((U8*)end, start + bufSize - end);
+    end += n;
+  }
+
+  if (itemSize * nItems > end - ptr)
+    nItems = (end - ptr) / itemSize;
+
+  return nItems;
+}
+
+
+int FdInStream::Check_if_buffer_has_data()
+{
+ InStream::setptr(InStream::getend());
+ return checkReadable(fd, 500);
+}
+
+int FdInStream::checkReadable(int fd, int timeout)
+{
+  while (true) {
+    fd_set rfds;
+    struct timeval tv;
+    
+    tv.tv_sec = timeout / 1000;
+    tv.tv_usec = (timeout % 1000) * 1000;
+
+    FD_ZERO(&rfds);
+    FD_SET(fd, &rfds);
+    int n = select(fd+1, &rfds, 0, 0, &tv);
+    if (n != -1 || errno != EINTR)
+      return n;
+    fprintf(stderr,"select returned EINTR\n");
+  }
+}
+
+/*#ifdef _WIN32
+static void gettimeofday_(struct timeval* tv, void*)
+{
+  LARGE_INTEGER counts, countsPerSec;
+  static double usecPerCount = 0.0;
+  counts.QuadPart=0;
+  if (QueryPerformanceCounter(&counts)) {
+    if (usecPerCount == 0.0) {
+      QueryPerformanceFrequency(&countsPerSec);
+	  if (countsPerSec.QuadPart!=0)
+      usecPerCount = 1000000.0 / countsPerSec.QuadPart;
+	  else usecPerCount = 200;
+    }
+
+    LONGLONG usecs = (LONGLONG)(counts.QuadPart * usecPerCount);
+	
+    tv->tv_usec = (long)((LONGLONG)usecs % (LONGLONG)1000000);
+    tv->tv_sec = (long)(usecs / 1000000);
+
+  } else {
+    struct timeb tb;
+    ftime(&tb);
+    tv->tv_sec = (long)tb.time;
+    tv->tv_usec = tb.millitm * 1000;
+  }
+}
+#endif*/
+
+#ifdef _WIN32
+LONGLONG 
+Passedusecs()
+{
+  LARGE_INTEGER counts, countsPerSec;
+  static LONGLONG usecPerCount = 0;
+  LONGLONG usecs=0;
+
+  if (QueryPerformanceCounter(&counts)) {
+    if (usecPerCount == 0) {
+      QueryPerformanceFrequency(&countsPerSec);
+      usecPerCount = 1000000000000000000 / countsPerSec.QuadPart;
+    }
+    usecs = (LONGLONG)(counts.QuadPart * usecPerCount /1000000000000);
+
+  } else {
+    struct timeb tb;
+    ftime(&tb);
+	usecs=tb.time*1000000+tb.millitm * 1000;
+  }
+  return usecs;
+}
+#endif
+
+int FdInStream::readWithTimeoutOrCallback(void* buf, int len)
+{
+  /*struct timeval before = {0, 0}, after; // before will not get initialized if the condition is false
+  if (timing)
+    gettimeofday_(&before, NULL);*/
+  LONGLONG before =0, after; // before will not get initialized if the condition is false
+  if (timing)
+    before=Passedusecs();
+
+  if (fd==INVALID_SOCKET) 
+	  throw SystemException("read",errno);
+
+  int n=0;
+  if (!m_fReadFromNetRectBuf)
+  {
+	  n = checkReadable(fd, timeout);
+	  
+	  if (n < 0) throw SystemException("select",errno);
+	  
+	  if (n == 0)
+	  {
+		  if (timeout) throw TimedOut();
+		  if (blockCallback) (*blockCallback)(blockCallbackArg);
+	  }
+  }
+	if (fd==INVALID_SOCKET) 
+		throw SystemException("read",errno);
+  bool fAlreadyCounted = false; // sf at 2004 - Avoid to count the plugin processed bytes twice...
+
+  while (true)
+  {
+	  if (fd==INVALID_SOCKET) 
+		throw SystemException("read",errno);
+	// sf at 2002 - DSM Plugin hack - Only necessary for ZRLE encoding
+	// If we must read already restored data from DSMPLugin memory  
+	if (m_fReadFromNetRectBuf)
+	{
+		int nRem = m_nReadSize - m_nNetRectBufOffset;
+		int nRead = (len <= nRem) ? len : nRem;
+		memcpy(buf, m_pNetRectBuf + m_nNetRectBufOffset, nRead);
+		m_nNetRectBufOffset += nRead;
+		if (m_nNetRectBufOffset == m_nReadSize)
+		{
+			// Next read calls should read the socket
+			m_fReadFromNetRectBuf = false;
+			m_nNetRectBufOffset = 0;
+			m_nReadSize = 0;
+		}
+		n = nRead;
+		fAlreadyCounted = true;
+	}
+	else
+	{
+		n = ::read(fd, buf, len);
+	}
+
+    if (n != -1 || errno != EINTR)
+      break;
+    fprintf(stderr,"read returned EINTR\n");
+  }
+
+  if (n < 0) throw SystemException("read",errno);
+  if (n == 0) throw EndOfStream("read");
+
+  if (fAlreadyCounted)
+	  return n; 
+
+  // sf at 2002 - stats
+  m_nBytesRead += n;
+
+  if (timing)
+  {
+    after=Passedusecs();
+
+    LONGLONG newTimeWaited = (after- before)/100;
+    int newKbits = n * 8 / 1000;
+    if (newTimeWaited > newKbits*1000) newTimeWaited = newKbits*1000;
+    if (newTimeWaited < newKbits/4)    newTimeWaited = newKbits/4;
+
+    timeWaitedIn100us += (unsigned int)newTimeWaited;
+    timedKbits += newKbits;
+  }
+
+
+  /*if (timing)
+  {
+    gettimeofday_(&after, 0);
+//      fprintf(stderr,"%d.%06d\n",(after.tv_sec - before.tv_sec),
+//              (after.tv_usec - before.tv_usec));
+    int newTimeWaited = ((after.tv_sec - before.tv_sec) * 10000 +
+                         (after.tv_usec - before.tv_usec) / 100);
+    int newKbits = n * 8 / 1000;
+
+//      if (newTimeWaited == 0) {
+//        fprintf(stderr,"new kbps infinite t %d k %d\n",
+//                newTimeWaited, newKbits);
+//      } else {
+//        fprintf(stderr,"new kbps %d t %d k %d\n",
+//                newKbits * 10000 / newTimeWaited, newTimeWaited, newKbits);
+//      }
+
+    // limit rate to between 10kbit/s and 40Mbit/s
+
+    if (newTimeWaited > newKbits*1000) newTimeWaited = newKbits*1000;
+    if (newTimeWaited < newKbits/4)    newTimeWaited = newKbits/4;
+
+    timeWaitedIn100us += newTimeWaited;
+    timedKbits += newKbits;
+  }*/
+
+  return n;
+}
+
+void FdInStream::startTiming()
+{
+  timing = true;
+
+  // Carry over up to 1s worth of previous rate for smoothing.
+
+  if (timeWaitedIn100us > 10000) {
+    timedKbits = timedKbits * 10000 / timeWaitedIn100us;
+    timeWaitedIn100us = 10000;
+  }
+}
+
+void FdInStream::stopTiming()
+{
+  timing = false; 
+  if (timeWaitedIn100us < timedKbits/2)
+    timeWaitedIn100us = timedKbits/2; // upper limit 20Mbit/s
+}
+
+unsigned int FdInStream::kbitsPerSecond()
+{
+  // The following calculation will overflow 32-bit arithmetic if we have
+  // received more than about 50Mbytes (400Mbits) since we started timing, so
+  // it should be OK for a single RFB update.
+
+  return timedKbits * 10000 / timeWaitedIn100us;
+}
+
+
+//
+// sf at 2002 - DSMPlugin - This hack is necessary because
+// the ZRLE encoder/decoder does not use the SendExact/ReadExact functions
+// like ALL the others encoders...
+// 
+void FdInStream::SetReadFromMemoryBuffer(int nReadSize, char* pMemBuffer)
+{
+	m_nReadSize = nReadSize; // Nb of bytes to read from buffer instead of socket
+	m_pNetRectBuf = pMemBuffer; // The memory buffer containing restored data
+	m_nNetRectBufOffset = 0;   // Initial offset
+
+	m_fReadFromNetRectBuf = true; // Order to read from the buffer
+}
+
+
+
diff --git a/ica/win32/rdr/FdInStream.h b/ica/win32/rdr/FdInStream.h
new file mode 100644
index 0000000..4631904
--- /dev/null
+++ b/ica/win32/rdr/FdInStream.h
@@ -0,0 +1,89 @@
+//
+// 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.
+
+//
+// FdInStream streams from a file descriptor.
+//
+
+#ifndef __RDR_FDINSTREAM_H__
+#define __RDR_FDINSTREAM_H__
+
+#pragma once
+
+#include "InStream.h"
+
+namespace rdr {
+
+  class FdInStream : public InStream {
+
+  public:
+
+    FdInStream(int fd, int timeout=0, int bufSize=0);
+    FdInStream(int fd, void (*blockCallback)(void*), void* blockCallbackArg=0,
+		  int bufSize=0);
+    virtual ~FdInStream();
+
+    int getFd() { return fd; }
+    int pos();
+    void readBytes(void* data, int length);
+    int bytesInBuf() { return end - ptr; }
+
+	void Update_socket();
+    void startTiming();
+    void stopTiming();
+    unsigned int kbitsPerSecond();
+    unsigned int timeWaited() { return timeWaitedIn100us; }
+
+	void SetDSMMode(bool fDSMMode){m_fDSMMode = fDSMMode;}; // sf at 2002 
+	void SetReadFromMemoryBuffer(int nReadSize, char* pMemBuffer); // sf at 2002 
+	bool GetReadFromMemoryBuffer(void) {return m_fReadFromNetRectBuf;}; // sf at 2002 
+	__int64 GetBytesRead() {return m_nBytesRead;};
+	int Check_if_buffer_has_data();
+
+  protected:
+    int overrun(int itemSize, int nItems);
+
+  private:
+    int checkReadable(int fd, int timeout);
+    int readWithTimeoutOrCallback(void* buf, int len);
+
+    int fd;
+    int timeout;
+    void (*blockCallback)(void*);
+    void* blockCallbackArg;
+
+    bool timing;
+    unsigned int timeWaitedIn100us;
+    unsigned int timedKbits;
+
+    int bufSize;
+    int offset;
+    U8* start;
+
+	// sf at 2002 - DSMPlugin hack
+	bool m_fDSMMode;
+	char* m_pNetRectBuf;
+	bool m_fReadFromNetRectBuf; 
+	int m_nNetRectBufOffset;
+	int m_nReadSize;
+	__int64 m_nBytesRead;
+  };
+
+} // end of namespace rdr
+
+#endif
diff --git a/ica/win32/rdr/FdOutStream.cxx b/ica/win32/rdr/FdOutStream.cxx
new file mode 100644
index 0000000..f93e8d7
--- /dev/null
+++ b/ica/win32/rdr/FdOutStream.cxx
@@ -0,0 +1,114 @@
+//
+// 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.
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/types.h>
+#ifdef _WIN32
+// adzm 2010-08 - use winsock2
+#include <winsock2.h>
+#define write(s,b,l) send(s,(const char*)b,l,0)
+#undef errno
+#define errno WSAGetLastError()
+#else
+#include <unistd.h>
+#include <sys/time.h>
+#endif
+
+#include "FdOutStream.h"
+#include "Exception.h"
+
+
+using namespace rdr;
+
+enum { DEFAULT_BUF_SIZE = 16384,
+       MIN_BULK_SIZE = 1024 };
+
+FdOutStream::FdOutStream(int fd_, int bufSize_)
+  : fd(fd_), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
+{
+  ptr = start = new U8[bufSize];
+  end = start + bufSize;
+}
+
+FdOutStream::~FdOutStream()
+{
+  try {
+    flush();
+  } catch (Exception&) {
+  }
+  delete [] start;
+}
+
+
+void FdOutStream::writeBytes(const void* data, int length)
+{
+  if (length < MIN_BULK_SIZE) {
+    OutStream::writeBytes(data, length);
+    return;
+  }
+
+  const U8* dataPtr = (const U8*)data;
+
+  flush();
+
+  while (length > 0) {
+    int n = write(fd, dataPtr, length);
+
+    if (n < 0) throw SystemException("write",errno);
+
+    length -= n;
+    dataPtr += n;
+    offset += n;
+  }
+}
+
+int FdOutStream::length()
+{
+  return offset + ptr - start;
+}
+
+void FdOutStream::flush()
+{
+  U8* sentUpTo = start;
+  while (sentUpTo < ptr) {
+    int n = write(fd, (const void*) sentUpTo, ptr - sentUpTo);
+
+    if (n < 0) throw SystemException("write",errno);
+
+    sentUpTo += n;
+    offset += n;
+  }
+
+  ptr = start;
+}
+
+
+int FdOutStream::overrun(int itemSize, int nItems)
+{
+  if (itemSize > bufSize)
+    throw Exception("FdOutStream overrun: max itemSize exceeded");
+
+  flush();
+
+  if (itemSize * nItems > end - ptr)
+    nItems = (end - ptr) / itemSize;
+
+  return nItems;
+}
diff --git a/ica/win32/rdr/FdOutStream.h b/ica/win32/rdr/FdOutStream.h
new file mode 100644
index 0000000..108aba5
--- /dev/null
+++ b/ica/win32/rdr/FdOutStream.h
@@ -0,0 +1,53 @@
+//
+// 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.
+
+//
+// FdOutStream streams to a file descriptor.
+//
+
+#ifndef __RDR_FDOUTSTREAM_H__
+#define __RDR_FDOUTSTREAM_H__
+
+#include "OutStream.h"
+
+namespace rdr {
+
+  class FdOutStream : public OutStream {
+
+  public:
+
+    FdOutStream(int fd, int bufSize=0);
+    virtual ~FdOutStream();
+
+    int getFd() { return fd; }
+
+    void flush();
+    int length();
+    void writeBytes(const void* data, int length);
+
+  private:
+    int overrun(int itemSize, int nItems);
+    int fd;
+    int bufSize;
+    int offset;
+    U8* start;
+  };
+
+}
+
+#endif
diff --git a/ica/win32/rdr/FixedMemOutStream.h b/ica/win32/rdr/FixedMemOutStream.h
new file mode 100644
index 0000000..2d3c263
--- /dev/null
+++ b/ica/win32/rdr/FixedMemOutStream.h
@@ -0,0 +1,52 @@
+//
+// 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.
+
+//
+// A FixedMemOutStream writes to a buffer of a fixed length.
+//
+
+#ifndef __RDR_FIXEDMEMOUTSTREAM_H__
+#define __RDR_FIXEDMEMOUTSTREAM_H__
+
+#include "OutStream.h
+#include "Exception.h"
+
+namespace rdr {
+
+  class FixedMemOutStream : public OutStream {
+
+  public:
+
+    FixedMemOutStream(void* buf, int len) {
+      ptr = start = (U8*)buf;
+      end = start + len;
+    }
+
+    int length() { return ptr - start; }
+    void reposition(int pos) { ptr = start + pos; }
+    const void* data() { return (const void*)start; }
+
+  private:
+
+    int overrun(int itemSize, int nItems) { throw EndOfStream("overrun"); }
+    U8* start;
+  };
+
+}
+
+#endif
diff --git a/ica/win32/rdr/InStream.cxx b/ica/win32/rdr/InStream.cxx
new file mode 100644
index 0000000..879b379
--- /dev/null
+++ b/ica/win32/rdr/InStream.cxx
@@ -0,0 +1,35 @@
+//
+// 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.
+
+#include "InStream.h"
+#include "Exception.h"
+
+using namespace rdr;
+
+U32 InStream::maxStringLength = 65535;
+
+char* InStream::readString()
+{
+  U32 len = readU32();
+  if (len > maxStringLength)
+    throw Exception("InStream max string length exceeded");
+  char* str = new char[len+1];
+  readBytes(str, len);
+  str[len] = 0;
+  return str;
+}
diff --git a/ica/win32/rdr/InStream.h b/ica/win32/rdr/InStream.h
new file mode 100644
index 0000000..d3e0fde
--- /dev/null
+++ b/ica/win32/rdr/InStream.h
@@ -0,0 +1,145 @@
+//
+// 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.
+
+//
+// rdr::InStream marshalls data from a buffer stored in RDR (RFB Data
+// Representation).
+//
+
+#ifndef __RDR_INSTREAM_H__
+#define __RDR_INSTREAM_H__
+
+#pragma once 
+
+#include "types.h"
+#include <string.h> // for memcpy
+
+namespace rdr {
+
+  class InStream {
+
+  public:
+
+    virtual ~InStream() {}
+
+    // check() ensures there is buffer data for at least one item of size
+    // itemSize bytes.  Returns the number of items in the buffer (up to a
+    // maximum of nItems).
+
+    inline int check(int itemSize, int nItems=1)
+    {
+      if (ptr + itemSize * nItems > end) {
+        if (ptr + itemSize > end)
+          return overrun(itemSize, nItems);
+
+        nItems = (end - ptr) / itemSize;
+      }
+      return nItems;
+    }
+
+    // readU/SN() methods read unsigned and signed N-bit integers.
+
+    inline U8  readU8()  { check(1); return *ptr++; }
+    inline U16 readU16() { check(2); int b0 = *ptr++; int b1 = *ptr++;
+                           return b0 << 8 | b1; }
+    inline U32 readU32() { check(4); int b0 = *ptr++; int b1 = *ptr++;
+                                     int b2 = *ptr++; int b3 = *ptr++;
+                           return b0 << 24 | b1 << 16 | b2 << 8 | b3; }
+
+    inline S8  readS8()  { return (S8) readU8();  }
+    inline S16 readS16() { return (S16)readU16(); }
+    inline S32 readS32() { return (S32)readU32(); }
+
+    // readString() reads a string - a U32 length followed by the data.
+    // Returns a null-terminated string - the caller should delete[] it
+    // afterwards.
+
+    char* readString();
+
+    // maxStringLength protects against allocating a huge buffer.  Set it
+    // higher if you need longer strings.
+
+    static U32 maxStringLength;
+
+    inline void skip(int bytes) {
+      while (bytes > 0) {
+        int n = check(1, bytes);
+        ptr += n;
+        bytes -= n;
+      }
+    }
+
+    // readBytes() reads an exact number of bytes.
+
+    virtual void readBytes(void* data, int length) {
+      U8* dataPtr = (U8*)data;
+      U8* dataEnd = dataPtr + length;
+      while (dataPtr < dataEnd) {
+        int n = check(1, dataEnd - dataPtr);
+        memcpy(dataPtr, ptr, n);
+        ptr += n;
+        dataPtr += n;
+      }
+    }
+
+    // readOpaqueN() reads a quantity without byte-swapping.
+
+    inline U8  readOpaque8()  { return readU8(); }
+    inline U16 readOpaque16() { check(2); U16 r; ((U8*)&r)[0] = *ptr++;
+                                ((U8*)&r)[1] = *ptr++; return r; }
+    inline U32 readOpaque32() { check(4); U32 r; ((U8*)&r)[0] = *ptr++;
+                                ((U8*)&r)[1] = *ptr++; ((U8*)&r)[2] = *ptr++;
+                                ((U8*)&r)[3] = *ptr++; return r; }
+    inline U32 readOpaque24A() { check(3); U32 r=0; ((U8*)&r)[0] = *ptr++;
+                                 ((U8*)&r)[1] = *ptr++; ((U8*)&r)[2] = *ptr++;
+                                 return r; }
+    inline U32 readOpaque24B() { check(3); U32 r=0; ((U8*)&r)[1] = *ptr++;
+                                 ((U8*)&r)[2] = *ptr++; ((U8*)&r)[3] = *ptr++;
+                                 return r; }
+
+    // pos() returns the position in the stream.
+
+    virtual int pos() = 0;
+
+    // getptr(), getend() and setptr() are "dirty" methods which allow you to
+    // manipulate the buffer directly.  This is useful for a stream which is a
+    // wrapper around an underlying stream.
+
+    inline const U8* getptr() const { return ptr; }
+    inline const U8* getend() const { return end; }
+    inline void setptr(const U8* p) { ptr = p; }
+
+  private:
+
+    // overrun() is implemented by a derived class to cope with buffer overrun.
+    // It ensures there are at least itemSize bytes of buffer data.  Returns
+    // the number of items in the buffer (up to a maximum of nItems).  itemSize
+    // is supposed to be "small" (a few bytes).
+
+    virtual int overrun(int itemSize, int nItems) = 0;
+
+  protected:
+
+    InStream() {}
+    const U8* ptr;
+    const U8* end;
+  };
+
+}
+
+#endif
diff --git a/ica/win32/rdr/Makefile.bcc32 b/ica/win32/rdr/Makefile.bcc32
new file mode 100644
index 0000000..3606dae
--- /dev/null
+++ b/ica/win32/rdr/Makefile.bcc32
@@ -0,0 +1,33 @@
+# ------------- Borland C++ 5.5 (Win32) -------------
+
+CC=bcc32
+LIB=tlib
+
+CFLAGS= -v- -O2 -3 -tWM -q -P -xd- -w-8004 -w-8057
+LIBFLAGS= /C
+
+OBJS=FdInStream.obj FdOutStream.obj InStream.obj NullOutStream.obj \
+       ZlibInStream.obj ZlibOutStream.obj
+
+pOBJS=+FdInStream.obj+FdOutStream.obj+InStream.obj+NullOutStream.obj \
+       +ZlibInStream.obj+ZlibOutStream.obj
+
+LIBS=..\zlib\zlib.lib
+
+.autodepend
+.cxx.obj:
+	$(CC) -c $(CFLAGS) $<
+
+rdr.lib: $(OBJS) $(LIBS)
+	 @if exist $@ del $@
+	 $(LIB) $@ $(LIBFLAGS) $(pOBJS)
+
+..\zlib\zlib.lib:
+	cd ..
+	cd zlib
+	make -fMakefile.bcc32 -l -s
+	cd ..
+
+clean:
+	del *.obj *.lib
+
diff --git a/ica/win32/rdr/Makefile.in b/ica/win32/rdr/Makefile.in
new file mode 100644
index 0000000..6b4c2ef
--- /dev/null
+++ b/ica/win32/rdr/Makefile.in
@@ -0,0 +1,18 @@
+
+SRCS = FdInStream.cxx FdOutStream.cxx InStream.cxx NullOutStream.cxx \
+       ZlibInStream.cxx ZlibOutStream.cxx
+
+OBJS = $(SRCS:.cxx=.o)
+
+DIR_CPPFLAGS = -I$(top_srcdir) @ZLIB_INCLUDE@
+
+library = librdr.a
+
+all:: $(library)
+
+$(library): $(OBJS)
+	rm -f $(library)
+	$(AR) $(library) $(OBJS)
+	$(RANLIB) $(library)
+
+# followed by boilerplate.mk
diff --git a/ica/win32/rdr/MemInStream.h b/ica/win32/rdr/MemInStream.h
new file mode 100644
index 0000000..03d5817
--- /dev/null
+++ b/ica/win32/rdr/MemInStream.h
@@ -0,0 +1,47 @@
+//
+// 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 __RDR_MEMINSTREAM_H__
+#define __RDR_MEMINSTREAM_H__
+
+#include "InStream.h"
+#include "Exception.h"
+
+namespace rdr {
+
+  class MemInStream : public InStream {
+
+  public:
+
+    MemInStream(const void* data, int len) {
+      ptr = start = (const U8*)data;
+      end = start + len;
+    }
+
+    int pos() { return ptr - start; }
+    void reposition(int pos) { ptr = start + pos; }
+
+  private:
+
+    int overrun(int itemSize, int nItems) { throw EndOfStream("overrun"); }
+    const U8* start;
+  };
+
+}
+
+#endif
diff --git a/ica/win32/rdr/MemOutStream.h b/ica/win32/rdr/MemOutStream.h
new file mode 100644
index 0000000..3cb8a49
--- /dev/null
+++ b/ica/win32/rdr/MemOutStream.h
@@ -0,0 +1,82 @@
+//
+// 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.
+
+//
+// A MemOutStream grows as needed when data is written to it.
+//
+
+#ifndef __RDR_MEMOUTSTREAM_H__
+#define __RDR_MEMOUTSTREAM_H__
+
+#include "OutStream.h"
+
+namespace rdr {
+
+  class MemOutStream : public OutStream {
+
+  public:
+
+    MemOutStream(int len=1024) {
+      start = ptr = new U8[len];
+      end = start + len;
+    }
+
+    virtual ~MemOutStream() {
+      delete [] start;
+    }
+
+    void writeBytes(const void* data, int length) {
+      check(length);
+      memcpy(ptr, data, length);
+      ptr += length;
+    }
+
+    int length() { return ptr - start; }
+    void clear() { ptr = start; };
+    void reposition(int pos) { ptr = start + pos; }
+
+    // data() returns a pointer to the buffer.
+
+    const void* data() { return (const void*)start; }
+
+  private:
+
+    // overrun() either doubles the buffer or adds enough space for nItems of
+    // size itemSize bytes.
+
+    int overrun(int itemSize, int nItems) {
+      int len = ptr - start + itemSize * nItems;
+      if (len < (end - start) * 2)
+        len = (end - start) * 2;
+
+      U8* newStart = new U8[len];
+      memcpy(newStart, start, ptr - start);
+      ptr = newStart + (ptr - start);
+      delete [] start;
+      start = newStart;
+      end = newStart + len;
+
+      return nItems;
+    }
+
+    U8* start;
+  };
+
+}
+
+#endif
diff --git a/ica/win32/rdr/NullOutStream.cxx b/ica/win32/rdr/NullOutStream.cxx
new file mode 100644
index 0000000..afb9c7b
--- /dev/null
+++ b/ica/win32/rdr/NullOutStream.cxx
@@ -0,0 +1,60 @@
+//
+// 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.
+
+#include "NullOutStream.h"
+#include "Exception.h"
+
+using namespace rdr;
+
+static const int bufferSize = 1024;
+
+NullOutStream::NullOutStream()
+  : offset(0)
+{
+  start = ptr = new U8[bufferSize];
+  end = start + bufferSize;
+}
+
+NullOutStream::~NullOutStream()
+{
+  delete [] start;
+}
+
+int NullOutStream::length()
+{
+  return offset + ptr - start;
+}
+
+void NullOutStream::writeBytes(const void* data, int length)
+{
+  offset += length;
+}
+
+int NullOutStream::overrun(int itemSize, int nItems)
+{
+  if (itemSize > bufferSize)
+    throw Exception("NullOutStream overrun: max itemSize exceeded");
+
+  offset += ptr - start;
+  ptr = start;
+
+  if (itemSize * nItems > end - ptr)
+    nItems = (end - ptr) / itemSize;
+
+  return nItems;
+}
diff --git a/ica/win32/rdr/NullOutStream.h b/ica/win32/rdr/NullOutStream.h
new file mode 100644
index 0000000..810c89b
--- /dev/null
+++ b/ica/win32/rdr/NullOutStream.h
@@ -0,0 +1,42 @@
+//
+// 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 __RDR_NULLOUTSTREAM_H__
+#define __RDR_NULLOUTSTREAM_H__
+
+#include "OutStream.h"
+
+namespace rdr {
+
+  class NullOutStream : public OutStream {
+
+  public:
+    NullOutStream();
+    virtual ~NullOutStream();
+    int length();
+    void writeBytes(const void* data, int length);
+
+  private:
+    int overrun(int itemSize, int nItems);
+    int offset;
+    U8* start;
+  };
+
+}
+
+#endif
diff --git a/ica/win32/rdr/OutStream.h b/ica/win32/rdr/OutStream.h
new file mode 100644
index 0000000..4b3f4d1
--- /dev/null
+++ b/ica/win32/rdr/OutStream.h
@@ -0,0 +1,154 @@
+//
+// 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.
+
+//
+// rdr::OutStream marshalls data into a buffer stored in RDR (RFB Data
+// Representation).
+//
+
+#ifndef __RDR_OUTSTREAM_H__
+#define __RDR_OUTSTREAM_H__
+
+#pragma once 
+
+#include "types.h"
+#include <string.h> // for memcpy
+
+namespace rdr {
+
+  class OutStream {
+
+  protected:
+
+    OutStream() {}
+
+  public:
+
+    virtual ~OutStream() {}
+
+    // check() ensures there is buffer space for at least one item of size
+    // itemSize bytes.  Returns the number of items which fit (up to a maximum
+    // of nItems).
+
+    inline int check(int itemSize, int nItems=1)
+    {
+      if (ptr + itemSize * nItems > end) {
+        if (ptr + itemSize > end)
+          return overrun(itemSize, nItems);
+
+        nItems = (end - ptr) / itemSize;
+      }
+      return nItems;
+    }
+
+    // writeU/SN() methods write unsigned and signed N-bit integers.
+
+    inline void writeU8( U8  u) { check(1); *ptr++ = u; }
+    inline void writeU16(U16 u) { check(2); *ptr++ = u >> 8; *ptr++ = (U8)u; }
+    inline void writeU32(U32 u) { check(4); *ptr++ = u >> 24; *ptr++ = u >> 16;
+                                            *ptr++ = u >> 8; *ptr++ = u; }
+
+    inline void writeS8( S8  s) { writeU8((U8)s); }
+    inline void writeS16(S16 s) { writeU16((U16)s); }
+    inline void writeS32(S32 s) { writeU32((U32)s); }
+
+    // writeString() writes a string - a U32 length followed by the data.  The
+    // given string should be null-terminated (but the terminating null is not
+    // written to the stream).
+
+    inline void writeString(const char* str) {
+      U32 len = strlen(str);
+      writeU32(len);
+      writeBytes(str, len);
+    }
+
+    inline void pad(int bytes) {
+      while (bytes-- > 0) writeU8(0);
+    }
+
+    inline void skip(int bytes) {
+      while (bytes > 0) {
+        int n = check(1, bytes);
+        ptr += n;
+        bytes -= n;
+      }
+    }
+
+    // writeBytes() writes an exact number of bytes.
+
+    virtual void writeBytes(const void* data, int length) {
+      const U8* dataPtr = (const U8*)data;
+      const U8* dataEnd = dataPtr + length;
+      while (dataPtr < dataEnd) {
+        int n = check(1, dataEnd - dataPtr);
+        memcpy(ptr, dataPtr, n);
+        ptr += n;
+        dataPtr += n;
+      }
+    }
+
+    // writeOpaqueN() writes a quantity without byte-swapping.
+
+    inline void writeOpaque8( U8  u) { writeU8(u); }
+    inline void writeOpaque16(U16 u) { check(2); *ptr++ = ((U8*)&u)[0];
+                                       *ptr++ = ((U8*)&u)[1]; }
+    inline void writeOpaque32(U32 u) { check(4); *ptr++ = ((U8*)&u)[0];
+                                       *ptr++ = ((U8*)&u)[1];
+                                       *ptr++ = ((U8*)&u)[2];
+                                       *ptr++ = ((U8*)&u)[3]; }
+    inline void writeOpaque24A(U32 u) { check(3); *ptr++ = ((U8*)&u)[0];
+                                        *ptr++ = ((U8*)&u)[1];
+                                        *ptr++ = ((U8*)&u)[2]; }
+    inline void writeOpaque24B(U32 u) { check(3); *ptr++ = ((U8*)&u)[1];
+                                        *ptr++ = ((U8*)&u)[2];
+                                        *ptr++ = ((U8*)&u)[3]; }
+
+    // length() returns the length of the stream.
+
+    virtual int length() = 0;
+
+    // flush() requests that the stream be flushed.
+
+    virtual void flush() {}
+
+    // getptr(), getend() and setptr() are "dirty" methods which allow you to
+    // manipulate the buffer directly.  This is useful for a stream which is a
+    // wrapper around an underlying stream.
+
+    inline U8* getptr() { return ptr; }
+    inline U8* getend() { return end; }
+    inline void setptr(U8* p) { ptr = p; }
+
+  private:
+
+    // overrun() is implemented by a derived class to cope with buffer overrun.
+    // It ensures there are at least itemSize bytes of buffer space.  Returns
+    // the number of items which fit (up to a maximum of nItems).  itemSize is
+    // supposed to be "small" (a few bytes).
+
+    virtual int overrun(int itemSize, int nItems) = 0;
+
+  protected:
+
+    U8* ptr;
+    U8* end;
+  };
+
+}
+
+#endif
diff --git a/ica/win32/rdr/ZlibInStream.cxx b/ica/win32/rdr/ZlibInStream.cxx
new file mode 100644
index 0000000..be4eab4
--- /dev/null
+++ b/ica/win32/rdr/ZlibInStream.cxx
@@ -0,0 +1,125 @@
+//
+// 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.
+
+#include "ZlibInStream.h"
+#include "Exception.h"
+#ifdef IPP
+#include "../ipp_zlib/src/zlib/zlib.h"
+#else
+#include "../zlib/zlib.h"
+#endif
+
+using namespace rdr;
+
+enum { DEFAULT_BUF_SIZE = 16384 };
+
+ZlibInStream::ZlibInStream(int bufSize_)
+  : underlying(0), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0),
+    bytesIn(0)
+{
+  zs = new z_stream;
+  zs->zalloc    = Z_NULL;
+  zs->zfree     = Z_NULL;
+  zs->opaque    = Z_NULL;
+  zs->next_in   = Z_NULL;
+  zs->avail_in  = 0;
+  if (inflateInit(zs) != Z_OK) {
+    delete zs;
+    throw Exception("ZlibInStream: inflateInit failed");
+  }
+  ptr = end = start = new U8[bufSize];
+}
+
+ZlibInStream::~ZlibInStream()
+{
+  delete [] start;
+  inflateEnd(zs);
+  delete zs;
+}
+
+void ZlibInStream::setUnderlying(InStream* is, int bytesIn_)
+{
+  underlying = is;
+  bytesIn = bytesIn_;
+  ptr = end = start;
+}
+
+int ZlibInStream::pos()
+{
+  return offset + ptr - start;
+}
+
+void ZlibInStream::reset()
+{
+  ptr = end = start;
+  if (!underlying) return;
+
+  while (bytesIn > 0) {
+    decompress();
+    end = start; // throw away any data
+  }
+  underlying = 0;
+}
+
+int ZlibInStream::overrun(int itemSize, int nItems)
+{
+  if (itemSize > bufSize)
+    throw Exception("ZlibInStream overrun: max itemSize exceeded");
+  if (!underlying)
+    throw Exception("ZlibInStream overrun: no underlying stream");
+
+  if (end - ptr != 0)
+    memmove(start, ptr, end - ptr);
+
+  offset += ptr - start;
+  end -= ptr - start;
+  ptr = start;
+
+  while (end - ptr < itemSize) {
+    decompress();
+  }
+
+  if (itemSize * nItems > end - ptr)
+    nItems = (end - ptr) / itemSize;
+
+  return nItems;
+}
+
+// decompress() calls the decompressor once.  Note that this won't necessarily
+// generate any output data - it may just consume some input data.
+
+void ZlibInStream::decompress()
+{
+  zs->next_out = (U8*)end;
+  zs->avail_out = start + bufSize - end;
+
+  underlying->check(1);
+  zs->next_in = (U8*)underlying->getptr();
+  zs->avail_in = underlying->getend() - underlying->getptr();
+  if ((int)zs->avail_in > bytesIn)
+    zs->avail_in = bytesIn;
+
+  int rc = inflate(zs, Z_SYNC_FLUSH);
+  if (rc != Z_OK) {
+    throw Exception("ZlibInStream: inflate failed");
+  }
+
+  bytesIn -= zs->next_in - underlying->getptr();
+  end = zs->next_out;
+  underlying->setptr(zs->next_in);
+}
diff --git a/ica/win32/rdr/ZlibInStream.h b/ica/win32/rdr/ZlibInStream.h
new file mode 100644
index 0000000..121ba78
--- /dev/null
+++ b/ica/win32/rdr/ZlibInStream.h
@@ -0,0 +1,61 @@
+//
+// 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.
+
+//
+// ZlibInStream streams from a compressed data stream ("underlying"),
+// decompressing with zlib on the fly.
+//
+
+#ifndef __RDR_ZLIBINSTREAM_H__
+#define __RDR_ZLIBINSTREAM_H__
+
+#pragma once
+
+#include "InStream.h"
+
+struct z_stream_s;
+
+namespace rdr {
+
+  class ZlibInStream : public InStream {
+
+  public:
+
+    ZlibInStream(int bufSize=0);
+    virtual ~ZlibInStream();
+
+    void setUnderlying(InStream* is, int bytesIn);
+    void reset();
+    int pos();
+
+  private:
+
+    int overrun(int itemSize, int nItems);
+    void decompress();
+
+    InStream* underlying;
+    int bufSize;
+    int offset;
+    z_stream_s* zs;
+    int bytesIn;
+    U8* start;
+  };
+
+} // end of namespace rdr
+
+#endif
diff --git a/ica/win32/rdr/ZlibOutStream.cxx b/ica/win32/rdr/ZlibOutStream.cxx
new file mode 100644
index 0000000..41c3ef0
--- /dev/null
+++ b/ica/win32/rdr/ZlibOutStream.cxx
@@ -0,0 +1,145 @@
+//
+// 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.
+
+#include "ZlibOutStream.h"
+#include "Exception.h"
+#ifdef IPP
+#include "../ipp_zlib/src/zlib/zlib.h"
+#else
+#include "../zlib/zlib.h"
+#endif
+
+using namespace rdr;
+
+enum { DEFAULT_BUF_SIZE = 16384 };
+
+// adzm - 2010-07 - Custom compression level
+ZlibOutStream::ZlibOutStream(OutStream* os, int bufSize_, int compressionLevel)
+  : underlying(os), bufSize(bufSize_ ? bufSize_ : DEFAULT_BUF_SIZE), offset(0)
+{
+  zs = new z_stream;
+  zs->zalloc    = Z_NULL;
+  zs->zfree     = Z_NULL;
+  zs->opaque    = Z_NULL;
+  if (deflateInit(zs, compressionLevel) != Z_OK) {
+    delete zs;
+    throw Exception("ZlibOutStream: deflateInit failed");
+  }
+  ptr = start = new U8[bufSize];
+  end = start + bufSize;
+}
+
+ZlibOutStream::~ZlibOutStream()
+{
+  try {
+    flush();
+  } catch (Exception&) {
+  }
+  delete [] start;
+  deflateEnd(zs);
+  delete zs;
+}
+
+void ZlibOutStream::setUnderlying(OutStream* os)
+{
+  underlying = os;
+}
+
+int ZlibOutStream::length()
+{
+  return offset + ptr - start;
+}
+
+void ZlibOutStream::flush()
+{
+  zs->next_in = start;
+  zs->avail_in = ptr - start;
+
+//    fprintf(stderr,"zos flush: avail_in %d\n",zs->avail_in);
+
+  while (zs->avail_in != 0) {
+
+    do {
+      underlying->check(1);
+      zs->next_out = underlying->getptr();
+      zs->avail_out = underlying->getend() - underlying->getptr();
+
+//        fprintf(stderr,"zos flush: calling deflate, avail_in %d, avail_out %d\n",
+//                zs->avail_in,zs->avail_out);
+      int rc = deflate(zs, Z_SYNC_FLUSH);
+      if (rc != Z_OK) throw Exception("ZlibOutStream: deflate failed");
+
+//        fprintf(stderr,"zos flush: after deflate: %d bytes\n",
+//                zs->next_out-underlying->getptr());
+
+      underlying->setptr(zs->next_out);
+    } while (zs->avail_out == 0);
+  }
+
+  offset += ptr - start;
+  ptr = start;
+}
+
+int ZlibOutStream::overrun(int itemSize, int nItems)
+{
+//    fprintf(stderr,"ZlibOutStream overrun\n");
+
+  if (itemSize > bufSize)
+    throw Exception("ZlibOutStream overrun: max itemSize exceeded");
+
+  while (end - ptr < itemSize) {
+    zs->next_in = start;
+    zs->avail_in = ptr - start;
+
+    do {
+      underlying->check(1);
+      zs->next_out = underlying->getptr();
+      zs->avail_out = underlying->getend() - underlying->getptr();
+
+//        fprintf(stderr,"zos overrun: calling deflate, avail_in %d, avail_out %d\n",
+//                zs->avail_in,zs->avail_out);
+
+      int rc = deflate(zs, 0);
+      if (rc != Z_OK) throw Exception("ZlibOutStream: deflate failed");
+
+//        fprintf(stderr,"zos overrun: after deflate: %d bytes\n",
+//                zs->next_out-underlying->getptr());
+
+      underlying->setptr(zs->next_out);
+    } while (zs->avail_out == 0);
+
+    // output buffer not full
+
+    if (zs->avail_in == 0) {
+      offset += ptr - start;
+      ptr = start;
+    } else {
+      // but didn't consume all the data?  try shifting what's left to the
+      // start of the buffer.
+      fprintf(stderr,"z out buf not full, but in data not consumed\n");
+      memmove(start, zs->next_in, ptr - zs->next_in);
+      offset += zs->next_in - start;
+      ptr -= zs->next_in - start;
+    }
+  }
+
+  if (itemSize * nItems > end - ptr)
+    nItems = (end - ptr) / itemSize;
+
+  return nItems;
+}
diff --git a/ica/win32/rdr/ZlibOutStream.h b/ica/win32/rdr/ZlibOutStream.h
new file mode 100644
index 0000000..175baca
--- /dev/null
+++ b/ica/win32/rdr/ZlibOutStream.h
@@ -0,0 +1,59 @@
+//
+// 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.
+
+
+//
+// ZlibOutStream streams to a compressed data stream (underlying), compressing
+// with zlib on the fly.
+//
+
+#ifndef __RDR_ZLIBOUTSTREAM_H__
+#define __RDR_ZLIBOUTSTREAM_H__
+
+#include "OutStream.h"
+
+struct z_stream_s;
+
+namespace rdr {
+
+  class ZlibOutStream : public OutStream {
+
+  public:
+
+    // adzm - 2010-07 - Custom compression level
+    ZlibOutStream(OutStream* os=0, int bufSize=0, int compressionLevel=-1); // Z_DEFAULT_COMPRESSION
+    virtual ~ZlibOutStream();
+
+    void setUnderlying(OutStream* os);
+    void flush();
+    int length();
+
+  private:
+
+    int overrun(int itemSize, int nItems);
+
+    OutStream* underlying;
+    int bufSize;
+    int offset;
+    z_stream_s* zs;
+    U8* start;
+  };
+
+} // end of namespace rdr
+
+#endif
diff --git a/ica/win32/rdr/types.h b/ica/win32/rdr/types.h
new file mode 100644
index 0000000..fe4b121
--- /dev/null
+++ b/ica/win32/rdr/types.h
@@ -0,0 +1,36 @@
+//
+// 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 __RDR_TYPES_H__
+#define __RDR_TYPES_H__
+
+#pragma once
+
+
+namespace rdr
+{
+  typedef unsigned char U8;
+  typedef unsigned short U16;
+  typedef unsigned int U32;
+  typedef signed char S8;
+  typedef signed short S16;
+  typedef signed int S32;
+
+} // end of namespace rdr
+
+#endif
diff --git a/ica/win32/rectlist.h b/ica/win32/rectlist.h
deleted file mode 100644
index ebc9bc5..0000000
--- a/ica/win32/rectlist.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "RectList.h"
diff --git a/ica/win32/src/DynamicFn.cpp b/ica/win32/src/DynamicFn.cpp
deleted file mode 100644
index 54ed03b..0000000
--- a/ica/win32/src/DynamicFn.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * Copyright (C) 2007 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.
- */
-
-#include "DynamicFn.h"
-
-DynamicFnBase::DynamicFnBase(const TCHAR* dllName, const char* fnName) : fnPtr(0), dllHandle(0) {
-  dllHandle = LoadLibrary(dllName);
-  if (!dllHandle) {
-    vnclog.Print(LL_INTERR, VNCLOG("DLL %s not found (error %d)"),
-                 (const char*)dllName, GetLastError());
-    return;
-  }
-  fnPtr = (void *) GetProcAddress(dllHandle, fnName);
-  if (!fnPtr)
-    vnclog.Print(LL_INTERR, VNCLOG("proc %s not found in %s (error %d)"),
-                 fnName, (const char*)dllName, GetLastError());
-}
-
-DynamicFnBase::~DynamicFnBase() {
-  if (dllHandle)
-    FreeLibrary(dllHandle);
-}
-
-
diff --git a/ica/win32/src/DynamicFn.h b/ica/win32/src/DynamicFn.h
deleted file mode 100644
index c146a64..0000000
--- a/ica/win32/src/DynamicFn.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * Copyright (C) 2007 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.
- */
-
-// Helper class managing dynamic linkage to DLL functions.
-
-#ifndef __RFB_WIN32_DYNAMICFN_H__
-#define __RFB_WIN32_DYNAMICFN_H__
-
-#include "stdhdrs.h"
-
-class DynamicFnBase {
-public:
-	DynamicFnBase(const TCHAR* dllName, const char* fnName);
-	~DynamicFnBase();
-	bool isValid() const {return fnPtr != 0;}
-protected:
-	void* fnPtr;
-	HMODULE dllHandle;
-private:
-	DynamicFnBase(const DynamicFnBase&);
-	DynamicFnBase operator=(const DynamicFnBase&);
-};
-
-template<class T> class DynamicFn : public DynamicFnBase {
-public:
-	DynamicFn(const TCHAR* dllName, const char* fnName) : DynamicFnBase(dllName, fnName) {}
-	T operator *() const {return (T)fnPtr;};
-};
-
-#endif
diff --git a/ica/win32/src/Log.cpp b/ica/win32/src/Log.cpp
deleted file mode 100644
index 556cf6d..0000000
--- a/ica/win32/src/Log.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-// Log.cpp: implementation of the Log class.
-//
-//////////////////////////////////////////////////////////////////////
-
-#include "stdhdrs.h"
-#include "Log.h"
-
-//////////////////////////////////////////////////////////////////////
-// Construction/Destruction
-//////////////////////////////////////////////////////////////////////
-
-#if (defined(_UNICODE) || defined(_MBCS))
-#error Cannot compile with multibyte/wide character support
-#endif
-
-const int Log::ToDebug   =  1;
-const int Log::ToFile    =  2;
-const int Log::ToConsole =  4;
-const int Log::ToQtLog   =  8;
-
-const static int LINE_BUFFER_SIZE = 1024;
-
-Log::Log(int mode, int level, char *filename, bool append)
-{
-	m_lastLogTime = 0;
-	m_filename = NULL;
-	m_append = false;
-    hlogfile = NULL;
-    m_todebug = false;
-    m_toconsole = false;
-    m_tofile = false;
-    m_toqtlog = false;
-
-    SetFile(filename, append);
-    SetMode(mode);
-//	SetLevel(level);
-
-	// If the compiler returns full path names in __FILE__,
-	// remember the path prefix, to remove it from the log messages.
-	char *path = __FILE__;
-	char *ptr = strrchr(path, '\\');
-	if (ptr != NULL) {
-		m_prefix_len = ptr + 1 - path;
-		m_prefix = (char *)malloc(m_prefix_len + 1);
-		memcpy(m_prefix, path, m_prefix_len);
-		m_prefix[m_prefix_len] = '\0';
-	}
-}
-
-void Log::SetMode(int mode) {
-    
-	m_mode = mode;
-
-    if (mode & ToDebug)
-        m_todebug = true;
-    else
-        m_todebug = false;
-
-    if (mode & ToFile)  {
-		if (!m_tofile)
-			OpenFile();
-	} else {
-		CloseFile();
-        m_tofile = false;
-    }
-    
-    if (mode & ToConsole) {
-        if (!m_toconsole)
-            AllocConsole();
-        m_toconsole = true;
-    } else {
-        m_toconsole = false;
-    }
-    m_toqtlog = ( mode && ToQtLog ) != 0;
-}
-
-int Log::GetMode() {
-	return m_mode;
-}
-/*
-void Log::SetLevel(int level) {
-    m_level = level;
-}
-
-int Log::GetLevel() {
-	return m_level;
-}*/
-
-void Log::SetStyle(int style) {
-	m_style = style;
-}
-
-int Log::GetStyle() {
-	return m_style;
-}
-
-void Log::SetFile(const char *filename, bool append)
-{
-	CloseFile();
-	if (m_filename != NULL)
-		free(m_filename);
-	m_filename = strdup(filename);
-	m_append = append;
-	if (m_tofile)
-		OpenFile();
-}
-
-void Log::OpenFile()
-{
-	// Is there a file-name?
-	if (m_filename == NULL)
-	{
-        m_todebug = true;
-        m_tofile = false;
-        Print(0, "Error opening log file\n");
-		return;
-	}
-
-    m_tofile  = true;
-	m_lastLogTime = 0;
-
-	// If there's an existing log and we're not appending then move it
-	if (!m_append)
-	{
-		// Build the backup filename
-		char *backupfilename = new char[strlen(m_filename)+5];
-		if (backupfilename)
-		{
-			strcpy(backupfilename, m_filename);
-			strcat(backupfilename, ".bak");
-			// Attempt the move and replace any existing backup
-			// Note that failure is silent - where would we log a message to? ;)
-			DeleteFile(backupfilename);
-			MoveFile(m_filename, backupfilename);
-			delete [] backupfilename;
-		}
-	}
-
-    // If filename is NULL or invalid we should throw an exception here
-    hlogfile = CreateFile(m_filename,
-						  GENERIC_WRITE,
-						  FILE_SHARE_READ | FILE_SHARE_WRITE,
-						  NULL,
-						  OPEN_ALWAYS,
-						  FILE_ATTRIBUTE_NORMAL,
-						  NULL);
-
-    if (hlogfile == INVALID_HANDLE_VALUE) {
-        // We should throw an exception here
-        m_todebug = true;
-        m_tofile = false;
-        Print(0, "Error opening log file %s\n", m_filename);
-    }
-    if (m_append) {
-        SetFilePointer(hlogfile, 0, NULL, FILE_END);
-    } else {
-        SetEndOfFile(hlogfile);
-    }
-}
-
-// if a log file is open, close it now.
-void Log::CloseFile() {
-    if (hlogfile != NULL) {
-        CloseHandle(hlogfile);
-        hlogfile = NULL;
-    }
-}
-
-inline void Log::ReallyPrintLine(char *line) 
-{
-    if (m_todebug) OutputDebugString(line);
-    if (m_toconsole) {
-        DWORD byteswritten;
-        WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), line, strlen(line), &byteswritten, NULL);
-    }
-    if (m_tofile && (hlogfile != NULL)) {
-        DWORD byteswritten;
-        WriteFile(hlogfile, line, strlen(line), &byteswritten, NULL); 
-    }
-    if( m_toqtlog )
-    {
-    	qDebug( line );
-    }
-}
-
-void Log::ReallyPrint(char *format, va_list ap) 
-{
-	// Write current time to the log if necessary
-	time_t current = time(NULL);
-	if (current != m_lastLogTime) {
-		m_lastLogTime = current;
-
-		char time_str[32];
-		strncpy(time_str, ctime(&m_lastLogTime), 24);
-		if (m_style & TIME_INLINE) {
-			strcpy(&time_str[24], " - ");
-		} else {
-			strcpy(&time_str[24], "\r\n");
-		}
-		ReallyPrintLine(time_str);
-	}
-
-	// Exclude path prefix from the format string if needed
-	char *format_ptr = format;
-	if (m_prefix != NULL && strlen(format) > m_prefix_len + 4) {
-#ifndef _DEBUG
-		if (memcmp(format, m_prefix, m_prefix_len) == 0)
-			format_ptr = format + m_prefix_len;
-#else
-		if (_strnicmp(format, m_prefix, m_prefix_len) == 0)
-			format_ptr = format + m_prefix_len;
-#endif
-	}
-
-	// Prepare the complete log message
-	char line[LINE_BUFFER_SIZE];
-	_vsnprintf(line, LINE_BUFFER_SIZE - 2, format_ptr, ap);
-	line[LINE_BUFFER_SIZE - 2] = '\0';
-	int len = strlen(line);
-	if (len > 0 && len <= LINE_BUFFER_SIZE - 2 && line[len - 1] == '\n') {
-		// Replace trailing '\n' with MS-DOS style end-of-line.
-		line[len-1] = '\r';
-		line[len] =   '\n';
-		line[len+1] = '\0';
-	}
-	if (m_style & (NO_FILE_NAMES | NO_TAB_SEPARATOR)) {
-		char *ptr = strchr(line, '\t');
-		if (ptr != NULL) {
-			// Print without file names if desired
-			if (m_style & NO_FILE_NAMES) {
-				ReallyPrintLine(ptr + 1);
-				return;
-			} else if (m_style & NO_TAB_SEPARATOR) {
-				*ptr = ' ';
-			}
-		}
-	}
-	ReallyPrintLine(line);
-}
-
-Log::~Log()
-{
-	if (m_filename != NULL)
-		free(m_filename);
-	if (m_prefix != NULL)
-		free(m_prefix);
-    CloseFile();
-}
diff --git a/ica/win32/src/Log.h b/ica/win32/src/Log.h
deleted file mode 100644
index c4b305c..0000000
--- a/ica/win32/src/Log.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// This is an object and macros which provide general logging and debugging functions.
-// It can log to a file, to a new console, and/or to debug - others maybe to follow.
-// Every log object has a logging level (which can be changed).
-// Only log requests with a high enough level attached get logged. So the
-// level can be thought of as 'amount of detail'.
-// We use Unicode-portable stuff here for compatibility with WinCE.
-//
-// Typical use:
-//
-//       Log vnclog;
-//       vnclog.SetFile( _T("myapp.log") );
-//       ...
-//       vnclog.Print(2, _T("x = %d\n"), x);
-//
-
-#ifndef VNCLOGGING
-#define VNCLOGGING
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <time.h>
-
-#include "local_system.h"
-
-// Macros for sticking in the current file name
-#define VNCLOG(s)	(__FILE__ ":\t" s)
-
-class Log  
-{
-public:
-    // Logging mode flags:
-    static const int ToDebug;
-    static const int ToFile;
-    static const int ToConsole;
-    static const int ToQtLog;
-
-    // Create a new log object.
-    // Parameters as follows:
-    //    mode     - specifies where output should go, using combination
-    //               of flags above.
-    //    level    - the default level
-    //    filename - if flag Log::ToFile is specified in the type,
-    //               a filename must be specified here.
-    //    append   - if logging to a file, whether or not to append to any
-    //               existing log.
-	Log(int mode = ToDebug, int level = 1, LPSTR filename = NULL, bool append = false);
-
-    inline void Print(int level, LPSTR format, ...) {
-        if (level > localSystem::logLevel/*m_level*/) return;
-        va_list ap;
-        va_start(ap, format);
-        ReallyPrint(format, ap);
-        va_end(ap);
-    }
-    
-/*// Change the log level
-    void SetLevel(int level);
-    int  GetLevel();*/
-
-    // Change the logging mode
-    void SetMode(int mode);
-    int  GetMode();
-
-	// Change the appearence of log records
-	enum Style {
-		TIME_INLINE = 0x01,
-		NO_FILE_NAMES = 0x02,
-		NO_TAB_SEPARATOR = 0x04
-	};
-	void SetStyle(int style);
-	int GetStyle();
-
-    // Change or set the logging filename.  This enables ToFile mode if
-    // not already enabled.
-    void SetFile(const char *filename, bool append = false);
-
-	virtual ~Log();
-
-private:
-	void ReallyPrintLine(char *line);
-    void ReallyPrint(char *format, va_list ap);
-	void OpenFile();
-    void CloseFile();
-    bool m_tofile, m_todebug, m_toconsole, m_toqtlog;
-//    int m_level;
-    int m_mode;
-	int m_style;
-    HANDLE hlogfile;
-	char *m_filename;
-	bool m_append;
-
-	// Path prefix to remove from log records
-	char *m_prefix;
-	size_t m_prefix_len;
-
-	time_t m_lastLogTime;
-};
-
-#endif // VNCLOGGING
diff --git a/ica/win32/src/MinMax.cpp b/ica/win32/src/MinMax.cpp
deleted file mode 100644
index 1d945d5..0000000
--- a/ica/win32/src/MinMax.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// Some routines used internally to minimise and maximise integers
-#include "MinMax.h"
-
-inline int Max(int x, int y)
-{
-	if (x>y)
-		return x;
-	else
-		return y;
-}
-
-inline int Min(int x, int y)
-{
-	if (x>y)
-		return y;
-	else
-		return x;
-}
diff --git a/ica/win32/src/MinMax.h b/ica/win32/src/MinMax.h
deleted file mode 100644
index 54797e3..0000000
--- a/ica/win32/src/MinMax.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// Routines to calculate the maximum and minimum of two integers
-
-#if !defined(MINMAX_INCLUDED)
-#define MINMAX_INCLUDED
-#pragma once
-
-// Some routines used internally to minimise and maximise integers
-inline int Max(int x, int y);
-inline int Min(int x, int y);
-
-#endif
diff --git a/ica/win32/src/ParseHost.c b/ica/win32/src/ParseHost.c
deleted file mode 100644
index 95c5ae6..0000000
--- a/ica/win32/src/ParseHost.c
+++ /dev/null
@@ -1,51 +0,0 @@
-//  Copyright (C) 2006 Constantin Kaplinsky. All Rights Reserved.
-//
-//  TightVNC is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-
-#include <stdlib.h>
-#include <string.h>
-#include "ParseHost.h"
-
-//
-// Parse a VNC host name string, return port number.
-// See the details in ParseHost.h.
-//
-
-int ParseHostPort(char *str, int base_port)
-{
-	int port, disp;
-	char *port_ptr;
-
-	port = base_port;
-	port_ptr = strchr(str, ':');
-	if (port_ptr) {
-		*port_ptr++ = '\0';
-		if (*port_ptr == ':') {
-			port = atoi(++port_ptr);	// port number after "::"
-		} else {
-			disp = atoi(port_ptr);
-			if (disp < 100) {
-				port += disp;			// display number after ":"
-			} else {
-				port = disp;			// port number after ":"
-			}
-		}
-	}
-
-	return port;
-}
diff --git a/ica/win32/src/ParseHost.h b/ica/win32/src/ParseHost.h
deleted file mode 100644
index c77b09c..0000000
--- a/ica/win32/src/ParseHost.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//  Copyright (C) 2006 Constantin Kaplinsky. All Rights Reserved.
-//
-//  TightVNC is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-
-//
-// The ParseHostPort function parses a VNC host name which can be specified
-// in one of these formats:
-//   (1) hostname
-//   (2) hostname:display   (display < 100)
-//   (3) hostname:port      (port >= 100)
-//   (4) hostname::port
-// The function determines and returns the port number, and modifies str[]
-// by inserting a zero byte in place of the first colon found in the string.
-// The algorithm of determining the port number is as follows:
-//   (1) if there are no colons in the string, base_port is used;
-//   (2) if there is one colon and the following number is less than 100,
-//       then the port number is calculated by adding this number (display
-//       number) to base_port;
-//   (3) if there is one colon and the following number is 100 or greater,
-//       then this number is interpreted as a port number;
-//   (4) if there are two colons, the following number is always treated as
-//       a port number.
-//
-extern "C"
-{
-int ParseHostPort(char *str, int base_port);
-}
diff --git a/ica/win32/src/RectList.cpp b/ica/win32/src/RectList.cpp
deleted file mode 100644
index 6def4f8..0000000
--- a/ica/win32/src/RectList.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// RectList implementation
-
-#include "RectList.h"
-
-bool
-operator <(const RECT _X, const RECT _Y)
-{
-	return _X.top < _Y.top;
-}
-
-bool
-operator >(const RECT _X, const RECT _Y)
-{
-	return _X.top > _Y.top;
-}
-
-bool
-operator ==(const RECT &_X, const RECT &_Y)
-{
-	return (_X.left == _Y.left) &&
-			(_X.right == _Y.right) &&
-			(_X.top == _Y.top) &&
-			(_X.bottom == _Y.bottom);
-}
-
-bool
-operator !=(const RECT &_X, const RECT &_Y)
-{
-	return (_X.left != _Y.left) ||
-			(_X.right != _Y.right) ||
-			(_X.top != _Y.top) ||
-			(_X.bottom != _Y.bottom);
-}
diff --git a/ica/win32/src/RectList.h b/ica/win32/src/RectList.h
deleted file mode 100644
index 6967fed..0000000
--- a/ica/win32/src/RectList.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// RectList header file
-
-#include "stdhdrs.h"
-#include <list>
-
-// The rectlist class
-typedef std::list<RECT> rectlist; 
-
-// Operators on RECTs.
-bool operator <(const RECT _X, const RECT _Y);
-bool operator >(const RECT _X, const RECT _Y);
-bool operator ==(const RECT _X, const RECT _Y);
-bool operator !=(const RECT _X, const RECT _Y);
diff --git a/ica/win32/src/TsSessions.cpp b/ica/win32/src/TsSessions.cpp
deleted file mode 100644
index 51e184f..0000000
--- a/ica/win32/src/TsSessions.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * Copyright (C) 2007 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.
- */
-
-#include "TsSessions.h"
-#include "DynamicFn.h"
-#include <tchar.h>
-
-#ifdef ERROR_CTX_WINSTATION_BUSY
-#define RFB_HAVE_WINSTATION_CONNECT
-#else
-#pragma message("  NOTE: Not building WinStationConnect support.")
-#endif
-
-// Windows XP (and later) functions used to handle session Ids
-typedef BOOLEAN (WINAPI *_WinStationConnect_proto) (HANDLE,ULONG,ULONG,PCWSTR,ULONG);
-DynamicFn<_WinStationConnect_proto> _WinStationConnect(_T("winsta.dll"), "WinStationConnectW");
-typedef DWORD (WINAPI *_WTSGetActiveConsoleSessionId_proto) ();
-DynamicFn<_WTSGetActiveConsoleSessionId_proto> _WTSGetActiveConsoleSessionId(_T("kernel32.dll"), "WTSGetActiveConsoleSessionId");
-typedef BOOL (WINAPI *_ProcessIdToSessionId_proto) (DWORD, DWORD*);
-DynamicFn<_ProcessIdToSessionId_proto> _ProcessIdToSessionId(_T("kernel32.dll"), "ProcessIdToSessionId");
-typedef BOOL (WINAPI *_LockWorkStation_proto)();
-DynamicFn<_LockWorkStation_proto> _LockWorkStation(_T("user32.dll"), "LockWorkStation");
-
-
-ProcessSessionId::ProcessSessionId(DWORD processId) {
-  id = 0;
-  if (!_ProcessIdToSessionId.isValid())
-    return;
-  if ((int)processId == -1)
-    processId = GetCurrentProcessId();
-  if (!(*_ProcessIdToSessionId)(GetCurrentProcessId(), &id))
-    vnclog.Print(LL_INTERR, VNCLOG("ProcessIdToSessionId failed (error %d)"), GetLastError());
-}
-
-ProcessSessionId mySessionId;
-
-ConsoleSessionId::ConsoleSessionId() {
-  if (_WTSGetActiveConsoleSessionId.isValid())
-    id = (*_WTSGetActiveConsoleSessionId)();
-  else
-    id = 0;
-}
-
-bool inConsoleSession() {
-  ConsoleSessionId console;
-  return console.id == mySessionId.id;
-}
-
-void setConsoleSession(DWORD sessionId) {
-#ifdef RFB_HAVE_WINSTATION_CONNECT
-  if (!_WinStationConnect.isValid()) {
-    vnclog.Print(LL_INTERR, VNCLOG("WinSta APIs missing"));
-    return;
-  }
-  if ((int) sessionId == -1)
-    sessionId = mySessionId.id;
-
-  // Try to reconnect our session to the console
-  ConsoleSessionId console;
-  vnclog.Print(LL_INTINFO, VNCLOG("Console session is %d"), console.id);
-  if (!(*_WinStationConnect)(0, sessionId, console.id, L"", 0)) {
-    vnclog.Print(LL_INTERR, VNCLOG("Unable to connect session to Console (error %d)"), GetLastError());
-    return;
-  }
-
-  // Lock the newly connected session, for security
-  if (_LockWorkStation.isValid())
-    (*_LockWorkStation)();
-#else
-  vnclog.Print(LL_INTERR, VNCLOG("setConsoleSession not implemented"));
-#endif
-}
diff --git a/ica/win32/src/TsSessions.h b/ica/win32/src/TsSessions.h
deleted file mode 100644
index 29a115e..0000000
--- a/ica/win32/src/TsSessions.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * Copyright (C) 2007 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.
- */
-
-// Windows version-independent Terminal Services Session discovery
-// and manipulation API.  This code will eventually be replaced
-// by the full TS-compatibility scheme.
-
-#ifndef __RFB_WIN32_TSSESSIONS_H__
-#define __RFB_WIN32_TSSESSIONS_H__
-
-#include "stdhdrs.h"
-
-struct SessionId {
-  DWORD id;
-};
-
-// Session Id for a given process
-struct ProcessSessionId : SessionId {
-  ProcessSessionId(DWORD processId = (DWORD)-1);
-};
-
-// Session Id for current process
-extern ProcessSessionId mySessionId;
-
-// Current console Session Id
-struct ConsoleSessionId : SessionId {
-  ConsoleSessionId();
-};
-
-// Check whether the process is in the Console session at present
-bool inConsoleSession();
-
-// Make the specified session the Console session.
-//   If sessionId is -1 then the process' session is
-//   made the Console session.
-void setConsoleSession(DWORD sessionId = (DWORD) -1);
-
-#endif
diff --git a/ica/win32/src/VNCHooks/SharedData.cpp b/ica/win32/src/VNCHooks/SharedData.cpp
deleted file mode 100644
index 5ebee18..0000000
--- a/ica/win32/src/VNCHooks/SharedData.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//  Copyright (C) 2001 Constantin Kaplinsky. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-
-// SharedData.cpp : Storage for the global data in the DLL
-// This file is used only when your compiler is Borland C++.
-
-// Change default data segment and data class names
-#define SHARED __attribute__((section(".shr"), shared))
-
-#include "windows.h"
-
-SHARED HWND hVeneto = NULL;
-SHARED UINT UpdateRectMessage = 0;
-SHARED UINT CopyRectMessage = 0;
-SHARED UINT MouseMoveMessage = 0;
-SHARED UINT LocalMouseMessage = 0;
-SHARED UINT LocalKeyboardMessage = 0;
-SHARED HHOOK hCallWndHook = NULL;							// Handle to the CallWnd hook
-SHARED HHOOK hGetMsgHook = NULL;							// Handle to the GetMsg hook
-SHARED HHOOK hDialogMsgHook = NULL;						// Handle to the DialogMsg hook
-SHARED HHOOK hLLKeyboardHook = NULL;						// Handle to LowLevel kbd hook
-SHARED HHOOK hLLMouseHook = NULL;							// Handle to LowLevel mouse hook
-SHARED HHOOK hLLKeyboardPrHook = NULL;						// Handle to LowLevel kbd hook for local event priority
-SHARED HHOOK hLLMousePrHook = NULL;						// Handle to LowLevel mouse hook for local event priority
-SHARED HHOOK hKeyboardHook = NULL;							// Handle to kbd hook
-SHARED HHOOK hMouseHook = NULL;							// Handle to mouse hook
-SHARED HWND hKeyboardPriorityWindow = NULL;
-SHARED HWND hMousePriorityWindow = NULL;
-__declspec(dllexport) BOOL __localInputsDisabled = false;
-
diff --git a/ica/win32/src/VNCHooks/SharedData.h b/ica/win32/src/VNCHooks/SharedData.h
deleted file mode 100644
index 99465c2..0000000
--- a/ica/win32/src/VNCHooks/SharedData.h
+++ /dev/null
@@ -1,42 +0,0 @@
-//  Copyright (C) 2001 Constantin Kaplinsky. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-
-// SharedData.h : Declarations for the global data in the DLL
-// This file is used only when your compiler is Borland C++.
-
-extern HWND hVeneto;
-extern UINT UpdateRectMessage;
-extern UINT CopyRectMessage;
-extern UINT MouseMoveMessage;
-extern UINT LocalMouseMessage;
-extern UINT LocalKeyboardMessage;
-extern HHOOK hCallWndHook;
-extern HHOOK hGetMsgHook;
-extern HHOOK hDialogMsgHook;
-extern HHOOK hLLKeyboardHook;
-extern HHOOK hLLMouseHook;
-extern HHOOK hLLKeyboardPrHook;
-extern HHOOK hLLMousePrHook;
-extern HHOOK hKeyboardHook;
-extern HHOOK hMouseHook;
-extern HWND hKeyboardPriorityWindow;
-extern HWND hMousePriorityWindow;
-extern BOOL __localInputsDisabled;
diff --git a/ica/win32/src/VNCHooks/VNCHooks.cpp b/ica/win32/src/VNCHooks/VNCHooks.cpp
deleted file mode 100644
index 6d3fad8..0000000
--- a/ica/win32/src/VNCHooks/VNCHooks.cpp
+++ /dev/null
@@ -1,1371 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-// VNCHooks.cpp : Defines the implementation of the DLL.
-//
-
-#include "VNCHooks.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <crtdbg.h>
-
-/////////////////////////////////////////////////////////////////////////////
-// Storage for the global data in the DLL
-// Note: For Borland C++ compilers, this data segment is defined in a
-//       separate file, SharedData.cpp.
-
-#ifdef _MSC_VER
-
-// MSVC is bugged - if a default value is missed off from one of the following
-// variables then that variable is process-specific for some reason!
-
-#pragma data_seg(".SharedData")
-HWND hVeneto = NULL;
-HWND hKeyboardPriorityWindow = NULL;
-HWND hMousePriorityWindow = NULL;
-UINT UpdateRectMessage = 0;
-UINT CopyRectMessage = 0;
-UINT MouseMoveMessage = 0;
-UINT LocalMouseMessage = 0;
-UINT LocalKeyboardMessage = 0;
-HHOOK hCallWndHook = NULL;							// Handle to the CallWnd hook
-HHOOK hGetMsgHook = NULL;							// Handle to the GetMsg hook
-HHOOK hDialogMsgHook = NULL;						// Handle to the DialogMsg hook
-HHOOK hLLKeyboardHook = NULL;						// Handle to LowLevel kbd hook
-HHOOK hLLMouseHook = NULL;							// Handle to LowLevel mouse hook
-HHOOK hLLKeyboardPrHook = NULL;						// Handle to LowLevel kbd hook for local event priority
-HHOOK hLLMousePrHook = NULL;						// Handle to LowLevel mouse hook for local event priority
-HHOOK hKeyboardHook = NULL;							// Handle to kbd hook
-HHOOK hMouseHook = NULL;							// Handle to mouse hook
-
-#pragma data_seg( )
-
-#else
-
-#include "SharedData.h"
-
-#endif // _MSC_VER
-
-/////////////////////////////////////////////////////////////////////////////
-// Per-instance DLL variables
-
-const char sPrefSegment[] = "Application_Prefs\\";
-char *sModulePrefs = NULL;							// Name of the module that created us
-BOOL prf_use_GetUpdateRect = FALSE;					// Use the GetUpdateRect paint mode
-BOOL prf_use_Timer = FALSE;							// Use Timer events to trigger updates
-BOOL prf_use_KeyPress = FALSE;						// Use keyboard events
-BOOL prf_use_LButtonUp = TRUE;						// Use left mouse button up events
-BOOL prf_use_MButtonUp = FALSE;						// Use middle mouse button up events
-BOOL prf_use_RButtonUp = FALSE;						// Use right mouse button up events
-BOOL prf_use_Deferral = FALSE;						// Use deferred updates
-
-HKEY hModuleKey = NULL;								// Key used to save settings
-HINSTANCE hInstance = NULL;							// This instance of the DLL
-BOOL HookMaster = FALSE;							// Is this instance veneto itself?
-
-BOOL appHookedOK = FALSE;							// Did InitInstance succeed?
-
-/////////////////////////////////////////////////////////////////////////////
-// Registered messages & atoms to be used by VNCHooks.DLL
-
-// Messages
-const UINT VNC_DEFERRED_UPDATE = RegisterWindowMessage("VNCHooks.Deferred.UpdateMessage");
-
-// Atoms
-const char *VNC_WINDOWPOS_ATOMNAME = "VNCHooks.CopyRect.WindowPos";
-const char *VNC_POPUPSELN_ATOMNAME = "VNCHooks.PopUpMenu.Selected";
-ATOM VNC_WINDOWPOS_ATOM = (ATOM) NULL;
-ATOM VNC_POPUPSELN_ATOM = (ATOM) NULL;
-
-/////////////////////////////////////////////////////////////////////////////
-// The DLL functions
-
-// Forward definition of hook procedures
-
-BOOL HookHandle(UINT msg, HWND hWnd, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK CallWndProc (int nCode, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK DialogMessageProc(int nCode, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK LowLevelKeyboardFilterProc(int nCode, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK LowLevelMouseFilterProc(int nCode, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK LowLevelKeyboardPriorityProc(int nCode, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK LowLevelMousePriorityProc(int nCode, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK KeyboardPriorityProc(int nCode, WPARAM wParam, LPARAM lParam);
-LRESULT CALLBACK MousePriorityProc(int nCode, WPARAM wParam, LPARAM lParam);
-
-// Forward definition of setup and shutdown procedures
-BOOL InitInstance();
-BOOL ExitInstance();
-
-// The DLL's main procedure
-extern "C" BOOL APIENTRY DllMain (HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
-{
-	// Find out why we're being called
-	switch (ul_reason_for_call)
-	{
-
-	case DLL_PROCESS_ATTACH:
-#ifdef _MSC_VER
-		_RPT0(_CRT_WARN, "vncHooks : Hook DLL loaded\n");
-#endif
-
-		// Save the instance handle
-		hInstance = (HINSTANCE)hInst;
-
-		// Call the initialisation function
-		appHookedOK = InitInstance();
-
-		// ALWAYS return TRUE to avoid breaking unhookable applications!!!
-		return TRUE;
-
-	case DLL_PROCESS_DETACH:
-#ifdef _MSC_VER
-		_RPT0(_CRT_WARN, "vncHooks : Hook DLL unloaded\n");
-#endif
-		
-		// Call the exit function
-		// If the app failed to hook OK, ExitInstance will still operate OK (hopefully...)
-		ExitInstance();
-
-		return TRUE;
-
-	default:
-		return TRUE;
-	}
-}
-
-// Add the new hook
-
-DllExport BOOL SetHook(HWND hWnd, UINT UpdateMsg, UINT CopyMsg, UINT MouseMsg)
-{
-
-	// Don't add the hook if the window ID is NULL
-	if (hWnd == NULL)
-		return FALSE;
-	
-	// Don't add a hook if there is already one added
-	if (hVeneto != NULL)
-		return FALSE;
-
-	// Add the CallWnd hook
-	hCallWndHook = SetWindowsHookEx(
-					WH_CALLWNDPROC,					// Hook in before msg reaches app
-					(HOOKPROC) CallWndProc,			// Hook procedure
-					hInstance,						// This DLL instance
-					0L								// Hook in to all apps
-//					GetCurrentThreadId()			// DEBUG : HOOK ONLY WinVNC
-					);
-
-	// Add the GetMessage hook
-	hGetMsgHook = SetWindowsHookEx(
-					WH_GETMESSAGE,					// Hook in before msg reaches app
-					(HOOKPROC) GetMessageProc,			// Hook procedure
-					hInstance,						// This DLL instance
-					0L								// Hook in to all apps
-//					GetCurrentThreadId()			// DEBUG : HOOK ONLY WinVNC
-					);
-
-		// Add the GetMessage hook
-	hDialogMsgHook = SetWindowsHookEx(
-					WH_SYSMSGFILTER,				// Hook in dialogs, menus and scrollbars
-					(HOOKPROC) DialogMessageProc,	// Hook procedure
-					hInstance,						// This DLL instance
-					0L								// Hook in to all apps
-					);
-
-	// Check that it worked
-	if ((hCallWndHook != NULL) && (hGetMsgHook != NULL) && (hDialogMsgHook != NULL))
-	{
-		hVeneto = hWnd;						// Save the WinRFB window handle
-		UpdateRectMessage = UpdateMsg;		// Save the message ID to use for rectangle updates
-		CopyRectMessage = CopyMsg;			// Save the message ID to use for copyrect
-		MouseMoveMessage = MouseMsg;		// Save the message ID to send when mouse moves
-		HookMaster = TRUE;					// Set the HookMaster flag for this instance
-		
-#ifdef _MSC_VER
-		_RPT1(_CRT_WARN, "Window : %d\n", hWnd);
-#endif
-		
-		return TRUE;
-	}
-	else
-	{
-		// Stop the keyboard hook
-		SetKeyboardFilterHook(FALSE);
-		SetMouseFilterHook(FALSE);
-
-		// Kill the main hooks
-		if (hCallWndHook != NULL)
-			UnhookWindowsHookEx(hCallWndHook);
-		if (hGetMsgHook != NULL)
-			UnhookWindowsHookEx(hGetMsgHook);
-		if (hDialogMsgHook != NULL)
-			UnhookWindowsHookEx(hDialogMsgHook);
-		hCallWndHook = NULL;
-		hGetMsgHook = NULL;
-		hDialogMsgHook = NULL;
-	}
-
-	// The hook failed, so return an error code
-	return FALSE;
-
-}
-
-// EnumWindows procedure to remove the extra property we added
-
-BOOL CALLBACK
-KillPropsProc(HWND hwnd, LPARAM lParam)
-{
-	// Remove our custom property...
-	RemoveProp(hwnd, (LPCTSTR) MAKEWORD(VNC_WINDOWPOS_ATOM, 0));
-	RemoveProp(hwnd, (LPCTSTR) MAKEWORD(VNC_POPUPSELN_ATOM, 0));
-	return TRUE;
-}
-
-// Remove the hook from the system
-
-DllExport BOOL UnSetHook(HWND hWnd)
-{
-
-	BOOL unHooked = TRUE;
-	
-	// Remove the extra property value from all local windows
-	EnumWindows((WNDENUMPROC) &KillPropsProc, (LPARAM) NULL);
-
-	// Stop the keyboard & mouse hooks
-	unHooked = unHooked && SetKeyboardFilterHook(FALSE);
-	unHooked = unHooked && SetMouseFilterHook(FALSE);
-
-	// Is the window handle valid?
-	if (hWnd == NULL)
-		MessageBox(NULL, "Window pointer is null", "Message", MB_OK);
-
-	// Is the correct application calling UnSetHook?
-	if (hWnd != hVeneto)
-		return FALSE;
-
-	// Unhook the procs
-	if (hCallWndHook != NULL)
-	{
-		unHooked = unHooked && UnhookWindowsHookEx(hCallWndHook);
-		hCallWndHook = NULL;
-	}
-
-	if (hGetMsgHook != NULL)
-	{
-		unHooked = unHooked && UnhookWindowsHookEx(hGetMsgHook);
-		hGetMsgHook = NULL;
-	}
-
-	if (hDialogMsgHook != NULL)
-	{
-		unHooked = unHooked && UnhookWindowsHookEx(hDialogMsgHook);
-		hDialogMsgHook = NULL;
-	}
-
-	// If we managed to unhook then reset
-	if (unHooked)
-	{
-		hVeneto = NULL;
-		HookMaster = FALSE;
-	}
-
-	return unHooked;
-
-}
-
-// Routine to start and stop local keyboard message filtering
-DllExport BOOL SetKeyboardFilterHook(BOOL activate)
-{
-	if (activate)
-	{
-#ifdef WH_KEYBOARD_LL
-		if (hLLKeyboardHook == NULL)
-		{
-			// Start up the hook...
-			hLLKeyboardHook = SetWindowsHookEx(
-					WH_KEYBOARD_LL,					// Hook in before msg reaches app
-					(HOOKPROC) LowLevelKeyboardFilterProc,			// Hook procedure
-					hInstance,						// This DLL instance
-					0L								// Hook in to all apps
-					);
-			if (hLLKeyboardHook == NULL)
-				return FALSE;
-		}
-		return TRUE;
-#else
-#pragma message("warning:Low-Level Keyboard hook code omitted.")
-		return FALSE;
-#endif
-	} else {
-		if (hLLKeyboardHook != NULL)
-		{
-			// Stop the hook...
-			if (!UnhookWindowsHookEx(hLLKeyboardHook))
-				return FALSE;
-			hLLKeyboardHook = NULL;
-		}
-		return TRUE;
-	}
-}
-
-DllExport BOOL SetKeyboardPriorityLLHook(HWND hwnd, BOOL activate, UINT LocalKbdMsg)
-{
-	LocalKeyboardMessage = LocalKbdMsg;
-	if (activate)
-	{
-#ifdef WH_KEYBOARD_LL
-		if (hLLKeyboardPrHook == NULL)
-		{
-			// save the window handle
-			hKeyboardPriorityWindow = hwnd;
-		
-			// Start up the hook...
-			hLLKeyboardPrHook = SetWindowsHookEx(
-					WH_KEYBOARD_LL,					// Hook in before msg reaches app
-					(HOOKPROC) LowLevelKeyboardPriorityProc,			// Hook procedure
-					hInstance,						// This DLL instance
-					0L								// Hook in to all apps
-					);
-			if (hLLKeyboardPrHook == NULL)
-				return FALSE;
-		}
-		return TRUE;
-#else
-#pragma message("warning:Low-Level Keyboard hook code omitted.")
-		return FALSE;
-#endif
-	} else {
-		if (hLLKeyboardPrHook != NULL)
-		{
-			// Stop the hook...
-			if (!UnhookWindowsHookEx(hLLKeyboardPrHook))
-				return FALSE;
-				
-			// reset the hook and window handle
-			hKeyboardPriorityWindow = NULL;
-			hLLKeyboardPrHook = NULL;
-		}
-		return TRUE;
-	}
-}
-
-// Routine to start and stop local mouse message filtering
-DllExport BOOL SetMouseFilterHook(BOOL activate)
-{
-	if (activate)
-	{
-#ifdef WH_MOUSE_LL
-		if (hLLMouseHook == NULL)
-		{
-			// Start up the hook...
-			hLLMouseHook = SetWindowsHookEx(
-					WH_MOUSE_LL,					// Hook in before msg reaches app
-					(HOOKPROC) LowLevelMouseFilterProc,			// Hook procedure
-					hInstance,						// This DLL instance
-					0L								// Hook in to all apps
-					);
-			if (hLLMouseHook == NULL)
-				return FALSE;
-		}
-		return TRUE;
-#else
-#pragma message("warning:Low-Level Mouse hook code omitted.")
-		return FALSE;
-#endif
-	} else {
-		if (hLLMouseHook != NULL)
-		{
-			// Stop the hook...
-			if (!UnhookWindowsHookEx(hLLMouseHook))
-				return FALSE;
-			hLLMouseHook = NULL;
-		}
-		return TRUE;
-	}
-}
-
-DllExport BOOL SetMousePriorityLLHook(HWND hwnd, BOOL activate, UINT LocalMouseMsg)
-{
-	LocalMouseMessage = LocalMouseMsg;
-	if (activate)
-	{
-#ifdef WH_MOUSE_LL
-		if (hLLMousePrHook == NULL)
-		{
-			// save the window handle
-			hMousePriorityWindow = hwnd;
-		
-			// Start up the hook...
-			hLLMousePrHook = SetWindowsHookEx(
-					WH_MOUSE_LL,					// Hook in before msg reaches app
-					(HOOKPROC) LowLevelMousePriorityProc,			// Hook procedure
-					hInstance,						// This DLL instance
-					0L								// Hook in to all apps
-					);
-			if (hLLMousePrHook == NULL)
-				return FALSE;
-		}
-		return TRUE;
-#else
-#pragma message("warning:Low-Level Mouse hook code omitted.")
-		return FALSE;
-#endif
-	} else {
-		if (hLLMousePrHook != NULL)
-		{
-			// Stop the hook...
-			if (!UnhookWindowsHookEx(hLLMousePrHook))
-				return FALSE;
-				
-			// reset the hook and window handle
-			hMousePriorityWindow = NULL;
-			hLLMousePrHook = NULL;
-		}
-		return TRUE;
-	}
-}
-
-
-// Routine to start and stop local keyboard message filtering
-DllExport BOOL SetKeyboardPriorityHook(HWND hwnd, BOOL activate, UINT LocalKbdMsg)
-{
-	LocalKeyboardMessage = LocalKbdMsg;
-	if (activate)
-	{
-		if (hKeyboardHook == NULL)
-		{
-			// save the window handle
-			hKeyboardPriorityWindow = hwnd;
-
-			// Start up the hook...
-			hKeyboardHook = SetWindowsHookEx(
-					WH_KEYBOARD,					// Hook in before msg reaches app
-					(HOOKPROC) KeyboardPriorityProc,// Hook procedure
-					hInstance,						// This DLL instance
-					0L								// Hook in to all apps
-					);
-			if (hKeyboardHook == NULL)
-				return FALSE;
-		}
-		return TRUE;
-	} else {
-		if (hKeyboardHook != NULL)
-		{
-			// Stop the hook...
-			if (!UnhookWindowsHookEx(hKeyboardHook))
-				return FALSE;
-			
-			// reset the hook and window handle
-			hKeyboardPriorityWindow = NULL;
-			hKeyboardHook = NULL;
-		}
-		return TRUE;
-	}
-}
-
-
-// Routine to start and stop local mouse message filtering
-DllExport BOOL SetMousePriorityHook(HWND hwnd, BOOL activate, UINT LocalMouseMsg)
-{
-	LocalMouseMessage = LocalMouseMsg;
-	if (activate)
-	{
-		if (hMouseHook == NULL)
-		{
-			// save the window handle
-			hMousePriorityWindow = hwnd;
- 		
-			// Start up the hook...
-			hMouseHook = SetWindowsHookEx(
-					WH_MOUSE,					// Hook in before msg reaches app
-					(HOOKPROC) MousePriorityProc,			// Hook procedure
-					hInstance,						// This DLL instance
-					0L								// Hook in to all apps
-					);
-			if (hMouseHook == NULL)
-				return FALSE;
-		}
-		return TRUE;
-	} else {
-		if (hMouseHook != NULL)
-		{
-			// Stop the hook...
-			if (!UnhookWindowsHookEx(hMouseHook))
-				return FALSE;
-				
-			// reset the hook and window handle
-			hMousePriorityWindow = NULL;
-			hMouseHook = NULL;
-		}
-		return TRUE;
-	}
-}
-
-
-
-// Routine to get the window's client rectangle, in screen coordinates
-inline BOOL GetAbsoluteClientRect(HWND hwnd, RECT *rect)
-{
-	POINT topleft;
-	topleft.x = 0;
-	topleft.y = 0;
-
-	// Get the client rectangle size
-	if (!GetClientRect(hwnd, rect))
-		return FALSE;
-
-	// Get the client rectangle position
-	if (!ClientToScreen(hwnd, &topleft))
-		return FALSE;
-
-	// Now adjust the window rectangle
-	rect->left += topleft.x;
-	rect->top += topleft.y;
-	rect->right += topleft.x;
-	rect->bottom += topleft.y;
-
-	return TRUE;
-}
-
-// Routine to send a CopyRect message to WinVNC
-inline void SendCopyWindowRect(HWND hWnd)
-{
-	WPARAM vwParam;
-
-	// All we send back is the handle of the window to be moved
-	vwParam = (LPARAM) hWnd;
-
-	// Send the update to Veneto
-	PostMessage(
-		hVeneto,
-		CopyRectMessage,
-		vwParam,
-		0
-		);
-}
-
-// Routine to send an UpdateRect message to Veneto
-inline void SendUpdateRect(SHORT x, SHORT y, SHORT x2, SHORT y2)
-{
-	WPARAM vwParam;
-	LPARAM vlParam;
-
-	vwParam = MAKELONG(x, y);
-	vlParam = MAKELONG(x2, y2);
-
-	// Send the update to Veneto
-	PostMessage(
-		hVeneto,
-		UpdateRectMessage,
-		vwParam,
-		vlParam
-		);
-}
-
-// Send a window's position to Veneto
-
-inline void SendWindowRect(HWND hWnd)
-{
-	RECT wrect;
-
-	// Get the rectangle position
-	if (GetWindowRect(hWnd, &wrect) && IsWindowVisible(hWnd))
-	{
-		// Send the position
-		SendUpdateRect(
-			(SHORT) wrect.left,
-			(SHORT) wrect.top,
-			(SHORT) wrect.right,
-			(SHORT) wrect.bottom
-			);
-	}
-}
-
-// Send a deferred message into this Window's message queue, so that
-// we'll intercept it again only after the message that triggered it has been
-// handled
-
-inline void SendDeferredUpdateRect(HWND hWnd, SHORT x, SHORT y, SHORT x2, SHORT y2)
-{
-	WPARAM vwParam;
-	LPARAM vlParam;
-
-	vwParam = MAKELONG(x, y);
-	vlParam = MAKELONG(x2, y2);
-
-	if (prf_use_Deferral)
-	{
-		// Send the update back to the window
-		PostMessage(
-			hWnd,
-			VNC_DEFERRED_UPDATE,
-			vwParam,
-			vlParam
-			);
-	}
-	else
-	{
-		// Send the update to WinRFB
-		PostMessage(
-			hVeneto,
-			UpdateRectMessage,
-			vwParam,
-			vlParam
-			);
-	}
-}
-
-inline void SendDeferredWindowRect(HWND hWnd)
-{
-	RECT wrect;
-
-	// Get the rectangle position
-	if (::GetWindowRect(hWnd, &wrect) && ::IsWindowVisible(hWnd))
-	{
-		// Send the position
-		SendDeferredUpdateRect(
-			hWnd,
-			(SHORT) wrect.left,
-			(SHORT) wrect.top,
-			(SHORT) wrect.right,
-			(SHORT) wrect.bottom
-			);
-	}
-}
-
-inline void SendDeferredBorderRect(HWND hWnd)
-{
-	RECT wrect;
-	RECT crect;
-
-	// Get the rectangle position
-	if (GetWindowRect(hWnd, &wrect) && ::IsWindowVisible(hWnd))
-	{
-		// Get the client rectangle position
-		if (GetAbsoluteClientRect(hWnd, &crect))
-		{
-			// Send the four border rectangles
-			SendDeferredUpdateRect(hWnd, (SHORT) wrect.left, (SHORT) wrect.top, (SHORT) wrect.right, (SHORT) crect.top);
-			SendDeferredUpdateRect(hWnd, (SHORT) wrect.left, (SHORT) wrect.top, (SHORT) crect.left, (SHORT) wrect.bottom);
-			SendDeferredUpdateRect(hWnd, (SHORT) wrect.left, (SHORT) crect.bottom, (SHORT) wrect.right, (SHORT) wrect.bottom);
-			SendDeferredUpdateRect(hWnd, (SHORT) crect.right, (SHORT) wrect.top, (SHORT) wrect.right, (SHORT) wrect.bottom);
-		}
-	}
-}
-
-// Generic hook-handler
-
-inline BOOL HookHandle(UINT MessageId, HWND hWnd, WPARAM wParam, LPARAM lParam)
-{
-	////////////////////////////////////////////////////////////////
-	// *** HANDLE DEFERRED UPDATES ***
-
-	// Is this a deferred-update message?
-	if (MessageId == VNC_DEFERRED_UPDATE)
-	{
-
-		// NOTE : NEVER use the SendDeferred- routines to send updates
-		//		from here, or you'll get an infinite loop....!
-
-		// NB : The format of DEFERRED_UPDATE matches that of UpdateRectMessage,
-		//		so just send the exact same message data to WinRFB:
-
-		PostMessage(
-			hVeneto,
-			UpdateRectMessage,
-			wParam,
-			lParam
-			);
-
-		return FALSE;
-	}
-
-	// *** Could use WM_COPYDATA to send data to WinVNC
-
-/*
-	if (GetClassLong(hWnd, GCW_ATOM) == 32768)
-	{
-		_RPT4(_CRT_WARN, "DBG : popup menu message (hwnd=%d, msg=%d, l=%d, w=%d)\n",
-		hWnd, MessageId, lParam, wParam);
-	}
-*/
-
-	////////////////////////////////////////////////////////////////
-	// *** UPDATE-TRIGGERING MESSAGES ***
-
-	// Do something dependent upon message type
-	switch (MessageId)
-	{
-		
-		////////////////////////////////////////////////////////////////
-		// Messages indicating only a border repaint.
-	case WM_NCPAINT:
-	case WM_NCACTIVATE:
-		SendDeferredBorderRect(hWnd);
-		break;
-
-		////////////////////////////////////////////////////////////////
-		// Messages indicating a client area repaint
-	case WM_CHAR:
-	case WM_KEYUP:							// Handle key-presses
-		if (prf_use_KeyPress)
-			SendDeferredWindowRect(hWnd);
-		break;
-
-	case WM_LBUTTONUP:						// Handle LMB clicks
-		if (prf_use_LButtonUp)
-			SendDeferredWindowRect(hWnd);
-		break;
-
-	case WM_MBUTTONUP:						// Handle MMB clicks
-		if (prf_use_MButtonUp)
-			SendDeferredWindowRect(hWnd);
-		break;
-
-	case WM_RBUTTONUP:						// Handle RMB clicks
-		if (prf_use_RButtonUp)
-			SendDeferredWindowRect(hWnd);
-		break;
-
-	case WM_TIMER:
-		if (prf_use_Timer)
-			SendDeferredWindowRect(hWnd);
-		break;
-
-	case WM_HSCROLL:
-	case WM_VSCROLL:
-		if (((int) LOWORD(wParam) == SB_THUMBTRACK) || ((int) LOWORD(wParam) == SB_ENDSCROLL))
-			SendDeferredWindowRect(hWnd);
-		break;
-
-	case 485:  // HACK to handle popup menus
-		{
-			// Get the old popup menu selection value
-			HANDLE prop = GetProp(hWnd, (LPCTSTR) MAKELONG(VNC_POPUPSELN_ATOM, 0));
-			if (prop != (HANDLE) wParam)
-			{
-				// It did, so update the menu & the selection value
-				SendDeferredWindowRect(hWnd);
-				SetProp(hWnd,
-					(LPCTSTR) MAKELONG(VNC_POPUPSELN_ATOM, 0),
-					(HANDLE) wParam);
-			}
-		}
-		break;
-
-		////////////////////////////////////////////////////////////////
-		// Messages indicating a full window update
-	case WM_SYSCOLORCHANGE:
-	case WM_PALETTECHANGED:
-	case WM_SETTEXT:
-	case WM_ENABLE:
-	case BM_SETCHECK:
-	case BM_SETSTATE:
-	case EM_SETSEL:
-	//case WM_MENUSELECT:
-		SendDeferredWindowRect(hWnd);
-		break;
-
-		////////////////////////////////////////////////////////////////
-		// Messages indicating that an area of the window needs updating
-		// Uses GetUpdateRect to find out which
-	case WM_PAINT:
-		if (prf_use_GetUpdateRect)
-		{
-			HRGN region;
-			region = CreateRectRgn(0, 0, 0, 0);
-
-			// Get the affected region
-			if (GetUpdateRgn(hWnd, region, FALSE) != ERROR)
-			{
-				int buffsize;
-				UINT x;
-				RGNDATA *buff;
-				POINT TopLeft;
-
-				// Get the top-left point of the client area
-				TopLeft.x = 0;
-				TopLeft.y = 0;
-				if (!ClientToScreen(hWnd, &TopLeft))
-					break;
-
-				// Get the size of buffer required
-				buffsize = GetRegionData(region, 0, 0);
-				if (buffsize != 0)
-				{
-					buff = (RGNDATA *) new BYTE [buffsize];
-					if (buff == NULL)
-						break;
-
-					// Now get the region data
-					if(GetRegionData(region, buffsize, buff))
-					{
-						for (x=0; x<(buff->rdh.nCount); x++)
-						{
-							// Obtain the rectangles from the list
-							RECT *urect = (RECT *) (((BYTE *) buff) + sizeof(RGNDATAHEADER) + (x * sizeof(RECT)));
-							SendDeferredUpdateRect(
-								hWnd,
-								(SHORT) (TopLeft.x + urect->left),
-								(SHORT) (TopLeft.y + urect->top),
-								(SHORT) (TopLeft.x + urect->right),
-								(SHORT) (TopLeft.y + urect->bottom)
-								);
-						}
-					}
-
-					delete [] buff;
-				}
-			}
-
-			// Now free the region
-			if (region != NULL)
-				DeleteObject(region);
-		}
-		else
-			SendDeferredWindowRect(hWnd);
-		break;
-
-		////////////////////////////////////////////////////////////////
-		// Messages indicating full repaint of this and a different window
-		// Send the new position of the window
-	case WM_WINDOWPOSCHANGING:
-		if (IsWindowVisible(hWnd))
-			SendWindowRect(hWnd);
-		break;
-
-	case WM_WINDOWPOSCHANGED:
-		if (IsWindowVisible(hWnd))
-			SendDeferredWindowRect(hWnd);
-		break;
-
-		////////////////////////////////////////////////////////////////
-		// WinRFB also wants to know about mouse movement
-	case WM_NCMOUSEMOVE:
-	case WM_MOUSEMOVE:
-		// Inform WinRFB that the mouse has moved and pass it the current cursor handle
-		PostMessage(
-			hVeneto,
-			MouseMoveMessage,
-			(ULONG_PTR) GetCursor(),
-			0
-		);
-		break;
-
-		////////////////////////////////////////////////////////////////
-		// VNCHOOKS PROPERTIES HANDLING WINDOWS
-	case WM_DESTROY:
-		RemoveProp(hWnd, (LPCTSTR) MAKEWORD(VNC_WINDOWPOS_ATOM, 0));
-		RemoveProp(hWnd, (LPCTSTR) MAKEWORD(VNC_POPUPSELN_ATOM, 0));
-		break;
-
-	}
-
-	return TRUE;
-}
-
-// Hook procedure for CallWindow hook
-
-LRESULT CALLBACK CallWndProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
-	// Do we have to handle this message?
-	if (nCode == HC_ACTION)
-	{
-		// Process the hook if the Veneto window handle is valid
-		if (hVeneto != NULL)
-		{
-			CWPSTRUCT *cwpStruct = (CWPSTRUCT *) lParam;
-			HookHandle(cwpStruct->message, cwpStruct->hwnd, cwpStruct->wParam, cwpStruct->lParam);
-		}
-	}
-
-	// Call the next handler in the chain
-    return CallNextHookEx (hCallWndHook, nCode, wParam, lParam);
-}
-
-// Hook procedure for GetMessageProc hook
-
-LRESULT CALLBACK GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
-	// Do we have to handle this message?
-	if (nCode == HC_ACTION)
-	{
-		// Process the hook only if the Veneto window is valid
-		if (hVeneto != NULL)
-		{
-			MSG *msg = (MSG *) lParam;
-
-			// Only handle application messages if they're being removed:
-			if (wParam & PM_REMOVE)
-			{
-				// Handle the message
-				HookHandle(msg->message, msg->hwnd, msg->wParam, msg->lParam);
-			}
-		}
-	}
-
-	// Call the next handler in the chain
-    return CallNextHookEx (hGetMsgHook, nCode, wParam, lParam);
-}
-
-// Hook procedure for DialogMessageProc hook
-
-LRESULT CALLBACK DialogMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
-	// Do we have to handle this message?
-	if (nCode >= 0)
-	{
-		// Process the hook only if the Veneto window is valid
-		if (hVeneto != NULL)
-		{
-			MSG *msg = (MSG *) lParam;
-
-			// Handle the message
-			HookHandle(msg->message, msg->hwnd, msg->wParam, msg->lParam);
-		}
-	}
-
-	// Call the next handler in the chain
-    return CallNextHookEx (hGetMsgHook, nCode, wParam, lParam);
-}
-
-// Hook procedure for LowLevel Keyboard filtering
-
-#ifdef WH_KEYBOARD_LL
-LRESULT CALLBACK LowLevelKeyboardFilterProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
-	// Are we expected to handle this callback?
-	if (nCode == HC_ACTION)
-	{
-		// Is this keyboard event "real" or "injected"
-		// i.e. hardware or software-produced?
-		KBDLLHOOKSTRUCT *hookStruct = (KBDLLHOOKSTRUCT*)lParam;
-		if (!(hookStruct->flags & LLKHF_INJECTED) && __localInputsDisabled) {
-			// Message was not injected - reject it!
-			return TRUE;
-		}
-	}
-
-	// Otherwise, pass on the message
-	return CallNextHookEx(hLLKeyboardHook, nCode, wParam, lParam);
-}
-
-LRESULT CALLBACK LowLevelKeyboardPriorityProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
-	// Are we expected to handle this callback?
-	// do we have a target window handle?
-	if (nCode == HC_ACTION && hKeyboardPriorityWindow != NULL)
-	{
-		// Is this keyboard event "real" or "injected"
-		// i.e. hardware or software-produced?
-		KBDLLHOOKSTRUCT *hookStruct = (KBDLLHOOKSTRUCT*)lParam;
-		if (!(hookStruct->flags & LLKHF_INJECTED)) {
-			// Message was not injected - send RFB_LOCAL_KEYBOARD msg!
-			// Remote event will be blocked
-			PostMessage(
-				hKeyboardPriorityWindow,
-				LocalKeyboardMessage,
-				0,
-				0
-				);
-		}
-	}
-
-	// Otherwise, pass on the message
-	return CallNextHookEx(hLLKeyboardPrHook, nCode, wParam, lParam);
-}
-
-#endif
-
-// Hook procedure for LowLevel Mouse filtering
-
-#ifdef WH_MOUSE_LL
-LRESULT CALLBACK LowLevelMouseFilterProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
-	// Are we expected to handle this callback?
-	if (nCode == HC_ACTION)
-	{
-		// Is this mouse event "real" or "injected"
-		// i.e. hardware or software-produced?
-		MSLLHOOKSTRUCT *hookStruct = (MSLLHOOKSTRUCT*)lParam;
-		if (!(hookStruct->flags & LLMHF_INJECTED) && __localInputsDisabled) {
-
-			return TRUE;
-		}
-	}
-
-	// Otherwise, pass on the message
-	return CallNextHookEx(hLLMouseHook, nCode, wParam, lParam);
-}
-
-LRESULT CALLBACK LowLevelMousePriorityProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
-	// Are we expected to handle this callback?
-	// do we have a target window handle?
-	if (nCode == HC_ACTION && hMousePriorityWindow != NULL)
-	{
-		// Is this mouse event "real" or "injected"
-		// i.e. hardware or software-produced?
-		MSLLHOOKSTRUCT *hookStruct = (MSLLHOOKSTRUCT*)lParam;
-		if (!(hookStruct->flags & LLMHF_INJECTED)) {
-			// Message was not injected - send RFB_LOCAL_MOUSE msg!
-			// Remote event will be blocked
-			PostMessage(
-				hMousePriorityWindow,
-				LocalMouseMessage,
-				0,
-				0
-				);
-		}
-	}
-
-	// Otherwise, pass on the message
-	return CallNextHookEx(hLLMousePrHook, nCode, wParam, lParam);
-}
-
-#endif
-
-LRESULT CALLBACK KeyboardPriorityProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
-	// Are we expected to handle this callback?
-	// do we have a target window handle?
-	if (nCode == HC_ACTION && hKeyboardPriorityWindow != NULL)
-	{
-			PostMessage(
-			hKeyboardPriorityWindow,
-			LocalKeyboardMessage,
-			0,
-			0
-			);
-		
-	}
-
-	return CallNextHookEx(hKeyboardHook, nCode, wParam, lParam);
-}
-
-
-LRESULT CALLBACK MousePriorityProc(int nCode, WPARAM wParam, LPARAM lParam)
-{
-	// Are we expected to handle this callback?
-	// do we have a target window handle?
-	if (nCode == HC_ACTION && hMousePriorityWindow != NULL)
-	{
-		if ( (wParam == WM_LBUTTONDOWN) || (wParam == WM_RBUTTONDOWN) || (wParam == WM_MBUTTONDOWN) || (wParam == WM_MOUSEMOVE) )
-			PostMessage(
-			hMousePriorityWindow,
-			LocalMouseMessage,
-			0,
-			0
-			);
-	}
-
-	return CallNextHookEx(hMouseHook, nCode, wParam, lParam);
-}
-
-
-char * NameFromPath(const char *path)
-{
-	int x;
-	int l = strlen(path);
-	char *temp = NULL;
-	
-	// Find the file part of a filename
-	for (x=l-1; x>0; x--)
-	{
-		if (path[x] == '\\')
-		{
-			temp = strdup(&(path[x+1]));
-			break;
-		}
-	}
-
-	// If we didn't fine a \ then just return a copy of the original
-	if (temp == NULL)
-		temp = strdup(path);
-
-	return temp;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// Initialise / Exit routines.
-// These functions handle the update settings for any apps used with WinVNC.
-
-static const TCHAR szSoftware[] = "Software";
-static const TCHAR szCompany[] = "ORL";
-static const TCHAR szProfile[] = "VNCHooks";
-
-HKEY GetRegistryKey()
-{
-	HKEY hAppKey = NULL;
-	HKEY hSoftKey = NULL;
-	HKEY hCompanyKey = NULL;
-	if (RegOpenKeyEx(HKEY_CURRENT_USER, szSoftware, 0, KEY_WRITE|KEY_READ,
-		&hSoftKey) == ERROR_SUCCESS)
-	{
-		DWORD dw;
-		if (RegCreateKeyEx(hSoftKey, szCompany, 0, REG_NONE,
-			REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL,
-			&hCompanyKey, &dw) == ERROR_SUCCESS)
-		{
-			RegCreateKeyEx(hCompanyKey, szProfile, 0, REG_NONE,
-				REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL,
-				&hAppKey, &dw);
-		}
-	}
-	if (hSoftKey != NULL)
-		RegCloseKey(hSoftKey);
-	if (hCompanyKey != NULL)
-		RegCloseKey(hCompanyKey);
-
-	return hAppKey;
-}
-
-HKEY GetModuleKey(const char *proc_name)
-{
-	HKEY hModule = NULL;
-
-	// Work out the registry key to save this under
-	sModulePrefs = (char *) malloc(strlen(sPrefSegment) + strlen(proc_name) + 1);
-	if (sModulePrefs == NULL)
-		return FALSE;
-	sprintf(sModulePrefs, "%s%s", sPrefSegment, proc_name);
-
-	// Check whether the library's entry exists!
-	HKEY hAppKey = GetRegistryKey();
-	if (hAppKey == NULL)
-		return NULL;
-
-	// Attempt to open the section for this application
-	if (RegOpenKeyEx(hAppKey,
-					sModulePrefs,
-					0, KEY_WRITE|KEY_READ,
-					&hModule
-					) != ERROR_SUCCESS)
-	{
-		// Cut off the app directory and just use the name
-		char *file_name = NameFromPath(proc_name);
-
-		if (file_name == NULL)
-		{
-			RegCloseKey(hAppKey);
-			return NULL;
-		}
-
-		// Adjust the moduleprefs name
-		sprintf(sModulePrefs, "%s%s", sPrefSegment, file_name);
-		free(file_name);
-
-		// Now get the module key again
-		DWORD dw;
-		if (RegCreateKeyEx(hAppKey,
-					sModulePrefs,
-					0, REG_NONE, REG_OPTION_NON_VOLATILE,
-					KEY_WRITE|KEY_READ,
-					NULL,
-					&hModule,
-					&dw) != ERROR_SUCCESS)
-		{
-			// Couldn't find/create the key - fail!
-			RegCloseKey(hAppKey);
-			return NULL;
-		}
-	}
-
-	// Close the application registry key
-	RegCloseKey(hAppKey);
-
-	return hModule;
-}
-
-int GetProfileInt(LPTSTR key, int def)
-{
-	DWORD type;
-	DWORD value;
-	ULONG size = sizeof(value);
-
-	if (RegQueryValueEx(
-		hModuleKey,
-		key,
-		NULL,
-		&type,
-		(unsigned char *)&value,
-		&size) == ERROR_SUCCESS)
-	{
-		// Is the value of the right type?
-		if (type != REG_DWORD)
-		{
-			return def;
-		}
-		else
-		{
-			return value;
-		}
-	}
-	else
-	{
-		return def;
-	}
-}
-
-void WriteProfileInt(LPTSTR key, int value)
-{
-	RegSetValueEx(
-		hModuleKey,
-		key,
-		0,
-		REG_DWORD,
-		(unsigned char *)&value,
-		sizeof(value));
-}
-
-BOOL InitInstance() 
-{
-	// Create the global atoms
-	VNC_WINDOWPOS_ATOM = GlobalAddAtom(VNC_WINDOWPOS_ATOMNAME);
-	if (VNC_WINDOWPOS_ATOM == (ATOM) NULL)
-		return FALSE;
-	VNC_POPUPSELN_ATOM = GlobalAddAtom(VNC_POPUPSELN_ATOMNAME);
-	if (VNC_POPUPSELN_ATOM == (ATOM) NULL)
-		return FALSE;
-
-	// Get the module name
-	char proc_name[_MAX_PATH];
-	DWORD size;
-
-	// Attempt to get the program/module name
-	if ((size = GetModuleFileName(
-		GetModuleHandle(NULL),
-		(char *) &proc_name,
-		_MAX_PATH
-		)) == 0)
-		return FALSE;
-
-	// Get the key for the module
-	hModuleKey = GetModuleKey(proc_name);
-	if (hModuleKey == NULL)
-		return FALSE;
-
-	// Read in the prefs
-	prf_use_GetUpdateRect = GetProfileInt(
-		"use_GetUpdateRect",
-		TRUE
-		);
-
-	prf_use_Timer = GetProfileInt(
-		"use_Timer",
-		FALSE
-		);
-	prf_use_KeyPress = GetProfileInt(
-		"use_KeyPress",
-		TRUE
-		);
-	prf_use_LButtonUp = GetProfileInt(
-		"use_LButtonUp",
-		TRUE
-		);
-	prf_use_MButtonUp = GetProfileInt(
-		"use_MButtonUp",
-		TRUE
-		);
-	prf_use_RButtonUp = GetProfileInt(
-		"use_RButtonUp",
-		TRUE
-		);
-	prf_use_Deferral = GetProfileInt(
-		"use_Deferral",
-#ifdef HORIZONLIVE
-		FALSE	// we use full screen polling anyway
-#else
-		TRUE
-#endif
-		);
-
-	return TRUE;
-}
-
-BOOL ExitInstance() 
-{
-	// Free the created atoms
-	if (VNC_WINDOWPOS_ATOM != (ATOM) NULL)
-	{
-		GlobalDeleteAtom(VNC_WINDOWPOS_ATOM);
-		VNC_WINDOWPOS_ATOM = (ATOM) NULL;
-	}
-	if (VNC_POPUPSELN_ATOM != (ATOM) NULL)
-	{
-		GlobalDeleteAtom(VNC_POPUPSELN_ATOM);
-		VNC_POPUPSELN_ATOM = (ATOM) NULL;
-	}
-
-	// Write the module settings to disk
-	if (sModulePrefs != NULL)
-	{
-		WriteProfileInt(
-			"use_GetUpdateRect",
-			prf_use_GetUpdateRect
-			);
-
-		WriteProfileInt(
-			"use_Timer",
-			prf_use_Timer
-			);
-
-		WriteProfileInt(
-			"use_KeyPress",
-			prf_use_KeyPress
-			);
-
-		WriteProfileInt(
-			"use_LButtonUp",
-			prf_use_LButtonUp
-			);
-
-		WriteProfileInt(
-			"use_MButtonUp",
-			prf_use_MButtonUp
-			);
-
-		WriteProfileInt(
-			"use_RButtonUp",
-			prf_use_RButtonUp
-			);
-
-		WriteProfileInt(
-			"use_Deferral",
-			prf_use_Deferral
-			);
-
-		free(sModulePrefs);
-		sModulePrefs = NULL;
-	}
-
-	// Close the registry key for this module
-	if (hModuleKey != NULL)
-		RegCloseKey(hModuleKey);
-
-	return TRUE;
-}
diff --git a/ica/win32/src/VNCHooks/VNCHooks.h b/ica/win32/src/VNCHooks/VNCHooks.h
deleted file mode 100644
index bcbcf51..0000000
--- a/ica/win32/src/VNCHooks/VNCHooks.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// RFB LIBRARY / VNC Hooks library
-//
-// WinVNC uses this DLL to hook into the system message pipeline, allowing it
-// to intercept messages which may be relevant to screen update strategy
-//
-// This library was originally created using MFC as RFBLib.dll, on
-// 8/8/97	WEZ
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-// VNC Hooks library
-//
-// This version created:
-// 24/11/97
-
-#if !defined(_VNCHOOKS_DLL_)
-#define _VNCHOOKS_DLL_
-
-#include <windows.h>
-
-/////////////////////////////////////////////////////////////////////////////
-// Define the import/export tags
-
-#define DllImport __declspec(dllimport)
-#define DllExport __declspec(dllexport)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Functions used by WinVNC
-
-extern "C"
-{
-	// DLL functions:
-	DllExport BOOL SetHook(
-		HWND hWnd,
-		UINT UpdateMsg,
-		UINT CopyMsg,
-		UINT MouseMsg
-		);											// Set the hook
-	DllExport BOOL UnSetHook(HWND hWnd);			// Remove it
-	
-	// Control keyboard filtering
-	DllExport BOOL SetKeyboardFilterHook(BOOL activate);
-	// Control mouse filtering
-	DllExport BOOL SetMouseFilterHook(BOOL activate);
-	// hooks for Local event priority impl. (win9x)
-	DllExport BOOL SetKeyboardPriorityHook(HWND hwnd, BOOL activate,UINT LocalMsg);
-	DllExport BOOL SetMousePriorityHook(HWND hwnd, BOOL activate,UINT LocalMsg);
-	// hooks for Local event priority impl. (winNT)
-	DllExport BOOL SetKeyboardPriorityLLHook(HWND hwnd, BOOL activate,UINT LocalMsg);
-	DllExport BOOL SetMousePriorityLLHook(HWND hwnd, BOOL activate,UINT LocalMsg);
-
-}
-
-#endif // !defined(_VNCHOOKS_DLL_)
diff --git a/ica/win32/src/VSocket.cpp b/ica/win32/src/VSocket.cpp
deleted file mode 100644
index 9ea1fd9..0000000
--- a/ica/win32/src/VSocket.cpp
+++ /dev/null
@@ -1,691 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//  Copyright (C) 2001 HorizonLive.com, Inc. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// VSocket.cpp
-
-// The VSocket class provides a platform-independent socket abstraction
-// with the simple functionality required for an RFB server.
-
-class VSocket;
-
-////////////////////////////////////////////////////////
-// System includes
-
-#include "stdhdrs.h"
-
-// Visual C++ .NET 2003 compatibility
-#if (_MSC_VER>= 1300)
-#include <iostream>
-#else
-#include <iostream>
-#endif
-
-#include <stdio.h>
-#ifdef __WIN32__
-#include <io.h>
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#endif
-#include <sys/types.h>
-
-////////////////////////////////////////////////////////
-// Custom includes
-
-#include "VTypes.h"
-
-////////////////////////////////////////////////////////
-// *** Lovely hacks to make Win32 work.  Hurrah!
-
-#ifdef __WIN32__
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#endif
-
-////////////////////////////////////////////////////////
-// Socket implementation
-
-#include "VSocket.h"
-
-// The socket timeout value (currently 5 seconds, for no reason...)
-// *** THIS IS NOT CURRENTLY USED ANYWHERE
-const VInt rfbMaxClientWait = 5000;
-
-////////////////////////////
-// Socket implementation initialisation
-
-static WORD winsockVersion = 0;
-
-VSocketSystem::VSocketSystem()
-{
-  // Initialise the socket subsystem
-  // This is only provided for compatibility with Windows.
-
-#ifdef __WIN32__
-  // Initialise WinPoxySockets on Win32
-  WORD wVersionRequested;
-  WSADATA wsaData;
-	
-  wVersionRequested = MAKEWORD(2, 0);
-  if (WSAStartup(wVersionRequested, &wsaData) != 0)
-  {
-    m_status = VFalse;
-	return;
-  }
-
-  winsockVersion = wsaData.wVersion;
- 
-#else
-  // Disable the nasty read/write failure signals on UNIX
-  signal(SIGPIPE, SIG_IGN);
-#endif
-
-  // If successful, or if not required, then continue!
-  m_status = VTrue;
-}
-
-VSocketSystem::~VSocketSystem()
-{
-	if (m_status)
-	{
-		WSACleanup();
-	}
-}
-
-////////////////////////////
-
-VSocket::VSocket()
-{
-  // Clear out the internal socket fields
-  sock = -1;
-  out_queue = NULL;
-}
-
-////////////////////////////
-
-VSocket::~VSocket()
-{
-  // Close the socket
-  Close();
-}
-
-////////////////////////////
-
-VBool
-VSocket::Create()
-{
-  const int one = 1;
-
-  // Check that the old socket was closed
-  if (sock >= 0)
-    Close();
-
-  // Create the socket
-  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
-    {
-      return VFalse;
-    }
-
-  // Set the socket options:
-  if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one)))
-    {
-      return VFalse;
-    }
-  if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&one, sizeof(one)))
-	{
-	  return VFalse;
-	}
-
-  return VTrue;
-}
-
-////////////////////////////
-
-VBool
-VSocket::Close()
-{
-  if (sock >= 0)
-    {
-	  vnclog.Print(LL_SOCKINFO, VNCLOG("closing socket\n"));
-
-	  shutdown(sock, SD_BOTH);
-#ifdef __WIN32__
-	  closesocket(sock);
-#else
-	  close(sock);
-#endif
-      sock = -1;
-    }
-  while (out_queue)
-	{
-	  AIOBlock *next = out_queue->next;
-	  delete out_queue;
-	  out_queue = next;
-	}
-
-  return VTrue;
-}
-
-////////////////////////////
-
-VBool
-VSocket::Shutdown()
-{
-  if (sock >= 0)
-    {
-	  vnclog.Print(LL_SOCKINFO, VNCLOG("shutdown socket\n"));
-
-	  shutdown(sock, SD_BOTH);
-    }
-  while (out_queue)
-	{
-	  AIOBlock *next = out_queue->next;
-	  delete out_queue;
-	  out_queue = next;
-	}
-
-  return VTrue;
-}
-
-////////////////////////////
-
-VBool
-VSocket::Bind(const VCard port, const VBool localOnly,
-			  const VBool checkIfInUse)
-{
-  struct sockaddr_in addr;
-
-  // Check that the socket is open!
-  if (sock < 0)
-    return VFalse;
-
-  // If a specific port is being set then check it's not already used!
-  if (port != 0 && checkIfInUse)
-  {
-	VSocket dummy;
-
-	if (dummy.Create())
-	{
-		// If we're able to connect then the port number is in use...
-		if (dummy.Connect("localhost", port))
-			return VFalse;
-	}
-  }
-
-  // Set up the address to bind the socket to
-  addr.sin_family = AF_INET;
-  addr.sin_port = htons(port);
-  if (localOnly)
-	addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-  else
-	addr.sin_addr.s_addr = htonl(INADDR_ANY);
-
-  // And do the binding
-  if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0)
-      return VFalse;
-
-  return VTrue;
-}
-
-////////////////////////////
-
-VBool
-VSocket::Connect(VStringConst address, const VCard port)
-{
-  // Check the socket
-  if (sock < 0)
-    return VFalse;
-
-  // Create an address structure and clear it
-  struct sockaddr_in addr;
-  memset(&addr, 0, sizeof(addr));
-
-  // Fill in the address if possible
-  addr.sin_family = AF_INET;
-  addr.sin_addr.s_addr = inet_addr(address);
-
-  // Was the string a valid IP address?
-  if ((int) addr.sin_addr.s_addr == -1)
-    {
-      // No, so get the actual IP address of the host name specified
-      struct hostent *pHost;
-      pHost = gethostbyname(address);
-      if (pHost != NULL)
-	  {
-		  if (pHost->h_addr == NULL)
-			  return VFalse;
-		  addr.sin_addr.s_addr = ((struct in_addr *)pHost->h_addr)->s_addr;
-	  }
-	  else
-	    return VFalse;
-    }
-
-  // Set the port number in the correct format
-  addr.sin_port = htons(port);
-
-  // Actually connect the socket
-  if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
-    return VFalse;
-
-  // Put the socket into non-blocking mode
-#ifdef __WIN32__
-  u_long arg = 1;
-  if (ioctlsocket(sock, FIONBIO, &arg) != 0)
-	return VFalse;
-#else
-  if (fcntl(sock, F_SETFL, O_NDELAY) != 0)
-	return VFalse;
-#endif
-
-  return VTrue;
-}
-
-////////////////////////////
-
-VBool
-VSocket::Listen()
-{
-  // Check socket
-  if (sock < 0)
-    return VFalse;
-
-	// Set it to listen
-  if (listen(sock, 5) < 0)
-    return VFalse;
-
-  return VTrue;
-}
-
-////////////////////////////
-
-VSocket *
-VSocket::Accept()
-{
-  const int one = 1;
-
-  int new_socket_id;
-  VSocket * new_socket;
-
-  // Check this socket
-  if (sock < 0)
-    return NULL;
-
-  // Accept an incoming connection
-  if ((new_socket_id = accept(sock, NULL, 0)) < 0)
-    return NULL;
-
-  // Create a new VSocket and return it
-  new_socket = new VSocket;
-  if (new_socket != NULL)
-    {
-      new_socket->sock = new_socket_id;
-    }
-  else
-    {
-	  shutdown(new_socket_id, SD_BOTH);
-	  closesocket(new_socket_id);
-	  return NULL;
-    }
-
-  // Attempt to set the new socket's options
-  setsockopt(new_socket->sock, IPPROTO_TCP, TCP_NODELAY, (char *)&one, sizeof(one));
-
-  // Put the socket into non-blocking mode
-#ifdef __WIN32__
-  u_long arg = 1;
-  if (ioctlsocket(new_socket->sock, FIONBIO, &arg) != 0) {
-	delete new_socket;
-	new_socket = NULL;
-  }
-#else
-  if (fcntl(new_socket->sock, F_SETFL, O_NDELAY) != 0) {
-	delete new_socket;
-	new_socket = NULL;
-  }
-#endif
-
-  return new_socket;
-}
-
-////////////////////////////
-
-VBool
-VSocket::TryAccept(VSocket **new_socket, long ms)
-{
-	// Check this socket
-	if (sock < 0)
-		return VFalse;
-
-	struct fd_set fds;
-	struct timeval tm;
-	FD_ZERO(&fds);
-	FD_SET((int)sock, &fds);
-	tm.tv_sec = ms / 1000;
-	tm.tv_usec = (ms % 1000) * 1000;
-	int ready = select(sock + 1, &fds, NULL, NULL, &tm);
-	if (ready == 0) {
-		// Timeout
-		*new_socket = NULL;
-		return VTrue;
-	} else if (ready != 1) {
-		// Error
-		return VFalse;
-	}
-	// Ready to accept new connection
-	VSocket *s = Accept();
-	if (s == NULL)
-		return VFalse;
-	// Success
-	*new_socket = s;
-	return VTrue;
-}
-
-////////////////////////////
-
-VString
-VSocket::GetPeerName()
-{
-	struct sockaddr_in	sockinfo;
-	struct in_addr		address;
-	int					sockinfosize = sizeof(sockinfo);
-	VString				name;
-
-	// Get the peer address for the client socket
-	getpeername(sock, (struct sockaddr *)&sockinfo, &sockinfosize);
-	memcpy(&address, &sockinfo.sin_addr, sizeof(address));
-
-	name = inet_ntoa(address);
-	if (name == NULL)
-		return "<unavailable>";
-	else
-		return name;
-}
-
-////////////////////////////
-
-VString
-VSocket::GetSockName()
-{
-	struct sockaddr_in	sockinfo;
-	struct in_addr		address;
-	int					sockinfosize = sizeof(sockinfo);
-	VString				name;
-
-	// Get the peer address for the client socket
-	getsockname(sock, (struct sockaddr *)&sockinfo, &sockinfosize);
-	memcpy(&address, &sockinfo.sin_addr, sizeof(address));
-
-	name = inet_ntoa(address);
-	if (name == NULL)
-		return "<unavailable>";
-	else
-		return name;
-}
-
-////////////////////////////
-
-VCard32
-VSocket::Resolve(VStringConst address)
-{
-  VCard32 addr;
-
-  // Try converting the address as IP
-  addr = inet_addr(address);
-
-  // Was it a valid IP address?
-  if (addr == 0xffffffff)
-    {
-      // No, so get the actual IP address of the host name specified
-      struct hostent *pHost;
-      pHost = gethostbyname(address);
-      if (pHost != NULL)
-	  {
-		  if (pHost->h_addr == NULL)
-			  return 0;
-		  addr = ((struct in_addr *)pHost->h_addr)->s_addr;
-	  }
-	  else
-		  return 0;
-    }
-
-  // Return the resolved IP address as an integer
-  return addr;
-}
-
-////////////////////////////
-
-VBool
-VSocket::SetTimeout(VCard32 secs)
-{
-	if (LOBYTE(winsockVersion) < 2)
-		return VFalse;
-	int timeout=secs;
-	if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeout, sizeof(timeout)) == SOCKET_ERROR)
-	{
-		return VFalse;
-	}
-	if (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char*)&timeout, sizeof(timeout)) == SOCKET_ERROR)
-	{
-		return VFalse;
-	}
-	return VTrue;
-}
-
-////////////////////////////
-
-VInt VSocket::Send(const char *buff, const VCard bufflen)
-{
-	errno = 0;
-
-	VInt bytes = send(sock, buff, bufflen, 0);
-	if (bytes < 0)
-	{
-		int wsa_error = WSAGetLastError();
-		vnclog.Print(
-			LL_SOCKERR,
-			VNCLOG("send(0x%x, 0x%x, %d, 0): wsa_error = %d\n"),
-			sock,
-			buff,
-			bufflen,
-			wsa_error);
-#ifdef __WIN32__
-		if (wsa_error == WSAEWOULDBLOCK)
-			errno = EWOULDBLOCK;
-#endif
-	}
-
-	return bytes;
-}
-
-////////////////////////////
-
-VBool
-VSocket::SendExact(const char *buff, const VCard bufflen)
-{
-	struct fd_set write_fds;
-	struct timeval tm;
-	int count;
-
-	// Put the data into the queue
-	SendQueued(buff, bufflen);
-
-	while (out_queue) {
-		// Wait until some data can be sent
-		do {
-			FD_ZERO(&write_fds);
-			FD_SET((int)sock, &write_fds);
-			tm.tv_sec = 1;
-			tm.tv_usec = 0;
-			count = select(sock + 1, NULL, &write_fds, NULL, &tm);
-		} while (count == 0);
-		if (count < 0 || count > 1) {
-			vnclog.Print(LL_SOCKERR, VNCLOG("socket error in select()\n"));
-			return VFalse;
-		}
-		// Actually send some data
-		if (FD_ISSET((int)sock, &write_fds)) {
-			if (!SendFromQueue())
-				return VFalse;
-		}
-    }
-
-	return VTrue;
-}
-
-////////////////////////////
-
-VBool
-VSocket::SendQueued(const char *buff, const VCard bufflen)
-{
-	omni_mutex_lock l(queue_lock);
-
-	// Just append new bytes to the output queue
-	if (!out_queue) {
-		out_queue = new AIOBlock(bufflen, buff);
-		bytes_sent = 0;
-	} else {
-		AIOBlock *last = out_queue;
-		while (last->next)
-			last = last->next;
-		last->next = new AIOBlock(bufflen, buff);
-	}
-
-	return VTrue;
-}
-
-////////////////////////////
-
-VBool
-VSocket::SendFromQueue()
-{
-	omni_mutex_lock l(queue_lock);
-
-	// Is there something to send?
-	if (!out_queue)
-		return VTrue;
-
-	// Maximum data size to send at once
-	size_t portion_size = out_queue->data_size - bytes_sent;
-	if (portion_size > 32768)
-		portion_size = 32768;
-
-	// Try to send some data
-	int bytes = Send(out_queue->data_ptr + bytes_sent, portion_size);
-	if (bytes > 0) {
-		bytes_sent += bytes;
-	} else if (bytes < 0 && errno != EWOULDBLOCK) {
-		vnclog.Print(LL_SOCKERR, VNCLOG("socket error\n"));
-		return VFalse;
-	}
-
-	// Remove block if all its data has been sent
-	if (bytes_sent == out_queue->data_size) {
-		AIOBlock *sent = out_queue;
-		out_queue = sent->next;
-		bytes_sent = 0;
-		delete sent;
-	}
-
-	return VTrue;
-}
-
-////////////////////////////
-
-VInt
-VSocket::Read(char *buff, const VCard bufflen)
-{
-	errno = 0;
-
-	VInt bytes = recv(sock, buff, bufflen, 0);
-
-#ifdef __WIN32__
-	if (bytes < 0 && WSAGetLastError() == WSAEWOULDBLOCK)
-		errno = EWOULDBLOCK;
-#endif
-
-	return bytes;
-}
-
-////////////////////////////
-
-VBool
-VSocket::ReadExact(char *buff, const VCard bufflen)
-{
-	int bytes;
-	VCard currlen = bufflen;
-	struct fd_set read_fds, write_fds;
-	struct timeval tm;
-	int count;
-
-	while (currlen > 0) {
-		// Wait until some data can be read or sent
-		do {
-			FD_ZERO(&read_fds);
-			FD_SET((int)sock, &read_fds);
-			FD_ZERO(&write_fds);
-			if (out_queue)
-				FD_SET((int)sock, &write_fds);
-			tm.tv_sec = 0;
-			tm.tv_usec = 50;
-			count = select(sock + 1, &read_fds, &write_fds, NULL, &tm);
-		} while (count == 0);
-		if (count < 0 || count > 2) {
-			vnclog.Print(LL_SOCKERR, VNCLOG("socket error in select()\n"));
-			return VFalse;
-		}
-		if (FD_ISSET((unsigned int)sock, &write_fds)) {
-			// Try to send some data
-			if (!SendFromQueue())
-				return VFalse;
-		}
-		if (FD_ISSET((unsigned int)sock, &read_fds)) {
-			// Try to read some data in
-			bytes = Read(buff, currlen);
-			if (bytes > 0) {
-				// Adjust the buffer position and size
-				buff += bytes;
-				currlen -= bytes;
-			} else if (bytes < 0 && errno != EWOULDBLOCK) {
-				vnclog.Print(LL_SOCKERR, VNCLOG("socket error\n"));
-				return VFalse;
-			} else if (bytes == 0) {
-				vnclog.Print(LL_SOCKERR, VNCLOG("zero bytes read\n"));
-				return VFalse;
-			}
-		}
-    }
-
-	return VTrue;
-}
-
diff --git a/ica/win32/src/VSocket.h b/ica/win32/src/VSocket.h
deleted file mode 100644
index d2881ff..0000000
--- a/ica/win32/src/VSocket.h
+++ /dev/null
@@ -1,182 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//  Copyright (C) 2001 HorizonLive.com, Inc. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// VSocket.h
-
-// RFB V3.0
-
-// The VSocket class provides simple socket functionality,
-// independent of platform.  Hurrah.
-
-class VSocket;
-
-#if (!defined(_ATT_VSOCKET_DEFINED))
-#define _ATT_VSOCKET_DEFINED
-
-#include <omnithread.h>
-#include "VTypes.h"
-
-// This class is used as a part of output queue
-class AIOBlock
-{
-public:
-	size_t data_size;		// Data size in this block
-	char *data_ptr;			// Beginning of the data buffer
-	AIOBlock *next;			// Next block or NULL for the last block
-
-	AIOBlock(int size, const char *data = NULL) {
-		next = NULL;
-		data_size = size;
-		data_ptr = new char[size];
-		if (data_ptr && data)
-			memcpy(data_ptr, data, size);
-	}
-	~AIOBlock() {
-		if (data_ptr)
-			delete[] data_ptr;
-	}
-};
-
-////////////////////////////
-// Socket implementation
-
-// Create one or more VSocketSystem objects per application
-class VSocketSystem
-{
-public:
-	VSocketSystem();
-	~VSocketSystem();
-	VBool Initialised() {return m_status;};
-private:
-	VBool m_status;
-};
-
-// The main socket class
-class VSocket
-{
-public:
-  // Constructor/Destructor
-  VSocket();
-  virtual ~VSocket();
-
-  ////////////////////////////
-  // Socket implementation
-
-  // Create
-  //        Create a socket and attach it to this VSocket object
-  VBool Create();
-
-  // Shutdown
-  //        Shutdown the currently attached socket
-  VBool Shutdown();
-
-  // Close
-  //        Close the currently attached socket
-  VBool Close();
-
-  // Bind
-  //        Bind the attached socket to the specified port
-  //		If localOnly is VTrue then the socket is bound only
-  //        to the loopback adapter. If checkIfInUse is VTrue,
-  //        then the socket won't be bound to an address which
-  //        is already in use (i.e. accepts connections).
-  VBool Bind(const VCard port, const VBool localOnly = VFalse,
-			 const VBool checkIfInUse = VFalse);
-
-  // Connect
-  //        Make a stream socket connection to the specified port
-  //        on the named machine.
-  VBool Connect(VStringConst address, const VCard port);
-
-  // Listen
-  //        Set the attached socket to listen for connections
-  VBool Listen();
-
-  // Accept
-  //        If the attached socket is set to listen then this
-  //        call blocks waiting for an incoming connection, then
-  //        returns a new socket object for the new connection
-  VSocket *Accept();
-
-  // TryAccept
-  //        Non-blocking version of Accept. It waits for an
-  //        incoming connection only for the specified number of
-  //        milliseconds. It returns VFalse on error, otherwise stores
-  //        either pointer to the new VSocket, or NULL on timeout
-  VBool TryAccept(VSocket **new_socket, long ms);
-
-  // GetPeerName
-  //        If the socket is connected then this returns the name
-  //        of the machine to which it is connected.
-  //        This string MUST be copied before the next socket call...
-  VString GetPeerName();
-
-  // GetSockName
-  //		If the socket exists then the name of the local machine
-  //		is returned.  This string MUST be copied before the next
-  //		socket call!
-  VString GetSockName();
-
-  // Resolve
-  //        Uses the Winsock API to resolve the supplied DNS name to
-  //        an IP address and returns it as an Int32
-  static VCard32 Resolve(VStringConst name);
-
-  // SetTimeout
-  //        Sets the socket timeout on reads and writes.
-  VBool SetTimeout(VCard32 secs);
-
-  // I/O routines
-
-  // Send and Read return the number of bytes sent or recieved.
-  VInt Send(const char *buff, const VCard bufflen);
-  VInt Read(char *buff, const VCard bufflen);
-
-  // SendExact and ReadExact attempt to send and recieve exactly
-  // the specified number of bytes.
-  VBool SendExact(const char *buff, const VCard bufflen);
-  VBool ReadExact(char *buff, const VCard bufflen);
-
-  // SendQueued sends as much data as possible immediately,
-  // and puts remaining bytes in a queue, to be sent later.
-  VBool SendQueued(const char *buff, const VCard bufflen);
-
-  ////////////////////////////
-  // Internal structures
-protected:
-  // The internal socket id
-  int sock;
-
-  // Output queue
-  size_t bytes_sent;
-  AIOBlock *out_queue;
-  omni_mutex queue_lock;
-
-  VBool SendFromQueue();
-};
-
-#endif // _ATT_VSOCKET_DEFINED
diff --git a/ica/win32/src/VTypes.h b/ica/win32/src/VTypes.h
deleted file mode 100644
index bd71910..0000000
--- a/ica/win32/src/VTypes.h
+++ /dev/null
@@ -1,88 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-// VTypes.h
-
-// RFB V3.0
-
-// Datatypes used by the VGui system
-
-#if (!defined(_ATT_VTYPES_DEFINED))
-#define _ATT_VTYPES_DEFINED
-
-////////////////////////////
-// Numeric data types
-
-////////////////////////////
-// Fixed size (derived from rfb.h)
-
-typedef unsigned int VCard32;
-typedef unsigned short VCard16;
-typedef unsigned char VCard8;
-typedef int VInt32;
-typedef short VInt16;
-typedef char VInt8;
-
-////////////////////////////
-// Variable size
-//		These will always be at least as big as the largest
-//		fixed-size data-type
-
-typedef VCard32 VCard;
-typedef VInt32 VInt;
-
-////////////////////////////
-// Useful functions on integers
-
-static inline VInt Max(VInt x, VInt y) {if (x>y) return x; else return y;}
-static inline VInt Min(VInt x, VInt y) {if (x<y) return x; else return y;}
-
-////////////////////////////
-// Boolean
-
-typedef int VBool;
-const VBool VTrue = -1;
-const VBool VFalse = 0;
-
-////////////////////////////
-// Others
-
-typedef char VChar;
-#if (!defined(NULL))
-#define NULL 0
-#endif
-
-////////////////////////////
-// Compound data types
-
-typedef VChar * VString;
-typedef const VChar * VStringConst;
-
-#endif // _ATT_VTYPES_DEFINED
-
-
-
-
-
diff --git a/ica/win32/src/VideoDriver.cpp b/ica/win32/src/VideoDriver.cpp
deleted file mode 100644
index 8b968ba..0000000
--- a/ica/win32/src/VideoDriver.cpp
+++ /dev/null
@@ -1,766 +0,0 @@
-//  Copyright (C) 2005-2006 Lev Kazarkin. All Rights Reserved.
-//
-//  TightVNC is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-
-#include "VideoDriver.h"
-#include "vncDesktop.h"
-
-char	vncVideoDriver::szDriverString[] = "Mirage Driver";
-char	vncVideoDriver::szDriverStringAlt[] = "DemoForge Mirage Driver";
-char	vncVideoDriver::szMiniportName[] = "dfmirage";
-
-#define MINIPORT_REGISTRY_PATH	"SYSTEM\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services"
-
-BOOL IsWinNT();
-BOOL IsNtVer(ULONG mj, ULONG mn);
-BOOL IsWinVerOrHigher(ULONG mj, ULONG mn);
-
-
-vncVideoDriver::vncVideoDriver()
-{
-	bufdata.buffer = NULL;
-	bufdata.Userbuffer = NULL;
-	m_fIsActive = false;
-	m_fDirectAccessInEffect = false;
-	m_fHandleScreen2ScreenBlt = false;
-	*m_devname= 0;
-	m_drv_ver_mj = 0;
-	m_drv_ver_mn = 0;
-}
-
-vncVideoDriver::~vncVideoDriver()
-{
-	UnMapSharedbuffers();
-	Deactivate();
-	_ASSERTE(!m_fIsActive);
-	_ASSERTE(!m_fDirectAccessInEffect);
-}
-
-#define	BYTE0(x)	((x) & 0xFF)
-#define	BYTE1(x)	(((x) >> 8) & 0xFF)
-#define	BYTE2(x)	(((x) >> 16) & 0xFF)
-#define	BYTE3(x)	(((x) >> 24) & 0xFF)
-
-BOOL vncVideoDriver::CheckVersion()
-{
-	_ASSERTE(IsWinNT());
-
-	HDC	l_gdc= ::CreateDC(m_devname, NULL, NULL, NULL);
-	if (!l_gdc)
-	{
-		vnclog.Print(
-			LL_INTERR,
-			VNCLOG("vncVideoDriver::CheckVersion: can't create DC on \"%s\"\n"),
-			m_devname);
-		return FALSE;
-	}
-
-	Esc_dmf_Qvi_IN qvi_in;
-	qvi_in.cbSize = sizeof(qvi_in);
-	vnclog.Print(
-		LL_INTINFO,
-		"Supported driver version is: min = %u.%u.%u.%u, cur = %u.%u.%u.%u\n",
-		BYTE3(DMF_PROTO_VER_MINCOMPAT), BYTE2(DMF_PROTO_VER_MINCOMPAT), BYTE1(DMF_PROTO_VER_MINCOMPAT), BYTE0(DMF_PROTO_VER_MINCOMPAT),
-		BYTE3(DMF_PROTO_VER_CURRENT), BYTE2(DMF_PROTO_VER_CURRENT), BYTE1(DMF_PROTO_VER_CURRENT), BYTE0(DMF_PROTO_VER_CURRENT));
-	qvi_in.app_actual_version = DMF_PROTO_VER_CURRENT;
-	qvi_in.display_minreq_version = DMF_PROTO_VER_MINCOMPAT;
-	qvi_in.connect_options = 0;
-
-	Esc_dmf_Qvi_OUT qvi_out;
-	qvi_out.cbSize = sizeof(qvi_out);
-
-	int drvCr = ExtEscape(
-		l_gdc,
-		ESC_QVI,
-		sizeof(qvi_in), (LPSTR) &qvi_in,
-		sizeof(qvi_out), (LPSTR) &qvi_out);
-	DeleteDC(l_gdc);
-
-	if (drvCr == 0)
-	{
-		vnclog.Print(
-			LL_INTERR,
-			VNCLOG("vncVideoDriver::CheckVersion: ESC_QVI not supported by this version of Mirage\n"));
-		return FALSE;
-	}
-
-	vnclog.Print(
-		LL_INTINFO,
-		"Driver version is: display = %u.%u.%u.%u (build %u),"
-		" miniport = %u.%u.%u.%u (build %u),"
-		" appMinReq = %u.%u.%u.%u\n",
-		BYTE3(qvi_out.display_actual_version), BYTE2(qvi_out.display_actual_version), BYTE1(qvi_out.display_actual_version), BYTE0(qvi_out.display_actual_version),
-		qvi_out.display_buildno, 
-		BYTE3(qvi_out.miniport_actual_version), BYTE2(qvi_out.miniport_actual_version), BYTE1(qvi_out.miniport_actual_version), BYTE0(qvi_out.miniport_actual_version),
-		qvi_out.miniport_buildno,
-		BYTE3(qvi_out.app_minreq_version), BYTE2(qvi_out.app_minreq_version), BYTE1(qvi_out.app_minreq_version), BYTE0(qvi_out.app_minreq_version));
-
-	if (drvCr < 0)
-	{
-		vnclog.Print(
-			LL_INTERR,
-			VNCLOG("vncVideoDriver::CheckVersion: ESC_QVI call returned 0x%x\n"),
-			drvCr);
-		return FALSE;
-	}
-
-	m_drv_ver_mj = BYTE3(qvi_out.display_actual_version);
-	m_drv_ver_mn = BYTE2(qvi_out.display_actual_version);
-
-	return TRUE;
-}
-
-BOOL vncVideoDriver::MapSharedbuffers(BOOL fForDirectScreenAccess)
-{
-	_ASSERTE(!m_fIsActive);
-	_ASSERTE(!m_fDirectAccessInEffect);
-	_ASSERTE(IsWinNT());
-
-	HDC	l_gdc= ::CreateDC(m_devname, NULL, NULL, NULL);
-	if (!l_gdc)
-	{
-		vnclog.Print(
-			LL_INTERR,
-			VNCLOG("vncVideoDriver::MapSharedbuffers: can't create DC on \"%s\"\n"),
-			m_devname);
-		return FALSE;
-	}
-
-	oldCounter = 0;
-	int drvCr = ExtEscape(
-		l_gdc,
-		MAP1,
-		0, NULL,
-		sizeof(GETCHANGESBUF), (LPSTR) &bufdata);
-	DeleteDC(l_gdc);
-
-	if (drvCr <= 0)
-	{
-		vnclog.Print(
-			LL_INTERR,
-			VNCLOG("vncVideoDriver::MapSharedbuffers: MAP1 call returned 0x%x\n"),
-			drvCr);
-		return FALSE;
-	}
-	m_fIsActive = true;
-	if (fForDirectScreenAccess)
-	{
-		if (!bufdata.Userbuffer)
-		{
-			vnclog.Print(
-				LL_INTERR,
-				VNCLOG("vncVideoDriver::MapSharedbuffers: mirror screen view is NULL\n"));
-			return FALSE;
-		}
-		m_fDirectAccessInEffect = true;
-	}
-	else
-	{
-		if (bufdata.Userbuffer)
-		{
-			vnclog.Print(
-				LL_INTINFO,
-				VNCLOG("vncVideoDriver::MapSharedbuffers: mirror screen view is mapped but direct access mode is OFF\n"));
-		}
-	}
-
-// Screen2Screen support added in Mirage ver 1.2
-	m_fHandleScreen2ScreenBlt = (m_drv_ver_mj > 1) || (m_drv_ver_mj == 1 && m_drv_ver_mn >= 2);
-
-	return TRUE;	
-}
-
-BOOL vncVideoDriver::TestMapped()
-{
-	_ASSERTE(IsWinNT());
-
-	TCHAR *pDevName;
-	if (IsWinVerOrHigher(5, 0))
-	{
-		DISPLAY_DEVICE dd;
-		INT devNum = 0;
-		if (!LookupVideoDeviceAlt(szDriverString, szDriverStringAlt, devNum, &dd))
-			return FALSE;
-		pDevName = (TCHAR *)dd.DeviceName;
-	}
-	else
-	{
-		pDevName = "DISPLAY";
-	}
-
-	HDC	l_ddc = ::CreateDC(pDevName, NULL, NULL, NULL);
-	if (l_ddc)
-	{
-		BOOL b = ExtEscape(l_ddc, TESTMAPPED, 0, NULL, 0, NULL);	
-		DeleteDC(l_ddc);
-		return b;
-	}
-	return FALSE;
-}
-
-void vncVideoDriver::UnMapSharedbuffers()
-{
-	_ASSERTE(IsWinNT());
-
-	int DrvCr = 0;
-	if (m_devname[0])
-	{
-		_ASSERTE(m_fIsActive);
-		_ASSERTE(bufdata.buffer);
-		_ASSERTE(!m_fDirectAccessInEffect || bufdata.Userbuffer);
-
-		HDC	l_gdc= ::CreateDC(m_devname, NULL, NULL, NULL);
-		if (!l_gdc)
-		{
-			vnclog.Print(
-				LL_INTERR,
-				VNCLOG("vncVideoDriver::UnMapSharedbuffers: can't create DC on \"%s\"\n"),
-				m_devname);
-		}
-		else
-		{
-			DrvCr = ExtEscape(
-				l_gdc,
-				UNMAP1,
-				sizeof(GETCHANGESBUF), (LPSTR) &bufdata,
-				0, NULL);
-			DeleteDC(l_gdc);
-
-			_ASSERTE(DrvCr > 0);
-		}
-	}
-// 0 return value is unlikely for Mirage because its DC is independent
-// from the reference device;
-// this happens with Quasar if its mode was changed externally.
-// nothing is particularly bad with it.
-
-	if (DrvCr <= 0)
-	{
-		vnclog.Print(
-			LL_INTINFO,
-			VNCLOG("vncVideoDriver::UnMapSharedbuffers failed. unmapping manually\n"));
-		if (bufdata.buffer)
-		{
-			BOOL br = UnmapViewOfFile(bufdata.buffer);
-			vnclog.Print(
-				LL_INTINFO,
-				VNCLOG("vncVideoDriver::UnMapSharedbuffers: UnmapViewOfFile(bufdata.buffer) returned %d\n"),
-				br);
-		}
-		if (bufdata.Userbuffer)
-		{
-			BOOL br = UnmapViewOfFile(bufdata.Userbuffer);
-			vnclog.Print(
-				LL_INTINFO,
-				VNCLOG("vncVideoDriver::UnMapSharedbuffers: UnmapViewOfFile(bufdata.Userbuffer) returned %d\n"),
-				br);
-		}
-	}
-	m_fIsActive = false;
-	m_fDirectAccessInEffect = false;
-	m_fHandleScreen2ScreenBlt = false;
-}
-
-template <class TpFn>
-HINSTANCE  LoadNImport(LPCTSTR szDllName, LPCTSTR szFName, TpFn &pfn)
-{
-	HINSTANCE hDll = LoadLibrary(szDllName);
-	if (hDll)
-	{
-		pfn = (TpFn)GetProcAddress(hDll, szFName);
-		if (pfn)
-			return hDll;
-		FreeLibrary(hDll);
-	}
-	vnclog.Print(
-		LL_INTERR,
-		VNCLOG("Can not import '%s' from '%s'.\n"),
-		szFName, szDllName);
-	return NULL;
-}
-
-//BOOL vncVideoDriver::LookupVideoDevice(LPCTSTR szDeviceString, INT &devNum, DISPLAY_DEVICE *pDd)
-BOOL vncVideoDriver::LookupVideoDeviceAlt(
-		LPCTSTR szDevStr,
-		LPCTSTR szDevStrAlt,
-		INT &devNum,
-		DISPLAY_DEVICE *pDd)
-{
-	_ASSERTE(IsWinVerOrHigher(5, 0));
-
-	pEnumDisplayDevices pd = NULL;
-	HINSTANCE  hInstUser32 = LoadNImport("User32.DLL", "EnumDisplayDevicesA", pd);
-	if (!hInstUser32) return FALSE;
-
-	ZeroMemory(pDd, sizeof(DISPLAY_DEVICE));
-	pDd->cb = sizeof(DISPLAY_DEVICE);
-	BOOL result;
-	while ((result = (*pd)(NULL,devNum, pDd, 0)))
-	{
-		if (strcmp((const char *)pDd->DeviceString, szDevStr) == 0 ||
-			szDevStrAlt && strcmp((const char *)pDd->DeviceString, szDevStrAlt) == 0)
-		{
-			vnclog.Print(
-				LL_INTINFO,
-				VNCLOG("Found display device \"%s\": \"%s\"\n"),
-				pDd->DeviceString,
-				pDd->DeviceName);
-			break;
-		}
-		devNum++;
-	}
-
-	FreeLibrary(hInstUser32);
-	return result;
-}
-
-HKEY vncVideoDriver::CreateDeviceKey(LPCTSTR szMpName)
-{
-	HKEY hKeyProfileMirror = (HKEY)0;
-	if (RegCreateKey(
-			HKEY_LOCAL_MACHINE,
-			(MINIPORT_REGISTRY_PATH),
-			&hKeyProfileMirror) != ERROR_SUCCESS)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("Can't access registry.\n"));
-		return FALSE;
-	}
-	HKEY hKeyProfileMp = (HKEY)0;
-	LONG cr = RegCreateKey(
-			hKeyProfileMirror,
-			szMpName,
-			&hKeyProfileMp);
-	RegCloseKey(hKeyProfileMirror);
-	if (cr != ERROR_SUCCESS)
-	{
-		vnclog.Print(
-			LL_INTERR,
-			VNCLOG("Can't access \"%s\" hardware profiles key.\n"),
-			szMpName);
-		return FALSE;
-	}
-	HKEY hKeyDevice = (HKEY)0;
-	if (RegCreateKey(
-			hKeyProfileMp,
-			("DEVICE0"),
-			&hKeyDevice) != ERROR_SUCCESS)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("Can't access DEVICE0 hardware profiles key.\n"));
-	}
-	RegCloseKey(hKeyProfileMp);
-	return hKeyDevice;
-}
-
-BOOL vncVideoDriver::Activate(
-		BOOL fForDirectAccess,
-		const RECT *prcltarget)
-{
-	_ASSERTE(IsWinNT());
-
-	if (IsWinVerOrHigher(5, 0))
-	{
-		return Activate_NT50(fForDirectAccess, prcltarget);
-	}
-	else
-	{
-// NOTE: prcltarget is just a SourceDisplayRect.
-// there is only 1 possibility on NT4, so safely ignore it
-		return Activate_NT46(fForDirectAccess);
-	}
-}
-
-void vncVideoDriver::Deactivate()
-{
-	_ASSERTE(IsWinNT());
-
-	if (IsWinVerOrHigher(5, 0))
-	{
-		Deactivate_NT50();
-	}
-	else
-	{
-		Deactivate_NT46();
-	}
-}
-
-BOOL vncVideoDriver::Activate_NT50(
-		BOOL fForDirectAccess,
-		const RECT *prcltarget)
-{
-	HDESK   hdeskInput = 0;
-    HDESK   hdeskCurrent;
- 
-	DISPLAY_DEVICE dd;
-	INT devNum = 0;
-	if (!LookupVideoDeviceAlt(szDriverString, szDriverStringAlt, devNum, &dd))
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("No '%s' or '%s' found.\n"), szDriverString, szDriverStringAlt);
-		return FALSE;
-	}
-
-	DEVMODE devmode;
-	FillMemory(&devmode, sizeof(DEVMODE), 0);
-	devmode.dmSize = sizeof(DEVMODE);
-	devmode.dmDriverExtra = 0;
-	(BOOL) EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devmode);
-	devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
-	if (prcltarget)
-	{
-// we always have to set position or
-// a stale position info in registry would come into effect.
-		devmode.dmFields |= DM_POSITION;
-		devmode.dmPosition.x = prcltarget->left;
-		devmode.dmPosition.y = prcltarget->top;
-
-		devmode.dmPelsWidth = prcltarget->right - prcltarget->left;
-		devmode.dmPelsHeight = prcltarget->bottom - prcltarget->top;
-	}
-
-	devmode.dmDeviceName[0] = '\0';
-
-    vnclog.Print(LL_INTINFO, VNCLOG("DevNum:%d\nName:%s\nString:%s\n\n"), devNum, &dd.DeviceName[0], &dd.DeviceString[0]);
-	vnclog.Print(LL_INTINFO, VNCLOG("Screen Top-Left Position: (%i, %i)\n"), devmode.dmPosition.x, devmode.dmPosition.y);
-	vnclog.Print(LL_INTINFO, VNCLOG("Screen Dimensions: (%i, %i)\n"), devmode.dmPelsWidth, devmode.dmPelsHeight);
-	vnclog.Print(LL_INTINFO, VNCLOG("Screen Color depth: %i\n"), devmode.dmBitsPerPel);
-
-	HKEY hKeyDevice = CreateDeviceKey(szMiniportName);
-	if (hKeyDevice == NULL)
-		return FALSE;
-
-// TightVNC does not use these features
-	RegDeleteValue(hKeyDevice, ("Screen.ForcedBpp"));
-	RegDeleteValue(hKeyDevice, ("Pointer.Enabled"));
-
-	DWORD dwVal = fForDirectAccess ? 3 : 0;
-// NOTE that old driver ignores it and mapping is always ON with it
-	if (RegSetValueEx(
-			hKeyDevice,
-			("Cap.DfbBackingMode"),
-			0,
-			REG_DWORD,
-			(unsigned char *)&dwVal,
-			4) != ERROR_SUCCESS)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("Can't set \"Cap.DfbBackingMode\" to %d\n"), dwVal);
-		return FALSE;
-	}
-
-	dwVal = 1;
-	if (RegSetValueEx(
-		hKeyDevice,
-		("Order.BltCopyBits.Enabled"),
-		0,
-		REG_DWORD,
-		(unsigned char *)&dwVal,
-		4) != ERROR_SUCCESS)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("Can't set Order.BltCopyBits.Enabled to %d\n"), dwVal);
-		return FALSE;
-	}
-
-	dwVal = 1;
-	if (RegSetValueEx(
-			hKeyDevice,
-			("Attach.ToDesktop"),
-			0,
-			REG_DWORD,
-			(unsigned char *)&dwVal,
-			4) != ERROR_SUCCESS)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("Can't set Attach.ToDesktop to %d\n"), dwVal);
-		return FALSE;
-	}
-
-	pChangeDisplaySettingsEx pCDS = NULL;
-	HINSTANCE  hInstUser32 = LoadNImport("User32.DLL", "ChangeDisplaySettingsExA", pCDS);
-	if (!hInstUser32) return FALSE;
-
-	// Save the current desktop
-	hdeskCurrent = GetThreadDesktop(GetCurrentThreadId());
-	if (hdeskCurrent != NULL)
-	{
-		hdeskInput = OpenInputDesktop(0, FALSE, MAXIMUM_ALLOWED);
-		if (hdeskInput != NULL) 
-			SetThreadDesktop(hdeskInput);
-	}
-// 24 bpp screen mode is MUNGED to 32 bpp.
-// the underlying buffer format must be 32 bpp.
-// see vncDesktop::ThunkBitmapInfo()
-	if (devmode.dmBitsPerPel==24) devmode.dmBitsPerPel = 32;
-	LONG cr = (*pCDS)(
-		(TCHAR *)dd.DeviceName,
-		&devmode,
-		NULL,
-		CDS_UPDATEREGISTRY,NULL);
-	if (cr != DISP_CHANGE_SUCCESSFUL)
-	{
-		vnclog.Print(
-			LL_INTERR,
-			VNCLOG("ChangeDisplaySettingsEx failed on device \"%s\" with status: 0x%x\n"),
-			dd.DeviceName,
-			cr);
-	}
-
-	strcpy(m_devname, (const char *)dd.DeviceName);
-
-	// Reset desktop
-	SetThreadDesktop(hdeskCurrent);
-	// Close the input desktop
-	CloseDesktop(hdeskInput);
-	RegCloseKey(hKeyDevice);
-	FreeLibrary(hInstUser32);
-
-	return TRUE;
-}
-
-BOOL vncVideoDriver::Activate_NT46(BOOL fForDirectAccess)
-{
-	HKEY hKeyDevice = CreateDeviceKey(szMiniportName);
-	if (hKeyDevice == NULL)
-		return FALSE;
-
-	// TightVNC does not use these features
-	RegDeleteValue(hKeyDevice, ("Screen.ForcedBpp"));
-	RegDeleteValue(hKeyDevice, ("Pointer.Enabled"));
-
-	DWORD dwVal = fForDirectAccess ? 3 : 0;
-	// NOTE that old driver ignores it and mapping is always ON with it
-	if (RegSetValueEx(
-		hKeyDevice,
-		("Cap.DfbBackingMode"),
-		0,
-		REG_DWORD,
-		(unsigned char *)&dwVal,
-		4) != ERROR_SUCCESS)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("Can't set \"Cap.DfbBackingMode\" to %d\n"), dwVal);
-		return FALSE;
-	}
-
-	dwVal = 1;
-	if (RegSetValueEx(
-		hKeyDevice,
-		("Order.BltCopyBits.Enabled"),
-		0,
-		REG_DWORD,
-		(unsigned char *)&dwVal,
-		4) != ERROR_SUCCESS)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("Can't set Order.BltCopyBits.Enabled to %d\n"), dwVal);
-		return FALSE;
-	}
-
-// NOTE: we cannot truly load the driver
-// but ChangeDisplaySettings makes PDEV to reload
-// and thus new settings come into effect
-
-// TODO
-
-	strcpy(m_devname, "DISPLAY");
-
-	RegCloseKey(hKeyDevice);
-	return TRUE;
-}
-
-void vncVideoDriver::Deactivate_NT50()
-{
-	HDESK   hdeskInput = 0;
-	HDESK   hdeskCurrent;
- 
-// it is important to us to be able to deactivate
-// even what we have never activated. thats why we look it up, all over
-//	if (!m_devname[0])
-//		return;
-// ... and forget the name
-	*m_devname = 0;
-
-	DISPLAY_DEVICE dd;
-	INT devNum = 0;
-	if (!LookupVideoDeviceAlt(szDriverString, szDriverStringAlt, devNum, &dd))
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("No '%s' or '%s' found.\n"), szDriverString, szDriverStringAlt);
-		return;
-	}
-
-	DEVMODE devmode;
-	FillMemory(&devmode, sizeof(DEVMODE), 0);
-	devmode.dmSize = sizeof(DEVMODE);
-	devmode.dmDriverExtra = 0;
-	(BOOL) EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devmode);
-	devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
-	devmode.dmDeviceName[0] = '\0';
-
-	HKEY hKeyDevice = CreateDeviceKey(szMiniportName);
-	if (hKeyDevice == NULL)
-		return;
-
-    DWORD one = 0;
-	if (RegSetValueEx(hKeyDevice,("Attach.ToDesktop"), 0, REG_DWORD, (unsigned char *)&one,4) != ERROR_SUCCESS)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("Can't set Attach.ToDesktop to 0x1\n"));
-	}
-
-// reverting to default behavior
-	RegDeleteValue(hKeyDevice, ("Cap.DfbBackingMode"));
-	RegDeleteValue(hKeyDevice, ("Order.BltCopyBits.Enabled"));
-
-	pChangeDisplaySettingsEx pCDS = NULL;
-	HINSTANCE  hInstUser32 = LoadNImport("User32.DLL", "ChangeDisplaySettingsExA", pCDS);
-	if (!hInstUser32) return;
-
-	// Save the current desktop
-	hdeskCurrent = GetThreadDesktop(GetCurrentThreadId());
-	if (hdeskCurrent != NULL)
-	{
-		hdeskInput = OpenInputDesktop(0, FALSE, MAXIMUM_ALLOWED);
-		if (hdeskInput != NULL)
-			SetThreadDesktop(hdeskInput);
-	}
-// 24 bpp screen mode is MUNGED to 32 bpp. see vncDesktop::ThunkBitmapInfo()
-	if (devmode.dmBitsPerPel==24) devmode.dmBitsPerPel = 32;
-
-	// Add 'Default.*' settings to the registry under above hKeyProfile\mirror\device
-	(*pCDS)((TCHAR *)dd.DeviceName, &devmode, NULL, CDS_UPDATEREGISTRY, NULL);
-
-	// Reset desktop
-	SetThreadDesktop(hdeskCurrent);
-	// Close the input desktop
-	CloseDesktop(hdeskInput);
-	RegCloseKey(hKeyDevice);
-	FreeLibrary(hInstUser32);
-}
-
-void vncVideoDriver::Deactivate_NT46()
-{
-// ... and forget the name
-	*m_devname = 0;
-
-	HKEY hKeyDevice = CreateDeviceKey(szMiniportName);
-	if (hKeyDevice == NULL)
-		return;
-
-// reverting to default behavior
-	RegDeleteValue(hKeyDevice, ("Cap.DfbBackingMode"));
-
-//	RegDeleteValue(hKeyDevice, ("Order.BltCopyBits.Enabled"));
-// TODO: remove "Order.BltCopyBits.Enabled"
-// now we don't touch this important option
-// because we dont apply the changed values
-
-	RegCloseKey(hKeyDevice);
-}
-
-void vncVideoDriver::HandleDriverChanges(
-		vncDesktop *pDesk,
-		vncRegion &rgn,
-		int xoffset,
-		int yoffset,
-		BOOL &bPointerShapeChange)
-{
-	ULONG snapshot_counter = bufdata.buffer->counter;
-	if (oldCounter == snapshot_counter)
-		return;
-
-	if (oldCounter < snapshot_counter)
-	{
-		HandleDriverChangesSeries(
-			pDesk,
-			rgn,
-			xoffset, yoffset,
-			bufdata.buffer->pointrect + oldCounter,
-			bufdata.buffer->pointrect + snapshot_counter,
-			bPointerShapeChange);
-	}
-	else
-	{
-		HandleDriverChangesSeries(
-			pDesk,
-			rgn,
-			xoffset, yoffset,
-			bufdata.buffer->pointrect + oldCounter,
-			bufdata.buffer->pointrect + MAXCHANGES_BUF,
-			bPointerShapeChange);
-
-		HandleDriverChangesSeries(
-			pDesk,
-			rgn,
-			xoffset, yoffset,
-			bufdata.buffer->pointrect,
-			bufdata.buffer->pointrect + snapshot_counter,
-			bPointerShapeChange);
-	}
-
-	oldCounter = snapshot_counter;
-}
-
-void vncVideoDriver::HandleDriverChangesSeries(
-		vncDesktop *pDesk,
-		vncRegion &rgn,
-		int xoffset,
-		int yoffset,
-		const CHANGES_RECORD *i,
-		const CHANGES_RECORD *last,
-		BOOL &bPointerShapeChange)
-{
-	for (; i < last; i++)
-	{
-// TODO bPointerShapeChange
-
-		if (m_fHandleScreen2ScreenBlt && i->type == dmf_dfo_SCREEN_SCREEN)
-		{
-		//	DPF(("CopyRect: (%d, %d, %d, %d)\n",
-		//		i->rect.left,
-		//		i->rect.top,
-		//		i->rect.right,
-		//		i->rect.bottom));
-
-			RECT Rc;
-			Rc.left = i->rect.left + xoffset;
-			Rc.top = i->rect.top + yoffset;
-			Rc.right = i->rect.right + xoffset;
-			Rc.bottom = i->rect.bottom + yoffset;
-
-			POINT Pt;
-			Pt.x = i->point.x + xoffset;
-			Pt.y = i->point.y + yoffset;
-			pDesk->CopyRect(Rc, Pt);
-			continue;
-		}
-
-		if (i->type >= dmf_dfo_SCREEN_SCREEN && i->type <= dmf_dfo_TEXTOUT)
-		{
-		//	DPF(("XRect: (%d, %d, %d, %d)\n",
-		//		i->rect.left,
-		//		i->rect.top,
-		//		i->rect.right,
-		//		i->rect.bottom));
-			rgn.AddRect(i->rect, xoffset, yoffset);
-		}
-	}
-}
-
-VOID	DebugPrint(PCHAR DebugMessage,
-			...)
-{
-	va_list ap;
-	va_start(ap, DebugMessage);
-	TCHAR	pb[256];
-	vsprintf(pb, DebugMessage, ap);
-	va_end(ap);
-	OutputDebugString(pb);
-}
diff --git a/ica/win32/src/VideoDriver.h b/ica/win32/src/VideoDriver.h
deleted file mode 100644
index 84a85d0..0000000
--- a/ica/win32/src/VideoDriver.h
+++ /dev/null
@@ -1,230 +0,0 @@
-//  Copyright (C) 2005-2006 Lev Kazarkin. All Rights Reserved.
-//
-//  TightVNC is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-
-#ifndef _WINVNC_VIDEODRIVER
-#define _WINVNC_VIDEODRIVER
-
-#include "stdhdrs.h"
-#include "vncRegion.h"
-
-#define ESC_QVI		1026
-
-#define MAP1		1030
-#define UNMAP1		1031
-#define TESTMAPPED	1051
-
-#define MAXCHANGES_BUF 20000
-
-typedef enum
-{
-	dmf_dfo_IGNORE		= 0,
-	dmf_dfo_FROM_SCREEN = 1,
-	dmf_dfo_FROM_DIB	= 2,
-	dmf_dfo_TO_SCREEN	= 3,
-
-	dmf_dfo_SCREEN_SCREEN	= 11,
-	dmf_dfo_BLIT		= 12,
-	dmf_dfo_SOLIDFILL	= 13,
-	dmf_dfo_BLEND		= 14,
-	dmf_dfo_TRANS		= 15,
-	dmf_dfo_PLG			= 17,
-	dmf_dfo_TEXTOUT		= 18,
-
-	dmf_dfo_Ptr_Engage	= 48,	// point is used with this record
-	dmf_dfo_Ptr_Avert	= 49,
-
-	// 1.0.9.0
-	// mode-assert notifications to manifest PDEV limbo status
-	dmf_dfn_assert_on	= 64,	// DrvAssert(TRUE): PDEV reenabled
-	dmf_dfn_assert_off	= 65,	// DrvAssert(FALSE): PDEV disabled
-
-} dmf_UpdEvent;
-
-
-#ifndef CDS_UPDATEREGISTRY
-#define CDS_UPDATEREGISTRY  0x00000001
-#endif
-#ifndef CDS_TEST
-#define CDS_TEST            0x00000002
-#endif
-#ifndef CDS_FULLSCREEN
-#define CDS_FULLSCREEN      0x00000004
-#endif
-#ifndef CDS_GLOBAL
-#define CDS_GLOBAL          0x00000008
-#endif
-#ifndef CDS_SET_PRIMARY
-#define CDS_SET_PRIMARY     0x00000010
-#endif
-#ifndef CDS_RESET
-#define CDS_RESET           0x40000000
-#endif
-#ifndef CDS_SETRECT
-#define CDS_SETRECT         0x20000000
-#endif
-#ifndef CDS_NORESET
-#define CDS_NORESET         0x10000000
-#endif
-
-
-typedef BOOL (WINAPI* pEnumDisplayDevices)(PVOID,DWORD,PVOID,DWORD);
-typedef LONG (WINAPI* pChangeDisplaySettingsEx)(LPCTSTR, LPDEVMODE, HWND, DWORD, LPVOID);
-
-//*********************************************************************
-
-typedef struct _CHANGES_RECORD
-{
-	ULONG type;  //screen_to_screen, blit, newcache,oldcache
-	RECT rect;
-	RECT origrect;
-	POINT point;
-	ULONG color; //number used in cache array
-	ULONG refcolor; //slot used to pase btimap data
-}CHANGES_RECORD;
-typedef CHANGES_RECORD *PCHANGES_RECORD;
-typedef struct _CHANGES_BUF
-	{
-	 ULONG counter;
-	 CHANGES_RECORD pointrect[MAXCHANGES_BUF];
-	}CHANGES_BUF;
-typedef CHANGES_BUF *PCHANGES_BUF;
-
-typedef struct _GETCHANGESBUF
-	{
-	 PCHANGES_BUF buffer;
-	 PVOID Userbuffer;
-	}GETCHANGESBUF;
-typedef GETCHANGESBUF *PGETCHANGESBUF;
-
-#define	DMF_VERSION_DEFINE(_ver_0,_ver_1,_ver_2,_ver_3)	((_ver_0<<24) | (_ver_1<<16) | (_ver_2<<8) | _ver_3)
-
-#define	DMF_PROTO_VER_CURRENT	DMF_VERSION_DEFINE(1,2,0,0)
-#define	DMF_PROTO_VER_MINCOMPAT	DMF_VERSION_DEFINE(0,9,0,1)
-
-struct	Esc_dmf_Qvi_IN
-{
-	ULONG	cbSize;
-
-	ULONG	app_actual_version;
-	ULONG	display_minreq_version;
-
-	ULONG	connect_options;		// reserved. must be 0.
-};
-
-enum
-{
-	esc_qvi_prod_name_max	= 16,
-};
-
-#define	ESC_QVI_PROD_MIRAGE	"MIRAGE"
-
-struct	Esc_dmf_Qvi_OUT
-{
-	ULONG	cbSize;
-
-	ULONG	display_actual_version;
-	ULONG	miniport_actual_version;
-	ULONG	app_minreq_version;
-	ULONG	display_buildno;
-	ULONG	miniport_buildno;
-
-	char	prod_name[esc_qvi_prod_name_max];
-};
-
-class vncDesktop;
-
-class vncVideoDriver
-{
-
-// Fields
-public:
-
-// Methods
-public:
-	// Make the desktop thread & window proc friends
-
-	vncVideoDriver();
-	~vncVideoDriver();
-	BOOL Activate(BOOL fForDirectAccess, const RECT *prcltarget);
-	void Deactivate();
-	BOOL Activate_NT50(BOOL fForDirectAccess, const RECT *prcltarget);
-	void Deactivate_NT50();
-	BOOL Activate_NT46(BOOL fForDirectAccess);
-	void Deactivate_NT46();
-	BOOL CheckVersion();
-	BOOL MapSharedbuffers(BOOL fForDirectScreenAccess);
-	void UnMapSharedbuffers();
-	BOOL TestMapped();
-	void HandleDriverChanges(
-		vncDesktop *pDesk,
-		vncRegion &rgn,
-		int xoffset,
-		int yoffset,
-		BOOL &bPointerShapeChange);
-	void HandleDriverChangesSeries(
-		vncDesktop *pDesk,
-		vncRegion &rgn,
-		int xoffset,
-		int yoffset,
-		const CHANGES_RECORD *first,
-		const CHANGES_RECORD *last,
-		BOOL &bPointerShapeChange);
-	void ResetCounter() { oldCounter = bufdata.buffer->counter; }
-
-	BYTE *GetScreenView(void) {	return (BYTE*)bufdata.Userbuffer; }
-
-	BOOL IsActive(void) {	return m_fIsActive; }
-	BOOL IsDirectAccessInEffect(void) {	return m_fDirectAccessInEffect; }
-	BOOL IsHandlingScreen2ScreenBlt(void) { return m_fHandleScreen2ScreenBlt; }
-	
-protected:
-
-	static BOOL	LookupVideoDeviceAlt(
-		LPCTSTR szDevStr,
-		LPCTSTR szDevStrAlt,
-		INT &devNum,
-		DISPLAY_DEVICE *pDd);
-	static HKEY	CreateDeviceKey(LPCTSTR szMpName);
-
-	char	m_devname[32];
-	ULONG	m_drv_ver_mj;
-	ULONG	m_drv_ver_mn;
-
-	GETCHANGESBUF bufdata;
-	ULONG oldCounter;
-	HDC m_gdc;
-
-	bool	m_fIsActive;
-	bool	m_fDirectAccessInEffect;
-	bool	m_fHandleScreen2ScreenBlt;
-
-	static char szDriverString[];
-	static char szDriverStringAlt[];
-	static char szMiniportName[];
-};
-
-VOID	DebugPrint(PCHAR DebugMessage, ...);
-
-#ifdef _DEBUG
-#define	DPF(x) DebugPrint x
-#else
-#define	DPF(x)
-#endif
-
-#endif
diff --git a/ica/win32/src/WinVNC.cpp b/ica/win32/src/WinVNC.cpp
deleted file mode 100644
index 81c84af..0000000
--- a/ica/win32/src/WinVNC.cpp
+++ /dev/null
@@ -1,414 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// WinVNC.cpp
-
-// 24/11/97		WEZ
-
-// WinMain and main WndProc for the new version of WinVNC
-
-////////////////////////////
-// System headers
-#include "stdhdrs.h"
-
-////////////////////////////
-// Custom headers
-#include "VSocket.h"
-#include "WinVNC.h"
-
-#include "vncServer.h"
-#include "vncMenu.h"
-#include "vncInstHandler.h"
-#include "vncService.h"
-
-extern "C" {
-#include "ParseHost.h"
-}
-
-// Application instance and name
-HINSTANCE	hAppInstance;
-const char	*szAppName = "WinVNC";
-
-DWORD		mainthreadId;
-
-#if 0
-// WinMain parses the command line and either calls the main App
-// routine or, under NT, the main service routine.
-int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
-{
-#ifdef _DEBUG
-	{
-		// Get current flag
-		int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
-
-		// Turn on leak-checking bit
-		tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
-
-		// Set flag to the new value
-		_CrtSetDbgFlag( tmpFlag );
-	}
-#endif
-
-	// Save the application instance and main thread id
-	hAppInstance = hInstance;
-	mainthreadId = GetCurrentThreadId();
-
-	// Initialise the VSocket system
-	VSocketSystem socksys;
-	if (!socksys.Initialised())
-	{
-		MessageBox(NULL, "Failed to initialise the socket system", szAppName, MB_OK);
-		return 0;
-	}
-	vnclog.Print(LL_STATE, VNCLOG("sockets initialised\n"));
-
-	// Make the command-line lowercase and parse it
-	size_t i;
-	for (i = 0; i < strlen(szCmdLine); i++)
-	{
-		szCmdLine[i] = tolower(szCmdLine[i]);
-	}
-
-	BOOL argfound = FALSE;
-	char *connectName = NULL;
-	int connectPort;
-	bool cancelConnect = false;
-
-	for (i = 0; i < strlen(szCmdLine); i++)
-	{
-		if (szCmdLine[i] <= ' ')
-			continue;
-		argfound = TRUE;
-
-		// Determine the length of current argument in the command line
-		size_t arglen = strcspn(&szCmdLine[i], " \t\r\n\v\f");
-
-		// Now check for command-line arguments
-		if (strncmp(&szCmdLine[i], winvncRunServiceHelper, arglen) == 0 &&
-			arglen == strlen(winvncRunServiceHelper))
-		{
-			// NB : This flag MUST be parsed BEFORE "-service", otherwise it will match
-			// the wrong option!  (This code should really be replaced with a simple
-			// parser machine and parse-table...)
-
-			// Run the WinVNC Service Helper app
-			vncService::PostUserHelperMessage();
-			return 0;
-		}
-		if (strncmp(&szCmdLine[i], winvncRunService, arglen) == 0 &&
-			arglen == strlen(winvncRunService))
-		{
-			// Run WinVNC as a service
-			return vncService::WinVNCServiceMain();
-		}
-		if (strncmp(&szCmdLine[i], winvncRunAsUserApp, arglen) == 0 &&
-			arglen == strlen(winvncRunAsUserApp))
-		{
-			// WinVNC is being run as a user-level program
-			return WinVNCAppMain();
-		}
-		if (strncmp(&szCmdLine[i], winvncInstallService, arglen) == 0 &&
-			arglen == strlen(winvncInstallService))
-		{
-			// Install WinVNC as a service
-			vncService::InstallService();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncReinstallService, arglen) == 0 &&
-			arglen == strlen(winvncReinstallService))
-		{
-			// Silently remove WinVNC, then re-install it
-			vncService::ReinstallService();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncRemoveService, arglen) == 0 &&
-			arglen == strlen(winvncRemoveService))
-		{
-			// Remove the WinVNC service
-			vncService::RemoveService();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncReload, arglen) == 0 &&
-			arglen == strlen(winvncReload))
-		{
-			// Reload Properties from the registry
-			vncService::PostReloadMessage();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncShowProperties, arglen) == 0 &&
-			arglen == strlen(winvncShowProperties))
-		{
-			// Show the Properties dialog of an existing instance of WinVNC
-			vncService::ShowProperties();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncShowDefaultProperties, arglen) == 0 &&
-			arglen == strlen(winvncShowDefaultProperties))
-		{
-			// Show the Properties dialog of an existing instance of WinVNC
-			vncService::ShowDefaultProperties();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncShowAbout, arglen) == 0 &&
-			arglen == strlen(winvncShowAbout))
-		{
-			// Show the About dialog of an existing instance of WinVNC
-			vncService::ShowAboutBox();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncKillAllClients, arglen) == 0 &&
-			arglen == strlen(winvncKillAllClients))
-		{
-			// NB : This flag MUST be parsed BEFORE "-kill", otherwise it will match
-			// the wrong option!
-
-			// Kill all connected clients
-			vncService::KillAllClients();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncKillRunningCopy, arglen) == 0 &&
-			arglen == strlen(winvncKillRunningCopy))
-		{
-			// Kill any already running copy of WinVNC
-			vncService::KillRunningCopy();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncShareAll, arglen) == 0 &&
-			arglen == strlen(winvncShareAll))
-		{
-			// Show full desktop to VNC clients
-			vncService::PostShareAll();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncSharePrimary, arglen) == 0 &&
-			arglen == strlen(winvncSharePrimary))
-		{
-			// Show only the primary display to VNC clients
-			vncService::PostSharePrimary();
-			i += arglen;
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncShareArea, arglen) == 0 &&
-			arglen == strlen(winvncShareArea))
-		{
-			// Show a specified rectangular area to VNC clients
-			i += arglen;
-
-			// First, we have to parse the command line to get an argument
-			int start, end;
-			start = i;
-			while (szCmdLine[start] && szCmdLine[start] <= ' ') start++;
-			end = start;
-			while (szCmdLine[end] > ' ') end++;
-			i = end;
-			if (end == start)
-				continue;
-
-			// Parse the argument -- it should look like 640x480+320+240
-			unsigned short x, y, w, h;
-			int n = sscanf(&szCmdLine[start], "%hux%hu+%hu+%hu", &w, &h, &x, &y);
-			if (n == 4 && w > 0 && h > 0)
-				vncService::PostShareArea(x, y, w, h);
-
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncShareWindow, arglen) == 0 &&
-			arglen == strlen(winvncShareWindow))
-		{
-			// Find a window to share, by its title
-			i += arglen;
-
-			cancelConnect = true;	// Ignore the -connect option unless
-									// there will be valid window to share
-
-			int start = i, end;
-			while (szCmdLine[start] && szCmdLine[start] <= ' ') start++;
-			if (szCmdLine[start] == '"') {
-				start++;
-				char *ptr = strchr(&szCmdLine[start], '"');
-				if (ptr == NULL) {
-					end = strlen(szCmdLine);
-					i = end;
-				} else {
-					end = ptr - szCmdLine;
-					i = end + 1;
-				}
-			} else {
-				end = start;
-				while (szCmdLine[end] > ' ') end++;
-				i = end;
-			}
-			if (end - start > 0) {
-				char *title = new char[end - start + 1];
-				if (title != NULL) {
-					strncpy(title, &szCmdLine[start], end - start);
-					title[end - start] = 0;
-					HWND hwndFound = vncService::FindWindowByTitle(title);
-					if (hwndFound != NULL)
-						cancelConnect = false;
-					vncService::PostShareWindow(hwndFound);
-					delete [] title;
-				}
-			}
-			continue;
-		}
-		if (strncmp(&szCmdLine[i], winvncAddNewClient, arglen) == 0 &&
-			arglen == strlen(winvncAddNewClient) && connectName == NULL)
-		{
-			// Add a new client to an existing copy of winvnc
-			i += arglen;
-
-			// First, we have to parse the command line to get the hostname to use
-			int start, end;
-			start=i;
-			while (szCmdLine[start] && szCmdLine[start] <= ' ') start++;
-			end = start;
-			while (szCmdLine[end] > ' ') end++;
-
-			connectName = new char[end-start+1];
-
-			// Was there a hostname (and optionally a port number) given?
-			if (end-start > 0) {
-				if (connectName != NULL) {
-					strncpy(connectName, &(szCmdLine[start]), end-start);
-					connectName[end-start] = 0;
-					connectPort = ParseHostPort(connectName, INCOMING_PORT_OFFSET);
-				}
-			} else {
-				if (connectName != NULL)
-					connectName[0] = '\0';
-			}
-			i = end;
-			continue;
-		}
-
-		// Either the user gave the -help option or there is something odd on the cmd-line!
-
-		// Show the usage dialog
-		MessageBox(NULL, winvncUsageText, "WinVNC Usage", MB_OK | MB_ICONINFORMATION);
-		break;
-	}
-
-	// If no arguments were given then just run
-	if (!argfound)
-		return WinVNCAppMain();
-
-	// Process the -connect option at the end
-	if (connectName != NULL && !cancelConnect) {
-		if (connectName[0] != '\0') {
-			VCard32 address = VSocket::Resolve(connectName);
-			if (address != 0) {
-				// Post the IP address to the server
-				vncService::PostAddNewClient(address, connectPort);
-			}
-		} else {
-			// Tell the server to show the Add New Client dialog
-			vncService::PostAddNewClient(0, 0);
-		}
-	}
-	if (connectName != NULL)
-		delete[] connectName;
-
-	return 0;
-}
-#endif
-
-// This is the main routine for WinVNC when running as an application
-// (under Windows 95 or Windows NT)
-// Under NT, WinVNC can also run as a service.  The WinVNCServerMain routine,
-// defined in the vncService header, is used instead when running as a service.
-vncServer * __server = NULL;
-
-
-int WinVNCAppMain()
-{
-	// Set this process to be the last application to be shut down.
-	SetProcessShutdownParameters(0x100, 0);
-	
-	// Check for previous instances of WinVNC!
-	vncInstHandler instancehan;
-	if (!instancehan.Init())
-	{
-		// We don't allow multiple instances!
-		MessageBox(NULL, "Another instance of me is already running", szAppName, MB_OK);
-		return 0;
-	}
-
-	VSocketSystem socksys;
-	if (!socksys.Initialised())
-	{
-		MessageBox(NULL, "Failed to initialise the socket system", szAppName, MB_OK);
-		return 0;
-	}
-
-	// CREATE SERVER
-	vncServer server;
-	server.SetAutoPortSelect( FALSE );
-	server.SetPorts( __ivs_port, server.GetHttpPort() );
-	__server = &server;
-
-	// Set the name and port number
-	server.SetName(szAppName);
-	server.SockConnect( TRUE );
-	vnclog.Print(LL_STATE, VNCLOG("server created ok\n"));
-
-#if 0
-	// Create tray icon & menu if we're running as an app
-	vncMenu *menu = new vncMenu(&server);
-	if (menu == NULL)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("failed to create tray menu\n"));
-		PostQuitMessage(0);
-	}
-#endif
-
-	// Now enter the message handling loop until told to quit!
-	MSG msg;
-	while (GetMessage(&msg, NULL, 0,0) ) {
-		vnclog.Print(LL_INTINFO, VNCLOG("message %d received\n"), msg.message);
-		TranslateMessage(&msg);	// convert key ups and downs to chars
-		DispatchMessage(&msg);
-	}
-
-	vnclog.Print(LL_STATE, VNCLOG("shutting down server\n"));
-
-#if 0
-	if (menu != NULL)
-		delete menu;
-#endif
-
-	return msg.wParam;
-}
diff --git a/ica/win32/src/WinVNC.h b/ica/win32/src/WinVNC.h
deleted file mode 100644
index 826c61c..0000000
--- a/ica/win32/src/WinVNC.h
+++ /dev/null
@@ -1,97 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// WinVNC header file
-
-#ifdef HORIZONLIVE
-#include "horizon/horizonMain.h"
-#else
-
-#ifndef __WINVNC_H
-#define __WINVNC_H
-
-#include "stdhdrs.h"
-#include "resource.h"
-#include "VNCHelp.h"
-
-// Application specific messages
-
-// Message used for system tray notifications
-#define WM_TRAYNOTIFY				WM_USER+1
-
-// Messages used for the server object to notify windows of things
-#define WM_SRV_CLIENT_CONNECT		WM_USER+2
-#define WM_SRV_CLIENT_AUTHENTICATED	WM_USER+3
-#define WM_SRV_CLIENT_DISCONNECT	WM_USER+4
-#define WM_SRV_CLIENT_HIDEWALLPAPER	WM_USER+5
-
-#define WINVNC_REGISTRY_KEY "Software\\ORL\\WinVNC3"
-
-// Export the application details
-extern HINSTANCE	hAppInstance;
-extern const char	*szAppName;
-extern DWORD		mainthreadId;
-extern VNCHelp		help;
-// Main VNC server routine
-extern int WinVNCAppMain();
-
-// Standard command-line flag definitions
-const char winvncRunService[]		= "-service";
-const char winvncRunServiceHelper[]	= "-servicehelper";
-const char winvncRunAsUserApp[]		= "-run";
-
-const char winvncInstallService[]	= "-install";
-const char winvncRemoveService[]	= "-remove";
-const char winvncReinstallService[]	= "-reinstall";
-
-const char winvncReload[]			= "-reload";
-const char winvncShowProperties[]	= "-settings";
-const char winvncShowDefaultProperties[]	= "-defaultsettings";
-const char winvncShowAbout[]		= "-about";
-const char winvncKillRunningCopy[]	= "-kill";
-
-const char winvncShareAll[]			= "-shareall";
-const char winvncSharePrimary[]		= "-shareprimary";
-const char winvncShareArea[]		= "-sharearea";
-const char winvncShareWindow[]		= "-sharewindow";
-
-const char winvncAddNewClient[]		= "-connect";
-const char winvncKillAllClients[]	= "-killallclients";
-
-const char winvncShowHelp[]			= "-help";
-
-// Usage string
-const char winvncUsageText[] =
-	"winvnc [-run] [-kill] [-service] [-servicehelper]\n"
-	" [-connect [host[:display]]] [-connect [host[::port]]]\n"
-	" [-install] [-remove] [-reinstall] [-reload]\n"
-	" [-settings] [-defaultsettings] [-killallclients]\n"
-	" [-shareall] [-shareprimary] [-sharearea WxH+X+Y]\n"
-	" [-sharewindow  \"title\"] [-about] [-help]\n";
-
-#endif // __WINVNC_H
-
-#endif // HORIZONLIVE
diff --git a/ica/win32/src/d3des.h b/ica/win32/src/d3des.h
deleted file mode 100644
index d71fb90..0000000
--- a/ica/win32/src/d3des.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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 deskey(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 usekey(unsigned long *);
-/*                  cookedkey[32]
- * Loads the internal key register with the data in cookedkey.
- */
-
-extern void cpkey(unsigned long *);
-/*                 cookedkey[32]
- * Copies the contents of the internal key register into the storage
- * located at &cookedkey[0].
- */
-
-extern void des(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
- ********************************************************************/
diff --git a/ica/win32/src/d3des_w32.c b/ica/win32/src/d3des_w32.c
deleted file mode 100644
index b7bfdf2..0000000
--- a/ica/win32/src/d3des_w32.c
+++ /dev/null
@@ -1,440 +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 deskey(key, edf)	/* Thanks to James Gillogly & Phil Karn! */
-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(raw1)
-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);
-		}
-	usekey(dough);
-	return;
-	}
-
-void cpkey(into)
-register unsigned long *into;
-{
-	register unsigned long *from, *endp;
-
-	from = KnL, endp = &KnL[32];
-	while( from < endp ) *into++ = *from++;
-	return;
-	}
-
-void usekey(from)
-register unsigned long *from;
-{
-	register unsigned long *to, *endp;
-
-	to = KnL, endp = &KnL[32];
-	while( to < endp ) *to++ = *from++;
-	return;
-	}
-
-void des(inblock, outblock)
-unsigned char *inblock, *outblock;
-{
-	unsigned long work[2];
-
-	scrunch(inblock, work);
-	desfunc(work, KnL);
-	unscrun(work, outblock);
-	return;
-	}
-
-static void scrunch(outof, into)
-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(outof, into)
-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(block, keys)
-register unsigned long *block, *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/win32/src/omnithread/nt.cpp b/ica/win32/src/omnithread/nt.cpp
deleted file mode 100644
index 23c6a32..0000000
--- a/ica/win32/src/omnithread/nt.cpp
+++ /dev/null
@@ -1,833 +0,0 @@
-//				Package : omnithread
-// omnithread/nt.cc		Created : 6/95 tjr
-//
-//    Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//    This file is part of the omnithread library
-//
-//    The omnithread 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
-//    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
-//    02111-1307, USA
-//
-
-//
-// Implementation of OMNI thread abstraction for NT threads
-//
-
-#include <stdlib.h>
-#include <errno.h>
-#include "omnithread.h"
-#include <process.h>
-
-#define DB(x) // x 
-//#include <iostream.h> or #include <iostream> if DB is on.
-
-static void get_time_now(unsigned long* abs_sec, unsigned long* abs_nsec);
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Mutex
-//
-///////////////////////////////////////////////////////////////////////////
-
-
-omni_mutex::omni_mutex(void)
-{
-    InitializeCriticalSection(&crit);
-}
-
-omni_mutex::~omni_mutex(void)
-{
-    DeleteCriticalSection(&crit);
-}
-
-void
-omni_mutex::lock(void)
-{
-    EnterCriticalSection(&crit);
-}
-
-void
-omni_mutex::unlock(void)
-{
-    LeaveCriticalSection(&crit);
-}
-
-
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Condition variable
-//
-///////////////////////////////////////////////////////////////////////////
-
-
-//
-// Condition variables are tricky to implement using NT synchronisation
-// primitives, since none of them have the atomic "release mutex and wait to be
-// signalled" which is central to the idea of a condition variable.  To get
-// around this the solution is to record which threads are waiting and
-// explicitly wake up those threads.
-//
-// Here we implement a condition variable using a list of waiting threads
-// (protected by a critical section), and a per-thread semaphore (which
-// actually only needs to be a binary semaphore).
-//
-// To wait on the cv, a thread puts itself on the list of waiting threads for
-// that cv, then releases the mutex and waits on its own personal semaphore.  A
-// signalling thread simply takes a thread from the head of the list and kicks
-// that thread's semaphore.  Broadcast is simply implemented by kicking the
-// semaphore of each waiting thread.
-//
-// The only other tricky part comes when a thread gets a timeout from a timed
-// wait on its semaphore.  Between returning with a timeout from the wait and
-// entering the critical section, a signalling thread could get in, kick the
-// waiting thread's semaphore and remove it from the list.  If this happens,
-// the waiting thread's semaphore is now out of step so it needs resetting, and
-// the thread should indicate that it was signalled rather than that it timed
-// out.
-//
-// It is possible that the thread calling wait or timedwait is not a
-// omni_thread. In this case we have to provide a temporary data structure,
-// i.e. for the duration of the call, for the thread to link itself on the
-// list of waiting threads. _internal_omni_thread_dummy provides such
-// a data structure and _internal_omni_thread_helper is a helper class to
-// deal with this special case for wait() and timedwait(). Once created,
-// the _internal_omni_thread_dummy is cached for use by the next wait() or
-// timedwait() call from a non-omni_thread. This is probably worth doing
-// because creating a Semaphore is quite heavy weight.
-
-class _internal_omni_thread_helper;
-
-class _internal_omni_thread_dummy : public omni_thread {
-public:
-  inline _internal_omni_thread_dummy() : next(0) { }
-  inline ~_internal_omni_thread_dummy() { }
-  friend class _internal_omni_thread_helper;
-private:
-  _internal_omni_thread_dummy* next;
-};
-
-class _internal_omni_thread_helper {
-public:
-  inline _internal_omni_thread_helper()  { 
-    d = 0;
-    t = omni_thread::self();
-    if (!t) {
-      omni_mutex_lock sync(cachelock);
-      if (cache) {
-	d = cache;
-	cache = cache->next;
-      }
-      else {
-	d = new _internal_omni_thread_dummy;
-      }
-      t = d;
-    }
-  }
-  inline ~_internal_omni_thread_helper() { 
-    if (d) {
-      omni_mutex_lock sync(cachelock);
-      d->next = cache;
-      cache = d;
-    }
-  }
-  inline operator omni_thread* () { return t; }
-  inline omni_thread* operator->() { return t; }
-
-  static _internal_omni_thread_dummy* cache;
-  static omni_mutex                   cachelock;
-
-private:
-  _internal_omni_thread_dummy* d;
-  omni_thread*                 t;
-};
-
-_internal_omni_thread_dummy* _internal_omni_thread_helper::cache = 0;
-omni_mutex                   _internal_omni_thread_helper::cachelock;
-
-
-omni_condition::omni_condition(omni_mutex* m) : mutex(m)
-{
-    InitializeCriticalSection(&crit);
-    waiting_head = waiting_tail = NULL;
-}
-
-
-omni_condition::~omni_condition(void)
-{
-    DeleteCriticalSection(&crit);
-    DB( if (waiting_head != NULL) {
-	cerr << "omni_condition::~omni_condition: list of waiting threads "
-	     << "is not empty\n";
-    } )
-}
-
-
-void
-omni_condition::wait(void)
-{
-    _internal_omni_thread_helper me;
-
-    EnterCriticalSection(&crit);
-
-    me->cond_next = NULL;
-    me->cond_prev = waiting_tail;
-    if (waiting_head == NULL)
-	waiting_head = me;
-    else
-	waiting_tail->cond_next = me;
-    waiting_tail = me;
-    me->cond_waiting = TRUE;
-
-    LeaveCriticalSection(&crit);
-
-    mutex->unlock();
-
-    DWORD result = WaitForSingleObject(me->cond_semaphore, INFINITE);
-
-    mutex->lock();
-
-    if (result != WAIT_OBJECT_0)
-	throw omni_thread_fatal(GetLastError());
-}
-
-
-int
-omni_condition::timedwait(unsigned long abs_sec, unsigned long abs_nsec)
-{
-    _internal_omni_thread_helper me;
-
-    EnterCriticalSection(&crit);
-
-    me->cond_next = NULL;
-    me->cond_prev = waiting_tail;
-    if (waiting_head == NULL)
-	waiting_head = me;
-    else
-	waiting_tail->cond_next = me;
-    waiting_tail = me;
-    me->cond_waiting = TRUE;
-
-    LeaveCriticalSection(&crit);
-
-    mutex->unlock();
-
-    unsigned long now_sec, now_nsec;
-
-    get_time_now(&now_sec, &now_nsec);
-
-    DWORD timeout = (abs_sec-now_sec) * 1000 + (abs_nsec-now_nsec) / 1000000;
-
-    if ((abs_sec <= now_sec) && ((abs_sec < now_sec) || (abs_nsec < abs_nsec)))
-	timeout = 0;
-
-    DWORD result = WaitForSingleObject(me->cond_semaphore, timeout);
-
-    if (result == WAIT_TIMEOUT) {
-	EnterCriticalSection(&crit);
-
-	if (me->cond_waiting) {
-	    if (me->cond_prev != NULL)
-		me->cond_prev->cond_next = me->cond_next;
-	    else
-		waiting_head = me->cond_next;
-	    if (me->cond_next != NULL)
-		me->cond_next->cond_prev = me->cond_prev;
-	    else
-		waiting_tail = me->cond_prev;
-	    me->cond_waiting = FALSE;
-
-	    LeaveCriticalSection(&crit);
-
-	    mutex->lock();
-	    return 0;
-	}
-
-	//
-	// We timed out but another thread still signalled us.  Wait for
-	// the semaphore (it _must_ have been signalled) to decrement it
-	// again.  Return that we were signalled, not that we timed out.
-	//
-
-	LeaveCriticalSection(&crit);
-
-	result = WaitForSingleObject(me->cond_semaphore, INFINITE);
-    }
-
-    if (result != WAIT_OBJECT_0)
-	throw omni_thread_fatal(GetLastError());
-
-    mutex->lock();
-    return 1;
-}
-
-
-void
-omni_condition::signal(void)
-{
-    EnterCriticalSection(&crit);
-
-    if (waiting_head != NULL) {
-	omni_thread* t = waiting_head;
-	waiting_head = t->cond_next;
-	if (waiting_head == NULL)
-	    waiting_tail = NULL;
-	else
-	    waiting_head->cond_prev = NULL;
-	t->cond_waiting = FALSE;
-
-	if (!ReleaseSemaphore(t->cond_semaphore, 1, NULL)) {
-	    int rc = GetLastError();
-	    LeaveCriticalSection(&crit);
-	    throw omni_thread_fatal(rc);
-	}
-    }
-
-    LeaveCriticalSection(&crit);
-}
-
-
-void
-omni_condition::broadcast(void)
-{
-    EnterCriticalSection(&crit);
-
-    while (waiting_head != NULL) {
-	omni_thread* t = waiting_head;
-	waiting_head = t->cond_next;
-	if (waiting_head == NULL)
-	    waiting_tail = NULL;
-	else
-	    waiting_head->cond_prev = NULL;
-	t->cond_waiting = FALSE;
-
-	if (!ReleaseSemaphore(t->cond_semaphore, 1, NULL)) {
-	    int rc = GetLastError();
-	    LeaveCriticalSection(&crit);
-	    throw omni_thread_fatal(rc);
-	}
-    }
-
-    LeaveCriticalSection(&crit);
-}
-
-
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Counting semaphore
-//
-///////////////////////////////////////////////////////////////////////////
-
-
-#define SEMAPHORE_MAX 0x7fffffff
-
-
-omni_semaphore::omni_semaphore(unsigned int initial)
-{
-    nt_sem = CreateSemaphore(NULL, initial, SEMAPHORE_MAX, NULL);
-
-    if (nt_sem == NULL) {
-      DB( cerr << "omni_semaphore::omni_semaphore: CreateSemaphore error "
-	     << GetLastError() << endl );
-      throw omni_thread_fatal(GetLastError());
-    }
-}
-
-
-omni_semaphore::~omni_semaphore(void)
-{
-  if (!CloseHandle(nt_sem)) {
-    DB( cerr << "omni_semaphore::~omni_semaphore: CloseHandle error "
-	     << GetLastError() << endl );
-    throw omni_thread_fatal(GetLastError());
-  }
-}
-
-
-void
-omni_semaphore::wait(void)
-{
-    if (WaitForSingleObject(nt_sem, INFINITE) != WAIT_OBJECT_0)
-	throw omni_thread_fatal(GetLastError());
-}
-
-
-int
-omni_semaphore::trywait(void)
-{
-    switch (WaitForSingleObject(nt_sem, 0)) {
-
-    case WAIT_OBJECT_0:
-	return 1;
-    case WAIT_TIMEOUT:
-	return 0;
-    }
-
-    throw omni_thread_fatal(GetLastError());
-    return 0; /* keep msvc++ happy */
-}
-
-
-void
-omni_semaphore::post(void)
-{
-    if (!ReleaseSemaphore(nt_sem, 1, NULL))
-	throw omni_thread_fatal(GetLastError());
-}
-
-
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Thread
-//
-///////////////////////////////////////////////////////////////////////////
-
-
-//
-// Static variables
-//
-
-int omni_thread::init_t::count = 0;
-
-omni_mutex* omni_thread::next_id_mutex;
-int omni_thread::next_id = 0;
-static DWORD self_tls_index;
-
-//
-// Initialisation function (gets called before any user code).
-//
-
-omni_thread::init_t::init_t(void)
-{
-    if (count++ != 0)	// only do it once however many objects get created.
-	return;
-
-    DB(cerr << "omni_thread::init: NT implementation initialising\n");
-
-    self_tls_index = TlsAlloc();
-
-    if (self_tls_index == 0xffffffff)
-	throw omni_thread_fatal(GetLastError());
-
-    next_id_mutex = new omni_mutex;
-
-    //
-    // Create object for this (i.e. initial) thread.
-    //
-
-    omni_thread* t = new omni_thread;
-
-    t->_state = STATE_RUNNING;
-
-    if (!DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
-			 GetCurrentProcess(), &t->handle,
-			 0, FALSE, DUPLICATE_SAME_ACCESS))
-	throw omni_thread_fatal(GetLastError());
-
-    t->nt_id = GetCurrentThreadId();
-
-    DB(cerr << "initial thread " << t->id() << " NT thread id " << t->nt_id
-       << endl);
-
-    if (!TlsSetValue(self_tls_index, (LPVOID)t))
-	throw omni_thread_fatal(GetLastError());
-
-    if (!SetThreadPriority(t->handle, nt_priority(PRIORITY_NORMAL)))
-	throw omni_thread_fatal(GetLastError());
-}
-
-//
-// Wrapper for thread creation.
-//
-
-extern "C" 
-unsigned __stdcall
-omni_thread_wrapper(void* ptr)
-{
-    omni_thread* me = (omni_thread*)ptr;
-
-    DB(cerr << "omni_thread_wrapper: thread " << me->id()
-       << " started\n");
-
-    if (!TlsSetValue(self_tls_index, (LPVOID)me))
-	throw omni_thread_fatal(GetLastError());
-
-    //
-    // Now invoke the thread function with the given argument.
-    //
-
-    if (me->fn_void != NULL) {
-	(*me->fn_void)(me->thread_arg);
-	omni_thread::exit();
-    }
-
-    if (me->fn_ret != NULL) {
-	void* return_value = (*me->fn_ret)(me->thread_arg);
-	omni_thread::exit(return_value);
-    }
-
-    if (me->detached) {
-	me->run(me->thread_arg);
-	omni_thread::exit();
-    } else {
-	void* return_value = me->run_undetached(me->thread_arg);
-	omni_thread::exit(return_value);
-    }
-
-    // should never get here.
-    return 0;
-}
-
-
-//
-// Constructors for omni_thread - set up the thread object but don't
-// start it running.
-//
-
-// construct a detached thread running a given function.
-
-omni_thread::omni_thread(void (*fn)(void*), void* arg, priority_t pri)
-{
-    common_constructor(arg, pri, 1);
-    fn_void = fn;
-    fn_ret = NULL;
-}
-
-// construct an undetached thread running a given function.
-
-omni_thread::omni_thread(void* (*fn)(void*), void* arg, priority_t pri)
-{
-    common_constructor(arg, pri, 0);
-    fn_void = NULL;
-    fn_ret = fn;
-}
-
-// construct a thread which will run either run() or run_undetached().
-
-omni_thread::omni_thread(void* arg, priority_t pri)
-{
-    common_constructor(arg, pri, 1);
-    fn_void = NULL;
-    fn_ret = NULL;
-}
-
-// common part of all constructors.
-
-void
-omni_thread::common_constructor(void* arg, priority_t pri, int det)
-{
-    _state = STATE_NEW;
-    _priority = pri;
-
-    next_id_mutex->lock();
-    _id = next_id++;
-    next_id_mutex->unlock();
-
-    thread_arg = arg;
-    detached = det;	// may be altered in start_undetached()
-
-    cond_semaphore = CreateSemaphore(NULL, 0, SEMAPHORE_MAX, NULL);
-
-    if (cond_semaphore == NULL)
-	throw omni_thread_fatal(GetLastError());
-
-    cond_next = cond_prev = NULL;
-    cond_waiting = FALSE;
-
-    handle = NULL;
-}
-
-
-//
-// Destructor for omni_thread.
-//
-
-omni_thread::~omni_thread(void)
-{
-    DB(cerr << "destructor called for thread " << id() << endl);
-    if ((handle != NULL) && !CloseHandle(handle))
-	throw omni_thread_fatal(GetLastError());
-    if (!CloseHandle(cond_semaphore))
-	throw omni_thread_fatal(GetLastError());
-}
-
-
-//
-// Start the thread
-//
-
-void
-omni_thread::start(void)
-{
-    omni_mutex_lock l(mutex);
-
-    if (_state != STATE_NEW)
-	throw omni_thread_invalid();
-
-    unsigned int t;
-    handle = (HANDLE)_beginthreadex(
-                        NULL,
-			0,
-			omni_thread_wrapper,
-			(LPVOID)this,
-			CREATE_SUSPENDED, 
-			&t);
-    nt_id = t;
-    if (handle == NULL)
-      throw omni_thread_fatal(GetLastError());
-
-    if (!SetThreadPriority(handle, _priority))
-      throw omni_thread_fatal(GetLastError());
-
-    if (ResumeThread(handle) == 0xffffffff)
-	throw omni_thread_fatal(GetLastError());
-
-    _state = STATE_RUNNING;
-}
-
-
-//
-// Start a thread which will run the member function run_undetached().
-//
-
-void
-omni_thread::start_undetached(void)
-{
-    if ((fn_void != NULL) || (fn_ret != NULL))
-	throw omni_thread_invalid();
-
-    detached = 0;
-    start();
-}
-
-
-//
-// join - simply check error conditions & call WaitForSingleObject.
-//
-
-void
-omni_thread::join(void** status)
-{
-    mutex.lock();
-
-    if ((_state != STATE_RUNNING) && (_state != STATE_TERMINATED)) {
-	mutex.unlock();
-	throw omni_thread_invalid();
-    }
-
-    mutex.unlock();
-
-    if (this == self())
-	throw omni_thread_invalid();
-
-    if (detached)
-	throw omni_thread_invalid();
-
-    DB(cerr << "omni_thread::join: doing WaitForSingleObject\n");
-
-    if (WaitForSingleObject(handle, INFINITE) != WAIT_OBJECT_0)
-	throw omni_thread_fatal(GetLastError());
-
-    DB(cerr << "omni_thread::join: WaitForSingleObject succeeded\n");
-
-    if (status)
-      *status = return_val;
-
-    delete this;
-}
-
-
-//
-// Change this thread's priority.
-//
-
-void
-omni_thread::set_priority(priority_t pri)
-{
-    omni_mutex_lock l(mutex);
-
-    if (_state != STATE_RUNNING)
-	throw omni_thread_invalid();
-
-    _priority = pri;
-
-    if (!SetThreadPriority(handle, nt_priority(pri)))
-	throw omni_thread_fatal(GetLastError());
-}
-
-
-//
-// create - construct a new thread object and start it running.  Returns thread
-// object if successful, null pointer if not.
-//
-
-// detached version
-
-omni_thread*
-omni_thread::create(void (*fn)(void*), void* arg, priority_t pri)
-{
-    omni_thread* t = new omni_thread(fn, arg, pri);
-    t->start();
-    return t;
-}
-
-// undetached version
-
-omni_thread*
-omni_thread::create(void* (*fn)(void*), void* arg, priority_t pri)
-{
-    omni_thread* t = new omni_thread(fn, arg, pri);
-    t->start();
-    return t;
-}
-
-
-//
-// exit() _must_ lock the mutex even in the case of a detached thread.  This is
-// because a thread may run to completion before the thread that created it has
-// had a chance to get out of start().  By locking the mutex we ensure that the
-// creating thread must have reached the end of start() before we delete the
-// thread object.  Of course, once the call to start() returns, the user can
-// still incorrectly refer to the thread object, but that's their problem.
-//
-
-void
-omni_thread::exit(void* return_value)
-{
-    omni_thread* me = self();
-
-    if (me)
-      {
-	me->mutex.lock();
-
-	me->_state = STATE_TERMINATED;
-
-	me->mutex.unlock();
-
-	DB(cerr << "omni_thread::exit: thread " << me->id() << " detached "
-	   << me->detached << " return value " << return_value << endl);
-
-	if (me->detached) {
-	  delete me;
-	} else {
-	  me->return_val = return_value;
-	}
-      }
-    else
-      {
-	DB(cerr << "omni_thread::exit: called with a non-omnithread. Exit quietly." << endl);
-      }
-    //   _endthreadex() does not automatically closes the thread handle.
-    //   The omni_thread dtor closes the thread handle.
-    _endthreadex(0);
-}
-
-
-omni_thread*
-omni_thread::self(void)
-{
-    LPVOID me;
-
-    me = TlsGetValue(self_tls_index);
-
-    if (me == NULL) {
-      DB(cerr << "omni_thread::self: called with a non-ominthread. NULL is returned." << endl);
-    }
-    return (omni_thread*)me;
-}
-
-
-void
-omni_thread::yield(void)
-{
-    Sleep(0);
-}
-
-
-#define MAX_SLEEP_SECONDS (DWORD)4294966	// (2**32-2)/1000
-
-void
-omni_thread::sleep(unsigned long secs, unsigned long nanosecs)
-{
-    if (secs <= MAX_SLEEP_SECONDS) {
-	Sleep(secs * 1000 + nanosecs / 1000000);
-	return;
-    }
-
-    DWORD no_of_max_sleeps = secs / MAX_SLEEP_SECONDS;
-
-    for (DWORD i = 0; i < no_of_max_sleeps; i++)
-	Sleep(MAX_SLEEP_SECONDS * 1000);
-
-    Sleep((secs % MAX_SLEEP_SECONDS) * 1000 + nanosecs / 1000000);
-}
-
-
-void
-omni_thread::get_time(unsigned long* abs_sec, unsigned long* abs_nsec,
-		      unsigned long rel_sec, unsigned long rel_nsec)
-{
-    get_time_now(abs_sec, abs_nsec);
-    *abs_nsec += rel_nsec;
-    *abs_sec += rel_sec + *abs_nsec / 1000000000;
-    *abs_nsec = *abs_nsec % 1000000000;
-}
-
-
-int
-omni_thread::nt_priority(priority_t pri)
-{
-    switch (pri) {
-
-    case PRIORITY_LOW:
-	return THREAD_PRIORITY_LOWEST;
-
-    case PRIORITY_NORMAL:
-	return THREAD_PRIORITY_NORMAL;
-
-    case PRIORITY_HIGH:
-	return THREAD_PRIORITY_HIGHEST;
-    }
-
-    throw omni_thread_invalid();
-    return 0; /* keep msvc++ happy */
-}
-
-
-static void
-get_time_now(unsigned long* abs_sec, unsigned long* abs_nsec)
-{
-    static int days_in_preceding_months[12]
-	= { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
-    static int days_in_preceding_months_leap[12]
-	= { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 };
-
-    SYSTEMTIME st;
-
-    GetSystemTime(&st);
-    *abs_nsec = st.wMilliseconds * 1000000;
-
-    // this formula should work until 1st March 2100
-
-    DWORD days = ((st.wYear - 1970) * 365 + (st.wYear - 1969) / 4
-		  + ((st.wYear % 4)
-		     ? days_in_preceding_months[st.wMonth - 1]
-		     : days_in_preceding_months_leap[st.wMonth - 1])
-		  + st.wDay - 1);
-
-    *abs_sec = st.wSecond + 60 * (st.wMinute + 60 * (st.wHour + 24 * days));
-}
diff --git a/ica/win32/src/omnithread/nt.h b/ica/win32/src/omnithread/nt.h
deleted file mode 100644
index c008669..0000000
--- a/ica/win32/src/omnithread/nt.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//				Package : omnithread
-// omnithread/nt.h		Created : 6/95 tjr
-//
-//    Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//    This file is part of the omnithread library
-//
-//    The omnithread 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
-//    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
-//    02111-1307, USA
-//
-//
-// OMNI thread implementation classes for NT threads.
-//
-
-#ifndef __omnithread_nt_h_
-#define __omnithread_nt_h_
-
-#include <windows.h>
-
-#define OMNI_THREAD_WRAPPER \
-    unsigned __stdcall omni_thread_wrapper(LPVOID ptr)
-
-extern "C" OMNI_THREAD_WRAPPER;
-
-#define OMNI_MUTEX_IMPLEMENTATION			\
-    CRITICAL_SECTION crit;
-
-#define OMNI_CONDITION_IMPLEMENTATION			\
-    CRITICAL_SECTION crit;				\
-    omni_thread* waiting_head;				\
-    omni_thread* waiting_tail;
-
-#define OMNI_SEMAPHORE_IMPLEMENTATION			\
-    HANDLE nt_sem;
-
-#define OMNI_THREAD_IMPLEMENTATION			\
-    HANDLE handle;					\
-    DWORD nt_id;					\
-    void* return_val;					\
-    HANDLE cond_semaphore;				\
-    omni_thread* cond_next;				\
-    omni_thread* cond_prev;				\
-    BOOL cond_waiting;					\
-    static int nt_priority(priority_t);			\
-    friend class omni_condition;			\
-    friend OMNI_THREAD_WRAPPER;
-
-#endif
diff --git a/ica/win32/src/omnithread/omnithread.h b/ica/win32/src/omnithread/omnithread.h
deleted file mode 100644
index a8f121b..0000000
--- a/ica/win32/src/omnithread/omnithread.h
+++ /dev/null
@@ -1,502 +0,0 @@
-//				Package : omnithread
-// omnithread.h			Created : 7/94 tjr
-//
-//    Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//    This file is part of the omnithread library
-//
-//    The omnithread 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
-//    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
-//    02111-1307, USA
-//
-
-//
-// Interface to OMNI thread abstraction.
-//
-// This file declares classes for threads and synchronisation objects
-// (mutexes, condition variables and counting semaphores).
-//
-// Wherever a seemingly arbitrary choice has had to be made as to the interface
-// provided, the intention here has been to be as POSIX-like as possible.  This
-// is why there is no semaphore timed wait, for example.
-//
-
-#ifndef __omnithread_h_
-#define __omnithread_h_
-
-#ifndef NULL
-#define NULL (void*)0
-#endif
-
-class omni_mutex;
-class omni_condition;
-class omni_semaphore;
-class omni_thread;
-
-//
-// OMNI_THREAD_EXPOSE can be defined as public or protected to expose the
-// implementation class - this may be useful for debugging.  Hopefully this
-// won't change the underlying structure which the compiler generates so that
-// this can work without recompiling the library.
-//
-
-#ifndef OMNI_THREAD_EXPOSE
-#define OMNI_THREAD_EXPOSE private
-#endif
-
-
-//
-// Include implementation-specific header file.
-//
-// This must define 4 CPP macros of the form OMNI_x_IMPLEMENTATION for mutex,
-// condition variable, semaphore and thread.  Each should define any
-// implementation-specific members of the corresponding classes.
-//
-
-
-#if defined(__arm__) && defined(__atmos__)
-#include <omnithread/posix.h>
-
-#elif defined(__alpha__) && defined(__osf1__)
-#include <omnithread/posix.h>
-
-#elif defined(__powerpc__) && defined(__aix__)
-#include <omnithread/posix.h>
-
-#elif defined(__hpux__)
-#include <omnithread/posix.h>
-
-#elif defined(__WIN32__)
-#include "nt.h"
-
-#ifdef _MSC_VER
-
-// Using MSVC++ to compile. If compiling library as a DLL,
-// define _OMNITHREAD_DLL. If compiling as a statuc library, define
-// _WINSTATIC
-// If compiling an application that is to be statically linked to omnithread,
-// define _WINSTATIC (if the application is  to be dynamically linked, 
-// there is no need to define any of these macros).
-
-#if defined (_OMNITHREAD_DLL) && defined(_WINSTATIC)
-#error "Both _OMNITHREAD_DLL and _WINSTATIC are defined."
-#elif defined(_OMNITHREAD_DLL)
-#define _OMNITHREAD_NTDLL_ __declspec(dllexport)
-#elif !defined(_WINSTATIC)
-#define _OMNITHREAD_NTDLL_ __declspec(dllimport)
-#elif defined(_WINSTATIC)
-#define _OMNITHREAD_NTDLL_
-#endif
- // _OMNITHREAD_DLL && _WINSTATIC
-
-#else
-
-// Not using MSVC++ to compile
-#define _OMNITHREAD_NTDLL_
-
-#endif
- // _MSC_VER
- 
-#elif defined(__sunos__) && (__OSVERSION__ == 5)
-#ifdef UsePthread
-#include <omnithread/posix.h>
-#else
-#include <omnithread/solaris.h>
-#endif
-
-#elif defined(__linux__)
-#include <omnithread/posix.h>
-
-#elif defined(__nextstep__)
-#include <omnithread/mach.h>
-
-#elif defined(__VMS)
-#include <omnithread/posix.h>
-
-#elif defined(__SINIX__)
-#include <omnithread/posix.h>
-
-#elif defined(__osr5__)
-#include <omnithread/posix.h>
-
-#elif defined(__irix__)
-#include <omnithread/posix.h>
-
-#else
-#error "No implementation header file"
-#endif
-
-#if !defined(__WIN32__)
-#define _OMNITHREAD_NTDLL_
-#endif
-
-#if (!defined(OMNI_MUTEX_IMPLEMENTATION) || \
-     !defined(OMNI_CONDITION_IMPLEMENTATION) || \
-     !defined(OMNI_SEMAPHORE_IMPLEMENTATION) || \
-     !defined(OMNI_THREAD_IMPLEMENTATION))
-#error "Implementation header file incomplete"
-#endif
-
-
-//
-// This exception is thrown in the event of a fatal error.
-//
-
-class _OMNITHREAD_NTDLL_ omni_thread_fatal {
-public:
-    int error;
-    omni_thread_fatal(int e = 0) : error(e) {}
-};
-
-
-//
-// This exception is thrown when an operation is invoked with invalid
-// arguments.
-//
-
-class _OMNITHREAD_NTDLL_ omni_thread_invalid {};
-
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Mutex
-//
-///////////////////////////////////////////////////////////////////////////
-
-class _OMNITHREAD_NTDLL_ omni_mutex {
-
-public:
-    omni_mutex(void);
-    ~omni_mutex(void);
-
-    void lock(void);
-    void unlock(void);
-    void acquire(void) { lock(); }
-    void release(void) { unlock(); }
-	// the names lock and unlock are preferred over acquire and release
-	// since we are attempting to be as POSIX-like as possible.
-
-    friend class omni_condition;
-
-private:
-    // dummy copy constructor and operator= to prevent copying
-    omni_mutex(const omni_mutex&);
-    omni_mutex& operator=(const omni_mutex&);
-
-OMNI_THREAD_EXPOSE:
-    OMNI_MUTEX_IMPLEMENTATION
-};
-
-//
-// As an alternative to:
-// {
-//   mutex.lock();
-//   .....
-//   mutex.unlock();
-// }
-//
-// you can use a single instance of the omni_mutex_lock class:
-//
-// {
-//   omni_mutex_lock l(mutex);
-//   ....
-// }
-//
-// This has the advantage that mutex.unlock() will be called automatically
-// when an exception is thrown.
-//
-
-class _OMNITHREAD_NTDLL_ omni_mutex_lock {
-    omni_mutex& mutex;
-public:
-    omni_mutex_lock(omni_mutex& m) : mutex(m) { mutex.lock(); }
-    ~omni_mutex_lock(void) { mutex.unlock(); }
-private:
-    // dummy copy constructor and operator= to prevent copying
-    omni_mutex_lock(const omni_mutex_lock&);
-    omni_mutex_lock& operator=(const omni_mutex_lock&);
-};
-
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Condition variable
-//
-///////////////////////////////////////////////////////////////////////////
-
-class _OMNITHREAD_NTDLL_ omni_condition {
-
-    omni_mutex* mutex;
-
-public:
-    omni_condition(omni_mutex* m);
-	// constructor must be given a pointer to an existing mutex. The
-	// condition variable is then linked to the mutex, so that there is an
-	// implicit unlock and lock around wait() and timed_wait().
-
-    ~omni_condition(void);
-
-    void wait(void);
-	// wait for the condition variable to be signalled.  The mutex is
-	// implicitly released before waiting and locked again after waking up.
-	// If wait() is called by multiple threads, a signal may wake up more
-	// than one thread.  See POSIX threads documentation for details.
-
-    int timedwait(unsigned long secs, unsigned long nanosecs = 0);
-	// timedwait() is given an absolute time to wait until.  To wait for a
-	// relative time from now, use omni_thread::get_time. See POSIX threads
-	// documentation for why absolute times are better than relative.
-	// Returns 1 (true) if successfully signalled, 0 (false) if time
-	// expired.
-
-    void signal(void);
-	// if one or more threads have called wait(), signal wakes up at least
-	// one of them, possibly more.  See POSIX threads documentation for
-	// details.
-
-    void broadcast(void);
-	// broadcast is like signal but wakes all threads which have called
-	// wait().
-
-private:
-    // dummy copy constructor and operator= to prevent copying
-    omni_condition(const omni_condition&);
-    omni_condition& operator=(const omni_condition&);
-
-OMNI_THREAD_EXPOSE:
-    OMNI_CONDITION_IMPLEMENTATION
-};
-
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Counting semaphore
-//
-///////////////////////////////////////////////////////////////////////////
-
-class _OMNITHREAD_NTDLL_ omni_semaphore {
-
-public:
-    omni_semaphore(unsigned int initial = 1);
-    ~omni_semaphore(void);
-
-    void wait(void);
-	// if semaphore value is > 0 then decrement it and carry on. If it's
-	// already 0 then block.
-
-    int trywait(void);
-	// if semaphore value is > 0 then decrement it and return 1 (true).
-	// If it's already 0 then return 0 (false).
-
-    void post(void);
-	// if any threads are blocked in wait(), wake one of them up. Otherwise
-	// increment the value of the semaphore.
-
-private:
-    // dummy copy constructor and operator= to prevent copying
-    omni_semaphore(const omni_semaphore&);
-    omni_semaphore& operator=(const omni_semaphore&);
-
-OMNI_THREAD_EXPOSE:
-    OMNI_SEMAPHORE_IMPLEMENTATION
-};
-
-//
-// A helper class for semaphores, similar to omni_mutex_lock above.
-//
-
-class _OMNITHREAD_NTDLL_ omni_semaphore_lock {
-    omni_semaphore& sem;
-public:
-    omni_semaphore_lock(omni_semaphore& s) : sem(s) { sem.wait(); }
-    ~omni_semaphore_lock(void) { sem.post(); }
-private:
-    // dummy copy constructor and operator= to prevent copying
-    omni_semaphore_lock(const omni_semaphore_lock&);
-    omni_semaphore_lock& operator=(const omni_semaphore_lock&);
-};
-
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Thread
-//
-///////////////////////////////////////////////////////////////////////////
-
-class _OMNITHREAD_NTDLL_ omni_thread {
-
-public:
-
-    enum priority_t {
-	PRIORITY_LOW,
-	PRIORITY_NORMAL,
-	PRIORITY_HIGH
-    };
-
-    enum state_t {
-	STATE_NEW,		// thread object exists but thread hasn't
-				// started yet.
-	STATE_RUNNING,		// thread is running.
-	STATE_TERMINATED	// thread has terminated but storage has not
-				// been reclaimed (i.e. waiting to be joined).
-    };
-
-    //
-    // Constructors set up the thread object but the thread won't start until
-    // start() is called. The create method can be used to construct and start
-    // a thread in a single call.
-    //
-
-    omni_thread(void (*fn)(void*), void* arg = NULL,
-		priority_t pri = PRIORITY_NORMAL);
-    omni_thread(void* (*fn)(void*), void* arg = NULL,
-		priority_t pri = PRIORITY_NORMAL);
-	// these constructors create a thread which will run the given function
-	// when start() is called.  The thread will be detached if given a
-	// function with void return type, undetached if given a function
-	// returning void*. If a thread is detached, storage for the thread is
-	// reclaimed automatically on termination. Only an undetached thread
-	// can be joined.
-
-    void start(void);
-	// start() causes a thread created with one of the constructors to
-	// start executing the appropriate function.
-
-protected:
-
-    omni_thread(void* arg = NULL, priority_t pri = PRIORITY_NORMAL);
-	// this constructor is used in a derived class.  The thread will
-	// execute the run() or run_undetached() member functions depending on
-	// whether start() or start_undetached() is called respectively.
-
-    void start_undetached(void);
-	// can be used with the above constructor in a derived class to cause
-	// the thread to be undetached.  In this case the thread executes the
-	// run_undetached member function.
-
-    virtual ~omni_thread(void);
-	// destructor cannot be called by user (except via a derived class).
-	// Use exit() or cancel() instead. This also means a thread object must
-	// be allocated with new - it cannot be statically or automatically
-	// allocated. The destructor of a class that inherits from omni_thread
-	// shouldn't be public either (otherwise the thread object can be
-	// destroyed while the underlying thread is still running).
-
-public:
-
-    void join(void**);
-	// join causes the calling thread to wait for another's completion,
-	// putting the return value in the variable of type void* whose address
-	// is given (unless passed a null pointer). Only undetached threads
-	// may be joined. Storage for the thread will be reclaimed.
-
-    void set_priority(priority_t);
-	// set the priority of the thread.
-
-    static omni_thread* create(void (*fn)(void*), void* arg = NULL,
-			       priority_t pri = PRIORITY_NORMAL);
-    static omni_thread* create(void* (*fn)(void*), void* arg = NULL,
-			       priority_t pri = PRIORITY_NORMAL);
-	// create spawns a new thread executing the given function with the
-	// given argument at the given priority. Returns a pointer to the
-	// thread object. It simply constructs a new thread object then calls
-	// start.
-
-    static void exit(void* return_value = NULL);
-	// causes the calling thread to terminate.
-
-    static omni_thread* self(void);
-	// returns the calling thread's omni_thread object.
-	// If the calling thread is not the main thread and
-	// is not created using this library, returns 0.
-
-    static void yield(void);
-	// allows another thread to run.
-
-    static void sleep(unsigned long secs, unsigned long nanosecs = 0);
-	// sleeps for the given time.
-
-    static void get_time(unsigned long* abs_sec, unsigned long* abs_nsec,
-			 unsigned long rel_sec = 0, unsigned long rel_nsec=0);
-	// calculates an absolute time in seconds and nanoseconds, suitable for
-	// use in timed_waits on condition variables, which is the current time
-	// plus the given relative offset.
-
-private:
-
-    virtual void run(void* arg) {}
-    virtual void* run_undetached(void* arg) { return NULL; }
-	// can be overridden in a derived class.  When constructed using the
-	// the constructor omni_thread(void*, priority_t), these functions are
-	// called by start() and start_undetached() respectively.
-
-    void common_constructor(void* arg, priority_t pri, int det);
-	// implements the common parts of the constructors.
-
-    omni_mutex mutex;
-	// used to protect any members which can change after construction,
-	// i.e. the following 2 members:
-
-    state_t _state;
-    priority_t _priority;
-
-    static omni_mutex* next_id_mutex;
-    static int next_id;
-    int _id;
-
-    void (*fn_void)(void*);
-    void* (*fn_ret)(void*);
-    void* thread_arg;
-    int detached;
-
-public:
-
-    priority_t priority(void) {
-
-	// return this thread's priority.
-
-	omni_mutex_lock l(mutex);
-	return _priority;
-    }
-
-    state_t state(void) {
-
-	// return thread state (invalid, new, running or terminated).
-
-	omni_mutex_lock l(mutex);
-	return _state;
-    }
-
-    int id(void) { return _id; }
-	// return unique thread id within the current process.
-
-
-    // This class plus the instance of it declared below allows us to execute
-    // some initialisation code before main() is called.
-
-    class _OMNITHREAD_NTDLL_ init_t {
-	static int count;
-    public:
-	init_t(void);
-    };
-
-    friend class init_t;
-
-OMNI_THREAD_EXPOSE:
-    OMNI_THREAD_IMPLEMENTATION
-};
-
-static omni_thread::init_t omni_thread_init;
-
-#endif
diff --git a/ica/win32/src/resource.h b/ica/win32/src/resource.h
deleted file mode 100644
index 97a58a6..0000000
--- a/ica/win32/src/resource.h
+++ /dev/null
@@ -1,164 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by WinVNC.rc
-//
-#define IDI_WINVNC                      102
-#define IDR_TRAYMENU                    104
-#define IDD_QUERY_SETTINGS              106
-#define IDD_PROPERTIES_PARENT           107
-#define IDR_INSTREAM_CLASS              108
-#define IDR_MEMINSTREAM_CLASS           109
-#define IDR_ZLIBINSTREAM_CLASS          110
-#define IDR_VNCVIEWER_JAR               116
-#define IDR_RECFRAME_CLASS              117
-#define IDR_SESSIONREC_CLASS            118
-#define IDR_AUTHPANEL_CLASS             119
-#define IDR_RELOGINPANEL_CLASS          120
-#define IDR_SOCKFACTORY_CLASS           121
-#define IDR_CLIPBOARDFRAME_CLASS        122
-#define IDR_OPTIONSFRAME_CLASS          125
-#define IDR_RFBPROTO_CLASS              126
-#define IDR_VNCCANVAS_CLASS             127
-#define IDR_VNCVIEWER_CLASS             128
-#define IDR_BUTTONPANEL_CLASS           129
-#define IDD_ABOUT                       131
-#define IDB_VNCLOGO                     132
-#define IDR_DESCIPHER_CLASS             133
-#define IDI_FLASH                       134
-#define IDD_OUTGOING_CONN               135
-#define IDD_ACCEPT_CONN                 136
-#define IDI_DISABLED                    138
-#define IDD_LIVESHAREPROP               138
-#define IDR_LSHTRAYMENU                 139
-#define IDD_LIVESHAREADVPROP            139
-#define IDB_BITMAP1                     139
-#define IDI_LIVESHARE                   140
-#define IDB_BITMAP2                     140
-#define IDC_CURSOR1                     141
-#define IDB_BITMAP3                     142
-#define IDI_LIVESHARE_CON               144
-#define IDI_LIVESHARE_NOCON             145
-#define IDD_ACCEPT_REVERSE              146
-#define IDD_SHARED_DESKTOP_AREA         147
-#define IDD_INCOMING                    148
-#define IDD_UPDATE_HANDLING             150
-#define IDD_ADMINISTRATION              152
-#define IDR_VNCCANVAS2_CLASS            153
-#define IDR_CAPINFO_CLASS               154
-#define IDR_CAPSCONTAINER_CLASS         155
-#define IDC_HOSTNAME_EDIT               1001
-#define IDC_PRIMARY_DISPLAY_ONLY        1002
-#define IDC_STATIC_DRVINFO              1003
-#define IDC_CONNECT_SOCK                1004
-#define IDC_BLANK_SCREEN                1005
-#define IDC_VNCLOGO                     1006
-#define IDC_PASSWORD_LABEL              1007
-#define IDC_DISPLAYNO                   1008
-#define IDC_PASSWORD                    1009
-#define IDC_UPDATE_BORDER               1010
-#define IDC_POLL_FULLSCREEN             1011
-#define IDC_CONSOLE_ONLY                1012
-#define IDC_POLL_FOREGROUND             1013
-#define IDC_POLL_UNDER_CURSOR           1014
-#define IDC_ONEVENT_ONLY                1015
-#define IDC_REMOTE_DISABLE              1016
-#define IDC_PORTHTTP                    1017
-#define IDC_PORTRFB                     1018
-#define IDC_PASSWORD_VIEWONLY_LABEL     1019
-#define IDC_PASSWORD_VIEWONLY           1020
-#define IDC_URL_PARAMS                  1021
-#define IDC_STATIC_DRVSTATUS            1022
-#define IDC_STATIC_TRSH                 1023
-#define IDC_DISABLE_INPUTS              1024
-#define IDC_APPLY                       1025
-#define IDC_PORTNO_AUTO                 1026
-#define IDC_DISABLE_LOCAL_INPUTS        1027
-#define IDC_HOSTNAME_STATIC             1028
-#define IDC_STATIC_WNDPOLLING           1029
-#define IDACCEPT                        1030
-#define IDREJECT                        1031
-#define IDC_STATIC_TEXT1                1032
-#define IDC_ACCEPT_IP                   1033
-#define IDC_STATIC_TEXT                 1034
-#define IDC_ACCEPT_TIMEOUT              1035
-#define IDACCEPT_NOPASS                 1036
-#define IDADVANCED                      1037
-#define IDC_STATIC_TEXT2                1038
-#define IDQUERY                         1039
-#define IDQUERYTIMEOUT                  1042
-#define IDREQUIREAUTH                   1043
-#define IDQUERYALLOWNOPASS              1044
-#define IDONLYLOOPBACK                  1045
-#define IDLOGLOTS                       1047
-#define IDALLOWLOOPBACK                 1048
-#define IDLOG                           1050
-#define IDPRIORITY0                     1052
-#define IDPRIORITY2                     1053
-#define IDPRIORITY1                     1054
-#define IDENABLEHTTPD                   1055
-#define IDC_SHARINGAREA_BORDER          1056
-#define IDC_LIVESHARE_BORDER            1057
-#define IDC_NAME_APPLI                  1058
-#define IDC_LIVESHARE                   1059
-#define IDC_BMPCURSOR                   1060
-#define IDC_WINDOW                      1061
-#define IDC_SCREEN                      1062
-#define IDC_FULLSCREEN                  1063
-#define IDC_DISABLE_TIME                1064
-#define IDC_TIMEOUT_LABEL               1065
-#define IDC_SECONDS_LABEL               1066
-#define IDC_STATIC_INCOMING             1067
-#define IDC_STATIC_INPUT                1068
-#define IDC_STATIC_DISCONNECT           1069
-#define IDC_STATIC_POLLING              1070
-#define IDC_SPECDISPLAY                 1071
-#define IDC_SPECPORT                    1072
-#define IDC_POLLING_CYCLE               1073
-#define IDC_ACTION_REFUSE               1074
-#define IDC_ACTION_ACCEPT               1075
-#define IDC_REMOVE_WALLPAPER            1076
-#define IDC_LOCKSETTING_NOTHING         1077
-#define IDC_LOCKSETTING_LOCK            1078
-#define IDC_LOCKSETTING_LOGOFF          1079
-#define IDC_DONT_SET_HOOKS              1080
-#define IDC_STATIC_PCYCLE               1081
-#define IDC_STATIC_MS                   1082
-#define IDC_ENABLE_FILE_TRANSFERS       1083
-#define IDC_AND_LABEL                   1084
-#define IDC_MAIN_LABEL                  1085
-#define IDC_HTTP_LABEL                  1086
-#define IDC_TAB                         1087
-#define IDC_STATIC_AND                  1088
-#define IDC_STATIC_SECONDS              1089
-#define IDC_STATIC_TIMEOUT              1090
-#define IDC_STATIC_ACTION               1091
-#define IDC_STATIC_TEMPORARY            1092
-#define IDC_STATIC_CONN_PRIOR           1093
-#define IDC_STATIC_ADMINISTR            1094
-#define IDC_STATIC_DISPLAY_PORT         1095
-#define IDC_POLCYCLMS_LABEL             1096
-#define IDC_LIVESHARE_LABEL             1097
-#define IDC_DONT_USE_DRIVER             1098
-#define IDC_DRIVER_DIRECT_ACCESS        1099
-#define IDC_STATIC_DRVOPT               1100
-#define IDC_STATIC_QUERY                1101
-#define IDC_STATIC_LOGGING              1102
-#define IDC_BUILDTIME                   1103
-#define ID_PROPERTIES                   40001
-#define ID_CLOSE                        40002
-#define ID_KILLCLIENTS                  40003
-#define ID_ABOUT                        40004
-#define ID_OUTGOING_CONN                40005
-#define ID_DEFAULT_PROPERTIES           40006
-#define ID_DISABLE_CONN                 40007
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        156
-#define _APS_NEXT_COMMAND_VALUE         40008
-#define _APS_NEXT_CONTROL_VALUE         1104
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
diff --git a/ica/win32/src/rfb.h b/ica/win32/src/rfb.h
deleted file mode 100644
index 812bbde..0000000
--- a/ica/win32/src/rfb.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// rfb.h
-// This includes the rfb spec header, the port numbers,
-// the CARD type definitions and various useful macros.
-//
-
-#ifndef RFB_H__
-#define RFB_H__
-
-// Define the CARD* types as used in X11/Xmd.h
-
-typedef unsigned long CARD32;
-typedef unsigned short CARD16;
-typedef short INT16;
-typedef unsigned char  CARD8;
-
-// Define the port number offsets
-#define FLASH_PORT_OFFSET 5400
-#define INCOMING_PORT_OFFSET 5500
-#define HTTP_PORT_OFFSET 5800
-#define RFB_PORT_OFFSET 5900
-
-#define PORT_TO_DISPLAY(p)  ( (p) - RFB_PORT_OFFSET )
-#define HPORT_TO_DISPLAY(p) ( (p) - HTTP_PORT_OFFSET )
-#define DISPLAY_TO_PORT(d)  ( (d) + RFB_PORT_OFFSET )
-#define DISPLAY_TO_HPORT(d) ( (d) + HTTP_PORT_OFFSET )
-
-// include the protocol spec
-#include <rfb/rfbproto.h>
-
-// define some quick endian conversions
-// change this if necessary
-#define LITTLE_ENDIAN_HOST
-
-#ifdef LITTLE_ENDIAN_HOST
-
-#define Swap16IfLE(s) \
-    ((CARD16) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)))
-#define Swap32IfLE(l) \
-    ((CARD32) ((((l) & 0xff000000) >> 24) | \
-     (((l) & 0x00ff0000) >> 8)  | \
-	 (((l) & 0x0000ff00) << 8)  | \
-	 (((l) & 0x000000ff) << 24)))
-
-#else
-
-#define Swap16IfLE(s) (s)
-#define Swap32IfLE(l) (l)
-
-#endif
-
-// unconditional swaps
-#define Swap16(s) \
-    ((CARD16) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)))
-#define Swap32(l) \
-    ((CARD32) ((((l) & 0xff000000) >> 24) | \
-     (((l) & 0x00ff0000) >> 8)  | \
-	 (((l) & 0x0000ff00) << 8)  | \
-	 (((l) & 0x000000ff) << 24)))
-
-
-#endif
diff --git a/ica/win32/src/stdhdrs.cpp b/ica/win32/src/stdhdrs.cpp
deleted file mode 100644
index 8404bd5..0000000
--- a/ica/win32/src/stdhdrs.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-#include "stdhdrs.h"
-
-#if 0
-// Create the main log object
-#ifdef HORIZONLIVE
-Log vnclog( 0, 1, NULL, true ) ;
-#else
-Log vnclog(0, 1, "WinVNC.log", false);
-#endif
-
-#endif
-Log vnclog(Log::ToQtLog, LL_INTWARN);
-
diff --git a/ica/win32/src/stdhdrs.h b/ica/win32/src/stdhdrs.h
deleted file mode 100644
index 5918fbb..0000000
--- a/ica/win32/src/stdhdrs.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// #define VC_EXTRALEAN
-#ifndef STRICT
-#define STRICT
-#endif
-#define WIN32_LEAN_AND_MEAN
-
-#include <winsock2.h>
-#include <windows.h>
-#include <stdio.h>
-#include <process.h>
-#include <crtdbg.h>
-
-// LOGGING SUPPORT
-
-#include "Log.h"
-extern Log vnclog;
-
-// No logging at all
-#define LL_NONE		0
-// Log server startup/shutdown
-#define LL_STATE	0
-// Log connect/disconnect
-#define LL_CLIENTS	1
-// Log connection errors (wrong pixfmt, etc)
-#define LL_CONNERR	0
-// Log socket errors
-#define LL_SOCKERR	4
-// Log internal errors
-#define LL_INTERR	0
-
-// Log internal warnings
-#define LL_INTWARN	8
-// Log internal info
-#define LL_INTINFO	9
-// Log socket errors
-#define LL_SOCKINFO	10
-// Log everything, including internal table setup, etc.
-#define LL_ALL		10
-
diff --git a/ica/win32/src/tableinitcmtemplate.cpp b/ica/win32/src/tableinitcmtemplate.cpp
deleted file mode 100644
index 7842a0b..0000000
--- a/ica/win32/src/tableinitcmtemplate.cpp
+++ /dev/null
@@ -1,91 +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 OUTBPP.
- * For each value of OUTBPP, 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.
- */
-
-#if !defined(OUTBPP)
-#error "This file shouldn't be compiled."
-#error "It is included as part of translate.c"
-#endif
-
-#define OUT_T CONCAT2E(CARD,OUTBPP)
-#define SwapOUT(x) CONCAT2E(Swap,OUTBPP) (x)
-#define rfbInitColourMapSingleTableOUT \
-				CONCAT2E(rfbInitColourMapSingleTable,OUTBPP)
-
-// THIS CODE HAS BEEN MODIFIED FROM THE ORIGINAL UNIX SOURCE
-// TO WORK FOR WINVNC.  THE PALETTE SHOULD REALLY BE RETRIEVED
-// FROM THE VNCDESKTOP OBJECT, RATHER THAN FROM THE OS DIRECTLY
-
-static void
-rfbInitColourMapSingleTableOUT (char **table,
-								rfbPixelFormat *in,
-								rfbPixelFormat *out)
-{
-	vnclog.Print(LL_ALL, VNCLOG("rfbInitColourMapSingleTable called\n"));
-
-	// ALLOCATE SPACE FOR COLOUR TABLE
-
-    int nEntries = 1 << in->bitsPerPixel;
-
-	// Allocate the table
-    if (*table) free(*table);
-    *table = (char *)malloc(nEntries * sizeof(OUT_T));
-	if (*table == NULL)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("failed to allocate translation table\n"));
-		return;
-	}
-
-	// Obtain the system palette
-	HDC hDC = GetDC(NULL);
-	PALETTEENTRY palette[256];
-	if (GetSystemPaletteEntries(hDC,
-		0, 256, palette) == 0)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("failed to get system palette, error=%d\n"),
-					 GetLastError());
-		ReleaseDC(NULL, hDC);
-		return;
-	}
-	ReleaseDC(NULL, hDC);
-
-	// COLOUR TRANSLATION
-
-	// We now have the colour table intact.  Map it into a translation table
-    int i, r, g, b;
-    OUT_T *t = (OUT_T *)*table;
-
-    for (i = 0; i < nEntries; i++)
-	{
-		// Split down the RGB data
-		r = palette[i].peRed;
-		g = palette[i].peGreen;
-		b = palette[i].peBlue;
-
-		// Now translate it
-		t[i] = ((((r * out->redMax + 127) / 255) << out->redShift) |
-			(((g * out->greenMax + 127) / 255) << out->greenShift) |
-			(((b * out->blueMax + 127) / 255) << out->blueShift));
-#if (OUTBPP != 8)
-		if (out->bigEndian != in->bigEndian)
-		{
-			t[i] = SwapOUT(t[i]);
-		}
-#endif
-	}
-
-	vnclog.Print(LL_ALL, VNCLOG("rfbInitColourMapSingleTable done\n"));
-}
-
-#undef OUT_T
-#undef SwapOUT
-#undef rfbInitColourMapSingleTableOUT
diff --git a/ica/win32/src/tableinittctemplate.cpp b/ica/win32/src/tableinittctemplate.cpp
deleted file mode 100644
index 9849864..0000000
--- a/ica/win32/src/tableinittctemplate.cpp
+++ /dev/null
@@ -1,122 +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 OUTBPP.
- * For each value of OUTBPP, 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.
- */
-
-#if !defined(OUTBPP)
-#error "This file shouldn't be compiled."
-#error "It is included as part of translate.c"
-#endif
-
-#define OUT_T CONCAT2E(CARD,OUTBPP)
-#define SwapOUT(x) CONCAT2E(Swap,OUTBPP) (x)
-#define rfbInitTrueColourSingleTableOUT \
-				CONCAT2E(rfbInitTrueColourSingleTable,OUTBPP)
-#define rfbInitTrueColourRGBTablesOUT CONCAT2E(rfbInitTrueColourRGBTables,OUTBPP)
-#define rfbInitOneRGBTableOUT CONCAT2E(rfbInitOneRGBTable,OUTBPP)
-
-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));
-	if (table == NULL) return;
-    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 (OUTBPP != 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 (OUTBPP != 8)
-	if (swap) {
-	    table[i] = SwapOUT(table[i]);
-	}
-#endif
-    }
-}
-
-#undef OUT_T
-#undef SwapOUT
-#undef rfbInitTrueColourSingleTableOUT
-#undef rfbInitTrueColourRGBTablesOUT
-#undef rfbInitOneRGBTableOUT
diff --git a/ica/win32/src/tabletranstemplate.cpp b/ica/win32/src/tabletranstemplate.cpp
deleted file mode 100644
index dc603fb..0000000
--- a/ica/win32/src/tabletranstemplate.cpp
+++ /dev/null
@@ -1,99 +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 INBPP and OUTBPP.
- *
- * For each pair of values INBPP and OUTBPP, 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.
- */
-
-#if !defined(INBPP) || !defined(OUTBPP)
-#error "This file shouldn't be compiled."
-#error "It is included as part of translate.c"
-#endif
-
-#define IN_T CONCAT2E(CARD,INBPP)
-#define OUT_T CONCAT2E(CARD,OUTBPP)
-#define rfbTranslateWithSingleTableINtoOUT \
-				CONCAT4E(rfbTranslateWithSingleTable,INBPP,to,OUTBPP)
-#define rfbTranslateWithRGBTablesINtoOUT \
-				CONCAT4E(rfbTranslateWithRGBTables,INBPP,to,OUTBPP)
-
-/*
- * 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;
-    IN_T in_pix;
-    OUT_T out_pix;
-
-    while (height > 0) {
-	opLineEnd = op + width;
-
-	while (op < opLineEnd) {
-	    in_pix = *ip++;
-	    out_pix  = redTable[(in_pix >> in->redShift) & in->redMax];
-	    out_pix |= greenTable[(in_pix >> in->greenShift) & in->greenMax];
-	    out_pix |= blueTable[(in_pix >> in->blueShift) & in->blueMax];
-	    *op++ = out_pix;
-	}
-	ip += ipextra;
-	height--;
-    }
-}
-
-#undef IN_T
-#undef OUT_T
-#undef rfbTranslateWithSingleTableINtoOUT
-#undef rfbTranslateWithRGBTablesINtoOUT
diff --git a/ica/win32/src/translate.cpp b/ica/win32/src/translate.cpp
deleted file mode 100644
index 0876d6f..0000000
--- a/ica/win32/src/translate.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * translate.c - translate between different pixel formats
- */
-
-/*
- *  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 "stdhdrs.h"
-
-#include "translate.h"
-#include <stdio.h>
-#include "rfb.h"
-
-#define CONCAT2(a,b) a##b
-#define CONCAT2E(a,b) CONCAT2(a,b)
-#define CONCAT4(a,b,c,d) a##b##c##d
-#define CONCAT4E(a,b,c,d) CONCAT4(a,b,c,d)
-
-#define OUTBPP 8
-#include "tableinittctemplate.cpp"
-#include "tableinitcmtemplate.cpp"
-#define INBPP 8
-#include "tabletranstemplate.cpp"
-#undef INBPP
-#define INBPP 16
-#include "tabletranstemplate.cpp"
-#undef INBPP
-#define INBPP 32
-#include "tabletranstemplate.cpp"
-#undef INBPP
-#undef OUTBPP
-
-#define OUTBPP 16
-#include "tableinittctemplate.cpp"
-#include "tableinitcmtemplate.cpp"
-#define INBPP 8
-#include "tabletranstemplate.cpp"
-#undef INBPP
-#define INBPP 16
-#include "tabletranstemplate.cpp"
-#undef INBPP
-#define INBPP 32
-#include "tabletranstemplate.cpp"
-#undef INBPP
-#undef OUTBPP
-
-#define OUTBPP 32
-#include "tableinittctemplate.cpp"
-#include "tableinitcmtemplate.cpp"
-#define INBPP 8
-#include "tabletranstemplate.cpp"
-#undef INBPP
-#define INBPP 16
-#include "tabletranstemplate.cpp"
-#undef INBPP
-#define INBPP 32
-#include "tabletranstemplate.cpp"
-#undef INBPP
-#undef OUTBPP
-
-rfbInitTableFnType rfbInitTrueColourSingleTableFns[3] = {
-    rfbInitTrueColourSingleTable8,
-    rfbInitTrueColourSingleTable16,
-    rfbInitTrueColourSingleTable32
-};
-
-rfbInitTableFnType rfbInitColourMapSingleTableFns[3] = {
-    rfbInitColourMapSingleTable8,
-    rfbInitColourMapSingleTable16,
-    rfbInitColourMapSingleTable32
-};
-
-rfbInitTableFnType rfbInitTrueColourRGBTablesFns[3] = {
-    rfbInitTrueColourRGBTables8,
-    rfbInitTrueColourRGBTables16,
-    rfbInitTrueColourRGBTables32
-};
-
-rfbTranslateFnType rfbTranslateWithSingleTableFns[3][3] = {
-    { rfbTranslateWithSingleTable8to8,
-      rfbTranslateWithSingleTable8to16,
-      rfbTranslateWithSingleTable8to32 },
-    { rfbTranslateWithSingleTable16to8,
-      rfbTranslateWithSingleTable16to16,
-      rfbTranslateWithSingleTable16to32 },
-    { rfbTranslateWithSingleTable32to8,
-      rfbTranslateWithSingleTable32to16,
-      rfbTranslateWithSingleTable32to32 }
-};
-
-rfbTranslateFnType rfbTranslateWithRGBTablesFns[3][3] = {
-    { rfbTranslateWithRGBTables8to8,
-      rfbTranslateWithRGBTables8to16,
-      rfbTranslateWithRGBTables8to32 },
-    { rfbTranslateWithRGBTables16to8,
-      rfbTranslateWithRGBTables16to16,
-      rfbTranslateWithRGBTables16to32 },
-    { rfbTranslateWithRGBTables32to8,
-      rfbTranslateWithRGBTables32to16,
-      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--;
-    }
-}
-
diff --git a/ica/win32/src/translate.h b/ica/win32/src/translate.h
deleted file mode 100644
index 80dd36e..0000000
--- a/ica/win32/src/translate.h
+++ /dev/null
@@ -1,81 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-/* translate.h - prototypes of functions in translate.cpp */
-
-#ifndef TRANSLATE_H__
-#define TRANSLATE_H__
-
-#include "stdhdrs.h"
-#include "rfb.h"
-
-// Translate function prototype!
-typedef void (*rfbTranslateFnType)(char *table, rfbPixelFormat *in,
-				   rfbPixelFormat *out,
-				   char *iptr, char *optr,
-				   int bytesBetweenInputLines,
-				   int width, int height);
-
-// Init function prototype!
-typedef void (*rfbInitTableFnType)(char **table, rfbPixelFormat *in,
-				   rfbPixelFormat *out);
-
-
-// External translation stuff
-extern void rfbTranslateNone(char *table, rfbPixelFormat *in,
-			     rfbPixelFormat *out,
-			     char *iptr, char *optr,
-			     int bytesBetweenInputLines,
-			     int width, int height);
-
-// Macro to compare pixel formats.
-#define PF_EQ(x,y)												\
-	((x.bitsPerPixel == y.bitsPerPixel) &&						\
-	 (x.depth == y.depth) &&									\
-	 (x.trueColour == y.trueColour) &&							\
-	 ((x.bigEndian == y.bigEndian) || (x.bitsPerPixel == 8)) &&	\
-	 (!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))))
-
-// Translation functions themselves
-extern rfbInitTableFnType rfbInitTrueColourSingleTableFns[];
-extern rfbInitTableFnType rfbInitColourMapSingleTableFns[];
-extern rfbInitTableFnType rfbInitTrueColourRGBTablesFns[];
-extern rfbTranslateFnType rfbTranslateWithSingleTableFns[3][3];
-extern rfbTranslateFnType rfbTranslateWithRGBTablesFns[3][3];
-
-/*
-extern Bool rfbSetTranslateFunction(rfbClientPtr cl);
-extern void rfbSetClientColourMaps(int firstColour, int nColours);
-extern Bool rfbSetClientColourMap(rfbClientPtr cl, int firstColour,
-				  int nColours);
-*/
-
-#endif
diff --git a/ica/win32/src/vncBuffer.cpp b/ica/win32/src/vncBuffer.cpp
deleted file mode 100644
index e9e4b53..0000000
--- a/ica/win32/src/vncBuffer.cpp
+++ /dev/null
@@ -1,533 +0,0 @@
-//  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 file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// ScrBuffer implementation
-
-#include "stdhdrs.h"
-
-// Header
-
-#include "vncDesktop.h"
-#include "vncEncoder.h"
-#include "vncEncodeRRE.h"
-#include "vncEncodeCoRRE.h"
-#include "vncEncodeHexT.h"
-#include "vncEncodeZlib.h"
-#include "vncEncodeTight.h"
-#include "vncEncodeZlibHex.h"
-#include "MinMax.h"
-
-#include "vncBuffer.h"
-
-// Implementation
-
-vncBuffer::vncBuffer(vncDesktop *desktop)
-{
-	m_desktop = desktop;
-	m_encoder = NULL;
-	zlib_encoder_in_use = false;
-	m_hold_zlib_encoder = NULL;
-	tight_encoder_in_use = false;
-	m_hold_tight_encoder = NULL;
-	zlibhex_encoder_in_use = false;
-	m_hold_zlibhex_encoder = NULL;
-
-	m_compresslevel = 6;
-	m_qualitylevel = -1;
-	m_use_xcursor = FALSE;
-	m_use_richcursor = FALSE;
-	m_use_lastrect = FALSE;
-
-	m_hcursor = NULL;
-
-	m_mainbuff = NULL;
-	m_mainsize = 0;
-	
-	m_clientbuff = NULL;
-	m_clientbuffsize = 0;
-	m_clientfmtset = FALSE;
-
-	// Initialise the screen buffers
-	CheckBuffer();
-}
-
-vncBuffer::~vncBuffer()
-{
-
-
-	if (m_hold_zlib_encoder != NULL && m_hold_zlib_encoder != m_encoder) {
-		m_hold_zlib_encoder->LogStats();
-		delete m_hold_zlib_encoder;
-		m_hold_zlib_encoder = NULL;
-	}
-	if (m_hold_tight_encoder != NULL && m_hold_tight_encoder != m_encoder) {
-		m_hold_tight_encoder->LogStats();
-		delete m_hold_tight_encoder;
-		m_hold_tight_encoder = NULL;
-	}
-	if (m_hold_zlibhex_encoder != NULL && m_hold_zlibhex_encoder != m_encoder) {
-		m_hold_zlibhex_encoder->LogStats();
-		delete m_hold_zlibhex_encoder;
-		m_hold_zlibhex_encoder = NULL;
-	}
-	if (m_encoder != NULL) {
-		m_encoder->LogStats();
-		delete m_encoder;
-		m_encoder = NULL;
-		m_hold_zlib_encoder = NULL;
-		m_hold_tight_encoder = NULL;
-		m_hold_zlibhex_encoder = NULL;
-	}
-	if (m_clientbuff != NULL) {
-		delete m_clientbuff;
-		m_clientbuff = NULL;
-	}
-	m_clientbuffsize = 0;
-	m_mainsize = 0;
-}
-
-RECT
-vncBuffer::GetSize()
-{
-	RECT rect;
-
-	rect.left = 0;
-	rect.top = 0;
-	rect.right = m_scrinfo.framebufferWidth;
-	rect.bottom = m_scrinfo.framebufferHeight;
-
-	return rect;
-}
-
-rfbPixelFormat
-vncBuffer::GetLocalFormat()
-{
-	return m_scrinfo.format;
-}
-
-BYTE *
-vncBuffer::GetClientBuffer()
-{
-	return m_clientbuff;
-}
-
-BOOL
-vncBuffer::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours)
-{
-	// Try to get the RGBQUAD data from the encoder
-	// This will only work if the remote client is palette-based,
-	// in which case the encoder will be storing RGBQUAD data
-	if (m_encoder == NULL)
-	{
-		vnclog.Print(LL_INTWARN, VNCLOG("GetRemotePalette called but no encoder set\n"));
-		return FALSE;
-	}
-
-	// Now get the palette data
-	return m_encoder->GetRemotePalette(quadlist, ncolours);
-}
-
-BOOL
-vncBuffer::CheckBuffer()
-{
-	// Get the screen format, in case it has changed
-	m_desktop->FillDisplayInfo(&m_scrinfo);
-
-	// If the client has not specified a pixel format then set one for it
-	if (!m_clientfmtset) {
-	    m_clientfmtset = TRUE;
-	    m_clientformat = m_scrinfo.format;
-	}
-
-	// If the client has not selected an encoding then set one for it
-	if (m_encoder == NULL) {
-	    if (!SetEncoding(rfbEncodingRaw))
-		return FALSE;
-	}
-
-	m_bytesPerRow = m_scrinfo.framebufferWidth * m_scrinfo.format.bitsPerPixel/8;
-
-	// Check the client buffer is sufficient
-	const UINT clientbuffsize =
-	    m_encoder->RequiredBuffSize(m_scrinfo.framebufferWidth,
-					m_scrinfo.framebufferHeight);
-	if (m_clientbuffsize != clientbuffsize)
-	{
-	    if (m_clientbuff != NULL)
-	    {
-		delete [] m_clientbuff;
-		m_clientbuff = NULL;
-	    }
-	    m_clientbuffsize = 0;
-
-	    m_clientbuff = new BYTE [clientbuffsize];
-	    if (m_clientbuff == NULL)
-	    {		
-		vnclog.Print(LL_INTERR, VNCLOG("unable to allocate client buffer[%d]\n"), clientbuffsize);
-		return FALSE;
-	    }
-
-	    m_clientbuffsize = clientbuffsize;
-
-	    ZeroMemory(m_clientbuff, m_clientbuffsize);
-	}
-
-	// Take the main buffer pointer and size from vncDesktop 
-	m_mainbuff = m_desktop->MainBuffer();
-	m_mainrect = m_desktop->MainBufferRect();
-	m_mainsize = m_desktop->ScreenBuffSize();
-		
-	vnclog.Print(LL_INTINFO, VNCLOG("local buffer=%d, remote buffer=%d\n"), m_mainsize, m_clientbuffsize);
-
-	return TRUE;
-}
-
-
-
-
-UINT
-vncBuffer::GetNumCodedRects(RECT &rect)
-{
-	// Ask the encoder how many rectangles this update would become
-	return m_encoder->NumCodedRects(rect);
-}
-
-RECT vncBuffer::GrabMouse()
-{
-// capture uncovered area
-	m_desktop->CaptureScreen(m_desktop->MouseRect(), m_mainbuff);
-// capture new mouse area
-	m_desktop->CaptureMouse(m_mainbuff, m_mainsize);
-
-	return m_desktop->MouseRect();
-}
-
-BOOL
-vncBuffer::SetClientFormat(rfbPixelFormat &format)
-{
-	vnclog.Print(LL_INTINFO, VNCLOG("SetClientFormat called\n"));
-	
-	// Save the desired format
-	m_clientfmtset = TRUE;
-	m_clientformat = format;
-
-	// Tell the encoder of the new format
-	if (m_encoder != NULL)
-		m_encoder->SetRemoteFormat(format);
-
-	// Check that the output buffer is sufficient
-	if (!CheckBuffer())
-		return FALSE;
-
-	return TRUE;
-}
-
-BOOL
-vncBuffer::SetEncoding(CARD32 encoding)
-{
-	//m_desktop->FillDisplayInfo(&m_scrinfo);
-
-	// Delete the old encoder
-	if (m_encoder != NULL)
-	{
-		// If a Zlib-like encoders were in use, save corresponding object
-		// (with dictionaries) for possible later use on this connection.
-		if ( zlib_encoder_in_use )
-		{
-			m_hold_zlib_encoder = m_encoder;
-		}
-		else if ( tight_encoder_in_use )
-		{
-			m_hold_tight_encoder = m_encoder;
-		}
-		else if ( zlibhex_encoder_in_use )
-		{
-			m_hold_zlibhex_encoder = m_encoder;
-		}
-		else
-		{
-			m_encoder->LogStats();
-			delete m_encoder;
-		}
-		m_encoder = NULL;
-	}
-
-	// Expect to not use the zlib encoder below.  However, this
-	// is overriden if zlib was selected.
-	zlib_encoder_in_use = false;
-	tight_encoder_in_use = false;
-	zlibhex_encoder_in_use = false;
-
-	// Returns FALSE if the desired encoding cannot be used
-	switch(encoding)
-	{
-
-	case rfbEncodingRaw:
-
-		vnclog.Print(LL_INTINFO, VNCLOG("raw encoder requested\n"));
-
-		// Create a RAW encoder
-		m_encoder = new vncEncoder;
-		if (m_encoder == NULL)
-			return FALSE;
-		break;
-
-	case rfbEncodingRRE:
-
-		vnclog.Print(LL_INTINFO, VNCLOG("RRE encoder requested\n"));
-
-		// Create a RRE encoder
-		m_encoder = new vncEncodeRRE;
-		if (m_encoder == NULL)
-			return FALSE;
-		break;
-
-	case rfbEncodingCoRRE:
-
-		vnclog.Print(LL_INTINFO, VNCLOG("CoRRE encoder requested\n"));
-
-		// Create a CoRRE encoder
-		m_encoder = new vncEncodeCoRRE;
-		if (m_encoder == NULL)
-			return FALSE;
-		break;
-
-	case rfbEncodingHextile:
-
-		vnclog.Print(LL_INTINFO, VNCLOG("Hextile encoder requested\n"));
-
-		// Create a Hextile encoder
-		m_encoder = new vncEncodeHexT;
-		if (m_encoder == NULL)
-			return FALSE;
-		break;
-
-#if 0
-	case rfbEncodingZlib:
-
-		vnclog.Print(LL_INTINFO, VNCLOG("Zlib encoder requested\n"));
-
-		// Create a Zlib encoder, if needed.
-		// If a Zlib encoder was used previously, then reuse it here
-		// to maintain zlib dictionary synchronization with the viewer.
-		if ( m_hold_zlib_encoder == NULL )
-		{
-			m_encoder = new vncEncodeZlib;
-		}
-		else
-		{
-			m_encoder = m_hold_zlib_encoder;
-		}
-		if (m_encoder == NULL)
-			return FALSE;
-		zlib_encoder_in_use = true;
-		break;
-#endif
-
-	case rfbEncodingTight:
-
-		vnclog.Print(LL_INTINFO, VNCLOG("Tight encoder requested\n"));
-
-		// Create a Tight encoder, if needed.
-		// If a Tight encoder was used previously, then reuse it here
-		// to maintain zlib dictionaries synchronization with the viewer.
-		if ( m_hold_tight_encoder == NULL )
-		{
-			m_encoder = new vncEncodeTight;
-		}
-		else
-		{
-			m_encoder = m_hold_tight_encoder;
-		}
-		if (m_encoder == NULL)
-			return FALSE;
-		tight_encoder_in_use = true;
-		break;
-
-#if 0
-	case rfbEncodingZlibHex:
-
-		vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex encoder requested\n"));
-
-		// Create a ZlibHex encoder, if needed.
-		// If a ZlibHex encoder was used previously, then reuse it here
-		// to maintain zlib dictionary synchronization with the viewer.
-		if ( m_hold_zlibhex_encoder == NULL )
-		{
-			m_encoder = new vncEncodeZlibHex;
-		}
-		else
-		{
-			m_encoder = m_hold_zlibhex_encoder;
-		}
-		if (m_encoder == NULL)
-			return FALSE;
-		zlibhex_encoder_in_use = true;
-		break;
-#endif
-
-	default:
-		// An unknown encoding was specified
-		vnclog.Print(LL_INTERR, VNCLOG("unknown encoder requested\n"));
-
-		return FALSE;
-	}
-
-	// Initialise it and give it the pixel format
-	m_encoder->Init();
-	m_encoder->SetLocalFormat(
-			m_scrinfo.format,
-			m_scrinfo.framebufferWidth,
-			m_scrinfo.framebufferHeight);
-
-	// Duplicate our member fields in new Encoder.
-	m_encoder->SetCompressLevel(m_compresslevel);
-	m_encoder->SetQualityLevel(m_qualitylevel);
-	m_encoder->EnableXCursor(m_use_xcursor);
-	m_encoder->EnableRichCursor(m_use_richcursor);
-	m_encoder->EnableLastRect(m_use_lastrect);
-
-	if (m_clientfmtset)
-		if (!m_encoder->SetRemoteFormat(m_clientformat))
-		{
-			vnclog.Print(LL_INTERR, VNCLOG("client pixel format is not supported\n"));
-
-			return FALSE;
-		}
-
-	// Check that the client buffer is compatible
-	return CheckBuffer();
-}
-
-void
-vncBuffer::SetCompressLevel(int level)
-{
-	m_compresslevel = (level >= 0 && level <= 9) ? level : 6;
-	if (m_encoder != NULL)
-		m_encoder->SetCompressLevel(m_compresslevel);
-}
-
-void
-vncBuffer::SetQualityLevel(int level)
-{
-	m_qualitylevel = (level >= 0 && level <= 9) ? level : -1;
-	if (m_encoder != NULL)
-		m_encoder->SetQualityLevel(m_qualitylevel);
-}
-
-void
-vncBuffer::EnableXCursor(BOOL enable)
-{
-	m_use_xcursor = enable;
-	if (m_encoder != NULL) {
-		m_encoder->EnableXCursor(enable);
-	}
-	m_hcursor = NULL;
-}
-
-void
-vncBuffer::EnableRichCursor(BOOL enable)
-{
-	m_use_richcursor = enable;
-	if (m_encoder != NULL) {
-		m_encoder->EnableRichCursor(enable);
-	}
-	m_hcursor = NULL;
-}
-
-void
-vncBuffer::EnableLastRect(BOOL enable)
-{
-	m_use_lastrect = enable;
-	if (m_encoder != NULL) {
-		m_encoder->EnableLastRect(enable);
-	}
-}
-
-
-// Routine to translate a rectangle between pixel formats
-// semantics changed:
-// offset now is the shared area origin in screen coordinates
-UINT vncBuffer::TranslateRect(
-		const RECT &rect,
-		VSocket *outConn,
-		int shared_org_x,
-		int shared_org_y)
-{
-	// Call the encoder to encode the rectangle into the client buffer...
-
-// Translate (==> EncodeRect also) assumes mainbuff-relative coordinates
-// so we need to adjust the rect.
-// also, presentation (fb) rect is required.
-	RECT ar;
-	ar.left = rect.left - m_mainrect.left;
-	ar.top = rect.top -  m_mainrect.top;
-	ar.right = rect.right - m_mainrect.left;
-	ar.bottom = rect.bottom - m_mainrect.top;
-
-	return m_encoder->EncodeRect(
-		m_mainbuff,
-		outConn,
-		m_clientbuff,
-		ar,
-		shared_org_x - m_mainrect.left,
-		shared_org_y - m_mainrect.top);
-}
-
-// Check if cursor shape update should be sent
-BOOL
-vncBuffer::IsCursorUpdatePending()
-{
-	if (m_use_xcursor || m_use_richcursor) {
-		HCURSOR temp_hcursor = m_desktop->GetCursor();
-		if (temp_hcursor != m_hcursor) {
-			m_hcursor = temp_hcursor;
-			return TRUE;
-		}
-	}
-	return FALSE;
-}
-
-BOOL
-vncBuffer::SendCursorShape(VSocket *outConn) {
-	return m_encoder->SendCursorShape(outConn, m_desktop);
-}
-
-BOOL
-vncBuffer::SendEmptyCursorShape(VSocket *outConn) {
-	return m_encoder->SendEmptyCursorShape(outConn);
-}
-
-void
-vncBuffer::UpdateLocalFormat() {
-	CheckBuffer();
-	m_encoder->SetLocalFormat(
-			m_scrinfo.format,
-			m_scrinfo.framebufferWidth,
-			m_scrinfo.framebufferHeight);
-}
diff --git a/ica/win32/src/vncBuffer.h b/ica/win32/src/vncBuffer.h
deleted file mode 100644
index bcb41e3..0000000
--- a/ica/win32/src/vncBuffer.h
+++ /dev/null
@@ -1,135 +0,0 @@
-//  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 file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-// vncBuffer object
-
-// The vncBuffer object provides a client-local copy of the screen
-// It can tell the client which bits have changed in a given region
-// It uses the specified vncDesktop to read screen data from
-
-class vncBuffer;
-
-#if !defined(_WINVNC_VNCBUFFER)
-#define _WINVNC_VNCBUFFER
-#pragma once
-
-// Includes
-
-#include "vncDesktop.h"
-#include "vncEncoder.h"
-#include "vncRegion.h"
-#include "RectList.h"
-
-// Class definition
-
-class vncBuffer
-{
-// Methods
-public:
-	// Create/Destroy methods
-	vncBuffer(vncDesktop *desktop);
-	~vncBuffer();
-
-	// BUFFER INFO
-	RECT GetSize();
-	rfbPixelFormat GetLocalFormat();
-	BYTE *GetClientBuffer();
-	BOOL GetRemotePalette(RGBQUAD *quadbuff, UINT ncolours);
-
-	// BUFFER MANIPULATION
-	BOOL CheckBuffer();
-
-	// SCREEN SCANNING
-	UINT GetNumCodedRects(RECT &rect);
-
-	// SCREEN CAPTURE
-	RECT GrabMouse();
-	BOOL SetClientFormat(rfbPixelFormat &format);
-
-	// CONFIGURING ENCODER
-	void SetCompressLevel(int level);
-	void SetQualityLevel(int level);
-	void EnableXCursor(BOOL enable);
-	void EnableRichCursor(BOOL enable);
-	void EnableLastRect(BOOL enable);
-	BOOL IsLastRectEnabled() { return m_use_lastrect; }
-
-	// ENCODING
-	BOOL SetEncoding(CARD32 encoding);
-
-// semantics changed: offset now is the shared area origin
-// in screen coordinates
-	UINT TranslateRect(const RECT &rect, VSocket *outConn, int shared_org_x, int shared_org_y);
-
-	// SENDING CURSOR SHAPE UPDATES
-	BOOL IsCursorUpdatePending();
-	BOOL SendCursorShape(VSocket *outConn);
-	BOOL SendEmptyCursorShape(VSocket *outConn);
-	void UpdateLocalFormat();
-
-// Implementation
-protected:
-
-	// Routine to verify the mainbuff handle hasn't changed
-	//inline BOOL FastCheckMainbuffer();
-	
-	BYTE		*m_mainbuff;
-	RECT		m_mainrect;
-	UINT		m_mainsize;
-
-	BYTE		*m_clientbuff;
-	UINT		m_clientbuffsize;
-	BOOL		m_clientfmtset;
-
-	UINT		m_bytesPerRow;
-
-	rfbServerInitMsg	m_scrinfo;
-	rfbPixelFormat		m_clientformat;
-	rfbTranslateFnType	m_transfunc;
-
-	vncDesktop	   *m_desktop;
-	vncEncoder	   *m_encoder;
-	bool           zlib_encoder_in_use;
-	vncEncoder     *m_hold_zlib_encoder;
-	bool           tight_encoder_in_use;
-	vncEncoder     *m_hold_tight_encoder;
-	bool           zlibhex_encoder_in_use;
-	vncEncoder     *m_hold_zlibhex_encoder;
-
-	// These variables mirror similar variables from vncEncoder class.
-	// They are necessary because vncEncoder instance may be created after
-	// their values were set.
-	int				m_compresslevel;
-	int				m_qualitylevel;
-	BOOL			m_use_xcursor;
-	BOOL			m_use_richcursor;
-	BOOL			m_use_lastrect;
-
-	HCURSOR			m_hcursor;		// Used to track cursor shape changes
-};
-
-#endif // _WINVNC_VNCBUFFER
diff --git a/ica/win32/src/vncClient.cpp b/ica/win32/src/vncClient.cpp
deleted file mode 100644
index da67863..0000000
--- a/ica/win32/src/vncClient.cpp
+++ /dev/null
@@ -1,2565 +0,0 @@
-//  Copyright (C) 2001-2006 Constantin Kaplinsky. All Rights Reserved.
-//  Copyright (C) 2002 Vladimir Vologzhanin. All Rights Reserved.
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncClient.cpp
-
-// The per-client object.  This object takes care of all per-client stuff,
-// such as socket input and buffering of updates.
-
-// vncClient class handles the following functions:
-// - Recieves requests from the connected client and
-//   handles them
-// - Handles incoming updates properly, using a vncBuffer
-//   object to keep track of screen changes
-// It uses a vncBuffer and is passed the vncDesktop and
-// vncServer to communicate with.
-
-// Includes
-#include "stdhdrs.h"
-#include <omnithread.h>
-#include "resource.h"
-
-// Custom
-#include "vncClient.h"
-#include "VSocket.h"
-#include "vncDesktop.h"
-#include "vncRegion.h"
-#include "vncBuffer.h"
-#include "vncService.h"
-#include "vncPasswd.h"
-#include "vncAcceptDialog.h"
-#include "vncKeymap.h"
-#include <windows.h>
-extern "C" {
-#include "d3des.h"
-}
-
-#include "FileTransferItemInfo.h"
-#include "vncMenu.h"
-
-//
-// Normally, using macros is no good, but this macro saves us from
-// writing constants twice -- it constructs signature names from codes.
-// Note that "code_sym" argument should be a single symbol, not an expression.
-//
-
-#define SetCapInfo(cap_ptr, code_sym, vendor)			\
-{														\
-	rfbCapabilityInfo *pcap = (cap_ptr);				\
-	pcap->code = Swap32IfLE(code_sym);					\
-	memcpy(pcap->vendorSignature, (vendor),				\
-	sz_rfbCapabilityInfoVendor);						\
-	memcpy(pcap->nameSignature, sig_##code_sym,			\
-	sz_rfbCapabilityInfoName);							\
-}
-
-// vncClient thread class
-
-class vncClientThread : public omni_thread
-{
-public:
-	char * ConvertPath(char *path);
-
-	// Init
-	virtual BOOL Init(vncClient *client,
-					  vncServer *server,
-					  VSocket *socket,
-					  BOOL reverse,
-					  BOOL shared);
-
-	// Sub-Init routines
-	virtual BOOL InitVersion();
-	virtual BOOL InitAuthenticate();
-	virtual int GetAuthenticationType();
-	virtual void SendConnFailedMessage(const char *reasonString);
-	virtual BOOL SendTextStringMessage(const char *str);
-	virtual BOOL NegotiateTunneling();
-	virtual BOOL NegotiateAuthentication(int authType);
-	virtual BOOL AuthenticateNone();
-	virtual BOOL AuthenticateVNC();
-	virtual BOOL ReadClientInit();
-	virtual BOOL SendInteractionCaps();
-
-	// The main thread function
-	virtual void run(void *arg);
-
-protected:
-	virtual ~vncClientThread();
-
-	// Fields
-protected:
-	VSocket *m_socket;
-	vncServer *m_server;
-	vncClient *m_client;
-	BOOL m_reverse;
-	BOOL m_shared;
-};
-
-vncClientThread::~vncClientThread()
-{
-	// If we have a client object then delete it
-	if (m_client != NULL)
-		delete m_client;
-}
-
-BOOL
-vncClientThread::Init(vncClient *client, vncServer *server, VSocket *socket, BOOL reverse, BOOL shared)
-{
-	// Save the server pointer and window handle
-	m_server = server;
-	m_socket = socket;
-	m_client = client;
-	m_reverse = reverse;
-	m_shared = shared;
-
-	// Start the thread
-	start();
-
-	return TRUE;
-}
-
-BOOL
-vncClientThread::InitVersion()
-{
-	// Generate the server's protocol version
-	rfbProtocolVersionMsg protocolMsg;
-	sprintf((char *)protocolMsg, rfbProtocolVersionFormat, 3, 8);
-
-	// Send the protocol message
-	if (!m_socket->SendExact((char *)&protocolMsg, sz_rfbProtocolVersionMsg))
-		return FALSE;
-
-	// Now, get the client's protocol version
-	rfbProtocolVersionMsg protocol_ver;
-	protocol_ver[12] = 0;
-	if (!m_socket->ReadExact((char *)&protocol_ver, sz_rfbProtocolVersionMsg))
-		return FALSE;
-
-	// Check the protocol version
-	int major, minor;
-	sscanf((char *)&protocol_ver, rfbProtocolVersionFormat, &major, &minor);
-	if (major != 3) {
-		vnclog.Print(LL_CONNERR, VNCLOG("unsupported protocol version %d.%d\n"),
-					 major, minor);
-		return FALSE;
-	}
-	int effective_minor = minor;
-	if (minor > 8) {						// buggy client
-		effective_minor = 8;
-	} else if (minor > 3 && minor < 7) {	// non-standard client
-		effective_minor = 3;
-	} else if (minor < 3) {					// ancient client
-		effective_minor = 3;
-	}
-	if (effective_minor != minor) {
-		vnclog.Print(LL_CONNERR,
-					 VNCLOG("non-standard protocol version 3.%d, using 3.%d instead\n"),
-					 minor, effective_minor);
-	}
-
-	// Save the minor number of the protocol version
-	m_client->m_protocol_minor_version = effective_minor;
-
-	// TightVNC protocol extensions are not enabled yet
-	m_client->m_protocol_tightvnc = FALSE;
-
-	vnclog.Print(LL_INTINFO, VNCLOG("negotiated protocol version, RFB 3.%d\n"),
-				 effective_minor);
-	return TRUE;
-}
-
-BOOL
-vncClientThread::InitAuthenticate()
-{
-	int secType = GetAuthenticationType();
-	if (secType == rfbSecTypeInvalid)
-		return FALSE;
-
-	if (m_client->m_protocol_minor_version >= 7) {
- 		CARD8 list[2];
- 		list[0] = (CARD8)1;					// number of security types
- 		list[1] = (CARD8)rfbSecTypeItalc;			// primary security type
-		if (!m_socket->SendExact((char *)list, sizeof(list)))
-			return FALSE;
-		CARD8 type;
-		if (!m_socket->ReadExact((char *)&type, sizeof(type)))
-			return FALSE;
- 		if( type == rfbSecTypeItalc )
- 		{
- 			return( isdServer::authSecTypeItalc( vsocketDispatcher,
- 							m_socket,
- 							ItalcAuthDSA ) );
- 		}
- 		return( FALSE );
-#if 0
-		if (type == (CARD8)rfbSecTypeTight) {
-			vnclog.Print(LL_INTINFO, VNCLOG("enabling TightVNC protocol extensions\n"));
-			m_client->m_protocol_tightvnc = TRUE;
-			if (!NegotiateTunneling())
-				return FALSE;
-			if (!NegotiateAuthentication(secType))
-				return FALSE;
-		} else if (type != (CARD8)secType) {
-			vnclog.Print(LL_CONNERR, VNCLOG("incorrect security type requested\n"));
-			return FALSE;
-		}
-#endif
-	} else {
-		CARD32 authValue = Swap32IfLE(secType);
-		if (!m_socket->SendExact((char *)&authValue, sizeof(authValue)))
-			return FALSE;
-	}
-
-	switch (secType) {
-	case rfbSecTypeNone:
-		vnclog.Print(LL_CLIENTS, VNCLOG("no authentication necessary\n"));
-		return AuthenticateNone();
-	case rfbSecTypeVncAuth:
-		vnclog.Print(LL_CLIENTS, VNCLOG("performing VNC authentication\n"));
-		return AuthenticateVNC();
-	}
-
-	return FALSE;	// should not happen but just in case...
-}
-
-int
-vncClientThread::GetAuthenticationType()
-{
-#if 0
-	if (!m_reverse && !m_server->ValidPasswordsSet())
-	{
-		vnclog.Print(LL_CONNERR,
-					 VNCLOG("no password specified for server - client rejected\n"));
-
-		// Send an error message to the client
-		SendConnFailedMessage("This server does not have a valid password enabled. "
-							  "Until a password is set, incoming connections cannot "
-							  "be accepted.");
-		return rfbSecTypeInvalid;
-	}
-
-	// By default we filter out local loop connections, because they're pointless
-	if (!m_server->LoopbackOk())
-	{
-		char *localname = strdup(m_socket->GetSockName());
-		char *remotename = strdup(m_socket->GetPeerName());
-
-		// Check that the local & remote names are different!
-		if (localname != NULL && remotename != NULL) {
-			BOOL ok = strcmp(localname, remotename) != 0;
-
-// FIXME: conceivable memory leak
-			free(localname);
-			free(remotename);
-
-			if (!ok) {
-				vnclog.Print(LL_CONNERR,
-							 VNCLOG("loopback connection attempted - client rejected\n"));
-
-				// Send an error message to the client
-				SendConnFailedMessage("Local loop-back connections are disabled.");
-				return rfbSecTypeInvalid;
-			}
-		}
-	}
-
-	// Verify the peer host name against the AuthHosts string
-	vncServer::AcceptQueryReject verified;
-	if (m_reverse) {
-		verified = vncServer::aqrAccept;
-	} else {
-		verified = m_server->VerifyHost(m_socket->GetPeerName());
-	}
-
-	// If necessary, query the connection with a timed dialog
-	verified = vncServer::aqrAccept;
-	BOOL skip_auth = FALSE;
-	if (verified == vncServer::aqrQuery) {
-		vncAcceptDialog *acceptDlg =
-			new vncAcceptDialog(m_server->QueryTimeout(),
-								m_server->QueryAccept(),
-								m_server->QueryAllowNoPass(),
-								m_socket->GetPeerName());
-		if (acceptDlg == NULL) {
-			if (m_server->QueryAccept()) {
-				verified = vncServer::aqrAccept;
-			} else {
-				verified = vncServer::aqrReject;
-			}
-		} else {
-			int action = acceptDlg->DoDialog();
-			if (action > 0) {
-				verified = vncServer::aqrAccept;
-				if (action == 2)
-					skip_auth = TRUE;	// accept without authentication
-			} else {
-				verified = vncServer::aqrReject;
-			}
-			delete acceptDlg;
-		}
-	}
-
-	// The connection should be rejected, either due to AuthHosts settings,
-	// or because of the "Reject" action performed in the query dialog
-	if (verified == vncServer::aqrReject) {
-		vnclog.Print(LL_CONNERR, VNCLOG("Client connection rejected\n"));
-		SendConnFailedMessage("Your connection has been rejected.");
-		return rfbSecTypeInvalid;
-	}
-
-	// Return preferred authentication type
-	if (m_reverse || skip_auth || m_server->ValidPasswordsEmpty()) {
-		return rfbSecTypeNone;
-	} else {
-		return rfbSecTypeVncAuth;
-	}
-#endif
-	return rfbSecTypeItalc;
-}
-
-//
-// Send a "connection failed" message.
-//
-
-void
-vncClientThread::SendConnFailedMessage(const char *reasonString)
-{
-	if (m_client->m_protocol_minor_version >= 7) {
-		CARD8 zeroCount = 0;
-		if (!m_socket->SendExact((char *)&zeroCount, sizeof(zeroCount)))
-			return;
-	} else {
-		CARD32 authValue = Swap32IfLE(rfbSecTypeInvalid);
-		if (!m_socket->SendExact((char *)&authValue, sizeof(authValue)))
-			return;
-	}
-	SendTextStringMessage(reasonString);
-}
-
-//
-// Send a text message preceded with a length counter.
-//
-
-BOOL
-vncClientThread::SendTextStringMessage(const char *str)
-{
-	CARD32 len = Swap32IfLE(strlen(str));
-	if (!m_socket->SendExact((char *)&len, sizeof(len)))
-		return FALSE;
-	if (!m_socket->SendExact(str, strlen(str)))
-		return FALSE;
-
-	return TRUE;
-}
-
-//
-// Negotiate tunneling type (protocol versions 3.7t, 3.8t).
-//
-
-BOOL
-vncClientThread::NegotiateTunneling()
-{
-	int nTypes = 0;
-
-	// Advertise our tunneling capabilities (currently, nothing to advertise).
-	rfbTunnelingCapsMsg caps;
-	caps.nTunnelTypes = Swap32IfLE(nTypes);
-	return m_socket->SendExact((char *)&caps, sz_rfbTunnelingCapsMsg);
-
-	// Read tunneling type requested by the client (currently, not necessary).
-	if (nTypes) {
-		CARD32 tunnelType;
-		if (!m_socket->ReadExact((char *)&tunnelType, sizeof(tunnelType)))
-			return FALSE;
-		tunnelType = Swap32IfLE(tunnelType);
-		// We cannot do tunneling yet.
-		vnclog.Print(LL_CONNERR, VNCLOG("unsupported tunneling type requested\n"));
-		return FALSE;
-	}
-
-	vnclog.Print(LL_INTINFO, VNCLOG("negotiated tunneling type\n"));
-	return TRUE;
-}
-
-//
-// Negotiate authentication scheme (protocol versions 3.7t, 3.8t).
-// NOTE: Here we always send en empty list for "no authentication".
-//
-
-BOOL
-vncClientThread::NegotiateAuthentication(int authType)
-{
-	int nTypes = 0;
-
-	if (authType == rfbAuthVNC) {
-		nTypes++;
-	} else if (authType != rfbAuthNone) {
-		vnclog.Print(LL_INTERR, VNCLOG("unknown authentication type\n"));
-		return FALSE;
-	}
-
-	rfbAuthenticationCapsMsg caps;
-	caps.nAuthTypes = Swap32IfLE(nTypes);
-	if (!m_socket->SendExact((char *)&caps, sz_rfbAuthenticationCapsMsg))
-		return FALSE;
-
-	if (authType == rfbAuthVNC) {
-		// Inform the client about supported authentication types.
-		rfbCapabilityInfo cap;
-		SetCapInfo(&cap, rfbAuthVNC, rfbStandardVendor);
-		if (!m_socket->SendExact((char *)&cap, sz_rfbCapabilityInfo))
-			return FALSE;
-
-		CARD32 type;
-		if (!m_socket->ReadExact((char *)&type, sizeof(type)))
-			return FALSE;
-		type = Swap32IfLE(type);
-		if ((int) type != authType) {
-			vnclog.Print(LL_CONNERR, VNCLOG("incorrect authentication type requested\n"));
-			return FALSE;
-		}
-	}
-
-	return TRUE;
-}
-
-//
-// Handle security type for "no authentication".
-//
-
-BOOL
-vncClientThread::AuthenticateNone()
-{
-	if (m_client->m_protocol_minor_version >= 8) {
-		CARD32 secResult = Swap32IfLE(rfbAuthOK);
-		if (!m_socket->SendExact((char *)&secResult, sizeof(secResult)))
-			return FALSE;
-	}
-	return TRUE;
-}
-
-//
-// Perform standard VNC authentication
-//
-
-BOOL
-vncClientThread::AuthenticateVNC()
-{
-	BOOL auth_ok = FALSE;
-
-	// Retrieve local passwords
-	char password[MAXPWLEN];
-	BOOL password_set = m_server->GetPassword(password);
-	vncPasswd::ToText plain(password);
-	BOOL password_viewonly_set = m_server->GetPasswordViewOnly(password);
-	vncPasswd::ToText plain_viewonly(password);
-
-	// Now create a 16-byte challenge
-	char challenge[16];
-	char challenge_viewonly[16];
-
-	vncRandomBytes((BYTE *)&challenge);
-	memcpy(challenge_viewonly, challenge, 16);
-
-	// Send the challenge to the client
-	if (!m_socket->SendExact(challenge, sizeof(challenge)))
-		return FALSE;
-
-	// Read the response
-	char response[16];
-	if (!m_socket->ReadExact(response, sizeof(response)))
-		return FALSE;
-
-	// Encrypt the challenge bytes
-	vncEncryptBytes((BYTE *)&challenge, plain);
-
-	// Compare them to the response
-	if (password_set && memcmp(challenge, response, sizeof(response)) == 0) {
-		auth_ok = TRUE;
-	} else {
-		// Check against the view-only password
-		vncEncryptBytes((BYTE *)&challenge_viewonly, plain_viewonly);
-		if (password_viewonly_set && memcmp(challenge_viewonly, response, sizeof(response)) == 0) {
-			m_client->EnablePointer(FALSE);
-			m_client->EnableKeyboard(FALSE);
-			auth_ok = TRUE;
-		}
-	}
-
-	// Did the authentication work?
-	CARD32 secResult;
-	if (!auth_ok) {
-		vnclog.Print(LL_CONNERR, VNCLOG("authentication failed\n"));
-
-		secResult = Swap32IfLE(rfbAuthFailed);
-		m_socket->SendExact((char *)&secResult, sizeof(secResult));
-		SendTextStringMessage("Authentication failed");
-		return FALSE;
-	} else {
-		// Tell the client we're ok
-		secResult = Swap32IfLE(rfbAuthOK);
-		if (!m_socket->SendExact((char *)&secResult, sizeof(secResult)))
-			return FALSE;
-	}
-
-	return TRUE;
-}
-
-//
-// Read client initialisation message
-//
-
-BOOL
-vncClientThread::ReadClientInit()
-{
-	// Read the client's initialisation message
-	rfbClientInitMsg client_ini;
-	if (!m_socket->ReadExact((char *)&client_ini, sz_rfbClientInitMsg))
-		return FALSE;
-
-	// If the client wishes to have exclusive access then remove other clients
-	if (!client_ini.shared && !m_shared)
-	{
-		// Which client takes priority, existing or incoming?
-		if (m_server->ConnectPriority() < 1) {
-			// Incoming
-			vnclog.Print(LL_INTINFO, VNCLOG("non-shared connection - disconnecting old clients\n"));
-			m_server->KillAuthClients();
-		} else if (m_server->ConnectPriority() > 1) {
-			// Existing
-			if (m_server->AuthClientCount() > 0) {
-				vnclog.Print(LL_CLIENTS, VNCLOG("connections already exist - client rejected\n"));
-				return FALSE;
-			}
-		}
-	}
-
-	// Tell the server that this client is ok
-	return m_server->Authenticated(m_client->GetClientId());
-}
-
-//
-// Advertise our messaging capabilities (protocol version 3.7+).
-//
-
-BOOL
-vncClientThread::SendInteractionCaps()
-{
-	// Update these constants on changing capability lists!
-	const int MAX_SMSG_CAPS = 4;
-	const int MAX_CMSG_CAPS = 6;
-	const int MAX_ENC_CAPS = 14;
-
-	int i;
-
-	// Supported server->client message types
-	rfbCapabilityInfo smsg_list[MAX_SMSG_CAPS];
-	i = 0;
-
-	if (m_server->FileTransfersEnabled() && m_client->IsInputEnabled()) {
-#if 0
-		SetCapInfo(&smsg_list[i++], rfbFileListData,       rfbTightVncVendor);
-		SetCapInfo(&smsg_list[i++], rfbFileDownloadData,   rfbTightVncVendor);
-		SetCapInfo(&smsg_list[i++], rfbFileUploadCancel,   rfbTightVncVendor);
-		SetCapInfo(&smsg_list[i++], rfbFileDownloadFailed, rfbTightVncVendor);
-#endif
-	}
-
-	int nServerMsgs = i;
-	if (nServerMsgs > MAX_SMSG_CAPS) {
-		vnclog.Print(LL_INTERR,
-					 VNCLOG("assertion failed, nServerMsgs > MAX_SMSG_CAPS\n"));
-		return FALSE;
-	}
-
-	// Supported client->server message types
-	rfbCapabilityInfo cmsg_list[MAX_CMSG_CAPS];
-	i = 0;
-
-	if (m_server->FileTransfersEnabled() && m_client->IsInputEnabled()) {
-#if 0
-		SetCapInfo(&cmsg_list[i++], rfbFileListRequest,    rfbTightVncVendor);
-		SetCapInfo(&cmsg_list[i++], rfbFileDownloadRequest,rfbTightVncVendor);
-		SetCapInfo(&cmsg_list[i++], rfbFileUploadRequest,  rfbTightVncVendor);
-		SetCapInfo(&cmsg_list[i++], rfbFileUploadData,     rfbTightVncVendor);
-		SetCapInfo(&cmsg_list[i++], rfbFileDownloadCancel, rfbTightVncVendor);
-		SetCapInfo(&cmsg_list[i++], rfbFileUploadFailed,   rfbTightVncVendor);
-#endif
-	}
-
-	int nClientMsgs = i;
-	if (nClientMsgs > MAX_CMSG_CAPS) {
-		vnclog.Print(LL_INTERR,
-					 VNCLOG("assertion failed, nClientMsgs > MAX_CMSG_CAPS\n"));
-		return FALSE;
-	}
-
-	// Encoding types
-	rfbCapabilityInfo enc_list[MAX_ENC_CAPS];
-	i = 0;
-	SetCapInfo(&enc_list[i++],  rfbEncodingCopyRect,       rfbStandardVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingRRE,            rfbStandardVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingCoRRE,          rfbStandardVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingHextile,        rfbStandardVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingZlib,           rfbTridiaVncVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingZlibHex,        rfbTridiaVncVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingTight,          rfbTightVncVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingCompressLevel0, rfbTightVncVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingQualityLevel0,  rfbTightVncVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingXCursor,        rfbTightVncVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingRichCursor,     rfbTightVncVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingPointerPos,     rfbTightVncVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingLastRect,       rfbTightVncVendor);
-	SetCapInfo(&enc_list[i++],  rfbEncodingNewFBSize,      rfbTightVncVendor);
-	int nEncodings = i;
-	if (nEncodings > MAX_ENC_CAPS) {
-		vnclog.Print(LL_INTERR,
-					 VNCLOG("assertion failed, nEncodings > MAX_ENC_CAPS\n"));
-		return FALSE;
-	}
-
-	// Create and send the header structure
-	rfbInteractionCapsMsg intr_caps;
-	intr_caps.nServerMessageTypes = Swap16IfLE(nServerMsgs);
-	intr_caps.nClientMessageTypes = Swap16IfLE(nClientMsgs);
-	intr_caps.nEncodingTypes = Swap16IfLE(nEncodings);
-	intr_caps.pad = 0;
-	if (!m_socket->SendExact((char *)&intr_caps, sz_rfbInteractionCapsMsg))
-		return FALSE;
-
-	// Send the capability lists
-	if (nServerMsgs &&
-		!m_socket->SendExact((char *)&smsg_list[0],
-		sz_rfbCapabilityInfo * nServerMsgs))
-		return FALSE;
-	if (nClientMsgs &&
-		!m_socket->SendExact((char *)&cmsg_list[0],
-		sz_rfbCapabilityInfo * nClientMsgs))
-		return FALSE;
-	if (nEncodings &&
-		!m_socket->SendExact((char *)&enc_list[0],
-		sz_rfbCapabilityInfo * nEncodings))
-		return FALSE;
-
-	return TRUE;
-}
-
-void
-ClearKeyState(BYTE key)
-{
-	// This routine is used by the VNC client handler to clear the
-	// CAPSLOCK, NUMLOCK and SCROLL-LOCK states.
-
-	BYTE keyState[256];
-
-	GetKeyboardState((LPBYTE)&keyState);
-
-	if(keyState[key] & 1)
-	{
-		// Simulate the key being pressed
-		keybd_event(key, 0, KEYEVENTF_EXTENDEDKEY, 0);
-
-		// Simulate it being release
-		keybd_event(key, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
-	}
-}
-
-void
-vncClientThread::run(void *arg)
-{
-	// All this thread does is go into a socket-recieve loop,
-	// waiting for stuff on the given socket
-
-	// IMPORTANT : ALWAYS call RemoveClient on the server before quitting
-	// this thread.
-
-	vnclog.Print(LL_CLIENTS, VNCLOG("client connected : %s (id %hd)\n"),
-				 m_client->GetClientName(), m_client->GetClientId());
-
-	// Save the handle to the thread's original desktop
-	HDESK home_desktop = GetThreadDesktop(GetCurrentThreadId());
-
-	// To avoid people connecting and then halting the connection, set a timeout
-	if (!m_socket->SetTimeout(30000))
-		vnclog.Print(LL_INTERR,
-					 VNCLOG("failed to set socket timeout, error=%d\n"),
-					 GetLastError());
-
-	// Initially blacklist the client so that excess connections from it get dropped
-	m_server->AddAuthHostsBlacklist(m_client->GetClientName());
-
-	// LOCK INITIAL SETUP
-	// All clients have the m_protocol_ready flag set to FALSE initially, to prevent
-	// updates and suchlike interfering with the initial protocol negotiations.
-
-	// GET PROTOCOL VERSION
-	if (!InitVersion()) {
-		m_server->RemoveClient(m_client->GetClientId());
-		return;
-	}
-
-	// AUTHENTICATE LINK
-	if (!InitAuthenticate()) {
-		m_server->RemoveClient(m_client->GetClientId());
-		return;
-	}
-
-	// READ CLIENT INITIALIZATION MESSAGE
-	if (!ReadClientInit()) {
-		m_server->RemoveClient(m_client->GetClientId());
-		return;
-	}
-
-	// Authenticated OK - remove from blacklist and remove timeout
-	m_server->RemAuthHostsBlacklist(m_client->GetClientName());
-	m_socket->SetTimeout(m_server->AutoIdleDisconnectTimeout()*1000);
-	vnclog.Print(LL_INTINFO, VNCLOG("authenticated connection\n"));
-
-	// INIT PIXEL FORMAT
-
-	// Get the screen format
-	m_client->m_fullscreen = m_client->m_buffer->GetSize();
-
-	// Get the name of this desktop
-	char desktopname[MAX_COMPUTERNAME_LENGTH+1];
-	DWORD desktopnamelen = MAX_COMPUTERNAME_LENGTH + 1;
-	if (GetComputerName(desktopname, &desktopnamelen))
-	{
-		// Make the name lowercase
-		for (size_t x=0; x<strlen(desktopname); x++)
-		{
-			desktopname[x] = tolower(desktopname[x]);
-		}
-	}
-	else
-	{
-		strcpy(desktopname, "WinVNC");
-	}
-
-	// Send the server format message to the client
-	rfbServerInitMsg server_ini;
-	server_ini.format = m_client->m_buffer->GetLocalFormat();
-
-	// Endian swaps
-	RECT sharedRect;
-	sharedRect = m_server->GetSharedRect();
-	server_ini.framebufferWidth = Swap16IfLE(sharedRect.right- sharedRect.left);
-	server_ini.framebufferHeight = Swap16IfLE(sharedRect.bottom - sharedRect.top);
-	server_ini.format.redMax = Swap16IfLE(server_ini.format.redMax);
-	server_ini.format.greenMax = Swap16IfLE(server_ini.format.greenMax);
-	server_ini.format.blueMax = Swap16IfLE(server_ini.format.blueMax);
-	server_ini.nameLength = Swap32IfLE(strlen(desktopname));
-
-	if (!m_socket->SendExact((char *)&server_ini, sizeof(server_ini)))
-	{
-		m_server->RemoveClient(m_client->GetClientId());
-		return;
-	}
-	if (!m_socket->SendExact(desktopname, strlen(desktopname)))
-	{
-		m_server->RemoveClient(m_client->GetClientId());
-		return;
-	}
-	vnclog.Print(LL_INTINFO, VNCLOG("sent pixel format to client\n"));
-
-	// Inform the client about our interaction capabilities (protocol 3.7t)
-	if (m_client->m_protocol_tightvnc) {
-		if (!SendInteractionCaps()) {
-			m_server->RemoveClient(m_client->GetClientId());
-			return;
-		}
-		vnclog.Print(LL_INTINFO, VNCLOG("list of interaction capabilities sent\n"));
-	}
-
-	// UNLOCK INITIAL SETUP
-	// Initial negotiation is complete, so set the protocol ready flag
-	{
-		omni_mutex_lock l(m_client->m_regionLock);
-		m_client->m_protocol_ready = TRUE;
-	}
-
-	// Clear the CapsLock and NumLock keys
-	if (m_client->IsKeyboardEnabled())
-	{
-		ClearKeyState(VK_CAPITAL);
-		// *** JNW - removed because people complain it's wrong
-		//ClearKeyState(VK_NUMLOCK);
-		ClearKeyState(VK_SCROLL);
-	}
-
-	// MAIN LOOP
-
-	BOOL connected = TRUE;
-	while (connected)
-	{
-		rfbClientToServerMsg msg;
-
-		// Ensure that we're running in the correct desktop
-		if (!vncService::InputDesktopSelected())
-			if (!vncService::SelectDesktop(NULL))
-				break;
-
-		// Try to read a message ID
-		if (!m_socket->ReadExact((char *)&msg.type, sizeof(msg.type)))
-		{
-			connected = FALSE;
-			break;
-		}
-
-		// What to do is determined by the message id
-		switch(msg.type)
-		{
-
-		case rfbSetPixelFormat:
-			// Read the rest of the message:
-			if (!m_socket->ReadExact(((char *) &msg)+1, sz_rfbSetPixelFormatMsg-1))
-			{
-				connected = FALSE;
-				break;
-			}
-
-			vnclog.Print(LL_INTINFO, VNCLOG("SetPixelFormat message received\n"));
-
-			// Swap the relevant bits.
-			msg.spf.format.redMax = Swap16IfLE(msg.spf.format.redMax);
-			msg.spf.format.greenMax = Swap16IfLE(msg.spf.format.greenMax);
-			msg.spf.format.blueMax = Swap16IfLE(msg.spf.format.blueMax);
-
-			{
-				omni_mutex_lock l(m_client->m_regionLock);
-
-				// Tell the buffer object of the change
-				if (!m_client->m_buffer->SetClientFormat(msg.spf.format))
-				{
-					vnclog.Print(LL_CONNERR, VNCLOG("remote pixel format invalid\n"));
-
-					connected = FALSE;
-				}
-
-				// Set the palette-changed flag, just in case...
-				m_client->m_palettechanged = TRUE;
-			}
-			break;
-
-		case rfbSetEncodings:
-			// Read the rest of the message:
-			if (!m_socket->ReadExact(((char *) &msg)+1, sz_rfbSetEncodingsMsg-1))
-			{
-				connected = FALSE;
-				break;
-			}
-
-			vnclog.Print(LL_INTINFO, VNCLOG("SetEncodings message received\n"));
-
-			m_client->m_buffer->SetQualityLevel(-1);
-			m_client->m_buffer->SetCompressLevel(6);
-			m_client->m_buffer->EnableXCursor(FALSE);
-			m_client->m_buffer->EnableRichCursor(FALSE);
-			m_client->m_buffer->EnableLastRect(FALSE);
-			m_client->m_use_PointerPos = FALSE;
-			m_client->m_use_NewFBSize = FALSE;
-
-			m_client->m_cursor_update_pending = FALSE;
-			m_client->m_cursor_update_sent = FALSE;
-			m_client->m_cursor_pos_changed = FALSE;
-
-			// Read in the preferred encodings
-			msg.se.nEncodings = Swap16IfLE(msg.se.nEncodings);
-			{
-				int x;
-				BOOL encoding_set = FALSE;
-				BOOL shapeupdates_requested = FALSE;
-				BOOL pointerpos_requested = FALSE;
-
-				{
-					omni_mutex_lock l(m_client->m_regionLock);
-					// By default, don't use copyrect!
-					m_client->m_copyrect_use = FALSE;
-				}
-
-				for (x = 0; x < msg.se.nEncodings; x++)
-				{
-					omni_mutex_lock l(m_client->m_regionLock);
-					CARD32 encoding;
-
-					// Read an encoding in
-					if (!m_socket->ReadExact((char *)&encoding, sizeof(encoding)))
-					{
-						connected = FALSE;
-						break;
-					}
-
-					// Is this the CopyRect encoding (a special case)?
-					if (Swap32IfLE(encoding) == rfbEncodingCopyRect)
-					{
-						// Client wants us to use CopyRect
-						m_client->m_copyrect_use = TRUE;
-						continue;
-					}
-
-					// Is this an XCursor encoding request?
-					if (Swap32IfLE(encoding) == rfbEncodingXCursor) {
-						m_client->m_buffer->EnableXCursor(TRUE);
-						shapeupdates_requested = TRUE;
-						vnclog.Print(LL_INTINFO, VNCLOG("X-style cursor shape updates enabled\n"));
-						continue;
-					}
-
-					// Is this a RichCursor encoding request?
-					if (Swap32IfLE(encoding) == rfbEncodingRichCursor) {
-						m_client->m_buffer->EnableRichCursor(TRUE);
-						shapeupdates_requested = TRUE;
-						vnclog.Print(LL_INTINFO, VNCLOG("Full-color cursor shape updates enabled\n"));
-						continue;
-					}
-
-					// Is this a CompressLevel encoding?
-					if ((Swap32IfLE(encoding) >= rfbEncodingCompressLevel0) &&
-						(Swap32IfLE(encoding) <= rfbEncodingCompressLevel9))
-					{
-						// Client specified encoding-specific compression level
-						int level = (int)(Swap32IfLE(encoding) - rfbEncodingCompressLevel0);
-						m_client->m_buffer->SetCompressLevel(level);
-						vnclog.Print(LL_INTINFO, VNCLOG("compression level requested: %d\n"), level);
-						continue;
-					}
-
-					// Is this a QualityLevel encoding?
-					if ((Swap32IfLE(encoding) >= rfbEncodingQualityLevel0) &&
-						(Swap32IfLE(encoding) <= rfbEncodingQualityLevel9))
-					{
-						// Client specified image quality level used for JPEG compression
-						int level = (int)(Swap32IfLE(encoding) - rfbEncodingQualityLevel0);
-						m_client->m_buffer->SetQualityLevel(level);
-						vnclog.Print(LL_INTINFO, VNCLOG("image quality level requested: %d\n"), level);
-						continue;
-					}
-
-					// Is this a PointerPos encoding request?
-					if (Swap32IfLE(encoding) == rfbEncodingPointerPos) {
-						pointerpos_requested = TRUE;
-						continue;
-					}
-
-					// Is this a LastRect encoding request?
-					if (Swap32IfLE(encoding) == rfbEncodingLastRect) {
-						m_client->m_buffer->EnableLastRect(TRUE);
-						vnclog.Print(LL_INTINFO, VNCLOG("LastRect protocol extension enabled\n"));
-						continue;
-					}
-
-					// Is this a NewFBSize encoding request?
-					if (Swap32IfLE(encoding) == rfbEncodingNewFBSize) {
-						m_client->m_use_NewFBSize = TRUE;
-						vnclog.Print(LL_INTINFO, VNCLOG("NewFBSize protocol extension enabled\n"));
-						continue;
-					}
-
-					// Have we already found a suitable encoding?
-					if (!encoding_set)
-					{
-						// omni_mutex_lock l(m_client->m_regionLock);
-
-						// No, so try the buffer to see if this encoding will work...
-						if (m_client->m_buffer->SetEncoding(Swap32IfLE(encoding))) {
-							encoding_set = TRUE;
-						}
-
-					}
-				}
-
-				// Enable CursorPos encoding only if cursor shape updates were
-				// requested by the client.
-				if (shapeupdates_requested && pointerpos_requested) {
-					m_client->m_use_PointerPos = TRUE;
-					m_client->SetCursorPosChanged();
-					vnclog.Print(LL_INTINFO, VNCLOG("PointerPos protocol extension enabled\n"));
-				}
-
-				// If no encoding worked then default to RAW!
-				// FIXME: Protocol extensions won't work in this case.
-				if (!encoding_set)
-				{
-					omni_mutex_lock l(m_client->m_regionLock);
-
-					vnclog.Print(LL_INTINFO, VNCLOG("defaulting to raw encoder\n"));
-
-					if (!m_client->m_buffer->SetEncoding(Swap32IfLE(rfbEncodingRaw)))
-					{
-						vnclog.Print(LL_INTERR, VNCLOG("failed to select raw encoder!\n"));
-
-						connected = FALSE;
-					}
-				}
-			}
-
-			break;
-
-		case rfbFramebufferUpdateRequest:
-			// Read the rest of the message:
-			if (!m_socket->ReadExact(((char *) &msg)+1, sz_rfbFramebufferUpdateRequestMsg-1))
-			{
-				connected = FALSE;
-				break;
-			}
-
-			if (msg.fur.incremental) {
-				vnclog.Print(LL_INTINFO, VNCLOG("FramebufferUpdateRequest(incr) received\n"));
-			} else {
-				vnclog.Print(LL_INTINFO, VNCLOG("FramebufferUpdateRequest(full) received\n"));
-			}
-
-			{
-				RECT update;
-				RECT sharedRect;
-				{
-					omni_mutex_lock l(m_client->m_regionLock);
-
-					sharedRect = m_server->GetSharedRect();
-					// Get the specified rectangle as the region to send updates for.
-					update.left = Swap16IfLE(msg.fur.x)+ sharedRect.left;
-					update.top = Swap16IfLE(msg.fur.y)+ sharedRect.top;
-					update.right = update.left + Swap16IfLE(msg.fur.w);
-
-//					_ASSERTE(Swap16IfLE(msg.fur.x) >= 0);
-//					_ASSERTE(Swap16IfLE(msg.fur.y) >= 0);
-
-					//if (update.right > m_client->m_fullscreen.right)
-					//	update.right = m_client->m_fullscreen.right;
-					if (update.right > sharedRect.right)
-						update.right = sharedRect.right;
-					if (update.left < sharedRect.left)
-						update.left = sharedRect.left;
-
-					update.bottom = update.top + Swap16IfLE(msg.fur.h);
-					//if (update.bottom > m_client->m_fullscreen.bottom)
-					//	update.bottom = m_client->m_fullscreen.bottom;
-					if (update.bottom > sharedRect.bottom)
-						update.bottom = sharedRect.bottom;
-					if (update.top < sharedRect.top)
-						update.top = sharedRect.top;
-
-					// Set the update-wanted flag to true
-					m_client->m_updatewanted = TRUE;
-
-					// Clip the rectangle to the screen
-					if (IntersectRect(&update, &update, &sharedRect))
-					{
-						// Is this request for an incremental region?
-						if (msg.fur.incremental)
-						{
-							// Yes, so add it to the incremental region
-							m_client->m_incr_rgn.AddRect(update);
-						}
-						else
-						{
-							// No, so add it to the full update region
-							m_client->m_full_rgn.AddRect(update);
-
-							// Disable any pending CopyRect
-							m_client->m_copyrect_set = FALSE;
-						}
-					}
-
-					// Trigger an update
-					m_server->RequestUpdate();
-				}
-			}
-			break;
-
-		case rfbKeyEvent:
-			// Read the rest of the message:
-			if (m_socket->ReadExact(((char *) &msg)+1, sz_rfbKeyEventMsg-1))
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("KeyEvent message received\n"));
-
-				if (m_client->IsKeyboardEnabled() && !m_client->IsInputBlocked())
-				{
-					msg.ke.key = Swap32IfLE(msg.ke.key);
-					// Get the keymapper to do the work
-					vncKeymap::keyEvent(msg.ke.key, msg.ke.down != 0,
-						m_client->m_server);
-					m_client->m_remoteevent = TRUE;
-				}
-			}
-			break;
-
-		case rfbPointerEvent:
-			// Read the rest of the message:
-			if (m_socket->ReadExact(((char *) &msg)+1, sz_rfbPointerEventMsg-1))
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("PointerEvent message received\n"));
-
-				if (m_client->IsPointerEnabled() && !m_client->IsInputBlocked())
-				{
-					// Convert the coords to Big Endian
-					msg.pe.x = Swap16IfLE(msg.pe.x);
-					msg.pe.y = Swap16IfLE(msg.pe.y);
-
-					// Remember cursor position for this client
-					m_client->m_cursor_pos.x = msg.pe.x;
-					m_client->m_cursor_pos.y = msg.pe.y;
-
-					// if we share only one window...
-
-					RECT coord;
-					{
-						omni_mutex_lock l(m_client->m_regionLock);
-
-						coord = m_server->GetSharedRect();
-					}
-
-					// to put position relative to screen
-					msg.pe.x = (CARD16)(msg.pe.x + coord.left);
-					msg.pe.y = (CARD16)(msg.pe.y + coord.top);
-
-					// Work out the flags for this event
-					DWORD flags = MOUSEEVENTF_ABSOLUTE;
-					flags |= MOUSEEVENTF_MOVE;
-					m_server->SetMouseCounter(1, m_client->m_cursor_pos, false );
-
-					if ( (msg.pe.buttonMask & rfbButton1Mask) != 
-						(m_client->m_ptrevent.buttonMask & rfbButton1Mask) )
-					{
-						if (GetSystemMetrics(SM_SWAPBUTTON))
-							flags |= (msg.pe.buttonMask & rfbButton1Mask) 
-							? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP;
-						else
-							flags |= (msg.pe.buttonMask & rfbButton1Mask) 
-							? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;
-						m_server->SetMouseCounter(1, m_client->m_cursor_pos, false);
-					}
-					if ( (msg.pe.buttonMask & rfbButton2Mask) != 
-						(m_client->m_ptrevent.buttonMask & rfbButton2Mask) )
-					{
-						flags |= (msg.pe.buttonMask & rfbButton2Mask) 
-							? MOUSEEVENTF_MIDDLEDOWN : MOUSEEVENTF_MIDDLEUP;
-						m_server->SetMouseCounter(1, m_client->m_cursor_pos, false);
-					}
-					if ( (msg.pe.buttonMask & rfbButton3Mask) != 
-						(m_client->m_ptrevent.buttonMask & rfbButton3Mask) )
-					{
-						if (GetSystemMetrics(SM_SWAPBUTTON))
-							flags |= (msg.pe.buttonMask & rfbButton3Mask) 
-							? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;
-						else
-							flags |= (msg.pe.buttonMask & rfbButton3Mask) 
-							? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP;
-						m_server->SetMouseCounter(1, m_client->m_cursor_pos, false);
-					}
-
-					// Treat buttons 4 and 5 presses as mouse wheel events
-					DWORD wheel_movement = 0;
-					if ((msg.pe.buttonMask & rfbButton4Mask) != 0 &&
-						(m_client->m_ptrevent.buttonMask & rfbButton4Mask) == 0)
-					{
-						flags |= MOUSEEVENTF_WHEEL;
-						wheel_movement = (DWORD)+120;
-					}
-					else if ((msg.pe.buttonMask & rfbButton5Mask) != 0 &&
-						(m_client->m_ptrevent.buttonMask & rfbButton5Mask) == 0)
-					{
-						flags |= MOUSEEVENTF_WHEEL;
-						wheel_movement = (DWORD)-120;
-					}
-
-					// Generate coordinate values
-// PRB: should it be really only primary rect?
-					HWND temp = GetDesktopWindow();
-					GetWindowRect(temp,&coord);
-
-					unsigned long x = (msg.pe.x * 65535) / (coord.right - coord.left - 1);
-					unsigned long y = (msg.pe.y * 65535) / (coord.bottom - coord.top - 1);
-
-					// Do the pointer event
-					::mouse_event(flags, (DWORD)x, (DWORD)y, wheel_movement, 0);
-					// Save the old position
-					m_client->m_ptrevent = msg.pe;
-
-					// Flag that a remote event occurred
-					m_client->m_remoteevent = TRUE;
-					m_client->m_pointer_event_time = time(NULL);
-
-					// Flag that the mouse moved
-					// FIXME: It should not set m_cursor_pos_changed here.
-					m_client->UpdateMouse();
-
-					// Trigger an update
-					m_server->RequestUpdate();
-				}
-			}
-			break;
-
-		case rfbClientCutText:
-			// Read the rest of the message:
-			if (m_socket->ReadExact(((char *) &msg)+1, sz_rfbClientCutTextMsg-1))
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("ClientCutText message received\n"));
-
-				// Allocate storage for the text
-				const UINT length = Swap32IfLE(msg.cct.length);
-				char *text = new char [length+1];
-				if (text == NULL)
-					break;
-				text[length] = 0;
-
-				// Read in the text
-				if (!m_socket->ReadExact(text, length)) {
-					delete [] text;
-					break;
-				}
-
-				// Get the server to update the local clipboard
-				if (m_client->IsKeyboardEnabled() && m_client->IsPointerEnabled())
-					m_server->UpdateLocalClipText(text);
-
-				// Free the clip text we read
-				delete [] text;
-			}
-			break;
-
-#if 0
-		case rfbFileListRequest:
-			if (!m_server->FileTransfersEnabled() || !m_client->IsInputEnabled()) {
-				connected = FALSE;
-				break;
-			}
-			if (m_socket->ReadExact(((char *) &msg)+1, sz_rfbFileListRequestMsg-1))
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("FileListRequest message received\n"));
-
-				msg.flr.dirNameSize = Swap16IfLE(msg.flr.dirNameSize);
-				if (msg.flr.dirNameSize > 255) break;
-				char path[255 + 1];
-				m_socket->ReadExact(path, msg.flr.dirNameSize);
-				path[msg.flr.dirNameSize] = '\0';
-				ConvertPath(path);
-				if (!vncService::tryImpersonate()) {
-					omni_mutex_lock l(m_client->m_sendUpdateLock);
-					rfbFileListDataMsg fld;
-					fld.type = rfbFileListData;
-					fld.numFiles = Swap16IfLE(0);
-					fld.dataSize = Swap16IfLE(0);
-					fld.compressedSize = Swap16IfLE(0);
-					fld.flags = msg.flr.flags | 0x80;
-					m_socket->SendExact((char *)&fld, sz_rfbFileListDataMsg);
-					break;
-				}
-				FileTransferItemInfo ftii;
-				if (strlen(path) == 0) {
-					TCHAR szDrivesList[256];
-					if (GetLogicalDriveStrings(255, szDrivesList) == 0) {
-						omni_mutex_lock l(m_client->m_sendUpdateLock);
-						rfbFileListDataMsg fld;
-						fld.type = rfbFileListData;
-						fld.numFiles = Swap16IfLE(0);
-						fld.dataSize = Swap16IfLE(0);
-						fld.compressedSize = Swap16IfLE(0);
-						fld.flags = msg.flr.flags | 0x80;
-						m_socket->SendExact((char *)&fld, sz_rfbFileListDataMsg);
-						vncService::undoImpersonate();
-						break;
-					}
-					int i = 0;
-					while (szDrivesList[i] != '\0') {
-						char *drive = strdup(&szDrivesList[i]);
-						char *backslash = strrchr(drive, '\\');
-						if (backslash != NULL)
-							*backslash = '\0';
-						ftii.Add(drive, -1, 0);
-						free(drive);
-						i += strcspn(&szDrivesList[i], "\0") + 1;
-					}
-				} else {
-					strcat(path, "\\*");
-					HANDLE FLRhandle;
-					WIN32_FIND_DATA FindFileData;
-					UINT savedErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
-					FLRhandle = FindFirstFile(path, &FindFileData);
-					DWORD LastError = GetLastError();
-					SetErrorMode(savedErrorMode);
-					if (FLRhandle != INVALID_HANDLE_VALUE) {
-						do {
-							if (strcmp(FindFileData.cFileName, ".") != 0 &&
-								strcmp(FindFileData.cFileName, "..") != 0) {
-								LARGE_INTEGER li;
-								li.LowPart = FindFileData.ftLastWriteTime.dwLowDateTime;
-								li.HighPart = FindFileData.ftLastWriteTime.dwHighDateTime;							
-								li.QuadPart = (li.QuadPart - 1164444736000000000) / 10000000;
-								if ((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {	
-									ftii.Add(FindFileData.cFileName, -1, 0);
-								} else {
-									if (!(msg.flr.flags & 0x10))
-										ftii.Add(FindFileData.cFileName, FindFileData.nFileSizeLow, li.HighPart);
-								}
-							}
-
-						} while (FindNextFile(FLRhandle, &FindFileData));
-						FindClose(FLRhandle);
-					} else {
-						if (LastError != ERROR_SUCCESS && LastError != ERROR_FILE_NOT_FOUND) {
-							omni_mutex_lock l(m_client->m_sendUpdateLock);
-
-							rfbFileListDataMsg fld;
-							fld.type = rfbFileListData;
-							fld.numFiles = Swap16IfLE(0);
-							fld.dataSize = Swap16IfLE(0);
-							fld.compressedSize = Swap16IfLE(0);
-							fld.flags = msg.flr.flags | 0x80;
-							m_socket->SendExact((char *)&fld, sz_rfbFileListDataMsg);
-							vncService::undoImpersonate();
-							break;
-						}
-					}
-				}
-				int dsSize = ftii.GetNumEntries() * 8;
-				int msgLen = sz_rfbFileListDataMsg + dsSize + ftii.GetSummaryNamesLength() + ftii.GetNumEntries();
-				char *pAllMessage = new char [msgLen];
-				rfbFileListDataMsg *pFLD = (rfbFileListDataMsg *) pAllMessage;
-				FTSIZEDATA *pftsd = (FTSIZEDATA *) &pAllMessage[sz_rfbFileListDataMsg];
-				char *pFilenames = &pAllMessage[sz_rfbFileListDataMsg + dsSize];
-				pFLD->type = rfbFileListData;
-				pFLD->flags = msg.flr.flags&0xF0;
-				pFLD->numFiles = Swap16IfLE(ftii.GetNumEntries());
-				pFLD->dataSize = Swap16IfLE(ftii.GetSummaryNamesLength() + ftii.GetNumEntries());
-				pFLD->compressedSize = pFLD->dataSize;
-				for (int i = 0; i < ftii.GetNumEntries(); i++) {
-					pftsd[i].size = Swap32IfLE(ftii.GetSizeAt(i));
-					pftsd[i].data = Swap32IfLE(ftii.GetDataAt(i));
-					strcpy(pFilenames, ftii.GetNameAt(i));
-					pFilenames = pFilenames + strlen(pFilenames) + 1;
-				}
-				omni_mutex_lock l(m_client->m_sendUpdateLock);
-				m_socket->SendExact(pAllMessage, msgLen);
-				vncService::undoImpersonate();
-			}
-			break;
-
-		case rfbFileDownloadRequest:
-			if (!m_server->FileTransfersEnabled() || !m_client->IsInputEnabled()) {
-				connected = FALSE;
-				break;
-			}
-			if (m_socket->ReadExact(((char *) &msg)+1, sz_rfbFileDownloadRequestMsg-1))
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("FileDownloadRequest message received\n"));
-
-				msg.fdr.fNameSize = Swap16IfLE(msg.fdr.fNameSize);
-				msg.fdr.position = Swap32IfLE(msg.fdr.position);
-
-				if (!vncService::tryImpersonate()) {
-					m_socket->ReadExact(NULL, msg.fdr.fNameSize);
-					char reason[] = "Cannot impersonate logged on user";
-					int reasonLen = strlen(reason);
-					m_client->SendFileDownloadFailed(reasonLen, reason);
-					break;
-				}
-				if (msg.fdr.fNameSize > 255) {
-					m_socket->ReadExact(NULL, msg.fdr.fNameSize);
-					char reason[] = "Path length exceeds 255 bytes";
-					int reasonLen = strlen(reason);
-					m_client->SendFileDownloadFailed(reasonLen, reason);
-					vncService::undoImpersonate();
-					break;
-				}
-				char path_file[255 + 1];
-				m_socket->ReadExact(path_file, msg.fdr.fNameSize);
-				path_file[msg.fdr.fNameSize] = '\0';
-				ConvertPath(path_file);
-				strcpy(m_client->m_DownloadFilename, path_file);
-
-				HANDLE hFile;
-				DWORD sz_rfbFileSize;
-				DWORD sz_rfbBlockSize = 8192;
-				DWORD dwNumberOfBytesRead = 0;
-				DWORD dwNumberOfAllBytesRead = 0;
-				WIN32_FIND_DATA FindFileData;
-				UINT savedErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
-				hFile = FindFirstFile(path_file, &FindFileData);
-				DWORD LastError = GetLastError();
-				SetErrorMode(savedErrorMode);
-
-				vnclog.Print(LL_CLIENTS, VNCLOG("file download requested: %s\n"),
-							 path_file);
-
-				if ((FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || 
-					(hFile == INVALID_HANDLE_VALUE) || (path_file[0] == '\0')) {
-					FindClose(hFile);
-					char reason[] = "Cannot open file, perhaps it is absent or is a directory";
-					int reasonLen = strlen(reason);
-					m_client->SendFileDownloadFailed(reasonLen, reason);
-					vncService::undoImpersonate();
-					break;
-				}
-				sz_rfbFileSize = FindFileData.nFileSizeLow;
-				FindClose(hFile);
-				m_client->m_modTime = m_client->FiletimeToTime70(FindFileData.ftLastWriteTime);
-				if (sz_rfbFileSize == 0) {
-					m_client->SendFileDownloadData(m_client->m_modTime);
-				} else {
-					if (sz_rfbFileSize <= sz_rfbBlockSize) sz_rfbBlockSize = sz_rfbFileSize;
-					UINT savedErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
-					m_client->m_hFileToRead = CreateFile(path_file, GENERIC_READ, FILE_SHARE_READ, NULL,	OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
-					SetErrorMode(savedErrorMode);
-					if (m_client->m_hFileToRead != INVALID_HANDLE_VALUE) {
-						m_client->m_bDownloadStarted = TRUE;
-						m_client->SendFileDownloadPortion();
-					}
-				}
-				vncService::undoImpersonate();
-			}
-			break;
-
-		case rfbFileUploadRequest:
-			if (!m_server->FileTransfersEnabled() || !m_client->IsInputEnabled()) {
-				connected = FALSE;
-				break;
-			}
-			if (m_socket->ReadExact(((char *) &msg)+1, sz_rfbFileUploadRequestMsg-1))
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("FileUploadRequest message received\n"));
-
-				msg.fupr.fNameSize = Swap16IfLE(msg.fupr.fNameSize);
-				msg.fupr.position = Swap32IfLE(msg.fupr.position);
-
-				if (!vncService::tryImpersonate()) {
-					m_socket->ReadExact(NULL, msg.fupr.fNameSize);
-					char reason[] = "Cannot impersonate logged on user";
-					int reasonLen = strlen(reason);
-					m_client->SendFileUploadCancel(reasonLen, reason);
-					break;
-				}
-				if (msg.fupr.fNameSize > MAX_PATH) {
-					m_socket->ReadExact(NULL, msg.fupr.fNameSize);
-					char reason[] = "Path length exceeds MAX_PATH value";
-					int reasonLen = strlen(reason);
-					m_client->SendFileUploadCancel(reasonLen, reason);
-					vncService::undoImpersonate();
-					break;
-				}
-				m_socket->ReadExact(m_client->m_UploadFilename, msg.fupr.fNameSize);
-				m_client->m_UploadFilename[msg.fupr.fNameSize] = '\0';
-				ConvertPath(m_client->m_UploadFilename);
-				vnclog.Print(LL_CLIENTS, VNCLOG("file upload requested: %s\n"),
-							 m_client->m_UploadFilename);
-				m_client->m_hFileToWrite = CreateFile(m_client->m_UploadFilename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
-				m_client->m_bUploadStarted = TRUE;
-				if (m_client->m_hFileToWrite == INVALID_HANDLE_VALUE) {
-					char reason[] = "Could not create file";
-					int reasonLen = strlen(reason);
-					m_client->SendFileUploadCancel(reasonLen, reason);
-					vncService::undoImpersonate();
-					break;
-				}
-				/*
-				DWORD dwError = GetLastError();
-				SYSTEMTIME systime;
-				FILETIME filetime;
-				GetSystemTime(&systime);
-				SystemTimeToFileTime(&systime, &filetime);
-				m_client->beginUploadTime = m_client->FiletimeToTime70(filetime);
-				*/        
-				/*
-				DWORD dwFilePtr;
-				if (msg.fupr.position > 0) {
-					dwFilePtr = SetFilePointer(m_hFiletoWrite, msg.fupr.position, NULL, FILE_BEGIN);
-					if ((dwFilePtr == INVALID_SET_FILE_POINTER) && (dwError != NO_ERROR)) {
-						char reason[] = "Invalid file pointer position";
-						int reasonLen = strlen(reason);
-						m_client->SendFileUploadCancel(reasonLen, reason);
-						CloseHandle(m_hFiletoWrite);
-						break;
-					}
-				}
-				*/
-				vncService::undoImpersonate();
-			}				
-			break;
-
-		case rfbFileUploadData:
-			if (!m_server->FileTransfersEnabled() || !m_client->IsInputEnabled()) {
-				connected = FALSE;
-				break;
-			}
-			if (m_socket->ReadExact(((char *) &msg)+1, sz_rfbFileUploadDataMsg-1))
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("FileUploadData message received\n"));
-
-				msg.fud.realSize = Swap16IfLE(msg.fud.realSize);
-				msg.fud.compressedSize = Swap16IfLE(msg.fud.compressedSize);
-
-				if (!vncService::tryImpersonate()) {
-					if (msg.fud.realSize == 0 && msg.fud.compressedSize == 0) {
-						m_socket->ReadExact(NULL, sizeof(CARD32));
-					} else {
-						m_socket->ReadExact(NULL, msg.fud.compressedSize);
-					}
-					char reason[] = "Cannot impersonate logged on user";
-					int reasonLen = strlen(reason);
-					m_client->SendFileUploadCancel(reasonLen, reason);
-					m_client->CloseUndoneFileTransfer();
-					break;
-				}
-				if ((msg.fud.realSize == 0) && (msg.fud.compressedSize == 0)) {
-					CARD32 mTime;
-					m_socket->ReadExact((char *) &mTime, sizeof(CARD32));
-					mTime = Swap32IfLE(mTime);
-					FILETIME Filetime;
-					m_client->Time70ToFiletime(mTime, &Filetime);
-					if (!SetFileTime(m_client->m_hFileToWrite, &Filetime, &Filetime, &Filetime)) {
-						vnclog.Print(LL_INTINFO, VNCLOG("SetFileTime() failed\n"));
-					}
-//					DWORD dwFileSize = GetFileSize(m_client->m_hFileToWrite, NULL);
-					CloseHandle(m_client->m_hFileToWrite);
-					m_client->m_bUploadStarted = FALSE;
-//					SYSTEMTIME systime;
-//					FILETIME filetime;
-//					GetSystemTime(&systime);
-//					SystemTimeToFileTime(&systime, &filetime);
-//					m_client->endUploadTime = m_client->FiletimeToTime70(filetime);
-//					unsigned int uploadTime = m_client->endUploadTime - m_client->beginUploadTime + 1;
-//					DWORD dwBytePerSecond = dwFileSize / uploadTime;
-//					vnclog.Print(LL_CLIENTS, VNCLOG("file upload complete: %s; Speed (B/s) = %d; FileSize = %d, UploadTime = %d\n"),
-//								 m_client->m_UploadFilename, dwBytePerSecond, dwFileSize, uploadTime);
-					vnclog.Print(LL_CLIENTS, VNCLOG("file upload complete: %s;\n"),
-								 m_client->m_UploadFilename);
-					vncService::undoImpersonate();
-					break;
-				}
-				DWORD dwNumberOfBytesWritten;
-				char *pBuff = new char [msg.fud.compressedSize];
-				m_socket->ReadExact(pBuff, msg.fud.compressedSize);
-				if (msg.fud.compressedLevel != 0) {
-					delete[] pBuff;
-					char reason[] = "Server does not support data compression on upload";
-					int reasonLen = strlen(reason);
-					m_client->SendFileUploadCancel(reasonLen, reason);
-					m_client->CloseUndoneFileTransfer();
-					vncService::undoImpersonate();
-					break;
-				}
-				BOOL bResult = WriteFile(m_client->m_hFileToWrite, pBuff, msg.fud.compressedSize, &dwNumberOfBytesWritten, NULL);
-				delete[] pBuff;
-				if ((dwNumberOfBytesWritten != msg.fud.compressedSize) || !bResult) {
-					char reason[] = "Error writing file data";
-					int reasonLen = strlen(reason);
-					m_client->SendFileUploadCancel(reasonLen, reason);
-					m_client->CloseUndoneFileTransfer();
-					vncService::undoImpersonate();
-					break;
-				}
-			}
-			break;
-
-		case rfbFileDownloadCancel:
-			if (!m_server->FileTransfersEnabled() || !m_client->IsInputEnabled()) {
-				connected = FALSE;
-				break;
-			}
-			if (m_socket->ReadExact(((char *) &msg)+1, sz_rfbFileDownloadCancelMsg-1))
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("FileDownloadCancel message received\n"));
-
-				vncService::tryImpersonate();
-				msg.fdc.reasonLen = Swap16IfLE(msg.fdc.reasonLen);
-				char *reason = new char[msg.fdc.reasonLen + 1];
-				m_socket->ReadExact(reason, msg.fdc.reasonLen);
-				reason[msg.fdc.reasonLen] = '\0';
-				m_client->CloseUndoneFileTransfer();
-				delete [] reason;
-				vncService::undoImpersonate();
-			}
-			break;
-
-		case rfbFileUploadFailed:
-			if (!m_server->FileTransfersEnabled() || !m_client->IsInputEnabled()) {
-				connected = FALSE;
-				break;
-			}
-			if (m_socket->ReadExact(((char *) &msg)+1, sz_rfbFileUploadFailedMsg-1))
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("FileUploadFailed message received\n"));
-
-				vncService::tryImpersonate();
-				msg.fuf.reasonLen = Swap16IfLE(msg.fuf.reasonLen);
-				char *reason = new char[msg.fuf.reasonLen + 1];
-				m_socket->ReadExact(reason, msg.fuf.reasonLen);
-				reason[msg.fuf.reasonLen] = '\0';
-				m_client->CloseUndoneFileTransfer();
-				delete [] reason;
-				vncService::undoImpersonate();
-			}
-			break;
-
-		case rfbFileCreateDirRequest:
-			if (!m_server->FileTransfersEnabled() || !m_client->IsInputEnabled()) {
-				connected = FALSE;
-				break;
-			}
-			if (m_socket->ReadExact(((char *) &msg)+1, sz_rfbFileCreateDirRequestMsg-1))
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("FileCreateDirRequest message received\n"));
-
-				vncService::tryImpersonate();
-				msg.fcdr.dNameLen = Swap16IfLE(msg.fcdr.dNameLen);
-				char *dirName = new char[msg.fcdr.dNameLen + 1];
-				m_socket->ReadExact(dirName, msg.fcdr.dNameLen);
-				dirName[msg.fcdr.dNameLen] = '\0';
-				dirName = ConvertPath(dirName);
-				CreateDirectory((LPCTSTR) dirName, NULL);
-				delete [] dirName;
-				vncService::undoImpersonate();
-			}
-
-			break;
-#endif
-		case rfbItalcServiceRequest:
-		{
-			omni_mutex_lock l(m_client->m_sendUpdateLock);
-			if( !processItalcClient( vsocketDispatcher, m_socket ) )
-			{
-				connected = FALSE;
-			}
-			break;
-		}
-
-		default:
-			// Unknown message, so fail!
-			vnclog.Print(LL_CLIENTS, VNCLOG("invalid message received : %d\n"),
-						 (int)msg.type);
-			connected = FALSE;
-		}
-	}
-
-	// Move into the thread's original desktop
-	vncService::SelectHDESK(home_desktop);
-
-	// Quit this thread.  This will automatically delete the thread and the
-	// associated client.
-	vnclog.Print(LL_CLIENTS, VNCLOG("client disconnected : %s (id %hd)\n"),
-				 m_client->GetClientName(), m_client->GetClientId());
-
-	// Remove the client from the server, just in case!
-	m_server->RemoveClient(m_client->GetClientId());
-}
-
-// The vncClient itself
-
-vncClient::vncClient()
-{
-	vnclog.Print(LL_INTINFO, VNCLOG("vncClient() executing...\n"));
-
-	m_socket = NULL;
-	m_client_name = 0;
-	m_server_name = 0;
-	m_buffer = NULL;
-
-	m_keyboardenabled = FALSE;
-	m_pointerenabled = FALSE;
-	m_inputblocked = FALSE;
-
-	m_copyrect_use = FALSE;
-
-	m_mousemoved = FALSE;
-	m_ptrevent.buttonMask = 0;
-	m_ptrevent.x = 0;
-	m_ptrevent.y = 0;
-
-	m_cursor_update_pending = FALSE;
-	m_cursor_update_sent = FALSE;
-	m_cursor_pos_changed = FALSE;
-	m_pointer_event_time = (time_t)0;
-	m_cursor_pos.x = -1;
-	m_cursor_pos.y = -1;
-
-	m_thread = NULL;
-	m_updatewanted = FALSE;
-
-	m_palettechanged = FALSE;
-
-	m_copyrect_set = FALSE;
-
-	m_remoteevent = FALSE;
-
-	m_bDownloadStarted = FALSE;
-	m_bUploadStarted = FALSE;
-
-	// IMPORTANT: Initially, client is not protocol-ready.
-	m_protocol_ready = FALSE;
-	m_fb_size_changed = FALSE;
-
-	m_use_NewFBSize = FALSE;
-
-}
-
-vncClient::~vncClient()
-{
-	vnclog.Print(LL_INTINFO, VNCLOG("~vncClient() executing...\n"));
-
-	// We now know the thread is dead, so we can clean up
-	if (m_client_name != 0) {
-		free(m_client_name);
-		m_client_name = 0;
-	}
-	if (m_server_name != 0) {
-		free(m_server_name);
-		m_server_name = 0;
-	}
-
-	// If we have a socket then kill it
-	if (m_socket != NULL)
-	{
-		vnclog.Print(LL_INTINFO, VNCLOG("deleting socket\n"));
-
-		delete m_socket;
-		m_socket = NULL;
-	}
-
-	// Kill the screen buffer
-	if (m_buffer != NULL)
-	{
-		vnclog.Print(LL_INTINFO, VNCLOG("deleting buffer\n"));
-
-		delete m_buffer;
-		m_buffer = NULL;
-	}
-}
-
-// Init
-BOOL
-vncClient::Init(vncServer *server,
-				VSocket *socket,
-				BOOL reverse,
-				BOOL shared,
-				vncClientId newid)
-{
-	// Save the server id;
-	m_server = server;
-
-	// Save the socket
-	m_socket = socket;
-
-	// Save the name/ip of the connecting client
-	char *name = m_socket->GetPeerName();
-	if (name != 0)
-		m_client_name = strdup(name);
-	else
-		m_client_name = strdup("<unknown>");
-
-	// Save the server name/ip
-	name = m_socket->GetSockName();
-	if (name != 0)
-		m_server_name = strdup(name);
-	else
-		m_server_name = strdup("<unknown>");
-
-	// Save the client id
-	m_id = newid;
-
-	// Spawn the child thread here
-	m_thread = new vncClientThread;
-	if (m_thread == NULL)
-		return FALSE;
-	return ((vncClientThread *)m_thread)->Init(this, m_server, m_socket, reverse, shared);
-
-	return FALSE;
-}
-
-void
-vncClient::Kill()
-{
-	// Close file transfer
-	CloseUndoneFileTransfer();
-
-	// Close the socket
-	if (m_socket != NULL)
-		m_socket->Close();
-}
-
-// Client manipulation functions for use by the server
-void
-vncClient::SetBuffer(vncBuffer *buffer)
-{
-	// Until authenticated, the client object has no access
-	// to the screen buffer.  This means that there only need
-	// be a buffer when there's at least one authenticated client.
-	m_buffer = buffer;
-}
-
-
-void
-vncClient::TriggerUpdate()
-{
-	// Lock the updates stored so far
-	omni_mutex_lock l(m_regionLock);
-	if (!m_protocol_ready)
-		return;
-
-	if (m_updatewanted)
-	{
-		// Check if cursor shape update has to be sent
-		m_cursor_update_pending = m_buffer->IsCursorUpdatePending();
-
-		// Send an update if one is waiting
-		if (!m_changed_rgn.IsEmpty() ||
-			!m_full_rgn.IsEmpty() ||
-			m_copyrect_set ||
-			m_cursor_update_pending ||
-			m_cursor_pos_changed ||
-			(m_mousemoved && !m_use_PointerPos))
-		{
-			// Has the palette changed?
-			if (m_palettechanged)
-			{
-				m_palettechanged = FALSE;
-				if (!SendPalette())
-					return;
-			}
-
-			// Now send the update
-			m_updatewanted = !SendUpdate();
-		}
-	}
-}
-
-void
-vncClient::UpdateMouse()
-{
-	if (!m_mousemoved && !m_cursor_update_sent)	{
-		omni_mutex_lock l(m_regionLock);
-		const RECT r = m_server->GetSharedRect();
-		if (IntersectRect(&m_oldmousepos, &m_oldmousepos, &r))
-			m_changed_rgn.AddRect(m_oldmousepos);
-
-		m_mousemoved = TRUE;
-	} else if (m_use_PointerPos) {
-		omni_mutex_lock l(m_regionLock);
-
-		SetCursorPosChanged();
-	}
-}
-
-void
-vncClient::UpdateRect(RECT &rect)
-{
-	// Add the rectangle to the update region
-	if (IsRectEmpty(&rect))
-		return;
-
-	omni_mutex_lock l(m_regionLock);
-
-	const RECT r = m_server->GetSharedRect();
-	if (IntersectRect(&rect, &rect, &r))
-		m_changed_rgn.AddRect(rect);
-}
-
-void
-vncClient::UpdateRegion(vncRegion &region)
-{
-	// Merge our current update region with the supplied one
-	if (region.IsEmpty())
-		return;
-
-	{
-		omni_mutex_lock l(m_regionLock);
-
-		// Merge the two
-		vncRegion dummy;
-		dummy.AddRect(m_server->GetSharedRect());
-		region.Intersect(dummy);
-
-		m_changed_rgn.Combine(region);
-	}
-}
-
-void
-vncClient::CopyRect(RECT &dest, POINT &source)
-{
-	// If CopyRect encoding is disabled or we already have a CopyRect pending,
-	// then just redraw the region.
-	if (!m_copyrect_use || m_copyrect_set) {
-		UpdateRect(dest);
-		return;
-	}
-
-	{
-		omni_mutex_lock l(m_regionLock);
-
-		// Clip the destination to the screen
-		RECT destrect;
-		const RECT r = m_server->GetSharedRect();
-		if (!IntersectRect(&destrect, &dest, &r))
-			return;
-
-		// Adjust the source correspondingly
-		source.x = source.x + (destrect.left - dest.left);
-		source.y = source.y + (destrect.top - dest.top);
-
-		// Work out the source rectangle
-		RECT srcrect;
-		srcrect.left = source.x;
-		srcrect.top = source.y;
-
-		// And fill out the right & bottom using the dest rect
-		srcrect.right = destrect.right-destrect.left + srcrect.left;
-		srcrect.bottom = destrect.bottom-destrect.top + srcrect.top;
-
-		// Clip the source to the screen
-		RECT srcrect2;
-		if (!IntersectRect(&srcrect2, &srcrect, &r))
-			return;
-
-		// Correct the destination rectangle
-		destrect.left += (srcrect2.left - srcrect.left);
-		destrect.top += (srcrect2.top - srcrect.top);
-		destrect.right = srcrect2.right-srcrect2.left + destrect.left;
-		destrect.bottom = srcrect2.bottom-srcrect2.top + destrect.top;
-
-		// Set the copyrect...
-		m_copyrect_rect = destrect;
-		m_copyrect_src.x = srcrect2.left;
-		m_copyrect_src.y = srcrect2.top;
-
-		m_copyrect_set = TRUE;
-	}
-}
-
-void
-vncClient::UpdateClipText(LPSTR text)
-{
-	if (!m_protocol_ready) return;
-
-	// Don't send the clipboard contents to a view-only client
-	if (!IsKeyboardEnabled() || !IsPointerEnabled())
-		return;
-
-	// Lock out any update sends and send clip text to the client
-	omni_mutex_lock l(m_sendUpdateLock);
-
-	rfbServerCutTextMsg message;
-	message.length = Swap32IfLE(strlen(text));
-	if (!SendRFBMsg(rfbServerCutText, (BYTE *) &message, sizeof(message)))
-	{
-		Kill();
-		return;
-	}
-	if (!m_socket->SendQueued(text, strlen(text)))
-	{
-		Kill();
-		return;
-	}
-}
-
-void
-vncClient::UpdatePalette()
-{
-	omni_mutex_lock l(m_regionLock);
-
-	m_palettechanged = TRUE;
-}
-
-// Functions used to set and retrieve the client settings
-const char*
-vncClient::GetClientName()
-{
-	return (m_client_name != NULL) ? m_client_name : "[unknown]";
-}
-
-const char*
-vncClient::GetServerName()
-{
-	return (m_server_name != NULL) ? m_server_name : "[unknown]";
-}
-
-// Internal methods
-BOOL
-vncClient::SendRFBMsg(CARD8 type, BYTE *buffer, int buflen)
-{
-	// Set the message type
-	((rfbServerToClientMsg *)buffer)->type = type;
-
-	// Send the message
-	if (!m_socket->SendQueued((char *) buffer, buflen))
-	{
-		vnclog.Print(LL_CONNERR, VNCLOG("failed to send RFB message to client\n"));
-
-		Kill();
-		return FALSE;
-	}
-	return TRUE;
-}
-
-
-BOOL vncClient::SendUpdate()
-{
-#ifndef _DEBUG
-	try
-	{
-#endif
-		// First, check if we need to send pending NewFBSize message
-		if (m_use_NewFBSize && m_fb_size_changed) {
-			SetNewFBSize(TRUE);
-			return TRUE;
-		}
-
-		vncRegion toBeSent;			// Region to actually be sent
-		rectlist toBeSentList;		// List of rectangles to actually send
-		vncRegion toBeDone;			// Region to check
-
-		// Prepare to send cursor position update if necessary
-		if (m_cursor_pos_changed) {
-			POINT cursor_pos;
-			if (!GetCursorPos(&cursor_pos)) {
-				cursor_pos.x = 0;
-				cursor_pos.y = 0;
-			}
-			RECT shared_rect = m_server->GetSharedRect();
-			cursor_pos.x -= shared_rect.left;
-			cursor_pos.y -= shared_rect.top;
-			if (cursor_pos.x < 0) {
-				cursor_pos.x = 0;
-			} else if (cursor_pos.x >= shared_rect.right - shared_rect.left) {
-				cursor_pos.x = shared_rect.right - shared_rect.left - 1;
-			}
-			if (cursor_pos.y < 0) {
-				cursor_pos.y = 0;
-			} else if (cursor_pos.y >= shared_rect.bottom - shared_rect.top) {
-				cursor_pos.y = shared_rect.bottom - shared_rect.top - 1;
-			}
-			if (cursor_pos.x == m_cursor_pos.x && cursor_pos.y == m_cursor_pos.y) {
-				m_cursor_pos_changed = FALSE;
-			} else {
-				m_cursor_pos.x = cursor_pos.x;
-				m_cursor_pos.y = cursor_pos.y;
-			}
-		}
-
-		toBeSent.Clear();
-		if (!m_full_rgn.IsEmpty()) {
-			m_incr_rgn.Clear();
-			m_copyrect_set = false;
-			toBeSent.Combine(m_full_rgn);
-			m_changed_rgn.Clear();
-			m_full_rgn.Clear();
-		} else {
-			if (!m_incr_rgn.IsEmpty()) {
-				// Get region to send from vncDesktop
-				toBeSent.Combine(m_changed_rgn);
-
-				// Mouse stuff for the case when cursor shape updates are off
-				if (!m_cursor_update_sent && !m_cursor_update_pending) {
-					// If the mouse hasn't moved, see if its position is in the rect
-					// we're sending. If so, make sure the full mouse rect is sent.
-					if (!m_mousemoved) {
-						vncRegion tmpMouseRgn;
-						tmpMouseRgn.AddRect(m_oldmousepos);
-						tmpMouseRgn.Intersect(toBeSent);
-						if (!tmpMouseRgn.IsEmpty()) 
-							m_mousemoved = TRUE;
-					}
-					// If the mouse has moved (or otherwise needs an update):
-					if (m_mousemoved) {
-						// Include an update for its previous position
-						const RECT r = m_server->GetSharedRect();
-						if (IntersectRect(&m_oldmousepos, &m_oldmousepos, &r)) 
-							toBeSent.AddRect(m_oldmousepos);
-						// Update the cached mouse position
-						m_oldmousepos = m_buffer->GrabMouse();
-						// Include an update for its current position
-						if (IntersectRect(&m_oldmousepos, &m_oldmousepos, &r)) 
-							toBeSent.AddRect(m_oldmousepos);
-						// Indicate the move has been handled
-						m_mousemoved = FALSE;
-					}
-				}
-				m_changed_rgn.Clear();
-			}
-		}
-
-		// Get the list of changed rectangles!
-		int numrects = 0;
-		if (toBeSent.Rectangles(toBeSentList))
-		{
-			// Find out how many rectangles this update will contain
-			rectlist::iterator i;
-			int numsubrects;
-			for (i=toBeSentList.begin(); i != toBeSentList.end(); i++)
-			{
-				numsubrects = m_buffer->GetNumCodedRects(*i);
-
-				// Skip remaining rectangles if an encoder will use LastRect extension.
-				if (numsubrects == 0) {
-					numrects = 0xFFFF;
-					break;
-				}
-				numrects += numsubrects;
-			}
-		}
-
-		if (numrects != 0xFFFF) {
-			// Count cursor shape and cursor position updates.
-			if (m_cursor_update_pending)
-				numrects++;
-			if (m_cursor_pos_changed)
-				numrects++;
-			// Handle the copyrect region
-			if (m_copyrect_set)
-				numrects++;
-			// If there are no rectangles then return
-			if (numrects != 0)
-				m_incr_rgn.Clear();
-			else
-				return FALSE;
-		}
-
-		omni_mutex_lock l(m_sendUpdateLock);
-
-		// Otherwise, send <number of rectangles> header
-		rfbFramebufferUpdateMsg header;
-		header.nRects = Swap16IfLE(numrects);
-		if (!SendRFBMsg(rfbFramebufferUpdate, (BYTE *) &header, sz_rfbFramebufferUpdateMsg))
-			return TRUE;
-
-		// Send mouse cursor shape update
-		if (m_cursor_update_pending) {
-			if (!SendCursorShapeUpdate())
-				return TRUE;
-		}
-
-		// Send cursor position update
-		if (m_cursor_pos_changed) {
-			if (!SendCursorPosUpdate())
-				return TRUE;
-		}
-
-		// Encode & send the copyrect
-		if (m_copyrect_set) {
-			m_copyrect_set = FALSE;
-			if(!SendCopyRect(m_copyrect_rect, m_copyrect_src))
-				return TRUE;
-		}
-
-		// Encode & send the actual rectangles
-		if (!SendRectangles(toBeSentList))
-			return TRUE;
-
-		// Send LastRect marker if needed.
-		if (numrects == 0xFFFF) {
-			if (!SendLastRect())
-				return TRUE;
-		}
-
-		// Both lists should be empty when we exit
-		_ASSERT(toBeSentList.empty());
-#ifndef _DEBUG
-	}
-	catch (...)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("vncClient::SendUpdate caught an exception.\n"));
-		throw;
-	}
-#endif
-
-	return TRUE;
-}
-
-// Send a set of rectangles
-BOOL
-vncClient::SendRectangles(rectlist &rects)
-{
-	RECT rect;
-
-	// Work through the list of rectangles, sending each one
-	while(!rects.empty())
-	{
-		rect = rects.front();
-		if (!SendRectangle(rect))
-			return FALSE;
-
-		rects.pop_front();
-	}
-	rects.clear();
-
-	return TRUE;
-}
-
-// Tell the encoder to send a single rectangle
-BOOL vncClient::SendRectangle(RECT &rect)
-{
-	RECT sharedRect;
-	{
-		omni_mutex_lock l(m_regionLock);
-		sharedRect = m_server->GetSharedRect();
-	}
-
-	IntersectRect(&rect, &rect, &sharedRect);
-	// Get the buffer to encode the rectangle
-	UINT bytes = m_buffer->TranslateRect(
-		rect,
-		m_socket,
-		sharedRect.left,
-		sharedRect.top);
-
-    // Send the encoded data
-    return m_socket->SendQueued((char *)(m_buffer->GetClientBuffer()), bytes);
-}
-
-// Send a single CopyRect message
-BOOL vncClient::SendCopyRect(RECT &dest, POINT &source)
-{
-	RECT rc_shr = m_server->GetSharedRect();
-
-	// Create the message header
-	rfbFramebufferUpdateRectHeader copyrecthdr;
-	copyrecthdr.r.x = Swap16IfLE(dest.left - rc_shr.left);
-	copyrecthdr.r.y = Swap16IfLE(dest.top - rc_shr.top);
-
-	copyrecthdr.r.w = Swap16IfLE(dest.right-dest.left);
-	copyrecthdr.r.h = Swap16IfLE(dest.bottom-dest.top);
-	copyrecthdr.encoding = Swap32IfLE(rfbEncodingCopyRect);
-
-	// Create the CopyRect-specific section
-	rfbCopyRect copyrectbody;
-	copyrectbody.srcX = Swap16IfLE(source.x - rc_shr.left);
-	copyrectbody.srcY = Swap16IfLE(source.y - rc_shr.top);
-
-	// Now send the message;
-	if (!m_socket->SendQueued((char *)&copyrecthdr, sizeof(copyrecthdr)))
-		return FALSE;
-	if (!m_socket->SendQueued((char *)&copyrectbody, sizeof(copyrectbody)))
-		return FALSE;
-
-	return TRUE;
-}
-
-// Send LastRect marker indicating that there are no more rectangles to send
-BOOL
-vncClient::SendLastRect()
-{
-	// Create the message header
-	rfbFramebufferUpdateRectHeader hdr;
-	hdr.r.x = 0;
-	hdr.r.y = 0;
-	hdr.r.w = 0;
-	hdr.r.h = 0;
-	hdr.encoding = Swap32IfLE(rfbEncodingLastRect);
-
-	// Now send the message;
-	if (!m_socket->SendQueued((char *)&hdr, sizeof(hdr)))
-		return FALSE;
-
-	return TRUE;
-}
-
-// Send the encoder-generated palette to the client
-// This function only returns FALSE if the SendQueued fails - any other
-// error is coped with internally...
-BOOL
-vncClient::SendPalette()
-{
-	rfbSetColourMapEntriesMsg setcmap;
-	RGBQUAD *rgbquad;
-	UINT ncolours = 256;
-
-	// Reserve space for the colour data
-	rgbquad = new RGBQUAD[ncolours];
-	if (rgbquad == NULL)
-		return TRUE;
-
-	// Get the data
-	if (!m_buffer->GetRemotePalette(rgbquad, ncolours))
-	{
-		delete [] rgbquad;
-		return TRUE;
-	}
-
-	// Compose the message
-	omni_mutex_lock l(m_sendUpdateLock);
-
-	setcmap.type = rfbSetColourMapEntries;
-	setcmap.firstColour = Swap16IfLE(0);
-	setcmap.nColours = Swap16IfLE(ncolours);
-
-	if (!m_socket->SendQueued((char *) &setcmap, sz_rfbSetColourMapEntriesMsg))
-	{
-		delete [] rgbquad;
-		return FALSE;
-	}
-
-	// Now send the actual colour data...
-	for (UINT i=0; i<ncolours; i++)
-	{
-		struct _PIXELDATA {
-			CARD16 r, g, b;
-		} pixeldata;
-
-		pixeldata.r = Swap16IfLE(((CARD16)rgbquad[i].rgbRed) << 8);
-		pixeldata.g = Swap16IfLE(((CARD16)rgbquad[i].rgbGreen) << 8);
-		pixeldata.b = Swap16IfLE(((CARD16)rgbquad[i].rgbBlue) << 8);
-
-		if (!m_socket->SendQueued((char *) &pixeldata, sizeof(pixeldata)))
-		{
-			delete [] rgbquad;
-			return FALSE;
-		}
-	}
-
-	// Delete the rgbquad data
-	delete [] rgbquad;
-
-	return TRUE;
-}
-
-BOOL
-vncClient::SendCursorShapeUpdate()
-{
-	m_cursor_update_pending = FALSE;
-
-	if (!m_buffer->SendCursorShape(m_socket)) {
-		m_cursor_update_sent = FALSE;
-
-		return m_buffer->SendEmptyCursorShape(m_socket);
-	}
-
-	m_cursor_update_sent = TRUE;
-	return TRUE;
-}
-
-BOOL
-vncClient::SendCursorPosUpdate()
-{
-	m_cursor_pos_changed = FALSE;
-
-	rfbFramebufferUpdateRectHeader hdr;
-	hdr.encoding = Swap32IfLE(rfbEncodingPointerPos);
-	hdr.r.x = Swap16IfLE(m_cursor_pos.x);
-	hdr.r.y = Swap16IfLE(m_cursor_pos.y);
-	hdr.r.w = Swap16IfLE(0);
-	hdr.r.h = Swap16IfLE(0);
-
-	return m_socket->SendQueued((char *)&hdr, sizeof(hdr));
-}
-
-// Send NewFBSize pseudo-rectangle to notify the client about
-// framebuffer size change
-BOOL
-vncClient::SetNewFBSize(BOOL sendnewfb)
-{
-	rfbFramebufferUpdateRectHeader hdr;
-	RECT sharedRect;
-
-	sharedRect = m_server->GetSharedRect();
-
-	m_full_rgn.Clear();
-	m_incr_rgn.Clear();
-	m_full_rgn.AddRect(sharedRect);
-
-	if (!m_use_NewFBSize) {
-		// We cannot send NewFBSize message right now, maybe later
-		m_fb_size_changed = TRUE;
-
-	} else if (sendnewfb) {
-		hdr.r.x = 0;
-		hdr.r.y = 0;
-		hdr.r.w = Swap16IfLE(sharedRect.right - sharedRect.left);
-		hdr.r.h = Swap16IfLE(sharedRect.bottom - sharedRect.top);
-		hdr.encoding = Swap32IfLE(rfbEncodingNewFBSize);
-
-		rfbFramebufferUpdateMsg header;
-		header.nRects = Swap16IfLE(1);
-		if (!SendRFBMsg(rfbFramebufferUpdate, (BYTE *)&header,
-			sz_rfbFramebufferUpdateMsg))
-            return FALSE;
-
-		// Now send the message
-		if (!m_socket->SendQueued((char *)&hdr, sizeof(hdr)))
-			return FALSE;
-
-		// No pending NewFBSize anymore
-		m_fb_size_changed = FALSE;
-	}
-
-	return TRUE;
-}
-
-void
-vncClient::UpdateLocalFormat()
-{
-	m_buffer->UpdateLocalFormat();
-}
-
-char * 
-vncClientThread::ConvertPath(char *path)
-{
-	int len = strlen(path);
-	if(len >= 255) return path;
-	if((path[0] == '/') && (len == 1)) {path[0] = '\0'; return path;}
-	for(int i = 0; i < (len - 1); i++) {
-		if(path[i+1] == '/') path[i+1] = '\\';
-		path[i] = path[i+1];
-	}
-	path[len-1] = '\0';
-	return path;
-}
-
-void 
-vncClient::SendFileUploadCancel(unsigned short reasonLen, char *reason)
-{
-#if 0
-	omni_mutex_lock l(m_sendUpdateLock);
-
-	int msgLen = sz_rfbFileUploadCancelMsg + reasonLen;
-	char *pAllFUCMessage = new char[msgLen];
-	rfbFileUploadCancelMsg *pFUC = (rfbFileUploadCancelMsg *) pAllFUCMessage;
-	char *pFollow = &pAllFUCMessage[sz_rfbFileUploadCancelMsg];
-	pFUC->type = rfbFileUploadCancel;
-	pFUC->reasonLen = Swap16IfLE(reasonLen);
-	memcpy(pFollow, reason, reasonLen);
-	m_socket->SendExact(pAllFUCMessage, msgLen);
-	delete [] pAllFUCMessage;
-#endif
-}
-
-void 
-vncClient::Time70ToFiletime(unsigned int mTime, FILETIME *pFiletime)
-{
-#if 0
-	LONGLONG ll = Int32x32To64(mTime, 10000000) + 116444736000000000;
-	pFiletime->dwLowDateTime = (DWORD) ll;
-	pFiletime->dwHighDateTime = (DWORD)(ll >> 32);
-#endif
-}
-
-void 
-vncClient::SendFileDownloadFailed(unsigned short reasonLen, char *reason)
-{
-#if 0
-	omni_mutex_lock l(m_sendUpdateLock);
-
-	int msgLen = sz_rfbFileDownloadFailedMsg + reasonLen;
-	char *pAllFDFMessage = new char[msgLen];
-	rfbFileDownloadFailedMsg *pFDF = (rfbFileDownloadFailedMsg *) pAllFDFMessage;
-	char *pFollow = &pAllFDFMessage[sz_rfbFileDownloadFailedMsg];
-	pFDF->type = rfbFileDownloadFailed;
-	pFDF->reasonLen = Swap16IfLE(reasonLen);
-	memcpy(pFollow, reason, reasonLen);
-	m_socket->SendExact(pAllFDFMessage, msgLen);
-	delete [] pAllFDFMessage;
-#endif
-}
-
-void 
-vncClient::SendFileDownloadData(unsigned int mTime)
-{
-#if 0
-	omni_mutex_lock l(m_sendUpdateLock);
-
-	int msgLen = sz_rfbFileDownloadDataMsg + sizeof(unsigned int);
-	char *pAllFDDMessage = new char[msgLen];
-	rfbFileDownloadDataMsg *pFDD = (rfbFileDownloadDataMsg *) pAllFDDMessage;
-	unsigned int *pFollow = (unsigned int *) &pAllFDDMessage[sz_rfbFileDownloadDataMsg];
-	pFDD->type = rfbFileDownloadData;
-	pFDD->compressLevel = 0;
-	pFDD->compressedSize = Swap16IfLE(0);
-	pFDD->realSize = Swap16IfLE(0);
-	memcpy(pFollow, &mTime, sizeof(unsigned int));
-	m_socket->SendExact(pAllFDDMessage, msgLen);
-	delete [] pAllFDDMessage;
-#endif
-}
-
-void
-vncClient::SendFileDownloadPortion()
-{
-#if 0
-	if (!m_bDownloadStarted) return;
-	DWORD dwNumberOfBytesRead = 0;
-	m_rfbBlockSize = 8192;
-	char *pBuff = new char[m_rfbBlockSize];
-	BOOL bResult = ReadFile(m_hFileToRead, pBuff, m_rfbBlockSize, &dwNumberOfBytesRead, NULL);
-	if ((bResult) && (dwNumberOfBytesRead == 0)) {
-		/* This is the end of the file. */
-		SendFileDownloadData(m_modTime);
-		vnclog.Print(LL_CLIENTS, VNCLOG("file download complete: %s\n"), m_DownloadFilename);
-		CloseHandle(m_hFileToRead);
-		m_bDownloadStarted = FALSE;
-		return;
-	}
-	SendFileDownloadData((unsigned short)dwNumberOfBytesRead, pBuff);
-	delete [] pBuff;
-	PostToWinVNC(fileTransferDownloadMessage, (WPARAM) this, (LPARAM) 0);
-#endif
-}
-
-void 
-vncClient::SendFileDownloadData(unsigned short sizeFile, char *pFile)
-{
-#if 0
-	omni_mutex_lock l(m_sendUpdateLock);
-
-	int msgLen = sz_rfbFileDownloadDataMsg + sizeFile;
-	char *pAllFDDMessage = new char[msgLen];
-	rfbFileDownloadDataMsg *pFDD = (rfbFileDownloadDataMsg *) pAllFDDMessage;
-	char *pFollow = &pAllFDDMessage[sz_rfbFileDownloadDataMsg];
-	pFDD->type = rfbFileDownloadData;
-	pFDD->compressLevel = 0;
-	pFDD->compressedSize = Swap16IfLE(sizeFile);
-	pFDD->realSize = Swap16IfLE(sizeFile);
-	memcpy(pFollow, pFile, sizeFile);
-	m_socket->SendExact(pAllFDDMessage, msgLen);
-	delete [] pAllFDDMessage;
-#endif
-
-}
-
-#if 0
-unsigned int 
-vncClient::FiletimeToTime70(FILETIME filetime)
-{
-	LARGE_INTEGER uli;
-	uli.LowPart = filetime.dwLowDateTime;
-	uli.HighPart = filetime.dwHighDateTime;
-	uli.QuadPart = (uli.QuadPart - 116444736000000000) / 10000000;
-	return uli.LowPart;
-}
-#endif
-
-void
-vncClient::CloseUndoneFileTransfer()
-{
-	if (m_bUploadStarted) {
-		m_bUploadStarted = FALSE;
-		CloseHandle(m_hFileToWrite);
-		DeleteFile(m_UploadFilename);
-	}
-	if (m_bDownloadStarted) {
-		m_bDownloadStarted = FALSE;
-		CloseHandle(m_hFileToRead);
-	}
-}
diff --git a/ica/win32/src/vncClient.h b/ica/win32/src/vncClient.h
deleted file mode 100644
index 1a5e8b2..0000000
--- a/ica/win32/src/vncClient.h
+++ /dev/null
@@ -1,237 +0,0 @@
-//  Copyright (C) 2001 Constantin Kaplinsky. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncClient.h
-
-// vncClient class handles the following functions:
-// - Recieves requests from the connected client and
-//   handles them
-// - Handles incoming updates properly, using a vncBuffer
-//   object to keep track of screen changes
-// It uses a vncBuffer and is passed the vncDesktop and
-// vncServer to communicate with.
-
-class vncClient;
-typedef SHORT vncClientId;
-
-#if (!defined(_WINVNC_VNCCLIENT))
-#define _WINVNC_VNCCLIENT
-
-#include <list>
-
-typedef std::list<vncClientId> vncClientList;
-
-// Includes
-#include "stdhdrs.h"
-#include "VSocket.h"
-#include <omnithread.h>
-
-// Custom
-#include "rectlist.h"
-#include "vncDesktop.h"
-#include "vncRegion.h"
-#include "vncBuffer.h"
-#include "vncKeymap.h"
-
-// The vncClient class itself
-
-class vncClient
-{
-public:
-	// Constructor/destructor
-	vncClient();
-	virtual ~vncClient();
-
-	// Allow the client thread to see inside the client object
-	friend class vncClientThread;
-
-	// Init
-	virtual BOOL Init(vncServer *server,
-						VSocket *socket,
-						BOOL reverse,
-						BOOL shared,
-						vncClientId newid);
-
-	// Kill
-	// The server uses this to close the client socket, causing the
-	// client thread to fail, which in turn deletes the client object
-	virtual void Kill();
-
-	// Client manipulation functions for use by the server
-	virtual void SetBuffer(vncBuffer *buffer);
-
-	// Update handling functions
-	virtual void TriggerUpdate();
-	virtual void UpdateMouse();
-	virtual void UpdateRect(RECT &rect);
-	virtual void UpdateRegion(vncRegion &region);
-	virtual void CopyRect(RECT &dest, POINT &source);
-	virtual void UpdateClipText(LPSTR text);
-	virtual void UpdatePalette();
-
-	// Has the client sent an input event?
-	virtual BOOL RemoteEventReceived() {
-		BOOL result = m_remoteevent;
-		m_remoteevent = FALSE;
-		return result;
-	}
-
-	virtual void SetCursorPosChanged() {
-		if (time(NULL) - m_pointer_event_time > 1) {
-			m_cursor_pos_changed = TRUE;
-		}
-	}
-
-	// Functions for setting & getting the client settings
-	virtual void EnableKeyboard(BOOL enable) { m_keyboardenabled = enable; }
-	virtual void EnablePointer(BOOL enable)  { m_pointerenabled = enable;  }
-	virtual void BlockInput(BOOL block) { m_inputblocked = block; }
-	virtual BOOL IsKeyboardEnabled() { return m_keyboardenabled; }
-	virtual BOOL IsPointerEnabled()  { return m_pointerenabled;  }
-	virtual BOOL IsInputEnabled()    { return m_keyboardenabled || m_pointerenabled; }
-	virtual BOOL IsInputBlocked()    { return m_inputblocked; }
-
-	virtual const char *GetClientName();
-	virtual const char *GetServerName();
-	virtual vncClientId GetClientId() {return m_id;};
-
-	BOOL SetNewFBSize(BOOL sendnewfb);
-	BOOL IncrRgnRequested(){return !m_incr_rgn.IsEmpty();};
-	BOOL FullRgnRequested(){return !m_full_rgn.IsEmpty();};
-	void UpdateLocalFormat();
-
-
-
-	// Update routines
-protected:
-	BOOL SendUpdate();
-	BOOL SendRFBMsg(CARD8 type, BYTE *buffer, int buflen);
-	BOOL SendRectangles(rectlist &rects);
-	BOOL SendRectangle(RECT &rect);
-	BOOL SendCopyRect(RECT &dest, POINT &source);
-	BOOL SendCursorShapeUpdate();
-	BOOL SendCursorPosUpdate();
-	BOOL SendLastRect();
-	BOOL SendPalette();
-
-
-
-	// Internal stuffs
-protected:
-	// Per-client settings
-	int				m_protocol_minor_version;
-	BOOL			m_protocol_tightvnc;
-	BOOL			m_keyboardenabled;
-	BOOL			m_pointerenabled;
-	BOOL			m_inputblocked;
-	BOOL			m_copyrect_use;
-	vncClientId		m_id;
-
-	// The screen buffer
-	vncBuffer		*m_buffer;
-
-	// The server
-	vncServer		*m_server;
-
-	// The socket
-	VSocket			*m_socket;
-	char			*m_client_name;
-	char			*m_server_name;
-
-	// The client thread
-	omni_thread		*m_thread;
-
-	// Flag to indicate whether the client is ready for RFB messages
-	BOOL			m_protocol_ready;
-
-	// Flag to indicate that our framebuffer size has changed before
-	// the client has told that it supports NewFBSize message
-	BOOL			m_fb_size_changed;
-
-	// User input information
-	RECT			m_oldmousepos;
-	BOOL			m_mousemoved;
-	rfbPointerEventMsg	m_ptrevent;
-
-	// Support for cursor shape updates (XCursor, RichCursor encodings)
-	BOOL			m_cursor_update_pending;
-	BOOL			m_cursor_update_sent;
-	BOOL			m_cursor_pos_changed;
-	time_t			m_pointer_event_time;
-	HCURSOR			m_hcursor;
-	POINT			m_cursor_pos;
-
-	// Region structures used when preparing updates
-	// - region of rects which may have changed since last update
-	// - region for which incremental data is requested
-	// - region for which full data is requested
-	vncRegion		m_changed_rgn;
-	vncRegion		m_incr_rgn;
-	vncRegion		m_full_rgn;
-	omni_mutex		m_regionLock;
-
-	BOOL			m_copyrect_set;
-	RECT			m_copyrect_rect;
-	POINT			m_copyrect_src;
-
-	BOOL			m_updatewanted;
-	RECT			m_fullscreen;
-
-	// When the local display is palettized, it sometimes changes...
-	BOOL			m_palettechanged;
-
-	// Information used in polling mode!
-	BOOL			m_remoteevent;
-
-	BOOL			m_use_NewFBSize;
-	BOOL			m_use_PointerPos;
-
-	omni_mutex		m_sendUpdateLock;
-
-private:
-	unsigned int FiletimeToTime70(FILETIME filetime);
-	void SendFileDownloadData(unsigned short sizeFile, char *pFile);
-	void SendFileDownloadData(unsigned int mTime);
-	void SendFileUploadCancel(unsigned short reasonLen, char *reason);
-	void SendFileDownloadFailed(unsigned short reasonLen, char *reason);
-	void CloseUndoneFileTransfer();
-	BOOL m_bUploadStarted;
-	BOOL m_bDownloadStarted;
-	HANDLE m_hFileToRead;
-	HANDLE m_hFileToWrite;
-	char m_UploadFilename[MAX_PATH];
-	char m_DownloadFilename[MAX_PATH];
-	void Time70ToFiletime(unsigned int mTime, FILETIME *pFiletime);
-	unsigned int m_modTime;
-	unsigned int beginUploadTime;
-	unsigned int endUploadTime;
-	DWORD m_rfbBlockSize;
-public:
-	void SendFileDownloadPortion();
-};
-
-#endif
diff --git a/ica/win32/src/vncDesktop.cpp b/ica/win32/src/vncDesktop.cpp
deleted file mode 100644
index 707a9de..0000000
--- a/ica/win32/src/vncDesktop.cpp
+++ /dev/null
@@ -1,3164 +0,0 @@
-//  Copyright (C) 2001-2004 HorizonLive.com, Inc. All Rights Reserved.
-//  Copyright (C) 2001-2004 TightVNC Team. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-// vncDesktop implementation
-
-// System headers
-#include "stdhdrs.h"
-#include <omnithread.h>
-
-// Custom headers
-#include "WinVNC.h"
-#include "VNCHooks/VNCHooks.h"
-#include "vncServer.h"
-#include "vncRegion.h"
-#include "rectlist.h"
-#include "vncDesktop.h"
-#include "vncService.h"
-#include "WallpaperUtils.h"
-//#include "TsSessions.h"
-
-#if (_MSC_VER>= 1300)
-#include <fstream>
-#else
-#include <fstream>
-#endif
-
-// Constants
-const UINT RFB_SCREEN_UPDATE = RegisterWindowMessage("WinVNC.Update.DrawRect");
-const UINT RFB_COPYRECT_UPDATE = RegisterWindowMessage("WinVNC.Update.CopyRect");
-const UINT RFB_MOUSE_UPDATE = RegisterWindowMessage("WinVNC.Update.Mouse");
-// Messages for blocking remote input events
-const UINT RFB_LOCAL_KEYBOARD = RegisterWindowMessage("WinVNC.Local.Keyboard");
-const UINT RFB_LOCAL_MOUSE = RegisterWindowMessage("WinVNC.Local.Mouse");
-
-const char szDesktopSink[] = "WinVNC desktop sink";
-
-// Atoms
-const char *VNC_WINDOWPOS_ATOMNAME = "VNCHooks.CopyRect.WindowPos";
-ATOM VNC_WINDOWPOS_ATOM = (ATOM) NULL;
-
-// Static members to use with new polling algorithm
-const int vncDesktop::m_pollingOrder[32] = {
-	 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
-};
-int vncDesktop::m_pollingStep = 0;
-
-
-BOOL IsWinNT()
-{
-	return vncService::IsWinNT();
-}
-
-BOOL IsWinVerOrHigher(ULONG mj, ULONG mn)
-{
-	return vncService::VersionMajor() > mj ||
-		vncService::VersionMajor() == mj && vncService::VersionMinor() >= mn;
-}
-
-BOOL IsNtVer(ULONG mj, ULONG mn)
-{
-	if (!vncService::IsWinNT())	
-		return FALSE;
-	return vncService::VersionMajor() == mj && vncService::VersionMinor() == mn;
-}
-
-BOOL vncDesktop::IsMultiMonDesktop()
-{
-	if (!IsWinVerOrHigher(4, 10))
-		return FALSE;
-	return GetSystemMetrics(SM_CMONITORS) > 1;
-}
-
-// The desktop handler thread
-// This handles the messages posted by RFBLib to the vncDesktop window
-
-class vncDesktopThread : public omni_thread
-{
-public:
-	vncDesktopThread() { m_returnsig = NULL; }
-protected:
-	~vncDesktopThread() { if (m_returnsig != NULL) delete m_returnsig; }
-public:
-	virtual BOOL Init(vncDesktop *desktop, vncServer *server);
-	virtual void *run_undetached(void *arg);
-	virtual void ReturnVal(BOOL result);
-
-protected:
-	vncServer *m_server;
-	vncDesktop *m_desktop;
-
-	omni_mutex m_returnLock;
-	omni_condition *m_returnsig;
-	BOOL m_return;
-	BOOL m_returnset;
-};
-
-BOOL
-vncDesktopThread::Init(vncDesktop *desktop, vncServer *server)
-{
-	// Save the server pointer
-	m_server = server;
-	m_desktop = desktop;
-
-	m_returnset = FALSE;
-	m_returnsig = new omni_condition(&m_returnLock);
-
-	// Start the thread
-	start_undetached();
-
-	// Wait for the thread to let us know if it failed to init
-	{	omni_mutex_lock l(m_returnLock);
-
-		while (!m_returnset)
-		{
-			m_returnsig->wait();
-		}
-	}
-
-	return m_return;
-}
-
-void
-vncDesktopThread::ReturnVal(BOOL result)
-{
-	omni_mutex_lock l(m_returnLock);
-
-	m_returnset = TRUE;
-	m_return = result;
-	m_returnsig->signal();
-}
-
-void *vncDesktopThread::run_undetached(void *arg)
-{
-	// Save the thread's "home" desktop, under NT (no effect under 9x)
-	HDESK home_desktop = GetThreadDesktop(GetCurrentThreadId());
-
-#if 0
-	// Try to make session zero the console session
-	if (!inConsoleSession())
-		setConsoleSession();
-#endif
-
-	// Attempt to initialise and return success or failure
-	if (!m_desktop->Startup())
-	{
-// vncDesktop::Startup might mave changed video mode in SetupDisplayForConnection.
-// it has to be reverted then.
-// TODO: review strong guarantee conditions for vncDesktop::Startup
-		m_desktop->ResetDisplayToNormal();
-		vncService::SelectHDESK(home_desktop);
-		ReturnVal(FALSE);
-		return NULL;
-	}
-
-	RECT rect = m_desktop->GetSourceRect();
-	IntersectRect(&rect, &rect, &m_desktop->m_bmrect);
-	m_server->SetSharedRect(rect);
-
-	// Succeeded to initialise ok
-	ReturnVal(TRUE);
-
-	// START PROCESSING DESKTOP MESSAGES
-
-	// We set a flag inside the desktop handler here, to indicate it's now safe
-	// to handle clipboard messages
-	m_desktop->SetClipboardActive(TRUE);
-
-	SYSTEMTIME systime;
-	FILETIME ftime;
-	ULARGE_INTEGER now, droptime;
-	droptime.QuadPart = 0;
-
-	MSG msg;
-	while (TRUE)
-	{
-		if (!PeekMessage(&msg, m_desktop->Window(), (UINT) NULL, (UINT) NULL, PM_REMOVE))
-		{
-			// Whenever the message queue becomes empty, we check to see whether
-			// there are updates to be passed to clients (first we make sure
-			// that scheduled wallpaper removal is complete).
-			if (!m_server->WallpaperWait()) {
-				if (!m_desktop->CheckUpdates())
-					break;
-			}
-
-			// Now wait for more messages to be queued
-			if (!WaitMessage())
-			{
-				vnclog.Print(LL_INTERR, VNCLOG("WaitMessage() failed\n"));
-				break;
-			}
-		}
-		else if (msg.message == RFB_SCREEN_UPDATE)
-		{
-// TODO: suppress this message from hook when driver is active
-
-			// An area of the screen has changed (ignore if we have a driver)
-			if (m_desktop->m_videodriver == NULL)
-			{
-				RECT rect;
-				rect.left =	(SHORT)LOWORD(msg.wParam);
-				rect.top = (SHORT)HIWORD(msg.wParam);
-				rect.right = (SHORT)LOWORD(msg.lParam);
-				rect.bottom = (SHORT)HIWORD(msg.lParam);
-				m_desktop->m_changed_rgn.AddRect(rect);
-			}
-		}
-		else if (msg.message == RFB_MOUSE_UPDATE)
-		{
-			// Save the cursor ID
-			m_desktop->SetCursor((HCURSOR) msg.wParam);
-		}
-		else if (msg.message == RFB_LOCAL_KEYBOARD)
-		{
-			// Block remote input events if necessary
-			if (vncService::IsWin95()) {
-				m_server->SetKeyboardCounter(-1);
-				if (m_server->KeyboardCounter() < 0) {
-					GetSystemTime(&systime);
-					SystemTimeToFileTime(&systime, &ftime);
-					droptime.LowPart = ftime.dwLowDateTime; 
-					droptime.HighPart = ftime.dwHighDateTime;
-					droptime.QuadPart /= 10000000;	// convert into seconds
-					m_server->BlockRemoteInput(true);
-				}
-			} else {
-				GetSystemTime(&systime);
-				SystemTimeToFileTime(&systime, &ftime);
-				droptime.LowPart = ftime.dwLowDateTime; 
-				droptime.HighPart = ftime.dwHighDateTime;
-				droptime.QuadPart /= 10000000;	// convert into seconds
-				m_server->BlockRemoteInput(true);
-			}
-		}
-		else if (msg.message == RFB_LOCAL_MOUSE)
-		{
-			// Block remote input events if necessary
-			if (vncService::IsWin95()) {
-				if (msg.wParam == WM_MOUSEMOVE) {
-					m_server->SetMouseCounter(-1, msg.pt, true);
-				} else {
-					m_server->SetMouseCounter(-1, msg.pt, false);
-				}
-				if (m_server->MouseCounter() < 0 && droptime.QuadPart == 0) {
-					GetSystemTime(&systime);
-					SystemTimeToFileTime(&systime, &ftime);
-					droptime.LowPart = ftime.dwLowDateTime; 
-					droptime.HighPart = ftime.dwHighDateTime;
-					droptime.QuadPart /= 10000000;	// convert into seconds
-					m_server->BlockRemoteInput(true);
-				}
-			} else {
-				GetSystemTime(&systime);
-				SystemTimeToFileTime(&systime, &ftime);
-				droptime.LowPart = ftime.dwLowDateTime; 
-				droptime.HighPart = ftime.dwHighDateTime;
-				droptime.QuadPart /= 10000000;	// convert into seconds
-				m_server->BlockRemoteInput(true);
-			}
-		}
-		else if (msg.message == WM_QUIT)
-		{
-			break;
-		}
-#ifdef HORIZONLIVE
-		else if (msg.message == LS_QUIT)
-		{
-			// this is our custom quit message
-			vnclog.Print(LL_INTINFO, VNCLOG("Received LS_QUIT message.\n"));
-			break;
-		}
-#endif
-		else
-		{
-			// Process any other messages normally
-			DispatchMessage(&msg);
-		}
-
-		// Check timer to unblock remote input events if necessary
-		// FIXME: rewrite this stuff to eliminate code duplication (ses above).
-		// FIXME: Use time() instead of GetSystemTime().
-		// FIXME: It's not necessary to do this on receiving _each_ message.
-		if (m_server->LocalInputPriority() && droptime.QuadPart != 0) {
-			GetSystemTime(&systime);
-			SystemTimeToFileTime(&systime, &ftime);
-			now.LowPart = ftime.dwLowDateTime;
-			now.HighPart = ftime.dwHighDateTime;
-			now.QuadPart /= 10000000;	// convert into seconds
-
-			if (now.QuadPart - m_server->DisableTime() >= droptime.QuadPart) {
-				m_server->BlockRemoteInput(false);
-				droptime.QuadPart = 0;
-				m_server->SetKeyboardCounter(0);
-				m_server->SetMouseCounter(0, msg.pt, false);
-			}
-		}
-	}
-
-	m_desktop->SetClipboardActive(FALSE);
-	
-	vnclog.Print(LL_INTINFO, VNCLOG("quitting desktop server thread\n"));
-
-	// Clear all the hooks and close windows, etc.
-	m_desktop->Shutdown();
-	// Return display settings to previous values.
-	m_desktop->ResetDisplayToNormal();
-	// Turn on the screen.
-	m_desktop->BlankScreen(FALSE);
-
-	// Clear the shift modifier keys, now that there are no remote clients
-	vncKeymap::ClearShiftKeys();
-
-	// Switch back into our home desktop, under NT (no effect under 9x)
-	vncService::SelectHDESK(home_desktop);
-
-	return NULL;
-}
-
-// Implementation of the vncDesktop class
-
-vncDesktop::vncDesktop()
-{
-	m_thread = NULL;
-
-	m_hwnd = NULL;
-	m_polling_flag = FALSE;
-	m_timer_polling = 0;
-	m_timer_blank_screen = 0;
-	m_hnextviewer = NULL;
-	m_hcursor = NULL;
-
-	m_displaychanged = FALSE;
-
-	m_hrootdc = NULL;
-	m_hmemdc = NULL;
-	m_membitmap = NULL;
-
-	m_initialClipBoardSeen = FALSE;
-
-	// Vars for Will Dean's DIBsection patch
-	m_DIBbits = NULL;
-	m_freemainbuff = FALSE;
-	m_formatmunged = FALSE;
-	m_mainbuff = NULL;
-	m_backbuff = NULL;
-
-	m_clipboard_active = FALSE;
-	m_hooks_active = FALSE;
-	m_hooks_may_change = FALSE;
-	m_lpAlternateDevMode = NULL;
-	m_copyrect_set = FALSE;
-
-	m_videodriver = NULL;
-
-	m_timer_blank_screen = 0;
-}
-
-vncDesktop::~vncDesktop()
-{
-	vnclog.Print(LL_INTINFO, VNCLOG("killing desktop server\n"));
-
-	// If we created a thread then here we delete it
-	// The thread itself does most of the cleanup
-	if(m_thread != NULL)
-	{
-		// Post a close message to quit our message handler thread
-		PostMessage(Window(), WM_QUIT, 0, 0);
-
-		// Join with the desktop handler thread
-		void *returnval;
-		m_thread->join(&returnval);
-		m_thread = NULL;
-	}
-
-	// Let's call Shutdown just in case something went wrong...
-	Shutdown();
-	_ASSERTE(!m_lpAlternateDevMode);
-}
-
-// Routine to startup and install all the hooks and stuff
-BOOL
-vncDesktop::Startup()
-{
-#if 0
-	// Currently, we just check whether we're in the console session, and
-	//   fail if not
-	if (!inConsoleSession()) {
-		vnclog.Print(LL_INTERR, VNCLOG("Console is not session zero - reconnect to restore Console session"));
-		return FALSE;
-	}
-#endif
-
-	// Configure the display for optimal VNC performance.
-	SetupDisplayForConnection();
-
-	// Initialise the Desktop object
-	if (!InitDesktop())
-		return FALSE;
-
-	if (InitVideoDriver())
-	{
-// this isn't really necessary
-//		InvalidateRect(NULL,NULL,TRUE);
-	}
-
-	if (!InitBitmap())
-		return FALSE;
-
-	if (!ThunkBitmapInfo())
-		return FALSE;
-
-	if (!SetPixFormat())
-		return FALSE;
-
-	if (!CreateBuffers())
-		return FALSE;
-
-	if (!SetPixShifts())
-		return FALSE;
-
-	if (!SetPalette())
-		return FALSE;
-
-	if (!InitWindow())
-		return FALSE;
-
-	// Add the system hook
-	ActivateHooks();
-	m_hooks_may_change = true;
-
-#ifndef HORIZONLIVE
-	// Start up the keyboard and mouse filters
-	SetKeyboardFilterHook(m_server->LocalInputsDisabled());
-	SetMouseFilterHook(m_server->LocalInputsDisabled());
-#endif
-
-	// Start up the keyboard and mouse hooks  for 
-	// local event priority over remote impl.
-	if (m_server->LocalInputPriority())
-		SetLocalInputPriorityHook(true);
-
-	// Start a timer to handle Polling Mode.  The timer will cause
-	// an "idle" event, which is necessary if Polling Mode is being used,
-	// to cause TriggerUpdate to be called.
-	SetPollingFlag(FALSE);
-	SetPollingTimer();
-
-	// If necessary, start a separate timer to preserve the diplay turned off.
-	UpdateBlankScreenTimer();
-
-	// Get hold of the WindowPos atom!
-	if ((VNC_WINDOWPOS_ATOM = GlobalAddAtom(VNC_WINDOWPOS_ATOMNAME)) == 0) {
-		vnclog.Print(LL_INTERR, VNCLOG("GlobalAddAtom() failed.\n"));
-		return FALSE;
-	}
-
-// this member must be initialized: we cant assume the absence
-// of clients when desktop is created.
-	m_cursorpos.left = 0;
-	m_cursorpos.top = 0;
-	m_cursorpos.right = 0;
-	m_cursorpos.bottom = 0;
-
-	// Everything is ok, so return TRUE
-	return TRUE;
-}
-
-// Routine to shutdown all the hooks and stuff
-BOOL vncDesktop::Shutdown()
-{
-	// If we created timers then kill them
-	if (m_timer_polling)
-	{
-		KillTimer(Window(), TIMER_POLL);
-		m_timer_polling = 0;
-	}
-	if (m_timer_blank_screen)
-	{
-		KillTimer(Window(), TIMER_BLANK_SCREEN);
-		m_timer_blank_screen = 0;
-	}
-
-	// If we created a window then kill it and the hooks
-	if (m_hwnd != NULL)
-	{	
-		//Remove the system hooks
-		//Unset keyboard and mouse hooks
-		SetLocalInputPriorityHook(false);
-		m_hooks_may_change = false;
-		ShutdownHooks();
-
-#ifndef HORIZONLIVE
-		// Stop the keyboard and mouse filters
-		SetKeyboardFilterHook(false);
-		SetMouseFilterHook(false);
-#endif
-		// The window is being closed - remove it from the viewer list
-		ChangeClipboardChain(m_hwnd, m_hnextviewer);
-
-		// Close the hook window
-		DestroyWindow(m_hwnd);
-		m_hwnd = NULL;
-		m_hnextviewer = NULL;
-	}
-
-	// Now free all the bitmap stuff
-	if (m_hrootdc != NULL)
-	{
-		// Release our device context
-		if(ReleaseDC(NULL, m_hrootdc) == 0)
-		{
-			vnclog.Print(LL_INTERR, VNCLOG("failed to ReleaseDC(m_hrootdc)\n"));
-		}
-		m_hrootdc = NULL;
-	}
-	if (m_hmemdc != NULL)
-	{
-		// Release our device context
-		if (!DeleteDC(m_hmemdc))
-		{
-			vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteDC(m_hmemdc)\n"));
-		}
-		m_hmemdc = NULL;
-	}
-	if (m_membitmap != NULL)
-	{
-		// Release the custom bitmap, if any
-		if (!DeleteObject(m_membitmap))
-		{
-			vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteObject\n"));
-		}
-		m_membitmap = NULL;
-	}
-
-	// Free back buffer
-	if (m_backbuff != NULL)
-	{
-		delete [] m_backbuff;
-		m_backbuff = NULL;
-	}
-
-	if (m_freemainbuff)
-	{
-		// Slow blits were enabled - free the slow blit buffer
-		if (m_mainbuff != NULL)
-		{
-			delete [] m_mainbuff;
-			m_mainbuff = NULL;
-		}
-	}
-
-	// Free the WindowPos atom!
-	if (VNC_WINDOWPOS_ATOM != (ATOM) NULL)
-	{
-		if (GlobalDeleteAtom(VNC_WINDOWPOS_ATOM) != 0)
-		{
-			vnclog.Print(LL_INTERR, VNCLOG("failed to delete atom!\n"));
-		}
-	}
-
-	ShutdownVideoDriver();
-
-	return TRUE;
-}
-
-// Routines to set/unset hooks via VNCHooks.dll
-
-void
-vncDesktop::ActivateHooks()
-{
-	BOOL enable = !(m_server->DontSetHooks() && m_server->PollFullScreen());
-	if (enable && !m_hooks_active) {
-		m_hooks_active = SetHook(m_hwnd,
-								 RFB_SCREEN_UPDATE,
-								 RFB_COPYRECT_UPDATE,
-								 RFB_MOUSE_UPDATE);
-		if (!m_hooks_active) {
-			vnclog.Print(LL_INTERR, VNCLOG("failed to set system hooks\n"));
-			// Switch on full screen polling, so they can see something, at least...
-			m_server->PollFullScreen(TRUE);
-		}
-	} else if (!enable) {
-		ShutdownHooks();
-	}
-}
-
-void
-vncDesktop::ShutdownHooks()
-{
-	if (m_hooks_active)
-		m_hooks_active = !UnSetHook(m_hwnd);
-}
-
-void
-vncDesktop::TryActivateHooks()
-{
-	if (m_hooks_may_change)
-		ActivateHooks();
-}
-
-// Routine to ensure we're on the correct NT desktop
-
-BOOL
-vncDesktop::InitDesktop()
-{
-	if (vncService::InputDesktopSelected())
-		return TRUE;
-
-	// Ask for the current input desktop
-	return vncService::SelectDesktop(NULL);
-}
-
-// Routine used to close the screen saver, if it's active...
-
-BOOL CALLBACK
-KillScreenSaverFunc(HWND hwnd, LPARAM lParam)
-{
-	char buffer[256];
-
-	// - ONLY try to close Screen-saver windows!!!
-	if ((GetClassName(hwnd, buffer, 256) != 0) &&
-		(strcmp(buffer, "WindowsScreenSaverClass") == 0))
-		PostMessage(hwnd, WM_CLOSE, 0, 0);
-	return TRUE;
-}
-
-void
-vncDesktop::KillScreenSaver()
-{
-	OSVERSIONINFO osversioninfo;
-	osversioninfo.dwOSVersionInfoSize = sizeof(osversioninfo);
-
-	// Get the current OS version
-	if (!GetVersionEx(&osversioninfo))
-		return;
-
-	vnclog.Print(LL_INTINFO, VNCLOG("KillScreenSaver...\n"));
-
-	// How to kill the screen saver depends on the OS
-	switch (osversioninfo.dwPlatformId)
-	{
-	case VER_PLATFORM_WIN32_WINDOWS:
-		{
-			// Windows 95
-
-			// Fidn the ScreenSaverClass window
-			HWND hsswnd = FindWindow ("WindowsScreenSaverClass", NULL);
-			if (hsswnd != NULL)
-				PostMessage(hsswnd, WM_CLOSE, 0, 0); 
-			break;
-		} 
-	case VER_PLATFORM_WIN32_NT:
-		{
-			// Windows NT
-
-			// Find the screensaver desktop
-			HDESK hDesk = OpenDesktop(
-				"Screen-saver",
-				0,
-				FALSE,
-				DESKTOP_READOBJECTS | DESKTOP_WRITEOBJECTS
-				);
-			if (hDesk != NULL)
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("Killing ScreenSaver\n"));
-
-				// Close all windows on the screen saver desktop
-				EnumDesktopWindows(hDesk, (WNDENUMPROC) &KillScreenSaverFunc, 0);
-				CloseDesktop(hDesk);
-				// Pause long enough for the screen-saver to close
-				//Sleep(2000);
-				// Reset the screen saver so it can run again
-				SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, (UINT) TRUE, 0, SPIF_SENDWININICHANGE); 
-			}
-			break;
-		}
-	}
-}
-
-void vncDesktop::ChangeResNow()
-{
-// IMPORTANT: Screen mode alteration may only take place on a single-mon system.
-	if (IsMultiMonDesktop())
-	{
-		return;
-	}
-
-	BOOL settingsUpdated = false;
-
-	_ASSERTE(!m_lpAlternateDevMode);
-	m_lpAlternateDevMode = new DEVMODE; // *** create an instance of DEVMODE - Jeremy Peaks
-	if (!m_lpAlternateDevMode)
-	{
-		vnclog.Print(LL_INTINFO, VNCLOG("SCR-WBB: failed to allocate memory "
-										"for alternate DEVMODE representation!\n"));
-		return;
-	}
-
-	// *** WBB - Obtain the current display settings.
-	// only on unimon
-	if (! EnumDisplaySettings(0, ENUM_CURRENT_SETTINGS, m_lpAlternateDevMode))
-	{
-		vnclog.Print(LL_INTINFO,
-					 VNCLOG("SCR-WBB: could not get current display settings!\n"));
-		delete m_lpAlternateDevMode;
-		m_lpAlternateDevMode = NULL;
-		return;
-
-	}
-
-	vnclog.Print(LL_INTINFO,
-				 VNCLOG("SCR-WBB: current display: w=%d h=%d bpp=%d vRfrsh=%d.\n"),
-				 m_lpAlternateDevMode->dmPelsWidth,
-				 m_lpAlternateDevMode->dmPelsHeight,
-				 m_lpAlternateDevMode->dmBitsPerPel,
-				 m_lpAlternateDevMode->dmDisplayFrequency);
-
-	origPelsWidth = m_lpAlternateDevMode->dmPelsWidth; // *** sets the original resolution for use later
-	origPelsHeight = m_lpAlternateDevMode->dmPelsHeight; // *** - Jeremy Peaks
-
-	// *** Open the registry key for resolution settings
-	HKEY checkdetails = 0;
-	RegOpenKeyEx(HKEY_LOCAL_MACHINE, 
-				WINVNC_REGISTRY_KEY,
-				0,
-				KEY_READ,
-				&checkdetails);
-	if (checkdetails)
-	{
-		int slen=MAX_REG_ENTRY_LEN;
-		int valType;
-		char inouttext[MAX_REG_ENTRY_LEN];
-
-		memset(inouttext, 0, MAX_REG_ENTRY_LEN);
-		
-		// *** Get the registry values for resolution change - Jeremy Peaks
-		RegQueryValueEx(checkdetails,
-			"ResWidth",
-			NULL,
-			(LPDWORD) &valType,
-			(LPBYTE) &inouttext,
-			(LPDWORD) &slen);
-
-		
-		if ((valType == REG_SZ) &&
-			atol(inouttext)) { // *** if width is 0, then this isn't a valid resolution, so do nothing - Jeremy Peaks
-			m_lpAlternateDevMode->dmPelsWidth = atol(inouttext);
-
-			memset(inouttext, 0, MAX_REG_ENTRY_LEN);
-
-			RegQueryValueEx(checkdetails,
-				"ResHeight",
-				NULL,
-				(LPDWORD) &valType,
-				(LPBYTE) &inouttext,
-				(LPDWORD) &slen);
-			
-			m_lpAlternateDevMode->dmPelsHeight = atol(inouttext);
-			if ((valType == REG_SZ ) &&
-				(m_lpAlternateDevMode->dmPelsHeight > 0)) {
-
-				vnclog.Print(LL_INTINFO,
-					VNCLOG("SCR-WBB: attempting to change "
-						   "resolution w=%d h=%d\n"),
-					m_lpAlternateDevMode->dmPelsWidth,
-					m_lpAlternateDevMode->dmPelsHeight);
-
-				// *** make res change - Jeremy Peaks
-				// testing: predefined Width/Height may become incompatible
-				// with new clrdepth/timings
-				long resultOfResChange = ChangeDisplaySettings(m_lpAlternateDevMode, CDS_TEST);
-				if (resultOfResChange == DISP_CHANGE_SUCCESSFUL) {
-					ChangeDisplaySettings(m_lpAlternateDevMode, CDS_UPDATEREGISTRY);
-					settingsUpdated = true;
-				}
-			} 
-		}
-
-		RegCloseKey(checkdetails);
-	}
-
-	if (! settingsUpdated)
-	{
-// Did not change the resolution.
-		delete m_lpAlternateDevMode;
-		m_lpAlternateDevMode = NULL;
-	}
-}
-
-void
-vncDesktop::SetupDisplayForConnection()
-{
-	KillScreenSaver();
-
-	ChangeResNow(); // *** - Jeremy Peaks
-}
-
-void
-vncDesktop::ResetDisplayToNormal()
-{
-	if (m_lpAlternateDevMode != NULL)
-	{
-		// *** In case the resolution was changed, revert to original settings now
-		m_lpAlternateDevMode->dmPelsWidth = origPelsWidth;
-		m_lpAlternateDevMode->dmPelsHeight = origPelsHeight;
-
-		long resultOfResChange = ChangeDisplaySettings(m_lpAlternateDevMode, CDS_TEST);
-		if (resultOfResChange == DISP_CHANGE_SUCCESSFUL)
-			ChangeDisplaySettings(m_lpAlternateDevMode, CDS_UPDATEREGISTRY);
-
-		delete m_lpAlternateDevMode;
-		m_lpAlternateDevMode = NULL;
-	}
-}
-
-RECT vncDesktop::GetSourceRect()
-{
-	if (m_server->WindowShared())
-	{
-		RECT wrect;
-		GetWindowRect(m_server->GetWindowShared(), &wrect);
-		return wrect;
-	}
-	else if (m_server->ScreenAreaShared())
-	{
-		return m_server->GetScreenAreaRect();
-	}
-	else if (m_server->PrimaryDisplayOnlyShared())
-	{
-		RECT pdr = { 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN) };
-		return pdr;
-	}
-	else
-	{
-#ifdef _DEBUG
-		RECT rd;
-		_ASSERTE(GetSourceDisplayRect(rd));
-		_ASSERTE(EqualRect(&rd, &m_bmrect));
-#endif
-		return m_bmrect;
-	}
-}
-
-RECT	GetScreenRect()
-{
-	RECT screenrect;
-	if (IsWinVerOrHigher(4, 10))
-	{
-		screenrect.left		= GetSystemMetrics(SM_XVIRTUALSCREEN);
-		screenrect.top		= GetSystemMetrics(SM_YVIRTUALSCREEN);
-		screenrect.right	= screenrect.left + GetSystemMetrics(SM_CXVIRTUALSCREEN);
-		screenrect.bottom	= screenrect.top + GetSystemMetrics(SM_CYVIRTUALSCREEN);
-	}
-	else
-	{
-		screenrect.left = 0;
-		screenrect.top = 0;
-		screenrect.right = GetSystemMetrics(SM_CXSCREEN);
-		screenrect.bottom = GetSystemMetrics(SM_CYSCREEN);
-	}
-	return screenrect;
-}
-
-BOOL vncDesktop::GetSourceDisplayRect(RECT &rdisp_rect)
-{
-	if (!m_hrootdc)
-		m_hrootdc = ::GetDC(NULL);
-	if (!m_hrootdc)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("GetDC() failed, error=%d\n"), GetLastError());
-		return FALSE;
-	}
-
-// TODO: refactor it
-	rdisp_rect = GetScreenRect();
-	return TRUE;
-}
-
-BOOL vncDesktop::InitBitmap()
-{
-// IMPORTANT: here an optimization may be implemented
-// when only a fixed rect is shared.
-// then m_bmrect should be set to that rect.
-	if (!GetSourceDisplayRect(m_bmrect))
-	{
-		return FALSE;
-	}
-
-	vnclog.Print(
-		LL_INTINFO,
-		VNCLOG("source desktop metrics: (%d, %d, %d, %d)\n"),
-		m_bmrect.left,
-		m_bmrect.top,
-		m_bmrect.right,
-		m_bmrect.bottom);
-
-	vnclog.Print(
-		LL_INTINFO,
-		VNCLOG("bitmap dimensions are %dx%d\n"),
-		m_bmrect.right - m_bmrect.left,
-		m_bmrect.bottom - m_bmrect.top);
-
-	// Create a compatible memory DC
-	m_hmemdc = CreateCompatibleDC(m_hrootdc);
-	if (m_hmemdc == NULL) {
-		vnclog.Print(LL_INTERR, VNCLOG("CreateCompatibleDC() failed, error=%d\n"),
-					 GetLastError());
-		return FALSE;
-	}
-
-	// Check that the device capabilities are ok
-	if ((GetDeviceCaps(m_hrootdc, RASTERCAPS) & RC_BITBLT) == 0)
-	{
-// FIXME: MessageBox in a service
-		MessageBox(
-			NULL,
-			"vncDesktop : root device doesn't support BitBlt\n"
-			"WinVNC cannot be used with this graphic device driver",
-			szAppName,
-			MB_ICONSTOP | MB_OK
-			);
-		return FALSE;
-	}
-	if ((GetDeviceCaps(m_hmemdc, RASTERCAPS) & RC_DI_BITMAP) == 0)
-	{
-// FIXME: MessageBox in a service
-		MessageBox(
-			NULL,
-			"vncDesktop : memory device doesn't support GetDIBits\n"
-			"WinVNC cannot be used with this graphics device driver",
-			szAppName,
-			MB_ICONSTOP | MB_OK
-			);
-		return FALSE;
-	}
-
-	// Create the bitmap to be compatible with the ROOT DC!!!
-	m_membitmap = CreateCompatibleBitmap(
-		m_hrootdc,
-		m_bmrect.right - m_bmrect.left,
-		m_bmrect.bottom - m_bmrect.top);
-	if (m_membitmap == NULL)
-	{
-		vnclog.Print(
-			LL_INTERR,
-			VNCLOG("failed to create memory bitmap, error=%d\n"),
-			GetLastError());
-		return FALSE;
-	}
-	vnclog.Print(LL_INTINFO, VNCLOG("created memory bitmap\n"));
-
-	// Get the bitmap's format and colour details
-	int result;
-	m_bminfo.bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
-	m_bminfo.bmi.bmiHeader.biBitCount = 0;
-	result = ::GetDIBits(m_hmemdc, m_membitmap, 0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS);
-	if (result == 0) {
-		return FALSE;
-	}
-	result = ::GetDIBits(m_hmemdc, m_membitmap, 0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS);
-	if (result == 0) {
-		return FALSE;
-	}
-	vnclog.Print(LL_INTINFO, VNCLOG("got bitmap format\n"));
-	vnclog.Print(LL_INTINFO, VNCLOG("DBG:display context has %d planes!\n"), GetDeviceCaps(m_hrootdc, PLANES));
-	vnclog.Print(LL_INTINFO, VNCLOG("DBG:memory context has %d planes!\n"), GetDeviceCaps(m_hmemdc, PLANES));
-	if (GetDeviceCaps(m_hmemdc, PLANES) != 1)
-	{
-// FIXME: MessageBox in a service
-		MessageBox(
-			NULL,
-			"vncDesktop : current display is PLANAR, not CHUNKY!\n"
-			"WinVNC cannot be used with this graphics device driver",
-			szAppName,
-			MB_ICONSTOP | MB_OK
-			);
-		return FALSE;
-	}
-
-	// Henceforth we want to use a top-down scanning representation
-	m_bminfo.bmi.bmiHeader.biHeight = - abs(m_bminfo.bmi.bmiHeader.biHeight);
-
-	// Is the bitmap palette-based or truecolour?
-	m_bminfo.truecolour = (GetDeviceCaps(m_hmemdc, RASTERCAPS) & RC_PALETTE) == 0;
-
-	return TRUE;
-}
-
-
-BOOL
-vncDesktop::ThunkBitmapInfo()
-{
-	// If we leave the pixel format intact, the blits can be optimised (Will Dean's patch)
-	m_formatmunged = FALSE;
-
-	// HACK ***.  Optimised blits don't work with palette-based displays, yet
-	if (!m_bminfo.truecolour) {
-		m_formatmunged = TRUE;
-	}
-
-	// Attempt to force the actual format into one we can handle
-	// We can handle 8-bit-palette and 16/32-bit-truecolour modes
-	switch (m_bminfo.bmi.bmiHeader.biBitCount)
-	{
-	case 1:
-	case 4:
-		vnclog.Print(LL_INTINFO, VNCLOG("DBG:used/bits/planes/comp/size "
-										"= %d/%d/%d/%d/%d\n"),
-					 (int)m_bminfo.bmi.bmiHeader.biClrUsed,
-					 (int)m_bminfo.bmi.bmiHeader.biBitCount,
-					 (int)m_bminfo.bmi.bmiHeader.biPlanes,
-					 (int)m_bminfo.bmi.bmiHeader.biCompression,
-					 (int)m_bminfo.bmi.bmiHeader.biSizeImage);
-		
-		// Correct the BITMAPINFO header to the format we actually want
-		m_bminfo.bmi.bmiHeader.biClrUsed = 0;
-		m_bminfo.bmi.bmiHeader.biPlanes = 1;
-		m_bminfo.bmi.bmiHeader.biCompression = BI_RGB;
-		m_bminfo.bmi.bmiHeader.biBitCount = 8;
-		m_bminfo.bmi.bmiHeader.biSizeImage =
-			abs((m_bminfo.bmi.bmiHeader.biWidth *
-				m_bminfo.bmi.bmiHeader.biHeight *
-				m_bminfo.bmi.bmiHeader.biBitCount)/ 8);
-		m_bminfo.bmi.bmiHeader.biClrImportant = 0;
-		m_bminfo.truecolour = FALSE;
-
-		// Display format is non-VNC compatible - use the slow blit method
-		m_formatmunged = TRUE;
-		break;	
-	case 24:
-		// Update the bitmapinfo header
-		m_bminfo.bmi.bmiHeader.biBitCount = 32;
-		m_bminfo.bmi.bmiHeader.biPlanes = 1;
-		m_bminfo.bmi.bmiHeader.biCompression = BI_RGB;
-		m_bminfo.bmi.bmiHeader.biSizeImage =
-			abs((m_bminfo.bmi.bmiHeader.biWidth *
-				m_bminfo.bmi.bmiHeader.biHeight *
-				m_bminfo.bmi.bmiHeader.biBitCount)/ 8);
-		// Display format is non-VNC compatible - use the slow blit method
-		m_formatmunged = TRUE;
-		break;
-	}
-
-	return TRUE;
-}
-
-BOOL
-vncDesktop::SetPixFormat()
-{
-	// Examine the bitmapinfo structure to obtain the current pixel format
-	m_scrinfo.format.trueColour = m_bminfo.truecolour;
-	m_scrinfo.format.bigEndian = 0;
-
-	// Set up the native buffer width, height and format
-	m_scrinfo.framebufferWidth = (CARD16) (m_bmrect.right - m_bmrect.left);		// Swap endian before actually sending
-	m_scrinfo.framebufferHeight = (CARD16) (m_bmrect.bottom - m_bmrect.top);	// Swap endian before actually sending
-	m_scrinfo.format.bitsPerPixel = (CARD8) m_bminfo.bmi.bmiHeader.biBitCount;
-	m_scrinfo.format.depth        = (CARD8) m_bminfo.bmi.bmiHeader.biBitCount;
-
-	
-	// Calculate the number of bytes per row
-	m_bytesPerRow = m_scrinfo.framebufferWidth * m_scrinfo.format.bitsPerPixel / 8;
-
-	return TRUE;
-}
-
-BOOL
-vncDesktop::SetPixShifts()
-{
-	// Sort out the colour shifts, etc.
-	DWORD redMask=0, blueMask=0, greenMask = 0;
-
-	switch (m_bminfo.bmi.bmiHeader.biBitCount)
-	{
-	case 16:
-		if (m_videodriver&& m_videodriver->IsDirectAccessInEffect())
-		{
-// IMPORTANT: Mirage colormask is always 565
-			redMask = 0xf800;
-			greenMask = 0x07e0;
-			blueMask = 0x001f;
-		}
-		else if (m_bminfo.bmi.bmiHeader.biCompression == BI_RGB)
-		{
-		// Standard 16-bit display
-		// each word single pixel 5-5-5
-			redMask = 0x7c00; greenMask = 0x03e0; blueMask = 0x001f;
-		}
-		else
-		{
-			if (m_bminfo.bmi.bmiHeader.biCompression == BI_BITFIELDS)
-			{
-				redMask =   *(DWORD *) &m_bminfo.bmi.bmiColors[0];
-				greenMask = *(DWORD *) &m_bminfo.bmi.bmiColors[1];
-				blueMask =  *(DWORD *) &m_bminfo.bmi.bmiColors[2];
-			}
-		}
-		break;
-
-	case 32:
-		// Standard 24/32 bit displays
-		if (m_bminfo.bmi.bmiHeader.biCompression == BI_RGB ||
-			m_videodriver && m_videodriver->IsDirectAccessInEffect())
-		{
-			redMask = 0xff0000;
-			greenMask = 0xff00;
-			blueMask = 0x00ff;
-
-			// The real color depth is 24 bits in this case. If the depth
-			// is set to 32, the Tight encoder shows worse performance.
-			m_scrinfo.format.depth = 24;
-		}
-		else
-		{
-			if (m_bminfo.bmi.bmiHeader.biCompression == BI_BITFIELDS)
-			{
-				redMask =   *(DWORD *) &m_bminfo.bmi.bmiColors[0];
-				greenMask = *(DWORD *) &m_bminfo.bmi.bmiColors[1];
-				blueMask =  *(DWORD *) &m_bminfo.bmi.bmiColors[2];
-			}
-		}
-		break;
-
-	default:
-		// Other pixel formats are only valid if they're palette-based
-		if (m_bminfo.truecolour)
-		{
-			vnclog.Print(LL_INTERR, "unsupported truecolour pixel format for SetPixShifts()\n");
-			return FALSE;
-		}
-		vnclog.Print(LL_INTINFO, VNCLOG("DBG:palette-based desktop in SetPixShifts()\n"));
-		return TRUE;
-	}
-
-	// Convert the data we just retrieved
-	MaskToMaxAndShift(redMask, m_scrinfo.format.redMax, m_scrinfo.format.redShift);
-	MaskToMaxAndShift(greenMask, m_scrinfo.format.greenMax, m_scrinfo.format.greenShift);
-	MaskToMaxAndShift(blueMask, m_scrinfo.format.blueMax, m_scrinfo.format.blueShift);
-
-	vnclog.Print(LL_INTINFO, VNCLOG("DBG:true-color desktop in SetPixShifts()\n"));
-	return TRUE;
-}
-
-BOOL
-vncDesktop::SetPalette()
-{
-	// Lock the current display palette into the memory DC we're holding
-	// *** CHECK THIS FOR LEAKS!
-	if (!m_bminfo.truecolour)
-	{
-		LOGPALETTE *palette;
-		UINT size = sizeof(LOGPALETTE) + (sizeof(PALETTEENTRY) * 256);
-
-		palette = (LOGPALETTE *) new char[size];
-		if (palette == NULL) {
-			vnclog.Print(LL_INTERR, VNCLOG("error allocating palette\n"));
-			return FALSE;
-		}
-
-		// Initialise the structure
-		palette->palVersion = 0x300;
-		palette->palNumEntries = 256;
-
-		// Get the system colours
-		if (GetSystemPaletteEntries(m_hrootdc, 0, 256, palette->palPalEntry) == 0)
-		{
-			vnclog.Print(LL_INTERR, VNCLOG("GetSystemPaletteEntries() failed.\n"));
-			delete [] palette;
-			return FALSE;
-		}
-
-		// Create a palette from those
-		HPALETTE pal = CreatePalette(palette);
-		if (pal == NULL)
-		{
-			vnclog.Print(LL_INTERR, VNCLOG("CreatePalette() failed.\n"));
-			delete [] palette;
-			return FALSE;
-		}
-
-		// Select the palette into our memory DC
-		HPALETTE oldpalette = SelectPalette(m_hmemdc, pal, FALSE);
-		if (oldpalette == NULL)
-		{
-			vnclog.Print(LL_INTERR, VNCLOG("SelectPalette() failed.\n"));
-			delete [] palette;
-			DeleteObject(pal);
-			return FALSE;
-		}
-
-		// Worked, so realise the palette
-		if (RealizePalette(m_hmemdc) == GDI_ERROR)
-			vnclog.Print(LL_INTWARN, VNCLOG("warning - failed to RealizePalette\n"));
-
-		// It worked!
-		delete [] palette;
-		DeleteObject(oldpalette);
-
-		vnclog.Print(LL_INTINFO, VNCLOG("initialised palette OK\n"));
-		return TRUE;
-	}
-
-	// Not a palette based local screen - forget it!
-	vnclog.Print(LL_INTINFO, VNCLOG("no palette data for truecolour display\n"));
-	return TRUE;
-}
-
-LRESULT CALLBACK DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
-
-ATOM m_wndClass = 0;
-
-BOOL
-vncDesktop::InitWindow()
-{
-	if (m_wndClass == 0) {
-		// Create the window class
-		WNDCLASSEX wndclass;
-
-		wndclass.cbSize			= sizeof(wndclass);
-		wndclass.style			= 0;
-		wndclass.lpfnWndProc	= &DesktopWndProc;
-		wndclass.cbClsExtra		= 0;
-		wndclass.cbWndExtra		= 0;
-		wndclass.hInstance		= hAppInstance;
-		wndclass.hIcon			= NULL;
-		wndclass.hCursor		= NULL;
-		wndclass.hbrBackground	= (HBRUSH) GetStockObject(WHITE_BRUSH);
-		wndclass.lpszMenuName	= (const char *) NULL;
-		wndclass.lpszClassName	= szDesktopSink;
-		wndclass.hIconSm		= NULL;
-
-		// Register it
-		m_wndClass = RegisterClassEx(&wndclass);
-	}
-
-	// And create a window
-	m_hwnd = CreateWindow(szDesktopSink,
-				"WinVNC",
-				WS_OVERLAPPEDWINDOW,
-				CW_USEDEFAULT,
-				CW_USEDEFAULT,
-				400, 200,
-				NULL,
-				NULL,
-				hAppInstance,
-				NULL);
-
-	if (m_hwnd == NULL) {
-		vnclog.Print(LL_INTERR, VNCLOG("CreateWindow() failed.\n"));
-		return FALSE;
-	}
-
-	// Set the "this" pointer for the window
-	SetWindowLongPtr(m_hwnd, GWLP_USERDATA, (LONG_PTR)this);
-
-	// Enable clipboard hooking
-	m_hnextviewer = SetClipboardViewer(m_hwnd);
-
-	return TRUE;
-}
-
-BOOL
-vncDesktop::CreateBuffers()
-{
-	vnclog.Print(LL_INTINFO, VNCLOG("attempting to create main and back buffers\n"));
-
-	// Create a new DIB section ***
-	HBITMAP tempbitmap = NULL;
-	if (!m_formatmunged)
-	{
-		tempbitmap = CreateDIBSection(
-			m_hmemdc,
-			&m_bminfo.bmi,
-			DIB_RGB_COLORS,
-			&m_DIBbits,
-			NULL,
-			0);
-		if (tempbitmap == NULL)
-		{
-			vnclog.Print(LL_INTWARN, VNCLOG("failed to build DIB section - reverting to slow blits\n"));
-		}
-	}
-
-	m_freemainbuff = false;
-
-// NOTE m_mainbuff and m_backbuff allocation can not be supressed
-// even with direct access mirror surface view
-
-	if (tempbitmap == NULL)
-	{
-		m_DIBbits = NULL;
-		// create our own buffer to copy blits through
-		if ((m_mainbuff = new BYTE [ScreenBuffSize()]) == NULL) {
-				vnclog.Print(LL_INTERR, VNCLOG("unable to allocate main buffer[%d]\n"), ScreenBuffSize());
-				return FALSE;
-		}
-		m_freemainbuff = true;
-		if ((m_backbuff = new BYTE [ScreenBuffSize()]) == NULL) {
-			vnclog.Print(LL_INTERR, VNCLOG("unable to allocate back buffer[%d]\n"), ScreenBuffSize());
-			return FALSE;
-		}
-		return TRUE;
-	}
-	
-	// Create our own buffer to copy blits through
-	if ((m_backbuff = new BYTE [ScreenBuffSize()]) == NULL) {
-		vnclog.Print(LL_INTERR, VNCLOG("unable to allocate back buffer[%d]\n"), ScreenBuffSize());
-		if (tempbitmap!= NULL)
-			DeleteObject(tempbitmap);
-		return FALSE;
-	}
-
-	// Delete the old memory bitmap
-	if (m_membitmap != NULL) {
-		DeleteObject(m_membitmap);
-		m_membitmap = NULL;
-	}
-
-	// Replace old membitmap with DIB section
-	m_membitmap = tempbitmap;
-	m_mainbuff = (BYTE *)m_DIBbits;
-	vnclog.Print(LL_INTINFO, VNCLOG("enabled fast DIBsection blits OK\n"));
-	return TRUE;
-}
-
-BOOL
-vncDesktop::Init(vncServer *server)
-{
-	vnclog.Print(LL_INTINFO, VNCLOG("initialising desktop server\n"));
-
-	// Save the server pointer
-	m_server = server;
-
-	// Load in the arrow cursor
-	m_hdefcursor = LoadCursor(NULL, IDC_ARROW);
-	m_hcursor = m_hdefcursor;
-
-	// Spawn a thread to handle that window's message queue
-	vncDesktopThread *thread = new vncDesktopThread;
-	if (thread == NULL)
-		return FALSE;
-	m_thread = thread;
-	return thread->Init(this, m_server);
-}
-
-void
-vncDesktop::RequestUpdate()
-{
-	PostMessage(m_hwnd, WM_TIMER, TIMER_POLL, 0);
-}
-
-int
-vncDesktop::ScreenBuffSize()
-{
-	return m_scrinfo.format.bitsPerPixel/8 *
-		m_scrinfo.framebufferWidth *
-		m_scrinfo.framebufferHeight;
-}
-
-void
-vncDesktop::FillDisplayInfo(rfbServerInitMsg *scrinfo)
-{
-	memcpy(scrinfo, &m_scrinfo, sz_rfbServerInitMsg);
-}
-
-// Function to capture an area of the screen immediately prior to sending
-// an update.
-
-void vncDesktop::CaptureScreen(const RECT &UpdateArea, BYTE *scrBuff)
-{
-// ASSUME rect related to virtual desktop
-	if (m_videodriver && m_videodriver->IsDirectAccessInEffect())
-			CaptureScreenFromMirage(UpdateArea, scrBuff);
-	else	CaptureScreenFromAdapterGeneral(UpdateArea, scrBuff);
-}
-
-
-static bool __hasLayeredWindows = false;
-
-static BOOL CALLBACK checkForLayeredWindow( HWND hwnd, LPARAM lParam )
-{
-	if( ( GetWindowLongPtr( hwnd, GWL_EXSTYLE ) & WS_EX_LAYERED ) &&
-			IsWindowVisible( hwnd ) &&
-			!IsIconic( hwnd ) )
-	{
-		__hasLayeredWindows = true;
-		return false;
-	}
-	return true;
-}
-
-
-static bool useCaptureBlt()
-{
-	__hasLayeredWindows = false;
-	EnumWindows((WNDENUMPROC)checkForLayeredWindow, 0);
-	return __hasLayeredWindows;
-}
-
-
-
-void vncDesktop::CaptureScreenFromAdapterGeneral(RECT rect, BYTE *scrBuff)
-{
-// ASSUME rect related to virtual desktop
-	// Protect the memory bitmap
-	omni_mutex_lock l(m_bitbltlock);
-
-	// Finish drawing anything in this thread 
-	// Wish we could do this for the whole system - maybe we should
-	// do something with LockWindowUpdate here.
-	GdiFlush();
-
-	// Select the memory bitmap into the memory DC
-	HBITMAP oldbitmap;
-	if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)
-		return;
-
-	// Capture screen into bitmap
-	BOOL blitok = BitBlt(
-		m_hmemdc,
-// source in m_hrootdc is relative to a virtual desktop,
-// whereas dst coordinates of m_hmemdc are relative to its top-left corner (0, 0)
-		rect.left - m_bmrect.left,
-		rect.top - m_bmrect.top,
-		rect.right - rect.left,
-		rect.bottom - rect.top,
-		m_hrootdc,
-		rect.left, rect.top,
-		useCaptureBlt() ? ( SRCCOPY | CAPTUREBLT ) : SRCCOPY );
-
-	// Select the old bitmap back into the memory DC
-	SelectObject(m_hmemdc, oldbitmap);
-	
-	if (blitok)
-	{
-	// Copy the new data to the screen buffer (CopyToBuffer optimises this if possible)
-		CopyToBuffer(rect, scrBuff);
-	}
-
-}
-
-void vncDesktop::CaptureScreenFromMirage(RECT UpdateArea, BYTE *scrBuff)
-{
-// ASSUME rect related to virtual desktop
-	_ASSERTE(m_videodriver);
-	omni_mutex_lock l(m_bitbltlock);
-	CopyToBuffer(UpdateArea, scrBuff, m_videodriver->GetScreenView());
-}
-
-void	vncDesktop::CaptureMouseRect()
-{
-	POINT CursorPos;
-	ICONINFO IconInfo;
-
-	// If the mouse cursor handle is invalid then forget it
-	if (m_hcursor == NULL)
-		return;
-
-	// Get the cursor position
-	if (!GetCursorPos(&CursorPos))
-		return;
-
-	// Translate position for hotspot
-	if (GetIconInfo(m_hcursor, &IconInfo))
-	{
-		CursorPos.x -= ((int) IconInfo.xHotspot);
-		CursorPos.y -= ((int) IconInfo.yHotspot);
-
-		if (IconInfo.hbmMask != NULL)
-			DeleteObject(IconInfo.hbmMask);
-		if (IconInfo.hbmColor != NULL)
-			DeleteObject(IconInfo.hbmColor);
-	}
-
-	// Save the bounding rectangle
-	m_cursorpos.left = CursorPos.x;
-	m_cursorpos.top = CursorPos.y;
-	m_cursorpos.right = CursorPos.x + GetSystemMetrics(SM_CXCURSOR);
-	m_cursorpos.bottom = CursorPos.y + GetSystemMetrics(SM_CYCURSOR);
-}
-
-// Add the mouse pointer to the buffer
-void vncDesktop::CaptureMouse(BYTE *scrBuff, UINT scrBuffSize)
-{
-	// Protect the memory bitmap
-	omni_mutex_lock l(m_bitbltlock);
-
-	CaptureMouseRect();
-
-	// Select the memory bitmap into the memory DC
-	HBITMAP oldbitmap;
-	if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)
-		return;
-
-	// Draw the cursor
-	DrawIconEx(
-		m_hmemdc,									// handle to device context 
-		m_cursorpos.left - m_bmrect.left,
-		m_cursorpos.top - m_bmrect.top,
-		m_hcursor,									// handle to icon to draw 
-		0,0,										// width of the icon 
-		0,											// index of frame in animated cursor 
-		NULL,										// handle to background brush 
-		DI_NORMAL									// icon-drawing flags 
-		);
-
-	// Select the old bitmap back into the memory DC
-	SelectObject(m_hmemdc, oldbitmap);
-
-	// Clip the bounding rect to the screen
-	RECT screen = m_server->GetSharedRect();
-	// Copy the mouse cursor into the screen buffer, if any of it is visible
-	if (IntersectRect(&m_cursorpos, &m_cursorpos, &screen))
-		CopyToBuffer(m_cursorpos, scrBuff);
-}
-
-// Obtain cursor image data in server's local format.
-// The length of databuf[] should be at least (width * height * 4).
-BOOL
-vncDesktop::GetRichCursorData(BYTE *databuf, HCURSOR hcursor, int width, int height)
-{
-	// Protect the memory bitmap (is it really necessary here?)
-	omni_mutex_lock l(m_bitbltlock);
-
-	// Create bitmap, select it into memory DC
-	HBITMAP membitmap = CreateCompatibleBitmap(m_hrootdc, width, height);
-	if (membitmap == NULL) {
-		return FALSE;
-	}
-	HBITMAP oldbitmap = (HBITMAP) SelectObject(m_hmemdc, membitmap);
-	if (oldbitmap == NULL) {
-		DeleteObject(membitmap);
-		return FALSE;
-	}
-
-	// Draw the cursor
-	DrawIconEx(m_hmemdc, 0, 0, hcursor, 0, 0, 0, NULL, DI_IMAGE);
-	SelectObject(m_hmemdc, oldbitmap);
-
-	// Prepare BITMAPINFO structure (copy most m_bminfo fields)
-	BITMAPINFO *bmi = (BITMAPINFO *)calloc(1, sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD));
-	memcpy(bmi, &m_bminfo.bmi, sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD));
-	bmi->bmiHeader.biWidth = width;
-	bmi->bmiHeader.biHeight = -height;
-
-	// Clear data buffer and extract RGB data
-	memset(databuf, 0x00, width * height * 4);
-	int lines = GetDIBits(m_hmemdc, membitmap, 0, height, databuf, bmi, DIB_RGB_COLORS);
-
-	// Cleanup
-	free(bmi);
-	DeleteObject(membitmap);
-
-	return (lines != 0);
-}
-
-// Return the current mouse pointer position
-RECT
-vncDesktop::MouseRect()
-{
-	return m_cursorpos;
-}
-
-void vncDesktop::SetCursor(HCURSOR cursor)
-{
-	if (cursor == NULL)
-		m_hcursor = m_hdefcursor;
-	else
-		m_hcursor = cursor;
-}
-
-//
-// DEBUG: Some visualization for LF->CRLF conversion code.
-//
-/*
-static void ShowClipText(char *caption, char *text)
-{
-	int len = strlen(text);
-	char *out_text = new char[len * 4 + 8];
-	int pos = 0;
-
-	out_text[pos++] = '"';
-	for (int i = 0; i < len; i++) {
-		if (text[i] == '\r') {
-			strcpy(&out_text[pos], "\\r");
-			pos += 2;
-		} else if (text[i] == '\n') {
-			strcpy(&out_text[pos], "\\n");
-			pos += 2;
-		} else if (text[i] < ' ') {
-			strcpy(&out_text[pos], "\\?");
-			pos += 2;
-		} else {
-			out_text[pos++] = text[i];
-		}
-	}
-	out_text[pos++] = '"';
-	out_text[pos++] = '\0';
-
-	MessageBox(NULL, out_text, caption, MB_OK);
-
-	delete[] out_text;
-}
-*/
-
-//
-// Convert text from Unix (LF only) format to CR+LF.
-// NOTE: The size of dst[] buffer must be at least (strlen(src) * 2 + 1).
-//
-
-void
-vncDesktop::ConvertClipText(char *dst, const char *src)
-{
-	const char *ptr0 = src;
-	const char *ptr1;
-	int dst_pos = 0;
-
-	while ((ptr1 = strchr(ptr0, '\n')) != NULL) {
-		// Copy the string before the LF
-		if (ptr1 != ptr0) {
-			memcpy(&dst[dst_pos], ptr0, ptr1 - ptr0);
-			dst_pos += ptr1 - ptr0;
-		}
-		// Don't insert CR if there is one already
-		if (ptr1 == ptr0 || *(ptr1 - 1) != '\r') {
-			dst[dst_pos++] = '\r';
-		}
-		// Append LF
-		dst[dst_pos++] = '\n';
-		// Next position in the source text
-		ptr0 = ptr1 + 1;
-	}
-	// Copy the last string with no LF, but with '\0'
-	memcpy(&dst[dst_pos], ptr0, &src[strlen(src)] - ptr0 + 1);
-}
-
-//
-// Manipulation of the clipboard
-//
-
-void
-vncDesktop::SetClipText(LPSTR text)
-{
-	// Open the system clipboard
-	if (OpenClipboard(m_hwnd))
-	{
-		// Empty it
-		if (EmptyClipboard())
-		{
-			HANDLE hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,
-									  strlen(text) * 2 + 1);
-
-			if (hMem != NULL)
-			{
-				LPSTR pMem = (char*)GlobalLock(hMem);
-
-				// Get the data (with line endings converted to CR+LF)
-				ConvertClipText(pMem, text);
-
-				// Tell the clipboard
-				GlobalUnlock(hMem);
-				SetClipboardData(CF_TEXT, hMem);
-			}
-		}
-	}
-
-	// Now close it
-	CloseClipboard();
-}
-
-// INTERNAL METHODS
-
-inline void
-vncDesktop::MaskToMaxAndShift(DWORD mask, CARD16 &max, CARD8 &shift)
-{
-	for (shift = 0; (mask & 1) == 0; shift++)
-		mask >>= 1;
-	max = (CARD16) mask;
-}
-
-// Copy data from the memory bitmap into a buffer
-void vncDesktop::CopyToBuffer(RECT rect, BYTE *destbuff)
-{
-	// Are we being asked to blit from the DIBsection to itself?
-	if (destbuff == m_DIBbits)
-	{
-		// Yes.  Ignore the request!
-		return;
-	}
-
-	// Protect the memory bitmap
-	omni_mutex_lock l(m_bitbltlock);
-
-	const int crect_re_vd_left = rect.left - m_bmrect.left;
-	const int crect_re_vd_top = rect.top - m_bmrect.top;
-	_ASSERTE(crect_re_vd_left >= 0);
-	_ASSERTE(crect_re_vd_top >= 0);
-
-	// Calculate the scanline-ordered y position to copy from
-// NB: m_membitmap is bottom2top
-	const int y_inv_re_vd = m_bmrect.bottom - m_bmrect.top - rect.bottom;
-	_ASSERTE(y_inv_re_vd >= 0);
-
-	// Calculate where in the output buffer to put the data
-	BYTE * destbuffpos = destbuff + (m_bytesPerRow * crect_re_vd_top);
-
-	// Set the number of bytes for GetDIBits to actually write
-	// NOTE : GetDIBits pads the destination buffer if biSizeImage < no. of bytes required
-	m_bminfo.bmi.bmiHeader.biSizeImage = (rect.bottom-rect.top) * m_bytesPerRow;
-
-	// Get the actual bits from the bitmap into the bit buffer
-	// If fast (DIBsection) blits are disabled then use the old GetDIBits technique
-	if (m_DIBbits == NULL)
-	{
-		if (GetDIBits(
-			m_hmemdc,
-			m_membitmap,
-			y_inv_re_vd,
-			rect.bottom - rect.top,
-			destbuffpos,
-			&m_bminfo.bmi,
-			DIB_RGB_COLORS) == 0)
-		{
-#ifdef _MSC_VER
-			_RPT1(_CRT_WARN, "vncDesktop : [1] GetDIBits failed! %d\n", GetLastError());
-			_RPT3(_CRT_WARN, "vncDesktop : thread = %d, DC = %d, bitmap = %d\n", omni_thread::self(), m_hmemdc, m_membitmap);
-			_RPT2(_CRT_WARN, "vncDesktop : y = %d, height = %d\n", y_inv_re_vd, (rect.bottom-rect.top));
-#endif
-		}
-	}
-	else
-	{
-		// Fast blits are enabled.  [I have a sneaking suspicion this will never get used, unless
-		// something weird goes wrong in the code.  It's here to keep the function general, though!]
-
-		const int bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
-		BYTE *srcbuffpos = (BYTE*)m_DIBbits;
-
-		srcbuffpos += (m_bytesPerRow * crect_re_vd_top) + (bytesPerPixel * crect_re_vd_left);
-		destbuffpos += bytesPerPixel * crect_re_vd_left;
-
-		const int widthBytes = (rect.right - rect.left) * bytesPerPixel;
-
-		for (int y = rect.top; y < rect.bottom; y++)
-		{
-			memcpy(destbuffpos, srcbuffpos, widthBytes);
-			srcbuffpos += m_bytesPerRow;
-			destbuffpos += m_bytesPerRow;
-		}
-	}
-}
-
-void vncDesktop::CopyToBuffer(RECT rect, BYTE *destbuff, const BYTE *srcbuffpos)
-{
-	const int crect_re_vd_left = rect.left - m_bmrect.left;
-	const int crect_re_vd_top = rect.top - m_bmrect.top;
-	_ASSERTE(crect_re_vd_left >= 0);
-	_ASSERTE(crect_re_vd_top >= 0);
-
-	const int bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
-
-	const int bmoffset = (m_bytesPerRow * crect_re_vd_top) + (bytesPerPixel * crect_re_vd_left);
-	BYTE *destbuffpos = destbuff + bmoffset;
-	srcbuffpos += bmoffset;
-
-	const int widthBytes = (rect.right - rect.left) * bytesPerPixel;
-
-	for (int y = rect.top; y < rect.bottom; y++)
-	{
-		memcpy(destbuffpos, srcbuffpos, widthBytes);
-		srcbuffpos += m_bytesPerRow;
-		destbuffpos += m_bytesPerRow;
-	}
-}
-
-// Callback routine used internally to catch window movement...
-BOOL CALLBACK
-EnumWindowsFnCopyRect(HWND hwnd, LPARAM arg)
-{
-
-	//For excluding the popup windows
-	if ((GetWindowLongPtr( hwnd, GWL_STYLE) & WS_POPUP) ==0)
-	{
-	
-		HANDLE prop = GetProp(hwnd, (LPCTSTR) MAKELONG(VNC_WINDOWPOS_ATOM, 0));
-		if (prop != NULL) {
-			
-			if (IsWindowVisible(hwnd)) {
-				
-				RECT dest;
-				POINT source;
-
-				// Get the window rectangle
-				if (GetWindowRect(hwnd, &dest)) {
-					// Old position
-					source.x = (SHORT) LOWORD(prop);
-					source.y = (SHORT) HIWORD(prop);
-
-					// Got the destination position.  Now send to clients!
-					if ((source.x != dest.left) || (source.y != dest.top)) {
-						// Update the property entry
-						SHORT x = (SHORT) dest.left;
-						SHORT y = (SHORT) dest.top;
-						SetProp(hwnd,
-							(LPCTSTR) MAKELONG(VNC_WINDOWPOS_ATOM, 0),
-							(HANDLE) MAKELONG(x, y));
-
-						// Store of the copyrect 
-						((vncDesktop*)arg)->CopyRect(dest, source);
-						
-					}
-				} else {
-					RemoveProp(hwnd, (LPCTSTR) MAKELONG(VNC_WINDOWPOS_ATOM, 0));
-				}
-			} else {
-				RemoveProp(hwnd, (LPCTSTR) MAKELONG(VNC_WINDOWPOS_ATOM, 0));
-			}
-		} else {
-			// If the window has become visible then save its position!
-			if (IsWindowVisible(hwnd)) {
-				RECT dest;
-
-				if (GetWindowRect(hwnd, &dest)) {
-					SHORT x = (SHORT) dest.left;
-					SHORT y = (SHORT) dest.top;
-					SetProp(hwnd,
-						(LPCTSTR) MAKELONG(VNC_WINDOWPOS_ATOM, 0),
-						(HANDLE) MAKELONG(x, y));
-				}
-			}
-		}
-	}
-	return TRUE;
-}
-
-
-void
-vncDesktop::SetLocalInputDisableHook(BOOL enable)
-{
-	SetKeyboardFilterHook(enable);
-	SetMouseFilterHook(enable);
-}
-
-void
-vncDesktop::SetLocalInputPriorityHook(BOOL enable)
-{
-	if (vncService::IsWin95()) {
-		SetKeyboardPriorityHook(m_hwnd,enable,RFB_LOCAL_KEYBOARD);
-		SetMousePriorityHook(m_hwnd,enable,RFB_LOCAL_MOUSE);
-	} else {
-		SetKeyboardPriorityLLHook(m_hwnd,enable,RFB_LOCAL_KEYBOARD);
-		SetMousePriorityLLHook(m_hwnd,enable,RFB_LOCAL_MOUSE);
-	}
-
-	if (!enable)
-// FIXME: incremental semantics broken here;
-// that's why we're compelled to consume extra unlocks
-		m_server->BlockRemoteInput(false);
-}
-
-// Routine to find out which windows have moved
-void
-vncDesktop::CalcCopyRects()
-{
-	// Enumerate all the desktop windows for movement
-	EnumWindows((WNDENUMPROC)EnumWindowsFnCopyRect, (LPARAM) this);
-}
-
-
-// Window procedure for the Desktop window
-LRESULT CALLBACK
-DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
-{
-	vncDesktop *_this = (vncDesktop*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
-
-	switch (iMsg)
-	{
-
-		// GENERAL
-
-	case WM_DISPLAYCHANGE:
-		// The display resolution is changing
-
-		// We must kick off any clients since their screen size will be wrong
-		_this->m_displaychanged = TRUE;
-		return 0;
-
-	case WM_SYSCOLORCHANGE:
-	case WM_PALETTECHANGED:
-		// The palette colours have changed, so tell the server
-
-		// Get the system palette
-		if (!_this->SetPalette())
-			PostQuitMessage(0);
-		// Update any palette-based clients, too
-		_this->m_server->UpdatePalette();
-		return 0;
-
-	case WM_TIMER:
-		switch (wParam) {
-		case vncDesktop::TIMER_POLL:
-			_this->SetPollingFlag(true);
-			break;
-		case vncDesktop::TIMER_BLANK_SCREEN:
-			if (_this->m_server->GetBlankScreen())
-				_this->BlankScreen(TRUE);
-			break;
-		case vncDesktop::TIMER_RESTORE_SCREEN:
-			_this->BlankScreen(FALSE);
-			break;
-		}
-		return 0;
-
-		// CLIPBOARD MESSAGES
-
-	case WM_CHANGECBCHAIN:
-		// The clipboard chain has changed - check our nextviewer handle
-		if ((HWND)wParam == _this->m_hnextviewer)
-			_this->m_hnextviewer = (HWND)lParam;
-		else
-			if (_this->m_hnextviewer != NULL)
-				SendMessage(_this->m_hnextviewer,
-							WM_CHANGECBCHAIN,
-							wParam, lParam);
-
-		return 0;
-
-	case WM_DRAWCLIPBOARD:
-		// The clipboard contents have changed
-		if((GetClipboardOwner() != _this->Window()) &&
-		    _this->m_initialClipBoardSeen &&
-			_this->m_clipboard_active)
-		{
-			LPSTR cliptext = NULL;
-
-			// Open the clipboard
-			if (OpenClipboard(_this->Window()))
-			{
-				// Get the clipboard data
-				HGLOBAL cliphandle = GetClipboardData(CF_TEXT);
-				if (cliphandle != NULL)
-				{
-					LPSTR clipdata = (LPSTR) GlobalLock(cliphandle);
-
-					// Copy it into a new buffer
-					if (clipdata == NULL)
-						cliptext = NULL;
-					else
-						cliptext = strdup(clipdata);
-
-					// Release the buffer and close the clipboard
-					GlobalUnlock(cliphandle);
-				}
-
-				CloseClipboard();
-			}
-
-			if (cliptext != NULL)
-			{
-				int cliplen = strlen(cliptext);
-				LPSTR unixtext = (char *)malloc(cliplen+1);
-
-				// Replace CR-LF with LF - never send CR-LF on the wire,
-				// since Unix won't like it
-				int unixpos=0;
-				for (int x=0; x<cliplen; x++)
-				{
-					if (cliptext[x] != '\x0d')
-					{
-						unixtext[unixpos] = cliptext[x];
-						unixpos++;
-					}
-				}
-				unixtext[unixpos] = 0;
-
-				// Free the clip text
-				free(cliptext);
-				cliptext = NULL;
-
-				// Now send the unix text to the server
-				_this->m_server->UpdateClipText(unixtext);
-
-				free(unixtext);
-			}
-		}
-
-		_this->m_initialClipBoardSeen = TRUE;
-
-		if (_this->m_hnextviewer != NULL)
-		{
-			// Pass the message to the next window in clipboard viewer chain.  
-			return SendMessage(_this->m_hnextviewer, WM_DRAWCLIPBOARD, 0,0); 
-		}
-
-		return 0;
-
-	default:
-		return DefWindowProc(hwnd, iMsg, wParam, lParam);
-	}
-}
-
-BOOL vncDesktop::CheckUpdates()
-{
-#ifndef _DEBUG
-	try
-	{
-#endif
-		// Re-install polling timer if necessary
-		if (m_server->PollingCycleChanged())
-		{
-			SetPollingTimer();
-			m_server->PollingCycleChanged(false);
-		}
-
-		// Update the state of blank screen timer
-		UpdateBlankScreenTimer();
-
-		// Has the display resolution or desktop changed?
-		if (m_displaychanged || !vncService::InputDesktopSelected() /*|| !inConsoleSession()*/)
-		{
-			vnclog.Print(LL_STATE, VNCLOG("display resolution or desktop changed.\n"));
-
-			rfbServerInitMsg oldscrinfo = m_scrinfo;
-			m_displaychanged = FALSE;
-
-			// Attempt to close the old hooks
-			if (!Shutdown())
-			{
-				vnclog.Print(LL_INTERR, VNCLOG("failed to close desktop server.\n"));
-				m_server->KillAuthClients();
-				return FALSE;
-			}
-
-			// Now attempt to re-install them!
-			ChangeResNow();
-
-			if (!Startup())
-			{
-				vnclog.Print(LL_INTERR, VNCLOG("failed to re-start desktop server.\n"));
-				m_server->KillAuthClients();
-				return FALSE;
-			}
-
-			// Check if the screen info has changed
-			vnclog.Print(LL_INTINFO,
-						VNCLOG("SCR: old screen format %dx%dx%d\n"),
-						oldscrinfo.framebufferWidth,
-						oldscrinfo.framebufferHeight,
-						oldscrinfo.format.bitsPerPixel);
-			vnclog.Print(LL_INTINFO,
-						VNCLOG("SCR: new screen format %dx%dx%d\n"),
-						m_scrinfo.framebufferWidth,
-						m_scrinfo.framebufferHeight,
-						m_scrinfo.format.bitsPerPixel);
-			if (memcmp(&m_scrinfo, &oldscrinfo, sizeof(oldscrinfo)) != 0)
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("screen format has changed.\n"));
-			}
-
-			// Call this regardless of screen format change
-			m_server->UpdateLocalFormat();
-
-			// Add a full screen update to all the clients
-			m_changed_rgn.AddRect(m_bmrect);
-			m_server->UpdatePalette();
-		}
-
-		// TRIGGER THE UPDATE
-
-		RECT rect = m_server->GetSharedRect();
-		RECT new_rect = GetSourceRect();
-		IntersectRect(&new_rect, &new_rect, &m_bmrect);
-
-		// Update screen size if required
-		if (!EqualRect(&new_rect, &rect))
-		{
-			m_server->SetSharedRect(new_rect);
-			bool sendnewfb = false;
-
-			if (rect.right - rect.left != new_rect.right - new_rect.left ||
-				rect.bottom - rect.top != new_rect.bottom - new_rect.top)
-				sendnewfb = true;
-
-			// FIXME: We should not send NewFBSize if a client
-			//        did not send framebuffer update request.
-			m_server->SetNewFBSize(sendnewfb);
-
-			m_changed_rgn.Clear();
-
-			if (sendnewfb && m_server->WindowShared())
-			{
-				if (new_rect.right - new_rect.left == 0 &&
-					new_rect.bottom - new_rect.top == 0)
-				{
-// window is minimized
-					return TRUE;
-				}
-				else
-				{
-// window is restored
-// window is resized
-					m_changed_rgn.AddRect(new_rect);
-				}
-			}
-			else
-			{
-				return TRUE;
-			}
-		}
-
-		// If we have clients full region requests
-		if (m_server->FullRgnRequested())
-		{
-			// Capture screen to main buffer
-			CaptureScreen(rect, m_mainbuff);
-			// If we have a video driver - reset counter
-			if ( m_videodriver != NULL && m_videodriver->IsActive())
-			{
-				m_videodriver->ResetCounter();
-			}
-		}
-
-// DEBUG: Continue auditing the code from this point.
-
-		// If we have incremental update requests
-		if (m_server->IncrRgnRequested())
-		{
-			vncRegion rgn;
-
-			// Use either a mirror video driver, or perform polling
-			if (m_videodriver != NULL && m_videodriver->IsActive())
-			{
-				// FIXME: If there were no incremental update requests
-				//        for some time, we will loose updates.
-// IMPORTANT: Mirage outputs the regions re (0, 0)
-// so we have to offset them re virtual display
-
-// TODOTODO
-					BOOL bCursorShape = FALSE;
-
-					m_videodriver->HandleDriverChanges(
-						this,
-						m_changed_rgn,
-						m_bmrect.left,
-						m_bmrect.top,
-						bCursorShape);
-			}
-			else
-			{
-				if (GetPollingFlag())
-				{
-					SetPollingFlag(false);
-					PerformPolling();
-				}
-			}
-
-			// Check for moved windows
-// PrimaryDisplayOnlyShared: check if any problems when
-// dragging from another display
-			if ((m_server->FullScreen() || m_server->PrimaryDisplayOnlyShared()) &&
-				!(m_videodriver && m_videodriver->IsHandlingScreen2ScreenBlt()))
-			{
-				CalcCopyRects();
-			}
-
-			if (m_copyrect_set)
-			{
-				// Send copyrect to all clients
-				m_server->CopyRect(m_copyrect_rect, m_copyrect_src);
-				m_copyrect_set = false;
-
-// IMPORTANT: this order: CopyRectToBuffer, CaptureScreen, GetChangedRegion
-				// Copy old window rect to back buffer
-				CopyRectToBuffer(m_copyrect_rect, m_copyrect_src);
-
-				// Copy new window rect to main buffer
-				CaptureScreen(m_copyrect_rect, m_mainbuff);
-
-				// Get changed pixels to rg
-				GetChangedRegion(rgn, m_copyrect_rect);
-
-				RECT rect;
-				rect.left= m_copyrect_src.x;
-				rect.top = m_copyrect_src.y;
-				rect.right = rect.left + (m_copyrect_rect.right - m_copyrect_rect.left);
-				rect.bottom = rect.top + (m_copyrect_rect.bottom - m_copyrect_rect.top);
-				// Refresh old window rect
-				m_changed_rgn.AddRect(rect);
-				// Don't refresh new window rect
-				m_changed_rgn.SubtractRect(m_copyrect_rect);
-			} 
-
-			// Get only desktop area
-			vncRegion temprgn;
-			temprgn.Clear();
-			temprgn.AddRect(rect);
-			m_changed_rgn.Intersect(temprgn);
-
-			// Get list of rectangles for checking
-			rectlist rectsToScan;
-			m_changed_rgn.Rectangles(rectsToScan);
-
-			// Capture and check them
-			CheckRects(rgn, rectsToScan);
-
-			// Update the mouse
-			m_server->UpdateMouse();
-
-			// Send changed region data to all clients
-			m_server->UpdateRegion(rgn);
-
-			// Clear changed region
-			m_changed_rgn.Clear();
-		}
-
-		// Trigger an update to be sent
-		if (m_server->FullRgnRequested() || m_server->IncrRgnRequested())
-		{
-			m_server->TriggerUpdate();
-		}
-
-#ifndef _DEBUG
-	}
-	catch (...)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("vncDesktop::CheckUpdates caught an exception.\n"));
-		m_server->KillAuthClients();
-		return FALSE;
-	}
-#endif
-
-	return TRUE;
-}
-
-void
-vncDesktop::SetPollingTimer()
-{
-	const UINT driverCycle = 30;
-	const UINT minPollingCycle = 5;
-
-	UINT msec;
-	if (m_videodriver != NULL) {
-		msec = driverCycle;
-	} else {
-		msec = m_server->GetPollingCycle() / 16;
-		if (msec < minPollingCycle) {
-			msec = minPollingCycle;
-		}
-	}
-	m_timer_polling = SetTimer(Window(), TIMER_POLL, msec, NULL);
-}
-
-inline void vncDesktop::CheckRects(vncRegion &rgn, rectlist &rects)
-{
-#ifndef _DEBUG
-	try
-	{
-#endif
-		rectlist::iterator i;
-
-		for (i = rects.begin(); i != rects.end(); i++)
-		{
-			// Copy data to the main buffer
-			// FIXME: Maybe call CaptureScreen() just once?
-			//        Check what would be more efficient.
-			CaptureScreen(*i, m_mainbuff);
-
-// Check for changes in the rectangle
-			GetChangedRegion(rgn, *i);
-		}
-#ifndef _DEBUG
-	}
-	catch (...)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("vncDesktop::CheckRects caught an exception.\n"));
-		throw;
-	}
-#endif
-}
-
-#ifdef _MSC_VER
-// This notably improves performance when using Visual C++ 6.0 compiler
-#pragma function(memcpy, memcmp)
-#endif
-
-static const int BLOCK_SIZE = 32;
-
-// created for troubleshoot purposes;
-// when GetChangedRegion_Normal et al are suspected for bugs/need changes.
-// the code below is as simple and clear as possible
-void vncDesktop::GetChangedRegion_Dummy(vncRegion &rgn, const RECT &rect)
-{
-	rgn.AddRect(rect);
-
-	// Copy the changes to the back buffer
-	const int c2rect_re_vd_top = rect.top - m_bmrect.top;
-	const int c3rect_re_vd_left = rect.left - m_bmrect.left;
-	_ASSERTE(c2rect_re_vd_top >= 0);
-	_ASSERTE(c3rect_re_vd_left >= 0);
-
-	const UINT bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
-	const int offset = c2rect_re_vd_top * m_bytesPerRow + c3rect_re_vd_left * bytesPerPixel;
-
-	unsigned char *o_ptr = m_backbuff + offset;
-	unsigned char *n_ptr = m_mainbuff + offset;
-	const int bytes_in_row = (rect.right - rect.left) * bytesPerPixel;
-	for (int y = rect.top; y < rect.bottom; y++)
-	{
-		memcpy(o_ptr, n_ptr, bytes_in_row);
-		n_ptr += m_bytesPerRow;
-		o_ptr += m_bytesPerRow;
-	}
-}
-
-void vncDesktop::GetChangedRegion_Normal(vncRegion &rgn, const RECT &rect)
-{
-	const UINT bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
-	const int bytes_per_scanline = (rect.right - rect.left) * bytesPerPixel;
-
-	const int crect_re_vd_left = rect.left - m_bmrect.left;
-	const int crect_re_vd_top = rect.top - m_bmrect.top;
-	_ASSERTE(crect_re_vd_left >= 0);
-	_ASSERTE(crect_re_vd_top >= 0);
-
-	const int offset = crect_re_vd_top * m_bytesPerRow + crect_re_vd_left * bytesPerPixel;
-	unsigned char *o_ptr = m_backbuff + offset;
-	unsigned char *n_ptr = m_mainbuff + offset;
-
-	RECT new_rect = rect;
-
-	// Fast processing for small rectangles
-	if (rect.right - rect.left <= BLOCK_SIZE &&
-		rect.bottom - rect.top <= BLOCK_SIZE)
-	{
-		for (int y = rect.top; y < rect.bottom; y++)
-		{
-			if (memcmp(o_ptr, n_ptr, bytes_per_scanline) != 0)
-			{
-				new_rect.top = y;
-				UpdateChangedSubRect(rgn, new_rect);
-				break;
-			}
-			o_ptr += m_bytesPerRow;
-			n_ptr += m_bytesPerRow;
-		}
-		return;
-	}
-
-// Process bigger rectangles
-	BOOL bTop4Move = TRUE;
-	for (int y = rect.top; y < rect.bottom; y++)
-	{
-		if (memcmp(o_ptr, n_ptr, bytes_per_scanline) != 0)
-		{
-			if (bTop4Move)
-			{
-				new_rect.top = y;
-				bTop4Move = FALSE;
-			}
-			// Skip a number of lines after a non-matched one
-			int n = BLOCK_SIZE / 2 - 1;
-			y += n;
-			o_ptr += n * m_bytesPerRow;
-			n_ptr += n * m_bytesPerRow;
-		}
-		else
-		{
-			if (!bTop4Move)
-			{
-				new_rect.bottom = y;
-				UpdateChangedRect(rgn, new_rect);
-				bTop4Move = TRUE;
-			}
-		}
-		o_ptr += m_bytesPerRow;
-		n_ptr += m_bytesPerRow;
-	}
-	if (!bTop4Move)
-	{
-		new_rect.bottom = rect.bottom;
-		UpdateChangedRect(rgn, new_rect);
-	}
-}
-
-void vncDesktop::UpdateChangedRect(vncRegion &rgn, const RECT &rect)
-{
-	// Pass small rectangles directly to UpdateChangedSubRect
-	if (rect.right - rect.left <= BLOCK_SIZE &&
-		rect.bottom - rect.top <= BLOCK_SIZE)
-	{
-		UpdateChangedSubRect(rgn, rect);
-		return;
-	}
-
-	const UINT bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
-
-	RECT new_rect;
-	int x, y, ay;
-
-	const int crect_re_vd_left = rect.left - m_bmrect.left;
-	const int crect_re_vd_top = rect.top - m_bmrect.top;
-	_ASSERTE(crect_re_vd_left >= 0);
-	_ASSERTE(crect_re_vd_top >= 0);
-
-	// Scan down the rectangle
-	const int offset = crect_re_vd_top * m_bytesPerRow + crect_re_vd_left * bytesPerPixel;
-	unsigned char *o_topleft_ptr = m_backbuff + offset;
-	unsigned char *n_topleft_ptr = m_mainbuff + offset;
-
-	for (y = rect.top; y < rect.bottom; y += BLOCK_SIZE)
-	{
-		// Work out way down the bitmap
-		unsigned char *o_row_ptr = o_topleft_ptr;
-		unsigned char *n_row_ptr = n_topleft_ptr;
-
-		const int blockbottom = Min(y + BLOCK_SIZE, rect.bottom);
-		new_rect.bottom = blockbottom;
-
-		BOOL bLeft4Move = TRUE;
-
-		for (x = rect.left; x < rect.right; x += BLOCK_SIZE)
-		{
-			// Work our way across the row
-			unsigned char *n_block_ptr = n_row_ptr;
-			unsigned char *o_block_ptr = o_row_ptr;
-
-			const UINT blockright = Min(x + BLOCK_SIZE, rect.right);
-			const UINT bytesPerBlockRow = (blockright-x) * bytesPerPixel;
-
-			// Scan this block
-			for (ay = y; ay < blockbottom; ay++)
-			{
-				if (memcmp(n_block_ptr, o_block_ptr, bytesPerBlockRow) != 0)
-					break;
-				n_block_ptr += m_bytesPerRow;
-				o_block_ptr += m_bytesPerRow;
-			}
-			if (ay < blockbottom)
-			{
-				// There were changes, so this block will need to be updated
-				if (bLeft4Move)
-				{
-					new_rect.left = x;
-					bLeft4Move = FALSE;
-					new_rect.top = ay;
-				}
-				else if (ay < new_rect.top)
-				{
-					new_rect.top = ay;
-				}
-			}
-			else
-			{
-				// No changes in this block, process previous changed blocks if any
-				if (!bLeft4Move)
-				{
-					new_rect.right = x;
-					UpdateChangedSubRect(rgn, new_rect);
-					bLeft4Move = TRUE;
-				}
-			}
-
-			o_row_ptr += bytesPerBlockRow;
-			n_row_ptr += bytesPerBlockRow;
-		}
-
-		if (!bLeft4Move)
-		{
-			new_rect.right = rect.right;
-			UpdateChangedSubRect(rgn, new_rect);
-		}
-
-		o_topleft_ptr += m_bytesPerRow * BLOCK_SIZE;
-		n_topleft_ptr += m_bytesPerRow * BLOCK_SIZE;
-	}
-}
-
-void vncDesktop::UpdateChangedSubRect(vncRegion &rgn, const RECT &rect)
-{
-	const UINT bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
-	int bytes_in_row = (rect.right - rect.left) * bytesPerPixel;
-	int y, i;
-
-	const int crect_re_vd_left = rect.left - m_bmrect.left;
-	const int crect_re_vd_bottom = rect.bottom - m_bmrect.top;
-	_ASSERTE(crect_re_vd_left >= 0);
-	_ASSERTE(crect_re_vd_bottom >= 0);
-
-	// Exclude unchanged scan lines at the bottom
-	int offset = (crect_re_vd_bottom - 1) * m_bytesPerRow + crect_re_vd_left * bytesPerPixel;
-	unsigned char *o_ptr = m_backbuff + offset;
-	unsigned char *n_ptr = m_mainbuff + offset;
-	RECT final_rect = rect;
-	final_rect.bottom = rect.top + 1;
-	for (y = rect.bottom - 1; y > rect.top; y--)
-	{
-		if (memcmp(o_ptr, n_ptr, bytes_in_row) != 0)
-		{
-			final_rect.bottom = y + 1;
-			break;
-		}
-		n_ptr -= m_bytesPerRow;
-		o_ptr -= m_bytesPerRow;
-	}
-
-	// Exclude unchanged pixels at left and right sides
-	const int c2rect_re_vd_left = final_rect.left - m_bmrect.left;
-	const int c2rect_re_vd_top = final_rect.top - m_bmrect.top;
-	_ASSERTE(c2rect_re_vd_left >= 0);
-	_ASSERTE(c2rect_re_vd_top >= 0);
-
-	offset = c2rect_re_vd_top * m_bytesPerRow + c2rect_re_vd_left * bytesPerPixel;
-	o_ptr = m_backbuff + offset;
-	n_ptr = m_mainbuff + offset;
-	int left_delta = bytes_in_row - 1;
-	int right_delta = 0;
-	for (y = final_rect.top; y < final_rect.bottom; y++)
-	{
-		for (i = 0; i < bytes_in_row - 1; i++)
-		{
-			if (n_ptr[i] != o_ptr[i])
-			{
-				if (i < left_delta)
-					left_delta = i;
-				break;
-			}
-		}
-		for (i = bytes_in_row - 1; i > 0; i--)
-		{
-			if (n_ptr[i] != o_ptr[i])
-			{
-				if (i > right_delta)
-					right_delta = i;
-				break;
-			}
-		}
-		n_ptr += m_bytesPerRow;
-		o_ptr += m_bytesPerRow;
-	}
-	final_rect.right = final_rect.left + right_delta / bytesPerPixel + 1;
-	final_rect.left += left_delta / bytesPerPixel;
-
-	// Update the rectangle
-	rgn.AddRect(final_rect);
-
-	// Copy the changes to the back buffer
-	const int c3rect_re_vd_left = final_rect.left - m_bmrect.left;
-	_ASSERTE(c3rect_re_vd_left >= 0);
-
-	offset = c2rect_re_vd_top * m_bytesPerRow + c3rect_re_vd_left * bytesPerPixel;
-
-	o_ptr = m_backbuff + offset;
-	n_ptr = m_mainbuff + offset;
-	bytes_in_row = (final_rect.right - final_rect.left) * bytesPerPixel;
-	for (y = final_rect.top; y < final_rect.bottom; y++)
-	{
-		memcpy(o_ptr, n_ptr, bytes_in_row);
-		n_ptr += m_bytesPerRow;
-		o_ptr += m_bytesPerRow;
-	}
-}
-
-
-void vncDesktop::PerformPolling()
-{
-	if (m_server->PollFullScreen())
-	{
-		// Poll full screen
-		RECT full_rect = m_server->GetSharedRect();
-		PollArea(full_rect);
-	}
-	else
-	{
-		// Poll a window
-		if (m_server->PollForeground())
-		{
-			// Get the window rectangle for the currently selected window
-			HWND hwnd = GetForegroundWindow();
-			if (hwnd != NULL)
-				PollWindow(hwnd);
-		}
-		if (m_server->PollUnderCursor())
-		{
-			// Find the mouse position
-			POINT mousepos;
-			if (GetCursorPos(&mousepos))
-			{
-				// Find the window under the mouse
-				HWND hwnd = WindowFromPoint(mousepos);
-				if (hwnd != NULL)
-					PollWindow(hwnd);
-			}
-		}
-	}
-}
-
-void
-vncDesktop::PollWindow(HWND hwnd)
-{
-	// Are we set to low-load polling?
-	if (m_server->PollOnEventOnly())
-	{
-		// Yes, so only poll if the remote user has done something
-		if (!m_server->RemoteEventReceived()) {
-			return;
-		}
-	}
-
-	// Does the client want us to poll only console windows?
-	if (m_server->PollConsoleOnly())
-	{
-		char classname[20];
-
-		// Yes, so check that this is a console window...
-		if (GetClassName(hwnd, classname, sizeof(classname))) {
-			if ((strcmp(classname, "tty") != 0) &&
-				(strcmp(classname, "ConsoleWindowClass") != 0)) {
-				return;
-			}
-		}
-	}
-
-	RECT full_rect = m_server->GetSharedRect();
-	RECT rect;
-
-	// Get the rectangle
-	if (GetWindowRect(hwnd, &rect)) {
-		if (IntersectRect(&rect, &rect, &full_rect)) {
-			PollArea(rect);
-		}
-	}
-}
-
-//
-// Implementation of the polling algorithm.
-//
-
-void vncDesktop::PollArea(const RECT &rect)
-{
-	const int scanLine = m_pollingOrder[m_pollingStep++ % 32];
-	const UINT bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
-
-	// Align 32x32 tiles to the left top corner of the shared area
-	const RECT shared = m_server->GetSharedRect();
-	const int leftAligned = ((rect.left - shared.left) & 0xFFFFFFE0) + shared.left;
-	const int topAligned = ((rect.top - shared.top) & 0xFFFFFFE0) + shared.top;
-
-	RECT rowRect = rect;	// we'll need left and right borders
-
-	for (int y = topAligned; y < rect.bottom; y += 32)
-	{
-		const int tile_h = Min(rect.bottom - y, 32);
-// TODO: refactor it
-		int sl = scanLine;
-// window captions suffer an arbitrary scanline...
-		if (y == topAligned)
-			sl = 31;
-		sl = Min(sl, tile_h-1);
-		const int scan_y = y + sl;
-
-		_ASSERTE(scan_y >= rect.top);
-		_ASSERTE(scan_y < rect.bottom);
-
-		rowRect.top = scan_y;
-		rowRect.bottom = scan_y + 1;
-		CaptureScreen(rowRect, m_mainbuff);
-		const int offset = (scan_y-m_bmrect.top) * m_bytesPerRow + (leftAligned-m_bmrect.left) * bytesPerPixel;
-		const unsigned char *o_ptr = m_backbuff + offset;
-		const unsigned char *n_ptr = m_mainbuff + offset;
-		for (int x = leftAligned; x < rect.right; x += 32)
-		{
-			const int tile_w = Min(rect.right - x, 32);
-			const int nBytes = tile_w * bytesPerPixel;
-			if (memcmp(o_ptr, n_ptr, nBytes) != 0)
-			{
-				RECT tileRect;
-				tileRect.left = x;
-				tileRect.top = y;
-				tileRect.right = x + tile_w;
-				tileRect.bottom = y + tile_h;
-				m_changed_rgn.AddRect(tileRect);
-			}
-			o_ptr += nBytes;
-			n_ptr += nBytes;
-		}
-	}
-}
-
-inline RECT MoveRect(RECT const& sr, POINT const& mv)
-{
-	RECT R;
-	R.left = sr.left + mv.x;
-	R.top = sr.top + mv.y;
-	R.right = sr.right + mv.x;
-	R.bottom = sr.bottom + mv.y;
-	return R;
-}
-
-void vncDesktop::CopyRect(RECT const &rcDest, POINT ptSrc)
-{
-// motion vector
-	POINT mv2;
-	mv2.x = rcDest.left - ptSrc.x;
-	mv2.y = rcDest.top - ptSrc.y;
-
-	// Clip the destination to the screen
-	RECT rcDr2;
-	const RECT r = m_server->GetSharedRect();
-	if (!IntersectRect(&rcDr2, &rcDest, &r))
-		return;
-
-// NOTE: this is important.
-// each pixel in rcDr2 is either salvaged by copyrect
-// or became dirty
-	m_changed_rgn.AddRect(rcDr2);
-
-	// Adjust the source correspondingly
-	ptSrc.x = rcDr2.left - mv2.x;
-	ptSrc.y = rcDr2.top - mv2.y;
-
-	// Work out the source rectangle
-	RECT rcSource;
-	rcSource.left = ptSrc.x;
-	rcSource.top = ptSrc.y;
-	rcSource.right = rcSource.left + rcDr2.right - rcDr2.left;
-	rcSource.bottom = rcSource.top + rcDr2.bottom - rcDr2.top;
-
-	// Clip the source to the screen
-	RECT rcSr2;
-	if (!IntersectRect(&rcSr2, &rcSource, &r))
-		return;
-
-	rcDr2 = MoveRect(rcSr2, mv2);
-
-// we'd try to continue the chain
-	if (m_copyrect_set)
-	{
-// prev motion vector
-		POINT mv1;
-		mv1.x = m_copyrect_rect.left - m_copyrect_src.x;
-		mv1.y = m_copyrect_rect.top - m_copyrect_src.y;
-
-		m_changed_rgn.AddRect(m_copyrect_rect);
-
-		RECT CR1i2Dst;
-		if (!IntersectRect(&CR1i2Dst, &m_copyrect_rect, &rcSr2))
-		{
-			m_copyrect_set = FALSE;
-			return;
-		}
-
-		RECT rcDr3 = MoveRect(CR1i2Dst, mv2);
-		if (rcDr3.right - rcDr3.left >= 16 &&
-			rcDr3.bottom - rcDr3.top >= 16)
-		{
-			m_changed_rgn.SubtractRect(rcDr3);
-
-			POINT ptCR1i2Src;
-			ptCR1i2Src.x = CR1i2Dst.left - mv1.x;
-			ptCR1i2Src.y = CR1i2Dst.top - mv1.y;
-
-			m_copyrect_rect = rcDr3;
-			m_copyrect_src = ptCR1i2Src;
-
-			//DPF(("CopyRect-cont: (%d, %d) (%d, %d, %d, %d)\n",
-			//	m_copyrect_src.x,
-			//	m_copyrect_src.y,
-			//	m_copyrect_rect.left,
-			//	m_copyrect_rect.top,
-			//	m_copyrect_rect.right,
-			//	m_copyrect_rect.bottom));
-		}
-		else
-		{
-			m_copyrect_set = FALSE;
-		}
-	}
-	else
-	{
-		if (rcDr2.right - rcDr2.left >= 16 &&
-			rcDr2.bottom - rcDr2.top >= 16)
-		{
-			m_changed_rgn.SubtractRect(rcDr2);
-
-			m_copyrect_rect = rcDr2;
-			m_copyrect_src.x = rcSr2.left;
-			m_copyrect_src.y = rcSr2.top;
-			m_copyrect_set = TRUE;
-
-			//DPF(("CopyRect: (%d, %d) (%d, %d, %d, %d)\n",
-			//	m_copyrect_src.x,
-			//	m_copyrect_src.y,
-			//	m_copyrect_rect.left,
-			//	m_copyrect_rect.top,
-			//	m_copyrect_rect.right,
-			//	m_copyrect_rect.bottom));
-		}
-	}
-}
-
-void vncDesktop::CopyRectToBuffer(RECT dest, POINT source)
-{
-	const int ptsrc_re_vd_x = source.x - m_bmrect.left;
-	const int ptsrc_re_vd_y = source.y - m_bmrect.top;
-	_ASSERTE(ptsrc_re_vd_x >= 0);
-	_ASSERTE(ptsrc_re_vd_y >= 0);
-
-	// Copy the data from one region of the back-buffer to another!
-	BYTE *srcptr = m_mainbuff + (ptsrc_re_vd_y * m_bytesPerRow) + (ptsrc_re_vd_x * m_scrinfo.format.bitsPerPixel/8);
-
-	const int rcdest_re_vd_left = dest.left - m_bmrect.left;
-	const int rcdest_re_vd_top = dest.top - m_bmrect.top;
-	_ASSERTE(rcdest_re_vd_left >= 0);
-	_ASSERTE(rcdest_re_vd_top >= 0);
-
-	BYTE *destptr = m_backbuff + (rcdest_re_vd_top * m_bytesPerRow) + (rcdest_re_vd_left * m_scrinfo.format.bitsPerPixel/8);
-	const UINT bytesPerLine = (dest.right - dest.left) * (m_scrinfo.format.bitsPerPixel/8);
-
-	if (dest.top < source.y)
-	{
-		for (int y = dest.top; y < dest.bottom; y++)
-		{
-			memmove(destptr, srcptr, bytesPerLine);
-			srcptr += m_bytesPerRow;
-			destptr += m_bytesPerRow;
-		}
-	}
-	else
-	{
-		srcptr += (m_bytesPerRow * ((dest.bottom - dest.top) - 1));
-		destptr += (m_bytesPerRow * ((dest.bottom - dest.top) - 1));
-		for (int y = dest.bottom; y > dest.top; y--)
-		{
-			memmove(destptr, srcptr, bytesPerLine);
-			srcptr -= m_bytesPerRow;
-			destptr -= m_bytesPerRow;
-		}
-	}
-}
-
-BOOL	IsBadDirectAccessConfig()
-{
-	if (IsWinVerOrHigher(5, 1))
-	{
-		if (GetSystemMetrics(SM_XVIRTUALSCREEN) < 0)
-			return TRUE;
-		if (GetSystemMetrics(SM_YVIRTUALSCREEN) < 0)
-			return TRUE;
-	}
-	return FALSE;
-}
-
-BOOL vncDesktop::InitVideoDriver()
-{
-	// Mirror video drivers supported under Win2K, WinXP, WinVista
-	// and Windows NT 4.0 SP3 (we assume SP6).
-	if (!vncService::IsWinNT())
-		return FALSE;
-
-	// FIXME: Windows NT 4.0 support is broken and thus we disable it here.
-	if (!IsWinVerOrHigher(5, 0))
-		return FALSE;
-
-	if (m_server->DontUseDriver())
-	{
-		vnclog.Print(LL_STATE, VNCLOG("not activating video driver interface\n"));
-		return FALSE;
-	}
-
-	BOOL	bIsBadDASDConfig = IsBadDirectAccessConfig();
-	if (bIsBadDASDConfig)
-	{
-		vnclog.Print(LL_INTINFO, VNCLOG("can't set direct access mode in this configuration of monitors due to a known Windows bug.\n"));
-	}
-
-	BOOL	bSolicitDASD = m_server->DriverDirectAccess() & !bIsBadDASDConfig;
-
-	_ASSERTE(!m_videodriver);
-	m_videodriver = new vncVideoDriver;
-	if (!m_videodriver)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("failed to create vncVideoDriver object\n"));
-		return FALSE;
-	}
-
-	if (IsWinVerOrHigher(5, 0))
-	{
-// restart the driver if left running.
-// NOTE that on NT4 it must be running beforehand
-		if (m_videodriver->TestMapped())
-		{
-			vnclog.Print(LL_INTINFO, VNCLOG("found abandoned Mirage driver running. restarting.\n"));
-			m_videodriver->Deactivate();
-		}
-		_ASSERTE(!m_videodriver->TestMapped());
-	}
-
-	{
-		RECT	vdesk_rect;
-		GetSourceDisplayRect(vdesk_rect);
-		(BOOL) m_videodriver->Activate(bSolicitDASD, &vdesk_rect);
-	}
-
-	if (!m_videodriver->CheckVersion())
-	{
-		vnclog.Print(LL_INTINFO, VNCLOG("******** PLEASE INSTALL NEWER VERSION OF MIRAGE DRIVER! ********\n"));
-// IMPORTANT: fail on NT46
-		if (IsNtVer(4, 0))
-			return FALSE;
-	}
-
-	if (m_videodriver->MapSharedbuffers(bSolicitDASD))
-	{
-		vnclog.Print(LL_INTINFO, VNCLOG("video driver interface activated\n"));
-	}
-	else
-	{
-		delete m_videodriver;
-		m_videodriver = NULL;
-		vnclog.Print(LL_INTERR, VNCLOG("failed to activate video driver interface\n"));
-		return FALSE;
-	}
-	_ASSERTE(bSolicitDASD == m_videodriver->IsDirectAccessInEffect());
-	return TRUE;
-}
-
-void vncDesktop::ShutdownVideoDriver()
-{
-	if (m_videodriver == NULL)
-		return;
-	delete m_videodriver;
-	m_videodriver = NULL;
-	vnclog.Print(LL_INTINFO, VNCLOG("video driver interface deactivated\n"));
-}
-
-void
-vncDesktop::UpdateBlankScreenTimer()
-{
-	BOOL active = m_server->GetBlankScreen();
-	if (active && !m_timer_blank_screen) {
-		m_timer_blank_screen = SetTimer(Window(), TIMER_BLANK_SCREEN, 50, NULL);
-	} else if (!active && m_timer_blank_screen) {
-		KillTimer(Window(), TIMER_BLANK_SCREEN);
-		m_timer_blank_screen = 0;
-		PostMessage(m_hwnd, WM_TIMER, TIMER_RESTORE_SCREEN, 0);
-	}
-}
-
-void
-vncDesktop::BlankScreen(BOOL set)
-{
-	if (set) {
-		SystemParametersInfo(SPI_SETPOWEROFFACTIVE, 1, NULL, 0);
-		SendMessage(GetDesktopWindow(), WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM)2);
-	} else {
-		SystemParametersInfo(SPI_SETPOWEROFFACTIVE, 0, NULL, 0);
-		SendMessage(GetDesktopWindow(), WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM)-1);
-	}
-}
-
-// created for debug purposes
-bool	SaveBitmapToBMPFile(
-			HANDLE hFile,
-			void *ptrBm,
-			void *ptrPal,
-			int bmwidth,
-			int bmheight,
-			int bmstride,
-			int bmclrdepth)
-{
-	BITMAPINFOHEADER bih = {0};
-	bih.biSize			= sizeof(bih);
-	bih.biWidth			= bmwidth;
-	bih.biHeight		= bmheight;
-	bih.biPlanes		= 1;
-	bih.biCompression	= BI_RGB;
-
-	DWORD bitFields[3] = {0, 0, 0};
-
-	if (bmclrdepth == 1)
-	{
-		bih.biBitCount = 1;
-		bih.biClrUsed = 2;
-	}
-	else if (bmclrdepth == 2)
-	{
-		bih.biBitCount = 2;
-		bih.biClrUsed = 4;
-	}
-	else if (bmclrdepth == 4)
-	{
-		bih.biBitCount = 4;
-		bih.biClrUsed = 0x10;
-	}
-	else if (bmclrdepth == 8)
-	{
-		bih.biBitCount = 8;
-		bih.biClrUsed = 0x100;
-	}
-	else if (bmclrdepth == 16)
-	{
-		bih.biBitCount = 16;
-		bih.biCompression = BI_BITFIELDS;
-// TODO: use actual masks
-		bitFields[0] = 0xF800;
-		bitFields[1] = 0x07E0;
-		bitFields[2] = 0x001F;
-	}
-	else if (bmclrdepth == 24)
-	{
-		bih.biBitCount = 24;
-	}
-	else if (bmclrdepth == 32)
-	{
-		bih.biBitCount = 32;
-	}
-	else
-		_ASSERTE(false);
-
-	BITMAPFILEHEADER bfh = {0};
-	bfh.bfType			= 0x4d42;	// 0x42 = "B" 0x4d = "M" 
-	bfh.bfOffBits		= sizeof(BITMAPFILEHEADER) + bih.biSize;
-
-	if (bih.biClrUsed)
-	{
-		bfh.bfOffBits += bih.biClrUsed * sizeof(RGBQUAD);
-	}
-	else if (bitFields[0] || bitFields[1] || bitFields[2])
-	{
-		bfh.bfOffBits += sizeof(bitFields);
-	}
-
-	unsigned lineSize = (((bih.biWidth * bih.biBitCount) + 15) / 8) & ~1;
-	bfh.bfSize = bfh.bfOffBits + lineSize * bih.biHeight; 
-
-	ULONG ulnWr = 0;
-	if (!WriteFile(hFile, &bfh, sizeof(bfh), &ulnWr, NULL) || ulnWr!=sizeof(bfh))
-		return false;
-	if (!WriteFile(hFile, &bih, sizeof(bih), &ulnWr, NULL) || ulnWr!=sizeof(bih))
-		return false;
-
-	if (ptrPal)
-	{
-		if (!WriteFile(hFile, ptrPal, bih.biClrUsed * sizeof(RGBQUAD), &ulnWr, NULL) || ulnWr!=bih.biClrUsed * sizeof(RGBQUAD))
-			return false;
-	}
-	else if (bih.biCompression == BI_BITFIELDS)
-	{
-		if (!WriteFile(hFile, bitFields, sizeof(bitFields), &ulnWr, NULL) || ulnWr!=sizeof(bitFields))
-			return false;
-	}
-
-	for (int i = 0; i < bih.biHeight; i++)
-	{
-		char *pDWr = (char*)ptrBm + (bih.biHeight - i - 1) * bmstride;
-		if (!WriteFile(hFile, pDWr, lineSize, &ulnWr, NULL) || ulnWr!=lineSize)
-			return false;
-	}
-
-	return true;
-}
-
-// created for debug purposes
-bool	bDbgBmDump(
-			void *ptr,
-			int bmwidth,
-			int bmheight,
-			int bmstride,
-			int bmclrdepth)
-{
-	if (bmclrdepth!=16 && bmclrdepth!=32)
-	{
-		// TODO: add 8 bpp
-		return false;
-	}
-
-	SYSTEMTIME stm;
-	GetSystemTime(&stm);
-	TCHAR szFileName[MAX_PATH];
-	sprintf(
-		szFileName,
-		"%04u.%02u.%02u-%02u-%02u-%02u-0x%08x.bmp",
-		stm.wYear, stm.wMonth, stm.wDay,
-		stm.wHour, stm.wMinute, stm.wSecond,
-		(uint)(intptr_t) ptr);
-
-	HANDLE hFile = CreateFile(
-		szFileName,
-		FILE_WRITE_DATA,
-		0,
-		NULL,
-		CREATE_NEW,
-		FILE_ATTRIBUTE_NORMAL,
-		NULL);
-	if (hFile==INVALID_HANDLE_VALUE)
-	{
-		return false;
-	}
-
-	bool b= SaveBitmapToBMPFile(
-		hFile,
-		ptr,
-		NULL,
-		bmwidth,
-		bmheight,
-		bmstride,
-		bmclrdepth);
-
-	CloseHandle(hFile);
-	return b;
-}
-
-// created for debug purposes
-bool	vncDesktop::bDbgDumpSurfBuffers(const RECT &rcl)
-{
-	const int c2rect_re_vd_top = rcl.top - m_bmrect.top;
-	const int c3rect_re_vd_left = rcl.left - m_bmrect.left;
-	_ASSERTE(c2rect_re_vd_top >= 0);
-	_ASSERTE(c3rect_re_vd_left >= 0);
-	const UINT bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
-	const int offset = c2rect_re_vd_top * m_bytesPerRow + c3rect_re_vd_left * bytesPerPixel;
-
-	bool b1 = bDbgBmDump(
-		m_mainbuff+offset,
-		rcl.right - rcl.left,
-		rcl.bottom - rcl.top,
-		m_bytesPerRow,
-		m_scrinfo.format.bitsPerPixel);
-
-	bool b2 = bDbgBmDump(
-		m_backbuff+offset,
-		rcl.right - rcl.left,
-		rcl.bottom - rcl.top,
-		m_bytesPerRow,
-		m_scrinfo.format.bitsPerPixel);
-	return b1 && b2;
-}
diff --git a/ica/win32/src/vncDesktop.h b/ica/win32/src/vncDesktop.h
deleted file mode 100644
index 4aab7b5..0000000
--- a/ica/win32/src/vncDesktop.h
+++ /dev/null
@@ -1,277 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncDesktop object
-
-// The vncDesktop object handles retrieval of data from the
-// display buffer.  It also uses the RFBLib DLL to supply
-// information on mouse movements and screen updates to
-// the server
-
-class vncDesktop;
-
-#if !defined(_WINVNC_VNCDESKTOP)
-#define _WINVNC_VNCDESKTOP
-#pragma once
-
-// Include files
-#include "stdhdrs.h"
-
-#include "vncServer.h"
-#include "vncRegion.h"
-#include "RectList.h"
-#include "translate.h"
-#include <omnithread.h>
-#include "VideoDriver.h"
-
-// Constants
-extern const UINT RFB_SCREEN_UPDATE;
-extern const UINT RFB_COPYRECT_UPDATE;
-extern const UINT RFB_MOUSE_UPDATE;
-extern const char szDesktopSink[];
-
-#define MAX_REG_ENTRY_LEN             (80)
-
-// Class definition
-
-class vncDesktop
-{
-
-// Fields
-public:
-
-// Methods
-public:
-	// Make the desktop thread & window proc friends
-	friend class vncDesktopThread;
-	friend LRESULT CALLBACK DesktopWndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
-
-	// Create/Destroy methods
-	vncDesktop();
-	~vncDesktop();
-
-	BOOL Init(vncServer *pSrv);
-
-	// Hooking stuff
-	void TryActivateHooks();
-	BOOL DriverActive() { return m_videodriver != NULL; }
-
-	// Routine to signal a vncServer to trigger an update
-	void RequestUpdate();
-
-	// Screen translation, capture, info
-	void FillDisplayInfo(rfbServerInitMsg *scrInfo);
-	void SetLocalInputDisableHook(BOOL enable);
-	void SetLocalInputPriorityHook(BOOL enable);
-	void CaptureScreen(const RECT &UpdateArea, BYTE *scrBuff);
-	void CaptureScreenFromAdapterGeneral(RECT UpdateArea, BYTE *scrBuff);
-	void CaptureScreenFromMirage(RECT UpdateArea, BYTE *scrBuff);
-	int ScreenBuffSize();
-	HWND Window() { return m_hwnd; }
-
-	// Mouse related
-	void CaptureMouse(BYTE *scrBuff, UINT scrBuffSize);
-
-	void CaptureMouseRect();
-	BOOL GetRichCursorData(BYTE *databuf, HCURSOR hcursor, int width, int height);
-	RECT MouseRect();
-	void SetCursor(HCURSOR cursor);
-	HCURSOR GetCursor() { return m_hcursor; }
-
-// created for debug purposes. not used in normal builds.
-	bool bDbgDumpSurfBuffers(const RECT &rcl);
-
-	// Clipboard manipulation
-	static void ConvertClipText(char *dst, const char *src);
-	void SetClipText(LPSTR text);
-
-	// Method to obtain the DIBsection buffer if fast blits are enabled
-	// If they're disabled, it'll return NULL
-	inline BYTE *MainBuffer() {	return m_mainbuff; }
-	inline RECT MainBufferRect() {	return m_bmrect; }
-	void CopyRect(RECT const& dest, POINT source);
-
-	BOOL			m_initialClipBoardSeen;
-
-	// Implementation
-protected:
-
-	// Routines to hook and unhook us
-	BOOL Startup();
-	BOOL Shutdown();
-	void ActivateHooks();
-	void ShutdownHooks();
-
-	// Init routines called by the child thread
-	BOOL InitDesktop();
-	void KillScreenSaver();
-
-	RECT GetSourceRect();
-	BOOL GetSourceDisplayRect(RECT &rdisp_rect);
-	static BOOL IsMultiMonDesktop();
-
-	void ChangeResNow();
-	void SetupDisplayForConnection();
-	void ResetDisplayToNormal();
-
-	BOOL InitBitmap();
-	BOOL InitWindow();
-	BOOL ThunkBitmapInfo();
-	BOOL SetPixFormat();
-	BOOL SetPixShifts();
-	BOOL InitHooks();
-	BOOL SetPalette();
-
-	void CopyToBuffer(RECT rect, BYTE *scrBuff);
-	void CopyToBuffer(RECT rect, BYTE *scrBuff, const BYTE *SourceBuff);
-	void CopyRectToBuffer(RECT dest, POINT source);
-	void CalcCopyRects();
-	
-	// Routine to attempt enabling optimised DIBsection blits
-	BOOL CreateBuffers();
-
-	// Convert a bit mask eg. 00111000 to max=7, shift=3
-	static void MaskToMaxAndShift(DWORD mask, CARD16 &max, CARD8 &shift);
-	
-	// Enabling & disabling clipboard handling
-	void SetClipboardActive(BOOL active) {m_clipboard_active = active;};
-
-	// Detecting updates
-	BOOL CheckUpdates();
-	void SetPollingTimer();
-	void SetPollingFlag(BOOL set) { m_polling_flag = set; }
-	BOOL GetPollingFlag() { return m_polling_flag; }
-	void PerformPolling();
-	void PollWindow(HWND hwnd);
-	void PollArea(const RECT &rect);
-	void CheckRects(vncRegion &rgn, rectlist &rects);
-	void GetChangedRegion_Normal(vncRegion &rgn, const RECT &rect);
-	void GetChangedRegion_Dummy(vncRegion &rgn, const RECT &rect);
-
-	void GetChangedRegion(vncRegion &rgn, const RECT &rect)
-	{
-#if 1
-		GetChangedRegion_Normal(rgn, rect);
-#else
-		GetChangedRegion_Dummy(rgn, rect);
-#endif
-	}
-
-	void UpdateChangedRect(vncRegion &rgn, const RECT &rect);
-	void UpdateChangedSubRect(vncRegion &rgn, const RECT &rect);
-
-	// Blank screen feature
-	void UpdateBlankScreenTimer();
-	void BlankScreen(BOOL set);
-
-	// Timer identifiers (the third one is not used in any real timer)
-	enum TimerID {
-		TIMER_POLL = 1,
-		TIMER_BLANK_SCREEN = 2,
-		TIMER_RESTORE_SCREEN = 3
-	};
-
-	// Video driver stuff
-	BOOL InitVideoDriver();
-	void ShutdownVideoDriver();
-
-	// DATA
-
-	// Generally useful stuff
-	vncServer 		*m_server;
-	omni_thread 	*m_thread;
-	HWND			m_hwnd;
-	BOOL			m_polling_flag;
-	UINT			m_timer_polling;
-	UINT			m_timer_blank_screen;
-	HWND			m_hnextviewer;
-	BOOL			m_clipboard_active;
-	BOOL			m_hooks_active;
-	BOOL			m_hooks_may_change;
-
-	// Video driver stuff
-	vncVideoDriver	*m_videodriver;
-
-	// device contexts for memory and the screen
-	HDC				m_hmemdc;
-	HDC				m_hrootdc;
-
-	// New and old bitmaps
-	HBITMAP			m_membitmap;
-	omni_mutex		m_bitbltlock;
-
-// frame buffer relative to the entire (virtual) desktop.
-// NOTE: non-zero offsets possible
-	RECT			m_bmrect;
-
-	struct _BMInfo {
-		BOOL			truecolour;
-		BITMAPINFO		bmi;
-		// Colormap info - comes straight after BITMAPINFO - **HACK**
-		RGBQUAD			cmap[256];
-	} m_bminfo;
-
-	// Screen info
-	rfbServerInitMsg	m_scrinfo;
-
-	// These are the red, green & blue masks for a pixel
-	DWORD			m_rMask, m_gMask, m_bMask;
-
-	// This is always handy to have
-	int				m_bytesPerRow;
-
-	// Handle of the default cursor
-	HCURSOR			m_hcursor;
-	// Handle of the basic arrow cursor
-	HCURSOR			m_hdefcursor;
-	// The current mouse position
-	RECT			m_cursorpos;
-
-	// Boolean flag to indicate when the display resolution has changed
-	BOOL			m_displaychanged;
-
-	// Extra vars used for the DIBsection optimisation
-	VOID			*m_DIBbits;
-	BYTE			*m_mainbuff;
-	BYTE			*m_backbuff;
-	BOOL			m_freemainbuff;
-	BOOL			m_formatmunged;
-
-// DevMode alteration
-	DEVMODE			*m_lpAlternateDevMode; // *** used for res changes - Jeremy Peaks
-	long			origPelsWidth; // *** To set the original resolution
-	long			origPelsHeight; // *** - Jeremy Peaks
-	
-	vncRegion		m_changed_rgn;
-	BOOL			m_copyrect_set;
-	RECT			m_copyrect_rect;
-	POINT			m_copyrect_src;
-
-	static const int m_pollingOrder[32];
-	static int		m_pollingStep;
-};
-
-#endif // _WINVNC_VNCDESKTOP
diff --git a/ica/win32/src/vncEncodeCoRRE.cpp b/ica/win32/src/vncEncodeCoRRE.cpp
deleted file mode 100644
index 309732a..0000000
--- a/ica/win32/src/vncEncodeCoRRE.cpp
+++ /dev/null
@@ -1,549 +0,0 @@
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncodeCoRRE
-
-// This file implements the vncEncoder-derived vncEncodeCoRRE class.
-// This class overrides some vncEncoder functions to produce a
-// Compact RRE encoder.  Compact RRE (CoRRE) uses fewer bytes to
-// encode each subrect, which makes it faster in general.  It also
-// splits large rectangles up into ones of at most 256 pixels width
-// & height.  This results in better granularity to use for deciding
-// whether to send RAW or CoRRE/RRE. 
-
-#include "vncEncodeCoRRE.h"
-#include "rfb.h"
-#include "MinMax.h"
-#include <stdlib.h>
-#include <time.h>
-
-vncEncodeCoRRE::vncEncodeCoRRE()
-{
-	m_buffer = NULL;
-	m_bufflen = 0;
-
-	// Set some sensible defaults
-	m_maxwidth = 24;
-	m_maxheight = 24;
-	m_maxadjust = 1;
-
-	// Set the threshold up/down probability
-	m_threshold = 50;
-
-	// Seed the random number generator
-	srand((unsigned)time(NULL));
-
-	m_statsready = FALSE;
-	m_encodedbytes = 0;
-	m_rectbytes = 0;
-}
-
-vncEncodeCoRRE::~vncEncodeCoRRE()
-{
-	if (m_buffer != NULL)
-	{
-		delete [] m_buffer;
-		m_buffer = NULL;
-	}
-}
-
-void vncEncodeCoRRE::Init()
-{
-	vncEncoder::Init();
-}
-
-UINT vncEncodeCoRRE::RequiredBuffSize(UINT width, UINT height)
-{
-	RECT fullscreen;
-	UINT codedrects;
-	int savedmaxheight = m_maxheight;
-	int savedmaxwidth = m_maxwidth;
-
-	// Need to set worse case size in case we ever low the
-	// size to it.
-	m_maxheight = 8;
-	m_maxwidth = 8;
-
-	// Work out how many rectangles the entire screen would
-	// be re-encoded to...
-	fullscreen.left = 0;
-	fullscreen.top = 0;
-	fullscreen.right = width;
-	fullscreen.bottom = height;
-	codedrects = NumCodedRects(fullscreen);
-
-	// restore max width/height
-	m_maxwidth = savedmaxwidth;
-	m_maxheight = savedmaxheight;
-
-	// The buffer size required is the size of raw data for the whole
-	// screen plus enough space for the required number of rectangle
-	// headers.
-	// This is inherently always greater than the RAW encoded size of
-	// the whole screen!
-	return (codedrects * sz_rfbFramebufferUpdateRectHeader) +
-			(width * height * m_remoteformat.bitsPerPixel)/8;
-}
-
-UINT
-vncEncodeCoRRE::NumCodedRects(RECT &rect)
-{
-	// If we have any statistical data handy then adjust the CoRRE sizes
-	if (m_statsready)
-	{
-		m_statsready = FALSE;
-
-		UINT newscore = m_encodedbytes * m_lastrectbytes;
-		UINT oldscore = m_lastencodedbytes * m_rectbytes;
-
-		if (newscore <= oldscore)
-		{
-			// The change was a good one, so adjust the threshold accordingly!
-			m_threshold = Max(5, Min(95, m_threshold + m_maxadjust));
-
-			m_maxwidth = Max(8, Min(255, m_maxwidth + m_maxadjust));
-			m_maxheight = Max(8, Min(255, m_maxheight + m_maxadjust));
-		}
-		else
-		{
-			// The change was a bad one, so adjust the threshold accordingly!
-			// m_threshold = Max(5, Min(95, m_threshold - m_maxadjust));
-		}
-
-		// Now calculate a new adjustment and apply it
-		m_maxadjust = ((rand() % 99)<m_threshold) ? 1 : -1;
-		
-		// Prepare the stats data for next time...
-		m_lastencodedbytes = m_encodedbytes;
-		m_lastrectbytes = m_rectbytes;
-
-		m_encodedbytes = 0;
-		m_rectbytes = 0;
-	}
-
-	// Now return the number of rects that this one would encode to
-    if ((rect.bottom-rect.top) > m_maxheight)
-	{
-		RECT subrect1, subrect2;
-
-		// Find how many rects the two subrects would take
-		subrect1.left = rect.left;
-		subrect1.right = rect.right;
-		subrect1.top = rect.top;
-		subrect1.bottom = rect.top + m_maxheight;
-
-		subrect2.left = rect.left;
-		subrect2.right = rect.right;
-		subrect2.top = rect.top + m_maxheight;
-		subrect2.bottom = rect.bottom;
-
-		return NumCodedRects(subrect1) + NumCodedRects(subrect2);
-	}
-
-    if ((rect.right-rect.left) > m_maxwidth)
-	{
-		RECT subrect1, subrect2;
-
-		// Find how many rects the two subrects would take
-		subrect1.left = rect.left;
-		subrect1.right = rect.left + m_maxwidth;
-		subrect1.top = rect.top;
-		subrect1.bottom = rect.bottom;
-
-		subrect2.left = rect.left + m_maxwidth;
-		subrect2.right = rect.right;
-		subrect2.top = rect.top;
-		subrect2.bottom = rect.bottom;
-		return NumCodedRects(subrect1) + NumCodedRects(subrect2);
-	}
-
-	// This rectangle is small enough not to require splitting
-	return 1;
-}
-
-/*
- * corre.c
- *
- * Routines to implement Compact Rise-and-Run-length Encoding (CoRRE).  This
- * code is based on krw's original javatel rfbserver.
- */
-
-/*
- * This version modified for WinVNC by jnw.
- */
-
-static int rreAfterBufLen;
-
-static int subrectEncode8 (CARD8 *source, CARD8 *dest, int w, int h, int max);
-static int subrectEncode16 (CARD16 *source, CARD8 *dest, int w, int h, int max);
-static int subrectEncode32 (CARD32 *source, CARD8 *dest, int w, int h, int max);
-static CARD32 getBgColour (char *data, int size, int bpp);
-
-/*
- * vncEncodeCoRRE::EncodeRect - send an arbitrary size rectangle using CoRRE
- * encoding.
- */
-
-UINT
-vncEncodeCoRRE::EncodeRect(BYTE *source, BYTE *dest, const RECT &rect, int offx, int offy)
-{
-	// Do the encoding
-	UINT size = InternalEncodeRect(source, dest, rect);
-
-	const int rectW = rect.right - rect.left;
-	const int rectH = rect.bottom - rect.top;
-	offsetx = offx;
-	offsety = offy;
-
-	// Will this rectangle have been split for encoding?
-	if ((rectW>m_maxwidth) || (rectH>m_maxheight))
-	{
-		// Yes : Once we return, the stats will be valid!
-		m_statsready = TRUE;
-
-		// Update the stats
-		m_encodedbytes += size;
-		m_rectbytes += sz_rfbFramebufferUpdateRectHeader +
-			(rectW*rectH*m_remoteformat.bitsPerPixel/8);
-	}
-
-	return size;
-}
-
-UINT
-vncEncodeCoRRE::InternalEncodeRect(BYTE *source, BYTE *dest, const RECT &rect)
-{
-	int size = 0;
-
-    if ((rect.bottom-rect.top) > m_maxheight)
-	{
-		RECT subrect;
-
-		// Rectangle is too high - split it into two subrects to send
-		subrect.left = rect.left;
-		subrect.right = rect.right;
-		subrect.top = rect.top;
-		subrect.bottom = rect.top + m_maxheight;
-		size += InternalEncodeRect(source, dest + size, subrect);
-
-		subrect.left = rect.left;
-		subrect.right = rect.right;
-		subrect.top = rect.top + m_maxheight;
-		subrect.bottom = rect.bottom;
-		size += InternalEncodeRect(source, dest + size, subrect);
-
-		return size;
-    }
-
-    if ((rect.right-rect.left) > m_maxwidth)
-	{
-		RECT subrect;
-
-		// Rectangle is too high - split it into two subrects to send
-		subrect.left = rect.left;
-		subrect.right = rect.left + m_maxwidth;
-		subrect.top = rect.top;
-		subrect.bottom = rect.bottom;
-		size += InternalEncodeRect(source, dest + size, subrect);
-
-		subrect.left = rect.left + m_maxwidth;
-		subrect.right = rect.right;
-		subrect.top = rect.top;
-		subrect.bottom = rect.bottom;
-		size += InternalEncodeRect(source, dest + size, subrect);
-
-		return size;
-	}
-
-    return EncodeSmallRect(source, dest, rect);
-}
-
-void
-vncEncodeCoRRE::SetCoRREMax(BYTE width, BYTE height)
-{
-	m_maxwidth = width;
-	m_maxheight = height;
-}
-
-/*
- * EncodeSmallRect - send a small (guaranteed < 256x256)
- * rectangle using CoRRE encoding.
- */
-
-UINT
-vncEncodeCoRRE::EncodeSmallRect(BYTE *source, BYTE *dest, const RECT &rect)
-{
-	int subrects = -1;
-
-	const UINT rectW = rect.right - rect.left;
-	const UINT rectH = rect.bottom - rect.top;
-
-	// Create the rectangle header
-	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
-	surh->r.x = (CARD16) rect.left;
-	surh->r.y = (CARD16) rect.top;
-	surh->r.w = (CARD16) (rectW);
-	surh->r.h = (CARD16) (rectH);
-	surh->r.x = Swap16IfLE(surh->r.x - offsetx);
-	surh->r.y = Swap16IfLE(surh->r.y - offsety);
-	surh->r.w = Swap16IfLE(surh->r.w);
-	surh->r.h = Swap16IfLE(surh->r.h);
-	surh->encoding = Swap32IfLE(rfbEncodingCoRRE);
-
-	// create a space big enough for the CoRRE encoded pixels
-
-	size_t rectSize = rectW * rectH * (m_remoteformat.bitsPerPixel / 8);
-	if (m_bufflen < rectSize)
-	{
-		if (m_buffer != NULL)
-		{
-			delete [] m_buffer;
-			m_buffer = NULL;
-		}
-		m_buffer = new BYTE [rectSize + 1];
-		if (m_buffer == NULL)
-			return vncEncoder::EncodeRect(source, dest, rect, offsetx, offsety);
-
-		m_bufflen = rectSize;
-	}
-	
-	// Translate the data into our new buffer
-	Translate(source, m_buffer, rect);
-
-	// The Buffer object will have ensured that the destination buffer is
-	// big enough using RequiredBuffSize
-
-	// Choose the appropriate encoding routine (for speed...)
-	switch(m_remoteformat.bitsPerPixel)
-	{
-	case 8:
-		subrects = subrectEncode8(
-			m_buffer,
-			dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader,
-			rectW,
-			rectH,
-			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
-			);
-		break;
-	case 16:
-		subrects = subrectEncode16(
-			(CARD16 *)m_buffer,
-			(CARD8 *)(dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader),
-			rectW,
-			rectH,
-			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
-			);
-		break;
-	case 32:
-		subrects = subrectEncode32(
-			(CARD32 *)m_buffer,
-			(CARD8 *)(dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader),
-			rectW,
-			rectH,
-			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
-			);
-		break;
-	}
-
-	// If we couldn't encode the rectangles then just send the data raw
-	if (subrects < 0)
-		return vncEncoder::EncodeRect(source, dest, rect, offsetx, offsety);
-
-	// Send the RREHeader
-	rfbRREHeader *rreh=(rfbRREHeader *)(dest+sz_rfbFramebufferUpdateRectHeader);
-	rreh->nSubrects = Swap32IfLE(subrects);
-
-	// Update the statistics for this rectangle.
-	encodedSize += sz_rfbRREHeader + rreAfterBufLen;
-	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
-	dataSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
-	transmittedSize += sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + rreAfterBufLen;
-	
-	// Calculate the size of the buffer produced
-	return sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + rreAfterBufLen;
-}
-
-/*
- * 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 rreAfterBuf.  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(											\
-	CARD##bpp *source,										\
-    CARD8 *dest,											\
-	int w,													\
-	int h,													\
-	int maxbytes)											\
-{															\
-    CARD##bpp cl;											\
-    rfbCoRRERectangle subrect;								\
-    int x,y;												\
-    int i,j;												\
-    int hx=0,hy,vx=0,vy;									\
-    int hyflag;												\
-    CARD##bpp *seg;											\
-    CARD##bpp *line;										\
-    int hw,hh,vw,vh;										\
-    int thex,they,thew,theh;								\
-    int numsubs = 0;										\
-    int newLen;												\
-    CARD##bpp bg = (CARD##bpp)getBgColour((char*)source,w*h,bpp);	\
-															\
-    *((CARD##bpp*)dest) = bg;								\
-															\
-    rreAfterBufLen = (bpp/8);								\
-															\
-    for (y=0; y<h; y++) {									\
-      line = source+(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 = source+(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 = rreAfterBufLen + (bpp/8) + sz_rfbCoRRERectangle;			\
-          if ((newLen > (w * h * (bpp/8))) || (newLen > maxbytes))		\
-	    return -1;											\
-															\
-	  numsubs += 1;											\
-	  *((CARD##bpp*)(dest + rreAfterBufLen)) = cl;			\
-	  rreAfterBufLen += (bpp/8);							\
-	  memcpy(&dest[rreAfterBufLen],&subrect,sz_rfbCoRRERectangle);		\
-	  rreAfterBufLen += sz_rfbCoRRERectangle;			    \
-															\
-		  /*												\
-           * Now mark the subrect as done.				    \
-           */												\
-          for (j=they; j < (they+theh); j++) {				\
-            for (i=thex; i < (thex+thew); i++) {			\
-              source[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 CARD32
-getBgColour(
-	char *data,
-	int size,
-	int bpp)
-{
-    
-#define NUMCLRS 256
-  
-  static int counts[NUMCLRS];
-  int i,j,k;
-
-  int maxcount = 0;
-  CARD8 maxclr = 0;
-
-  if (bpp != 8) {
-    if (bpp == 16) {
-      return ((CARD16 *)data)[0];
-    } else if (bpp == 32) {
-      return ((CARD32 *)data)[0];
-    } else {
-      fprintf(stderr,"getBgColour: bpp %d?\n",bpp);
-      exit(1);
-    }
-  }
-
-  for (i=0; i<NUMCLRS; i++) {
-    counts[i] = 0;
-  }
-
-  for (j=0; j<size; j++) {
-    k = (int)(((CARD8 *)data)[j]);
-    if (k >= NUMCLRS) {
-      fprintf(stderr, "%s: unusual colour = %d\n", "getBgColour",k);
-      exit(1);
-    }
-    counts[k] += 1;
-    if (counts[k] > maxcount) {
-      maxcount = counts[k];
-      maxclr = ((CARD8 *)data)[j];
-    }
-  }
-  
-  return maxclr;
-}
diff --git a/ica/win32/src/vncEncodeCoRRE.h b/ica/win32/src/vncEncodeCoRRE.h
deleted file mode 100644
index 26d2eb6..0000000
--- a/ica/win32/src/vncEncodeCoRRE.h
+++ /dev/null
@@ -1,85 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncodeCoRRE object
-
-// The vncEncodeCoRRE object uses a compression encoding to send rectangles
-// to a client
-
-class vncEncodeCoRRE;
-
-#if !defined(_WINVNC_ENCODECORRRE)
-#define _WINVNC_ENCODECORRE
-#pragma once
-
-#include "vncEncoder.h"
-
-// Class definition
-
-class vncEncodeCoRRE : public vncEncoder
-{
-// Fields
-public:
-
-// Methods
-public:
-	// Create/Destroy methods
-	vncEncodeCoRRE();
-	~vncEncodeCoRRE();
-
-	virtual void Init();
-	virtual const char* GetEncodingName() { return "CoRRE"; }
-
-	virtual UINT RequiredBuffSize(UINT width, UINT height);
-	virtual UINT NumCodedRects(RECT &rect);
-
-	virtual UINT EncodeRect(BYTE *source, BYTE *dest, const RECT &rect, int offx, int offy);
-	virtual void SetCoRREMax(BYTE width, BYTE height);
-protected:
-	virtual UINT InternalEncodeRect(BYTE *source, BYTE *dest, const RECT &rect);
-	virtual UINT EncodeSmallRect(BYTE *source, BYTE *dest, const RECT &rect);
-
-// Implementation
-protected:
-	BYTE		*m_buffer;
-	size_t		m_bufflen;
-
-	// Maximum height & width for CoRRE
-	int			m_maxwidth;
-	int			m_maxheight;
-
-	// Last-update stats for CoRRE
-	UINT		m_encodedbytes, m_rectbytes;
-	UINT		m_lastencodedbytes, m_lastrectbytes;
-	int			m_maxadjust;
-	int			m_threshold;
-	BOOL		m_statsready;
-	int			offsetx;
-	int			offsety;
-};
-
-#endif // _WINVNC_ENCODECORRE
-
diff --git a/ica/win32/src/vncEncodeHexT.cpp b/ica/win32/src/vncEncodeHexT.cpp
deleted file mode 100644
index f0c39a1..0000000
--- a/ica/win32/src/vncEncodeHexT.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncodeHexT
-
-// This file implements the vncEncoder-derived vncEncodeHexT class.
-// This class overrides some vncEncoder functions to produce a
-// Hextile encoder.  Hextile splits all top-level update rectangles
-// into smaller, 16x16 rectangles and encodes these using the
-// optimised Hextile sub-encodings.
-
-#include "vncEncodeHexT.h"
-#include "rfb.h"
-#include "MinMax.h"
-#include <stdlib.h>
-#include <time.h>
-
-vncEncodeHexT::vncEncodeHexT()
-{
-}
-
-vncEncodeHexT::~vncEncodeHexT()
-{
-}
-
-void
-vncEncodeHexT::Init()
-{
-	vncEncoder::Init();
-}
-
-UINT
-vncEncodeHexT::RequiredBuffSize(UINT width, UINT height)
-{
-	return vncEncoder::RequiredBuffSize(width, height) + (((width/16)+1) * ((height/16)+1));
-}
-
-UINT
-vncEncodeHexT::NumCodedRects(RECT &rect)
-{
-	return 1;
-}
-
-/*
- * hextile.c
- *
- * Routines to implement Hextile Encoding
- */
-
-#include <stdio.h>
-#include "rfb.h"
-
-/*
- * vncEncodeHexT::EncodeRect - send a rectangle using hextile encoding.
- */
-
-UINT
-vncEncodeHexT::EncodeRect(BYTE *source, BYTE *dest, const RECT &rect, int offsetx, int offsety)
-{
-	const UINT rectW = rect.right - rect.left;
-	const UINT rectH = rect.bottom - rect.top;
-	int encodedResult;
-
-	// Create the rectangle header
-	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
-	surh->r.x = (CARD16) rect.left;
-	surh->r.y = (CARD16) rect.top;
-	surh->r.w = (CARD16) (rectW);
-	surh->r.h = (CARD16) (rectH);
-	surh->r.x = Swap16IfLE(surh->r.x - offsetx);
-	surh->r.y = Swap16IfLE(surh->r.y - offsety);
-	surh->r.w = Swap16IfLE(surh->r.w);
-	surh->r.h = Swap16IfLE(surh->r.h);
-	surh->encoding = Swap32IfLE(rfbEncodingHextile);
-
-	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
-	dataSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
-
-	// Do the encoding
-    switch (m_remoteformat.bitsPerPixel)
-	{
-	case 8:
-		encodedResult = EncodeHextiles8(source, dest + sz_rfbFramebufferUpdateRectHeader,
-									rect.left, rect.top, rectW, rectH);
-		encodedSize += encodedResult;
-		transmittedSize += sz_rfbFramebufferUpdateRectHeader + encodedResult;
-		return sz_rfbFramebufferUpdateRectHeader + encodedResult;
-    case 16:
-		encodedResult = EncodeHextiles16(source, dest + sz_rfbFramebufferUpdateRectHeader,
-									rect.left, rect.top, rectW, rectH);
-		encodedSize += encodedResult;
-		transmittedSize += sz_rfbFramebufferUpdateRectHeader + encodedResult;
-		return sz_rfbFramebufferUpdateRectHeader + encodedResult;
-    case 32:
-		encodedResult = EncodeHextiles32(source, dest + sz_rfbFramebufferUpdateRectHeader,
-									rect.left, rect.top, rectW, rectH);
-		encodedSize += encodedResult;
-		transmittedSize += sz_rfbFramebufferUpdateRectHeader + encodedResult;
-		return sz_rfbFramebufferUpdateRectHeader + encodedResult;
-    }
-
-	return vncEncoder::EncodeRect(source, dest, rect, offsetx, offsety);
-}
-
-#define PUT_PIXEL8(pix) (dest[destoffset++] = (pix))
-
-#define PUT_PIXEL16(pix) (dest[destoffset++] = ((char*)&(pix))[0],			\
-			  dest[destoffset++] = ((char*)&(pix))[1])
-
-#define PUT_PIXEL32(pix) (dest[destoffset++] = ((char*)&(pix))[0],			\
-			  dest[destoffset++] = ((char*)&(pix))[1],						\
-			  dest[destoffset++] = ((char*)&(pix))[2],						\
-			  dest[destoffset++] = ((char*)&(pix))[3])
-
-#define DEFINE_SEND_HEXTILES(bpp)											\
-																			\
-static UINT subrectEncode##bpp(CARD##bpp *src, BYTE *dest,					\
-				int w, int h, CARD##bpp bg,									\
-			    CARD##bpp fg, BOOL mono);									\
-static void testColours##bpp(CARD##bpp *data, int size, BOOL *mono,			\
-			     BOOL *solid, CARD##bpp *bg, CARD##bpp *fg);				\
-																			\
-																			\
-/*																			\
- * rfbSendHextiles															\
- */																			\
-																			\
-UINT																		\
-vncEncodeHexT::EncodeHextiles##bpp(BYTE *source, BYTE *dest,				\
-				  int rx, int ry, int rw, int rh)							\
-{																			\
-    int x, y, w, h;															\
-    int rectoffset, destoffset;												\
-    CARD##bpp bg=0, fg=0, newBg, newFg;											\
-    BOOL mono, solid;														\
-    BOOL validBg = FALSE;													\
-    CARD##bpp clientPixelData[16*16*(bpp/8)];								\
-    BOOL validFg = FALSE;													\
-																			\
-	destoffset = 0;															\
-																			\
-    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;												\
-																			\
-			RECT hexrect;													\
-			hexrect.left = x;												\
-			hexrect.top = y;												\
-			hexrect.right = x+w;											\
-			hexrect.bottom = y+h;											\
-			Translate(source, (BYTE *) &clientPixelData, hexrect);			\
-																			\
-			rectoffset = destoffset;										\
-			dest[rectoffset] = 0;											\
-			destoffset++;													\
-																			\
-			testColours##bpp(clientPixelData, w * h,						\
-			     &mono, &solid, &newBg, &newFg);							\
-																			\
-			if (!validBg || (newBg != bg))									\
-			{																\
-				validBg = TRUE;												\
-				bg = newBg;													\
-				dest[rectoffset] |= rfbHextileBackgroundSpecified;			\
-				PUT_PIXEL##bpp(bg);											\
-			}																\
-																			\
-			if (solid)														\
-				continue;													\
-																			\
-			dest[rectoffset] |= rfbHextileAnySubrects;						\
-																			\
-			if (mono)														\
-			{																\
-				if (!validFg || (newFg != fg))								\
-				{															\
-					validFg = TRUE;											\
-					fg = newFg;												\
-					dest[rectoffset] |= rfbHextileForegroundSpecified;		\
-					PUT_PIXEL##bpp(fg);										\
-				}															\
-			}																\
-			else															\
-			{																\
-				validFg = FALSE;											\
-				dest[rectoffset] |= rfbHextileSubrectsColoured;			    \
-			}																\
-																			\
-			int encodedbytes = subrectEncode##bpp(clientPixelData,			\
-								   dest + destoffset,						\
-								   w, h, bg, fg, mono);						\
-			destoffset += encodedbytes;										\
-			if (encodedbytes == 0)											\
-			{																\
-				/* encoding was too large, use raw */						\
-				validBg = FALSE;											\
-				validFg = FALSE;											\
-				destoffset = rectoffset;									\
-				dest[destoffset++] = rfbHextileRaw;							\
-																			\
-				Translate(source, (BYTE *) (dest + destoffset), hexrect);	\
-																			\
-				destoffset += w * h * (bpp/8);								\
-		    }																\
-		}																	\
-    }																		\
-																			\
-    return destoffset;														\
-}																			\
-																			\
-static UINT																	\
-subrectEncode##bpp(CARD##bpp *src, BYTE *dest, int w, int h, CARD##bpp bg,	\
-		   CARD##bpp fg, BOOL mono)											\
-{																			\
-    CARD##bpp cl;															\
-    int x,y;																\
-    int i,j;																\
-    int hx=0,hy,vx=0,vy;													\
-    int hyflag;																\
-    CARD##bpp *seg;															\
-    CARD##bpp *line;														\
-    int hw,hh,vw,vh;														\
-    int thex,they,thew,theh;												\
-    int numsubs = 0;														\
-    int newLen;																\
-    int rectoffset;															\
-	int destoffset;															\
-																			\
-	destoffset = 0;															\
-    rectoffset = destoffset;												\
-    destoffset++;															\
-																			\
-    for (y=0; y<h; y++)														\
-	{																		\
-		line = src+(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 = src+(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;												\
-				}															\
-																			\
-				if (mono)													\
-				{															\
-				    newLen = destoffset - rectoffset + 2;					\
-				}															\
-				else														\
-				{															\
-				    newLen = destoffset - rectoffset + bpp/8 + 2;			\
-				}															\
-																			\
-				if (newLen > (w * h * (bpp/8)))								\
-				    return 0;												\
-																			\
-				numsubs += 1;												\
-																			\
-				if (!mono) PUT_PIXEL##bpp(cl);								\
-																			\
-				dest[destoffset++] = rfbHextilePackXY(thex,they);			\
-				dest[destoffset++] = rfbHextilePackWH(thew,theh);			\
-																			\
-				/*															\
-				 * Now mark the subrect as done.							\
-				 */															\
-				for (j=they; j < (they+theh); j++)							\
-				{															\
-					for (i=thex; i < (thex+thew); i++)						\
-					{														\
-						src[j*w+i] = bg;									\
-					}														\
-				}															\
-		    }																\
-		}																	\
-    }																		\
-																			\
-    dest[rectoffset] = numsubs;												\
-																			\
-    return destoffset;														\
-}																			\
-																			\
-																			\
-/*																			\
- * 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(CARD##bpp *data, int size,									\
-				 BOOL *mono, BOOL *solid,									\
-				 CARD##bpp *bg, CARD##bpp *fg)								\
-{																			\
-    CARD##bpp 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/win32/src/vncEncodeHexT.h b/ica/win32/src/vncEncodeHexT.h
deleted file mode 100644
index 2021384..0000000
--- a/ica/win32/src/vncEncodeHexT.h
+++ /dev/null
@@ -1,75 +0,0 @@
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncodeHexT object
-
-// The vncEncodeHexT object uses a compression encoding to send rectangles
-// to a client
-
-class vncEncodeHexT;
-
-#if !defined(_WINVNC_ENCODEHEXTILE)
-#define _WINVNC_ENCODEHEXTILE
-#pragma once
-
-#include "vncEncoder.h"
-
-// Class definition
-
-class vncEncodeHexT : public vncEncoder
-{
-// Fields
-public:
-
-// Methods
-public:
-	// Create/Destroy methods
-	vncEncodeHexT();
-	~vncEncodeHexT();
-
-	virtual void Init();
-	virtual const char* GetEncodingName() { return "Hextile"; }
-
-	virtual UINT RequiredBuffSize(UINT width, UINT height);
-	virtual UINT NumCodedRects(RECT &rect);
-
-	virtual UINT EncodeRect(BYTE *source, BYTE *dest, const RECT &rect, int offsetx, int offsety);
-
-protected:
-	virtual UINT EncodeHextiles8(BYTE *source, BYTE *dest,
-		int x, int y, int w, int h);
-	virtual UINT EncodeHextiles16(BYTE *source, BYTE *dest,
-		int x, int y, int w, int h);
-	virtual UINT EncodeHextiles32(BYTE *source, BYTE *dest,
-		int x, int y, int w, int h);
-
-// Implementation
-protected:
-};
-
-#endif // _WINVNC_ENCODEHEXTILE
-
diff --git a/ica/win32/src/vncEncodeRRE.cpp b/ica/win32/src/vncEncodeRRE.cpp
deleted file mode 100644
index e63d254..0000000
--- a/ica/win32/src/vncEncodeRRE.cpp
+++ /dev/null
@@ -1,347 +0,0 @@
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncodeRRE
-
-// This file implements the vncEncoder-derived vncEncodeRRE class.
-// This class overrides some vncEncoder functions to produce a bitmap
-// to RRE encoder.  RRE is much more efficient than RAW format on
-// most screen data.
-
-#include "vncEncodeRRE.h"
-
-vncEncodeRRE::vncEncodeRRE()
-{
-	m_buffer = NULL;
-	m_bufflen = 0;
-}
-
-vncEncodeRRE::~vncEncodeRRE()
-{
-	if (m_buffer != NULL)
-	{
-		delete [] m_buffer;
-		m_buffer = NULL;
-	}
-}
-
-void
-vncEncodeRRE::Init()
-{
-	vncEncoder::Init();
-}
-
-UINT
-vncEncodeRRE::RequiredBuffSize(UINT width, UINT height)
-{
-	return vncEncoder::RequiredBuffSize(width, height);
-}
-
-UINT
-vncEncodeRRE::NumCodedRects(RECT &rect)
-{
-	return 1;
-}
-
-/*****************************************************************************
- *
- * Routines to implement Rise-and-Run-length Encoding (RRE).  This code is
- * based on krw's original javatel rfbserver.
- * This code courtesy of tjr
- */
-
-/*
- * rreBeforeBuf contains pixel data in the client's format.
- * rreAfterBuf contains the RRE encoded version.  If the RRE encoded version is
- * larger than the raw data or if it exceeds rreAfterBufSize then
- * normal encoding is used instead.
- */
-
-static int rreAfterBufLen;
-
-static int subrectEncode8 (CARD8 *data, CARD8 *buf, int w, int h, int maxBytes);
-static int subrectEncode16 (CARD16 *data, CARD8 *buf, int w, int h, int maxBytes);
-static int subrectEncode32 (CARD32 *data, CARD8 *buf, int w, int h, int maxBytes);
-static CARD32 getBgColour (char *data, int size, int bpp);
-
-/*
- * 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 rreAfterBuf.  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>].
- *
- * This code has been modified from tjr's original by Wez(jnw)
- */
-
-#define DEFINE_SUBRECT_ENCODE(bpp)											\
-static int																	\
-subrectEncode##bpp(															\
-	CARD##bpp *data,														\
-	CARD8 *buf,																\
-	int w,																	\
-	int h,																	\
-	int maxBytes															\
-	)																		\
-{																			\
-    CARD##bpp cl;															\
-    rfbRectangle subrect;													\
-    int x,y;																\
-    int i,j;																\
-    int hx=0,hy,vx=0,vy;														\
-    int hyflag;																\
-    CARD##bpp *seg;															\
-    CARD##bpp *line;														\
-    int hw,hh,vw,vh;														\
-    int thex,they,thew,theh;												\
-    int numsubs = 0;														\
-    int newLen;																\
-    CARD##bpp bg = (CARD##bpp)getBgColour((char*)data,w*h,bpp);				\
-																			\
-	/* Set the background colour value */									\
-	*((CARD##bpp *)buf) = bg;																\
-																			\
-    rreAfterBufLen = (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 ((i < w) && (seg[i] == cl)) 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 = rreAfterBufLen + (bpp/8) + sz_rfbRectangle;					\
-	if ((newLen > (w * h * (bpp/8))) || (newLen > maxBytes))				\
-	    return -1;															\
-																			\
-	  numsubs += 1;															\
-	  *((CARD##bpp *)(buf + rreAfterBufLen)) = cl;											\
-	  rreAfterBufLen += (bpp/8);											\
-	  memcpy(&buf[rreAfterBufLen],&subrect, sz_rfbRectangle);				\
-	  rreAfterBufLen += 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 CARD32
-getBgColour(char *data, int size, int bpp)
-{
-    
-#define NUMCLRS 256
-  
-  static int counts[NUMCLRS];
-  int i,j,k;
-
-  int maxcount = 0;
-  CARD8 maxclr = 0;
-
-  if (bpp != 8) {
-    if (bpp == 16) {
-      return ((CARD16 *)data)[0];
-    } else if (bpp == 32) {
-      return ((CARD32 *)data)[0];
-    } else {
-      fprintf(stderr,"getBgColour: bpp %d?\n",bpp);
-      exit(1);
-    }
-  }
-
-  for (i=0; i<NUMCLRS; i++) {
-    counts[i] = 0;
-  }
-
-  for (j=0; j<size; j++) {
-    k = (int)(((CARD8 *)data)[j]);
-    if (k >= NUMCLRS) {
-      fprintf(stderr, "%s: unusual colour = %d\n", "getBgColour",k);
-      exit(1);
-    }
-    counts[k] += 1;
-    if (counts[k] > maxcount) {
-      maxcount = counts[k];
-      maxclr = ((CARD8 *)data)[j];
-    }
-  }
-  
-  return maxclr;
-}
-
-// Encode the rectangle using RRE
-inline UINT
-vncEncodeRRE::EncodeRect(BYTE *source, BYTE *dest, const RECT &rect, int offx, int offy)
-{
-	int subrects = -1;
-
-	const UINT rectW = rect.right - rect.left;
-	const UINT rectH = rect.bottom - rect.top;
-	
-	// Create the rectangle header
-	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
-	surh->r.x = (CARD16) rect.left;
-	surh->r.y = (CARD16) rect.top;
-	surh->r.w = (CARD16) (rectW);
-	surh->r.h = (CARD16) (rectH);
-	surh->r.x = Swap16IfLE(surh->r.x - offx);
-	surh->r.y = Swap16IfLE(surh->r.y - offy);
-	surh->r.w = Swap16IfLE(surh->r.w);
-	surh->r.h = Swap16IfLE(surh->r.h);
-	surh->encoding = Swap32IfLE(rfbEncodingRRE);
-
-	// create a space big enough for the RRE encoded pixels
-	size_t rectSize = rectW * rectH * (m_remoteformat.bitsPerPixel / 8);
-	if (m_bufflen < rectSize)
-	{
-		if (m_buffer != NULL)
-		{
-			delete [] m_buffer;
-			m_buffer = NULL;
-		}
-		m_buffer = new BYTE [rectSize + 1];
-		if (m_buffer == NULL)
-			return vncEncoder::EncodeRect(source, dest, rect, offx, offy);
-		m_bufflen = rectSize;
-	}
-	
-	// Translate the data into our new buffer
-	Translate(source, m_buffer, rect);
-
-	// Choose the appropriate encoding routine (for speed...)
-	switch(m_remoteformat.bitsPerPixel)
-	{
-	case 8:
-		subrects = subrectEncode8(
-			m_buffer,
-			dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader,
-			rectW,
-			rectH,
-			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
-			);
-		break;
-	case 16:
-		subrects = subrectEncode16(
-			(CARD16 *)m_buffer,
-			(CARD8 *)(dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader),
-			rectW,
-			rectH,
-			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
-			);
-		break;
-	case 32:
-		subrects = subrectEncode32(
-			(CARD32 *)m_buffer,
-			(CARD8 *)(dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader),
-			rectW,
-			rectH,
-			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
-			);
-		break;
-	}
-
-	// If we couldn't encode the rectangles then just send the data raw
-	if (subrects < 0)
-		return vncEncoder::EncodeRect(source, dest, rect, offx, offy);
-
-	// Send the RREHeader
-	rfbRREHeader *rreh=(rfbRREHeader *)(dest+sz_rfbFramebufferUpdateRectHeader);
-	rreh->nSubrects = Swap32IfLE(subrects);
-
-	// Update statistics for this rectangle.
-	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
-	dataSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
-	encodedSize += sz_rfbRREHeader +
-					(m_remoteformat.bitsPerPixel / 8) +
-					(subrects * (sz_rfbRectangle + m_remoteformat.bitsPerPixel / 8));
-	transmittedSize += sz_rfbFramebufferUpdateRectHeader +
-						sz_rfbRREHeader +
-						(m_remoteformat.bitsPerPixel / 8) +
-						(subrects * (sz_rfbRectangle + m_remoteformat.bitsPerPixel / 8));
-
-	// Return the amount of data sent	
-	return sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader +
-		(m_remoteformat.bitsPerPixel / 8) +
-		(subrects * (sz_rfbRectangle + m_remoteformat.bitsPerPixel / 8));
-}
diff --git a/ica/win32/src/vncEncodeRRE.h b/ica/win32/src/vncEncodeRRE.h
deleted file mode 100644
index 885c686..0000000
--- a/ica/win32/src/vncEncodeRRE.h
+++ /dev/null
@@ -1,69 +0,0 @@
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncodeRRE object
-
-// The vncEncodeRRE object uses a compression encoding to send rectangles
-// to a client
-
-class vncEncodeRRE;
-
-#if !defined(_WINVNC_ENCODERRRE)
-#define _WINVNC_ENCODERRE
-#pragma once
-
-#include "vncEncoder.h"
-
-// Class definition
-
-class vncEncodeRRE : public vncEncoder
-{
-// Fields
-public:
-
-// Methods
-public:
-	// Create/Destroy methods
-	vncEncodeRRE();
-	~vncEncodeRRE();
-
-	virtual void Init();
-	virtual const char* GetEncodingName() { return "RRE"; }
-
-	virtual UINT RequiredBuffSize(UINT width, UINT height);
-	virtual UINT NumCodedRects(RECT &rect);
-
-	virtual UINT EncodeRect(BYTE *source, BYTE *dest, const RECT &rect, int offx, int offy);
-
-// Implementation
-protected:
-	BYTE		*m_buffer;
-	size_t		m_bufflen;
-};
-
-#endif // _WINVNC_ENCODERRE
-
diff --git a/ica/win32/src/vncEncodeTight.cpp b/ica/win32/src/vncEncodeTight.cpp
deleted file mode 100644
index 53d5f39..0000000
--- a/ica/win32/src/vncEncodeTight.cpp
+++ /dev/null
@@ -1,1599 +0,0 @@
-//  Copyright (C) 2000 Constantin Kaplinsky. All Rights Reserved.
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncodeTight
-
-// This file implements the vncEncoder-derived vncEncodeTight class.
-// This class overrides some vncEncoder functions to produce a bitmap
-// to Tight encoder. Tight is much more efficient than RAW format on
-// most screen data and usually 2..10 times as efficient as hextile.
-// It's also more efficient than Zlib encoding in most cases.
-// But note that tight compression may use more CPU time on the server.
-// However, over slower (128kbps or less) connections, the reduction
-// in data transmitted usually outweighs the extra latency added
-// while the server CPU performs the compression algorithms.
-
-#include "vncEncodeTight.h"
-
-// 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).
-//
-// NOTE: m_conf[9].maxRectSize should be >= m_conf[i].maxRectSize,
-// where i in [0..8]. RequiredBuffSize() method depends on this.
-
-const TIGHT_CONF vncEncodeTight::m_conf[10] = {
-	{   512,   32,   6, 65536, 0, 0, 0, 0,   0,   0,   4,  5, 10000, 23000 },
-	{  2048,  128,   6, 65536, 1, 1, 1, 0,   0,   0,   8, 10,  8000, 18000 },
-	{  6144,  256,   8, 65536, 3, 3, 2, 0,   0,   0,  24, 15,  6500, 15000 },
-	{ 10240, 1024,  12, 65536, 5, 5, 3, 0,   0,   0,  32, 25,  5000, 12000 },
-	{ 16384, 2048,  12, 65536, 6, 6, 4, 0,   0,   0,  32, 37,  4000, 10000 },
-	{ 32768, 2048,  12,  4096, 7, 7, 5, 4, 150, 380,  32, 50,  3000,  8000 },
-	{ 65536, 2048,  16,  4096, 7, 7, 6, 4, 170, 420,  48, 60,  2000,  5000 },
-	{ 65536, 2048,  16,  4096, 8, 8, 7, 5, 180, 450,  64, 70,  1000,  2500 },
-	{ 65536, 2048,  32,  8192, 9, 9, 8, 6, 190, 475,  64, 75,   500,  1200 },
-	{ 65536, 2048,  32,  8192, 9, 9, 9, 6, 200, 500,  96, 80,   200,   500 }
-};
-
-vncEncodeTight::vncEncodeTight()
-{
-	m_buffer = NULL;
-	m_bufflen = 0;
-
-	m_hdrBuffer = new BYTE [sz_rfbFramebufferUpdateRectHeader + 8 + 256*4];
-	m_prevRowBuf = NULL;
-
-	for (int i = 0; i < 4; i++)
-		m_zsActive[i] = false;
-}
-
-vncEncodeTight::~vncEncodeTight()
-{
-	if (m_buffer != NULL) {
-		delete[] m_buffer;
-		m_buffer = NULL;
-	}
-
-	delete[] m_hdrBuffer;
-
-	for (int i = 0; i < 4; i++) {
-		if (m_zsActive[i])
-			deflateEnd(&m_zsStruct[i]);
-		m_zsActive[i] = false;
-	}
-}
-
-void
-vncEncodeTight::Init()
-{
-	vncEncoder::Init();
-}
-
-/*****************************************************************************
- *
- * Routines to implement Tight Encoding.
- *
- */
-
-UINT
-vncEncodeTight::RequiredBuffSize(UINT width, UINT height)
-{
-	// FIXME: Use actual compression level instead of 9?
-	int result = m_conf[9].maxRectSize * (m_remoteformat.bitsPerPixel / 8);
-	result += result / 100 + 16;
-
-	return result;
-}
-
-UINT
-vncEncodeTight::NumCodedRects(RECT &rect)
-{
-	const int w = rect.right - rect.left;
-	const int h = rect.bottom - rect.top;
-
-	// No matter how many rectangles we will send if LastRect markers
-	// are used to terminate rectangle stream.
-	if (m_use_lastrect && w * h >= MIN_SPLIT_RECT_SIZE) {
-		return 0;
-	}
-
-	const int maxRectSize = m_conf[m_compresslevel].maxRectSize;
-	const int maxRectWidth = m_conf[m_compresslevel].maxRectWidth;
-
-	if (w > maxRectWidth || w * h > maxRectSize) {
-		const int subrectMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
-		const int subrectMaxHeight = maxRectSize / subrectMaxWidth;
-		return (((w - 1) / maxRectWidth + 1) *
-				((h - 1) / subrectMaxHeight + 1));
-	} else {
-		return 1;
-	}
-}
-
-UINT
-vncEncodeTight::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest,
-						   const RECT &rect, int offx, int offy)
-{
-	int x = rect.left, y = rect.top;
-	int w = rect.right - x, h = rect.bottom - y;
-	offsetx = offx;
-	offsety = offy;
-
-	const int maxRectSize = m_conf[m_compresslevel].maxRectSize;
-	const int rawDataSize = maxRectSize * (m_remoteformat.bitsPerPixel / 8);
-
-	if (m_bufflen < rawDataSize) {
-		if (m_buffer != NULL)
-			delete [] m_buffer;
-
-		m_buffer = new BYTE [rawDataSize+1];
-		if (m_buffer == NULL)
-			return vncEncoder::EncodeRect(source, dest, rect, offsetx, offsety);
-
-		m_bufflen = rawDataSize;
-	}
-
-	if ( m_remoteformat.depth == 24 && m_remoteformat.redMax == 0xFF &&
-		 m_remoteformat.greenMax == 0xFF && m_remoteformat.blueMax == 0xFF ) {
-		m_usePixelFormat24 = true;
-	} else {
-		m_usePixelFormat24 = false;
-	}
-
-	if (!m_use_lastrect || w * h < MIN_SPLIT_RECT_SIZE)
-		return EncodeRectSimple(source, outConn, dest, rect);
-
-	// Calculate maximum number of rows in one non-solid rectangle.
-
-	int nMaxRows;
-	{
-		int maxRectSize = m_conf[m_compresslevel].maxRectSize;
-		int maxRectWidth = m_conf[m_compresslevel].maxRectWidth;
-		int nMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
-		nMaxRows = maxRectSize / nMaxWidth;
-	}
-
-	// Try to find large solid-color areas and send them separately.
-
-	CARD32 colorValue;
-	int x_best, y_best, w_best, h_best;
-	int dx, dy, dw, dh;
-
-	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) {
-			RECT upperRect;
-			SetRect(&upperRect, x, y, x + w, y + nMaxRows);
-
-			int size = EncodeRectSimple(source, outConn, dest, upperRect);
-			outConn->SendQueued((char *)dest, size);
-
-			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(source, dx, dy, dw, dh, &colorValue, FALSE)) {
-
-				// Get dimensions of solid-color area.
-
-				FindBestSolidArea(source, 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(source, x, y, w, h, colorValue,
-								&x_best, &y_best, &w_best, &h_best);
-
-				// Compute dimensions of surrounding rectangles.
-
-				RECT rects[4];
-				SetRect(&rects[0],
-						x, y, x + w, y_best);
-				SetRect(&rects[1],
-						x, y_best, x_best, y_best + h_best);
-				SetRect(&rects[2],
-						x_best + w_best, y_best, x + w, y_best + h_best);
-				SetRect(&rects[3],
-						x, y_best + h_best, x + w, y + h);
-
-				// Send solid-color area and surrounding rectangles.
-
-				for (int i = 0; i < 4; i++) {
-					if (i == 2) {
-						RECT onePixel;
-						SetRect(&onePixel,
-								x_best, y_best, x_best + 1, y_best + 1);
-						Translate(source, m_buffer, onePixel);
-
-						SendTightHeader(x_best, y_best, w_best, h_best);
-						int size = SendSolidRect(dest);
-
-						outConn->SendQueued((char *)m_hdrBuffer, m_hdrBufferBytes);
-						outConn->SendQueued((char *)dest, size);
-						encodedSize += (m_hdrBufferBytes + size -
-										sz_rfbFramebufferUpdateRectHeader);
-						transmittedSize += (m_hdrBufferBytes + size);
-					}
-					if ( rects[i].left == rects[i].right ||
-						 rects[i].top  == rects[i].bottom ) {
-						continue;
-					}
-					int size = EncodeRect(source, outConn, dest, rects[i], offsetx, offsety);
-					outConn->SendQueued((char *)dest, size);
-				}
-
-				// Return after all recursive calls done (0 == data sent).
-
-				return 0;
-			}
-
-		}
-
-	}
-
-	// No suitable solid-color rectangles found.
-
-	return EncodeRectSimple(source, outConn, dest, rect);
-}
-
-void
-vncEncodeTight::FindBestSolidArea(BYTE *source, int x, int y, int w, int h,
-								  CARD32 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(source, 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(source, 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;
-}
-
-void vncEncodeTight::ExtendSolidArea(BYTE *source, int x, int y, int w, int h,
-									 CARD32 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(source, *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(source, *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(source, 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(source, cx, *y_ptr, 1, *h_ptr,
-									   &colorValue, TRUE);
-		  cx++ );
-	*w_ptr += cx - (*x_ptr + *w_ptr);
-}
-
-bool
-vncEncodeTight::CheckSolidTile(BYTE *source, int x, int y, int w, int h,
-							   CARD32 *colorPtr, bool needSameColor)
-{
-	switch(m_localformat.bitsPerPixel) {
-	case 32:
-		return CheckSolidTile32(source, x, y, w, h, colorPtr, needSameColor);
-	case 16:
-		return CheckSolidTile16(source, x, y, w, h, colorPtr, needSameColor);
-	default:
-		return CheckSolidTile8(source, x, y, w, h, colorPtr, needSameColor);
-	}
-}
-
-#define DEFINE_CHECK_SOLID_FUNCTION(bpp)									  \
-																			  \
-bool 																		  \
-vncEncodeTight::CheckSolidTile##bpp(BYTE *source, int x, int y, int w, int h, \
-									CARD32 *colorPtr, bool needSameColor)	  \
-{																			  \
-	CARD##bpp *fbptr;														  \
-	CARD##bpp colorValue;													  \
-	int dx, dy; 															  \
-																			  \
-	fbptr = (CARD##bpp *)													  \
-		&source[y * m_bytesPerRow + x * (bpp/8)];							  \
-																			  \
-	colorValue = *fbptr;													  \
-	if (needSameColor && (CARD32)colorValue != *colorPtr)					  \
-		return false;														  \
-																			  \
-	for (dy = 0; dy < h; dy++) {											  \
-		for (dx = 0; dx < w; dx++) {										  \
-			if (colorValue != fbptr[dx])									  \
-				return false;												  \
-		}																	  \
-		fbptr = (CARD##bpp *)((BYTE *)fbptr + m_bytesPerRow);				  \
-	}																		  \
-																			  \
-	*colorPtr = (CARD32)colorValue; 										  \
-	return true;															  \
-}
-
-DEFINE_CHECK_SOLID_FUNCTION(8)
-DEFINE_CHECK_SOLID_FUNCTION(16)
-DEFINE_CHECK_SOLID_FUNCTION(32)
-
-UINT
-vncEncodeTight::EncodeRectSimple(BYTE *source, VSocket *outConn, BYTE *dest,
-								 const RECT &rect)
-{
-	const int x = rect.left, y = rect.top;
-	const int w = rect.right - x, h = rect.bottom - y;
-
-	const int maxRectSize = m_conf[m_compresslevel].maxRectSize;
-	const int maxRectWidth = m_conf[m_compresslevel].maxRectWidth;
-
-	int partialSize = 0;
-
-	if (w > maxRectWidth || w * h > maxRectSize) {
-		const int subrectMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
-		const int subrectMaxHeight = maxRectSize / subrectMaxWidth;
-		int dx, dy, rw, rh;
-
-		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;
-
-				partialSize = EncodeSubrect(source, outConn, dest,
-											x+dx, y+dy, rw, rh);
-				if (dy + subrectMaxHeight < h || dx + maxRectWidth < w) {
-					outConn->SendQueued((char *)dest, partialSize);
-				}
-			}
-		}
-	} else {
-		partialSize = EncodeSubrect(source, outConn, dest, x, y, w, h);
-	}
-
-	return partialSize;
-}
-
-UINT
-vncEncodeTight::EncodeSubrect(BYTE *source, VSocket *outConn, BYTE *dest,
-							  int x, int y, int w, int h)
-{
-	SendTightHeader(x, y, w, h);
-
-	RECT r;
-	r.left = x; r.top = y;
-	r.right = x + w; r.bottom = y + h;
-	Translate(source, m_buffer, r);
-
-	m_paletteMaxColors = w * h / m_conf[m_compresslevel].idxMaxColorsDivisor;
-	if ( m_paletteMaxColors < 2 &&
-		 w * h >= m_conf[m_compresslevel].monoMinRectSize ) {
-		m_paletteMaxColors = 2;
-	}
-	switch (m_remoteformat.bitsPerPixel) {
-	case 8:
-		FillPalette8(w * h);
-		break;
-	case 16:
-		FillPalette16(w * h);
-		break;
-	default:
-		FillPalette32(w * h);
-	}
-
-	int encDataSize;
-	switch (m_paletteNumColors) {
-	case 0:
-		// Truecolor image
-		if (DetectSmoothImage(w, h)) {
-			if (m_qualitylevel != -1) {
-				encDataSize = SendJpegRect(dest, w, h,
-										   m_conf[m_qualitylevel].jpegQuality);
-			} else {
-				encDataSize = SendGradientRect(dest, w, h);
-			}
-		} else {
-			encDataSize = SendFullColorRect(dest, w, h);
-		}
-		break;
-	case 1:
-		// Solid rectangle
-		encDataSize = SendSolidRect(dest);
-		break;
-	case 2:
-		// Two-color rectangle
-		encDataSize = SendMonoRect(dest, w, h);
-		break;
-	default:
-		// Up to 256 different colors
-		if ( m_paletteNumColors > 96 &&
-			 m_qualitylevel != -1 && m_qualitylevel <= 3 &&
-			 DetectSmoothImage(w, h) ) {
-			encDataSize = SendJpegRect(dest, w, h,
-									   m_conf[m_qualitylevel].jpegQuality);
-		} else {
-			encDataSize = SendIndexedRect(dest, w, h);
-		}
-	}
-
-	if (encDataSize < 0)
-		return vncEncoder::EncodeRect(source, dest, r, 0, 0);
-
-	outConn->SendQueued((char *)m_hdrBuffer, m_hdrBufferBytes);
-
-	encodedSize += m_hdrBufferBytes - sz_rfbFramebufferUpdateRectHeader + encDataSize;
-	transmittedSize += m_hdrBufferBytes + encDataSize;
-
-	return encDataSize;
-}
-
-void
-vncEncodeTight::SendTightHeader(int x, int y, int w, int h)
-{
-	rfbFramebufferUpdateRectHeader rect;
-
-	rect.r.x = Swap16IfLE(x - offsetx);
-	rect.r.y = Swap16IfLE(y - offsety);
-	rect.r.w = Swap16IfLE(w);
-	rect.r.h = Swap16IfLE(h);
-	rect.encoding = Swap32IfLE(rfbEncodingTight);
-
-	dataSize += w * h * (m_remoteformat.bitsPerPixel / 8);
-	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
-
-	memcpy(m_hdrBuffer, (BYTE *)&rect, sz_rfbFramebufferUpdateRectHeader);
-	m_hdrBufferBytes = sz_rfbFramebufferUpdateRectHeader;
-}
-
-//
-// Subencoding implementations.
-//
-
-int
-vncEncodeTight::SendSolidRect(BYTE *dest)
-{
-	int len;
-
-	if (m_usePixelFormat24) {
-		Pack24(m_buffer, 1);
-		len = 3;
-	} else
-		len = m_remoteformat.bitsPerPixel / 8;
-
-	m_hdrBuffer[m_hdrBufferBytes++] = rfbTightFill << 4;
-	memcpy (dest, m_buffer, len);
-
-	return len;
-}
-
-int
-vncEncodeTight::SendMonoRect(BYTE *dest, int w, int h)
-{
-	const int streamId = 1;
-	int paletteLen, dataLen;
-	CARD8 paletteBuf[8];
-
-	// Prepare tight encoding header.
-	dataLen = (w + 7) / 8;
-	dataLen *= h;
-
-	m_hdrBuffer[m_hdrBufferBytes++] = (streamId | rfbTightExplicitFilter) << 4;
-	m_hdrBuffer[m_hdrBufferBytes++] = rfbTightFilterPalette;
-	m_hdrBuffer[m_hdrBufferBytes++] = 1;
-
-	// Prepare palette, convert image.
-	switch (m_remoteformat.bitsPerPixel) {
-	case 32:
-		EncodeMonoRect32((CARD8 *)m_buffer, w, h);
-
-		((CARD32 *)paletteBuf)[0] = m_monoBackground;
-		((CARD32 *)paletteBuf)[1] = m_monoForeground;
-
-		if (m_usePixelFormat24) {
-			Pack24(paletteBuf, 2);
-			paletteLen = 6;
-		} else
-			paletteLen = 8;
-
-		memcpy(&m_hdrBuffer[m_hdrBufferBytes], paletteBuf, paletteLen);
-		m_hdrBufferBytes += paletteLen;
-		break;
-
-	case 16:
-		EncodeMonoRect16((CARD8 *)m_buffer, w, h);
-
-		((CARD16 *)paletteBuf)[0] = (CARD16)m_monoBackground;
-		((CARD16 *)paletteBuf)[1] = (CARD16)m_monoForeground;
-
-		memcpy(&m_hdrBuffer[m_hdrBufferBytes], paletteBuf, 4);
-		m_hdrBufferBytes += 4;
-		break;
-
-	default:
-		EncodeMonoRect8((CARD8 *)m_buffer, w, h);
-
-		m_hdrBuffer[m_hdrBufferBytes++] = (BYTE)m_monoBackground;
-		m_hdrBuffer[m_hdrBufferBytes++] = (BYTE)m_monoForeground;
-	}
-
-	return CompressData(dest, streamId, dataLen,
-						m_conf[m_compresslevel].monoZlibLevel,
-						Z_DEFAULT_STRATEGY);
-}
-
-int
-vncEncodeTight::SendIndexedRect(BYTE *dest, int w, int h)
-{
-	const int streamId = 2;
-	int i, entryLen;
-	CARD8 paletteBuf[256*4];
-
-	// Prepare tight encoding header.
-	m_hdrBuffer[m_hdrBufferBytes++] = (streamId | rfbTightExplicitFilter) << 4;
-	m_hdrBuffer[m_hdrBufferBytes++] = rfbTightFilterPalette;
-	m_hdrBuffer[m_hdrBufferBytes++] = (BYTE)(m_paletteNumColors - 1);
-
-	// Prepare palette, convert image.
-	switch (m_remoteformat.bitsPerPixel) {
-	case 32:
-		EncodeIndexedRect32((CARD8 *)m_buffer, w * h);
-
-		for (i = 0; i < m_paletteNumColors; i++) {
-			((CARD32 *)paletteBuf)[i] =
-				m_palette.entry[i].listNode->rgb;
-		}
-		if (m_usePixelFormat24) {
-			Pack24(paletteBuf, m_paletteNumColors);
-			entryLen = 3;
-		} else
-			entryLen = 4;
-
-		memcpy(&m_hdrBuffer[m_hdrBufferBytes], paletteBuf,
-			   m_paletteNumColors * entryLen);
-		m_hdrBufferBytes += m_paletteNumColors * entryLen;
-		break;
-
-	case 16:
-		EncodeIndexedRect16((CARD8 *)m_buffer, w * h);
-
-		for (i = 0; i < m_paletteNumColors; i++) {
-			((CARD16 *)paletteBuf)[i] =
-				(CARD16)m_palette.entry[i].listNode->rgb;
-		}
-
-		memcpy(&m_hdrBuffer[m_hdrBufferBytes], paletteBuf,
-			   m_paletteNumColors * 2);
-		m_hdrBufferBytes += m_paletteNumColors * 2;
-		break;
-
-	default:
-		return -1;				// Should never happen.
-	}
-
-	return CompressData(dest, streamId, w * h,
-						m_conf[m_compresslevel].idxZlibLevel,
-						Z_DEFAULT_STRATEGY);
-}
-
-int
-vncEncodeTight::SendFullColorRect(BYTE *dest, int w, int h)
-{
-	const int streamId = 0;
-	int len;
-
-	m_hdrBuffer[m_hdrBufferBytes++] = 0x00;
-
-	if (m_usePixelFormat24) {
-		Pack24(m_buffer, w * h);
-		len = 3;
-	} else
-		len = m_remoteformat.bitsPerPixel / 8;
-
-	return CompressData(dest, streamId, w * h * len,
-						m_conf[m_compresslevel].rawZlibLevel,
-						Z_DEFAULT_STRATEGY);
-}
-
-int
-vncEncodeTight::SendGradientRect(BYTE *dest, int w, int h)
-{
-	const int streamId = 3;
-	int len;
-
-	if (m_remoteformat.bitsPerPixel == 8)
-		return SendFullColorRect(dest, w, h);
-
-	if (m_prevRowBuf == NULL)
-		m_prevRowBuf = new int [2048*3];
-
-	m_hdrBuffer[m_hdrBufferBytes++] = (streamId | rfbTightExplicitFilter) << 4;
-	m_hdrBuffer[m_hdrBufferBytes++] = rfbTightFilterGradient;
-
-	if (m_usePixelFormat24) {
-		FilterGradient24(m_buffer, w, h);
-		len = 3;
-	} else if (m_remoteformat.bitsPerPixel == 32) {
-		FilterGradient32((CARD32 *)m_buffer, w, h);
-		len = 4;
-	} else {
-		FilterGradient16((CARD16 *)m_buffer, w, h);
-		len = 2;
-	}
-
-	return CompressData(dest, streamId, w * h * len,
-						m_conf[m_compresslevel].gradientZlibLevel,
-						Z_FILTERED);
-}
-
-int
-vncEncodeTight::CompressData(BYTE *dest, int streamId, int dataLen,
-							 int zlibLevel, int zlibStrategy)
-{
-	if (dataLen < TIGHT_MIN_TO_COMPRESS) {
-		memcpy(dest, m_buffer, dataLen);
-		return dataLen;
-	}
-
-	z_streamp pz = &m_zsStruct[streamId];
-
-	// Initialize compression stream if needed.
-	if (!m_zsActive[streamId]) {
-		pz->zalloc = Z_NULL;
-		pz->zfree = Z_NULL;
-		pz->opaque = Z_NULL;
-
-		vnclog.Print(LL_INTINFO,
-					 VNCLOG("calling deflateInit2 with zlib level:%d\n"),
-					 zlibLevel);
-		int err = deflateInit2 (pz, zlibLevel, Z_DEFLATED, MAX_WBITS,
-								MAX_MEM_LEVEL, zlibStrategy);
-		if (err != Z_OK) {
-			vnclog.Print(LL_INTINFO,
-						 VNCLOG("deflateInit2 returned error:%d:%s\n"),
-						 err, pz->msg);
-			return -1;
-		}
-
-		m_zsActive[streamId] = true;
-		m_zsLevel[streamId] = zlibLevel;
-	}
-
-	int outBufferSize = dataLen + dataLen / 100 + 16;
-
-	// Prepare buffer pointers.
-	pz->next_in = (Bytef *)m_buffer;
-	pz->avail_in = dataLen;
-	pz->next_out = (Bytef *)dest;
-	pz->avail_out = outBufferSize;
-
-	// Change compression parameters if needed.
-	if (zlibLevel != m_zsLevel[streamId]) {
-		vnclog.Print(LL_INTINFO,
-					 VNCLOG("calling deflateParams with zlib level:%d\n"),
-					 zlibLevel);
-		int err = deflateParams (pz, zlibLevel, zlibStrategy);
-		if (err != Z_OK) {
-			vnclog.Print(LL_INTINFO,
-						 VNCLOG("deflateParams returned error:%d:%s\n"),
-						 err, pz->msg);
-			return -1;
-		}
-		m_zsLevel[streamId] = zlibLevel;
-	}
-
-	// Actual compression.
-	if ( deflate (pz, Z_SYNC_FLUSH) != Z_OK ||
-		 pz->avail_in != 0 || pz->avail_out == 0 ) {
-		vnclog.Print(LL_INTINFO, VNCLOG("deflate() call failed.\n"));
-		return -1;
-	}
-
-	return SendCompressedData(outBufferSize - pz->avail_out);
-}
-
-int
-vncEncodeTight::SendCompressedData(int compressedLen)
-{
-	// Prepare compressed data size for sending.
-	m_hdrBuffer[m_hdrBufferBytes++] = compressedLen & 0x7F;
-	if (compressedLen > 0x7F) {
-		m_hdrBuffer[m_hdrBufferBytes-1] |= 0x80;
-		m_hdrBuffer[m_hdrBufferBytes++] = compressedLen >> 7 & 0x7F;
-		if (compressedLen > 0x3FFF) {
-			m_hdrBuffer[m_hdrBufferBytes-1] |= 0x80;
-			m_hdrBuffer[m_hdrBufferBytes++] = compressedLen >> 14 & 0xFF;
-		}
-	}
-	return compressedLen;
-}
-
-void
-vncEncodeTight::FillPalette8(int count)
-{
-	CARD8 *data = (CARD8 *)m_buffer;
-	CARD8 c0, c1;
-	int i, n0, n1;
-
-	m_paletteNumColors = 0;
-
-	c0 = data[0];
-	for (i = 1; i < count && data[i] == c0; i++);
-	if (i == count) {
-		m_paletteNumColors = 1;
-		return; 				// Solid rectangle
-	}
-
-	if (m_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) {
-			m_monoBackground = (CARD32)c0;
-			m_monoForeground = (CARD32)c1;
-		} else {
-			m_monoBackground = (CARD32)c1;
-			m_monoForeground = (CARD32)c0;
-		}
-		m_paletteNumColors = 2;   // Two colors
-	}
-}
-
-#define DEFINE_FILL_PALETTE_FUNCTION(bpp)									  \
-																			  \
-void																		  \
-vncEncodeTight::FillPalette##bpp(int count) 								  \
-{																			  \
-	CARD##bpp *data = (CARD##bpp *)m_buffer;								  \
-	CARD##bpp c0, c1, ci;													  \
-	int i, n0, n1, ni;														  \
-																			  \
-	c0 = data[0];															  \
-	for (i = 1; i < count && data[i] == c0; i++);							  \
-	if (i >= count) {														  \
-		m_paletteNumColors = 1; /* Solid rectangle */						  \
-		return; 															  \
-	}																		  \
-																			  \
-	if (m_paletteMaxColors < 2) {											  \
-		m_paletteNumColors = 0; /* Full-color format 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) {														  \
-			m_monoBackground = (CARD32)c0;									  \
-			m_monoForeground = (CARD32)c1;									  \
-		} else {															  \
-			m_monoBackground = (CARD32)c1;									  \
-			m_monoForeground = (CARD32)c0;									  \
-		}																	  \
-		m_paletteNumColors = 2; /* Two colors */							  \
-		return; 															  \
-	}																		  \
-																			  \
-	PaletteReset(); 														  \
-	PaletteInsert (c0, (CARD32)n0, bpp);									  \
-	PaletteInsert (c1, (CARD32)n1, bpp);									  \
-																			  \
-	ni = 1; 																  \
-	for (i++; i < count; i++) { 											  \
-		if (data[i] == ci) {												  \
-			ni++;															  \
-		} else {															  \
-			if (!PaletteInsert (ci, (CARD32)ni, bpp))						  \
-				return; 													  \
-			ci = data[i];													  \
-			ni = 1; 														  \
-		}																	  \
-	}																		  \
-	PaletteInsert (ci, (CARD32)ni, bpp);									  \
-}
-
-DEFINE_FILL_PALETTE_FUNCTION(16)
-DEFINE_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))
-
-void
-vncEncodeTight::PaletteReset(void)
-{
-	m_paletteNumColors = 0;
-	memset(m_palette.hash, 0, 256 * sizeof(COLOR_LIST *));
-}
-
-int
-vncEncodeTight::PaletteInsert(CARD32 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 = m_palette.hash[hash_key];
-
-	while (pnode != NULL) {
-		if (pnode->rgb == rgb) {
-			// Such palette entry already exists.
-			new_idx = idx = pnode->idx;
-			count = m_palette.entry[idx].numPixels + numPixels;
-			if (new_idx && m_palette.entry[new_idx-1].numPixels < count) {
-				do {
-					m_palette.entry[new_idx] = m_palette.entry[new_idx-1];
-					m_palette.entry[new_idx].listNode->idx = new_idx;
-					new_idx--;
-				}
-				while (new_idx &&
-					   m_palette.entry[new_idx-1].numPixels < count);
-				m_palette.entry[new_idx].listNode = pnode;
-				pnode->idx = new_idx;
-			}
-			m_palette.entry[new_idx].numPixels = count;
-			return m_paletteNumColors;
-		}
-		prev_pnode = pnode;
-		pnode = pnode->next;
-	}
-
-	// Check if palette is full.
-	if ( m_paletteNumColors == 256 ||
-		 m_paletteNumColors == m_paletteMaxColors ) {
-		m_paletteNumColors = 0;
-		return 0;
-	}
-
-	// Move palette entries with lesser pixel counts.
-	for ( idx = m_paletteNumColors;
-		  idx > 0 && m_palette.entry[idx-1].numPixels < numPixels;
-		  idx-- ) {
-		m_palette.entry[idx] = m_palette.entry[idx-1];
-		m_palette.entry[idx].listNode->idx = idx;
-	}
-
-	// Add new palette entry into the freed slot.
-	pnode = &m_palette.list[m_paletteNumColors];
-	if (prev_pnode != NULL) {
-		prev_pnode->next = pnode;
-	} else {
-		m_palette.hash[hash_key] = pnode;
-	}
-	pnode->next = NULL;
-	pnode->idx = idx;
-	pnode->rgb = rgb;
-	m_palette.entry[idx].listNode = pnode;
-	m_palette.entry[idx].numPixels = numPixels;
-
-	return (++m_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.
-//
-
-void
-vncEncodeTight::Pack24(BYTE *buf, int count)
-{
-	CARD32 *buf32;
-	CARD32 pix;
-	int r_shift, g_shift, b_shift;
-
-	buf32 = (CARD32 *)buf;
-
-	if (!m_localformat.bigEndian == !m_remoteformat.bigEndian) {
-		r_shift = m_remoteformat.redShift;
-		g_shift = m_remoteformat.greenShift;
-		b_shift = m_remoteformat.blueShift;
-	} else {
-		r_shift = 24 - m_remoteformat.redShift;
-		g_shift = 24 - m_remoteformat.greenShift;
-		b_shift = 24 - m_remoteformat.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) 									  \
-																			  \
-void																		  \
-vncEncodeTight::EncodeIndexedRect##bpp(BYTE *buf, int count)				  \
-{																			  \
-	COLOR_LIST *pnode;														  \
-	CARD##bpp *src; 														  \
-	CARD##bpp rgb;															  \
-	int rep = 0;															  \
-																			  \
-	src = (CARD##bpp *) buf;												  \
-																			  \
-	while (count--) {														  \
-		rgb = *src++;														  \
-		while (count && *src == rgb) {										  \
-			rep++, src++, count--;											  \
-		}																	  \
-		pnode = m_palette.hash[HASH_FUNC##bpp(rgb)];						  \
-		while (pnode != NULL) { 											  \
-			if ((CARD##bpp)pnode->rgb == rgb) { 							  \
-				*buf++ = (CARD8)pnode->idx; 								  \
-				while (rep) {												  \
-					*buf++ = (CARD8)pnode->idx; 							  \
-					rep--;													  \
-				}															  \
-				break;														  \
-			}																  \
-			pnode = pnode->next;											  \
-		}																	  \
-	}																		  \
-}
-
-DEFINE_IDX_ENCODE_FUNCTION(16)
-DEFINE_IDX_ENCODE_FUNCTION(32)
-
-#define DEFINE_MONO_ENCODE_FUNCTION(bpp)									  \
-																			  \
-void																		  \
-vncEncodeTight::EncodeMonoRect##bpp(BYTE *buf, int w, int h)				  \
-{																			  \
-	CARD##bpp *ptr; 														  \
-	CARD##bpp bg;															  \
-	unsigned int value, mask;												  \
-	int aligned_width;														  \
-	int x, y, bg_bits;														  \
-																			  \
-	ptr = (CARD##bpp *) buf;												  \
-	bg = (CARD##bpp) m_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++ = (CARD8)value;											  \
-		}																	  \
-																			  \
-		mask = 0x80;														  \
-		value = 0;															  \
-		if (x >= w) 														  \
-			continue;														  \
-																			  \
-		for (; x < w; x++) {												  \
-			if (*ptr++ != bg) { 											  \
-				value |= mask;												  \
-			}																  \
-			mask >>= 1; 													  \
-		}																	  \
-		*buf++ = (CARD8)value;												  \
-	}																		  \
-}
-
-DEFINE_MONO_ENCODE_FUNCTION(8)
-DEFINE_MONO_ENCODE_FUNCTION(16)
-DEFINE_MONO_ENCODE_FUNCTION(32)
-
-
-//
-// ``Gradient'' filter for 24-bit color samples.
-// Should be called only when redMax, greenMax and blueMax are 255.
-// Color components assumed to be byte-aligned.
-//
-
-void
-vncEncodeTight::FilterGradient24(BYTE *buf, int w, int h)
-{
-	CARD32 *buf32;
-	CARD32 pix32;
-	int *prevRowPtr;
-	int shiftBits[3];
-	int pixHere[3], pixUpper[3], pixLeft[3], pixUpperLeft[3];
-	int prediction;
-	int x, y, c;
-
-	buf32 = (CARD32 *)buf;
-	memset (m_prevRowBuf, 0, w * 3 * sizeof(int));
-
-	if (!m_localformat.bigEndian == !m_remoteformat.bigEndian) {
-		shiftBits[0] = m_remoteformat.redShift;
-		shiftBits[1] = m_remoteformat.greenShift;
-		shiftBits[2] = m_remoteformat.blueShift;
-	} else {
-		shiftBits[0] = 24 - m_remoteformat.redShift;
-		shiftBits[1] = 24 - m_remoteformat.greenShift;
-		shiftBits[2] = 24 - m_remoteformat.blueShift;
-	}
-
-	for (y = 0; y < h; y++) {
-		for (c = 0; c < 3; c++) {
-			pixUpper[c] = 0;
-			pixHere[c] = 0;
-		}
-		prevRowPtr = m_prevRowBuf;
-		for (x = 0; x < w; x++) {
-			pix32 = *buf32++;
-			for (c = 0; c < 3; c++) {
-				pixUpperLeft[c] = pixUpper[c];
-				pixLeft[c] = pixHere[c];
-				pixUpper[c] = *prevRowPtr;
-				pixHere[c] = (int)(pix32 >> shiftBits[c] & 0xFF);
-				*prevRowPtr++ = pixHere[c];
-
-				prediction = pixLeft[c] + pixUpper[c] - pixUpperLeft[c];
-				if (prediction < 0) {
-					prediction = 0;
-				} else if (prediction > 0xFF) {
-					prediction = 0xFF;
-				}
-				*buf++ = (BYTE)(pixHere[c] - prediction);
-			}
-		}
-	}
-}
-
-
-//
-// ``Gradient'' filter for other color depths.
-//
-
-#define DEFINE_GRADIENT_FILTER_FUNCTION(bpp)								  \
-																			  \
-void																		  \
-vncEncodeTight::FilterGradient##bpp(CARD##bpp *buf, int w, int h)			  \
-{																			  \
-	CARD##bpp pix, diff;													  \
-	bool endianMismatch;													  \
-	int *prevRowPtr;														  \
-	int maxColor[3], shiftBits[3];											  \
-	int pixHere[3], pixUpper[3], pixLeft[3], pixUpperLeft[3];				  \
-	int prediction; 														  \
-	int x, y, c;															  \
-																			  \
-	memset (m_prevRowBuf, 0, w * 3 * sizeof(int));							  \
-																			  \
-	endianMismatch = (!m_localformat.bigEndian != !m_remoteformat.bigEndian); \
-																			  \
-	maxColor[0] = m_remoteformat.redMax;									  \
-	maxColor[1] = m_remoteformat.greenMax;									  \
-	maxColor[2] = m_remoteformat.blueMax;									  \
-	shiftBits[0] = m_remoteformat.redShift; 								  \
-	shiftBits[1] = m_remoteformat.greenShift;								  \
-	shiftBits[2] = m_remoteformat.blueShift;								  \
-																			  \
-	for (y = 0; y < h; y++) {												  \
-		for (c = 0; c < 3; c++) {											  \
-			pixUpper[c] = 0;												  \
-			pixHere[c] = 0; 												  \
-		}																	  \
-		prevRowPtr = m_prevRowBuf;											  \
-		for (x = 0; x < w; x++) {											  \
-			pix = *buf; 													  \
-			if (endianMismatch) {											  \
-				pix = Swap##bpp(pix);										  \
-			}																  \
-			diff = 0;														  \
-			for (c = 0; c < 3; c++) {										  \
-				pixUpperLeft[c] = pixUpper[c];								  \
-				pixLeft[c] = pixHere[c];									  \
-				pixUpper[c] = *prevRowPtr;									  \
-				pixHere[c] = (int)(pix >> shiftBits[c] & maxColor[c]);		  \
-				*prevRowPtr++ = pixHere[c]; 								  \
-																			  \
-				prediction = pixLeft[c] + pixUpper[c] - pixUpperLeft[c];	  \
-				if (prediction < 0) {										  \
-					prediction = 0; 										  \
-				} else if (prediction > maxColor[c]) {						  \
-					prediction = maxColor[c];								  \
-				}															  \
-				diff |= ((pixHere[c] - prediction) & maxColor[c])			  \
-					<< shiftBits[c];										  \
-			}																  \
-			if (endianMismatch) {											  \
-				diff = Swap##bpp(diff); 									  \
-			}																  \
-			*buf++ = diff;													  \
-		}																	  \
-	}																		  \
-}
-
-DEFINE_GRADIENT_FILTER_FUNCTION(16)
-DEFINE_GRADIENT_FILTER_FUNCTION(32)
-
-
-//
-// Code to guess if given rectangle is suitable for smooth image
-// compression (by applying "gradient" filter or JPEG coder).
-//
-
-#define JPEG_MIN_RECT_SIZE	4096
-
-#define DETECT_SUBROW_WIDTH   7
-#define DETECT_MIN_WIDTH	  8
-#define DETECT_MIN_HEIGHT	  8
-
-int
-vncEncodeTight::DetectSmoothImage (int w, int h)
-{
-	if ( m_localformat.bitsPerPixel == 8 || m_remoteformat.bitsPerPixel == 8 ||
-		 w < DETECT_MIN_WIDTH || h < DETECT_MIN_HEIGHT ) {
-		return 0;
-	}
-
-	if (m_qualitylevel != -1) {
-		if (w * h < JPEG_MIN_RECT_SIZE) {
-			return 0;
-		}
-	} else {
-		if (w * h < m_conf[m_compresslevel].gradientMinRectSize) {
-			return 0;
-		}
-	}
-
-	unsigned long avgError;
-	if (m_remoteformat.bitsPerPixel == 32) {
-		if (m_usePixelFormat24) {
-			avgError = DetectSmoothImage24(w, h);
-			if (m_qualitylevel != -1) {
-				return (avgError < m_conf[m_qualitylevel].jpegThreshold24);
-			}
-			return (avgError < m_conf[m_compresslevel].gradientThreshold24);
-		} else {
-			avgError = DetectSmoothImage32(w, h);
-		}
-	} else {
-		avgError = DetectSmoothImage16(w, h);
-	}
-	if (m_qualitylevel != -1) {
-		return (avgError < m_conf[m_qualitylevel].jpegThreshold);
-	}
-	return (avgError < m_conf[m_compresslevel].gradientThreshold);
-}
-
-unsigned long
-vncEncodeTight::DetectSmoothImage24 (int w, int h)
-{
-	int diffStat[256];
-	int pixelCount = 0;
-	int pix, left[3];
-	unsigned long avgError;
-
-	// If client is big-endian, color samples begin from the second
-	// byte (offset 1) of a 32-bit pixel value.
-	int off = (m_remoteformat.bigEndian != 0);
-
-	memset(diffStat, 0, 256*sizeof(int));
-
-	int y = 0, x = 0;
-	int d, dx, c;
-	while (y < h && x < w) {
-		for (d = 0; d < h - y && d < w - x - DETECT_SUBROW_WIDTH; d++) {
-			for (c = 0; c < 3; c++) {
-				left[c] = (int)m_buffer[((y+d)*w+x+d)*4+off+c] & 0xFF;
-			}
-			for (dx = 1; dx <= DETECT_SUBROW_WIDTH; dx++) {
-				for (c = 0; c < 3; c++) {
-					pix = (int)m_buffer[((y+d)*w+x+d+dx)*4+off+c] & 0xFF;
-					diffStat[abs(pix - left[c])]++;
-					left[c] = pix;
-				}
-				pixelCount++;
-			}
-		}
-		if (w > h) {
-			x += h;
-			y = 0;
-		} else {
-			x = 0;
-			y += w;
-		}
-	}
-
-	if (diffStat[0] * 33 / pixelCount >= 95)
-		return 0;
-
-	avgError = 0;
-	for (c = 1; c < 8; c++) {
-		avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);
-		if (diffStat[c] == 0 || diffStat[c] > diffStat[c-1] * 2)
-			return 0;
-	}
-	for (; c < 256; c++) {
-		avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);
-	}
-	avgError /= (pixelCount * 3 - diffStat[0]);
-
-	return avgError;
-}
-
-#define DEFINE_DETECT_FUNCTION(bpp) 										  \
-																			  \
-unsigned long																  \
-vncEncodeTight::DetectSmoothImage##bpp (int w, int h)						  \
-{																			  \
-	bool endianMismatch;													  \
-	CARD##bpp pix;															  \
-	int maxColor[3], shiftBits[3];											  \
-	int x, y, d, dx, c; 													  \
-	int diffStat[256];														  \
-	int pixelCount = 0; 													  \
-	int sample, sum, left[3];												  \
-	unsigned long avgError; 												  \
-																			  \
-	endianMismatch = (!m_localformat.bigEndian != !m_remoteformat.bigEndian); \
-																			  \
-	maxColor[0] = m_remoteformat.redMax;									  \
-	maxColor[1] = m_remoteformat.greenMax;									  \
-	maxColor[2] = m_remoteformat.blueMax;									  \
-	shiftBits[0] = m_remoteformat.redShift; 								  \
-	shiftBits[1] = m_remoteformat.greenShift;								  \
-	shiftBits[2] = m_remoteformat.blueShift;								  \
-																			  \
-	memset(diffStat, 0, 256*sizeof(int));									  \
-																			  \
-	y = 0, x = 0;															  \
-	while (y < h && x < w) {												  \
-		for (d = 0; d < h - y && d < w - x - DETECT_SUBROW_WIDTH; d++) {	  \
-			pix = ((CARD##bpp *)m_buffer)[(y+d)*w+x+d]; 					  \
-			if (endianMismatch) {											  \
-				pix = Swap##bpp(pix);										  \
-			}																  \
-			for (c = 0; c < 3; c++) {										  \
-				left[c] = (int)(pix >> shiftBits[c] & maxColor[c]); 		  \
-			}																  \
-			for (dx = 1; dx <= DETECT_SUBROW_WIDTH; dx++) { 				  \
-				pix = ((CARD##bpp *)m_buffer)[(y+d)*w+x+d+dx];				  \
-				if (endianMismatch) {										  \
-					pix = Swap##bpp(pix);									  \
-				}															  \
-				sum = 0;													  \
-				for (c = 0; c < 3; c++) {									  \
-					sample = (int)(pix >> shiftBits[c] & maxColor[c]);		  \
-					sum += abs(sample - left[c]);							  \
-					left[c] = sample;										  \
-				}															  \
-				if (sum > 255)												  \
-					sum = 255;												  \
-				diffStat[sum]++;											  \
-				pixelCount++;												  \
-			}																  \
-		}																	  \
-		if (w > h) {														  \
-			x += h; 														  \
-			y = 0;															  \
-		} else {															  \
-			x = 0;															  \
-			y += w; 														  \
-		}																	  \
-	}																		  \
-																			  \
-	if ((diffStat[0] + diffStat[1]) * 100 / pixelCount >= 90)				  \
-		return 0;															  \
-																			  \
-	avgError = 0;															  \
-	for (c = 1; c < 8; c++) {												  \
-		avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);	  \
-		if (diffStat[c] == 0 || diffStat[c] > diffStat[c-1] * 2)			  \
-			return 0;														  \
-	}																		  \
-	for (; c < 256; c++) {													  \
-		avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);	  \
-	}																		  \
-	avgError /= (pixelCount - diffStat[0]); 								  \
-																			  \
-	return avgError;														  \
-}
-
-DEFINE_DETECT_FUNCTION(16)
-DEFINE_DETECT_FUNCTION(32)
-
-//
-// JPEG compression stuff.
-//
-
-static bool jpegError;
-static int jpegDstDataLen;
-
-static void JpegSetDstManager(j_compress_ptr cinfo, JOCTET *buf, size_t buflen);
-
-int
-vncEncodeTight::SendJpegRect(BYTE *dst, int w, int h, int quality)
-{
-	struct jpeg_compress_struct cinfo;
-	struct jpeg_error_mgr jerr;
-
-	if (m_localformat.bitsPerPixel == 8)
-		return SendFullColorRect(dst, w, h);
-
-	BYTE *srcBuf = new BYTE[w * 3];
-	JSAMPROW rowPointer[1];
-	rowPointer[0] = (JSAMPROW)srcBuf;
-
-	cinfo.err = jpeg_std_error(&jerr);
-	jpeg_create_compress(&cinfo);
-
-	cinfo.image_width = w;
-	cinfo.image_height = h;
-	cinfo.input_components = 3;
-	cinfo.in_color_space = JCS_RGB;
-
-	jpeg_set_defaults(&cinfo);
-	jpeg_set_quality(&cinfo, quality, TRUE);
-
-	JpegSetDstManager (&cinfo, (JOCTET*)dst, w * h * (m_localformat.bitsPerPixel / 8));
-
-	jpeg_start_compress(&cinfo, TRUE);
-
-	for (int dy = 0; dy < h; dy++) {
-		PrepareRowForJpeg(srcBuf, dy, w);
-		jpeg_write_scanlines(&cinfo, rowPointer, 1);
-		if (jpegError)
-			break;
-	}
-
-	if (!jpegError)
-		jpeg_finish_compress(&cinfo);
-
-	jpeg_destroy_compress(&cinfo);
-	delete[] srcBuf;
-
-	if (jpegError)
-		return SendFullColorRect(dst, w, h);
-
-	m_hdrBuffer[m_hdrBufferBytes++] = rfbTightJpeg << 4;
-
-	return SendCompressedData(jpegDstDataLen);
-}
-
-void
-vncEncodeTight::PrepareRowForJpeg(BYTE *dst, int y, int w)
-{
-	if (m_remoteformat.bitsPerPixel == 32) {
-		CARD32 *src = (CARD32 *)&m_buffer[y * w * sizeof(CARD32)];
-		if (m_usePixelFormat24) {
-			PrepareRowForJpeg24(dst, src, w);
-		} else {
-			PrepareRowForJpeg32(dst, src, w);
-		}
-	} else {
-		// 16 bpp assumed.
-		CARD16 *src = (CARD16 *)&m_buffer[y * w * sizeof(CARD16)];
-		PrepareRowForJpeg16(dst, src, w);
-	}
-}
-
-void
-vncEncodeTight::PrepareRowForJpeg24(BYTE *dst, CARD32 *src, int count)
-{
-	int r_shift, g_shift, b_shift;
-	if (!m_localformat.bigEndian == !m_remoteformat.bigEndian) {
-		r_shift = m_remoteformat.redShift;
-		g_shift = m_remoteformat.greenShift;
-		b_shift = m_remoteformat.blueShift;
-	} else {
-		r_shift = 24 - m_remoteformat.redShift;
-		g_shift = 24 - m_remoteformat.greenShift;
-		b_shift = 24 - m_remoteformat.blueShift;
-	}
-
-	CARD32 pix;
-	while (count--) {
-		pix = *src++;
-		*dst++ = (BYTE)(pix >> r_shift);
-		*dst++ = (BYTE)(pix >> g_shift);
-		*dst++ = (BYTE)(pix >> b_shift);
-	}
-}
-
-#define DEFINE_JPEG_GET_ROW_FUNCTION(bpp)									\
-																			\
-void																		\
-vncEncodeTight::PrepareRowForJpeg##bpp(BYTE *dst, CARD##bpp *src, int count)\
-{																			\
-	bool endianMismatch =													\
-		(!m_localformat.bigEndian != !m_remoteformat.bigEndian);			\
-																			\
-	int r_shift = m_remoteformat.redShift;									\
-	int g_shift = m_remoteformat.greenShift;								\
-	int b_shift = m_remoteformat.blueShift; 								\
-	int r_max = m_remoteformat.redMax;										\
-	int g_max = m_remoteformat.greenMax;									\
-	int b_max = m_remoteformat.blueMax; 									\
-																			\
-	CARD##bpp pix;															\
-	while (count--) {														\
-		pix = *src++;														\
-		if (endianMismatch) {												\
-			pix = Swap##bpp(pix);											\
-		}																	\
-		*dst++ = (BYTE)((pix >> r_shift & r_max) * 255 / r_max);			\
-		*dst++ = (BYTE)((pix >> g_shift & g_max) * 255 / g_max);			\
-		*dst++ = (BYTE)((pix >> b_shift & b_max) * 255 / b_max);			\
-	}																		\
-}
-
-DEFINE_JPEG_GET_ROW_FUNCTION(16)
-DEFINE_JPEG_GET_ROW_FUNCTION(32)
-
-/*
- * Destination manager implementation for JPEG library.
- */
-
-static struct jpeg_destination_mgr jpegDstManager;
-static JOCTET *jpegDstBuffer;
-static size_t jpegDstBufferLen;
-
-static void JpegInitDestination(j_compress_ptr cinfo);
-static boolean JpegEmptyOutputBuffer(j_compress_ptr cinfo);
-static void JpegTermDestination(j_compress_ptr cinfo);
-
-static void
-JpegInitDestination(j_compress_ptr cinfo)
-{
-	jpegError = false;
-	jpegDstManager.next_output_byte = jpegDstBuffer;
-	jpegDstManager.free_in_buffer = jpegDstBufferLen;
-}
-
-static boolean
-JpegEmptyOutputBuffer(j_compress_ptr cinfo)
-{
-	jpegError = true;
-	jpegDstManager.next_output_byte = jpegDstBuffer;
-	jpegDstManager.free_in_buffer = jpegDstBufferLen;
-
-	return TRUE;
-}
-
-static void
-JpegTermDestination(j_compress_ptr cinfo)
-{
-	jpegDstDataLen = jpegDstBufferLen - jpegDstManager.free_in_buffer;
-}
-
-static void
-JpegSetDstManager(j_compress_ptr cinfo, JOCTET *buf, size_t buflen)
-{
-	jpegDstBuffer = buf;
-	jpegDstBufferLen = buflen;
-	jpegDstManager.init_destination = JpegInitDestination;
-	jpegDstManager.empty_output_buffer = JpegEmptyOutputBuffer;
-	jpegDstManager.term_destination = JpegTermDestination;
-	cinfo->dest = &jpegDstManager;
-}
-
diff --git a/ica/win32/src/vncEncodeTight.h b/ica/win32/src/vncEncodeTight.h
deleted file mode 100644
index 0d8b61a..0000000
--- a/ica/win32/src/vncEncodeTight.h
+++ /dev/null
@@ -1,191 +0,0 @@
-//  Copyright (C) 2000 Constantin Kaplinsky. All Rights Reserved.
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncodeTight object
-
-class vncEncodeTight;
-
-#if !defined(_WINVNC_ENCODETIGHT)
-#define _WINVNC_ENCODETIGHT
-#pragma once
-
-#include "vncEncoder.h"
-
-#include "zlib/zlib.h"
-extern "C" {
-#include "libjpeg/jpeglib.h"
-}
-
-// Minimum amount of data to be compressed. This value should not be
-// changed, doing so will break compatibility with existing clients.
-#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
-
-// C-style structures to store palette entries and compression paramentes.
-// Such code probably should be converted into C++ classes.
-
-struct COLOR_LIST {
-	COLOR_LIST *next;
-	int idx;
-	CARD32 rgb;
-};
-
-struct PALETTE_ENTRY {
-	COLOR_LIST *listNode;
-	int numPixels;
-};
-
-struct PALETTE {
-	PALETTE_ENTRY entry[256];
-	COLOR_LIST *hash[256];
-	COLOR_LIST list[256];
-};
-
-struct TIGHT_CONF {
-	int maxRectSize, maxRectWidth;
-	int monoMinRectSize, gradientMinRectSize;
-	int idxZlibLevel, monoZlibLevel, rawZlibLevel, gradientZlibLevel;
-	unsigned long gradientThreshold, gradientThreshold24;
-	int idxMaxColorsDivisor;
-	int jpegQuality;
-	unsigned long jpegThreshold, jpegThreshold24;
-};
-
-
-// Class definition
-
-class vncEncodeTight : public vncEncoder
-{
-// Fields
-public:
-
-// Methods
-public:
-	// Create/Destroy methods
-	vncEncodeTight();
-	~vncEncodeTight();
-
-	virtual void Init();
-	virtual const char* GetEncodingName() { return "Tight"; }
-
-	virtual UINT RequiredBuffSize(UINT width, UINT height);
-	virtual UINT NumCodedRects(RECT &rect);
-
-	virtual UINT EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &rect, int offx, int offy);
-
-// Implementation
-protected:
-	int m_paletteNumColors, m_paletteMaxColors;
-	CARD32 m_monoBackground, m_monoForeground;
-	PALETTE m_palette;
-
-	z_stream m_zsStruct[4];
-	bool m_zsActive[4];
-	int m_zsLevel[4];
-
-	BYTE *m_hdrBuffer;
-	int m_hdrBufferBytes;
-	BYTE *m_buffer;
-	int m_bufflen;
-	int *m_prevRowBuf;
-	int	offsetx;
-	int	offsety;
-
-	bool m_usePixelFormat24;
-
-	static const TIGHT_CONF m_conf[10];
-
-	// Protected member functions.
-
-	void FindBestSolidArea(BYTE *source, int x, int y, int w, int h,
-						   CARD32 colorValue, int *w_ptr, int *h_ptr);
-	void ExtendSolidArea  (BYTE *source, int x, int y, int w, int h,
-						   CARD32 colorValue,
-						   int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr);
-	bool CheckSolidTile   (BYTE *source, int x, int y, int w, int h,
-						   CARD32 *colorPtr, bool needSameColor);
-	bool CheckSolidTile8  (BYTE *source, int x, int y, int w, int h,
-						   CARD32 *colorPtr, bool needSameColor);
-	bool CheckSolidTile16 (BYTE *source, int x, int y, int w, int h,
-						   CARD32 *colorPtr, bool needSameColor);
-	bool CheckSolidTile32 (BYTE *source, int x, int y, int w, int h,
-						   CARD32 *colorPtr, bool needSameColor);
-
-	UINT EncodeRectSimple (BYTE *source, VSocket *outConn, BYTE *dest,
-						   const RECT &rect);
-	UINT EncodeSubrect    (BYTE *source, VSocket *outConn, BYTE *dest,
-						   int x, int y, int w, int h);
-	void SendTightHeader  (int x, int y, int w, int h);
-
-	int SendSolidRect     (BYTE *dest);
-	int SendMonoRect      (BYTE *dest, int w, int h);
-	int SendIndexedRect   (BYTE *dest, int w, int h);
-	int SendFullColorRect (BYTE *dest, int w, int h);
-	int SendGradientRect  (BYTE *dest, int w, int h);
-	int CompressData      (BYTE *dest, int streamId, int dataLen,
-						   int zlibLevel, int zlibStrategy);
-	int SendCompressedData(int compressedLen);
-
-	void FillPalette8 (int count);
-	void FillPalette16(int count);
-	void FillPalette32(int count);
-
-	void PaletteReset(void);
-	int PaletteInsert(CARD32 rgb, int numPixels, int bpp);
-
-	void Pack24(BYTE *buf, int count);
-
-	void EncodeIndexedRect16(BYTE *buf, int count);
-	void EncodeIndexedRect32(BYTE *buf, int count);
-
-	void EncodeMonoRect8 (BYTE *buf, int w, int h);
-	void EncodeMonoRect16(BYTE *buf, int w, int h);
-	void EncodeMonoRect32(BYTE *buf, int w, int h);
-
-	void FilterGradient24(BYTE *buf, int w, int h);
-	void FilterGradient16(CARD16 *buf, int w, int h);
-	void FilterGradient32(CARD32 *buf, int w, int h);
-
-	int DetectSmoothImage (int w, int h);
-	unsigned long DetectSmoothImage24 (int w, int h);
-	unsigned long DetectSmoothImage16 (int w, int h);
-	unsigned long DetectSmoothImage32 (int w, int h);
-
-	int SendJpegRect(BYTE *dst, int w, int h, int quality);
-	void PrepareRowForJpeg(BYTE *dst, int y, int w);
-	void PrepareRowForJpeg24(BYTE *dst, CARD32 *src, int count);
-	void PrepareRowForJpeg16(BYTE *dst, CARD16 *src, int count);
-	void PrepareRowForJpeg32(BYTE *dst, CARD32 *src, int count);
-};
-
-#endif // _WINVNC_ENCODETIGHT
-
diff --git a/ica/win32/src/vncEncodeZlib.cpp b/ica/win32/src/vncEncodeZlib.cpp
deleted file mode 100644
index 560b7de..0000000
--- a/ica/win32/src/vncEncodeZlib.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncodeZlib
-
-// This file implements the vncEncoder-derived vncEncodeZlib class.
-// This class overrides some vncEncoder functions to produce a bitmap
-// to Zlib encoder.  Zlib is much more efficient than RAW format on
-// most screen data and usually twice as efficient as hextile.  Of
-// course, zlib compression uses more CPU time on the server.
-// However, over slower (64kbps or less) connections, the reduction
-// in data transmitted usually outweighs the extra latency added
-// while the server CPU performs the compression algorithms.
-
-#include "vncEncodeZlib.h"
-
-vncEncodeZlib::vncEncodeZlib()
-{
-	m_buffer = NULL;
-	m_bufflen = 0;
-	compStreamInited = false;
-}
-
-vncEncodeZlib::~vncEncodeZlib()
-{
-	if (m_buffer != NULL)
-	{
-		delete [] m_buffer;
-		m_buffer = NULL;
-	}
-	if ( compStreamInited == true )
-	{
-		deflateEnd( &compStream );
-	}
-	compStreamInited = false;
-}
-
-void
-vncEncodeZlib::Init()
-{
-	vncEncoder::Init();
-}
-
-UINT
-vncEncodeZlib::RequiredBuffSize(UINT width, UINT height)
-{
-	int result;
-
-	// The zlib library specifies a maximum compressed size of
-	// the raw size plus one percent plus 8 bytes.  We also need
-	// to cover the zlib header space.
-	result = vncEncoder::RequiredBuffSize(width, height);
-	result += ((result / 100) + 8) + sz_rfbZlibHeader;
-	return result;
-}
-
-UINT
-vncEncodeZlib::NumCodedRects(RECT &rect)
-{
-
-/******************************************************************
-	return 1;
-******************************************************************/
-
-	const int rectW = rect.right - rect.left;
-	const int rectH = rect.bottom - rect.top;
-
-	// Return the number of rectangles needed to encode the given
-	// update.  ( ZLIB_MAX_SIZE(rectW) / rectW ) is the number of lines in 
-	// each maximum size rectangle.
-	return (( rectH - 1 ) / ( ZLIB_MAX_SIZE( rectW ) / rectW ) + 1 );
-
-}
-
-/*****************************************************************************
- *
- * Routines to implement zlib Encoding (LZ+Huffman compression) by calling
- * the included zlib library.
- */
-
-// Encode the rectangle using zlib compression
-inline UINT
-vncEncodeZlib::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &rect, int offx, int offy)
-{
-	int  totalSize = 0;
-	int  partialSize = 0;
-	int  maxLines;
-	int  linesRemaining;
-	offsetx = offx;
-	offsety = offy;
-	RECT partialRect;
-
-	const int rectW = rect.right - rect.left;
-	const int rectH = rect.bottom - rect.top;
-
-	partialRect.right = rect.right;
-	partialRect.left = rect.left;
-	partialRect.top = rect.top;
-	partialRect.bottom = rect.bottom;
-
-	/* WBB: For testing purposes only! */
-	// vnclog.Print(LL_INTINFO, VNCLOG("rect.right=%d rect.left=%d rect.top=%d rect.bottom=%d\n"), rect.right, rect.left, rect.top, rect.bottom);
-
-	maxLines = ( ZLIB_MAX_SIZE(rectW) / rectW );
-	linesRemaining = rectH;
-
-	while ( linesRemaining > 0 ) {
-
-		int linesToComp;
-
-		if ( maxLines < linesRemaining )
-			linesToComp = maxLines;
-		else
-			linesToComp = linesRemaining;
-
-		partialRect.bottom = partialRect.top + linesToComp;
-
-		/* WBB: For testing purposes only! */
-		// vnclog.Print(LL_INTINFO, VNCLOG("partialRect.right=%d partialRect.left=%d partialRect.top=%d partialRect.bottom=%d\n"), partialRect.right, partialRect.left, partialRect.top, partialRect.bottom);
-
-		partialSize = EncodeOneRect( source, dest, partialRect );
-		totalSize += partialSize;
-
-		linesRemaining -= linesToComp;
-		partialRect.top += linesToComp;
-
-		if (( linesRemaining > 0 ) &&
-			( partialSize > 0 ))
-		{
-			// Send the encoded data
-			outConn->SendQueued( (char *)dest, partialSize );
-			transmittedSize += partialSize;
-		}
-
-
-	}
-	transmittedSize += partialSize;
-
-	return partialSize;
-
-}
-
-// Encode the rectangle using zlib compression
-inline UINT
-vncEncodeZlib::EncodeOneRect(BYTE *source, BYTE *dest, const RECT &rect)
-{
-	int totalCompDataLen = 0;
-	int previousTotalOut;
-	int deflateResult;
-
-	const int rectW = rect.right - rect.left;
-	const int rectH = rect.bottom - rect.top;
-	const int rawDataSize = (rectW*rectH*m_remoteformat.bitsPerPixel / 8);
-	const int maxCompSize = (rawDataSize + (rawDataSize/100) + 8);
-
-	// Send as raw if the update is too small to compress.
-	if (rawDataSize < VNC_ENCODE_ZLIB_MIN_COMP_SIZE)
-		return vncEncoder::EncodeRect(source, dest, rect, offsetx, offsety);
-
-	// Create the rectangle header
-	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
-	surh->r.x = (CARD16) rect.left ;
-	surh->r.y = (CARD16) rect.top ;
-	surh->r.w = (CARD16) (rectW);
-	surh->r.h = (CARD16) (rectH);
-	surh->r.x = Swap16IfLE(surh->r.x- offsetx);
-	surh->r.y = Swap16IfLE(surh->r.y- offsety);
-	surh->r.w = Swap16IfLE(surh->r.w);
-	surh->r.h = Swap16IfLE(surh->r.h);
-	surh->encoding = Swap32IfLE(rfbEncodingZlib);
-
-	dataSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
-	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
-	
-	// create a space big enough for the Zlib encoded pixels
-	if (m_bufflen < rawDataSize)
-	{
-		if (m_buffer != NULL)
-		{
-			delete [] m_buffer;
-			m_buffer = NULL;
-		}
-		m_buffer = new BYTE [rawDataSize+1];
-		if (m_buffer == NULL)
-			return vncEncoder::EncodeRect(source, dest, rect, offsetx, offsety);
-		m_bufflen = rawDataSize;
-	}
-
-	// Translate the data into our new buffer
-	Translate(source, m_buffer, rect);
-
-	// Initialize input/output buffer assignment for compressor state.
-	compStream.avail_in = rawDataSize;
-	compStream.next_in = m_buffer;
-	compStream.avail_out = maxCompSize;
-	compStream.next_out = (dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader);
-	compStream.data_type = Z_BINARY;
-
-	// If necessary, the first time, initialize the compressor state.
-	if ( compStreamInited == false )
-	{
-
-		compStream.total_in = 0;
-		compStream.total_out = 0;
-		compStream.zalloc = Z_NULL;
-		compStream.zfree = Z_NULL;
-		compStream.opaque = Z_NULL;
-
-		vnclog.Print(LL_INTINFO, VNCLOG("calling deflateInit2 with zlib level:%d\n"), m_compresslevel);
-
-		deflateResult = deflateInit2( &compStream,
-			                          m_compresslevel,
-					                  Z_DEFLATED,
-					                  MAX_WBITS,
-					                  MAX_MEM_LEVEL,
-					                  Z_DEFAULT_STRATEGY );
-		if ( deflateResult != Z_OK )
-		{
-			vnclog.Print(LL_INTINFO, VNCLOG("deflateInit2 returned error:%d:%s\n"), deflateResult, compStream.msg);
-			return vncEncoder::EncodeRect(source, dest, rect, offsetx, offsety);
-		}
-		compStreamInited = true;
-	}
-
-	// Record previous total output size.
-	previousTotalOut = compStream.total_out;
-
-	// Compress the raw data into the result buffer.
-	deflateResult = deflate( &compStream, Z_SYNC_FLUSH );
-
-	if ( deflateResult != Z_OK )
-	{
-		vnclog.Print(LL_INTINFO, VNCLOG("deflate returned error:%d:%s\n"), deflateResult, compStream.msg);
-		return vncEncoder::EncodeRect(source, dest, rect, offsetx, offsety);
-	}
-
-	// Calculate size of compressed data.
-	totalCompDataLen = compStream.total_out - previousTotalOut;
-
-	// Format the ZlibHeader
-	rfbZlibHeader *zlibh=(rfbZlibHeader *)(dest+sz_rfbFramebufferUpdateRectHeader);
-	zlibh->nBytes = Swap32IfLE(totalCompDataLen);
-
-	// Update statistics
-	encodedSize += sz_rfbZlibHeader + totalCompDataLen;
-
-	// Return the amount of data sent	
-	return sz_rfbFramebufferUpdateRectHeader +
-		   sz_rfbZlibHeader +
-		   totalCompDataLen;
-
-}
diff --git a/ica/win32/src/vncEncodeZlib.h b/ica/win32/src/vncEncodeZlib.h
deleted file mode 100644
index 08a53c9..0000000
--- a/ica/win32/src/vncEncodeZlib.h
+++ /dev/null
@@ -1,86 +0,0 @@
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncodeZlib object
-
-// The vncEncodeZlib object uses a zlib based compression encoding to send rectangles
-// to a client
-
-class vncEncodeZlib;
-
-#if !defined(_WINVNC_ENCODEZLIB)
-#define _WINVNC_ENCODEZLIB
-#pragma once
-
-#include "vncEncoder.h"
-
-#include "zlib/zlib.h"
-
-// 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 (8*1024)
-#define ZLIB_MAX_SIZE(min) ((( min * 2 ) > ZLIB_MAX_RECT_SIZE ) ? ( min * 2 ) : ZLIB_MAX_RECT_SIZE )
-
-
-// Class definition
-
-class vncEncodeZlib : public vncEncoder
-{
-// Fields
-public:
-
-// Methods
-public:
-	// Create/Destroy methods
-	vncEncodeZlib();
-	~vncEncodeZlib();
-
-	virtual void Init();
-	virtual const char* GetEncodingName() { return "Zlib"; }
-
-	virtual UINT RequiredBuffSize(UINT width, UINT height);
-	virtual UINT NumCodedRects(RECT &rect);
-
-	virtual UINT EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &rect, int offx, int offy);
-	virtual UINT EncodeOneRect(BYTE *source, BYTE *dest, const RECT &rect);
-
-// Implementation
-protected:
-	BYTE		      *m_buffer;
-	int			       m_bufflen;
-	struct z_stream_s  compStream;
-	bool               compStreamInited;
-	int offsetx;
-	int offsety;
-};
-
-#endif // _WINVNC_ENCODEZLIB
-
diff --git a/ica/win32/src/vncEncoder.cpp b/ica/win32/src/vncEncoder.cpp
deleted file mode 100644
index 90b7fdf..0000000
--- a/ica/win32/src/vncEncoder.cpp
+++ /dev/null
@@ -1,669 +0,0 @@
-//  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 file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncoder - Object used to encode data for RFB
-
-#include "vncEncoder.h"
-#include "vncBuffer.h"
-
-// Pixel format used internally when the client is palette-based & server is truecolour
-
-static const rfbPixelFormat BGR233Format = {
-    8, 8, 0, 1, 7, 7, 3, 0, 3, 6
-};
-
-// The base (RAW) encoder class
-
-vncEncoder::vncEncoder()
-{
-	ZeroMemory(&m_remoteformat, sizeof(m_remoteformat));
-	ZeroMemory(&m_localformat, sizeof(m_localformat));
-	ZeroMemory(&m_transformat, sizeof(m_transformat));
-	m_transtable = NULL;
-	m_localpalette = NULL;
-	m_bytesPerRow = 0;
-	m_compresslevel = 6;
-	m_qualitylevel = -1;
-	m_use_xcursor = FALSE;
-	m_use_richcursor = FALSE;
-	m_use_lastrect = FALSE;
-}
-
-vncEncoder::~vncEncoder()
-{
-	if (m_transtable != NULL)
-	{
-		free(m_transtable);
-		m_transtable = NULL;
-	}
-	if (m_localpalette != NULL)
-	{
-		free(m_localpalette);
-		m_localpalette = NULL;
-	}
-}
-
-void
-vncEncoder::Init()
-{
-	dataSize = 0;
-	rectangleOverhead = 0;
-	encodedSize = 0;
-	transmittedSize = 0;
-}
-
-void
-vncEncoder::LogStats()
-{
-	vnclog.Print(LL_INTINFO, VNCLOG("%s encoder stats: data=%d, overhead=%d, "
-									"encoded=%d, sent=%d\n"),
-				 GetEncodingName(),
-				 dataSize, rectangleOverhead, encodedSize, transmittedSize);
-
-	if (dataSize != 0) {
-		vnclog.Print(LL_INTINFO, VNCLOG("%s encoder efficiency: %.3f%%\n"),
-					 GetEncodingName(),
-					 (double)((double)((dataSize - transmittedSize) * 100) / dataSize));
-	}
-}
-
-UINT
-vncEncoder::RequiredBuffSize(UINT width, UINT height)
-{
-	return sz_rfbFramebufferUpdateRectHeader +
-		(width * height * m_remoteformat.bitsPerPixel)/8;
-}
-
-UINT
-vncEncoder::NumCodedRects(RECT &rect)
-{
-	return 1;
-}
-
-// Translate a rectangle
-inline void
-vncEncoder::Translate(BYTE *source, BYTE *dest, const RECT &rect)
-{
-// IMPORTANT: ASSUME backbuffer-relative coordinates for rect
-	// Calculate where in the source rectangle to read from
-	BYTE *sourcepos = (BYTE *)(source + (m_bytesPerRow * rect.top)+(rect.left * (m_localformat.bitsPerPixel / 8)));
-
-	// Call the translation function
-	(*m_transfunc) (m_transtable,
-					&m_localformat,
-					&m_transformat,
-					(char *)sourcepos,
-					(char *)dest,
-					m_bytesPerRow,
-					rect.right-rect.left,
-					rect.bottom-rect.top
-					);
-}
-
-// Translate a rectangle (using arbitrary m_bytesPerRow value,
-// always translating from the beginning of the source pixel array)
-// NOTE: overloaded function!
-inline void
-vncEncoder::Translate(BYTE *source, BYTE *dest, int w, int h, int bytesPerRow)
-{
-	// Call the translation function
-	(*m_transfunc) (m_transtable, &m_localformat, &m_transformat,
-					(char *)source, (char *)dest, bytesPerRow, w, h);
-}
-
-// Encode a rectangle
-inline UINT
-vncEncoder::EncodeRect(BYTE *source, BYTE *dest, const RECT &rect, int offsetx, int offsety)
-{
-	const int rectW = rect.right - rect.left;
-	const int rectH = rect.bottom - rect.top;
-
-	// Create the header for the update in the destination area
-	rfbFramebufferUpdateRectHeader *surh = (rfbFramebufferUpdateRectHeader *)dest;
-	surh->r.x = (CARD16) (rect.left - offsetx);
-	surh->r.y = (CARD16) (rect.top - offsety);
-	surh->r.w = (CARD16) (rectW);
-	surh->r.h = (CARD16) (rectH);
-	surh->r.x = Swap16IfLE(surh->r.x);
-	surh->r.y = Swap16IfLE(surh->r.y);
-	surh->r.w = Swap16IfLE(surh->r.w);
-	surh->r.h = Swap16IfLE(surh->r.h);
-	surh->encoding = Swap32IfLE(rfbEncodingRaw);
-
-	// Update raw encoding statistics
-	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
-	dataSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
-	encodedSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
-	transmittedSize += sz_rfbFramebufferUpdateRectHeader + ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
-
-	// Translate the data in place in the output buffer
-	Translate(source, dest + sz_rfbFramebufferUpdateRectHeader, rect);
-
-	// Return the buffer size
-	return sz_rfbFramebufferUpdateRectHeader +
-		(rectW*rectH*m_remoteformat.bitsPerPixel) / 8;
-}
-
-// Encode a rectangle directly to the output stream.
-// This implementation may not be the best, but it will work with all
-// of the existing EncodeRect(BYTE *, BYTE *, const RECT &) implementations.
-// Note, that the returned value is that of any data in the dest buffer that
-// was not yet transmitted on the outConn.
-// The primary justification for adding this method is to allow encodings to
-// transmit partial data during the encoding process.  This can improve
-// performance considerably for slower (more complex) encoding algorithms.
-inline UINT
-vncEncoder::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &rect, int offsetx, int offsety)
-{
-	return EncodeRect(source, dest, rect, offsetx, offsety);
-}
-
-BOOL
-vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours)
-{
-	vnclog.Print(LL_INTINFO, VNCLOG("remote palette data requested\n"));
-
-	// If the local server is palette-based then call SetTranslateFunction
-	// to update the palette-to-truecolour mapping:
-	if (!m_localformat.trueColour)
-	{
-		if (!SetTranslateFunction())
-			return FALSE;
-	}
-
-	// If the client is truecolour then don't fill in the palette buffer...
-	if (m_remoteformat.trueColour)
-		return FALSE;
-
-	// If the server is truecolour then fake BGR233
-	if (m_localformat.trueColour)
-	{
-		// Fake BGR233...
-		vnclog.Print(LL_INTINFO, VNCLOG("generating BGR233 palette data\n"));
-
-		int ncolours = 1 << m_transformat.bitsPerPixel;
-		if (m_localpalette != NULL)
-			free(m_localpalette);
-		m_localpalette = (char *)malloc(ncolours * sizeof(RGBQUAD));
-		
-		if (m_localpalette != NULL)
-		{
-			RGBQUAD *colour = (RGBQUAD *)m_localpalette;
-
-			for (int i=0; i<ncolours; i++)
-			{
-				colour[i].rgbBlue = (((i >> m_transformat.blueShift) & m_transformat.blueMax) * 255) / m_transformat.blueMax;
-				colour[i].rgbRed = (((i >> m_transformat.redShift) & m_transformat.redMax) * 255) / m_transformat.redMax;
-				colour[i].rgbGreen = (((i >> m_transformat.greenShift) & m_transformat.greenMax) * 255) / m_transformat.greenMax;
-			}
-		}
-	}
-	else
-	{
-		// Set up RGBQUAD rfbPixelFormat info
-		vnclog.Print(LL_INTINFO, VNCLOG("generating 8-bit palette data\n"));
-
-		rfbPixelFormat remote;
-		remote.trueColour = (uint8_t)TRUE;
-		remote.bitsPerPixel = 32;
-		remote.depth = 24;
-		remote.bigEndian = FALSE;
-		remote.redMax = remote.greenMax = remote.blueMax = 255;
-		remote.redShift = 16;
-		remote.greenShift = 8;
-		remote.blueShift = 0;
-
-		// We get the ColourMapSingleTableFns procedure to handle retrieval of the
-		// palette for us, to avoid replicating the code!
-		(*rfbInitColourMapSingleTableFns[remote.bitsPerPixel / 16])
-			(&m_localpalette, &m_localformat, &remote);
-	}
-
-	// Did we create some palette info?
-	if (m_localpalette == NULL)
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("failed to obtain colour map data!\n"));
-		return FALSE;
-	}
-
-	// Copy the data into the RGBQUAD buffer
-	memcpy(quadlist, m_localpalette, ncolours*sizeof(RGBQUAD));
-
-	return TRUE;
-}
-
-BOOL
-vncEncoder::SetTranslateFunction()
-{
-	vnclog.Print(LL_INTINFO, VNCLOG("SetTranslateFunction called\n"));
-
-	// By default, the actual format translated to matches the client format
-	m_transformat = m_remoteformat;
-
-    // Check that bits per pixel values are valid
-
-    if ((m_transformat.bitsPerPixel != 8) &&
-		(m_transformat.bitsPerPixel != 16) &&
-		(m_transformat.bitsPerPixel != 32))
-    {
-		vnclog.Print(LL_CONNERR,
-			VNCLOG("only 8, 16 or 32 bits supported remotely - %d requested\n"),
-			m_transformat.bitsPerPixel
-			);
-
-		return FALSE;
-    }
-
-    if ((m_localformat.bitsPerPixel != 8) &&
-		(m_localformat.bitsPerPixel != 16) &&
-		(m_localformat.bitsPerPixel != 32))
-    {
-		vnclog.Print(LL_CONNERR,
-			VNCLOG("only 8, 16 or 32 bits supported locally - %d in use\n"),
-			m_localformat.bitsPerPixel
-			);
-
-		return FALSE;
-    }
-
-	if (!m_transformat.trueColour && (m_transformat.bitsPerPixel != 8))
-	{
-		vnclog.Print(LL_CONNERR, VNCLOG("only 8-bit palette format supported remotely\n"));
-		return FALSE;
-	}
-	if (!m_localformat.trueColour && (m_localformat.bitsPerPixel != 8))
-	{
-		vnclog.Print(LL_CONNERR, VNCLOG("only 8-bit palette format supported locally\n"));
-		return FALSE;
-	}
-
-	// Now choose the translation function to use
-
-	// We don't do remote palettes unless they're 8-bit
-    if (!m_transformat.trueColour)
-	{
-		// Is the local format the same?
-		if (!m_localformat.trueColour &&
-			(m_localformat.bitsPerPixel == m_transformat.bitsPerPixel))
-		{
-			// Yes, so don't do any encoding
-			vnclog.Print(LL_INTINFO, VNCLOG("no encoding required - both 8-bit palettized\n"));
-
-			m_transfunc = rfbTranslateNone;
-
-			// The first time the client sends an update, it will call
-			// GetRemotePalette to get the palette information required
-			return TRUE;
-		}
-		else if (m_localformat.trueColour)
-		{
-			// Local side is truecolour, remote is palettized
-			vnclog.Print(LL_INTINFO, VNCLOG("local truecolour, remote palettized.  using BGR233 palette\n"));
-
-			// Fill out the translation table as if writing to BGR233
-			m_transformat = BGR233Format;
-
-			// Continue on down to the main translation section
-		}
-		else
-		{
-			// No, so not supported yet...
-			vnclog.Print(LL_CONNERR, VNCLOG("unknown local pixel format in use!\n"));
-			return FALSE;
-		}
-	}
-
-	// REMOTE FORMAT IS TRUE-COLOUR
-
-	// Handle 8-bit palette-based local data
-	if (!m_localformat.trueColour)
-	{
-		// 8-bit palette to truecolour...
-
-		// Yes, so pick the right translation function!
-		vnclog.Print(LL_INTINFO, VNCLOG("using 8-bit colourmap to truecolour translation\n"));
-
-		m_transfunc = rfbTranslateWithSingleTableFns
-			[m_localformat.bitsPerPixel / 16]
-			[m_transformat.bitsPerPixel / 16];
-
-		(*rfbInitColourMapSingleTableFns[m_transformat.bitsPerPixel / 16])
-			(&m_transtable, &m_localformat, &m_transformat);
-		return m_transtable != NULL;
-	}
-
-	// If we reach here then we're doing truecolour to truecolour
-
-	// Are the formats identical?
-    if (PF_EQ(m_transformat,m_localformat))
-	{
-		// Yes, so use the null translation function
-		vnclog.Print(LL_INTINFO, VNCLOG("no translation required\n"));
-
-		m_transfunc = rfbTranslateNone;
-
-		return TRUE;
-    }
-
-	// Is the local display a 16-bit one
-    if (m_localformat.bitsPerPixel == 16)
-	{
-		// Yes, so use a single lookup-table
-		vnclog.Print(LL_INTINFO, VNCLOG("single LUT used\n"));
-
-		m_transfunc = rfbTranslateWithSingleTableFns
-			[m_localformat.bitsPerPixel / 16]
-			[m_transformat.bitsPerPixel / 16];
-
-		(*rfbInitTrueColourSingleTableFns[m_transformat.bitsPerPixel / 16])
-			(&m_transtable, &m_localformat, &m_transformat);
-    }
-	else
-	{
-		// No, so use three tables - one for each of R, G, B.
-		vnclog.Print(LL_INTINFO, VNCLOG("triple LUT used\n"));
-
-		m_transfunc = rfbTranslateWithRGBTablesFns
-			[m_localformat.bitsPerPixel / 16]
-			[m_transformat.bitsPerPixel / 16];
-
-		(*rfbInitTrueColourRGBTablesFns[m_transformat.bitsPerPixel / 16])
-			(&m_transtable, &m_localformat, &m_transformat);
-    }
-
-	return m_transtable != NULL;
-}
-
-BOOL
-vncEncoder::SetLocalFormat(rfbPixelFormat &pixformat, int width, int height)
-{
-	// Work out the bytes per row at the local end - useful
-	m_bytesPerRow = width * pixformat.bitsPerPixel/8;
-
-	// Save the pixel format
-	m_localformat = pixformat;
-
-	// Don't call SetTranslateFunction() if remote format is not set yet.
-	if (m_remoteformat.depth == 0)
-		return TRUE;
-
-	return SetTranslateFunction();
-}
-
-BOOL
-vncEncoder::SetRemoteFormat(rfbPixelFormat &pixformat)
-{
-	// Save the client pixel format
-	m_remoteformat = pixformat;
-
-	return SetTranslateFunction();
-}
-
-void
-vncEncoder::SetCompressLevel(int level)
-{
-	m_compresslevel = (level >= 0 && level <= 9) ? level : 6;
-}
-
-void
-vncEncoder::SetQualityLevel(int level)
-{
-	m_qualitylevel = (level >= 0 && level <= 9) ? level : -1;
-}
-
-//
-// New code implementing cursor shape updates.
-//
-
-BOOL
-vncEncoder::SendEmptyCursorShape(VSocket *outConn)
-{
-	rfbFramebufferUpdateRectHeader hdr;
-	hdr.r.x = Swap16IfLE(0);
-	hdr.r.y = Swap16IfLE(0);
-	hdr.r.w = Swap16IfLE(0);
-	hdr.r.h = Swap16IfLE(0);
-	if (m_use_xcursor) {
-		hdr.encoding = Swap32IfLE(rfbEncodingXCursor);
-	} else {
-		hdr.encoding = Swap32IfLE(rfbEncodingRichCursor);
-	}
-
-	return outConn->SendQueued((char *)&hdr, sizeof(hdr));
-}
-
-BOOL
-vncEncoder::SendCursorShape(VSocket *outConn, vncDesktop *desktop)
-{
-	// Make sure the function is used correctly
-	if (!m_use_xcursor && !m_use_richcursor)
-		return FALSE;
-
-	// Check mouse cursor handle
-	HCURSOR hcursor = desktop->GetCursor();
-	if (hcursor == NULL) {
-		vnclog.Print(LL_INTINFO, VNCLOG("cursor handle is NULL.\n"));
-		return FALSE;
-	}
-
-	// Get cursor info
-	ICONINFO IconInfo;
-	if (!GetIconInfo(hcursor, &IconInfo)) {
-		vnclog.Print(LL_INTINFO, VNCLOG("GetIconInfo() failed.\n"));
-		return FALSE;
-	}
-	BOOL isColorCursor = FALSE;
-	if (IconInfo.hbmColor != NULL) {
-		isColorCursor = TRUE;
-		DeleteObject(IconInfo.hbmColor);
-	}
-	if (IconInfo.hbmMask == NULL) {
-		vnclog.Print(LL_INTINFO, VNCLOG("cursor bitmap handle is NULL.\n"));
-		return FALSE;
-	}
-
-	// Check bitmap info for the cursor
-	BITMAP bmMask;
-	if (!GetObject(IconInfo.hbmMask, sizeof(BITMAP), (LPVOID)&bmMask)) {
-		vnclog.Print(LL_INTINFO, VNCLOG("GetObject() for bitmap failed.\n"));
-		DeleteObject(IconInfo.hbmMask);
-		return FALSE;
-	}
-	if (bmMask.bmPlanes != 1 || bmMask.bmBitsPixel != 1) {
-		vnclog.Print(LL_INTINFO, VNCLOG("incorrect data in cursor bitmap.\n"));
-		DeleteObject(IconInfo.hbmMask);
-		return FALSE;
-	}
-
-	// Get monochrome bitmap data for cursor
-	// NOTE: they say we should use GetDIBits() instead of GetBitmapBits().
-	BYTE *mbits = new BYTE[bmMask.bmWidthBytes * bmMask.bmHeight];
-	if (mbits == NULL)
-		return FALSE;
-
-	BOOL success = GetBitmapBits(IconInfo.hbmMask,
-								 bmMask.bmWidthBytes * bmMask.bmHeight, mbits);
-	DeleteObject(IconInfo.hbmMask);
-
-	if (!success) {
-		vnclog.Print(LL_INTINFO, VNCLOG("GetBitmapBits() failed.\n"));
-		delete[] mbits;
-		return FALSE;
-	}
-
-	// Compute cursor dimensions
-	int width = bmMask.bmWidth;
-	int height = (isColorCursor) ? bmMask.bmHeight : bmMask.bmHeight/2;
-
-	// Call appropriate routine to send cursor shape update
-	if (!isColorCursor && m_use_xcursor) {
-		FixCursorMask(mbits, NULL, width, bmMask.bmHeight, bmMask.bmWidthBytes);
-		success = SendXCursorShape(outConn, mbits,
-								   IconInfo.xHotspot, IconInfo.yHotspot,
-								   width, height);
-	}
-	else if (m_use_richcursor) {
-		int cbits_size = width * height * 4;
-		BYTE *cbits = new BYTE[cbits_size];
-		if (cbits == NULL) {
-			delete[] mbits;
-			return FALSE;
-		}
-		if (!desktop->GetRichCursorData(cbits, hcursor, width, height)) {
-			vnclog.Print(LL_INTINFO, VNCLOG("vncDesktop::GetRichCursorData() failed.\n"));
-			delete[] mbits;
-			delete[] cbits;
-			return FALSE;
-		}
-		FixCursorMask(mbits, cbits, width, height, bmMask.bmWidthBytes);
-		success = SendRichCursorShape(outConn, mbits, cbits,
-									  IconInfo.xHotspot, IconInfo.yHotspot,
-									  width, height);
-		delete[] cbits;
-	}
-	else {
-		success = FALSE;	// FIXME: We could convert RichCursor -> XCursor.
-	}
-
-	// Cleanup
-	delete[] mbits;
-
-	return success;
-}
-
-BOOL
-vncEncoder::SendXCursorShape(VSocket *outConn, BYTE *mask,
-							 int xhot, int yhot, int width, int height)
-{
-	rfbFramebufferUpdateRectHeader hdr;
-	hdr.r.x = Swap16IfLE(xhot);
-	hdr.r.y = Swap16IfLE(yhot);
-	hdr.r.w = Swap16IfLE(width);
-	hdr.r.h = Swap16IfLE(height);
-	hdr.encoding = Swap32IfLE(rfbEncodingXCursor);
-
-	BYTE colors[6] = { 0, 0, 0, 0xFF, 0xFF, 0xFF };
-	int maskRowSize = (width + 7) / 8;
-	int maskSize = maskRowSize * height;
-
-	if ( !outConn->SendQueued((char *)&hdr, sizeof(hdr)) ||
-		 !outConn->SendQueued((char *)colors, 6) ||
-		 !outConn->SendQueued((char *)&mask[maskSize], maskSize) ||
-		 !outConn->SendQueued((char *)mask, maskSize) ) {
-		return FALSE;
-	}
-	return TRUE;
-}
-
-BOOL
-vncEncoder::SendRichCursorShape(VSocket *outConn, BYTE *mbits, BYTE *cbits,
-								int xhot, int yhot, int width, int height)
-{
-	rfbFramebufferUpdateRectHeader hdr;
-	hdr.r.x = Swap16IfLE(xhot);
-	hdr.r.y = Swap16IfLE(yhot);
-	hdr.r.w = Swap16IfLE(width);
-	hdr.r.h = Swap16IfLE(height);
-	hdr.encoding = Swap32IfLE(rfbEncodingRichCursor);
-
-	// Cet cursor image in local pixel format
-	int srcbuf_rowsize = width * (m_localformat.bitsPerPixel / 8);
-	while (srcbuf_rowsize % sizeof(DWORD))
-		srcbuf_rowsize++;	// Actually, this should never happen
-
-	// Translate image to client pixel format
-	int dstbuf_size = width * height * (m_remoteformat.bitsPerPixel / 8);
-	BYTE *dstbuf = new BYTE[dstbuf_size];
-	Translate(cbits, dstbuf, width, height, srcbuf_rowsize);
-
-	// Send the data
-	int mask_rowsize = (width + 7) / 8;
-	int mask_size = mask_rowsize * height;
-	if ( !outConn->SendQueued((char *)&hdr, sizeof(hdr)) ||
-		 !outConn->SendQueued((char *)dstbuf, dstbuf_size) ||
-		 !outConn->SendQueued((char *)mbits, mask_size) ) {
-		delete[] dstbuf;
-		return FALSE;
-	}
-	delete[] dstbuf;
-	return TRUE;
-}
-
-void
-vncEncoder::FixCursorMask(BYTE *mbits, BYTE *cbits,
-						  int width, int height, int width_bytes)
-{
-	int packed_width_bytes = (width + 7) / 8;
-
-	// Pack and invert bitmap data (mbits)
-	int x, y;
-	for (y = 0; y < height; y++)
-		for (x = 0; x < packed_width_bytes; x++)
-			mbits[y * packed_width_bytes + x] = ~mbits[y * width_bytes + x];
-
-	// Replace "inverted background" bits with black color to ensure
-	// cross-platform interoperability. Not beautiful but necessary code.
-	if (cbits == NULL) {
-		BYTE m, c;
-		height /= 2;
-		for (y = 0; y < height; y++) {
-			for (x = 0; x < packed_width_bytes; x++) {
-				m = mbits[y * packed_width_bytes + x];
-				c = mbits[(height + y) * packed_width_bytes + x];
-				mbits[y * packed_width_bytes + x] |= ~(m | c);
-				mbits[(height + y) * packed_width_bytes + x] |= ~(m | c);
-			}
-		}
-	} else {
-		int bytes_pixel = m_localformat.bitsPerPixel / 8;
-		int bytes_row = width * bytes_pixel;
-		while (bytes_row % sizeof(DWORD))
-			bytes_row++;	// Actually, this should never happen
-
-		BYTE bitmask;
-		int b1, b2;
-		for (y = 0; y < height; y++) {
-			bitmask = 0x80;
-			for (x = 0; x < width; x++) {
-				if ((mbits[y * packed_width_bytes + x / 8] & bitmask) == 0) {
-					for (b1 = 0; b1 < bytes_pixel; b1++) {
-						if (cbits[y * bytes_row + x * bytes_pixel + b1] != 0) {
-							mbits[y * packed_width_bytes + x / 8] ^= bitmask;
-							for (b2 = b1; b2 < bytes_pixel; b2++)
-								cbits[y * bytes_row + x * bytes_pixel + b2] = 0x00;
-							break;
-						}
-					}
-				}
-				if ((bitmask >>= 1) == 0)
-					bitmask = 0x80;
-			}
-		}
-	}
-}
-
diff --git a/ica/win32/src/vncEncoder.h b/ica/win32/src/vncEncoder.h
deleted file mode 100644
index a8726ed..0000000
--- a/ica/win32/src/vncEncoder.h
+++ /dev/null
@@ -1,128 +0,0 @@
-//  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 file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncEncoder object
-
-// The vncEncoder object encodes regions of a display buffer for sending
-// to a client
-
-class vncEncoder;
-
-#if !defined(RFBENCODER_DEFINED)
-#define RFBENCODER_DEFINED
-#pragma once
-
-#include "vncBuffer.h"
-#include "translate.h"
-
-// Class definition
-
-class vncEncoder
-{
-// Fields
-public:
-
-// Methods
-public:
-	// Create/Destroy methods
-	vncEncoder();
-	virtual ~vncEncoder();
-
-	// Initialisation
-	virtual void Init();
-
-	// A method to return the encoding name, used by the LogStats() method
-	virtual const char* GetEncodingName() { return "Raw"; }
-
-	// Central method for outputing encoding statistics
-	virtual void LogStats();
-
-	// Encoder stats used by the buffer object
-	virtual UINT RequiredBuffSize(UINT width, UINT height);
-	virtual UINT NumCodedRects(RECT &rect);
-
-	// Translation & encoding routines
-	//  - Source is the base address of the ENTIRE SCREEN buffer.
-	//    The Translate routine compensates automatically for the desired rectangle.
-	//  - Dest is the base address to encode the rect to.  The rect will be encoded
-	//    into a contiguous region of the buffer.
-	virtual void Translate(BYTE *source, BYTE *dest, const RECT &rect);
-	virtual UINT EncodeRect(BYTE *source, BYTE *dest, const RECT &rect, int offsetx, int offsety);
-	virtual UINT EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &rect, int offsetx, int offsety);
-
-	// Additional translation function for cursor shape data (overloaded!)
-	void Translate(BYTE *source, BYTE *dest, int w, int h, int bytesPerRow);
-
-	// Translation handling
-	BOOL SetLocalFormat(rfbPixelFormat &pixformat, int width, int height);
-	BOOL SetRemoteFormat(rfbPixelFormat &pixformat);
-
-	// Configuring encoder
-	void SetCompressLevel(int level);
-	void SetQualityLevel(int level);
-	void EnableXCursor(BOOL enable) { m_use_xcursor = enable; }
-	void EnableRichCursor(BOOL enable) { m_use_richcursor = enable; }
-	void EnableLastRect(BOOL enable) { m_use_lastrect = enable; }
-
-	// Colour map handling
-	BOOL GetRemotePalette(RGBQUAD *quadlist, UINT ncolours);
-
-	// Supporting cursor shape updates
-	BOOL SendEmptyCursorShape(VSocket *outConn);
-	BOOL SendCursorShape(VSocket *outConn, vncDesktop *desktop);
-
-protected:
-	BOOL SetTranslateFunction();
-
-	// Supporting cursor shape updates
-	BOOL SendXCursorShape(VSocket *outConn, BYTE *mask, int xhot,int yhot,int width,int height);
-	BOOL SendRichCursorShape(VSocket *outConn, BYTE *mbits, BYTE *cbits, int xhot,int yhot,int width,int height);
-	void FixCursorMask(BYTE *mbits, BYTE *cbits, int width, int height, int width_bytes);
-
-// Implementation
-protected:
-	rfbTranslateFnType	m_transfunc;			// Translator function
-	char*				m_transtable;			// Colour translation LUT
-	char*				m_localpalette;			// Palette info if client is palette-based
-	rfbPixelFormat		m_localformat;			// Pixel Format info
-	rfbPixelFormat		m_remoteformat;			// Client pixel format info
-	rfbPixelFormat		m_transformat;			// Internal format used for translation (usually == client format)
-	int					m_bytesPerRow;			// Number of bytes per row locally
-	int					dataSize;				// Total size of raw data encoded
-	int					rectangleOverhead;		// Total size of rectangle header data
-	int					encodedSize;			// Total size of encoded data
-	int					transmittedSize;		// Total amount of data sent
-
-	int					m_compresslevel;		// Encoding-specific compression level (if needed).
-	int					m_qualitylevel;			// Image quality level for lossy JPEG compression.
-	BOOL				m_use_xcursor;			// XCursor cursor shape updates allowed.
-	BOOL				m_use_richcursor;		// RichCursor cursor shape updates allowed.
-	BOOL				m_use_lastrect;			// LastRect pseudo-encoding allowed.
-};
-
-#endif // vncENCODER_DEFINED
diff --git a/ica/win32/src/vncInstHandler.cpp b/ica/win32/src/vncInstHandler.cpp
deleted file mode 100644
index bdd10ad..0000000
--- a/ica/win32/src/vncInstHandler.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncInstHandler.cpp
-
-// Implementation of the class used to ensure that only
-// one instance is running
-
-#include "stdhdrs.h"
-#include "vncInstHandler.h"
-
-// Name of the mutex
-#ifdef HORIZONLIVE
-const char mutexname [] = "AppShareHost_Instance_Mutex";
-#else
-const char mutexname [] = "iTALC_Service_Win32_Instance_Mutex";
-#endif
-// The class methods
-
-vncInstHandler::vncInstHandler() : m_mutex(NULL)
-{
-}
-
-vncInstHandler::~vncInstHandler()
-{
-	// make sure mutex is cleared as we exit
-	Release();
-}
-
-BOOL
-vncInstHandler::Init()
-{
-	// Create the named mutex
-	m_mutex = CreateMutex(NULL, FALSE, mutexname);
-	if (m_mutex == NULL)
-		return FALSE;
-
-	// Check that the mutex didn't already exist
-	if (GetLastError() == ERROR_ALREADY_EXISTS)
-		return FALSE;
-
-	return TRUE;
-}
-
-//
-// allow mutex to be explicitely cleared
-//
-
-DWORD
-vncInstHandler::Release() 
-{
-	//
-	// CloseHandle() will throw an exception when
-	// passed an invalid handle
-	//
-	try 
-	{ 
-		CloseHandle(m_mutex);
-	}
-	catch (...)
-	{
-		//
-		// Release() should be called once from the user code,
-		// and a second time by the object's destructor. 
-		// the second call will cause an exception.
-		// we can just ignore it.
-		//
-	}
-
-	return GetLastError();
-}
diff --git a/ica/win32/src/vncInstHandler.h b/ica/win32/src/vncInstHandler.h
deleted file mode 100644
index c37b234..0000000
--- a/ica/win32/src/vncInstHandler.h
+++ /dev/null
@@ -1,57 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncInstHandler
-
-// The WinMain procedure for WinVNC produces one of these objects.
-// It creates a named mutex and checks to see whether that mutex
-// already existed in the system.  If it did, then there is a previous
-// instance of WinVNC running, which must be requested to quit cleanly.
-
-class vncInstHandler;
-
-#if (!defined(_WINVNC_VNCINSTHANDLER))
-#define _WINVNC_VNCINSTHANDLER
-
-// Includes
-#include "stdhdrs.h"
-
-// The vncInstHandler class itself
-class vncInstHandler
-{
-public:
-	vncInstHandler();
-	~vncInstHandler();
-
-	// check to see if an instance is already running
-	BOOL Init();
-	DWORD Release();
-
-private:
-	HANDLE m_mutex;
-};
-
-#endif // _WINVNC_VNCINSTHANDLER
diff --git a/ica/win32/src/vncKeymap.cpp b/ica/win32/src/vncKeymap.cpp
deleted file mode 100644
index fe01371..0000000
--- a/ica/win32/src/vncKeymap.cpp
+++ /dev/null
@@ -1,376 +0,0 @@
-//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the program is not available from the place from
-// which you received this file, check http://www.realvnc.com/ or contact
-// the authors on info at realvnc.com for information on obtaining it.
-
-// vncKeymap.cpp
-
-// This code originally just mapped between X keysyms and local Windows
-// virtual keycodes.  Now it actually does the local-end simulation of
-// key presses, to keep this messy code on one place!
-
-// Disable warnings about truncated names caused by #include <map>
-//#pragma warning(disable : 4786)
-
-#include "vncKeymap.h"
-
-#define XK_MISCELLANY
-#include "keysymdef.h"
-#include "vncService.h"
-
-#include <map>
-
-// Mapping of X keysyms to windows VK codes.  Ordering here is the same as
-// keysymdef.h to make checking easier
-
-struct keymap_t {
-  CARD32 keysym;
-  CARD8 vk;
-  bool extended;
-};
-
-static keymap_t keymap[] = {
-
-  // TTY functions
-
-  { XK_BackSpace,        VK_BACK, 0 },
-  { XK_Tab,              VK_TAB, 0 },
-  { XK_Clear,            VK_CLEAR, 0 },
-  { XK_Return,           VK_RETURN, 0 },
-  { XK_Pause,            VK_PAUSE, 0 },
-  { XK_Escape,           VK_ESCAPE, 0 },
-  { XK_Delete,           VK_DELETE, 1 },
-
-  // Japanese stuff - almost certainly wrong...
-  { XK_Kanji,            VK_KANJI, 0 },
-  { XK_Kana_Shift,       VK_KANA, 0 },
-
-  // Cursor control & motion
-
-  { XK_Home,             VK_HOME, 1 },
-  { XK_Left,             VK_LEFT, 1 },
-  { XK_Up,               VK_UP, 1 },
-  { XK_Right,            VK_RIGHT, 1 },
-  { XK_Down,             VK_DOWN, 1 },
-  { XK_Page_Up,          VK_PRIOR, 1 },
-  { XK_Page_Down,        VK_NEXT, 1 },
-  { XK_End,              VK_END, 1 },
-
-  // Misc functions
-
-  { XK_Select,           VK_SELECT, 0 },
-  { XK_Print,            VK_SNAPSHOT, 0 },
-  { XK_Execute,          VK_EXECUTE, 0 },
-  { XK_Insert,           VK_INSERT, 1 },
-  { XK_Help,             VK_HELP, 0 },
-  { XK_Break,            VK_CANCEL, 1 },
-
-  // Keypad Functions, keypad numbers
-
-  { XK_KP_Space,         VK_SPACE, 0 },
-  { XK_KP_Tab,           VK_TAB, 0 },
-  { XK_KP_Enter,         VK_RETURN, 1 },
-  { XK_KP_F1,            VK_F1, 0 },
-  { XK_KP_F2,            VK_F2, 0 },
-  { XK_KP_F3,            VK_F3, 0 },
-  { XK_KP_F4,            VK_F4, 0 },
-  { XK_KP_Home,          VK_HOME, 0 },
-  { XK_KP_Left,          VK_LEFT, 0 },
-  { XK_KP_Up,            VK_UP, 0 },
-  { XK_KP_Right,         VK_RIGHT, 0 },
-  { XK_KP_Down,          VK_DOWN, 0 },
-  { XK_KP_End,           VK_END, 0 },
-  { XK_KP_Page_Up,       VK_PRIOR, 0 },
-  { XK_KP_Page_Down,     VK_NEXT, 0 },
-  { XK_KP_Begin,         VK_CLEAR, 0 },
-  { XK_KP_Insert,        VK_INSERT, 0 },
-  { XK_KP_Delete,        VK_DELETE, 0 },
-  // XXX XK_KP_Equal should map in the same way as ascii '='
-  { XK_KP_Multiply,      VK_MULTIPLY, 0 },
-  { XK_KP_Add,           VK_ADD, 0 },
-  { XK_KP_Separator,     VK_SEPARATOR, 0 },
-  { XK_KP_Subtract,      VK_SUBTRACT, 0 },
-  { XK_KP_Decimal,       VK_DECIMAL, 0 },
-  { XK_KP_Divide,        VK_DIVIDE, 1 },
-
-  { XK_KP_0,             VK_NUMPAD0, 0 },
-  { XK_KP_1,             VK_NUMPAD1, 0 },
-  { XK_KP_2,             VK_NUMPAD2, 0 },
-  { XK_KP_3,             VK_NUMPAD3, 0 },
-  { XK_KP_4,             VK_NUMPAD4, 0 },
-  { XK_KP_5,             VK_NUMPAD5, 0 },
-  { XK_KP_6,             VK_NUMPAD6, 0 },
-  { XK_KP_7,             VK_NUMPAD7, 0 },
-  { XK_KP_8,             VK_NUMPAD8, 0 },
-  { XK_KP_9,             VK_NUMPAD9, 0 },
-
-  // Auxilliary Functions
-
-  { XK_F1,               VK_F1, 0 },
-  { XK_F2,               VK_F2, 0 },
-  { XK_F3,               VK_F3, 0 },
-  { XK_F4,               VK_F4, 0 },
-  { XK_F5,               VK_F5, 0 },
-  { XK_F6,               VK_F6, 0 },
-  { XK_F7,               VK_F7, 0 },
-  { XK_F8,               VK_F8, 0 },
-  { XK_F9,               VK_F9, 0 },
-  { XK_F10,              VK_F10, 0 },
-  { XK_F11,              VK_F11, 0 },
-  { XK_F12,              VK_F12, 0 },
-  { XK_F13,              VK_F13, 0 },
-  { XK_F14,              VK_F14, 0 },
-  { XK_F15,              VK_F15, 0 },
-  { XK_F16,              VK_F16, 0 },
-  { XK_F17,              VK_F17, 0 },
-  { XK_F18,              VK_F18, 0 },
-  { XK_F19,              VK_F19, 0 },
-  { XK_F20,              VK_F20, 0 },
-  { XK_F21,              VK_F21, 0 },
-  { XK_F22,              VK_F22, 0 },
-  { XK_F23,              VK_F23, 0 },
-  { XK_F24,              VK_F24, 0 },
-
-    // Modifiers
-    
-  { XK_Shift_L,          VK_SHIFT, 0 },
-  { XK_Shift_R,          VK_RSHIFT, 0 },
-  { XK_Control_L,        VK_CONTROL, 0 },
-  { XK_Control_R,        VK_CONTROL, 1 },
-  { XK_Alt_L,            VK_MENU, 0 },
-  { XK_Alt_R,            VK_RMENU, 1 },
-};
-
-
-// doKeyboardEvent wraps the system keybd_event function and attempts to find
-// the appropriate scancode corresponding to the supplied virtual keycode.
-
-inline void doKeyboardEvent(BYTE vkCode, vncServer *server, DWORD flags) {
-  if (server != NULL) {
-    server->SetKeyboardCounter(1);
-  }
-  keybd_event(vkCode, MapVirtualKey(vkCode, 0), flags, 0);
-}
-
-// KeyStateModifier is a class which helps simplify generating a "fake" press
-// or release of shift, ctrl, alt, etc.  An instance of the class is created
-// for every key which may need to be pressed or released.  Then either press()
-// or release() may be called to make sure that the corresponding key is in the
-// right state.  The destructor of the class automatically reverts to the
-// previous state.
-
-class KeyStateModifier {
-public:
-  KeyStateModifier(int vkCode_, vncServer *server_, int flags_=0)
-    : vkCode(vkCode_), flags(flags_),
-      pressed(false), released(false), server(server_)
-  {}
-  void press() {
-    if (!(GetAsyncKeyState(vkCode) & 0x8000)) {
-      doKeyboardEvent(vkCode, server, flags);
-      vnclog.Print(LL_INTINFO, "fake %d down\n", vkCode);
-      pressed = true;
-    }
-  }
-  void release() {
-    if (GetAsyncKeyState(vkCode) & 0x8000) {
-      doKeyboardEvent(vkCode, server, flags | KEYEVENTF_KEYUP);
-      vnclog.Print(LL_INTINFO, "fake %d up\n", vkCode);
-      released = true;
-    }
-  }
-  ~KeyStateModifier() {
-    if (pressed) {
-      doKeyboardEvent(vkCode, server, flags | KEYEVENTF_KEYUP);
-      vnclog.Print(LL_INTINFO, "fake %d up\n", vkCode);
-    } else if (released) {
-      doKeyboardEvent(vkCode, server, flags);
-      vnclog.Print(LL_INTINFO, "fake %d down\n", vkCode);
-    }
-  }
-  int vkCode;
-  int flags;
-  bool pressed;
-  bool released;
-private:
-  vncServer *server;
-};
-
-// Keymapper - a single instance of this class is used to generate Windows key
-// events.
-
-class Keymapper {
-
-public:
-  Keymapper()
-  {
-    for (int i = 0; i < (int)(sizeof(keymap) / sizeof(keymap_t)); i++) {
-      vkMap[keymap[i].keysym] = keymap[i].vk;
-      extendedMap[keymap[i].keysym] = keymap[i].extended;
-    }
-  }
-
-  void keyEvent(CARD32 keysym, bool down, vncServer *server)
-  {
-    if ((keysym >= 32 && keysym <= 126) ||
-        (keysym >= 160 && keysym <= 255))
-    {
-      // ordinary Latin-1 character
-
-      SHORT s = VkKeyScan((CHAR)keysym);
-      if (s == -1) {
-        vnclog.Print(LL_INTWARN, "ignoring unrecognised Latin-1 keysym %d\n",
-                     keysym);
-        return;
-      }
-
-      BYTE vkCode = LOBYTE(s);
-
-      KeyStateModifier ctrl(VK_CONTROL, server);
-      KeyStateModifier alt(VK_MENU, server);
-      KeyStateModifier shift(VK_SHIFT, server);
-      KeyStateModifier lshift(VK_LSHIFT, server);
-      KeyStateModifier rshift(VK_RSHIFT, server);
-
-      if (down) {
-        BYTE modifierState = HIBYTE(s);
-        if (modifierState & 2) ctrl.press();
-        if (modifierState & 4) alt.press();
-        if (modifierState & 1) {
-          shift.press(); 
-        } else {
-          if (vncService::IsWin95()) {
-            shift.release();
-          } else {
-            lshift.release();
-            rshift.release();
-          }
-        }
-      }
-      vnclog.Print(LL_INTINFO,
-                   "latin-1 key: keysym %d(0x%x) vkCode 0x%x down %d\n",
-                   keysym, keysym, vkCode, down);
-
-      doKeyboardEvent(vkCode, server, down ? 0 : KEYEVENTF_KEYUP);
-
-    } else {
-
-      // see if it's a recognised keyboard key, otherwise ignore it
-
-      if (vkMap.find(keysym) == vkMap.end()) {
-        vnclog.Print(LL_INTWARN, "ignoring unknown keysym %d\n",keysym);
-        return;
-      }
-      BYTE vkCode = vkMap[keysym];
-      DWORD flags = 0;
-      if (extendedMap[keysym]) flags |= KEYEVENTF_EXTENDEDKEY;
-      if (!down) flags |= KEYEVENTF_KEYUP;
-
-      vnclog.Print(LL_INTINFO,
-                  "keyboard key: keysym %d(0x%x) vkCode 0x%x ext %d down %d\n",
-                   keysym, keysym, vkCode, extendedMap[keysym], down);
-
-      if (down && (vkCode == VK_DELETE) &&
-          ((GetAsyncKeyState(VK_CONTROL) & 0x8000) != 0) &&
-          ((GetAsyncKeyState(VK_MENU) & 0x8000) != 0) &&
-          vncService::IsWinNT())
-      {
-        vncService::SimulateCtrlAltDel();
-        return;
-      }
-
-      if (vncService::IsWin95()) {
-        switch (vkCode) {
-        case VK_RSHIFT:   vkCode = VK_SHIFT;   break;
-        case VK_RCONTROL: vkCode = VK_CONTROL; break;
-        case VK_RMENU:    vkCode = VK_MENU;    break;
-        }
-      }
-
-      doKeyboardEvent(vkCode, server, flags);
-    }
-  }
-
-private:
-  std::map<CARD32,CARD8> vkMap;
-  std::map<CARD32,bool> extendedMap;
-} key_mapper;
-
-void vncKeymap::keyEvent(CARD32 keysym, bool down, vncServer *server)
-{
-  key_mapper.keyEvent(keysym, down, server);
-}
-
-
-
-void
-SetShiftState(BYTE key, BOOL down)
-{
-	BOOL keystate = (GetAsyncKeyState(key) & 0x8000) != 0;
-
-	// This routine sets the specified key to the desired value (up or down)
-	if ((keystate && down) || ((!keystate) && (!down)))
-		return;
-
-	vnclog.Print(LL_INTINFO,
-		VNCLOG("setshiftstate %d - (%s->%s)\n"),
-		key, keystate ? "down" : "up",
-		down ? "down" : "up");
-
-	// Now send a key event to set the key to the new value
-	doKeyboardEvent(key, NULL, down ? 0 : KEYEVENTF_KEYUP);
-	keystate = (GetAsyncKeyState(key) & 0x8000) != 0;
-
-	vnclog.Print(LL_INTINFO,
-		VNCLOG("new state %d (%s)\n"),
-		key, keystate ? "down" : "up");
-}
-
-void
-vncKeymap::ClearShiftKeys()
-{
-	if (vncService::IsWinNT())
-	{
-		// On NT, clear both sets of keys
-
-		// LEFT
-		SetShiftState(VK_LSHIFT, FALSE);
-		SetShiftState(VK_LCONTROL, FALSE);
-		SetShiftState(VK_LMENU, FALSE);
-
-		// RIGHT
-		SetShiftState(VK_RSHIFT, FALSE);
-		SetShiftState(VK_RCONTROL, FALSE);
-		SetShiftState(VK_RMENU, FALSE);
-	}
-	else
-	{
-		// Otherwise, we can't distinguish the keys anyway...
-
-		// Clear the shift key states
-		SetShiftState(VK_SHIFT, FALSE);
-		SetShiftState(VK_CONTROL, FALSE);
-		SetShiftState(VK_MENU, FALSE);
-	}
-}
diff --git a/ica/win32/src/vncKeymap.h b/ica/win32/src/vncKeymap.h
deleted file mode 100644
index dbb532a..0000000
--- a/ica/win32/src/vncKeymap.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the program is not available from the place from
-// which you received this file, check http://www.realvnc.com/ or contact
-// the authors on info at realvnc.com for information on obtaining it.
-
-#ifndef KEYMAP_H__
-#define KEYMAP_H__
-
-#include "rfb.h"
-#include "vncServer.h"
-
-class vncKeymap {
-public:
-  static void keyEvent(CARD32 keysym, bool down, vncServer *server);
-  static void ClearShiftKeys();
-};
-
-
-#endif
diff --git a/ica/win32/src/vncPasswd.h b/ica/win32/src/vncPasswd.h
deleted file mode 100644
index 34872f3..0000000
--- a/ica/win32/src/vncPasswd.h
+++ /dev/null
@@ -1,104 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncPasswd
-
-// This header provides helpers for handling encrypted password data.
-// The password handling routines found in vncauth.h should not be used directly
-
-class vncPasswd;
-
-#if (!defined(_WINVNC_VNCPASSWD))
-#define _WINVNC_VNCPASSWD
-
-#include "stdhdrs.h"
-extern "C" {
-#include "vncauth.h"
-}
-#include <stdlib.h>
-
-// Password handling helper class
-class vncPasswd
-{
-public:
-
-    // Password decryptor!
-    class ToText
-    {
-    public:
-	inline ToText(const char encrypted[MAXPWLEN])
-	{
-	    vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : ToText called\n"));
-	    plaintext = vncDecryptPasswd((char *)encrypted);
-	}
-	inline ~ToText()
-	{
-	    if (plaintext != NULL)
-	    {
-		ZeroMemory(plaintext, strlen(plaintext));
-		free(plaintext);
-	    }
-	}
-	inline operator const char*() const {return plaintext;};
-    private:
-	char *plaintext;
-    };
-
-    class FromText
-    {
-    public:
-	inline FromText(char *unencrypted)
-	{
-	    vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : FromText called\n"));
-	    vncEncryptPasswd(unencrypted, encrypted);
-	    ZeroMemory(unencrypted, strlen(unencrypted));
-	}
-	inline ~FromText()
-	{
-	}
-	inline operator const char*() const {return encrypted;};
-    private:
-	char encrypted[MAXPWLEN];
-    };
-
-    class FromClear
-    {
-    public:
-	inline FromClear()
-	{
-	    vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : FromClear called\n"));
-	    vncEncryptPasswd("", encrypted);
-	}
-	inline ~FromClear()
-	{
-	}
-	inline operator const char*() const {return encrypted;};
-    private:
-	char encrypted[MAXPWLEN];
-    };
-};
-
-#endif
diff --git a/ica/win32/src/vncRegion.cpp b/ica/win32/src/vncRegion.cpp
deleted file mode 100644
index 6aee22b..0000000
--- a/ica/win32/src/vncRegion.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncRegion implementation
-// This implementation uses the system region handling routines
-// to speed things up and give the best results
-
-#include "stdhdrs.h"
-
-// Header
-
-#include "vncRegion.h"
-
-// Implementation
-
-vncRegion::vncRegion()
-{
-	region = NULL;
-}
-
-vncRegion::~vncRegion()
-{
-	Clear();
-}
-
-void vncRegion::AddRect(const RECT &new_rect)
-{
-	HRGN newregion;
-
-	if (region == NULL)
-	{
-		// Create the region and set it to contain this rectangle
-		region = CreateRectRgnIndirect(&new_rect);
-	}
-	else
-	{
-		// Create a new region containing the appropriate rectangle
-		newregion = CreateRectRgnIndirect(&new_rect);
-
-		// Merge it into the existing region
-		if (CombineRgn(region, region, newregion, RGN_OR) == NULLREGION)
-			Clear();
-
-		// Now delete the temporary region
-		DeleteObject(newregion);
-	}
-}
-
-void vncRegion::AddRect(RECT R, int xoffset, int yoffset)
-{
-	R.left += xoffset;
-	R.top += yoffset;
-	R.right += xoffset;
-	R.bottom += yoffset;
-	AddRect(R);
-}
-
-void vncRegion::SubtractRect(RECT &new_rect)
-{
-	HRGN newregion;
-
-	if (region == NULL)
-		return;
-
-	// Create a new region containing the appropriate rectangle
-	newregion = CreateRectRgnIndirect(&new_rect);
-
-	// Remove it from the existing region
-	if (CombineRgn(region, region, newregion, RGN_DIFF) == NULLREGION)
-		Clear();
-
-	// Now delete the temporary region
-	DeleteObject(newregion);
-}
-
-void vncRegion::Clear()
-{
-	// Set the region to be empty
-	if (region != NULL)
-	{
-		DeleteObject(region);
-		region = NULL;
-	}
-}
-
-void
-vncRegion::Combine(vncRegion &rgn)
-{
-	if (rgn.region == NULL)
-		return;
-	if (region == NULL)
-	{
-		region = CreateRectRgn(0, 0, 0, 0);
-		if (region == NULL)
-			return;
-
-		// Copy the specified region into this one...
-		if (CombineRgn(region, rgn.region, 0, RGN_COPY) == NULLREGION)
-			Clear();
-		return;
-	}
-
-	// Otherwise, combine the two
-	if (CombineRgn(region, region, rgn.region, RGN_OR) == NULLREGION)
-		Clear();
-}
-
-void
-vncRegion::Intersect(vncRegion &rgn)
-{
-	if (rgn.region == NULL)
-		return;
-	if (region == NULL)
-		return;
-
-	// Otherwise, intersect the two
-	if (CombineRgn(region, region, rgn.region, RGN_AND) == NULLREGION)
-		Clear();
-}
-
-void
-vncRegion::Subtract(vncRegion &rgn)
-{
-	if (rgn.region == NULL)
-		return;
-	if (region == NULL)
-		return;
-
-	// Otherwise, intersect the two
-	if (CombineRgn(region, region, rgn.region, RGN_DIFF) == NULLREGION)
-		Clear();
-}
-
-
-
-// Return all the rectangles
-BOOL vncRegion::Rectangles(rectlist &rects)
-{
-	int buffsize;
-	DWORD x;
-	RGNDATA *buff;
-
-	// If the region is empty then return empty rectangle list
-	if (region == NULL)
-		return FALSE;
-
-	// Get the size of buffer required
-	buffsize = GetRegionData(region, (DWORD) NULL, 0);
-	buff = (RGNDATA *) new BYTE [buffsize];
-	if (buff == NULL)
-		return FALSE;
-
-	// Now get the region data
-	if (GetRegionData(region, buffsize, buff))
-	{
-		for (x=0; x<(buff->rdh.nCount); x++)
-		{
-			// Obtain the rectangles from the list
-			RECT *rect = (RECT *) (((BYTE *) buff) + sizeof(RGNDATAHEADER) + x * sizeof(RECT));
-			rects.push_front(*rect);
-		}
-	}
-
-	// Delete the temporary buffer
-	delete [] buff;
-
-	// Return whether there are any rects!
-	return !rects.empty();
-}
-
-// Return rectangles clipped to a certain area
-BOOL vncRegion::Rectangles(rectlist &rects, RECT &cliprect)
-{
-	vncRegion cliprgn;
-
-	// Create the clip-region
-	cliprgn.AddRect(cliprect);
-
-	// Calculate the intersection with this region
-	cliprgn.Intersect(*this);
-
-	return cliprgn.Rectangles(rects);
-}
diff --git a/ica/win32/src/vncRegion.h b/ica/win32/src/vncRegion.h
deleted file mode 100644
index 1cd66da..0000000
--- a/ica/win32/src/vncRegion.h
+++ /dev/null
@@ -1,76 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncRegion object
-
-// The vncRegion object turns a number of rectangular regions
-// into a list of distinct, non-overlapping regions.
-
-class vncRegion;
-
-#if !defined(VNCREGION_DEFINED)
-#define VNCREGION_DEFINED
-#pragma once
-
-#include "stdhdrs.h"
-#include <list>
-#include "RectList.h"
-
-// Class definition
-class vncRegion
-{
-
-// Fields
-public:
-
-// Methods
-public:
-	// Create/Destroy methods
-	vncRegion();
-	~vncRegion();
-
-	void AddRect(const RECT &rect);			// Add another rectangle to the regions
-	void AddRect(RECT rect, int xoffset, int yoffset);	// ... with offset
-	void SubtractRect(RECT &rect);			// Subtract a rectangle from the regions
-	void Clear();							// Clear the current set of rectangles
-	inline BOOL IsEmpty() {					// Is the region empty?
-		return region == NULL;
-	}
-	void Combine(vncRegion &rgn);			// Combine with another region
-	void Intersect(vncRegion &rgn);			// Intersect with another region
-	void Subtract(vncRegion &rgn);			// Subtract another region from this one
-
-	// Rectangle retrieval routines - return FALSE if no rects returned!
-	// Note that these routines ADD rectangles to existing lists...
-	BOOL Rectangles(rectlist &rects);					// Just return the rects
-	BOOL Rectangles(rectlist &rects, RECT &cliprect);	// Return all rects within the clip region	
-
-// Implementation
-protected:
-	HRGN region;							// Region used internally
-};
-
-#endif // VNCREGION_DEFINED
diff --git a/ica/win32/src/vncServer.cpp b/ica/win32/src/vncServer.cpp
deleted file mode 100644
index 59ff771..0000000
--- a/ica/win32/src/vncServer.cpp
+++ /dev/null
@@ -1,1744 +0,0 @@
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncServer.cpp
-
-// vncServer class implementation
-
-// Includes
-#include "stdhdrs.h"
-#include <omnithread.h>
-#include <string.h>
-#include <lmcons.h>
-
-// Custom
-#include "WinVNC.h"
-#include "vncServer.h"
-#include "vncSockConnect.h"
-#include "vncCorbaConnect.h"
-#include "vncClient.h"
-#include "vncService.h"
-
-// Constructor/destructor
-vncServer::vncServer()
-{
-	ResetPasswordsValidityInfo();
-
-	// Initialise some important stuffs...
-	m_socketConn = NULL;
-	m_corbaConn = NULL;
-	m_httpConn = NULL;
-	m_desktop = NULL;
-	m_name = NULL;
-	m_port = DISPLAY_TO_PORT(0);
-	m_port_http = DISPLAY_TO_HPORT(0);
-	m_autoportselect = TRUE;
-	m_passwd_required = TRUE;
-	m_beepConnect = FALSE;
-	m_beepDisconnect = FALSE;
-	m_auth_hosts = 0;
-	m_blacklist = 0;
-	{
-		vncPasswd::FromClear clearPWD;
-		memcpy(m_password, clearPWD, MAXPWLEN);
-		m_password_set = FALSE;
-		memcpy(m_password_viewonly, clearPWD, MAXPWLEN);
-		m_password_viewonly_set = FALSE;
-	}
-	m_querysetting = 2;
-	m_querytimeout = 10;
-	m_queryaccept = FALSE;
-	m_queryallownopass = FALSE;
-
-	// Autolock settings
-	m_lock_on_exit = 0;
-
-	// Set the polling mode options
-	m_poll_fullscreen = FALSE;
-	m_poll_foreground = FALSE;
-	m_poll_undercursor = TRUE;
-
-	m_poll_oneventonly = FALSE;
-	m_poll_consoleonly = TRUE;
-
-	m_dont_set_hooks = FALSE;
-	m_dont_use_driver = FALSE;
-	m_driver_direct_access_en = TRUE;
-
-	// General options
-	m_loopbackOnly = FALSE;
-	m_disableTrayIcon = TRUE;
-	m_loopback_allowed = FALSE;
-	m_httpd_enabled = TRUE;
-	m_httpd_params_enabled = FALSE;
-	m_lock_on_exit = 0;
-	m_connect_pri = 0;
-
-	// Set the input options
-	m_enable_remote_inputs = TRUE;
-	m_disable_local_inputs = TRUE;
-
-	// Clear the client mapping table
-	for (int x=0; x<MAX_CLIENTS; x++)
-		m_clientmap[x] = NULL;
-	m_nextid = 0;
-
-	// Signal set when a client quits
-	m_clientquitsig = new omni_condition(&m_clientsLock);
-	m_clients_disabled = FALSE;
-	m_local_input_priority = FALSE;
-
-	m_full_screen = TRUE;
-	m_WindowShared= FALSE;
-	m_hwndShared = NULL;
-	m_screen_area = FALSE;
-	m_primary_display_only_shared = FALSE;
-	m_disable_time = 3;
-	SetSharedRect(GetScreenRect());
-	SetPollingCycle(300);
-	PollingCycleChanged(false);
-	m_cursor_pos.x = 0;
-	m_cursor_pos.y = 0;
-
-	// initialize
-	m_enable_file_transfers = FALSE;
-	m_remove_wallpaper = FALSE;
-	m_blank_screen = FALSE;
-
-#ifdef HORIZONLIVE
-	m_full_screen = FALSE;
-	m_WindowShared= TRUE;
-	m_local_input_priority = TRUE;
-	m_remote_mouse = 1;
-	m_remote_keyboard = 1;
-#endif
-
-	m_wallpaper_wait = FALSE;
-}
-
-vncServer::~vncServer()
-{
-	vnclog.Print(LL_STATE, VNCLOG("shutting down server object\n"));
-
-	// If there is a socket_conn object then delete it
-	if (m_socketConn != NULL)
-	{
-		delete m_socketConn;
-		m_socketConn = NULL;
-	}
-
-	if (m_corbaConn != NULL)
-	{
-		delete m_corbaConn;
-		m_corbaConn = NULL;
-	}
-
-	if (m_httpConn != NULL)
-	{
-		delete m_httpConn;
-		m_httpConn = NULL;
-	}
-
-	// Remove any active clients!
-	KillAuthClients();
-	KillUnauthClients();
-
-	// Wait for all the clients to die
-	WaitUntilAuthEmpty();
-	WaitUntilUnauthEmpty();
-
-	// Don't free the desktop until no KillClient is likely to free it
-	{	omni_mutex_lock l(m_desktopLock);
-
-		if (m_desktop != NULL)
-		{
-			delete m_desktop;
-			m_desktop = NULL;
-		}
-	}
-
-	// Don't free the authhosts string until no more connections are possible
-	if (m_auth_hosts != 0)
-	{
-		free(m_auth_hosts);
-		m_auth_hosts = 0;
-	}
-
-	if (m_name != NULL)
-	{
-		free(m_name);
-		m_name = NULL;
-	}
-
-	if (m_clientquitsig != NULL)
-	{
-		delete m_clientquitsig;
-		m_clientquitsig = NULL;
-	}
-
-	vnclog.Print(LL_STATE, VNCLOG("shutting down server object(4)\n"));
-}
-
-// Client handling functions
-void
-vncServer::DisableClients(BOOL state)
-{
-	m_clients_disabled = state;
-}
-
-BOOL
-vncServer::ClientsDisabled()
-{
-	return m_clients_disabled;
-}
-
-vncClientId
-vncServer::AddClient(VSocket *socket, BOOL reverse, BOOL shared)
-{
-	return AddClient(socket, reverse, shared, TRUE, TRUE);
-}
-
-vncClientId
-vncServer::AddClient(VSocket *socket, BOOL reverse, BOOL shared,
-					 BOOL keysenabled, BOOL ptrenabled)
-{
-	vncClient *client;
-
-	omni_mutex_lock l(m_clientsLock);
-
-	// Try to allocate a client id...
-	vncClientId clientid = m_nextid;
-	do
-	{
-		clientid = (clientid+1) % MAX_CLIENTS;
-		if (clientid == m_nextid)
-		{
-			vnclog.Print(LL_CONNERR, VNCLOG("too many clients already connected\n"));
-			delete socket;
-			return -1;
-		}
-	}
-	while (m_clientmap[clientid] != NULL);
-
-	// Create a new client and add it to the relevant client list
-	client = new vncClient();
-	if (client == NULL) {
-		vnclog.Print(LL_CONNERR, VNCLOG("failed to allocate client object\n"));
-		delete socket;
-		return -1;
-	}
-
-	// Set the client's settings
-	client->EnableKeyboard(keysenabled && m_enable_remote_inputs);
-	client->EnablePointer(ptrenabled && m_enable_remote_inputs);
-
-	// Start the client
-	if (!client->Init(this, socket, reverse, shared, clientid))
-	{
-		// The client will delete the socket for us...
-		vnclog.Print(LL_CONNERR, VNCLOG("failed to initialize client object\n"));
-		delete client;
-		return -1;
-	}
-
-	m_clientmap[clientid] = client;
-
-	// Add the client to unauth the client list
-	m_unauthClients.push_back(clientid);
-
-	// Notify anyone interested about this event
-	DoNotify(WM_SRV_CLIENT_CONNECT, 0, 0);
-
-	vnclog.Print(LL_INTINFO, VNCLOG("AddClient() done\n"));
-
-	return clientid;
-}
-
-BOOL
-vncServer::Authenticated(vncClientId clientid)
-{
-	vncClientList::iterator i;
-	BOOL authok = TRUE;
-
-	omni_mutex_lock l1(m_desktopLock);
-	omni_mutex_lock l2(m_clientsLock);
-
-	// Search the unauthenticated client list
-	for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
-	{
-		// Is this the right client?
-		if ((*i) == clientid)
-		{
-			vncClient *client = GetClient(clientid);
-
-			// Yes, so remove the client and add it to the auth list
-			m_unauthClients.erase(i);
-
-			// Create the screen handler if necessary
-			if (m_desktop == NULL)
-			{
-				if (RemoveWallpaperEnabled()) {
-					m_wallpaper_wait = TRUE;
-					DoNotify(WM_SRV_CLIENT_HIDEWALLPAPER, 0, 0);
-				}
-				m_desktop = new vncDesktop();
-				if (m_desktop == NULL)
-				{
-					vnclog.Print(LL_CONNERR, VNCLOG("failed to allocate desktop object\n"));
-					client->Kill();
-					authok = FALSE;
-					break;
-				}
-				if (!m_desktop->Init(this))
-				{
-					vnclog.Print(LL_CONNERR, VNCLOG("failed to initialize desktop object\n"));
-
-					client->Kill();
-					authok = FALSE;
-
-					delete m_desktop;
-					m_desktop = NULL;
-
-					break;
-				}
-			}
-
-			// Create a buffer object for this client
-			vncBuffer *buffer = new vncBuffer(m_desktop);
-			if (buffer == NULL)
-			{
-				vnclog.Print(LL_CONNERR, VNCLOG("failed to allocate buffer object\n"));
-				client->Kill();
-				authok = FALSE;
-				break;
-			}
-
-			// Tell the client about this new buffer
-			client->SetBuffer(buffer);
-
-			// Add the client to the auth list
-			m_authClients.push_back(clientid);
-
-			break;
-		}
-	}
-
-	// Notify anyone interested of this event
-	DoNotify(WM_SRV_CLIENT_AUTHENTICATED, 0, 0);
-
-	vnclog.Print(LL_INTINFO, VNCLOG("Authenticated() done\n"));
-
-	// If so configured, beep to indicate the new connection is
-	// present.
-	if (authok && GetBeepConnect())
-	{
-		MessageBeep(MB_OK);
-	}
-
-	return authok;
-}
-
-void
-vncServer::KillClient(vncClientId clientid)
-{
-	vncClientList::iterator i;
-	BOOL done = FALSE;
-
-	omni_mutex_lock l(m_clientsLock);
-
-	// Find the client in one of the two lists
-	for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
-	{
-		// Is this the right client?
-		if ((*i) == clientid)
-		{
-			vnclog.Print(LL_INTINFO, VNCLOG("killing unauth client\n"));
-
-			// Ask the client to die
-			vncClient *client = GetClient(clientid);
-			client->Kill();
-
-			done = TRUE;
-			break;
-		}
-	}
-	if (!done)
-	{
-		for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-		{
-			// Is this the right client?
-			if ((*i) == clientid)
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("killing auth client\n"));
-
-				// Yes, so kill it
-				vncClient *client = GetClient(clientid);
-				client->Kill();
-
-				done = TRUE;
-				break;
-			}
-		}
-	}
-
-	vnclog.Print(LL_INTINFO, VNCLOG("KillClient() done\n"));
-}
-
-void
-vncServer::KillAuthClients()
-{
-	vncClientList::iterator i;
-	omni_mutex_lock l(m_clientsLock);
-
-	// Tell all the authorised clients to die!
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		vnclog.Print(LL_INTINFO, VNCLOG("killing auth client\n"));
-
-		// Kill the client
-		GetClient(*i)->Kill();
-	}
-
-	vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() done\n"));
-}
-
-void
-vncServer::KillUnauthClients()
-{
-	vncClientList::iterator i;
-	omni_mutex_lock l(m_clientsLock);
-
-	// Tell all the authorised clients to die!
-	for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
-	{
-		vnclog.Print(LL_INTINFO, VNCLOG("killing unauth client\n"));
-
-		// Kill the client
-		GetClient(*i)->Kill();
-	}
-
-	vnclog.Print(LL_INTINFO, VNCLOG("KillUnauthClients() done\n"));
-}
-
-UINT
-vncServer::AuthClientCount()
-{
-	omni_mutex_lock l(m_clientsLock);
-
-	return m_authClients.size();
-}
-
-UINT
-vncServer::UnauthClientCount()
-{
-	omni_mutex_lock l(m_clientsLock);
-
-	return m_unauthClients.size();
-}
-
-void
-vncServer::WaitUntilAuthEmpty()
-{
-	omni_mutex_lock l(m_clientsLock);
-
-	// Wait for all the clients to exit
-	while (!m_authClients.empty())
-	{
-		// Wait for a client to quit
-		m_clientquitsig->wait();
-	}
-}
-
-void
-vncServer::WaitUntilUnauthEmpty()
-{
-	omni_mutex_lock l(m_clientsLock);
-
-	// Wait for all the clients to exit
-	while (!m_unauthClients.empty())
-	{
-		// Wait for a client to quit
-		m_clientquitsig->wait();
-	}
-}
-
-BOOL
-vncServer::RemoteEventReceived()
-{
-	vncClientList::iterator i;
-	BOOL result = FALSE;
-	omni_mutex_lock l(m_clientsLock);
-
-	// Iterate over the authorised clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		result = result || GetClient(*i)->RemoteEventReceived();
-	}
-	return result;
-}
-
-// Client info retrieval/setup
-vncClient*
-vncServer::GetClient(vncClientId clientid)
-{
-	if ((clientid >= 0) && (clientid < MAX_CLIENTS))
-		return m_clientmap[clientid];
-	return NULL;
-}
-
-vncClientList
-vncServer::ClientList()
-{
-	vncClientList clients;
-
-	omni_mutex_lock l(m_clientsLock);
-
-	clients = m_authClients;
-
-	return clients;
-}
-
-void
-vncServer::BlockRemoteInput(BOOL block)
-{
-	omni_mutex_lock l(m_clientsLock);
-
-	vncClientList::iterator i;
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-		GetClient(*i)->BlockInput(block);
-}
-
-const char*
-vncServer::GetClientName(vncClientId clientid)
-{
-	omni_mutex_lock l(m_clientsLock);
-
-	vncClient *client = GetClient(clientid);
-	if (client != NULL)
-		return client->GetClientName();
-	return NULL;
-}
-
-// RemoveClient should ONLY EVER be used by the client to remove itself.
-void
-vncServer::RemoveClient(vncClientId clientid)
-{
-	vncClientList::iterator i;
-	BOOL done = FALSE;
-
-	omni_mutex_lock l1(m_desktopLock);
-	{	omni_mutex_lock l2(m_clientsLock);
-
-		// Find the client in one of the two lists
-		for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
-		{
-			// Is this the right client?
-			if ((*i) == clientid)
-			{
-				vnclog.Print(LL_INTINFO, VNCLOG("removing unauthorised client\n"));
-
-				// Yes, so remove the client and kill it
-				m_unauthClients.erase(i);
-				m_clientmap[clientid] = NULL;
-
-				done = TRUE;
-				break;
-			}
-		}
-		if (!done)
-		{
-			for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-			{
-				// Is this the right client?
-				if ((*i) == clientid)
-				{
-					vnclog.Print(LL_INTINFO, VNCLOG("removing authorised client\n"));
-
-					// Yes, so remove the client and kill it
-					m_authClients.erase(i);
-					m_clientmap[clientid] = NULL;
-
-					done = TRUE;
-					break;
-				}
-			}
-		}
-
-		// Signal that a client has quit
-		m_clientquitsig->signal();
-
-	} // Unlock the clientLock
-
-	// If so configured, beep to indicate the old connection is
-	// gone.
-	if (GetBeepDisconnect())
-	{
-		MessageBeep(MB_OK);
-	}
-
-	// Are there any authorised clients connected?
-	if (m_authClients.empty() && (m_desktop != NULL))
-	{
-		vnclog.Print(LL_STATE, VNCLOG("deleting desktop server\n"));
-
-		// Are there locksettings set?
-		if (LockSettings() == 1)
-		{
-			// Yes - lock the machine on disconnect!
-			vncService::LockWorkstation();
-		} else if (LockSettings() > 1)
-		{
-		    char username[UNLEN+1];
-
-		    vncService::CurrentUser((char *)&username, sizeof(username));
-		    if (strcmp(username, "") != 0)
-		    {
-			// Yes - force a user logoff on disconnect!
-			if (!ExitWindowsEx(EWX_LOGOFF, 0))
-			    vnclog.Print(LL_CONNERR, VNCLOG("client disconnect - failed to logoff user!\n"));
-		    }
-		}
-
-		// Delete the screen server
-		delete m_desktop;
-		m_desktop = NULL;
-	}
-
-	// Notify anyone interested of the change
-	DoNotify(WM_SRV_CLIENT_DISCONNECT, 0, 0);
-
-	vnclog.Print(LL_INTINFO, VNCLOG("RemoveClient() done\n"));
-}
-
-// NOTIFICATION HANDLING!
-
-// Connect/disconnect notification
-BOOL
-vncServer::AddNotify(HWND hwnd)
-{
-	omni_mutex_lock l(m_clientsLock);
-
-	// Add the window handle to the list
-	m_notifyList.push_front(hwnd);
-
-	return TRUE;
-}
-
-BOOL
-vncServer::RemNotify(HWND hwnd)
-{
-	omni_mutex_lock l(m_clientsLock);
-
-	// Remove the window handle from the list
-	vncNotifyList::iterator i;
-	for (i=m_notifyList.begin(); i!=m_notifyList.end(); i++)
-	{
-		if ((*i) == hwnd)
-		{
-			// Found the handle, so remove it
-			m_notifyList.erase(i);
-			return TRUE;
-		}
-	}
-
-	return FALSE;
-}
-
-// Send a notification message
-void
-vncServer::DoNotify(UINT message, WPARAM wparam, LPARAM lparam)
-{
-	omni_mutex_lock l(m_clientsLock);
-
-	// Send the given message to all the notification windows
-	vncNotifyList::iterator i;
-	for (i=m_notifyList.begin(); i!=m_notifyList.end(); i++)
-	{
-		PostMessage((*i), message, wparam, lparam);
-	}
-}
-
-// Client->Desktop update signalling
-void
-vncServer::RequestUpdate()
-{
-	omni_mutex_lock l(m_desktopLock);
-	if (m_desktop != NULL)
-	{
-		m_desktop->RequestUpdate();
-	}
-}
-
-// Update handling
-void
-vncServer::TriggerUpdate()
-{
-	vncClientList::iterator i;
-	
-	omni_mutex_lock l(m_clientsLock);
-
-	// Post this update to all the connected clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		// Post the update
-		GetClient(*i)->TriggerUpdate();
-	}
-}
-
-void
-vncServer::UpdateRect(RECT &rect)
-{
-	vncClientList::iterator i;
-	
-	omni_mutex_lock l(m_clientsLock);
-
-	// Post this update to all the connected clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		// Post the update
-		GetClient(*i)->UpdateRect(rect);
-	}
-}
-
-
-
-void
-vncServer::UpdateRegion(vncRegion &region)
-{
-	vncClientList::iterator i;
-	
-	omni_mutex_lock l(m_clientsLock);
-
-		
-	// Post this update to all the connected clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		// Post the update
-			GetClient(*i)->UpdateRegion(region);
-	}
-}
-
-void
-vncServer::CopyRect(RECT &dest, POINT &source)
-{
-	vncClientList::iterator i;
-	
-	omni_mutex_lock l(m_clientsLock);
-
-	// Post this update to all the connected clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		// Post the update
-		GetClient(*i)->CopyRect(dest, source);
-	}
-}
-
-void
-vncServer::UpdateMouse()
-{
-	vncClientList::iterator i;
-	
-	omni_mutex_lock l(m_clientsLock);
-
-	// Post this mouse update to all the connected clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		// Post the update
-		GetClient(*i)->UpdateMouse();
-	}
-}
-
-void
-vncServer::UpdateClipText(LPSTR text)
-{
-	vncClientList::iterator i;
-	
-	omni_mutex_lock l(m_clientsLock);
-
-	// Post this update to all the connected clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		// Post the update
-		GetClient(*i)->UpdateClipText(text);
-	}
-}
-
-void
-vncServer::UpdatePalette()
-{
-	vncClientList::iterator i;
-	
-	omni_mutex_lock l(m_clientsLock);
-
-	// Post this update to all the connected clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		// Post the update
-		GetClient(*i)->UpdatePalette();
-	}
-}
-
-void
-vncServer::UpdateLocalClipText(LPSTR text)
-{
-	omni_mutex_lock l(m_desktopLock);
-
-	if (m_desktop != NULL)
-		m_desktop->SetClipText(text);
-}
-
-// Changing hook settings
-
-void
-vncServer::DontSetHooks(BOOL enable)
-{
-	m_dont_set_hooks = enable;
-	if (m_desktop != NULL)
-		m_desktop->TryActivateHooks();
-}
-
-// Changing use driver settings
-
-void
-vncServer::DontUseDriver(BOOL enable)
-{
-	m_dont_use_driver = enable;
-}
-
-void
-vncServer::DriverDirectAccess(BOOL enable)
-{
-	m_driver_direct_access_en = enable;
-}
-
-// Name and port number handling
-void
-vncServer::SetName(const char * name)
-{
-	// Set the name of the desktop
-	if (m_name != NULL)
-	{
-		free(m_name);
-		m_name = NULL;
-	}
-	
-	m_name = strdup(name);
-}
-
-void
-vncServer::SetPorts(const UINT port_rfb, const UINT port_http)
-{
-	if (m_port != port_rfb || m_port_http != port_http) {
-		// Set port numbers to use
-		m_port = port_rfb;
-		m_port_http = port_http;
-
-		// If there is already a listening socket then close and re-open it...
-		BOOL socketon = SockConnected();
-		SockConnect(FALSE);
-		if (socketon)
-			SockConnect(TRUE);
-    }
-}
-
-void
-vncServer::SetPassword(BOOL activate, const char *passwd)
-{
-	ResetPasswordsValidityInfo();
-	m_password_set = activate;
-	memcpy(m_password, passwd, MAXPWLEN);
-}
-
-BOOL
-vncServer::GetPassword(char *passwd)
-{
-	memcpy(passwd, m_password, MAXPWLEN);
-	return m_password_set;
-}
-
-void
-vncServer::SetPasswordViewOnly(BOOL activate, const char *passwd)
-{
-	ResetPasswordsValidityInfo();
-	m_password_viewonly_set = activate;
-	memcpy(m_password_viewonly, passwd, MAXPWLEN);
-}
-
-BOOL
-vncServer::GetPasswordViewOnly(char *passwd)
-{
-	memcpy(passwd, m_password_viewonly, MAXPWLEN);
-	return m_password_viewonly_set;
-}
-
-BOOL
-vncServer::ValidPasswordsSet()
-{
-	if (!m_valid_passwords_set_cached) {
-		m_valid_passwords_set = ValidPasswordsSet_nocache();
-		m_valid_passwords_set_cached = TRUE;
-	}
-	return m_valid_passwords_set;
-}
-
-BOOL
-vncServer::ValidPasswordsSet_nocache()
-{
-	char passwd1[MAXPWLEN];
-	char passwd2[MAXPWLEN];
-	BOOL set1 = GetPassword(passwd1);
-	BOOL set2 = GetPasswordViewOnly(passwd2);
-	if (!set1 && !set2)
-		return FALSE;	// no passwords set, connections impossible
-
-	if (!AuthRequired())
-		return TRUE;	// passwords may be empty, but we allow that
-
-	vncPasswd::ToText plain1(passwd1);
-	vncPasswd::ToText plain2(passwd2);
-	BOOL empty1 = !set1 || (strlen(plain1) == 0);
-	BOOL empty2 = !set2 || (strlen(plain2) == 0);
-	if (empty1 && empty2)
-		return FALSE;	// both passwords empty or unset, not allowed
-
-	return TRUE;		// at least one non-empty password
-}
-
-BOOL
-vncServer::ValidPasswordsEmpty()
-{
-	if (!m_valid_passwords_empty_cached) {
-		m_valid_passwords_empty = ValidPasswordsEmpty_nocache();
-		m_valid_passwords_empty_cached = TRUE;
-	}
-	return m_valid_passwords_empty;
-}
-
-BOOL
-vncServer::ValidPasswordsEmpty_nocache()
-{
-	if (AuthRequired())
-		return FALSE;	// empty passwords disallowed, always fail
-
-	char passwd1[MAXPWLEN];
-	char passwd2[MAXPWLEN];
-	BOOL set1 = GetPassword(passwd1);
-	BOOL set2 = GetPasswordViewOnly(passwd2);
-	if (!set1 && !set2)
-		return FALSE;	// no passwords set, connections impossible
-
-	vncPasswd::ToText plain1(passwd1);
-	vncPasswd::ToText plain2(passwd2);
-	BOOL empty1 = !set1 || (strlen(plain1) == 0);
-	BOOL empty2 = !set2 || (strlen(plain2) == 0);
-	if (empty1 && empty2)
-		return TRUE;	// there are no passwords that are non-empty
-
-	return FALSE;		// at least one non-empty password
-}
-
-// Remote input handling
-void
-vncServer::EnableRemoteInputs(BOOL enable)
-{
-	m_enable_remote_inputs = enable;
-}
-
-BOOL vncServer::RemoteInputsEnabled()
-{
-	return m_enable_remote_inputs;
-}
-
-// Local input handling
-void
-vncServer::DisableLocalInputs(BOOL disable)
-{
-	if ( m_disable_local_inputs != disable )
-	{
-		m_disable_local_inputs = disable;
-		if ( AuthClientCount() != 0 )
-			m_desktop->SetLocalInputDisableHook(disable);
-	}
-}
-
-BOOL vncServer::LocalInputsDisabled()
-{
-	return m_disable_local_inputs;
-}
-
-void vncServer::LocalInputPriority(BOOL disable)
-{
-	if( m_local_input_priority != disable )
-	{
-		m_local_input_priority = disable;
-		m_remote_mouse = 0;
-		m_remote_keyboard = 0;
-		if ( AuthClientCount() != 0 )
-			m_desktop->SetLocalInputPriorityHook(disable);
-	}
-	
-}  
-
-
-
-// Socket connection handling
-BOOL
-vncServer::SockConnect(BOOL On)
-{
-	// Are we being asked to switch socket connects on or off?
-	if (On)
-	{
-		// Is there a listening socket?
-		if (m_socketConn == NULL)
-		{
-			m_socketConn = new vncSockConnect();
-			if (m_socketConn == NULL)
-				return FALSE;
-
-			// Are we to use automatic port selection?
-			if (m_autoportselect)
-			{
-				BOOL ok = FALSE;
-
-				// Yes, so cycle through the ports, looking for a free one!
-				for (int i = 0; i < 99; i++)
-				{
-					m_port = DISPLAY_TO_PORT(i);
-					m_port_http = DISPLAY_TO_HPORT(i);
-
-					vnclog.Print(LL_CLIENTS, VNCLOG("trying port number %d\n"), m_port);
-
-					// Attempt to connect to the port
-					VSocket tempsock;
-					if (tempsock.Create())
-					{
-						if (!tempsock.Connect("localhost", m_port))
-						{
-							// Couldn't connect, so this port is probably usable!
-							if (m_socketConn->Init(this, m_port))
-							{
-								ok = TRUE;
-								break;
-							}
-						}
-					}
-				}
-
-				if (!ok)
-				{
-					delete m_socketConn;
-					m_socketConn = NULL;
-					return FALSE;
-				}
-			} else
-			{
-				// No autoportselect
-				if (!m_socketConn->Init(this, m_port))
-				{
-					delete m_socketConn;
-					m_socketConn = NULL;
-					return FALSE;
-				}
-			}
-
-#if 0
-			// Now let's start the HTTP connection stuff
-			if (m_port_http == m_port) {
-				vnclog.Print(LL_INTERR, VNCLOG("cannot start both RFB and HTTP servers "
-											   "on the same port\n"));
-			}
-            if (m_httpConn == NULL && m_httpd_enabled && m_port_http != m_port) {
-				m_httpConn = new vncHTTPConnect;
-				if (m_httpConn != NULL) {
-					// Start up the HTTP server
-					if (!m_httpConn->Init(this, m_port_http,
-										  m_httpd_params_enabled)) {
-						delete m_httpConn;
-						m_httpConn = NULL;
-						return FALSE;
-					}
-				}
-			}
-#endif
-		}
-	}
-	else
-	{
-		// *** JNW - Trying to fix up a lock-up when the listening socket closes
-#ifndef HORIZONLIVE
-		KillAuthClients();
-		KillUnauthClients();
-		WaitUntilAuthEmpty();
-		WaitUntilUnauthEmpty();
-#endif
-
-		// Is there a listening socket?
-		if (m_socketConn != NULL)
-		{
-			// Close the socket
-			delete m_socketConn;
-			m_socketConn = NULL;
-		}
-
-#if 0
-		// Is there an HTTP socket active?
-		if (m_httpConn != NULL)
-		{
-			// Close the socket
-			delete m_httpConn;
-			m_httpConn = NULL;
-		}
-#endif
-	}
-	return TRUE;
-}
-
-BOOL
-vncServer::SockConnected()
-{
-	return m_socketConn != NULL;
-}
-
-BOOL
-vncServer::SetHttpdEnabled(BOOL enable_httpd, BOOL enable_params)
-{
-	if (enable_httpd != m_httpd_enabled) {
-		m_httpd_enabled = enable_httpd;
-		m_httpd_params_enabled = enable_params;
-		BOOL socketConn = SockConnected();
-		SockConnect(FALSE);
-		SockConnect(socketConn);
-	} else {
-		if (enable_params != m_httpd_params_enabled) {
-			m_httpd_params_enabled = enable_params;
-			if (SockConnected()) {
-				SockConnect(FALSE);
-				SockConnect(TRUE);
-			}
-		}
-	}
-	return TRUE;
-}
-
-BOOL
-vncServer::SetLoopbackOnly(BOOL loopbackOnly)
-{
-	if (loopbackOnly != m_loopbackOnly)
-	{
-		m_loopbackOnly = loopbackOnly;
-		BOOL socketConn = SockConnected();
-		SockConnect(FALSE);
-		SockConnect(socketConn);
-	}
-	return TRUE;
-}
-
-BOOL
-vncServer::LoopbackOnly()
-{
-	return m_loopbackOnly;
-}
-
-BOOL
-vncServer::SetDisableTrayIcon(BOOL disableTrayIcon)
-{
-	if (disableTrayIcon != m_disableTrayIcon)
-	{
-		m_disableTrayIcon = disableTrayIcon;
-	}
-	return TRUE;
-}
-
-BOOL
-vncServer::GetDisableTrayIcon()
-{
-	return m_disableTrayIcon;
-}
-
-// CORBA connection handling
-BOOL
-vncServer::CORBAConnect(BOOL On)
-{
-#if 0
-	// Are we being asked to switch CORBA connects on or off?
-	if (On)
-	{
-		// Is there a CORBA object?
-		if (m_corbaConn == NULL)
-		{
-			m_corbaConn = new vncCorbaConnect();
-		}
-		if (m_corbaConn == NULL)
-			return FALSE;
-		if (!m_corbaConn->Init(this))
-		{
-			delete m_corbaConn;
-			m_corbaConn = NULL;
-			return FALSE;
-		}
-	}
-	else
-	{
-		// Is there a listening socket?
-		if (m_corbaConn != NULL)
-		{
-			// Close the socket
-			delete m_corbaConn;
-			m_corbaConn = NULL;
-		}
-	}
-#endif
-
-	return TRUE;
-}
-
-BOOL
-vncServer::CORBAConnected()
-{
-	return m_corbaConn != NULL;
-}
-
-void
-vncServer::GetScreenInfo(int &width, int &height, int &depth)
-{
-	rfbServerInitMsg scrinfo;
-
-	omni_mutex_lock l(m_desktopLock);
-
-	vnclog.Print(LL_INTINFO, VNCLOG("GetScreenInfo called\n"));
-
-	// Is a desktop object currently active?
-	if (m_desktop == NULL)
-	{
-		vncDesktop desktop;
-
-		// No, so create a dummy desktop and interrogate it
-		if (!desktop.Init(this))
-		{
-			scrinfo.framebufferWidth = 0;
-			scrinfo.framebufferHeight = 0;
-			scrinfo.format.bitsPerPixel = 0;
-		}
-		else
-		{
-			desktop.FillDisplayInfo(&scrinfo);
-		}
-	}
-	else
-	{
-		m_desktop->FillDisplayInfo(&scrinfo);
-	}
-
-	// Get the info from the scrinfo structure
-	width = m_shared_rect.right - m_shared_rect.left;
-	height = m_shared_rect.bottom - m_shared_rect.top;
-	depth = scrinfo.format.bitsPerPixel;
-}
-
-void
-vncServer::SetAuthHosts(const char*hostlist) {
-	omni_mutex_lock l(m_clientsLock);
-
-	if (m_auth_hosts != 0)
-		free(m_auth_hosts);
-
-	if (hostlist == 0) {
-		vnclog.Print(LL_INTINFO, VNCLOG("authhosts cleared\n"));
-		m_auth_hosts = 0;
-		return;
-	}
-
-	vnclog.Print(LL_INTINFO, VNCLOG("authhosts set to \"%s\"\n"), hostlist);
-	m_auth_hosts = strdup(hostlist);
-}
-
-char*
-vncServer::AuthHosts() {
-	omni_mutex_lock l(m_clientsLock);
-
-	if (m_auth_hosts == 0)
-		return strdup("");
-	else
-		return strdup(m_auth_hosts);
-}
-
-inline BOOL
-MatchStringToTemplate(const char *addr, size_t addrlen,
-				      const char *filtstr, size_t filtlen) {
-	if (filtlen == 0)
-		return 1;
-	if (addrlen < filtlen)
-		return 0;
-	for (size_t x = 0; x < filtlen; x++) {
-		if (addr[x] != filtstr[x])
-			return 0;
-	}
-	if ((addrlen > filtlen) && (addr[filtlen] != '.'))
-		return 0;
-	return 1;
-}
-
-vncServer::AcceptQueryReject
-vncServer::VerifyHost(const char *hostname) {
-	if (ClientsDisabled())
-		return vncServer::aqrReject;
-
-	omni_mutex_lock l(m_clientsLock);
-
-	// -=- Is the specified host blacklisted?
-	vncServer::BlacklistEntry	*current = m_blacklist;
-	vncServer::BlacklistEntry	*previous = 0;
-	SYSTEMTIME					systime;
-	FILETIME					ftime;
-	LARGE_INTEGER				now;
-
-	// Get the current time as a 64-bit value
-	GetSystemTime(&systime);
-	SystemTimeToFileTime(&systime, &ftime);
-	now.LowPart=ftime.dwLowDateTime;now.HighPart=ftime.dwHighDateTime;
-	now.QuadPart /= 10000000; // Convert it into seconds
-
-	while (current) {
-
-		// Has the blacklist entry timed out?
-		if ((now.QuadPart - current->_lastRefTime.QuadPart) > 0) {
-
-			// Yes.  Is it a "blocked" entry?
-			if (current->_blocked) {
-				// Yes, so unblock it & re-set the reference time
-				current->_blocked = FALSE;
-				current->_lastRefTime.QuadPart = now.QuadPart + 10;
-			} else {
-				// No, so remove it
-				if (previous)
-					previous->_next = current->_next;
-				else
-					m_blacklist = current->_next;
-				vncServer::BlacklistEntry *next = current->_next;
-				free(current->_machineName);
-				delete current;
-				current = next;
-				continue;
-			}
-
-		}
-
-		// Is this the entry we're interested in?
-		if ((strcmp(current->_machineName, hostname) == 0) &&
-			(current->_blocked)) {
-			// Machine is blocked, so just reject it
-			return vncServer::aqrReject;
-		}
-
-		previous = current;
-		current = current->_next;
-	}
-
-	// Has a hostname been specified?
-	if (hostname == 0) {
-		vnclog.Print(LL_INTWARN, VNCLOG("verify failed - null hostname\n"));
-		return vncServer::aqrReject;
-	}
-
-	// Set the state machine into the correct mode & process the filter
-	enum vh_Mode {vh_ExpectDelimiter, vh_ExpectIncludeExclude, vh_ExpectPattern};
-	vh_Mode machineMode = vh_ExpectIncludeExclude;
-	
-	vncServer::AcceptQueryReject verifiedHost = vncServer::aqrAccept;
-
-	vncServer::AcceptQueryReject patternType = vncServer::aqrReject;
-	UINT authHostsPos = 0;
-	UINT patternStart = 0;
-	UINT hostNameLen = strlen(hostname);
-
-	// Run through the auth hosts string until we hit the end
-	if (m_auth_hosts) {
-		while (1) {
-
-			// Which mode are we in?
-			switch (machineMode) {
-
-				// ExpectIncludeExclude - we should see a + or -.
-			case vh_ExpectIncludeExclude:
-				if (m_auth_hosts[authHostsPos] == '+') {
-					patternType = vncServer::aqrAccept;
-					patternStart = authHostsPos+1;
-					machineMode = vh_ExpectPattern;
-				} else if (m_auth_hosts[authHostsPos] == '-') {	
-					patternType = vncServer::aqrReject;
-					patternStart = authHostsPos+1;
-					machineMode = vh_ExpectPattern;
-				} else if (m_auth_hosts[authHostsPos] == '?') {	
-					patternType = vncServer::aqrQuery;
-					patternStart = authHostsPos+1;
-					machineMode = vh_ExpectPattern;
-				} else if (m_auth_hosts[authHostsPos] != '\0') {
-					vnclog.Print(LL_INTWARN, VNCLOG("verify host - malformed AuthHosts string\n"));
-					machineMode = vh_ExpectDelimiter;
-				}
-				break;
-
-				// ExpectPattern - we expect to see a valid pattern
-			case vh_ExpectPattern:
-				// ExpectDelimiter - we're scanning for the next ':', skipping a pattern
-			case vh_ExpectDelimiter:
-				if ((m_auth_hosts[authHostsPos] == ':') ||
-					(m_auth_hosts[authHostsPos] == '\0')) {
-					if (machineMode == vh_ExpectPattern) {
-						if (patternStart == 0) {
-							vnclog.Print(LL_INTWARN, VNCLOG("verify host - pattern processing failed!\n"));
-						} else {
-							// Process the match
-							if (MatchStringToTemplate(hostname, hostNameLen,
-								&(m_auth_hosts[patternStart]), authHostsPos-patternStart)) {
-								// The hostname matched - apply the include/exclude rule
-								verifiedHost = patternType;
-							}
-						}
-					}
-
-					// We now expect another + or -
-					machineMode = vh_ExpectIncludeExclude;
-				}
-				break;
-			}
-
-			// Have we hit the end of the pattern string?
-			if (m_auth_hosts[authHostsPos] == '\0')
-				break;
-			authHostsPos++;
-		}
-	}
-
-	return AdjustVerification(verifiedHost);
-}
-
-
-vncServer::AcceptQueryReject
-vncServer::AdjustVerification(vncServer::AcceptQueryReject host)
-{
-	vncServer::AcceptQueryReject verifiedHost = host;
-
-	// Based on the server's QuerySetting, adjust the verification result
-	switch (host) {
-	case vncServer::aqrAccept:
-		if (QuerySetting() >= 3)
-			verifiedHost = vncServer::aqrQuery;
-		break;
-	case vncServer::aqrQuery:
-		if (QuerySetting() <= 1)
-			verifiedHost = vncServer::aqrAccept;
-		else if (QuerySetting() == 4)
-			verifiedHost = vncServer::aqrReject;
-		break;
-	case vncServer::aqrReject:
-		if (QuerySetting() == 0)
-			verifiedHost = vncServer::aqrQuery;
-		break;
-	};
-
-	return verifiedHost;
-}
-
-void
-vncServer::AddAuthHostsBlacklist(const char *machine) {
-	omni_mutex_lock l(m_clientsLock);
-
-	// -=- Is the specified host blacklisted?
-	vncServer::BlacklistEntry	*current = m_blacklist;
-
-	// Get the current time as a 64-bit value
-	SYSTEMTIME					systime;
-	FILETIME					ftime;
-	LARGE_INTEGER				now;
-	GetSystemTime(&systime);
-	SystemTimeToFileTime(&systime, &ftime);
-	now.LowPart=ftime.dwLowDateTime;now.HighPart=ftime.dwHighDateTime;
-	now.QuadPart /= 10000000; // Convert it into seconds
-
-	while (current) {
-
-		// Is this the entry we're interested in?
-		if (strcmp(current->_machineName, machine) == 0) {
-
-			// If the host is already blocked then ignore
-			if (current->_blocked)
-				return;
-
-			// Set the RefTime & failureCount
-			current->_lastRefTime.QuadPart = now.QuadPart + 10;
-			current->_failureCount++;
-
-			if (current->_failureCount > 5)
-				current->_blocked = TRUE;
-			return;
-		}
-
-		current = current->_next;
-	}
-
-	// Didn't find the entry
-	current = new vncServer::BlacklistEntry;
-	current->_blocked = FALSE;
-	current->_failureCount = 0;
-	current->_lastRefTime.QuadPart = now.QuadPart + 10;
-	current->_machineName = strdup(machine);
-	current->_next = m_blacklist;
-	m_blacklist = current;
-}
-
-void
-vncServer::RemAuthHostsBlacklist(const char *machine) {
-	omni_mutex_lock l(m_clientsLock);
-
-	// -=- Is the specified host blacklisted?
-	vncServer::BlacklistEntry	*current = m_blacklist;
-	vncServer::BlacklistEntry	*previous = 0;
-
-	while (current) {
-
-		// Is this the entry we're interested in?
-		if (strcmp(current->_machineName, machine) == 0) {
-			if (previous)
-				previous->_next = current->_next;
-			else
-				m_blacklist = current->_next;
-			vncServer::BlacklistEntry *next = current->_next;
-			free (current->_machineName);
-			delete current;
-			current = next;
-			continue;
-		}
-
-		previous = current;
-		current = current->_next;
-	}
-}
-
-void
-vncServer::SetWindowShared(HWND hWnd)
-{
-	m_hwndShared=hWnd;
-}
-
-void  vncServer::SetMatchSizeFields(int left,int top,int right,int bottom)
-{
-	RECT trect = GetScreenRect();
-
-/*	if ( right - left < 32 )
-		right = left + 32;
-	
-	if ( bottom - top < 32)
-		bottom = top + 32 ;*/
-
-	if( right > trect.right )
-		right = trect.right;
-	if( bottom > trect.bottom )
-		bottom = trect.bottom;
-	if( left < trect.left)
-		left = trect.left;
-	if( top < trect.top)
-		top = trect.top;
-
- 
-	m_screenarea_rect.left=left;
-	m_screenarea_rect.top=top;
-	m_screenarea_rect.bottom=bottom;
-	m_screenarea_rect.right=right;
-}
-
-
-void 
-vncServer::SetKeyboardCounter(int count)
-{
-		
-	omni_mutex_lock l(m_clientsLock);
-	if (LocalInputPriority() && vncService::IsWin95())
-	{
-		m_remote_keyboard += count;
-		if (count == 0)
-			m_remote_keyboard = 0;
-	}       
-	
-}
-
-void 
-vncServer::SetMouseCounter(int count, POINT &cursor_pos, BOOL mousemove)
-{
-	if( (mousemove) && ( abs (m_cursor_pos.x - cursor_pos.x)==0 
-		&&  abs (m_cursor_pos.y - cursor_pos.y)==0 ) ) 
-		return;
-	
-	omni_mutex_lock l(m_clientsLock);
-	if (LocalInputPriority() && vncService::IsWin95())
-	{
-		m_remote_mouse += count;
-		if (count == 0)
-			m_remote_mouse = 0;
-
-		m_cursor_pos.x = cursor_pos.x;
-		m_cursor_pos.y = cursor_pos.y;
-		
-	
-	}
-	
-}
-
-void 
-vncServer::SetNewFBSize(BOOL sendnewfb)
-{
-	vncClientList::iterator i;
-	omni_mutex_lock l(m_clientsLock);
-
-	// Post new framebuffer size update to all the connected clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		// Post the update
-		GetClient(*i)->SetNewFBSize( sendnewfb);
-	}
-}
-
-
-BOOL 
-vncServer::FullRgnRequested()
-{
-	vncClientList::iterator i;
-	omni_mutex_lock l(m_clientsLock);
-
-	// Iterate over the authorised clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		if (GetClient(*i)->FullRgnRequested())
-			return TRUE;
-	}
-	return FALSE;
-}
-
-BOOL 
-vncServer::IncrRgnRequested()
-{
-	vncClientList::iterator i;
-	omni_mutex_lock l(m_clientsLock);
-
-	// Iterate over the authorised clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		if (GetClient(*i)->IncrRgnRequested())
-			return TRUE;
-	}
-	return FALSE;
-}
-
-void 
-vncServer::UpdateLocalFormat()
-{
-	vncClientList::iterator i;
-	omni_mutex_lock l(m_clientsLock);
-
-	// Iterate over the authorised clients
-	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-	{
-		GetClient(*i)->UpdateLocalFormat();
-			
-	}
-	return;
-}
-
-void 
-vncServer::SetPollingCycle(UINT msec)
-{
-	if (m_polling_cycle != msec && msec > 10) {
-		m_polling_cycle = msec;
-		PollingCycleChanged(true);
-	}
-}
-
-BOOL
-vncServer::checkPointer(vncClient *pClient)
-{
-  vncClientList::iterator i;
-  for (i = m_authClients.begin(); i != m_authClients.end(); i++)
-  {
-    if (GetClient(*i) == pClient) return TRUE;
-  }
-  return FALSE;
-}
-
-BOOL
-vncServer::DriverActive() {
-	return (m_desktop != NULL) ? m_desktop->DriverActive() : FALSE;
-}
-
-typedef HMONITOR (WINAPI* pMonitorFromPoint)(POINT,DWORD);
-typedef BOOL (WINAPI* pGetMonitorInfo)(HMONITOR,LPMONITORINFO);
-
-BOOL vncServer::SetShareMonitorFromPoint(POINT pt)
-{
-	HINSTANCE  hInstUser32 = LoadLibrary("User32.DLL");
-	if (!hInstUser32) return FALSE;  
-	pMonitorFromPoint pMFP = (pMonitorFromPoint)GetProcAddress(hInstUser32, "MonitorFromPoint");
-	pGetMonitorInfo pGMI = (pGetMonitorInfo)GetProcAddress(hInstUser32, "GetMonitorInfoA");
-	if (!pMFP || !pGMI)
-	{
-		vnclog.Print(
-			LL_INTERR,
-			VNCLOG("Can not import '%s' and '%s' from '%s'.\n"),
-			"MonitorFromPoint",
-			"GetMonitorInfoA",
-			"User32.DLL");
-		FreeLibrary(hInstUser32);
-		return FALSE;
-	}
-
-	HMONITOR hm = pMFP(pt, MONITOR_DEFAULTTONEAREST);
-	if (!hm)
-	{
-		FreeLibrary(hInstUser32);
-		return FALSE;
-	}
-	MONITORINFO	moninfo;
-	moninfo.cbSize = sizeof(moninfo);
-	if (!pGMI(hm, &moninfo))
-	{
-		FreeLibrary(hInstUser32);
-		return FALSE;
-	}
-
-	FullScreen(FALSE);
-	WindowShared(FALSE);
-	ScreenAreaShared(TRUE);
-	PrimaryDisplayOnlyShared(FALSE);
-
-	SetMatchSizeFields(
-		moninfo.rcMonitor.left,
-		moninfo.rcMonitor.top,
-		moninfo.rcMonitor.right,
-		moninfo.rcMonitor.bottom);
-
-	FreeLibrary(hInstUser32);
-	return TRUE;
-}
diff --git a/ica/win32/src/vncServer.h b/ica/win32/src/vncServer.h
deleted file mode 100644
index 3bf7949..0000000
--- a/ica/win32/src/vncServer.h
+++ /dev/null
@@ -1,466 +0,0 @@
-//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncServer.h
-
-// vncServer class handles the following functions:
-// - Allowing clients to be dynamically added and removed
-// - Propagating updates from the local vncDesktop object
-//   to all the connected clients
-// - Propagating mouse movements and keyboard events from
-//   clients to the local vncDesktop
-// It also creates the vncSockConnect and vncCORBAConnect
-// servers, which respectively allow connections via sockets
-// and via the ORB interface
-
-class vncServer;
-
-#if (!defined(_WINVNC_VNCSERVER))
-#define _WINVNC_VNCSERVER
-
-// Custom
-#include "vncCorbaConnect.h"
-#include "vncSockConnect.h"
-#include "vncHTTPConnect.h"
-#include "vncClient.h"
-#include "vncRegion.h"
-#include "vncPasswd.h"
-
-// Includes
-#include "stdhdrs.h"
-#include <omnithread.h>
-#include <list>
-
-// Define a datatype to handle lists of windows we wish to notify
-typedef std::list<HWND> vncNotifyList;
-
-// Some important constants;
-const int MAX_CLIENTS = 128;
-
-// The vncServer class itself
-
-class vncServer
-{
-public:
-	// Constructor/destructor
-	vncServer();
-	virtual ~vncServer();
-
-	// Client handling functions
-	virtual void DisableClients(BOOL state);
-	virtual BOOL ClientsDisabled();
-	virtual vncClientId AddClient(VSocket *socket, BOOL reverse, BOOL shared);
-	virtual vncClientId AddClient(VSocket *socket, BOOL reverse, BOOL shared,
-								  BOOL keysenabled, BOOL ptrenabled);
-	virtual BOOL Authenticated(vncClientId client);
-	virtual void KillClient(vncClientId client);
-
-	virtual UINT AuthClientCount();
-	virtual UINT UnauthClientCount();
-
-	virtual void KillAuthClients();
-	virtual void WaitUntilAuthEmpty();
-
-	virtual void KillUnauthClients();
-	virtual void WaitUntilUnauthEmpty();
-
-	// Has at least one client had a remote event?
-	virtual BOOL RemoteEventReceived();
-
-	// Client info retrieval/setup
-	virtual vncClient* GetClient(vncClientId clientid);
-	virtual vncClientList ClientList();
-
-	virtual void BlockRemoteInput(BOOL block);
-
-	virtual const char* GetClientName(vncClientId client);
-
-	// Let a client remove itself
-	virtual void RemoveClient(vncClientId client);
-
-	// Connect/disconnect notification
-	virtual BOOL AddNotify(HWND hwnd);
-	virtual BOOL RemNotify(HWND hwnd);
-
-	// Check mirror driver status
-	virtual BOOL DesktopActive() { return m_desktop != NULL; }
-	virtual BOOL DriverActive();
-
-	virtual BOOL SetShareMonitorFromPoint(POINT pt);
-
-protected:
-	// Send a notification message
-	virtual void DoNotify(UINT message, WPARAM wparam, LPARAM lparam);
-
-public:
-	// Update handling, used by clients to signal the screen server
-	virtual void RequestUpdate();
-
-	// Update handling, used by the screen server
-	virtual void TriggerUpdate();
-	virtual void UpdateRect(RECT &rect);
-	virtual void UpdateRegion(vncRegion &region);
-	virtual void CopyRect(RECT &dest, POINT &source);
-	virtual void UpdateMouse();
-	virtual void UpdateClipText(LPSTR text);
-	virtual void UpdatePalette();
-
-	// Polling mode handling
-	virtual void PollUnderCursor(BOOL enable) {m_poll_undercursor = enable;};
-	virtual BOOL PollUnderCursor() {return m_poll_undercursor;};
-	virtual void PollForeground(BOOL enable) {m_poll_foreground = enable;};
-	virtual BOOL PollForeground() {return m_poll_foreground;};
-	virtual void PollFullScreen(BOOL enable) {m_poll_fullscreen = enable;};
-	virtual BOOL PollFullScreen() {return m_poll_fullscreen;};
-	virtual void DontSetHooks(BOOL enable);
-	virtual BOOL DontSetHooks() {return m_dont_set_hooks;};
-	virtual void DontUseDriver(BOOL enable);
-	virtual BOOL DontUseDriver() {return m_dont_use_driver;};
-	virtual void DriverDirectAccess(BOOL enable);
-	virtual BOOL DriverDirectAccess() {return m_driver_direct_access_en;};
-
-	virtual void PollConsoleOnly(BOOL enable) {m_poll_consoleonly = enable;};
-	virtual BOOL PollConsoleOnly() {return m_poll_consoleonly;};
-	virtual void PollOnEventOnly(BOOL enable) {m_poll_oneventonly = enable;};
-	virtual BOOL PollOnEventOnly() {return m_poll_oneventonly;};
-
-	// Client manipulation of the clipboard
-	virtual void UpdateLocalClipText(LPSTR text);
-
-	// Name and port number handling
-	virtual void SetName(const char * name);
-	virtual void SetPorts(const UINT port_rfb, const UINT port_http);
-	virtual UINT GetPort() { return m_port; };
-	virtual UINT GetHttpPort() { return m_port_http; };
-	virtual void SetAutoPortSelect(const BOOL autoport) {
-	    if (autoport && !m_autoportselect)
-	    {
-		BOOL sockconnect = SockConnected();
-		SockConnect(FALSE);
-		m_autoportselect = autoport;
-		SockConnect(sockconnect);
-	    }
-		else
-		{
-			m_autoportselect = autoport;
-		}
-	};
-	virtual BOOL AutoPortSelect() {return m_autoportselect;};
-
-	// Password set/retrieve.  Note that these functions now handle the encrypted
-	// form, not the plaintext form.  The buffer passwd MUST be MAXPWLEN in size.
-	// If the parameter `activate' is FALSE, then the password is considered
-	// undefined. If `activate' is FALSE, the password data still may be copied.
-	// The return value of `Get' functions matches the `activate' parameter.
-	virtual void SetPassword(BOOL activate, const char *passwd);
-	virtual BOOL GetPassword(char *passwd);
-	virtual void SetPasswordViewOnly(BOOL activate, const char *passwd);
-	virtual BOOL GetPasswordViewOnly(char *passwd);
-
-	// Determine is at least one valid password is set so authentication is
-	// possible. This function returns TRUE if at least one of the passwords
-	// (primary or view-only) is set, AND at least one of the passwords is
-	// not empty if empty passwords are disabled.
-	virtual BOOL ValidPasswordsSet();
-
-	// Version of ValidPasswordsSet() that does not use m_valid_passwords_set.
-	virtual BOOL ValidPasswordsSet_nocache();
-
-	// Determine if there are valid passwords (primary or view-only) AND all
-	// valid passwords are empty. If this function returns TRUE, no password
-	// authentication will be requested.
-	virtual BOOL ValidPasswordsEmpty();
-
-	// Version of ValidPasswordsEmpty() that does not use m_valid_passwords_empty.
-	virtual BOOL ValidPasswordsEmpty_nocache();
-
-	// Remote input handling
-	virtual void EnableRemoteInputs(BOOL enable);
-	virtual BOOL RemoteInputsEnabled();
-
-	// Local input handling
-	virtual void DisableLocalInputs(BOOL disable);
-	virtual BOOL LocalInputsDisabled();
-
-	// General connection handling
-	virtual void SetConnectPriority(UINT priority) {m_connect_pri = priority;};
-	virtual UINT ConnectPriority() {return m_connect_pri;};
-
-	// Socket connection handling
-	virtual BOOL SockConnect(BOOL on);
-	virtual BOOL SockConnected();
-	virtual BOOL SetLoopbackOnly(BOOL loopbackOnly);
-	virtual BOOL LoopbackOnly();
-
-	// Tray icon disposition
-	virtual BOOL SetDisableTrayIcon(BOOL disableTrayIcon);
-	virtual BOOL GetDisableTrayIcon();
-
-	// CORBA connection handling
-	virtual BOOL CORBAConnect(BOOL on);
-	virtual BOOL CORBAConnected();
-	virtual void GetScreenInfo(int &width, int &height, int &depth);
-
-	// Allow connections without password authentication?
-	virtual void SetAuthRequired(BOOL reqd) {ResetPasswordsValidityInfo(); m_passwd_required = reqd;}
-	virtual BOOL AuthRequired() {return m_passwd_required;};
-
-	// Beep on connect/disconnect?
-	virtual void SetBeepConnect(BOOL beepConn) {m_beepConnect = beepConn;};
-	virtual BOOL GetBeepConnect() {return m_beepConnect;};
-	virtual void SetBeepDisconnect(BOOL beepDisconn) {m_beepDisconnect = beepDisconn;};
-	virtual BOOL GetBeepDisconnect() {return m_beepDisconnect;};
-
-	// Handling of per-client connection authorisation
-	virtual void SetAuthHosts(const char *hostlist);
-	virtual char *AuthHosts();
-	enum AcceptQueryReject {aqrAccept, aqrQuery, aqrReject};
-	virtual AcceptQueryReject VerifyHost(const char *hostname);
-	virtual AcceptQueryReject AdjustVerification(AcceptQueryReject host);
-
-	// Blacklisting of machines which fail connection attempts too often
-	// Such machines will fail VerifyHost for a short period
-	virtual void AddAuthHostsBlacklist(const char *machine);
-	virtual void RemAuthHostsBlacklist(const char *machine);
-
-	// Connection querying settings
-	virtual void SetQuerySetting(const UINT setting) {m_querysetting = setting;};
-	virtual UINT QuerySetting() {return m_querysetting;};
-	virtual void SetQueryTimeout(const UINT setting) {m_querytimeout = setting;};
-	virtual UINT QueryTimeout() {return m_querytimeout;};
-	virtual void SetQueryAccept(const BOOL setting) {m_queryaccept = setting;};
-	virtual BOOL QueryAccept() {return m_queryaccept;};
-	virtual void SetQueryAllowNoPass(const BOOL setting) {m_queryallownopass = setting;};
-	virtual BOOL QueryAllowNoPass() {return m_queryallownopass;};
-
-	// Whether or not to allow incoming HTTP connections
-	virtual BOOL SetHttpdEnabled(BOOL enable_httpd, BOOL enable_params);
-	virtual BOOL HttpdEnabled() {return m_httpd_enabled;};
-	virtual BOOL HttpdParamsEnabled() {return m_httpd_params_enabled;};
-
-	// Whether or not to allow connections from the local machine
-	virtual void SetLoopbackOk(BOOL ok) {m_loopback_allowed = ok;};
-	virtual BOOL LoopbackOk() {return m_loopback_allowed;};
-
-	// Whether or not to shutdown or logoff when the last client leaves
-	virtual void SetLockSettings(int ok) {m_lock_on_exit = ok;};
-	virtual int LockSettings() {return m_lock_on_exit;};
-
-	// Timeout for automatic disconnection of idle connections
-	virtual void SetAutoIdleDisconnectTimeout(const UINT timeout) {m_idle_timeout = timeout;};
-	virtual UINT AutoIdleDisconnectTimeout() {return m_idle_timeout;};
-
-	// Removal of desktop wallpaper, etc
-	virtual void EnableRemoveWallpaper(const BOOL enable) {m_remove_wallpaper = enable;};
-	virtual BOOL RemoveWallpaperEnabled() {return m_remove_wallpaper;};
-
-	virtual void SetBlankScreen(const BOOL enable) {m_blank_screen = enable;};
-	virtual BOOL GetBlankScreen() {return m_blank_screen;};
-
-	// Whether or not to allow file transfers
-	virtual void EnableFileTransfers(const BOOL enable) {m_enable_file_transfers = enable;}
-	virtual BOOL FileTransfersEnabled() {return m_enable_file_transfers;}
-
-    // Patrial desktop sharing
-    virtual void WindowShared(BOOL enable) { m_WindowShared = enable; }
-    virtual BOOL WindowShared() { return m_WindowShared; }
-    virtual void SetMatchSizeFields(int left, int top, int right, int bottom);
-	virtual RECT GetScreenAreaRect() { return m_screenarea_rect; }
-	virtual void SetWindowShared(HWND hWnd);
-    virtual HWND GetWindowShared() { return m_hwndShared; }
-	virtual RECT GetSharedRect () { return m_shared_rect; }
-	virtual void SetSharedRect (RECT rect) { m_shared_rect = rect; }
-	virtual BOOL FullScreen() { return m_full_screen; }
-	virtual void FullScreen(BOOL enable) { m_full_screen = enable; }
-	virtual BOOL ScreenAreaShared() { return m_screen_area; }
-	virtual void ScreenAreaShared(BOOL enable) { m_screen_area = enable; }
-	virtual BOOL PrimaryDisplayOnlyShared() { return m_primary_display_only_shared; }
-	virtual void PrimaryDisplayOnlyShared(BOOL enable) { m_primary_display_only_shared = enable; }
-
-	virtual void SetNewFBSize(BOOL sendnewfb);
-	virtual BOOL FullRgnRequested();
-	virtual BOOL IncrRgnRequested();
-	virtual	void UpdateLocalFormat();
-	                                                                                     
-	// Blocking remote input
-	virtual void LocalInputPriority(BOOL enable);
-	virtual BOOL LocalInputPriority() { return m_local_input_priority; }
-	virtual void SetKeyboardCounter(int count);
-	virtual int KeyboardCounter() { return m_remote_keyboard; }
-	virtual void SetMouseCounter(int count, POINT &cursor_pos, BOOL mousemove);
-	virtual int MouseCounter() { return m_remote_mouse; }
-	virtual UINT DisableTime() { return m_disable_time; }
-	virtual void SetDisableTime(UINT disabletime) { m_disable_time = disabletime; }
-	virtual UINT GetPollingCycle() { return m_polling_cycle; }
-	virtual void SetPollingCycle(UINT msec);
-	virtual BOOL PollingCycleChanged() { return m_polling_cycle_changed; }
-	virtual void PollingCycleChanged(BOOL change) { m_polling_cycle_changed = change; }
-
-  BOOL checkPointer(vncClient *pClient);
-
-	virtual void ClearWallpaperWait() { m_wallpaper_wait = FALSE; }
-	virtual BOOL WallpaperWait() { return m_wallpaper_wait; }
-
-	// Internal stuffs
-protected:
-	// Connection servers
-	vncSockConnect		*m_socketConn;
-	vncCorbaConnect		*m_corbaConn;
-	vncHTTPConnect		*m_httpConn;
-
-	// The desktop handler
-	vncDesktop			*m_desktop;
-
-	// General preferences
-	UINT				m_port;
-	UINT				m_port_http;
-	RECT			    m_shared_rect;
-	RECT			    m_screenarea_rect;
-	BOOL				m_autoportselect;
-	char				m_password[MAXPWLEN];
-	BOOL				m_password_set;
-	char				m_password_viewonly[MAXPWLEN];
-	BOOL				m_password_viewonly_set;
-	BOOL				m_passwd_required;
-	BOOL				m_loopback_allowed;
-	BOOL				m_httpd_enabled;
-	BOOL				m_httpd_params_enabled;
-	BOOL				m_loopbackOnly;
-	BOOL				m_disableTrayIcon;
-	char				*m_auth_hosts;
-	BOOL				m_enable_remote_inputs;
-	BOOL				m_disable_local_inputs;
-	int					m_lock_on_exit;
-	int					m_connect_pri;
-	BOOL				m_beepConnect;
-	BOOL				m_beepDisconnect;
-	UINT				m_querysetting;
-	UINT				m_querytimeout;
-	BOOL				m_queryaccept;
-	BOOL				m_queryallownopass;
-	BOOL				m_clients_disabled;
-	UINT				m_idle_timeout;
-	UINT				m_disable_time;
-
-	BOOL				m_remove_wallpaper;
-	BOOL				m_blank_screen;
-	BOOL				m_enable_file_transfers;
-
-	// Polling preferences
-	BOOL				m_poll_fullscreen;
-	BOOL				m_poll_foreground;
-	BOOL				m_poll_undercursor;
-
-	BOOL				m_poll_oneventonly;
-	BOOL				m_poll_consoleonly;
-
-	BOOL				m_dont_set_hooks;
-	BOOL				m_dont_use_driver;
-	BOOL				m_driver_direct_access_en;
-// NOTE that it only has a status of preference;
-// the effective status of direct access option is
-// vncVideoDriver::m_fDirectAccessInEffect
-
-	// screen area sharing preferences                                                   
-	BOOL				m_shared_oneapplionly;               
-	HWND				m_hwndShared;  
-	BOOL				m_WindowShared;                      
-	BOOL				m_full_screen;                       
-	BOOL				m_screen_area;                       
-	BOOL				m_primary_display_only_shared;
-
-	// local event priority stuff                                        
-	BOOL				m_local_input_priority;                    
-	INT					m_remote_mouse;              
-	INT					m_remote_keyboard;           
-	POINT				m_cursor_pos;
-
-	UINT				m_polling_cycle;
-	BOOL				m_polling_cycle_changed;
-
-	// Make sure to remove wallpaper _before_ the first update
-	BOOL				m_wallpaper_wait;
-
-	// Name of this desktop
-	char				*m_name;
-
-	// Blacklist structures
-	struct BlacklistEntry {
-		BlacklistEntry *_next;
-		char *_machineName;
-		LARGE_INTEGER _lastRefTime;
-		UINT _failureCount;
-		BOOL _blocked;
-	};
-	BlacklistEntry		*m_blacklist;
-	
-	// The client lists - list of clients being authorised and ones
-	// already authorised
-	vncClientList		m_unauthClients;
-	vncClientList		m_authClients;
-	vncClient			*m_clientmap[MAX_CLIENTS];
-	vncClientId			m_nextid;
-
-	// Lock to protect the client list from concurrency - lock when reading/updating client list
-	omni_mutex			m_clientsLock;
-	// Lock to protect the desktop object from concurrency - lock when updating client list
-	omni_mutex			m_desktopLock;
-
-	// Signal set when a client removes itself
-	omni_condition		*m_clientquitsig;
-
-	// Set of windows to send notifications to
-	vncNotifyList		m_notifyList;
-
-	// The value that would be returned by ValidPasswordsSet(). This variable has correct
-	// authentic value only if m_valid_passwords_set_cached is true. Maintaining this variable
-	// prevents from decoding passwords each time ValidPasswordsSet() is called.
-	BOOL				m_valid_passwords_set;
-
-	// This variable set to true means that the value of m_valid_passwords_set is authentic.
-	BOOL				m_valid_passwords_set_cached;
-
-	// The value that would be returned by ValidPasswordsEmpty(). This variable has correct
-	// authentic value only if m_valid_passwords_empty_cached is true. Maintaining this variable
-	// prevents from decoding passwords each time ValidPasswordsEmpty() is called.
-	BOOL				m_valid_passwords_empty;
-
-	// This variable set to true means that the value of m_valid_passwords_empty is authentic.
-	BOOL				m_valid_passwords_empty_cached;
-
-	// A short function to invalidate both m_valid_passwords_set and m_valid_passwords_empty.
-	void inline ResetPasswordsValidityInfo() {
-		m_valid_passwords_set_cached = m_valid_passwords_empty_cached = FALSE;
-	}
-};
-
-BOOL IsWinNT();
-BOOL IsWinVerOrHigher(ULONG mj, ULONG mn);
-
-RECT GetScreenRect();
-
-#endif
diff --git a/ica/win32/src/vncService.cpp b/ica/win32/src/vncService.cpp
deleted file mode 100644
index 82a7d5e..0000000
--- a/ica/win32/src/vncService.cpp
+++ /dev/null
@@ -1,1430 +0,0 @@
-//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//  Copyright (C) 2009 GlavSoft LLC. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncService
-
-// Implementation of service-oriented functionality of WinVNC
-
-#include "stdhdrs.h"
-
-// Header
-
-#include "vncService.h"
-
-#include <lmcons.h>
-#include "omnithread.h"
-#include "WinVNC.h"
-#include "vncMenu.h"
-#include "vncTimedMsgBox.h"
-
-// Error message logging
-void LogErrorMsg(char *message);
-
-// OS-SPECIFIC ROUTINES
-
-// Create an instance of the vncService class to cause the static fields to be
-// initialised properly
-
-vncService init;
-
-DWORD	g_platform_id;
-BOOL	g_impersonating_user = FALSE;
-HANDLE	g_impersonation_token = 0;
-DWORD	g_version_major;
-DWORD	g_version_minor;
-
-#ifdef HORIZONLIVE
-BOOL	g_nosettings_flag;
-#endif
-
-vncService::vncService()
-{
-    OSVERSIONINFO osversioninfo;
-    osversioninfo.dwOSVersionInfoSize = sizeof(osversioninfo);
-
-    // Get the current OS version
-    if (!GetVersionEx(&osversioninfo))
-	    g_platform_id = 0;
-    g_platform_id = osversioninfo.dwPlatformId;
-	g_version_major = osversioninfo.dwMajorVersion;
-	g_version_minor = osversioninfo.dwMinorVersion;
-#ifdef HORIZONLIVE
-	g_nosettings_flag = false;
-#endif
-
-}
-
-vncService::~vncService()
-{
-	if (g_impersonating_user) {
-		g_impersonating_user = FALSE;
-		CloseHandle(g_impersonation_token);
-		g_impersonation_token = 0;
-	}
-}
-
-#ifdef HORIZONLIVE
-void
-vncService::SetNoSettings(bool flag)
-{
-	g_nosettings_flag = flag;
-}
-
-BOOL vncService::GetNoSettings()
-{
-	return g_nosettings_flag;
-}
-
-#endif
-
-
-// GetCurrentUser - fills a buffer with the name of the current user!
-BOOL
-vncService::GetCurrentUser(char *buffer, UINT size)
-{
-	// How to obtain the name of the current user depends upon the OS being used
-	if ((g_platform_id == VER_PLATFORM_WIN32_NT) && vncService::RunningAsService())
-	{
-		// Windows NT, service-mode
-
-		// -=- FIRSTLY - verify that a user is logged on
-
-		// Get the current Window station
-		HWINSTA station = GetProcessWindowStation();
-		if (station == NULL)
-			return FALSE;
-
-		// Get the current user SID size
-		DWORD usersize;
-		GetUserObjectInformation(station,
-			UOI_USER_SID, NULL, 0, &usersize);
-
-		// Check the required buffer size isn't zero
-		if (usersize == 0)
-		{
-			// No user is logged in - ensure we're not impersonating anyone
-			RevertToSelf();
-			g_impersonating_user = FALSE;
-			CloseHandle(g_impersonation_token);
-			g_impersonation_token = 0;
-
-			// Return "" as the name...
-			if (strlen("") >= size)
-				return FALSE;
-			strcpy(buffer, "");
-
-			return TRUE;
-		}
-
-		// -=- SECONDLY - a user is logged on but if we're not impersonating
-		//     them then we can't continue!
-		if (!g_impersonating_user) {
-			// Return "" as the name...
-			if (strlen("") >= size)
-				return FALSE;
-			strcpy(buffer, "");
-			return TRUE;
-		}
-	}
-		
-	// -=- When we reach here, we're either running under Win9x, or we're running
-	//     under NT as an application or as a service impersonating a user
-	// Either way, we should find a suitable user name.
-
-	switch (g_platform_id)
-	{
-
-	case VER_PLATFORM_WIN32_WINDOWS:
-	case VER_PLATFORM_WIN32_NT:
-		{
-			// Just call GetCurrentUser
-			DWORD length = size;
-
-			if (GetUserName(buffer, &length) == 0)
-			{
-				UINT error = GetLastError();
-
-				if (error == ERROR_NOT_LOGGED_ON)
-				{
-					// No user logged on
-					if (strlen("") >= size)
-						return FALSE;
-					strcpy(buffer, "");
-					return TRUE;
-				}
-				else
-				{
-					// Genuine error...
-					vnclog.Print(LL_INTERR, VNCLOG("GetUserName() failed, error=%d\n"), GetLastError());
-					return FALSE;
-				}
-			}
-		}
-		return TRUE;
-	};
-
-	// OS was not recognised!
-	return FALSE;
-}
-
-BOOL
-vncService::CurrentUser(char *buffer, UINT size)
-{
-  BOOL result = GetCurrentUser(buffer, size);
-  if (result && (strcmp(buffer, "") == 0) && !vncService::RunningAsService()) {
-    strncpy(buffer, "Default", size);
-  }
-  return result;
-}
-
-// IsWin95 - returns a BOOL indicating whether the current OS is Win95
-BOOL
-vncService::IsWin95()
-{
-	return (g_platform_id == VER_PLATFORM_WIN32_WINDOWS);
-}
-
-// IsWinNT - returns a bool indicating whether the current OS is WinNT
-BOOL
-vncService::IsWinNT()
-{
-	return (g_platform_id == VER_PLATFORM_WIN32_NT);
-}
-
-// Version info
-DWORD
-vncService::VersionMajor()
-{
-	return g_version_major;
-}
-
-DWORD
-vncService::VersionMinor()
-{
-	return g_version_minor;
-}
-
-// Internal routine to find the WinVNC menu class window and
-// post a message to it!
-
-BOOL
-PostToWinVNC(UINT message, WPARAM wParam, LPARAM lParam)
-{
-#if 0
-	// Locate the hidden WinVNC menu window
-	HWND hservwnd = FindWindow(MENU_CLASS_NAME, NULL);
-	if (hservwnd == NULL)
-		return FALSE;
-
-	// Post the message to WinVNC
-	PostMessage(hservwnd, message, wParam, lParam);
-#endif
-	return TRUE;
-}
-
-// Static routines only used on Windows NT to ensure we're in the right desktop
-// These routines are generally available to any thread at any time.
-
-// - SelectDesktop(HDESK)
-// Switches the current thread into a different desktop by desktop handle
-// This call takes care of all the evil memory management involved
-
-BOOL
-vncService::SelectHDESK(HDESK new_desktop)
-{
-	// Are we running on NT?
-	if (IsWinNT())
-	{
-		HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
-
-		DWORD dummy;
-		char new_name[256];
-
-		if (!GetUserObjectInformation(new_desktop, UOI_NAME, &new_name, 256, &dummy)) {
-			vnclog.Print(LL_INTERR, VNCLOG("GetUserObjectInformation() failed\n"));
-			return FALSE;
-		}
-
-		vnclog.Print(LL_INTINFO, VNCLOG("SelectHDESK() to %s (%x) from %x\n"),
-					 new_name, new_desktop, old_desktop);
-
-		// Switch the desktop
-		if(!SetThreadDesktop(new_desktop)) {
-			vnclog.Print(LL_INTERR, VNCLOG("unable to SetThreadDesktop(), error=%d\n"), GetLastError());
-			return FALSE;
-		}
-
-		// Switched successfully - destroy the old desktop
-		if (!CloseDesktop(old_desktop))
-			vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK failed to close old desktop %x, error=%d\n"), old_desktop, GetLastError());
-
-		return TRUE;
-	}
-
-	return TRUE;
-}
-
-// - SelectDesktop(char *)
-// Switches the current thread into a different desktop, by name
-// Calling with a valid desktop name will place the thread in that desktop.
-// Calling with a NULL name will place the thread in the current input desktop.
-
-BOOL
-vncService::SelectDesktop(char *name)
-{
-	// Are we running on NT?
-	if (IsWinNT())
-	{
-		HDESK desktop;
-
-		if (name != NULL)
-		{
-			// Attempt to open the named desktop
-			desktop = OpenDesktop(name, 0, FALSE,
-				DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
-				DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
-				DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
-				DESKTOP_SWITCHDESKTOP | GENERIC_WRITE);
-		}
-		else
-		{
-			// No, so open the input desktop
-			desktop = OpenInputDesktop(0, FALSE,
-				DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
-				DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
-				DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
-				DESKTOP_SWITCHDESKTOP | GENERIC_WRITE);
-		}
-
-		// Did we succeed?
-		if (desktop == NULL) {
-			vnclog.Print(LL_INTERR, VNCLOG("unable to open desktop, error=%d\n"), GetLastError());
-			return FALSE;
-		}
-
-		// Switch to the new desktop
-		if (!SelectHDESK(desktop)) {
-			// Failed to enter the new desktop, so free it!
-			vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop() failed to select desktop\n"));
-			if (!CloseDesktop(desktop))
-				vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop failed to close desktop, error=%d\n"), GetLastError());
-			return FALSE;
-		}
-
-		// We successfully switched desktops!
-		return TRUE;
-	}
-
-	return (name == NULL);
-}
-
-// NT only function to establish whether we're on the current input desktop
-
-BOOL
-vncService::InputDesktopSelected()
-{
-	// Are we running on NT?
-	if (IsWinNT())
-	{
-		// Get the input and thread desktops
-		HDESK threaddesktop = GetThreadDesktop(GetCurrentThreadId());
-		HDESK inputdesktop = OpenInputDesktop(0, FALSE,
-				DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
-				DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
-				DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
-				DESKTOP_SWITCHDESKTOP | GENERIC_WRITE);
-
-		if (inputdesktop == NULL) {
-			// Returning TRUE on ERROR_BUSY fixes the bug #1109102.
-			// FIXME: Probably this is not the most correct way to do it.
-			return (GetLastError() == ERROR_BUSY) ? TRUE : FALSE;
-		}
-
-		DWORD dummy;
-		char threadname[256];
-		char inputname[256];
-
-		if (!GetUserObjectInformation(threaddesktop, UOI_NAME, &threadname, 256, &dummy)) {
-			if (!CloseDesktop(inputdesktop))
-				vnclog.Print(LL_INTWARN, VNCLOG("failed to close input desktop\n"));
-			return FALSE;
-		}
-		_ASSERT(dummy <= 256);
-		if (!GetUserObjectInformation(inputdesktop, UOI_NAME, &inputname, 256, &dummy)) {
-			if (!CloseDesktop(inputdesktop))
-				vnclog.Print(LL_INTWARN, VNCLOG("failed to close input desktop\n"));
-			return FALSE;
-		}
-		_ASSERT(dummy <= 256);
-
-		if (!CloseDesktop(inputdesktop))
-			vnclog.Print(LL_INTWARN, VNCLOG("failed to close input desktop\n"));
-
-		if (strcmp(threadname, inputname) != 0)
-			return FALSE;
-	}
-
-	return TRUE;
-}
-
-// Static routine used to fool Winlogon into thinking CtrlAltDel was pressed
-
-void *
-SimulateCtrlAltDelThreadFn(void *context)
-{
-	HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
-
-	// Switch into the Winlogon desktop
-	if (!vncService::SelectDesktop("Winlogon"))
-	{
-		vnclog.Print(LL_INTERR, VNCLOG("failed to select logon desktop\n"));
-		return FALSE;
-	}
-
-	vnclog.Print(LL_ALL, VNCLOG("generating ctrl-alt-del\n"));
-
-	HWND hwndCtrlAltDel = FindWindow("SAS window class", "SAS window");
-	if (hwndCtrlAltDel == NULL) {
-		vnclog.Print(LL_INTERR, VNCLOG("\"SAS window\" not found\n"));
-		hwndCtrlAltDel = HWND_BROADCAST;
-	}
-
-	PostMessage(hwndCtrlAltDel, WM_HOTKEY, 0, MAKELONG(MOD_ALT | MOD_CONTROL, VK_DELETE));
-
-	// Switch back to our original desktop
-	if (old_desktop != NULL)
-		vncService::SelectHDESK(old_desktop);
-
-	return NULL;
-}
-
-// Static routine to simulate Ctrl-Alt-Del locally
-
-BOOL
-vncService::SimulateCtrlAltDel()
-{
-	vnclog.Print(LL_ALL, VNCLOG("preparing to generate ctrl-alt-del\n"));
-
-	// Are we running on NT?
-	if (IsWinNT())
-	{
-		vnclog.Print(LL_ALL, VNCLOG("spawn ctrl-alt-del thread...\n"));
-
-		// We simulate Ctrl+Alt+Del by posting a WM_HOTKEY message to the
-		// "SAS window" on the Winlogon desktop.
-		// This requires that the current thread is part of the Winlogon desktop.
-		// But the current thread has hooks set & a window open, so it can't
-		// switch desktops, so I instead spawn a new thread & let that do the work...
-
-		omni_thread *thread = omni_thread::create(SimulateCtrlAltDelThreadFn);
-		if (thread == NULL)
-			return FALSE;
-		thread->join(NULL);
-
-		return TRUE;
-	}
-
-	return TRUE;
-}
-
-// Static routine to lock a 2K or above workstation
-
-BOOL
-vncService::LockWorkstation()
-{
-	if (!IsWinNT()) {
-		vnclog.Print(LL_INTERR, VNCLOG("unable to lock workstation - not NT\n"));
-		return FALSE;
-	}
-
-	vnclog.Print(LL_ALL, VNCLOG("locking workstation\n"));
-
-	// Load the user32 library
-	HMODULE user32 = LoadLibrary("user32.dll");
-	if (!user32) {
-		vnclog.Print(LL_INTERR, VNCLOG("unable to load User32 DLL (%u)\n"), GetLastError());
-		return FALSE;
-	}
-
-	// Get the LockWorkstation function
-	typedef BOOL (*LWProc) ();
-	LWProc lockworkstation = (LWProc)GetProcAddress(user32, "LockWorkStation");
-	if (!lockworkstation) {
-		vnclog.Print(LL_INTERR, VNCLOG("unable to locate LockWorkStation - requires Windows 2000 or above (%u)\n"), GetLastError());
-		FreeLibrary(user32);
-		return FALSE;
-	}
-	
-	// Attempt to lock the workstation
-	BOOL result = (lockworkstation)();
-
-	if (!result) {
-		vnclog.Print(LL_INTERR, VNCLOG("call to LockWorkstation failed\n"));
-		FreeLibrary(user32);
-		return FALSE;
-	}
-
-	FreeLibrary(user32);
-	return result;
-}
-
-// Static routine to show the Properties dialog for a currently-running
-// copy of WinVNC, (usually a servicified version.)
-
-BOOL
-vncService::ShowProperties()
-{
-	// Post to the WinVNC menu window
-	if (!PostToWinVNC(MENU_PROPERTIES_SHOW, 0, 0))
-	{
-		MessageBox(NULL, "No existing instance of WinVNC could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-// Static routine to find a window by its title substring (case-insensitive).
-// Window titles and search substrings will be truncated at length 255.
-
-HWND
-vncService::FindWindowByTitle(char *substr)
-{
-	char l_substr[256];
-	strncpy(l_substr, substr, 255);
-	l_substr[255] = 0;
-	int i;
-	for (i = 0; i < (int)strlen(substr); i++) {
-		l_substr[i] = tolower(l_substr[i]);
-	}
-
-	char title[256];
-	HWND hWindow = GetForegroundWindow();
-	while (hWindow != NULL) {
-		int len = GetWindowText(hWindow, title, 256);
-		for (i = 0; i < len; i++) {
-			title[i] = tolower(title[i]);
-		}
-		DWORD style = GetWindowLongPtr(hWindow, GWL_STYLE);
-		if ((style & WS_VISIBLE) != 0 && strstr(title, l_substr) != NULL) {
-			if (IsIconic(hWindow))
-				SendMessage(hWindow, WM_SYSCOMMAND, SC_RESTORE, 0);
-			SetForegroundWindow(hWindow);
-			break;
-		}
-		hWindow = GetNextWindow(hWindow, GW_HWNDNEXT);
-	}
-	if (hWindow == NULL) {
-		MessageBox(NULL, "Unable to find a window with the specified title.",
-				   szAppName, MB_ICONEXCLAMATION | MB_OK);
-	}
-	return hWindow;
-}
-
-BOOL
-vncService::PostShareAll()
-{
-	// Post to the WinVNC menu window
-	if (!PostToWinVNC(MENU_SERVER_SHAREALL, 0, 0))
-	{
-		MessageBox(NULL, "No existing instance of WinVNC could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-BOOL
-vncService::PostSharePrimary()
-{
-	// Post to the WinVNC menu window
-	if (!PostToWinVNC(MENU_SERVER_SHAREPRIMARY, 0, 0))
-	{
-		MessageBox(NULL, "No existing instance of WinVNC could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-BOOL
-vncService::PostShareArea(unsigned short x, unsigned short y,
-						  unsigned short w, unsigned short h)
-{
-	// Post to the WinVNC menu window
-	if (!PostToWinVNC(MENU_SERVER_SHAREAREA,
-					  MAKEWPARAM(x,y), MAKELPARAM(w,h))) {
-		MessageBox(NULL, "No existing instance of WinVNC could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-BOOL
-vncService::PostShareWindow(HWND hwnd)
-{
-	// Post to the WinVNC menu window
-	if (!PostToWinVNC(MENU_SERVER_SHAREWINDOW, (WPARAM)hwnd, 0))
-	{
-		MessageBox(NULL, "No existing instance of WinVNC could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-// Static routine to show the Default Properties dialog for a currently-running
-// copy of WinVNC, (usually a servicified version.)
-
-BOOL
-vncService::ShowDefaultProperties()
-{
-	// Post to the WinVNC menu window
-	if (!PostToWinVNC(MENU_DEFAULT_PROPERTIES_SHOW, 0, 0))
-	{
-		MessageBox(NULL, "No existing instance of WinVNC could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-// Static routine to show the About dialog for a currently-running
-// copy of WinVNC, (usually a servicified version.)
-
-BOOL
-vncService::ShowAboutBox()
-{
-	// Post to the WinVNC menu window
-	if (!PostToWinVNC(MENU_ABOUTBOX_SHOW, 0, 0))
-	{
-		MessageBox(NULL, "No existing instance of WinVNC could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-// Static routine to tell a locally-running instance of the server
-// to connect out to a new client
-
-BOOL
-vncService::PostAddNewClient(unsigned long ipaddress, unsigned short port)
-{
-	// Post to the WinVNC menu window
-	if (!PostToWinVNC(MENU_ADD_CLIENT_MSG, (WPARAM)port, (LPARAM)ipaddress))
-	{
-		MessageBox(NULL, "No existing instance of WinVNC could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-// Static routine to tell a locally-running instance of the server
-// to disconnect all connected clients.
-
-BOOL
-vncService::KillAllClients()
-{
-	// Post to the WinVNC menu window
-	if (!PostToWinVNC(MENU_KILL_ALL_CLIENTS_MSG, 0, 0))
-	{
-		MessageBox(NULL, "No existing instance of WinVNC could be contacted", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-// SERVICE-MODE ROUTINES
-
-// Service-mode defines:
-
-// Executable name
-#define VNCAPPNAME            "winvnc"
-
-// Internal service name
-#define VNCSERVICENAME        "winvnc"
-
-// Displayed service name
-#define VNCSERVICEDISPLAYNAME "VNC Server"
-
-// List of other required services ("dependency 1\0dependency 2\0\0")
-// *** These need filling in properly
-#define VNCDEPENDENCIES       ""
-
-// Internal service state
-SERVICE_STATUS          g_srvstatus;       // current status of the service
-SERVICE_STATUS_HANDLE   g_hstatus;
-DWORD                   g_error = 0;
-DWORD			g_servicethread = (DWORD) NULL;
-char*                   g_errortext[256];
-
-// Forward defines of internal service functions
-void WINAPI ServiceMain(DWORD argc, char **argv);
-
-void ServiceWorkThread(void *arg);
-void ServiceStop();
-void WINAPI ServiceCtrl(DWORD ctrlcode);
-
-bool WINAPI CtrlHandler (DWORD ctrltype);
-
-BOOL ReportStatus(DWORD state, DWORD exitcode, DWORD waithint);
-
-// ROUTINE TO QUERY WHETHER THIS PROCESS IS RUNNING AS A SERVICE OR NOT
-
-BOOL	g_servicemode = FALSE;
-
-BOOL
-vncService::RunningAsService()
-{
-	return g_servicemode;
-}
-
-BOOL
-vncService::KillRunningCopy()
-{
-#if 0
-	// Locate the hidden WinVNC menu window
-	HWND hservwnd;
-
-	while ((hservwnd = FindWindow(MENU_CLASS_NAME, NULL)) != NULL)
-	{
-		// Post the message to WinVNC
-		PostMessage(hservwnd, WM_CLOSE, 0, 0);
-
-		omni_thread::sleep(1);
-	}
-#endif
-
-	return TRUE;
-}
-
-
-// ROUTINE TO POST THE HANDLE OF THE CURRENT USER TO THE RUNNING WINVNC, IN ORDER
-// THAT IT CAN LOAD THE APPROPRIATE SETTINGS.  THIS IS USED ONLY BY THE SVCHELPER
-// OPTION, WHEN RUNNING UNDER NT
-BOOL
-vncService::PostUserHelperMessage()
-{
-	// - Check the platform type
-	if (!IsWinNT())
-		return TRUE;
-
-	// - Get the current process ID
-	DWORD processId = GetCurrentProcessId();
-
-	// - Post it to the existing WinVNC
-	int retries = 6;
-	while (!PostToWinVNC(MENU_SERVICEHELPER_MSG, 0, (LPARAM)processId) && retries--)
-		omni_thread::sleep(10);
-
-	// - Wait until it's been used
-	omni_thread::sleep(5);
-
-	return retries;
-}
-
-BOOL
-vncService::PostReloadMessage()
-{
-	// - Check the platform type
-	if (!IsWinNT())
-		return TRUE;
-
-	// - Get the current process ID
-	DWORD processId = GetCurrentProcessId();
-
-	// - Post it to the existing WinVNC
-	// FIXME: Code duplication, see PostUserHelperMessage().
-	int retries = 6;
-	while (!PostToWinVNC(MENU_RELOAD_MSG, 0, (LPARAM)processId) && retries--)
-		omni_thread::sleep(10);
-
-	// - Wait until it's been used
-	omni_thread::sleep(5);
-
-	return retries;
-}
-
-
-// ROUTINE TO PROCESS AN INCOMING INSTANCE OF THE ABOVE MESSAGE
-BOOL
-vncService::ProcessUserHelperMessage(DWORD processId) {
-	// - Check the platform type
-	if (!IsWinNT() || !vncService::RunningAsService())
-		return TRUE;
-
-	// - Close the HKEY_CURRENT_USER key, to force NT to reload it for the new user
-	// NB: Note that this is _really_ dodgy if ANY other thread is accessing the key!
-	if (RegCloseKey(HKEY_CURRENT_USER) != ERROR_SUCCESS) {
-		vnclog.Print(LL_INTERR, VNCLOG("failed to close current registry hive\n"));
-		return FALSE;
-	}
-
-	// - Revert to our own identity
-	RevertToSelf();
-	g_impersonating_user = FALSE;
-	CloseHandle(g_impersonation_token);
-	g_impersonation_token = 0;
-
-	// - Open the specified process
-	HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, processId);
-	if (processHandle == NULL) {
-		vnclog.Print(LL_INTERR, VNCLOG("failed to open specified process, error=%d\n"),
-					 GetLastError());
-		return FALSE;
-	}
-
-	// - Get the token for the given process
-	HANDLE userToken = NULL;
-	if (!OpenProcessToken(processHandle, TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE, &userToken)) {
-		vnclog.Print(LL_INTERR, VNCLOG("failed to get user token, error=%d\n"),
-					 GetLastError());
-		CloseHandle(processHandle);
-		return FALSE;
-	}
-	CloseHandle(processHandle);
-
-	// - Set this thread to impersonate them
-	if (!ImpersonateLoggedOnUser(userToken)) {
-		vnclog.Print(LL_INTERR, VNCLOG("failed to impersonate user, error=%d\n"),
-					 GetLastError());
-		CloseHandle(userToken);
-		return FALSE;
-	}
-
-	g_impersonating_user = TRUE;
-	g_impersonation_token = userToken;
-	vnclog.Print(LL_INTINFO, VNCLOG("impersonating logged on user\n"));
-	return TRUE;
-}
-
-bool vncService::tryImpersonate()
-{
-	if (!IsWinNT() || !vncService::RunningAsService())
-		return true;
-
-	if (!g_impersonating_user) {
-		vnclog.Print(LL_INTERR, VNCLOG("impersonation failure, user unknown\n"));
-		return false;
-	}
-	if (!ImpersonateLoggedOnUser(g_impersonation_token)) {
-		vnclog.Print(LL_INTERR, VNCLOG("user impersonation failure, error=%d\n"),
-					 GetLastError());
-		return false;
-	}
-
-	vnclog.Print(LL_INTINFO, VNCLOG("impersonated logged on user\n"));
-	return true;
-}
-
-void vncService::undoImpersonate()
-{
-	RevertToSelf();
-	vnclog.Print(LL_INTINFO, VNCLOG("reverted impersonation\n"));
-}
-
-// SERVICE MAIN ROUTINE
-int
-vncService::WinVNCServiceMain()
-{
-	typedef DWORD (WINAPI * RegisterServiceProc)(DWORD, DWORD);
-	const ULONG RSP_SIMPLE_SERVICE = 0x00000001;
-	const ULONG RSP_UNREGISTER_SERVICE = 0x00000000;
-
-	g_servicemode = TRUE;
-
-	// How to run as a service depends upon the OS being used
-	switch (g_platform_id)
-	{
-
-		// Windows 95/98
-	case VER_PLATFORM_WIN32_WINDOWS:
-		{
-			// Obtain a handle to the kernel library
-			HINSTANCE kerneldll = LoadLibrary("KERNEL32.DLL");
-			if (kerneldll == NULL)
-				break;
-
-			// And find the RegisterServiceProcess function
-			RegisterServiceProc RegisterService;
-			RegisterService = (RegisterServiceProc) GetProcAddress(kerneldll, "RegisterServiceProcess");
-			if (RegisterService == NULL)
-				break;
-
-			// Register this process with the OS as a service!
-			RegisterService(NULL, RSP_SIMPLE_SERVICE);
-
-			// Run the service itself
-			WinVNCAppMain();
-
-			// Then remove the service from the system service table
-			RegisterService(NULL, RSP_UNREGISTER_SERVICE);
-
-			// Free the kernel library
-			FreeLibrary(kerneldll);
-
-			// *** If we don't kill the process directly here, then 
-			// for some reason, WinVNC crashes...
-			// *** Is this now fixed (with the stdcall patch above)?
-			//ExitProcess(0);
-		}
-		break;
-
-		// Windows NT
-	case VER_PLATFORM_WIN32_NT:
-		{
-			// Create a service entry table
-			SERVICE_TABLE_ENTRY dispatchTable[] =
-		    {
-				{VNCSERVICENAME, (LPSERVICE_MAIN_FUNCTION)ServiceMain},
-				{NULL, NULL}
-			};
-
-			// Call the service control dispatcher with our entry table
-			if (!StartServiceCtrlDispatcher(dispatchTable))
-				LogErrorMsg("StartServiceCtrlDispatcher failed.");
-		}
-		break;
-
-	};
-
-	return 0;
-}
-
-// SERVICE MAIN ROUTINE
-void WINAPI ServiceMain(DWORD argc, char**argv)
-{
-	// Register the service control handler
-    g_hstatus = RegisterServiceCtrlHandler(VNCSERVICENAME, ServiceCtrl);
-
-    if (g_hstatus == 0)
-		return;
-
-	// Set up some standard service state values
-    g_srvstatus.dwServiceType = SERVICE_WIN32 | SERVICE_INTERACTIVE_PROCESS;
-    g_srvstatus.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,
-			g_error,
-            0);
-		return;
-	}
-
-	// Now start the service for real
-    omni_thread *workthread = omni_thread::create(ServiceWorkThread);
-    return;
-}
-
-// SERVICE START ROUTINE - thread that calls WinVNCAppMain
-void ServiceWorkThread(void *arg)
-{
-	// Save the current thread identifier
-	g_servicethread = GetCurrentThreadId();
-
-    // report the status to the service control manager.
-    //
-    if (!ReportStatus(
-        SERVICE_RUNNING,       // service state
-        NO_ERROR,              // exit code
-        0))                    // wait hint
-		return;
-
-	// RUN!
-	WinVNCAppMain();
-
-	// Mark that we're no longer running
-	g_servicethread = NULL;
-
-	// Tell the service manager that we've stopped.
-    ReportStatus(
-		SERVICE_STOPPED,
-		g_error,
-		0);
-}
-
-// SERVICE STOP ROUTINE - post a quit message to the relevant thread
-void ServiceStop()
-{
-	// Post a quit message to the main service thread
-	if (g_servicethread != NULL)
-	{
-		vnclog.Print(LL_INTINFO, VNCLOG("quitting from ServiceStop\n"));
-		PostThreadMessage(g_servicethread, WM_QUIT, 0, 0);
-	}
-}
-
-// SERVICE INSTALL ROUTINE
-int
-vncService::ReinstallService(BOOL silent) {
-	RemoveService(1);
-	InstallService(silent);
-	return 0;
-}
-
-int
-vncService::InstallService(BOOL silent)
-{
-	const int pathlength = 2048;
-	char path[pathlength];
-	char servicecmd[pathlength];
-
-	// Get the filename of this executable
-    if (GetModuleFileName(NULL, path, pathlength-(strlen(winvncRunService)+2)) == 0) {
-		if (!silent) {
-			MessageBox(NULL, "Unable to install WinVNC service", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		}
-		return 0;
-    }
-
-	// Append the service-start flag to the end of the path:
-	if ((int)(strlen(path) + 4 + strlen(winvncRunService)) < pathlength)
-		sprintf(servicecmd, "\"%s\" %s", path, winvncRunService);
-	else
-		return 0;
-
-	// How to add the WinVNC service depends upon the OS
-	switch (g_platform_id)
-	{
-
-		// Windows 95/98
-	case VER_PLATFORM_WIN32_WINDOWS:
-		{
-			// Locate the RunService registry entry
-			HKEY runservices;
-			if (RegCreateKey(HKEY_LOCAL_MACHINE, 
-				"Software\\Microsoft\\Windows\\CurrentVersion\\RunServices",
-				&runservices) != ERROR_SUCCESS)
-			{
-				if (!silent) {
-					MessageBox(NULL, "The SCM could not be contacted - the WinVNC service was not installed", szAppName, MB_ICONEXCLAMATION | MB_OK);
-				}
-				break;
-			}
-
-			// Attempt to add a WinVNC key
-			if (RegSetValueEx(runservices, szAppName, 0, REG_SZ, (unsigned char *)servicecmd, strlen(servicecmd)+1) != ERROR_SUCCESS)
-			{
-				RegCloseKey(runservices);
-				if (!silent) {
-					MessageBox(NULL, "The WinVNC service could not be registered", szAppName, MB_ICONEXCLAMATION | MB_OK);
-				}
-				break;
-			}
-
-			RegCloseKey(runservices);
-
-			// We have successfully installed the service!
-			if (!silent) {
-				vncTimedMsgBox::Do(
-					"The WinVNC service was successfully installed\n"
-					"The service will start now and will automatically\n"
-					"be run the next time this machine is reset",
-					szAppName,
-					MB_ICONINFORMATION | MB_OK);
-			}
-
-			// Run the service...
-			STARTUPINFO si;
-			si.cb = sizeof(si);
-			si.cbReserved2 = 0;
-			si.lpReserved = NULL;
-			si.lpReserved2 = NULL;
-			si.dwFlags = 0;
-			si.lpTitle = NULL;
-			PROCESS_INFORMATION pi;
-			if (!CreateProcess(
-				NULL, servicecmd,							// Program name & path
-				NULL, NULL,									// Security attributes
-				FALSE,										// Inherit handles?
-				NORMAL_PRIORITY_CLASS,						// Extra startup flags
-				NULL,										// Environment table
-				NULL,										// Current directory
-				&si,
-				&pi
-				))
-			{
-				if (!silent) {
-					MessageBox(NULL, "The WinVNC service failed to start",
-							   szAppName, MB_ICONSTOP | MB_OK);
-				}
-				break;
-			}
-		}
-		break;
-
-		// Windows NT
-	case VER_PLATFORM_WIN32_NT:
-		{
-			SC_HANDLE   hservice;
-		    SC_HANDLE   hsrvmanager;
-
-			// Open the default, local Service Control Manager database
-		    hsrvmanager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
-			if (hsrvmanager == NULL)
-			{
-				if (!silent) {
-					MessageBox(NULL,
-						"The Service Control Manager could not be contacted - the WinVNC service was not registered",
-						szAppName,
-						MB_ICONEXCLAMATION | MB_OK);
-				}
-				break;
-			}
-
-			// Create an entry for the WinVNC service
-			hservice = CreateService(
-				hsrvmanager,				// SCManager database
-				VNCSERVICENAME,				// name of service
-				VNCSERVICEDISPLAYNAME,		// 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
-				VNCDEPENDENCIES,			// dependencies
-				NULL,						// LocalSystem account
-				NULL);						// no password
-			if (hservice == NULL)
-			{
-				DWORD error = GetLastError();
-				if (!silent) {
-					if (error == ERROR_SERVICE_EXISTS) {
-						MessageBox(NULL,
-							"The WinVNC service is already registered",
-							szAppName,
-							MB_ICONEXCLAMATION | MB_OK);
-					} else {
-						MessageBox(NULL,
-							"The WinVNC service could not be registered",
-							szAppName,
-							MB_ICONEXCLAMATION | MB_OK);
-					}
-				}
- 				CloseServiceHandle(hsrvmanager);
-				break;
-			}
-			CloseServiceHandle(hsrvmanager);
-			CloseServiceHandle(hservice);
-
-			// Now install the servicehelper registry setting...
-			// Locate the RunService registry entry
-			HKEY runapps;
-			if (RegCreateKey(HKEY_LOCAL_MACHINE, 
-				"Software\\Microsoft\\Windows\\CurrentVersion\\Run",
-				&runapps) != ERROR_SUCCESS)
-			{
-				if (!silent) {
-					MessageBox(NULL, "WARNING:Unable to install the ServiceHelper hook\nGlobal user-specific registry settings will not be loaded", szAppName, MB_ICONEXCLAMATION | MB_OK);
-				}
-			} else {
-				char servicehelpercmd[pathlength];
-
-				// Append the service-helper-start flag to the end of the path:
-				if ((int)(strlen(path) + 4 + strlen(winvncRunServiceHelper)) < pathlength)
-					sprintf(servicehelpercmd, "\"%s\" %s", path, winvncRunServiceHelper);
-				else
-					return 0;
-
-				// Add the VNCserviceHelper entry
-				if (RegSetValueEx(runapps, szAppName, 0, REG_SZ,
-					(unsigned char *)servicehelpercmd, strlen(servicehelpercmd)+1) != ERROR_SUCCESS)
-				{
-					if (!silent) {
-						MessageBox(NULL, "WARNING:Unable to install the ServiceHelper hook\nGlobal user-specific registry settings will not be loaded", szAppName, MB_ICONEXCLAMATION | MB_OK);
-					}
-				}
-				RegCloseKey(runapps);
-			}
-
-			// Everything went fine
-			if (!silent) {
-				vncTimedMsgBox::Do(
-					"The WinVNC service was successfully registered\n"
-					"The service may be started from the Control Panel, and will\n"
-					"automatically be run the next time this machine is reset",
-					szAppName,
-					MB_ICONINFORMATION | MB_OK);
-			}
-		}
-		break;
-	};
-
-	return 0;
-}
-
-// SERVICE REMOVE ROUTINE
-int
-vncService::RemoveService(BOOL silent)
-{
-	// How to remove the WinVNC service depends upon the OS
-	switch (g_platform_id)
-	{
-
-		// Windows 95/98
-	case VER_PLATFORM_WIN32_WINDOWS:
-		{
-			// Locate the RunService registry entry
-			HKEY runservices;
-			if (RegOpenKey(HKEY_LOCAL_MACHINE, 
-				"Software\\Microsoft\\Windows\\CurrentVersion\\RunServices",
-				&runservices) != ERROR_SUCCESS)
-			{
-				if (!silent) {
-					MessageBox(NULL, "The Service Control Manager could not be contacted - the WinVNC service was not unregistered", szAppName, MB_ICONEXCLAMATION | MB_OK);
-				}
-			}
-			else
-			{
-				// Attempt to delete the WinVNC key
-				if (RegDeleteValue(runservices, szAppName) != ERROR_SUCCESS)
-				{
-					RegCloseKey(runservices);
-					if (!silent) {
-						MessageBox(NULL, "The WinVNC service could not be unregistered", szAppName, MB_ICONEXCLAMATION | MB_OK);
-					}
-				}
-
-				RegCloseKey(runservices);
-				break;
-			}
-
-			// Try to kill any running copy of WinVNC
-			if (!KillRunningCopy())
-			{
-				if (!silent) {
-					MessageBox(NULL,
-						"The WinVNC service could not be contacted",
-						szAppName,
-						MB_ICONEXCLAMATION | MB_OK);
-				}
-				break;
-			}
-
-			// We have successfully removed the service!
-			if (!silent) {
-				vncTimedMsgBox::Do("The WinVNC service has been unregistered", szAppName, MB_ICONINFORMATION | MB_OK);
-			}
-		}
-		break;
-
-		// Windows NT
-	case VER_PLATFORM_WIN32_NT:
-		{
-			SC_HANDLE   hservice;
-			SC_HANDLE   hsrvmanager;
-
-			// Attempt to remove the service-helper hook
-			HKEY runapps;
-			if (RegOpenKey(HKEY_LOCAL_MACHINE, 
-				"Software\\Microsoft\\Windows\\CurrentVersion\\Run",
-				&runapps) == ERROR_SUCCESS)
-			{
-				// Attempt to delete the WinVNC key
-				if (RegDeleteValue(runapps, szAppName) != ERROR_SUCCESS)
-				{
-					if (!silent) {
-						MessageBox(NULL, "WARNING:The ServiceHelper hook entry could not be removed from the registry", szAppName, MB_ICONEXCLAMATION | MB_OK);
-					}
-				}
-				RegCloseKey(runapps);
-			}
-
-			// Open the SCM
-		    hsrvmanager = OpenSCManager(
-                        NULL,                   // machine (NULL == local)
-                        NULL,                   // database (NULL == default)
-                        SC_MANAGER_ALL_ACCESS   // access required
-                        );
-		    if (hsrvmanager)
-		    {
-		        hservice = OpenService(hsrvmanager, VNCSERVICENAME, SERVICE_ALL_ACCESS);
-
-				if (hservice != NULL)
-				{
-					SERVICE_STATUS status;
-
-					// Try to stop the WinVNC 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) {
-							if (!silent) {
-								MessageBox(NULL, "The WinVNC service could not be stopped", szAppName, MB_ICONEXCLAMATION | MB_OK);
-							}
-						}
-					}
-
-					// Now remove the service from the SCM
-					if (DeleteService(hservice)) {
-						if (!silent) {
-							vncTimedMsgBox::Do("The WinVNC service has been unregistered", szAppName, MB_ICONINFORMATION | MB_OK);
-						}
-					} else {
-						DWORD error = GetLastError();
-						if (error == ERROR_SERVICE_MARKED_FOR_DELETE) {
-							if (!silent)
-								MessageBox(NULL, "The WinVNC service is already marked to be unregistered", szAppName, MB_ICONEXCLAMATION | MB_OK);
-						} else {
-							if (!silent)
-								MessageBox(NULL, "The WinVNC service could not be unregistered", szAppName, MB_ICONEXCLAMATION | MB_OK);
-						}
-					}
-					CloseServiceHandle(hservice);
-				}
-				else if (!silent)
-					MessageBox(NULL, "The WinVNC service could not be found", szAppName, MB_ICONEXCLAMATION | MB_OK);
-
-				CloseServiceHandle(hsrvmanager);
-			}
-			else if (!silent)
-				MessageBox(NULL, "The Service Control Manager could not be contacted - the WinVNC service was not unregistered", szAppName, MB_ICONEXCLAMATION | MB_OK);
-		}
-		break;
-	};
-	return 0;
-}
-
-// USEFUL SERVICE SUPPORT ROUTINES
-
-// Service control routine
-void WINAPI ServiceCtrl(DWORD ctrlcode)
-{
-	// What control code have we been sent?
-    switch(ctrlcode)
-    {
-
-	case SERVICE_CONTROL_STOP:
-		// STOP : The service must stop
-		g_srvstatus.dwCurrentState = SERVICE_STOP_PENDING;
-        ServiceStop();
-        break;
-
-    case SERVICE_CONTROL_INTERROGATE:
-		// QUERY : Service control manager just wants to know our state
-		break;
-
-	default:
-		// Control code not recognised
-		break;
-
-    }
-
-	// Tell the control manager what we're up to.
-    ReportStatus(g_srvstatus.dwCurrentState, NO_ERROR, 0);
-}
-
-// Service manager status reporting
-BOOL 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)
-		g_srvstatus.dwControlsAccepted = 0;
-	else
-		g_srvstatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
-
-	// Save the new status we've been given
-	g_srvstatus.dwCurrentState = state;
-	g_srvstatus.dwWin32ExitCode = exitcode;
-	g_srvstatus.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))
-		g_srvstatus.dwCheckPoint = 0;
-	else
-        g_srvstatus.dwCheckPoint = checkpoint++;
-
-	// Tell the SCM our new status
-	if (!(result = SetServiceStatus(g_hstatus, &g_srvstatus)))
-		LogErrorMsg("SetServiceStatus failed");
-
-    return result;
-}
-
-// Error reporting
-void LogErrorMsg(char *message)
-{
-    char	msgbuff[256];
-    HANDLE	heventsrc;
-    char *	strings[2];
-
-	// Save the error code
-	g_error = GetLastError();
-
-	// Use event logging to log the error
-    heventsrc = RegisterEventSource(NULL, VNCSERVICENAME);
-
-	sprintf(msgbuff, "%.200s error: %d", VNCSERVICENAME, (int) g_error);
-    strings[0] = msgbuff;
-    strings[1] = message;
-
-	if (heventsrc != NULL)
-	{
-		MessageBeep(MB_OK);
-
-		ReportEvent(
-			heventsrc,				// handle of event source
-			EVENTLOG_ERROR_TYPE,	// event type
-			0,						// event category
-			0,						// event ID
-			NULL,					// current user's SID
-			2,						// strings in 'strings'
-			0,						// no bytes of raw data
-			(const char **)strings,	// array of error strings
-			NULL);					// no raw data
-
-		DeregisterEventSource(heventsrc);
-	}
-}
diff --git a/ica/win32/src/vncService.h b/ica/win32/src/vncService.h
deleted file mode 100644
index 19226c3..0000000
--- a/ica/win32/src/vncService.h
+++ /dev/null
@@ -1,149 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//  Copyright (C) 2009 GlavSoft LLC. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncService
-
-// SERVICE-MODE CODE
-
-// This class provides access to service-oriented routines, under both
-// Windows NT and Windows 95.  Some routines only operate under one
-// OS, others operate under any OS.
-
-class vncService;
-
-#if (!defined(_WINVNC_VNCSERVICE))
-#define _WINVNC_VNCSERVICE
-
-#include "stdhdrs.h"
-
-BOOL PostToWinVNC(UINT message, WPARAM wParam, LPARAM lParam);
-
-// The NT-specific code wrapper class
-class vncService
-{
-public:
-	vncService();
-	~vncService();
-
-	// SERVICE INSTALL & START FUNCTIONS
-
-	// Routine called by WinMain to cause WinVNC to be installed
-	// as a service.
-	static int WinVNCServiceMain();
-
-	// Routine to install the WinVNC service on the local machine
-	static int InstallService(BOOL silent=0);
-	static int ReinstallService(BOOL silent=0);
-
-	// Routine to remove the WinVNC service from the local machine
-	static int RemoveService(BOOL silent=0);
-
-	// SERVICE SUPPORT FUNCTIONS
-
-	// Routine to establish and return the currently logged in user name
-	static BOOL GetCurrentUser(char *buffer, UINT size);
-	static BOOL CurrentUser(char *buffer, UINT size);
-
-	// Routine to post a message to the currently running WinVNC server
-	// to pass it a handle to the current user
-	static BOOL PostUserHelperMessage();
-	static BOOL PostReloadMessage();
-	// Routine to process a user helper message
-	static BOOL ProcessUserHelperMessage(DWORD processId);
-
-	// Impersonate current user in an arbitrary thread. This function assumes
-	// that ProcessUserHelperMessage() was called when user logged on.
-	static bool tryImpersonate();
-	// Revert to self after successful tryImpersonate().
-	static void undoImpersonate();
-
-	// Routines to establish which OS we're running on
-	static BOOL IsWin95();
-	static BOOL IsWinNT();
-	static DWORD VersionMajor();
-	static DWORD VersionMinor();
-
-	// Routine to establish whether the current instance is running
-	// as a service or not
-	static BOOL RunningAsService();
-
-	// Routine to kill any other running copy of WinVNC
-	static BOOL KillRunningCopy();
-
-	// Routine to set the current thread into the given desktop
-	static BOOL SelectHDESK(HDESK newdesktop);
-
-	// Routine to set the current thread into the named desktop,
-	// or the input desktop if no name is given
-	static BOOL SelectDesktop(char *name);
-
-	// Routine to establish whether the current thread desktop is the
-	// current user input one
-	static BOOL InputDesktopSelected();
-
-	// Routine to fake a CtrlAltDel to winlogon when required.
-	// *** This is a nasty little hack...
-	static BOOL SimulateCtrlAltDel();
-
-	// Routine to lock the workstation.  Returns TRUE if successful.
-	// Main cause of failure will be when locking is not supported
-	static BOOL LockWorkstation();
-
-	// Routine to make any currently running version of WinVNC show its
-	// Properties dialog, to allow the user to make changes to their settings
-	static BOOL ShowProperties();
-
-	static BOOL PostShareAll();
-	static BOOL PostSharePrimary();
-	static BOOL PostShareArea(unsigned short x, unsigned short y,
-							  unsigned short w, unsigned short h);
-	static BOOL PostShareWindow(HWND hwnd);
-	static HWND FindWindowByTitle(char *substr);
-
-	// Routine to make any currently running version of WinVNC show the
-	// Properties dialog for the default settings, so the user can make changes
-	static BOOL ShowDefaultProperties();
-
-	// Routine to make the an already running copy of WinVNC bring up its
-	// About box so you can check the version!
-	static BOOL ShowAboutBox();
-
-#ifdef HORIZONLIVE
-	static void SetNoSettings(bool flag);
-	static BOOL GetNoSettings();
-#endif
-
-	// Routine to make an already running copy of WinVNC form an outgoing
-	// connection to a new VNC client
-	static BOOL PostAddNewClient(unsigned long ipaddress, unsigned short port);
-
-	// Routine to make an already running copy of WinVNC disconnect all
-	// connected clients
-	static BOOL KillAllClients();
-};
-
-#endif
diff --git a/ica/win32/src/vncSockConnect.cpp b/ica/win32/src/vncSockConnect.cpp
deleted file mode 100644
index 5d5eb87..0000000
--- a/ica/win32/src/vncSockConnect.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncSockConnect.cpp
-
-// Implementation of the listening socket class
-
-#include "stdhdrs.h"
-#include "VSocket.h"
-#include "vncSockConnect.h"
-#include "vncServer.h"
-#include <omnithread.h>
-
-// The function for the spawned thread to run
-class vncSockConnectThread : public omni_thread
-{
-public:
-	// Init routine
-	virtual BOOL Init(VSocket *socket, vncServer *server);
-
-	// Code to be executed by the thread
-	virtual void *run_undetached(void * arg);
-
-	// Fields used internally
-	BOOL		m_shutdown;
-protected:
-	VSocket		*m_socket;
-	vncServer	*m_server;
-};
-
-// Method implementations
-BOOL vncSockConnectThread::Init(VSocket *socket, vncServer *server)
-{
-	// Save the server pointer
-	m_server = server;
-
-	// Save the socket pointer
-	m_socket = socket;
-
-	// Start the thread
-	m_shutdown = FALSE;
-	start_undetached();
-
-	return TRUE;
-}
-
-// Code to be executed by the thread
-void *vncSockConnectThread::run_undetached(void * arg)
-{
-	vnclog.Print(LL_STATE, VNCLOG("started socket connection thread\n"));
-
-	// Go into a loop, listening for connections on the given socket
-	while (!m_shutdown) {
-		// Accept an incoming connection
-		VSocket *new_socket;
-		if (!m_socket->TryAccept(&new_socket, 100))
-			break;
-		if (new_socket != NULL) {
-			vnclog.Print(LL_CLIENTS, VNCLOG("accepted connection from %s\n"),
-						 new_socket->GetPeerName());
-			// Successful accept - start the client unauthenticated
-			m_server->AddClient(new_socket, FALSE, FALSE);
-		}
-	}
-
-	vnclog.Print(LL_STATE, VNCLOG("quitting socket connection thread\n"));
-	return NULL;
-}
-
-// The vncSockConnect class implementation
-
-vncSockConnect::vncSockConnect()
-{
-	m_thread = NULL;
-}
-
-vncSockConnect::~vncSockConnect()
-{
-    m_socket.Shutdown();
-
-    // Join with our lovely thread
-    if (m_thread != NULL) {
-		((vncSockConnectThread *)m_thread)->m_shutdown = TRUE;
-
-		void *returnval;
-		m_thread->join(&returnval);
-		m_thread = NULL;
-
-		m_socket.Close();
-    }
-}
-
-BOOL vncSockConnect::Init(vncServer *server, UINT port)
-{
-	// Save the port id
-	m_port = port;
-
-	// Create the listening socket
-	if (!m_socket.Create())
-		return FALSE;
-
-	// Bind it
-	if (!m_socket.Bind(m_port, server->LoopbackOnly()))
-		return FALSE;
-
-	// Set it to listen
-	if (!m_socket.Listen())
-		return FALSE;
-
-	// Create the new thread
-	m_thread = new vncSockConnectThread;
-	if (m_thread == NULL)
-		return FALSE;
-
-	// And start it running
-	return ((vncSockConnectThread *)m_thread)->Init(&m_socket, server);
-}
-
diff --git a/ica/win32/src/vncSockConnect.h b/ica/win32/src/vncSockConnect.h
deleted file mode 100644
index 00102ad..0000000
--- a/ica/win32/src/vncSockConnect.h
+++ /dev/null
@@ -1,69 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-
-// vncSockConnect.h
-
-// The vncSockConnect class creates a listening socket and binds
-// it to the specified port.  It then creates a listen thread which
-// goes into a loop, listening on the socket.
-// When the vncSockConnect object is destroyed, all resources are
-// freed automatically, including the listen thread.
-
-class vncSockConnect;
-
-#if (!defined(_WINVNC_VNCSOCKCONNECT))
-#define _WINVNC_VNCSOCKCONNECT
-
-// Includes
-#include "stdhdrs.h"
-#include "VSocket.h"
-#include "vncServer.h"
-#include <omnithread.h>
-
-// The vncSockConnect class itself
-class vncSockConnect
-{
-public:
-	// Constructor/destructor
-	vncSockConnect();
-	virtual ~vncSockConnect();
-
-	// Init
-	virtual VBool Init(vncServer *server, UINT port);
-
-	// Implementation
-protected:
-	// The listening socket
-	VSocket m_socket;
-
-	// The port to listen on
-	UINT m_port;
-
-	// The in-coming accept thread
-	omni_thread *m_thread;
-};
-
-#endif // _WINVNC_VNCSOCKCONNECT
diff --git a/ica/win32/src/vncTimedMsgBox.h b/ica/win32/src/vncTimedMsgBox.h
deleted file mode 100644
index 4acfa24..0000000
--- a/ica/win32/src/vncTimedMsgBox.h
+++ /dev/null
@@ -1,44 +0,0 @@
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-
-// vncTimedMsgBox
-
-// Static class used to generate message boxes which allow the program's
-// execution to continue after a set delay (4 seconds at present)
-
-class vncTimedMsgBox;
-
-#if(!defined(_WINVNC_VNCTIMEDMSGBOX))
-#define _WINVNC_VNCTIMEDMSGBOX
-
-class vncTimedMsgBox
-{
-public:
-	// Bring up a message box, wait for two seconds, then return
-	static inline void Do(const char *, const char *, UINT ) { }
-};
-
-#endif
-
diff --git a/ica/win32/src/vncauth.h b/ica/win32/src/vncauth.h
deleted file mode 100644
index 8f97130..0000000
--- a/ica/win32/src/vncauth.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#if 0
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-#endif
-
-
-/* 
- * vncauth.h - describes the functions provided by the vncauth library.
- */
-
-#define MAXPWLEN 8
-#define CHALLENGESIZE 16
-
-extern int vncEncryptPasswd(char *passwd, char *fname);
-extern char *vncDecryptPasswd(char *fname);
-extern void vncRandomBytes(unsigned char *bytes);
-extern void vncEncryptBytes(unsigned char *bytes, const char *passwd);
diff --git a/ica/win32/src/vncauth_w32.c b/ica/win32/src/vncauth_w32.c
deleted file mode 100644
index dce30fe..0000000
--- a/ica/win32/src/vncauth_w32.c
+++ /dev/null
@@ -1,134 +0,0 @@
-#if 0
-//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
-//
-//  This file is part of the VNC system.
-//
-//  The VNC system is free software; you can redistribute it and/or modify
-//  it under the terms of the 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.
-//
-// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
-//
-// If the source code for the VNC system is not available from the place 
-// whence you received this file, check http://www.uk.research.att.com/vnc or contact
-// the authors on vnc at uk.research.att.com for information on obtaining it.
-#endif
-
-
-/*
- *  Functions for VNC password management and authentication.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "vncauth.h"
-#include "d3des.h"
-
-/*
- *   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 s_fixedkey[8] = {23,82,107,6,35,78,88,7};
-
-/*
- *   Encrypt a password and store it in a file.
- */
-int
-vncEncryptPasswd(char *passwd, char *encryptedPasswd)
-{
-    int i;
-
-    /* pad password with nulls */
-
-    for (i = 0; i < MAXPWLEN; i++) {
-	if (i < (int)strlen(passwd)) {
-	    encryptedPasswd[i] = passwd[i];
-	} else {
-	    encryptedPasswd[i] = 0;
-	}
-    }
-
-    /* Do encryption in-place - this way we overwrite our copy of the plaintext
-       password */
-
-    deskey(s_fixedkey, EN0);
-    des(encryptedPasswd, encryptedPasswd);
-
-    return 8;
-}
-
-/*
- *   Decrypt a password.  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 *
-vncDecryptPasswd(char *inouttext)
-{
-    unsigned char *passwd = (unsigned char *)malloc(9);
-
-    deskey(s_fixedkey, DE1);
-    des(inouttext, passwd);
-
-    passwd[8] = 0;
-
-    return (char *)passwd;
-}
-
-/*
- *   Generate a set of random bytes for use in challenge-response authentication.
- */
-void
-vncRandomBytes(unsigned char *where) {
-  int i;
-  unsigned int seed = (unsigned int) time(0);
-
-  srand(seed);
-  for (i=0; i < CHALLENGESIZE; i++) {
-    where[i] = (unsigned char)(rand() & 255);    
-  }
-}
-
-/*
- *   Encrypt some bytes in memory using a password.
- */
-void
-vncEncryptBytes(unsigned char *where, const char *passwd)
-{
-    unsigned char key[8];
-    int i;
-
-    /* key is simply password padded with nulls */
-
-    for (i = 0; i < 8; i++) {
-	if (i < (int)strlen(passwd)) {
-	    key[i] = passwd[i];
-	} else {
-	    key[i] = 0;
-	}
-    }
-
-    deskey(key, EN0);
-
-    for (i = 0; i < CHALLENGESIZE; i += 8) {
-	des(where+i, where+i);
-    }
-}
diff --git a/ica/win32/ultravnc-italc.cpp b/ica/win32/ultravnc-italc.cpp
new file mode 100644
index 0000000..4538733
--- /dev/null
+++ b/ica/win32/ultravnc-italc.cpp
@@ -0,0 +1,112 @@
+#include <windows.h>
+
+#include <QtCore/QSettings>
+
+#include "DesktopAccessPermission.h"
+#include "ItalcCore.h"
+#include "ItalcCoreServer.h"
+#include "ItalcConfiguration.h"
+#include "Configuration/LocalStore.h"
+
+static QSettings *__italcSettings = NULL;
+
+
+BOOL ultravnc_italc_load_int( LPCSTR valname, LONG *out )
+{
+	if( strcmp( valname, "LocalConnectOnly" ) == 0 )
+	{
+		if( __italcSettings == NULL )
+		{
+			__italcSettings = Configuration::LocalStore( Configuration::Store::System ).createSettingsObject();
+			__italcSettings->beginGroup( "Network" );
+		}
+
+		*out = __italcSettings->value( valname ).toInt();
+		return true;
+	}
+	if( strcmp( valname, "DisableTrayIcon" ) == 0 )
+	{
+		*out = 1;
+		return true;
+	}
+	if( strcmp( valname, "AuthRequired" ) == 0 )
+	{
+		*out = 1;
+		return true;
+	}
+	if( strcmp( valname, "CaptureAlphaBlending" ) == 0 )
+	{
+		*out = ItalcCore::config->vncCaptureLayeredWindows() ? 1 : 0;
+		return true;
+	}
+	if( strcmp( valname, "PollFullScreen" ) == 0 )
+	{
+		*out = ItalcCore::config->vncPollFullScreen() ? 1 : 0;
+		return true;
+	}
+	if( strcmp( valname, "TurboMode" ) == 0 )
+	{
+		*out = ItalcCore::config->vncLowAccuracy() ? 1 : 0;
+		return true;
+	}
+	if( strcmp( valname, "NewMSLogon" ) == 0 )
+	{
+		*out = 1;
+		return true;
+	}
+	if( strcmp( valname, "MSLogonRequired" ) == 0 )
+	{
+		*out = ItalcCore::config->isLogonAuthenticationEnabled() ? 1 : 0;
+		return true;
+	}
+	if( strcmp( valname, "RemoveWallpaper" ) == 0 )
+	{
+		*out = 0;
+		return true;
+	}
+	if( strcmp( valname, "FileTransferEnabled" ) == 0 )
+	{
+		*out = 0;
+		return true;
+	}
+	if( strcmp( valname, "AllowLoopback" ) == 0 )
+	{
+		*out = 1;
+		return true;
+	}
+	if( strcmp( valname, "AutoPortSelect" ) == 0 )
+	{
+		*out = 0;
+		return true;
+	}
+
+	if( strcmp( valname, "HTTPConnect" ) == 0 )
+	{
+		*out = ItalcCore::config->isHttpServerEnabled() ? 1 : 0;
+		return true;
+	}
+
+	if( strcmp( valname, "PortNumber" ) == 0 )
+	{
+		*out = ItalcCore::config->coreServerPort();
+		return true;
+	}
+
+	if( strcmp( valname, "HTTPPortNumber" ) == 0 )
+	{
+		*out = ItalcCore::config->httpServerPort();
+		return true;
+	}
+
+	return false;
+}
+
+
+BOOL ultravnc_italc_ask_permission( const char *username, const char *host )
+{
+	return DesktopAccessPermission(
+				DesktopAccessPermission::LogonAuthentication ).
+														ask( username, host );
+}
+
+
diff --git a/ica/win32/ultravnc.cpp b/ica/win32/ultravnc.cpp
new file mode 100644
index 0000000..d9d55a1
--- /dev/null
+++ b/ica/win32/ultravnc.cpp
@@ -0,0 +1,236 @@
+#include <algorithm>
+
+#include "stdhdrs.h"
+#include "ItalcRfbExt.h"
+#include "ItalcCoreServer.h"
+#include "vsocket.cpp"
+
+// adzm 2010-09
+typedef enum {
+	clientInitShared       = 0x01,
+} rfbClientInitMsgFlags;
+
+/*-----------------------------------------------------------------------------
+ * 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:
+ */
+
+// adzm 2010-09
+/*
+ pre-RFB 3.8 -- rfbUltraVNC_SecureVNCPlugin extension
+
+ If using SecureVNCPlugin (or any plugin that uses the integrated plugin architecture) the unofficial 1.0.8.2 version sends
+ the auth type rfbUltraVNC_SecureVNCPlugin.
+
+ The intention of this auth type is to act as a 'master' and once complete, allow other authentication types to occur
+ over the now-encrypted communication channel.
+
+ So, server sends 32-bit network order int for rfbUltraVNC_SecureVNCPlugin and the loop begins:
+   server sends 16-bit little-endian challenge length, followed by the challenge
+   viewer responds with 16-bit little-endian response length, followed by the response
+   this continues until the plugin says to stop the loop. Currently the SecureVNC plugin only
+     does one loop, but this functionality exists in order to implement more complicated handshakes.
+ 
+ If there was a failure, and an error message is available, rfbVncAuthFailedEx (3) is sent followed by the length of the
+   error string and then the error string
+ If there was a failure, and no error message is available, simply send rfbVncAuthFailed (1)
+ otherwise, if using mslogon, send rfbMsLogon, and if not using mslogon, send rfbVncAuthOK(0)
+
+ at this point the handshake is 'complete' and all further communication is encrypted.
+
+ if using mslogon, mslogon authentication will now occur (since the rfbMsLogon packet was sent)
+
+ RFB 3.8 changes
+
+ Now we send a byte for # of supported auth types, and then a byte for each auth type.
+
+ rfbUltraVNC is not being used for anything, although rfbUltraVNC_SecureVNCPlugin has been established somewhat.
+ Like a lot of these things, most of the values in the authentication range will end up going unused.
+ 
+ Rather than complicate things further, I hereby declare this scheme: the top 4 bits will define the 'owner'
+ of that set of values, and the bottom 4 bits will define the type. All of the values in the RFB 3.8 spec
+ can then be covered by 0x0 and 0x1 for the top 4 bits.
+
+                              mask
+ RealVNC-approved values:     0x0F
+ RealVNC-approved values:     0x1F
+ reserved:                    0x2F
+ reserved:                    0x3F
+ reserved:                    0x4F
+ reserved:                    0x5F
+ reserved:                    0x6F
+ UltraVNC:                    0x7F
+ TightVNC:                    0x8F
+ reserved:                    0x9F
+ reserved:                    0xAF
+ reserved:                    0xBF
+ reserved:                    0xCF
+ reserved:                    0xDF
+ reserved:                    0xEF
+ reserved:                    0xFF
+*/
+
+#define rfbConnFailed 0
+#define rfbInvalidAuth 0
+#define rfbNoAuth 1
+#define rfbVncAuth 2
+#define rfbUltraVNC 17
+// adzm 2010-09 - After rfbUltraVNC, auth repeats via rfbVncAuthContinue
+
+#define rfbUltraVNC_SCPrompt 0x68
+#define rfbUltraVNC_SessionSelect 0x69
+// adzm 2010-09 - Ultra subtypes
+#define rfbUltraVNC_MsLogonIAuth 0x70
+
+	// mslogonI never seems to be used anymore -- the old code would say if (m_ms_logon) AuthMsLogon (II) else AuthVnc
+	// and within AuthVnc would be if (m_ms_logon) { /* mslogon code */ }. That could never be hit since the first case
+	// would always match!
+
+#define rfbUltraVNC_MsLogonIIAuth 0x71
+#define rfbUltraVNC_SecureVNCPluginAuth 0x72
+
+//adzm 2010-05-10 - for backwards compatibility with pre-3.8
+#define rfbLegacy_SecureVNCPlugin 17
+#define rfbLegacy_MsLogon 0xfffffffa // UltraVNC's MS-Logon with (hopefully) better security
+
+// please see ABOVE these definitions for more discussion on authentication
+
+
+/*
+ * 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
+// neither of these are used any longer in RFB 3.8
+#define rfbVncAuthTooMany 2
+#define rfbVncAuthFailedEx 3 //adzm 2010-05-11 - Send an explanatory message for the failure (if any)
+
+// adzm 2010-09 - rfbUltraVNC or other auths may send this to restart authentication (perhaps over a now-secure channel)
+#define rfbVncAuthContinue 0xFFFFFFFF
+
+
+
+// UltraVNC specific extensions of RFB protocol
+//
+#define rfbServerState 0xAD // 26 March 2008 jdp
+
+#define rfbKeepAlive 13 // 16 July 2008 jdp -- bidirectional
+// adzm 2010-09 - Notify streaming DSM plugin support
+#define rfbNotifyPluginStreaming 0x50
+
+#define rfbRequestSession 20
+#define rfbSetSession 21
+
+  
+// adzm 2010-09 - Notify streaming DSM plugin support
+#define rfbEncodingPluginStreaming       0xC0A1E5CF
+
+// viewer requests server state updates
+#define rfbEncodingServerState              0xFFFF8000
+#define rfbEncodingEnableKeepAlive          0xFFFF8001
+#define rfbEncodingFTProtocolVersion           0xFFFF8002
+#define rfbEncodingpseudoSession    		0xFFFF8003
+
+// adzm 2010-09 - Notify streaming DSM plugin support
+typedef struct {
+    uint8_t type;			/* always rfbServerCutText */
+    uint8_t pad1;
+    uint16_t flags; // reserved - always 0
+} rfbNotifyPluginStreamingMsg;
+
+#define sz_rfbNotifyPluginStreamingMsg	4
+
+
+
+#define rfbFileTransferSessionStart 15 // indicates a client has the FT gui open
+#define rfbFileTransferSessionEnd   16 // indicates a client has closed the ft gui.
+#define rfbFileTransferProtocolVersion 17 // indicates ft protocol version understood by sender. contentParam is version #
+
+
+#define rfbPartialFilePrefix   "!UVNCPFT-\0" // Files are transferred with this prefix, until complete. Must end with "-", does not apply to directory transfers
+#define sz_rfbPartialFilePrefix 9 
+
+// new message for sending server state to client
+
+#define rfbServerState_Disabled     0
+#define rfbServerState_Enabled      1
+
+#define rfbServerRemoteInputsState  1
+#define rfbKeepAliveInterval        2
+
+typedef struct {
+    uint8_t   type;          /* always rfbServerState */
+    uint8_t pad1;
+    uint8_t pad2;
+    uint8_t pad3;
+    uint32_t  state;         /* state id*/
+    uint32_t  value;         /* state value */ 
+} rfbServerStateMsg;
+
+
+#define sz_rfbServerStateMsg 12
+
+
+typedef struct {
+	uint8_t type;
+} rfbKeepAliveMsg;
+
+typedef struct {
+	uint8_t type;
+} rfbRequestSessionMsg;
+
+typedef struct {
+	uint8_t type;
+	uint8_t number;
+} rfbSetSessionMsg;
+
+#define sz_rfbKeepAliveMsg 1
+#define sz_rfbRequestSessionMsg 1
+#define sz_rfbSetSessionMsg 2
+
+
+qint64 vsocketDispatcher( char * _buf, const qint64 _len,
+                                const SocketOpCodes _op_code, void * _user )
+{
+	VSocket * sock = static_cast<VSocket *>( _user );
+	switch( _op_code )
+	{
+		case SocketRead: return( sock->ReadExact( _buf, _len ) ?
+								_len : 0 );
+		case SocketWrite: return( sock->SendExact( _buf, _len ) ?
+								_len : 0 );
+		case SocketGetPeerAddress:
+			strncpy( _buf, sock->GetPeerName(), _len );
+			return( 0 );
+	}
+	return( 0 );
+
+}
+
+
+#include "vncclient.cpp"
+#include "vncdesktop.cpp"
+
diff --git a/ica/win32/vncAcceptDialog.h b/ica/win32/vncAcceptDialog.h
deleted file mode 100644
index e69de29..0000000
diff --git a/ica/win32/vncCorbaConnect.h b/ica/win32/vncCorbaConnect.h
deleted file mode 100644
index 922b0e1..0000000
--- a/ica/win32/vncCorbaConnect.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _VNC_CORBA_CONNECT_H
-#define _VNC_CORBA_CONNECT_H
-struct vncCorbaConnect
-{
-} ;
-#endif
diff --git a/ica/win32/vncEncodeZlibHex.h b/ica/win32/vncEncodeZlibHex.h
deleted file mode 100644
index e69de29..0000000
diff --git a/ica/win32/vncHTTPConnect.h b/ica/win32/vncHTTPConnect.h
deleted file mode 100644
index acb0d67..0000000
--- a/ica/win32/vncHTTPConnect.h
+++ /dev/null
@@ -1,3 +0,0 @@
-struct vncHTTPConnect
-{
-} ;
diff --git a/ica/win32/vncMenu.h b/ica/win32/vncMenu.h
deleted file mode 100644
index f9be725..0000000
--- a/ica/win32/vncMenu.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//typedef int vncMenu;
-
-#define MENU_SERVER_SHAREWINDOW 0
-#define MENU_PROPERTIES_SHOW 0
-#define MENU_DEFAULT_PROPERTIES_SHOW 0
-#define MENU_ABOUTBOX_SHOW 0
-#define MENU_SERVICEHELPER_MSG 0
-#define MENU_RELOAD_MSG 0
-#define MENU_ADD_CLIENT_MSG 0
-#define MENU_KILL_ALL_CLIENTS_MSG 0
-#define MENU_SERVER_SHAREPRIMARY 0
-#define MENU_SERVER_SHAREAREA 0
-#define MENU_SERVER_SHAREALL 0
diff --git a/ica/win32/vncPasswd.h b/ica/win32/vncPasswd.h
deleted file mode 100644
index e69de29..0000000
diff --git a/ica/win32/win32vnc.cpp b/ica/win32/win32vnc.cpp
deleted file mode 100644
index a435917..0000000
--- a/ica/win32/win32vnc.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#define XMD_H
-#define _WIN32_WINNT 0x0500
-#include <winsock2.h>
-#include <windows.h>
-
-
-extern "C" char * strdup( const char * );
-
-
-#include <rfb/rfbproto.h>
-#include <rfb.h>
-
-#define rfbAuthNone rfbNoAuth
-#define rfbAuthVNC rfbVncAuth
-
-#define rfbAuthOK rfbVncAuthOK
-#define rfbAuthFailed rfbVncAuthFailed
-#define rfbSecTypeTight rfbTight
-#define rfbAuthUnixLogin 129
-#define rfbAuthExternal 130
-
-
-#define sig_rfbAuthNone "NOAUTH__"
-#define sig_rfbAuthVNC "VNCAUTH_"
-#define sig_rfbAuthUnixLogin "ULGNAUTH"
-#define sig_rfbAuthExternal "XTRNAUTH"
-
-#define rfbProtocolFallbackMinorVersion 3
-
-
-#include <assert.h>
-
-#define _ASSERT assert
-#define _ASSERTE assert
-
-
-/*-----------------------------------------------------------------------------
- * Structure used to describe protocol options such as tunneling methods,
- * authentication schemes and message types (protocol version 3.7t).
- */
-
-typedef struct _rfbCapabilityInfo {
-
-    CARD32 code;		/* numeric identifier */
-    CARD8 vendorSignature[4];	/* vendor identification */
-    CARD8 nameSignature[8];	/* abbreviated option name */
-
-} rfbCapabilityInfo;
-
-#define sz_rfbCapabilityInfoVendor 4
-#define sz_rfbCapabilityInfoName 8
-#define sz_rfbCapabilityInfo 16
-
-/*
- * Vendors known by TightVNC: standard VNC/RealVNC, TridiaVNC, and TightVNC.
- */
-
-#define rfbStandardVendor "STDV"
-#define rfbTridiaVncVendor "TRDV"
-#define rfbTightVncVendor "TGHT"
-
-
-/*-----------------------------------------------------------------------------
- * Negotiation of Tunneling Capabilities (protocol version 3.7t)
- *
- * If the chosen security type is rfbSecTypeTight, the server sends a list of
- * supported tunneling methods ("tunneling" refers to any additional layer of
- * data transformation, such as encryption or external compression.)
- *
- * nTunnelTypes specifies the number of following rfbCapabilityInfo structures
- * that list all supported tunneling methods in the order of preference.
- *
- * NOTE: If nTunnelTypes is 0, that tells the client that no tunneling can be
- * used, and the client should not send a response requesting a tunneling
- * method.
- */
-
-typedef struct _rfbTunnelingCapsMsg {
-    CARD32 nTunnelTypes;
-    /* followed by nTunnelTypes * rfbCapabilityInfo structures */
-} rfbTunnelingCapsMsg;
-
-#define sz_rfbTunnelingCapsMsg 4
-
-/*-----------------------------------------------------------------------------
- * Tunneling Method Request (protocol version 3.7t)
- *
- * If the list of tunneling capabilities sent by the server was not empty, the
- * client should reply with a 32-bit code specifying a particular tunneling
- * method.  The following code should be used for no tunneling.
- */
-
-#define rfbNoTunneling 0
-#define sig_rfbNoTunneling "NOTUNNEL"
-
-
-/*-----------------------------------------------------------------------------
- * Negotiation of Authentication Capabilities (protocol version 3.7t)
- *
- * After setting up tunneling, the server sends a list of supported
- * authentication schemes.
- *
- * nAuthTypes specifies the number of following rfbCapabilityInfo structures
- * that list all supported authentication schemes in the order of preference.
- *
- * NOTE: If nAuthTypes is 0, that tells the client that no authentication is
- * necessary, and the client should not send a response requesting an
- * authentication scheme.
- */
-
-typedef struct _rfbAuthenticationCapsMsg {
-    CARD32 nAuthTypes;
-    /* followed by nAuthTypes * rfbCapabilityInfo structures */
-} rfbAuthenticationCapsMsg;
-
-#define sz_rfbAuthenticationCapsMsg 4
-
-/* signatures for basic encoding types */
-#define sig_rfbEncodingRaw       "RAW_____"
-#define sig_rfbEncodingCopyRect  "COPYRECT"
-#define sig_rfbEncodingRRE       "RRE_____"
-#define sig_rfbEncodingCoRRE     "CORRE___"
-#define sig_rfbEncodingHextile   "HEXTILE_"
-#define sig_rfbEncodingZlib      "ZLIB____"
-#define sig_rfbEncodingTight     "TIGHT___"
-#define sig_rfbEncodingZlibHex   "ZLIBHEX_"
-
-/* signatures for "fake" encoding types */
-#define sig_rfbEncodingCompressLevel0  "COMPRLVL"
-#define sig_rfbEncodingXCursor         "X11CURSR"
-#define sig_rfbEncodingRichCursor      "RCHCURSR"
-#define sig_rfbEncodingPointerPos      "POINTPOS"
-#define sig_rfbEncodingLastRect        "LASTRECT"
-#define sig_rfbEncodingNewFBSize       "NEWFBSIZ"
-#define sig_rfbEncodingQualityLevel0   "JPEGQLVL"
-
-
-/*-----------------------------------------------------------------------------
- * Server Interaction Capabilities Message (protocol version 3.7t)
- *
- * In the protocol version 3.7t, the server informs the client what message
- * types it supports in addition to ones defined in the protocol version 3.7.
- * Also, the server sends the list of all supported encodings (note that it's
- * not necessary to advertise the "raw" encoding sinse it MUST be supported in
- * RFB 3.x protocols).
- *
- * This data immediately follows the server initialisation message.
- */
-
-typedef struct _rfbInteractionCapsMsg {
-    CARD16 nServerMessageTypes;
-    CARD16 nClientMessageTypes;
-    CARD16 nEncodingTypes;
-    CARD16 pad;			/* reserved, must be 0 */
-    /* followed by nServerMessageTypes * rfbCapabilityInfo structures */
-    /* followed by nClientMessageTypes * rfbCapabilityInfo structures */
-} rfbInteractionCapsMsg;
-
-#define sz_rfbInteractionCapsMsg 8
-
-
-#include "isd_server.h"
-#include "ica_main.h"
-#include "src/VSocket.cpp"
-
-
-qint64 vsocketDispatcher( char * _buf, const qint64 _len,
-				const socketOpCodes _op_code, void * _user )
-{
-	VSocket * sock = static_cast<VSocket *>( _user );
-	switch( _op_code )
-	{
-		case SocketRead: return( sock->ReadExact( _buf, _len ) ?
-								_len : 0 );
-		case SocketWrite: return( sock->SendExact( _buf, _len ) ?
-						  		_len : 0 );
-		case SocketGetPeerAddress:
-			strncpy( _buf, sock->GetPeerName(), _len );
-			return( 0 );
-	}
-	return( 0 );
-
-}
-
-
-
-#include "src/ParseHost.c"
-#include "src/vncKeymap.cpp"
-#include "src/WinVNC.cpp"
-#include "src/vncService.cpp"
-#include "src/vncInstHandler.cpp"
-#include "src/vncServer.cpp"
-#include "src/vncClient.cpp"
-#include "src/vncDesktop.cpp"
-#include "src/stdhdrs.cpp"
-#include "src/omnithread/nt.cpp"
-#include "src/RectList.cpp"
-#include "src/translate.cpp"
-#include "src/Log.cpp"
-#include "src/vncEncoder.cpp"
-#include "src/vncBuffer.cpp"
-#include "src/vncRegion.cpp"
-#include "src/vncSockConnect.cpp"
-#include "src/VideoDriver.cpp"
-//#include "src/TsSessions.cpp"
-//#include "src/DynamicFn.cpp"
-
diff --git a/ica/win32/winvnc/DSMPlugin/DSMPlugin.cpp b/ica/win32/winvnc/DSMPlugin/DSMPlugin.cpp
new file mode 100644
index 0000000..1efd6e7
--- /dev/null
+++ b/ica/win32/winvnc/DSMPlugin/DSMPlugin.cpp
@@ -0,0 +1,525 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+//
+////////////////////////////////////////////////////////////////////////////
+//
+//
+// DSMPlugin.cpp: implementation of the CDSMPlugin class.
+//
+//////////////////////////////////////////////////////////////////////
+//
+// This class is the interface between UltraVNC and plugins 
+// (third party dlls) that may be developed (written, exported and 
+// provided by authorized individuals - according to the law of their 
+// country) to alter/modify/process/encrypt rfb data streams between 
+// vnc viewer and vnc server.
+//
+// The goal here is not to design and develop an extensive, versatile
+// and powerfull plugin system but to provide people a way
+// to easely customize the VNC communication data between client and server.
+//
+// It handles the following tasks:
+// 
+// - Listing of all plugins found in the vnc directory (dlls, with ".dsm" extension)
+//
+// - Loading of a given plugin
+//
+// - Interface between vnc and the plugin functions: 
+//   - Init()               Initialize the plugin
+//   - SetParams()          Set Password, or key or other. If more than one param, uses ',' as separator
+//   - GetParams()          Give Password, or key or other. If more than one param, uses ',' as separator
+//   - DescribePlugin()     Give the Plugin ID string (Name, Author, Date, Version, FileName)
+//   - TransformBuffer()    Tell the plugin to do it's transformation against the data in the buffer
+//   - RestoreBuffer()      Tell the plugin to restore data to its original state   
+//   - Shutdown()           Cleanup and shutdown the plugin
+//   - FreeBuffer()         Free a buffer used in the plugin
+//	 - Reset()
+//
+// - Unloading of the current loaded plugin
+//
+//  (2009)
+//  Multithreaded DSM plugin framework created by Adam D. Walling aka adzm
+// - Creating a new (threadsafe) instance of a DSM plugin encryptor/decryptor
+//   - CreatePluginInterface -- returns a pointer to a new IPlugin-derived class,
+//       which is then used to transform and restore buffers in a threadsafe manner.
+// 
+// WARNING: For the moment, only ONE instance of this class must exist in Vncviewer and WinVNC
+// Consequently, WinVNc will impose all its clients to use the same plugin. Maybe we'll 
+// improve that soon. It depends on the demand/production of DSM plugins.
+
+
+#include <memory.h>
+#include <stdio.h>
+#include <string.h>
+#include "stdhdrs.h"
+#include "DSMPlugin.h"
+
+
+//
+// Utils
+//
+BOOL MyStrToken(LPSTR szToken, LPSTR lpString, int nTokenNum, char cSep)
+{
+	int i = 1;
+	while (i < nTokenNum)
+	{
+		while ( *lpString && (*lpString != cSep) &&(*lpString != '\0'))
+		{
+			lpString++;
+		}
+		i++;
+		lpString++;
+	}
+	while ((*lpString != cSep) && (*lpString != '\0'))
+	{
+		*szToken = *lpString;
+		szToken++;
+		lpString++;
+	}
+	*szToken = '\0' ;
+	if (( ! *lpString ) || (! *szToken)) return FALSE;
+	return FALSE;
+}
+
+
+
+//
+//
+//
+CDSMPlugin::CDSMPlugin()
+{
+	m_fLoaded = false;
+	m_fEnabled = false;
+	m_lPassLen = 0;
+
+	m_pTransBuffer = NULL;
+	m_pRestBuffer = NULL;
+
+	sprintf(m_szPluginName, "Unknown");
+	sprintf(m_szPluginVersion, "0.0.0");
+	sprintf(m_szPluginDate, "12-12-2002");
+	sprintf(m_szPluginAuthor, "Someone");
+	sprintf(m_szPluginFileName, "Plugin.dsm"); // No path, just the filename
+
+	m_hPDll = NULL;
+
+	// Plugin's functions pointers init
+	/*
+	STARTUP			m_PStartup = NULL;
+	SHUTDOWN		m_PShutdown = NULL;
+	SETPARAMS		m_PSetParams = NULL;
+	GETPARAMS		m_PGetParams = NULL;
+	TRANSFORMBUFFER m_PTransformBuffer = NULL;
+	RESTOREBUFFER	m_PRestoreBuffer = NULL;
+	TRANSFORMBUFFER	m_PFreeBuffer = NULL;
+	RESET			m_PReset = NULL;
+	//adzm - 2009-06-21
+	CREATEPLUGININTERFACE	m_PCreatePluginInterface = NULL;
+	*/
+
+	//adzm - 2009-07-05
+	// Plugin's functions pointers init
+	m_PDescription = NULL;
+	m_PStartup = NULL;
+	m_PShutdown = NULL;
+	m_PSetParams = NULL;
+	m_PGetParams = NULL;
+	m_PTransformBuffer = NULL;
+	m_PRestoreBuffer = NULL;
+	m_PFreeBuffer = NULL;
+	m_PReset = NULL;
+	//adzm - 2009-06-21
+	m_PCreatePluginInterface = NULL;
+	//adzm 2010-05-10
+	m_PCreateIntegratedPluginInterface = NULL;
+	//adzm 2010-05-12 - dsmplugin config
+	m_PConfig = NULL;
+}
+
+//
+//
+//
+CDSMPlugin::~CDSMPlugin()
+{
+	// TODO: Log events
+	if (IsLoaded())
+		UnloadPlugin();
+}
+
+
+//
+//
+//
+void CDSMPlugin::SetEnabled(bool fEnable)
+{
+	m_fEnabled =  fEnable;
+}
+
+
+//
+//
+//
+void CDSMPlugin::SetLoaded(bool fEnable)
+{
+	m_fLoaded =  fEnable;
+}
+
+
+//
+//
+//
+char* CDSMPlugin::DescribePlugin(void)
+{
+	// TODO: Log events
+	char* szDescription = NULL;
+	if (m_PDescription)
+	{
+		 szDescription = (*m_PDescription)();
+		 if (szDescription != NULL)
+		 {
+			 //adzm 2010-05-10 - this was inconsistent with the way the plugins are written
+			MyStrToken(m_szPluginName, szDescription, 1, ',');
+			MyStrToken(m_szPluginVersion, szDescription, 2, ',');
+			MyStrToken(m_szPluginDate, szDescription, 3, ',');
+			MyStrToken(m_szPluginAuthor, szDescription, 4, ',');
+			MyStrToken(m_szPluginFileName, szDescription, 5, ',');
+		 }
+		 return szDescription;
+	}
+
+	else 
+		return "No Plugin loaded";
+}
+
+
+//
+// Init the DSMPlugin system
+//
+bool CDSMPlugin::InitPlugin(void)
+{
+	// TODO: Log events
+	int nRes = (*m_PStartup)();
+	if (nRes < 0) return false;
+	else return true;
+}
+
+//
+// Reset the DSMPlugin
+//
+bool CDSMPlugin::ResetPlugin(void)
+{
+	// TODO: Log events
+	int nRes = (*m_PReset)();
+	if (nRes < 0) return false;
+	else return true;
+}
+
+
+//
+// szParams is the key (or password) that is transmitted to the loaded DSMplugin
+//
+bool CDSMPlugin::SetPluginParams(HWND hWnd, char* szParams, char* szConfig, char** pszNewConfig)
+{
+	// TODO: Log events
+
+	//adzm 2010-05-12 - dsmplugin config
+	if (m_PConfig) {
+		//char* szNewConfig = NULL;
+		int nRes = (*m_PConfig)(hWnd, szParams, szConfig, pszNewConfig);		
+		if (nRes > 0) return true; else return false;
+	} else {
+		int nRes = (*m_PSetParams)(hWnd, szParams);
+		if (nRes > 0) return true; else return false;
+	}
+}
+
+
+//
+// Return the loaded DSMplugin current param(s)
+//
+char* CDSMPlugin::GetPluginParams(void)
+{
+	// 
+	return (*m_PGetParams)();
+
+}
+
+
+//
+// List all the plugins is the current APP directory in the given ComboBox
+//
+int CDSMPlugin::ListPlugins(HWND hComboBox)
+{
+	// TODO: Log events
+	WIN32_FIND_DATA fd;
+	HANDLE ff;
+	int fRet = 1;
+	int nFiles = 0;
+	char szCurrentDir[MAX_PATH];
+
+	if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+	{
+		char* p = strrchr(szCurrentDir, '\\');
+		if (p == NULL)
+			return 0;
+		*p = '\0';
+	}
+	else
+		return 0;
+	// MessageBoxSecure(NULL, szCurrentDir, "Current directory", MB_OK);
+
+    if (szCurrentDir[strlen(szCurrentDir) - 1] != '\\') strcat(szCurrentDir, "\\");
+	strcat(szCurrentDir, "*.dsm"); // The DSMplugin dlls must have this extension
+	
+	ff = FindFirstFile(szCurrentDir, &fd);
+	if (ff == INVALID_HANDLE_VALUE)
+	{
+		// Todo: Log error here
+		return 0;
+	}
+
+	while (fRet != 0)
+	{
+		SendMessage(hComboBox, CB_ADDSTRING, 0, (LPARAM)(fd.cFileName)); 
+		nFiles++;
+		fRet = FindNextFile(ff, &fd);
+	}
+
+	FindClose(ff);
+
+	return nFiles;
+}
+
+
+
+//
+// Load the given DSMplugin and map its functions
+//
+bool CDSMPlugin::LoadPlugin(char* szPlugin, bool fAllowMulti)
+{
+	// sf at 2003 - Multi dll trick 
+	// I really don't like doing this kind of dirty workaround but I have no time to do
+	// better for now. Used only by a listening viewer.
+	// Create a numbered temporary copy of the original plugin dll and load it (viewer only, for now)
+	if (fAllowMulti)
+	{
+		bool fDllCopyCreated = false;
+		int i = 1;
+		char szDllCopyName[MAX_PATH];
+		char szCurrentDir[MAX_PATH];
+		char szCurrentDir_szPlugin[MAX_PATH];
+		char szCurrentDir_szDllCopyName[MAX_PATH];
+		while (!fDllCopyCreated)
+		{
+			/*strcpy_s(szDllCopyName, 260,szPlugin);
+			szDllCopyName[strlen(szPlugin) - 4] = '\0'; //remove the ".dsm" extension
+			sprintf(szDllCopyName, "%s-tmp.d%d", szDllCopyName, i++);*/
+			//fDllCopyCreated = (FALSE != CopyFile(szPlugin, szDllCopyName, false));
+			// Note: Let's be really dirty; Overwrite if it's possible only (dll not loaded). 
+			// This way if for some reason (abnormal process termination) the dll wasn't previously 
+			// normally deleted we overwrite/clean it with the new one at the same time.
+			//strcpy (szCurrentDir_szDllCopyName,szDllCopyName);
+			//DWORD error=GetLastError();
+			//if (error==2)
+			{
+				if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+					{
+						char* p = strrchr(szCurrentDir, '\\');
+						*p = '\0';
+					}
+				char lpPathBuffer[MAX_PATH];
+				DWORD dwBufSize=MAX_PATH;
+				DWORD dwRetVal;
+				dwRetVal = GetTempPath(dwBufSize,lpPathBuffer);
+				if (dwRetVal > dwBufSize || (dwRetVal == 0))
+				{
+					strcpy (lpPathBuffer,szCurrentDir);
+				}
+				else
+				{
+					
+				}
+				
+				strcpy (szCurrentDir_szPlugin,szCurrentDir);
+				strcat (szCurrentDir_szPlugin,"\\");
+				strcat (szCurrentDir_szPlugin,szPlugin);
+
+				strcpy (szCurrentDir_szDllCopyName,lpPathBuffer);
+				//strcat (szCurrentDir_szDllCopyName,"\\");
+				strcat (szCurrentDir_szDllCopyName,szDllCopyName);
+				fDllCopyCreated = (FALSE != CopyFile(szCurrentDir_szPlugin, szCurrentDir_szDllCopyName, false));
+			}
+			if (i > 99) break; // Just in case...
+		}
+		strcpy(m_szDllName, szCurrentDir_szDllCopyName);
+		m_hPDll = LoadLibrary(m_szDllName);
+	}
+	else // Use the original plugin dll
+	{
+		ZeroMemory(m_szDllName, strlen(m_szDllName));
+		m_hPDll = LoadLibrary(szPlugin);
+		//Try current PATH
+		if (m_hPDll==NULL)
+		{
+			char szCurrentDir[MAX_PATH];
+			char szCurrentDir_szPlugin[MAX_PATH];
+			if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+				{
+					char* p = strrchr(szCurrentDir, '\\');
+					*p = '\0';
+				}
+			strcpy (szCurrentDir_szPlugin,szCurrentDir);
+			strcat (szCurrentDir_szPlugin,"\\");
+			strcat (szCurrentDir_szPlugin,szPlugin);
+			m_hPDll = LoadLibrary(szCurrentDir_szPlugin);
+		}
+	}
+
+	if (m_hPDll == NULL) return false;
+
+	m_PDescription     = (DESCRIPTION)     GetProcAddress(m_hPDll, "Description");
+	m_PStartup         = (STARTUP)         GetProcAddress(m_hPDll, "Startup");
+	m_PShutdown        = (SHUTDOWN)        GetProcAddress(m_hPDll, "Shutdown");
+	m_PSetParams       = (SETPARAMS)       GetProcAddress(m_hPDll, "SetParams");
+	m_PGetParams       = (GETPARAMS)       GetProcAddress(m_hPDll, "GetParams");
+	m_PTransformBuffer = (TRANSFORMBUFFER) GetProcAddress(m_hPDll, "TransformBuffer");
+	m_PRestoreBuffer   = (RESTOREBUFFER)   GetProcAddress(m_hPDll, "RestoreBuffer");
+	m_PFreeBuffer      = (FREEBUFFER)      GetProcAddress(m_hPDll, "FreeBuffer");
+	m_PReset           = (RESET)           GetProcAddress(m_hPDll, "Reset");
+	//adzm - 2009-06-21
+	m_PCreatePluginInterface	= (CREATEPLUGININTERFACE)	GetProcAddress(m_hPDll, "CreatePluginInterface");
+	//adzm 2010-05-10
+	m_PCreateIntegratedPluginInterface	= (CREATEINTEGRATEDPLUGININTERFACE)	GetProcAddress(m_hPDll, "CreateIntegratedPluginInterface");
+	//adzm 2010-05-12 - dsmplugin config
+	m_PConfig         = (CONFIG)           GetProcAddress(m_hPDll, "Config");
+
+	if (m_PStartup == NULL || m_PShutdown == NULL || m_PSetParams == NULL || m_PGetParams == NULL
+		|| m_PTransformBuffer == NULL || m_PRestoreBuffer == NULL || m_PFreeBuffer == NULL)
+	{
+		FreeLibrary(m_hPDll); 
+		if (*m_szDllName) DeleteFile(m_szDllName);
+		return false;
+	}
+
+	// return ((*m_PStartup)());
+	SetLoaded(true);
+	return true;
+}
+
+
+//
+// Unload the current DSMPlugin from memory
+//
+bool CDSMPlugin::UnloadPlugin(void)
+{
+	// TODO: Log events
+	// Force the DSMplugin to free the buffers it allocated
+	if (m_pTransBuffer != NULL) (*m_PFreeBuffer)(m_pTransBuffer);
+	if (m_pRestBuffer != NULL) (*m_PFreeBuffer)(m_pRestBuffer);
+	
+	m_pTransBuffer = NULL;
+	m_pRestBuffer = NULL;
+
+	SetLoaded(false);
+
+	if ((*m_PShutdown)())
+	{
+		bool fFreed = false;
+		fFreed = (FALSE != FreeLibrary(m_hPDll));
+		if (*m_szDllName) DeleteFile(m_szDllName);
+		return fFreed;
+	}
+	else
+		return false;
+	
+}
+
+//adzm - 2009-06-21
+IPlugin* CDSMPlugin::CreatePluginInterface()
+{
+	if (m_PCreatePluginInterface) {
+		return m_PCreatePluginInterface();
+	} else {
+		return NULL;
+	}
+}
+
+bool CDSMPlugin::SupportsMultithreaded()
+{
+	//adzm 2010-05-10
+	return m_PCreatePluginInterface != NULL || m_PCreateIntegratedPluginInterface != NULL;
+}
+
+//adzm 2010-05-10
+IIntegratedPlugin* CDSMPlugin::CreateIntegratedPluginInterface()
+{
+	if (m_PCreateIntegratedPluginInterface) {
+		return m_PCreateIntegratedPluginInterface();
+	} else {
+		return NULL;
+	}
+}
+
+bool CDSMPlugin::SupportsIntegrated()
+{
+	return m_PCreateIntegratedPluginInterface != NULL;
+}
+
+
+//
+// Tell the plugin to do its transformation on the source data buffer
+// Return: pointer on the new transformed buffer (allocated by the plugin)
+// nTransformedDataLen is the number of bytes contained in the transformed buffer
+//
+BYTE* CDSMPlugin::TransformBuffer(BYTE* pDataBuffer, int nDataLen, int* pnTransformedDataLen)
+{
+	// FixME: possible pb with this mutex in WinVNC
+	omni_mutex_lock l(m_TransMutex);
+
+	m_pTransBuffer = (*m_PTransformBuffer)(pDataBuffer, nDataLen, pnTransformedDataLen);
+
+	return m_pTransBuffer;
+}
+
+
+// - If pRestoredDataBuffer = NULL, the plugin check its local buffer and return the pointer
+// - Otherwise, restore data contained in its rest. buffer and put the result in pRestoredDataBuffer
+//   pnRestoredDataLen is the number bytes put in pRestoredDataBuffers
+BYTE* CDSMPlugin::RestoreBufferStep1(BYTE* pRestoredDataBuffer, int nDataLen, int* pnRestoredDataLen)
+{
+	//m_RestMutex.lock();
+	m_pRestBuffer = (*m_PRestoreBuffer)(pRestoredDataBuffer, nDataLen, pnRestoredDataLen);
+	return m_pRestBuffer;
+}
+
+BYTE* CDSMPlugin::RestoreBufferStep2(BYTE* pRestoredDataBuffer, int nDataLen, int* pnRestoredDataLen)
+{
+	m_pRestBuffer = (*m_PRestoreBuffer)(pRestoredDataBuffer, nDataLen, pnRestoredDataLen);
+	//m_RestMutex.unlock();
+	return NULL;
+}
+
+void CDSMPlugin::RestoreBufferUnlock()
+{
+	//m_RestMutex.unlock();
+}
+
diff --git a/ica/win32/winvnc/DSMPlugin/DSMPlugin.h b/ica/win32/winvnc/DSMPlugin/DSMPlugin.h
new file mode 100644
index 0000000..db6c134
--- /dev/null
+++ b/ica/win32/winvnc/DSMPlugin/DSMPlugin.h
@@ -0,0 +1,194 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at Vnc Team Members. 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/
+////////////////////////////////////////////////////////////////////////////
+//
+// DSMPlugin.h: interface for the CDSMPlugin class.
+//
+//////////////////////////////////////////////////////////////////////
+//
+//  (2009)
+//  Multithreaded DSM plugin framework created by Adam D. Walling aka adzm
+
+#if !defined(CDSMPlugin_H)
+#define CDSMPlugin_H
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+#ifdef UNDER_CE
+#include "omnithreadce.h"
+#else
+#include "omnithread.h"
+#endif
+
+#include "windows.h"
+
+//adzm - 2009-06-21
+class IPlugin
+{
+public:
+	virtual ~IPlugin() {};
+
+	virtual BYTE* TransformBuffer(BYTE* pDataBuffer, int nDataLen, int* pnTransformedDataLen) = 0;
+	virtual BYTE* RestoreBuffer(BYTE* pTransBuffer, int nTransDataLen, int* pnRestoredDataLen) = 0;
+};
+
+class IIntegratedPlugin : public IPlugin
+{
+public:
+	virtual ~IIntegratedPlugin() {};
+
+	// Free memory allocated by the plugin
+	virtual void FreeMemory(void* pMemory) = 0;
+
+	// Get the last error string
+	virtual LPCSTR GetLastErrorString() = 0; // volatile, must be copied or may be invalidated
+
+	// Describe the current encryption settings
+	virtual LPCSTR DescribeCurrentSettings() = 0; // volatile, must be copied or may be invalidated
+
+	// Set handshake complete and start to transform/restore buffers
+	virtual void SetHandshakeComplete() = 0;
+
+	// Helper methods to decrypt or encrypt an arbitrary array of bytes with a given passphrase
+	virtual bool EncryptBytesWithKey(const BYTE* pPlainData, int nPlainDataLength, const BYTE* pPassphrase, int nPassphraseLength, BYTE*& pEncryptedData, int& nEncryptedDataLength, bool bIncludeHash) = 0;
+	virtual bool DecryptBytesWithKey(const BYTE* pEncryptedData, int nEncryptedDataLength, const BYTE* pPassphrase, int nPassphraseLength, BYTE*& pPlainData, int& nPlainDataLength, bool bIncludeHash) = 0;
+
+	// server
+	virtual void SetServerIdentification(const BYTE* pIdentification, int nLength) = 0;
+	virtual void SetServerOptions(LPCSTR szOptions) = 0;
+	virtual void SetPasswordData(const BYTE* pPasswordData, int nLength) = 0;
+	virtual bool GetChallenge(BYTE*& pChallenge, int& nChallengeLength, int nSequenceNumber) = 0;
+	virtual bool HandleResponse(const BYTE* pResponse, int nResponseLength, int nSequenceNumber, bool& bSendChallenge) = 0;
+
+	// client
+	virtual void SetViewerOptions(LPCSTR szOptions) = 0;
+	virtual bool HandleChallenge(const BYTE* pChallenge, int nChallengeLength, int nSequenceNumber, bool& bPasswordOK, bool& bPassphraseRequired) = 0;
+	virtual bool GetResponse(BYTE*& pResponse, int& nResponseLength, int nSequenceNumber, bool& bExpectChallenge) = 0;
+
+};
+
+// A plugin dll must export the following functions (with same convention)
+typedef char* (__cdecl  *DESCRIPTION)(void);
+typedef int   (__cdecl  *STARTUP)(void);
+typedef int   (__cdecl  *SHUTDOWN)(void);
+typedef int   (__cdecl  *SETPARAMS)(HWND, char*);
+typedef char* (__cdecl  *GETPARAMS)(void);
+typedef BYTE* (__cdecl  *TRANSFORMBUFFER)(BYTE*, int, int*);
+typedef BYTE* (__cdecl  *RESTOREBUFFER)(BYTE*, int, int*);
+typedef void  (__cdecl  *FREEBUFFER)(BYTE*);
+typedef int   (__cdecl  *RESET)(void);
+//adzm - 2009-06-21
+typedef IPlugin* (__cdecl  *CREATEPLUGININTERFACE)(void);
+//adzm 2010-05-10
+typedef IIntegratedPlugin* (__cdecl  *CREATEINTEGRATEDPLUGININTERFACE)(void);
+//adzm 2010-05-12 - dsmplugin config
+typedef int   (__cdecl  *CONFIG)(HWND, char*, char*, char**);
+
+//
+//
+//
+class CDSMPlugin  
+{
+public:
+	void SetLoaded(bool fEnable);
+	bool IsLoaded(void) { return m_fLoaded; };
+	void SetEnabled(bool fEnable);
+	bool IsEnabled(void) { return m_fEnabled; };
+	bool InitPlugin(void);
+	//adzm 2010-05-12 - dsmplugin config
+	bool SetPluginParams(HWND hWnd, char* szParams, char* szConfig = NULL, char** szNewConfig = NULL);
+	char* GetPluginParams(void);
+	char* DescribePlugin(void);
+	int  ListPlugins(HWND hComboBox);
+	bool LoadPlugin(char* szPlugin, bool fAllowMulti);
+	bool UnloadPlugin(void); // Could be private
+	BYTE* TransformBuffer(BYTE* pDataBuffer, int nDataLen, int* nTransformedDataLen);
+	BYTE* RestoreBufferStep1(BYTE* pDataBuffer, int nDataLen, int* nRestoredDataLen);
+	BYTE* RestoreBufferStep2(BYTE* pDataBuffer, int nDataLen, int* nRestoredDataLen);
+	void RestoreBufferUnlock();
+	char* GetPluginName(void) { return m_szPluginName;} ;
+	char* GetPluginVersion(void)  {  return m_szPluginVersion;} ;
+	char* GetPluginDate(void) { return m_szPluginDate; } ;
+	char* GetPluginAuthor(void) { return m_szPluginAuthor;} ;
+	char* GetPluginFileName(void) { return m_szPluginFileName;} ;
+
+	//adzm - 2009-06-21
+	IPlugin* CreatePluginInterface();
+	bool SupportsMultithreaded();
+
+	//adzm 2010-05-10
+	IIntegratedPlugin* CreateIntegratedPluginInterface();
+	bool SupportsIntegrated();
+
+	CDSMPlugin();
+	virtual ~CDSMPlugin();
+	bool ResetPlugin(void);
+
+	long m_lPassLen; 
+
+	omni_mutex m_RestMutex;
+
+private:
+	bool m_fLoaded;
+	bool m_fEnabled;
+
+	char szPassword[64];
+
+	char m_szPluginName[128]; // Name of the plugin and very short description
+	char m_szPluginVersion[16];
+	char m_szPluginDate[16];
+	char m_szPluginAuthor[64];
+	char m_szPluginFileName[128]; // No path, just the filename and possible comment
+
+	HMODULE m_hPDll;
+	char m_szDllName[MAX_PATH];
+
+	// Plugin's functions pointers when loaded
+	DESCRIPTION     m_PDescription;
+	SHUTDOWN		m_PShutdown;
+	STARTUP			m_PStartup;
+	SETPARAMS		m_PSetParams;
+	GETPARAMS		m_PGetParams;
+	TRANSFORMBUFFER m_PTransformBuffer;
+	RESTOREBUFFER	m_PRestoreBuffer;
+	FREEBUFFER		m_PFreeBuffer;
+	RESET			m_PReset;
+	//adzm - 2009-06-21
+	CREATEPLUGININTERFACE m_PCreatePluginInterface;
+	//adzm 2010-05-10
+	CREATEINTEGRATEDPLUGININTERFACE m_PCreateIntegratedPluginInterface;
+	//adzm 2010-05-12 - dsmplugin config
+	CONFIG m_PConfig;
+
+
+	//adzm - 2009-06-21 - Please do not use these! Deprecated with multithreaded DSM
+	BYTE* m_pTransBuffer;
+	BYTE* m_pRestBuffer;
+
+	omni_mutex m_TransMutex;
+	// omni_mutex m_RestMutex;
+};
+
+#endif
diff --git a/ica/win32/winvnc/Makefile.bcc32 b/ica/win32/winvnc/Makefile.bcc32
new file mode 100644
index 0000000..1034471
--- /dev/null
+++ b/ica/win32/winvnc/Makefile.bcc32
@@ -0,0 +1,117 @@
+# This makefile is for command-line Borland C++ 5.5 compiler (Win32).
+# It builds winvnc.exe (and .\VNCHooks\VNCHooks.dll).
+
+CC=bcc32
+RC=brc32
+LD=ilink32
+
+CFLAGS= -v- -Od -3 -tWM -xd- -q -P -Iomnithread -I".." -I..\..\rfb\ -w-8057 -w-8004 -w-8066 -w-8027 -w-8012 -w-8022 -DXMD_H -DWIN32
+LDFLAGS= /c /Tpe /aa /Gn /B:0x400000
+
+OBJS=winvnc\d3des.obj \
+     winvnc\vncLog.obj \
+     winvnc\stdhdrs.obj \
+     winvnc\translate.obj \
+     winvnc\vncAbout.obj \
+     winvnc\vncAcceptDialog.obj \
+     winvnc\vncauth.obj \
+     winvnc\vncBuffer.obj \
+     winvnc\vncClient.obj \
+     winvnc\vncConnDialog.obj \
+     winvnc\vncDesktop.obj \
+     winvnc\vncEncodeCoRRE.obj \
+     winvnc\vncEncodeHexT.obj \
+     winvnc\vncEncoder.obj \
+     winvnc\vncEncodeRRE.obj \
+     winvnc\vncEncodeTight.obj \
+     winvnc\vncEncodeZlib.obj \
+     winvnc\vncEncodeZlibHex.obj \
+     winvnc\vncHTTPConnect.obj \
+     winvnc\vncInstHandler.obj \
+     winvnc\vncKeymap.obj \
+     winvnc\vncMenu.obj \
+     winvnc\vncProperties.obj \
+#     winvnc\rfbRegion_win32.obj \
+     winvnc\Region.obj \
+     winvnc\rfbRegion_X11.obj \
+     winvnc\vncServer.obj \
+     winvnc\vncService.obj \
+     winvnc\vncSockConnect.obj \
+     winvnc\vncTimedMsgBox.obj \
+     winvnc\VSocket.obj \
+     winvnc\WinVNC.obj \
+     winvnc\buildtime.obj \
+     winvnc\TextChat.obj \
+     winvnc\vncDesktopSW.obj \
+     winvnc\vncEncoderCursor.obj \
+     winvnc\vncEncodeZRLE.obj \
+     winvnc\vncListDlg.obj \
+     winvnc\rfbUpdateTracker.obj \
+#     winvnc\vncLogonntml.obj \
+#     winvnc\vncLogonntlm2.obj \
+#     winvnc\vncMasterPasswd.obj \
+#     winvnc\vncPropPath.obj \
+     omnithread\omnithread.obj \
+     ..\DSMPlugin\DSMPlugin.obj \
+     winvnc\vncOSVersion.obj \
+     winvnc\videodriver.obj \
+     winvnc\vncmemcpy.obj \
+     winvnc\vncEncodeUltra.obj \
+     ..\lzo\minilzo.obj \
+     winvnc\vncntlm.obj \
+     ..\zipunzip32\zipunzip32.obj
+
+LIBS=..\zlib\zlib.lib ..\rdr\rdr.lib ..\libjpeg\libjpeg.lib VNCHooks\VNCHooks.lib
+
+RES=winvnc\winvnc.res
+
+.autodepend
+.c.obj:
+	$(CC) -c $(CFLAGS) $<
+.cpp.obj:
+	$(CC) -c $(CFLAGS) $<
+.cxx.obj:
+	$(CC) -c $(CFLAGS) $< 
+
+.rc.res:
+	echo:>afxres.h
+	$(RC) -r $<
+	del afxres.h
+
+winvnc.exe: $(OBJS) $(LIBS) $(RES)
+	$(LD) $(LDFLAGS) c0w32 $(OBJS), $@, , $(LIBS) import32 cw32mt, , $(RES)
+
+..\zlib\zlib.lib:
+	cd ..
+	cd zlib
+	make -fMakefile.bcc32 -l -s
+	cd ..
+	cd winvnc
+
+..\rdr\rdr.lib:
+	cd ..
+	cd rdr
+	make -fMakefile.bcc32 -l -s
+	cd ..
+	cd winvnc
+
+..\libjpeg\libjpeg.lib:
+	cd ..
+	cd libjpeg
+	make -fMakefile.bcc32 -l -s
+	cd ..
+	cd winvnc
+
+VNCHooks\VNCHooks.lib:
+	cd VNCHooks
+	make -fMakefile.bcc32 -l -s
+	cd ..
+
+omnithread\omnithread.obj:
+	cd omnithread
+	build-bcc32.bat
+	cd ..
+
+clean:
+	del *.obj winvnc.exe
+
diff --git a/ica/win32/winvnc/building.txt b/ica/win32/winvnc/building.txt
new file mode 100644
index 0000000..567230d
--- /dev/null
+++ b/ica/win32/winvnc/building.txt
@@ -0,0 +1,40 @@
+NOTES ON BUILDING WINVNC:
+
+The WinVNC project file (WinVNC.dsp) contains four sets of project
+settings.  The settings required to re-build the publicly released
+executable are stored in the Release configuration.
+
+The public configurations are:
+
+///////////////////////////////////////////////////////////////////////////
+
+Release -	This is the intended build configuration for external use
+			and is used directly to create the distributed executables.
+			This configuration is identical to the Release (CORBA) configuration,
+			barring the use of the definition NCORBA rather than the
+			definition _CORBA.
+
+**>		Use this release when building WinVNC for general distribution.	<**
+
+Debug -		The public debug build.  This builds debug executables and
+			libraries, equivalent in all other respects to the release builds.  
+
+///////////////////////////////////////////////////////////////////////////
+
+Internally, AT&T Labs and the Laboratory for Communications Engineering use
+CORBA-based session-management.  Within the labs, the following builds are used
+in place of the public builds above.
+
+Release (CORBA) -
+			Release build providing session management interface.
+			This build assumes the presence of CORBA session-control code
+			in the vncCorbaConnect files.  These are not supplied
+			as part of the public release distribution because
+			they are dependent upon AT&T infrastructure.
+
+Debug (CORBA) -
+			Debug build providing session management.  This build
+			also assumes the presence of the CORBA session-control
+			routines.
+
+///////////////////////////////////////////////////////////////////////////
diff --git a/ima/src/qplatformdefs.h b/ica/win32/winvnc/crtdbg.h
similarity index 100%
rename from ima/src/qplatformdefs.h
rename to ica/win32/winvnc/crtdbg.h
diff --git a/ica/win32/winvnc/history.txt b/ica/win32/winvnc/history.txt
new file mode 100644
index 0000000..68025c0
--- /dev/null
+++ b/ica/win32/winvnc/history.txt
@@ -0,0 +1,740 @@
+WinVNC Version History
+
+	The AllowEditClients registry option is used like AllowProperties,
+	and allows VNC to be configured not to show the Add New Client or
+	Kill All Clients menu items in the tray icon menu.
+
+	Implemented the -reinstall option, which unregisters the WinVNC
+	service if registered, then re-registers it.
+
+	Fixed bug in fast blit code when pixel format changes from one
+	supporting fast blits to a munged format.
+
+Version 3.3.4b1 (RealVNC Version 3.3.4, Beta Release 1)
+Changes from AT&T Labs' Version 3.3.3 Revision 10:
+
+	Delphi apps should no longer crash when run alongside VNC.
+
+	WinVNC nows gives a slightly more useful error message if -install is used
+	while the service is already registered,
+
+	The logging-related buffer overflow exploits should no longer be possible.
+
+	Added several options to the Properties dialog.
+
+	The current password is not stored in the Properties dialog when
+	displayed, preventing it from being read by other programs.
+
+	The HTTP server can be disabled by the HTTPConnect registry key.
+
+	LockSettings can now lock Windows 2000/XP boxes on disconnect.
+
+	Improved update tracking code.
+
+	Fixed LF/CRLF problem in HTTP server.
+
+	Clients are no longer disconnected if pixel format changes.
+	They WILL be disconnected if the display size changes.
+
+	Update hooking and transmission now decoupled.
+
+	Optimised checking of update regions for changes for case where
+	clients are connected which do not request updates (often).
+
+	Optimised for multiple simultaneous client connections.
+
+	Upgraded omnithread library.
+
+	Rationalised source tree a little.
+
+	Renamed "log" to "vnclog" to avoid log() function clashes.
+
+Version 3.3.3 (VNC Version 3.3.3, revision 10)
+Changes from Version 3.3.3 Revision 9:
+
+	Fixed signature of RegisterServiceProcess.
+
+	Fixed incorrect call of errno to call wsagetlasterror.
+
+	Fixed keymapping of circumflex character, etc.
+
+	Added extra debug logging in desktop hook code.
+
+	Removed warning about connected users in logoff handling code.
+
+Version 3.3.3 (VNC Version 3.3.3, revision 9)
+Changes from Version 3.3.3 Revision 8:
+
+	Fixed handling of empty (match all) AuthHosts filters.
+
+	WinVNC.log will now be moved to WinVNC.log.bak when WinVNC runs.
+
+Version 3.3.3 (VNC Version 3.3.3, revision 8)
+Changes from Version 3.3.3 Revision 7:
+
+-=-	Bug Fixes to WinVNC:
+
+	Fixed clipboard handling.
+
+	Fixed AddClient semantics in vncServer to avoid a socket leak.
+
+	Fixed AuthHosts dialog display.  Now flashes titlebar/tray button if not foreground window.
+
+	Fixed AuthHosts string parsing.  Filters such as 10.0.0.1 no longer match 10.0.0.10.
+
+	QuerySetting didn't work correctly if the AuthHosts string was empty.  Fixed.
+
+	Closing the screen-saver now works, so it's back in there.
+
+	Changed the shutdown-dialog behaviour.  It now only operates in application mode.
+
+-=-	Bug Fixes to VNCHooks:
+
+	Added HooksType() function to VNChooks so that the library may be replaced with a reliable
+	hooking version easily.
+	
+	VNCHooks DLL did not remove properties from windows correctly when
+	UnsetHooks() was called.  Fixed.
+
+-=-	Minor Fixes
+
+	Implemented the wallpaper-culling feature during remote connections.
+
+	Added automatic culling of "idle" connections, if required, via the IdleTimeout setting.
+	An idle connection is one in which the client has sent no data for a fixed period,
+	whether the data be an update request, input events, or clipboard data.
+
+	Only incoming connections are now checked for validity.  Outgoing (Add New Client)
+	or CORBA-initiated connections are not checked via AuthHosts.
+
+Version 3.3.3 (VNC Version 3.3.3, revision 7)
+Changes from Version 3.3.3 Revision 6:
+
+	WinVNC did not correctly handle Winsock1.1, causing all client connections to be
+	erroneously dropped by the anti-DoS code.  Now fixed.
+
+Version 3.3.3 (VNC Version 3.3.3, revision 6)
+Changes from Version 3.3.3 Revision 4:
+
+	The anti denial-of-service blacklist code was very buggy.  It's now fixed.
+
+	An serious potential deadlock condition in the negotiation phase of new
+	clients has been fixed.  The problem was incredibly rare on uniprocessors
+	but much more noticable on multiprocessors, unsurprisingly.
+
+	Pointer is now rendered slightly better.
+
+Version 3.3.3 (VNC Version 3.3.3, revision 4)
+Changes from Version 3.3.3 Revision 3:
+
+	Implemented some simple Denial-of-Service protection.  After five consecutive failed
+	connection attempts from a client, that client is "blacklisted" for ten seconds.
+	In addition, connections which hang before the authentication stage has completed are
+	timed out after thirty seconds, to prevent malicious users gradually eating up socket
+	resources.
+
+	Corrected a bug initialising the back-buffer.
+
+	Added hooking for dialog boxes, menus and scrollbars.  Seems to fix some dialogs but not
+	many scrollbars or menus..
+
+	Improved the GetChangedRect code with some alignment patches suggested by Will Dean.
+
+	Fixed an *IDIOTIC* bug in the handling of user-specific settings.  They were completely
+	broken before.  Now they should work.  I'm such an idiot.  Idiot idiot idiot.
+	See MS Knowledge Base articles Q168877 & Q199190.
+
+	The idiot bug-fix above broke roaming profiles on NT domains!  That's now fixed, too.
+	Idiot idiot idiot.
+
+	Added a dialog to query whether to accept or reject incoming connections.  The dialog is
+	currently controlled ONLY via the registry!  The AuthHosts setting is now extended, while
+	some new user-specific settings are provided so that users can tailor the query feature.
+	Relevant keys are:
+	- QuerySetting (DWORD) (local&global user-specific)
+		[Least secure]
+		0 - Accept or Query.  If AuthHosts says Reject then query, otherwise Accept.
+		1 - Accept or Reject.  Reject if AuthHosts says so, otherwise Accept.
+		2 - Obey AuthHosts.  Obey AuthHosts Accept, Query, Reject settings. [Default!]
+		3 - Query or Reject.  If AuthHosts says Reject then Reject, otherwise Query.
+		4 - Ultimate Paranoia.  If AuthHosts says Accept then Query, otherwise Reject!
+		[Most secure]
+
+		Summary:	Actual Effect
+		Setting		Accept	Query	Reject
+		0			a		a		q
+		1			a		a		r
+		2			a		q		r
+		3			q		q		r
+		4			q		r		r
+
+	- QueryTimeout (DWORD) (local&global user-specific)
+		Number of seconds before Accept/Reject dialog should timeout and reject.
+	- AuthHosts (SZ) (machine-local)
+		Match terms may now start with "-", "+" or "?".  "?" indicates that the connection
+		attempt should be queried.
+
+Version 3.3.3 (VNC Version 3.3.3, revision 3)
+Changes from Version 3.3.3 Revision 2:
+
+	Implemented Will Dean's DIBsection patch to retrive screen data.  This reduces
+	both the retrieval time & the memory usage of WinVNC but currently only works
+	for VNC-format-compatible 16 and 32 bit displays.  If your display is incompatible
+	then WinVNC falls back to the old, slow, memory hungry mode.
+
+	Fixed a bug in VNCHooks which cause very large updates to be spuriously created on occasion.
+
+	vncKeymap now filters out the three Lock keys (CapsLock, NumLock, ScrollLock), so that
+	they can be safely used at the client side without generating random keystrokes on the
+	server.
+
+Version 3.3.3 (VNC Version 3.3.3, revision 2)
+Changes from Version 3.3.3 Revision 1:
+
+	Added the new "Disable Local Keyboard & Pointer" option to the Properties dialog.
+	This features currently allows the keyboard & pointer of the sever machine to be
+	disabled while a remote connection is in progress.
+	The feature only works under Windows NT at present.
+	NB:This is a BETA feature, with a known limitation - if the setting
+	is changed then all clients must disconnect and reconnect to achieve the desired
+	effect.
+
+	The -connect command-line option has been added, allowing new outgoing connections
+	to be made using a script or an icon.
+
+	The Add New Client and -connect options now make shared outgoing connections, since
+	this is usually preferable to unshared outgoing connections.
+
+	Improved the way preferences are loaded, reducing the number of times the client will
+	be disconnected when settings are loaded & saved.
+
+Version 3.3.3 (VNC Version 3.3.3, revision 1)
+Release version, patched for HTML bug below.
+
+	[The initial 3.3.3 release featured a bug in the rendering of HTML for the Java-based
+	viewer.  3.3.3 was quickly withdrawn and 3.3.3R1 is now the base Version 3.3.3 release.]
+
+	-=- NEW FEATURES:
+
+	REGISTRY SETTINGS ARE NOW LOADED CORRECTLY FROM THE CURRENT_USER REGISTRY HIVE!
+	When running as a service under Windows NT, WinVNC was unable to correctly load
+	settings stored in the current user's HKEY_CURRENT_USER hive.  As a workaround
+	for this, a special helper-hook is installed when the service itself is
+	installed.  The helper-hook runs when a user logs in and passes enough information
+	to the WinVNC service for it to locate their preferences correctly.
+	If the helper hook fails to install or isn't run for some reason, then WinVNC
+	will continue to operate based on ALL the WinVNC HKEY_LOCAL_MACHINE settings.
+
+	A new command-line option, -defaultsettings, has been added, which will cause the
+	running WinVNC server to show a Default Properties dialog, through which the default
+	local properties can be editted.  (While the dialog is displayed, the properties used
+	will be the default ones.  When it dissappears, WinVNC reverts to the user's settings.)
+
+	Nagle's algorithm is now disabled on all WinVNC connections, decreasing latency
+	considerably.
+
+	Timestamp information is now added in the debug log output.
+
+	Limited client IP-address based filtering of connections is now supported.
+	The new Machine-Local registry setting "AuthHosts" may be specified, and should
+	be of type "string".
+	Match terms look like:
+		+<ip-address-template>
+		-<ip-address-tamplate>
+	where ip-address-template is the leftmost bytes of the stringified IP-address,
+	e.g. 158.97 would match both 158.97.54.1 and 158.97.128.6, for example.
+	Multiple Match terms may be specified, delimited by the ':' character.
+	Match terms later in the list take precedence over earlier ones.
+	e.g. -:+158.97:
+	[This scheme does not currently filter by DNS name]
+
+	In addition to the above, incoming connections may be restricted on a server-wide
+	basis to being accepted only on the local-loopback interface.  This is controlled
+	through the LoopbackOnly registry setting, which overrides the AllowLoopback and
+	AuthHosts settings when active.
+
+	The WinVNC priority is now increased while processing its message queue and put
+	back to normal while preparing updates for sending.  This results in apparent
+	increase in performance, particularly when used in conjunction with some common
+	applications.
+
+	The machine's name is now included in the title of the web page used to access the
+	Java version of the VNC client.
+
+	-=- BUG FIXES:
+	- Major:
+
+	Under Windows NT, a handle was leaked whenever the SelectDesktop function was
+	called to move a thread into a different desktop.  In practice, this meant a leak
+	everytime someone logged in, connected remotely, or used C-A-D to access security
+	features in NT.  Not pretty.
+
+	Related to the above fix:  When simulating Ctrl-Alt-Del, WinVNC would switch a
+	dedicated thread into the WinLogon desktop to achieve the desired effect.  When
+	the thread quit, the handle to the WinLogon desktop was not properly freed by
+	WinNT.  This is now worked around by WinVNC internally.
+
+	When killing the vncServer object, a race condition occurred because
+	WaitUntilAuthEmpty() was used to wait for ALL clients being removed - potentially,
+	there could have been active, unauthorised clients connected to the vncServer
+	object, which would crash if the server object was deleted before they had quit.
+	A new function, WaitUntilUnauthEmpty, is now used as well as WaitUntilAuthEmpty,
+	to remove this race condition.
+
+	- Minor:
+
+	The LockSetting option was not correctly loaded by the Properties class in some
+	common cases.  This is now fixed.
+
+	WinVNC was using ExitWindows but specifying parameters according to the
+	specification of ExitWindowsEx.  ExitWindowsEx is now used instead.
+
+	-=- OTHER MODIFICATIONS:
+
+	When starting up without a password set, WinVNC will first check whether the
+	Properties dialog has been disabled with AllowProperties=0 before attempting
+	to open it for the user to set one.  Instead a dialog indicating the problem
+	will be displayed.
+
+	-=- NOTES:
+
+	BUGLET:PLANAR vs CHUNKY.  It transpires that problems encountered with WinVNC and
+	16-colour Windows 95 displays are due to Win95 VGA drivers giving a "planar" view
+	of the world.  Internally, Win95 is very bad at handling planar pixels and is
+	also very bad at making them chunky.  WinNT does not have this problem.  A new
+	error dialog has been added to warn about this problem on Win95.
+
+Version 3.3.2 (VNC Version 3.3.2, revision 8)
+Changes from revision 7:
+
+	Fix in VNCHooks.cpp (part of the WinVNC hooks library) to place
+	the hook handles in a shared segment of DLL memory, so that they are correctly
+	accessed by the hook code itself.
+
+	Fix in vncKeymap.cpp which should sort out the CapsLock on connect problem.
+
+	Added an Initiate Outgoing Connection (Add New Client) dialog.  If a machine is
+	running a vncviewer with the -listen option then WinVNC can be made to export
+	the display it is managing to this listening viewer.
+
+	NOTE : Outgoing connections are treated as 'non-shared'.
+
+	NOTES ON BUILDING UNDER VC6:
+	For compatibility reasons, WinVNC will remain a VC5 distribution for the moment.
+	However, some problems arise when compiling WinVNC under VC6.
+
+		- vncControl.idl is not supplied in the distribution and is ONLY USED
+			INTERNALLY at the AT&T Labs Cambridge.
+			It is disabled in the VC5 version of the project but conversion to VC6 format
+			re-enables it.
+		Solution : remove vncControl.idl from the project once it is imported into
+		Visual C++ 6, before compilation.
+
+	Fixed minor bug in Log.cpp code relating to invalid handles being returned by file
+	open call
+
+Version 3.3.2 (VNC Version 3.3.2, revision 7)
+Changes from revision 6:
+
+	Fixed HANDLE to HINSTANCE casting problem in VNCHooks.cpp, which prevented WinVNC
+	from compiling under Microsoft Visual C++ 6.0
+
+	Tray icon is now refreshed every five seconds.  This may help detect dynamically added
+	IP addresses correctly
+
+	Every five seconds, WinVNC will re-attempt to add the tray icon, even under Win95.
+	If Explorer crashes or Windows 95 is being run then this should ensure the icon appears.
+
+Version 3.3.2 (VNC Version 3.3.2, revision 6)
+Changes from revision 5:
+
+	Fixed minor protocol non-compliance bug with regard to clients which fail to send
+	SetPixelFormat messages.
+
+	Fixed DOS-prompt polling under Windows 95.  DOS boxes are now polled correctly.
+
+Version 3.3.2 (VNC Version 3.3.2, revision 5)
+Changes from revision 4:
+
+	Prepared WinVNC for release.
+	
+	Fixed AuthRequired race condition.
+
+	Fixed AutoPortSelect bug.
+
+Version 3.3.2 (VNC Version 3.3.2, revision 4)
+Changes from revision 3:
+
+	Fixed a tray icon bug, in which the tray icon was being produced before the menu
+	had been loaded.
+
+	Replaced the thread package with the latest version, which fixes a few resource leaks.
+
+	Mouse events are now produced to reflect those sent on the wire, regardless of whether
+	the mouse buttons would locally be swapped by the OS.  This means that left- or right-
+	handedness is a client-side feature.
+
+Version 3.3.2 (VNC Version 3.3.2, revision 3)
+Changes from revision 2:
+
+	SETTINGS REORGANIZED!
+	The WinVNC registry settings have now been reorganized and improved to allow better
+	control over individual user's capabilities when running it, whether as an application
+	or as a service.
+
+	Local machine settings are stored under HKEY_LOCAL_MACHINE/Software/ORL/WinVNC3
+	Local per user settings are stored under HKEY_LOCAL_MACHINE/Software/ORL/WinVNC3/<username>
+	Local default user settings are stored under HKEY_LOCAL_MACHINE/Software/ORL/WinVNC3/Default
+	Local no-user settings are stored under HKEY_LOCAL_MACHINE/Software/ORL/WinVNC3/SYSTEM
+	Global per user settings are stored under HKEY_CURRENT_USER/Software/ORL/WinVNC3
+	
+	These groups of settings have the following priority:
+	1.	Machine settings are always read, from the machine settings location.  Not overridable.
+	2.	Default user settings are read.
+	3.	Local-machine, per-user settings are read for the current user, or for SYSTEM if
+		there is no current user.  These override the Default settings.
+	4.	If AllowProperties is not zero, the global per-user settings are read.
+		These override both the Default settings & the local-machine, per-user settings.
+
+	- Local Only, Machine Settings		: DebugMode, DebugLevel, AllowLoopback,
+									AuthRequired, ConnectPriority.
+	- Local Only, Per User Settings		: AllowShutdown, AllowProperties.
+	- Local/Global, Per User Settings	: SocketConnect, AutoPortSelect, PortNumber, Password,
+									CORBAConnect, InputsEnabled, LockSetting, PollUnderCursor,
+									PollForeground, PollFullScreen, OnlyPollConsole,
+									OnlyPollOnEvent
+
+	UPDATE ROUTINES FIXED!
+	If a client chose to send multiple update requests to the server without waiting for
+	the update data, then the server would only consider the last request.  This behaviour
+	was incorrect and has now been fixed.  As a result, WinVNC will now work properly with
+	the PalmVNC viewer.
+
+	HTTP SERVER FIXED!
+	The HTTP server section of WinVNC could end up listening on the wrong port number when
+	automatic display number selection was in use.  This is now fixed.
+
+	MEMORY LEAK FIXED!
+	A small memory leak in the WinNT side of the vncService::CurrentUser function has been fixed.
+	Although the amount lost on each execution was small, the function is called often enough
+	for this to cause problems over long periods of use.
+
+	Established that the Ctrl-Alt-Del problem under NT 3.51 is because GetAsyncKeyState for
+	ctrl and alt ALWAYS returns zero.  Don't know why...
+
+	Fixed a potential lockup when the Properties dialog is closed by the OS rather than by
+	the Ok or Cancel buttons.
+
+Version 3.3.2 (VNC Version 3.3.2, revision 2)
+Changes from revision 1:
+
+	CTRL-ALT-DEL IMPROVED!
+	Ctrl-Alt-Del will now work both with the Delete key and with the keypad Del key, from
+	Unix clients.  Unix clients treat these two keys differently but Windows doesn't, so
+	WinVNC now maps both on to VK_DELETE internally.
+
+	MENU UPDATES IMPROVED!
+	Extra hook code has been added to the VNCHooks library to catch the messages used to
+	update the contents of pop-up menus, etc.  As a result, menus tend to suffer much less
+	from the characteristic colour-smear effect.
+
+	Code is now in place to perform automatic locking or logoff of the workstation
+	when all remote clients have closed, for security reasons.  Unfortunately, the
+	LockWorkstation function doesn't work on pre-NT5 machines, so only the logoff
+	functionality is implemented.
+
+	The new ConnectPriority option is available, on a per-machine basis.  The
+	HKEY_LOCAL_MACHINE/Software/ORL/WinVNC3/ConnectPriority
+	setting can take one of three values:
+		0 - new, non-shared incoming connections kick off existing ones.
+		1 - all incoming connections are treated as shared, regardless of the -shared viewer option.
+		2 - new, non-shared incoming connections will be refused if a current connection exists.
+
+	Automatic display number selection is now available.  This option is set through the WinVNC
+	properties dialog.  When this option is used, the display number parameter in the dialog
+	is ignored and the display number to use is instead allocated on the fly by WinVNC.
+
+Version 3.3.2 (VNC Version 3.3.2, revision 1)
+Changes from base 3.3.2 release:
+
+	PALETTE-BASED CLIENTS SUPPORTED!
+	Clients which request 8-bit palette-based data are now supported by WinVNC.
+	Palette-based clients will get the best results from 8-bit palette mode
+	servers, due to the way in which truecolour is culled into 8-bit palettes.
+	svncviewer will now work with 8-bit WinVNC desktops as well as Xvnc ones.
+
+	LOGGING SUPPORTED!
+	Run-time logging of all internal debug messages is now supported.  Log data
+	may be output to a file or a console window (or the MSVC debugger if the
+	program was compiled with debugging active.)
+	Two registry keys under HKEY_LOCAL_MACHINE/Software/ORL/WinVNC3 are used:
+	DebugMode indicates which logging methods to use.
+		[1 = MSVC debugger]
+		2 = Output to log file Winvnc.log in the WinVNC directory
+		4 = Output to a console window, displayed on-screen
+	Any combination of the above values may be used.
+	DebugLevel indicates how much debug information to present.  Any positive
+	integer is valid.  Zero indicates that no debugging information should be
+	produced and is the default.
+
+	Loopback (local-machine) connections to WinVNC will now be allowed if the
+	HKEY_LOCAL_MACHINE/Software/ORL/WinVNC3/AllowLoopback registry entry is set
+	to 1.  The default is 0.
+
+	Connections may now be made to WinVNC servers without requiring authentication
+	if the HKEY_LOCAL_MACHINE/Software/ORL/WinVNC3/AuthRequired registry entry is
+	set to 0.  The default is 1.
+
+	Microsoft Developer Studio configurations are included (but not tested) for 
+	Alpha NT, to make compilations for this platform more straightforward.
+
+	CopyRect is now handled differently and tends to give better results when
+	windows are dragged around the screen.
+
+	All notifications of potential updates to the screen are cached into a vncRegion
+	object in the vncDesktop thread and are only flushed to clients immediately
+	before TriggerUpdate is called, to improve performance.
+
+	Added a delay when the -kill option is used, to give the running copy time to quit.
+
+	Fixed a CopyRect-related bug which caused windows to scroll oddly when dragged
+	partially off the left or top of the screen.
+
+Version 3.3.2 (VNC Version 3.3.2)
+Release version.
+
+Version 3.3.1 (VNC Version 3.3, revision 20a)
+Changes from revision 19:
+
+	WinVNC now returns explanatory message text to the viewer when an incoming
+	connection is refused because of an empty Password field or a local-loopback
+	connection.
+
+	Mouse movements are now pre-processed by the Desktop handler and only passed to
+	the Client handlers immediately before an update is triggered, resulting in less
+	overhead and therefore lower latency.
+
+	If a client requests the CopyRect encoding in the list of encodings it supports
+	then WinVNC will now use the CopyRect primitive when doing simple tasks like
+	dragging windows.  This still has some flaws in it but generally improves performance.
+
+	Updated the Java classes exported by WinVNC to include the Send-Ctrl-Alt-Del button.
+
+	Added a "-about" option, which will cause an _already running_ copy of WinVNC to
+	display its About box, making it easier to check that you have the latest version!
+
+	Added version information to the VNCHooks Dynamic Link Library.  This can be viewed
+	selecting the properties dialog for the vnchooks.dll file.
+
+Version 3.3.1 (VNC Version 3.3, revision 19)
+Changes from revision 17:
+
+	A bug in the new region culling routine was fixed.
+
+Version 3.3.1 (VNC Version 3.3, revision 17)
+Changes from revision 16:
+
+	WIN-NT & WIN-95:
+
+	MS-DOS applications can now by typed into!  Thanks to Gur Stavi for pointing
+	out that WinVNC didn't previously generate keyboard scancodes for key events.
+	This means that the COMMAND.COM and EDIT programs, for example, may now be
+	used through VNC.
+
+	Lookup-table based colour translations are now incorporated into WinVNC.
+	This means an increase in memory usage but delivers a noticable performance
+	boost on most screen formats.
+
+	1, 4 and 8 bit palette-based local displays are now handled directly by
+	WinVNC, resulting in a significant performance boost, although there are
+	currently problems with the palette layout being confused in places.
+
+	More intelligent culling of unchanged regions of the screen from the list of
+	rectangles to be sent has been implemented.  Generally, this isn't noticable
+	but over low-bandwidth links, it should have a significant effect.
+
+	WM_ENDSESSION is handled properly for full system shutdown.
+
+	WM_DISPLAYCHANGE is now handled, so that when the display resolution changes,
+	all remote VNC users are disconnected, to prevent corrupt display updates.
+
+	The mouse cursor rendered to VNC clients is now correct most of the time.
+
+	When installing WinVNC as a service, quotes are now placed around the
+	executable's name, to avoid problems if there are whitespace characters
+	in the path.  (Common because of installing to "program files\orl\vnc")
+
+	The command-line options available have changed slightly:
+	-run			Causes WinVNC to run normally & ignore rest of command-line.
+	-install		Installs the WinVNC service and continues reading the command-line.
+	-remove			Removes the WinVNC service and continues reading the command-line.
+	-settings		Tells a running copy of WinVNC to show its Properties box.
+	-kill			Kills a running copy of WinVNC.
+	If no options are given then WinVNC runs normally.
+	Multiple option may be given, so, for example, to upgrade from a running copy
+	if WinVNC to a new one, you could use:
+		WinVNC_new -remove -install
+	which will stop & remove the old copy & install the new one, or
+		WinVNC_new -kill -run
+	which will stop the running copy & run the new version normally.
+
+	The Java viewer class files have been updated.  The new classes are slightly more
+	compatible with borderline Java VMs.
+
+	Deferred update messages are no longer removed from the application's message queue
+	behind it's back, hopefully resulting in more reliable behaviour & fewer lock-ups.
+
+	The screen-saver is now not disabled when WinVNC is running in service mode and a
+	connection is made, to avoid a potential race condition.  This will be handled better
+	in a future revision.
+
+	WIN-NT ONLY:
+
+	When running as a system service, WinVNC no longer disconnects all remote
+	VNC connections whenever the current desktop changes.
+
+	Corrected some problems with shift-key release code confusing Windows NT.
+
+	WIN-95 ONLY:
+
+	WM_USERCHANGED is handled, so that when no user is logged in, the
+	machine-local password is used, otherwise the user's own VNC password and
+	settings are used.
+	(This assumes that Windows 95 is set to Multiple User Profile mode)
+
+	Under Windows 95, WinVNC running in service mode no longer crashes when
+	told to stop by the -kill or -remove options.
+
+	The main text area of the Windows 95 console will now be polled by WinVNC
+	properly when the Poll Console Windows Only option is set.
+
+Version 3.3.1 (VNC Version 3.3, revision 16)
+Changes from revision 15:
+
+	The Revision 15 build was broken due to file timestamp corruption.
+	Revision 16 is a complete re-build.
+
+Version 3.3.1 (VNC Version 3.3, revision 15)
+Changes from revision 13:
+
+	WIN-NT & WIN-95:
+
+	WinVNC will now run as a service on both Windows NT and Windows 95.
+	Running WinVNC with the -install command-line option will install it into the system
+	service control manager and set it to auto-run on bootup.  The -remove option will stop
+	the service if necessary and will then remove it.
+	WIN-95 : winvnc -install will cause the service to run immediately.
+	WIN-NT : winvnc -install will install the service into the manager but not start it.
+
+	To allow the per-machine settings for WinVNC to be changed even when WinVNC is running as
+	a service, the "-settings" option will cause the service to pop-up the properties dialog.
+
+	A bug which often caused the entire screen to be transmitted twice to a connecting
+	client is now fixed.
+
+	The general Shift, Alt and Control-related bugs, affecting non-UK/US keyboard layouts in
+	particular, are now corrected, with one important exception, mentioned in the NOTES
+	section below.
+
+	WIN-NT ONLY:
+
+	Ctrl-Alt-Del can be simulated by WinVNC if a client sends it, allowing users to log on
+	and off and to lock the workstation remotely.
+
+	WIN-95 ONLY:
+
+	Shift, Alt and Control were broken in Revision 13, since Windows 95 cannot distinguish
+	left and right shift keys at all.  This is now fixed.
+
+	NOTES:
+
+	When typing into an application set to use keyboard layout A, using WinVNC run with
+	keyboard layout B, problems may be experienced because of WinVNC setting the wrong Shift
+	key states to generate particular characters.  As long as only one keyboard layout is used
+	consistently across all applications, this shouldn't be a problem.
+
+Version 3.3.1 (VNC Version 3.3, revision 13)
+Changes from revision 12:
+
+	The Caps-Lock, Num-Lock and Scroll-Lock keys are now correctly disabled whenever a new
+	client connects, if that client has keyboard input enabled.
+
+	Left and right versions of the Shift, Alt and Control keys can now be distinguished.
+
+	The right and middle mouse buttons can now be set to trigger updates, although by default
+	these options are not used.
+
+Version 3.3.1 (VNC Version 3.3, revision 12)
+Changes from revision 10:
+
+	It is now no longer possible to accept unauthenticated incoming connections.
+
+	If WinVNC fails to access the local root window then any remote connection will be refused.
+
+Version 3.3.1 (VNC Version 3.3, revision 10)
+Changes from revision 9:
+
+	Black-background initial update bug is now fixed.
+
+	Border redrawing bug is now fixed.
+
+Version 3.3.1 (VNC Version 3.3, revision 9)
+Changes from revision 8:
+
+	Local connections to WinVNC servers are now filtered out.
+
+	The OMNIthread package is now included as part of the WinVNC source distribution.
+
+	The VTypes header file is now included in the WinVNC source distribution.
+
+	WM_NCPAINT messages are hooked, resulting in better updates of window borders.
+
+Version 3.3.1 (VNC Version 3.3, revision 8)
+Changes from revision 5:
+
+	The resource leak while rendering the mouse pointer has been fixed.
+
+	The WinVNC tray icon changes colour when there is a remote connection.
+
+	An Apply button has been added to the Properties dialog so that it can be used as the main
+	WinVNC window on Windows NT 3.51 (or any other system without a system tray.)
+
+	The Non-CORBA installer now generates an uninstall option properly.
+
+	WinVNC may now be run in a view-only mode, in which remote users have no control.
+
+Version 3.3.1 (VNC Version 3.3, revision 5)
+Changes from revision 4:
+
+	The machine name is now converted to lowercase to get the desktop name.
+
+	The CORBA control object is properly removed from the Naming Service on exit.
+
+Version 3.3.1 (VNC Version 3.3, revision 4)
+Changes from revision 1:
+
+	WinVNC now warns if no password has been set for the current user.
+
+Version 3.3.1 (VNC Version 3.3, revision 1)
+Changes from version 3.05:
+
+	WinVNC now listens on a socket for incoming HTTP connections and produces HTML accordingly.
+	This allows the server to be connected to from any web browser that supports Java, without
+	any plug-ins or other software having to be installed on the client system.
+
+	The server now copes gracefully with the absence of a valid CORBA setup and warns the user.
+
+	Any previous, running instance of WinVNC is detected, to prevent further instances from
+	running.
+
+	The new, DES-based authentication scheme is used. This results in incompatibility with VNC
+	clients using version 3.2 or lower of the protocol. To avoid this problem, connect via the
+	HTTP interface, which provides the correct version of the Java viewer. Version 3.3+ based
+	clients will handle the new scheme correctly.
+
+	Shared VNC client connections are now fully supported.
+
+James "Wez" Weatherall
+7 November 1997
+
+
diff --git a/ica/win32/winvnc/libjpeg-turbo-win/jpeglib.h b/ica/win32/winvnc/libjpeg-turbo-win/jpeglib.h
new file mode 100644
index 0000000..79cdbd1
--- /dev/null
+++ b/ica/win32/winvnc/libjpeg-turbo-win/jpeglib.h
@@ -0,0 +1,2 @@
+#include <jpeglib.h>
+
diff --git a/ica/win32/winvnc/lzo/minilzo.h b/ica/win32/winvnc/lzo/minilzo.h
new file mode 100644
index 0000000..e6e472a
--- /dev/null
+++ b/ica/win32/winvnc/lzo/minilzo.h
@@ -0,0 +1,2 @@
+#include <minilzo.h>
+
diff --git a/ica/win32/winvnc/omnithread/nt.cpp b/ica/win32/winvnc/omnithread/nt.cpp
new file mode 100644
index 0000000..5531d5c
--- /dev/null
+++ b/ica/win32/winvnc/omnithread/nt.cpp
@@ -0,0 +1,965 @@
+//				Package : omnithread
+// omnithread/nt.cc		Created : 6/95 tjr
+//
+//    Copyright (C) 1995-1999 AT&T Laboratories Cambridge
+//
+//    This file is part of the omnithread library
+//
+//    The omnithread 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
+//    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+//    02111-1307, USA
+//
+
+//
+// Implementation of OMNI thread abstraction for NT threads
+//
+
+#include <stdlib.h>
+#include <errno.h>
+#include "omnithread.h"
+#include <process.h>
+
+#define DB(x) // x 
+//#include <iostream.h> or #include <iostream> if DB is on.
+
+static void get_time_now(unsigned long* abs_sec, unsigned long* abs_nsec);
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Mutex
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+omni_mutex::omni_mutex(void)
+{
+    InitializeCriticalSection(&crit);
+}
+
+omni_mutex::~omni_mutex(void)
+{
+    DeleteCriticalSection(&crit);
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Condition variable
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+//
+// Condition variables are tricky to implement using NT synchronisation
+// primitives, since none of them have the atomic "release mutex and wait to be
+// signalled" which is central to the idea of a condition variable.  To get
+// around this the solution is to record which threads are waiting and
+// explicitly wake up those threads.
+//
+// Here we implement a condition variable using a list of waiting threads
+// (protected by a critical section), and a per-thread semaphore (which
+// actually only needs to be a binary semaphore).
+//
+// To wait on the cv, a thread puts itself on the list of waiting threads for
+// that cv, then releases the mutex and waits on its own personal semaphore.  A
+// signalling thread simply takes a thread from the head of the list and kicks
+// that thread's semaphore.  Broadcast is simply implemented by kicking the
+// semaphore of each waiting thread.
+//
+// The only other tricky part comes when a thread gets a timeout from a timed
+// wait on its semaphore.  Between returning with a timeout from the wait and
+// entering the critical section, a signalling thread could get in, kick the
+// waiting thread's semaphore and remove it from the list.  If this happens,
+// the waiting thread's semaphore is now out of step so it needs resetting, and
+// the thread should indicate that it was signalled rather than that it timed
+// out.
+//
+// It is possible that the thread calling wait or timedwait is not a
+// omni_thread. In this case we have to provide a temporary data structure,
+// i.e. for the duration of the call, for the thread to link itself on the
+// list of waiting threads. _internal_omni_thread_dummy provides such
+// a data structure and _internal_omni_thread_helper is a helper class to
+// deal with this special case for wait() and timedwait(). Once created,
+// the _internal_omni_thread_dummy is cached for use by the next wait() or
+// timedwait() call from a non-omni_thread. This is probably worth doing
+// because creating a Semaphore is quite heavy weight.
+
+class _internal_omni_thread_helper;
+
+class _internal_omni_thread_dummy : public omni_thread {
+public:
+  inline _internal_omni_thread_dummy() : next(0) { }
+  inline ~_internal_omni_thread_dummy() { }
+  friend class _internal_omni_thread_helper;
+private:
+  _internal_omni_thread_dummy* next;
+};
+
+class _internal_omni_thread_helper {
+public:
+  inline _internal_omni_thread_helper()  { 
+    d = 0;
+    t = omni_thread::self();
+    if (!t) {
+      omni_mutex_lock sync(cachelock);
+      if (cache) {
+	d = cache;
+	cache = cache->next;
+      }
+      else {
+	d = new _internal_omni_thread_dummy;
+      }
+      t = d;
+    }
+  }
+  inline ~_internal_omni_thread_helper() { 
+    if (d) {
+      omni_mutex_lock sync(cachelock);
+      d->next = cache;
+      cache = d;
+    }
+  }
+  inline operator omni_thread* () { return t; }
+  inline omni_thread* operator->() { return t; }
+
+  static _internal_omni_thread_dummy* cache;
+  static omni_mutex                   cachelock;
+
+private:
+  _internal_omni_thread_dummy* d;
+  omni_thread*                 t;
+};
+
+_internal_omni_thread_dummy* _internal_omni_thread_helper::cache = 0;
+omni_mutex                   _internal_omni_thread_helper::cachelock;
+
+
+omni_condition::omni_condition(omni_mutex* m) : mutex(m)
+{
+    InitializeCriticalSection(&crit);
+    waiting_head = waiting_tail = NULL;
+}
+
+
+omni_condition::~omni_condition(void)
+{
+    DeleteCriticalSection(&crit);
+    DB( if (waiting_head != NULL) {
+	cerr << "omni_condition::~omni_condition: list of waiting threads "
+	     << "is not empty\n";
+    } )
+}
+
+
+void
+omni_condition::wait(void)
+{
+    _internal_omni_thread_helper me;
+
+    EnterCriticalSection(&crit);
+
+    me->cond_next = NULL;
+    me->cond_prev = waiting_tail;
+    if (waiting_head == NULL)
+	waiting_head = me;
+    else
+	waiting_tail->cond_next = me;
+    waiting_tail = me;
+    me->cond_waiting = TRUE;
+
+    LeaveCriticalSection(&crit);
+
+    mutex->unlock();
+
+    DWORD result = WaitForSingleObject(me->cond_semaphore, INFINITE);
+
+    mutex->lock();
+
+    if (result != WAIT_OBJECT_0)
+	throw omni_thread_fatal(GetLastError());
+}
+
+
+int
+omni_condition::timedwait(unsigned long abs_sec, unsigned long abs_nsec)
+{
+    _internal_omni_thread_helper me;
+
+    EnterCriticalSection(&crit);
+
+    me->cond_next = NULL;
+    me->cond_prev = waiting_tail;
+    if (waiting_head == NULL)
+	waiting_head = me;
+    else
+	waiting_tail->cond_next = me;
+    waiting_tail = me;
+    me->cond_waiting = TRUE;
+
+    LeaveCriticalSection(&crit);
+
+    mutex->unlock();
+
+    unsigned long now_sec, now_nsec;
+
+    get_time_now(&now_sec, &now_nsec);
+
+    DWORD timeout;
+    if ((abs_sec <= now_sec) && ((abs_sec < now_sec) || (abs_nsec < now_nsec)))
+      timeout = 0;
+    else {
+      timeout = (abs_sec-now_sec) * 1000;
+
+      if( abs_nsec < now_nsec )  timeout -= (now_nsec-abs_nsec) / 1000000;
+      else                       timeout += (abs_nsec-now_nsec) / 1000000;
+    }
+
+    DWORD result = WaitForSingleObject(me->cond_semaphore, timeout);
+
+    if (result == WAIT_TIMEOUT) {
+	EnterCriticalSection(&crit);
+
+	if (me->cond_waiting) {
+	    if (me->cond_prev != NULL)
+		me->cond_prev->cond_next = me->cond_next;
+	    else
+		waiting_head = me->cond_next;
+	    if (me->cond_next != NULL)
+		me->cond_next->cond_prev = me->cond_prev;
+	    else
+		waiting_tail = me->cond_prev;
+	    me->cond_waiting = FALSE;
+
+	    LeaveCriticalSection(&crit);
+
+	    mutex->lock();
+	    return 0;
+	}
+
+	//
+	// We timed out but another thread still signalled us.  Wait for
+	// the semaphore (it _must_ have been signalled) to decrement it
+	// again.  Return that we were signalled, not that we timed out.
+	//
+
+	LeaveCriticalSection(&crit);
+
+	result = WaitForSingleObject(me->cond_semaphore, INFINITE);
+    }
+
+    if (result != WAIT_OBJECT_0)
+	throw omni_thread_fatal(GetLastError());
+
+    mutex->lock();
+    return 1;
+}
+
+
+void
+omni_condition::signal(void)
+{
+    EnterCriticalSection(&crit);
+
+    if (waiting_head != NULL) {
+	omni_thread* t = waiting_head;
+	waiting_head = t->cond_next;
+	if (waiting_head == NULL)
+	    waiting_tail = NULL;
+	else
+	    waiting_head->cond_prev = NULL;
+	t->cond_waiting = FALSE;
+
+	if (!ReleaseSemaphore(t->cond_semaphore, 1, NULL)) {
+	    int rc = GetLastError();
+	    LeaveCriticalSection(&crit);
+	    throw omni_thread_fatal(rc);
+	}
+    }
+
+    LeaveCriticalSection(&crit);
+}
+
+
+void
+omni_condition::broadcast(void)
+{
+    EnterCriticalSection(&crit);
+
+    while (waiting_head != NULL) {
+	omni_thread* t = waiting_head;
+	waiting_head = t->cond_next;
+	if (waiting_head == NULL)
+	    waiting_tail = NULL;
+	else
+	    waiting_head->cond_prev = NULL;
+	t->cond_waiting = FALSE;
+
+	if (!ReleaseSemaphore(t->cond_semaphore, 1, NULL)) {
+	    int rc = GetLastError();
+	    LeaveCriticalSection(&crit);
+	    throw omni_thread_fatal(rc);
+	}
+    }
+
+    LeaveCriticalSection(&crit);
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Counting semaphore
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+#define SEMAPHORE_MAX 0x7fffffff
+
+
+omni_semaphore::omni_semaphore(unsigned int initial)
+{
+    nt_sem = CreateSemaphore(NULL, initial, SEMAPHORE_MAX, NULL);
+
+    if (nt_sem == NULL) {
+      DB( cerr << "omni_semaphore::omni_semaphore: CreateSemaphore error "
+	     << GetLastError() << endl );
+      throw omni_thread_fatal(GetLastError());
+    }
+}
+
+
+omni_semaphore::~omni_semaphore(void)
+{
+  if (!CloseHandle(nt_sem)) {
+    DB( cerr << "omni_semaphore::~omni_semaphore: CloseHandle error "
+	     << GetLastError() << endl );
+    throw omni_thread_fatal(GetLastError());
+  }
+}
+
+
+void
+omni_semaphore::wait(void)
+{
+    if (WaitForSingleObject(nt_sem, INFINITE) != WAIT_OBJECT_0)
+	throw omni_thread_fatal(GetLastError());
+}
+
+
+int
+omni_semaphore::trywait(void)
+{
+    switch (WaitForSingleObject(nt_sem, 0)) {
+
+    case WAIT_OBJECT_0:
+	return 1;
+    case WAIT_TIMEOUT:
+	return 0;
+    }
+
+    throw omni_thread_fatal(GetLastError());
+    return 0; /* keep msvc++ happy */
+}
+
+
+void
+omni_semaphore::post(void)
+{
+    if (!ReleaseSemaphore(nt_sem, 1, NULL))
+	throw omni_thread_fatal(GetLastError());
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Thread
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+//
+// Static variables
+//
+
+omni_mutex* omni_thread::next_id_mutex;
+int omni_thread::next_id = 0;
+static DWORD self_tls_index;
+
+static unsigned int stack_size = 0;
+
+//
+// Initialisation function (gets called before any user code).
+//
+
+static int& count() {
+  static int the_count = 0;
+  return the_count;
+}
+
+omni_thread::init_t::init_t(void)
+{
+    if (count()++ != 0)	// only do it once however many objects get created.
+	return;
+
+    DB(cerr << "omni_thread::init: NT implementation initialising\n");
+
+    self_tls_index = TlsAlloc();
+
+    if (self_tls_index == 0xffffffff)
+	throw omni_thread_fatal(GetLastError());
+
+    next_id_mutex = new omni_mutex;
+
+    //
+    // Create object for this (i.e. initial) thread.
+    //
+
+    omni_thread* t = new omni_thread;
+
+    t->_state = STATE_RUNNING;
+
+    if (!DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
+			 GetCurrentProcess(), &t->handle,
+			 0, FALSE, DUPLICATE_SAME_ACCESS))
+	throw omni_thread_fatal(GetLastError());
+
+    t->nt_id = GetCurrentThreadId();
+
+    DB(cerr << "initial thread " << t->id() << " NT thread id " << t->nt_id
+       << endl);
+
+    if (!TlsSetValue(self_tls_index, (LPVOID)t))
+	throw omni_thread_fatal(GetLastError());
+
+    if (!SetThreadPriority(t->handle, nt_priority(PRIORITY_NORMAL)))
+	throw omni_thread_fatal(GetLastError());
+}
+
+omni_thread::init_t::~init_t(void)
+{
+    if (--count() != 0) return;
+
+    omni_thread* self = omni_thread::self();
+    if (!self) return;
+
+    TlsSetValue(self_tls_index, (LPVOID)0);
+    delete self;
+
+    delete next_id_mutex;
+
+    TlsFree(self_tls_index);
+}
+
+//
+// Wrapper for thread creation.
+//
+
+extern "C" 
+#ifndef __BCPLUSPLUS__
+unsigned __stdcall
+#else
+void _USERENTRY
+#endif
+omni_thread_wrapper(void* ptr)
+{
+    omni_thread* me = (omni_thread*)ptr;
+
+    DB(cerr << "omni_thread_wrapper: thread " << me->id()
+       << " started\n");
+
+    if (!TlsSetValue(self_tls_index, (LPVOID)me))
+	throw omni_thread_fatal(GetLastError());
+
+    //
+    // Now invoke the thread function with the given argument.
+    //
+
+    if (me->fn_void != NULL) {
+	(*me->fn_void)(me->thread_arg);
+	omni_thread::exit();
+    }
+
+    if (me->fn_ret != NULL) {
+	void* return_value = (*me->fn_ret)(me->thread_arg);
+	omni_thread::exit(return_value);
+    }
+
+    if (me->detached) {
+	me->run(me->thread_arg);
+	omni_thread::exit();
+    } else {
+	void* return_value = me->run_undetached(me->thread_arg);
+	omni_thread::exit(return_value);
+    }
+
+    // should never get here.
+#ifndef __BCPLUSPLUS__
+    return 0;
+#endif
+}
+
+
+//
+// Constructors for omni_thread - set up the thread object but don't
+// start it running.
+//
+
+// construct a detached thread running a given function.
+
+omni_thread::omni_thread(void (*fn)(void*), void* arg, priority_t pri)
+{
+    common_constructor(arg, pri, 1);
+    fn_void = fn;
+    fn_ret = NULL;
+}
+
+// construct an undetached thread running a given function.
+
+omni_thread::omni_thread(void* (*fn)(void*), void* arg, priority_t pri)
+{
+    common_constructor(arg, pri, 0);
+    fn_void = NULL;
+    fn_ret = fn;
+}
+
+// construct a thread which will run either run() or run_undetached().
+
+omni_thread::omni_thread(void* arg, priority_t pri)
+{
+    common_constructor(arg, pri, 1);
+    fn_void = NULL;
+    fn_ret = NULL;
+}
+
+// common part of all constructors.
+
+void
+omni_thread::common_constructor(void* arg, priority_t pri, int det)
+{
+    _state = STATE_NEW;
+    _priority = pri;
+
+    next_id_mutex->lock();
+    _id = next_id++;
+    next_id_mutex->unlock();
+
+    thread_arg = arg;
+    detached = det;	// may be altered in start_undetached()
+
+    cond_semaphore = CreateSemaphore(NULL, 0, SEMAPHORE_MAX, NULL);
+
+    if (cond_semaphore == NULL)
+	throw omni_thread_fatal(GetLastError());
+
+    cond_next = cond_prev = NULL;
+    cond_waiting = FALSE;
+
+    handle = NULL;
+
+    _dummy       = 0;
+    _values      = 0;
+    _value_alloc = 0;
+}
+
+
+//
+// Destructor for omni_thread.
+//
+
+omni_thread::~omni_thread(void)
+{
+    DB(cerr << "destructor called for thread " << id() << endl);
+    if (_values) {
+        for (key_t i=0; i < _value_alloc; i++) {
+	    if (_values[i]) {
+	        delete _values[i];
+	    }
+        }
+	delete [] _values;
+    }
+// sf@ - _endthread() that is used for BCC already does a CloseHandle (that's not the case for _endthreadEx())
+// #ifndef __BCPLUSPLUS__
+    if (handle && !CloseHandle(handle))
+	throw omni_thread_fatal(GetLastError());
+// #endif
+    if (cond_semaphore && !CloseHandle(cond_semaphore))
+	throw omni_thread_fatal(GetLastError());
+}
+
+
+//
+// Start the thread
+//
+
+void
+omni_thread::start(void)
+{
+    omni_mutex_lock l(mutex);
+
+    if (_state != STATE_NEW)
+	throw omni_thread_invalid();
+
+#ifndef __BCPLUSPLUS__
+    // MSVC++ or compatiable
+    unsigned int t=0;
+    handle = (HANDLE)_beginthreadex(
+                        NULL,
+			stack_size,
+			omni_thread_wrapper,
+			(LPVOID)this,
+			CREATE_SUSPENDED, 
+			&t);
+    nt_id = t;
+    if (handle == NULL)
+      throw omni_thread_fatal(GetLastError());
+#else
+    // Borland C++
+    handle = (HANDLE)_beginthreadNT(omni_thread_wrapper,
+				    stack_size,
+				    (void*)this,
+				    NULL,
+				    CREATE_SUSPENDED,
+				    &nt_id);
+    if (handle == INVALID_HANDLE_VALUE)
+      throw omni_thread_fatal(errno);
+#endif
+
+    if (!SetThreadPriority(handle, nt_priority(_priority)))
+      throw omni_thread_fatal(GetLastError());
+
+    if (ResumeThread(handle) == 0xffffffff)
+	throw omni_thread_fatal(GetLastError());
+
+    _state = STATE_RUNNING;
+}
+
+
+//
+// Start a thread which will run the member function run_undetached().
+//
+
+void
+omni_thread::start_undetached(void)
+{
+    if ((fn_void != NULL) || (fn_ret != NULL))
+	throw omni_thread_invalid();
+
+    detached = 0;
+    start();
+}
+
+
+//
+// join - simply check error conditions & call WaitForSingleObject.
+//
+
+void
+omni_thread::join(void** status)
+{
+    mutex.lock();
+
+    if ((_state != STATE_RUNNING) && (_state != STATE_TERMINATED)) {
+	mutex.unlock();
+	throw omni_thread_invalid();
+    }
+
+    mutex.unlock();
+
+    if (this == self())
+	throw omni_thread_invalid();
+
+    if (detached)
+	throw omni_thread_invalid();
+
+    DB(cerr << "omni_thread::join: doing WaitForSingleObject\n");
+
+    if (WaitForSingleObject(handle, INFINITE) != WAIT_OBJECT_0)
+	throw omni_thread_fatal(GetLastError());
+
+    DB(cerr << "omni_thread::join: WaitForSingleObject succeeded\n");
+
+    if (status)
+      *status = return_val;
+
+    delete this;
+}
+
+
+//
+// Change this thread's priority.
+//
+
+void
+omni_thread::set_priority(priority_t pri)
+{
+    omni_mutex_lock l(mutex);
+
+    if (_state != STATE_RUNNING)
+	throw omni_thread_invalid();
+
+    _priority = pri;
+
+    if (!SetThreadPriority(handle, nt_priority(pri)))
+	throw omni_thread_fatal(GetLastError());
+}
+
+
+//
+// create - construct a new thread object and start it running.  Returns thread
+// object if successful, null pointer if not.
+//
+
+// detached version
+
+omni_thread*
+omni_thread::create(void (*fn)(void*), void* arg, priority_t pri)
+{
+    omni_thread* t = new omni_thread(fn, arg, pri);
+    t->start();
+    return t;
+}
+
+// undetached version
+
+omni_thread*
+omni_thread::create(void* (*fn)(void*), void* arg, priority_t pri)
+{
+    omni_thread* t = new omni_thread(fn, arg, pri);
+    t->start();
+    return t;
+}
+
+
+//
+// exit() _must_ lock the mutex even in the case of a detached thread.  This is
+// because a thread may run to completion before the thread that created it has
+// had a chance to get out of start().  By locking the mutex we ensure that the
+// creating thread must have reached the end of start() before we delete the
+// thread object.  Of course, once the call to start() returns, the user can
+// still incorrectly refer to the thread object, but that's their problem.
+//
+
+void
+omni_thread::exit(void* return_value)
+{
+    omni_thread* me = self();
+
+    if (me)
+      {
+	me->mutex.lock();
+
+	me->_state = STATE_TERMINATED;
+
+	me->mutex.unlock();
+
+	DB(cerr << "omni_thread::exit: thread " << me->id() << " detached "
+	   << me->detached << " return value " << return_value << endl);
+
+	if (me->detached) {
+	  delete me;
+	} else {
+	  me->return_val = return_value;
+	}
+      }
+    else
+      {
+	DB(cerr << "omni_thread::exit: called with a non-omnithread. Exit quietly." << endl);
+      }
+//#ifndef __BCPLUSPLUS__
+    // MSVC++ or compatiable
+    //   _endthreadex() does not automatically closes the thread handle.
+    //   The omni_thread dtor closes the thread handle. sf@: Excepted for BCC compiler, otherwise -> crash 
+    _endthreadex(0);
+/*
+#else
+    // Borland C++
+    //   _endthread() DOES automatically closes the thread handle. // sf@
+    //   _endthreadex() is only available if __MFC_COMPAT__ is defined and
+    //   all it does is to call _endthread().
+	// sf@ - Actually _endthreadex(0) doesn't cause any pb when compiling with BCC55...
+    _endthread();
+#endif
+*/
+}
+
+
+omni_thread*
+omni_thread::self(void)
+{
+    LPVOID me;
+
+    me = TlsGetValue(self_tls_index);
+
+    if (me == NULL) {
+      DB(cerr << "omni_thread::self: called with a non-ominthread. NULL is returned." << endl);
+    }
+    return (omni_thread*)me;
+}
+
+
+void
+omni_thread::yield(void)
+{
+    Sleep(0);
+}
+
+
+#define MAX_SLEEP_SECONDS (DWORD)4294966	// (2**32-2)/1000
+
+void
+omni_thread::sleep(unsigned long secs, unsigned long nanosecs)
+{
+    if (secs <= MAX_SLEEP_SECONDS) {
+	Sleep(secs * 1000 + nanosecs / 1000000);
+	return;
+    }
+
+    DWORD no_of_max_sleeps = secs / MAX_SLEEP_SECONDS;
+
+    for (DWORD i = 0; i < no_of_max_sleeps; i++)
+	Sleep(MAX_SLEEP_SECONDS * 1000);
+
+    Sleep((secs % MAX_SLEEP_SECONDS) * 1000 + nanosecs / 1000000);
+}
+
+
+void
+omni_thread::get_time(unsigned long* abs_sec, unsigned long* abs_nsec,
+		      unsigned long rel_sec, unsigned long rel_nsec)
+{
+    get_time_now(abs_sec, abs_nsec);
+    *abs_nsec += rel_nsec;
+    *abs_sec += rel_sec + *abs_nsec / 1000000000;
+    *abs_nsec = *abs_nsec % 1000000000;
+}
+
+
+int
+omni_thread::nt_priority(priority_t pri)
+{
+    switch (pri) {
+
+    case PRIORITY_LOW:
+	return THREAD_PRIORITY_LOWEST;
+
+    case PRIORITY_NORMAL:
+	return THREAD_PRIORITY_NORMAL;
+
+    case PRIORITY_HIGH:
+	return THREAD_PRIORITY_HIGHEST;
+    }
+
+    throw omni_thread_invalid();
+    return 0; /* keep msvc++ happy */
+}
+
+
+static void
+get_time_now(unsigned long* abs_sec, unsigned long* abs_nsec)
+{
+    static int days_in_preceding_months[12]
+	= { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+    static int days_in_preceding_months_leap[12]
+	= { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 };
+
+    SYSTEMTIME st;
+
+    GetSystemTime(&st);
+    *abs_nsec = st.wMilliseconds * 1000000;
+
+    // this formula should work until 1st March 2100
+
+    DWORD days = ((st.wYear - 1970) * 365 + (st.wYear - 1969) / 4
+		  + ((st.wYear % 4)
+		     ? days_in_preceding_months[st.wMonth - 1]
+		     : days_in_preceding_months_leap[st.wMonth - 1])
+		  + st.wDay - 1);
+
+    *abs_sec = st.wSecond + 60 * (st.wMinute + 60 * (st.wHour + 24 * days));
+}
+
+void
+omni_thread::stacksize(unsigned long sz)
+{
+  stack_size = sz;
+}
+
+unsigned long
+omni_thread::stacksize()
+{
+  return stack_size;
+}
+
+//
+// Dummy thread
+//
+
+class omni_thread_dummy : public omni_thread {
+public:
+  inline omni_thread_dummy() : omni_thread()
+  {
+    _dummy = 1;
+    _state = STATE_RUNNING;
+
+    if (!DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
+			 GetCurrentProcess(), &handle,
+			 0, FALSE, DUPLICATE_SAME_ACCESS))
+      throw omni_thread_fatal(GetLastError());
+
+    nt_id = GetCurrentThreadId();
+
+    if (!TlsSetValue(self_tls_index, (LPVOID)this))
+      throw omni_thread_fatal(GetLastError());
+  }
+  inline ~omni_thread_dummy()
+  {
+    if (!TlsSetValue(self_tls_index, (LPVOID)0))
+      throw omni_thread_fatal(GetLastError());
+  }
+};
+
+omni_thread*
+omni_thread::create_dummy()
+{
+  if (omni_thread::self())
+    throw omni_thread_invalid();
+
+  return new omni_thread_dummy;
+}
+
+void
+omni_thread::release_dummy()
+{
+  omni_thread* self = omni_thread::self();
+  if (!self || !self->_dummy)
+    throw omni_thread_invalid();
+
+  omni_thread_dummy* dummy = (omni_thread_dummy*)self;
+  delete dummy;
+}
+
+
+#if defined(__DMC__) && defined(_WINDLL)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+  return TRUE;
+}
+#endif
+
+
+#define INSIDE_THREAD_IMPL_CC
+#include "threaddata.cpp"
+#undef INSIDE_THREAD_IMPL_CC
diff --git a/ica/win32/winvnc/omnithread/nt.h b/ica/win32/winvnc/omnithread/nt.h
new file mode 100644
index 0000000..e1ee2ab
--- /dev/null
+++ b/ica/win32/winvnc/omnithread/nt.h
@@ -0,0 +1,82 @@
+//				Package : omnithread
+// omnithread/nt.h		Created : 6/95 tjr
+//
+//    Copyright (C) 1995, 1996, 1997 Olivetti & Oracle Research Laboratory
+//
+//    This file is part of the omnithread library
+//
+//    The omnithread 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
+//    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+//    02111-1307, USA
+//
+//
+// OMNI thread implementation classes for NT threads.
+//
+
+#ifndef __omnithread_nt_h_
+#define __omnithread_nt_h_
+
+#ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+#  define OMNI_DEFINED_WIN32_LEAN_AND_MEAN
+#endif
+
+#include <windows.h>
+
+#ifdef OMNI_DEFINED_WIN32_LEAN_AND_MEAN
+#  undef WIN32_LEAN_AND_MEAN
+#  undef OMNI_DEFINED_WIN32_LEAN_AND_MEAN
+#endif
+
+
+#ifndef __BCPLUSPLUS__
+#define OMNI_THREAD_WRAPPER \
+    unsigned __stdcall omni_thread_wrapper(LPVOID ptr);
+#else
+#define OMNI_THREAD_WRAPPER \
+    void _USERENTRY omni_thread_wrapper(void *ptr)
+#endif
+
+extern "C" OMNI_THREAD_WRAPPER;
+
+#define OMNI_MUTEX_IMPLEMENTATION			\
+    CRITICAL_SECTION crit;
+
+#define OMNI_MUTEX_LOCK_IMPLEMENTATION                  \
+    EnterCriticalSection(&crit);
+
+#define OMNI_MUTEX_UNLOCK_IMPLEMENTATION                \
+    LeaveCriticalSection(&crit);
+
+#define OMNI_CONDITION_IMPLEMENTATION			\
+    CRITICAL_SECTION crit;				\
+    omni_thread* waiting_head;				\
+    omni_thread* waiting_tail;
+
+#define OMNI_SEMAPHORE_IMPLEMENTATION			\
+    HANDLE nt_sem;
+
+#define OMNI_THREAD_IMPLEMENTATION			\
+    HANDLE handle;					\
+    DWORD nt_id;					\
+    void* return_val;					\
+    HANDLE cond_semaphore;				\
+    omni_thread* cond_next;				\
+    omni_thread* cond_prev;				\
+    BOOL cond_waiting;					\
+    static int nt_priority(priority_t);			\
+    friend class omni_condition;			\
+    friend OMNI_THREAD_WRAPPER;
+
+#endif
diff --git a/ica/win32/winvnc/omnithread/omnithread.h b/ica/win32/winvnc/omnithread/omnithread.h
new file mode 100644
index 0000000..7454264
--- /dev/null
+++ b/ica/win32/winvnc/omnithread/omnithread.h
@@ -0,0 +1,659 @@
+// -*- Mode: C++; -*-
+//				Package : omnithread
+// omnithread.h			Created : 7/94 tjr
+//
+//    Copyright (C) 1994,1995,1996, 1997 Olivetti & Oracle Research Laboratory
+//
+//    This file is part of the omnithread library
+//
+//    The omnithread 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
+//    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+//    02111-1307, USA
+//
+
+//
+// Interface to OMNI thread abstraction.
+//
+// This file declares classes for threads and synchronisation objects
+// (mutexes, condition variables and counting semaphores).
+//
+// Wherever a seemingly arbitrary choice has had to be made as to the interface
+// provided, the intention here has been to be as POSIX-like as possible.  This
+// is why there is no semaphore timed wait, for example.
+//
+
+#ifndef __omnithread_h_
+#define __omnithread_h_
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+class omni_mutex;
+class omni_condition;
+class omni_semaphore;
+class omni_thread;
+
+//
+// OMNI_THREAD_EXPOSE can be defined as public or protected to expose the
+// implementation class - this may be useful for debugging.  Hopefully this
+// won't change the underlying structure which the compiler generates so that
+// this can work without recompiling the library.
+//
+
+#ifndef OMNI_THREAD_EXPOSE
+#define OMNI_THREAD_EXPOSE private
+#endif
+
+//
+// Include implementation-specific header file.
+//
+// This must define 4 CPP macros of the form OMNI_x_IMPLEMENTATION for mutex,
+// condition variable, semaphore and thread.  Each should define any
+// implementation-specific members of the corresponding classes.
+//
+
+
+#if defined(__arm__) && defined(__atmos__)
+#include <omnithread/posix.h>
+
+#elif defined(__osf1__)
+#include <omnithread/posix.h>
+
+#elif defined(__aix__)
+#include <omnithread/posix.h>
+
+#elif defined(__hpux__)
+#include <omnithread/posix.h>
+
+#elif defined(__vxWorks__)
+#include <omnithread/VxThread.h>
+
+#elif defined(__WIN32__)
+
+#if defined(__POSIX_NT__)
+#include <omnithread/posix.h>
+#else
+#include "nt.h"
+#endif
+
+#ifdef _MSC_VER
+
+// Using MSVC++ to compile. If compiling library as a DLL,
+// define _OMNITHREAD_DLL. If compiling as a statuc library, define
+// _WINSTATIC
+// If compiling an application that is to be statically linked to omnithread,
+// define _WINSTATIC (if the application is  to be dynamically linked, 
+// there is no need to define any of these macros).
+
+#if defined (_OMNITHREAD_DLL) && defined(_WINSTATIC)
+#error "Both _OMNITHREAD_DLL and _WINSTATIC are defined."
+#elif defined(_OMNITHREAD_DLL)
+#define _OMNITHREAD_NTDLL_ __declspec(dllexport)
+#elif !defined(_WINSTATIC)
+#define _OMNITHREAD_NTDLL_ __declspec(dllimport)
+#elif defined(_WINSTATIC)
+#define _OMNITHREAD_NTDLL_
+#endif
+ // _OMNITHREAD_DLL && _WINSTATIC
+
+#else
+
+// Not using MSVC++ to compile
+#define _OMNITHREAD_NTDLL_
+
+#endif
+ // _MSC_VER
+ 
+#elif defined(__sunos__)
+#if __OSVERSION__ != 5
+// XXX Workaround for SUN C++ compiler (seen on 4.2) Template.DB code
+//     regeneration bug. See omniORB2/CORBA_sysdep.h for details.
+#if !defined(__SUNPRO_CC) || __OSVERSION__ != '5'
+#error "Only SunOS 5.x or later is supported."
+#endif
+#endif
+#ifdef UseSolarisThreads
+#include <omnithread/solaris.h>
+#else
+#include <omnithread/posix.h>
+#endif
+
+#elif defined(__linux__)
+#include <omnithread/posix.h>
+
+#elif defined(__nextstep__)
+#include <omnithread/mach.h>
+
+#elif defined(__VMS)
+#include <omnithread/posix.h>
+
+#elif defined(__SINIX__)
+#include <omnithread/posix.h>
+
+#elif defined(__osr5__)
+#include <omnithread/posix.h>
+
+#elif defined(__uw7__)
+#include <omnithread/posix.h>
+
+#elif defined(__irix__)
+#include <omnithread/posix.h>
+
+#elif defined(__freebsd__)
+#include <omnithread/posix.h>
+
+#elif defined(__rtems__)
+#include <omnithread/posix.h>
+#include <sched.h>
+
+#elif defined(__darwin__)
+#include <omnithread/posix.h>
+
+#elif defined(__macos__)
+#include <omnithread/posix.h>
+#include <sched.h>
+
+#else
+#error "No implementation header file"
+#endif
+
+#if !defined(__WIN32__)
+#define _OMNITHREAD_NTDLL_
+#endif
+
+#if (!defined(OMNI_MUTEX_IMPLEMENTATION)        || \
+     !defined(OMNI_MUTEX_LOCK_IMPLEMENTATION)   || \
+     !defined(OMNI_MUTEX_UNLOCK_IMPLEMENTATION) || \
+     !defined(OMNI_CONDITION_IMPLEMENTATION)    || \
+     !defined(OMNI_SEMAPHORE_IMPLEMENTATION)    || \
+     !defined(OMNI_THREAD_IMPLEMENTATION))
+#error "Implementation header file incomplete"
+#endif
+
+
+//
+// This exception is thrown in the event of a fatal error.
+//
+
+class _OMNITHREAD_NTDLL_ omni_thread_fatal {
+public:
+    int error;
+    omni_thread_fatal(int e = 0) : error(e) {}
+};
+
+
+//
+// This exception is thrown when an operation is invoked with invalid
+// arguments.
+//
+
+class _OMNITHREAD_NTDLL_ omni_thread_invalid {};
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Mutex
+//
+///////////////////////////////////////////////////////////////////////////
+
+class _OMNITHREAD_NTDLL_ omni_mutex {
+
+public:
+    omni_mutex(void);
+    ~omni_mutex(void);
+
+    inline void lock(void)    { OMNI_MUTEX_LOCK_IMPLEMENTATION   }
+    inline void unlock(void)  { OMNI_MUTEX_UNLOCK_IMPLEMENTATION }
+    inline void acquire(void) { lock(); }
+    inline void release(void) { unlock(); }
+	// the names lock and unlock are preferred over acquire and release
+	// since we are attempting to be as POSIX-like as possible.
+
+    friend class omni_condition;
+
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_mutex(const omni_mutex&);
+    omni_mutex& operator=(const omni_mutex&);
+
+OMNI_THREAD_EXPOSE:
+    OMNI_MUTEX_IMPLEMENTATION
+};
+
+//
+// As an alternative to:
+// {
+//   mutex.lock();
+//   .....
+//   mutex.unlock();
+// }
+//
+// you can use a single instance of the omni_mutex_lock class:
+//
+// {
+//   omni_mutex_lock l(mutex);
+//   ....
+// }
+//
+// This has the advantage that mutex.unlock() will be called automatically
+// when an exception is thrown.
+//
+
+class _OMNITHREAD_NTDLL_ omni_mutex_lock {
+    omni_mutex& mutex;
+public:
+    omni_mutex_lock(omni_mutex& m) : mutex(m) { mutex.lock(); }
+    ~omni_mutex_lock(void) { mutex.unlock(); }
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_mutex_lock(const omni_mutex_lock&);
+    omni_mutex_lock& operator=(const omni_mutex_lock&);
+};
+
+
+//adzm 2009-06-21 - only locks/unlocks if conditional is true
+class _OMNITHREAD_NTDLL_ omni_mutex_conditional_lock {
+    omni_mutex& mutex;
+	bool conditional;
+public:
+	omni_mutex_conditional_lock(omni_mutex& m, bool c) : mutex(m), conditional(c) { if (conditional) {mutex.lock();} }
+	~omni_mutex_conditional_lock(void) { if (conditional) {mutex.unlock();} }
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_mutex_conditional_lock(const omni_mutex_conditional_lock&);
+    omni_mutex_conditional_lock& operator=(const omni_mutex_conditional_lock&);
+};
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Condition variable
+//
+///////////////////////////////////////////////////////////////////////////
+
+class _OMNITHREAD_NTDLL_ omni_condition {
+
+    omni_mutex* mutex;
+
+public:
+    omni_condition(omni_mutex* m);
+	// constructor must be given a pointer to an existing mutex. The
+	// condition variable is then linked to the mutex, so that there is an
+	// implicit unlock and lock around wait() and timed_wait().
+
+    ~omni_condition(void);
+
+    void wait(void);
+	// wait for the condition variable to be signalled.  The mutex is
+	// implicitly released before waiting and locked again after waking up.
+	// If wait() is called by multiple threads, a signal may wake up more
+	// than one thread.  See POSIX threads documentation for details.
+
+    int timedwait(unsigned long secs, unsigned long nanosecs = 0);
+	// timedwait() is given an absolute time to wait until.  To wait for a
+	// relative time from now, use omni_thread::get_time. See POSIX threads
+	// documentation for why absolute times are better than relative.
+	// Returns 1 (true) if successfully signalled, 0 (false) if time
+	// expired.
+
+    void signal(void);
+	// if one or more threads have called wait(), signal wakes up at least
+	// one of them, possibly more.  See POSIX threads documentation for
+	// details.
+
+    void broadcast(void);
+	// broadcast is like signal but wakes all threads which have called
+	// wait().
+
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_condition(const omni_condition&);
+    omni_condition& operator=(const omni_condition&);
+
+OMNI_THREAD_EXPOSE:
+    OMNI_CONDITION_IMPLEMENTATION
+};
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Counting semaphore
+//
+///////////////////////////////////////////////////////////////////////////
+
+class _OMNITHREAD_NTDLL_ omni_semaphore {
+
+public:
+    omni_semaphore(unsigned int initial = 1);
+    ~omni_semaphore(void);
+
+    void wait(void);
+	// if semaphore value is > 0 then decrement it and carry on. If it's
+	// already 0 then block.
+
+    int trywait(void);
+	// if semaphore value is > 0 then decrement it and return 1 (true).
+	// If it's already 0 then return 0 (false).
+
+    void post(void);
+	// if any threads are blocked in wait(), wake one of them up. Otherwise
+	// increment the value of the semaphore.
+
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_semaphore(const omni_semaphore&);
+    omni_semaphore& operator=(const omni_semaphore&);
+
+OMNI_THREAD_EXPOSE:
+    OMNI_SEMAPHORE_IMPLEMENTATION
+};
+
+//
+// A helper class for semaphores, similar to omni_mutex_lock above.
+//
+
+class _OMNITHREAD_NTDLL_ omni_semaphore_lock {
+    omni_semaphore& sem;
+public:
+    omni_semaphore_lock(omni_semaphore& s) : sem(s) { sem.wait(); }
+    ~omni_semaphore_lock(void) { sem.post(); }
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_semaphore_lock(const omni_semaphore_lock&);
+    omni_semaphore_lock& operator=(const omni_semaphore_lock&);
+};
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Thread
+//
+///////////////////////////////////////////////////////////////////////////
+
+class _OMNITHREAD_NTDLL_ omni_thread {
+
+public:
+
+    enum priority_t {
+	PRIORITY_LOW,
+	PRIORITY_NORMAL,
+	PRIORITY_HIGH
+    };
+
+    enum state_t {
+	STATE_NEW,		// thread object exists but thread hasn't
+				// started yet.
+	STATE_RUNNING,		// thread is running.
+	STATE_TERMINATED	// thread has terminated but storage has not
+				// been reclaimed (i.e. waiting to be joined).
+    };
+
+    //
+    // Constructors set up the thread object but the thread won't start until
+    // start() is called. The create method can be used to construct and start
+    // a thread in a single call.
+    //
+
+    omni_thread(void (*fn)(void*), void* arg = NULL,
+		priority_t pri = PRIORITY_NORMAL);
+    omni_thread(void* (*fn)(void*), void* arg = NULL,
+		priority_t pri = PRIORITY_NORMAL);
+	// these constructors create a thread which will run the given function
+	// when start() is called.  The thread will be detached if given a
+	// function with void return type, undetached if given a function
+	// returning void*. If a thread is detached, storage for the thread is
+	// reclaimed automatically on termination. Only an undetached thread
+	// can be joined.
+
+    void start(void);
+	// start() causes a thread created with one of the constructors to
+	// start executing the appropriate function.
+
+protected:
+
+    omni_thread(void* arg = NULL, priority_t pri = PRIORITY_NORMAL);
+	// this constructor is used in a derived class.  The thread will
+	// execute the run() or run_undetached() member functions depending on
+	// whether start() or start_undetached() is called respectively.
+
+    void start_undetached(void);
+	// can be used with the above constructor in a derived class to cause
+	// the thread to be undetached.  In this case the thread executes the
+	// run_undetached member function.
+
+    virtual ~omni_thread(void);
+	// destructor cannot be called by user (except via a derived class).
+	// Use exit() or cancel() instead. This also means a thread object must
+	// be allocated with new - it cannot be statically or automatically
+	// allocated. The destructor of a class that inherits from omni_thread
+	// shouldn't be public either (otherwise the thread object can be
+	// destroyed while the underlying thread is still running).
+
+public:
+
+    void join(void**);
+	// join causes the calling thread to wait for another's completion,
+	// putting the return value in the variable of type void* whose address
+	// is given (unless passed a null pointer). Only undetached threads
+	// may be joined. Storage for the thread will be reclaimed.
+
+    void set_priority(priority_t);
+	// set the priority of the thread.
+
+    static omni_thread* create(void (*fn)(void*), void* arg = NULL,
+			       priority_t pri = PRIORITY_NORMAL);
+    static omni_thread* create(void* (*fn)(void*), void* arg = NULL,
+			       priority_t pri = PRIORITY_NORMAL);
+	// create spawns a new thread executing the given function with the
+	// given argument at the given priority. Returns a pointer to the
+	// thread object. It simply constructs a new thread object then calls
+	// start.
+
+    static void exit(void* return_value = NULL);
+	// causes the calling thread to terminate.
+
+    static omni_thread* self(void);
+	// returns the calling thread's omni_thread object.  If the
+	// calling thread is not the main thread and is not created
+	// using this library, returns 0. (But see create_dummy()
+	// below.)
+
+    static void yield(void);
+	// allows another thread to run.
+
+    static void sleep(unsigned long secs, unsigned long nanosecs = 0);
+	// sleeps for the given time.
+
+    static void get_time(unsigned long* abs_sec, unsigned long* abs_nsec,
+			 unsigned long rel_sec = 0, unsigned long rel_nsec=0);
+	// calculates an absolute time in seconds and nanoseconds, suitable for
+	// use in timed_waits on condition variables, which is the current time
+	// plus the given relative offset.
+
+
+    static void stacksize(unsigned long sz);
+    static unsigned long stacksize();
+        // Use this value as the stack size when spawning a new thread.
+        // The default value (0) means that the thread library default is
+        // to be used.
+
+
+    // Per-thread data
+    //
+    // These functions allow you to attach additional data to an
+    // omni_thread. First allocate a key for yourself with
+    // allocate_key(). Then you can store any object whose class is
+    // derived from value_t. Any values still stored in the
+    // omni_thread when the thread exits are deleted.
+    //
+    // These functions are NOT thread safe, so you should be very
+    // careful about setting/getting data in a different thread to the
+    // current thread.
+
+    typedef unsigned int key_t;
+    static key_t allocate_key();
+
+    class value_t {
+    public:
+      virtual ~value_t() {}
+    };
+
+    value_t* set_value(key_t k, value_t* v);
+        // Sets a value associated with the given key. The key must
+        // have been allocated with allocate_key(). If a value has
+        // already been set with the specified key, the old value_t
+        // object is deleted and replaced. Returns the value which was
+        // set, or zero if the key is invalid.
+
+    value_t* get_value(key_t k);
+        // Returns the value associated with the key. If the key is
+        // invalid, or there is no value for the key, returns zero.
+
+    value_t* remove_value(key_t k);
+        // Removes the value associated with the key and returns it.
+        // If the key is invalid, or there is no value for the key,
+        // returns zero.
+
+
+    // Dummy omni_thread
+    //
+    // Sometimes, an application finds itself with threads created
+    // outside of omnithread which must interact with omnithread
+    // features such as the per-thread data. In this situation,
+    // omni_thread::self() would normally return 0. These functions
+    // allow the application to create a suitable dummy omni_thread
+    // object.
+
+    static omni_thread* create_dummy(void);
+        // creates a dummy omni_thread for the calling thread. Future
+        // calls to self() will return the dummy omni_thread. Throws
+        // omni_thread_invalid if this thread already has an
+        // associated omni_thread (real or dummy).
+
+    static void release_dummy();
+        // release the dummy omni_thread for this thread. This
+        // function MUST be called before the thread exits. Throws
+        // omni_thread_invalid if the calling thread does not have a
+        // dummy omni_thread.
+
+    // class ensure_self should be created on the stack. If created in
+    // a thread without an associated omni_thread, it creates a dummy
+    // thread which is released when the ensure_self object is deleted.
+
+    class ensure_self {
+    public:
+      inline ensure_self() : _dummy(0)
+      {
+	_self = omni_thread::self();
+	if (!_self) {
+	  _dummy = 1;
+	  _self  = omni_thread::create_dummy();
+	}
+      }
+      inline ~ensure_self()
+      {
+	if (_dummy)
+	  omni_thread::release_dummy();
+      }
+      inline omni_thread* self() { return _self; }
+    private:
+      omni_thread* _self;
+      int          _dummy;
+    };
+
+
+private:
+
+    virtual void run(void* /*arg*/) {}
+    virtual void* run_undetached(void* /*arg*/) { return NULL; }
+	// can be overridden in a derived class.  When constructed using the
+	// the constructor omni_thread(void*, priority_t), these functions are
+	// called by start() and start_undetached() respectively.
+
+    void common_constructor(void* arg, priority_t pri, int det);
+	// implements the common parts of the constructors.
+
+    omni_mutex mutex;
+	// used to protect any members which can change after construction,
+	// i.e. the following 2 members.
+
+    state_t _state;
+    priority_t _priority;
+
+    static omni_mutex* next_id_mutex;
+    static int next_id;
+    int _id;
+
+    void (*fn_void)(void*);
+    void* (*fn_ret)(void*);
+    void* thread_arg;
+    int detached;
+    int _dummy;
+    value_t**     _values;
+    unsigned long _value_alloc;
+
+    omni_thread(const omni_thread&);
+    omni_thread& operator=(const omni_thread&);
+    // Not implemented
+
+public:
+
+    priority_t priority(void) {
+
+	// return this thread's priority.
+
+	omni_mutex_lock l(mutex);
+	return _priority;
+    }
+
+    state_t state(void) {
+
+	// return thread state (invalid, new, running or terminated).
+
+	omni_mutex_lock l(mutex);
+	return _state;
+    }
+
+    int id(void) { return _id; }
+	// return unique thread id within the current process.
+
+
+    // This class plus the instance of it declared below allows us to execute
+    // some initialisation code before main() is called.
+
+    class _OMNITHREAD_NTDLL_ init_t {
+    public:
+	init_t(void);
+        ~init_t(void);
+    };
+
+    friend class init_t;
+    friend class omni_thread_dummy;
+
+OMNI_THREAD_EXPOSE:
+    OMNI_THREAD_IMPLEMENTATION
+};
+
+#ifndef __rtems__
+static omni_thread::init_t omni_thread_init;
+#else
+// RTEMS calls global Ctor/Dtor in a context that is not
+// a posix thread. Calls to functions to pthread_self() in
+// that context returns NULL. 
+// So, for RTEMS we will make the thread initialization at the
+// beginning of the Init task that has a posix context.
+#endif
+
+#endif
diff --git a/ica/win32/winvnc/omnithread/threaddata.cpp b/ica/win32/winvnc/omnithread/threaddata.cpp
new file mode 100644
index 0000000..39860e7
--- /dev/null
+++ b/ica/win32/winvnc/omnithread/threaddata.cpp
@@ -0,0 +1,83 @@
+//				Package : omnithread
+// omnithread/threaddata.cc	Created : 10/2000 dpg1
+//
+//    Copyright (C) 2000 AT&T Laboratories Cambridge
+//
+//    This file is part of the omnithread library
+//
+//    The omnithread 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
+//    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+//    02111-1307, USA
+//
+
+// Implementation of per-thread data
+
+#ifndef INSIDE_THREAD_IMPL_CC
+#error "threaddata.cc must be #included by a thread implementation."
+#endif
+
+
+static omni_thread::key_t allocated_keys = 0;
+
+omni_thread::key_t
+omni_thread::allocate_key()
+{
+  omni_mutex_lock l(*next_id_mutex);
+  return ++allocated_keys;
+}
+
+omni_thread::value_t*
+omni_thread::set_value(key_t k, value_t* v)
+{
+  if (k == 0) return 0;
+  if (k > _value_alloc) {
+    next_id_mutex->lock();
+    key_t alloc = allocated_keys;
+    next_id_mutex->unlock();
+
+    if (k > alloc) return 0;
+
+    value_t** nv = new value_t*[alloc];
+    key_t i = 0;
+    if (_values) {
+      for (; i < _value_alloc; i++)
+	nv[i] = _values[i];
+      delete [] _values;
+    }
+    for (; i < alloc; i++)
+      nv[i] = 0;
+
+    _values = nv;
+    _value_alloc = alloc;
+  }
+  if (_values[k-1]) delete _values[k-1];
+  _values[k-1] = v;
+  return v;
+}
+
+omni_thread::value_t*
+omni_thread::get_value(key_t k)
+{
+  if (k > _value_alloc) return 0;
+  return _values[k-1];
+}
+
+omni_thread::value_t*
+omni_thread::remove_value(key_t k)
+{
+  if (k > _value_alloc) return 0;
+  value_t* v = _values[k-1];
+  _values[k-1] = 0;
+  return v;
+}
diff --git a/ica/win32/winvnc/rfb/zrleEncode.h b/ica/win32/winvnc/rfb/zrleEncode.h
new file mode 100644
index 0000000..f07b8cd
--- /dev/null
+++ b/ica/win32/winvnc/rfb/zrleEncode.h
@@ -0,0 +1,352 @@
+//
+// 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.
+
+//
+// zrleEncode.h - zrle encoding function.
+//
+// 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 <rdr/OutStream.h>
+#include <assert.h>
+
+using namespace rdr;
+
+/* __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(rdr::U,BPP)
+#define WRITE_PIXEL __RFB_CONCAT2E(writeOpaque,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(rdr::U,16)
+#define WRITE_PIXEL __RFB_CONCAT2E(writeOpaque,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(rdr::U,BPP)
+#define WRITE_PIXEL __RFB_CONCAT2E(writeOpaque,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
+};
+
+int zywrle_level = 1;
+int zywrleBuf[rfbZRLETileWidth*rfbZRLETileHeight];
+
+// The PaletteHelper class helps us build up the palette from pixel data by
+// storing a reverse index using a simple hash-table
+
+class PaletteHelper {
+public:
+  enum { MAX_SIZE = 127 };
+
+  PaletteHelper()
+  {
+    memset(index, 255, sizeof(index));
+    size = 0;
+  }
+
+  inline int hash(rdr::U32 pix)
+  {
+    return (pix ^ (pix >> 17)) & 4095;
+  }
+
+  inline void insert(rdr::U32 pix)
+  {
+    if (size < MAX_SIZE) {
+      int i = hash(pix);
+      while (index[i] != 255 && key[i] != pix)
+        i++;
+      if (index[i] != 255) return;
+
+      index[i] = size;
+      key[i] = pix;
+      palette[size] = pix;
+    }
+    size++;
+  }
+
+  inline int lookup(rdr::U32 pix)
+  {
+    assert(size <= MAX_SIZE);
+    int i = hash(pix);
+    while (index[i] != 255 && key[i] != pix)
+      i++;
+    if (index[i] != 255) return index[i];
+    return -1;
+  }
+
+  rdr::U32 palette[MAX_SIZE];
+  rdr::U8 index[4096+MAX_SIZE];
+  rdr::U32 key[4096+MAX_SIZE];
+  int size;
+};
+#endif
+
+void ZRLE_ENCODE_TILE (PIXEL_T* data, int w, int h, rdr::OutStream* os);
+
+#if BPP!=8
+#define ZYWRLE_ENCODE
+#include <rfb/zywrletemplate.c>
+#endif
+
+void ZRLE_ENCODE (int x, int y, int w, int h, rdr::OutStream* os,
+                  rdr::ZlibOutStream* zos, void* buf
+                  EXTRA_ARGS
+                  )
+{
+  zos->setUnderlying(os);
+
+  for (int ty = y; ty < y+h; ty += rfbZRLETileHeight) {
+    int th = rfbZRLETileHeight;
+    if (th > y+h-ty) th = y+h-ty;
+    for (int 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);
+
+      ZRLE_ENCODE_TILE((PIXEL_T*)buf, tw, th, zos);
+    }
+  }
+  zos->flush();
+}
+
+
+void ZRLE_ENCODE_TILE (PIXEL_T* data, int w, int h, rdr::OutStream* os)
+{
+  // First find the palette and the number of runs
+
+  PaletteHelper ph;
+
+  int runs = 0;
+  int singlePixels = 0;
+
+  PIXEL_T* ptr = data;
+  PIXEL_T* end = ptr + h * w;
+  *end = ~*(end-1); // one past the end is different so the while loop ends
+
+  while (ptr < end) {
+    PIXEL_T pix = *ptr;
+    if (*++ptr != pix) {
+      singlePixels++;
+    } else {
+      while (*++ptr == pix) ;
+      runs++;
+    }
+    ph.insert(pix);
+  }
+
+  //fprintf(stderr,"runs %d, single pixels %d, paletteSize %d\n",
+  //        runs, singlePixels, ph.size);
+
+  // Solid tile is a special case
+
+  if (ph.size == 1) {
+    os->writeU8(1);
+    os->WRITE_PIXEL(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...
+
+  bool useRle = false;
+  bool usePalette = false;
+
+  int estimatedBytes = w * h * (BPPOUT/8); // start assuming raw
+
+#if BPP!=8
+  if( (zywrle_level>0)&& !(zywrle_level & 0x80) ){
+	  estimatedBytes >>= zywrle_level;
+  }
+#endif
+
+  int 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;
+
+  os->writeU8((useRle ? 128 : 0) | ph.size);
+
+  for (int i = 0; i < ph.size; i++) {
+    os->WRITE_PIXEL(ph.palette[i]);
+  }
+
+  if (useRle) {
+
+    PIXEL_T* ptr = data;
+    PIXEL_T* end = ptr + w * h;
+    PIXEL_T* runStart;
+    PIXEL_T pix;
+    while (ptr < end) {
+      runStart = ptr;
+      pix = *ptr++;
+      while (*ptr == pix && ptr < end)
+        ptr++;
+      int len = ptr - runStart;
+      if (len <= 2 && usePalette) {
+        int index = ph.lookup(pix);
+        if (len == 2)
+          os->writeU8(index);
+        os->writeU8(index);
+        continue;
+      }
+      if (usePalette) {
+        int index = ph.lookup(pix);
+        os->writeU8(index | 128);
+      } else {
+        os->WRITE_PIXEL(pix);
+      }
+      len -= 1;
+      while (len >= 255) {
+        os->writeU8(255);
+        len -= 255;
+      }
+      os->writeU8(len);
+    }
+
+  } else {
+
+    // no RLE
+
+    if (usePalette) {
+
+      // packed pixels
+
+      assert (ph.size < 17);
+
+      int bppp = bitsPerPackedPixel[ph.size-1];
+
+      PIXEL_T* ptr = data;
+
+      for (int i = 0; i < h; i++) {
+        U8 nbits = 0;
+        U8 byte = 0;
+
+        PIXEL_T* eol = ptr + w;
+
+        while (ptr < eol) {
+          PIXEL_T pix = *ptr++;
+          U8 index = ph.lookup(pix);
+          byte = (byte << bppp) | index;
+          nbits += bppp;
+          if (nbits >= 8) {
+            os->writeU8(byte);
+            nbits = 0;
+          }
+        }
+        if (nbits > 0) {
+          byte <<= 8 - nbits;
+          os->writeU8(byte);
+        }
+      }
+    } else {
+
+      // raw
+
+#if BPP!=8
+      if( (zywrle_level>0)&& !(zywrle_level & 0x80) ){
+		  ZYWRLE_ANALYZE( data, data, w, h, w, zywrle_level, zywrleBuf );
+		  zywrle_level |= 0x80;
+		  ZRLE_ENCODE_TILE( data, w, h, os );
+		  zywrle_level &= 0x7F;
+	  }else
+#endif
+#ifdef CPIXEL
+      for (PIXEL_T* ptr = data; ptr < data+w*h; ptr++) {
+        os->WRITE_PIXEL(*ptr);
+      }
+#else
+      os->writeBytes(data, w*h*(BPPOUT/8));
+#endif
+    }
+  }
+}
+
+#undef PIXEL_T
+#undef WRITE_PIXEL
+#undef ZRLE_ENCODE
+#undef ZRLE_ENCODE_TILE
+#undef BPPOUT
diff --git a/ica/win32/winvnc/rfb/zywrletemplate.c b/ica/win32/winvnc/rfb/zywrletemplate.c
new file mode 100644
index 0000000..3eadb59
--- /dev/null
+++ b/ica/win32/winvnc/rfb/zywrletemplate.c
@@ -0,0 +1,804 @@
+
+/********************************************************************
+ *                                                                  *
+ * 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.
+ ********************************************************************/
+
+//#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
+#define InlineX inline
+#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 ZYWRLE_TRANSFER_COEFF(pBuf,data,r,width,height,level,TRANS)	\
+	pH = pBuf;	\
+	s = 2<<level;	\
+	if( r & 0x01 ){	\
+		pH +=  s>>1;	\
+	}	\
+	if( r & 0x02 ){	\
+		pH += (s>>1)*width;	\
+	}	\
+	pEnd = pH+height*width;	\
+	while( pH < pEnd ){	\
+		pLine = pH+width;	\
+		while( pH < pLine ){	\
+			TRANS	\
+			data++;	\
+			pH += s;	\
+		}	\
+		pH += (s-1)*width;	\
+	}
+
+#define ZYWRLE_PACK_COEFF(pBuf,data,r,width,height,level)	\
+	ZYWRLE_TRANSFER_COEFF(pBuf,data,r,width,height,level,ZYWRLE_LOAD_COEFF(pH,R,G,B);ZYWRLE_SAVE_PIXEL(data,R,G,B);)
+
+#define ZYWRLE_UNPACK_COEFF(pBuf,data,r,width,height,level)	\
+	ZYWRLE_TRANSFER_COEFF(pBuf,data,r,width,height,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 = pTop + (w+uw)*(h+uh)-w*h;	\
+	while( pTop < pEnd ){	\
+		TRANS	\
+		data++;	\
+		pTop++;	\
+	}
+
+#define ZYWRLE_LOAD_UNALIGN(data,pData,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* pSrc;
+	int R, G, B;
+	int s;
+	int* pH;
+
+	zywrleCalcSize( &w, &h, level );
+	if( (w==0)||(h==0) ){
+		return NULL;
+	}
+	uw -= w;
+	uh -= h;
+
+	ZYWRLE_LOAD_UNALIGN(src,pSrc,*(PIXEL_T*)pTop=*pSrc;)
+	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, l );
+		ZYWRLE_PACK_COEFF( pBuf, dst, 2, w, h, l );
+		ZYWRLE_PACK_COEFF( pBuf, dst, 1, w, h, l );
+		if( l == level-1 ){
+			ZYWRLE_PACK_COEFF( pBuf, dst, 0, w, h, 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* pDst;
+	int R, G, B;
+	int s;
+	int* pH;
+
+	zywrleCalcSize( &w, &h, level );
+	if( (w==0)||(h==0) ){
+		return NULL;
+	}
+	uw -= w;
+	uh -= h;
+
+	for( l=0; l<level; l++ ){
+		ZYWRLE_UNPACK_COEFF( pBuf, src, 3, w, h, l );
+		ZYWRLE_UNPACK_COEFF( pBuf, src, 2, w, h, l );
+		ZYWRLE_UNPACK_COEFF( pBuf, src, 1, w, h, l );
+		if( l == level-1 ){
+			ZYWRLE_UNPACK_COEFF( pBuf, src, 0, w, h, 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,pDst,*pDst=*(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/win32/winvnc/vnchooks/Makefile.bcc32 b/ica/win32/winvnc/vnchooks/Makefile.bcc32
new file mode 100644
index 0000000..72227c8
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/Makefile.bcc32
@@ -0,0 +1,9 @@
+CFLAGS=-v- -O2 -3 -tWD -xd- -q -w-8057 -w-8027
+
+VNCHooks.lib: VNCHooks.dll
+	implib.exe VNCHooks.lib VNCHooks.dll
+
+VNCHooks.dll: VNCHooks.cpp SharedData.cpp VNCHooks.h SharedData.h
+	copy /b VNCHooks-bcc32.def VNCHooks.def
+	bcc32.exe $(CFLAGS) VNCHooks.cpp SharedData.cpp
+	copy /b VNCHooks-vc.def VNCHooks.def
diff --git a/ica/win32/winvnc/vnchooks/SharedData.cpp b/ica/win32/winvnc/vnchooks/SharedData.cpp
new file mode 100644
index 0000000..48a5a0e
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/SharedData.cpp
@@ -0,0 +1,42 @@
+//  Copyright (C) 2001 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+
+// SharedData.cpp : Storage for the global data in the DLL
+// This file is used only when your compiler is Borland C++.
+
+// Change default data segment and data class names
+#ifndef __GNUC__
+#pragma option -zRSHSEG
+#pragma option -zTSHCLASS
+#endif
+
+#include "windows.h"
+
+DWORD vnc_thread_id = 0;
+UINT UpdateRectMessage = 0;
+UINT CopyRectMessage = 0;
+UINT MouseMoveMessage = 0;
+HHOOK hCallWndHook = NULL;							// Handle to the CallWnd hook
+HHOOK hGetMsgHook = NULL;							// Handle to the GetMsg hook
+HHOOK hDialogMsgHook = NULL;						// Handle to the DialogMsg hook
+HHOOK hLLKeyboardHook = NULL;						// Handle to LowLevel kbd hook
+HHOOK hLLMouseHook = NULL;							// Handle to LowLevel mouse hook
diff --git a/ica/win32/winvnc/vnchooks/SharedData.h b/ica/win32/winvnc/vnchooks/SharedData.h
new file mode 100644
index 0000000..c90acc1
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/SharedData.h
@@ -0,0 +1,33 @@
+//  Copyright (C) 2001 Const Kaplinsky. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+
+// SharedData.h : Declarations for the global data in the DLL
+// This file is used only when your compiler is Borland C++.
+
+extern DWORD vnc_thread_id;
+extern UINT UpdateRectMessage;
+extern UINT CopyRectMessage;
+extern UINT MouseMoveMessage;
+extern HHOOK hCallWndHook;
+extern HHOOK hGetMsgHook;
+extern HHOOK hDialogMsgHook;
+extern HHOOK hLLKeyboardHook;
+extern HHOOK hLLMouseHook;
diff --git a/ica/win32/winvnc/vnchooks/VNCHooks-bcc32.def b/ica/win32/winvnc/vnchooks/VNCHooks-bcc32.def
new file mode 100644
index 0000000..65f9727
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/VNCHooks-bcc32.def
@@ -0,0 +1,7 @@
+; VNCHooks.def : Declares the module parameters for the DLL.
+
+LIBRARY      "VNCHooks"
+DESCRIPTION  'WinVNC 3.0 Hook Library'
+
+SEGMENTS
+	SHSEG CLASS 'SHCLASS' SHARED
diff --git a/ica/win32/winvnc/vnchooks/VNCHooks-vc.def b/ica/win32/winvnc/vnchooks/VNCHooks-vc.def
new file mode 100644
index 0000000..efd1154
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/VNCHooks-vc.def
@@ -0,0 +1,7 @@
+; VNCHooks.def : Declares the module parameters for the DLL.
+
+LIBRARY      "VNCHooks"
+; DESCRIPTION  'WinVNC 3.0 Hook Library'
+
+SECTIONS
+	.SharedData read write shared
diff --git a/ica/win32/winvnc/vnchooks/VNCHooks.cpp b/ica/win32/winvnc/vnchooks/VNCHooks.cpp
new file mode 100644
index 0000000..0215be1
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/VNCHooks.cpp
@@ -0,0 +1,1180 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1997 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+// VNC update hook implementation.
+//
+
+#include "VNCHooks.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <crtdbg.h>
+
+/////////////////////////////////////////////////////////////////////////////
+// Storage for the global data in the DLL
+
+// MSVC is bugged - if a default value is missed off from one of the following
+// variables then that variable is process-specific for some reason!
+
+/////////////////////////////////////////////////////////////////////////////
+// Storage for the global data in the DLL
+// Note: For Borland C++ compilers, this data segment is defined in a
+//       separate file, SharedData.cpp.
+
+#ifdef _MSC_VER
+
+// MSVC is bugged - if a default value is missed off from one of the following
+// variables then that variable is process-specific for some reason!
+
+#pragma data_seg(".SharedData")
+DWORD vnc_thread_id = 0;
+UINT UpdateRectMessage = 0;
+UINT CopyRectMessage = 0;
+UINT MouseMoveMessage = 0;
+HHOOK hCallWndHook = NULL;							// Handle to the CallWnd hook
+HHOOK hGetMsgHook = NULL;							// Handle to the GetMsg hook
+HHOOK hDialogMsgHook = NULL;						// Handle to the DialogMsg hook
+HHOOK hLLKeyboardHook = NULL;						// Handle to LowLevel kbd hook
+HHOOK hLLMouseHook = NULL;							// Handle to LowLevel mouse hook
+#pragma data_seg( )
+
+
+#else
+
+#include "SharedData.h"
+
+
+#endif // _MSC_VER
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Per-instance DLL variables
+
+const char sPrefSegment[] = "Application_Prefs";
+char *sModulePrefs = NULL;							// Name of the module that created us
+BOOL prf_use_GetUpdateRect = FALSE;					// Use the GetUpdateRect paint mode
+BOOL prf_use_Timer = FALSE;							// Use Timer events to trigger updates
+BOOL prf_use_KeyPress = FALSE;						// Use keyboard events
+BOOL prf_use_LButtonUp = TRUE;						// Use left mouse button up events
+BOOL prf_use_MButtonUp = FALSE;						// Use middle mouse button up events
+BOOL prf_use_RButtonUp = FALSE;						// Use right mouse button up events
+BOOL prf_use_Deferral = FALSE;						// Use deferred updates
+
+HINSTANCE hInstance = NULL;							// This instance of the DLL
+BOOL HookMaster = FALSE;							// Is this instance WinVNC itself?
+
+BOOL appHookedOK = FALSE;							// Did InitInstance succeed?
+
+HICON old_cursor = NULL;							// Current Cursor icon handle
+
+BOOL m_ddihook;
+
+/////////////////////////////////////////////////////////////////////////////
+// Registered messages & atoms to be used by VNCHooks.DLL
+
+// Messages
+const UINT VNC_DEFERRED_UPDATE = RegisterWindowMessage("VNCHooks.Deferred.UpdateMessage");
+
+// Atoms
+const char *VNC_POPUPSELN_ATOMNAME = "VNCHooks.PopUpMenu.Selected";
+ATOM VNC_POPUPSELN_ATOM = INVALID_ATOM;
+
+/////////////////////////////////////////////////////////////////////////////
+// The DLL functions
+
+// Forward definition of hook procedures
+
+BOOL HookHandle(UINT msg, HWND hWnd, WPARAM wParam, LPARAM lParam);
+LRESULT CALLBACK CallWndProc (int nCode, WPARAM wParam, LPARAM lParam);
+LRESULT CALLBACK GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam);
+LRESULT CALLBACK DialogMessageProc(int nCode, WPARAM wParam, LPARAM lParam);
+LRESULT CALLBACK LowLevelKeyboardFilterProc(int nCode, WPARAM wParam, LPARAM lParam);
+LRESULT CALLBACK LowLevelMouseFilterProc(int nCode, WPARAM wParam, LPARAM lParam);
+
+// Forward definition of setup and shutdown procedures
+BOOL InitInstance();
+BOOL ExitInstance();
+
+// The DLL's main procedure
+BOOL WINAPI DllMain (HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
+{
+	// Find out why we're being called
+	switch (ul_reason_for_call)
+	{
+
+	case DLL_PROCESS_ATTACH:
+#ifdef _MSC_VER 
+		_RPT0(_CRT_WARN, "vncHooks : Hook DLL loaded\n");
+#endif
+
+		// Save the instance handle
+		hInstance = (HINSTANCE)hInst;
+
+		// Call the initialisation function
+		appHookedOK = InitInstance();
+
+		// ALWAYS return TRUE to avoid breaking unhookable applications!!!
+		return TRUE;
+
+	case DLL_PROCESS_DETACH:
+#ifdef _MSC_VER 
+		_RPT0(_CRT_WARN, "vncHooks : Hook DLL unloaded\n");
+#endif
+		
+		// Call the exit function
+		// If the app failed to hook OK, ExitInstance will still operate OK (hopefully...)
+		ExitInstance();
+
+		return TRUE;
+
+	default:
+		return TRUE;
+	}
+}
+
+// Function used to find out whether VNCHooks uses "reliable" or "hint" hooks
+// Currently is always zero to indicate unreliable, hint hooks.
+DllExport DWORD HooksType()
+{
+	// Unreliable "hint" hooks
+	return 0;
+}
+
+// Add the new hook
+
+DllExport BOOL SetHooks(DWORD thread_id, UINT UpdateMsg, UINT CopyMsg, UINT MouseMsg,BOOL ddihook)
+{
+
+	// Don't add the hook if the thread id is NULL
+	if (!thread_id)
+		return FALSE;
+	m_ddihook=ddihook;
+	
+	// Don't add a hook if there is already one added
+	if (vnc_thread_id)
+		return FALSE;
+	// Add the CallWnd hook
+	hCallWndHook = SetWindowsHookEx(
+					WH_CALLWNDPROC,					// Hook in before msg reaches app
+					(HOOKPROC) CallWndProc,			// Hook procedure
+					hInstance,						// This DLL instance
+					0L								// Hook in to all apps
+//					GetCurrentThreadId()			// DEBUG : HOOK ONLY WinVNC
+					);
+
+	// Add the GetMessage hook
+	hGetMsgHook = SetWindowsHookEx(
+					WH_GETMESSAGE,					// Hook in before msg reaches app
+					(HOOKPROC) GetMessageProc,			// Hook procedure
+					hInstance,						// This DLL instance
+					0L								// Hook in to all apps
+//					GetCurrentThreadId()			// DEBUG : HOOK ONLY WinVNC
+					);
+
+		// Add the GetMessage hook
+	hDialogMsgHook = SetWindowsHookEx(
+					WH_SYSMSGFILTER,				// Hook in dialogs, menus and scrollbars
+					(HOOKPROC) DialogMessageProc,	// Hook procedure
+					hInstance,						// This DLL instance
+					0L								// Hook in to all apps
+					);
+
+	// Check that it worked
+	if ((hCallWndHook != NULL) && (hGetMsgHook != NULL) && (hDialogMsgHook != NULL))
+	{
+		vnc_thread_id = thread_id;			// Save the WinVNC thread id
+		UpdateRectMessage = UpdateMsg;		// Save the message ID to use for rectangle updates
+		CopyRectMessage = CopyMsg;			// Save the message ID to use for copyrect
+		MouseMoveMessage = MouseMsg;		// Save the message ID to send when mouse moves
+		HookMaster = TRUE;					// Set the HookMaster flag for this instance
+		return TRUE;
+	}
+	else
+	{
+		// Stop the keyboard hook
+		SetKeyboardFilterHook(FALSE);
+		SetMouseFilterHook(FALSE);
+
+		// Kill the main hooks
+		if (hCallWndHook != NULL)
+			UnhookWindowsHookEx(hCallWndHook);
+		if (hGetMsgHook != NULL)
+			UnhookWindowsHookEx(hGetMsgHook);
+		if (hDialogMsgHook != NULL)
+			UnhookWindowsHookEx(hDialogMsgHook);
+		hCallWndHook = NULL;
+		hGetMsgHook = NULL;
+		hDialogMsgHook = NULL;
+	}
+	if (ddihook)
+	{
+		if (hCallWndHook != NULL)
+			UnhookWindowsHookEx(hCallWndHook);
+		if (hDialogMsgHook != NULL)
+			UnhookWindowsHookEx(hDialogMsgHook);
+		hCallWndHook = NULL;
+		hDialogMsgHook = NULL;
+	}
+	// The hook failed, so return an error code
+	return FALSE;
+
+}
+
+// EnumWindows procedure to remove the extra property we added
+
+BOOL CALLBACK
+KillPropsProc(HWND hwnd, LPARAM lParam)
+{
+	// Remove our custom property...
+	RemoveProp(hwnd, (LPCTSTR) MAKELONG(VNC_POPUPSELN_ATOM, 0));
+	return TRUE;
+}
+
+// Remove the hook from the system
+
+DllExport BOOL UnSetHooks(DWORD thread_id)
+{
+
+	BOOL unHooked = TRUE;
+	
+	// Remove the extra property value from all local windows
+	EnumWindows((WNDENUMPROC) &KillPropsProc, 0);
+
+	// Stop the keyboard & mouse hooks
+	unHooked = unHooked && SetKeyboardFilterHook(FALSE);
+	unHooked = unHooked && SetMouseFilterHook(FALSE);
+
+	// Is the window handle valid?
+	if (thread_id != vnc_thread_id)
+		return FALSE;
+
+	// Unhook the procs
+	if (hCallWndHook != NULL)
+	{
+		unHooked = unHooked && UnhookWindowsHookEx(hCallWndHook);
+		hCallWndHook = NULL;
+	}
+
+	if (hGetMsgHook != NULL)
+	{
+		unHooked = unHooked && UnhookWindowsHookEx(hGetMsgHook);
+		hGetMsgHook = NULL;
+	}
+
+	if (hDialogMsgHook != NULL)
+	{
+		unHooked = unHooked && UnhookWindowsHookEx(hDialogMsgHook);
+		hDialogMsgHook = NULL;
+	}
+
+	// If we managed to unhook then reset
+	if (unHooked)
+	{
+		vnc_thread_id = 0;
+		HookMaster = FALSE;
+	}
+
+	return unHooked;
+
+}
+
+// Routine to start and stop local keyboard message filtering
+DllExport BOOL SetKeyboardFilterHook(BOOL activate)
+{
+	if (activate)
+	{
+#ifdef WH_KEYBOARD_LL
+		if (hLLKeyboardHook == NULL)
+		{
+			// Start up the hook...
+			hLLKeyboardHook = SetWindowsHookEx(
+					WH_KEYBOARD_LL,					// Hook in before msg reaches app
+					(HOOKPROC) LowLevelKeyboardFilterProc,			// Hook procedure
+					hInstance,						// This DLL instance
+					0L								// Hook in to all apps
+					);
+			if (hLLKeyboardHook == NULL)
+				return FALSE;
+		}
+		return TRUE;
+#else
+#pragma message("warning:Low-Level Keyboard hook code omitted.")
+		return FALSE;
+#endif
+	} else {
+		if (hLLKeyboardHook != NULL)
+		{
+			// Stop the hook...
+			if (!UnhookWindowsHookEx(hLLKeyboardHook))
+				return FALSE;
+			hLLKeyboardHook = NULL;
+		}
+		return TRUE;
+	}
+}
+
+// Routine to start and stop local mouse message filtering
+DllExport BOOL SetMouseFilterHook(BOOL activate)
+{
+	if (activate)
+	{
+#ifdef WH_MOUSE_LL
+		if (hLLMouseHook == NULL)
+		{
+			// Start up the hook...
+			hLLMouseHook = SetWindowsHookEx(
+					WH_MOUSE_LL,					// Hook in before msg reaches app
+					(HOOKPROC) LowLevelMouseFilterProc,			// Hook procedure
+					hInstance,						// This DLL instance
+					0L								// Hook in to all apps
+					);
+			if (hLLMouseHook == NULL)
+				return FALSE;
+		}
+		return TRUE;
+#else
+#pragma message("warning:Low-Level Mouse hook code omitted.")
+		return FALSE;
+#endif
+	} else {
+		if (hLLMouseHook != NULL)
+		{
+			// Stop the hook...
+			if (!UnhookWindowsHookEx(hLLMouseHook))
+				return FALSE;
+			hLLMouseHook = NULL;
+		}
+		return TRUE;
+	}
+}
+
+// Routine to get the window's client rectangle, in screen coordinates
+inline BOOL GetAbsoluteClientRect(HWND hwnd, RECT *rect)
+{
+	POINT topleft;
+	topleft.x = 0;
+	topleft.y = 0;
+
+	// Get the client rectangle size
+	if (!GetClientRect(hwnd, rect))
+		return FALSE;
+
+	// Get the client rectangle position
+	if (!ClientToScreen(hwnd, &topleft))
+		return FALSE;
+
+	// Now adjust the window rectangle
+	rect->left += topleft.x;
+	rect->top += topleft.y;
+	rect->right += topleft.x;
+	rect->bottom += topleft.y;
+
+	return TRUE;
+}
+
+// Routine to send an UpdateRect message to WinVNC
+inline void SendUpdateRect(SHORT x, SHORT y, SHORT x2, SHORT y2)
+{
+	WPARAM vwParam;
+	LPARAM vlParam;
+
+	vwParam = MAKELONG(x, y);
+	vlParam = MAKELONG(x2, y2);
+
+	// Send the update to WinVNC
+	PostThreadMessage(
+		vnc_thread_id,
+		UpdateRectMessage,
+		vwParam,
+		vlParam
+		);
+	HWND hWndRemote=FindWindow("WinVNC desktop sink", "WinVNC");
+	if (hWndRemote==NULL) UnSetHooks(vnc_thread_id);
+}
+
+// Send a window's position to WinVNC
+
+inline void SendWindowRect(HWND hWnd)
+{
+	RECT wrect;
+
+	// Get the rectangle position
+	if (IsWindowVisible(hWnd) && GetWindowRect(hWnd, &wrect))
+	{
+		// Send the position
+		SendUpdateRect(
+			(SHORT) wrect.left,
+			(SHORT) wrect.top,
+			(SHORT) wrect.right,
+			(SHORT) wrect.bottom
+			);
+	}
+}
+
+// Send a deferred message into this Window's message queue, so that
+// we'll intercept it again only after the message that triggered it has been
+// handled
+
+inline void SendDeferredUpdateRect(HWND hWnd, SHORT x, SHORT y, SHORT x2, SHORT y2)
+{
+	WPARAM vwParam;
+	LPARAM vlParam;
+
+	vwParam = MAKELONG(x, y);
+	vlParam = MAKELONG(x2, y2);
+
+	if (prf_use_Deferral)
+	{
+		// Send the update back to the window
+		PostMessage(
+			hWnd,
+			VNC_DEFERRED_UPDATE,
+			vwParam,
+			vlParam
+			);
+	}
+	else
+	{
+		// Send the update to WinVNC
+		PostThreadMessage(
+			vnc_thread_id,
+			UpdateRectMessage,
+			vwParam,
+			vlParam
+			);
+	}
+}
+
+inline void SendDeferredWindowRect(HWND hWnd)
+{
+	RECT wrect;
+
+	// Get the rectangle position
+	if (IsWindowVisible(hWnd) && GetWindowRect(hWnd, &wrect))
+	{
+		// Send the position
+		SendDeferredUpdateRect(
+			hWnd,
+			(SHORT) wrect.left,
+			(SHORT) wrect.top,
+			(SHORT) wrect.right,
+			(SHORT) wrect.bottom
+			);
+	}
+}
+
+inline void SendDeferredBorderRect(HWND hWnd)
+{
+	RECT wrect;
+	RECT crect;
+
+	// Get the rectangle position
+	if (IsWindowVisible(hWnd) && GetWindowRect(hWnd, &wrect))
+	{
+		// Get the client rectangle position
+		if (GetAbsoluteClientRect(hWnd, &crect))
+		{
+			// Send the four border rectangles
+			SendDeferredUpdateRect(hWnd, (SHORT) wrect.left, (SHORT) wrect.top, (SHORT) wrect.right, (SHORT) crect.top);
+			SendDeferredUpdateRect(hWnd, (SHORT) wrect.left, (SHORT) wrect.top, (SHORT) crect.left, (SHORT) wrect.bottom);
+			SendDeferredUpdateRect(hWnd, (SHORT) wrect.left, (SHORT) crect.bottom, (SHORT) wrect.right, (SHORT) wrect.bottom);
+			SendDeferredUpdateRect(hWnd, (SHORT) crect.right, (SHORT) wrect.top, (SHORT) wrect.right, (SHORT) wrect.bottom);
+		}
+	}
+}
+// ddihook, we only need the mouse info
+inline BOOL HookHandleddi(UINT MessageId, HWND hWnd, WPARAM wParam, LPARAM lParam)
+{
+	switch (MessageId)
+	{
+	case WM_NCMOUSEMOVE:
+	case WM_MOUSEMOVE:
+		// Inform WinVNC that the mouse has moved and pass it the current cursor handle
+		{
+			HICON new_cursor = GetCursor();
+			if (new_cursor != old_cursor) {
+				PostThreadMessage(
+					vnc_thread_id,
+					MouseMoveMessage,
+					(ULONG_PTR)new_cursor, 0);
+				old_cursor=new_cursor;
+			}
+		}
+		break;
+	}
+	return TRUE;
+}
+// Generic hook-handler
+
+inline BOOL HookHandle(UINT MessageId, HWND hWnd, WPARAM wParam, LPARAM lParam)
+{
+	////////////////////////////////////////////////////////////////
+	// HANDLE DEFERRED UPDATES
+
+	// Is this a deferred-update message?
+	if (MessageId == VNC_DEFERRED_UPDATE)
+	{
+
+		// NOTE : NEVER use the SendDeferred- routines to send updates
+		//		from here, or you'll get an infinite loop....!
+
+		// NB : The format of DEFERRED_UPDATE matches that of UpdateRectMessage,
+		//		so just send the exact same message data to WinVNC
+
+		PostThreadMessage(
+			vnc_thread_id,
+			UpdateRectMessage,
+			wParam,
+			lParam
+			);
+
+		return FALSE;
+	}
+
+	// *** Could use WM_COPYDATA to send data to WinVNC
+
+/*
+	if (GetClassLong(hWnd, GCW_ATOM) == 32768)
+	{
+		_RPT4(_CRT_WARN, "DBG : popup menu message (hwnd=%d, msg=%d, l=%d, w=%d)\n",
+		hWnd, MessageId, lParam, wParam);
+	}
+*/
+
+	////////////////////////////////////////////////////////////////
+	// UPDATE-TRIGGERING MESSAGES
+
+	// Do something dependent upon message type
+	switch (MessageId)
+	{
+		
+		////////////////////////////////////////////////////////////////
+		// Messages indicating only a border repaint.
+	case WM_NCPAINT:
+	case WM_NCACTIVATE:
+		SendDeferredBorderRect(hWnd);
+		old_cursor = NULL;
+		break;
+
+		////////////////////////////////////////////////////////////////
+		// Messages indicating a client area repaint
+	case WM_CHAR:
+	case WM_KEYUP:							// Handle key-presses
+		if (prf_use_KeyPress)
+			SendDeferredWindowRect(hWnd);
+		break;
+
+	case WM_LBUTTONUP:						// Handle LMB clicks
+		if (prf_use_LButtonUp)
+			SendDeferredWindowRect(hWnd);
+		break;
+
+	case WM_MBUTTONUP:						// Handle MMB clicks
+		if (prf_use_MButtonUp)
+			SendDeferredWindowRect(hWnd);
+		break;
+
+	case WM_RBUTTONUP:						// Handle RMB clicks
+		if (prf_use_RButtonUp)
+			SendDeferredWindowRect(hWnd);
+		break;
+
+	case WM_TIMER:
+		if (prf_use_Timer)
+			SendDeferredWindowRect(hWnd);
+		break;
+
+	case WM_HSCROLL:
+	case WM_VSCROLL:
+		if (((int) LOWORD(wParam) == SB_THUMBTRACK) || ((int) LOWORD(wParam) == SB_ENDSCROLL))
+			SendDeferredWindowRect(hWnd);
+		break;
+
+	case 485:  // HACK to handle popup menus
+		{
+			// Get the old popup menu selection value
+			HANDLE prop = GetProp(hWnd, (LPCTSTR) MAKELONG(VNC_POPUPSELN_ATOM, 0));
+			if (prop != (HANDLE) wParam)
+			{
+				// It did, so update the menu & the selection value
+				SendDeferredWindowRect(hWnd);
+				SetProp(hWnd,
+					(LPCTSTR) MAKELONG(VNC_POPUPSELN_ATOM, 0),
+					(HANDLE) wParam);
+			}
+		}
+		break;
+
+		////////////////////////////////////////////////////////////////
+		// Messages indicating a full window update
+	case WM_SYSCOLORCHANGE:
+	case WM_PALETTECHANGED:
+	case WM_SETTEXT:
+	case WM_ENABLE:
+	case BM_SETCHECK:
+	case BM_SETSTATE:
+	case EM_SETSEL:
+	//case WM_MENUSELECT:
+		SendDeferredWindowRect(hWnd);
+		break;
+
+		////////////////////////////////////////////////////////////////
+		// Messages indicating that an area of the window needs updating
+		// Uses GetUpdateRect to find out which
+	case WM_PAINT:
+		if (prf_use_GetUpdateRect)
+		{
+			HRGN region;
+			region = CreateRectRgn(0, 0, 0, 0);
+
+			// Get the affected region
+			if (GetUpdateRgn(hWnd, region, FALSE) != ERROR)
+			{
+				int buffsize;
+				UINT x;
+				RGNDATA *buff;
+				POINT TopLeft;
+
+				// Get the top-left point of the client area
+				TopLeft.x = 0;
+				TopLeft.y = 0;
+				if (!ClientToScreen(hWnd, &TopLeft))
+					break;
+
+				// Get the size of buffer required
+				buffsize = GetRegionData(region, 0, 0);
+				if (buffsize != 0)
+				{
+					buff = (RGNDATA *) new BYTE [buffsize];
+					if (buff == NULL)
+						break;
+
+					// Now get the region data
+					if(GetRegionData(region, buffsize, buff))
+					{
+						for (x=0; x<(buff->rdh.nCount); x++)
+						{
+							// Obtain the rectangles from the list
+							RECT *urect = (RECT *) (((BYTE *) buff) + sizeof(RGNDATAHEADER) + (x * sizeof(RECT)));
+							SendDeferredUpdateRect(
+								hWnd,
+								(SHORT) (TopLeft.x + urect->left),
+								(SHORT) (TopLeft.y + urect->top),
+								(SHORT) (TopLeft.x + urect->right),
+								(SHORT) (TopLeft.y + urect->bottom)
+								);
+
+							// Modified by mws for VNC ver. 3.3.6
+							// We yield this thread so our PostMessages and socket commands
+							// can complete, otherwise this hook can suck up too many
+							// timeslices before it returns
+							Sleep (0);
+						}
+					}
+
+					delete [] buff;
+				}
+			}
+
+			// Now free the region
+			if (region != NULL)
+				DeleteObject(region);
+		}
+		else
+			SendDeferredWindowRect(hWnd);
+		break;
+
+		////////////////////////////////////////////////////////////////
+		// Messages indicating full repaint of this and a different window
+		// Send the new position of the window
+	case WM_WINDOWPOSCHANGING:
+		if (IsWindowVisible(hWnd))
+			SendWindowRect(hWnd);
+		break;
+
+	case WM_WINDOWPOSCHANGED:
+		if (IsWindowVisible(hWnd))
+			SendDeferredWindowRect(hWnd);
+		break;
+
+	////////////////////////////////////////////////////////////////
+	// WinVNC also wants to know about mouse movement
+	case WM_NCMOUSEMOVE:
+	case WM_MOUSEMOVE:
+		// Inform WinVNC that the mouse has moved and pass it the current cursor handle
+		{
+			HICON new_cursor = GetCursor();
+			if (new_cursor != old_cursor) {
+				PostThreadMessage(
+					vnc_thread_id,
+					MouseMoveMessage,
+					(ULONG_PTR)new_cursor, 0);
+				old_cursor=new_cursor;
+			}
+		}
+		break;
+
+    // RealVNC 335
+    case WM_MOUSEWHEEL:           // Handle mousewheel events
+       SendDeferredWindowRect(hWnd);
+       break;
+		////////////////////////////////////////////////////////////////
+		// VNCHOOKS PROPERTIES HANDLING WINDOWS
+	case WM_DESTROY:
+		RemoveProp(hWnd, (LPCTSTR) MAKELONG(VNC_POPUPSELN_ATOM, 0));
+		break;
+
+	}
+
+	return TRUE;
+}
+
+// Hook procedure for CallWindow hook
+
+LRESULT CALLBACK CallWndProc(int nCode, WPARAM wParam, LPARAM lParam)
+{
+	// Do we have to handle this message?
+	if (nCode == HC_ACTION)
+	{
+		// Process the hook if the WinVNC thread ID is valid
+		if (vnc_thread_id)
+		{
+			CWPSTRUCT *cwpStruct = (CWPSTRUCT *) lParam;
+			HookHandle(cwpStruct->message, cwpStruct->hwnd, cwpStruct->wParam, cwpStruct->lParam);
+		}
+	}
+
+	// Call the next handler in the chain
+    return CallNextHookEx (hCallWndHook, nCode, wParam, lParam);
+}
+
+// Hook procedure for GetMessageProc hook
+
+LRESULT CALLBACK GetMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
+{
+	// Do we have to handle this message?
+	if (nCode == HC_ACTION)
+	{
+		// Process the hook only if the WinVNC thread id is valid
+		if (vnc_thread_id)
+		{
+			MSG *msg = (MSG *) lParam;
+
+			// Only handle application messages if they're being removed:
+			if (wParam & PM_REMOVE)
+			{
+				// Handle the message
+				if (m_ddihook)
+				HookHandleddi(msg->message, msg->hwnd, msg->wParam, msg->lParam);
+				else HookHandle(msg->message, msg->hwnd, msg->wParam, msg->lParam);
+			}
+		}
+	}
+
+	// Call the next handler in the chain
+    return CallNextHookEx (hGetMsgHook, nCode, wParam, lParam);
+}
+
+
+// Hook procedure for DialogMessageProc hook
+
+LRESULT CALLBACK DialogMessageProc(int nCode, WPARAM wParam, LPARAM lParam)
+{
+	// Do we have to handle this message?
+	if (nCode >= 0)
+	{
+		// Process the hook only if the WinVNC thread ID is valid
+		if (vnc_thread_id)
+		{
+			MSG *msg = (MSG *) lParam;
+
+			// Handle the message
+			HookHandle(msg->message, msg->hwnd, msg->wParam, msg->lParam);
+		}
+	}
+
+	// Call the next handler in the chain
+    return CallNextHookEx (hGetMsgHook, nCode, wParam, lParam);
+}
+
+// Hook procedure for LowLevel Keyboard filtering
+
+#ifdef WH_KEYBOARD_LL
+LRESULT CALLBACK LowLevelKeyboardFilterProc(int nCode, WPARAM wParam, LPARAM lParam)
+{
+	// Are we expected to handle this callback?
+	if (nCode == HC_ACTION)
+	{
+		// Is this keyboard event "real" or "injected"
+		// i.e. hardware or software-produced?
+		KBDLLHOOKSTRUCT *hookStruct = (KBDLLHOOKSTRUCT*)lParam;
+		if (!(hookStruct->flags & LLKHF_INJECTED)) {
+			// Message was not injected - reject it!
+			return TRUE;
+		}
+	}
+
+	// Otherwise, pass on the message
+	return CallNextHookEx(hLLKeyboardHook, nCode, wParam, lParam);
+}
+#endif
+
+// Hook procedure for LowLevel Mouse filtering
+
+#ifdef WH_MOUSE_LL
+LRESULT CALLBACK LowLevelMouseFilterProc(int nCode, WPARAM wParam, LPARAM lParam)
+{
+	// Are we expected to handle this callback?
+	if (nCode == HC_ACTION)
+	{
+		// Is this mouse event "real" or "injected"
+		// i.e. hardware or software-produced?
+		MSLLHOOKSTRUCT *hookStruct = (MSLLHOOKSTRUCT*)lParam;
+		if (!(hookStruct->flags & LLMHF_INJECTED)) {
+			// Message was not injected - reject it!
+			return TRUE;
+		}
+	}
+
+	// Otherwise, pass on the message
+	return CallNextHookEx(hLLMouseHook, nCode, wParam, lParam);
+}
+#endif
+
+char * NameFromPath(const char *path)
+{
+	int x;
+	int l = strlen(path);
+	char *temp = NULL;
+	
+	// Find the file part of a filename
+	for (x=l-1; x>0; x--)
+	{
+		if (path[x] == '\\')
+		{
+			temp = _strdup(&(path[x+1]));
+			break;
+		}
+	}
+
+	// If we didn't fine a \ then just return a copy of the original
+	if (temp == NULL)
+		temp = _strdup(path);
+
+	return temp;
+}
+
+/////////////////////////////////////////////////////////////////////////////
+// Initialise / Exit routines.
+// These functions handle the update settings for any apps used with WinVNC.
+
+static const TCHAR szSoftware[] = "Software";
+static const TCHAR szCompany[] = "ORL";
+static const TCHAR szProfile[] = "VNCHooks";
+
+HKEY hModuleKey = NULL;
+
+HKEY OpenKey(HKEY basekey, const char* path[], bool writable, bool create) {
+	HKEY key = basekey;
+	DWORD flags = KEY_READ;
+	if (writable) flags |= KEY_WRITE;
+	if (create) flags |= KEY_CREATE_SUB_KEY;
+	unsigned int i = 0;
+	while (path[i]) {
+		HKEY newkey;
+		DWORD result, dw;
+		if (create) {
+#ifdef _MSC_VER 
+			_RPT2(_CRT_WARN, "vncHooks : creating %s from %x\n", path[i], key);
+#endif
+			result = RegCreateKeyEx(key, path[i], 0, REG_NONE,
+				REG_OPTION_NON_VOLATILE, flags, NULL,
+				&newkey, &dw);
+		} else {
+#ifdef _MSC_VER 
+			_RPT2(_CRT_WARN, "vncHooks : opening %s from %x\n", path[i], key);
+#endif
+			result = RegOpenKeyEx(key, path[i], 0, flags, &newkey);
+		}
+		if (key && (key != basekey)) RegCloseKey(key);
+		key = newkey;
+		if (result != ERROR_SUCCESS) {
+#ifdef _MSC_VER 
+			_RPT2(_CRT_WARN, "vncHooks : failed to open %s(%lu)\n", path[i], result);
+#endif
+			return NULL;
+		} else {
+#ifdef _MSC_VER 
+			_RPT2(_CRT_WARN, "vncHooks : opened %s (%x)\n", path[i], key);
+#endif
+		}
+		i++;
+	}
+	return key;
+}
+
+HKEY GetModuleKey(HKEY basekey, const char* proc_name, bool writable, bool create) {
+	// Work out the registry key to save this under
+	if (!sModulePrefs) {
+		sModulePrefs = (char *) malloc(strlen(proc_name) + 1);
+		if (sModulePrefs == NULL)
+			return FALSE;
+		strcpy(sModulePrefs, proc_name);
+	}
+	
+	// Check whether the library's entry exists!
+	const char* appPath[] = {szSoftware, szCompany, szProfile, 0};
+	HKEY appKey = OpenKey(basekey, appPath, writable, create);
+	if (!appKey)
+		return NULL;
+	
+	// Attempt to open the registry section for the application
+	const char* modPath[] = {sPrefSegment, sModulePrefs, 0};
+	HKEY modKey = OpenKey(appKey, modPath, writable, false);
+	if (!modKey) {
+		// Cut off the app directory and just use the name
+		char *file_name = NameFromPath(proc_name);
+		
+		if (!file_name)
+		{
+			RegCloseKey(appKey);
+			return NULL;
+		}
+		
+		// Adjust the moduleprefs name
+		strcpy(sModulePrefs, file_name);
+		free(file_name);
+		
+		// Now get the module key again
+		const char* modPath2[] = {sPrefSegment, sModulePrefs, 0};
+		modKey = OpenKey(appKey, modPath2, writable, create);
+	}
+	
+	RegCloseKey(appKey);
+	
+	return modKey;
+}
+
+int GetProfileInt(LPTSTR key, int def)
+{
+	DWORD type;
+	DWORD value;
+	ULONG size = sizeof(value);
+
+	if (RegQueryValueEx(
+		hModuleKey,
+		key,
+		NULL,
+		&type,
+		(unsigned char *)&value,
+		&size) == ERROR_SUCCESS)
+	{
+		// Is the value of the right type?
+		if (type != REG_DWORD)
+		{
+			return def;
+		}
+		else
+		{
+			return value;
+		}
+	}
+	else
+	{
+		return def;
+	}
+}
+
+void WriteProfileInt(LPTSTR key, int value)
+{
+	RegSetValueEx(
+		hModuleKey,
+		key,
+		0,
+		REG_DWORD,
+		(unsigned char *)&value,
+		sizeof(value));
+}
+
+void ReadSettings() {
+  // Read in the prefs
+	prf_use_GetUpdateRect = GetProfileInt(
+		(CHAR *) "use_GetUpdateRect",
+		TRUE
+		);
+
+	prf_use_Timer = GetProfileInt(
+		(CHAR *) "use_Timer",
+		FALSE
+		);
+	prf_use_KeyPress = GetProfileInt(
+		(CHAR *) "use_KeyPress",
+		TRUE
+		);
+	prf_use_LButtonUp = GetProfileInt(
+		(CHAR *) "use_LButtonUp",
+		TRUE
+		);
+	prf_use_MButtonUp = GetProfileInt(
+		(CHAR *) "use_MButtonUp",
+		TRUE
+		);
+	prf_use_RButtonUp = GetProfileInt(
+		(CHAR *) "use_RButtonUp",
+		TRUE
+		);
+	prf_use_Deferral = GetProfileInt(
+		(CHAR *) "use_Deferral",
+		TRUE
+		);
+}
+
+BOOL InitInstance() 
+{
+	// Create the global atoms
+	if (VNC_POPUPSELN_ATOM == INVALID_ATOM)
+    	VNC_POPUPSELN_ATOM = GlobalAddAtom(VNC_POPUPSELN_ATOMNAME);
+	if (VNC_POPUPSELN_ATOM == INVALID_ATOM)
+		return FALSE;
+
+	// Get the module name
+	char proc_name[_MAX_PATH];
+	DWORD size;
+
+	// Attempt to get the program/module name
+	if ((size = GetModuleFileName(
+		GetModuleHandle(NULL),
+		(char *) &proc_name,
+		_MAX_PATH
+		)) == 0)
+		return FALSE;
+
+  // Get the default system key for the module
+	hModuleKey = GetModuleKey(HKEY_LOCAL_MACHINE, proc_name, false, false);
+  if (hModuleKey != NULL) {
+#ifdef _MSC_VER 
+		_RPT0(_CRT_WARN, "vncHooks : loading machine prefs\n");
+#endif
+    ReadSettings();
+		RegCloseKey(hModuleKey);
+    hModuleKey = NULL;
+  }
+
+	// Get the key for the module
+	hModuleKey = GetModuleKey(HKEY_CURRENT_USER, proc_name, false, false);
+  if (hModuleKey != NULL) {
+#ifdef _MSC_VER 
+		_RPT0(_CRT_WARN, "vncHooks : loading user prefs\n");
+#endif
+    ReadSettings();
+		RegCloseKey(hModuleKey);
+    hModuleKey = NULL;
+  }
+
+	return TRUE;
+}
+
+BOOL ExitInstance() 
+{
+	// Free the created atoms
+	if (VNC_POPUPSELN_ATOM != INVALID_ATOM)
+	{
+		GlobalDeleteAtom(VNC_POPUPSELN_ATOM);
+		VNC_POPUPSELN_ATOM = INVALID_ATOM;
+	}
+
+	// Write the module settings to disk
+	if (sModulePrefs != NULL)
+	{
+	  // Get the module name
+	  char proc_name[_MAX_PATH];
+	  DWORD size;
+
+	  // Attempt to get the program/module name
+	  if ((size = GetModuleFileName(
+		  GetModuleHandle(NULL),
+		  (char *) &proc_name,
+		  _MAX_PATH
+		  )) == 0)
+		  return FALSE;
+
+	  // Get the key for the module
+#ifdef _MSC_VER 
+		_RPT0(_CRT_WARN, "vncHooks : locating user prefs\n");
+#endif
+	  hModuleKey = GetModuleKey(HKEY_CURRENT_USER, proc_name, true, true);
+	  if (hModuleKey == NULL)
+		  return FALSE;
+#ifdef _MSC_VER 
+		_RPT0(_CRT_WARN, "vncHooks : writing user prefs\n");
+#endif
+
+		WriteProfileInt(
+			(CHAR *) "use_GetUpdateRect",
+			prf_use_GetUpdateRect
+			);
+
+		WriteProfileInt(
+			(CHAR *) "use_Timer",
+			prf_use_Timer
+			);
+
+		WriteProfileInt(
+			(CHAR *) "use_KeyPress",
+			prf_use_KeyPress
+			);
+
+		WriteProfileInt(
+			(CHAR *) "use_LButtonUp",
+			prf_use_LButtonUp
+			);
+
+		WriteProfileInt(
+			(CHAR *) "use_MButtonUp",
+			prf_use_MButtonUp
+			);
+
+		WriteProfileInt(
+			(CHAR *) "use_RButtonUp",
+			prf_use_RButtonUp
+			);
+
+		WriteProfileInt(
+			(CHAR *) "use_Deferral",
+			prf_use_Deferral
+			);
+
+		free(sModulePrefs);
+		sModulePrefs = NULL;
+	}
+
+	// Close the registry key for this module
+  if (hModuleKey != NULL) {
+		RegCloseKey(hModuleKey);
+    hModuleKey = NULL;
+  }
+
+	return TRUE;
+}
diff --git a/ica/win32/winvnc/vnchooks/VNCHooks.def b/ica/win32/winvnc/vnchooks/VNCHooks.def
new file mode 100644
index 0000000..efd1154
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/VNCHooks.def
@@ -0,0 +1,7 @@
+; VNCHooks.def : Declares the module parameters for the DLL.
+
+LIBRARY      "VNCHooks"
+; DESCRIPTION  'WinVNC 3.0 Hook Library'
+
+SECTIONS
+	.SharedData read write shared
diff --git a/ica/win32/winvnc/vnchooks/VNCHooks.h b/ica/win32/winvnc/vnchooks/VNCHooks.h
new file mode 100644
index 0000000..7487982
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/VNCHooks.h
@@ -0,0 +1,73 @@
+/////////////////////////////////////////////////////////////////////////////
+// VNC Hooks library
+//
+// WinVNC uses this DLL to hook into the system message pipeline, allowing it
+// to intercept messages which may be relevant to screen update strategy
+//
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1997 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+// VNC Hooks library
+//
+// This version created:
+// 24/11/97
+
+#if !defined(_VNCHOOKS_DLL_)
+#define _VNCHOOKS_DLL_
+
+#include <windows.h>
+
+/////////////////////////////////////////////////////////////////////////////
+// Define the import/export tags
+
+#define DllImport __declspec(dllimport)
+#define DllExport __declspec(dllexport)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Functions used by WinVNC
+
+#define VNC_HOOKS_CATCHES_ALL 0x1					// Doesn't miss updates
+#define VNC_HOOKS_CATCHES_MIN 0x2					// Reports minimal updates
+
+extern "C"
+{
+	// DLL functions:
+	DllExport DWORD HooksType();                    // Find out whether hooks are reliable/hints
+	DllExport BOOL SetHooks(
+		DWORD thread_id,
+		UINT UpdateMsg,
+		UINT CopyMsg,
+		UINT MouseMsg,
+		BOOL ddihook
+		);											// Set the hook
+	DllExport BOOL UnSetHooks(DWORD thread_id);		// Remove it
+
+	DllExport BOOL SetKeyboardFilterHook(BOOL activate);
+													// Control keyboard filtering
+	DllExport BOOL SetMouseFilterHook(BOOL activate);
+													// Control mouse filtering
+}
+
+#endif // !defined(_VNCHOOKS_DLL_)
diff --git a/ica/win32/winvnc/vnchooks/resource.h b/ica/win32/winvnc/vnchooks/resource.h
new file mode 100644
index 0000000..3063d86
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by VNCHooks.rc
+//
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/winvnc/vnchooks/vnchooks.dsp b/ica/win32/winvnc/vnchooks/vnchooks.dsp
new file mode 100644
index 0000000..0121ddf
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/vnchooks.dsp
@@ -0,0 +1,123 @@
+# Microsoft Developer Studio Project File - Name="vnchooks" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=vnchooks - Win32 Profile
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "vnchooks.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "vnchooks.mak" CFG="vnchooks - Win32 Profile"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "vnchooks - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "vnchooks - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "vnchooks - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release"
+# PROP Intermediate_Dir "..\Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VNCHOOKS_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "__WIN32__" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VNCHOOKS_EXPORTS" /D _WIN32_WINNT=0x400 /YX /FD /O3 /QaxM /Qip /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 user32.lib advapi32.lib gdi32.lib /nologo /dll /debug /machine:I386
+
+!ELSEIF  "$(CFG)" == "vnchooks - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\Debug"
+# PROP Intermediate_Dir "..\Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VNCHOOKS_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "__WIN32__" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "VNCHOOKS_EXPORTS" /D _WIN32_WINNT=0x400 /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=xilink6.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 user32.lib advapi32.lib gdi32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "vnchooks - Win32 Release"
+# Name "vnchooks - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\VNCHooks.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\VNCHooks.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\VNCHooks.rc
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\VNCHooks.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/ica/win32/winvnc/vnchooks/vnchooks.rc b/ica/win32/winvnc/vnchooks/vnchooks.rc
new file mode 100644
index 0000000..35c33b7
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/vnchooks.rc
@@ -0,0 +1,109 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.K.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,1,0,0
+ PRODUCTVERSION 1,1,0,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "080904b0"
+        BEGIN
+            VALUE "Comments", "\0"
+            VALUE "CompanyName", "UltraVNC\0"
+            VALUE "FileDescription", "VNC hooks DLL for Win32\0"
+            VALUE "FileVersion", "1, 1, 0, 0\0"
+            VALUE "InternalName", "VNCHooks\0"
+            VALUE "LegalCopyright", "Copyright (C) 2002 UltraVNC, Copyright RealVNC Ltd.© 2002, AT&T Research Labs Cambridge© 1996-2001\0"
+            VALUE "LegalTrademarks", "\0"
+            VALUE "OriginalFilename", "VNCHooks.dll\0"
+            VALUE "PrivateBuild", "\0"
+            VALUE "ProductName", "UltraVNC - VNCHooks\0"
+            VALUE "ProductVersion", "1, 1, 0, 0\0"
+            VALUE "SpecialBuild", "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x809, 1200
+    END
+END
+
+#endif    // !_MAC
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // English (U.K.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/winvnc/vnchooks/vnchooks.vcproj b/ica/win32/winvnc/vnchooks/vnchooks.vcproj
new file mode 100644
index 0000000..4f48d74
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/vnchooks.vcproj
@@ -0,0 +1,717 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="vnchooks"
+	ProjectGUID="{1D18E045-6B72-43F4-ACBD-3E679A3DE349}"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\..\Debug"
+			IntermediateDirectory=".\..\Debug"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\..\Debug/vnchooks.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="_DEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\..\Debug/vnchooks.pch"
+				AssemblerListingLocation=".\..\Debug/"
+				ObjectFile=".\..\Debug/"
+				ProgramDataBaseFileName=".\..\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\..\Debug/vnchooks.dll"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\VNCHooks.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Debug/vnchooks.pdb"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				ImportLibrary=".\..\Debug/vnchooks.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Debug/vnchooks.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName=".\..\Debug/vnchooks.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="_DEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\..\Debug/vnchooks.pch"
+				AssemblerListingLocation=".\..\Debug/"
+				ObjectFile=".\..\Debug/"
+				ProgramDataBaseFileName=".\..\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\..\Debug/vnchooks.dll"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\VNCHooks.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Debug/vnchooks.pdb"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				ImportLibrary=".\..\Debug/vnchooks.lib"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Debug/vnchooks.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\..\Release"
+			IntermediateDirectory=".\..\Release"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\..\Release/vnchooks.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="NDEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/vnchooks.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\..\Release/vnchooks.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\VNCHooks.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Release/vnchooks.pdb"
+				OptimizeReferences="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				ImportLibrary=".\..\Release/vnchooks.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/vnchooks.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName=".\..\Release/vnchooks.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="NDEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/vnchooks.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\..\Release/vnchooks.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\VNCHooks.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Release/vnchooks.pdb"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				ImportLibrary=".\..\Release/vnchooks.lib"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/vnchooks.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="IPP|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\..\Release/vnchooks.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="NDEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/vnchooks.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\..\Release/vnchooks.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\VNCHooks.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Release/vnchooks.pdb"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				ImportLibrary=".\..\Release/vnchooks.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/vnchooks.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="IPP|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName=".\..\Release/vnchooks.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="NDEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/vnchooks.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\..\Release/vnchooks.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\VNCHooks.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Release/vnchooks.pdb"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				ImportLibrary=".\..\Release/vnchooks.lib"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/vnchooks.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="VNCHooks.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="VNCHooks.def"
+				>
+			</File>
+			<File
+				RelativePath="VNCHooks.rc"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="resource.h"
+				>
+			</File>
+			<File
+				RelativePath="VNCHooks.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/ica/win32/winvnc/vnchooks/vnchooksVS2005.vcproj b/ica/win32/winvnc/vnchooks/vnchooksVS2005.vcproj
new file mode 100644
index 0000000..463345f
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/vnchooksVS2005.vcproj
@@ -0,0 +1,505 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="vnchooks"
+	ProjectGUID="{1D18E045-6B72-43F4-ACBD-3E679A3DE349}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\..\Debug"
+			IntermediateDirectory=".\..\Debug"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\..\Debug/vnchooks.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="_DEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\..\Debug/vnchooks.pch"
+				AssemblerListingLocation=".\..\Debug/"
+				ObjectFile=".\..\Debug/"
+				ProgramDataBaseFileName=".\..\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\..\Debug/vnchooks.dll"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\VNCHooks.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Debug/vnchooks.pdb"
+				ImportLibrary=".\..\Debug/vnchooks.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Debug/vnchooks.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\..\Release"
+			IntermediateDirectory=".\..\Release"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\..\Release/vnchooks.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="NDEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/vnchooks.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\..\Release/vnchooks.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\VNCHooks.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Release/vnchooks.pdb"
+				ImportLibrary=".\..\Release/vnchooks.lib"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/vnchooks.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName=".\..\Debug/vnchooks.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="_DEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				PrecompiledHeaderFile=".\..\Debug/vnchooks.pch"
+				AssemblerListingLocation=".\..\Debug/"
+				ObjectFile=".\..\Debug/"
+				ProgramDataBaseFileName=".\..\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\..\Debug/vnchooks.dll"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\VNCHooks.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Debug/vnchooks.pdb"
+				ImportLibrary=".\..\Debug/vnchooks.lib"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Debug/vnchooks.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName=".\..\Release/vnchooks.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="NDEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/vnchooks.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile=".\..\Release/vnchooks.dll"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ModuleDefinitionFile=".\VNCHooks.def"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Release/vnchooks.pdb"
+				ImportLibrary=".\..\Release/vnchooks.lib"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/vnchooks.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="VNCHooks.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="VNCHooks.def"
+				>
+			</File>
+			<File
+				RelativePath="VNCHooks.rc"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="resource.h"
+				>
+			</File>
+			<File
+				RelativePath="VNCHooks.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/ica/win32/winvnc/vnchooks/vnchooks_vs90_Debug_Win32.lnt b/ica/win32/winvnc/vnchooks/vnchooks_vs90_Debug_Win32.lnt
new file mode 100644
index 0000000..4edbd8f
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/vnchooks_vs90_Debug_Win32.lnt
@@ -0,0 +1,12 @@
+
+// Generated by Visual Lint 1.5.8.77 from file: D:\UltraVNC-src\UltraVNC Project Root\UltraVNC\winvnc\vnchooks\vnchooks.vcproj
+// -dConfiguration=Debug|Win32
+//
+-D_WINDLL                       // ConfigurationType = "2"
+-D_MBCS                         // CharacterSet = "2"
+-D_DEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS
+                                // PreprocessorDefinitions = "_DEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+-D_NATIVE_WCHAR_T_DEFINED       // TreatWChar_tAsBuiltInType = "TRUE"
+-D_MT;_DEBUG;_DLL               // RuntimeLibrary = "3"
+
+VNCHooks.cpp                    // RelativePath = "VNCHooks.cpp"
diff --git a/ica/win32/winvnc/vnchooks/vnchooks_vs90_Release_Win32.lnt b/ica/win32/winvnc/vnchooks/vnchooks_vs90_Release_Win32.lnt
new file mode 100644
index 0000000..1ac3abc
--- /dev/null
+++ b/ica/win32/winvnc/vnchooks/vnchooks_vs90_Release_Win32.lnt
@@ -0,0 +1,12 @@
+
+// Generated by Visual Lint 1.5.8.77 from file: D:\UltraVNC-src\UltraVNC Project Root\UltraVNC\winvnc\vnchooks\vnchooks.vcproj
+// -dConfiguration=Release|Win32
+//
+-D_WINDLL                       // ConfigurationType = "2"
+-D_MBCS                         // CharacterSet = "2"
+-DNDEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS
+                                // PreprocessorDefinitions = "NDEBUG;__WIN32__;WIN32;_WINDOWS;_USRDLL;VNCHOOKS_EXPORTS;_WIN32_WINNT=0x400;_CRT_SECURE_NO_WARNINGS"
+-D_NATIVE_WCHAR_T_DEFINED       // TreatWChar_tAsBuiltInType = "TRUE"
+-D_MT                           // RuntimeLibrary = "0"
+
+VNCHooks.cpp                    // RelativePath = "VNCHooks.cpp"
diff --git a/ica/win32/winvnc/winvnc.dsw b/ica/win32/winvnc/winvnc.dsw
new file mode 100644
index 0000000..2ae82c5
--- /dev/null
+++ b/ica/win32/winvnc/winvnc.dsw
@@ -0,0 +1,260 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "MSLogonACL"=".\ms-logon\MSLogonACL\MSLogonACL.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "Xregion"="..\Xregion\Xregion.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "authSSP"=".\ms-logon\authSSP\authSSP.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "authadmin"=".\ms-logon\authadmin\authadmin.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ldapauth"=".\ms-logon\ldapauth\ldapauth.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ldapauth9x"=".\ms-logon\ldapauth9x\ldapauth9x.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ldapauthnt4"=".\ms-logon\ldapauthNT4\ldapauthnt4.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "libjpeg"="..\libjpeg\libjpeg.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "logging"=".\ms-logon\logging\logging.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "logmessages"=".\logger\logmessages.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "omnithread"=".\omnithread\omnithread.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "rdr"="..\rdr\rdr.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "testauth"=".\ms-logon\testauth\testauth.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "vnchooks"=".\vnchooks\vnchooks.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "winvnc"=".\winvnc\winvnc.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+    Begin Project Dependency
+    Project_Dep_Name omnithread
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name zlib
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name pointstat
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name libjpeg
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name Xregion
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name authadmin
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name ldapauth
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name ldapauth9x
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name ldapauthnt4
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name logging
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name testauth
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name workgrpdomnt4
+    End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name rdr
+    End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "workgrpdomnt4"=".\ms-logon\workgrpdomnt4\workgrpdomnt4.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "zlib"="..\zlib\zlib.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/winvnc/winvnc.sln b/ica/win32/winvnc/winvnc.sln
new file mode 100644
index 0000000..b8245e0
--- /dev/null
+++ b/ica/win32/winvnc/winvnc.sln
@@ -0,0 +1,345 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "omnithread", "omnithread\omnithread.vcxproj", "{E52B9956-FE67-47F7-BC4F-67CC5A64B708}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdr", "..\rdr\rdr.vcxproj", "{F5244002-0FFF-4F19-A941-FCCE1861F132}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vnchooks", "vnchooks\vnchooks.vcxproj", "{1D18E045-6B72-43F4-ACBD-3E679A3DE349}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winvnc", "winvnc\winvnc.vcxproj", "{C05AE605-1250-4F58-911B-EC99AE2C25AF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avilog", "..\avilog\avilog\avilog.vcxproj", "{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unz32lib", "..\zipunzip_src\unzip\windll\vc6\lib\unz32lib.vcxproj", "{F9321962-FBED-4581-BF7D-D0EBC303D891}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zip32", "..\zipunzip_src\zip20\windll\visualc\lib\zip32.vcxproj", "{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg-turbo-win", "..\libjpeg-turbo-win\libjpeg-turbo-win.vcxproj", "{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "..\zlib-1.2.5\contrib\vstudio\vc10\zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		ASM Debug|Itanium = ASM Debug|Itanium
+		ASM Debug|Win32 = ASM Debug|Win32
+		ASM Debug|x64 = ASM Debug|x64
+		ASM Release|Itanium = ASM Release|Itanium
+		ASM Release|Win32 = ASM Release|Win32
+		ASM Release|x64 = ASM Release|x64
+		Debug|Itanium = Debug|Itanium
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Http|Itanium = Http|Itanium
+		Http|Win32 = Http|Win32
+		Http|x64 = Http|x64
+		IPP|Itanium = IPP|Itanium
+		IPP|Win32 = IPP|Win32
+		IPP|x64 = IPP|x64
+		Release|Itanium = Release|Itanium
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+		ReleaseWithoutAsm|Itanium = ReleaseWithoutAsm|Itanium
+		ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32
+		ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Debug|Itanium.ActiveCfg = Debug|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Debug|x64.Build.0 = Debug|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Release|Itanium.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Release|Win32.Build.0 = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Release|x64.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Release|x64.Build.0 = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Debug|Itanium.ActiveCfg = Debug|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Debug|Win32.Build.0 = Debug|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Debug|x64.ActiveCfg = Debug|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Debug|x64.Build.0 = Debug|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Http|Itanium.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Http|Win32.ActiveCfg = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Http|Win32.Build.0 = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Http|x64.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Http|x64.Build.0 = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.IPP|Itanium.ActiveCfg = IPP|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.IPP|Win32.ActiveCfg = IPP|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.IPP|Win32.Build.0 = IPP|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.IPP|x64.ActiveCfg = IPP|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.IPP|x64.Build.0 = IPP|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release|Itanium.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release|Win32.ActiveCfg = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release|Win32.Build.0 = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release|x64.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release|x64.Build.0 = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ReleaseWithoutAsm|x64.Build.0 = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Debug|Itanium.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Debug|x64.Build.0 = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Release|Itanium.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Release|Win32.Build.0 = Release|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Release|x64.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Release|x64.Build.0 = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Debug|Itanium.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Debug|Win32.Build.0 = Debug|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Debug|x64.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Debug|x64.Build.0 = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Http|Itanium.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Http|Win32.ActiveCfg = Debug|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Http|Win32.Build.0 = Debug|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Http|x64.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Http|x64.Build.0 = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.IPP|Itanium.ActiveCfg = IPP|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.IPP|Win32.ActiveCfg = IPP|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.IPP|Win32.Build.0 = IPP|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.IPP|x64.ActiveCfg = IPP|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.IPP|x64.Build.0 = IPP|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release|Itanium.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release|Win32.ActiveCfg = Release|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release|Win32.Build.0 = Release|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release|x64.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release|x64.Build.0 = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ReleaseWithoutAsm|x64.Build.0 = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Debug|Itanium.ActiveCfg = Debug|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Debug|x64.Build.0 = Debug|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Release|Itanium.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Release|Win32.Build.0 = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Release|x64.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Release|x64.Build.0 = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Debug|Itanium.ActiveCfg = Debug|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Debug|Win32.Build.0 = Debug|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Debug|x64.ActiveCfg = Debug|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Debug|x64.Build.0 = Debug|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Http|Itanium.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Http|Win32.ActiveCfg = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Http|Win32.Build.0 = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Http|x64.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Http|x64.Build.0 = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.IPP|Itanium.ActiveCfg = IPP|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.IPP|Win32.ActiveCfg = IPP|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.IPP|Win32.Build.0 = IPP|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.IPP|x64.ActiveCfg = IPP|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.IPP|x64.Build.0 = IPP|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release|Itanium.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release|Win32.ActiveCfg = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release|Win32.Build.0 = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release|x64.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release|x64.Build.0 = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ReleaseWithoutAsm|x64.Build.0 = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Debug|Itanium.ActiveCfg = Debug|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Debug|x64.Build.0 = Debug|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Release|Itanium.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Release|Win32.Build.0 = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Release|x64.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Release|x64.Build.0 = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Debug|Itanium.ActiveCfg = Debug|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Debug|Win32.Build.0 = Debug|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Debug|x64.ActiveCfg = Debug|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Debug|x64.Build.0 = Debug|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Http|Itanium.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Http|Win32.ActiveCfg = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Http|Win32.Build.0 = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Http|x64.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Http|x64.Build.0 = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.IPP|Itanium.ActiveCfg = IPP|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.IPP|Win32.ActiveCfg = IPP|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.IPP|Win32.Build.0 = IPP|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.IPP|x64.ActiveCfg = IPP|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.IPP|x64.Build.0 = IPP|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release|Itanium.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release|Win32.ActiveCfg = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release|Win32.Build.0 = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release|x64.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release|x64.Build.0 = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ReleaseWithoutAsm|x64.Build.0 = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Debug|Itanium.ActiveCfg = Debug|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Debug|x64.ActiveCfg = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Release|Itanium.ActiveCfg = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Release|Win32.Build.0 = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Release|x64.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Debug|Itanium.ActiveCfg = Debug|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Debug|Win32.Build.0 = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Debug|x64.ActiveCfg = Debug|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Http|Itanium.ActiveCfg = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Http|Win32.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Http|Win32.Build.0 = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Http|x64.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.IPP|Itanium.ActiveCfg = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.IPP|Win32.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.IPP|Win32.Build.0 = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.IPP|x64.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release|Itanium.ActiveCfg = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release|Win32.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release|Win32.Build.0 = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release|x64.ActiveCfg = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release|x64.Build.0 = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ReleaseWithoutAsm|x64.Build.0 = Release|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ASM Debug|Itanium.ActiveCfg = ASM Debug|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ASM Debug|Win32.ActiveCfg = ASM Debug|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ASM Debug|Win32.Build.0 = ASM Debug|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ASM Debug|x64.ActiveCfg = ASM Debug|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ASM Release|Itanium.ActiveCfg = ASM Release|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ASM Release|Win32.ActiveCfg = ASM Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ASM Release|Win32.Build.0 = ASM Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ASM Release|x64.ActiveCfg = ASM Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Debug|Itanium.ActiveCfg = Debug|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Debug|Win32.Build.0 = Debug|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Debug|x64.ActiveCfg = Debug|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Debug|x64.Build.0 = Debug|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Http|Itanium.ActiveCfg = Release|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Http|Win32.ActiveCfg = Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Http|Win32.Build.0 = Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Http|x64.ActiveCfg = Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.IPP|Itanium.ActiveCfg = Release|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.IPP|Win32.ActiveCfg = Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.IPP|Win32.Build.0 = Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.IPP|x64.ActiveCfg = Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Release|Itanium.ActiveCfg = Release|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Release|Win32.ActiveCfg = Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Release|Win32.Build.0 = Release|Win32
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Release|x64.ActiveCfg = Release|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.Release|x64.Build.0 = Release|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+		{F9321962-FBED-4581-BF7D-D0EBC303D891}.ReleaseWithoutAsm|x64.Build.0 = Release|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ASM Debug|Itanium.ActiveCfg = Debug|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ASM Debug|x64.ActiveCfg = Debug|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ASM Release|Itanium.ActiveCfg = Release|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ASM Release|Win32.Build.0 = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ASM Release|x64.ActiveCfg = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Debug|Itanium.ActiveCfg = Debug|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Debug|Win32.Build.0 = Debug|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Debug|x64.ActiveCfg = Debug|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Debug|x64.Build.0 = Debug|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Http|Itanium.ActiveCfg = Release|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Http|Win32.ActiveCfg = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Http|Win32.Build.0 = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Http|x64.ActiveCfg = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.IPP|Itanium.ActiveCfg = Release|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.IPP|Win32.ActiveCfg = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.IPP|Win32.Build.0 = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.IPP|x64.ActiveCfg = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Release|Itanium.ActiveCfg = Release|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Release|Win32.ActiveCfg = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Release|Win32.Build.0 = Release|Win32
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Release|x64.ActiveCfg = Release|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.Release|x64.Build.0 = Release|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+		{E8BA959F-B652-4BAB-9EA7-8E9FC8D7F39C}.ReleaseWithoutAsm|x64.Build.0 = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ASM Debug|Itanium.ActiveCfg = Debug|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ASM Debug|x64.Build.0 = Debug|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ASM Release|Itanium.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ASM Release|Win32.Build.0 = Release|Win32
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ASM Release|x64.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ASM Release|x64.Build.0 = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Debug|Itanium.ActiveCfg = Debug|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Debug|Win32.ActiveCfg = Debug|Win32
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Debug|Win32.Build.0 = Debug|Win32
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Debug|x64.ActiveCfg = Debug|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Debug|x64.Build.0 = Debug|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Http|Itanium.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Http|Win32.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Http|x64.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Http|x64.Build.0 = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.IPP|Itanium.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.IPP|Win32.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.IPP|x64.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.IPP|x64.Build.0 = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Release|Itanium.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Release|Win32.ActiveCfg = Release|Win32
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Release|x64.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.Release|x64.Build.0 = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ReleaseWithoutAsm|Itanium.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ReleaseWithoutAsm|x64.ActiveCfg = Release|x64
+		{04F91FA4-2D94-4803-BA3B-B61FBEF0ABE3}.ReleaseWithoutAsm|x64.Build.0 = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Debug|Itanium.ActiveCfg = Debug|Itanium
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Debug|Itanium.Build.0 = Debug|Itanium
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Debug|x64.Build.0 = Debug|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Release|Itanium.ActiveCfg = Release|Itanium
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Release|Itanium.Build.0 = Release|Itanium
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Release|Win32.Build.0 = Release|Win32
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Release|x64.ActiveCfg = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ASM Release|x64.Build.0 = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.ActiveCfg = Debug|Itanium
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Itanium.Build.0 = Debug|Itanium
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Http|Itanium.ActiveCfg = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Http|Win32.ActiveCfg = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Http|x64.ActiveCfg = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Http|x64.Build.0 = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.IPP|Itanium.ActiveCfg = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.IPP|Win32.ActiveCfg = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.IPP|x64.ActiveCfg = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.IPP|x64.Build.0 = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.ActiveCfg = Release|Itanium
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Itanium.Build.0 = Release|Itanium
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.ActiveCfg = ReleaseWithoutAsm|Itanium
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Itanium.Build.0 = ReleaseWithoutAsm|Itanium
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64
+		{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/ica/win32/winvnc/winvnc.sln.vloptions b/ica/win32/winvnc/winvnc.sln.vloptions
new file mode 100644
index 0000000..2f6c55e
--- /dev/null
+++ b/ica/win32/winvnc/winvnc.sln.vloptions
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<Solution><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Projects><Project Name="Xregion" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="libjpeg" Analyse="0"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="rdr" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="logmessages" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="MSLogonACL" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="authSSP" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="authadmin" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="ldapauth9x" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="ldapauthnt4" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="ldapauth" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="logging" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="testauth" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="workgrpdomnt4" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="omnithread" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="vnchooks" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="winvnc" Analyse="1"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project><Project Name="zlib" Analyse="0"><LintConfiguration><ConfigFile Source="Default"/><PolicyFile Source="Default"/><AdditionalParameters Source="Default"/></LintConfiguration><Files/></Project></Projects></Solution>
diff --git a/ica/win32/winvnc/winvnc/CpuUsage.cpp b/ica/win32/winvnc/winvnc/CpuUsage.cpp
new file mode 100644
index 0000000..dd2827f
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/CpuUsage.cpp
@@ -0,0 +1,215 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include <stdio.h>
+#include <tchar.h>
+#include <time.h>
+#include <windows.h>
+#include "CpuUsage.h"
+
+DWORD CProcessorUsage::s_TickMark = 0;
+__int64  CProcessorUsage::s_time = 0;
+__int64 CProcessorUsage::s_idleTime = 0;
+__int64 CProcessorUsage::s_kernelTime = 0;
+__int64 CProcessorUsage::s_userTime = 0;
+__int64 CProcessorUsage::s_kernelTimeProcess = 0;
+__int64 CProcessorUsage::s_userTimeProcess = 0;
+int CProcessorUsage::s_count = 0;
+int CProcessorUsage::s_index = 0;
+int CProcessorUsage::s_lastCpu = 0;
+int CProcessorUsage::s_cpu[5] = {0, 0, 0, 0, 0};
+int CProcessorUsage::s_cpuProcess[5] = {0, 0, 0, 0, 0};
+
+CProcessorUsage::CProcessorUsage()
+{
+   ::InitializeCriticalSection(&m_cs);
+	m_bLocked = false;
+   s_pfnNtQuerySystemInformation = NULL;
+   s_pfnGetSystemTimes = NULL;
+
+   m_pInfo = NULL;
+   m_uInfoLength = sizeof(PROC_PERF_INFO);
+
+   HMODULE hModule  = ::GetModuleHandle(_T("kernel32.dll"));
+   if(hModule)
+      s_pfnGetSystemTimes = (pfnGetSystemTimes)::GetProcAddress(hModule, "GetSystemTimes");
+
+   if(!s_pfnGetSystemTimes)
+   {
+      hModule = ::GetModuleHandle(_T("ntdll.dll"));
+      if(hModule)
+      {
+         s_pfnNtQuerySystemInformation = (pfnNtQuerySystemInformation)::GetProcAddress(hModule, "NtQuerySystemInformation");
+         if(s_pfnNtQuerySystemInformation)
+         {
+            PROC_PERF_INFO tmp;
+            s_pfnNtQuerySystemInformation(8, &tmp, m_uInfoLength, &m_uInfoLength);
+            m_pInfo = new PROC_PERF_INFO[m_uInfoLength / sizeof(PROC_PERF_INFO)];
+         }
+      }
+   }
+   s_TickMark = ::GetTickCount();
+}
+
+CProcessorUsage::~CProcessorUsage()
+{
+   if(m_pInfo)
+      delete m_pInfo;
+     //Critical Section Over-Released or Corrupted
+	//::LeaveCriticalSection( &m_cs );
+	if (m_bLocked) m_bLocked = false;
+    ::DeleteCriticalSection(&m_cs);
+}
+
+void CProcessorUsage::GetSysTimes(__int64 & idleTime, __int64 & kernelTime, __int64 & userTime)
+{
+   if(s_pfnGetSystemTimes)
+      s_pfnGetSystemTimes((LPFILETIME)&idleTime, (LPFILETIME)&kernelTime, (LPFILETIME)&userTime);
+   else
+   {
+      idleTime = 0;
+      kernelTime = 0;
+      userTime = 0;
+      if(s_pfnNtQuerySystemInformation && m_uInfoLength && !s_pfnNtQuerySystemInformation(0x08, m_pInfo, m_uInfoLength, &m_uInfoLength))
+      {
+         // NtQuerySystemInformation returns information for all
+         // CPU cores in the system, so we take the average here:
+         int nCores = m_uInfoLength / sizeof(PROC_PERF_INFO);
+         for(int i = 0;i < nCores;i ++)
+         {
+            idleTime += m_pInfo[i].IdleTime.QuadPart;
+            kernelTime += m_pInfo[i].KernelTime.QuadPart;
+            userTime += m_pInfo[i].UserTime.QuadPart;
+         }
+         idleTime /= nCores;
+         kernelTime /= nCores;
+         userTime /= nCores;
+      }
+   }
+}
+
+short CProcessorUsage::GetUsage()
+{
+    __int64 sTime;
+    int sLastCpu;
+
+   if (m_bLocked) return s_lastCpu;
+   ::EnterCriticalSection( &m_cs );
+   m_bLocked = true;
+   sTime = s_time;
+   sLastCpu = s_lastCpu;
+
+    if(((::GetTickCount() - s_TickMark) & 0x7FFFFFFF) <= 200)
+	{
+	  if (m_bLocked) ::LeaveCriticalSection( &m_cs );
+	  m_bLocked = false;
+      return sLastCpu;
+	}
+
+   __int64 time;
+   __int64 idleTime;
+   __int64 kernelTime;
+   __int64 userTime;
+   __int64 kernelTimeProcess;
+   __int64 userTimeProcess;
+
+   ::GetSystemTimeAsFileTime((LPFILETIME)&time);
+
+    if(!sTime)
+    {
+      GetSysTimes(idleTime, kernelTime, userTime);
+      FILETIME createTime;
+      FILETIME exitTime;
+      ::GetProcessTimes(::GetCurrentProcess(), &createTime, &exitTime, (LPFILETIME)&kernelTimeProcess, (LPFILETIME)&userTimeProcess);
+
+      s_time = time;
+      s_idleTime = idleTime;
+      s_kernelTime = kernelTime;
+      s_userTime = userTime;
+      s_kernelTimeProcess = kernelTimeProcess;
+      s_userTimeProcess = userTimeProcess;
+      s_lastCpu = 0;
+      s_TickMark = ::GetTickCount();
+	  if (m_bLocked) ::LeaveCriticalSection( &m_cs );
+	  m_bLocked = false;
+      return 0;
+   }
+
+    __int64 div = (time - sTime);
+
+   GetSysTimes(idleTime, kernelTime, userTime);
+
+   FILETIME createTime;
+   FILETIME exitTime;
+   ::GetProcessTimes(::GetCurrentProcess(), &createTime, &exitTime, (LPFILETIME)&kernelTimeProcess, (LPFILETIME)&userTimeProcess);
+
+    int cpu;
+    int cpuProcess;
+
+     __int64 usr = userTime   - s_userTime;
+     __int64 ker = kernelTime - s_kernelTime;
+     __int64 idl = idleTime   - s_idleTime;
+     __int64 sys = (usr + ker);
+
+   if(sys)
+      cpu = int((sys - idl) * 100 / sys); // System Idle take 100 % of cpu;
+   else
+      cpu = 0;
+
+   cpuProcess = int((((userTimeProcess - s_userTimeProcess) + (kernelTimeProcess - s_kernelTimeProcess)) * 100 ) / div);
+
+   s_time = time;
+   s_idleTime = idleTime;
+   s_kernelTime = kernelTime;
+   s_userTime = userTime;
+   s_kernelTimeProcess = kernelTimeProcess;
+   s_userTimeProcess = userTimeProcess;
+   s_cpu[s_index] = cpu;
+	s_cpuProcess[s_index] = cpuProcess;
+	s_index++;
+	s_index%=5;
+
+   s_count ++;
+
+   if(s_count > 5)
+      s_count = 5;
+
+   cpu = 0;
+   int i;
+   for(i = 0; i < s_count; i++ )
+      cpu += s_cpu[i];
+
+   cpuProcess = 0;
+   for(i = 0; i < s_count; i++ )
+      cpuProcess += s_cpuProcess[i];
+
+   cpu /= s_count;
+   cpuProcess /= s_count;
+   s_lastCpu = cpuProcess;
+   sLastCpu = s_lastCpu;
+   s_TickMark = ::GetTickCount();
+   if (m_bLocked) ::LeaveCriticalSection( &m_cs );
+   m_bLocked = false;
+   return sLastCpu;
+}
diff --git a/ica/win32/winvnc/winvnc/CpuUsage.h b/ica/win32/winvnc/winvnc/CpuUsage.h
new file mode 100644
index 0000000..69ce457
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/CpuUsage.h
@@ -0,0 +1,89 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+
+////////////////////////////////////////
+// class CProcessorUsage;
+//
+// Calculates overal processor usage at
+// any given time.
+//
+// The usage value is updated every 200
+// milliseconds;
+//
+// The class is fully thread-safe;
+//
+class CProcessorUsage
+{
+   typedef BOOL (WINAPI * pfnGetSystemTimes)(LPFILETIME lpIdleTime, LPFILETIME lpKernelTime, LPFILETIME lpUserTime );
+   typedef LONG (WINAPI * pfnNtQuerySystemInformation)(ULONG SystemInformationClass, PVOID SystemInformation, ULONG SystemInformationLength, PULONG ReturnLength);
+
+   struct PROC_PERF_INFO
+   {
+      LARGE_INTEGER IdleTime;
+      LARGE_INTEGER KernelTime;
+      LARGE_INTEGER UserTime;
+      LARGE_INTEGER Reserved1[2];
+      ULONG Reserved2;
+   };
+
+public:
+
+    CProcessorUsage();
+    ~CProcessorUsage();
+
+    short GetUsage();
+	bool m_bLocked;
+
+private:
+
+   void GetSysTimes(__int64 & idleTime, __int64 & kernelTime, __int64 & userTime);
+
+   ////////////////////////////////////////////////
+   // Set of static variables to be accessed from
+   // within critical section by multiple threads:
+   //
+   static DWORD s_TickMark;
+   static __int64 s_time;
+   static __int64 s_idleTime;
+   static __int64 s_kernelTime;
+   static __int64 s_userTime;
+   static int s_lastCpu;
+   static int s_cpu[5];
+   static __int64 s_kernelTimeProcess;
+   static __int64 s_userTimeProcess;
+   static int s_cpuProcess[5];
+    static int s_count;
+    static int s_index;
+   //
+   /////////////////////////////////////////////////
+
+   pfnGetSystemTimes s_pfnGetSystemTimes;
+   pfnNtQuerySystemInformation s_pfnNtQuerySystemInformation;
+   CRITICAL_SECTION m_cs;
+   PROC_PERF_INFO * m_pInfo;
+   ULONG m_uInfoLength;
+};
diff --git a/ica/win32/winvnc/winvnc/Dtwinver.cpp b/ica/win32/winvnc/winvnc/Dtwinver.cpp
new file mode 100644
index 0000000..6db2ce8
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/Dtwinver.cpp
@@ -0,0 +1,2074 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+/*
+Module : Dtwinver.cpp
+Purpose: Implementation of a comprehensive function to perform OS version detection
+Created: PJN / 11-05-1996
+History: PJN / 24-02-1997 A number of updates including support for NT 3.1, 
+                          single mode dos in Windows 95 and better Windows
+                          version detecion under real mode dos.
+         PJN / 13-09-1998 1.  Added explicit support for Windows 98 
+                          2.  Updated documentation to use HTML. 
+                          3.  Minor update to the web page describing it. 
+         PJN / 22-06-1999 1.  UNICODE enabled the code.
+                          2.  Removed need for the dwOSVersionInfoSize variable
+                          3.  Added support for detecting Build Number of 95 and 98 from DOS code path.
+                          4.  Now ships as standard with VC 5 workspace files
+                          5.  Added explicit support for Windows 95 SP 1
+                          6.  Added explicit support for Windows 95 OSR 2
+                          7.  Added explicit support for Windows 98 Second Edition
+                          8.  Added explicit support for Windows 2000
+                          9.  Added explicit support for Windows CE
+                          10. Added explicit support for Windows Terminal Server's
+                          11. Added explicit support for NT Stand Alone Server's.
+                          12. Added explicit support for NT Primary Domain Controller's
+                          13. Added explicit support for NT Backup Domain Controller's
+         PJN / 23-07-1999 Tested out support for Windows 98 SE, minor changes required
+         PJN / 26-07-1999 Added explicit support for Windows 98 SP 1
+         PJN / 28-07-1999 1. Fixed a problem when application is build in non-huge/large 
+                          memory model in Win16
+                          2. Added explicit support for returning NT and Win9x service pack information 
+                          from Win32 and Win16 code paths
+                          3. Updated test program to not bother reporting on any info which does not 
+                          exist. e.g. if there is no service pack installed, then we don't bother 
+                          displaying any info about service packs
+                          4. Added explicit support for NT Enterprise Edition
+         PJN / 30-06-2000 1. Added explicit support for Windows Millennium Edition
+         PJN / 29-01-2001 1. Added explicit support for Windows XP (Whistler) Personal
+                          2. Added explicit support for Windows XP (Whistler) Professional
+                          3. Added explicit support for Windows XP (Whistler) Server
+                          4. Added explicit support for Windows XP (Whistler) Advanced Server
+                          5. Added explicit support for Windows XP (Whistler) Datacenter
+                          6. Added explicit support for Windows XP (Whistler) 64 bit (all flavours)
+                          7. Made all the code into a C++ class called COSVersion
+                          8. Rewrote all the generic thunk code to be easier to follow
+                          9. Generic think code now uses CallProcEx32W
+                          10. Added explicit support for BackOffice Small Business Edition
+                          11. Added explicit support for Terminal Services
+                          12. 16 bit code path now can determine ProductSuite and ProductType type
+                          thro additional generic thunk code
+                          13. Provided a 64 bit test binary and make batch file (make64.bat) for 
+                          those lucky enough to have an Itanium processor and a beta of 64 bit Windows XP (Whistler).
+                          14. Provided a Embedded C++ workspace and X86 Release binary.
+                          15. Updated copyright information           
+         PJN / 10-02-2001 1. Updated function names etc following MS decision to call Whistler "Windows XP"
+         PJN / 10-10-2001 1. Added code to 32 bit code path to detect if we are being run under 64 bit Windows. Also
+                          updated the sample app to distinguish between emulated 64 bit and underlying 
+                          64 bit.
+                          2. Updated the sample app to call XP Server its proper name which will be "Windows.NET Server"
+         PJN / 13-12-2001 1. Major upgrade. Now 16 bit DOS path can return as much information as native Win32 code. 
+                          This is achieved by spawning off the Win32 utility WriteVer with a special command line option.
+                          Please note that if you intend deploying dtwinver then you must now ship the writever.exe file
+                          in addition to linking in the dtwinver code into your application. Also this utilty needs
+                          to be in the path or current directory when the dtwinver code is executing. Thanks to Chaz Angell
+                          for prompted me into finding a solution for this last major item missing in dtwinver.
+         PJN / 30-12-2002 1. Provided an update CE workspace to work correctly in eMbedded Visual C++ v3. All build configurations
+                          for eVC 3 have also been provided.
+                          2. Optimized the usage of _tcscat and _tcscpy in the test app which comes with Dtwinver.cpp
+                          3. OEM Info string and Platform Type string is now returned for CE code path
+                          4. Fixed display of minor version number for example Windows .NET is version number v5.20 but
+                          should be shown as 5.2 to be consistent with what the native ver command displays
+                          5. Provided a new CE workspace to work correctly in eMbedded Visual C++ v4. All build configurations
+                          for eVC 4 have also been provided.
+         PJN / 08-10-2002 1. Now uses OSVERSIONINFOEX it possible in the Win32 or Win64 code paths. This provides for
+                          more reliably detection of Windows XP Home Edition.
+                          2. Renamed the functions which detect Windows .NET Server 2003. Also updated the test code which
+                          prints out these names
+                          3. Provided explicit support for Windows .NET Web Server
+                          4. Fixed a bug in the display of the minor OS version number on Windows .NET Server.
+                          5. Made the project for WriteVer a VC 5 project instead of VC 6 which it was up until now.
+                          6. Reworked the internal function WhichNTProduct to use a constant input string parameter
+                          7. Added explicit support for Windows NT / 2000 / XP Embedded
+                          8. Added explicit support for detecting Terminal Services in remote admin mode
+         PJN / 10-10-2002 1.  Fixed a problem where on Windows XP, the test program will include the text "(Standard Edition)"
+                          2.  Added two variables to the OS_VERSION_INFO structure to report the minor service pack number
+                          3.  Removed the OS_VERSION_INFO structure from the global namespace
+                          4.  Removed all static member variables from the class
+                          5.  Added a member variable to the OS_VERSION_INFO to return the various "suites" installed
+                          6.  reduced the number of calls to WriteVer to 1 when called from dos code path.
+                          7.  Completely reworked the internal WhichNTProduct method
+                          8.  General tidy up of the header file
+                          9.  Completely reworked the ValidateProductSuite method
+                          10. Now only 1 call is made to WhichNTProduct throughout a single call to COSVersion::GetVersion
+                          11. Now only 1 call is made to ValidateProductSuite throughout a single call to COSVersion::GetVersion
+                          12. Fixed an unitialized variable problem in COSVersion::IsUnderlying64Bit
+                          13. Changed "WhichNTProduct" method to "GetNTOSTypeFromRegistry"
+                          14. Changed "ValidateProductSuite" method to "GetProductSuiteDetailsFromRegistry".
+                          15. Now correctly reports on Terminal Services being in Remote Admin Mode on OS which do not
+                          support calling GetVersionEx using an OSVERSIONINFOEX structure i.e any NT 4 install prior to SP6.
+                          16. 16 bit Windows code path now reports as much NT information as the Win32 code path 
+                          17. Fixed a bug in COSVersion::GetInfoBySpawingWriteVer which was failing if it encountered 
+                          an empty CSD string. This was spotted on Windows .NET Server which since it is in beta still
+                          (as of October 2002) does not have any service pack!.
+         PJN / 10-01-2003 1. Update to support MS deciding to change the name of their Whistler Server product. The product 
+                          will now be called "Windows Server 2003".
+         PJN / 30-01-2003 1. Added explicit support for detecting NT Service Pack 6a
+         PJN / 08-02-2003 1. Added explicit support for detecting Windows XP Service Pack 1a
+                          2. Added support to determine the HAL on NT Kernels.
+         PJN / 12-02-2003 1. Fixed a compiler warning in GetNTServicePackFromRegistry which occurs when the code is compiled
+                          with the Watcom compiler. Thanks to Christian Kaiser for reporting this.
+         PJN / 08-03-2003 1. Updated a comment in COSVersion::GetProductSuiteDetailsFromRegistry re NT Embedded.
+                          2. A comment from John A. Vorchak: On NTe (NT Embedded) and XPE (XP Embedded), all of the versions 
+                          (of DTWinver) work just fine so long as the components to support them are included in the images, 
+                          which itself is kind of a crap shoot.  I think that you would probably find that most images will 
+                          not support the DOS or Win16 versions however most will support the Win32.  Many of the images that 
+                          folks build either do not include the DOS subsystem and some of them do not include Explorer, so it 
+                          really can't be said that all builds will support them however it is not difficult for a developer 
+                          to understand which version would work for them as they understand their target systems better than 
+                          anyone and at least one version would certainly work for almost all images. 
+                          As far as Win2k (Server Appliance Kit), I haven't done enough testing with that platform, nor do I 
+                          currently have any built images with the SAK to say positively or otherwise. More than likely you 
+                          would find no problems with the SAK images since they typically follow W2k much more than NTe or 
+                          XPE do.
+                          Author: If you are writing for an embedded OS, then there is little use for DTWinver!!, since the
+                          developer has very tight control over the runtime environment. Also if you do use DTWinver on an 
+                          embedded version of Windows, you will probably compile in the dtwinver code rather than ship the 
+                          sample binaries I include in the dtwinver download.
+         PJN / 09-04-2004 1. Removed a number of unreferrenced variable warnings when you compile the code on on VS.NET 2003.
+                          Thanks to Edward Livingston for reporting these issues.
+                          2. Now includes support for Windows XP Media Center Edition. Please note that if you want to do
+                          specific version checking of what version of Media Center you have installed then you should use
+                          my CVersionInfo classes at http://www.naughter.com/versioninfo.html in conjunction with the following 
+                          information which I culled from http://www.mvps.org/marksxp/MediaCenter/2004/version.php which
+                          describes the various version numbers of ehshell.exe in \Windows\ehome to the corresponding versions
+                          of XP Media Center Edition.
+                         
+                          Windows XP Media Center Edition: 2002    5.1.2600.1106 First released version of Windows Media Center  
+                                                                   5.1.2600.1142 Highest released build of Media Center 2002 
+                                                                                 (provided via Q815487) 
+                          Windows XP Media Center Edition: 2004    5.1.2600.1217 Release build of Windows Media Center 2004 
+                                                                                 (upgrade over previous MCE 2002 build).  
+                                                                   5.1.2600.1321 December 2003 Hotfix for Media Center 2004 version 
+                                                                                 (provided via Q830786) 
+                                                                   5.1.2600.2096 Media Center Version included with Windows XP 
+                                                                                 Service Pack 2 Release Candidate 1. This version can 
+                                                                                 be installed over a current MCE 2002 or 2004 using 
+                                                                                 the Windows XP Service Pack 2 installer. If you have 
+                                                                                 any build between 1322 and 2095 assume this to be 
+                                                                                 a beta version.  
+                          3. dtwinver now returns the processor architecture via a call to GetSystemInfo or GetNativeSystemInfo. 
+                          This is used to differentiate between 64 Bit Windows on Itanium and AMD64 processors.
+                          4. Renamed the global preprocesor defines used by dtwinver to use more unique names
+                          5. Added make files and binaries for AMD64 processors
+
+Copyright (c) 1997 - 2004 by PJ Naughter.  (Web: www.naughter.com, Email: pjna at naughter.com)
+
+All rights reserved.
+
+Copyright / Usage Details:
+
+You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise) 
+when your product is released in binary form. You are allowed to modify the source code in any way you want 
+except you cannot modify the copyright details at the top of each module. If you want to distribute source 
+code with your application, then you are only allowed to distribute versions released by the author. This is 
+to maintain a single distribution point for the source code. 
+*/
+
+
+/////////////////////////////////  Includes  //////////////////////////////////
+#include <windows.h> 
+#include <ctype.h>
+#if defined(_WIN32) || defined(_WIN64)
+#include <tchar.h>
+#else
+#include <stdlib.h>
+#include <shellapi.h>
+#endif
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include "Dtwinver.h"
+
+
+/////////////////////////////////  Local function / variables /////////////////
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_NT_WORKSTATION
+#define VER_NT_WORKSTATION              0x0000001
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_NT_DOMAIN_CONTROLLER
+#define VER_NT_DOMAIN_CONTROLLER        0x0000002
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_NT_SERVER
+#define VER_NT_SERVER                   0x0000003
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef PROCESSOR_ARCHITECTURE_SHX
+#define PROCESSOR_ARCHITECTURE_SHX    4
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef PROCESSOR_ARCHITECTURE_ARM
+#define PROCESSOR_ARCHITECTURE_ARM    5
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef PROCESSOR_ARCHITECTURE_IA64
+#define PROCESSOR_ARCHITECTURE_IA64    6
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef PROCESSOR_ARCHITECTURE_ALPHA64
+#define PROCESSOR_ARCHITECTURE_ALPHA64    7
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef PROCESSOR_ARCHITECTURE_MSIL
+#define PROCESSOR_ARCHITECTURE_MSIL    8
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef PROCESSOR_ARCHITECTURE_AMD64
+#define PROCESSOR_ARCHITECTURE_AMD64    9
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64
+#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64    10
+#endif
+
+
+
+//OS_VERSION_INFO::wSuiteMask can any of the following bit masks
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_SUITE_SMALLBUSINESS
+#define VER_SUITE_SMALLBUSINESS             0x00000001
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_SUITE_ENTERPRISE
+#define VER_SUITE_ENTERPRISE                0x00000002
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_SUITE_TERMINAL
+#define VER_SUITE_TERMINAL                  0x00000010
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_SUITE_DATACENTER
+#define VER_SUITE_DATACENTER                0x00000080
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_SUITE_PERSONAL
+#define VER_SUITE_PERSONAL                  0x00000200
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_SUITE_BLADE
+#define VER_SUITE_BLADE                     0x00000400
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_SUITE_EMBEDDEDNT
+#define VER_SUITE_EMBEDDEDNT                0x00000040
+#endif
+
+//Taken from Platform SDK's WinNT.h file
+#ifndef VER_SUITE_SINGLEUSERTS
+#define VER_SUITE_SINGLEUSERTS              0x00000100
+#endif
+
+
+#if defined(_WIN32)
+
+//Taken from Windows CE winbase.h file
+#ifndef VER_PLATFORM_WIN32_CE
+  #define VER_PLATFORM_WIN32_CE         3
+#endif
+
+#endif //defined(_WIN32) 
+
+#ifdef _DOS
+  WORD WinVer;
+  BYTE bRunningWindows;
+#endif //ifdef _DOS
+
+
+////////////////////////////////// Implementation /////////////////////////////
+COSVersion::COSVersion()
+{
+#if defined(_WINDOWS) && !defined(_WIN32) && !defined(_WIN64)
+  //Initialize the values to sane defaults
+  m_lpfnLoadLibraryEx32W = NULL;
+  m_lpfnFreeLibrary32W = NULL;
+  m_lpfnGetProcAddress32W = NULL;
+  m_lpfnCallProcEx32W = NULL;
+  m_hAdvApi32 = 0;    
+  m_hKernel32 = 0;
+  m_lpfnRegQueryValueExA= 0;
+  m_lpfnGetVersionExA = 0;
+  m_lpfnGetVersion = 0;
+  m_lpfnGetSystemInfo = 0;
+  m_lpfnGetNativeSystemInfo = 0;
+
+  //Get Kernel dll handle
+  HMODULE hKernel = GetModuleHandle("KERNEL");
+  if (hKernel)
+  {
+    //Dynamically link to the functions we want
+    m_lpfnLoadLibraryEx32W  = (lpfnLoadLibraryEx32W)  GetProcAddress(hKernel, "LoadLibraryEx32W");
+    m_lpfnFreeLibrary32W    = (lpfnFreeLibrary32W)    GetProcAddress(hKernel, "FreeLibrary32W");
+    m_lpfnGetProcAddress32W = (lpfnGetProcAddress32W) GetProcAddress(hKernel, "GetProcAddress32W");
+    m_lpfnCallProcEx32W     = (lpfnCallProcEx32W)     GetProcAddress(hKernel, "_CallProcEx32W");
+    if (m_lpfnLoadLibraryEx32W && m_lpfnFreeLibrary32W)
+    {
+      m_hAdvApi32 = m_lpfnLoadLibraryEx32W("ADVAPI32.DLL", NULL, 0);
+      if (m_hAdvApi32)                                                   
+        m_lpfnRegQueryValueExA = m_lpfnGetProcAddress32W(m_hAdvApi32, "RegQueryValueExA"); 
+      m_hKernel32 = m_lpfnLoadLibraryEx32W("KERNEL32.DLL", NULL, 0);
+      if (m_hKernel32)
+      {                                                               
+        m_lpfnGetVersionExA = m_lpfnGetProcAddress32W(m_hKernel32, "GetVersionExA");
+        m_lpfnGetVersion = m_lpfnGetProcAddress32W(m_hKernel32, "GetVersion");
+        m_lpfnGetSystemInfo = m_lpfnGetProcAddress32W(m_hKernel32, "GetSystemInfo");
+        m_lpfnGetNativeSystemInfo = m_lpfnGetProcAddress32W(m_hKernel32, "GetNativeSystemInfo");
+      }
+    }
+  }
+#endif
+}
+
+COSVersion::~COSVersion()
+{
+#if defined(_WINDOWS) && !defined(_WIN32) && !defined(_WIN64)
+  if (m_lpfnFreeLibrary32W)
+  {           
+    if (m_hAdvApi32)
+      m_lpfnFreeLibrary32W(m_hAdvApi32);
+    if (m_hKernel32)
+      m_lpfnFreeLibrary32W(m_hKernel32);
+  }
+#endif
+}
+
+#if defined(_WINDOWS) && (!defined(_WIN32) && !defined(_WIN64))
+BOOL COSVersion::WFWLoaded()
+{
+  const WORD WNNC_NET_MultiNet         = 0x8000;
+  const WORD WNNC_SUBNET_WinWorkgroups = 0x0004;
+  const WORD WNNC_NET_TYPE             = 0x0002;
+  BOOL rVal;
+   
+  HINSTANCE hUserInst = LoadLibrary("USER.EXE");
+  lpfnWNetGetCaps lpWNetGetCaps = (lpfnWNetGetCaps) GetProcAddress(hUserInst, "WNetGetCaps");
+  if (lpWNetGetCaps != NULL)
+  {
+    // Get the network type
+    WORD wNetType = lpWNetGetCaps(WNNC_NET_TYPE);
+    if (wNetType & WNNC_NET_MultiNet)
+    {
+      // a multinet driver is installed
+      if (LOBYTE(wNetType) & WNNC_SUBNET_WinWorkgroups) // It is WFW
+        rVal = TRUE;
+      else // It is not WFW
+        rVal = FALSE;
+    }
+    else
+     rVal = FALSE;
+  }
+  else
+    rVal = FALSE;
+   
+  //Clean up the module instance
+  if (hUserInst)
+    FreeLibrary(hUserInst);
+    
+  return rVal;  
+}
+
+LONG COSVersion::RegQueryValueEx(HKEY32 hKey, LPSTR  lpszValueName, LPDWORD lpdwReserved, LPDWORD lpdwType, LPBYTE  lpbData, LPDWORD lpcbData)
+{                                             
+  //Assume the worst
+  DWORD dwResult = ERROR_CALL_NOT_IMPLEMENTED;
+
+  if (m_lpfnRegQueryValueExA)
+    dwResult = m_lpfnCallProcEx32W(CPEX_DEST_STDCALL | 6, 0x3e, m_lpfnRegQueryValueExA, hKey, lpszValueName, lpdwReserved, lpdwType, lpbData, lpcbData);
+
+  return dwResult;
+}                 
+
+BOOL COSVersion::GetVersionEx(LPOSVERSIONINFO lpVersionInfo)
+{
+  //Assume the worst
+  BOOL bSuccess = FALSE;
+
+  if (m_lpfnGetVersionExA)
+    bSuccess = (BOOL) m_lpfnCallProcEx32W(CPEX_DEST_STDCALL | 1, 1, m_lpfnGetVersionExA, lpVersionInfo, 0);
+
+  return bSuccess;
+}
+
+void COSVersion::GetProcessorType(LPOS_VERSION_INFO lpVersionInformation)
+{
+  //Get the processor details
+  SYSTEM_INFO EmulatedSI;
+  EmulatedSI.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_UNKNOWN;
+  SYSTEM_INFO UnderlyingSI;
+  UnderlyingSI.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_UNKNOWN;
+
+  if (m_lpfnGetNativeSystemInfo)
+  {
+    m_lpfnCallProcEx32W(CPEX_DEST_STDCALL | 1, 1, m_lpfnGetNativeSystemInfo, &UnderlyingSI, 0);
+  
+    if (m_lpfnGetSystemInfo)
+      m_lpfnCallProcEx32W(CPEX_DEST_STDCALL | 1, 1, m_lpfnGetSystemInfo, &EmulatedSI, 0);
+  }
+  else
+  {
+    if (m_lpfnGetSystemInfo)
+      m_lpfnCallProcEx32W(CPEX_DEST_STDCALL | 1, 1, m_lpfnGetSystemInfo, &EmulatedSI, 0);
+
+    memcpy(&EmulatedSI, &UnderlyingSI, sizeof(SYSTEM_INFO));
+  }
+
+  //Map from the SYTEM_INFO wProcessorArchitecture defines to our equivalents
+  switch (UnderlyingSI.wProcessorArchitecture)
+  {
+    case PROCESSOR_ARCHITECTURE_INTEL: //deliberate fallthrough
+    case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
+    {
+      lpVersionInformation->UnderlyingProcessorType = INTEL_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_MSIL:
+    {
+      lpVersionInformation->UnderlyingProcessorType = MSIL_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_MIPS:
+    {
+      lpVersionInformation->UnderlyingProcessorType = MIPS_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_ARM:
+    {
+      lpVersionInformation->UnderlyingProcessorType = ARM_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_SHX:
+    {
+      lpVersionInformation->UnderlyingProcessorType = SHX_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_ALPHA:
+    {
+      lpVersionInformation->UnderlyingProcessorType = ALPHA_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_ALPHA64:
+    {
+      lpVersionInformation->UnderlyingProcessorType = ALPHA64_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_PPC:
+    {
+      lpVersionInformation->UnderlyingProcessorType = PPC_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_IA64:
+    {
+      lpVersionInformation->UnderlyingProcessorType = IA64_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_AMD64:
+    {
+      lpVersionInformation->UnderlyingProcessorType = AMD64_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_UNKNOWN: //Deliberate fallthrough
+    default:
+    {
+      lpVersionInformation->UnderlyingProcessorType = UNKNOWN_PROCESSOR;
+      break;
+    }
+  }
+  switch (EmulatedSI.wProcessorArchitecture)
+  {
+    case PROCESSOR_ARCHITECTURE_INTEL: //deliberate fallthrough
+    case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
+    {
+      lpVersionInformation->EmulatedProcessorType = INTEL_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_MSIL:
+    {
+      lpVersionInformation->EmulatedProcessorType = MSIL_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_MIPS:
+    {
+      lpVersionInformation->EmulatedProcessorType = MIPS_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_ARM:
+    {
+      lpVersionInformation->EmulatedProcessorType = ARM_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_SHX:
+    {
+      lpVersionInformation->EmulatedProcessorType = SHX_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_ALPHA:
+    {
+      lpVersionInformation->EmulatedProcessorType = ALPHA_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_ALPHA64:
+    {
+      lpVersionInformation->EmulatedProcessorType = ALPHA64_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_PPC:
+    {
+      lpVersionInformation->EmulatedProcessorType = PPC_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_IA64:
+    {
+      lpVersionInformation->EmulatedProcessorType = IA64_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_AMD64:
+    {
+      lpVersionInformation->EmulatedProcessorType = AMD64_PROCESSOR;
+      break;
+    }
+    case PROCESSOR_ARCHITECTURE_UNKNOWN: //Deliberate fallthrough
+    default:
+    {
+      lpVersionInformation->EmulatedProcessorType = UNKNOWN_PROCESSOR;
+      break;
+    }
+  }
+}
+
+DWORD COSVersion::GetVersion()
+{
+  //Assume the worst
+  DWORD dwVersion = 0;
+
+  if (m_lpfnGetVersion)
+    dwVersion = (BOOL) m_lpfnCallProcEx32W(CPEX_DEST_STDCALL | 0, 0, m_lpfnGetVersion, 0);
+
+  return dwVersion;
+}
+#endif //defined(_WINDOWS) && !defined(_WIN32)
+
+BOOL COSVersion::GetVersion(LPOS_VERSION_INFO lpVersionInformation)
+{
+  //Zero out everything in the structure
+  memset(lpVersionInformation, 0, sizeof(lpVersionInformation));
+                
+  #ifdef UNDER_CE
+    OSVERSIONINFO osvi;
+    memset(&osvi, 0, sizeof(OSVERSIONINFO));
+    osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+    if (!GetVersionEx(&osvi))
+      return FALSE;
+
+    //Basic OS info
+    lpVersionInformation->dwUnderlyingMajorVersion = osvi.dwMajorVersion; 
+    lpVersionInformation->dwUnderlyingMinorVersion = osvi.dwMinorVersion; 
+    lpVersionInformation->dwUnderlyingBuildNumber = LOWORD(osvi.dwBuildNumber); //ignore HIWORD
+    lpVersionInformation->UnderlyingPlatform = WindowsCE;
+    _tcscpy(lpVersionInformation->szUnderlyingCSDVersion, osvi.szCSDVersion);
+
+    //OEM Info
+    _tcscpy(lpVersionInformation->szOEMInfo, _T(""));
+    SystemParametersInfo(SPI_GETOEMINFO, 256, lpVersionInformation->szOEMInfo, 0);
+
+    //Platform Type
+    _tcscpy(lpVersionInformation->szPlatformType, _T(""));
+    SystemParametersInfo(SPI_GETPLATFORMTYPE, 256, lpVersionInformation->szPlatformType, 0);
+
+    //Always set the OSType to Workstation on CE. The variable itself does not make 
+    //much sense on CE, but we do not conditionally compile it out on CE as then we
+    //would have to put in loadsa ifdefs UNDER_CE in the COSVersion::Is... methods
+    lpVersionInformation->OSType = Workstation;
+
+  #elif defined(_WIN32) || defined(_WIN64)
+    //determine dynamically if GetVersionEx is available, if 
+    //not then drop back to using GetVersion
+
+    // Get Kernel handle
+    HMODULE hKernel32 = GetModuleHandle(_T("KERNEL32.DLL"));
+    if (hKernel32 == NULL)
+      return FALSE;
+
+    #ifdef _UNICODE
+      lpfnGetVersionEx lpGetVersionEx = (lpfnGetVersionEx) GetProcAddress(hKernel32, "GetVersionExW");
+    #else
+      lpfnGetVersionEx lpGetVersionEx = (lpfnGetVersionEx) GetProcAddress(hKernel32, "GetVersionExA");
+    #endif
+
+    if (lpGetVersionEx)
+    {
+      OSVERSIONINFOEX osviex;
+      memset(&osviex, 0, sizeof(OSVERSIONINFOEX));
+      osviex.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+
+      OSVERSIONINFO osvi;
+      memset(&osvi, 0, sizeof(OSVERSIONINFO));
+      osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+      BOOL bGotOSviEx = lpGetVersionEx((LPOSVERSIONINFO) &osviex);
+      if (!bGotOSviEx)
+      {
+        if (!lpGetVersionEx(&osvi))
+          return FALSE;
+      }
+
+      if (bGotOSviEx)
+      {
+        lpVersionInformation->dwEmulatedMajorVersion = osviex.dwMajorVersion;
+        lpVersionInformation->dwEmulatedMinorVersion = osviex.dwMinorVersion;
+        lpVersionInformation->dwEmulatedBuildNumber = LOWORD(osviex.dwBuildNumber);
+        _tcscpy(lpVersionInformation->szEmulatedCSDVersion, osviex.szCSDVersion);
+        lpVersionInformation->wEmulatedServicePackMajor = osviex.wServicePackMajor;
+        lpVersionInformation->wEmulatedServicePackMinor = osviex.wServicePackMinor;
+        
+        //Explicitly map the Win32 wSuiteMask to our own values
+        if (osviex.wSuiteMask & VER_SUITE_SMALLBUSINESS)
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_SMALLBUSINESS;
+        if (osviex.wSuiteMask & VER_SUITE_ENTERPRISE)
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_ENTERPRISE;
+        if (osviex.wSuiteMask & VER_SUITE_TERMINAL)
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_TERMINAL;
+        if (osviex.wSuiteMask & VER_SUITE_DATACENTER)
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_DATACENTER;
+        if (osviex.wSuiteMask & VER_SUITE_PERSONAL)
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_PERSONAL;
+        if (osviex.wSuiteMask & VER_SUITE_BLADE)
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_WEBEDITION;
+        if (osviex.wSuiteMask & VER_SUITE_EMBEDDEDNT)
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_EMBEDDEDNT;
+        if (osviex.wSuiteMask & VER_SUITE_SINGLEUSERTS)
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_REMOTEADMINMODE_TERMINAL;
+
+        //Explicitely map the Win32 wProductType to our own values
+        switch (osviex.wProductType)
+        {
+          case VER_NT_WORKSTATION:
+          {
+            lpVersionInformation->OSType = Workstation;
+            break;
+          }
+          case VER_NT_DOMAIN_CONTROLLER:
+          {
+            lpVersionInformation->OSType = DomainController;
+            break;
+          }
+          case VER_NT_SERVER:
+          {
+            lpVersionInformation->OSType = Server;
+            break;
+          }
+          default:
+          {
+            break;
+          }
+        }
+
+        //Determine the Domain Controller Type
+        GetNTOSTypeFromRegistry(lpVersionInformation, TRUE);
+
+        //Get the media center details
+        GetMediaCenterDetailsFromRegistry(lpVersionInformation);
+
+        //Explicitly map the win32 dwPlatformId to our own values 
+        switch (osviex.dwPlatformId)
+        {
+          case VER_PLATFORM_WIN32_WINDOWS:
+          {
+            lpVersionInformation->EmulatedPlatform = Windows9x;
+            break;
+          }
+          case VER_PLATFORM_WIN32_NT:
+          {
+            lpVersionInformation->EmulatedPlatform = WindowsNT;
+            break;
+          }
+          case VER_PLATFORM_WIN32_CE:
+          {
+            lpVersionInformation->EmulatedPlatform = WindowsCE;
+            break;
+          }
+          default:
+          {
+            break;
+          }
+        }
+
+        lpVersionInformation->dwUnderlyingMajorVersion = lpVersionInformation->dwEmulatedMajorVersion; 
+        lpVersionInformation->dwUnderlyingMinorVersion = lpVersionInformation->dwEmulatedMinorVersion; 
+        lpVersionInformation->dwUnderlyingBuildNumber = lpVersionInformation->dwEmulatedBuildNumber;
+        lpVersionInformation->UnderlyingPlatform = lpVersionInformation->EmulatedPlatform;
+        _tcscpy(lpVersionInformation->szUnderlyingCSDVersion, lpVersionInformation->szEmulatedCSDVersion);
+        lpVersionInformation->wUnderlyingServicePackMajor = lpVersionInformation->wEmulatedServicePackMajor;
+        lpVersionInformation->wUnderlyingServicePackMinor = lpVersionInformation->wEmulatedServicePackMinor;
+
+      #ifndef UNDER_CE
+        //Determine if it is NT SP6a Vs SP6
+        GetNTSP6aDetailsFromRegistry(lpVersionInformation, TRUE);
+
+        //Determine if it is XP SP1a Vs SP1
+        GetXPSP1aDetailsFromRegistry(lpVersionInformation, TRUE);
+
+        //Determine the HAL details
+        GetNTHALDetailsFromRegistry(lpVersionInformation);
+	    #endif
+      }
+      else
+      {
+        lpVersionInformation->dwEmulatedMajorVersion = osvi.dwMajorVersion; 
+        lpVersionInformation->dwEmulatedMinorVersion = osvi.dwMinorVersion; 
+        lpVersionInformation->dwEmulatedBuildNumber = LOWORD(osvi.dwBuildNumber); //ignore HIWORD
+        _tcscpy(lpVersionInformation->szEmulatedCSDVersion, osvi.szCSDVersion);
+    
+        //Explicitely map the win32 dwPlatformId to our own values 
+        //Also work out the various service packs which are installed
+        if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
+        {
+          lpVersionInformation->EmulatedPlatform = Windows9x;
+          lpVersionInformation->OSType = Workstation;
+
+          //Deterine the Win9x Service pack installed
+          if (IsWindows95SP1(lpVersionInformation))
+          {
+            lpVersionInformation->wEmulatedServicePackMajor = 1;
+            lpVersionInformation->wUnderlyingServicePackMajor = 1;
+          }
+          else if (IsWindows95OSR2(lpVersionInformation))
+          {
+            lpVersionInformation->wEmulatedServicePackMajor = 2;
+            lpVersionInformation->wUnderlyingServicePackMajor = 2;
+          }
+          else if (IsWindows98SP1(lpVersionInformation))
+          {
+            lpVersionInformation->wEmulatedServicePackMajor = 1;
+            lpVersionInformation->wUnderlyingServicePackMajor = 1;
+          }
+        }
+        else if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
+        {
+          lpVersionInformation->EmulatedPlatform = WindowsNT;
+
+          //Determine the NT Service pack
+          lpVersionInformation->wEmulatedServicePackMajor = GetNTServicePackFromCSDString(osvi.szCSDVersion);
+          lpVersionInformation->wUnderlyingServicePackMajor = lpVersionInformation->wEmulatedServicePackMajor;
+
+          //Determine the OS Type
+          GetNTOSTypeFromRegistry(lpVersionInformation, FALSE);
+
+          //Get the Product Suites installed
+          GetProductSuiteDetailsFromRegistry(lpVersionInformation);
+          GetTerminalServicesRemoteAdminModeDetailsFromRegistry(lpVersionInformation);
+        }
+        else if (osvi.dwPlatformId == VER_PLATFORM_WIN32_CE)
+        {
+          lpVersionInformation->EmulatedPlatform = WindowsCE;
+
+          //Always set the OSType to Workstation on CE. The variable itself does not make 
+          //much sense on CE, but we do not conditionally compile it out on CE as then we
+          //would have to put in loadsa ifdefs UNDER_CE in the COSVersion::Is... methods
+          lpVersionInformation->OSType = Workstation;
+        }
+
+        if (osvi.dwPlatformId == VER_PLATFORM_WIN32s)  //32 bit app running on Windows 3.x
+        {
+          lpVersionInformation->EmulatedPlatform = Windows9x;
+
+          lpVersionInformation->dwUnderlyingMajorVersion = 3; 
+          lpVersionInformation->dwUnderlyingMinorVersion = 10; 
+          lpVersionInformation->dwUnderlyingBuildNumber = 0;
+          lpVersionInformation->UnderlyingPlatform = Windows3x;
+          _tcscpy(lpVersionInformation->szUnderlyingCSDVersion, _T(""));
+        }
+        else
+        {
+          lpVersionInformation->dwUnderlyingMajorVersion = lpVersionInformation->dwEmulatedMajorVersion; 
+          lpVersionInformation->dwUnderlyingMinorVersion = lpVersionInformation->dwEmulatedMinorVersion; 
+          lpVersionInformation->dwUnderlyingBuildNumber = lpVersionInformation->dwEmulatedBuildNumber;
+          lpVersionInformation->UnderlyingPlatform = lpVersionInformation->EmulatedPlatform;
+          _tcscpy(lpVersionInformation->szUnderlyingCSDVersion, lpVersionInformation->szEmulatedCSDVersion);
+        }
+
+        if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
+        {
+          //Determine if it is NT SP6a Vs SP6
+          GetNTSP6aDetailsFromRegistry(lpVersionInformation, TRUE);
+
+          //Determine if it is XP SP1a Vs SP1
+          GetXPSP1aDetailsFromRegistry(lpVersionInformation, TRUE);
+
+          //Determine the HAL details
+          GetNTHALDetailsFromRegistry(lpVersionInformation);
+        }
+      }
+    }
+    else
+    {
+      //Since GetVersionEx is not available we need to fall back on plain
+      //old GetVersion. Because GetVersionEx is available on all but v3.1 of NT
+      //we can fill in some of the parameters ourselves.
+      DWORD dwVersion = ::GetVersion();
+
+      lpVersionInformation->dwEmulatedMajorVersion =  (DWORD)(LOBYTE(LOWORD(dwVersion)));
+      lpVersionInformation->dwEmulatedMinorVersion =  (DWORD)(HIBYTE(LOWORD(dwVersion)));
+      lpVersionInformation->dwEmulatedBuildNumber = 0;
+      lpVersionInformation->EmulatedPlatform   = WindowsNT;   
+      lpVersionInformation->dwUnderlyingMajorVersion = lpVersionInformation->dwEmulatedMajorVersion;
+      lpVersionInformation->dwUnderlyingMinorVersion = lpVersionInformation->dwEmulatedMinorVersion;
+      lpVersionInformation->dwUnderlyingBuildNumber  = lpVersionInformation->dwEmulatedBuildNumber;
+      lpVersionInformation->UnderlyingPlatform   = lpVersionInformation->EmulatedPlatform;   
+      _tcscpy(lpVersionInformation->szUnderlyingCSDVersion, lpVersionInformation->szEmulatedCSDVersion);
+
+      //Need to determine the NT Service pack by querying the registry directory.
+      lpVersionInformation->wEmulatedServicePackMajor = GetNTServicePackFromRegistry();
+      lpVersionInformation->wUnderlyingServicePackMajor = lpVersionInformation->wEmulatedServicePackMajor;
+    }
+
+  #ifndef UNDER_CE
+    //Get the processor details
+    if (hKernel32)
+    {
+      SYSTEM_INFO EmulatedSI;
+      SYSTEM_INFO UnderlyingSI;
+
+      lpfnGetNativeSystemInfo pGetNativeSystemInfo = (lpfnGetNativeSystemInfo) GetProcAddress(hKernel32, "GetNativeSystemInfo"); 
+      if (pGetNativeSystemInfo)
+      {
+        pGetNativeSystemInfo(&UnderlyingSI);
+        GetSystemInfo(&EmulatedSI);
+      }
+      else
+      {
+        GetSystemInfo(&UnderlyingSI);
+        CopyMemory(&EmulatedSI, &UnderlyingSI, sizeof(SYSTEM_INFO));
+      }
+
+      //Map from the SYTEM_INFO wProcessorArchitecture defines to our equivalents
+      switch (UnderlyingSI.wProcessorArchitecture)
+      {
+        case PROCESSOR_ARCHITECTURE_INTEL: //deliberate fallthrough
+        case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
+        {
+          lpVersionInformation->UnderlyingProcessorType = INTEL_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_MSIL:
+        {
+          lpVersionInformation->UnderlyingProcessorType = MSIL_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_MIPS:
+        {
+          lpVersionInformation->UnderlyingProcessorType = MIPS_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_ARM:
+        {
+          lpVersionInformation->UnderlyingProcessorType = ARM_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_SHX:
+        {
+          lpVersionInformation->UnderlyingProcessorType = SHX_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_ALPHA:
+        {
+          lpVersionInformation->UnderlyingProcessorType = ALPHA_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_ALPHA64:
+        {
+          lpVersionInformation->UnderlyingProcessorType = ALPHA64_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_PPC:
+        {
+          lpVersionInformation->UnderlyingProcessorType = PPC_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_IA64:
+        {
+          lpVersionInformation->UnderlyingProcessorType = IA64_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_AMD64:
+        {
+          lpVersionInformation->UnderlyingProcessorType = AMD64_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_UNKNOWN: //Deliberate fallthrough
+        default:
+        {
+          lpVersionInformation->UnderlyingProcessorType = UNKNOWN_PROCESSOR;
+          break;
+        }
+      }
+
+      switch (EmulatedSI.wProcessorArchitecture)
+      {
+        case PROCESSOR_ARCHITECTURE_INTEL: //deliberate fallthrough
+        case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
+        {
+          lpVersionInformation->EmulatedProcessorType = INTEL_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_MSIL:
+        {
+          lpVersionInformation->EmulatedProcessorType = MSIL_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_MIPS:
+        {
+          lpVersionInformation->EmulatedProcessorType = MIPS_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_ARM:
+        {
+          lpVersionInformation->EmulatedProcessorType = ARM_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_SHX:
+        {
+          lpVersionInformation->EmulatedProcessorType = SHX_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_ALPHA:
+        {
+          lpVersionInformation->EmulatedProcessorType = ALPHA_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_ALPHA64:
+        {
+          lpVersionInformation->EmulatedProcessorType = ALPHA64_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_PPC:
+        {
+          lpVersionInformation->EmulatedProcessorType = PPC_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_IA64:
+        {
+          lpVersionInformation->EmulatedProcessorType = IA64_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_AMD64:
+        {
+          lpVersionInformation->EmulatedProcessorType = AMD64_PROCESSOR;
+          break;
+        }
+        case PROCESSOR_ARCHITECTURE_UNKNOWN: //Deliberate fallthrough
+        default:
+        {
+          lpVersionInformation->EmulatedProcessorType = UNKNOWN_PROCESSOR;
+          break;
+        }
+      }
+    }
+  #endif
+  
+  #else //We must be runing on an emulated or real version of Win16 or DOS
+    lpVersionInformation->EmulatedProcessorType = INTEL_PROCESSOR; //We can only be running Intel(x86) code from Win16 or DOS
+
+    #ifdef _WINDOWS //Running on some version of Windows                   
+      DWORD dwVersion = GetVersion();
+      // GetVersion does not differentiate between Windows 3.1 and Windows 3.11
+      
+      lpVersionInformation->dwEmulatedMajorVersion = LOBYTE(LOWORD(dwVersion)); 
+      lpVersionInformation->dwEmulatedMinorVersion = HIBYTE(LOWORD(dwVersion));
+      lpVersionInformation->dwEmulatedBuildNumber  = 0; //no build number with Win3.1x
+      lpVersionInformation->EmulatedPlatform       = Windows3x;
+      
+      //Call to get the underlying OS here through 16 -> 32 bit Generic Thunk
+      BOOL bFoundUnderlyingOS = FALSE;
+      OSVERSIONINFO osvi;                      
+      memset(&osvi, 0, sizeof(OSVERSIONINFO));
+      osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+      if (GetVersionEx(&osvi))
+      {
+        lpVersionInformation->dwUnderlyingMajorVersion = osvi.dwMajorVersion; 
+        lpVersionInformation->dwUnderlyingMinorVersion = osvi.dwMinorVersion; 
+        lpVersionInformation->dwUnderlyingBuildNumber = LOWORD(osvi.dwBuildNumber); //ignore HIWORD
+        _fstrcpy(lpVersionInformation->szUnderlyingCSDVersion, osvi.szCSDVersion);
+       
+        //Explicitely map the win32 dwPlatformId to our own values
+        if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
+        {
+          lpVersionInformation->UnderlyingPlatform = Windows9x;
+
+          //Deterine the Win9x Service pack installed
+          if (IsWindows95SP1(lpVersionInformation))
+            lpVersionInformation->wUnderlyingServicePackMajor = 1;
+          else if (IsWindows95OSR2(lpVersionInformation))
+            lpVersionInformation->wUnderlyingServicePackMajor = 2;
+          else if (IsWindows98SP1(lpVersionInformation))
+            lpVersionInformation->wUnderlyingServicePackMajor = 1;
+        }
+        else if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
+        {
+          lpVersionInformation->UnderlyingPlatform = WindowsNT;
+
+          //Determine the NT Service pack
+          lpVersionInformation->wEmulatedServicePackMajor = 0; //Win16 does not have a concept of a service pack
+          lpVersionInformation->wUnderlyingServicePackMajor = GetNTServicePackFromCSDString(osvi.szCSDVersion);
+
+          //Determine the OS Type
+          GetNTOSTypeFromRegistry(lpVersionInformation, FALSE);
+
+		#ifndef UNDER_CE
+          //Determine if it is NT SP6a Vs SP6
+          GetNTSP6aDetailsFromRegistry(lpVersionInformation, FALSE);
+
+          //Determine if it is XP SP1a Vs SP1
+          GetXPSP1aDetailsFromRegistry(lpVersionInformation, FALSE);
+
+          //Determine the HAL details
+          GetNTHALDetailsFromRegistry(lpVersionInformation);
+		#endif
+
+          //Get the Product Suites installed
+          GetProductSuiteDetailsFromRegistry(lpVersionInformation);
+          GetTerminalServicesRemoteAdminModeDetailsFromRegistry(lpVersionInformation);
+          GetMediaCenterDetailsFromRegistry(lpVersionInformation);
+        }
+        else
+          return FALSE;
+       
+        bFoundUnderlyingOS = TRUE;
+      }
+      else
+      {
+        //We failed to get GetVersionEx so try to GetVersion instead. We known that we must be on
+        //Windows NT 3.5 or earlier since anything released later by MS had this function.
+        DWORD dwVersion = GetVersion();
+        if (dwVersion)
+        {              
+          lpVersionInformation->dwUnderlyingMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
+          lpVersionInformation->dwUnderlyingMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
+          lpVersionInformation->dwUnderlyingBuildNumber  = 0;
+          lpVersionInformation->UnderlyingPlatform   = WindowsNT; 
+          _fstrcpy(lpVersionInformation->szUnderlyingCSDVersion, "");
+   
+          bFoundUnderlyingOS = TRUE;
+        }
+      }
+                                             
+      //Get the processor details                                       
+	  GetProcessorType(lpVersionInformation);
+
+      if (!bFoundUnderlyingOS)
+      {
+        //must be running on a real version of 16 bit Windows whose underlying OS is DOS
+        lpVersionInformation->dwUnderlyingMajorVersion = HIBYTE(HIWORD(dwVersion)); 
+        lpVersionInformation->dwUnderlyingMinorVersion = LOBYTE(HIWORD(dwVersion)); 
+        lpVersionInformation->dwUnderlyingBuildNumber = 0; 
+        lpVersionInformation->UnderlyingPlatform = Dos;
+        _fstrcpy(lpVersionInformation->szUnderlyingCSDVersion, "");
+      }
+    #else //Must be some version of real or emulated DOS
+      //Retreive the current version of emulated DOS
+      BYTE DosMinor;
+      BYTE DosMajor;
+      _asm
+      {
+        mov ax, 3306h
+        int 21h
+        mov byte ptr [DosMajor], bl
+        mov byte ptr [DosMinor], bh
+      }
+      lpVersionInformation->EmulatedPlatform = Dos;
+      lpVersionInformation->dwEmulatedMajorVersion = (DWORD) DosMajor; 
+      lpVersionInformation->dwEmulatedMinorVersion = (DWORD) DosMinor;                
+      lpVersionInformation->dwEmulatedBuildNumber = 0; //no build number with DOS
+      
+      //See can we get the underlying OS info by calling WriteVer
+      if (!GetInfoBySpawingWriteVer(lpVersionInformation))
+      {
+        //We can detect if NT is running as it reports DOS v5.5
+        if ((lpVersionInformation->dwEmulatedMajorVersion == 5) &&
+            (lpVersionInformation->dwEmulatedMinorVersion == 50))    //NT reports DOS v5.5
+        {
+          _fstrcpy(lpVersionInformation->szUnderlyingCSDVersion, "");    
+          //could not find method of determing version of NT from DOS,
+          //so assume 3.50
+          lpVersionInformation->dwUnderlyingMajorVersion = 3; 
+          lpVersionInformation->dwUnderlyingMinorVersion = 50; 
+          lpVersionInformation->dwUnderlyingBuildNumber = 0;  //cannot get access to build number from DOS
+          lpVersionInformation->UnderlyingPlatform = WindowsNT;
+        }            
+        else
+        {
+          //Get the underlying OS here via the int 2FH interface of Windows
+          GetWinInfo();
+          if (bRunningWindows)
+          { 
+            if (lpVersionInformation->dwEmulatedMajorVersion >= 7)  //Windows 9x marks itself as DOS 7 or DOS 8
+              lpVersionInformation->UnderlyingPlatform = Windows9x;
+            else                                                              
+            {
+              //Could not find method of differentiating between WFW & Win3.1 under DOS,
+              //so assume Win3.1                                     
+              lpVersionInformation->UnderlyingPlatform = Windows3x;      
+            }  
+            _fstrcpy(lpVersionInformation->szUnderlyingCSDVersion, "");
+            lpVersionInformation->dwUnderlyingMajorVersion = (WinVer & 0xFF00) >> 8; 
+            lpVersionInformation->dwUnderlyingMinorVersion = WinVer & 0x00FF; 
+  
+            if (lpVersionInformation->dwEmulatedMajorVersion >= 8)  //Windows Me reports itself as DOS v8.0
+              lpVersionInformation->dwUnderlyingBuildNumber = 3000; //This is the build number for Windows ME.
+            else
+            {
+              if (lpVersionInformation->dwEmulatedMinorVersion == 0)
+                lpVersionInformation->dwUnderlyingBuildNumber = 950; //Windows 95 Gold reports DOS v7.0                      
+              else if (lpVersionInformation->dwUnderlyingMinorVersion > 0 && 
+                       lpVersionInformation->dwUnderlyingMinorVersion < 3) 
+              {                                                            
+                //Testing for 95 SP1 has not been done, so the above check
+                //may or may not work
+                lpVersionInformation->dwUnderlyingBuildNumber = 1080; 
+              }
+              else if (lpVersionInformation->dwUnderlyingMinorVersion == 3)
+                lpVersionInformation->dwUnderlyingBuildNumber = 1212; //Windows 95 OSR2 reports DOS 7.03 from 16 bit code
+              else
+                lpVersionInformation->dwUnderlyingBuildNumber = 1998; //Windows 98 or SE. There is no way to differentiate from real mode
+                                                                      //between the two of them
+            }
+          }
+          else //must be on a real version of DOS
+          {                               
+            lpVersionInformation->dwUnderlyingMajorVersion = (DWORD) DosMajor; 
+            lpVersionInformation->dwUnderlyingMinorVersion = (DWORD) DosMinor;                
+            lpVersionInformation->dwUnderlyingBuildNumber = 0; //no build number with DOS
+            lpVersionInformation->UnderlyingPlatform = Dos;
+            _fstrcpy(lpVersionInformation->szUnderlyingCSDVersion, "");
+          }
+        }   
+      }
+    #endif  
+  #endif
+
+  return TRUE;
+}
+
+#ifndef _DOS
+void COSVersion::GetNTSP6aDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation, BOOL bUpdateEmulatedAlso)
+{
+#ifndef UNDER_CE
+  if ((lpVersionInformation->dwUnderlyingMajorVersion == 4) && (lpVersionInformation->wUnderlyingServicePackMajor == 6))
+  {
+    //Test for SP6 versus SP6a.
+    HKEY hKey;
+#if (defined(_WIN32) || defined(_WIN64))
+    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
+#else                                  
+	if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Hotfix\\Q246009"), &hKey) == ERROR_SUCCESS)
+#endif    
+    {
+      lpVersionInformation->wUnderlyingServicePackMinor = 1;         
+      if (bUpdateEmulatedAlso)
+        lpVersionInformation->wEmulatedServicePackMinor = 1;
+    }
+
+    RegCloseKey(hKey);
+  }
+#endif
+}
+#endif
+
+#ifndef _DOS
+void COSVersion::GetXPSP1aDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation, BOOL bUpdateEmulatedAlso)
+{
+#ifndef UNDER_CE
+  if ((lpVersionInformation->dwUnderlyingMajorVersion == 5) && (lpVersionInformation->dwUnderlyingMinorVersion != 0) && (lpVersionInformation->wUnderlyingServicePackMajor == 1))
+  {
+    //Test for SP1a versus SP1.
+    HKEY hKey;
+#if (defined(_WIN32) || defined(_WIN64))
+    if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
+#else                                  
+	if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), &hKey) == ERROR_SUCCESS)
+#endif    
+    {
+      TCHAR sTemp[1024];
+      DWORD dwBufLen = 1024 * sizeof(TCHAR);
+
+  #if (defined(_WIN32) || defined(_WIN64))
+      if (::RegQueryValueEx(hKey, _T("SubVersionNumber"), NULL, NULL, (LPBYTE) sTemp, &dwBufLen) == ERROR_SUCCESS)
+  #else
+      if (RegQueryValueEx(hKey, _T("SubVersionNumber"), NULL, NULL, (LPBYTE) sTemp, &dwBufLen) == ERROR_SUCCESS)
+  #endif
+      {
+        if (_tcsicmp(sTemp, _T("a")) == 0)
+        {
+          lpVersionInformation->wUnderlyingServicePackMinor = 1;         
+          if (bUpdateEmulatedAlso)
+            lpVersionInformation->wEmulatedServicePackMinor = 1;
+        }
+      }
+    }
+
+    RegCloseKey(hKey);
+  }
+#endif
+}
+#endif
+
+#ifndef _DOS
+void COSVersion::GetNTHALDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation)
+{
+#ifndef UNDER_CE
+  HKEY hKey;
+#if (defined(_WIN32) || defined(_WIN64))
+  if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
+#else                                  
+  if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"), &hKey) == ERROR_SUCCESS)
+#endif    
+  {
+    TCHAR sTemp[1024];
+    DWORD dwBufLen = 1024 * sizeof(TCHAR);
+
+#if (defined(_WIN32) || defined(_WIN64))
+    if (::RegQueryValueEx(hKey, _T("CurrentType"), NULL, NULL, (LPBYTE) sTemp, &dwBufLen) == ERROR_SUCCESS)
+#else
+    if (RegQueryValueEx(hKey, _T("CurrentType"), NULL, NULL, (LPBYTE) sTemp, &dwBufLen) == ERROR_SUCCESS)
+#endif
+    {
+      if (_tcsicmp(sTemp, _T("Uniprocessor Free")) == 0)
+        lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_UNIPROCESSOR_FREE;         
+      else if (_tcsicmp(sTemp, _T("Uniprocessor Checked")) == 0)
+        lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_UNIPROCESSOR_CHECKED;         
+      else if (_tcsicmp(sTemp, _T("Multiprocessor Free")) == 0)
+        lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_MULTIPROCESSOR_FREE;         
+      else if (_tcsicmp(sTemp, _T("Multiprocessor Checked")) == 0)
+        lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_MULTIPROCESSOR_CHECKED;         
+    }
+  }
+
+  RegCloseKey(hKey);
+#endif
+}
+#endif
+      
+#ifndef _DOS
+void COSVersion::GetNTOSTypeFromRegistry(LPOS_VERSION_INFO lpVersionInformation, BOOL bOnlyUpdateDCDetails)
+{
+  //Open and the product options key
+  HKEY hKey;
+#if (defined(_WIN32) || defined(_WIN64))
+  if (::RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Control\\ProductOptions"), 0, KEY_READ, &hKey) == ERROR_SUCCESS)
+#else                                                                                                                               
+  if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Control\\ProductOptions"), &hKey) == ERROR_SUCCESS)
+#endif
+  {
+    TCHAR sTemp[1024];
+    DWORD dwBufLen = 1024 * sizeof(TCHAR);
+
+#if (defined(_WIN32) || defined(_WIN64))
+    if (::RegQueryValueEx(hKey, _T("ProductType"), NULL, NULL, (LPBYTE) sTemp, &dwBufLen) == ERROR_SUCCESS)
+#else
+    if (RegQueryValueEx(hKey, _T("ProductType"), NULL, NULL, (LPBYTE) sTemp, &dwBufLen) == ERROR_SUCCESS)
+#endif
+    {
+      if (bOnlyUpdateDCDetails)
+      {
+        if (_tcsicmp(sTemp, _T("LANMANNT")) == 0)
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_PRIMARY_DOMAIN_CONTROLLER;
+        else if (_tcsicmp(sTemp, _T("LANSECNT")) == 0)
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_BACKUP_DOMAIN_CONTROLLER;
+      }
+      else
+      {
+        if (_tcsicmp(sTemp, _T("LANMANNT")) == 0)
+        {
+          lpVersionInformation->OSType = DomainController;
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_PRIMARY_DOMAIN_CONTROLLER;
+        }
+        else if (_tcsicmp(sTemp, _T("SERVERNT")) == 0)
+        {
+          lpVersionInformation->OSType = Server;
+        }
+        else if (_tcsicmp(sTemp, _T("LANSECNT")) == 0)
+        {
+          lpVersionInformation->OSType = DomainController;
+          lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_BACKUP_DOMAIN_CONTROLLER;
+        }
+        else if (_tcsicmp(sTemp, _T("WinNT")) == 0)
+        {
+          lpVersionInformation->OSType = Workstation;
+        }
+      }
+    }
+
+    RegCloseKey(hKey);
+  }
+}
+#endif //#ifndef _DOS
+                                   
+#ifdef _DOS             
+BOOL COSVersion::GetInfoBySpawingWriteVer(COSVersion::LPOS_VERSION_INFO lpVersionInformation)
+{
+  //Assume the worst
+  BOOL bSuccess = FALSE;
+
+  //Form the command line we need  
+  char pszCommandLine[256];      
+  char* pszTempFilename = tmpnam(NULL);
+  sprintf(pszCommandLine, "WriteVer.exe %s", pszTempFilename);
+
+  //Try to spawn out writever utilty
+  if (system(pszCommandLine) != -1)
+  {           
+    //Open the file we need                 
+    FILE* pOSFile = fopen(pszTempFilename, "r");
+    if (pOSFile == NULL)
+      return bSuccess;
+        
+    //Read in the OS version info from file
+    char pszLine[1024];
+    size_t nRead = fread(pszLine, 1, 1024, pOSFile);
+    if (nRead)
+    {
+      pszLine[nRead] = '\0'; //Don't forget to NULL terminate
+
+      //Parse the input string                               
+      char* pszSeparators = "\t";                               
+      char* pszToken = strtok(pszLine, pszSeparators);
+      if (pszToken)
+      {
+        lpVersionInformation->dwUnderlyingMajorVersion = atoi(pszToken);      
+        pszToken = strtok(NULL, pszSeparators);         
+        if (pszToken)
+        {
+          lpVersionInformation->dwUnderlyingMinorVersion = atoi(pszToken);      
+          pszToken = strtok(NULL, pszSeparators);         
+          if (pszToken)
+          {
+            lpVersionInformation->dwUnderlyingBuildNumber = atoi(pszToken);       
+            pszToken = strtok(NULL, pszSeparators);         
+            if (pszToken)
+            {
+              lpVersionInformation->UnderlyingPlatform = (COSVersion::OS_PLATFORM) atoi(pszToken);       
+              pszToken = strtok(NULL, pszSeparators);         
+              if (pszToken)                                       
+              {                                                   
+                lpVersionInformation->wUnderlyingServicePackMajor = (WORD) atoi(pszToken);       
+                pszToken = strtok(NULL, pszSeparators);             
+                if (pszToken)
+                {
+                  lpVersionInformation->wUnderlyingServicePackMinor = (WORD) atoi(pszToken);       
+                  pszToken = strtok(NULL, pszSeparators);             
+                  if (pszToken)
+                  {
+                    lpVersionInformation->dwSuiteMask = (DWORD) atoi(pszToken);       
+                    pszToken = strtok(NULL, pszSeparators);
+                    if (pszToken)
+                    {
+                      lpVersionInformation->OSType = (COSVersion::OS_TYPE) atoi(pszToken);       
+
+                      pszToken = strtok(NULL, pszSeparators);             
+                      if (pszToken)
+                      {
+                        lpVersionInformation->UnderlyingProcessorType = (COSVersion::PROCESSOR_TYPE) atoi(pszToken);       
+
+                        //CSDVersion string is optional so consider it successful if we got as far as here
+                        bSuccess = TRUE;
+
+                        pszToken = strtok(NULL, pszSeparators);
+                        if (pszToken)
+                          strcpy(lpVersionInformation->szUnderlyingCSDVersion, pszToken);                                    
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+   
+    //Don't forget to close the file
+    fclose(pOSFile);
+
+    //and remove it now that we are finished with it
+    remove(pszTempFilename);
+  }
+  else
+  {
+    printf("writever command failed, Errno:%d\n", errno);
+  }     
+
+  return bSuccess;
+}
+
+void COSVersion::GetWinInfo()
+{ 
+  BYTE MajorVer;
+  BYTE MinorVer;
+
+  //use some inline assembly to determine if Windows if
+  //running and what version is active
+  _asm
+  {
+  ; check for Windows 3.1
+    mov     ax,160ah                ; WIN31CHECK
+    int     2fh                     ; check if running under Win 3.1.
+    or      ax,ax
+    jz      RunningUnderWin31       ; can check if running in standard
+                                    ; or enhanced mode
+   
+  ; check for Windows 3.0 enhanced mode
+    mov     ax,1600h                ; WIN386CHECK
+    int     2fh
+    test    al,7fh
+    jnz     RunningUnderWin30Enh    ; enhanced mode
+   
+  ; check for 3.0 WINOLDAP
+    mov     ax,4680h                ; IS_WINOLDAP_ACTIVE
+    int     2fh
+    or      ax,ax                   ; running under 3.0 derivative?
+    jnz     NotRunningUnderWin
+   
+  ; rule out MS-DOS 5.0 task switcher
+    mov     ax,4b02h                ; detect switcher
+    push    bx
+    push    es
+    push    di
+    xor     bx,bx
+    mov     di,bx
+    mov     es,bx
+    int     2fh
+    pop     di
+    pop     es
+    pop     bx
+    or      ax,ax
+    jz      NotRunningUnderWin      ; MS-DOS 5.0 task switcher found
+   
+  ; check for standard mode Windows 3.0
+    mov     ax,1605h                ; PMODE_START
+    int     2fh
+    cmp     cx,-1
+    jz      RunningUnderWin30Std
+   
+  ; check for real mode Windows 3.0
+    mov     ax,1606h                ; PMODE_STOP
+    int     2fh                     ; in case someone is counting
+    ; Real mode Windows 3.0 is running
+    mov     byte ptr [bRunningWindows], 1
+    mov     byte ptr [MajorVer], 3h    
+    mov     byte ptr [MinorVer], 0h        
+    jmp     ExitLabel
+   
+  RunningUnderWin30Std:
+    ; Standard mode Windows 3.0 is running
+    mov     byte ptr [bRunningWindows], 1
+    mov     byte ptr [MajorVer], 3h    
+    mov     byte ptr [MinorVer], 0h        
+    jmp     ExitLabel
+   
+  RunningUnderWin31:
+    ; At this point: CX == 3 means Windows 3.1 enhanced mode
+    ;                CX == 2 means Windows 3.1 standard mode
+    mov     byte ptr [bRunningWindows], 1
+    
+    ; Get the version of Windows 
+    mov     ax, 1600h   ; Get Enhanced-Mode Windows Installed State
+    int     2Fh
+    mov     byte ptr [MajorVer], al
+    mov     byte ptr [MinorVer], ah
+    jmp     ExitLabel
+   
+  RunningUnderWin30Enh:
+    ; Enhanced mode Windows 3.0 is running
+    mov     byte ptr [bRunningWindows], 1    
+    mov     byte ptr [MajorVer], 3h    
+    mov     byte ptr [MinorVer], 0h        
+    jmp     ExitLabel
+   
+  NotRunningUnderWin:                    
+    mov     byte ptr [bRunningWindows], 0
+    
+  ExitLabel:
+  }             
+  
+  WinVer = (WORD) ((MajorVer << 8) + MinorVer);
+} 
+#endif //_DOS 
+
+BOOL COSVersion::IsWindowsCE(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == WindowsCE);
+}
+
+BOOL COSVersion::IsWindows95(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == Windows9x &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 4 && 
+          lpVersionInformation->dwUnderlyingMinorVersion == 0 &&
+          lpVersionInformation->dwUnderlyingBuildNumber == 950);
+}
+
+BOOL COSVersion::IsWindows95SP1(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == Windows9x &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 4 && 
+          lpVersionInformation->dwUnderlyingBuildNumber > 950 && 
+          lpVersionInformation->dwUnderlyingBuildNumber <= 1080);
+}
+
+BOOL COSVersion::IsWindows95OSR2(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == Windows9x &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 4 && 
+          lpVersionInformation->dwUnderlyingMinorVersion < 10 &&
+          lpVersionInformation->dwUnderlyingBuildNumber > 1080);
+}
+
+BOOL COSVersion::IsWindows98(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == Windows9x &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 4 && 
+          lpVersionInformation->dwUnderlyingMinorVersion == 10 &&
+          lpVersionInformation->dwUnderlyingBuildNumber == 1998);
+}
+
+BOOL COSVersion::IsWindows98SP1(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == Windows9x &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 4 && 
+          lpVersionInformation->dwUnderlyingMinorVersion == 10 &&
+          lpVersionInformation->dwUnderlyingBuildNumber > 1998 &&
+          lpVersionInformation->dwUnderlyingBuildNumber < 2183);
+}
+
+BOOL COSVersion::IsWindows98SE(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == Windows9x &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 4 && 
+          lpVersionInformation->dwUnderlyingMinorVersion == 10 &&
+          lpVersionInformation->dwUnderlyingBuildNumber >= 2183);
+}
+
+BOOL COSVersion::IsWindowsME(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == Windows9x &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 4 &&
+          lpVersionInformation->dwUnderlyingMinorVersion == 90);
+}
+
+BOOL COSVersion::IsWindowsNT31(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == WindowsNT &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 3 && 
+          lpVersionInformation->dwUnderlyingMinorVersion == 10);
+}
+
+BOOL COSVersion::IsWindowsNT35(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == WindowsNT &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 3 && 
+          lpVersionInformation->dwUnderlyingMinorVersion == 50);
+}
+
+BOOL COSVersion::IsWindowsNT351(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == WindowsNT &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 3 && 
+          lpVersionInformation->dwUnderlyingMinorVersion == 51);
+}
+
+BOOL COSVersion::IsWindowsNT4(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == WindowsNT &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 4);
+}
+
+BOOL COSVersion::IsWindows2000(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == WindowsNT &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 5 &&
+          lpVersionInformation->dwUnderlyingMinorVersion == 0);
+}
+
+BOOL COSVersion::IsWindowsXPOrWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == WindowsNT &&
+          lpVersionInformation->dwUnderlyingMajorVersion == 5 &&
+          lpVersionInformation->dwUnderlyingMinorVersion != 0);
+}
+
+BOOL COSVersion::IsWindowsXP(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsXPPersonal(lpVersionInformation) || IsXPProfessional(lpVersionInformation);
+}
+
+WORD COSVersion::GetNTServicePackFromCSDString(LPCTSTR pszCSDVersion)
+{
+  WORD wServicePack = 0;
+  if (_tcslen(pszCSDVersion))
+  {
+    //Parse out the CSDVersion string
+    int i=0;      
+    while (pszCSDVersion[i] != _T('\0') && !_istdigit(pszCSDVersion[i]))
+      i++;
+    wServicePack = (WORD) (_ttoi(&pszCSDVersion[i]));
+  }
+
+  return wServicePack;
+}
+
+#if defined(_WIN32) || defined(_WIN64)
+WORD COSVersion::GetNTServicePackFromRegistry()
+{
+  //By default assume no service pack
+  WORD wServicePack = 0;
+
+  HKEY hCurrentVersion;
+  #ifdef _WIN32
+  if (::RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows NT\\CurrentVersion"), 0, KEY_READ, &hCurrentVersion) == ERROR_SUCCESS)
+  #else                                                                                                                                       
+  if (RegOpenKey(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows NT\\CurrentVersion"), &hCurrentVersion) == ERROR_SUCCESS)
+  #endif
+  {
+    BYTE byData[128];
+    DWORD dwType;
+    DWORD dwSize = 128;
+    if (RegQueryValueEx(hCurrentVersion, _T("CSDVersion"), NULL, &dwType, byData, &dwSize) == ERROR_SUCCESS)
+    {
+      if (dwType == REG_SZ)
+      {
+        //Stored as a string on all other versions of NT
+        wServicePack = GetNTServicePackFromCSDString((TCHAR*) byData);
+      }
+      else if (dwType == REG_DWORD)
+      {
+        //Handle the service pack number being stored as a DWORD which happens on NT 3.1
+        wServicePack = HIBYTE((WORD) *((DWORD*) byData));
+      }
+    }
+
+    //Don't forget to close the registry key we were using      
+    RegCloseKey(hCurrentVersion);
+  }
+
+  return wServicePack;
+}
+#endif //#if defined(_WIN32) || defined(_WIN64)
+
+#if defined(_WIN32) || defined(_WIN64) || defined (_WINDOWS)
+void COSVersion::GetTerminalServicesRemoteAdminModeDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation)
+{
+  //Lookup the TSAppCompat registry value
+  HKEY hKey = NULL;        
+  #ifdef _WIN32
+  LONG lResult = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Control\\Terminal Server"), 0, KEY_READ, &hKey);
+  #else                                                                                                                         
+  LONG lResult = RegOpenKey(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Control\\Terminal Server"), &hKey);
+  #endif
+  if (lResult != ERROR_SUCCESS)
+    return;
+
+  DWORD dwTSAppCompat = 1;
+  DWORD dwType;
+  DWORD dwSize = sizeof(DWORD);
+#if defined(_WIN32) || defined(_WIN64)    
+  lResult = ::RegQueryValueEx(hKey, _T("TSAppCompat"), NULL, &dwType, (LPBYTE) &dwTSAppCompat, &dwSize);
+#else                                                                                                     
+  lResult = RegQueryValueEx(hKey, _T("TSAppCompat"), NULL, &dwType, (LPBYTE) &dwTSAppCompat, &dwSize);
+#endif  
+  if (lResult == ERROR_SUCCESS)
+  {
+    if (dwTSAppCompat == 0)
+      lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_REMOTEADMINMODE_TERMINAL;
+  }
+
+  //Don't forget to free up the resource we used
+  RegCloseKey(hKey);
+}
+
+void COSVersion::GetMediaCenterDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation)
+{
+  //Lookup the WPA\MediaCenter\Installed registry value
+  HKEY hKey = NULL;        
+  #ifdef _WIN32
+  LONG lResult = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("System\\WPA\\MediaCenter"), 0, KEY_READ, &hKey);
+  #else                                                                                                                         
+  LONG lResult = RegOpenKey(HKEY_LOCAL_MACHINE, _T("System\\WPA\\MediaCenter"), &hKey);
+  #endif
+  if (lResult != ERROR_SUCCESS)
+    return;
+
+  DWORD dwMCE = 0;
+  DWORD dwType;
+  DWORD dwSize = sizeof(DWORD);
+#if defined(_WIN32) || defined(_WIN64)    
+  lResult = ::RegQueryValueEx(hKey, _T("Installed"), NULL, &dwType, (LPBYTE) &dwMCE, &dwSize);
+#else                                                                                                     
+  lResult = RegQueryValueEx(hKey, _T("Installed"), NULL, &dwType, (LPBYTE) &dwMCE, &dwSize);
+#endif  
+  if (lResult == ERROR_SUCCESS)
+  {
+    if (dwMCE)
+      lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_MEDIACENTER;
+  }
+
+  //Don't forget to free up the resource we used
+  RegCloseKey(hKey);
+}
+
+void COSVersion::GetProductSuiteDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation) 
+{
+  //Lookup the ProductOptions registry key
+  HKEY hKey = NULL;        
+  #ifdef _WIN32
+  LONG lResult = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Control\\ProductOptions"), 0, KEY_READ, &hKey);
+  #else                                                                                                                         
+  LONG lResult = RegOpenKey(HKEY_LOCAL_MACHINE, _T("System\\CurrentControlSet\\Control\\ProductOptions"), &hKey);
+  #endif
+  if (lResult != ERROR_SUCCESS)
+    return;
+
+  // Determine required size of ProductSuite buffer.
+  DWORD dwType = 0;
+  DWORD dwSize = 0;                   
+#if defined(_WIN32) || defined(_WIN64)  
+  lResult = ::RegQueryValueEx(hKey, _T("ProductSuite"), NULL, &dwType, NULL, &dwSize);
+#else
+  lResult = RegQueryValueEx(hKey, _T("ProductSuite"), NULL, &dwType, NULL, &dwSize);
+#endif  
+  if (lResult != ERROR_SUCCESS || !dwSize)
+  {
+    RegCloseKey(hKey);
+    return;
+  }
+
+  // Allocate buffer.
+  LPTSTR lpszProductSuites = (LPTSTR) new BYTE[dwSize];
+
+  // Retrieve array of product suite strings.
+#if defined(_WIN32) || defined(_WIN64)    
+  lResult = ::RegQueryValueEx(hKey, _T("ProductSuite"), NULL, &dwType, (LPBYTE) lpszProductSuites, &dwSize);
+#else                                                                                                     
+  lResult = RegQueryValueEx(hKey, _T("ProductSuite"), NULL, &dwType, (LPBYTE) lpszProductSuites, &dwSize);
+#endif  
+  if (lResult != ERROR_SUCCESS || dwType != REG_MULTI_SZ)
+  {
+    //Don't forget to free up the resource we used
+    delete [] lpszProductSuites;
+    RegCloseKey(hKey);
+
+    return;
+  }
+
+  //Search for suite name in array of strings.
+  LPTSTR lpszSuite = lpszProductSuites;
+  while (*lpszSuite) 
+  {
+    //Note we do not need to implement checks for COSVERSION_SUITE_WEBEDITION
+    //as Windows Server 2003 Web Edition which supports GetVersionEx
+    //using a OSVERSIONINFOEX structure.
+
+    //NT Embedded and subsequent version of Embedded Windows supports
+    //GetVersionEx using a OSVERSIONINFOEX structure, so no check for 
+    //it here either
+
+    //Also I was unable to find any documentation on what Windows NT Datacenter Server
+    //puts in the ProductSuite. In Windows 2000 Datacenter it does not matter as it
+    //supports GetVersionEx using a OSVERSIONINFOEX structure.
+
+    //Turn on appropiate fields in the "wSuiteMask" bit field
+    if (_tcsicmp(lpszSuite, _T("Terminal Server")) == 0) 
+      lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_TERMINAL;
+    else if ((_tcsicmp(lpszSuite, _T("SBS")) == 0) || (_tcsicmp(lpszSuite, _T("Small Business")) == 0))
+      lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_SMALLBUSINESS;
+    else if (_tcsicmp(lpszSuite, _T("Enterprise")) == 0) 
+      lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_ENTERPRISE;
+    else if (_tcsicmp(lpszSuite, _T("Personal")) == 0) 
+      lpVersionInformation->dwSuiteMask |= COSVERSION_SUITE_PERSONAL;
+
+    lpszSuite += (lstrlen(lpszSuite) + 1);
+  }
+
+  //Don't forget to free up the resource we used
+  delete [] lpszProductSuites;
+  RegCloseKey(hKey);
+}
+#endif //#if defined(_WIN32) || defined(_WIN64)  || defined (_WINDOWS)
+             
+#if defined(_WIN64) || defined(_WIN32)             
+BOOL COSVersion::IsWindows30(LPOS_VERSION_INFO /*lpVersionInformation*/)
+#else
+BOOL COSVersion::IsWindows30(LPOS_VERSION_INFO lpVersionInformation)
+#endif //#if defined(_WIN64) || defined(_Win32             
+{
+#ifdef _WIN64
+  return FALSE;
+#elif _WIN32
+  return FALSE;
+#else
+  return (lpVersionInformation->UnderlyingPlatform == Windows3x &&
+          lpVersionInformation->dwUnderlyingMinorVersion == 0);
+#endif
+}
+
+#if defined(_WIN64) || defined(_WIN32)             
+BOOL COSVersion::IsWindows31(LPOS_VERSION_INFO /*lpVersionInformation*/)
+#else
+BOOL COSVersion::IsWindows31(LPOS_VERSION_INFO lpVersionInformation)
+#endif //#if defined(_WIN64) || defined(_Win32             
+{
+#ifdef _WIN64
+  return FALSE;
+#elif _WIN32
+  return FALSE;
+#else
+  return (lpVersionInformation->UnderlyingPlatform == Windows3x &&
+          lpVersionInformation->dwUnderlyingMinorVersion == 10);
+#endif
+}
+
+#if defined(_WIN64) || defined(_WIN32)            
+BOOL COSVersion::IsWindows311(LPOS_VERSION_INFO /*lpVersionInformation*/)
+#else
+BOOL COSVersion::IsWindows311(LPOS_VERSION_INFO lpVersionInformation)
+#endif //#if defined(_WIN64) || defined(_Win32             
+{
+#ifdef _WIN64
+  return FALSE;
+#elif _WIN32
+  return FALSE;
+#else
+  return (lpVersionInformation->UnderlyingPlatform == Windows3x &&
+          lpVersionInformation->dwUnderlyingMinorVersion == 11);
+#endif
+}
+
+#if defined(_WINDOWS) && (!defined(_WIN32) && !defined(_WIN64))  
+BOOL COSVersion::IsWindowsForWorkgroups(LPOS_VERSION_INFO lpVersionInformation)
+#else
+BOOL COSVersion::IsWindowsForWorkgroups(LPOS_VERSION_INFO /*lpVersionInformation*/)
+#endif //#if defined(_WINDOWS) && (defined(_WIN32) || defined(_WIN64))  
+{
+#if defined(_WINDOWS) && (!defined(_WIN32) && !defined(_WIN64))  
+  return (lpVersionInformation->UnderlyingPlatform == Windows3x &&
+          WFWLoaded());
+#else
+  return FALSE;          
+#endif //#if defined(_WINDOWS) && (!defined(_WIN32) && !defined(_WIN64))  
+}
+
+
+#if defined(_WIN32)
+BOOL COSVersion::IsWin32sInstalled(LPOS_VERSION_INFO lpVersionInformation)
+#else
+BOOL COSVersion::IsWin32sInstalled(LPOS_VERSION_INFO /*lpVersionInformation*/)
+#endif //#if defined(_WIN64) || defined(_Win32             
+{
+#ifdef _WIN64
+  return FALSE;
+#elif _WIN32
+  return (lpVersionInformation->UnderlyingPlatform == Windows3x);
+#else
+  return FALSE;
+#endif
+}
+
+BOOL COSVersion::IsNTPreWin2k(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (lpVersionInformation->UnderlyingPlatform == WindowsNT &&
+          lpVersionInformation->dwUnderlyingMajorVersion <= 4);
+}
+
+BOOL COSVersion::IsNTPDC(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (IsNTPreWin2k(lpVersionInformation)) && 
+         (lpVersionInformation->OSType == DomainController) &&
+         ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_PRIMARY_DOMAIN_CONTROLLER) != 0);
+}
+
+BOOL COSVersion::IsNTStandAloneServer(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsNTPreWin2k(lpVersionInformation) && (lpVersionInformation->OSType == Server);
+}
+
+BOOL COSVersion::IsNTBDC(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsNTPreWin2k(lpVersionInformation) && 
+         (lpVersionInformation->OSType == DomainController) && 
+         ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_BACKUP_DOMAIN_CONTROLLER) != 0);
+}
+
+BOOL COSVersion::IsNTWorkstation(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsNTPreWin2k(lpVersionInformation) && (lpVersionInformation->OSType == Workstation);
+}
+
+BOOL COSVersion::IsTerminalServicesInstalled(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_TERMINAL) != 0);
+}
+
+BOOL COSVersion::IsEmbedded(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_EMBEDDEDNT) != 0);
+}
+
+BOOL COSVersion::IsTerminalServicesInRemoteAdminMode(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_REMOTEADMINMODE_TERMINAL) != 0);
+}
+
+BOOL COSVersion::ISSmallBusinessEditionInstalled(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_SMALLBUSINESS) != 0);
+}
+
+BOOL COSVersion::IsNTEnterpriseServer(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (IsNTPreWin2k(lpVersionInformation) && (lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_ENTERPRISE) != 0);
+}
+
+BOOL COSVersion::IsNTDatacenterServer(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsNTPreWin2k(lpVersionInformation) && ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_DATACENTER) != 0);
+}
+
+BOOL COSVersion::IsWin2000Professional(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindows2000(lpVersionInformation) && (lpVersionInformation->OSType == Workstation);
+}
+
+BOOL COSVersion::IsWin2000Server(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindows2000(lpVersionInformation) && (lpVersionInformation->OSType == Server);
+}
+
+BOOL COSVersion::IsWin2000AdvancedServer(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindows2000(lpVersionInformation) && ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_ENTERPRISE) != 0);
+}
+
+BOOL COSVersion::IsWin2000DatacenterServer(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return (IsWindows2000(lpVersionInformation) && (lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_DATACENTER) != 0);
+}
+
+BOOL COSVersion::IsWin2000DomainController(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindows2000(lpVersionInformation) && (lpVersionInformation->OSType == DomainController);
+}
+
+BOOL COSVersion::IsXPPersonal(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindowsXPOrWindowsServer2003(lpVersionInformation) && ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_PERSONAL) != 0);
+}
+
+BOOL COSVersion::IsXPProfessional(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindowsXPOrWindowsServer2003(lpVersionInformation) && (lpVersionInformation->OSType == Workstation) && !IsXPPersonal(lpVersionInformation);
+}
+
+BOOL COSVersion::IsWebWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindowsXPOrWindowsServer2003(lpVersionInformation) && ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_WEBEDITION) != 0);
+}
+
+BOOL COSVersion::IsWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindowsXPOrWindowsServer2003(lpVersionInformation) && (lpVersionInformation->OSType == Server);
+}
+
+BOOL COSVersion::IsEnterpriseWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindowsXPOrWindowsServer2003(lpVersionInformation) && ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_ENTERPRISE) != 0);
+}
+
+BOOL COSVersion::IsDatacenterWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindowsXPOrWindowsServer2003(lpVersionInformation) && ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_DATACENTER) != 0);
+}
+
+BOOL COSVersion::IsDomainControllerWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return IsWindowsXPOrWindowsServer2003(lpVersionInformation) && (lpVersionInformation->OSType == DomainController);
+}
+
+BOOL COSVersion::IsMediaCenterInstalled(LPOS_VERSION_INFO lpVersionInformation)
+{
+  return ((lpVersionInformation->dwSuiteMask & COSVERSION_SUITE_MEDIACENTER) != 0);
+}
+
+BOOL COSVersion::IsEmulated64Bit(LPOS_VERSION_INFO /*lpVersionInformation*/)
+{
+#ifdef _WIN64
+  return TRUE;
+#else
+  return FALSE;
+#endif
+}
+
+BOOL COSVersion::IsUnderlying64Bit(LPOS_VERSION_INFO /*lpVersionInformation*/)
+{
+#ifdef _WIN64
+  return TRUE;
+#elif UNDER_CE
+  return FALSE;
+#elif _WIN32
+  //Assume the worst
+  BOOL bSuccess = FALSE;  
+  
+  //Check to see if we are running on 64 bit Windows thro WOW64
+  HMODULE hKernel32 = GetModuleHandle(_T("KERNEL32.DLL"));
+  if (hKernel32)
+  {
+    lpfnIsWow64Process pIsWow64Process = (lpfnIsWow64Process) GetProcAddress(hKernel32, "IsWow64Process"); 
+    if (pIsWow64Process)
+    {
+      BOOL bWow64 = FALSE;
+      if (pIsWow64Process(GetCurrentProcess(), &bWow64))
+        bSuccess = bWow64;
+    }
+  }
+  return bSuccess;
+#else
+  return FALSE;
+#endif
+}
+
diff --git a/ica/win32/winvnc/winvnc/Dtwinver.h b/ica/win32/winvnc/winvnc/Dtwinver.h
new file mode 100644
index 0000000..4542e2b
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/Dtwinver.h
@@ -0,0 +1,363 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+/*
+Module : DTWINVER.H
+Purpose: Interface of a function to perform
+         version detection on OS
+Created: PJN / 11-05-1996
+
+
+Copyright (c) 1997 - 2004 by PJ Naughter.  (Web: www.naughter.com, Email: pjna at naughter.com)
+
+All rights reserved.
+
+Copyright / Usage Details:
+
+You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise) 
+when your product is released in binary form. You are allowed to modify the source code in any way you want 
+except you cannot modify the copyright details at the top of each module. If you want to distribute source 
+code with your application, then you are only allowed to distribute versions released by the author. This is 
+to maintain a single distribution point for the source code. 
+
+*/
+
+#ifndef __DTWINVER_H__                                          
+
+
+////////////////////////////////// Defines ////////////////////////////////////
+
+#define COSVERSION_SUITE_SMALLBUSINESS             0x00000001
+#define COSVERSION_SUITE_ENTERPRISE                0x00000002
+#define COSVERSION_SUITE_PRIMARY_DOMAIN_CONTROLLER 0x00000004
+#define COSVERSION_SUITE_BACKUP_DOMAIN_CONTROLLER  0x00000008
+#define COSVERSION_SUITE_TERMINAL                  0x00000010
+#define COSVERSION_SUITE_DATACENTER                0x00000020
+#define COSVERSION_SUITE_PERSONAL                  0x00000040
+#define COSVERSION_SUITE_WEBEDITION                0x00000080
+#define COSVERSION_SUITE_EMBEDDEDNT                0x00000100
+#define COSVERSION_SUITE_REMOTEADMINMODE_TERMINAL  0x00000200
+#define COSVERSION_SUITE_UNIPROCESSOR_FREE         0x00000400
+#define COSVERSION_SUITE_UNIPROCESSOR_CHECKED      0x00000800
+#define COSVERSION_SUITE_MULTIPROCESSOR_FREE       0x00001000
+#define COSVERSION_SUITE_MULTIPROCESSOR_CHECKED    0x00002000
+#define COSVERSION_SUITE_MEDIACENTER               0x00004000
+
+
+
+////////////////////////////////// Classes ////////////////////////////////////
+
+class COSVersion
+{
+public:
+//Enums
+  enum OS_PLATFORM
+  {
+    Dos = 0,
+    Windows3x = 1,
+    Windows9x = 2,
+    WindowsNT = 3,
+    WindowsCE = 4,
+  };
+
+  enum OS_TYPE
+  {
+    Workstation = 0,
+    Server = 1,
+    DomainController = 2,
+  };
+
+  enum PROCESSOR_TYPE
+  {
+    UNKNOWN_PROCESSOR = 0,
+    INTEL_PROCESSOR = 1,
+    MIPS_PROCESSOR = 2,
+    ALPHA_PROCESSOR = 3,
+    PPC_PROCESSOR = 4,
+    IA64_PROCESSOR = 5,
+    AMD64_PROCESSOR = 6,
+    ALPHA64_PROCESSOR = 7,
+    MSIL_PROCESSOR = 8,
+    ARM_PROCESSOR = 9,
+    SHX_PROCESSOR = 10,
+  };
+
+//defines
+  typedef struct _OS_VERSION_INFO
+  {
+  #ifndef UNDER_CE
+    //What version of OS is being emulated
+    DWORD          dwEmulatedMajorVersion;
+    DWORD          dwEmulatedMinorVersion;
+    DWORD          dwEmulatedBuildNumber;
+    OS_PLATFORM    EmulatedPlatform;
+    PROCESSOR_TYPE EmulatedProcessorType; //The emulated processor type
+  #ifdef _WIN32                    
+    TCHAR          szEmulatedCSDVersion[128];
+  #else
+    char           szEmulatedCSDVersion[128];
+  #endif  
+    WORD           wEmulatedServicePackMajor;
+    WORD           wEmulatedServicePackMinor;
+  #endif
+
+    //What version of OS is really running                 
+    DWORD       dwUnderlyingMajorVersion;
+    DWORD       dwUnderlyingMinorVersion;
+    DWORD       dwUnderlyingBuildNumber;
+    OS_PLATFORM UnderlyingPlatform;   
+  #ifdef _WIN32                      
+    TCHAR       szUnderlyingCSDVersion[128];
+  #else  
+    char        szUnderlyingCSDVersion[128];
+  #endif  
+    WORD    wUnderlyingServicePackMajor;
+    WORD    wUnderlyingServicePackMinor;
+
+    DWORD          dwSuiteMask;             //Bitmask of various OS suites
+    OS_TYPE        OSType;                  //The basic OS type
+  #ifndef UNDER_CE
+    PROCESSOR_TYPE UnderlyingProcessorType; //The underlying processor type
+  #endif
+
+  #ifdef UNDER_CE
+    TCHAR szOEMInfo[256];
+    TCHAR szPlatformType[256];
+  #endif
+  } OS_VERSION_INFO, *POS_VERSION_INFO, FAR *LPOS_VERSION_INFO;
+
+//Constructors / Destructors
+  COSVersion(); 
+  ~COSVersion();
+
+//Methods:
+  BOOL GetVersion(LPOS_VERSION_INFO lpVersionInformation);
+                                 
+//Please note that the return values for all the following functions 
+//are mutually exclusive for example if you are running on 
+//95 OSR2 then IsWindows95 will return FALSE
+  BOOL IsWindows30(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindows31(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindows311(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindowsForWorkgroups(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindowsCE(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindows95(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindows95SP1(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindows95OSR2(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindows98(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindows98SP1(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindows98SE(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindowsME(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindowsNT31(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindowsNT35(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindowsNT351(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindowsNT4(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindows2000(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindowsXPOrWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation);
+
+//Returns the various flavours of the "os" that is installed. Note that these
+//functions are not completely mutually exlusive
+  BOOL IsWin32sInstalled(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsNTPreWin2k(LPOS_VERSION_INFO lpVersionInformation);
+
+  BOOL IsNTWorkstation(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsNTStandAloneServer(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsNTPDC(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsNTBDC(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsNTEnterpriseServer(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsNTDatacenterServer(LPOS_VERSION_INFO lpVersionInformation);
+
+  BOOL IsWin2000Professional(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWin2000Server(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWin2000AdvancedServer(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWin2000DatacenterServer(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWin2000DomainController(LPOS_VERSION_INFO lpVersionInformation);
+
+  BOOL IsXPPersonal(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsXPProfessional(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindowsXP(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWebWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsEnterpriseWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsDatacenterWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsDomainControllerWindowsServer2003(LPOS_VERSION_INFO lpVersionInformation);
+
+  BOOL IsTerminalServicesInstalled(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL ISSmallBusinessEditionInstalled(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsEmulated64Bit(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsUnderlying64Bit(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsEmbedded(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsTerminalServicesInRemoteAdminMode(LPOS_VERSION_INFO lpVersionInformation);
+  BOOL IsMediaCenterInstalled(LPOS_VERSION_INFO lpVersionInformation);
+
+protected:
+//Defines / typedefs
+#if (defined(_WINDOWS) || defined(_DOS)) && (!defined(_WIN32) && !defined(_WIN64))  
+  #define CPEX_DEST_STDCALL        0x00000000L
+  #define HKEY32                   DWORD                                                               
+  #define HKEY_LOCAL_MACHINE       (( HKEY32 ) 0x80000002 )    
+  #define TCHAR                    char
+  #define _T
+  #define _tcsicmp                 strcmpi
+  #define _tcscpy                  strcpy
+  #define _tcslen                  strlen
+  #define _istdigit                isdigit
+  #define _ttoi                    atoi
+  #define _tcsupr                  strupr
+  #define _tcsstr                  strstr
+  #define LPCTSTR                  LPCSTR
+  #define ERROR_CALL_NOT_IMPLEMENTED  120
+  #define REG_DWORD                ( 4 )                                                               
+  #define REG_MULTI_SZ             ( 7 )
+  #define VER_PLATFORM_WIN32s             0
+  #define VER_PLATFORM_WIN32_WINDOWS      1
+  #define VER_PLATFORM_WIN32_NT           2
+  #define VER_PLATFORM_WIN32_CE           3
+#endif                      
+                      
+#if defined(_WINDOWS) && !defined(_WIN32) && !defined(_WIN64)  
+//Defines / Macros
+  #define LPTSTR LPSTR
+
+  typedef struct OSVERSIONINFO
+  { 
+    DWORD dwOSVersionInfoSize; 
+    DWORD dwMajorVersion; 
+    DWORD dwMinorVersion; 
+    DWORD dwBuildNumber; 
+    DWORD dwPlatformId; 
+    char szCSDVersion[128]; 
+  } OSVERSIONINFO, *POSVERSIONINFO, FAR *LPOSVERSIONINFO; 
+
+  typedef struct _SYSTEM_INFO 
+  {
+    union 
+    {
+      DWORD dwOemId;          // Obsolete field...do not use
+      struct 
+      {
+        WORD wProcessorArchitecture;
+        WORD wReserved;
+      };
+    };
+    DWORD dwPageSize;
+    LPVOID lpMinimumApplicationAddress;
+    LPVOID lpMaximumApplicationAddress;
+    DWORD dwActiveProcessorMask;
+    DWORD dwNumberOfProcessors;
+    DWORD dwProcessorType;
+    DWORD dwAllocationGranularity;
+    WORD wProcessorLevel;
+    WORD wProcessorRevision;
+  } SYSTEM_INFO, *LPSYSTEM_INFO;
+
+  #define PROCESSOR_ARCHITECTURE_INTEL            0
+  #define PROCESSOR_ARCHITECTURE_MIPS             1
+  #define PROCESSOR_ARCHITECTURE_ALPHA            2
+  #define PROCESSOR_ARCHITECTURE_PPC              3
+  #define PROCESSOR_ARCHITECTURE_SHX              4
+  #define PROCESSOR_ARCHITECTURE_ARM              5
+  #define PROCESSOR_ARCHITECTURE_IA64             6
+  #define PROCESSOR_ARCHITECTURE_ALPHA64          7
+  #define PROCESSOR_ARCHITECTURE_MSIL             8
+  #define PROCESSOR_ARCHITECTURE_AMD64            9
+  #define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64    10
+  #define PROCESSOR_ARCHITECTURE_UNKNOWN          0xFFFF
+  
+//Methods
+  DWORD GetVersion();
+  BOOL GetVersionEx(LPOSVERSIONINFO lpVersionInfo);
+  void GetProcessorType(LPOS_VERSION_INFO lpVersionInformation);
+  LONG RegQueryValueEx(HKEY32 hKey, LPSTR  lpszValueName, LPDWORD lpdwReserved, LPDWORD lpdwType, LPBYTE  lpbData, LPDWORD lpcbData);
+  static BOOL WFWLoaded();                                     
+
+//Function Prototypes
+  typedef DWORD (FAR PASCAL  *lpfnLoadLibraryEx32W) (LPCSTR, DWORD, DWORD);
+  typedef BOOL  (FAR PASCAL  *lpfnFreeLibrary32W)   (DWORD);
+  typedef DWORD (FAR PASCAL  *lpfnGetProcAddress32W)(DWORD, LPCSTR);
+  typedef DWORD (FAR __cdecl *lpfnCallProcEx32W)    (DWORD, DWORD, DWORD, DWORD, ...);
+  typedef WORD  (FAR PASCAL  *lpfnWNetGetCaps)      (WORD);
+
+//Member variables
+  lpfnLoadLibraryEx32W  m_lpfnLoadLibraryEx32W;
+  lpfnFreeLibrary32W    m_lpfnFreeLibrary32W;
+  lpfnGetProcAddress32W m_lpfnGetProcAddress32W;
+  lpfnCallProcEx32W     m_lpfnCallProcEx32W;
+  DWORD                 m_hAdvApi32;    
+  DWORD                 m_hKernel32;
+  DWORD                 m_lpfnRegQueryValueExA;
+  DWORD                 m_lpfnGetVersionExA;
+  DWORD                 m_lpfnGetVersion;
+  DWORD                 m_lpfnGetSystemInfo;
+  DWORD                 m_lpfnGetNativeSystemInfo;
+#endif //defined(_WINDOWS) && (!defined(_WIN32) && !defined(_WIN64))
+
+#ifdef _WIN32
+//Function Prototypes
+  typedef BOOL (WINAPI *lpfnIsWow64Process)(HANDLE, PBOOL);  
+  typedef void (WINAPI *lpfnGetNativeSystemInfo)(LPSYSTEM_INFO);
+#endif
+
+#if defined(_WIN32) || defined(_WINDOWS)
+//Defines / Macros
+  typedef struct OSVERSIONINFOEX 
+  {  
+    DWORD dwOSVersionInfoSize;  
+    DWORD dwMajorVersion;  
+    DWORD dwMinorVersion;  
+    DWORD dwBuildNumber;  
+    DWORD dwPlatformId;  
+    TCHAR szCSDVersion[128];  
+    WORD wServicePackMajor;  
+    WORD wServicePackMinor;  
+    WORD wSuiteMask;  
+    BYTE wProductType;  
+    BYTE wReserved;
+  } OSVERSIONINFOEX, *POSVERSIONINFOEX, *LPOSVERSIONINFOEX;
+                  
+//Function Prototypes                  
+  typedef BOOL (WINAPI *lpfnGetVersionEx) (LPOSVERSIONINFO);  
+#endif  
+
+#ifndef _DOS         
+//Methods
+  void GetNTOSTypeFromRegistry(LPOS_VERSION_INFO lpVersionInformation, BOOL bOnlyUpdateDCDetails);
+  void GetProductSuiteDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation) ;
+  void GetTerminalServicesRemoteAdminModeDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation);
+  void GetMediaCenterDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation);
+  void GetNTSP6aDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation, BOOL bUpdateEmulatedAlso);
+  void GetXPSP1aDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation, BOOL bUpdateEmulatedAlso);
+  void GetNTHALDetailsFromRegistry(LPOS_VERSION_INFO lpVersionInformation);
+#else
+  BOOL GetInfoBySpawingWriteVer(COSVersion::LPOS_VERSION_INFO lpVersionInformation);
+  void GetWinInfo();
+#endif
+
+#if defined(_WIN32) || defined(_WIN64)
+  WORD GetNTServicePackFromRegistry();
+#endif    
+  WORD GetNTServicePackFromCSDString(LPCTSTR pszCSDVersion);
+};
+
+#endif //__DTWINVER_H__
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/HideDesktop.cpp b/ica/win32/winvnc/winvnc/HideDesktop.cpp
new file mode 100644
index 0000000..1fcd0e4
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/HideDesktop.cpp
@@ -0,0 +1,425 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// Functions to hide the Windows Desktop
+//
+// This hides three variants:
+//	- Desktop Patterns  (WIN.INI [Desktop] Pattern=)
+//	- Desktop Wallpaper (.bmp [and JPEG on Windows XP])
+//	- Active Desktop
+//
+// Written by Ed Hardebeck - Glance Networks, Inc.
+// With some code from Paul DiLascia, MSDN Magazine - May 2001
+//
+//	HideDesktop()		- hides the desktop
+//	RestoreDesktop()	- restore the desktop
+//
+
+#define WIN32_LEAN_AND_MEAN
+#include <shlwapi.h>
+#include <windows.h>
+#include <wininet.h> // Shell object uses INTERNET_MAX_URL_LENGTH (go figure)
+#if !__GNUC__ && _MSC_VER < 1400
+#define _WIN32_IE 0x0400
+#endif
+#include <tchar.h>
+#include <shlguid.h> // shell GUIDs
+#include <shlobj.h>  // IActiveDesktop
+#include "stdhdrs.h"
+
+struct __declspec(uuid("F490EB00-1240-11D1-9888-006097DEACF9")) IActiveDesktop;
+
+#define PACKVERSION(major,minor) MAKELONG(minor,major)
+
+DWORD GetDllVersion(LPCTSTR lpszDllName)
+{
+    HINSTANCE hinstDll;
+    DWORD dwVersion = 0;
+
+    hinstDll = LoadLibrary(lpszDllName);
+	
+    if(hinstDll)
+    {
+        DLLGETVERSIONPROC pDllGetVersion;
+
+        pDllGetVersion = (DLLGETVERSIONPROC) GetProcAddress(hinstDll, "DllGetVersion");
+
+		// Because some DLLs might not implement this function,
+		// test for it explicitly. Depending on the particular 
+		// DLL, the lack of a DllGetVersion function can be an
+		// indicator of the version.
+		
+        if (pDllGetVersion)
+        {
+            DLLVERSIONINFO	dvi;
+            HRESULT			hr;
+
+            ZeroMemory(&dvi, sizeof(dvi));
+            dvi.cbSize = sizeof(dvi);
+
+            hr = (*pDllGetVersion)(&dvi);
+
+            if(SUCCEEDED(hr))
+            {
+                dwVersion = PACKVERSION(dvi.dwMajorVersion, dvi.dwMinorVersion);
+            }
+        }
+        
+        FreeLibrary(hinstDll);
+    }
+    return dwVersion;
+}
+
+typedef void (CALLBACK * P_SHGetSettings)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
+
+BOOL SHDesktopHTML()
+{
+   // Determine if Active Desktop is enabled. SHGetSettings is apparently
+   // more reliable than IActiveDesktop::GetDesktopItemOptions, which can
+   // report incorrectly during the middle of ApplyChanges!
+   // Dynamically link to SHGetVersion so this can load on Windows with pre 4.71 shell
+
+	HINSTANCE	hinstDll;
+    BOOL		enabled = FALSE;
+
+    hinstDll = LoadLibrary("shell32.dll");
+	
+    if (hinstDll)
+    {
+	  P_SHGetSettings	pSHGetSettings;
+
+	  if ((pSHGetSettings = (P_SHGetSettings)GetProcAddress(hinstDll, "SHGetSettings")))
+	  {
+		SHELLFLAGSTATE	shfs;
+
+		(*pSHGetSettings)(&shfs, SSF_DESKTOPHTML);
+		enabled = shfs.fDesktopHTML;
+	  }
+
+	  FreeLibrary(hinstDll);
+	}
+
+	return enabled;
+}
+
+static 
+HRESULT EnableActiveDesktop(bool enable)
+{
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	CoInitialize(NULL);
+	CComQIPtr<IActiveDesktop, &IID_IActiveDesktop>	pIActiveDesktop;
+	
+	HRESULT		hr;
+
+	hr = pIActiveDesktop.CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER);
+	if (!SUCCEEDED(hr))
+		return hr;
+
+	COMPONENTSOPT	opt;
+
+	opt.dwSize = sizeof(opt);
+	opt.fActiveDesktop = opt.fEnableComponents = enable;
+    hr = pIActiveDesktop->SetDesktopItemOptions(&opt, 0);
+    if (!SUCCEEDED(hr))
+	{
+		CoUninitialize();
+		return hr;
+	}
+
+	hr = pIActiveDesktop->ApplyChanges(AD_APPLY_REFRESH);
+	CoUninitialize();
+	return hr;
+#else
+	return 0;
+#endif
+}
+
+bool HideActiveDesktop()
+{
+	// returns true if the Active Desktop was enabled and has been hidden
+
+	if (GetDllVersion(TEXT("shell32.dll")) >= PACKVERSION(4,71))
+		if (SHDesktopHTML())
+			return SUCCEEDED(EnableActiveDesktop(false));
+
+	return false;
+}
+
+void ShowActiveDesktop()
+{
+	if (GetDllVersion(TEXT("shell32.dll")) >= PACKVERSION(4,71))
+		EnableActiveDesktop(true);
+}
+		
+// OK, so this doesn't work in multiple threads or nest...
+static BOOL		ADWasEnabled = false;
+static BOOL		ISWallPaperHided = false;
+static TCHAR SCREENNAME[1024];
+
+// Added Jef Fix - 4 March 2008 jpaquette (paquette at atnetsend.net)
+static unsigned char WallpaperStyle[10] = {0}; // string "0" centered, "1" tiled, "2" stretched
+
+static const TCHAR * const DESKTOP_KEYNAME = _T("Control Panel\\Desktop");
+static const TCHAR * const DESKTOP_WALLPAPER_STYLE_KEYNAME = _T("WallpaperStyle");
+
+void SaveWallpaperStyle()
+{
+    HKEY hKey;
+
+    if (::RegOpenKeyEx(HKEY_CURRENT_USER, DESKTOP_KEYNAME, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
+    {
+        DWORD sz = sizeof WallpaperStyle;
+        ::RegQueryValueEx(hKey, DESKTOP_WALLPAPER_STYLE_KEYNAME, 0, 0, WallpaperStyle, &sz);
+        ::RegCloseKey(hKey);
+    }
+}
+
+void RestoreWallpaperStyle()
+{
+    HKEY hKey;
+
+    if (::RegOpenKeyEx(HKEY_CURRENT_USER, DESKTOP_KEYNAME, 0, KEY_WRITE, &hKey) == ERROR_SUCCESS)
+    {
+        DWORD sz = strlen((const char *)WallpaperStyle);
+        ::RegSetValueEx(hKey, DESKTOP_WALLPAPER_STYLE_KEYNAME, 0, REG_SZ, WallpaperStyle, sz);
+        ::RegCloseKey(hKey);
+    }
+}
+// -- end jdp
+
+
+void HideDesktop()
+{
+	// @@@efh Setting the desktop pattern via pvParam works, but is undocumented (except by www.winehq.com)
+	//SystemParametersInfo(SPI_SETDESKPATTERN, 0, "0 0 0 0 0 0 0 0", SPIF_SENDCHANGE);
+
+	// Tell all applications that there is no wallpaper
+	// Note that this doesn't change the wallpaper registry setting!
+	// @@@efh On Win98 and Win95 this returns an error in the debug build (but not in release)...
+	vnclog.Print(LL_INTWARN, VNCLOG("Killwallpaper %i\n"),ISWallPaperHided);
+	if (!ISWallPaperHided)
+	{
+		SaveWallpaperStyle(); // Added Jef Fix
+		SystemParametersInfo(SPI_GETDESKWALLPAPER,1024,SCREENNAME,0 );
+		SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (PVOID)"", SPIF_SENDCHANGE);
+		ADWasEnabled = HideActiveDesktop();
+		ISWallPaperHided=true;
+		vnclog.Print(LL_INTWARN, VNCLOG("Killwallpaper %i %i\n"),ISWallPaperHided,ADWasEnabled);
+	}
+	
+}
+
+void RestoreDesktop()
+{
+	vnclog.Print(LL_INTWARN, VNCLOG("Restorewallpaper %i\n"),ISWallPaperHided);
+	if (ISWallPaperHided)
+	{
+		vnclog.Print(LL_INTWARN, VNCLOG("Restorewallpaper %i %i\n"),ISWallPaperHided,ADWasEnabled);
+		if (ADWasEnabled)
+			ShowActiveDesktop();
+
+		SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, SCREENNAME, SPIF_SENDCHANGE);
+		RestoreWallpaperStyle(); // Added Jef Fix
+	}
+
+	ISWallPaperHided=false;
+}
+
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+// SPI_GETUIEFFECTS can enable/disable everything in one shot, but I'm sure we'll want finer control over this eventually.
+
+UINT spiParams[] = {
+	0x1024, //SPI_GETDROPSHADOW, 
+	SPI_GETCOMBOBOXANIMATION, 
+	SPI_GETMENUANIMATION, 
+	SPI_GETTOOLTIPANIMATION, 
+	SPI_GETSELECTIONFADE, 
+	SPI_GETLISTBOXSMOOTHSCROLLING, 
+	SPI_GETHOTTRACKING,
+	SPI_GETGRADIENTCAPTIONS,
+	0x1042, //SPI_GETCLIENTAREAANIMATION
+	0x1043, //SPI_GETDISABLEOVERLAPPEDCONTENT
+};
+
+
+UINT spiSuggested[] = {
+	FALSE,
+	FALSE,
+	FALSE,
+	FALSE,
+	FALSE,
+	FALSE,
+	FALSE,
+	FALSE,
+	FALSE,
+	FALSE,
+};
+
+BOOL spiValues[(sizeof(spiParams) / sizeof(spiParams[0]))];
+
+static bool g_bEffectsDisabled = false;
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+void DisableEffects()
+{
+	if (!g_bEffectsDisabled) {
+		g_bEffectsDisabled = true;
+
+		::ZeroMemory(spiValues, sizeof(spiValues));
+
+		for (size_t iParam = 0; iParam < (sizeof(spiParams) / sizeof(spiParams[0])); iParam++) {
+			if (!SystemParametersInfo(spiParams[iParam], 0, &(spiValues[iParam]), 0)) {
+				vnclog.Print(LL_INTWARN, VNCLOG("Failed to get SPI value for 0x%04x (0x%08x)\n"), spiParams[iParam], GetLastError());
+			} else {
+				vnclog.Print(LL_INTINFO, VNCLOG("Retrieved SPI value for 0x%04x: 0x%08x\n"), spiParams[iParam], spiValues[iParam]);
+			}
+		}
+		for (size_t iParam = 0; iParam < (sizeof(spiParams) / sizeof(spiParams[0])); iParam++) {
+			if (spiValues[iParam] != (BOOL) spiSuggested[iParam]) {
+				if (!SystemParametersInfo(spiParams[iParam]+1, 0, (PVOID)spiSuggested[iParam], SPIF_SENDCHANGE)) {				
+					vnclog.Print(LL_INTWARN, VNCLOG("Failed to set SPI value for 0x%04x to 0x%08x (0x%08x)\n"), spiParams[iParam]+1, spiSuggested[iParam], GetLastError());
+				} else {
+					vnclog.Print(LL_INTINFO, VNCLOG("Set SPI value for 0x%04x to 0x%08x\n"), spiParams[iParam]+1, spiSuggested[iParam]);
+				}
+			}
+		}
+	}
+}
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+void EnableEffects()
+{
+	if (g_bEffectsDisabled) {
+		for (size_t iParam = 0; iParam < (sizeof(spiParams) / sizeof(spiParams[0])); iParam++) {
+			if (spiValues[iParam] != (BOOL) spiSuggested[iParam]) {
+				if (!SystemParametersInfo(spiParams[iParam]+1, 0, (PVOID)spiValues[iParam], SPIF_SENDCHANGE)) {
+					vnclog.Print(LL_INTWARN, VNCLOG("Failed to restore SPI value for 0x%04x (0x%08x)\n"), spiParams[iParam]+1, GetLastError());
+				} else {
+					vnclog.Print(LL_INTINFO, VNCLOG("Restored SPI value for 0x%04x to 0x%08x\n"), spiParams[iParam]+1, spiValues[iParam]);
+				}
+			}
+		}
+
+		::ZeroMemory(spiValues, sizeof(spiValues));
+	}
+
+	g_bEffectsDisabled = false;
+}
+
+
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+//
+bool g_bDisabledFontSmoothing = false;
+
+bool g_bGotOldFontSmoothingValue = false;
+bool g_bGotFontSmoothingType = false;
+bool g_bGotClearType = false;
+BOOL g_bOldClearTypeValue = TRUE;
+BOOL g_bOldFontSmoothingValue = TRUE;
+UINT g_nOldFontSmoothingType = 0x0001; // FE_FONTSMOOTHINGSTANDARD
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+void DisableFontSmoothing()
+{
+	if (!g_bDisabledFontSmoothing) {
+		
+		if (!g_bGotOldFontSmoothingValue) {
+			// there appears to be a delay between setting the SPI_SETFONTSMOOTHING value and SPI_GETFONTSMOOTHING returning that up-to-date value.
+			if (!SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &g_bOldFontSmoothingValue, 0)) {
+				vnclog.Print(LL_INTWARN, VNCLOG("Failed to get SPI value for SPI_GETFONTSMOOTHING (0x%08x)\n"), GetLastError());
+				g_bGotOldFontSmoothingValue = false;
+			} else {
+				vnclog.Print(LL_INTINFO, VNCLOG("Retrieved SPI value for SPI_GETFONTSMOOTHING: 0x%08x\n"), g_bOldFontSmoothingValue);
+				g_bGotOldFontSmoothingValue = true;
+				
+				if (!SystemParametersInfo(0x200A /*SPI_GETFONTSMOOTHINGTYPE*/, 0, &g_nOldFontSmoothingType, 0)) {
+					vnclog.Print(LL_INTWARN, VNCLOG("Failed to get SPI value for SPI_GETFONTSMOOTHINGTYPE (0x%08x)\n"), GetLastError());
+					g_bGotFontSmoothingType = false;
+				} else {
+					vnclog.Print(LL_INTINFO, VNCLOG("Retrieved SPI value for SPI_GETFONTSMOOTHINGTYPE: 0x%08x\n"), g_nOldFontSmoothingType);
+					g_bGotFontSmoothingType = true;
+				}
+				
+				if (!SystemParametersInfo(0x1048 /*SPI_GETCLEARTYPE*/, 0, &g_bOldClearTypeValue, 0)) {
+					vnclog.Print(LL_INTWARN, VNCLOG("Failed to get SPI value for SPI_GETCLEARTYPE (0x%08x)\n"), GetLastError());
+					g_bGotClearType = false;
+				} else {
+					vnclog.Print(LL_INTINFO, VNCLOG("Retrieved SPI value for SPI_GETCLEARTYPE: 0x%08x\n"), g_bOldClearTypeValue);
+					g_bGotClearType = true;
+				}
+			}
+		}
+
+
+		if (g_bGotOldFontSmoothingValue && g_bOldFontSmoothingValue != FALSE) {
+			
+			if (g_bGotClearType && g_bOldClearTypeValue != FALSE) {
+				if (!SystemParametersInfo(0x1049 /*SPI_SETCLEARTYPE*/, 0, (PVOID)FALSE, SPIF_SENDCHANGE)) {				
+					vnclog.Print(LL_INTWARN, VNCLOG("Failed to set SPI value for SPI_SETCLEARTYPE (0x%08x)\n"), GetLastError());
+				} else {
+					g_bDisabledFontSmoothing = true; // ensure we reset even if SPI_SETFONTSMOOTHING fails for some reason
+					vnclog.Print(LL_INTINFO, VNCLOG("Set SPI value for SPI_SETCLEARTYPE: 0x%08x\n"), FALSE);
+				}
+			}
+
+			if (!SystemParametersInfo(SPI_SETFONTSMOOTHING, FALSE, NULL, SPIF_SENDCHANGE)) {				
+				vnclog.Print(LL_INTWARN, VNCLOG("Failed to set SPI value for SPI_SETFONTSMOOTHING (0x%08x)\n"), GetLastError());
+			} else {
+				g_bDisabledFontSmoothing = true;
+				vnclog.Print(LL_INTINFO, VNCLOG("Set SPI value for SPI_SETFONTSMOOTHING: 0x%08x\n"), FALSE);
+			}
+		}
+	}
+}
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+void EnableFontSmoothing()
+{
+	if (g_bDisabledFontSmoothing && g_bGotOldFontSmoothingValue) {
+		if (g_bOldFontSmoothingValue != FALSE) {
+			if (!SystemParametersInfo(SPI_SETFONTSMOOTHING, g_bOldFontSmoothingValue, NULL, SPIF_SENDCHANGE)) {				
+				vnclog.Print(LL_INTWARN, VNCLOG("Failed to restore SPI value for SPI_SETFONTSMOOTHING (0x%08x)\n"), GetLastError());
+			} else {
+				vnclog.Print(LL_INTINFO, VNCLOG("Restored SPI value for SPI_SETFONTSMOOTHING: 0x%08x\n"), g_bOldFontSmoothingValue);
+
+				if (g_bGotClearType) {
+					if (!SystemParametersInfo(0x1049 /*SPI_SETCLEARTYPE*/, 0, (PVOID)g_bOldClearTypeValue, SPIF_SENDCHANGE)) {				
+						vnclog.Print(LL_INTWARN, VNCLOG("Failed to restore SPI value for SPI_SETCLEARTYPE (0x%08x)\n"), GetLastError());
+					} else {
+						vnclog.Print(LL_INTINFO, VNCLOG("Restored SPI value for SPI_SETCLEARTYPE: 0x%08x\n"), g_bOldClearTypeValue);
+					}
+				}
+
+				if (g_bGotFontSmoothingType) {
+					if (!SystemParametersInfo(0x200B /*SPI_SETFONTSMOOTHINGTYPE*/, 0, (PVOID)g_nOldFontSmoothingType, SPIF_SENDCHANGE)) {				
+						vnclog.Print(LL_INTWARN, VNCLOG("Failed to restore SPI value for SPI_SETFONTSMOOTHINGTYPE (0x%08x)\n"), GetLastError());
+					} else {
+						vnclog.Print(LL_INTINFO, VNCLOG("Restored SPI value for SPI_SETFONTSMOOTHINGTYPE: 0x%08x\n"), g_nOldFontSmoothingType);
+					}
+				}
+			}
+		}
+	}
+
+	g_bDisabledFontSmoothing = false;
+}
diff --git a/ica/win32/winvnc/winvnc/HideDesktop.h b/ica/win32/winvnc/winvnc/HideDesktop.h
new file mode 100644
index 0000000..1744289
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/HideDesktop.h
@@ -0,0 +1,56 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+//
+// Functions to hide the Windows Desktop
+//
+// This hides three variants:
+//	- Desktop Patterns  (WIN.INI [Desktop] Pattern=)
+//	- Desktop Wallpaper (.bmp [and JPEG on Windows XP])
+//	- Active Desktop
+//
+// Written by Ed Hardebeck - Glance Networks, Inc.
+// With some code from Paul DiLascia, MSDN Magazine - May 2001
+//
+
+#ifndef _G_HIDEDESKTOP_H_
+#define _G_HIDEDESKTOP_H_
+
+// Everything
+
+void HideDesktop();				// hide it
+void RestoreDesktop();			// restore it  (warning: uses some global state set by HideDesktop)
+
+// Just the Active Desktop
+
+bool HideActiveDesktop();		// returns true if the Active Desktop was enabled and has been hidden
+void ShowActiveDesktop();		// show it always (if Shell version >= 4.71)
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+// UI Effects
+
+void DisableEffects();
+void EnableEffects();
+
+void DisableFontSmoothing();
+void EnableFontSmoothing();
+
+#endif
diff --git a/ica/win32/winvnc/winvnc/IPC.cpp b/ica/win32/winvnc/winvnc/IPC.cpp
new file mode 100644
index 0000000..ad75180
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/IPC.cpp
@@ -0,0 +1,200 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include <windows.h>
+#include <tchar.h>
+#include <crtdbg.h>
+
+#include "IPC.h"
+
+const static LPCTSTR g_szIPCSharedMMF = _T("{34F673E0-878F-11D5-B98A-00B0D07B8C7C}");
+const static LPCTSTR g_szIPCMutex = _T("{34F673E1-878F-11D5-B98A-00B0D07B8C7C}");
+int oldcounter=0;
+
+
+
+//***********************************************
+CIPC::CIPC() : m_hFileMap(NULL), m_hMutex(NULL)
+{
+	plist=NULL;
+	m_FileView=0;
+	CreateIPCMMF();
+	OpenIPCMMF();
+}
+
+//***********************************************
+CIPC::~CIPC()
+{
+	CloseIPCMMF();
+	Unlock();
+}
+
+//***********************************************
+bool CIPC::CreateIPCMMF(void)
+{
+	bool bCreated = false;
+
+	try
+	{
+		if(m_hFileMap != NULL)
+			return false;	// Already created
+
+		// Create an in-memory 4KB memory mapped file to share data
+		m_hFileMap = CreateFileMapping((HANDLE)0xFFFFFFFF,
+			NULL,
+			PAGE_READWRITE,
+			0,
+			sizeof(list),
+			g_szIPCSharedMMF);
+		if(m_hFileMap != NULL)
+			bCreated = true;
+	}
+	catch(...) {}
+
+	return bCreated;
+}
+
+//***********************************************
+bool CIPC::OpenIPCMMF(void)
+{
+	bool bOpened = false;
+
+	try
+	{
+		if(m_hFileMap == NULL)
+		{
+
+		m_hFileMap = OpenFileMapping(FILE_MAP_READ | FILE_MAP_WRITE,
+			FALSE,
+			g_szIPCSharedMMF);
+		}
+
+		if(m_hFileMap != NULL)
+		{
+			bOpened = true;
+			m_FileView = MapViewOfFile(m_hFileMap,
+			FILE_MAP_READ | FILE_MAP_WRITE,
+			0, 0, 0);
+			if (m_FileView==0) bOpened = false;
+			plist=(mystruct*) m_FileView;
+
+		}
+	}
+	catch(...) {}
+
+	return bOpened;
+}
+
+//***********************************************
+void CIPC::CloseIPCMMF(void)
+{
+	try
+	{
+		if (m_FileView) UnmapViewOfFile(m_FileView);
+		if(m_hFileMap != NULL)
+			CloseHandle(m_hFileMap), m_hFileMap = NULL;
+	}
+	catch(...) {}
+}
+
+//***********************************************
+void CIPC::Addrect(int type, int x1, int y1, int x2, int y2,int x11,int y11, int x22,int y22)
+{
+	if (plist==NULL) return;
+	if (plist->locked==1) 
+	{
+		return;
+	}
+	int counter=plist->counter;
+	plist->locked=1;
+	counter++;
+	if (counter>1999) counter=1;
+	plist->rect1[counter].left=x1;
+	plist->rect1[counter].right=x2;
+	plist->rect1[counter].top=y1;
+	plist->rect1[counter].bottom=y2;
+	plist->rect2[counter].left=x11;
+	plist->rect2[counter].right=x22;
+	plist->rect2[counter].top=y11;
+	plist->rect2[counter].bottom=y22;
+	plist->type[counter]=type;
+	plist->locked=0;
+	plist->counter=counter;
+}
+
+void CIPC::Addcursor(ULONG cursor)
+{
+	if (plist==NULL) return;
+	if (plist->locked==1) 
+	{
+		return;
+	}
+	int counter=plist->counter;
+	plist->locked=1;
+	counter++;
+	if (counter>1999) counter=1;
+	plist->type[counter]=1;
+	plist->locked=0;
+	plist->counter=counter;
+}
+
+mystruct* CIPC::listall()
+{
+	return plist;
+}
+//***********************************************
+bool CIPC::Lock(void)
+{
+	bool bLocked = false;
+
+	try
+	{
+		// First get the handle to the mutex
+		m_hMutex = CreateMutex(NULL, FALSE, g_szIPCMutex);
+		if(m_hMutex != NULL)
+		{
+			// Wait to get the lock on the mutex
+			if(WaitForSingleObject(m_hMutex, INFINITE) == WAIT_OBJECT_0)
+				bLocked = true;
+		}
+	}
+	catch(...) {}
+
+	return bLocked;
+}
+
+//***********************************************
+void CIPC::Unlock(void)
+{
+	try
+	{
+		if(m_hMutex != NULL)
+		{
+			ReleaseMutex(m_hMutex);
+			CloseHandle(m_hMutex);
+			m_hMutex = NULL;
+		}
+	}
+	catch(...) {}
+}
diff --git a/ica/win32/winvnc/winvnc/IPC.h b/ica/win32/winvnc/winvnc/IPC.h
new file mode 100644
index 0000000..c8ce6de
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/IPC.h
@@ -0,0 +1,62 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+struct mystruct
+{
+	short counter;
+	short locked;
+	RECT rect1[2000];
+	RECT rect2[2000];
+	short type[2000];
+//	ULONG cursor[2000];
+};
+
+// Class for Inter Process Communication using Memory Mapped Files
+class CIPC
+{
+public:
+	CIPC();
+	virtual ~CIPC();
+
+	bool CreateIPCMMF(void);
+	bool OpenIPCMMF(void);
+	void CloseIPCMMF(void);
+	mystruct*  listall();
+
+	bool IsOpen(void) const {return (m_hFileMap != NULL);}
+
+	bool Lock(void);
+	void Unlock(void);
+	void Addrect(int type, int x1, int y1, int x2, int y2,int x11,int y11, int x22,int y22);
+	void Addcursor(ULONG cursor);
+
+protected:
+	HANDLE m_hFileMap;
+	HANDLE m_hMutex;
+	LPVOID m_FileView;
+	mystruct list;
+	mystruct *plist;
+};
diff --git a/ica/win32/winvnc/winvnc/Localization.h b/ica/win32/winvnc/winvnc/Localization.h
new file mode 100644
index 0000000..e72fa62
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/Localization.h
@@ -0,0 +1,202 @@
+
+
+// For translating all messages
+// find and translate all MessageBox                          -- done
+// find and translate all MsgBox                              -- done
+// find and translate all sendMessage with strings            -- done
+// find and copy here and delete all messages string const    -- done
+// find and translate all SetWindowText                       -- done
+// find and translate all SetDlgItemText                      -- done
+
+// All VNCLOG messages are NOT translated for now
+
+
+#ifdef LOCALIZATION_MESSAGES
+
+// LOCALIZATION_MESSAGES is only declare in winvnc.cpp
+
+char sz_ID_FAILED_INIT[64];  //    "Failed to initialise the socket system"
+char sz_ID_WINVNC_USAGE[64];  //   "WinVNC Usage"
+char sz_ID_ANOTHER_INST[64];  //   "Another instance of WinVNC is already running"
+char sz_ID_NO_EXIST_INST[64];  // "No existing instance of WinVNC could be contacted"
+char sz_ID_UNABLE_INST[64];  //    "Unable to install WinVNC service"
+char sz_ID_SCM_NOT_HERE[128];  // "The SCM could not be contacted - the WinVNC service was not installed"
+char sz_ID_SERV_NOT_REG[64];   // "The WinVNC service could not be registered"
+char sz_ID_SERV_FAIL_ST[64];  //   "The WinVNC service failed to start"
+char sz_ID_SERV_CT_MISS[128];  // "The Service Control Manager could not be contacted - the WinVNC service was not registered"
+char sz_ID_SERV_OLD_REG[64];  //   "The WinVNC service is already registered"
+char sz_ID_SERVHELP_UNAB[128]; // "WARNING:Unable to install the ServiceHelper hook\nGlobal user-specific registry settings will not be loaded"
+char sz_ID_SERV_CT_UNREG[128]; // "The Service Control Manager could not be contacted - the WinVNC service was not unregistered"
+char sz_ID_SERV_NOT_UNRG[64];  //  "The WinVNC service could not be unregistered"
+char sz_ID_SERV_NCONTACT[64];  //  "The WinVNC service could not be contacted"
+char sz_ID_SERVHELP_NREM[126]; // "WARNING:The ServiceHelper hook entry could not be removed from the registry"
+char sz_ID_SERV_NOT_STOP[64];  //  "The WinVNC service could not be stopped"
+char sz_ID_SERV_MK_UNREG[64];  // "The WinVNC service is already marked to be unregistered"
+char sz_ID_SERV_NT_FOUND[64];
+char sz_ID_WINVNC_ERROR[64];
+char sz_ID_WINVNC_WARNIN[64];  //  "WinVNC Warning"
+char sz_ID_PLUGIN_LOADIN[64];  //  "Plugin Loading"
+char sz_ID_NO_PASSWD_NO_OVERRIDE_ERR[200];
+char sz_ID_NO_PASSWD_NO_OVERRIDE_WARN[160];
+char sz_ID_NO_PASSWD_NO_LOGON_WARN [140]; // "WARNING : This machine has no default password set.  WinVNC will present the Default Properties dialog now to allow one to be entered.";
+char sz_ID_NO_OVERRIDE_ERR [200];
+char sz_ID_NO_CURRENT_USER_ERR [128]; // = "The WinVNC settings for the current user are unavailable at present.";
+char sz_ID_CANNOT_EDIT_DEFAULT_PREFS [128]; // = "You do not have sufficient priviliges to edit the default local WinVNC settings.";
+char sz_ID_NO_PASSWORD_WARN [200]; 
+char sz_ID_PLUGIN_NOT_LOAD [200]; //  "The Plugin cannot be loaded.\n\rPlease check its integrity.";
+char sz_ID_MB1 [10]; //  "MB1";
+char sz_ID_WVNC [10]; //  "WVNC";
+char sz_ID_AUTHAD_NOT_FO [128]; //  "You selected ms-logon, but the authad.dll\nwas not found.Check you installation"
+char sz_ID_WARNING [64] ; //  "WARNING";
+char sz_ID_AUTH_NOT_FO [128]; //    "You selected ms-logon, but the auth.dll\nwas not found.Check you installation";
+char sz_ID_DESKTOP_BITBLT_ROOT [128]; //   "vncDesktop : root device doesn't support BitBlt\n"       "WinVNC cannot be used with this graphic device driver";
+char sz_ID_DESKTOP_BITBLT_MEM [128];  //   "vncDesktop : memory device doesn't support GetDIBits\n"  "WinVNC cannot be used with this graphics device driver";
+char sz_ID_DESKTOP_PLANAR_NOTC [128]; //   "vncDesktop : current display is PLANAR, not CHUNKY!\n"   "WinVNC cannot be used with this graphics device driver";
+char sz_ID_FAILED_CONNECT_LISTING_VIEW [64]; //  "Failed to connect to listening VNC viewer";
+char sz_ID_OUTGOING_CONNECTION [64] ; //  "Outgoing Connection";
+char sz_ID_UNABLE_PROC_MSLOGON [64]; //  "Unable to process MS logon";
+char sz_ID_RICHED32_UNLOAD [64]; //  "Unable to load the Rich Edit (RICHED32.DLL) control!";
+char sz_ID_RICHED32_DLL_LD [64]; //  "Rich Edit Dll Loading";
+char sz_ID_SERV_SUCCESS_INST[200];
+char sz_ID_SERV_SUCCESS_REG[200];
+char sz_ID_SERV_SUCCESS_UNREG[64]; //    "The WinVNC service has been unregistered";
+char sz_ID_ULTRAVNC_TEXTCHAT[128]; // "The selected client is not an Ultr at VNC Viewer !\n"	"It presumably does not support TextChat\n";
+char sz_ID_ULTRAVNC_WARNING [64]; //     "Ultr at VNC Warning";
+char sz_ID_NO_PLUGIN_DETECT [64]; // "No Plugin detected..."
+
+char sz_ID_CHAT_WITH_S_ULTRAVNC [64]; //   " Chat with <%s> - Ultr at VNC"
+char sz_ID_CURRENT_USER_PROP [64]; //   "WinVNC: Current User Properties"
+char sz_ID_DEFAULT_SYST_PROP [64]; //  "WinVNC: Default Local System Properties"
+char sz_ID_AUTOREJECT_U [64] ; //  "AutoReject:%u"
+char sz_ID_AUTOACCEPT_U [64] ; //  "AutoAccept:%u"
+char sz_ID_CADERROR [128];
+char sz_ID_CADERRORFILE [128];
+char sz_ID_CADPERMISSION [128];
+
+
+int Load_Localization(HINSTANCE hInstance) 
+{
+
+   LoadString(hInstance, ID_FAILED_INIT, sz_ID_FAILED_INIT, 64 -1); 
+   LoadString(hInstance, ID_WINVNC_USAGE, sz_ID_WINVNC_USAGE, 64 -1); 
+   LoadString(hInstance, ID_ANOTHER_INST, sz_ID_ANOTHER_INST, 64 -1); 
+   LoadString(hInstance, ID_NO_EXIST_INST, sz_ID_NO_EXIST_INST, 64 -1);
+   LoadString(hInstance, ID_UNABLE_INST, sz_ID_UNABLE_INST, 64 -1); 
+   LoadString(hInstance, ID_SCM_NOT_HERE, sz_ID_SCM_NOT_HERE, 128 -1); 
+   LoadString(hInstance, ID_SERV_NOT_REG, sz_ID_SERV_NOT_REG, 64 -1); 
+   LoadString(hInstance, ID_SERV_FAIL_ST, sz_ID_SERV_FAIL_ST, 64 -1); 
+   LoadString(hInstance, ID_SERV_CT_MISS, sz_ID_SERV_CT_MISS, 128 -1); 
+   LoadString(hInstance, ID_SERV_OLD_REG, sz_ID_SERV_OLD_REG, 64 -1); 
+   LoadString(hInstance, ID_SERVHELP_UNAB, sz_ID_SERVHELP_UNAB, 128 -1); 
+   LoadString(hInstance, ID_SERV_CT_UNREG, sz_ID_SERV_CT_UNREG, 128 -1); 
+   LoadString(hInstance, ID_SERV_NOT_UNRG, sz_ID_SERV_NOT_UNRG, 64 -1);  
+   LoadString(hInstance, ID_SERV_NCONTACT, sz_ID_SERV_NCONTACT, 64 -1); 
+   LoadString(hInstance, ID_SERVHELP_NREM, sz_ID_SERVHELP_NREM, 126 -1); 
+   LoadString(hInstance, ID_SERV_NOT_STOP, sz_ID_SERV_NOT_STOP, 64 -1);  
+   LoadString(hInstance, ID_SERV_MK_UNREG, sz_ID_SERV_MK_UNREG, 64 -1); 
+   LoadString(hInstance, ID_SERV_NT_FOUND, sz_ID_SERV_NT_FOUND, 64 -1);
+   LoadString(hInstance, ID_WINVNC_ERROR, sz_ID_WINVNC_ERROR, 64 -1);
+   LoadString(hInstance, ID_WINVNC_WARNIN, sz_ID_WINVNC_WARNIN, 64 -1); 
+   LoadString(hInstance, ID_PLUGIN_LOADIN, sz_ID_PLUGIN_LOADIN, 64 -1); 
+   LoadString(hInstance, ID_NO_PASSWD_NO_OVERRIDE_ERR, sz_ID_NO_PASSWD_NO_OVERRIDE_ERR, 200 -1);
+   LoadString(hInstance, ID_NO_PASSWD_NO_OVERRIDE_WARN, sz_ID_NO_PASSWD_NO_OVERRIDE_WARN, 160 -1);
+   LoadString(hInstance, ID_NO_PASSWD_NO_LOGON_WARN, sz_ID_NO_PASSWD_NO_LOGON_WARN , 140 -1); 
+   LoadString(hInstance, ID_NO_OVERRIDE_ERR, sz_ID_NO_OVERRIDE_ERR , 200 -1);
+   LoadString(hInstance, ID_NO_CURRENT_USER_ERR, sz_ID_NO_CURRENT_USER_ERR , 128 -1);
+   LoadString(hInstance, ID_CANNOT_EDIT_DEFAULT_PREFS, sz_ID_CANNOT_EDIT_DEFAULT_PREFS , 128 -1); 
+   LoadString(hInstance, ID_NO_PASSWORD_WARN, sz_ID_NO_PASSWORD_WARN , 200 -1); 
+   LoadString(hInstance, ID_PLUGIN_NOT_LOAD, sz_ID_PLUGIN_NOT_LOAD , 200 -1);
+   LoadString(hInstance, ID_MB1, sz_ID_MB1 , 10 -1); 
+   LoadString(hInstance, ID_WVNC, sz_ID_WVNC , 10 -1); 
+   LoadString(hInstance, ID_AUTHAD_NOT_FO, sz_ID_AUTHAD_NOT_FO , 128 -1); 
+   LoadString(hInstance, ID_WARNING, sz_ID_WARNING , 64 -1) ; 
+   LoadString(hInstance, ID_AUTH_NOT_FO, sz_ID_AUTH_NOT_FO , 128 -1);
+   LoadString(hInstance, ID_DESKTOP_BITBLT_ROOT, sz_ID_DESKTOP_BITBLT_ROOT , 128 -1);
+   LoadString(hInstance, ID_DESKTOP_BITBLT_MEM, sz_ID_DESKTOP_BITBLT_MEM , 128 -1);
+   LoadString(hInstance, ID_DESKTOP_PLANAR_NOTC, sz_ID_DESKTOP_PLANAR_NOTC , 128 -1); 
+   LoadString(hInstance, ID_FAILED_CONNECT_LISTING_VIEW, sz_ID_FAILED_CONNECT_LISTING_VIEW , 64 -1);
+   LoadString(hInstance, ID_OUTGOING_CONNECTION, sz_ID_OUTGOING_CONNECTION , 64 -1); 
+   LoadString(hInstance, ID_UNABLE_PROC_MSLOGON, sz_ID_UNABLE_PROC_MSLOGON , 64 -1);
+   LoadString(hInstance, ID_RICHED32_UNLOAD, sz_ID_RICHED32_UNLOAD , 64 -1); 
+   LoadString(hInstance, ID_RICHED32_DLL_LD, sz_ID_RICHED32_DLL_LD , 64 -1); 
+   LoadString(hInstance, ID_SERV_SUCCESS_INST, sz_ID_SERV_SUCCESS_INST, 200 -1);
+   LoadString(hInstance, ID_SERV_SUCCESS_REG, sz_ID_SERV_SUCCESS_REG, 200 -1);
+   LoadString(hInstance, ID_SERV_SUCCESS_UNREG, sz_ID_SERV_SUCCESS_UNREG, 64 -1); 
+   LoadString(hInstance, ID_ULTRAVNC_TEXTCHAT, sz_ID_ULTRAVNC_TEXTCHAT, 128 -1); 
+   LoadString(hInstance, ID_ULTRAVNC_WARNING, sz_ID_ULTRAVNC_WARNING , 64 -1); 
+   LoadString(hInstance, ID_NO_PLUGIN_DETECT, sz_ID_NO_PLUGIN_DETECT , 64 -1); 
+   LoadString(hInstance, ID_CHAT_WITH_S_ULTRAVNC, sz_ID_CHAT_WITH_S_ULTRAVNC, 64 -1);
+   LoadString(hInstance, ID_CURRENT_USER_PROP, sz_ID_CURRENT_USER_PROP, 64 -1); 
+   LoadString(hInstance, ID_DEFAULT_SYST_PROP, sz_ID_DEFAULT_SYST_PROP, 64 -1); 
+   LoadString(hInstance, ID_AUTOREJECT_U, sz_ID_AUTOREJECT_U, 64 -1);
+   LoadString(hInstance, ID_AUTOACCEPT_U, sz_ID_AUTOACCEPT_U, 64 -1);
+   LoadString(hInstance, ID_CADERROR, sz_ID_CADERROR , 128 -1);
+   LoadString(hInstance, ID_CADERROR, sz_ID_CADERRORFILE , 128 -1);
+   LoadString(hInstance, ID_CADERROR, sz_ID_CADPERMISSION , 128 -1);
+
+
+  return 0;
+}
+
+#else
+
+extern char sz_ID_FAILED_INIT[64];  //    "Failed to initialise the socket system"
+extern char sz_ID_WINVNC_USAGE[64];  //   "WinVNC Usage"
+extern char sz_ID_ANOTHER_INST[64];  //   "Another instance of WinVNC is already running"
+extern char sz_ID_NO_EXIST_INST[64];  // "No existing instance of WinVNC could be contacted"
+extern char sz_ID_UNABLE_INST[64];  //    "Unable to install WinVNC service"
+extern char sz_ID_SCM_NOT_HERE[128];  // "The SCM could not be contacted - the WinVNC service was not installed"
+extern char sz_ID_SERV_NOT_REG[64];   // "The WinVNC service could not be registered"
+extern char sz_ID_SERV_FAIL_ST[64];  //   "The WinVNC service failed to start"
+extern char sz_ID_SERV_CT_MISS[128];  // "The Service Control Manager could not be contacted - the WinVNC service was not registered"
+extern char sz_ID_SERV_OLD_REG[64];  //   "The WinVNC service is already registered"
+extern char sz_ID_SERVHELP_UNAB[128]; // "WARNING:Unable to install the ServiceHelper hook\nGlobal user-specific registry settings will not be loaded"
+extern char sz_ID_SERV_CT_UNREG[128]; // "The Service Control Manager could not be contacted - the WinVNC service was not unregistered"
+extern char sz_ID_SERV_NOT_UNRG[64];  //  "The WinVNC service could not be unregistered"
+extern char sz_ID_SERV_NCONTACT[64];  //  "The WinVNC service could not be contacted"
+extern char sz_ID_SERVHELP_NREM[126]; // "WARNING:The ServiceHelper hook entry could not be removed from the registry"
+extern char sz_ID_SERV_NOT_STOP[64];  //  "The WinVNC service could not be stopped"
+extern char sz_ID_SERV_MK_UNREG[64];  // "The WinVNC service is already marked to be unregistered"
+extern char sz_ID_SERV_NT_FOUND[64];
+extern char sz_ID_WINVNC_ERROR[64];
+extern char sz_ID_WINVNC_WARNIN[64];  //  "WinVNC Warning"
+extern char sz_ID_PLUGIN_LOADIN[64];  //  "Plugin Loading"
+extern char sz_ID_NO_PASSWD_NO_OVERRIDE_ERR[200];
+extern char sz_ID_NO_PASSWD_NO_OVERRIDE_WARN[160];
+extern char sz_ID_NO_PASSWD_NO_LOGON_WARN [140]; // "WARNING : This machine has no default password set.  WinVNC will present the Default Properties dialog now to allow one to be entered.";
+extern char sz_ID_NO_OVERRIDE_ERR [200];
+extern char sz_ID_NO_CURRENT_USER_ERR [128]; // = "The WinVNC settings for the current user are unavailable at present.";
+extern char sz_ID_CANNOT_EDIT_DEFAULT_PREFS [128]; // = "You do not have sufficient priviliges to edit the default local WinVNC settings.";
+extern char sz_ID_NO_PASSWORD_WARN [200]; 
+extern char sz_ID_PLUGIN_NOT_LOAD [200]; //  "The Plugin cannot be loaded.\n\rPlease check its integrity.";
+extern char sz_ID_MB1 [10]; //  "MB1";
+extern char sz_ID_WVNC [10]; //  "WVNC";
+extern char sz_ID_AUTHAD_NOT_FO [128]; //  "You selected ms-logon, but the authad.dll\nwas not found.Check you installation"
+extern char sz_ID_WARNING [64] ; //  "WARNING";
+extern char sz_ID_AUTH_NOT_FO [128]; //    "You selected ms-logon, but the auth.dll\nwas not found.Check you installation";
+extern char sz_ID_DESKTOP_BITBLT_ROOT [128]; //   "vncDesktop : root device doesn't support BitBlt\n"       "WinVNC cannot be used with this graphic device driver";
+extern char sz_ID_DESKTOP_BITBLT_MEM [128];  //   "vncDesktop : memory device doesn't support GetDIBits\n"  "WinVNC cannot be used with this graphics device driver";
+extern char sz_ID_DESKTOP_PLANAR_NOTC [128]; //   "vncDesktop : current display is PLANAR, not CHUNKY!\n"   "WinVNC cannot be used with this graphics device driver";
+extern char sz_ID_FAILED_CONNECT_LISTING_VIEW [64]; //  "Failed to connect to listening VNC viewer";
+extern char sz_ID_OUTGOING_CONNECTION [64] ; //  "Outgoing Connection";
+extern char sz_ID_UNABLE_PROC_MSLOGON [64]; //  "Unable to process MS logon";
+extern char sz_ID_RICHED32_UNLOAD [64]; //  "Unable to load the Rich Edit (RICHED32.DLL) control!";
+extern char sz_ID_RICHED32_DLL_LD [64]; //  "Rich Edit Dll Loading";
+extern char sz_ID_SERV_SUCCESS_INST[200];
+extern char sz_ID_SERV_SUCCESS_REG[200];
+extern char sz_ID_SERV_SUCCESS_UNREG[64]; //    "The WinVNC service has been unregistered";
+extern char sz_ID_ULTRAVNC_TEXTCHAT[128]; // "The selected client is not an Ultr at VNC Viewer !\n"	"It presumably does not support TextChat\n";
+extern char sz_ID_ULTRAVNC_WARNING [64]; //     "Ultr at VNC Warning";
+
+extern char sz_ID_NO_PLUGIN_DETECT [64]; // "No Plugin detected..."
+
+extern char sz_ID_CHAT_WITH_S_ULTRAVNC [64]; //   " Chat with <%s> - Ultr at VNC"
+extern char sz_ID_CURRENT_USER_PROP [64]; //   "WinVNC: Current User Properties"
+extern char sz_ID_DEFAULT_SYST_PROP [64]; //  "WinVNC: Default Local System Properties"
+extern char sz_ID_AUTOREJECT_U [64] ; //  "AutoReject:%u"
+extern char sz_ID_AUTOACCEPT_U [64] ; //  "AutoReject:%u"
+extern char sz_ID_CADERROR [128];
+extern char sz_ID_CADERRORFILE [128];
+extern char sz_ID_CADPERMISSION [128];
+
+#endif
diff --git a/ica/win32/winvnc/winvnc/TextChat.cpp b/ica/win32/winvnc/winvnc/TextChat.cpp
new file mode 100644
index 0000000..183e003
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/TextChat.cpp
@@ -0,0 +1,852 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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://www.uvnc.com/
+
+#include "stdhdrs.h"
+#include "resource.h"
+#include "vncclient.h"
+#include "vncserver.h"
+#include "TextChat.h"
+#include "commctrl.h"
+#include "richedit.h"
+#include "common/win32_helpers.h"
+
+#include "Localization.h" // Act : add localization on messages
+
+#define TEXTMAXSIZE 16384
+#define MAXNAMESIZE	128 // MAX_COMPUTERNAME_LENGTH+1 (32)
+#define CHAT_OPEN  -1  // Todo; put these codes in rfbproto.h
+#define CHAT_CLOSE -2
+#define CHAT_FINISHED -3
+
+//	[v1.0.2-jp1 fix]
+LRESULT CALLBACK SBProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+LONG pDefSBProc=NULL;
+extern HINSTANCE	hInstResDLL;
+
+extern HINSTANCE	hAppInstance;
+
+//
+//
+//
+#include <mmsystem.h>
+BOOL PlayResource(LPSTR lpName)
+{
+    /*BOOL bRtn;
+    LPSTR lpRes;
+    HANDLE hRes;
+    HRSRC hResInfo;
+
+    // Find the WAVE resource. 
+    hResInfo= FindResource(hAppInstance,MAKEINTRESOURCE(IDR_WAVE1),"WAVE");
+    if(hResInfo == NULL)
+       return FALSE;
+    // Load the WAVE resource. 
+
+    hRes = LoadResource(hAppInstance,hResInfo);
+    if (hRes == NULL)
+      return FALSE;
+
+    // Lock the WAVE resource and play it. 
+    lpRes=(LPSTR)LockResource(hRes);
+    if(lpRes==NULL)
+      return FALSE;
+
+    bRtn = sndPlaySound(lpRes, SND_MEMORY | SND_SYNC);
+    if(bRtn == NULL)
+      return FALSE;
+
+    // Free the WAVE resource and return success or failure. 
+    FreeResource(hRes);
+    return TRUE;*/
+
+	char szWavFile[MAX_PATH]; //PGM 
+
+	if (GetModuleFileName(NULL, szWavFile, MAX_PATH)) //PGM 
+
+	{ // PGM 
+
+		char* p = strrchr(szWavFile, '\\'); //PGM 
+
+		*p = '\0'; //PGM 
+
+		strcat(szWavFile,"\\"); //PGM 
+
+	} //PGM 
+
+	strcat(szWavFile,"ding_dong.wav"); //PGM 
+
+	if(::PlaySound(szWavFile, NULL, SND_APPLICATION | SND_FILENAME | SND_ASYNC | SND_NOWAIT)!= ERROR_SUCCESS) //PGM
+
+		return FALSE; //PGM 
+
+	else //PGM 
+
+		return TRUE; //PGM 
+
+}
+
+///////////////////////////////////////////////////////
+TextChat::TextChat(vncClient *pCC)
+{
+	m_hDlg=NULL;
+	m_pCC = pCC;
+	m_fTextChatRunning = false;
+	
+	m_fPersistentTexts = false;
+	m_szLocalText = new char [TEXTMAXSIZE]; // Text (message) entered by local user
+	memset(m_szLocalText, 0, TEXTMAXSIZE);
+	m_szLastLocalText = new char [TEXTMAXSIZE]; // Last local text (no more necessary)
+	memset(m_szLastLocalText, 0, TEXTMAXSIZE);
+	m_szRemoteText = new char [TEXTMAXSIZE]; // Incoming remote text (remote message)
+	memset(m_szRemoteText, 0, TEXTMAXSIZE);
+	m_szRemoteName = new char[MAXNAMESIZE]; // Name of remote machine
+	memset(m_szRemoteName,0,MAXNAMESIZE);
+	m_szLocalName =  new char[MAXNAMESIZE]; // Name of local machine
+	memset(m_szLocalName,0,MAXNAMESIZE);
+
+	m_szTextBoxBuffer = new char[TEXTMAXSIZE]; // History Text (containing all chat messages from everybody)
+	memset(m_szTextBoxBuffer,0,TEXTMAXSIZE);
+
+	// memset(m_szUserID, 0, 16);	// Short User ID (name, pseudo...whatever) that replace 
+								// the local computer name/IP
+
+	unsigned long pcSize=MAXNAMESIZE;
+	if (GetComputerName(m_szLocalName, &pcSize))
+	{
+		if( pcSize >= MAXNAMESIZE)
+		{
+			m_szLocalName[MAXNAMESIZE-4]='.';
+			m_szLocalName[MAXNAMESIZE-3]='.';
+			m_szLocalName[MAXNAMESIZE-2]='.';
+			m_szLocalName[MAXNAMESIZE-1]=0x00;
+		}
+	}
+	
+	//  Load the Rich Edit control DLL
+	m_hRichEdit = LoadLibrary( "RICHED32.DLL" );
+	if (!m_hRichEdit)
+	{  
+		MessageBoxSecure( NULL, sz_ID_RICHED32_UNLOAD,
+					sz_ID_RICHED32_DLL_LD, MB_OK | MB_ICONEXCLAMATION );
+		// Todo: do normal edit instead (no colors)
+	}
+    m_Thread = INVALID_HANDLE_VALUE;
+}
+
+
+//
+//
+//
+TextChat::~TextChat()
+{
+	if (m_szLocalText != NULL) delete [] m_szLocalText;
+	if (m_szLastLocalText != NULL) delete [] m_szLastLocalText;
+	if (m_szRemoteText != NULL) delete [] m_szRemoteText;
+	if (m_szRemoteName != NULL) delete [] m_szRemoteName;
+	if (m_szLocalName != NULL) delete [] m_szLocalName;
+	if (m_szTextBoxBuffer != NULL) delete [] m_szTextBoxBuffer;
+
+	m_fTextChatRunning = false;
+	if (m_hDlg!=NULL) SendMessage(m_hDlg, WM_COMMAND, IDCANCEL, 0L);
+
+	if (m_hRichEdit != NULL) FreeLibrary(m_hRichEdit);
+}
+
+
+//
+//
+//
+void TextChat::ShowChatWindow(bool fVisible)
+{
+	ShowWindow(m_hDlg, fVisible ? SW_RESTORE : SW_MINIMIZE);
+	SetForegroundWindow(m_hDlg);
+	//SetFocus(GetDlgItem(m_hDlg, IDC_INPUTAREA_EDIT));
+}
+
+
+//
+// Set text format to a selection in the Chat area
+//
+void TextChat::SetTextFormat(bool bBold /* = false */, bool bItalic /* = false*/
+	, long nSize /* = 0x75*/, const char* szFaceName /* = "MS Sans Serif"*/, DWORD dwColor /* = BLACK*/)
+{
+	if ( GetDlgItem( m_hDlg, IDC_CHATAREA_EDIT ) )  //  Sanity Check
+	{		
+		CHARFORMAT cf;
+		memset( &cf, 0, sizeof(CHARFORMAT) ); //  Initialize structure
+
+		cf.cbSize = sizeof(CHARFORMAT);             
+		cf.dwMask = CFM_COLOR | CFM_FACE | CFM_SIZE;
+		if (bBold) {
+			cf.dwMask |= CFM_BOLD;
+			cf.dwEffects |= CFE_BOLD;
+		}
+		if (bItalic) {
+			cf.dwMask |= CFM_ITALIC;  
+			cf.dwEffects |= CFE_ITALIC;
+		}
+		cf.crTextColor = dwColor;					// set color in AABBGGRR mode (alpha-RGB)
+		cf.yHeight = nSize;							// set size in points
+		strcpy_s( cf.szFaceName, 32, szFaceName);
+													
+		SendDlgItemMessage( m_hDlg, IDC_CHATAREA_EDIT, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf );
+	}
+}
+
+//
+//
+//
+void TextChat::ProcessTextChatMsg(int nTO)
+{
+	rfbTextChatMsg tcm;
+	m_pCC->m_socket->ReadExact(((char *) &tcm) + nTO, sz_rfbTextChatMsg - nTO);
+	int len = Swap32IfLE(tcm.length);
+	
+	if (len == CHAT_OPEN)
+	{
+		PlayResource("IDR_WAVE1");
+		if (m_fTextChatRunning) return;
+		// PostMessage(m_pCC->m_server->GetDesktopPointer()->Window(), WM_USER+888, 0, (LPARAM)this);
+		DisplayTextChat();
+		return;
+	}
+	else if (len == CHAT_CLOSE)
+	{
+		// Close TextChat Dialog
+		if (!m_fTextChatRunning) return;
+		PostMessage(m_hDlg, WM_COMMAND, IDOK, 0);
+		return;
+	}
+	else if (len == CHAT_FINISHED)
+	{
+		// Close TextChat Dialog
+		if (!m_fTextChatRunning) return;
+		// m_fTextChatRunning = false;
+		// PostMessage(m_hDlg, WM_COMMAND, IDCANCEL, 0);
+		return;
+	}
+	else
+	{
+		// Read the incoming text
+		if (len > TEXTMAXSIZE) return; // Todo: Improve this...
+		if (len == 0)
+		{
+			SetDlgItemText(m_hDlg, IDC_CHATAREA_EDIT, "");
+			memset(m_szRemoteText, 0, TEXTMAXSIZE);
+		}
+		else
+		{
+			memset(m_szRemoteText, 0, TEXTMAXSIZE);
+			m_pCC->m_socket->ReadExact(m_szRemoteText, len);
+			ShowChatWindow(true); // Show the chat window on new message reception
+			PrintMessage(m_szRemoteText, m_szRemoteName, RED);
+		}
+	}
+}
+
+
+//
+// Tell the client to initiate a TextChat
+//
+void TextChat::OrderTextChat()
+{
+	SendTextChatRequest(CHAT_OPEN);
+	return;
+}
+
+
+//
+//
+//
+void TextChat::SendTextChatRequest(int nMsg)
+{
+	if (m_pCC->m_fFileTransferRunning) return; // Don't break a running file transfer please...
+    rfbTextChatMsg tcm;
+    tcm.type = rfbTextChat;
+	tcm.length = Swap32IfLE(nMsg);
+    m_pCC->m_socket->SendExact((char *)&tcm, sz_rfbTextChatMsg, rfbTextChat);
+	return;
+}
+
+
+//
+// Output messages in the chat area 
+//
+//
+void TextChat::PrintMessage(const char* szMessage,const char* szSender,DWORD dwColor /* = BLACK*/)
+{
+	// char szTextBoxBuffer[TEXTMAXSIZE];			
+	// memset(szTextBoxBuffer,0,TEXTMAXSIZE);			
+	CHARRANGE cr;	
+	
+	// sf at 2005 - Empty the RichEdit control when it's close to the TEXTMAXSIZE limit
+	// In worst case, the RichEdit can contains 2*TEXTMAXSIZE + NAMEMAXSIZE + 4 - 32 bytes
+	GETTEXTLENGTHEX lpG;
+	lpG.flags = GTL_NUMBYTES;
+	lpG.codepage = CP_ACP; // ANSI
+
+	int nLen = SendDlgItemMessage(m_hDlg, IDC_CHATAREA_EDIT, EM_GETTEXTLENGTHEX, (WPARAM)&lpG, 0L);
+	if (nLen + 32 > TEXTMAXSIZE )
+	{
+		memset(m_szTextBoxBuffer, 0, TEXTMAXSIZE);
+		strcpy(m_szTextBoxBuffer, "------------------------------------------------------------------------------------------------------------------------\n");
+		SetDlgItemText(m_hDlg, IDC_CHATAREA_EDIT, m_szTextBoxBuffer);
+	}
+
+	// Todo: test if chat text + sender + message > TEXTMAXSIZE -> Modulo display
+	if (szSender != NULL && strlen(szSender) > 0) //print the sender's name
+	{
+		SendDlgItemMessage(m_hDlg, IDC_CHATAREA_EDIT,WM_GETTEXT, TEXTMAXSIZE-1,(LONG)m_szTextBoxBuffer);
+		cr.cpMax = nLen; //strlen(m_szTextBoxBuffer);	 // Select the last caracter to make the text insertion
+		cr.cpMin  = cr.cpMax;
+		SendDlgItemMessage(m_hDlg, IDC_CHATAREA_EDIT,EM_EXSETSEL,0,(LONG) &cr);
+
+		//	[v1.0.2-jp1 fix]
+		//SetTextFormat(false,false,0x75,"MS Sans Serif",dwColor);
+		if(!hInstResDLL){
+			SetTextFormat(false,false,0x75,"MS Sans Serif",dwColor);
+		}
+		else{
+			SetTextFormat(false, false, 0xb4, "‚l‚r ‚oƒSƒVƒbƒN", dwColor);
+		}
+
+		_snprintf(m_szTextBoxBuffer, MAXNAMESIZE-1 + 4, "<%s>: ", szSender);		
+		SendDlgItemMessage(m_hDlg, IDC_CHATAREA_EDIT,EM_REPLACESEL,FALSE,(LONG)m_szTextBoxBuffer); // Replace the selection with the message
+	}
+
+	nLen = SendDlgItemMessage(m_hDlg, IDC_CHATAREA_EDIT, EM_GETTEXTLENGTHEX, (WPARAM)&lpG, 0L);
+	if (szMessage != NULL) //print the sender's message
+	{	
+		SendDlgItemMessage(m_hDlg, IDC_CHATAREA_EDIT,WM_GETTEXT, TEXTMAXSIZE-1,(LONG)m_szTextBoxBuffer);
+		cr.cpMax = nLen; //strlen(m_szTextBoxBuffer);	 // Select the last caracter to make the text insertion
+		cr.cpMin  = cr.cpMax;
+		SendDlgItemMessage(m_hDlg, IDC_CHATAREA_EDIT,EM_EXSETSEL,0,(LONG) &cr);
+
+		//	[v1.0.2-jp1 fix]
+		//SetTextFormat(false, false, 0x75, "MS Sans Serif", dwColor != GREY ? BLACK : GREY);	
+		if(!hInstResDLL){
+			SetTextFormat(false, false, 0x75, "MS Sans Serif", dwColor != GREY ? BLACK : GREY);
+		}
+		else{
+			SetTextFormat(false, false, 0xb4, "‚l‚r ‚oƒSƒVƒbƒN", dwColor != GREY ? BLACK : GREY);
+		}
+
+		_snprintf(m_szTextBoxBuffer, TEXTMAXSIZE-1, "%s", szMessage);		
+		SendDlgItemMessage(m_hDlg, IDC_CHATAREA_EDIT,EM_REPLACESEL,FALSE,(LONG)m_szTextBoxBuffer); 
+	}
+
+	// Scroll down the chat window
+	// The following seems necessary under W9x & Me if we want the Edit to scroll to bottom...
+	SCROLLINFO si;
+    ZeroMemory(&si, sizeof(SCROLLINFO));
+    si.cbSize = sizeof(SCROLLINFO);
+    si.fMask = SIF_RANGE|SIF_PAGE;
+    GetScrollInfo(GetDlgItem(m_hDlg, IDC_CHATAREA_EDIT), SB_VERT, &si);
+	si.nPos = si.nMax - max(si.nPage - 1, 0);
+	SendDlgItemMessage(m_hDlg, IDC_CHATAREA_EDIT, WM_VSCROLL, MAKELONG(SB_THUMBPOSITION, si.nPos), 0L);	// Scroll down the ch
+
+	// This line does the bottom scrolling correctly under NT4,W2K, XP...
+	// SendDlgItemMessage(m_hDlg, IDC_CHATAREA_EDIT, WM_VSCROLL, SB_BOTTOM, 0L);
+
+}
+
+//
+// Send local text content
+//
+void TextChat::SendLocalText(void)
+{
+	if (m_pCC->m_fFileTransferRunning) return; // Don't break a running file transfer please...
+
+	// We keep it because we could use it
+	// for future retype functionality. (F3)
+	memcpy(m_szLastLocalText, m_szLocalText, strlen(m_szLocalText));
+
+	PrintMessage(m_szLocalText, m_szLocalName, BLUE);
+
+    rfbTextChatMsg tcm;
+    tcm.type = rfbTextChat;
+	tcm.length = Swap32IfLE(strlen(m_szLocalText));
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+    m_pCC->m_socket->SendExactQueue((char *)&tcm, sz_rfbTextChatMsg, rfbTextChat);
+	m_pCC->m_socket->SendExact((char *)m_szLocalText, strlen(m_szLocalText));
+
+	//and we clear the input box
+	SetDlgItemText(m_hDlg, IDC_INPUTAREA_EDIT, "");
+	return;
+}
+
+
+
+LRESULT CALLBACK TextChat::DoDialogThread(LPVOID lpParameter)
+{
+	TextChat* _this = (TextChat*)lpParameter;
+
+	_this->m_fTextChatRunning = true;
+	// TODO: Place code here.
+	HDESK desktop;
+	desktop = OpenInputDesktop(0, FALSE,
+								DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
+								DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
+								DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
+								DESKTOP_SWITCHDESKTOP | GENERIC_WRITE
+								);
+
+	if (desktop == NULL)
+		vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error \n"));
+	else 
+		vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK\n"));
+
+	HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
+	DWORD dummy;
+
+	char new_name[256];
+	if (desktop)
+	{
+		if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation \n"));
+		}
+
+		vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x\n"), new_name, desktop, old_desktop);
+
+		if (!SetThreadDesktop(desktop))
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop \n"));
+		}
+	}
+
+	 //	[v1.0.2-jp1 fix]
+ 	 //DialogBoxParam(hAppInstance, MAKEINTRESOURCE(IDD_TEXTCHAT_DLG), 
+	 //						NULL, (DLGPROC) TextChatDlgProc, (LONG) _this);
+ 	 DialogBoxParam(hInstResDLL, MAKEINTRESOURCE(IDD_TEXTCHAT_DLG), 
+	 						NULL, (DLGPROC) TextChatDlgProc, (LPARAM) _this);
+	 SetThreadDesktop(old_desktop);
+	 if (desktop) CloseDesktop(desktop);
+	 return 0;
+}
+
+
+/*int TextChat::DoDialog()
+{
+	m_fTextChatRunning = true; // Here.Important.
+
+	//	[v1.0.2-jp1 fix]
+	//return DialogBoxParam(hAppInstance, MAKEINTRESOURCE(IDD_TEXTCHAT_DLG), 
+	//						NULL, (DLGPROC) TextChatDlgProc, (LONG) this);
+	return DialogBoxParam(hInstResDLL, MAKEINTRESOURCE(IDD_TEXTCHAT_DLG), 
+							NULL, (DLGPROC) TextChatDlgProc, (LONG) this);
+}*/
+
+HWND TextChat::DisplayTextChat()
+{
+	DWORD threadID;
+	m_Thread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)(TextChat::DoDialogThread),(LPVOID)this, 0, &threadID);
+	if (m_Thread) ResumeThread(m_Thread);
+	return (HWND)0;
+
+}
+
+//
+//
+//
+void TextChat::KillDialog()
+{
+	m_fTextChatRunning = false;
+    if (m_Thread != INVALID_HANDLE_VALUE)
+    {
+	    SendMessage(m_hDlg, WM_COMMAND, IDCANCEL, 0);
+        ::WaitForSingleObject(m_Thread, INFINITE); // wait for thread to exit
+        m_hDlg=NULL;
+    }
+}
+
+
+//
+//
+//
+void TextChat::RefuseTextChat()
+{
+	SendTextChatRequest(CHAT_CLOSE);
+	SendTextChatRequest(CHAT_FINISHED);
+}
+
+
+//	[v1.0.2-jp1 fix-->]
+void AdjustLeft(LPRECT lprc)
+{
+	int cx = lprc->right - lprc->left - GetSystemMetrics(SM_CXSIZEFRAME) * 2;
+
+	if(cx < 240){
+		lprc->left = lprc->right - 240 - GetSystemMetrics(SM_CXSIZEFRAME) * 2;
+	}
+}
+
+void AdjustTop(LPRECT lprc)
+{
+	int cy = lprc->bottom - lprc->top - GetSystemMetrics(SM_CYSIZEFRAME) * 2;
+
+	if(cy < 179){
+		lprc->top = lprc->bottom - 179 - GetSystemMetrics(SM_CYSIZEFRAME) * 2;
+	}
+}
+
+void AdjustRight(LPRECT lprc)
+{
+	int cx = lprc->right - lprc->left - GetSystemMetrics(SM_CXSIZEFRAME) * 2;
+
+	if(cx < 240){
+		lprc->right = lprc->left + 240 + GetSystemMetrics(SM_CXSIZEFRAME) * 2;
+	}
+}
+
+void AdjustBottom(LPRECT lprc)
+{
+	int cy = lprc->bottom - lprc->top - GetSystemMetrics(SM_CYSIZEFRAME) * 2;
+
+	if(cy < 179){
+		lprc->bottom = lprc->top + 179 + GetSystemMetrics(SM_CYSIZEFRAME) * 2;
+	}
+}
+//	[<--v1.0.2-jp1 fix]
+
+
+//
+//
+//
+INT_PTR CALLBACK TextChat::TextChatDlgProc(  HWND hWnd,  UINT uMsg,  WPARAM wParam, LPARAM lParam ) {
+
+    TextChat *_this = helper::SafeGetWindowUserData<TextChat>(hWnd);
+#ifdef _DEBUG
+					char			szText[256];
+					sprintf(szText," ++++++ uMsg %i\n",uMsg);
+					OutputDebugString(szText);		
+#endif
+	switch (uMsg)
+	{
+	case WM_INITDIALOG:
+		{
+            helper::SafeSetWindowUserData(hWnd, lParam);
+            TextChat *_this = (TextChat *) lParam;
+
+			if (_this->m_szLocalText == NULL || _this->m_szRemoteText == NULL)
+				EndDialog(hWnd, FALSE);
+
+			_this->m_hWnd = hWnd;
+			_this->m_hDlg = hWnd;
+
+			if (_snprintf(_this->m_szRemoteName,MAXNAMESIZE-1,"%s", _this->m_pCC->GetClientName()) < 0 )
+			{
+				_this->m_szRemoteName[MAXNAMESIZE-4]='.';
+				_this->m_szRemoteName[MAXNAMESIZE-3]='.';
+				_this->m_szRemoteName[MAXNAMESIZE-2]='.';
+				_this->m_szRemoteName[MAXNAMESIZE-1]=0x00;
+			}	
+
+			const long lTitleBufSize = 256;			
+			char szTitle[lTitleBufSize];
+			
+			_snprintf(szTitle,lTitleBufSize-1, sz_ID_CHAT_WITH_S_ULTRAVNC,_this->m_szRemoteName);
+			SetWindowText(hWnd, szTitle);			
+
+			memset(_this->m_szLocalText, 0, TEXTMAXSIZE);
+
+			// Local message box	
+			SetDlgItemText(hWnd, IDC_INPUTAREA_EDIT, _this->m_szLocalText); 
+			
+			//  Chat area			
+			_this->SetTextFormat(); //  Set character formatting and background color
+			SendDlgItemMessage( hWnd, IDC_CHATAREA_EDIT, EM_SETBKGNDCOLOR, FALSE, 0xFFFFFF ); 
+
+			memset(_this->m_szLastLocalText, 0, TEXTMAXSIZE); // Future retype functionnality
+			memset(_this->m_szTextBoxBuffer, 0, TEXTMAXSIZE); // Clear Chat area 
+				//  Load and display diclaimer message
+				// sf at 2005 - Only if the DSMplugin is used
+			if (!_this->m_pCC->m_server->GetDSMPluginPointer()->IsEnabled())
+				{
+					//	[v1.0.2-jp1 fix]
+					if (LoadString(hInstResDLL,IDS_WARNING,_this->m_szRemoteText, TEXTMAXSIZE -1) )
+						_this->PrintMessage(_this->m_szRemoteText, NULL ,GREY);
+				}
+
+
+			
+			// Scroll down the chat window
+			// The following seems necessary under W9x & Me if we want the Edit to scroll to bottom...
+
+
+			SCROLLINFO si;
+			ZeroMemory(&si, sizeof(SCROLLINFO));
+			si.cbSize = sizeof(SCROLLINFO);
+			si.fMask = SIF_RANGE|SIF_PAGE;
+			GetScrollInfo(GetDlgItem(hWnd, IDC_CHATAREA_EDIT), SB_VERT, &si);
+			si.nPos = si.nMax - max(si.nPage - 1, 0);
+			SendDlgItemMessage(hWnd, IDC_CHATAREA_EDIT, WM_VSCROLL, MAKELONG(SB_THUMBPOSITION, si.nPos), 0L);	
+			
+			SetForegroundWindow(hWnd);
+
+			//	[v1.0.2-jp1 fix] SUBCLASS Split bar
+            pDefSBProc = helper::SafeGetWindowProc(GetDlgItem(hWnd, IDC_STATIC_SPLIT));
+			// CRAsh X64 fixed
+            helper::SafeSetWindowProc(GetDlgItem(hWnd, IDC_STATIC_SPLIT), pDefSBProc);
+
+            return TRUE;
+		}
+		break;
+
+	case WM_COMMAND:
+#ifdef _DEBUG
+					//char			szText[256];
+					sprintf(szText," ++++++ wm_command %i\n",LOWORD(wParam));
+					OutputDebugString(szText);		
+	#endif
+		switch (LOWORD(wParam))
+		{
+		/*
+		case IDC_PERSISTENT_CHECK:
+			  _this->m_fPersistentTexts = (SendDlgItemMessage(hWnd, IDC_PERSISTENT_CHECK, BM_GETCHECK, 0, 0) == BST_CHECKED);
+			return TRUE;
+		*/
+
+		case IDOK:
+			// Client order to close TextChat 			
+
+			//	[v1.0.2-jp1 fix] UNSUBCLASS Split bar
+            helper::SafeSetWindowProc(GetDlgItem(hWnd, IDC_STATIC_SPLIT), pDefSBProc);
+			EndDialog(hWnd, FALSE);
+			_this->m_fTextChatRunning = false;
+			_this->SendTextChatRequest(CHAT_FINISHED);
+			return TRUE;
+
+		case IDCANCEL:			
+			_this->SendTextChatRequest(CHAT_CLOSE); // Client must close TextChat
+
+			//	[v1.0.2-jp1 fix] UNSUBCLASS Split bar
+            helper::SafeSetWindowProc(GetDlgItem(hWnd, IDC_STATIC_SPLIT), pDefSBProc);
+			EndDialog(hWnd, FALSE);
+			_this->m_fTextChatRunning = false;
+			_this->SendTextChatRequest(CHAT_FINISHED);
+			return TRUE;
+
+		case IDC_SEND_B:
+			{
+			memset(_this->m_szLocalText,0,TEXTMAXSIZE);
+			UINT nRes = GetDlgItemText( hWnd, IDC_LOCALTEXT_EDIT, _this->m_szLocalText, TEXTMAXSIZE-1);
+			strcat(_this->m_szLocalText, "\n");
+			_this->SendLocalText();	
+			SetFocus(GetDlgItem(hWnd, IDC_INPUTAREA_EDIT));
+			}
+			return TRUE;
+
+		case IDC_INPUTAREA_EDIT:
+			if(HIWORD(wParam) == EN_UPDATE)			
+			{
+				UINT nRes = GetDlgItemText( hWnd, IDC_INPUTAREA_EDIT, _this->m_szLocalText, TEXTMAXSIZE);
+				if (strstr(_this->m_szLocalText, "\n") > 0 ) // Enter triggers the message transmission
+				{
+					// nRes = GetDlgItemText( hWnd, IDC_USERID_EDIT, _this->m_szUserID, 16);
+					_this->SendLocalText();
+				}								
+			}
+			return TRUE;
+
+		case IDC_HIDE_B:
+			_this->ShowChatWindow(false);
+			return TRUE;
+
+		default:
+			return TRUE;
+			break;
+		}
+		break;
+
+	case WM_SYSCOMMAND:
+		switch (LOWORD(wParam))
+		{
+		case SC_RESTORE:
+			_this->ShowChatWindow(true);
+			//SetFocus(GetDlgItem(hWnd, IDC_INPUTAREA_EDIT));
+			return TRUE;
+		}
+		break;
+
+	//	[v1.0.2-jp1 fix-->]
+	case WM_SIZING:
+		LPRECT lprc;
+		lprc = (LPRECT)lParam;
+		switch(wParam){
+		case WMSZ_TOPLEFT:
+			AdjustTop(lprc);
+			AdjustLeft(lprc);
+		case WMSZ_TOP:
+			AdjustTop(lprc);
+		case WMSZ_TOPRIGHT:
+			AdjustTop(lprc);
+			AdjustRight(lprc);
+		case WMSZ_LEFT:
+			AdjustLeft(lprc);
+		case WMSZ_RIGHT:
+			AdjustRight(lprc);
+		case WMSZ_BOTTOMLEFT:
+			AdjustBottom(lprc);
+			AdjustLeft(lprc);
+		case WMSZ_BOTTOM:
+			AdjustBottom(lprc);
+		case WMSZ_BOTTOMRIGHT:
+			AdjustBottom(lprc);
+			AdjustRight(lprc);
+		}
+		return TRUE;
+
+	case WM_SIZE:
+		int cx;
+		int cy;
+		int icy;
+		RECT rc;
+
+		if(wParam == SIZE_MINIMIZED){
+			break;
+		}
+
+		cx = LOWORD(lParam);
+		cy = HIWORD(lParam);
+		GetWindowRect(GetDlgItem(hWnd, IDC_INPUTAREA_EDIT), &rc);
+		icy = rc.bottom - rc.top;
+		if(cy - icy - 12 < 80){
+			icy = cy - 92;
+		}
+		MoveWindow(GetDlgItem(hWnd, IDC_CHATAREA_EDIT),  4,             4, cx -  8, cy - icy - 16, TRUE); 
+		MoveWindow(GetDlgItem(hWnd, IDC_STATIC_SPLIT),   4, cy - icy - 12, cx -  8,             8, TRUE); 
+		MoveWindow(GetDlgItem(hWnd, IDC_INPUTAREA_EDIT), 4, cy - icy -  4, cx - 88,           icy, TRUE);
+
+		MoveWindow(GetDlgItem(hWnd, IDC_SEND_B), cx - 76, cy - 64, 72, 20, TRUE); 
+		MoveWindow(GetDlgItem(hWnd, IDC_HIDE_B), cx - 76, cy - 40, 72, 18, TRUE); 
+		MoveWindow(GetDlgItem(hWnd, IDCANCEL),   cx - 76, cy - 22, 72, 18, TRUE);
+
+		InvalidateRect(hWnd, NULL, FALSE);
+		return TRUE;
+	//	[<--v1.0.2-jp1 fix]
+
+	case WM_DESTROY:
+		// _this->m_fTextChatRunning = false;
+		// _this->SendTextChatRequest(CHAT_FINISHED);
+		EndDialog(hWnd, FALSE);
+		return TRUE;
+	}
+	return 0;
+}
+
+//	[v1.0.2-jp1 fix-->] Split bar
+void DrawResizeLine(HWND hWnd, int y)
+{
+	HWND hParent;
+	RECT rc;
+	HDC hDC;
+
+	hParent = GetParent(hWnd);
+	GetClientRect(hParent, &rc);
+
+	if(y < 80){
+		y = 80;
+	}
+	else if(y > rc.bottom - 80){
+		y = rc.bottom - 80;
+	}
+	
+	hDC = GetDC(hParent);
+	SetROP2(hDC, R2_NOTXORPEN);
+	MoveToEx(hDC, rc.left, y, NULL);
+	LineTo(hDC, rc.right, y);
+	MoveToEx(hDC, rc.left, y+1, NULL);
+	LineTo(hDC, rc.right, y+1);
+	MoveToEx(hDC, rc.left, y+2, NULL);
+	LineTo(hDC, rc.right, y+2);
+	MoveToEx(hDC, rc.left, y+3, NULL);
+	LineTo(hDC, rc.right, y+3);
+	ReleaseDC(hParent, hDC);
+}
+//	[<--v1.0.2-jp1 fix]
+
+//	[v1.0.2-jp1 fix-->] Split bar proc
+LRESULT CALLBACK SBProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+	static BOOL bCapture;
+	static UINT u;
+	static int oldy;
+	HWND hParent;
+	RECT rc;
+	POINT cp;
+	int y;
+	int cx;
+	int cy;
+
+	switch(uMsg){
+	case WM_SETCURSOR:
+		SetCursor(LoadCursor(NULL, IDC_SIZENS));
+		return TRUE;
+	case WM_LBUTTONDOWN:
+		SetCapture(hWnd);
+		bCapture = TRUE;
+		u = GetCaretBlinkTime();
+		SetCaretBlinkTime(0x7fffffff);
+		GetCursorPos(&cp);
+		hParent = GetParent(hWnd);
+		ScreenToClient(hParent, &cp);
+		DrawResizeLine(hWnd, cp.y);
+		oldy = cp.y;
+		break;
+	case WM_MOUSEMOVE:
+		if(bCapture){
+			GetCursorPos(&cp);
+			hParent = GetParent(hWnd);
+			ScreenToClient(hParent, &cp);
+			DrawResizeLine(hWnd, oldy);
+			DrawResizeLine(hWnd, cp.y);
+			oldy = cp.y;
+		}
+		break;
+	case WM_LBUTTONUP:
+		ReleaseCapture();
+		bCapture = FALSE;
+		SetCaretBlinkTime(u);
+		GetCursorPos(&cp);
+		hParent = GetParent(hWnd);
+		GetClientRect(hParent, &rc);
+		cx = rc.right - rc.left;
+		cy = rc.bottom - rc.top;
+		ScreenToClient(hParent, &cp);
+		DrawResizeLine(hWnd, cp.y);
+		y = cp.y;
+		if(y < 80){
+			y = 80;
+		}
+		else if(y > cy - 80){
+			y = cy - 80;
+		}
+		MoveWindow(GetDlgItem(hParent, IDC_CHATAREA_EDIT),  4,         4, cx -  8,       y - 4, TRUE); 
+		MoveWindow(GetDlgItem(hParent, IDC_STATIC_SPLIT),   4,         y, cx -  8,           8, TRUE); 
+		MoveWindow(GetDlgItem(hParent, IDC_INPUTAREA_EDIT), 4,     y + 8, cx - 88, cy - y - 12, TRUE);
+		break;
+	}
+
+	return CallWindowProc((WNDPROC)pDefSBProc, hWnd, uMsg, wParam, lParam);
+}
+//	[<--v1.0.2-jp1 fix]
diff --git a/ica/win32/winvnc/winvnc/TextChat.h b/ica/win32/winvnc/winvnc/TextChat.h
new file mode 100644
index 0000000..fc24c92
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/TextChat.h
@@ -0,0 +1,76 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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://www.uvnc.com/
+
+
+#ifndef TEXTCHAT_H__
+#define TEXTCHAT_H__
+#pragma once
+
+#define BLACK	0x00000000
+#define RED		0x000000FF
+#define GREEN	0x0000FF00
+#define BLUE	0x00FF0000
+#define GREY	0x00888888
+
+class vncClient;
+
+class TextChat  
+{
+public:
+	// Props
+	vncClient			*m_pCC;
+	HWND				m_hWnd;
+	HWND				m_hDlg;
+	bool				m_fTextChatRunning;
+	char*				m_szLocalText;
+	char*				m_szLastLocalText;
+	char*				m_szRemoteText;	
+	char*				m_szRemoteName;
+	char*				m_szLocalName;
+	char*				m_szTextBoxBuffer;
+	HMODULE				m_hRichEdit;
+	bool				m_fPersistentTexts;
+	// char				m_szUserID[16];
+    HANDLE              m_Thread;
+
+	// Methods
+	TextChat(vncClient *pCC);
+//	int DoDialog();
+	HWND DisplayTextChat();
+	void KillDialog();
+	void OrderTextChat();
+	void RefuseTextChat();
+	void ProcessTextChatMsg(int nTO);
+   	virtual ~TextChat();
+	static LRESULT CALLBACK DoDialogThread(LPVOID lpParameter);
+	static INT_PTR CALLBACK TextChatDlgProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
+	void SendTextChatRequest(int Msg);
+	void SendLocalText(void);
+	void PrintMessage(const char* szMessage, const char* szSender, DWORD color = BLACK);
+	void SetTextFormat(bool bBold = false, bool bItalic = false, long nSize = 0x75, const char* szFaceName = "MS Sans Serif", DWORD dwColor = BLACK);
+	void ShowChatWindow(bool fVisible);
+};
+
+#endif 
+
+
+
diff --git a/ica/win32/winvnc/winvnc/Timer.cpp b/ica/win32/winvnc/winvnc/Timer.cpp
new file mode 100644
index 0000000..431f0ba
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/Timer.cpp
@@ -0,0 +1,39 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+// Class was copied from another project...but can find it back
+// If someone find it please message me to add it..
+
+#include "Timer.h"
+Timer :: Timer()
+{
+  total = 0.0;
+  endT.tv_sec = startT.tv_sec = 0;
+  endT.tv_usec = startT.tv_usec = 0;
+  tScale = 1.0 / CLOCKS_PER_SEC;
+  start();
+  stop();
+  reset();
+}
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/Timer.h b/ica/win32/winvnc/winvnc/Timer.h
new file mode 100644
index 0000000..7a0c734
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/Timer.h
@@ -0,0 +1,123 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+// Class was copied from another project...but can find it back
+// If someone find it please message me to add it..
+
+#ifndef _TIMER_H
+
+#include <stdio.h>
+#include <winsock.h>
+#include <time.h>
+
+inline void gettimeofday( struct timeval *t, void* )
+{
+  t->tv_sec = 0;
+  t->tv_usec = clock();
+}
+
+
+class Timer
+{
+
+ public:
+
+  Timer();
+  virtual ~Timer(){};
+
+  inline double frame()
+    {
+      if( !stopped )
+        gettimeofday( &endT, 0 );
+      else
+	{
+	  frameT.tv_sec = endT.tv_sec;
+	  frameT.tv_usec = endT.tv_usec;
+	}
+
+      secs  = endT.tv_sec - frameT.tv_sec;
+      usecs = endT.tv_usec - frameT.tv_usec;
+
+      frameT.tv_sec = endT.tv_sec;
+      frameT.tv_usec = endT.tv_usec;
+
+      return( secs + ( usecs * tScale ) );
+    }
+
+  //! Reset the timer to \b newVal.
+  inline void reset( float newVal = 0.0f )
+    {
+      total = newVal;
+      if( !stopped )
+	gettimeofday( &startT, 0 );
+    }
+
+  //! Read the current elapsed time (in seconds).
+  inline double read()
+    {
+      if( !stopped )
+	gettimeofday( &endT, 0 );
+      else
+	{
+	  endT.tv_sec = startT.tv_sec;
+	  endT.tv_usec = startT.tv_usec;
+	}
+
+      secs  = endT.tv_sec - startT.tv_sec;
+      usecs = endT.tv_usec - startT.tv_usec;
+      return( secs + ( usecs * tScale ) + total );
+    }
+
+  //! Start the timer.
+  inline void start()
+    {
+      stopped = false;
+      gettimeofday( &startT, 0 );
+      frameT.tv_sec = startT.tv_sec;
+      frameT.tv_usec = startT.tv_usec;
+    }
+
+  //! Stop the timer.
+  inline void stop()
+    {
+      gettimeofday( &endT, 0 );
+      secs  = endT.tv_sec - startT.tv_sec;
+      usecs = endT.tv_usec - startT.tv_usec;
+      total += ( secs + ( usecs * tScale) );
+      frameT.tv_sec = endT.tv_sec;
+      frameT.tv_usec = endT.tv_usec;
+      stopped = true;
+    }
+
+ private:
+
+  timeval endT, frameT, startT;
+  double secs, usecs, tScale, total;
+  bool stopped;
+
+}; /* end class Timer */
+
+#define _TIMER_H
+#endif
diff --git a/ica/win32/winvnc/winvnc/WINVNC.DSW b/ica/win32/winvnc/winvnc/WINVNC.DSW
new file mode 100644
index 0000000..f66df05
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/WINVNC.DSW
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "winvnc"=".\WINVNC.DSP" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ica/win32/winvnc/winvnc/benchmark.cpp b/ica/win32/winvnc/winvnc/benchmark.cpp
new file mode 100644
index 0000000..eb557fb
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/benchmark.cpp
@@ -0,0 +1,152 @@
+#include "windows.h"
+#include <stdio.h>
+#include <string.h>
+#include "vnclog.h"
+bool G_USE_PIXEL=false;
+extern VNCLog vnclog;
+#define VNCLOG(s)	(__FILE__ " : " s)
+
+struct _BMInfo {
+		BOOL			truecolour;
+		BITMAPINFO		bmi;
+		// Colormap info - comes straight after BITMAPINFO - **HACK**
+		RGBQUAD			cmap[256];
+	} m_bminfo;
+
+void testBench()
+{
+	HDC			m_hrootdc=NULL;
+	HDC			m_hmemdc=NULL;
+	HBITMAP		m_membitmap=NULL;
+	HBITMAP		m_oldbitmap=NULL;
+	void		*m_DIBbits=NULL;
+
+	m_hrootdc = GetDC(NULL);
+	if (m_hrootdc == NULL) {
+		return ;
+	}
+	m_hmemdc = CreateCompatibleDC(m_hrootdc);
+	if (m_hmemdc == NULL) {
+		return ;
+	}
+	m_membitmap = CreateCompatibleBitmap(m_hrootdc,1,1);
+	if (m_membitmap == NULL) {
+		return ;
+	}
+
+
+	int result;
+	memset(&m_bminfo, 0, sizeof(m_bminfo));
+	m_bminfo.bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+	m_bminfo.bmi.bmiHeader.biBitCount = 0;
+	result = ::GetDIBits(m_hmemdc, m_membitmap, 0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS);
+	if (result == 0) {
+		return;
+	}
+	result = ::GetDIBits(m_hmemdc, m_membitmap,  0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS);
+	if (result == 0) {
+		return;
+	}
+	RECT m_bmrect;
+	m_bmrect.left=0;
+	m_bmrect.top=0;
+	m_bmrect.right=GetDeviceCaps(m_hrootdc, HORZRES);
+	m_bmrect.bottom=GetDeviceCaps(m_hrootdc, VERTRES);
+	// Henceforth we want to use a top-down scanning representation
+    m_bminfo.bmi.bmiHeader.biWidth = m_bmrect.right;
+    m_bminfo.bmi.bmiHeader.biHeight = m_bmrect.bottom;
+    m_bminfo.bmi.bmiHeader.biSizeImage = abs((m_bminfo.bmi.bmiHeader.biWidth *
+				m_bminfo.bmi.bmiHeader.biHeight *
+				m_bminfo.bmi.bmiHeader.biBitCount)/ 8);
+	m_bminfo.bmi.bmiHeader.biHeight = - abs(m_bminfo.bmi.bmiHeader.biHeight);
+
+	// Is the bitmap palette-based or truecolour?
+	m_bminfo.truecolour = (GetDeviceCaps(m_hmemdc, RASTERCAPS) & RC_PALETTE) == 0;
+
+	int m_bytesPerRow = m_bminfo.bmi.bmiHeader.biWidth * m_bminfo.bmi.bmiHeader.biBitCount / 8;
+	int m_bytesPerPixel= m_bminfo.bmi.bmiHeader.biBitCount / 8;
+
+	HBITMAP tempbitmap = CreateDIBSection(m_hmemdc, &m_bminfo.bmi, DIB_RGB_COLORS, &m_DIBbits, NULL, 0);
+	if (tempbitmap == NULL) {
+		m_DIBbits = NULL;
+        tempbitmap = CreateCompatibleBitmap(m_hrootdc, m_bmrect.right, m_bmrect.bottom);
+	    if (tempbitmap == NULL) {
+		    return;
+	    }
+	}
+
+	// Delete the old memory bitmap
+	if (m_membitmap != NULL) {
+		DeleteObject(m_membitmap);
+		m_membitmap = NULL;
+	}
+
+	// Replace old membitmap with DIB section
+	m_membitmap = tempbitmap;
+	DWORD time1,time2;
+///---------------------------------------
+	{
+	DWORD start= timeGetTime();
+	
+	{
+	if ((m_oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)
+					return;
+	BOOL blitok = BitBlt(m_hmemdc, 0, 0, m_bmrect.right, m_bmrect.bottom, m_hrootdc, 0, 0, CAPTUREBLT | SRCCOPY);
+	SelectObject(m_hmemdc, m_oldbitmap);
+	}
+	COLORREF cr = 0;
+	for (int xx=0;xx<m_bmrect.right/32;xx++)
+		for (int yy=0;yy<m_bmrect.bottom/32;yy++)
+		{
+			unsigned int index = (m_bytesPerRow * yy) + (m_bytesPerPixel * xx);
+				memcpy(&cr, ((char*)m_DIBbits)+index, m_bytesPerPixel);
+		}
+
+
+	DWORD stop= timeGetTime();
+	time1=stop-start;
+	}
+	
+///---------------------------------------
+	{
+	DWORD start= timeGetTime();
+	
+	{
+	COLORREF cr = 0;
+	for (int xx=0;xx<m_bmrect.right*m_bmrect.bottom/32/32/200;xx++)
+		{
+			cr=GetPixel(m_hrootdc, 1, 1);
+		}
+	}
+	DWORD stop= timeGetTime();
+	time2=(stop-start)*200;
+	}
+///---------------------------------------
+
+	if (time2<time1) G_USE_PIXEL=true;
+	else G_USE_PIXEL=false;
+
+	vnclog.Print(9, VNCLOG("Blit time %i  Getpixeltime %i  Use getpixel= %i\n"), time1,time2,G_USE_PIXEL);
+
+	if (m_hrootdc != NULL)
+	{
+		if (!DeleteDC(m_hrootdc))
+		m_hrootdc = NULL;
+	}
+	if (m_hmemdc != NULL)
+	{
+		// Release our device context
+		if (!DeleteDC(m_hmemdc))
+		{
+		}
+		m_hmemdc = NULL;
+	}
+	if (m_membitmap != NULL)
+	{
+		// Release the custom bitmap, if any
+		if (!DeleteObject(m_membitmap))
+		{
+		}
+		m_membitmap = NULL;
+	}
+}
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/black_layered.cpp b/ica/win32/winvnc/winvnc/black_layered.cpp
new file mode 100644
index 0000000..e9cfa42
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/black_layered.cpp
@@ -0,0 +1,334 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
+#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
+#include <windows.h>
+#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
+#include <time.h>
+HWND hwnd;
+HINSTANCE hInst;
+#ifndef LWA_COLORKEY
+# define LWA_COLORKEY 1
+#endif
+#ifndef LWA_ALPHA 
+# define LWA_ALPHA 2
+#endif
+#ifndef WS_EX_LAYERED
+# define WS_EX_LAYERED 0x80000
+#endif
+#include "stdhdrs.h"
+#include "resource.h"
+#include "vncservice.h"
+
+
+int wd=0;
+int ht=0;
+
+HBITMAP
+    DoGetBkGndBitmap2(
+        IN CONST UINT uBmpResId
+      )
+    {
+        static HBITMAP hbmBkGnd = NULL;
+        if (NULL == hbmBkGnd)
+        {
+			char WORKDIR[MAX_PATH];
+			char mycommand[MAX_PATH];
+			if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+				{
+				char* p = strrchr(WORKDIR, '\\');
+				if (p == NULL) return 0;
+				*p = '\0';
+			}
+			strcpy(mycommand,WORKDIR);
+			strcat(mycommand,"\\background.bmp");
+
+			hbmBkGnd = (HBITMAP)LoadImage(NULL, mycommand, IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE);
+			if (hbmBkGnd ==NULL)
+			{
+				 hbmBkGnd = (HBITMAP)LoadImage(
+                GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_LOGO64),
+                    IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
+			}
+			BITMAPINFOHEADER h2;
+			h2.biSize=sizeof(h2);
+			h2.biBitCount=0;
+			// h2.biWidth=11; h2.biHeight=22; h2.biPlanes=1;
+			HDC hxdc=CreateDC("DISPLAY",NULL,NULL,NULL);  
+			GetDIBits(hxdc, hbmBkGnd, 0, 0, NULL, (BITMAPINFO*)&h2, DIB_RGB_COLORS);
+			wd=h2.biWidth; ht=h2.biHeight;
+			DeleteDC(hxdc);
+
+            if (NULL == hbmBkGnd)
+                hbmBkGnd = (HBITMAP)-1;
+        }
+        return (hbmBkGnd == (HBITMAP)-1)
+            ? NULL : hbmBkGnd;
+    }
+BOOL
+    DoSDKEraseBkGnd2(
+        IN CONST HDC hDC,
+        IN CONST COLORREF crBkGndFill
+      )
+    {
+        HBITMAP hbmBkGnd = DoGetBkGndBitmap2(0);
+        if (hDC && hbmBkGnd)
+        {
+            RECT rc;
+            if ((ERROR != GetClipBox(hDC, &rc)) && !IsRectEmpty(&rc))
+            {
+                HDC hdcMem = CreateCompatibleDC(hDC);
+                if (hdcMem)
+                {
+                    HBRUSH hbrBkGnd = CreateSolidBrush(crBkGndFill);
+                    if (hbrBkGnd)
+                    {
+                        HGDIOBJ hbrOld = SelectObject(hDC, hbrBkGnd);
+                        if (hbrOld)
+                        {
+                            SIZE size = {
+                                (rc.right-rc.left), (rc.bottom-rc.top)
+                            };
+
+                            if (PatBlt(hDC, rc.left, rc.top, size.cx, size.cy, PATCOPY))
+                            {
+                                HGDIOBJ hbmOld = SelectObject(hdcMem, hbmBkGnd);
+                                if (hbmOld)
+                                {
+									StretchBlt(hDC,
+										0,
+										0,
+										size.cx,
+										size.cy,
+                                        hdcMem,
+										0,
+										0,
+										wd,
+										ht,
+										SRCCOPY);
+
+
+
+  /*                                  BitBlt(hDC, rc.left, rc.top, size.cx, size.cy,
+                                        hdcMem, rc.left, rc.top, SRCCOPY);*/
+                                    SelectObject(hdcMem, hbmOld);
+                                }
+                            }
+                            SelectObject(hDC, hbrOld);
+                        }
+                        DeleteObject(hbrBkGnd);
+                    }
+                    DeleteDC(hdcMem);
+                }
+            }
+        }
+        return TRUE;
+    }
+
+
+static LRESULT CALLBACK WndProc(
+    HWND hwnd,        // handle to window
+    UINT uMsg,        // message identifier
+    WPARAM wParam,    // first message parameter
+    LPARAM lParam)    // second message parameter
+{
+    switch (uMsg)
+    {
+						case WM_CREATE:
+//							SetTimer(hwnd,10,30000,NULL);
+							SetTimer(hwnd,100,20,NULL);
+							break;
+						case WM_TIMER:
+							if (wParam==100) 
+							{
+                                SetWindowPos(hwnd,HWND_TOPMOST,0,0,0,0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
+							
+							}
+//							if (wParam==10) DestroyWindow(hwnd);
+                         
+						 case WM_ERASEBKGND:
+							{
+									DoSDKEraseBkGnd2((HDC)wParam, RGB(0,0,0));
+									return true;
+							}
+						case WM_CTLCOLORSTATIC:
+							{
+									SetBkMode((HDC) wParam, TRANSPARENT);
+									return (LONG_PTR) GetStockObject(NULL_BRUSH);
+							}
+                         case WM_DESTROY:
+								KillTimer(hwnd,100);
+                                PostQuitMessage (0);
+                                break;
+        default:
+            return DefWindowProc(hwnd, uMsg, wParam, lParam);
+    }
+    return 0;
+}
+
+bool
+create_window(void)
+{
+	WNDCLASSEX wndClass;
+	ZeroMemory (&wndClass, sizeof (wndClass));
+    wndClass.cbSize        = sizeof (wndClass);
+    wndClass.style         = CS_HREDRAW | CS_VREDRAW;
+    wndClass.lpfnWndProc   = WndProc;
+    wndClass.cbClsExtra    = 0;
+    wndClass.cbWndExtra    = 0;
+    wndClass.hInstance     = hInst;
+    wndClass.hIcon         = LoadIcon (NULL, IDI_APPLICATION);
+    wndClass.hIconSm       = NULL;
+    wndClass.hCursor       = LoadCursor (NULL, IDC_ARROW);
+    wndClass.hbrBackground = (HBRUSH) GetStockObject(GRAY_BRUSH);
+    wndClass.lpszMenuName  = NULL;
+    wndClass.lpszClassName = "blackscreen";
+
+        if (!RegisterClassEx(&wndClass)) {
+ //               return false;
+        }
+
+        RECT clientRect;
+        clientRect.left = 0;
+        clientRect.top = 0;
+        clientRect.right = GetSystemMetrics(SM_CXSCREEN);
+        clientRect.bottom = GetSystemMetrics(SM_CYSCREEN);
+
+        UINT x(GetSystemMetrics(SM_XVIRTUALSCREEN));
+        UINT y(GetSystemMetrics(SM_YVIRTUALSCREEN));
+        UINT cx(GetSystemMetrics(SM_CXVIRTUALSCREEN));
+        UINT cy(GetSystemMetrics(SM_CYVIRTUALSCREEN));
+
+        clientRect.left = x;
+        clientRect.top = y;
+        clientRect.right = x + cx;
+        clientRect.bottom = y + cy;
+
+        AdjustWindowRect (&clientRect, WS_CAPTION, FALSE);
+        hwnd = CreateWindowEx (0,
+                               "blackscreen",
+                               "blackscreen",
+                               WS_POPUP  | WS_CLIPSIBLINGS | WS_CLIPCHILDREN|WS_BORDER,
+                               CW_USEDEFAULT,
+                               CW_USEDEFAULT,
+                               cx,
+                               cy,
+                               NULL,
+                               NULL,
+                               hInst,
+                               NULL);
+		typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);
+
+	PSLWA pSetLayeredWindowAttributes=NULL;
+	/*
+	* Code that follows allows the program to run in 
+	* environment other than windows 2000
+	* without crashing only difference being that 
+	* there will be no transparency as 
+	* the SetLayeredAttributes function is available only in
+	* windows 2000
+	*/
+	HMODULE hDLL = LoadLibrary ("user32");
+	if (hDLL) pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL,"SetLayeredWindowAttributes");
+	/*
+	* Make the windows a layered window
+	*/
+	LONG style = GetWindowLong(hwnd, GWL_STYLE);
+	style = GetWindowLong(hwnd, GWL_STYLE);
+	style &= ~(WS_DLGFRAME | WS_THICKFRAME);
+	SetWindowLong(hwnd, GWL_STYLE, style);
+
+	if (pSetLayeredWindowAttributes != NULL) {
+		SetWindowLong (hwnd, GWL_EXSTYLE, GetWindowLong
+		(hwnd, GWL_EXSTYLE) |WS_EX_LAYERED|WS_EX_TRANSPARENT|WS_EX_TOPMOST);
+	    ShowWindow (hwnd, SW_SHOWNORMAL);
+	}
+	if (pSetLayeredWindowAttributes != NULL) {
+	/**
+	* Second parameter RGB(255,255,255) sets the colorkey to white
+	* LWA_COLORKEY flag indicates that color key is valid
+	* LWA_ALPHA indicates that ALphablend parameter (factor)
+	* is valid
+	*/
+	pSetLayeredWindowAttributes (hwnd, RGB(255,255,255), 255, LWA_ALPHA);
+	}
+	SetWindowPos(hwnd,HWND_TOPMOST,x,y,cx,cy, SWP_FRAMECHANGED|SWP_NOACTIVATE);
+//SM_CXVIRTUALSCREEN
+	return true;
+}
+
+DWORD WINAPI BlackWindow(LPVOID lpParam)
+{
+ 	// TODO: Place code here.
+	HDESK desktop;
+	desktop = OpenInputDesktop(0, FALSE,
+								DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
+								DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
+								DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
+								DESKTOP_SWITCHDESKTOP | GENERIC_WRITE
+								);
+
+	if (desktop == NULL)
+		vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error \n"));
+	else 
+		vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK\n"));
+
+	HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
+	DWORD dummy;
+
+	char new_name[256];
+	if (desktop)
+	{
+		if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation \n"));
+		}
+
+		vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x\n"), new_name, desktop, old_desktop);
+
+		if (!SetThreadDesktop(desktop))
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop \n"));
+		}
+	}
+
+	create_window();
+	MSG msg;
+	while (GetMessage(&msg,0,0,0) != 0)
+	{
+		TranslateMessage(&msg);
+		DispatchMessage(&msg);
+	}
+	vnclog.Print(LL_INTERR, VNCLOG("end BlackWindow \n"));
+	SetThreadDesktop(old_desktop);
+	if (desktop) CloseDesktop(desktop);
+
+	return 0;
+}
diff --git a/ica/win32/winvnc/winvnc/buildtime.cpp b/ica/win32/winvnc/winvnc/buildtime.cpp
new file mode 100644
index 0000000..30ca1c0
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/buildtime.cpp
@@ -0,0 +1,22 @@
+//  Copyright (C) 2002 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+char buildtime[] = __DATE__ " " __TIME__;
diff --git a/ica/win32/winvnc/winvnc/d3des.c b/ica/win32/winvnc/winvnc/d3des.c
new file mode 100644
index 0000000..6d508d4
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/d3des.c
@@ -0,0 +1,440 @@
+/*
+ * 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 deskey(key, edf)	/* Thanks to James Gillogly & Phil Karn! */
+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(raw1)
+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);
+		}
+	usekey(dough);
+	return;
+	}
+
+void cpkey(into)
+register unsigned long *into;
+{
+	register unsigned long *from, *endp;
+
+	from = KnL, endp = &KnL[32];
+	while( from < endp ) *into++ = *from++;
+	return;
+	}
+
+void usekey(from)
+register unsigned long *from;
+{
+	register unsigned long *to, *endp;
+
+	to = KnL, endp = &KnL[32];
+	while( to < endp ) *to++ = *from++;
+	return;
+	}
+
+void des(inblock, outblock)
+unsigned char *inblock, *outblock;
+{
+	unsigned long work[2];
+
+	scrunch(inblock, work);
+	desfunc(work, KnL);
+	unscrun(work, outblock);
+	return;
+	}
+
+static void scrunch(outof, into)
+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(outof, into)
+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(block, keys)
+register unsigned long *block, *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/win32/winvnc/winvnc/d3des.h b/ica/win32/winvnc/winvnc/d3des.h
new file mode 100644
index 0000000..feae87f
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/d3des.h
@@ -0,0 +1,51 @@
+/*
+ * 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 deskey(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 usekey(unsigned long *);
+/*                  cookedkey[32]
+ * Loads the internal key register with the data in cookedkey.
+ */
+
+extern void cpkey(unsigned long *);
+/*                 cookedkey[32]
+ * Copies the contents of the internal key register into the storage
+ * located at &cookedkey[0].
+ */
+
+extern void des(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
+ ********************************************************************/
diff --git a/ica/win32/winvnc/winvnc/getinfo.cpp b/ica/win32/winvnc/winvnc/getinfo.cpp
new file mode 100644
index 0000000..5fa4f99
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/getinfo.cpp
@@ -0,0 +1,589 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include <windows.h> 
+#if defined(_WIN32) || defined(_WIN64)
+#include <tchar.h>
+#endif
+#include <memory.h>
+//#include <math.h>
+#include <stdio.h>    
+#include <string.h>
+#include "Dtwinver.h"
+
+#if !defined(_WIN32) && !defined(_WIN64)
+  #define _stprintf sprintf
+  #define _tcscat strcat
+  #define LPTSTR LPSTR
+#endif
+
+
+int getinfo(char mytext[1024])
+
+{                                  
+  COSVersion::OS_VERSION_INFO osvi;
+  memset(&osvi, 0, sizeof(osvi));
+#ifdef _WIN32
+  TCHAR sText[512];
+  TCHAR sBuf[100];
+#else
+  char sText[512];
+  char sBuf[100];
+#endif
+
+  COSVersion os;  
+  if (os.GetVersion(&osvi))
+  {
+  #ifndef UNDER_CE
+    _stprintf(sText, _T("OS: "));
+    
+    switch (osvi.EmulatedPlatform)
+    {
+      case COSVersion::Dos:               
+      {
+        _tcscat(sText, _T("DOS"));                
+        break;
+      }
+      case COSVersion::Windows3x:         
+      {
+        _tcscat(sText, _T("Windows"));        
+        if (os.IsWin32sInstalled(&osvi))
+          _tcscat(sText, _T(" (Win32s)"));
+        break;
+      }
+      case COSVersion::WindowsCE:
+      {
+        _tcscat(sText, _T("Windows CE"));        
+        break;
+      }
+      case COSVersion::Windows9x:
+      {
+        if (os.IsWindows95(&osvi))
+          _stprintf(sBuf, _T("Windows 95"));
+        else if (os.IsWindows95SP1(&osvi))
+          _stprintf(sBuf, _T("Windows 95 SP1"));
+        else if (os.IsWindows95OSR2(&osvi))
+          _stprintf(sBuf, _T("Windows 95 OSR2"));
+        else if (os.IsWindows98(&osvi))
+          _stprintf(sBuf, _T("Windows 98"));
+        else if (os.IsWindows98SP1(&osvi))
+          _stprintf(sBuf, _T("Windows 98 SP1"));
+        else if (os.IsWindows98SE(&osvi))
+          _stprintf(sBuf, _T("Windows 98 Second Edition"));
+        else if (os.IsWindowsME(&osvi))
+          _stprintf(sBuf, _T("Windows Millenium Edition"));
+        else
+          _stprintf(sBuf, _T("Windows ??"));
+        _tcscat(sText, sBuf);          
+        break;
+      }
+      case COSVersion::WindowsNT:
+      {
+        if (os.IsNTPreWin2k(&osvi))
+        {
+          _tcscat(sText, _T("Windows NT"));          
+
+          if (os.IsNTWorkstation(&osvi))
+            _tcscat(sText, _T(" (Workstation)"));
+          else if (os.IsNTStandAloneServer(&osvi))
+            _tcscat(sText, _T(" (Server)"));
+          else if (os.IsNTPDC(&osvi))
+            _tcscat(sText, _T(" (Primary Domain Controller)"));
+          else if (os.IsNTBDC(&osvi))
+            _tcscat(sText, _T(" (Backup Domain Controller)"));
+
+          if (os.IsNTDatacenterServer(&osvi))
+            _tcscat(sText, _T(", (Datacenter)"));
+          else if (os.IsNTEnterpriseServer(&osvi))
+            _tcscat(sText, _T(", (Enterprise)"));
+        }
+        else if (os.IsWindows2000(&osvi))
+        {
+          _tcscat(sText, _T("Windows 2000"));          
+
+          if (os.IsWin2000Professional(&osvi))
+            _tcscat(sText, _T(" (Professional)"));
+          else if (os.IsWin2000Server(&osvi))
+            _tcscat(sText, _T(" (Server)"));
+          else if (os.IsWin2000DomainController(&osvi))
+            _tcscat(sText, _T(" (Domain Controller)"));
+
+          if (os.IsWin2000DatacenterServer(&osvi))
+            _tcscat(sText, _T(", (Datacenter)"));
+          else if (os.IsWin2000AdvancedServer(&osvi))
+            _tcscat(sText, _T(", (Advanced Server)"));
+        }
+        else if (os.IsWindowsXPOrWindowsServer2003(&osvi))
+        {
+          if (os.IsXPPersonal(&osvi))
+            _tcscat(sText, _T("Windows XP (Personal)"));          
+          else if (os.IsXPProfessional(&osvi))
+            _tcscat(sText, _T("Windows XP (Professional)"));          
+          else if (os.IsWindowsServer2003(&osvi))
+            _tcscat(sText, _T("Windows Server 2003"));          
+          else if (os.IsDomainControllerWindowsServer2003(&osvi))
+            _tcscat(sText, _T("Windows Server 2003 (Domain Controller)"));          
+
+          if (os.IsDatacenterWindowsServer2003(&osvi))
+            _tcscat(sText, _T(", (Datacenter Edition)"));
+          else if (os.IsEnterpriseWindowsServer2003(&osvi))
+            _tcscat(sText, _T(", (Enterprise Edition)"));
+          else if (os.IsWebWindowsServer2003(&osvi))
+            _tcscat(sText, _T(", (Web Edition)"));
+          else if (os.IsWindowsServer2003(&osvi))
+            _tcscat(sText, _T(", (Standard Edition)"));
+        }
+
+        if (os.IsTerminalServicesInstalled(&osvi))
+          _tcscat(sText, _T(", (Terminal Services)"));
+        if (os.ISSmallBusinessEditionInstalled(&osvi))
+          _tcscat(sText, _T(", (BackOffice Small Business Edition)"));
+        if (os.IsEmbedded(&osvi))
+          _tcscat(sText, _T(", (Embedded)"));
+        if (os.IsTerminalServicesInRemoteAdminMode(&osvi))
+          _tcscat(sText, _T(", (Terminal Services in Remote Admin Mode)"));
+        if (os.IsEmulated64Bit(&osvi))
+          _tcscat(sText, _T(", (64 Bit Edition)"));
+        if (os.IsMediaCenterInstalled(&osvi))
+          _tcscat(sText, _T(", (Media Center Edition)"));
+
+        if (osvi.dwSuiteMask & COSVERSION_SUITE_UNIPROCESSOR_FREE)
+          _tcscat(sText, _T(", (Uniprocessor Free)"));
+        else if (osvi.dwSuiteMask & COSVERSION_SUITE_UNIPROCESSOR_CHECKED)
+          _tcscat(sText, _T(", (Uniprocessor Checked)"));
+        else if (osvi.dwSuiteMask & COSVERSION_SUITE_MULTIPROCESSOR_FREE)
+          _tcscat(sText, _T(", (Multiprocessor Free)"));
+        else if (osvi.dwSuiteMask & COSVERSION_SUITE_MULTIPROCESSOR_CHECKED)
+          _tcscat(sText, _T(", (Multiprocessor Checked)"));
+
+        break;
+      }
+      default: 
+      {
+        _stprintf(sBuf, _T("Unknown OS"));
+        break;
+      }
+    }                     
+
+#ifndef UNDER_CE
+    switch (osvi.EmulatedProcessorType)
+    {
+      case COSVersion::INTEL_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (Intel Processor)"));
+        break;
+      }
+      case COSVersion::MSIL_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (MSIL Processor)"));
+        break;
+      }
+      case COSVersion::MIPS_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (MIPS Processor)"));
+        break;
+      }
+      case COSVersion::ARM_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (ARM Processor)"));
+        break;
+      }
+      case COSVersion::SHX_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (SHX Processor)"));
+        break;
+      }
+      case COSVersion::ALPHA_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (Alpha Processor)"));
+        break;
+      }
+      case COSVersion::ALPHA64_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (Alpha64 Processor)"));
+        break;
+      }
+      case COSVersion::PPC_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (PPC Processor)"));
+        break;
+      }
+      case COSVersion::IA64_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (IA64 Processor)"));
+        break;
+      }
+      case COSVersion::AMD64_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (AMD64 Processor)"));
+        break;
+      }
+      case COSVersion::UNKNOWN_PROCESSOR: //deliberate fallthrough
+      default:
+      {
+        _tcscat(sText, _T(", (Unknown Processor)"));
+        break;
+      }
+    }
+#endif
+
+    _stprintf(sBuf, _T(" v%d."), (int) osvi.dwEmulatedMajorVersion);
+    _tcscat(sText, sBuf);     
+    if (osvi.dwEmulatedMinorVersion % 10)
+    {
+      if (osvi.dwEmulatedMinorVersion > 9)
+        _stprintf(sBuf, _T("%02d"), (int) osvi.dwEmulatedMinorVersion);
+      else
+        _stprintf(sBuf, _T("%01d"), (int) osvi.dwEmulatedMinorVersion);
+    }
+    else
+      _stprintf(sBuf, _T("%01d"), (int) osvi.dwEmulatedMinorVersion / 10);
+    _tcscat(sText, sBuf);                           
+    if (osvi.dwEmulatedBuildNumber)
+    {
+      _stprintf(sBuf, _T(" Build:%d"), (int) osvi.dwEmulatedBuildNumber);
+      _tcscat(sText, sBuf);           
+    }
+    if (osvi.wEmulatedServicePackMajor)       
+    {
+      if (osvi.wEmulatedServicePackMinor)
+      {
+        //Handle the special case of NT 4 SP 6a which Dtwinver ver treats as SP 6.1
+        if (os.IsNTPreWin2k(&osvi) && (osvi.wEmulatedServicePackMajor == 6) && (osvi.wEmulatedServicePackMinor == 1))
+          _stprintf(sBuf, _T(" Service Pack: 6a"));
+        //Handle the special case of XP SP 1a which Dtwinver ver treats as SP 1.1
+        else if (os.IsWindowsXP(&osvi) && (osvi.wEmulatedServicePackMajor == 1) && (osvi.wEmulatedServicePackMinor == 1))
+          _stprintf(sBuf, _T(" Service Pack: 1a"));
+        else       
+          _stprintf(sBuf, _T(" Service Pack:%d.%d"), osvi.wEmulatedServicePackMajor, osvi.wEmulatedServicePackMinor);
+      }
+      else
+        _stprintf(sBuf, _T(" Service Pack:%d"), osvi.wEmulatedServicePackMajor);
+      _tcscat(sText, sBuf);
+    }                            
+    else
+    {
+      if (osvi.wEmulatedServicePackMinor)       
+        _stprintf(sBuf, _T(" Service Pack:0.%d"), osvi.wEmulatedServicePackMinor);
+    }
+
+    _tcscat(sText, _T("\n"));        
+  #endif
+  /*  
+    //CE does not really have a concept of an emulated OS so
+    //lets not bother displaying any info on this on CE
+    if (osvi.UnderlyingPlatform == COSVersion::WindowsCE)
+      _tcscpy(sText, _T("OS: "));
+    else
+      _tcscat(sText, _T("Underlying OS: "));
+                                                         
+    switch (osvi.UnderlyingPlatform)
+    {
+      case COSVersion::Dos:               
+      {
+        _tcscat(sText, _T("DOS"));                
+        break;
+      }
+      case COSVersion::Windows3x:         
+      {
+        _tcscat(sText, _T("Windows"));                
+        break;
+      }
+      case COSVersion::WindowsCE:            
+      {
+        _tcscat(sText, _T("Windows CE"));                
+        break;
+      }
+      case COSVersion::Windows9x:           
+      {
+        if (os.IsWindows95(&osvi))
+          _stprintf(sBuf, _T("Windows 95"));
+        else if (os.IsWindows95SP1(&osvi))
+          _stprintf(sBuf, _T("Windows 95 SP1"));
+        else if (os.IsWindows95OSR2(&osvi))
+          _stprintf(sBuf, _T("Windows 95 OSR2"));
+        else if (os.IsWindows98(&osvi))
+          _stprintf(sBuf, _T("Windows 98"));
+        else if (os.IsWindows98SP1(&osvi))
+          _stprintf(sBuf, _T("Windows 98 SP1"));
+        else if (os.IsWindows98SE(&osvi))
+          _stprintf(sBuf, _T("Windows 98 Second Edition"));
+        else if (os.IsWindowsME(&osvi))
+          _stprintf(sBuf, _T("Windows Millenium Edition"));
+        else
+          _stprintf(sBuf, _T("Windows ??"));
+        _tcscat(sText, sBuf);                  
+        break;
+      }
+      case COSVersion::WindowsNT:    
+      {
+        if (os.IsNTPreWin2k(&osvi))
+        {
+          _tcscat(sText, _T("Windows NT"));                  
+
+          if (os.IsNTWorkstation(&osvi))
+            _tcscat(sText, _T(" (Workstation)"));
+          else if (os.IsNTStandAloneServer(&osvi))
+            _tcscat(sText, _T(" (Server)"));
+          else if (os.IsNTPDC(&osvi))
+            _tcscat(sText, _T(" (Primary Domain Controller)"));
+          else if (os.IsNTBDC(&osvi))
+            _tcscat(sText, _T(" (Backup Domain Controller)"));
+
+          if (os.IsNTDatacenterServer(&osvi))
+            _tcscat(sText, _T(", (Datacenter)"));
+          else if (os.IsNTEnterpriseServer(&osvi))
+            _tcscat(sText, _T(", (Enterprise)"));
+        }
+        else if (os.IsWindows2000(&osvi))
+        {
+          _tcscat(sText, _T("Windows 2000"));                  
+
+          if (os.IsWin2000Professional(&osvi))
+            _tcscat(sText, _T(" (Professional)"));
+          else if (os.IsWin2000Server(&osvi))
+            _tcscat(sText, _T(" (Server)"));
+          else if (os.IsWin2000DomainController(&osvi))
+            _tcscat(sText, _T(" (Domain Controller)"));
+
+          if (os.IsWin2000DatacenterServer(&osvi))
+            _tcscat(sText, _T(", (Datacenter)"));
+          else if (os.IsWin2000AdvancedServer(&osvi))
+            _tcscat(sText, _T(", (Advanced Server)"));
+        }
+        else if (os.IsWindowsXPOrWindowsServer2003(&osvi))
+        {
+          if (os.IsXPPersonal(&osvi))
+            _tcscat(sText, _T("Windows XP (Personal)"));                  
+          else if (os.IsXPProfessional(&osvi))
+            _tcscat(sText, _T("Windows XP (Professional)"));                  
+          else if (os.IsWindowsServer2003(&osvi))
+            _tcscat(sText, _T("Windows Server 2003"));          
+          else if (os.IsDomainControllerWindowsServer2003(&osvi))
+            _tcscat(sText, _T("Windows Server 2003 (Domain Controller)"));          
+
+          if (os.IsDatacenterWindowsServer2003(&osvi))
+            _tcscat(sText, _T(", (Datacenter Edition)"));
+          else if (os.IsEnterpriseWindowsServer2003(&osvi))
+            _tcscat(sText, _T(", (Enterprise Edition)"));
+          else if (os.IsWebWindowsServer2003(&osvi))
+            _tcscat(sText, _T(", (Web Edition)"));
+          else if (os.IsWindowsServer2003(&osvi))
+            _tcscat(sText, _T(", (Standard Edition)"));
+        }
+
+        if (os.IsTerminalServicesInstalled(&osvi))
+          _tcscat(sText, _T(", (Terminal Services)"));
+        if (os.ISSmallBusinessEditionInstalled(&osvi))
+          _tcscat(sText, _T(", (BackOffice Small Business Edition)"));
+        if (os.IsEmbedded(&osvi))
+          _tcscat(sText, _T(", (Embedded)"));
+        if (os.IsTerminalServicesInRemoteAdminMode(&osvi))
+          _tcscat(sText, _T(", (Terminal Services in Remote Admin Mode)"));
+        if (os.IsEmulated64Bit(&osvi))
+          _tcscat(sText, _T(", (64 Bit Edition)"));
+        if (os.IsMediaCenterInstalled(&osvi))
+          _tcscat(sText, _T(", (Media Center Edition)"));
+
+        if (osvi.dwSuiteMask & COSVERSION_SUITE_UNIPROCESSOR_FREE)
+          _tcscat(sText, _T(", (Uniprocessor Free)"));
+        else if (osvi.dwSuiteMask & COSVERSION_SUITE_UNIPROCESSOR_CHECKED)
+          _tcscat(sText, _T(", (Uniprocessor Checked)"));
+        else if (osvi.dwSuiteMask & COSVERSION_SUITE_MULTIPROCESSOR_FREE)
+          _tcscat(sText, _T(", (Multiprocessor Free)"));
+        else if (osvi.dwSuiteMask & COSVERSION_SUITE_MULTIPROCESSOR_CHECKED)
+          _tcscat(sText, _T(", (Multiprocessor Checked)"));
+
+        break;
+      }
+      default:                         
+      {
+        _stprintf(sBuf, _T("Unknown OS"));
+        _tcscat(sText, sBuf);                
+        break;
+      }
+    }                                      
+
+#ifndef UNDER_CE
+    switch (osvi.UnderlyingProcessorType)
+    {
+      case COSVersion::INTEL_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (Intel Processor)"));
+        break;
+      }
+      case COSVersion::MSIL_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (MSIL Processor)"));
+        break;
+      }
+      case COSVersion::MIPS_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (MIPS Processor)"));
+        break;
+      }
+      case COSVersion::ARM_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (ARM Processor)"));
+        break;
+      }
+      case COSVersion::SHX_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (SHX Processor)"));
+        break;
+      }
+      case COSVersion::ALPHA_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (Alpha Processor)"));
+        break;
+      }
+      case COSVersion::PPC_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (PPC Processor)"));
+        break;
+      }
+      case COSVersion::IA64_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (IA64 Processor)"));
+        break;
+      }
+      case COSVersion::AMD64_PROCESSOR:
+      {
+        _tcscat(sText, _T(", (AMD64 Processor)"));
+        break;
+      }
+      case COSVersion::UNKNOWN_PROCESSOR: //deliberate fallthrough
+      default:
+      {
+        _tcscat(sText, _T(", (Unknown Processor)"));
+        break;
+      }
+    }
+#endif
+
+    _stprintf(sBuf, _T(" v%d."), osvi.dwUnderlyingMajorVersion);
+    _tcscat(sText, sBuf);     
+    if (osvi.dwUnderlyingMinorVersion % 10)
+    {
+      if (osvi.dwUnderlyingMinorVersion > 9)
+        _stprintf(sBuf, _T("%02d"), osvi.dwUnderlyingMinorVersion);
+      else
+        _stprintf(sBuf, _T("%01d"), osvi.dwUnderlyingMinorVersion);
+    }
+    else
+      _stprintf(sBuf, _T("%01d"), osvi.dwUnderlyingMinorVersion / 10);
+    _tcscat(sText, sBuf);          
+    if (osvi.dwUnderlyingBuildNumber)
+    {
+      _stprintf(sBuf, _T(" Build:%d"), osvi.dwUnderlyingBuildNumber);
+      _tcscat(sText, sBuf);
+    }
+    if (osvi.wUnderlyingServicePackMajor)       
+    {
+      if (osvi.wUnderlyingServicePackMinor)       
+      {
+        //Handle the special case of NT 4 SP 6a which Dtwinver ver treats as SP 6.1
+        if (os.IsNTPreWin2k(&osvi) && (osvi.wUnderlyingServicePackMajor == 6) && (osvi.wUnderlyingServicePackMinor == 1))
+          _stprintf(sBuf, _T(" Service Pack: 6a"));
+        //Handle the special case of XP SP 1a which Dtwinver ver treats as SP 1.1
+        else if (os.IsWindowsXP(&osvi) && (osvi.wUnderlyingServicePackMajor == 1) && (osvi.wUnderlyingServicePackMinor == 1))
+          _stprintf(sBuf, _T(" Service Pack: 1a"));
+        else
+          _stprintf(sBuf, _T(" Service Pack:%d.%d"), osvi.wUnderlyingServicePackMajor, osvi.wUnderlyingServicePackMinor);
+      }
+      else
+        _stprintf(sBuf, _T(" Service Pack:%d"), osvi.wUnderlyingServicePackMajor);
+      _tcscat(sText, sBuf);
+    }                            
+    else
+    {
+      if (osvi.wUnderlyingServicePackMinor)       
+        _stprintf(sBuf, _T(" Service Pack:0.%d"), osvi.wUnderlyingServicePackMinor);
+    }
+    _tcscat(sText, _T("\n"));    
+
+    //Some extra info for CE
+  #ifdef UNDER_CE
+    if (osvi.UnderlyingPlatform == COSVersion::WindowsCE)
+    {
+      _tcscat(sText, _T("Model: "));
+      _tcscat(sText, osvi.szOEMInfo);
+      _tcscat(sText, _T("\nDevice Type: "));
+      _tcscat(sText, osvi.szPlatformType);
+    }
+  #endif*/ 
+  }
+  else
+    _stprintf(sText, _T("Failed in call to GetOSVersion\n"));
+           
+  
+
+	char UserName[256+1]="";
+	DWORD Size=256+1;
+	if (GetUserName(UserName,&Size)!=0)
+	{
+		strcpy(mytext,"Current user : ");
+		strcat(mytext,UserName);
+	}
+	char ComputerName[256+1]="";
+	if (GetComputerName(ComputerName,&Size)!=0)
+	{
+		strcat(mytext,"\nComputerName : ");
+		strcat(mytext,ComputerName);
+	}
+	///////////////////////////////
+
+    char name[255];
+	char *IP=NULL;
+	PHOSTENT hostinfo;
+		if(gethostname(name, sizeof(name))==0)
+		{
+			if((hostinfo=gethostbyname(name)) != NULL)
+			{
+				IP = inet_ntoa(*(struct in_addr*)* hostinfo->h_addr_list);
+			}
+		}
+	if (IP)
+	{
+	strcat(mytext,"\nIP : ");
+	strcat(mytext,IP);
+	}
+
+	//////////////////////////////////////
+/*	MEMORYSTATUS memoryStatus;
+	ZeroMemory(&memoryStatus,sizeof(MEMORYSTATUS));
+	memoryStatus.dwLength = sizeof (MEMORYSTATUS);
+	
+	::GlobalMemoryStatus (&memoryStatus);
+	
+	sprintf("Installed RAM: %ldMB",(DWORD) ceil(memoryStatus.dwTotalPhys/1024/1024));	
+	sprintf("\r\nMemory Available: %ldKB",(DWORD) (memoryStatus.dwAvailPhys/1024));	
+	sprintf("\r\nPrecent of used RAM: %%%ld\n",memoryStatus.dwMemoryLoad);
+	sprintf("\n");
+	sprintf(sText);*/
+	strcat(mytext,"\n");
+	strcat(mytext,sText);      
+
+  return 0;
+}
diff --git a/ica/win32/winvnc/winvnc/helpers.cpp b/ica/win32/winvnc/winvnc/helpers.cpp
new file mode 100644
index 0000000..1be0219
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/helpers.cpp
@@ -0,0 +1,610 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include <algorithm>
+#include "stdhdrs.h"
+#include "inifile.h"
+#include <string>
+#include <cctype>
+
+//  We first use shellexecute with "runas"
+//  This way we can use UAC and user/passwd
+//	Runas is standard OS, so no security risk
+
+const char winvncSettings[]				= "-settings";
+const char winvncStopservice[]			= "-stopservice";
+const char winvncStartservice[]			= "-startservice";
+const char winvncInstallService[]		= "-install";
+const char winvncUnInstallService[]		= "-uninstall";
+const char winvncSecurityEditor[]		= "-securityeditor";
+
+extern char service_name[];
+
+/////////////////////////////////////////////////////////////////////
+void
+Set_settings_as_admin(char *mycommand)
+{
+	char exe_file_name[MAX_PATH];
+	char commanline[MAX_PATH];
+	GetModuleFileName(0, exe_file_name, MAX_PATH);
+
+	strcpy(commanline, winvncSettings);
+	strcat(commanline, ":");
+	strcat_s(commanline, 260, mycommand);
+
+	SHELLEXECUTEINFO shExecInfo;
+	shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+	shExecInfo.fMask = 0;
+	shExecInfo.hwnd = GetForegroundWindow();
+	shExecInfo.lpVerb = "runas";
+	shExecInfo.lpFile = exe_file_name;
+	shExecInfo.lpParameters = commanline;
+	shExecInfo.lpDirectory = NULL;
+	shExecInfo.nShow = SW_SHOWNORMAL;
+	shExecInfo.hInstApp = NULL;
+	ShellExecuteEx(&shExecInfo);
+}
+
+
+void Copy_to_Secure_from_temp_helper(char *lpCmdLine)
+{
+IniFile myIniFile_In;
+IniFile myIniFile_Out;
+myIniFile_Out.IniFileSetSecure();
+myIniFile_In.IniFileSetTemp(lpCmdLine);
+
+TCHAR *group1=new char[150];
+TCHAR *group2=new char[150];
+TCHAR *group3=new char[150];
+BOOL BUseRegistry;
+LONG MSLogonRequired;
+LONG NewMSLogon;
+LONG locdom1;
+LONG locdom2;
+LONG locdom3;
+LONG DebugMode=2;
+LONG Avilog=0;
+LONG DebugLevel=10;
+LONG DisableTrayIcon;
+LONG LoopbackOnly;
+LONG UseDSMPlugin;
+LONG AllowLoopback;
+LONG AuthRequired;
+LONG ConnectPriority;
+
+char DSMPlugin[128];
+char *authhosts=new char[150];
+
+LONG AllowShutdown=1;
+LONG AllowProperties=1;
+LONG AllowEditClients=1;
+
+LONG FileTransferEnabled=0;
+LONG FTUserImpersonation=1;
+LONG BlankMonitorEnabled=1;
+LONG BlankInputsOnly=0; //PGM
+LONG DefaultScale=1;
+LONG CaptureAlphaBlending=1;
+LONG BlackAlphaBlending=1;
+
+LONG SocketConnect=1;
+LONG HTTPConnect;
+LONG XDMCPConnect;
+LONG AutoPortSelect=1;
+LONG PortNumber;
+LONG HttpPortNumber;
+LONG IdleTimeout;
+
+LONG RemoveWallpaper=1;
+LONG RemoveAero=1;
+
+LONG QuerySetting=1;
+LONG QueryTimeout=10;
+LONG QueryAccept;
+LONG QueryIfNoLogon;
+
+LONG EnableRemoteInputs=1;
+LONG LockSettings=0;
+LONG DisableLocalInputs=0;
+LONG EnableJapInput=0;
+LONG kickrdp=0;
+LONG clearconsole=0;
+
+#define MAXPWLEN 8
+char passwd[MAXPWLEN];
+
+LONG TurboMode=1;
+LONG PollUnderCursor=0;
+LONG PollForeground=0;
+LONG PollFullScreen=1;
+LONG PollConsoleOnly=0;
+LONG PollOnEventOnly=0;
+LONG Driver=0;
+LONG Hook=1;
+LONG Virtual;
+LONG SingleWindow=0;
+char SingleWindowName[32];
+char path[512];
+LONG MaxCpu=40;
+
+//adzm 2010-05-30 - dsmplugin config
+char DSMPluginConfig[512];
+*DSMPluginConfig = '\0';
+
+LONG Primary=1;
+LONG Secondary=0;
+
+
+BUseRegistry = myIniFile_In.ReadInt("admin", "UseRegistry", 0);
+if (!myIniFile_Out.WriteInt("admin", "UseRegistry", BUseRegistry))
+{
+		//error
+		MessageBoxSecure(NULL,"Permission denied:Uncheck [_] Protect my computer... in run as dialog or use user with write permission." ,myIniFile_Out.myInifile,MB_ICONERROR);
+}
+
+MSLogonRequired=myIniFile_In.ReadInt("admin", "MSLogonRequired", false);
+myIniFile_Out.WriteInt("admin", "MSLogonRequired", MSLogonRequired);
+NewMSLogon=myIniFile_In.ReadInt("admin", "NewMSLogon", false);
+myIniFile_Out.WriteInt("admin", "NewMSLogon", NewMSLogon);
+
+
+myIniFile_In.ReadString("admin_auth","group1",group1,150);
+myIniFile_In.ReadString("admin_auth","group2",group2,150);
+myIniFile_In.ReadString("admin_auth","group3",group3,150);
+myIniFile_Out.WriteString("admin_auth", "group1",group1);
+myIniFile_Out.WriteString("admin_auth", "group2",group2);
+myIniFile_Out.WriteString("admin_auth", "group3",group3);
+
+
+
+locdom1=myIniFile_In.ReadInt("admin_auth", "locdom1",0);
+locdom2=myIniFile_In.ReadInt("admin_auth", "locdom2",0);
+locdom3=myIniFile_In.ReadInt("admin_auth", "locdom3",0);
+myIniFile_Out.WriteInt("admin_auth", "locdom1", locdom1);
+myIniFile_Out.WriteInt("admin_auth", "locdom2", locdom2);
+myIniFile_Out.WriteInt("admin_auth", "locdom3", locdom3);
+
+
+DebugMode=myIniFile_In.ReadInt("admin", "DebugMode", 0);
+Avilog=myIniFile_In.ReadInt("admin", "Avilog", 0);
+myIniFile_In.ReadString("admin", "path", path,512);
+DebugLevel=myIniFile_In.ReadInt("admin", "DebugLevel", 0);
+DisableTrayIcon=myIniFile_In.ReadInt("admin", "DisableTrayIcon", false);
+LoopbackOnly=myIniFile_In.ReadInt("admin", "LoopbackOnly", false);
+
+myIniFile_Out.WriteInt("admin", "DebugMode", DebugMode);
+myIniFile_Out.WriteInt("admin", "Avilog", Avilog);
+myIniFile_Out.WriteString("admin", "path", path);
+myIniFile_Out.WriteInt("admin", "DebugLevel", DebugLevel);
+myIniFile_Out.WriteInt("admin", "DisableTrayIcon", DisableTrayIcon);
+myIniFile_Out.WriteInt("admin", "LoopbackOnly", LoopbackOnly);
+
+UseDSMPlugin=myIniFile_In.ReadInt("admin", "UseDSMPlugin", false);
+AllowLoopback=myIniFile_In.ReadInt("admin", "AllowLoopback", false);
+AuthRequired=myIniFile_In.ReadInt("admin", "AuthRequired", true);
+ConnectPriority=myIniFile_In.ReadInt("admin", "ConnectPriority", 0);
+
+myIniFile_Out.WriteInt("admin", "UseDSMPlugin", UseDSMPlugin);
+myIniFile_Out.WriteInt("admin", "AllowLoopback", AllowLoopback);
+myIniFile_Out.WriteInt("admin", "AuthRequired", AuthRequired);
+myIniFile_Out.WriteInt("admin", "ConnectPriority", ConnectPriority);
+
+
+myIniFile_In.ReadString("admin", "DSMPlugin",DSMPlugin,128);
+myIniFile_In.ReadString("admin", "AuthHosts",authhosts,150);
+
+myIniFile_Out.WriteString("admin", "DSMPlugin",DSMPlugin);
+myIniFile_Out.WriteString("admin", "AuthHosts",authhosts);
+
+//adzm 2010-05-30 - dsmplugin config
+myIniFile_In.ReadString("admin", "DSMPluginConfig",DSMPluginConfig,512);
+myIniFile_Out.WriteString("admin", "DSMPluginConfig",DSMPluginConfig);
+
+AllowShutdown=myIniFile_In.ReadInt("admin", "AllowShutdown", true);
+AllowProperties=myIniFile_In.ReadInt("admin", "AllowProperties", true);
+AllowEditClients=myIniFile_In.ReadInt("admin", "AllowEditClients", true);
+myIniFile_Out.WriteInt("admin", "AllowShutdown" ,AllowShutdown);
+myIniFile_Out.WriteInt("admin", "AllowProperties" ,AllowProperties);
+myIniFile_Out.WriteInt("admin", "AllowEditClients" ,AllowEditClients);
+
+
+FileTransferEnabled=myIniFile_In.ReadInt("admin", "FileTransferEnabled", true);
+FTUserImpersonation=myIniFile_In.ReadInt("admin", "FTUserImpersonation", true);
+BlankMonitorEnabled = myIniFile_In.ReadInt("admin", "BlankMonitorEnabled", true);
+BlankInputsOnly = myIniFile_In.ReadInt("admin", "BlankInputsOnly", false); //PGM
+DefaultScale = myIniFile_In.ReadInt("admin", "DefaultScale", 1);
+CaptureAlphaBlending = myIniFile_In.ReadInt("admin", "CaptureAlphaBlending", false); // sf at 2005
+BlackAlphaBlending = myIniFile_In.ReadInt("admin", "BlackAlphaBlending", false); // sf at 2005
+
+Primary = myIniFile_In.ReadInt("admin", "primary", true);
+Secondary = myIniFile_In.ReadInt("admin", "secondary", false);
+
+myIniFile_Out.WriteInt("admin", "FileTransferEnabled", FileTransferEnabled);
+myIniFile_Out.WriteInt("admin", "FTUserImpersonation", FTUserImpersonation);
+myIniFile_Out.WriteInt("admin", "BlankMonitorEnabled", BlankMonitorEnabled);
+myIniFile_Out.WriteInt("admin", "BlankInputsOnly", BlankInputsOnly); //PGM
+myIniFile_Out.WriteInt("admin", "DefaultScale", DefaultScale);
+myIniFile_Out.WriteInt("admin", "CaptureAlphaBlending", CaptureAlphaBlending);
+myIniFile_Out.WriteInt("admin", "BlackAlphaBlending", BlackAlphaBlending);
+
+myIniFile_Out.WriteInt("admin", "primary", Primary);
+myIniFile_Out.WriteInt("admin", "secondary", Secondary);
+
+
+	// Connection prefs
+SocketConnect=myIniFile_In.ReadInt("admin", "SocketConnect", true);
+HTTPConnect=myIniFile_In.ReadInt("admin", "HTTPConnect", true);
+XDMCPConnect=myIniFile_In.ReadInt("admin", "XDMCPConnect", true);
+AutoPortSelect=myIniFile_In.ReadInt("admin", "AutoPortSelect", true);
+PortNumber=myIniFile_In.ReadInt("admin", "PortNumber", 0);
+HttpPortNumber=myIniFile_In.ReadInt("admin", "HTTPPortNumber",0);
+IdleTimeout=myIniFile_In.ReadInt("admin", "IdleTimeout", 0);
+myIniFile_Out.WriteInt("admin", "SocketConnect", SocketConnect);
+myIniFile_Out.WriteInt("admin", "HTTPConnect", HTTPConnect);
+myIniFile_Out.WriteInt("admin", "XDMCPConnect", XDMCPConnect);
+myIniFile_Out.WriteInt("admin", "AutoPortSelect", AutoPortSelect);
+myIniFile_Out.WriteInt("admin", "PortNumber", PortNumber);
+myIniFile_Out.WriteInt("admin", "HTTPPortNumber", HttpPortNumber);
+myIniFile_Out.WriteInt("admin", "IdleTimeout", IdleTimeout);
+	
+RemoveWallpaper=myIniFile_In.ReadInt("admin", "RemoveWallpaper", 0);
+RemoveAero=myIniFile_In.ReadInt("admin", "RemoveAero", 0);
+myIniFile_Out.WriteInt("admin", "RemoveWallpaper", RemoveWallpaper);
+myIniFile_Out.WriteInt("admin", "RemoveAero", RemoveAero);
+
+	// Connection querying settings
+QuerySetting=myIniFile_In.ReadInt("admin", "QuerySetting", 0);
+QueryTimeout=myIniFile_In.ReadInt("admin", "QueryTimeout", 0);
+QueryAccept=myIniFile_In.ReadInt("admin", "QueryAccept", 0);
+QueryIfNoLogon=myIniFile_In.ReadInt("admin", "QueryIfNoLogon", 0);
+myIniFile_Out.WriteInt("admin", "QuerySetting", QuerySetting);
+myIniFile_Out.WriteInt("admin", "QueryTimeout", QueryTimeout);
+myIniFile_Out.WriteInt("admin", "QueryAccept", QueryAccept);
+myIniFile_Out.WriteInt("admin", "QueryIfNoLogon", QueryIfNoLogon);
+
+myIniFile_In.ReadPassword(passwd,MAXPWLEN);
+myIniFile_Out.WritePassword(passwd);
+memset(passwd, '\0', MAXPWLEN); //PGM 
+myIniFile_In.ReadPassword2(passwd,MAXPWLEN); //PGM
+myIniFile_Out.WritePassword2(passwd); //PGM
+
+EnableRemoteInputs=myIniFile_In.ReadInt("admin", "InputsEnabled", 0);
+LockSettings=myIniFile_In.ReadInt("admin", "LockSetting", 0);
+DisableLocalInputs=myIniFile_In.ReadInt("admin", "LocalInputsDisabled", 0);
+EnableJapInput=myIniFile_In.ReadInt("admin", "EnableJapInput", 0);
+kickrdp=myIniFile_In.ReadInt("admin", "kickrdp", 0);
+clearconsole=myIniFile_In.ReadInt("admin", "clearconsole", 0);
+
+myIniFile_Out.WriteInt("admin", "InputsEnabled", EnableRemoteInputs);
+myIniFile_Out.WriteInt("admin", "LockSetting", LockSettings);
+myIniFile_Out.WriteInt("admin", "LocalInputsDisabled", DisableLocalInputs);	
+myIniFile_Out.WriteInt("admin", "EnableJapInput", EnableJapInput);	
+myIniFile_Out.WriteInt("admin", "kickrdp", kickrdp);
+myIniFile_Out.WriteInt("admin", "clearconsole", clearconsole);
+
+
+
+TurboMode = myIniFile_In.ReadInt("poll", "TurboMode", 0);
+PollUnderCursor=myIniFile_In.ReadInt("poll", "PollUnderCursor", 0);
+PollForeground=myIniFile_In.ReadInt("poll", "PollForeground", 0);
+PollFullScreen=myIniFile_In.ReadInt("poll", "PollFullScreen", 0);
+PollConsoleOnly=myIniFile_In.ReadInt("poll", "OnlyPollConsole", 0);
+PollOnEventOnly=myIniFile_In.ReadInt("poll", "OnlyPollOnEvent", 0);
+MaxCpu=myIniFile_In.ReadInt("poll", "MaxCpu", 0);
+Driver=myIniFile_In.ReadInt("poll", "EnableDriver", 0);
+Hook=myIniFile_In.ReadInt("poll", "EnableHook", 0);
+Virtual=myIniFile_In.ReadInt("poll", "EnableVirtual", 0);
+
+SingleWindow=myIniFile_In.ReadInt("poll","SingleWindow",SingleWindow);
+myIniFile_In.ReadString("poll", "SingleWindowName", SingleWindowName,32);
+
+myIniFile_Out.WriteInt("poll", "TurboMode", TurboMode);
+myIniFile_Out.WriteInt("poll", "PollUnderCursor", PollUnderCursor);
+myIniFile_Out.WriteInt("poll", "PollForeground", PollForeground);
+myIniFile_Out.WriteInt("poll", "PollFullScreen", PollFullScreen);
+myIniFile_Out.WriteInt("poll", "OnlyPollConsole",PollConsoleOnly);
+myIniFile_Out.WriteInt("poll", "OnlyPollOnEvent", PollOnEventOnly);
+myIniFile_Out.WriteInt("poll", "MaxCpu", MaxCpu);
+myIniFile_Out.WriteInt("poll", "EnableDriver", Driver);
+myIniFile_Out.WriteInt("poll", "EnableHook", Hook);
+myIniFile_Out.WriteInt("poll", "EnableVirtual", Virtual);
+
+myIniFile_Out.WriteInt("poll", "SingleWindow", SingleWindow);
+myIniFile_Out.WriteString("poll", "SingleWindowName", SingleWindowName);
+
+MaxCpu=myIniFile_In.ReadInt("poll", "MaxCpu",MaxCpu);
+myIniFile_Out.WriteInt("poll", "MaxCpu", MaxCpu);
+
+DeleteFile(lpCmdLine);
+}
+void
+Real_settings(char *mycommand)
+{
+Copy_to_Secure_from_temp_helper(mycommand);
+}
+
+void
+Set_stop_service_as_admin()
+{
+	char exe_file_name[MAX_PATH];
+	GetModuleFileName(0, exe_file_name, MAX_PATH);
+
+	SHELLEXECUTEINFO shExecInfo;
+
+	shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+	shExecInfo.fMask = 0;
+	shExecInfo.hwnd = GetForegroundWindow();
+	shExecInfo.lpVerb = "runas";
+	shExecInfo.lpFile = exe_file_name;
+	shExecInfo.lpParameters = winvncStopservice;
+	shExecInfo.lpDirectory = NULL;
+	shExecInfo.nShow = SW_SHOWNORMAL;
+	shExecInfo.hInstApp = NULL;
+	ShellExecuteEx(&shExecInfo);
+
+}
+
+void
+Real_stop_service()
+{
+    char command[MAX_PATH + 32]; // 29 January 2008 jdp 
+    _snprintf(command, sizeof command, "net stop \"%s\"", service_name);
+	WinExec(command,SW_HIDE);
+}
+
+void
+Set_start_service_as_admin()
+{
+	char exe_file_name[MAX_PATH];
+	GetModuleFileName(0, exe_file_name, MAX_PATH);
+
+	SHELLEXECUTEINFO shExecInfo;
+
+	shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+	shExecInfo.fMask = 0;
+	shExecInfo.hwnd = GetForegroundWindow();
+	shExecInfo.lpVerb = "runas";
+	shExecInfo.lpFile = exe_file_name;
+	shExecInfo.lpParameters = winvncStartservice;
+	shExecInfo.lpDirectory = NULL;
+	shExecInfo.nShow = SW_SHOWNORMAL;
+	shExecInfo.hInstApp = NULL;
+	ShellExecuteEx(&shExecInfo);
+
+}
+
+void Open_homepage()
+{
+	ShellExecute(0, "open", "http://www.uvnc.com", 0, 0, 1);
+}
+
+void Open_forum()
+{
+	ShellExecute(0, "open", "http://forum.uvnc.com", 0, 0, 1);
+}
+
+void
+Real_start_service()
+{
+    char command[MAX_PATH + 32]; // 29 January 2008 jdp 
+    _snprintf(command, sizeof command, "net start \"%s\"", service_name);
+	WinExec(command,SW_HIDE);
+}
+
+void
+Set_install_service_as_admin()
+{
+	char exe_file_name[MAX_PATH];
+	GetModuleFileName(0, exe_file_name, MAX_PATH);
+
+	SHELLEXECUTEINFO shExecInfo;
+
+	shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+	shExecInfo.fMask = 0;
+	shExecInfo.hwnd = GetForegroundWindow();
+	shExecInfo.lpVerb = "runas";
+	shExecInfo.lpFile = exe_file_name;
+	shExecInfo.lpParameters = winvncInstallService;
+	shExecInfo.lpDirectory = NULL;
+	shExecInfo.nShow = SW_SHOWNORMAL;
+	shExecInfo.hInstApp = NULL;
+	ShellExecuteEx(&shExecInfo);
+
+}
+
+void
+Set_uninstall_service_as_admin()
+{
+	char exe_file_name[MAX_PATH];
+	GetModuleFileName(0, exe_file_name, MAX_PATH);
+
+	SHELLEXECUTEINFO shExecInfo;
+
+	shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+	shExecInfo.fMask = 0;
+	shExecInfo.hwnd = GetForegroundWindow();
+	shExecInfo.lpVerb = "runas";
+	shExecInfo.lpFile = exe_file_name;
+	shExecInfo.lpParameters = winvncUnInstallService;
+	shExecInfo.lpDirectory = NULL;
+	shExecInfo.nShow = SW_SHOWNORMAL;
+	shExecInfo.hInstApp = NULL;
+	ShellExecuteEx(&shExecInfo);
+
+}
+
+void
+winvncSecurityEditorHelper_as_admin()
+{
+	char exe_file_name[MAX_PATH];
+	GetModuleFileName(0, exe_file_name, MAX_PATH);
+
+	SHELLEXECUTEINFO shExecInfo;
+
+	shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+	shExecInfo.fMask = 0;
+	shExecInfo.hwnd = GetForegroundWindow();
+	shExecInfo.lpVerb = "runas";
+	shExecInfo.lpFile = exe_file_name;
+	shExecInfo.lpParameters = winvncSecurityEditor;
+	shExecInfo.lpDirectory = NULL;
+	shExecInfo.nShow = SW_SHOWNORMAL;
+	shExecInfo.hInstApp = NULL;
+	ShellExecuteEx(&shExecInfo);
+}
+void make_upper(std::string& str)
+{
+    // convert to uppercase
+    std::transform(str.begin(), str.end(), str.begin(), toupper);//(int(*)(int))
+}
+//**************************************************************************
+// GetServiceName() looks up service by application path. If found, the function
+// fills pszServiceName (must be at least 256+1 characters long).
+bool GetServiceName(TCHAR *pszAppPath, TCHAR *pszServiceName)
+{
+    // prepare given application path for matching against service list
+    std::string appPath(pszAppPath);
+    // convert to uppercase
+    make_upper(appPath);
+
+	// connect to serice control manager
+    SC_HANDLE hManager = OpenSCManager(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE);
+    if (!hManager)
+        return false;
+
+    DWORD dwBufferSize = 0;
+    DWORD dwCount = 0;
+    DWORD dwPosition = 0;
+    bool bResult = false;
+
+    // call EnumServicesStatus() the first time to receive services array size
+    BOOL bOK = EnumServicesStatus(
+        hManager,
+        SERVICE_WIN32,
+        SERVICE_STATE_ALL,
+        NULL,
+        0,
+        &dwBufferSize,
+        &dwCount,
+        &dwPosition);
+    if (!bOK && GetLastError() == ERROR_MORE_DATA)
+    {
+        // allocate space per results from the first call
+        ENUM_SERVICE_STATUS *pServices = (ENUM_SERVICE_STATUS *) new UCHAR[dwBufferSize];
+        if (pServices)
+        {
+            // call EnumServicesStatus() the second time to actually get the services array
+            bOK = EnumServicesStatus(
+                hManager,
+                SERVICE_WIN32,
+                SERVICE_STATE_ALL,
+                pServices,
+                dwBufferSize,
+                &dwBufferSize,
+                &dwCount,
+                &dwPosition);
+            if (bOK)
+            {
+                // iterate through all services returned by EnumServicesStatus()
+                for (DWORD i = 0; i < dwCount && !bResult; i++)
+                {
+                    // open service
+                    SC_HANDLE hService = OpenService(hManager,
+                        pServices[i].lpServiceName,
+                        GENERIC_READ);
+                    if (!hService)
+                        break;
+
+                    // call QueryServiceConfig() the first time to receive buffer size
+                    bOK = QueryServiceConfig(
+                        hService,
+                        NULL,
+                        0,
+                        &dwBufferSize);
+                    if (!bOK && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
+                    {
+                        // allocate space per results from the first call
+                        QUERY_SERVICE_CONFIG *pServiceConfig = (QUERY_SERVICE_CONFIG *) new UCHAR[dwBufferSize];
+                        if (pServiceConfig)
+                        {
+                            // call EnumServicesStatus() the second time to actually get service config
+                            bOK = QueryServiceConfig(
+                                hService,
+                                pServiceConfig,
+                                dwBufferSize,
+                                &dwBufferSize);
+                            if (bOK)
+                            {
+                                // match given application name against executable path in the service config
+                                std::string servicePath(pServiceConfig->lpBinaryPathName);
+                                make_upper(servicePath);
+                                if (servicePath.find(appPath.c_str()) != (size_t) -1)
+                                {
+                                    strncpy(pszServiceName, pServices[i].lpServiceName, 256);
+                                    pszServiceName[255] = 0;
+                                }
+                            }
+
+                            delete [] (UCHAR *) pServiceConfig;
+                        }
+                    }
+
+                    CloseServiceHandle(hService);
+                }
+            }
+
+            delete [] (UCHAR *) pServices;
+        }
+    }
+
+    // disconnect from serice control manager
+    CloseServiceHandle(hManager);
+
+    return bResult;
+}
+extern BOOL	m_fRunningFromExternalService;
+DWORD MessageBoxSecure(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType)
+{
+	DWORD retunvalue;
+	if (m_fRunningFromExternalService)
+	{
+		HDESK desktop=NULL;
+		HDESK old_desktop;
+		desktop = OpenInputDesktop(0, FALSE,DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |DESKTOP_SWITCHDESKTOP | GENERIC_WRITE);
+		old_desktop = GetThreadDesktop(GetCurrentThreadId());
+		if (desktop && 	old_desktop && old_desktop!=desktop)
+			{					
+					SetThreadDesktop(desktop);
+					retunvalue=MessageBox(hWnd,lpText,lpCaption,uType);
+					SetThreadDesktop(old_desktop);
+					CloseDesktop(desktop);
+			}
+		else retunvalue=0;
+	}
+	else
+	{
+		retunvalue=MessageBox(hWnd,lpText,lpCaption,uType);
+	}
+	return retunvalue;
+}
diff --git a/ica/win32/winvnc/winvnc/httpconnect.cpp b/ica/win32/winvnc/winvnc/httpconnect.cpp
new file mode 100644
index 0000000..23d6891
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/httpconnect.cpp
@@ -0,0 +1,1485 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "httpconnect.h"
+
+PARAMETER_ITEM parameter_table[] = {
+    { ENV_SOCKS_SERVER, NULL },
+    { ENV_SOCKS5_SERVER, NULL },
+    { ENV_SOCKS4_SERVER, NULL },
+    { ENV_SOCKS_RESOLVE, NULL },
+    { ENV_SOCKS5_RESOLVE, NULL },
+    { ENV_SOCKS4_RESOLVE, NULL },
+    { ENV_SOCKS5_USER, NULL },
+    { ENV_SOCKS5_PASSWD, NULL },
+    { ENV_SOCKS5_PASSWORD, NULL },
+    { ENV_HTTP_PROXY, NULL },
+    { ENV_HTTP_PROXY_USER, NULL },
+    { ENV_HTTP_PROXY_PASSWORD, NULL },
+    { ENV_CONNECT_USER, NULL },
+    { ENV_CONNECT_PASSWORD, NULL },
+    { ENV_SSH_ASKPASS, NULL },
+    { ENV_SOCKS5_DIRECT, NULL },
+    { ENV_SOCKS4_DIRECT, NULL },
+    { ENV_SOCKS_DIRECT, NULL },
+    { ENV_HTTP_DIRECT, NULL },
+    { ENV_CONNECT_DIRECT, NULL },
+    { ENV_SOCKS5_AUTH, NULL },
+    { NULL, NULL }
+};
+
+LOOKUP_ITEM socks4_rep_names[] = {
+    { SOCKS4_REP_SUCCEEDED,  "request granted (succeeded)"},
+    { SOCKS4_REP_REJECTED,   "request rejected or failed"},
+    { SOCKS4_REP_IDENT_FAIL, "cannot connect identd"},
+    { SOCKS4_REP_USERID,     "user id not matched"},
+    { -1, NULL }
+};
+
+LOOKUP_ITEM socks5_rep_names[] = {
+    { SOCKS5_REP_SUCCEEDED, "succeeded"},
+    { SOCKS5_REP_FAIL,      "general SOCKS server failure"},
+    { SOCKS5_REP_NALLOWED,  "connection not allowed by ruleset"},
+    { SOCKS5_REP_NUNREACH,  "Network unreachable"},
+    { SOCKS5_REP_HUNREACH,  "Host unreachable"},
+    { SOCKS5_REP_REFUSED,   "connection refused"},
+    { SOCKS5_REP_EXPIRED,   "TTL expired"},
+    { SOCKS5_REP_CNOTSUP,   "Command not supported"},
+    { SOCKS5_REP_ANOTSUP,   "Address not supported"},
+    { SOCKS5_REP_INVADDR,   "Invalid address"},
+    { -1, NULL }
+};
+
+AUTH_METHOD_ITEM socks5_auth_table[] = {
+    { "none", SOCKS5_AUTH_NOAUTH },
+    { "gssapi", SOCKS5_AUTH_GSSAPI },
+    { "userpass", SOCKS5_AUTH_USERPASS },
+    { "chap", SOCKS5_AUTH_CHAP },
+    { NULL, -1 },
+};
+
+const char *digits    = "0123456789";
+const char *dotdigits = "0123456789.";
+char *method_names[] = { "UNDECIDED", "DIRECT", "SOCKS", "HTTP", "TELNET" };
+
+httpconnect::~httpconnect()
+{
+}
+httpconnect::httpconnect()
+{
+	relay_method = METHOD_UNDECIDED;          
+	relay_host = NULL;                        
+	relay_port = 0;                        
+	relay_user = NULL;  
+	dest_port = 0;
+	f_debug = 0;
+	proxy_auth_type = PROXY_AUTH_NONE;
+	local_port = 0; 
+	local_type = LOCAL_STDIO;
+	socks_version = 5; 
+	socks_resolve = RESOLVE_UNKNOWN;
+	f_report = 1;
+	socks5_auth = NULL;
+	n_direct_addr_list = 0;
+}
+
+const char *base64_table =
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+/* packet operation macro */
+
+//int askpassbox(char *input, char *inuser, char *output, char *outuser);
+
+void *
+httpconnect::xmalloc (size_t size)
+{
+    void *ret = malloc(size);
+    return ret;
+}
+
+void
+httpconnect::downcase( char *buf )
+{
+    while ( *buf ) {
+        if ( isupper(*buf) )
+            *buf += 'a'-'A';
+        buf++;
+    }
+}
+
+char *
+httpconnect::expand_host_and_port (const char *fmt, const char *host, int port)
+{
+    const char *src;
+    char *buf, *dst;//, *ptr;
+    size_t len = strlen(fmt) + strlen(host) + 20;
+    buf = (char *)xmalloc (len);
+    dst = buf;
+    src = fmt;
+    
+    while (*src) {
+	if (*src == '%') {
+	    switch (src[1]) {
+	    case 'h':
+		strcpy (dst, host);
+		src += 2;
+		break;
+	    case 'p':
+		sprintf (dst, "%d", port);
+		src += 2;
+		break;
+	    default:
+		src ++;
+		break;
+	    }
+	    dst = buf + strlen (buf);
+	} else if (*src == '\\') {
+	    switch (src[1]) {
+	    case 'r':				/* CR */
+		*dst++ = '\r';
+		src += 2;
+		break;
+	    case 'n':				/* LF */
+		*dst++ = '\n';
+		src += 2;
+		break;
+	    case 't':				/* TAB */
+		*dst++ = '\t';
+		src += 2;
+		break;
+	    default:
+		src ++;
+		break;
+	    }
+	} else {
+	    /* usual */
+	    *dst++ = *src++;
+	}
+	*dst = '\0';
+    }
+    assert (strlen(buf) < len);
+    return buf;
+}
+
+
+int
+httpconnect::lookup_resolve( const char *str )
+{
+    char *buf = _strdup( str );
+    int ret;
+
+    downcase( buf );
+    if ( strcmp( buf, "both" ) == 0 )
+        ret = RESOLVE_BOTH;
+    else if ( strcmp( buf, "remote" ) == 0 )
+        ret = RESOLVE_REMOTE;
+    else if ( strcmp( buf, "local" ) == 0 )
+        ret = RESOLVE_LOCAL;
+    else if ( strspn(buf, dotdigits) == strlen(buf) ) {
+        ret = RESOLVE_LOCAL;                    /* this case is also 'local' */
+        socks_ns.sin_addr.s_addr = inet_addr(buf);
+        socks_ns.sin_family = AF_INET;
+    }
+    else
+        ret = RESOLVE_UNKNOWN;
+    free(buf);
+    return ret;
+}
+
+char *
+httpconnect::getusername(void)
+{
+    static char buf[1024];
+    DWORD size = sizeof(buf);
+    buf[0] = '\0';
+    GetUserName( buf, &size);
+    return buf;
+}
+
+/* expect
+   check STR is begin with substr with case-ignored comparison.
+   Return 1 if matched, otherwise 0.
+*/
+int
+httpconnect::expect( char *str, char *substr)
+{
+    int len = strlen(substr);
+    while ( 0 < len-- ) {
+        if ( toupper(*str) != toupper(*substr) )
+            return 0;                           /* not matched */
+        str++, substr++;
+    }
+    return 1;                   /* good, matched */
+}
+
+PARAMETER_ITEM*
+httpconnect::find_parameter_item(const char* name)
+{
+    int i;
+    for( i = 0; parameter_table[i].name != NULL; i++ ){
+        if ( strncmp(name, parameter_table[i].name, strlen(parameter_table[i].name)) == 0 )
+            return &parameter_table[i];
+    }
+    return NULL;
+}
+
+char*
+httpconnect::getparam(const char* name)
+{
+    char *value = getenv(name);
+    if ( value == NULL ){
+        PARAMETER_ITEM *item = find_parameter_item(name);
+        if ( item != NULL )
+            value = item->value;
+    }
+    return value;
+}
+
+
+/** DIRECT connection **/
+
+void
+httpconnect::mask_addr (void *addr, void *mask, int addrlen)
+{
+    char *a, *m;
+    a =(char*) addr;
+    m = (char *)mask;
+    while ( 0 < addrlen-- )
+        *a++ &= *m++;
+}
+
+int
+httpconnect::add_direct_addr (struct in_addr *addr, struct in_addr *mask, int negative)
+{
+    struct in_addr iaddr;
+    char *s;
+    if ( MAX_DIRECT_ADDR_LIST <= n_direct_addr_list ) {
+        return -1;
+    }
+    iaddr = *addr;
+    mask_addr(&iaddr, mask, sizeof(iaddr));
+    s = _strdup(inet_ntoa(iaddr));
+    free(s);
+    memcpy( &direct_addr_list[n_direct_addr_list].addr,
+            &iaddr, sizeof(iaddr));
+    memcpy( &direct_addr_list[n_direct_addr_list].mask,
+            mask, sizeof(*mask));
+    direct_addr_list[n_direct_addr_list].negative = negative;
+    n_direct_addr_list++;
+    return 0;
+}
+
+int
+httpconnect::parse_addr_pair (const char *str, struct in_addr *addr, struct in_addr *mask)
+{
+    const char *ptr;
+    u_char *dsta, *dstm;
+    int i, n;
+
+    assert( str != NULL );
+    addr->s_addr = 0;
+    mask->s_addr = 0;
+    ptr = str;
+    dsta = (u_char*)&addr->s_addr;
+    dstm = (u_char*)&mask->s_addr;
+    for (i=0; i<4; i++ ) {
+        if ( *ptr == '\0' )
+            break;              /* case of format #3 */
+        if ( !isdigit(*ptr) )
+            return -1;          /* format error: */
+        *dsta++ = atoi( ptr );
+        *dstm++ = 255;          /* automatic mask for format #3 */
+        while ( isdigit(*ptr) ) /* skip digits */
+            ptr++;
+        if ( *ptr == '.' )
+            ptr++;
+        else
+            break;
+    }
+    /* At this point, *ptr points '/' or EOS ('\0') */
+    if ( *ptr == '\0' )
+        return 0;                       /* complete as format #3 */
+    if ( *ptr != '/' )
+        return -1;                      /* format error */
+    /* Now parse mask for format #1 or #2 */
+    ptr++;
+    mask->s_addr = 0;                   /* clear automatic mask */
+
+    if ( strchr( ptr, '.') ) {
+        /* case of format #1 */
+        dstm = (u_char*)&mask->s_addr;
+        for (i=0; i<4; i++) {
+            if ( !isdigit(*ptr) )
+                return -1;              /* format error: */
+            *dstm++ = atoi(ptr);
+            while ( isdigit(*ptr) )     /* skip digits */
+                ptr++;
+            if ( *ptr == '.' )
+                ptr++;
+            else
+                break;                  /* from for loop */
+        }
+        /* complete as format #1 */
+    } else {
+        /* case of format #2 */
+        if ( !isdigit(*ptr) )
+            return -1;                  /* format error: */
+        n = atoi(ptr);
+        if ( n<0 || 32<n)
+            return -1;                  /* format error */
+        mask->s_addr = (n==0)? 0: htonl(((u_long)0xFFFFFFFF)<<(32-n));
+        /* complete as format #1 */
+    }
+    return 0;
+}
+
+void
+httpconnect::initialize_direct_addr (void)
+{
+    int negative;
+    int n_entries;
+    char *env = NULL, *beg, *next, *envkey = NULL;
+    struct in_addr addr, mask;
+
+    if ( relay_method == METHOD_SOCKS ){
+        if ( socks_version == 5 )
+            envkey = ENV_SOCKS5_DIRECT;
+        else
+            envkey = ENV_SOCKS4_DIRECT;
+        env = getparam(envkey);
+        if ( env == NULL )
+            env = getparam(ENV_SOCKS_DIRECT);
+    } else if ( relay_method == METHOD_HTTP ){
+        env = getparam(ENV_HTTP_DIRECT);
+    }
+
+    if ( env == NULL )
+        env = getparam(ENV_CONNECT_DIRECT);
+
+    if ( env == NULL )
+        return;                 /* no entry */
+    env = _strdup( env );        /* reallocate to modify */
+    beg = next = env;
+    n_entries = 0;
+    do {
+        if ( MAX_DIRECT_ADDR_LIST <= n_entries ) {
+            break;              /* from do loop */
+        }
+        next = strchr( beg, ',');
+        if ( next != NULL )
+            *next++ = '\0';
+        addr.s_addr = 0;
+        mask.s_addr = 0;
+        if (*beg == '!') {
+            negative = 1;
+            beg++;
+        } else
+            negative = 0;
+        if ( !parse_addr_pair( beg, &addr, &mask ) ) {
+            add_direct_addr( &addr, &mask, negative );
+        } else {
+            return;
+        }
+        if ( next != NULL )
+            beg = next;
+    } while ( next != NULL );
+
+    free( env );
+    return;
+}
+
+int
+httpconnect::cmp_addr (void *addr1, void *addr2, int addrlen)
+{
+    return memcmp( addr1, addr2, addrlen );
+}
+
+int
+httpconnect::is_direct_address (const struct sockaddr_in *addr)
+{
+    int i;
+    struct in_addr saddr, iaddr;
+
+    saddr = addr->sin_addr;
+
+    /* Note: assume IPV4 address !! */
+    for (i=0; i<n_direct_addr_list; i++ ) {
+        iaddr = saddr;
+        mask_addr( &iaddr, &direct_addr_list[i].mask,
+                   sizeof(struct in_addr));
+        if (cmp_addr(&iaddr, &direct_addr_list[i].addr,
+                     sizeof(struct in_addr)) == 0) {
+            if (direct_addr_list[i].negative) {
+                return 0;       /* not direct */
+            }
+            if (!direct_addr_list[i].negative) {               
+                return 1;       /* direct*/
+            }
+        }
+    }
+    return 0;                   /* not direct */
+}
+
+char *
+httpconnect::determine_relay_user ()
+{
+    char *user = NULL;
+    /* get username from environment variable, or system. */
+    if (relay_method == METHOD_SOCKS) {
+        if (user == NULL && socks_version == 5)
+            user = getparam (ENV_SOCKS5_USER);
+        if (user == NULL && socks_version == 4)
+            user = getparam (ENV_SOCKS4_USER);
+        if (user == NULL)
+            user = getparam (ENV_SOCKS_USER);
+    } else if (relay_method == METHOD_HTTP) {
+        if (user == NULL)
+            user = getparam (ENV_HTTP_PROXY_USER);
+    }
+    if (user == NULL)
+        user = getparam (ENV_CONNECT_USER);
+    /* determine relay user by system call if not yet. */
+    if (user == NULL)
+        user = getusername();
+    return user;
+}
+
+char *
+httpconnect::determine_relay_password ()
+{
+    char *pass = NULL;
+    if (pass == NULL && relay_method == METHOD_HTTP)
+        pass = getparam(ENV_HTTP_PROXY_PASSWORD);
+    if (pass == NULL && relay_method == METHOD_SOCKS)
+        pass = getparam(ENV_SOCKS5_PASSWD);
+    if (pass == NULL && relay_method == METHOD_SOCKS)
+        pass = getparam(ENV_SOCKS5_PASSWORD);
+    if (pass == NULL)
+        pass = getparam(ENV_CONNECT_PASSWORD);
+    return pass;
+}
+
+
+int
+httpconnect::set_relay( int method, char *spec )
+{
+    char *buf, *sep, *resolve;
+
+    relay_method = method;
+    initialize_direct_addr();
+    if (n_direct_addr_list == 0) {
+       
+    } else {
+        int i;
+        for ( i=0; i<n_direct_addr_list; i++ ) {
+            char *s1, *s2;
+            s1 = _strdup(inet_ntoa(direct_addr_list[i].addr));
+            s2 = _strdup(inet_ntoa(direct_addr_list[i].mask));
+            free(s1);
+            free(s2);
+        }
+    }
+
+    switch ( method ) {
+    case METHOD_DIRECT:
+        return -1;                              /* nothing to do */
+
+    case METHOD_SOCKS:
+        if ( spec == NULL ) {
+            switch ( socks_version ) {
+            case 5:
+                spec = getparam(ENV_SOCKS5_SERVER);
+                break;
+            case 4:
+                spec = getparam(ENV_SOCKS4_SERVER);
+                break;
+            }
+        }
+        if ( spec == NULL )
+            spec = getparam(ENV_SOCKS_SERVER);
+
+        if ( spec == NULL )
+            return 0;
+        relay_port = 1080;                      /* set default first */
+
+        /* determine resolve method */
+        if ( socks_resolve == RESOLVE_UNKNOWN ) {
+            if ( ((socks_version == 5) &&
+                  ((resolve = getparam(ENV_SOCKS5_RESOLVE)) != NULL)) ||
+                 ((socks_version == 4) &&
+                  ((resolve = getparam(ENV_SOCKS4_RESOLVE)) != NULL)) ||
+                 ((resolve = getparam(ENV_SOCKS_RESOLVE)) != NULL) ) {
+                socks_resolve = lookup_resolve( resolve );
+                if ( socks_resolve == RESOLVE_UNKNOWN )
+                     return 0;
+            } else {
+                /* default */
+                if ( socks_version == 5 )
+                    socks_resolve = RESOLVE_REMOTE;
+                else
+                    socks_resolve = RESOLVE_LOCAL;
+            }
+        }
+        break;
+
+    case METHOD_HTTP:
+        if ( spec == NULL )
+            spec = getparam(ENV_HTTP_PROXY);
+        if ( spec == NULL )
+             return 0;
+        relay_port = 80;                        /* set default first */
+        break;
+    }
+
+    if (expect( spec, HTTP_PROXY_PREFIX)) {
+        /* URL format like: "http://server:port/" */
+        /* extract server:port part */
+        buf = _strdup( spec + strlen(HTTP_PROXY_PREFIX));
+        buf[strcspn(buf, "/")] = '\0';
+    } else {
+        /* assume spec is aready "server:port" format */
+        buf = _strdup( spec );
+    }
+    spec = buf;
+
+    /* check username in spec */
+    sep = strchr( spec, '@' );
+    if ( sep != NULL ) {
+        *sep = '\0';
+        relay_user = _strdup( spec );
+        spec = sep +1;
+    }
+    if (relay_user == NULL)
+        relay_user = determine_relay_user();
+
+    /* split out hostname and port number from spec */
+    sep = strchr(spec,':');
+    if ( sep == NULL ) {
+        /* hostname only, port is already set as default */
+        relay_host = _strdup( spec );
+    } else {
+        /* hostname and port */
+        relay_port = atoi(sep+1);
+        *sep = '\0';
+        relay_host = _strdup( spec );
+    }
+    free(buf);
+    return 0;
+}
+
+
+u_short
+httpconnect::resolve_port( const char *service )
+{
+    int port;
+    if ( service[strspn (service, digits)] == '\0'  ) {
+        /* all digits, port number */
+        port = atoi(service);
+    } else {
+        /* treat as service name */
+        struct servent *ent;
+        ent = getservbyname( service, NULL );
+        if ( ent == NULL ) {
+            port = 0;
+        } else {
+            port = ntohs(ent->s_port);
+        }
+    }
+    return (u_short)port;
+}
+
+int
+httpconnect::local_resolve (const char *host, struct sockaddr_in *addr)
+{
+    struct hostent *ent;
+    if ( strspn(host, dotdigits) == strlen(host) ) {
+        /* given by IPv4 address */
+        addr->sin_family = AF_INET;
+        addr->sin_addr.s_addr = inet_addr(host);
+    } else {
+        ent = gethostbyname (host);
+        if ( ent ) {
+            memcpy (&addr->sin_addr, ent->h_addr, ent->h_length);
+            addr->sin_family = ent->h_addrtype;
+        } else {
+            return -1;                          /* failed */
+        }
+    }
+    return 0;                                   /* good */
+}
+
+SOCKET
+httpconnect::open_connection( const char *host, u_short port )
+{
+    SOCKET s;
+    struct sockaddr_in saddr;
+
+    if ( relay_method == METHOD_DIRECT ) {
+        host = dest_host;
+        port = dest_port;
+    } else if ((local_resolve (dest_host, &saddr) >= 0)&&
+               (is_direct_address(&saddr))) {
+        relay_method = METHOD_DIRECT;
+        host = dest_host;
+        port = dest_port;
+    } else {
+        host = relay_host;
+        port = relay_port;
+    }
+
+    if (local_resolve (host, &saddr) < 0) {
+        return SOCKET_ERROR;
+    }
+    saddr.sin_port = htons(port);
+    s = socket( AF_INET, SOCK_STREAM, 0 );
+    if ( connect( s, (struct sockaddr *)&saddr, sizeof(saddr))
+         == SOCKET_ERROR) {
+        return SOCKET_ERROR;
+    }
+    return s;
+}
+
+void
+httpconnect::report_text( char *prefix, char *buf )
+{
+    static char work[1024];
+    char *tmp;
+
+    if ( !f_debug )
+        return;
+    if ( !f_report )
+        return;                                 /* don't report */
+    while ( *buf ) {
+        memset( work, 0, sizeof(work));
+        tmp = work;
+        while ( *buf && ((tmp-work) < (int)sizeof(work)-5) ) {
+            switch ( *buf ) {
+            case '\t': *tmp++ = '\\'; *tmp++ = 't'; break;
+            case '\r': *tmp++ = '\\'; *tmp++ = 'r'; break;
+            case '\n': *tmp++ = '\\'; *tmp++ = 'n'; break;
+            case '\\': *tmp++ = '\\'; *tmp++ = '\\'; break;
+            default:
+                if ( isprint(*buf) ) {
+                    *tmp++ = *buf;
+                } else {
+                    sprintf( tmp, "\\x%02X", (unsigned char)*buf);
+                    tmp += strlen(tmp);
+                }
+            }
+            buf++;
+            *tmp = '\0';
+        }
+    }
+}
+
+int
+httpconnect::atomic_out( SOCKET s, char *buf, int size )
+{
+    int ret, len;
+
+    assert( buf != NULL );
+    assert( 0<=size );
+    /* do atomic out */
+    ret = 0;
+    while ( 0 < size ) {
+        len = send( s, buf+ret, size, 0 );
+        if ( len == -1 )
+           return -1;
+        ret += len;
+        size -= len;
+    }
+    return ret;
+}
+
+int
+httpconnect::atomic_in( SOCKET s, char *buf, int size )
+{
+    int ret, len;
+
+    assert( buf != NULL );
+    assert( 0<=size );
+
+    /* do atomic in */
+    ret = 0;
+    while ( 0 < size ) {
+        len = recv( s, buf+ret, size, 0 );
+        if ( len == -1 ) {
+            return -1;
+        } else if ( len == 0 ) {
+            return -1;
+        }
+        ret += len;
+        size -= len;
+    }
+    return ret;
+}
+
+int
+httpconnect::line_input( SOCKET s, char *buf, int size )
+{
+    char *dst = buf;
+    if ( size == 0 )
+        return 0;                               /* no error */
+    size--;
+    while ( 0 < size ) {
+        switch ( recv( s, dst, 1, 0) ) {        /* recv one-by-one */
+        case SOCKET_ERROR:
+            return -1;                          /* error */
+        case 0:
+            size = 0;                           /* end of stream */
+            break;
+        default:
+            /* continue reading until last 1 char is EOL? */
+            if ( *dst == '\n' ) {
+                /* finished */
+                size = 0;
+            } else {
+                /* more... */
+                size--;
+            }
+            dst++;
+        }
+    }
+    *dst = '\0';
+//    report_text( "<<<", buf);
+    return 0;
+}
+
+
+char *
+httpconnect::cut_token( char *str, char *delim)
+{
+    char *ptr = str + strcspn(str, delim);
+    char *end = ptr + strspn(ptr, delim);
+    if ( ptr == str )
+        return NULL;
+    while ( ptr < end )
+        *ptr++ = '\0';
+    return ptr;
+}
+
+const char *
+httpconnect::lookup(int num, LOOKUP_ITEM *items)
+{
+    int i = 0;
+    while (0 <= items[i].num) {
+        if (items[i].num == num)
+            return items[i].str;
+        i++;
+    }
+    return "(unknown)";
+}
+
+
+char *
+httpconnect::readpass( const char* prompt, ...)
+{
+    static char buf[1000];                      /* XXX, don't be fix length */
+    va_list args;
+    va_start(args, prompt);
+    vsprintf(buf, prompt, args);
+    va_end(args);
+	//askpassbox(buf,relay_user, buf,relay_user);
+    buf[strcspn(buf, "\r\n")] = '\0';
+    return buf;
+}
+
+int
+httpconnect::socks5_do_auth_userpass( SOCKET s )
+{
+    unsigned char buf[1024], *ptr;
+    char *pass = NULL;
+    int len;
+
+    /* do User/Password authentication. */
+    /* This feature requires username and password from
+       command line argument or environment variable,
+       or terminal. */
+    if (relay_user == NULL)
+        return -1;
+
+    /* get password from environment variable if exists. */
+    if ((pass=determine_relay_password()) == NULL &&
+        (pass=readpass("Enter SOCKS5 password for %s@%s: ",
+                       relay_user, relay_host)) == NULL)
+        return -1;
+
+    /* make authentication packet */
+    ptr = buf;
+    PUT_BYTE( ptr++, 1 );                       /* subnegotiation ver.: 1 */
+    len = strlen( relay_user );                 /* ULEN and UNAME */
+    PUT_BYTE( ptr++, len );
+    strcpy( (char*)ptr, relay_user );
+    ptr += len;
+    len = strlen( pass );                       /* PLEN and PASSWD */
+    PUT_BYTE( ptr++, strlen(pass));
+    strcpy( (char *)ptr, pass );
+    ptr += len;
+    memset (pass, 0, strlen(pass));             /* erase password */
+
+    /* send it and get answer */
+    f_report = 0;
+    atomic_out( s, (char*)buf, ptr-buf );
+    f_report = 1;
+    atomic_in( s, (char*)buf, 2 );
+
+    /* check status */
+    if ( buf[1] == 0 )
+        return 0;                               /* success */
+    else
+        return -1;                              /* fail */
+}
+
+const char *
+httpconnect::socks5_getauthname( int auth )
+{
+    switch ( auth ) {
+    case SOCKS5_AUTH_REJECT: return "REJECTED";
+    case SOCKS5_AUTH_NOAUTH: return "NO-AUTH";
+    case SOCKS5_AUTH_GSSAPI: return "GSSAPI";
+    case SOCKS5_AUTH_USERPASS: return "USERPASS";
+    case SOCKS5_AUTH_CHAP: return "CHAP";
+    case SOCKS5_AUTH_EAP: return "EAP";
+    case SOCKS5_AUTH_MAF: return "MAF";
+    default: return "(unknown)";
+    }
+}
+
+int
+httpconnect::socks5_auth_parse_1(char *start, char *end){
+    int i, len;
+    for ( ; *start; start++ )
+        if ( *start != ' ' && *start != '\t') break;
+    for ( end--; end >= start; end-- ) {
+        if ( *end != ' ' && *end != '\t'){
+            end++;
+            break;
+        }
+    }
+    len = end - start;
+    for ( i = 0; socks5_auth_table[i].name != NULL; i++ ){
+        if ( strncmp(start, socks5_auth_table[i].name, len) == 0) {
+            return socks5_auth_table[i].auth;
+        }
+    }
+    return -1;
+}
+
+int
+httpconnect::socks5_auth_parse(char *start, unsigned char *auth_list, int max_auth){
+    char *end;
+    int i = 0;
+    while ( i < max_auth ) {
+        end = strchr(start, ',');
+        if (*start && end) {
+            auth_list[i++] = socks5_auth_parse_1(start, end);
+            start = ++end;
+        } else {
+            break;
+        }
+    }
+    if ( *start && ( i < max_auth ) ){
+        for( end = start; *end; end++ );
+        auth_list[i++] = socks5_auth_parse_1(start, end);
+    } else {
+       return -1;
+    }
+    return i;
+}
+
+/* begin SOCKS5 relaying
+   And no authentication is supported.
+ */
+int
+httpconnect::begin_socks5_relay( SOCKET s )
+{
+    unsigned char buf[256], *ptr, *env = (unsigned char*)socks5_auth;
+    unsigned char n_auth = 0; unsigned char auth_list[10], auth_method;
+    int len, auth_result, i;
+
+    /* request authentication */
+    ptr = buf;
+    PUT_BYTE( ptr++, 5);                        /* SOCKS version (5) */
+
+    if ( env == NULL )
+        env = (unsigned char*)getparam(ENV_SOCKS5_AUTH);
+    if ( env == NULL ) {
+        /* add no-auth authentication */
+        auth_list[n_auth++] = SOCKS5_AUTH_NOAUTH;
+        /* add user/pass authentication */
+        auth_list[n_auth++] = SOCKS5_AUTH_USERPASS;
+    } else {
+        n_auth = socks5_auth_parse((char*)env, auth_list, 10);
+    }
+    PUT_BYTE( ptr++, n_auth);                   /* num auth */
+    for (i=0; i<n_auth; i++) {
+        PUT_BYTE( ptr++, auth_list[i]);         /* authentications */
+    }
+    atomic_out( s, (char*)buf, ptr-buf );              /* send requst */
+    atomic_in( s, (char*)buf, 2 );                     /* recv response */
+    if ( (buf[0] != 5) ||                       /* ver5 response */
+         (buf[1] == 0xFF) ) {                   /* check auth method */
+        return -1;
+    }
+    auth_method = buf[1];
+
+
+    switch ( auth_method ) {
+    case SOCKS5_AUTH_REJECT:
+        return -1;                              /* fail */
+
+    case SOCKS5_AUTH_NOAUTH:
+        /* nothing to do */
+        auth_result = 0;
+        break;
+
+    case SOCKS5_AUTH_USERPASS:
+        auth_result = socks5_do_auth_userpass(s);
+        break;
+
+    default:
+        return -1;                              /* fail */
+    }
+    if ( auth_result != 0 ) {
+        return -1;
+    }
+    /* request to connect */
+    ptr = buf;
+    PUT_BYTE( ptr++, 5);                        /* SOCKS version (5) */
+    PUT_BYTE( ptr++, 1);                        /* CMD: CONNECT */
+    PUT_BYTE( ptr++, 0);                        /* FLG: 0 */
+    if ( dest_addr.sin_addr.s_addr == 0 ) {
+        /* resolved by SOCKS server */
+        PUT_BYTE( ptr++, 3);                    /* ATYP: DOMAINNAME */
+        len = strlen(dest_host);
+        PUT_BYTE( ptr++, len);                  /* DST.ADDR (len) */
+        memcpy( ptr, dest_host, len );          /* (hostname) */
+        ptr += len;
+    } else {
+        /* resolved localy */
+        PUT_BYTE( ptr++, 1 );                   /* ATYP: IPv4 */
+        memcpy( ptr, &dest_addr.sin_addr.s_addr, sizeof(dest_addr.sin_addr));
+        ptr += sizeof(dest_addr.sin_addr);
+    }
+    PUT_BYTE( ptr++, dest_port>>8);     /* DST.PORT */
+    PUT_BYTE( ptr++, dest_port&0xFF);
+    atomic_out( s, (char*)buf, ptr-buf);               /* send request */
+    atomic_in( s, (char*)buf, 4 );                     /* recv response */
+    if ( (buf[1] != SOCKS5_REP_SUCCEEDED) ) {   /* check reply code */
+        return -1;
+    }
+    ptr = buf + 4;
+    switch ( buf[3] ) {                         /* case by ATYP */
+    case 1:                                     /* IP v4 ADDR*/
+        atomic_in( s, (char*)ptr, 4+2 );               /* recv IPv4 addr and port */
+        break;
+    case 3:                                     /* DOMAINNAME */
+        atomic_in( s, (char*)ptr, 1 );                 /* recv name and port */
+        atomic_in( s, (char*)ptr+1, *(unsigned char*)ptr + 2);
+        break;
+    case 4:                                     /* IP v6 ADDR */
+        atomic_in( s, (char*)ptr, 16+2 );              /* recv IPv6 addr and port */
+        break;
+    }
+
+    /* Conguraturation, connected via SOCKS5 server! */
+    return 0;
+}
+
+int
+httpconnect::begin_socks4_relay( SOCKET s )
+{
+    unsigned char buf[256], *ptr;
+    ptr = buf;
+    PUT_BYTE( ptr++, 4);                        /* protocol version (4) */
+    PUT_BYTE( ptr++, 1);                        /* CONNECT command */
+    PUT_BYTE( ptr++, dest_port>>8);     /* destination Port */
+    PUT_BYTE( ptr++, dest_port&0xFF);
+    /* destination IP */
+    memcpy(ptr, &dest_addr.sin_addr, sizeof(dest_addr.sin_addr));
+    ptr += sizeof(dest_addr.sin_addr);
+    if ( dest_addr.sin_addr.s_addr == 0 )
+        *(ptr-1) = 1;                           /* fake, protocol 4a */
+    /* username */
+    if (relay_user == NULL)
+        return -1;
+    strcpy( (char*)ptr, relay_user );
+    ptr += strlen( relay_user ) +1;
+    /* destination host name (for protocol 4a) */
+    if ( (socks_version == 4) && (dest_addr.sin_addr.s_addr == 0)) {
+        strcpy( (char*)ptr, dest_host );
+        ptr += strlen( dest_host ) +1;
+    }
+    /* send command and get response
+       response is: VN:1, CD:1, PORT:2, ADDR:4 */
+    atomic_out( s, (char*)buf, ptr-buf);               /* send request */
+    atomic_in( s, (char*)buf, 8 );                     /* recv response */
+    if ( (buf[1] != SOCKS4_REP_SUCCEEDED) ) {   /* check reply code */       
+        return -1;                              /* failed */
+    }
+
+    /* Conguraturation, connected via SOCKS4 server! */
+    return 0;
+}
+
+int
+httpconnect::sendf(SOCKET s, const char *fmt,...)
+{
+    static char buf[10240];                     /* xxx, enough? */
+
+    va_list args;
+    va_start( args, fmt );
+    vsprintf( buf, fmt, args );
+    va_end( args );
+
+//    report_text(">>>", buf);
+    if ( send(s, buf, strlen(buf), 0) == SOCKET_ERROR ) {       
+        return -1;
+    }
+    return 0;
+}
+
+char *
+httpconnect::make_base64_string(const char *str)
+{
+    static char *buf;
+    unsigned char *src;
+    char *dst;
+    int bits, data, src_len, dst_len;
+    /* make base64 string */
+    src_len = strlen(str);
+    dst_len = (src_len+2)/3*4;
+    buf = (char*)xmalloc(dst_len+1);
+    bits = data = 0;
+    src = (unsigned char *)str;
+    dst = (char *)buf;
+    while ( dst_len-- ) {
+        if ( bits < 6 ) {
+            data = (data << 8) | *src;
+            bits += 8;
+            if ( *src != 0 )
+                src++;
+        }
+        *dst++ = base64_table[0x3F & (data >> (bits-6))];
+        bits -= 6;
+    }
+    *dst = '\0';
+    /* fix-up tail padding */
+    switch ( src_len%3 ) {
+    case 1:
+        *--dst = '=';
+    case 2:
+        *--dst = '=';
+    }
+    return buf;
+}
+
+
+int
+httpconnect::basic_auth (SOCKET s)
+{
+    char *userpass;
+    char *cred;
+    const char *user = relay_user;
+    char *pass = NULL;
+    int len, ret;
+
+    /* Get username/password for authentication */
+    if (user == NULL)
+	{       
+		return -1;
+	}
+    if ((pass = determine_relay_password ()) == NULL &&
+        (pass = readpass("Enter proxy authentication password for %s@%s: ",
+                         relay_user, relay_host)) == NULL)
+	{
+		return -1;
+	}
+
+    len = strlen(user)+strlen(pass)+1;
+    userpass = (char*)xmalloc(len+1);
+    sprintf(userpass,"%s:%s", user, pass);
+    memset (pass, 0, strlen(pass));
+    cred = make_base64_string(userpass);
+    memset (userpass, 0, len);
+
+    f_report = 0;                               /* don't report for security */
+    ret = sendf(s, "Proxy-Authorization: Basic %s\r\n", cred);
+    f_report = 1;
+    report_text(">>>", "Proxy-Authorization: Basic xxxxx\r\n");
+
+    memset(cred, 0, strlen(cred));
+    free(cred);
+
+    return ret;
+}
+
+/* begin relaying via HTTP proxy
+   Directs CONNECT method to proxy server to connect to
+   destination host (and port). It may not be allowed on your
+   proxy server.
+ */
+int
+httpconnect::begin_http_relay( SOCKET s )
+{
+	char auth_www[] = "WWW-Authenticate:";
+	char auth_proxy[] = "Proxy-Authenticate:";
+    char buf[1024];
+    int result;
+    char *auth_what;
+    if (sendf(s,"CONNECT %s:%d HTTP/1.0\r\n", dest_host, dest_port) < 0)
+        return START_ERROR;
+    if (proxy_auth_type == PROXY_AUTH_BASIC && basic_auth (s) < 0)
+        return START_ERROR;
+    if (sendf(s,"\r\n") < 0)
+        return START_ERROR;
+
+    /* get response */
+    if ( line_input(s, buf, sizeof(buf)) < 0 ) {
+        return START_ERROR;
+    }
+
+    /* check status */
+    if (!strchr(buf, ' ')) {
+	return START_ERROR;
+    }
+    result = atoi(strchr(buf,' '));
+
+    switch ( result ) {
+    case 200:
+        break;
+    case 302:                                   /* redirect */
+        do {
+            if (line_input(s, buf, sizeof(buf)))
+                break;
+            downcase(buf);
+            if (expect(buf, "Location: ")) {
+                relay_host = cut_token(buf, "//");
+                cut_token(buf, "/");
+                relay_port = atoi(cut_token(buf, ":"));
+            }
+        } while (strcmp(buf,"\r\n") != 0);
+        return START_RETRY;
+
+    /* We handle both 401 and 407 codes here: 401 is WWW-Authenticate, which
+     * not strictly the correct response, but some proxies do send this (e.g.
+     * Symantec's Raptor firewall) */
+    case 401:                                   /* WWW-Auth required */
+    case 407:                                   /* Proxy-Auth required */
+        /** NOTE: As easy implementation, we support only BASIC scheme
+            and ignore realm. */
+        /* If proxy_auth_type is PROXY_AUTH_BASIC and get
+         this result code, authentication was failed. */
+        if (proxy_auth_type != PROXY_AUTH_NONE) {
+            return START_ERROR;
+        }
+        auth_what = (result == 401) ? auth_www : auth_proxy;
+        do {
+            if ( line_input(s, buf, sizeof(buf)) ) {
+                break;
+            }
+            downcase(buf);
+            if (expect(buf, auth_what)) {
+                /* parse type and realm */
+                char *scheme, *realm;
+                scheme = cut_token(buf, " ");
+                realm = cut_token(scheme, " ");
+                if ( scheme == NULL || realm == NULL ) {
+                    return START_ERROR;         /* fail */
+                }
+                /* check supported auth type */
+                if (expect(scheme, "basic")) {
+                    proxy_auth_type = PROXY_AUTH_BASIC;
+                } 
+            }
+        } while (strcmp(buf,"\r\n") != 0);
+        if ( proxy_auth_type == PROXY_AUTH_NONE ) {
+            return START_ERROR;
+        } else {
+            return START_RETRY;
+        }
+
+    default:
+        /* Not allowed */
+        return START_ERROR;
+    }
+    /* skip to end of response header */
+    do {
+        if ( line_input(s, buf, sizeof(buf) ) ) {
+            return START_ERROR;
+        }
+    } while ( strcmp(buf,"\r\n") != 0 );
+
+    return START_OK;
+}
+
+
+BOOL httpconnect::ParseDisplay(LPTSTR display, LPTSTR phost, int hostlen, int *pport) 
+{
+	int tmp_port;
+	TCHAR *colonpos = _tcschr(display, L':');
+    if (hostlen < (int)_tcslen(display))
+        return FALSE;
+
+    if (colonpos == NULL)
+	{
+		// No colon -- use default port number
+        tmp_port = HTTP_PORT;
+		_tcsncpy(phost, display, MAX_HOST_NAME_LEN);
+	}
+	else
+	{
+		_tcsncpy(phost, display, colonpos - display);
+		phost[colonpos - display] = L'\0';
+		if (colonpos[1] == L':') {
+			// Two colons -- interpret as a port number
+			if (_stscanf(colonpos + 2, TEXT("%d"), &tmp_port) != 1) 
+				return FALSE;
+		}
+		else
+		{
+			// One colon -- interpret as a display number or port number
+			if (_stscanf(colonpos + 1, TEXT("%d"), &tmp_port) != 1) 
+				return FALSE;
+
+			// RealVNC method - If port < 100 interpret as display number else as Port number
+			if (tmp_port < 100)
+				tmp_port += HTTP_PORT;
+		}
+	}
+    *pport = tmp_port;
+    return TRUE;
+}
+
+BOOL httpconnect::ParseDisplay2(LPTSTR display, LPTSTR phost, int hostlen, int *pport) 
+{
+	int tmp_port;
+	TCHAR *colonpos = _tcschr(display, L':');
+    if (hostlen < (int)_tcslen(display))
+        return FALSE;
+
+    if (colonpos == NULL)
+	{
+		// No colon -- use default port number
+        tmp_port = HTTPS_PORT;
+		_tcsncpy(phost, display, MAX_HOST_NAME_LEN);
+	}
+	else
+	{
+		_tcsncpy(phost, display, colonpos - display);
+		phost[colonpos - display] = L'\0';
+		if (colonpos[1] == L':') {
+			// Two colons -- interpret as a port number
+			if (_stscanf(colonpos + 2, TEXT("%d"), &tmp_port) != 1) 
+				return FALSE;
+		}
+		else
+		{
+			// One colon -- interpret as a display number or port number
+			if (_stscanf(colonpos + 1, TEXT("%d"), &tmp_port) != 1) 
+				return FALSE;
+
+			// RealVNC method - If port < 100 interpret as display number else as Port number
+			if (tmp_port < 100)
+				tmp_port += HTTPS_PORT;
+		}
+	}
+    *pport = tmp_port;
+    return TRUE;
+}
+
+/** Main of program **/
+SOCKET
+httpconnect::mainconnect( int meth,char *server,char *remoteserver, int remoteport)
+{
+	int ret;
+    SOCKET remote;
+    WSADATA wsadata;
+    WSAStartup( 0x101, &wsadata);
+
+	//set_relay( METHOD_SOCKS, "24.125.118.146:26836");
+	/*	f_debug++;
+	set_relay(METHOD_HTTP,"proxy.skynet.be:8080");
+	local_type=1;
+	local_port=1111;
+	dest_host="uvnc.com";
+	dest_port=443;*/
+
+
+	f_debug++;
+	local_type = LOCAL_SOCKET;
+    local_port = 1111;
+	strcpy(dest_host,remoteserver);
+	dest_port=remoteport;
+	set_relay( meth, server );
+
+
+retry:
+
+    /* make connection */
+    if ( relay_method == METHOD_DIRECT ) {
+        remote = open_connection (dest_host, dest_port);
+        if ( remote == SOCKET_ERROR )
+		{
+			return 0;
+		}
+    } else {
+        remote = open_connection (relay_host, relay_port);
+        if ( remote == SOCKET_ERROR )
+		{
+			return 0;
+		}
+    }
+
+    if (relay_method == METHOD_SOCKS &&
+        socks_resolve == RESOLVE_LOCAL &&
+        local_resolve (dest_host, &dest_addr) < 0) {
+		return 0;
+    }
+
+    /** relay negociation **/
+    switch ( relay_method ) {
+    case METHOD_SOCKS:
+        if ( ((socks_version == 5) && (begin_socks5_relay(remote) < 0)) ||
+             ((socks_version == 4) && (begin_socks4_relay(remote) < 0)) )
+		{
+			return 0;
+		}
+        break;
+
+    case METHOD_HTTP:
+        ret = begin_http_relay(remote);
+        switch (ret) {
+        case START_ERROR:
+            closesocket(remote);
+			return 0;
+        case START_OK:
+            break;
+        case START_RETRY:
+            /* retry with authentication */
+           closesocket(remote);
+            goto retry;
+        }
+        break;
+    }
+	return remote;
+}
+
+
+SOCKET 
+httpconnect::Get_https_socket(char *port, char *host)
+{
+	TCHAR proxy[512];
+	memset (proxy,0,sizeof(proxy));
+	TCHAR * pch=NULL;
+	long ProxyEnable=0;
+	pfnWinHttpGetIEProxyConfig pWHGIEPC = NULL;
+	HMODULE hModWH=NULL;
+	//New function, ask current user proxy
+	if ((hModWH = LoadLibrary("winhttp.dll"))) {
+	pWHGIEPC = (pfnWinHttpGetIEProxyConfig) (GetProcAddress(hModWH, "WinHttpGetIEProxyConfigForCurrentUser"));
+	}
+	WINHTTP_CURRENT_USER_IE_PROXY_CONFIG MyProxyConfig;
+	if(!pWHGIEPC(&MyProxyConfig))
+	{
+		ProxyEnable=false;
+		return 0;
+	}
+	else
+	{
+		ProxyEnable=true;
+	}
+	if (hModWH) FreeLibrary(hModWH);
+	if(NULL != MyProxyConfig.lpszAutoConfigUrl)
+		{
+			GlobalFree(MyProxyConfig.lpszAutoConfigUrl);
+		}
+	if(NULL != MyProxyConfig.lpszProxyBypass)
+		{
+			GlobalFree(MyProxyConfig.lpszProxyBypass);
+		}
+	if(NULL != MyProxyConfig.lpszProxy)
+		{
+			WideCharToMultiByte( CP_ACP, 0, MyProxyConfig.lpszProxy,-1,proxy,512,NULL,NULL);
+			GlobalFree(MyProxyConfig.lpszProxy);
+		}
+
+	TCHAR remotehost[256];
+	int remoteport=0;
+	TCHAR remotehost2[256];
+	int remoteport2=0;
+	TCHAR tempchar1[256];
+	TCHAR tempchar2[256];
+	_tcscpy(tempchar1,"");
+	_tcscpy(tempchar2,"");
+
+	if (strlen(proxy)!=0)
+	{
+		pch = _tcstok (proxy,";");
+	
+		if (_tcsstr(pch,"http=")!=NULL)
+		{
+			_tcscpy(tempchar1,pch);
+		}
+		if (_tcsstr(pch,"https=")!=NULL)
+		{
+			_tcscpy(tempchar2,pch);
+		}
+		if (_tcsstr(pch,"=")==NULL)
+		{
+			_tcscpy(tempchar2,pch);
+		}
+	}
+
+	while (pch != NULL)
+		{
+			pch = _tcstok (NULL, ";");
+			if (pch != NULL)
+			{
+				if (_tcsstr(pch,"http=")!=NULL)
+					{
+						_tcscpy(tempchar1,pch+5);
+					}
+				if (_tcsstr(pch,"https=")!=NULL)
+					{
+						_tcscpy(tempchar2,pch+6);
+					}
+
+			}
+	}
+	ParseDisplay(tempchar1, remotehost, 255, &remoteport);
+	ParseDisplay2(tempchar2, remotehost2, 255, &remoteport2);
+	SOCKET mysock=0;
+
+	if (remoteport2!=1080)
+		{
+			mysock=mainconnect(METHOD_HTTP,tempchar2,host,atoi(port));
+		}
+	else
+		{
+			mysock=mainconnect(METHOD_SOCKS,tempchar2,host,atoi(port));
+		}
+
+	return mysock;
+}
diff --git a/ica/win32/winvnc/winvnc/httpconnect.h b/ica/win32/winvnc/winvnc/httpconnect.h
new file mode 100644
index 0000000..325a7ef
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/httpconnect.h
@@ -0,0 +1,227 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <memory.h>
+#include <errno.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <winsock2.h>
+#include <windows.h>
+#include <sys/stat.h>
+#include <io.h>
+#include <conio.h>
+#include <tchar.h>
+
+#define LOCAL_STDIO     0
+#define LOCAL_SOCKET    1
+#define HTTP_PORT 80
+#define HTTPS_PORT 443
+#define MAX_HOST_NAME_LEN 256
+/* relay method, server and port */
+#define METHOD_UNDECIDED 0
+#define METHOD_DIRECT    1
+#define METHOD_SOCKS     2
+#define METHOD_HTTP      3
+#define METHOD_TELNET    4
+/* informations for SOCKS */
+#define SOCKS5_REP_SUCCEEDED    0x00    /* succeeded */
+#define SOCKS5_REP_FAIL         0x01    /* general SOCKS serer failure */
+#define SOCKS5_REP_NALLOWED     0x02    /* connection not allowed by ruleset */
+#define SOCKS5_REP_NUNREACH     0x03    /* Network unreachable */
+#define SOCKS5_REP_HUNREACH     0x04    /* Host unreachable */
+#define SOCKS5_REP_REFUSED      0x05    /* connection refused */
+#define SOCKS5_REP_EXPIRED      0x06    /* TTL expired */
+#define SOCKS5_REP_CNOTSUP      0x07    /* Command not supported */
+#define SOCKS5_REP_ANOTSUP      0x08    /* Address not supported */
+#define SOCKS5_REP_INVADDR      0x09    /* Inalid address */
+/* SOCKS5 authentication methods */
+#define SOCKS5_AUTH_REJECT      0xFF    /* No acceptable auth method */
+#define SOCKS5_AUTH_NOAUTH      0x00    /* without authentication */
+#define SOCKS5_AUTH_GSSAPI      0x01    /* GSSAPI */
+#define SOCKS5_AUTH_USERPASS    0x02    /* User/Password */
+#define SOCKS5_AUTH_CHAP        0x03    /* Challenge-Handshake Auth Proto. */
+#define SOCKS5_AUTH_EAP         0x05    /* Extensible Authentication Proto. */
+#define SOCKS5_AUTH_MAF         0x08    /* Multi-Authentication Framework */
+#define SOCKS4_REP_SUCCEEDED    90      /* rquest granted (succeeded) */
+#define SOCKS4_REP_REJECTED     91      /* request rejected or failed */
+#define SOCKS4_REP_IDENT_FAIL   92      /* cannot connect identd */
+#define SOCKS4_REP_USERID       93      /* user id not matched */
+#define RESOLVE_UNKNOWN 0
+#define RESOLVE_LOCAL   1
+#define RESOLVE_REMOTE  2
+#define RESOLVE_BOTH    3
+/* Environment variable names */
+#define ENV_SOCKS_SERVER  "SOCKS_SERVER"        /* SOCKS server */
+#define ENV_SOCKS5_SERVER "SOCKS5_SERVER"
+#define ENV_SOCKS4_SERVER "SOCKS4_SERVER"
+#define ENV_SOCKS_RESOLVE  "SOCKS_RESOLVE"      /* resolve method */
+#define ENV_SOCKS5_RESOLVE "SOCKS5_RESOLVE"
+#define ENV_SOCKS4_RESOLVE "SOCKS4_RESOLVE"
+#define ENV_SOCKS5_USER     "SOCKS5_USER"       /* auth user for SOCKS5 */
+#define ENV_SOCKS4_USER     "SOCKS4_USER"       /* auth user for SOCKS4 */
+#define ENV_SOCKS_USER      "SOCKS_USER"        /* auth user for SOCKS */
+#define ENV_SOCKS5_PASSWD   "SOCKS5_PASSWD"     /* auth password for SOCKS5 */
+#define ENV_SOCKS5_PASSWORD "SOCKS5_PASSWORD"   /* old style */
+#define ENV_HTTP_PROXY          "HTTP_PROXY"    /* common env var */
+#define ENV_HTTP_PROXY_USER     "HTTP_PROXY_USER" /* auth user */
+#define ENV_HTTP_PROXY_PASSWORD "HTTP_PROXY_PASSWORD" /* auth password */
+#define ENV_TELNET_PROXY          "TELNET_PROXY"    /* common env var */
+#define ENV_CONNECT_USER     "CONNECT_USER"     /* default auth user name */
+#define ENV_CONNECT_PASSWORD "CONNECT_PASSWORD" /* default auth password */
+#define ENV_SOCKS_DIRECT   "SOCKS_DIRECT"       /* addr-list for non-proxy */
+#define ENV_SOCKS5_DIRECT  "SOCKS5_DIRECT"
+#define ENV_SOCKS4_DIRECT  "SOCKS4_DIRECT"
+#define ENV_HTTP_DIRECT    "HTTP_DIRECT"
+#define ENV_CONNECT_DIRECT "CONNECT_DIRECT"
+#define ENV_SOCKS5_AUTH "SOCKS5_AUTH"
+#define ENV_SSH_ASKPASS "SSH_ASKPASS"           /* askpass program */
+/* Prefix string of HTTP_PROXY */
+#define HTTP_PROXY_PREFIX "http://"
+#define PROXY_AUTH_NONE 0
+#define PROXY_AUTH_BASIC 1
+#define PROXY_AUTH_DIGEST 2
+#define REASON_UNK              -2
+#define REASON_ERROR            -1
+#define REASON_CLOSED_BY_LOCAL  0
+#define REASON_CLOSED_BY_REMOTE 1
+#define START_ERROR -1
+#define START_OK     0
+#define START_RETRY  1
+#define socket_errno() WSAGetLastError()
+#define popen _popen
+
+#define ECONNRESET WSAECONNRESET
+#define MAX_DIRECT_ADDR_LIST 256
+
+#define PUT_BYTE(ptr,data) (*(unsigned char*)ptr = data)
+
+struct ADDRPAIR {
+    struct in_addr addr;
+    struct in_addr mask;
+    int negative;
+};
+
+typedef struct {
+    BOOL    fAutoDetect;
+    LPWSTR  lpszAutoConfigUrl;
+    LPWSTR  lpszProxy;
+    LPWSTR  lpszProxyBypass;
+} WINHTTP_CURRENT_USER_IE_PROXY_CONFIG;
+
+typedef BOOL (STDAPICALLTYPE * pfnWinHttpGetIEProxyConfig)
+(
+    IN OUT WINHTTP_CURRENT_USER_IE_PROXY_CONFIG * pProxyConfig
+);
+
+typedef struct {
+    int num;
+    const char *str;
+} LOOKUP_ITEM;
+
+typedef struct {
+    char* name;
+    char* value;
+} PARAMETER_ITEM;
+
+typedef struct {
+    char* name;
+    unsigned char auth;
+} AUTH_METHOD_ITEM;
+
+
+class httpconnect
+{
+	
+public:
+	httpconnect();
+	~httpconnect();
+
+	void *xmalloc (size_t size);
+	void downcase( char *buf );
+	char * expand_host_and_port (const char *fmt, const char *host, int port);
+	int lookup_resolve( const char *str );
+	char *getusername(void);
+	int expect( char *str, char *substr);
+	PARAMETER_ITEM* find_parameter_item(const char* name);
+	char* getparam(const char* name);
+	void mask_addr (void *addr, void *mask, int addrlen);
+	int add_direct_addr (struct in_addr *addr, struct in_addr *mask, int negative);
+	int parse_addr_pair (const char *str, struct in_addr *addr, struct in_addr *mask);
+	void initialize_direct_addr (void);
+	int cmp_addr (void *addr1, void *addr2, int addrlen);
+	int is_direct_address (const struct sockaddr_in *addr);
+	char * determine_relay_user ();
+	char *determine_relay_password ();
+	int set_relay( int method, char *spec );
+	u_short resolve_port( const char *service );
+	int local_resolve (const char *host, struct sockaddr_in *addr);
+	SOCKET open_connection( const char *host, u_short port );
+	void report_text( char *prefix, char *buf );
+	int atomic_out( SOCKET s, char *buf, int size );
+	int atomic_in( SOCKET s, char *buf, int size );
+	int line_input( SOCKET s, char *buf, int size );
+	char *cut_token( char *str, char *delim);
+	const char * lookup(int num, LOOKUP_ITEM *items);
+	const char * socks5_getauthname( int auth );
+	int socks5_do_auth_userpass( SOCKET s );
+	char *readpass( const char* prompt, ...);
+	int socks5_auth_parse_1(char *start, char *end);
+	int socks5_auth_parse(char *start, unsigned char *auth_list, int max_auth);
+	int begin_socks5_relay( SOCKET s );
+	int begin_socks4_relay( SOCKET s );
+	int sendf(SOCKET s, const char *fmt,...);
+	char * make_base64_string(const char *str);
+	int basic_auth (SOCKET s);
+	int begin_http_relay( SOCKET s );
+	BOOL ParseDisplay(LPTSTR display, LPTSTR phost, int hostlen, int *pport) ;
+	BOOL ParseDisplay2(LPTSTR display, LPTSTR phost, int hostlen, int *pport) ;
+	SOCKET mainconnect( int meth,char *server,char *remoteserver, int remoteport);
+	SOCKET Get_https_socket(char *port, char *host);
+
+	int   relay_method;          
+	char *relay_host;                        
+	u_short relay_port;                        
+	char *relay_user;  
+	char dest_host[256];
+	u_short dest_port;
+	struct sockaddr_in dest_addr;
+	int f_debug;
+	int proxy_auth_type;
+	u_short local_port; 
+	int   local_type;
+	int socks_version; 
+	int socks_resolve;
+	int f_report;
+	struct sockaddr_in socks_ns;
+	char *socks5_auth;
+	struct ADDRPAIR direct_addr_list[MAX_DIRECT_ADDR_LIST];
+	int n_direct_addr_list;
+};
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/inifile.cpp b/ica/win32/winvnc/winvnc/inifile.cpp
new file mode 100644
index 0000000..68b6185
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/inifile.cpp
@@ -0,0 +1,213 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "stdhdrs.h"
+#include "inifile.h"
+void Set_settings_as_admin(char *mycommand);
+
+
+IniFile::IniFile()
+{
+char WORKDIR[MAX_PATH];
+	if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+		{
+		char* p = strrchr(WORKDIR, '\\');
+		if (p == NULL) return;
+		*p = '\0';
+		}
+	strcpy(myInifile,"");
+	strcat(myInifile,WORKDIR);//set the directory
+	strcat(myInifile,"\\");
+	strcat(myInifile,INIFILE_NAME);
+}
+
+void
+IniFile::IniFileSetSecure()
+{
+char WORKDIR[MAX_PATH];
+	if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+		{
+		char* p = strrchr(WORKDIR, '\\');
+		if (p == NULL) return;
+		*p = '\0';
+		}
+	strcpy(myInifile,"");
+	strcat(myInifile,WORKDIR);//set the directory
+	strcat(myInifile,"\\");
+	strcat(myInifile,INIFILE_NAME);
+}
+
+void
+IniFile::IniFileSetTemp(char *lpCmdLine)
+{	
+	strcpy_s(myInifile,260,lpCmdLine);
+}
+
+/*void
+IniFile::IniFileSetTemp()
+{
+char WORKDIR[MAX_PATH];
+
+	if (!GetTempPath(MAX_PATH,WORKDIR))
+	{
+		//Function failed, just set something
+		if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+		{
+		char* p = strrchr(WORKDIR, '\\');
+		if (p == NULL) return;
+		*p = '\0';
+		}
+		strcpy(myInifile,"");
+		strcat(myInifile,WORKDIR);//set the directory
+		strcat(myInifile,"\\");
+		strcat(myInifile,INIFILE_NAME);
+		return;
+	}
+
+	strcpy(myInifile,"");
+	strcat(myInifile,WORKDIR);//set the directory
+	strcat(myInifile,INIFILE_NAME);
+}*/
+
+void
+IniFile::copy_to_secure()
+{
+		char dir[MAX_PATH];
+
+		char exe_file_name[MAX_PATH];
+		GetModuleFileName(0, exe_file_name, MAX_PATH);
+
+		strcpy(dir, exe_file_name);
+		strcat(dir, " -settingshelper");
+		strcat(dir, ":");
+		strcat(dir, myInifile);
+
+
+		STARTUPINFO          StartUPInfo;
+		PROCESS_INFORMATION  ProcessInfo;
+		HANDLE Token=NULL;
+		HANDLE process=NULL;
+		ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+		ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+		StartUPInfo.wShowWindow = SW_SHOW;
+		StartUPInfo.lpDesktop = "Winsta0\\Default";
+		StartUPInfo.cb = sizeof(STARTUPINFO);
+		HWND tray = FindWindow(("Shell_TrayWnd"), 0);
+		if (!tray)
+			return;
+	
+		DWORD processId = 0;
+			GetWindowThreadProcessId(tray, &processId);
+		if (!processId)
+			return;	
+		process = OpenProcess(MAXIMUM_ALLOWED, FALSE, processId);
+		if (!process)
+			return;	
+		OpenProcessToken(process, MAXIMUM_ALLOWED, &Token);
+		CreateProcessAsUser(Token,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+		DWORD error=GetLastError();
+		if (process) CloseHandle(process);
+		if (Token) CloseHandle(Token);
+		if (ProcessInfo.hThread) CloseHandle (ProcessInfo.hThread);
+		if (ProcessInfo.hProcess) CloseHandle (ProcessInfo.hProcess);
+		if (error==1314)
+		{
+			Set_settings_as_admin(myInifile);
+		}
+
+}
+
+IniFile::~IniFile()
+{
+}
+
+bool
+IniFile::WriteString(char *key1, char *key2,char *value)
+{
+	//vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifile); 
+	return (FALSE != WritePrivateProfileString(key1,key2, value,myInifile));
+}
+
+bool 
+IniFile::WriteInt(char *key1, char *key2,int value)
+{
+	char       buf[32];
+	wsprintf(buf, "%d", value);
+	//vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifile);
+	int result=WritePrivateProfileString(key1,key2, buf,myInifile);
+	if (result==0) return false;
+	return true;
+}
+
+int
+IniFile::ReadInt(char *key1, char *key2,int Defaultvalue)
+{
+	//vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifile);
+	return GetPrivateProfileInt(key1, key2, Defaultvalue, myInifile);
+}
+
+void 
+IniFile::ReadString(char *key1, char *key2,char *value,int valuesize)
+{
+	//vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifile);
+	GetPrivateProfileString(key1,key2, "",value,valuesize,myInifile);
+}
+
+void 
+IniFile::ReadPassword(char *value,int valuesize)
+{
+	//int size=ReadInt("ultravnc", "passwdsize",0);
+	//vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifilePasswd);
+	GetPrivateProfileStruct("ultravnc","passwd",value,8,myInifile);
+}
+
+void //PGM
+IniFile::ReadPassword2(char *value,int valuesize) //PGM
+{ //PGM
+	GetPrivateProfileStruct("ultravnc","passwd2",value,8,myInifile); //PGM
+} //PGM
+
+bool
+IniFile::WritePassword(char *value)
+{
+		//WriteInt("ultravnc", "passwdsize",sizeof(value));
+		//vnclog.Print(LL_INTERR, VNCLOG("%s \n"),myInifile);
+		return (FALSE != WritePrivateProfileStruct("ultravnc","passwd", value,8,myInifile));
+}
+
+bool //PGM
+IniFile::WritePassword2(char *value) //PGM
+{ //PGM
+		return (FALSE != WritePrivateProfileStruct("ultravnc","passwd2", value,8,myInifile)); //PGM
+} //PGM
+
+bool IniFile::IsWritable()
+{
+    bool writable = WriteInt("Permissions", "isWritable",1);
+    if (writable)
+        WritePrivateProfileSection("Permissions", "", myInifile);
+
+    return writable;
+}
+
diff --git a/ica/win32/winvnc/winvnc/inifile.h b/ica/win32/winvnc/winvnc/inifile.h
new file mode 100644
index 0000000..efecab7
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/inifile.h
@@ -0,0 +1,64 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include <windows.h>
+#if (!defined(_WINVNC_INIFILE))
+#define _WINVNC_INIFILE
+
+bool Copy_to_Temp(char *tempfile);
+bool Copy_to_Secure_from_temp(char *tempfile);
+#define INIFILE_NAME "ultravnc.ini"
+
+class IniFile
+{
+
+// Fields
+public:
+	char myInifile[MAX_PATH];
+
+// Methods
+public:
+	// Make the desktop thread & window proc friends
+
+	IniFile();
+	~IniFile();
+	bool WriteString(char *key1, char *key2,char *value);
+	bool WritePassword(char *value);
+	bool WritePassword2(char *value); //PGM
+	bool WriteInt(char *key1, char *key2,int value);
+	int ReadInt(char *key1, char *key2,int Defaultvalue);
+	void ReadString(char *key1, char *key2,char *value,int valuesize);
+	void ReadPassword(char *value,int valuesize);
+	void ReadPassword2(char *value,int valuesize); //PGM
+	void IniFileSetSecure();
+	//void IniFileSetTemp();
+	void IniFileSetTemp(char *lpCmdLine);
+	void copy_to_secure();
+
+    bool IsWritable();
+
+protected:
+		
+};
+#endif
diff --git a/ica/win32/winvnc/winvnc/initipp.cpp b/ica/win32/winvnc/winvnc/initipp.cpp
new file mode 100644
index 0000000..17beb57
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/initipp.cpp
@@ -0,0 +1,186 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#ifdef IPP
+#include "ippcore.h"
+#include "ippversion.h"
+#include <windows.h>
+
+#define CACHE_LINE 32
+#define bool BOOL
+#define false FALSE
+#define true TRUE
+
+
+static int ippstaticinitcalled=0;
+#if IPP_VERSION_MAJOR>=5
+#define ippCoreGetStatusString ippGetStatusString
+#define ippCoreGetCpuType ippGetCpuType
+#define ippStaticInitBest ippStaticInit
+#endif
+
+
+// MMX_SSESupport.h
+
+#pragma once
+
+#define _MMX_FEATURE_BIT        0x00800000      // bit 23
+#define _SSE_FEATURE_BIT        0x02000000      // bit 25
+// bit flags set by cpuid when called with register eax set to 1
+#define MMX_SUPPORTED			0x00800000
+#define SSE_SUPPORTED			0x02000000
+#define SSE2_SUPPORTED			0x04000000
+#define AMD_3DNOW_SUPPORTED		0x80000000
+
+// AMD specific
+#define AMD_3DNOW_EX_SUPPORTED	0x40000000
+#define AMD_MMX_EX_SUPPORTED	0x00400000
+
+#define SUPPORT_MMX				0x0001
+#define SUPPORT_3DNOW			0x0002
+#define SUPPORT_SSE				0x0004
+#define SUPPORT_SSE2			0x0008
+DWORD				dwFeatures;
+
+
+#ifndef _X64
+bool IsCPUID()
+{
+	__try 
+	{
+		_asm 
+		{
+			xor eax, eax
+			cpuid
+		}
+	}
+	__except (EXCEPTION_EXECUTE_HANDLER) 
+	{
+		return false;
+	}
+	return true;
+}
+
+bool QueryCPUInfo()
+{
+	DWORD dwStandard = 0;
+	DWORD dwFeature = 0;
+	
+	DWORD dwMax = 0;
+	DWORD dwExt = 0;
+	int feature = 0;
+	int os_support = 0;
+
+	union {
+		char cBuffer[12+1];
+		struct {
+			DWORD dw0;
+			DWORD dw1;
+			DWORD dw2;
+		} stc;
+	} Vendor;
+
+	if (!IsCPUID())
+		return false;
+
+	dwFeatures=0;
+	memset(&Vendor, 0, sizeof(Vendor));
+
+	_asm {
+		push ebx
+		push ecx
+		push edx
+
+		// get the vendor string
+		xor eax, eax
+		cpuid
+		mov dwMax, eax
+		mov Vendor.stc.dw0, ebx
+		mov Vendor.stc.dw1, edx
+		mov Vendor.stc.dw2, ecx
+
+		// get the Standard bits
+		mov eax, 1
+		cpuid
+		mov dwStandard, eax
+		mov dwFeature, edx
+
+		// get AMD-specials
+		mov eax, 80000000h
+		cpuid
+		cmp eax, 80000000h
+		jc notamd
+		mov eax, 80000001h
+		cpuid
+		mov dwExt, edx
+
+notamd:
+		pop ecx
+		pop ebx
+		pop edx
+	}
+
+	if (dwFeature & MMX_SUPPORTED) 
+		dwFeatures |= SUPPORT_MMX;
+
+	if (dwExt & AMD_3DNOW_SUPPORTED) 
+		dwFeatures |= SUPPORT_3DNOW;
+
+	if (dwFeature & SSE_SUPPORTED) 
+		dwFeatures |= SUPPORT_SSE;
+
+	if (dwFeature & SSE2_SUPPORTED) 
+		dwFeatures |= SUPPORT_SSE2;
+
+	return true;
+}
+
+
+static
+IppCpuType
+AutoDetect(void)
+{
+IppCpuType cputype=ippCpuUnknown;
+QueryCPUInfo();
+if ((dwFeatures & SUPPORT_MMX) == SUPPORT_MMX) cputype=ippCpuPII;
+if ((dwFeatures & SUPPORT_SSE) == SUPPORT_SSE) cputype=ippCpuPIII;
+if ((dwFeatures & SUPPORT_SSE2) == SUPPORT_SSE2) cputype=ippCpuP4;
+return cputype;
+}
+#endif
+
+void InitIpp()
+{
+if(!ippstaticinitcalled)
+	{
+		IppCpuType cpu=ippCoreGetCpuType();
+#ifndef _X64
+		if(cpu==ippCpuUnknown) {cpu=AutoDetect();  ippInitCpu(cpu);}
+		else
+#endif
+		ippStaticInitBest();
+		ippstaticinitcalled=1;
+	}
+}
+#endif
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/keysymdef.h b/ica/win32/winvnc/winvnc/keysymdef.h
new file mode 100644
index 0000000..87274b7
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/keysymdef.h
@@ -0,0 +1,1595 @@
+/* $TOG: keysymdef.h /main/28 1998/05/22 16:18:01 kaleb $ */
+
+/***********************************************************
+Copyright 1987, 1994, 1998  The Open Group
+
+All Rights Reserved.
+
+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.
+
+******************************************************************/
+
+#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_Codeinput		0xFF37
+#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_Kanji_Bangou		0xFF37  /* Codeinput */
+#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 */
+
+/*
+ * Latin-9 (a.k.a. Latin-0)
+ * Byte 3 = 19
+ */
+
+#ifdef XK_LATIN9
+#define XK_OE                  0x13bc
+#define XK_oe                  0x13bd
+#define XK_Ydiaeresis          0x13be
+#endif /* XK_LATIN9 */
+
+/*
+ * 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_IOTAdiaeresis                         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 */
+
+#ifdef XK_CURRENCY
+#define XK_EcuSign					0x20a0
+#define XK_ColonSign					0x20a1
+#define XK_CruzeiroSign					0x20a2
+#define XK_FFrancSign					0x20a3
+#define XK_LiraSign					0x20a4
+#define XK_MillSign					0x20a5
+#define XK_NairaSign					0x20a6
+#define XK_PesetaSign					0x20a7
+#define XK_RupeeSign					0x20a8
+#define XK_WonSign					0x20a9
+#define XK_NewSheqelSign				0x20aa
+#define XK_DongSign					0x20ab
+#define XK_EuroSign					0x20ac
+#endif
diff --git a/ica/win32/winvnc/winvnc/minmax.h b/ica/win32/winvnc/winvnc/minmax.h
new file mode 100644
index 0000000..8715826
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/minmax.h
@@ -0,0 +1,48 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// Routines to calculate the maximum and minimum of two integers
+
+#if !defined(MINMAX_INCLUDED)
+#define MINMAX_INCLUDED
+#pragma once
+
+// Some routines used internally to minimise and maximise integers
+static inline int Max(int x, int y)
+{
+	if (x>y)
+		return x;
+	else
+		return y;
+}
+
+static inline int Min(int x, int y)
+{
+	if (x>y)
+		return y;
+	else
+		return x;
+}
+
+#endif
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/read_write_ini.cpp b/ica/win32/winvnc/winvnc/read_write_ini.cpp
new file mode 100644
index 0000000..acbf372
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/read_write_ini.cpp
@@ -0,0 +1,308 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "inifile.h"
+DWORD MessageBoxSecure(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType);
+
+bool do_copy (IniFile& myIniFile_In, IniFile& myIniFile_Out)
+{
+
+TCHAR *group1=new char[150];
+TCHAR *group2=new char[150];
+TCHAR *group3=new char[150];
+BOOL BUseRegistry;
+LONG MSLogonRequired;
+LONG NewMSLogon;
+LONG locdom1;
+LONG locdom2;
+LONG locdom3;
+LONG DebugMode;
+LONG Avilog;
+LONG DebugLevel;
+LONG DisableTrayIcon;
+LONG LoopbackOnly;
+LONG UseDSMPlugin;
+LONG AllowLoopback;
+LONG AuthRequired;
+LONG ConnectPriority;
+
+char DSMPlugin[128];
+char *authhosts=new char[150];
+
+LONG AllowShutdown=1;
+LONG AllowProperties=1;
+LONG AllowEditClients=1;
+
+LONG FileTransferEnabled=0;
+LONG FTUserImpersonation=1;
+LONG BlankMonitorEnabled=1;
+LONG BlankInputsOnly=0; //PGM
+LONG DefaultScale=1;
+LONG CaptureAlphaBlending=1;
+LONG BlackAlphaBlending=1;
+
+LONG SocketConnect=1;
+LONG HTTPConnect;
+LONG XDMCPConnect;
+LONG AutoPortSelect=1;
+LONG PortNumber=5900;
+LONG HttpPortNumber=5800;
+LONG IdleTimeout=0;
+
+LONG RemoveWallpaper=1;
+LONG RemoveAero=1;
+
+LONG QuerySetting=1;
+LONG QueryTimeout=10;
+LONG QueryAccept=4;
+LONG QueryIfNoLogon=1;
+
+LONG EnableRemoteInputs=1;
+LONG LockSettings=0;
+LONG DisableLocalInputs=0;
+LONG EnableJapInput=0;
+LONG kickrdp=0;
+LONG clearconsole=0;
+
+#define MAXPWLEN 8
+char passwd[MAXPWLEN];
+
+LONG TurboMode=1;
+LONG PollUnderCursor=0;
+LONG PollForeground=0;
+LONG PollFullScreen=1;
+LONG PollConsoleOnly=0;
+LONG PollOnEventOnly=0;
+LONG Driver=0;
+LONG Hook=1;
+LONG Virtual=0;
+LONG SingleWindow=0;
+char SingleWindowName[32];
+LONG FTTimeout = 30;
+char path[512];
+LONG MaxCpu=40;
+
+LONG Primary=1;
+LONG Secondary=0;
+//Beep(100,20000);
+BUseRegistry = myIniFile_In.ReadInt("admin", "UseRegistry", 0);
+if (!myIniFile_Out.WriteInt("admin", "UseRegistry", BUseRegistry))
+{
+		//error
+		char temp[10];
+		DWORD error=GetLastError();
+		MessageBoxSecure(NULL,myIniFile_Out.myInifile,_itoa(error,temp,10),MB_ICONERROR);
+		return false;
+}
+
+MSLogonRequired=myIniFile_In.ReadInt("admin", "MSLogonRequired", false);
+myIniFile_Out.WriteInt("admin", "MSLogonRequired", MSLogonRequired);
+NewMSLogon=myIniFile_In.ReadInt("admin", "NewMSLogon", false);
+myIniFile_Out.WriteInt("admin", "NewMSLogon", NewMSLogon);
+
+
+myIniFile_In.ReadString("admin_auth","group1",group1,150);
+myIniFile_In.ReadString("admin_auth","group2",group2,150);
+myIniFile_In.ReadString("admin_auth","group3",group3,150);
+myIniFile_Out.WriteString("admin_auth", "group1",group1);
+myIniFile_Out.WriteString("admin_auth", "group2",group2);
+myIniFile_Out.WriteString("admin_auth", "group3",group3);
+
+
+
+locdom1=myIniFile_In.ReadInt("admin_auth", "locdom1",0);
+locdom2=myIniFile_In.ReadInt("admin_auth", "locdom2",0);
+locdom3=myIniFile_In.ReadInt("admin_auth", "locdom3",0);
+myIniFile_Out.WriteInt("admin_auth", "locdom1", locdom1);
+myIniFile_Out.WriteInt("admin_auth", "locdom2", locdom2);
+myIniFile_Out.WriteInt("admin_auth", "locdom3", locdom3);
+
+
+DebugMode=myIniFile_In.ReadInt("admin", "DebugMode", 0);
+Avilog=myIniFile_In.ReadInt("admin", "Avilog", 0);
+myIniFile_In.ReadString("admin", "path", path,512);
+DebugLevel=myIniFile_In.ReadInt("admin", "DebugLevel", 0);
+DisableTrayIcon=myIniFile_In.ReadInt("admin", "DisableTrayIcon", false);
+LoopbackOnly=myIniFile_In.ReadInt("admin", "LoopbackOnly", false);
+
+myIniFile_Out.WriteInt("admin", "DebugMode", DebugMode);
+myIniFile_Out.WriteInt("admin", "Avilog", Avilog);
+myIniFile_Out.WriteString("admin", "path", path);
+myIniFile_Out.WriteInt("admin", "DebugLevel", DebugLevel);
+myIniFile_Out.WriteInt("admin", "DisableTrayIcon", DisableTrayIcon);
+myIniFile_Out.WriteInt("admin", "LoopbackOnly", LoopbackOnly);
+
+UseDSMPlugin=myIniFile_In.ReadInt("admin", "UseDSMPlugin", false);
+AllowLoopback=myIniFile_In.ReadInt("admin", "AllowLoopback", false);
+AuthRequired=myIniFile_In.ReadInt("admin", "AuthRequired", true);
+ConnectPriority=myIniFile_In.ReadInt("admin", "ConnectPriority", 0);
+
+myIniFile_Out.WriteInt("admin", "UseDSMPlugin", UseDSMPlugin);
+myIniFile_Out.WriteInt("admin", "AllowLoopback", AllowLoopback);
+myIniFile_Out.WriteInt("admin", "AuthRequired", AuthRequired);
+myIniFile_Out.WriteInt("admin", "ConnectPriority", ConnectPriority);
+
+
+myIniFile_In.ReadString("admin", "DSMPlugin",DSMPlugin,128);
+myIniFile_In.ReadString("admin", "AuthHosts",authhosts,150);
+
+myIniFile_Out.WriteString("admin", "DSMPlugin",DSMPlugin);
+myIniFile_Out.WriteString("admin", "AuthHosts",authhosts);
+
+AllowShutdown=myIniFile_In.ReadInt("admin", "AllowShutdown", true);
+AllowProperties=myIniFile_In.ReadInt("admin", "AllowProperties", true);
+AllowEditClients=myIniFile_In.ReadInt("admin", "AllowEditClients", true);
+myIniFile_Out.WriteInt("admin", "AllowShutdown" ,AllowShutdown);
+myIniFile_Out.WriteInt("admin", "AllowProperties" ,AllowProperties);
+myIniFile_Out.WriteInt("admin", "AllowEditClients" ,AllowEditClients);
+
+
+FileTransferEnabled=myIniFile_In.ReadInt("admin", "FileTransferEnabled", true);
+FTUserImpersonation=myIniFile_In.ReadInt("admin", "FTUserImpersonation", true);
+BlankMonitorEnabled = myIniFile_In.ReadInt("admin", "BlankMonitorEnabled", true);
+BlankInputsOnly = myIniFile_In.ReadInt("admin", "BlankInputsOnly", false); //PGM
+DefaultScale = myIniFile_In.ReadInt("admin", "DefaultScale", 1);
+CaptureAlphaBlending = myIniFile_In.ReadInt("admin", "CaptureAlphaBlending", false); // sf at 2005
+BlackAlphaBlending = myIniFile_In.ReadInt("admin", "BlackAlphaBlending", false); // sf at 2005
+FTTimeout = myIniFile_In.ReadInt("admin", "FileTransferTimeout", 30);
+
+Primary = myIniFile_In.ReadInt("admin", "primary", true);
+Secondary = myIniFile_In.ReadInt("admin", "secondary", false);
+
+
+myIniFile_Out.WriteInt("admin", "FileTransferEnabled", FileTransferEnabled);
+myIniFile_Out.WriteInt("admin", "FTUserImpersonation", FTUserImpersonation);
+myIniFile_Out.WriteInt("admin", "BlankMonitorEnabled", BlankMonitorEnabled);
+myIniFile_Out.WriteInt("admin", "BlankInputsOnly", BlankInputsOnly); //PGM
+myIniFile_Out.WriteInt("admin", "DefaultScale", DefaultScale);
+myIniFile_Out.WriteInt("admin", "CaptureAlphaBlending", CaptureAlphaBlending);
+myIniFile_Out.WriteInt("admin", "BlackAlphaBlending", BlackAlphaBlending);
+myIniFile_Out.WriteInt("admin", "FileTransferTimeout", 30);
+
+myIniFile_Out.WriteInt("admin", "primary", Primary);
+myIniFile_Out.WriteInt("admin", "secondary", Secondary);
+
+	// Connection prefs
+SocketConnect=myIniFile_In.ReadInt("admin", "SocketConnect", true);
+HTTPConnect=myIniFile_In.ReadInt("admin", "HTTPConnect", true);
+XDMCPConnect=myIniFile_In.ReadInt("admin", "XDMCPConnect", true);
+AutoPortSelect=myIniFile_In.ReadInt("admin", "AutoPortSelect", true);
+PortNumber=myIniFile_In.ReadInt("admin", "PortNumber", PortNumber);
+HttpPortNumber=myIniFile_In.ReadInt("admin", "HTTPPortNumber",HttpPortNumber);
+IdleTimeout=myIniFile_In.ReadInt("admin", "IdleTimeout", IdleTimeout);
+myIniFile_Out.WriteInt("admin", "SocketConnect", SocketConnect);
+myIniFile_Out.WriteInt("admin", "HTTPConnect", HTTPConnect);
+myIniFile_Out.WriteInt("admin", "XDMCPConnect", XDMCPConnect);
+myIniFile_Out.WriteInt("admin", "AutoPortSelect", AutoPortSelect);
+myIniFile_Out.WriteInt("admin", "PortNumber", PortNumber);
+myIniFile_Out.WriteInt("admin", "HTTPPortNumber", HttpPortNumber);
+myIniFile_Out.WriteInt("admin", "IdleTimeout", IdleTimeout);
+	
+RemoveWallpaper=myIniFile_In.ReadInt("admin", "RemoveWallpaper", RemoveWallpaper);
+RemoveAero=myIniFile_In.ReadInt("admin", "RemoveAero", RemoveAero);
+myIniFile_Out.WriteInt("admin", "RemoveWallpaper", RemoveWallpaper);
+myIniFile_Out.WriteInt("admin", "RemoveAero", RemoveAero);
+
+	// Connection querying settings
+QuerySetting=myIniFile_In.ReadInt("admin", "QuerySetting", QuerySetting);
+QueryTimeout=myIniFile_In.ReadInt("admin", "QueryTimeout", QueryTimeout);
+QueryAccept=myIniFile_In.ReadInt("admin", "QueryAccept", QueryAccept);
+QueryIfNoLogon=myIniFile_In.ReadInt("admin", "QueryIfNoLogon", QueryIfNoLogon);
+myIniFile_Out.WriteInt("admin", "QuerySetting", QuerySetting);
+myIniFile_Out.WriteInt("admin", "QueryTimeout", QueryTimeout);
+myIniFile_Out.WriteInt("admin", "QueryAccept", QueryAccept);
+myIniFile_Out.WriteInt("admin", "QueryIfNoLogon", QueryIfNoLogon);
+
+myIniFile_In.ReadPassword(passwd,MAXPWLEN);
+myIniFile_Out.WritePassword(passwd);
+memset(passwd, '\0', MAXPWLEN); //PGM 
+myIniFile_In.ReadPassword2(passwd,MAXPWLEN); //PGM
+myIniFile_Out.WritePassword2(passwd); //PGM
+
+EnableRemoteInputs=myIniFile_In.ReadInt("admin", "InputsEnabled", EnableRemoteInputs);
+LockSettings=myIniFile_In.ReadInt("admin", "LockSetting", LockSettings);
+DisableLocalInputs=myIniFile_In.ReadInt("admin", "LocalInputsDisabled", DisableLocalInputs);
+EnableJapInput=myIniFile_In.ReadInt("admin", "EnableJapInput", EnableJapInput);
+kickrdp=myIniFile_In.ReadInt("admin", "kickrdp", kickrdp);
+clearconsole=myIniFile_In.ReadInt("admin", "clearconsole", clearconsole);
+
+myIniFile_Out.WriteInt("admin", "InputsEnabled", EnableRemoteInputs);
+myIniFile_Out.WriteInt("admin", "LockSetting", LockSettings);
+myIniFile_Out.WriteInt("admin", "LocalInputsDisabled", DisableLocalInputs);	
+myIniFile_Out.WriteInt("admin", "EnableJapInput", EnableJapInput);
+myIniFile_Out.WriteInt("admin", "kickrdp", kickrdp);
+myIniFile_Out.WriteInt("admin", "clearconsole", clearconsole);
+
+
+TurboMode = myIniFile_In.ReadInt("poll", "TurboMode", TurboMode);
+PollUnderCursor=myIniFile_In.ReadInt("poll", "PollUnderCursor", PollUnderCursor);
+PollForeground=myIniFile_In.ReadInt("poll", "PollForeground", PollForeground);
+PollFullScreen=myIniFile_In.ReadInt("poll", "PollFullScreen", PollFullScreen);
+PollConsoleOnly=myIniFile_In.ReadInt("poll", "OnlyPollConsole", PollConsoleOnly);
+PollOnEventOnly=myIniFile_In.ReadInt("poll", "OnlyPollOnEvent", PollOnEventOnly);
+MaxCpu=myIniFile_In.ReadInt("poll", "MaxCpu",MaxCpu);
+Driver=myIniFile_In.ReadInt("poll", "EnableDriver",Driver);
+Hook=myIniFile_In.ReadInt("poll", "EnableHook", Hook);
+Virtual=myIniFile_In.ReadInt("poll", "EnableVirtual", Virtual);
+
+SingleWindow=myIniFile_In.ReadInt("poll","SingleWindow",SingleWindow);
+myIniFile_In.ReadString("poll", "SingleWindowName", SingleWindowName,32);
+
+myIniFile_Out.WriteInt("poll", "TurboMode", TurboMode);
+myIniFile_Out.WriteInt("poll", "PollUnderCursor", PollUnderCursor);
+myIniFile_Out.WriteInt("poll", "PollForeground", PollForeground);
+myIniFile_Out.WriteInt("poll", "PollFullScreen", PollFullScreen);
+myIniFile_Out.WriteInt("poll", "OnlyPollConsole",PollConsoleOnly);
+myIniFile_Out.WriteInt("poll", "OnlyPollOnEvent", PollOnEventOnly);
+myIniFile_Out.WriteInt("poll", "MaxCpu", MaxCpu);
+myIniFile_Out.WriteInt("poll", "EnableDriver", Driver);
+myIniFile_Out.WriteInt("poll", "EnableHook", Hook);
+myIniFile_Out.WriteInt("poll", "EnableVirtual", Virtual);
+
+myIniFile_Out.WriteInt("poll", "SingleWindow", SingleWindow);
+myIniFile_Out.WriteString("poll", "SingleWindowName", SingleWindowName);
+return true;
+}
+
+bool Copy_to_Temp(char *tempfile)
+{
+IniFile myIniFile_In;
+IniFile myIniFile_Out;
+myIniFile_In.IniFileSetSecure();
+myIniFile_Out.IniFileSetTemp(tempfile);
+
+return do_copy(myIniFile_In, myIniFile_Out);
+
+}
+
+
+bool Copy_to_Secure_from_temp(char *tempfile)
+{
+IniFile myIniFile_In;
+IniFile myIniFile_Out;
+myIniFile_Out.IniFileSetSecure();
+myIniFile_In.IniFileSetTemp(tempfile);
+
+return do_copy(myIniFile_In, myIniFile_Out);
+}
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/res/AuthPanel.class b/ica/win32/winvnc/winvnc/res/AuthPanel.class
new file mode 100644
index 0000000..14ea30f
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/AuthPanel.class differ
diff --git a/ica/win32/winvnc/winvnc/res/ButtonPanel.class b/ica/win32/winvnc/winvnc/res/ButtonPanel.class
new file mode 100644
index 0000000..fcbf38a
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/ButtonPanel.class differ
diff --git a/ica/win32/winvnc/winvnc/res/DH.class b/ica/win32/winvnc/winvnc/res/DH.class
new file mode 100644
index 0000000..9929fa0
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/DH.class differ
diff --git a/ica/win32/winvnc/winvnc/res/FTPFrame.class b/ica/win32/winvnc/winvnc/res/FTPFrame.class
new file mode 100644
index 0000000..c0ddd3c
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/FTPFrame.class differ
diff --git a/ica/win32/winvnc/winvnc/res/Finger.cur b/ica/win32/winvnc/winvnc/res/Finger.cur
new file mode 100644
index 0000000..8fb9346
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/Finger.cur differ
diff --git a/ica/win32/winvnc/winvnc/res/RecordingFrame.class b/ica/win32/winvnc/winvnc/res/RecordingFrame.class
new file mode 100644
index 0000000..4a09aa4
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/RecordingFrame.class differ
diff --git a/ica/win32/winvnc/winvnc/res/SessionRecorder.class b/ica/win32/winvnc/winvnc/res/SessionRecorder.class
new file mode 100644
index 0000000..6c030d3
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/SessionRecorder.class differ
diff --git a/ica/win32/winvnc/winvnc/res/clipboardframe.class b/ica/win32/winvnc/winvnc/res/clipboardframe.class
new file mode 100644
index 0000000..00f180f
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/clipboardframe.class differ
diff --git a/ica/win32/winvnc/winvnc/res/descipher.class b/ica/win32/winvnc/winvnc/res/descipher.class
new file mode 100644
index 0000000..9fe50e8
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/descipher.class differ
diff --git a/ica/win32/winvnc/winvnc/res/ding_dong.wav b/ica/win32/winvnc/winvnc/res/ding_dong.wav
new file mode 100644
index 0000000..5577fc3
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/ding_dong.wav differ
diff --git a/ica/win32/winvnc/winvnc/res/ftpframe$strcomp.class b/ica/win32/winvnc/winvnc/res/ftpframe$strcomp.class
new file mode 100644
index 0000000..e147b7b
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/ftpframe$strcomp.class differ
diff --git a/ica/win32/winvnc/winvnc/res/icon2.ico b/ica/win32/winvnc/winvnc/res/icon2.ico
new file mode 100644
index 0000000..94f49df
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/icon2.ico differ
diff --git a/ica/win32/winvnc/winvnc/res/optionsframe.class b/ica/win32/winvnc/winvnc/res/optionsframe.class
new file mode 100644
index 0000000..2601e9f
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/optionsframe.class differ
diff --git a/ica/win32/winvnc/winvnc/res/rfbproto.class b/ica/win32/winvnc/winvnc/res/rfbproto.class
new file mode 100644
index 0000000..4231ae5
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/rfbproto.class differ
diff --git a/ica/win32/winvnc/winvnc/res/runas.bmp b/ica/win32/winvnc/winvnc/res/runas.bmp
new file mode 100644
index 0000000..ca11149
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/runas.bmp differ
diff --git a/ica/win32/winvnc/winvnc/res/vnc-1.bmp b/ica/win32/winvnc/winvnc/res/vnc-1.bmp
new file mode 100644
index 0000000..9b81765
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/vnc-1.bmp differ
diff --git a/ica/win32/winvnc/winvnc/res/vnccanvas.class b/ica/win32/winvnc/winvnc/res/vnccanvas.class
new file mode 100644
index 0000000..66dda73
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/vnccanvas.class differ
diff --git a/ica/win32/winvnc/winvnc/res/vncviewer.class b/ica/win32/winvnc/winvnc/res/vncviewer.class
new file mode 100644
index 0000000..2ce572d
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/vncviewer.class differ
diff --git a/ica/win32/winvnc/winvnc/res/vncviewer.jar b/ica/win32/winvnc/winvnc/res/vncviewer.jar
new file mode 100644
index 0000000..911606e
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/vncviewer.jar differ
diff --git a/ica/win32/winvnc/winvnc/res/world3a.ico b/ica/win32/winvnc/winvnc/res/world3a.ico
new file mode 100644
index 0000000..f864974
Binary files /dev/null and b/ica/win32/winvnc/winvnc/res/world3a.ico differ
diff --git a/ica/win32/winvnc/winvnc/resource.h b/ica/win32/winvnc/winvnc/resource.h
new file mode 100644
index 0000000..f587443
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/resource.h
@@ -0,0 +1,312 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by winvnc.rc
+//
+#define IDI_WINVNC                      102
+#define IDD_PROPERTIES                  102
+#define IDS_WARNING                     103
+#define IDR_TRAYMENU                    104
+#define IDR_VNCVIEWER_JAR               116
+#define IDR_RECFRAME_CLASS              117
+#define IDR_SESSIONREC_CLASS            118
+#define IDR_AUTHPANEL_CLASS             119
+#define IDR_BLOCKCIPHER_CLASS           120
+#define IDR_CIPHER_CLASS                121
+#define IDR_CLIPBOARDFRAME_CLASS        122
+#define IDR_CRYPTOUTILS_CLASS           123
+#define IDR_IDEACIPHER_CLASS            124
+#define IDR_OPTIONSFRAME_CLASS          125
+#define IDR_RFBPROTO_CLASS              126
+#define IDR_VNCCANVAS_CLASS             127
+#define IDR_VNCVIEWER_CLASS             128
+#define IDR_BUTTONPANEL_CLASS           129
+#define IDR_DESCIPHER_CLASS             130
+#define IDD_ABOUT                       131
+#define IDB_VNCLOGO                     132
+#define IDI_FLASH                       134
+#define IDD_OUTGOING_CONN               135
+#define IDD_ACCEPT_CONN                 136
+#define IDD_PATHS                       138
+#define IDB_LOGO64                      139
+#define IDD_TEXTCHAT_DLG                140
+#define IDD_LIST_DLG                    141
+#define IDB_BITMAP2                     143
+#define IDB_BITMAP4                     144
+#define IDB_BITMAP1                     144
+#define IDD_MSLOGON                     145
+#define IDD_PROPERTIES1                 146
+#define IDD_ABOUT1                      147
+#define IDR_FTPFRAME_CLASS              148
+#define IDR_DH_CLASS                    149
+#define IDR_FTPFRAMESTRCOMP_CLASS       151
+#define IDR_JAVAARCHIVE1                155
+#define IDR_JAVACLASS1                  156
+#define IDR_JAVACLASS2                  157
+#define IDR_JAVACLASS3                  158
+#define IDR_JAVACLASS4                  159
+#define IDR_JAVACLASS5                  160
+#define IDR_JAVACLASS6                  161
+#define IDR_JAVACLASS7                  162
+#define IDR_JAVACLASS8                  163
+#define IDR_JAVACLASS9                  164
+#define IDR_JAVACLASS10                 165
+#define IDR_JAVACLASS11                 166
+#define IDR_JAVACLASS12                 167
+#define IDR_JAVACLASS13                 169
+#define IDD_USER_NAME                   604
+#define IDD_PASSWORD                    608
+#define IDR_MESSAGES_PROPERTIES         900
+#define IDR_MESSAGES_CLASS              901
+#define IDD_LOGON                       1002
+#define IDC_CONNECT_BORDER              1003
+#define IDD_AUTH_DIALOG                 1003
+#define IDC_CONNECT_SOCK                1004
+#define IDC_CONNECT_CORBA               1005
+#define IDC_PORTNO_LABEL                1006
+#define IDC_CONNECT_HTTP                1006
+#define IDC_PASSWORD_LABEL              1007
+#define IDC_PORTNO                      1008
+#define IDC_DISPLAYNO                   1008
+#define IDC_PASSWORD                    1009
+#define IDC_PASSWD_EDIT                 1009
+#define IDC_UPDATE_BORDER               1010
+#define IDC_PASSWORD_LABEL2             1010
+#define IDC_POLL_FULLSCREEN             1011
+#define IDC_PASSWORD2                   1011
+#define IDC_CONSOLE_ONLY                1012
+#define IDC_POLL_FOREGROUND             1013
+#define IDC_POLL_UNDER_CURSOR           1014
+#define IDC_ONEVENT_ONLY                1015
+#define IDC_VNCLOGO                     1016
+#define IDC_CONNSETTINGS_BORDER         1016
+#define IDC_HOSTS                       1016
+#define IDC_VERSION                     1017
+#define IDC_DISPLAY_NO_LABEL            1017
+#define IDC_NAME                        1018
+#define IDC_HOST_ADD                    1018
+#define IDC_EMAIL                       1019
+#define IDC_BUILDTEXT                   1019
+#define IDC_HOST_REMOVE                 1019
+#define IDC_VNC                         1020
+#define IDC_HOST_UP                     1020
+#define IDC_ATT                         1021
+#define IDC_BUILDTIME                   1021
+#define IDC_HOST_DOWN                   1021
+#define IDC_WWW                         1022
+#define IDC_HOST_EDIT                   1022
+#define IDC_COPYRIGHT                   1023
+#define IDC_DISABLE_INPUTS              1024
+#define IDC_APPLY                       1025
+#define IDC_PORTNO_AUTO                 1026
+#define IDD_DOMAIN                      1026
+#define IDC_HOSTNAME_EDIT               1027
+#define IDC_DISABLE_LOCAL_INPUTS        1027
+#define IDC_HOSTNAME_STATIC             1028
+#define IDC_REMOVE_WALLPAPER            1028
+#define IDC_NOTE_STATIC                 1029
+#define IDACCEPT                        1030
+#define IDREJECT                        1031
+#define IDC_STATIC_TEXT1                1032
+#define IDC_ACCEPT_IP                   1033
+#define IDC_STATIC_TEXT                 1034
+#define IDC_ACCEPT_TIMEOUT              1035
+#define IDC_TRADEMARK                   1036
+#define IDC_AUTO_DISPLAY_NO             1037
+#define IDC_MANUAL_DISPLAY_NO           1038
+#define IDC_DISPLAY_NUMBER              1039
+#define IDC_LOCKSETTINGS                1040
+#define IDC_LOCKSETTING_NOTHING         1041
+#define IDC_LOCKSETTING_LOGOFF          1042
+#define IDC_LOCKSETTING_LOCK            1043
+#define IDC_FILETRANSFER                1046
+#define IDC_SCALE                       1048
+#define IDC_PATH                        1049
+#define IDC_SETMASTER                   1050
+#define IDC_MSLOGON_CHECK               1051
+#define IDC_PLUGIN_CHECK                1052
+#define IDC_COMBO1                      1053
+#define IDC_PLUGINS_COMBO               1053
+#define IDC_PLUGIN_BUTTON               1054
+#define IDC_VIEWERS_LISTBOX             1055
+#define IDC_SINGLE_WINDOW               1056
+#define IDC_CLIENTTEXT                  1056
+#define IDC_VIEWERS_LISTBOX2            1056
+#define IDC_PENDING_LISTBOX             1056
+#define IDC_KILL_B                      1057
+#define IDC_NAME_APPLI                  1058
+#define IDC_TEXTCHAT_B                  1058
+#define IDC_SPECDISPLAY                 1060
+#define IDC_SPECPORT                    1061
+#define IDC_PORTRFB                     1062
+#define IDC_PORTHTTP                    1063
+#define IDC_STATUS                      1064
+#define IDC_WARNING                     1064
+#define IDC_PERSISTENT_CHECK            1065
+#define IDC_DRIVER                      1066
+#define IDC_HOOK                        1067
+#define IDC_VIRTUAL                     1068
+#define IDC_CONNECT_XDMCP               1069
+#define IDC_BLANK                       1070
+#define IDC_BLANK2                      1071
+#define IDC_TURBOMODE                   1075
+#define IDC_SEND_B                      1078
+#define IDC_LOG                         1079
+#define IDC_ALLOWLOOPBACK               1080
+#define IDQUERY                         1081
+#define IDQUERYTIMEOUT                  1082
+#define IDC_EDIT1                       1084
+#define IDC_GROUP1                      1084
+#define IDC_IDCODE                      1084
+#define IDC_BLANKINGTXT                 1084
+#define IDC_EDIT_PATH                   1084
+#define IDC_MAXCPU                      1084
+#define IDC_MSLOGON_CHECKD              1085
+#define IDC_GROUP2                      1086
+#define IDC_MSLOGON_CHECKD2             1086
+#define IDC_GROUP3                      1087
+#define IDC_CHECKG1L                    1088
+#define IDC_CHECKG2L                    1089
+#define IDC_CHECKG3L                    1090
+#define IDC_CHECKG1D                    1091
+#define IDC_CHECKG2D                    1092
+#define IDC_CHECKG3D                    1093
+#define IDC_MSLOGON                     1094
+#define IDC_CHECKDRIVER                 1096
+#define IDC_RADIO1                      1097
+#define IDC_MV1                         1097
+#define IDC_RADIO2                      1098
+#define IDC_MV2                         1098
+#define IDC_RADIO3                      1099
+#define IDC_MV3                         1099
+#define IDC_RADIO4                      1100
+#define IDC_MV4                         1100
+#define IDC_LOOPBACKONLY                1101
+#define IDC_CHECK2                      1102
+#define IDC_DISABLETRAY                 1102
+#define IDC_DREFUSE                     1105
+#define IDC_DACCEPT                     1106
+#define IDC_ALLOWSHUTDOWN               1107
+#define IDC_ALLOWEDITCLIENTS            1108
+#define IDC_NEW_MSLOGON                 1109
+#define IDC_HIDE_B                      1110
+#define IDC_ALPHA                       1112
+#define IDC_ALPHABLACK                  1114
+#define IDC_ALPHABLACK2                 1116
+#define IDC_FTUSERIMPERSONATION_CHECK   1117
+#define IDC_REMOVE_Aero                 1118
+#define IDE_CUSTOM1                     1119
+#define IDC_WWW2                        1120
+#define IDC_WWW3                        1121
+#define IDC_CHECK1                      1122
+#define IDC_JAP_INPUTS                  1122
+#define IDC_CHECK3                      1123
+#define IDC_EURO                        1123
+#define IDC_VIDEO                       1125
+#define IDC_BUTTON1                     1126
+#define IDC_CLEAR                       1126
+#define IDC_CONNECTION_NUMBER_LABEL     1128
+#define IDC_CONNECTION_NUMBER_STATIC    1128
+#define IDC_CAPTION_STATIC              1129
+#define IDC_Path1                       1132
+#define IDC_Path2                       1133
+#define IDC_Path3                       1134
+#define IDC_LOCALTEXT_EDIT              1140
+#define IDC_INPUTAREA_EDIT              1140
+#define IDC_REMOTETEXT_EDIT             1141
+#define IDC_CHATAREA_EDIT               1141
+#define IDC_CLEAR_B                     1142
+#define IDC_FINGER                      9000
+#define IDC_GAMMAGRAY                   9001
+#define IDC_STATIC_SPLIT                9002
+#define ID_ADMIN_PROPERTIES             40000
+#define ID_PROPERTIES                   40001
+#define ID_CLOSE                        40002
+#define ID_KILLCLIENTS                  40003
+#define ID_ABOUT                        40004
+#define ID_OUTGOING_CONN                40005
+#define ID_DEFAULT_PROPERTIES           40006
+#define ID_LISTCLIENTS                  40007
+#define ID_ONLINEHELP                   40013
+#define ID_HOME                         40014
+#define ID_CLOSE_SERVICE                40015
+#define ID_RUNASSERVICE                 40016
+#define ID_UNINSTALL_SERVICE            40017
+#define ID_START_SERVICE                40018
+#define ID_TRAY_VISITUSONLINE           40019
+#define ID_VISITUSONLINE_HOMEPAGE       40020
+#define ID_VISITUSONLINE_FORUM          40021
+#define ID_TRAY_ENABLESOFTWARECAD       40022
+#define ID_SOFTWARECAD                  40023
+#define ID_TRAY_REBOOTINSAFEMODE        40024
+#define ID_REBOOTSAFEMODE               40025
+#define ID_TRAY_DELETESOFTWARECAD       40026
+#define ID_DELSOFTWARECAD               40027
+#define ID_TRAY_FORCEREBOOT             40028
+#define ID_REBOOT_FORCE                 40029
+#define ID_FAILED_INIT                  41000
+#define ID_WINVNC_USAGE                 41001
+#define ID_ANOTHER_INST                 41002
+#define ID_NO_EXIST_INST                41003
+#define ID_UNABLE_INST                  41004
+#define ID_SCM_NOT_HERE                 41005
+#define ID_SERV_NOT_REG                 41006
+#define ID_SERV_FAIL_ST                 41007
+#define ID_SERV_CT_MISS                 41008
+#define ID_SERV_OLD_REG                 41009
+#define ID_SERVHELP_UNAB                41010
+#define ID_SERV_CT_UNREG                41011
+#define ID_SERV_NOT_UNRG                41012
+#define ID_SERV_NCONTACT                41013
+#define ID_SERVHELP_NREM                41014
+#define ID_SERV_NOT_STOP                41015
+#define ID_SERV_MK_UNREG                41016
+#define ID_SERV_NT_FOUND                41017
+#define ID_WINVNC_ERROR                 41018
+#define ID_WINVNC_WARNIN                41019
+#define ID_PLUGIN_LOADIN                41020
+#define ID_NO_PASSWD_NO_OVERRIDE_ERR    41021
+#define ID_NO_PASSWD_NO_OVERRIDE_WARN   41022
+#define ID_NO_PASSWD_NO_LOGON_WARN      41023
+#define ID_NO_OVERRIDE_ERR              41024
+#define ID_NO_CURRENT_USER_ERR          41025
+#define ID_CANNOT_EDIT_DEFAULT_PREFS    41026
+#define ID_NO_PASSWORD_WARN             41027
+#define ID_PLUGIN_NOT_LOAD              41028
+#define ID_MB1                          41029
+#define ID_WVNC                         41030
+#define ID_AUTHAD_NOT_FO                41031
+#define ID_WARNING                      41032
+#define ID_AUTH_NOT_FO                  41033
+#define ID_DESKTOP_BITBLT_ROOT          41034
+#define ID_DESKTOP_BITBLT_MEM           41035
+#define ID_DESKTOP_PLANAR_NOTC          41036
+#define ID_FAILED_CONNECT_LISTING_VIEW  41037
+#define ID_OUTGOING_CONNECTION          41038
+#define ID_UNABLE_PROC_MSLOGON          41039
+#define ID_RICHED32_UNLOAD              41040
+#define ID_RICHED32_DLL_LD              41041
+#define ID_SERV_SUCCESS_INST            41042
+#define ID_SERV_SUCCESS_REG             41043
+#define ID_SERV_SUCCESS_UNREG           41044
+#define ID_ULTRAVNC_TEXTCHAT            41045
+#define ID_ULTRAVNC_WARNING             41046
+#define ID_NO_PLUGIN_DETECT             41047
+#define ID_CHAT_WITH_S_ULTRAVNC         41048
+#define ID_CURRENT_USER_PROP            41049
+#define ID_DEFAULT_SYST_PROP            41050
+#define ID_AUTOREJECT_U                 41051
+#define ID_AUTOACCEPT_U                 41052
+#define ID_CADERROR                     41053
+#define ID_CADERRORFILE                 41054
+#define ID_CADPERMISSION                41055
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        170
+#define _APS_NEXT_COMMAND_VALUE         40030
+#define _APS_NEXT_CONTROL_VALUE         1131
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/ica/win32/winvnc/winvnc/rfb.h b/ica/win32/winvnc/winvnc/rfb.h
new file mode 100644
index 0000000..3fb6b20
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/rfb.h
@@ -0,0 +1,86 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// rfb.h
+// This includes the rfb spec header, the port numbers,
+// the CARD type definitions and various useful macros.
+//
+
+#ifndef RFB_H__
+#define RFB_H__
+
+// Define the CARD* types as used in X11/Xmd.h
+
+typedef unsigned long CARD32;
+typedef unsigned short CARD16;
+typedef short INT16;
+typedef unsigned char  CARD8;
+
+// Define the port number offsets
+#define FLASH_PORT_OFFSET 5400
+#define INCOMING_PORT_OFFSET 5500
+#define HTTP_PORT_OFFSET 5800	// we don't use this in Venice
+#define RFB_PORT_OFFSET 5900
+
+#define PORT_TO_DISPLAY(p)  ( (p) - RFB_PORT_OFFSET )
+#define HPORT_TO_DISPLAY(p) ( (p) - HTTP_PORT_OFFSET )
+#define DISPLAY_TO_PORT(d)  ( (d) + RFB_PORT_OFFSET )
+#define DISPLAY_TO_HPORT(d) ( (d) + HTTP_PORT_OFFSET )
+
+// include the protocol spec
+#include <rfb/rfbproto.h>
+
+// define some quick endian conversions
+// change this if necessary
+#define LITTLE_ENDIAN_HOST
+
+#ifdef LITTLE_ENDIAN_HOST
+
+#define Swap16IfLE(s) \
+    ((CARD16) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)))
+#define Swap32IfLE(l) \
+    ((CARD32) ((((l) & 0xff000000) >> 24) | \
+     (((l) & 0x00ff0000) >> 8)  | \
+	 (((l) & 0x0000ff00) << 8)  | \
+	 (((l) & 0x000000ff) << 24)))
+
+#else
+
+#define Swap16IfLE(s) (s)
+#define Swap32IfLE(l) (l)
+
+#endif
+
+// unconditional swaps
+#define Swap16(s) \
+    ((CARD16) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)))
+#define Swap32(l) \
+    ((CARD32) ((((l) & 0xff000000) >> 24) | \
+     (((l) & 0x00ff0000) >> 8)  | \
+	 (((l) & 0x0000ff00) << 8)  | \
+	 (((l) & 0x000000ff) << 24)))
+
+
+#endif
diff --git a/ica/win32/winvnc/winvnc/rfbMisc.h b/ica/win32/winvnc/winvnc/rfbMisc.h
new file mode 100644
index 0000000..6f75375
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/rfbMisc.h
@@ -0,0 +1,124 @@
+//  Copyright (C) 2002 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+#include <vector>
+
+#ifndef max
+#define max(a,b)            (((a) > (b)) ? (a) : (b))
+#endif
+
+#ifndef min
+#define min(a,b)            (((a) < (b)) ? (a) : (b))
+#endif
+
+
+#ifndef __RFB_MISC_INCLUDED__
+#define __RFB_MISC_INCLUDED__
+
+// Some platforms (e.g. Windows) include max() and min() functions
+// in their standard headers.
+// These macros are pdefined only when standard equivalents cannot
+// be found.
+
+
+#ifdef WIN32
+
+// WIN32-ONLY PROFILING CODE
+//
+// CpuTime and CpuTimer provide a simple way to profile particular
+// sections of code
+//
+// Use one CpuTime object per task to be profiled.  CpuTime instances
+// maintain a cumulative total of time spent in user and kernel space
+// by threads.
+// When a CpuTime object is created, a label must be specified to
+// identify the task being profiled.
+// When the object is destroyed, it will print debugging information
+// containing the user and kernel times accumulated.
+//
+// Place a CpuTimer object in each section of code which is to be
+// profiled.  When the object is created, it snapshots the current
+// kernel and user times and stores them.  These are used when the
+// object is destroyed to establish how much time has elapsed in the
+// intervening period.  The accumulated time is then added to the
+// associated CpuTime object.
+//
+// This code works only on platforms providing __int64
+
+namespace rfb {
+
+	class CpuTime {
+	public:
+		CpuTime(const char *name)
+			: timer_name(_strdup(name)),
+			  kernel_time(0), user_time(0), iterations(0), max_user_time(0) {}
+		~CpuTime() {
+			vnclog.Print(0, "timer %s : %I64ums (krnl), %I64ums (user), %I64uus (user-max) (%I64u its)\n",
+				timer_name, kernel_time/10000, user_time/10000, max_user_time/10,
+				iterations);
+			delete [] timer_name;
+		}
+		char* timer_name;
+		__int64 kernel_time;
+		__int64 user_time;
+		__int64 iterations;
+		__int64 max_user_time;
+	};
+
+	class CpuTimer {
+	public:
+		inline CpuTimer(CpuTime &ct) : cputime(ct) {
+			FILETIME create_time, end_time;
+			if (!GetThreadTimes(GetCurrentThread(),
+				&create_time, &end_time,
+				(LPFILETIME)&start_kernel_time,
+				(LPFILETIME)&start_user_time)) {
+				abort();
+			}
+		}
+		inline ~CpuTimer() {
+			FILETIME create_time, end_time;
+			__int64 end_kernel_time, end_user_time;
+			if (!GetThreadTimes(GetCurrentThread(),
+				&create_time, &end_time,
+				(LPFILETIME)&end_kernel_time,
+				(LPFILETIME)&end_user_time)) {
+				abort();
+			}
+			cputime.kernel_time += end_kernel_time - start_kernel_time;
+			cputime.user_time += end_user_time - start_user_time;
+			if (end_user_time - start_user_time > cputime.max_user_time) {
+				cputime.max_user_time = end_user_time - start_user_time;
+			}
+			cputime.iterations++;
+		}
+	private:
+		CpuTime& cputime;
+		__int64 start_kernel_time;
+		__int64 start_user_time;
+	};
+}
+
+#endif
+
+#endif // __RFB_MISC_INCLUDED__
+
+
diff --git a/ica/win32/winvnc/winvnc/rfbRect.h b/ica/win32/winvnc/winvnc/rfbRect.h
new file mode 100644
index 0000000..40418ff
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/rfbRect.h
@@ -0,0 +1,117 @@
+//  Copyright (C) 2002-2003 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+// rfb::Rect and rfb::Point structures
+
+#ifndef __RFB_RECT_INCLUDED__
+#define __RFB_RECT_INCLUDED__
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+
+#include "rfbMisc.h"
+#include <vector>
+
+namespace rfb {
+
+	// rfb::Point
+	//
+	// Represents a point in 2D space, by X and Y coordinates.
+	// Can also be used to represent a delta, or offset, between
+	// two Points.
+	// Functions are provided to allow Points to be compared for
+	// equality and translated by a supplied offset.
+	// Functions are also provided to negate offset Points.
+
+	struct Point {
+		Point() : x(0), y(0) {}
+		Point(int x_, int y_) : x(x_), y(y_) {}
+#ifdef WIN32
+		Point(const POINT &p) : x(p.x), y(p.y) {}
+#endif
+		Point negate() const {return Point(-x, -y);}
+		bool equals(const Point &p) const {return x==p.x && y==p.y;}
+		Point translate(const Point &p) const {return Point(x+p.x, y+p.y);}
+		int x, y;
+	};
+
+	// rfb::Rect
+	//
+	// Represents a rectangular region defined by its top-left (tl)
+	// and bottom-right (br) Points.
+	// Rects may be compared for equality, checked to determine whether
+	// or not they are empty, cleared (made empty), or intersected with
+	// one another.  The bounding rectangle of two existing Rects
+	// may be calculated, as may the area of a Rect.
+	// Rects may also be translated, in the same way as Points, by
+	// an offset specified in a Point structure.
+
+	struct Rect {
+		Rect() {}
+		Rect(Point tl_, Point br_) : tl(tl_), br(br_) {}
+		Rect(int x1, int y1, int x2, int y2) : tl(x1, y1), br(x2, y2) {}
+#ifdef WIN32
+		Rect(const RECT &r) : tl(r.left, r.top), br(r.right, r.bottom) {}
+#endif
+		Rect intersect(const Rect &r) const {
+			Rect result;
+			result.tl.x = max(tl.x, r.tl.x);
+			result.tl.y = max(tl.y, r.tl.y);
+			result.br.x = min(br.x, r.br.x);
+			result.br.y = min(br.y, r.br.y);
+			return result;
+		}
+		Rect union_boundary(const Rect &r) const {
+			Rect result;
+			if (is_empty()) return r;
+			if (r.is_empty()) return *this;
+			result.tl.x = min(tl.x, r.tl.x);
+			result.tl.y = min(tl.y, r.tl.y);
+			result.br.x = max(br.x, r.br.x);
+			result.br.y = max(br.y, r.br.y);
+			return result;
+		}
+		Rect translate(const Point &p) const {
+			return Rect(tl.translate(p), br.translate(p));
+		}
+		bool equals(const Rect &r) const {return r.tl.equals(tl) && r.br.equals(br);}
+		bool is_empty() const {return (tl.x >= br.x) || (tl.y >= br.y);}
+		void clear() {tl = Point(); br = Point();}
+		bool enclosed_by(const Rect &r) const {
+			return (tl.x>=r.tl.x) && (tl.y>=r.tl.y) && (br.x<=r.br.x) && (br.y<=r.br.y);
+		}
+		unsigned int area() const {return is_empty() ? 0 : width()*height();}
+    inline int width() const {return br.x-tl.x;}
+    inline int height() const {return br.y-tl.y;}
+		Point tl;
+		Point br;
+	};
+
+	// rfb::RectVector
+	//
+	// An STL vector containing Rects. 
+	typedef std::vector<Rect> RectVector;
+
+}
+
+
+#endif // __RFB_RECT_INCLUDED__
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/rfbRegion.h b/ica/win32/winvnc/winvnc/rfbRegion.h
new file mode 100644
index 0000000..de0742e
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/rfbRegion.h
@@ -0,0 +1,31 @@
+//  Copyright (C) 2002-2003 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+//#define USE_X11_REGIONS
+
+#ifdef USE_X11_REGIONS
+#include "rfbRegion_X11.h"
+#else
+
+#include "rfbRegion_win32.h"
+
+
+#endif // X11
diff --git a/ica/win32/winvnc/winvnc/rfbRegion_X11.cxx b/ica/win32/winvnc/winvnc/rfbRegion_X11.cxx
new file mode 100644
index 0000000..f6e4670
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/rfbRegion_X11.cxx
@@ -0,0 +1,210 @@
+//  Copyright (C) 2002-2003 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+// Cross-platform Region class based on the X11 region implementation
+/*
+#include "stdhdrs.h"
+#include "rfbRegion_X11.h"
+#include <Xregion/region.h>
+#include <assert.h>
+
+using namespace rfb;
+
+class _RectRegion {
+public:
+  _RectRegion() {
+    region.rects = 0;
+    region.numRects = 0;
+    region.size = 0;
+  }
+  _RectRegion(const Rect& r) {
+    region.rects = &region.extents;
+    region.numRects = 1;
+    region.extents.x1 = r.tl.x;
+    region.extents.y1 = r.tl.y;
+    region.extents.x2 = r.br.x;
+    region.extents.y2 = r.br.y;
+    region.size = 1;
+    if (r.is_empty())
+      region.numRects = 0;
+  }
+  REGION region;
+};
+
+
+Region::Region() {
+  Xrgn = XCreateRegion();
+  assert(Xrgn);
+}
+
+Region::Region(int x1, int y1, int x2, int y2) {
+  Xrgn = XCreateRegion();
+  assert(Xrgn);
+  reset(Rect(x1, y1, x2, y2));
+}
+
+Region::Region(const Rect& r) {
+  Xrgn = XCreateRegion();
+  assert(Xrgn);
+  reset(r);
+}
+
+Region::Region(const Region& r) {
+  _RectRegion tmp;
+  Xrgn = XCreateRegion();
+  assert(Xrgn);
+  XUnionRegion(&tmp.region, r.Xrgn, Xrgn);
+}
+
+Region::~Region() {
+  XDestroyRegion(Xrgn);
+}
+
+
+rfb::Region& Region::operator=(const Region& r) {
+  _RectRegion tmp;
+  clear();
+  XUnionRegion(&tmp.region, r.Xrgn, Xrgn);
+  return *this;
+}
+
+
+void Region::clear() {
+  EMPTY_REGION(Xrgn);
+}
+
+void Region::reset(const Rect& r) {
+  clear();
+  XRectangle xrect;
+  xrect.x = r.tl.x;
+  xrect.y = r.tl.y;
+  xrect.width = r.width();
+  xrect.height = r.height();
+  XUnionRectWithRegion(&xrect, Xrgn, Xrgn);
+}
+
+void Region::translate(const Point& delta) {
+  XOffsetRegion(Xrgn, delta.x, delta.y);
+}
+
+void Region::setOrderedRects(const std::vector<Rect>& rects) {
+  std::vector<Rect>::const_iterator i;
+  for (i=rects.begin(); i != rects.end(); ++i) {
+    _RectRegion rr(*i);
+    XUnionRegion(&rr.region, Xrgn, Xrgn);
+  }
+}
+
+
+void Region::assign_intersect(const Region& r) {
+  XIntersectRegion(r.Xrgn, Xrgn, Xrgn);
+}
+
+void Region::assign_union(const Region& r) {
+  XUnionRegion(r.Xrgn, Xrgn, Xrgn);
+}
+
+void Region::assign_subtract(const Region& r) {
+  XSubtractRegion(Xrgn, r.Xrgn, Xrgn);
+}
+
+
+rfb::Region Region::intersect(const Region& r) const {
+  Region t = *this;
+  t.assign_intersect(r);
+  return t;
+}
+
+rfb::Region Region::union_(const Region& r) const {
+  Region t = *this;
+  t.assign_union(r);
+  return t;
+}
+
+rfb::Region Region::subtract(const Region& r) const {
+  Region t = *this;
+  t.assign_subtract(r);
+  return t;
+}
+
+
+bool Region::equals(const Region& b) const {
+  return (0 != XEqualRegion(Xrgn, b.Xrgn));
+}
+
+bool Region::is_empty() const {
+  return (0 != XEmptyRegion(Xrgn));
+}
+
+
+bool Region::get_rects(std::vector<Rect>& rects,
+                       bool left2right,
+                       bool topdown) const {
+  BOX* Xrects = Xrgn->rects;
+
+  int nRects = Xrgn->numRects;
+  int xInc = left2right ? 1 : -1;
+  int yInc = topdown ? 1 : -1;
+  int i = topdown ? 0 : nRects-1;
+
+  rects.clear();
+  while (nRects > 0) {
+    int firstInNextBand = i;
+    int nRectsInBand = 0;
+
+    while (nRects > 0 && Xrects[firstInNextBand].y1 == Xrects[i].y1) {
+      firstInNextBand += yInc;
+      nRects--;
+      nRectsInBand++;
+    }
+
+    if (xInc != yInc)
+      i = firstInNextBand - yInc;
+
+    while (nRectsInBand > 0) {
+      Rect r(Xrects[i].x1, Xrects[i].y1,
+             Xrects[i].x2, Xrects[i].y2);
+      rects.push_back(r);
+      i += xInc;
+      nRectsInBand--;
+    }
+
+    i = firstInNextBand;
+  }
+
+  return !rects.empty();
+}
+
+rfb::Rect Region::get_bounding_rect() const {
+  XRectangle r;
+  XClipBox(Xrgn, &r);
+  return Rect(r.x, r.y, r.x+r.width, r.y+r.height);
+}
+
+int Region::Numrects()
+{
+	return Xrgn->numRects;
+}*/
+/*XRegion Region::replaceXrgn(XRegion newrgn) {
+  XRegion tmp = Xrgn;
+  Xrgn = newrgn;
+  return tmp;
+}*/
diff --git a/ica/win32/winvnc/winvnc/rfbRegion_X11.h b/ica/win32/winvnc/winvnc/rfbRegion_X11.h
new file mode 100644
index 0000000..30214ee
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/rfbRegion_X11.h
@@ -0,0 +1,87 @@
+//  Copyright (C) 2002-2003 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+// Cross-platform Region class based on the X11 region implementation
+
+#ifndef __RFB_REGION_X11_INCLUDED__
+#define __RFB_REGION_X11_INCLUDED__
+
+#include "rfbRect.h"
+#include <Xregion/Xregion.h>
+#include <vector>
+
+namespace rfb {
+
+  // rfb::Region
+  // See Region.h for description of interface.
+
+  class Region {
+  public:
+    // Create an empty region
+    Region();
+    // Create a rectangular region
+    Region(int x1, int y1, int x2, int y2);
+    Region(const Rect& r);
+
+    Region(const Region& r);
+    Region &operator=(const Region& src);
+
+    ~Region();
+
+    // the following methods alter the region in place:
+
+    void clear();
+    void reset(const Rect& r);
+    void translate(const rfb::Point& delta);
+    void setOrderedRects(const std::vector<Rect>& rects);
+
+    void assign_intersect(const Region& r);
+    void assign_union(const Region& r);
+    void assign_subtract(const Region& r);
+
+    // the following three operations return a new region:
+
+    Region intersect(const Region& r) const;
+    Region union_(const Region& r) const;
+    Region subtract(const Region& r) const;
+
+    bool equals(const Region& b) const;
+    bool is_empty() const;
+
+    bool get_rects(std::vector<Rect>& rects, bool left2right=true,
+                   bool topdown=true) const;
+    Rect get_bounding_rect() const;
+	int Numrects();
+
+    void debug_print(const char *prefix) const;
+
+  protected:
+    Region(struct _XRegion* rgn);
+    struct _XRegion* replaceXrgn(struct _XRegion* newrgn);
+
+    struct _XRegion*  Xrgn;
+  };
+
+  typedef Region Region2D;
+
+}
+
+#endif // __RFB_REGION_X11_INCLUDED__
diff --git a/ica/win32/winvnc/winvnc/rfbRegion_win32.cpp b/ica/win32/winvnc/winvnc/rfbRegion_win32.cpp
new file mode 100644
index 0000000..3a728de
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/rfbRegion_win32.cpp
@@ -0,0 +1,280 @@
+//  Copyright (C) 2002-2003 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+// Cross-platform Region class based on the X11 region implementation
+
+#include "stdhdrs.h"
+#include "rfbRegion_win32.h"
+
+using namespace rfb;
+
+void dump_rects(char *n, HRGN rgn, bool dbg = 0)
+{
+/*#if defined(_DEBUG)
+  //vnclog.Print(LL_INTWARN, VNCLOG("Region %s %p contains rects:\n"), n, rgn);
+	DWORD buffsize = GetRegionData(rgn, 0, NULL);
+	if (!buffsize)
+		return ;
+
+	unsigned char* buffer = new unsigned char[buffsize];
+
+	if (GetRegionData(rgn, buffsize, (LPRGNDATA)buffer) != buffsize)
+	{
+		delete [] buffer;
+		return ;
+	}
+
+	bool stop_needed(dbg && strcmp(n, "rgncache")==0);
+	LPRGNDATA region_data = (LPRGNDATA)buffer;
+	DWORD nRects = region_data->rdh.nCount;
+
+	if (nRects == 0)
+	{
+		delete [] buffer;
+		return ;
+	}
+
+	static bool enabled(false);
+	RECT *pRectangles = reinterpret_cast<RECT*>(&region_data->Buffer[0]);
+	for (DWORD i = 0; i < nRects; ++i)
+	{
+		//vnclog.Print(LL_INTWARN, VNCLOG("           (%u,%u - %u,%u)\n"), pRectangles[i].left, pRectangles[i].top,pRectangles[i].right, pRectangles[i].bottom);
+
+		if (stop_needed && enabled)
+		{
+			if (pRectangles[i].left == 0 &&pRectangles[i].top ==0 &&
+				pRectangles[i].right == 1280 && pRectangles[i].bottom == 1024)
+				DebugBreak();
+		}
+	}
+
+	delete [] buffer;
+#endif*/
+}
+
+
+Region::Region() : m_name(_strdup("")) {
+  rgn = CreateRectRgn(0,0,0,0);
+}
+
+Region::Region(int x1, int y1, int x2, int y2) : m_name(_strdup("")) {
+  rgn = CreateRectRgn(x1, y1, x2, y2);
+}
+
+Region::Region(const Rect& r) : m_name(_strdup("")) {
+  rgn = CreateRectRgn(r.tl.x, r.tl.y, r.br.x, r.br.y);
+}
+
+Region::Region(const Region& r) : m_name(_strdup("")) {
+  rgn = CreateRectRgn(0,0,0,0);
+  CombineRgn(rgn, r.rgn, r.rgn, RGN_COPY);
+#if defined(_DEBUG)
+  //vnclog.Print(LL_INTWARN, VNCLOG("Copy-construct Region %p from %s %p\n"), rgn, r.m_name, r.rgn);
+  dump_rects(m_name, rgn);
+#endif
+}
+
+Region::~Region() {
+#if defined(_DEBUG)
+  //vnclog.Print(LL_INTWARN, VNCLOG("Deleting Region %s %p\n"), m_name, rgn);
+#endif
+  DeleteObject(rgn);
+  free(m_name);
+}
+
+bool Region::IsPtInRegion(int x, int y)
+{
+	return PtInRegion(rgn,x,y);
+}
+
+rfb::Region& Region::operator=(const Region& r) {
+  clear();
+#if defined(_DEBUG)
+  //vnclog.Print(LL_INTWARN, VNCLOG("Assign Region %s %p from %s %p\n"), m_name, rgn, r.m_name, r.rgn);
+  dump_rects(m_name, rgn);
+#endif
+  CombineRgn(rgn, r.rgn, r.rgn, RGN_COPY);
+  return *this;
+}
+
+
+void Region::clear() {
+  SetRectRgn(rgn, 0, 0, 0, 0);
+}
+
+void Region::reset(const Rect& r) {
+  SetRectRgn(rgn, r.tl.x, r.tl.y, r.br.x, r.br.y);
+}
+
+void Region::translate(const Point& delta) {
+  OffsetRgn(rgn, delta.x, delta.y);
+}
+
+
+void Region::assign_intersect(const Region& r) {
+  CombineRgn(rgn, rgn, r.rgn, RGN_AND);
+#if defined(_DEBUG)
+  //vnclog.Print(LL_INTWARN, VNCLOG("assign_intersect this %s %p, other %s %p\n"), m_name, rgn, r.m_name, r.rgn);
+  dump_rects(m_name, rgn);
+#endif
+}
+
+void Region::assign_union(const Region& r) {
+  CombineRgn(rgn, rgn, r.rgn, RGN_OR);
+#if defined(_DEBUG)
+  //vnclog.Print(LL_INTWARN, VNCLOG("assign_union this %s %p, other %s %p\n"),  m_name, rgn, r.m_name, r.rgn);
+  dump_rects(m_name, rgn, 1);
+#endif
+}
+
+void Region::assign_subtract(const Region& r) {
+  CombineRgn(rgn, rgn, r.rgn, RGN_DIFF);
+#if defined(_DEBUG)
+  //vnclog.Print(LL_INTWARN, VNCLOG("assign_subtract %s %p, other %s %p\n"), m_name, rgn, r.m_name, r.rgn);
+  dump_rects(m_name, rgn);
+#endif
+}
+
+
+rfb::Region Region::intersect(const Region& r) const {
+  Region t = *this;
+  t.assign_intersect(r);
+  return t;
+}
+
+rfb::Region Region::union_(const Region& r) const {
+  Region t = *this;
+  t.assign_union(r);
+  return t;
+}
+
+rfb::Region Region::subtract(const Region& r) const {
+  Region t = *this;
+  t.assign_subtract(r);
+  return t;
+}
+
+
+bool Region::equals(const Region& b) const {
+  return EqualRgn(rgn, b.rgn) ? true : false;
+}
+
+bool Region::is_empty() const {
+  RECT rc;
+  return (GetRgnBox(rgn, &rc) == NULLREGION);
+}
+
+bool Region::get_rects(std::vector<Rect>& rects,
+					   bool left2right,
+					   bool topdown) const {
+#if defined(_DEBUG)
+   //vnclog.Print(LL_INTWARN, VNCLOG("get_rects %s %p\n"), m_name, rgn);
+#endif
+
+   DWORD buffsize = GetRegionData(rgn, 0, NULL);
+   if (!buffsize)
+	   return false;
+
+
+   unsigned char* buffer = new unsigned char[buffsize];
+   memset(buffer,0,buffsize);
+
+   if (GetRegionData(rgn, buffsize, (LPRGNDATA)buffer) != buffsize)
+   {
+	   delete [] buffer;
+	   return false;
+   }
+
+   LPRGNDATA region_data = (LPRGNDATA)buffer;
+   DWORD nRects = region_data->rdh.nCount;
+
+   if (nRects == 0)
+   {
+	   delete [] buffer;
+	   return false;
+   }
+
+   rects.clear();
+   rects.reserve(nRects);
+   RECT *pRectangles = reinterpret_cast<RECT*>(&region_data->Buffer[0]);
+
+   int xInc = left2right ? 1 : -1;
+   int yInc = topdown ? 1 : -1;
+   int i = topdown ? 0 : nRects-1;
+#if defined(_DEBUG)
+   //vnclog.Print(LL_INTWARN, VNCLOG("Region %s %p contains rects:\n"), m_name, rgn);
+#endif
+
+   while (nRects > 0) {
+	   int firstInNextBand = i;
+	   int nRectsInBand = 0;
+
+	   while (nRects > 0 && pRectangles[firstInNextBand].top == pRectangles[i].top) {
+		   firstInNextBand += yInc;
+		   nRects--;
+		   nRectsInBand++;
+	   }
+
+	   if (xInc != yInc)
+		   i = firstInNextBand - yInc;
+
+	   while (nRectsInBand > 0) {
+		   Rect r(pRectangles[i].left, pRectangles[i].top,
+			   pRectangles[i].right, pRectangles[i].bottom);
+
+#if defined(_DEBUG)
+		   //vnclog.Print(LL_INTWARN, VNCLOG("           (%u,%u - %u,%u) %ux%u\n"), r.tl.x, r.tl.y, r.br.x, r.br.y, r.width(), r.height());
+#endif
+		   rects.push_back(r);
+		   i += xInc;
+		   nRectsInBand--;
+	   }
+
+	   i = firstInNextBand;
+   }
+   delete [] buffer;
+
+   return !rects.empty();
+}
+
+rfb::Rect Region::get_bounding_rect() const {
+  RECT rc;
+  GetRgnBox(rgn, &rc);
+  return Rect(rc.left, rc.top, rc.right, rc.bottom);
+}
+
+int Region::Numrects()
+{
+	char *pRgnData;
+	DWORD dwCount(0);
+	int nRects(0);
+
+	dwCount = GetRegionData(rgn, 0, 0);
+	pRgnData = new char[dwCount];
+	if (pRgnData == 0) return 0;
+
+	if (GetRegionData(rgn, dwCount, reinterpret_cast<LPRGNDATA>(pRgnData)) == dwCount)
+		nRects = reinterpret_cast<LPRGNDATA>(pRgnData)->rdh.nCount;
+
+	delete [] pRgnData;
+	return nRects;
+}
+
diff --git a/ica/win32/winvnc/winvnc/rfbRegion_win32.h b/ica/win32/winvnc/winvnc/rfbRegion_win32.h
new file mode 100644
index 0000000..7903a16
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/rfbRegion_win32.h
@@ -0,0 +1,93 @@
+//   Copyright (C) 2002-2003 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+// rfb::Region2D class for Win32
+
+#ifndef __RFB_REGION_WIN32_INCLUDED__
+#define __RFB_REGION_WIN32_INCLUDED__
+
+#include "rfbRect.h"
+#include <vector>
+
+namespace rfb {
+
+	// rfb::Region2D
+	//
+	// See the rfbRegion.h header for documentation.
+
+  class Region {
+  public:
+    // Create an empty region
+    Region();
+    // Create a rectangular region
+    Region(int x1, int y1, int x2, int y2);
+    Region(const Rect& r);
+
+    Region(const Region& r);
+    Region &operator=(const Region& src);
+	bool IsPtInRegion(int x, int y);
+
+    ~Region();
+
+    // the following methods alter the region in place:
+
+    void clear();
+    void reset(const Rect& r);
+    void translate(const rfb::Point& delta);
+    void setOrderedRects(const std::vector<Rect>& rects);
+
+	void name(const char *n)
+	{
+		free(m_name);
+		m_name = _strdup(n);
+	}
+
+    void assign_intersect(const Region& r);
+    void assign_union(const Region& r);
+    void assign_subtract(const Region& r);
+
+    // the following three operations return a new region:
+
+    Region intersect(const Region& r) const;
+    Region union_(const Region& r) const;
+    Region subtract(const Region& r) const;
+
+    bool equals(const Region& b) const;
+    bool is_empty() const;
+
+    bool get_rects(std::vector<Rect>& rects, bool left2right=true,
+                   bool topdown=true) const;
+    Rect get_bounding_rect() const;
+	int Numrects();
+
+    void debug_print(const char *prefix) const;
+
+  protected:
+	  HRGN rgn;
+	  char *m_name;
+  };
+  typedef Region Region2D;
+
+};
+
+#endif /* __RFB_REGION_WIN32_INCLUDED__ */
+
+
diff --git a/ica/win32/winvnc/winvnc/rfbUpdateTracker.cpp b/ica/win32/winvnc/winvnc/rfbUpdateTracker.cpp
new file mode 100644
index 0000000..b5154b7
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/rfbUpdateTracker.cpp
@@ -0,0 +1,224 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+// -=- rfbUpdateTracker.cpp
+//
+// Tracks updated regions and a region-copy event, too
+//
+
+#include "stdhdrs.h"
+#include <assert.h>
+#include "rfbUpdateTracker.h"
+
+using namespace rfb;
+
+// ClippedUpdateTracker
+
+void ClippedUpdateTracker::add_changed(const Region2D &region) {
+	child.add_changed(region.intersect(cliprgn));
+}
+
+void ClippedUpdateTracker::add_cached(const Region2D &region) {
+	child.add_cached(region.intersect(cliprgn));
+}
+
+void ClippedUpdateTracker::add_copied(const Region2D &dest, const Point &delta) {
+	// Clip the destination to the display area
+	Region2D tmp = dest.intersect(cliprgn);
+	if (tmp.is_empty())	return;
+
+	// Clip the source to the screen
+	tmp.translate(delta.negate());
+	tmp = tmp.intersect(cliprgn);
+	if (!tmp.is_empty()) {
+		// Translate the source back to a destination region
+		tmp.translate(delta);
+
+		// Pass the copy region to the child tracker
+		child.add_copied(tmp, delta);
+	}
+
+	// And add any bits that we had to remove to the changed region
+	tmp = dest.subtract(tmp);
+	if (!tmp.is_empty()) {
+		child.add_changed(tmp);
+	}
+}
+
+// SimpleUpdateTracker
+
+SimpleUpdateTracker::SimpleUpdateTracker(bool use_copyrect) {
+	copy_enabled = use_copyrect;
+}
+
+SimpleUpdateTracker::~SimpleUpdateTracker() {
+}
+
+void SimpleUpdateTracker::add_changed(const Region2D &region) {
+	changed.assign_union(region);
+}
+
+void SimpleUpdateTracker::add_cached(const Region2D &region) {
+	cached.assign_union(region);
+}
+
+
+void SimpleUpdateTracker::add_copied(const Region2D &dest, const Point &delta) {
+	// Do we support copyrect?
+	if (!copy_enabled) {
+		add_changed(dest);
+		return;
+	}
+
+	// Is there anything to do?
+	if (dest.is_empty()) return;
+
+	// Calculate whether any of this copy can be treated as a continuation
+	// of an earlier one
+	Region2D src = dest;
+	src.translate(delta.negate());
+	Region2D overlap = src.intersect(copied);
+
+	if (overlap.is_empty()) {
+		// There is no overlap
+
+		Rect newbr = dest.get_bounding_rect();
+		Rect oldbr = copied.get_bounding_rect();
+		if (oldbr.area() > newbr.area() && !copied.is_empty()) {
+			// Old copyrect is (probably) bigger - use it
+			changed = changed.union_(dest);
+		} else {
+			// New copyrect is probably bigger
+			// RealVNC 336 change 
+			Region2D invalid = src.intersect(changed);
+			invalid.translate(delta);
+			changed.assign_union(invalid);
+			changed.assign_union(copied);
+//			changed = changed.union_(invalid).union_(copied);
+			copied = dest.subtract(invalid);
+			copy_delta = delta;
+			/*
+			// Use the new one
+			// But be careful not to copy stuff that still needs
+			// to be updated.
+			Region2D invalid_src = src.intersect(changed);
+			invalid_src.translate(delta);
+			changed = changed.union_(invalid_src).union_(copied);
+			copied = dest;
+			copy_delta = delta;
+			*/
+		}
+		return;
+	}
+
+	// RealVNC 336 change
+	Region2D valid = overlap.subtract(changed);
+	valid.translate(delta);
+	changed.assign_union(copied);
+	changed.assign_union(dest);
+	changed.assign_subtract(valid);
+//	changed = changed.union_(copied).union_(dest).subtract(valid);
+	copied = valid;
+	copy_delta = copy_delta.translate(delta);
+	
+	/*
+	Region2D invalid_src = overlap.intersect(changed);
+	invalid_src.translate(delta.negate());
+	changed = changed.union_(invalid_src);
+	
+	  overlap.translate(delta);
+	  
+		Region2D nonoverlapped_copied = dest.union_(copied).subtract(overlap);
+		changed = changed.union_(nonoverlapped_copied);
+		
+		  copied = overlap;
+		  copy_delta = copy_delta.translate(delta);
+	*/
+	
+	return;
+}
+
+void SimpleUpdateTracker::flush_update(UpdateInfo &info, const Region2D &cliprgn) {
+	copied.assign_subtract(changed);
+
+	// Ensure the UpdateInfo structure is empty
+	info.copied.clear();
+	info.changed.clear();
+	info.cached.clear();
+	
+
+	// Clip the changed region to the clip region
+	Region2D updatergn = changed.intersect(cliprgn);
+	changed.assign_subtract(updatergn);
+
+	// Clip the copyrect region to the display
+	Region2D copyrgn = copied.intersect(cliprgn);
+	copied.assign_subtract(copyrgn);
+
+	// Clip the cacherect region to the display
+	Region2D cachedrgn = cached.intersect(cliprgn);
+	cached.assign_subtract(cachedrgn);
+
+	// Save the update and copyrect rectangles info the UpdateInfo
+	updatergn.get_rects(info.changed, 1, 1);
+	cachedrgn.get_rects(info.cached, 1, 1);
+	copyrgn.get_rects(info.copied, copy_delta.x <= 0, copy_delta.y <= 0);
+	info.copy_delta = copy_delta;
+}
+void SimpleUpdateTracker::flush_update(UpdateTracker &info, const Region2D &cliprgn) {
+	Region2D copied_clipped = copied.intersect(cliprgn);
+	Region2D changed_clipped = changed.intersect(cliprgn);
+	Region2D cached_clipped = cached.intersect(cliprgn);
+	copied.assign_subtract(copied_clipped);
+	changed.assign_subtract(changed_clipped);
+	cached.assign_subtract(cached_clipped);
+	if (!copied_clipped.is_empty()) {
+		info.add_copied(copied_clipped, copy_delta);
+	}
+	if (!changed_clipped.is_empty())
+		info.add_changed(changed_clipped);
+	if (!cached_clipped.is_empty())
+		info.add_cached(cached_clipped);
+}
+
+void SimpleUpdateTracker::get_update(UpdateInfo &info) const {
+	info.copied.clear();
+	info.changed.clear();
+	info.cached.clear();
+	info.copy_delta = copy_delta;
+	Region2D copied_dest = copied.subtract(changed);
+	copied_dest.get_rects(info.copied, copy_delta.x <= 0, copy_delta.y <= 0);
+	changed.get_rects(info.changed, 1, 1);
+	cached.get_rects(info.cached, 1, 1);
+}
+void SimpleUpdateTracker::get_update(UpdateTracker &to) const {
+	if (!copied.is_empty()) {
+		to.add_copied(copied, copy_delta);
+	}
+	if (!changed.is_empty()) {
+		to.add_changed(changed);
+	}
+	if (!cached.is_empty()) {
+		to.add_cached(cached);
+	}
+}
+
diff --git a/ica/win32/winvnc/winvnc/rfbUpdateTracker.h b/ica/win32/winvnc/winvnc/rfbUpdateTracker.h
new file mode 100644
index 0000000..b1f73f7
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/rfbUpdateTracker.h
@@ -0,0 +1,112 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+#ifndef __RFB_UPDATETRACKER_INCLUDED__
+#define __RFB_UPDATETRACKER_INCLUDED__
+
+#include "rfbRect.h"
+#include "rfbRegion.h"
+
+namespace rfb {
+
+	struct UpdateInfo {
+		RectVector cached;
+		RectVector copied;
+		Point copy_delta;
+		RectVector changed;
+	};
+
+	class UpdateTracker {
+	public:
+		UpdateTracker() {};
+		virtual ~UpdateTracker() {};
+
+		virtual void add_changed(const Region2D &region) = 0;
+		virtual void add_cached(const Region2D &region) = 0;
+		virtual void add_copied(const Region2D &dest, const Point &delta) = 0;
+
+		
+	};
+
+	class ClippedUpdateTracker : public UpdateTracker {
+	public:
+		ClippedUpdateTracker(UpdateTracker &child_) : child(child_) {};
+		ClippedUpdateTracker(UpdateTracker &child_,
+			const Region2D &cliprgn_) : child(child_), cliprgn(cliprgn_) {};
+		virtual ~ClippedUpdateTracker() {};
+
+		virtual void set_clip_region(const Region2D cliprgn_) {cliprgn = cliprgn_;};
+
+		virtual void add_changed(const Region2D &region);
+		virtual void add_cached(const Region2D &region);
+		virtual void add_copied(const Region2D &dest, const Point &delta);
+
+	protected:
+		UpdateTracker &child;
+		Region2D cliprgn;
+	};
+
+	class SimpleUpdateTracker : public UpdateTracker {
+	public:
+		SimpleUpdateTracker(bool use_copyrect=false);
+		virtual ~SimpleUpdateTracker();
+
+		virtual void enable_copyrect(bool enable) {copy_enabled=enable;};
+
+		virtual void add_changed(const Region2D &region);
+		virtual void add_cached(const Region2D &region);
+		virtual void add_copied(const Region2D &dest, const Point &delta);
+
+		// Fill the supplied UpdateInfo structure with update information
+		// Also removes the updates that are returned from the update tracker
+		virtual void flush_update(UpdateInfo &info, const Region2D &cliprgn);
+		virtual void flush_update(UpdateTracker &info, const Region2D &cliprgn);
+
+		// Pass the current updates to the supplied tracker
+		// Does not affect internal state of this tracker
+		virtual void get_update(UpdateInfo &to) const;
+		virtual void get_update(UpdateTracker &to) const;
+
+		// Get the changed/copied regions
+		virtual const Region2D& get_changed_region() const {return changed;};
+		virtual const Region2D& get_cached_region() const {return cached;};
+		virtual const Region2D& get_copied_region() const {return copied;};
+
+
+		virtual bool is_empty() const {return changed.is_empty() && copied.is_empty() && cached.is_empty();};
+
+		virtual void clear() {
+			changed.clear();
+			copied.clear();
+			cached.clear();
+		};
+	protected:
+		Region2D changed;
+		Region2D cached;
+		Region2D copied;
+		Point copy_delta;
+		bool copy_enabled;
+	};
+
+};
+
+#endif /* __RFB_UPDATETRACKER_INCLUDED__ */
diff --git a/ica/win32/winvnc/winvnc/security.cpp b/ica/win32/winvnc/winvnc/security.cpp
new file mode 100644
index 0000000..05884b9
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/security.cpp
@@ -0,0 +1,158 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "stdhdrs.h"
+#include "lmcons.h"
+#include "vncservice.h"
+#include "vncOSVersion.h"
+#include "common/ScopeGuard.h"
+
+
+typedef BOOL (WINAPI *pWTSQueryUserToken_proto)(ULONG, PHANDLE);
+
+DWORD GetCurrentUserToken(HANDLE& process, HANDLE &Token)
+{
+	if(OSversion()==4 || OSversion()==5) return 1;
+	if (!vncService::RunningAsService())
+	{
+		if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &Token))
+			return 0;
+		return 2;
+	}
+	{
+	  HWND tray = FindWindow(("Shell_TrayWnd"), 0);
+      if (!tray)
+        return 0;
+	  DWORD processId = 0;
+      GetWindowThreadProcessId(tray, &processId);
+      if (!processId)
+        return 0;
+	  process = OpenProcess(MAXIMUM_ALLOWED, FALSE, processId);
+      if (!process)
+        return 0;
+	  OpenProcessToken(process, MAXIMUM_ALLOWED, &Token);
+	  // Remeber the closhandle
+	  //
+	}
+	return 2;
+}
+
+bool ImpersonateCurrentUser() {
+  SetLastError(0);
+  HANDLE process=0;
+  HANDLE Token=NULL;
+
+  GetCurrentUserToken(process, Token);
+
+  // Auto close process and token when leaving scope
+  ON_BLOCK_EXIT(CloseHandle, process);
+  ON_BLOCK_EXIT(CloseHandle, Token);
+
+  bool test=(FALSE != ImpersonateLoggedOnUser(Token));
+
+  return test;
+}
+
+bool
+RevertCurrentUser() {
+  return (FALSE != RevertToSelf());
+}
+
+bool RunningAsAdministrator ()
+{
+ BOOL   fAdmin;
+ TOKEN_GROUPS *ptg = NULL;
+ DWORD  cbTokenGroups;
+ DWORD  dwGroup;
+ PSID   psidAdmin;
+ SetLastError(0);
+ HANDLE process=0;
+ HANDLE Token=NULL;
+
+ if (GetCurrentUserToken(process, Token)==1) return true;
+
+ ON_BLOCK_EXIT(CloseHandle, process);
+ ON_BLOCK_EXIT(CloseHandle, Token);
+
+ SID_IDENTIFIER_AUTHORITY SystemSidAuthority= SECURITY_NT_AUTHORITY;
+
+ // Then we must query the size of the group information associated with
+ // the token. Note that we expect a FALSE result from GetTokenInformation
+ // because we've given it a NULL buffer. On exit cbTokenGroups will tell
+ // the size of the group information.
+
+ if ( GetTokenInformation ( Token, TokenGroups, NULL, 0, &cbTokenGroups))
+  return ( FALSE);
+
+ // Here we verify that GetTokenInformation failed for lack of a large
+ // enough buffer.
+ DWORD aa=GetLastError();
+ if ( aa != ERROR_INSUFFICIENT_BUFFER)
+  return ( FALSE);
+
+ // Now we allocate a buffer for the group information.
+ // Since _alloca allocates on the stack, we don't have
+ // to explicitly deallocate it. That happens automatically
+ // when we exit this function.
+
+ if ( ! ( ptg= (_TOKEN_GROUPS *) _malloca ( cbTokenGroups))) 
+  return ( FALSE);
+
+ // Now we ask for the group information again.
+ // This may fail if an administrator has added this account
+ // to an additional group between our first call to
+ // GetTokenInformation and this one.
+
+ if ( !GetTokenInformation ( Token, TokenGroups, ptg, cbTokenGroups,
+          &cbTokenGroups) )
+  return ( FALSE);
+
+ // Now we must create a System Identifier for the Admin group.
+
+ if ( ! AllocateAndInitializeSid ( &SystemSidAuthority, 2, 
+            SECURITY_BUILTIN_DOMAIN_RID, 
+            DOMAIN_ALIAS_RID_ADMINS,
+            0, 0, 0, 0, 0, 0, &psidAdmin) )
+  return ( FALSE);
+
+ // Finally we'll iterate through the list of groups for this access
+ // token looking for a match against the SID we created above.
+
+ fAdmin= FALSE;
+
+ for ( dwGroup= 0; dwGroup < ptg->GroupCount; dwGroup++)
+ {
+  if ( EqualSid ( ptg->Groups[dwGroup].Sid, psidAdmin))
+  {
+   fAdmin = TRUE;
+
+   break;
+  }
+ }
+
+ // Before we exit we must explicity deallocate the SID we created.
+
+ FreeSid ( psidAdmin);
+ return (FALSE != fAdmin);
+}
diff --git a/ica/win32/winvnc/winvnc/service.cpp b/ica/win32/winvnc/winvnc/service.cpp
new file mode 100644
index 0000000..137c872
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/service.cpp
@@ -0,0 +1,1065 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncService
+
+// Implementation of service-oriented functionality of WinVNC
+#include <windows.h>
+#include <userenv.h>
+#include <wtsapi32.h>
+#include <stdio.h>
+#include <tlhelp32.h>
+#include "inifile.h"
+#include "common/win32_helpers.h"
+
+HANDLE hEvent=NULL;
+HANDLE hEventcad=NULL;
+extern HANDLE stopServiceEvent;
+static char app_path[MAX_PATH];
+typedef DWORD (*WTSGETACTIVECONSOLESESSIONID)();
+typedef bool (*WTSQUERYUSERTOKEN)(ULONG,PHANDLE);
+helper::DynamicFn<WTSGETACTIVECONSOLESESSIONID> lpfnWTSGetActiveConsoleSessionId("kernel32", "WTSGetActiveConsoleSessionId");
+helper::DynamicFn<WTSQUERYUSERTOKEN> lpfnWTSQueryUserToken("Wtsapi32.dll", "WTSQueryUserToken");
+PROCESS_INFORMATION  ProcessInfo;
+int counter=0;
+extern char cmdtext[256];
+int kickrdp=0;
+int clear_console=0;
+bool W2K=0;
+//////////////////////////////////////////////////////////////////////////////
+#define MAXSTRLENGTH    255
+BOOL Char2Wchar(WCHAR* pDest, char* pSrc, int nDestStrLen)
+{
+     int nSrcStrLen = 0;
+     int nOutputBuffLen = 0;
+     int retcode = 0;
+
+     if(pDest == NULL || pSrc == NULL)
+     {
+          return FALSE;
+     }
+
+     nSrcStrLen = strlen(pSrc);
+     if(nSrcStrLen == 0)
+     {  
+          return FALSE;
+     }
+
+     nDestStrLen = nSrcStrLen;
+
+     if (nDestStrLen > MAXSTRLENGTH - 1)
+     {
+          return FALSE;
+     }
+     memset(pDest,0,sizeof(TCHAR)*nDestStrLen);
+     nOutputBuffLen = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, pSrc,nSrcStrLen, pDest, nDestStrLen);
+ 
+     if (nOutputBuffLen == 0)
+     {
+          retcode = GetLastError();
+          return FALSE;
+     }
+
+     pDest[nOutputBuffLen] = '\0';
+     return TRUE;
+}
+//////////////////////////////////////////////////////////////////////////////
+typedef BOOLEAN (WINAPI* pWinStationQueryInformationW)(
+  IN   HANDLE hServer,
+  IN   ULONG LogonId,
+  IN   DWORD /*WINSTATIONINFOCLASS*/ WinStationInformationClass,
+  OUT  PVOID pWinStationInformation,
+  IN   ULONG WinStationInformationLength,
+  OUT  PULONG pReturnLength
+);
+DWORD MarshallString(LPCWSTR    pszText, LPVOID, DWORD  dwMaxSize,LPBYTE*
+ppNextBuf, DWORD* pdwUsedBytes)
+{
+        DWORD   dwOffset = *pdwUsedBytes;
+        if(!pszText)
+                return 0;
+        DWORD   dwLen = (wcslen(pszText)+1)*sizeof(WCHAR);
+        if(*pdwUsedBytes + dwLen> dwMaxSize)
+                return 0;
+        memmove(*ppNextBuf, pszText , dwLen);
+        *pdwUsedBytes += dwLen;
+        *ppNextBuf += dwLen;
+        return dwOffset;
+
+}
+
+typedef struct _CPAU_PARAM{
+        DWORD   cbSize;
+        DWORD   dwProcessId;
+        BOOL    bUseDefaultToken;
+        HANDLE  hToken;
+        LPWSTR  lpApplicationName;
+        LPWSTR  lpCommandLine;
+        SECURITY_ATTRIBUTES     ProcessAttributes;
+        SECURITY_ATTRIBUTES ThreadAttributes;
+        BOOL bInheritHandles;
+        DWORD dwCreationFlags;
+        LPVOID lpEnvironment;
+        LPWSTR lpCurrentDirectory;
+        STARTUPINFOW StartupInfo;
+        PROCESS_INFORMATION     ProcessInformation;
+
+}CPAU_PARAM;
+
+typedef struct _CPAU_RET_PARAM{
+        DWORD   cbSize;
+        BOOL    bRetValue;
+        DWORD   dwLastErr;
+        PROCESS_INFORMATION     ProcInfo;
+
+}CPAU_RET_PARAM;
+
+BOOL CreateRemoteSessionProcess(
+        IN DWORD        dwSessionId,
+        IN BOOL         bUseDefaultToken,
+        IN HANDLE       hToken,
+        IN LPCWSTR      lpApplicationName,
+        IN LPSTR       A_lpCommandLine,
+        IN LPSECURITY_ATTRIBUTES lpProcessAttributes,
+        IN LPSECURITY_ATTRIBUTES lpThreadAttributes,
+        IN BOOL bInheritHandles,
+        IN DWORD dwCreationFlags,
+        IN LPVOID lpEnvironment,
+        IN LPCWSTR lpCurrentDirectory,
+        IN LPSTARTUPINFO A_lpStartupInfo,
+        OUT LPPROCESS_INFORMATION lpProcessInformation)
+{
+
+		WCHAR       lpCommandLine[255];
+		STARTUPINFOW StartupInfo;
+		Char2Wchar(lpCommandLine, A_lpCommandLine, 255);
+		ZeroMemory(&StartupInfo,sizeof(STARTUPINFOW));
+		StartupInfo.wShowWindow = SW_SHOW;
+		StartupInfo.lpDesktop = L"Winsta0\\Winlogon";
+		StartupInfo.cb = sizeof(STARTUPINFOW);
+
+        WCHAR           szWinStaPath[MAX_PATH];
+        BOOL            bGetNPName=FALSE;
+        WCHAR           szNamedPipeName[MAX_PATH]=L"";
+        DWORD           dwNameLen;
+        HINSTANCE       hInstWinSta;
+        HANDLE          hNamedPipe;
+        BOOL            bRet = FALSE;
+        DWORD           cbReadBytes,cbWriteBytes;
+        DWORD           dwEnvLen = 0;
+        union{
+                CPAU_PARAM      cpauData;
+                BYTE            bDump[0x2000];
+        };
+        CPAU_RET_PARAM  cpauRetData;
+        DWORD                   dwUsedBytes = sizeof(cpauData);
+        LPBYTE                  pBuffer = (LPBYTE)(&cpauData+1);
+        GetSystemDirectoryW(szWinStaPath, MAX_PATH);
+        lstrcatW(szWinStaPath,L"\\winsta.dll");
+        hInstWinSta = LoadLibraryW(szWinStaPath);
+
+        if(hInstWinSta)
+        {
+                pWinStationQueryInformationW pfWinStationQueryInformationW=(pWinStationQueryInformationW)GetProcAddress(hInstWinSta,"WinStationQueryInformationW");
+                if(pfWinStationQueryInformationW)
+                {
+                        bGetNPName = pfWinStationQueryInformationW(0, dwSessionId, 0x21,szNamedPipeName, sizeof(szNamedPipeName), &dwNameLen);
+                }
+                FreeLibrary(hInstWinSta);
+        }
+        if(!bGetNPName || szNamedPipeName[0] == '\0')
+        {
+                swprintf(szNamedPipeName,L"\\\\.\\Pipe\\TerminalServer\\SystemExecSrvr\\%d", dwSessionId);
+        }
+
+        do{
+                hNamedPipe = CreateFileW(szNamedPipeName, GENERIC_READ|GENERIC_WRITE,0, NULL, OPEN_EXISTING, 0, 0);
+                if(hNamedPipe == INVALID_HANDLE_VALUE)
+                {
+                        if(GetLastError() == ERROR_PIPE_BUSY)
+                        {
+                                if(!WaitNamedPipeW(szNamedPipeName, 30000))
+                                        return FALSE;
+                        }
+                        else
+                        {
+                                return FALSE;
+                        }
+                }
+        }while(hNamedPipe == INVALID_HANDLE_VALUE);
+
+        memset(&cpauData, 0, sizeof(cpauData));
+        cpauData.bInheritHandles        = bInheritHandles;
+        cpauData.bUseDefaultToken       = bUseDefaultToken;
+        cpauData.dwCreationFlags        = dwCreationFlags;
+        cpauData.dwProcessId            = GetCurrentProcessId();
+        cpauData.hToken                         = hToken;
+        cpauData.lpApplicationName      =(LPWSTR)MarshallString(lpApplicationName, &cpauData, sizeof(bDump),&pBuffer, &dwUsedBytes);
+        cpauData.lpCommandLine          = (LPWSTR)MarshallString(lpCommandLine,&cpauData, sizeof(bDump), &pBuffer, &dwUsedBytes);
+        cpauData.StartupInfo            = StartupInfo;
+        cpauData.StartupInfo.lpDesktop  =(LPWSTR)MarshallString(cpauData.StartupInfo.lpDesktop, &cpauData,sizeof(bDump), &pBuffer, &dwUsedBytes);
+        cpauData.StartupInfo.lpTitle    =(LPWSTR)MarshallString(cpauData.StartupInfo.lpTitle, &cpauData,sizeof(bDump), &pBuffer, &dwUsedBytes);
+
+        if(lpEnvironment)
+        {
+                if(dwCreationFlags & CREATE_UNICODE_ENVIRONMENT)
+                {
+                        while((dwEnvLen+dwUsedBytes <= sizeof(bDump)))
+                        {
+                                if(((LPWSTR)lpEnvironment)[dwEnvLen/2]=='\0' &&((LPWSTR)lpEnvironment)[dwEnvLen/2+1] == '\0')
+                                {
+                                        dwEnvLen+=2*sizeof(WCHAR);
+                                        break;
+                                }
+                                dwEnvLen+=sizeof(WCHAR);
+                        }
+                }
+                else
+                {
+                        while(dwEnvLen+dwUsedBytes <= sizeof(bDump))
+                        {
+                                if(((LPSTR)lpEnvironment)[dwEnvLen]=='\0' && ((LPSTR)lpEnvironment)[dwEnvLen+1]=='\0')
+                                {
+                                        dwEnvLen+=2;
+                                        break;
+                                }
+                                dwEnvLen++;
+                        }
+                }
+                if(dwEnvLen+dwUsedBytes <= sizeof(bDump))
+                {
+                        memmove(pBuffer, lpEnvironment, dwEnvLen);
+                        cpauData.lpEnvironment = (LPVOID)dwUsedBytes;
+                        pBuffer += dwEnvLen;
+                        dwUsedBytes += dwEnvLen;
+                }
+                else
+                {
+                        cpauData.lpEnvironment = NULL;
+                }
+        }
+        else
+        {
+                cpauData.lpEnvironment  = NULL;
+        }
+        cpauData.cbSize  = dwUsedBytes;
+
+		HANDLE hProcess=NULL;
+        if(WriteFile(hNamedPipe, &cpauData, cpauData.cbSize, &cbWriteBytes,NULL))
+		{
+			Sleep(250);
+			if (ReadFile(hNamedPipe, & cpauRetData, sizeof(cpauRetData),&cbReadBytes, NULL))
+			{
+				hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, cpauRetData.ProcInfo.dwProcessId);
+	#ifdef _DEBUG
+						char			szText[256];
+						sprintf(szText," ++++++cpau  %i  %i %i %i %i %i\n",cpauRetData.bRetValue,cpauRetData.ProcInfo.hProcess,cpauRetData.ProcInfo.dwProcessId,cpauRetData.ProcInfo.dwThreadId,cpauRetData.ProcInfo.hThread,hProcess);
+						OutputDebugString(szText);						
+	#endif
+					bRet = cpauRetData.bRetValue;
+					if(bRet)
+					{
+							*lpProcessInformation = cpauRetData.ProcInfo;
+					}
+					else
+							SetLastError(cpauRetData.dwLastErr);
+			}
+		}
+        else
+                bRet = FALSE;
+		// function sometimes fail, the use processid to get hprocess... bug MS
+		if (lpProcessInformation->hProcess==0) lpProcessInformation->hProcess=hProcess;
+		//this should never happen, looping connections
+		if (lpProcessInformation->hProcess==0) 
+			Sleep(5000);
+        CloseHandle(hNamedPipe);
+        return bRet;
+
+}
+//////////////////////////////////////////////////////////////////////////////
+
+static int pad2()
+{
+
+	OSVERSIONINFO OSversion;
+	
+	OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+
+	GetVersionEx(&OSversion);
+	W2K=0;
+	switch(OSversion.dwPlatformId)
+	{
+		case VER_PLATFORM_WIN32_NT:
+						  if(OSversion.dwMajorVersion==5 && OSversion.dwMinorVersion==0)
+									 W2K=1;							    
+								  
+	}
+	char exe_file_name[MAX_PATH];
+	char cmdline[MAX_PATH];
+    GetModuleFileName(0, exe_file_name, MAX_PATH);
+
+    strcpy(app_path, exe_file_name);
+	strcat(app_path, " ");
+	strcat(app_path,cmdtext);
+    strcat(app_path, "_run");
+	IniFile myIniFile;
+	kickrdp=myIniFile.ReadInt("admin", "kickrdp", kickrdp);
+	clear_console=myIniFile.ReadInt("admin", "clearconsole", clear_console);
+	myIniFile.ReadString("admin", "service_commandline",cmdline,256);
+	if (strlen(cmdline)!=0)
+	{
+		strcpy(app_path, exe_file_name);
+		strcat(app_path, " ");
+		strcat(app_path,cmdline);
+		strcat(app_path, " -service_run");
+	}
+	return 0;
+}
+//////////////////////////////////////////////////////////////////////////////
+
+BOOL SetTBCPrivileges(VOID) {
+  DWORD dwPID;
+  HANDLE hProcess;
+  HANDLE hToken;
+  LUID Luid;
+  TOKEN_PRIVILEGES tpDebug;
+  dwPID = GetCurrentProcessId();
+  if ((hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID)) == NULL) return FALSE;
+  if (OpenProcessToken(hProcess, TOKEN_ALL_ACCESS, &hToken) == 0) return FALSE;
+  if ((LookupPrivilegeValue(NULL, SE_TCB_NAME, &Luid)) == 0) return FALSE;
+  tpDebug.PrivilegeCount = 1;
+  tpDebug.Privileges[0].Luid = Luid;
+  tpDebug.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+  if ((AdjustTokenPrivileges(hToken, FALSE, &tpDebug, sizeof(tpDebug), NULL, NULL)) == 0) return FALSE;
+  if (GetLastError() != ERROR_SUCCESS) return FALSE;
+  CloseHandle(hToken);
+  CloseHandle(hProcess);
+  return TRUE;
+}
+//////////////////////////////////////////////////////////////////////////////
+#include <tlhelp32.h>
+
+DWORD GetwinlogonPid()
+{
+	//DWORD dwSessionId;
+	DWORD dwExplorerLogonPid=0;
+	PROCESSENTRY32 procEntry;
+
+	//dwSessionId=0;
+
+	
+
+    HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+    if (hSnap == INVALID_HANDLE_VALUE)
+    {
+        return 0 ;
+    }
+
+    procEntry.dwSize = sizeof(PROCESSENTRY32);
+
+    if (!Process32First(hSnap, &procEntry))
+    {
+		CloseHandle(hSnap);
+        return 0 ;
+    }
+
+    do
+    {
+        if (_stricmp(procEntry.szExeFile, "winlogon.exe") == 0)
+        {
+			dwExplorerLogonPid = procEntry.th32ProcessID;
+        }
+
+    } while (Process32Next(hSnap, &procEntry));
+	CloseHandle(hSnap);
+	return dwExplorerLogonPid;
+}
+//////////////////////////////////////////////////////////////////////////////
+DWORD
+Find_winlogon(DWORD SessionId)
+{
+
+  PWTS_PROCESS_INFO pProcessInfo = NULL;
+  DWORD         ProcessCount = 0;
+//  char         szUserName[255];
+  DWORD         Id = -1;
+
+  typedef BOOL (WINAPI *pfnWTSEnumerateProcesses)(HANDLE,DWORD,DWORD,PWTS_PROCESS_INFO*,DWORD*);
+  typedef VOID (WINAPI *pfnWTSFreeMemory)(PVOID);
+
+  helper::DynamicFn<pfnWTSEnumerateProcesses> pWTSEnumerateProcesses("wtsapi32","WTSEnumerateProcessesA");
+  helper::DynamicFn<pfnWTSFreeMemory> pWTSFreeMemory("wtsapi32", "WTSFreeMemory");
+
+  if (pWTSEnumerateProcesses.isValid() && pWTSFreeMemory.isValid())
+  {
+    if ((*pWTSEnumerateProcesses)(WTS_CURRENT_SERVER_HANDLE, 0, 1, &pProcessInfo, &ProcessCount))
+  {
+    // dump each process description
+    for (DWORD CurrentProcess = 0; CurrentProcess < ProcessCount; CurrentProcess++)
+    {
+
+        if( _stricmp(pProcessInfo[CurrentProcess].pProcessName, "winlogon.exe") == 0 )
+        {    
+			if (SessionId==pProcessInfo[CurrentProcess].SessionId)
+			{
+            Id = pProcessInfo[CurrentProcess].ProcessId;
+            break;
+			}
+        }
+    }
+
+    (*pWTSFreeMemory)(pProcessInfo);
+    }
+  }
+
+  return Id;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+BOOL
+get_winlogon_handle(OUT LPHANDLE  lphUserToken)
+{
+	BOOL   bResult = FALSE;
+	HANDLE hProcess;
+	HANDLE hTokenThis = NULL;
+	DWORD ID_session=0;
+	if (lpfnWTSGetActiveConsoleSessionId.isValid()) ID_session=(*lpfnWTSGetActiveConsoleSessionId)();
+	DWORD Id=0;
+	if (W2K==0) Id=Find_winlogon(ID_session);
+	else Id=GetwinlogonPid();
+
+    // fall back to old method if Terminal services is disabled
+    if (W2K == 0 && Id == (DWORD)-1)
+        Id=GetwinlogonPid();
+
+	#ifdef _DEBUG
+					char			szText[256];
+					DWORD error=GetLastError();
+					sprintf(szText," ++++++ Find_winlogon %i %i %d\n",ID_session,Id,error);
+					SetLastError(0);
+					OutputDebugString(szText);		
+	#endif
+
+
+	hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, Id );
+	if (hProcess)
+	{
+		#ifdef _DEBUG
+					char			szText[256];
+					DWORD error=GetLastError();
+					sprintf(szText," ++++++ OpenProcess %i \n",hProcess);
+					SetLastError(0);
+					OutputDebugString(szText);		
+		#endif
+
+		OpenProcessToken(hProcess, TOKEN_ASSIGN_PRIMARY|TOKEN_ALL_ACCESS, &hTokenThis);
+
+		#ifdef _DEBUG
+					error=GetLastError();
+					sprintf(szText," ++++++ OpenProcessToken %i %i\n",hTokenThis,error);
+					SetLastError(0);
+					OutputDebugString(szText);		
+		#endif
+		{
+		bResult = DuplicateTokenEx(hTokenThis, TOKEN_ASSIGN_PRIMARY|TOKEN_ALL_ACCESS,NULL, SecurityImpersonation, TokenPrimary, lphUserToken);
+		#ifdef _DEBUG
+					error=GetLastError();
+					sprintf(szText," ++++++ DuplicateTokenEx %i %i %i %i\n",hTokenThis,&lphUserToken,error,bResult);
+					SetLastError(0);
+					OutputDebugString(szText);		
+		#endif
+		SetTokenInformation(*lphUserToken, TokenSessionId, &ID_session, sizeof(DWORD));
+		#ifdef _DEBUG
+					error=GetLastError();
+					sprintf(szText," ++++++ SetTokenInformation( %i %i %i\n",hTokenThis,&lphUserToken,error);
+					SetLastError(0);
+					OutputDebugString(szText);		
+		#endif
+		CloseHandle(hTokenThis);
+		}
+		CloseHandle(hProcess);
+	}
+	return bResult;
+}
+//////////////////////////////////////////////////////////////////////////////
+
+BOOL
+GetSessionUserTokenWin(OUT LPHANDLE  lphUserToken)
+{
+  BOOL   bResult = FALSE;
+  DWORD ID=0;
+  if (lpfnWTSGetActiveConsoleSessionId.isValid()) ID=(*lpfnWTSGetActiveConsoleSessionId)();
+  
+  if (lphUserToken != NULL) {   
+		  bResult = get_winlogon_handle(lphUserToken);
+  }
+  return bResult;
+}
+//////////////////////////////////////////////////////////////////////////////
+BOOL
+GetSessionUserTokenDefault(OUT LPHANDLE  lphUserToken)
+{
+  BOOL   bResult = FALSE;
+  HANDLE hImpersonationToken = INVALID_HANDLE_VALUE;
+  DWORD ID=0;
+  if (lpfnWTSGetActiveConsoleSessionId.isValid()) ID=(*lpfnWTSGetActiveConsoleSessionId)();
+
+  if (lphUserToken != NULL) {   
+      if ((*lpfnWTSQueryUserToken)(ID, &hImpersonationToken)) 
+      {
+        bResult = DuplicateTokenEx(hImpersonationToken,
+                                   0,
+                                   NULL,
+                                   SecurityImpersonation,
+                                   TokenPrimary,
+                                   lphUserToken);
+        CloseHandle(hImpersonationToken);
+      }     
+  }
+  return bResult;
+
+}
+//////////////////////////////////////////////////////////////////////////////
+// START the app as system 
+BOOL
+LaunchProcessWin(DWORD dwSessionId)
+{
+  BOOL                 bReturn = FALSE;
+  HANDLE               hToken;
+  STARTUPINFO          StartUPInfo;
+  PVOID                lpEnvironment = NULL;
+
+  ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+  ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+  StartUPInfo.wShowWindow = SW_SHOW;
+  StartUPInfo.lpDesktop = "Winsta0\\Winlogon";
+  //StartUPInfo.lpDesktop = "Winsta0\\Default";
+  StartUPInfo.cb = sizeof(STARTUPINFO);
+  SetTBCPrivileges();
+  pad2();
+
+  if ( GetSessionUserTokenWin(&hToken) )
+  {
+      if ( CreateEnvironmentBlock(&lpEnvironment, hToken, FALSE) ) 
+      {
+      
+		 SetLastError(0);
+         if (CreateProcessAsUser(hToken,NULL,app_path,NULL,NULL,FALSE,CREATE_UNICODE_ENVIRONMENT |DETACHED_PROCESS,lpEnvironment,NULL,&StartUPInfo,&ProcessInfo))
+			{
+				counter=0;
+				bReturn = TRUE;
+				#ifdef _DEBUG
+					DWORD error=GetLastError();
+					char			szText[256];
+					sprintf(szText," ++++++ CreateProcessAsUser winlogon %d\n",error);
+					OutputDebugString(szText);		
+				#endif
+			}
+		 else
+		 {
+			 DWORD error=GetLastError();
+			 #ifdef _DEBUG
+					char			szText[256];
+					sprintf(szText," ++++++ CreateProcessAsUser failed %d %d %d\n",error,kickrdp,counter);
+					OutputDebugString(szText);		
+			#endif
+			if (error==233 && kickrdp==1)
+					{
+						counter++;
+						if (counter>3)
+							{
+								#ifdef _DEBUG
+								DWORD error=GetLastError();
+								sprintf(szText," ++++++ error==233 win\n");
+								SetLastError(0);
+								OutputDebugString(szText);		
+								#endif
+								typedef BOOLEAN (WINAPI * pWinStationConnect) (HANDLE,ULONG,ULONG,PCWSTR,ULONG);
+								typedef BOOL (WINAPI * pLockWorkStation)();
+								HMODULE  hlibwinsta = LoadLibrary("winsta.dll"); 
+								HMODULE  hlibuser32 = LoadLibrary("user32.dll");
+								pWinStationConnect WinStationConnectF=NULL;
+								pLockWorkStation LockWorkStationF=NULL;
+
+								if (hlibwinsta)
+								   {
+									   WinStationConnectF=(pWinStationConnect)GetProcAddress(hlibwinsta, "WinStationConnectW"); 
+								   }
+								if (hlibuser32)
+								   {
+									   LockWorkStationF=(pLockWorkStation)GetProcAddress(hlibuser32, "LockWorkStation"); 
+								   }
+								if (WinStationConnectF!=NULL && WinStationConnectF!=NULL)
+									{
+											DWORD ID=0;
+											if (lpfnWTSGetActiveConsoleSessionId.isValid()) ID=(*lpfnWTSGetActiveConsoleSessionId)();
+											WinStationConnectF(0, 0, ID, L"", 0);
+											LockWorkStationF();
+									}
+								Sleep(3000);
+						}
+					}
+			else if (error==233)
+			{
+				CreateRemoteSessionProcess(dwSessionId,true,hToken,NULL,app_path,NULL,NULL,FALSE,CREATE_UNICODE_ENVIRONMENT |DETACHED_PROCESS,lpEnvironment,NULL,&StartUPInfo,&ProcessInfo);
+				counter=0;
+				bReturn = TRUE;
+			}
+		 }
+
+         if (lpEnvironment) 
+         {
+            DestroyEnvironmentBlock(lpEnvironment);
+         }
+
+	  }//createenv
+	  else
+	  {
+		  SetLastError(0);
+         if (CreateProcessAsUser(hToken,NULL,app_path,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo))
+			{
+				counter=0;
+				bReturn = TRUE;
+				#ifdef _DEBUG
+					DWORD error=GetLastError();
+					char			szText[256];
+					sprintf(szText," ++++++ CreateProcessAsUser winlogon %d\n",error);
+					OutputDebugString(szText);		
+				#endif
+			}
+		 else
+		 {
+			 DWORD error=GetLastError();
+			 #ifdef _DEBUG
+					char			szText[256];
+					sprintf(szText," ++++++ CreateProcessAsUser no env failed %d\n",error);
+					OutputDebugString(szText);		
+			#endif
+			//Little trick needed, FUS sometimes has an unreachable logon session.
+			 //Switch to USER B, logout user B
+			 //The logon session is then unreachable
+			 //We force the logon session on the console
+			if (error==233 && kickrdp==1)
+					{
+						counter++;
+						if (counter>3)
+							{
+								#ifdef _DEBUG
+								DWORD error=GetLastError();
+								sprintf(szText," ++++++ error==233 win\n");
+								SetLastError(0);
+								OutputDebugString(szText);		
+								#endif
+								typedef BOOLEAN (WINAPI * pWinStationConnect) (HANDLE,ULONG,ULONG,PCWSTR,ULONG);
+								typedef BOOL (WINAPI * pLockWorkStation)();
+								HMODULE  hlibwinsta = LoadLibrary("winsta.dll"); 
+								HMODULE  hlibuser32 = LoadLibrary("user32.dll");
+								pWinStationConnect WinStationConnectF=NULL;
+								pLockWorkStation LockWorkStationF=NULL;
+
+								if (hlibwinsta)
+								   {
+									   WinStationConnectF=(pWinStationConnect)GetProcAddress(hlibwinsta, "WinStationConnectW"); 
+								   }
+								if (hlibuser32)
+								   {
+									   LockWorkStationF=(pLockWorkStation)GetProcAddress(hlibuser32, "LockWorkStation"); 
+								   }
+								if (WinStationConnectF!=NULL && WinStationConnectF!=NULL)
+									{
+											DWORD ID=0;
+											if (lpfnWTSGetActiveConsoleSessionId.isValid()) ID=(*lpfnWTSGetActiveConsoleSessionId)();
+											WinStationConnectF(0, 0, ID, L"", 0);
+											LockWorkStationF();
+									}
+								Sleep(3000);
+						}
+			}
+			else if (error==233)
+			{
+				CreateRemoteSessionProcess(dwSessionId,true,hToken,NULL,app_path,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+				counter=0;
+				bReturn = TRUE;
+			}
+	  }
+        
+	}  //getsession
+	CloseHandle(hToken);
+	}
+  else
+  {
+	 #ifdef _DEBUG
+	char			szText[256];
+	DWORD error=GetLastError();
+	sprintf(szText," ++++++ Getsessionusertokenwin failed %d\n",error);
+	OutputDebugString(szText);		
+	#endif
+
+  }
+    
+    return bReturn;
+}
+//////////////////////////////////////////////////////////////////////////////
+
+void wait_for_existing_process()
+{
+#ifdef _DEBUG
+        OutputDebugString("Checking for preexisting tray icon\n");
+#endif
+    while ((hEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, "Global\\SessionEventUltra")) != NULL) {
+    	SetEvent(hEvent); // signal tray icon to shut down 
+        CloseHandle(hEvent);
+
+#ifdef _DEBUG
+        OutputDebugString("Waiting for existing tray icon to exit\n");
+#endif
+        Sleep(1000);
+    }
+}
+
+#include <sddl.h>
+SECURITY_ATTRIBUTES secAttr;
+extern SERVICE_STATUS serviceStatus;
+
+char old_buffer_s[512];
+int old_buflen_s=0;
+char buffer_s[512];
+int buflen_s;
+
+bool CheckIPAddrString() {
+    char namebuf[256];
+
+    if (gethostname(namebuf, 256) != 0) {
+		strncpy(buffer_s, "Host name unavailable", buflen_s);
+		return false;
+    };
+
+    HOSTENT *ph = gethostbyname(namebuf);
+    if (!ph) {
+		strncpy(buffer_s, "IP address unavailable", buflen_s);
+		return false;
+    };
+
+    *buffer_s = '\0';
+    char digtxt[5];
+    for (int i = 0; ph->h_addr_list[i]; i++) {
+    	for (int j = 0; j < ph->h_length; j++) {
+			sprintf(digtxt, "%d.", (unsigned char) ph->h_addr_list[i][j]);
+			strncat(buffer_s, digtxt, (buflen_s-1)-strlen(buffer_s));
+		}	
+		buffer_s[strlen(buffer_s)-1] = '\0';
+		if (ph->h_addr_list[i+1] != 0)
+			strncat(buffer_s, ", ", (buflen_s-1)-strlen(buffer_s));
+    }
+	if (strlen(buffer_s)<512) // just in case it would be bigger then our buffer
+	{
+	if (old_buflen_s!=0)
+	{
+		if (strncmp(old_buffer_s,buffer_s,old_buflen_s)!=NULL)	
+		{
+			old_buflen_s=strlen(buffer_s);
+			strncpy(old_buffer_s,buffer_s,strlen(buffer_s));
+			return false;
+		}
+	}
+	old_buflen_s=strlen(buffer_s);
+	strncpy(old_buffer_s,buffer_s,strlen(buffer_s));
+	}
+	return true;
+}
+
+void monitor_sessions()
+{
+	pad2();
+
+	int counter_ipcheck=0;
+	DWORD dwSessionId=0;
+	DWORD OlddwSessionId=99;
+	ProcessInfo.hProcess=0;
+	bool win=false;
+	bool Slow_connect=false;
+	bool last_con=false;
+	//We use this event to notify the program that the session has changed
+	//The program need to end so the service can restart the program in the correct session
+    wait_for_existing_process();
+	hEvent = CreateEvent(NULL, FALSE, FALSE, "Global\\SessionEventUltra");	
+	hEventcad = CreateEvent(NULL, FALSE, FALSE, "Global\\SessionEventUltraCad");
+	Sleep(3000);
+	HANDLE testevent[2];
+	testevent[0]=stopServiceEvent;
+	testevent[1]=hEventcad;
+	bool ToCont=true;
+	while(ToCont && serviceStatus.dwCurrentState==SERVICE_RUNNING)
+	{
+	DWORD dwEvent;
+	dwEvent=WaitForMultipleObjects(2,testevent,FALSE, 1000);
+	switch (dwEvent) 
+    { 
+		//stopServiceEvent, exit while loop
+		case WAIT_OBJECT_0 + 0: 
+			ToCont=false;
+            break; 
+
+        //cad request
+        case WAIT_OBJECT_0 + 1: 
+			{
+			typedef VOID (WINAPI *SendSas)(BOOL asUser);
+			HINSTANCE Inst = LoadLibrary("sas.dll");
+			SendSas sendSas = (SendSas) GetProcAddress(Inst, "SendSAS");
+			if (sendSas) sendSas(FALSE);
+			else
+			{
+				char WORKDIR[MAX_PATH];
+				char mycommand[MAX_PATH];
+				if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+					{
+					char* p = strrchr(WORKDIR, '\\');
+					if (p == NULL) return;
+					*p = '\0';
+					}
+				strcpy(mycommand,"");
+				strcat(mycommand,WORKDIR);//set the directory
+				strcat(mycommand,"\\");
+				strcat(mycommand,"cad.exe");
+				(void)ShellExecute(GetDesktopWindow(), "open", mycommand, "", 0, SW_SHOWNORMAL);
+			}
+			if (Inst) FreeLibrary(Inst);
+			}
+            break; 
+
+        case WAIT_TIMEOUT:
+			{
+				counter_ipcheck++;
+				if (counter_ipcheck==30)
+				{
+					counter_ipcheck=0;
+					if (!CheckIPAddrString()) OlddwSessionId=99;  //force restart
+				}
+
+									if (lpfnWTSGetActiveConsoleSessionId.isValid())
+										dwSessionId = (*lpfnWTSGetActiveConsoleSessionId)();
+									if (OlddwSessionId!=dwSessionId)
+									{
+										#ifdef _DEBUG
+												char			szText[256];
+												sprintf(szText," ++++++SetEvent Session change: signal tray icon to shut down\n");
+												OutputDebugString(szText);		
+										#endif
+										SetEvent(hEvent);
+									}
+
+		
+			
+
+									if (dwSessionId!=0xFFFFFFFF)
+										{
+													DWORD dwCode=0;
+													if (ProcessInfo.hProcess==NULL)
+													{
+																Sleep(1000);
+																if (Slow_connect) Sleep(2000);
+							#ifdef _DEBUG
+														OutputDebugString("No Tray icon existed, starting first process\n");
+							#endif
+																LaunchProcessWin(dwSessionId);
+																win=false;
+																Slow_connect=false;
+													}
+													else if (GetExitCodeProcess(ProcessInfo.hProcess,&dwCode))
+													{
+														if(dwCode != STILL_ACTIVE)
+															{
+																if (last_con==true)
+																{
+																	//problems, we move from win-->default-->win
+																	// Put a long timeout to give system time to start or logout
+																	Sleep(2000);
+																}
+							//#if 0
+																Sleep(1000);
+																if (Slow_connect) Sleep(4000);
+							//#endif
+							#ifdef _DEBUG
+																OutputDebugString("Waiting up to 15 seconds for tray icon process to exit\n");
+							#endif
+
+																WaitForSingleObject(ProcessInfo.hProcess, 15000);
+																CloseHandle(ProcessInfo.hProcess);
+																CloseHandle(ProcessInfo.hThread);
+																LaunchProcessWin(dwSessionId);
+																win=false;
+																Slow_connect=false;
+															}
+														else
+															{
+																if (Slow_connect==false)
+																{
+																	//This is the first time, so createprocess worked
+																	//last_con=false-->defaultdesk
+																	//last_con=true-->windesk
+																	last_con=false;
+																}
+																Slow_connect=true;
+															}
+													}
+													else
+													{
+														if (last_con==true)
+																{
+																	//problems, we move from win-->default-->win
+																	// Put a long timeout to give system time to start or logout
+																	Sleep(2000);
+																}
+														Sleep(1000);
+														if (Slow_connect) Sleep(4000);
+														if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+														if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+							#ifdef _DEBUG
+														OutputDebugString("Tray icon exited, starting new process\n");
+							#endif
+														LaunchProcessWin(dwSessionId);
+														win=false;
+														Slow_connect=false;
+													}
+												#ifdef _DEBUG
+												char			szText[256];
+												sprintf(szText," ++++++1 %i %i %i %i\n",OlddwSessionId,dwSessionId,dwCode,ProcessInfo.hProcess);
+												OutputDebugString(szText);		
+												#endif
+												OlddwSessionId=dwSessionId;
+										}
+			}//timeout
+		}//switch
+	}//while
+	#ifdef _DEBUG
+					char			szText[256];
+					sprintf(szText," ++++++SetEvent Service stopping: signal tray icon to shut down\n");
+					OutputDebugString(szText);		
+	#endif
+	if (hEvent) SetEvent(hEvent);
+
+    if (ProcessInfo.hProcess)
+    {
+#ifdef _DEBUG
+    OutputDebugString("Waiting up to 15 seconds for tray icon process to exit\n");
+#endif
+        WaitForSingleObject(ProcessInfo.hProcess, 15000);
+	    if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+	    if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+    }
+
+//	EndProcess();
+
+	if (hEvent) CloseHandle(hEvent);
+	if (hEventcad) CloseHandle(hEventcad);
+}
+
+// 20 April 2008 jdp paquette at atnetsend.net
+
+bool IsAnyRDPSessionActive()
+{
+    WTS_SESSION_INFO *pSessions = 0;
+    DWORD   nSessions(0);
+    DWORD   rdpSessionExists = false;
+
+    typedef BOOL (WINAPI *pfnWTSEnumerateSessions)(HANDLE,DWORD,DWORD,PWTS_SESSION_INFO*,DWORD*);
+    typedef VOID (WINAPI *pfnWTSFreeMemory)(PVOID);
+
+    helper::DynamicFn<pfnWTSEnumerateSessions> pWTSEnumerateSessions("wtsapi32","WTSEnumerateSessionsA");
+    helper::DynamicFn<pfnWTSFreeMemory> pWTSFreeMemory("wtsapi32", "WTSFreeMemory");
+
+    if (pWTSEnumerateSessions.isValid() && pWTSFreeMemory.isValid())
+
+
+    if ((*pWTSEnumerateSessions)(WTS_CURRENT_SERVER_HANDLE, 0, 1, &pSessions, &nSessions)) 
+    {
+        for (DWORD i(0); i < nSessions && !rdpSessionExists; ++i)
+        {
+            if ((_stricmp(pSessions[i].pWinStationName, "Console") != 0) &&
+                (pSessions[i].State == WTSActive        || 
+                 pSessions[i].State == WTSShadow        ||
+                 pSessions[i].State == WTSConnectQuery
+                ))
+            {
+                rdpSessionExists = true;
+            }
+        }
+
+        (*pWTSFreeMemory)(pSessions);
+    }
+
+    return rdpSessionExists ? true : false;
+}
+
+// 20 April 2008 jdp paquette at atnetsend.net
+void disconnect_remote_sessions()
+{
+	typedef BOOLEAN (WINAPI * pWinStationConnect) (HANDLE,ULONG,ULONG,PCWSTR,ULONG);
+	
+	typedef BOOL (WINAPI * pLockWorkStation)();
+
+	HMODULE  hlibwinsta = LoadLibrary("winsta.dll"); 
+	HMODULE  hlibuser32 = LoadLibrary("user32.dll");
+	pWinStationConnect WinStationConnectF=NULL;
+	pLockWorkStation LockWorkStationF=NULL;
+
+
+    // don't kick rdp off if there's still an active session
+    if (IsAnyRDPSessionActive())
+        return;
+
+	if (hlibwinsta)
+	   {
+		   WinStationConnectF=(pWinStationConnect)GetProcAddress(hlibwinsta, "WinStationConnectW"); 
+	   }
+	
+	if (hlibuser32)
+	   {
+		   LockWorkStationF=(pLockWorkStation)GetProcAddress(hlibuser32, "LockWorkStation"); 
+	   }
+	if (WinStationConnectF!=NULL && LockWorkStationF!=NULL)
+		{
+				DWORD ID=0;
+				if (lpfnWTSGetActiveConsoleSessionId.isValid()) ID=(*lpfnWTSGetActiveConsoleSessionId)();
+				WinStationConnectF(0, 0, ID, L"", 0);
+				// sleep to allow the system to finish the connect/disconnect process. If we don't
+				// then the workstation won't get locked every time.
+            	Sleep(3000);
+				if (!LockWorkStationF())
+                {
+                    char msg[1024];
+                    sprintf(msg, "LockWorkstation failed with error 0x%0X", (unsigned int) GetLastError());
+                    ::OutputDebugString(msg);
+                }
+
+		}
+	Sleep(3000);
+
+	if (hlibwinsta)
+        FreeLibrary(hlibwinsta);
+	if (hlibuser32)
+        FreeLibrary(hlibuser32);
+}
+
diff --git a/ica/win32/winvnc/winvnc/service_motor.cpp b/ica/win32/winvnc/winvnc/service_motor.cpp
new file mode 100644
index 0000000..8612bd4
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/service_motor.cpp
@@ -0,0 +1,898 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "stdhdrs.h"
+#include <windows.h>
+#include <wtsapi32.h>
+#include "common/win32_helpers.h"
+
+static void WINAPI service_main(DWORD, LPTSTR *);
+static void WINAPI control_handler(DWORD controlCode);
+static DWORD WINAPI control_handler_ex(DWORD controlCode, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext);
+static int pad();
+
+SERVICE_STATUS serviceStatus;
+static SERVICE_STATUS_HANDLE serviceStatusHandle=0;
+HANDLE stopServiceEvent=0;
+extern HANDLE hEvent;
+static char service_path[MAX_PATH];
+void monitor_sessions();
+void Restore_after_reboot();
+char service_name[256]="uvnc_service";
+char *app_name = "UltraVNC";
+void disconnect_remote_sessions();
+char cmdtext[256];
+extern int clear_console;
+bool IsWin2000()
+{
+	OSVERSIONINFO OSversion;
+	
+	OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+	GetVersionEx(&OSversion);
+
+    if (OSversion.dwPlatformId == VER_PLATFORM_WIN32_NT)
+    {
+        if (OSversion.dwMajorVersion==5 && OSversion.dwMinorVersion==0)
+            return true; 
+						
+    }
+
+    return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+static void WINAPI service_main(DWORD argc, LPTSTR* argv) {
+    /* initialise service status */
+    serviceStatus.dwServiceType=SERVICE_WIN32;
+    serviceStatus.dwCurrentState=SERVICE_STOPPED;
+    serviceStatus.dwControlsAccepted=0;
+    serviceStatus.dwWin32ExitCode=NO_ERROR;
+    serviceStatus.dwServiceSpecificExitCode=NO_ERROR;
+    serviceStatus.dwCheckPoint=0;
+    serviceStatus.dwWaitHint=0;
+
+    typedef SERVICE_STATUS_HANDLE (WINAPI * pfnRegisterServiceCtrlHandlerEx)(LPCTSTR, LPHANDLER_FUNCTION_EX, LPVOID);
+    helper::DynamicFn<pfnRegisterServiceCtrlHandlerEx> pRegisterServiceCtrlHandlerEx("advapi32.dll","RegisterServiceCtrlHandlerExA");
+
+    if (pRegisterServiceCtrlHandlerEx.isValid())
+      serviceStatusHandle = (*pRegisterServiceCtrlHandlerEx)(service_name, control_handler_ex, 0);
+    else 
+      serviceStatusHandle = RegisterServiceCtrlHandler(service_name, control_handler);
+
+    if(serviceStatusHandle) {
+        /* service is starting */
+        serviceStatus.dwCurrentState=SERVICE_START_PENDING;
+        SetServiceStatus(serviceStatusHandle, &serviceStatus);
+
+        /* do initialisation here */
+        stopServiceEvent=CreateEvent(0, FALSE, FALSE, 0);
+
+        /* running */
+        serviceStatus.dwControlsAccepted |= (SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN);
+        if (!IsWin2000())
+            serviceStatus.dwControlsAccepted |= SERVICE_ACCEPT_SESSIONCHANGE;
+
+        serviceStatus.dwCurrentState=SERVICE_RUNNING;
+        SetServiceStatus(serviceStatusHandle, &serviceStatus);
+
+Restore_after_reboot();
+monitor_sessions();
+
+        /* service was stopped */
+        serviceStatus.dwCurrentState=SERVICE_STOP_PENDING;
+        SetServiceStatus(serviceStatusHandle, &serviceStatus);
+
+        /* do cleanup here */
+        if (stopServiceEvent) CloseHandle(stopServiceEvent);
+        stopServiceEvent=0;
+
+        /* service is now stopped */
+        serviceStatus.dwControlsAccepted&=
+            ~(SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN);
+        serviceStatus.dwCurrentState=SERVICE_STOPPED;
+        SetServiceStatus(serviceStatusHandle, &serviceStatus);
+    }
+}
+////////////////////////////////////////////////////////////////////////////////
+static void WINAPI control_handler(DWORD controlCode)
+{
+  control_handler_ex(controlCode, 0, 0, 0);
+}
+static DWORD WINAPI control_handler_ex(DWORD controlCode, DWORD dwEventType, LPVOID lpEventData, LPVOID lpContext) {
+    switch (controlCode) {
+    case SERVICE_CONTROL_INTERROGATE:
+        break;
+
+    case SERVICE_CONTROL_SHUTDOWN:
+    case SERVICE_CONTROL_STOP:
+        serviceStatus.dwCurrentState=SERVICE_STOP_PENDING;
+        SetServiceStatus(serviceStatusHandle, &serviceStatus);
+        SetEvent(stopServiceEvent);
+		SetEvent(hEvent);
+        return NO_ERROR;
+
+    case SERVICE_CONTROL_PAUSE:
+        break;
+
+    case SERVICE_CONTROL_CONTINUE:
+        break;
+
+    case SERVICE_CONTROL_SESSIONCHANGE:
+        {
+            if (dwEventType == WTS_REMOTE_DISCONNECT)
+            {
+                // disconnect rdp, and reconnect to the console
+                if ( clear_console) disconnect_remote_sessions();
+            }
+        }
+        break;
+
+    default:
+        if(controlCode >= 128 && controlCode <= 255)
+            break; 
+        else
+            break;
+    }
+    SetServiceStatus(serviceStatusHandle, &serviceStatus);
+    return NO_ERROR;
+}
+////////////////////////////////////////////////////////////////////////////////
+int start_service(char *cmd) {
+	strcpy_s(cmdtext,256,cmd);
+    SERVICE_TABLE_ENTRY serviceTable[]={
+	 {service_name, service_main},
+        {0, 0}
+    };
+
+    if(!StartServiceCtrlDispatcher(serviceTable)) {
+        return 1;
+    }
+    return 0; /* NT service started */
+}
+////////////////////////////////////////////////////////////////////////////////
+void set_service_description()
+{
+    // Add service description 
+	DWORD	dw;
+	HKEY hKey;
+	char tempName[256];
+    char desc[] = "Provides secure remote desktop sharing";
+	_snprintf(tempName,  sizeof tempName, "SYSTEM\\CurrentControlSet\\Services\\%s", service_name);
+	RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+						tempName,
+						0,
+						REG_NONE,
+						REG_OPTION_NON_VOLATILE,
+						KEY_READ|KEY_WRITE,
+						NULL,
+						&hKey,
+						&dw);
+	RegSetValueEx(hKey,
+					"Description",
+					0,
+					REG_SZ,
+					(const BYTE *)desc,
+					strlen(desc)+1);
+
+
+	RegCloseKey(hKey);
+}
+
+
+// List of other required services ("dependency 1\0dependency 2\0\0")
+// *** These need filling in properly
+#define VNCDEPENDENCIES    "Tcpip\0\0"
+
+
+
+int install_service(void) {
+    SC_HANDLE scm, service;
+	pad();
+
+    scm=OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
+    if(!scm) {
+        MessageBoxSecure(NULL, "Failed to open service control manager",
+            app_name, MB_ICONERROR);
+        return 1;
+    }
+    //"Provides secure remote desktop sharing"
+    service=CreateService(scm,service_name, service_name, SERVICE_ALL_ACCESS,
+                          SERVICE_WIN32_OWN_PROCESS,
+                          SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, service_path,
+        NULL, NULL, VNCDEPENDENCIES, NULL, NULL);
+    if(!service) {
+		DWORD myerror=GetLastError();
+		if (myerror==ERROR_ACCESS_DENIED)
+		{
+			MessageBoxSecure(NULL, "Failed: Permission denied",
+            app_name, MB_ICONERROR);
+			CloseServiceHandle(scm);
+			return 1;
+		}
+		if (myerror==ERROR_SERVICE_EXISTS)
+		{
+			//MessageBoxSecure(NULL, "Failed: Already exist",
+            //"UltraVnc", MB_ICONERROR);
+			CloseServiceHandle(scm);
+			return 1;
+		}
+
+        MessageBoxSecure(NULL, "Failed to create a new service",
+            app_name, MB_ICONERROR);
+        CloseServiceHandle(scm);
+        return 1;
+    }
+    else
+        set_service_description();
+    CloseServiceHandle(service);
+    CloseServiceHandle(scm);
+    return 0;
+}
+////////////////////////////////////////////////////////////////////////////////
+int uninstall_service(void) {
+    SC_HANDLE scm, service;
+    SERVICE_STATUS serviceStatus;
+
+    scm=OpenSCManager(0, 0, SC_MANAGER_CONNECT);
+    if(!scm) {
+        MessageBoxSecure(NULL, "Failed to open service control manager",
+            app_name, MB_ICONERROR);
+        return 1;
+    }
+
+	service=OpenService(scm, service_name,
+        SERVICE_QUERY_STATUS | DELETE);
+    if(!service) {
+		DWORD myerror=GetLastError();
+		if (myerror==ERROR_ACCESS_DENIED)
+		{
+			MessageBoxSecure(NULL, "Failed: Permission denied",
+            app_name, MB_ICONERROR);
+			CloseServiceHandle(scm);
+			return 1;
+		}
+		if (myerror==ERROR_SERVICE_DOES_NOT_EXIST)
+		{
+#if 0
+			MessageBoxSecure(NULL, "Failed: Service is not installed",
+            app_name, MB_ICONERROR);
+#endif
+			CloseServiceHandle(scm);
+			return 1;
+		}
+
+        MessageBoxSecure(NULL, "Failed to open the service",
+            app_name, MB_ICONERROR);
+        CloseServiceHandle(scm);
+        return 1;
+    }
+    if(!QueryServiceStatus(service, &serviceStatus)) {
+        MessageBoxSecure(NULL, "Failed to query service status",
+            app_name, MB_ICONERROR);
+        CloseServiceHandle(service);
+        CloseServiceHandle(scm);
+        return 1;
+    }
+    if(serviceStatus.dwCurrentState!=SERVICE_STOPPED) {
+        //MessageBoxSecure(NULL, "The service is still running, disable it first",
+        //    "UltraVnc", MB_ICONERROR);
+        CloseServiceHandle(service);
+        CloseServiceHandle(scm);
+		Sleep(2500);uninstall_service();
+        return 1;
+    }
+    if(!DeleteService(service)) {
+        MessageBoxSecure(NULL, "Failed to delete the service",
+            app_name, MB_ICONERROR);
+        CloseServiceHandle(service);
+        CloseServiceHandle(scm);
+        return 1;
+    }
+    CloseServiceHandle(service);
+    CloseServiceHandle(scm);
+    return 0;
+}
+////////////////////////////////////////////////////////////////////////////////
+static int pad()
+{
+	char exe_file_name[MAX_PATH], dir[MAX_PATH], *ptr;
+    GetModuleFileName(0, exe_file_name, MAX_PATH);
+
+    /* set current directory */
+    strcpy(dir, exe_file_name);
+    ptr=strrchr(dir, '\\'); /* last backslash */
+    if(ptr)
+        ptr[1]='\0'; /* truncate program name */
+    if(!SetCurrentDirectory(dir)) {
+        return 1;
+    }
+
+    strcpy(service_path, "\"");
+    strcat(service_path, exe_file_name);
+    strcat(service_path, "\" -service");
+	return 0;
+}
+////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+BOOL CreateServiceSafeBootKey()
+{
+	HKEY hKey;
+	DWORD dwDisp = 0;
+	LONG lSuccess;
+	char szKey[1024];
+	_snprintf(szKey, 1024, "SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\%s\\%s", "Network", service_name);
+	lSuccess = RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKey, 0L, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisp);
+	if (lSuccess == ERROR_SUCCESS)
+	{
+    RegSetValueEx(hKey, NULL, 0, REG_SZ, (unsigned char*)"Service", 8);
+		RegCloseKey(hKey);
+		return TRUE;
+	}
+	else
+		return FALSE;
+}
+////////////////////////////////////////////////////////////////////////////////
+void Set_Safemode()
+{
+	OSVERSIONINFO OSversion;	
+	OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+	GetVersionEx(&OSversion);
+	if(OSversion.dwMajorVersion<6)
+			{
+					char drivepath[150];
+					char systemdrive[150];
+					char stringvalue[512];
+					GetEnvironmentVariable("SYSTEMDRIVE", systemdrive, 150);
+					strcat (systemdrive,"/boot.ini");
+					GetPrivateProfileString("boot loader","default","",drivepath,150,systemdrive);
+					if (strlen(drivepath)==0) return;
+					GetPrivateProfileString("operating systems",drivepath,"",stringvalue,512,systemdrive);
+					if (strlen(stringvalue)==0) return;
+					strcat(stringvalue," /safeboot:network");
+					SetFileAttributes(systemdrive,FILE_ATTRIBUTE_NORMAL);
+					WritePrivateProfileString("operating systems",drivepath,stringvalue,systemdrive);
+
+			}
+			else
+			{
+
+#ifdef _X64
+			char systemroot[150];
+			GetEnvironmentVariable("SystemRoot", systemroot, 150);
+			char exe_file_name[MAX_PATH];
+			char parameters[MAX_PATH];
+			strcpy(exe_file_name,systemroot);
+			strcat(exe_file_name,"\\system32\\");
+			strcat(exe_file_name,"bcdedit.exe");
+			strcpy(parameters,"/set safeboot network");
+			SHELLEXECUTEINFO shExecInfo;
+			shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+			shExecInfo.fMask = 0;
+			shExecInfo.hwnd = GetForegroundWindow();
+			shExecInfo.lpVerb = "runas";
+			shExecInfo.lpFile = exe_file_name;
+			shExecInfo.lpParameters = parameters;
+			shExecInfo.lpDirectory = NULL;
+			shExecInfo.nShow = SW_HIDE;
+			shExecInfo.hInstApp = NULL;
+			ShellExecuteEx(&shExecInfo);
+#else
+
+			typedef BOOL (WINAPI *LPFN_Wow64DisableWow64FsRedirection)(PVOID* OldValue);
+			typedef BOOL (WINAPI *LPFN_Wow64RevertWow64FsRedirection)(PVOID OldValue);
+			PVOID OldValue;  
+			LPFN_Wow64DisableWow64FsRedirection pfnWow64DisableWowFsRedirection = (LPFN_Wow64DisableWow64FsRedirection)GetProcAddress(GetModuleHandle("kernel32"),"Wow64DisableWow64FsRedirection");
+			LPFN_Wow64RevertWow64FsRedirection pfnWow64RevertWow64FsRedirection = (LPFN_Wow64RevertWow64FsRedirection)GetProcAddress(GetModuleHandle("kernel32"),"Wow64RevertWow64FsRedirection");
+			if (pfnWow64DisableWowFsRedirection && pfnWow64RevertWow64FsRedirection) 
+			{
+				if(TRUE == pfnWow64DisableWowFsRedirection(&OldValue))
+					{
+						char systemroot[150];
+						GetEnvironmentVariable("SystemRoot", systemroot, 150);
+						char exe_file_name[MAX_PATH];
+						char parameters[MAX_PATH];
+						strcpy(exe_file_name,systemroot);
+						strcat(exe_file_name,"\\system32\\");
+						strcat(exe_file_name,"bcdedit.exe");
+						strcpy(parameters,"/set safeboot network");
+						SHELLEXECUTEINFO shExecInfo;
+						shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+						shExecInfo.fMask = 0;
+						shExecInfo.hwnd = GetForegroundWindow();
+						shExecInfo.lpVerb = "runas";
+						shExecInfo.lpFile = exe_file_name;
+						shExecInfo.lpParameters = parameters;
+						shExecInfo.lpDirectory = NULL;
+						shExecInfo.nShow = SW_HIDE;
+						shExecInfo.hInstApp = NULL;
+						ShellExecuteEx(&shExecInfo);
+						pfnWow64RevertWow64FsRedirection(OldValue);
+					}
+				else
+				{
+					char systemroot[150];
+					GetEnvironmentVariable("SystemRoot", systemroot, 150);
+					char exe_file_name[MAX_PATH];
+					char parameters[MAX_PATH];
+					strcpy(exe_file_name,systemroot);
+					strcat(exe_file_name,"\\system32\\");
+					strcat(exe_file_name,"bcdedit.exe");
+					strcpy(parameters,"/set safeboot network");
+					SHELLEXECUTEINFO shExecInfo;
+					shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+					shExecInfo.fMask = 0;
+					shExecInfo.hwnd = GetForegroundWindow();
+					shExecInfo.lpVerb = "runas";
+					shExecInfo.lpFile = exe_file_name;
+					shExecInfo.lpParameters = parameters;
+					shExecInfo.lpDirectory = NULL;
+					shExecInfo.nShow = SW_HIDE;
+					shExecInfo.hInstApp = NULL;
+					ShellExecuteEx(&shExecInfo);
+				}
+			}
+			else
+			{
+				char systemroot[150];
+				GetEnvironmentVariable("SystemRoot", systemroot, 150);
+				char exe_file_name[MAX_PATH];
+				char parameters[MAX_PATH];
+				strcpy(exe_file_name,systemroot);
+				strcat(exe_file_name,"\\system32\\");
+				strcat(exe_file_name,"bcdedit.exe");
+				strcpy(parameters,"/set safeboot network");
+				SHELLEXECUTEINFO shExecInfo;
+				shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+				shExecInfo.fMask = 0;
+				shExecInfo.hwnd = GetForegroundWindow();
+				shExecInfo.lpVerb = "runas";
+				shExecInfo.lpFile = exe_file_name;
+				shExecInfo.lpParameters = parameters;
+				shExecInfo.lpDirectory = NULL;
+				shExecInfo.nShow = SW_HIDE;
+				shExecInfo.hInstApp = NULL;
+				ShellExecuteEx(&shExecInfo);
+			}
+#endif
+
+			}
+}
+
+BOOL reboot()
+{
+	HANDLE hToken; 
+    TOKEN_PRIVILEGES tkp; 
+    if (OpenProcessToken(    GetCurrentProcess(),
+                TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, 
+                & hToken)) 
+		{
+			LookupPrivilegeValue(    NULL,  SE_SHUTDOWN_NAME,  & tkp.Privileges[0].Luid);          
+			tkp.PrivilegeCount = 1; 
+			tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 
+			if(AdjustTokenPrivileges(    hToken,  FALSE,  & tkp,  0,  (PTOKEN_PRIVILEGES)NULL,  0))
+				{
+					ExitWindowsEx(EWX_REBOOT, 0);
+				}
+		}
+	return TRUE;
+}
+
+BOOL Force_reboot()
+{
+	HANDLE hToken; 
+    TOKEN_PRIVILEGES tkp; 
+    if (OpenProcessToken(    GetCurrentProcess(),
+                TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, 
+                & hToken)) 
+		{
+			LookupPrivilegeValue(    NULL,  SE_SHUTDOWN_NAME,  & tkp.Privileges[0].Luid);          
+			tkp.PrivilegeCount = 1; 
+			tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 
+			if(AdjustTokenPrivileges(    hToken,  FALSE,  & tkp,  0,  (PTOKEN_PRIVILEGES)NULL,  0))
+				{
+					OSVERSIONINFO OSversion;	
+					OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+					GetVersionEx(&OSversion);
+					if(OSversion.dwMajorVersion<6)
+					{
+					ExitWindowsEx(EWX_REBOOT|EWX_FORCEIFHUNG, 0);
+					}
+					else
+					{
+					ExitWindowsEx(EWX_REBOOT|EWX_FORCE, 0);
+					}
+				}
+		}
+	return TRUE;
+}
+
+void Reboot_with_force_reboot()
+{
+	Force_reboot();
+
+}
+
+void Reboot_with_force_reboot_elevated()
+{
+
+	char exe_file_name[MAX_PATH];
+	GetModuleFileName(0, exe_file_name, MAX_PATH);
+	SHELLEXECUTEINFO shExecInfo;
+	shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+	shExecInfo.fMask = NULL;
+	shExecInfo.hwnd = GetForegroundWindow();
+	shExecInfo.lpVerb = "runas";
+	shExecInfo.lpFile = exe_file_name;
+	shExecInfo.lpParameters = "-rebootforce";
+	shExecInfo.lpDirectory = NULL;
+	shExecInfo.nShow = SW_HIDE;
+	shExecInfo.hInstApp = NULL;
+	ShellExecuteEx(&shExecInfo);
+}
+
+void Reboot_in_safemode()
+{
+	if (CreateServiceSafeBootKey()) 
+		{
+			Set_Safemode();
+			reboot();
+		}
+
+}
+
+void Reboot_in_safemode_elevated()
+{
+
+	char exe_file_name[MAX_PATH];
+	GetModuleFileName(0, exe_file_name, MAX_PATH);
+	SHELLEXECUTEINFO shExecInfo;
+	shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+	shExecInfo.fMask = 0;
+	shExecInfo.hwnd = GetForegroundWindow();
+	shExecInfo.lpVerb = "runas";
+	shExecInfo.lpFile = exe_file_name;
+	shExecInfo.lpParameters = "-rebootsafemode";
+	shExecInfo.lpDirectory = NULL;
+	shExecInfo.nShow = SW_HIDE;
+	shExecInfo.hInstApp = NULL;
+	ShellExecuteEx(&shExecInfo);
+}
+
+////////////////// ALL /////////////////////////////
+////////////////////////////////////////////////////
+
+BOOL DeleteServiceSafeBootKey()
+{
+	LONG lSuccess;
+	char szKey[1024];
+	_snprintf(szKey, 1024, "SYSTEM\\CurrentControlSet\\Control\\SafeBoot\\%s\\%s", "Network", service_name);
+	lSuccess = RegDeleteKey(HKEY_LOCAL_MACHINE, szKey);
+	return lSuccess == ERROR_SUCCESS;
+
+}
+
+void Restore_safemode()
+{
+	OSVERSIONINFO OSversion;	
+	OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+	GetVersionEx(&OSversion);
+	if(OSversion.dwMajorVersion<6)
+		{
+			char drivepath[150];
+			char systemdrive[150];
+			char stringvalue[512];
+			GetEnvironmentVariable("SYSTEMDRIVE", systemdrive, 150);
+			strcat (systemdrive,"/boot.ini");
+			GetPrivateProfileString("boot loader","default","",drivepath,150,systemdrive);
+			if (strlen(drivepath)==0) return;
+			GetPrivateProfileString("operating systems",drivepath,"",stringvalue,512,systemdrive);
+			if (strlen(stringvalue)==0) return;
+			char* p = strrchr(stringvalue, '/');
+			if (p == NULL) return;
+				*p = '\0';
+			WritePrivateProfileString("operating systems",drivepath,stringvalue,systemdrive);		
+			SetFileAttributes(systemdrive,FILE_ATTRIBUTE_READONLY);
+		}
+	else
+		{
+#ifdef _X64
+			char systemroot[150];
+			GetEnvironmentVariable("SystemRoot", systemroot, 150);
+			char exe_file_name[MAX_PATH];
+			char parameters[MAX_PATH];
+			strcpy(exe_file_name,systemroot);
+			strcat(exe_file_name,"\\system32\\");
+			strcat(exe_file_name,"bcdedit.exe");
+			strcpy(parameters,"/deletevalue safeboot");
+			SHELLEXECUTEINFO shExecInfo;
+			shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+			shExecInfo.fMask = 0;
+			shExecInfo.hwnd = GetForegroundWindow();
+			shExecInfo.lpVerb = "runas";
+			shExecInfo.lpFile = exe_file_name;
+			shExecInfo.lpParameters = parameters;
+			shExecInfo.lpDirectory = NULL;
+			shExecInfo.nShow = SW_HIDE;
+			shExecInfo.hInstApp = NULL;
+			ShellExecuteEx(&shExecInfo);
+#else
+			typedef BOOL (WINAPI *LPFN_Wow64DisableWow64FsRedirection)(PVOID* OldValue);
+			typedef BOOL (WINAPI *LPFN_Wow64RevertWow64FsRedirection)(PVOID OldValue);
+			PVOID OldValue;  
+			LPFN_Wow64DisableWow64FsRedirection pfnWow64DisableWowFsRedirection = (LPFN_Wow64DisableWow64FsRedirection)GetProcAddress(GetModuleHandle("kernel32"),"Wow64DisableWow64FsRedirection");
+			LPFN_Wow64RevertWow64FsRedirection pfnWow64RevertWow64FsRedirection = (LPFN_Wow64RevertWow64FsRedirection)GetProcAddress(GetModuleHandle("kernel32"),"Wow64RevertWow64FsRedirection");
+			if (pfnWow64DisableWowFsRedirection && pfnWow64RevertWow64FsRedirection)  ///win32 on x64 system
+			{
+				if(TRUE == pfnWow64DisableWowFsRedirection(&OldValue))
+					{
+						char systemroot[150];
+						GetEnvironmentVariable("SystemRoot", systemroot, 150);
+						char exe_file_name[MAX_PATH];
+						char parameters[MAX_PATH];
+						strcpy(exe_file_name,systemroot);
+						strcat(exe_file_name,"\\system32\\");
+						strcat(exe_file_name,"bcdedit.exe");
+						strcpy(parameters,"/deletevalue safeboot");
+						SHELLEXECUTEINFO shExecInfo;
+						shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+						shExecInfo.fMask = 0;
+						shExecInfo.hwnd = GetForegroundWindow();
+						shExecInfo.lpVerb = "runas";
+						shExecInfo.lpFile = exe_file_name;
+						shExecInfo.lpParameters = parameters;
+						shExecInfo.lpDirectory = NULL;
+						shExecInfo.nShow = SW_HIDE;
+						shExecInfo.hInstApp = NULL;
+						ShellExecuteEx(&shExecInfo);
+						pfnWow64RevertWow64FsRedirection(OldValue);
+					}
+				else
+				{
+					char systemroot[150];
+					GetEnvironmentVariable("SystemRoot", systemroot, 150);
+					char exe_file_name[MAX_PATH];
+					char parameters[MAX_PATH];
+					strcpy(exe_file_name,systemroot);
+					strcat(exe_file_name,"\\system32\\");
+					strcat(exe_file_name,"bcdedit.exe");
+					strcpy(parameters,"/deletevalue safeboot");
+					SHELLEXECUTEINFO shExecInfo;
+					shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+					shExecInfo.fMask = 0;
+					shExecInfo.hwnd = GetForegroundWindow();
+					shExecInfo.lpVerb = "runas";
+					shExecInfo.lpFile = exe_file_name;
+					shExecInfo.lpParameters = parameters;
+					shExecInfo.lpDirectory = NULL;
+					shExecInfo.nShow = SW_HIDE;
+					shExecInfo.hInstApp = NULL;
+					ShellExecuteEx(&shExecInfo);
+				}
+			}
+			else  //win32 on W32
+			{
+				char systemroot[150];
+				GetEnvironmentVariable("SystemRoot", systemroot, 150);
+				char exe_file_name[MAX_PATH];
+				char parameters[MAX_PATH];
+				strcpy(exe_file_name,systemroot);
+				strcat(exe_file_name,"\\system32\\");
+				strcat(exe_file_name,"bcdedit.exe");
+				strcpy(parameters,"/deletevalue safeboot");
+				SHELLEXECUTEINFO shExecInfo;
+				shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+				shExecInfo.fMask = 0;
+				shExecInfo.hwnd = GetForegroundWindow();
+				shExecInfo.lpVerb = "runas";
+				shExecInfo.lpFile = exe_file_name;
+				shExecInfo.lpParameters = parameters;
+				shExecInfo.lpDirectory = NULL;
+				shExecInfo.nShow = SW_HIDE;
+				shExecInfo.hInstApp = NULL;
+				ShellExecuteEx(&shExecInfo);
+			}
+#endif
+		}
+}
+
+void Restore_after_reboot()
+{
+	//If we are running !normal mode
+	//disable boot.ini /safemode:network
+	//disable safeboot service
+	if (GetSystemMetrics(SM_CLEANBOOT) != 0)
+	{
+		Restore_safemode();
+		DeleteServiceSafeBootKey();
+	}
+}
+
+
+////////////////// >VISTA /////////////////////////////
+///////////////////////////////////////////////////////
+bool ISUACENabled()
+{
+	OSVERSIONINFO OSversion;	
+	OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+	GetVersionEx(&OSversion);
+	if(OSversion.dwMajorVersion<6) return false;
+	HKEY hKey;
+	if (::RegOpenKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", &hKey) == ERROR_SUCCESS)
+		{
+			DWORD value = 0;
+			DWORD tt=4;
+			if (::RegQueryValueExW(hKey, L"EnableLUA", NULL, NULL, (LPBYTE)&value, &tt) == ERROR_SUCCESS)
+			{
+			RegCloseKey(hKey);
+			return (value != 0);
+			}
+			RegCloseKey(hKey);
+		}
+	return false;
+}
+
+bool IsSoftwareCadEnabled()
+{
+	OSVERSIONINFO OSversion;	
+	OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+	GetVersionEx(&OSversion);
+	if(OSversion.dwMajorVersion<6) return true;
+
+	HKEY hkLocal, hkLocalKey;
+	DWORD dw;
+	if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+		"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies",
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+		{
+		return 0;
+		}
+	if (RegOpenKeyEx(hkLocal,
+		"System",
+		0, KEY_READ,
+		&hkLocalKey) != ERROR_SUCCESS)
+	{
+		RegCloseKey(hkLocal);
+		return 0;
+	}
+
+	LONG pref=0;
+	ULONG type = REG_DWORD;
+	ULONG prefsize = sizeof(pref);
+
+	if (RegQueryValueEx(hkLocalKey,
+			"SoftwareSASGeneration",
+			NULL,
+			&type,
+			(LPBYTE) &pref,
+			&prefsize) != ERROR_SUCCESS)
+	{
+			RegCloseKey(hkLocalKey);
+			RegCloseKey(hkLocal);
+			return false;
+	}
+	RegCloseKey(hkLocalKey);
+	RegCloseKey(hkLocal);
+	if (pref!=0) return true;
+	else return false;
+}
+
+void
+Enable_softwareCAD()
+{							
+	HKEY hkLocal, hkLocalKey;
+	DWORD dw;
+	if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+		"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies",
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+		{
+		return;
+		}
+	if (RegOpenKeyEx(hkLocal,
+		"System",
+		0, KEY_WRITE | KEY_READ,
+		&hkLocalKey) != ERROR_SUCCESS)
+	{
+		RegCloseKey(hkLocal);
+		return;
+	}
+	LONG pref;
+	pref=1;
+	RegSetValueEx(hkLocalKey, "SoftwareSASGeneration", 0, REG_DWORD, (LPBYTE) &pref, sizeof(pref));
+	RegCloseKey(hkLocalKey);
+	RegCloseKey(hkLocal);
+}
+
+void delete_softwareCAD()
+{
+	//Beep(1000,10000);
+	HKEY hkLocal, hkLocalKey;
+	DWORD dw;
+	if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+		"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies",
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+		{
+		return;
+		}
+	if (RegOpenKeyEx(hkLocal,
+		"System",
+		0, KEY_WRITE | KEY_READ,
+		&hkLocalKey) != ERROR_SUCCESS)
+	{
+		RegCloseKey(hkLocal);
+		return;
+	}
+	RegDeleteValue(hkLocalKey, "SoftwareSASGeneration");
+	RegCloseKey(hkLocalKey);
+	RegCloseKey(hkLocal);
+
+}
+
+void delete_softwareCAD_elevated()
+{
+	OSVERSIONINFO OSversion;	
+	OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+	GetVersionEx(&OSversion);
+	if(OSversion.dwMajorVersion<6) return;
+
+	char exe_file_name[MAX_PATH];
+	GetModuleFileName(0, exe_file_name, MAX_PATH);
+	SHELLEXECUTEINFO shExecInfo;
+	shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+	shExecInfo.fMask = 0;
+	shExecInfo.hwnd = GetForegroundWindow();
+	shExecInfo.lpVerb = "runas";
+	shExecInfo.lpFile = exe_file_name;
+	shExecInfo.lpParameters = "-delsoftwarecad";
+	shExecInfo.lpDirectory = NULL;
+	shExecInfo.nShow = SW_SHOWNORMAL;
+	shExecInfo.hInstApp = NULL;
+	ShellExecuteEx(&shExecInfo);
+}
+
+void Enable_softwareCAD_elevated()
+{
+	OSVERSIONINFO OSversion;	
+	OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+	GetVersionEx(&OSversion);
+	if(OSversion.dwMajorVersion<6) return;
+
+	char exe_file_name[MAX_PATH];
+	GetModuleFileName(0, exe_file_name, MAX_PATH);
+	SHELLEXECUTEINFO shExecInfo;
+	shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+	shExecInfo.fMask = 0;
+	shExecInfo.hwnd = GetForegroundWindow();
+	shExecInfo.lpVerb = "runas";
+	shExecInfo.lpFile = exe_file_name;
+	shExecInfo.lpParameters = "-softwarecad";
+	shExecInfo.lpDirectory = NULL;
+	shExecInfo.nShow = SW_SHOWNORMAL;
+	shExecInfo.hInstApp = NULL;
+	ShellExecuteEx(&shExecInfo);
+}
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
diff --git a/ica/win32/winvnc/winvnc/stdhdrs.cpp b/ica/win32/winvnc/winvnc/stdhdrs.cpp
new file mode 100644
index 0000000..0034fd3
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/stdhdrs.cpp
@@ -0,0 +1,28 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+#include "stdhdrs.h"
+
+// Create the main log object
+VNCLog vnclog;
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/stdhdrs.h b/ica/win32/winvnc/winvnc/stdhdrs.h
new file mode 100644
index 0000000..4e0efab
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/stdhdrs.h
@@ -0,0 +1,104 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+//need to be added for VS 2005
+//#define _WIN32_IE 0x0500
+#define WIN32_LEAN_AND_MEAN
+#ifndef STRICT
+#define STRICT
+#endif
+
+//compile special case, rfb port is used for java and rfb
+//#define HTTP_SAMEPORT
+
+#include <winsock2.h>
+#include <windows.h>
+#include <shellapi.h>
+//#include <winsock2.h>
+
+#include <malloc.h>
+#include <stdio.h>
+#include <process.h>
+#include <crtdbg.h>
+
+#include <QtCore/QString>
+
+//#include "dpi.h"
+
+// LOGGING SUPPORT
+void *memcpy_amd(void *dest, const void *src, size_t n);
+bool CheckVideoDriver(bool);
+#define MAXPATH 256
+
+#include "vnclog.h"
+extern VNCLog vnclog;
+
+// No logging at all
+#define LL_NONE		0
+// Log server startup/shutdown
+#define LL_STATE	1
+// Log connect/disconnect
+#define LL_CLIENTS	2
+// Log connection errors (wrong pixfmt, etc)
+#define LL_CONNERR	3
+// Log socket errors
+#define LL_SOCKERR	4
+// Log internal errors
+#define LL_INTERR	5
+
+#define LL_ERROR	6
+
+// Log internal warnings
+#define LL_INTWARN	8
+// Log internal info
+#define LL_INTINFO	9
+// Log socket errors
+#define LL_SOCKINFO	10
+// Log everything, including internal table setup, etc.
+#define LL_ALL		10
+
+#define strcat_s(dst,num,src) strncat(dst,src,num)
+#define strncat_s(a,b,c,d) strncat(a,c,b)
+#define strcpy_s(dst,num,src)	strncpy(dst,src,num)
+#define strncpy_s(dst,num,src,x)	strncpy(dst,src,num)
+
+#define KEEPALIVE_HEADROOM 1
+#define KEEPALIVE_INTERVAL 5
+#define FT_RECV_TIMEOUT    30
+
+// adzm 2010-08
+#define SOCKET_KEEPALIVE_TIMEOUT 10000
+#define SOCKET_KEEPALIVE_INTERVAL 1000
+
+// Macros for sticking in the current file name
+#define VNCLOG(s)	(QString("%1 : %2").arg(__PRETTY_FUNCTION__).arg(s).toUtf8().constData())
+#if MSC_VER > 12
+#ifndef _X64
+#pragma comment(linker,"/manifestdependency:\"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='X86' publicKeyToken='6595b64144ccf1df' language='*'\"")
+#else
+#pragma comment(linker,"/manifestdependency:\"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
+#endif
+#endif
+//#define memcpy memcpy_amd
+//remove comment to compiler for >=athlon  or >=PIII
+DWORD MessageBoxSecure(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType);
diff --git a/ica/win32/winvnc/winvnc/tableinitcmtemplate.cpp b/ica/win32/winvnc/winvnc/tableinitcmtemplate.cpp
new file mode 100644
index 0000000..d8e07b0
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/tableinitcmtemplate.cpp
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+
+#if !defined(OUTVNC)
+#error "This file shouldn't be compiled."
+#error "It is included as part of translate.c"
+#endif
+
+#define OUT_T CONCAT2E(CARD,OUTVNC)
+#define SwapOUTVNC(x) CONCAT2E(Swap,OUTVNC) (x)
+#define rfbInitColourMapSingleTableOUTVNC \
+				CONCAT2E(rfbInitColourMapSingleTable,OUTVNC)
+
+// THIS CODE HAS BEEN MODIFIED FROM THE ORIGINAL UNIX SOURCE
+// TO WORK FOR WINVNC.  THE PALETTE SHOULD REALLY BE RETRIEVED
+// FROM THE VNCDESKTOP OBJECT, RATHER THAN FROM THE OS DIRECTLY
+
+static void
+rfbInitColourMapSingleTableOUTVNC (char **table,
+								rfbPixelFormat *in,
+								rfbPixelFormat *out)
+{
+	vnclog.Print(LL_ALL, VNCLOG("rfbInitColourMapSingleTable called\n"));
+
+	// ALLOCATE SPACE FOR COLOUR TABLE
+
+    unsigned int nEntries = 1 << in->bitsPerPixel;
+
+	// Allocate the table
+    if (*table) free(*table);
+    *table = (char *)malloc(nEntries * sizeof(OUT_T));
+	if (*table == NULL)
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("failed to allocate translation table\n"));
+		return;
+	}
+
+	// Obtain the system palette
+	HDC hDC = GetDcMirror();
+	if (hDC==NULL) vnclog.Print(LL_ALL, VNCLOG("Using video Palette\n"));
+	else vnclog.Print(LL_ALL, VNCLOG("Using mirror video Palette\n"));
+	if (hDC==NULL) hDC = GetDC(NULL);
+	PALETTEENTRY palette[256];
+  UINT entries = ::GetSystemPaletteEntries(hDC,	0, 256, palette);
+	vnclog.Print(LL_INTINFO, VNCLOG("got %u palette entries\n"), GetLastError());
+	ReleaseDC(NULL, hDC);
+
+  // - Set the rest of the palette to something nasty but usable
+  unsigned int i;
+  for (i=entries;i<256;i++) {
+    palette[i].peRed = i % 2 ? 255 : 0;
+    palette[i].peGreen = i/2 % 2 ? 255 : 0;
+    palette[i].peBlue = i/4 % 2 ? 255 : 0;
+  }
+
+	// COLOUR TRANSLATION
+
+	// We now have the colour table intact.  Map it into a translation table
+  int r, g, b;
+  OUT_T *t = (OUT_T *)*table;
+
+  for (i = 0; i < nEntries; i++)
+	{
+		// Split down the RGB data
+		r = palette[i].peRed;
+		g = palette[i].peGreen;
+		b = palette[i].peBlue;
+
+		// Now translate it
+		t[i] = ((((r * out->redMax + 127) / 255) << out->redShift) |
+			(((g * out->greenMax + 127) / 255) << out->greenShift) |
+			(((b * out->blueMax + 127) / 255) << out->blueShift));
+#if (OUTVNC != 8)
+		if (out->bigEndian != in->bigEndian)
+		{
+			t[i] = SwapOUTVNC(t[i]);
+		}
+#endif
+	}
+
+	vnclog.Print(LL_ALL, VNCLOG("rfbInitColourMapSingleTable done\n"));
+}
+
+#undef OUT_T
+#undef SwapOUT
+#undef rfbInitColourMapSingleTableOUTVNC
diff --git a/ica/win32/winvnc/winvnc/tableinittctemplate.cpp b/ica/win32/winvnc/winvnc/tableinittctemplate.cpp
new file mode 100644
index 0000000..d21c6cd
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/tableinittctemplate.cpp
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+
+#if !defined(OUTVNC)
+#error "This file shouldn't be compiled."
+#error "It is included as part of translate.c"
+#endif
+
+#define OUT_T CONCAT2E(CARD,OUTVNC)
+#define SwapOUTVNC(x) CONCAT2E(Swap,OUTVNC) (x)
+#define rfbInitTrueColourSingleTableOUTVNC \
+				CONCAT2E(rfbInitTrueColourSingleTable,OUTVNC)
+#define rfbInitTrueColourRGBTablesOUTVNC CONCAT2E(rfbInitTrueColourRGBTables,OUTVNC)
+#define rfbInitOneRGBTableOUTVNC CONCAT2E(rfbInitOneRGBTable,OUTVNC)
+
+static void
+rfbInitOneRGBTableOUTVNC (OUT_T *table, int inMax, int outMax, int outShift,
+		       int swap);
+
+
+/*
+ * rfbInitTrueColourSingleTable sets up a single lookup table for truecolour
+ * translation.
+ */
+
+static void
+rfbInitTrueColourSingleTableOUTVNC (char **table, rfbPixelFormat *in,
+				 rfbPixelFormat *out)
+{
+    int i;
+    int inRed, inGreen, inBlue, outRed, outGreen, outBlue;
+    OUT_T *t=NULL;
+    int nEntries = 1 << in->bitsPerPixel;
+
+    if (*table) free(*table);
+    *table = (char *)malloc(nEntries * sizeof(OUT_T));
+	if (table == NULL) return;
+    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;
+
+	if (t) t[i] = ((outRed   << out->redShift)   |
+		(outGreen << out->greenShift) |
+		(outBlue  << out->blueShift));
+#if (OUTVNC != 8)
+	if (t) if (out->bigEndian != in->bigEndian) {
+	    t[i] = SwapOUTVNC(t[i]);
+	}
+#endif
+    }
+}
+
+
+/*
+ * rfbInitTrueColourRGBTables sets up three separate lookup tables for the
+ * red, green and blue values.
+ */
+
+static void
+rfbInitTrueColourRGBTablesOUTVNC (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;
+
+    rfbInitOneRGBTableOUTVNC (redTable, in->redMax, out->redMax,
+			   out->redShift, (out->bigEndian != in->bigEndian));
+    rfbInitOneRGBTableOUTVNC (greenTable, in->greenMax, out->greenMax,
+			   out->greenShift, (out->bigEndian != in->bigEndian));
+    rfbInitOneRGBTableOUTVNC (blueTable, in->blueMax, out->blueMax,
+			   out->blueShift, (out->bigEndian != in->bigEndian));
+}
+
+static void
+rfbInitOneRGBTableOUTVNC (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 (OUTVNC != 8)
+	if (swap) {
+	    table[i] = SwapOUTVNC(table[i]);
+	}
+#endif
+    }
+}
+
+#undef OUT_T
+#undef SwapOUTVNC
+#undef rfbInitTrueColourSingleTableOUTVNC
+#undef rfbInitTrueColourRGBTablesOUTVNC
+#undef rfbInitOneRGBTableOUTVNC
diff --git a/ica/win32/winvnc/winvnc/tabletranstemplate.cpp b/ica/win32/winvnc/winvnc/tabletranstemplate.cpp
new file mode 100644
index 0000000..1a8c729
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/tabletranstemplate.cpp
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+
+#if !defined(INVNC) || !defined(OUTVNC)
+#error "This file shouldn't be compiled."
+#error "It is included as part of translate.c"
+#endif
+
+#define IN_T CONCAT2E(CARD,INVNC)
+#define OUT_T CONCAT2E(CARD,OUTVNC)
+#define rfbTranslateWithSingleTableINVNCtoOUTVNC \
+				CONCAT4E(rfbTranslateWithSingleTable,INVNC,to,OUTVNC)
+#define rfbTranslateWithRGBTablesINVNCtoOUTVNC \
+				CONCAT4E(rfbTranslateWithRGBTables,INVNC,to,OUTVNC)
+
+/*
+ * rfbTranslateWithSingleTableINVNCtoOUTVNC translates a rectangle of pixel data
+ * using a single lookup table.
+ */
+
+static void
+rfbTranslateWithSingleTableINVNCtoOUTVNC (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--;
+    }
+}
+
+
+/*
+ * rfbTranslateWithRGBTablesINVNCtoOUTVNC translates a rectangle of pixel data
+ * using three separate lookup tables for the red, green and blue values.
+ */
+
+static void
+rfbTranslateWithRGBTablesINVNCtoOUTVNC (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 rfbTranslateWithSingleTableINVNCtoOUTVNC
+#undef rfbTranslateWithRGBTablesINVNCtoOUTVNC
diff --git a/ica/win32/winvnc/winvnc/translate.cpp b/ica/win32/winvnc/winvnc/translate.cpp
new file mode 100644
index 0000000..d13854d
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/translate.cpp
@@ -0,0 +1,184 @@
+/*
+ * translate.c - translate between different pixel formats
+ */
+
+/*
+ *  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 "stdhdrs.h"
+
+#include "translate.h"
+#include <stdio.h>
+#include "rfb.h"
+#include "vncOSVersion.h"
+
+#define CONCAT2(a,b) a##b
+#define CONCAT2E(a,b) CONCAT2(a,b)
+#define CONCAT4(a,b,c,d) a##b##c##d
+#define CONCAT4E(a,b,c,d) CONCAT4(a,b,c,d)
+
+#define OUTVNC 8
+#include "tableinittctemplate.cpp"
+#include "tableinitcmtemplate.cpp"
+#define INVNC 8
+#include "tabletranstemplate.cpp"
+#undef INVNC
+#define INVNC 16
+#include "tabletranstemplate.cpp"
+#undef INVNC
+#define INVNC 32
+#include "tabletranstemplate.cpp"
+#undef INVNC
+#undef OUTVNC
+
+#define OUTVNC 16
+#include "tableinittctemplate.cpp"
+#include "tableinitcmtemplate.cpp"
+#define INVNC 8
+#include "tabletranstemplate.cpp"
+#undef INVNC
+#define INVNC 16
+#include "tabletranstemplate.cpp"
+#undef INVNC
+#define INVNC 32
+#include "tabletranstemplate.cpp"
+#undef INVNC
+#undef OUTVNC
+
+#define OUTVNC 32
+#include "tableinittctemplate.cpp"
+#include "tableinitcmtemplate.cpp"
+#define INVNC 8
+#include "tabletranstemplate.cpp"
+#undef INVNC
+#define INVNC 16
+#include "tabletranstemplate.cpp"
+#undef INVNC
+#define INVNC 32
+#include "tabletranstemplate.cpp"
+#undef INVNC
+#undef OUTVNC
+
+rfbInitTableFnType rfbInitTrueColourSingleTableFns[3] = {
+    rfbInitTrueColourSingleTable8,
+    rfbInitTrueColourSingleTable16,
+    rfbInitTrueColourSingleTable32
+};
+
+rfbInitTableFnType rfbInitColourMapSingleTableFns[3] = {
+    rfbInitColourMapSingleTable8,
+    rfbInitColourMapSingleTable16,
+    rfbInitColourMapSingleTable32
+};
+
+rfbInitTableFnType rfbInitTrueColourRGBTablesFns[3] = {
+    rfbInitTrueColourRGBTables8,
+    rfbInitTrueColourRGBTables16,
+    rfbInitTrueColourRGBTables32
+};
+
+rfbTranslateFnType rfbTranslateWithSingleTableFns[3][3] = {
+    { rfbTranslateWithSingleTable8to8,
+      rfbTranslateWithSingleTable8to16,
+      rfbTranslateWithSingleTable8to32 },
+    { rfbTranslateWithSingleTable16to8,
+      rfbTranslateWithSingleTable16to16,
+      rfbTranslateWithSingleTable16to32 },
+    { rfbTranslateWithSingleTable32to8,
+      rfbTranslateWithSingleTable32to16,
+      rfbTranslateWithSingleTable32to32 }
+};
+
+rfbTranslateFnType rfbTranslateWithRGBTablesFns[3][3] = {
+    { rfbTranslateWithRGBTables8to8,
+      rfbTranslateWithRGBTables8to16,
+      rfbTranslateWithRGBTables8to32 },
+    { rfbTranslateWithRGBTables16to8,
+      rfbTranslateWithRGBTables16to16,
+      rfbTranslateWithRGBTables16to32 },
+    { rfbTranslateWithRGBTables32to8,
+      rfbTranslateWithRGBTables32to16,
+      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 >> 3);
+
+    while (height > 0) {
+	memcpy(optr, iptr, bytesPerOutputLine);
+	iptr += bytesBetweenInputLines;
+	optr += bytesPerOutputLine;
+	--height;
+    }
+}
+
+
+
+HDC GetDcMirror()
+{
+typedef BOOL (WINAPI* pEnumDisplayDevices)(PVOID,DWORD,PVOID,DWORD);
+		HDC m_hrootdc=NULL;
+		pEnumDisplayDevices pd=NULL;
+		LPSTR driverName = "mv video hook driver2";
+		BOOL DriverFound;
+		DEVMODE devmode;
+		FillMemory(&devmode, sizeof(DEVMODE), 0);
+		devmode.dmSize = sizeof(DEVMODE);
+		devmode.dmDriverExtra = 0;
+		/*BOOL change = */EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&devmode);
+		devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+		HMODULE hUser32=LoadLibrary("USER32");
+		if (hUser32) pd = (pEnumDisplayDevices)GetProcAddress( hUser32, "EnumDisplayDevicesA");
+		if (pd)
+			{
+				LPSTR deviceName=NULL;
+				DISPLAY_DEVICE dd;
+				ZeroMemory(&dd, sizeof(dd));
+				dd.cb = sizeof(dd);
+				devmode.dmDeviceName[0] = '\0';
+				INT devNum = 0;
+				BOOL result;
+				DriverFound=false;
+				while ((result = (*pd)(NULL,devNum, &dd,0)))
+				{
+					if (strcmp((const char *)&dd.DeviceString[0], driverName) == 0)
+					{
+					DriverFound=true;
+					break;
+					}
+					devNum++;
+				}
+				if (DriverFound)
+				{
+				deviceName = (LPSTR)&dd.DeviceName[0];
+				m_hrootdc = CreateDC("DISPLAY",deviceName,NULL,NULL);	
+				}
+			}
+		if (hUser32) FreeLibrary(hUser32);
+
+		return m_hrootdc;
+}
diff --git a/ica/win32/winvnc/winvnc/translate.h b/ica/win32/winvnc/winvnc/translate.h
new file mode 100644
index 0000000..30a095b
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/translate.h
@@ -0,0 +1,81 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+/* translate.h - prototypes of functions in translate.cpp */
+
+#ifndef TRANSLATE_H__
+#define TRANSLATE_H__
+
+#include "stdhdrs.h"
+#include "rfb.h"
+#include "vncmemcpy.h"
+
+// Translate function prototype!
+typedef void (*rfbTranslateFnType)(char *table, rfbPixelFormat *in,
+				   rfbPixelFormat *out,
+				   char *iptr, char *optr,
+				   int bytesBetweenInputLines,
+				   int width, int height);
+
+// Init function prototype!
+typedef void (*rfbInitTableFnType)(char **table, rfbPixelFormat *in,
+				   rfbPixelFormat *out);
+
+
+// External translation stuff
+extern void rfbTranslateNone(char *table, rfbPixelFormat *in,
+			     rfbPixelFormat *out,
+			     char *iptr, char *optr,
+			     int bytesBetweenInputLines,
+			     int width, int height);
+
+extern HDC GetDcMirror();
+
+// Macro to compare pixel formats.
+#define PF_EQ(x,y)												\
+	((x.bitsPerPixel == y.bitsPerPixel) &&						\
+	 (x.depth == y.depth) &&									\
+	 (x.trueColour == y.trueColour) &&							\
+	 ((x.bigEndian == y.bigEndian) || (x.bitsPerPixel == 8)) &&	\
+	 (!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))))
+
+// Translation functions themselves
+extern rfbInitTableFnType rfbInitTrueColourSingleTableFns[];
+extern rfbInitTableFnType rfbInitColourMapSingleTableFns[];
+extern rfbInitTableFnType rfbInitTrueColourRGBTablesFns[];
+extern rfbTranslateFnType rfbTranslateWithSingleTableFns[3][3];
+extern rfbTranslateFnType rfbTranslateWithRGBTablesFns[3][3];
+/*
+extern Bool rfbSetTranslateFunction(rfbClientPtr cl);
+extern void rfbSetClientColourMaps(int firstColour, int nColours);
+extern Bool rfbSetClientColourMap(rfbClientPtr cl, int firstColour,
+				  int nColours);
+*/
+
+#endif
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/videodriver.cpp b/ica/win32/winvnc/winvnc/videodriver.cpp
new file mode 100644
index 0000000..215919c
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/videodriver.cpp
@@ -0,0 +1,977 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "stdhdrs.h"
+#include "videodriver.h"
+#include <strsafe.h>
+LPSTR driverName = "mv video hook driver2";
+
+#define MAP1 1030
+#define UNMAP1 1031
+#define CURSOREN 1060
+#define CURSORDIS 1061
+
+VIDEODRIVER::VIDEODRIVER()
+{
+	mypVideoMemory=NULL;
+	mypchangebuf=NULL;
+	myframebuffer=NULL;
+	shared_buffer_size=0;
+}
+
+void
+VIDEODRIVER::VIDEODRIVER_start(int x,int y,int w,int h)
+{
+	blocked=true;
+	oldaantal=1;
+	mypVideoMemory=NULL;
+	OSVER=OSVersion();
+	if (OSVER==OSWIN2000|| OSVER==OSWINXP64)
+	{
+		if (Mirror_driver_attach_XP(x,y,w,h))
+		{
+			if (GetDcMirror()!=NULL)
+			{
+			mypVideoMemory=VideoMemory_GetSharedMemory();
+			mypchangebuf=(PCHANGES_BUF)mypVideoMemory;
+			myframebuffer=mypVideoMemory+sizeof(CHANGES_BUF);
+			}
+			else
+			{
+				mypVideoMemory=NULL;
+			}
+		}
+		else
+		{
+			mypVideoMemory=NULL;
+		}
+	}
+	if (OSVER==OSVISTA)
+	{
+		if (Mirror_driver_Vista(1,x,y,w,h))
+		{
+			if (GetDcMirror()!=NULL)
+			{
+			mypVideoMemory=VideoMemory_GetSharedMemory();
+			mypchangebuf=(PCHANGES_BUF)mypVideoMemory;
+			myframebuffer=mypVideoMemory+sizeof(CHANGES_BUF);
+			//if (mypVideoMemory==NULL) MessageBoxSecure(NULL,"MVideo driver failed", NULL, MB_OK);
+			}
+			else
+			{
+	//			MessageBoxSecure(NULL,"Video driver failed", NULL, MB_OK);
+////////////////////////////////////////////////////////////////////////////////
+				if (Mirror_driver_attach_XP(x,y,w,h))
+					{
+						if (GetDcMirror()!=NULL)
+						{
+						mypVideoMemory=VideoMemory_GetSharedMemory();
+						mypchangebuf=(PCHANGES_BUF)mypVideoMemory;
+						myframebuffer=mypVideoMemory+sizeof(CHANGES_BUF);
+						}
+						else
+						{
+							mypVideoMemory=NULL;
+						}
+					}
+					else
+					{
+						mypVideoMemory=NULL;
+					}
+////////////////////////////////////////////////////////////////////////////////
+				//mypVideoMemory=NULL;
+			}
+		}
+		else
+		{
+			mypVideoMemory=NULL;
+		}
+	}
+	blocked=false;
+}
+
+void
+VIDEODRIVER::VIDEODRIVER_Stop()
+{
+	OSVER=OSVersion();
+	if (OSVER==OSWIN2000||OSVER==OSWINXP64)
+	{
+		Mirror_driver_detach_XP();
+		if (mypVideoMemory!=NULL) VideoMemory_ReleaseSharedMemory(mypVideoMemory);
+	}
+	if (OSVER==OSVISTA)
+	{
+		Mirror_driver_Vista(0,0,0,0,0);
+		if (mypVideoMemory!=NULL) VideoMemory_ReleaseSharedMemory(mypVideoMemory);
+	}
+	mypVideoMemory=NULL;
+	mypchangebuf=NULL;
+	myframebuffer=NULL;
+
+
+}
+
+
+VIDEODRIVER::~VIDEODRIVER()
+{
+	//mypVideoMemory=NULL;
+	OSVER=OSVersion();
+	if (OSVER==OSWIN2000|| OSVER==OSWINXP64)
+	{
+		Mirror_driver_detach_XP();
+		if (mypVideoMemory!=NULL) VideoMemory_ReleaseSharedMemory(mypVideoMemory);
+	}
+	if (OSVER==OSVISTA)
+	{
+		Mirror_driver_Vista(0,0,0,0,0);
+		if (mypVideoMemory!=NULL) VideoMemory_ReleaseSharedMemory(mypVideoMemory);
+	}
+
+}
+
+void VIDEODRIVER::VideoMemory_ReleaseSharedMemory(PCHAR pVideoMemory)
+{
+    UnmapViewOfFile(pVideoMemory);
+}
+
+PCHAR VIDEODRIVER::VideoMemory_GetSharedMemory(void)
+{
+   PCHAR pVideoMemory=NULL;
+   HANDLE hMapFile, hFile, hFile0,hFile1;
+   hFile=NULL;
+   
+   hFile0 = CreateFile("c:\\video0.dat", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
+   hFile1 = CreateFile("c:\\video1.dat", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
+
+   if ((hFile0 && hFile0 != INVALID_HANDLE_VALUE) && !(hFile1 && hFile1 != INVALID_HANDLE_VALUE)) hFile=hFile0;
+   if ((hFile1 && hFile1 != INVALID_HANDLE_VALUE) && !(hFile0 && hFile0 != INVALID_HANDLE_VALUE)) hFile=hFile1;
+   if ((hFile0 && hFile0 != INVALID_HANDLE_VALUE) && (hFile1 && hFile1 != INVALID_HANDLE_VALUE))
+   {
+	   DWORD size0=GetFileSize(hFile0,NULL);
+	   DWORD size1=GetFileSize(hFile1,NULL);
+	   if (size0==shared_buffer_size) hFile=hFile0;
+	   if (size1==shared_buffer_size) hFile=hFile1;
+	    if (size1==shared_buffer_size && size0==shared_buffer_size)
+		{
+			//find last modification time
+			FILETIME createt0, lastWriteTime0, lastAccessTime0;
+			GetFileTime( hFile0, &createt0, &lastAccessTime0, &lastWriteTime0);
+			FILETIME createt1, lastWriteTime1, lastAccessTime1;
+			GetFileTime( hFile0, &createt1, &lastAccessTime1, &lastWriteTime1);
+			LONG result=CompareFileTime(&lastWriteTime0,&lastWriteTime1);
+			if (result==0 || result== 1) hFile=hFile0;
+			else hFile=hFile1;
+
+		}
+
+   }
+
+
+   if(hFile && hFile != INVALID_HANDLE_VALUE)
+   {
+       hMapFile = CreateFileMapping(hFile, NULL, PAGE_READWRITE, 0, 0, NULL);
+
+       if(hMapFile && hMapFile != INVALID_HANDLE_VALUE)
+       {
+           pVideoMemory = (char *) MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, 0);
+    
+           CloseHandle(hMapFile);
+       }
+
+       CloseHandle(hFile);
+   }
+   else
+   {
+	   vnclog.Print(LL_INTERR, VNCLOG("Error video.dat \n")); 
+   }
+   
+   return pVideoMemory;
+}
+
+bool
+VIDEODRIVER::Mirror_driver_Vista(DWORD dwAttach,int x,int y,int w,int h)
+{
+	HDESK   hdeskInput=NULL;
+    HDESK   hdeskCurrent=NULL;
+	pEnumDisplayDevices pd=NULL;
+	HMODULE hUser32=LoadLibrary("USER32");
+	if (hUser32) pd = (pEnumDisplayDevices)GetProcAddress( hUser32, "EnumDisplayDevicesA");
+	if (!pd) return false;
+    BOOL  bED   = TRUE;
+    DEVMODE devmode;
+
+    FillMemory(&devmode, sizeof(DEVMODE), 0);
+    devmode.dmSize = sizeof(DEVMODE);
+    devmode.dmDriverExtra = 0;
+
+    // Make sure we have a display on this thread.
+    BOOL change = EnumDisplaySettings(NULL,
+                                      ENUM_CURRENT_SETTINGS,
+                                      &devmode);
+
+    devmode.dmFields = DM_BITSPERPEL |
+                       DM_PELSWIDTH | 
+                       DM_PELSHEIGHT |
+                       DM_POSITION ;
+
+    if (change) 
+    {
+        // query all display devices in the system until we hit a primary
+        // display device. Using it get the width and height of the primary
+        // so we can use that for the mirror driver. Also enumerate the
+        // display devices installed on this machine untill we hit
+        // our favourate mirrored driver, then extract the device name string
+        // of the format '\\.\DISPLAY#'
+//		MessageBoxSecure(NULL, "change ok", NULL, MB_OK);
+   
+        DISPLAY_DEVICE dispDevice;
+   
+        FillMemory(&dispDevice, sizeof(DISPLAY_DEVICE), 0);
+   
+        dispDevice.cb = sizeof(DISPLAY_DEVICE);
+   
+        LPSTR deviceName = NULL;
+
+        devmode.dmDeviceName[0] = '\0';
+
+        INT devNum = 0;
+        BOOL result;
+        DWORD cxPrimary = 0xFFFFFFFF;
+        DWORD cyPrimary = 0xFFFFFFFF;
+
+        // First enumerate for Primary display device:
+        while ((result = (*pd)(NULL,
+                                devNum,
+                                &dispDevice,
+                                0)))
+        {
+//          MessageBoxSecure(NULL, &dispDevice.DeviceString[0], NULL, MB_OK);
+          if (dispDevice.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
+          {
+              // Primary device. Find out its dmPelsWidht and dmPelsHeight.
+              EnumDisplaySettings(dispDevice.DeviceName,
+                                  ENUM_CURRENT_SETTINGS,
+                                  &devmode);
+
+              cxPrimary = devmode.dmPelsWidth;
+              cyPrimary = devmode.dmPelsHeight;
+              break;
+          }
+          devNum++;
+        }
+#if defined(MIRROR_24)
+		if (devmode.dmBitsPerPel == 24)
+			devmode.dmBitsPerPel = 32;
+#endif
+		if (devmode.dmBitsPerPel!=8 && devmode.dmBitsPerPel!=16 && devmode.dmBitsPerPel!=32) 
+		{
+			if (hUser32) FreeLibrary(hUser32);
+			return false;
+		}
+		shared_buffer_size=devmode.dmBitsPerPel/8*w*h+sizeof(CHANGES_BUF);
+
+        // error check
+        if (!result)
+        {
+//           MessageBoxSecure(NULL,  driverName, NULL, MB_OK);
+		   if (hUser32) FreeLibrary(hUser32);
+           return false;
+        }
+
+        if (cxPrimary == 0xffffffff || cyPrimary == 0xffffffff)
+        {
+//             MessageBoxSecure(NULL,"cxPrimary or cyPrimary not valid", NULL, MB_OK);
+			if (hUser32) FreeLibrary(hUser32);
+            return false;
+        }
+
+        // Enumerate again for the mirror driver:
+        devNum = 0;
+        while ((result = (*pd)(NULL,
+                                  devNum,
+                                  &dispDevice,
+                                  0)))
+        {
+          if (strcmp(&dispDevice.DeviceString[0], driverName) == 0)
+              break;
+
+           devNum++;
+        }
+
+        // error check       
+        if (!result)
+        {
+//          MessageBoxSecure(NULL,driverName, NULL, MB_OK);
+		   if (hUser32) FreeLibrary(hUser32);
+           return false;
+        }
+
+//        printf("DevNum:%d\nName:%s\nString:%s\nID:%s\nKey:%s\n\n",
+//               devNum,
+//               &dispDevice.DeviceName[0],
+//               &dispDevice.DeviceString[0],
+//               &dispDevice.DeviceID[0],
+//               &dispDevice.DeviceKey[0]);
+
+        CHAR deviceNum[MAX_PATH];
+        LPSTR deviceSub;
+
+        // Simply extract 'DEVICE#' from registry key.  This will depend
+        // on how many mirrored devices your driver has and which ones
+        // you intend to use.
+
+        _strupr(&dispDevice.DeviceKey[0]);
+
+        deviceSub = strstr(&dispDevice.DeviceKey[0],
+                           "\\DEVICE");
+
+        if (!deviceSub) 
+            StringCbCopy(&deviceNum[0], sizeof(deviceNum), "DEVICE0");
+        else
+            StringCbCopy(&deviceNum[0], sizeof(deviceNum), ++deviceSub);
+
+        // Reset the devmode for mirror driver use:
+		int depth=devmode.dmBitsPerPel;
+        FillMemory(&devmode, sizeof(DEVMODE), 0);
+        devmode.dmSize = sizeof(DEVMODE);
+        devmode.dmDriverExtra = 0;
+		devmode.dmBitsPerPel=depth;
+
+        devmode.dmFields = DM_BITSPERPEL |
+                           DM_PELSWIDTH | 
+                           DM_PELSHEIGHT |
+                           DM_POSITION;
+
+        StringCbCopy((LPSTR)&devmode.dmDeviceName[0], sizeof(devmode.dmDeviceName), "mv2");
+        deviceName = (LPSTR)&dispDevice.DeviceName[0];
+
+        if (bED)
+        {
+            // Attach and detach information is sent via the dmPelsWidth/Height
+            // of the devmode.
+            //
+//			MessageBoxSecure(NULL,"bED", NULL, MB_OK);
+            if (dwAttach == 0)
+            {
+                devmode.dmPelsWidth = 0;
+                devmode.dmPelsHeight = 0;
+            }
+            else
+            {
+                devmode.dmPelsWidth=w;
+				devmode.dmPelsHeight=h;
+				devmode.dmPosition.x=x;
+				devmode.dmPosition.y=y;
+            }
+            // Update the mirror device's registry data with the devmode. Dont
+            // do a mode change.
+			
+/////////////////////////
+				hdeskCurrent = GetThreadDesktop(GetCurrentThreadId());
+				if (hdeskCurrent != NULL)
+					{
+						hdeskInput = OpenInputDesktop(0, FALSE, MAXIMUM_ALLOWED);
+						if (hdeskInput != NULL)
+							{
+								SetThreadDesktop(hdeskInput);
+							}
+					}
+
+
+				INT code =
+            ChangeDisplaySettingsEx(deviceName,
+                                    &devmode, 
+                                    NULL,
+                                    (CDS_UPDATEREGISTRY | CDS_RESET|CDS_GLOBAL),
+                                    NULL
+                                    );
+//            GetDispCode(code);
+			if (code!=0) 
+			{
+				if (hUser32) FreeLibrary(hUser32);
+				return false;
+			}
+            // Now do the real mode change to take mirror driver changes into
+            // effect.
+            code = ChangeDisplaySettingsEx(NULL,
+                                           NULL,
+                                           NULL,
+                                           0,
+                                           NULL);
+
+			if (hdeskCurrent) SetThreadDesktop(hdeskCurrent);
+			if (hdeskInput) CloseDesktop(hdeskInput);
+
+			if (code!=0)
+			{
+				if (hUser32) FreeLibrary(hUser32);
+				return false;
+			}
+			if (hUser32) FreeLibrary(hUser32);
+			return true;
+        }
+		if (hUser32) FreeLibrary(hUser32);
+		return false;
+	}
+	if (hUser32) FreeLibrary(hUser32);
+	return false;
+}
+
+
+
+void
+VIDEODRIVER::Mirror_driver_detach_XP()
+{
+	HDESK   hdeskInput=NULL;
+    HDESK   hdeskCurrent=NULL;
+	pEnumDisplayDevices pd=NULL;
+	HMODULE hUser32=LoadLibrary("USER32");
+	if (hUser32) pd = (pEnumDisplayDevices)GetProcAddress( hUser32, "EnumDisplayDevicesA");
+	if (!pd) return;
+	DEVMODE devmode;
+
+    FillMemory(&devmode, sizeof(DEVMODE), 0);
+
+    devmode.dmSize = sizeof(DEVMODE);
+    devmode.dmDriverExtra = 0;
+
+    BOOL change = EnumDisplaySettings(NULL,
+                                      ENUM_CURRENT_SETTINGS,
+                                      &devmode);
+
+    devmode.dmFields = DM_BITSPERPEL |
+                       DM_PELSWIDTH | 
+                       DM_PELSHEIGHT;
+
+    if (change) 
+    {
+        // query all display devices in the system until we hit
+        // our favourate mirrored driver, then extract the device name string
+        // of the format '\\.\DISPLAY#'
+       
+        DISPLAY_DEVICE dispDevice;
+       
+        FillMemory(&dispDevice, sizeof(DISPLAY_DEVICE), 0);
+       
+        dispDevice.cb = sizeof(DISPLAY_DEVICE);
+       
+        LPSTR deviceName = NULL;
+
+        devmode.dmDeviceName[0] = '\0';
+
+        INT devNum = 0;
+        BOOL result;
+
+        while ((result = (*pd)(NULL,
+                                  devNum,
+                                  &dispDevice,
+                                  0)))
+        {
+          if (strcmp(&dispDevice.DeviceString[0], driverName) == 0)
+              break;
+
+           devNum++;
+        }
+       
+        if (!result)
+        {
+           printf("No '%s' found.\n", driverName);
+		   if (hUser32) FreeLibrary(hUser32);
+           return;
+        }
+
+        printf("DevNum:%d\nName:%s\nString:%s\nID:%s\nKey:%s\n\n",
+               devNum,
+               &dispDevice.DeviceName[0],
+               &dispDevice.DeviceString[0],
+               &dispDevice.DeviceID[0],
+               &dispDevice.DeviceKey[0]);
+
+        CHAR deviceNum[MAX_PATH];
+        LPSTR deviceSub;
+
+        // Simply extract 'DEVICE#' from registry key.  This will depend
+        // on how many mirrored devices your driver has and which ones
+        // you intend to use.
+
+        _strupr(&dispDevice.DeviceKey[0]);
+
+        deviceSub = strstr(&dispDevice.DeviceKey[0],
+                           "\\DEVICE");
+
+        if (!deviceSub) 
+            StringCbCopy(&deviceNum[0], sizeof(deviceNum), "DEVICE0");
+        else
+            StringCbCopy(&deviceNum[0], sizeof(deviceNum), ++deviceSub);
+        
+        // Add 'Attach.ToDesktop' setting.
+        //
+		{
+				HKEY hKeyProfileMirror = (HKEY)0;
+				if (RegCreateKey(HKEY_LOCAL_MACHINE,
+								_T("SYSTEM\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\mv2"),
+								 &hKeyProfileMirror) != ERROR_SUCCESS)
+				{
+				   if (hUser32) FreeLibrary(hUser32);
+				   return;
+				}
+
+				HKEY hKeyDevice = (HKEY)0;
+				if (RegCreateKey(hKeyProfileMirror,
+								 _T(&deviceNum[0]),
+								 &hKeyDevice) != ERROR_SUCCESS)
+				{
+				   if (hUser32) FreeLibrary(hUser32);
+				   return;
+				}
+
+				DWORD one = 0;
+				if (RegSetValueEx(hKeyDevice,
+								  _T("Attach.ToDesktop"),
+								  0,
+								  REG_DWORD,
+								  (unsigned char *)&one,
+								  4) != ERROR_SUCCESS)
+				{
+				   if (hUser32) FreeLibrary(hUser32);
+				   return;
+				}
+				RegCloseKey(hKeyProfileMirror);
+				RegCloseKey(hKeyDevice);
+		}
+		{
+				deviceSub = strstr(&dispDevice.DeviceKey[0],
+                           "SYSTEM");
+
+				HKEY hKeyProfileMirror = (HKEY)0;
+				if (RegCreateKey(HKEY_LOCAL_MACHINE,
+								_T("SYSTEM\\CurrentControlSet\\Hardware Profiles\\Current"),
+								 &hKeyProfileMirror) != ERROR_SUCCESS)
+				{
+				   if (hUser32) FreeLibrary(hUser32);
+				   return;
+				}
+
+				HKEY hKeyDevice = (HKEY)0;
+				if (RegCreateKey(hKeyProfileMirror,
+								 _T(deviceSub),
+								 &hKeyDevice) != ERROR_SUCCESS)
+				{
+				   if (hUser32) FreeLibrary(hUser32);
+				   return;
+				}
+
+				DWORD one = 0;
+				if (RegSetValueEx(hKeyDevice,
+								  _T("Attach.ToDesktop"),
+								  0,
+								  REG_DWORD,
+								  (unsigned char *)&one,
+								  4) != ERROR_SUCCESS)
+				{
+				   if (hUser32) FreeLibrary(hUser32);
+				   return;
+				}
+				RegCloseKey(hKeyProfileMirror);
+				RegCloseKey(hKeyDevice);
+		}
+
+
+        FillMemory(&devmode, sizeof(DEVMODE), 0);
+
+        devmode.dmSize = sizeof(DEVMODE);
+        devmode.dmDriverExtra = 0;
+
+        StringCbCopy((LPSTR)&devmode.dmDeviceName[0], sizeof(devmode.dmDeviceName), "mv2");
+        deviceName = (LPSTR)&dispDevice.DeviceName[0];
+		devmode.dmBitsPerPel=32;
+        // add 'Default.*' settings to the registry under above hKeyProfile\mirror\device
+		hdeskCurrent = GetThreadDesktop(GetCurrentThreadId());
+				if (hdeskCurrent != NULL)
+					{
+						hdeskInput = OpenInputDesktop(0, FALSE, MAXIMUM_ALLOWED);
+						if (hdeskInput != NULL)
+							{
+								SetThreadDesktop(hdeskInput);
+							}
+					}
+
+        INT code =
+        ChangeDisplaySettingsEx(deviceName,
+                                &devmode, 
+                                NULL,
+                                CDS_UPDATEREGISTRY,
+                                NULL
+                                );
+    
+//        GetDispCode(code);
+
+        code = ChangeDisplaySettingsEx(deviceName,
+                                &devmode, 
+                                NULL,
+                                0,
+                                NULL
+                                );
+   
+		if (hdeskCurrent) SetThreadDesktop(hdeskCurrent);
+		if (hdeskInput) CloseDesktop(hdeskInput);
+		
+	}
+if (hUser32) FreeLibrary(hUser32);
+}
+
+//BOOL
+//Activate_video_driver();
+
+bool
+VIDEODRIVER::Mirror_driver_attach_XP(int x,int y,int w,int h)
+{
+	HDESK   hdeskInput=NULL;
+    HDESK   hdeskCurrent=NULL;
+
+	pEnumDisplayDevices pd=NULL;
+	HMODULE hUser32=LoadLibrary("USER32");
+	if (hUser32) pd = (pEnumDisplayDevices)GetProcAddress( hUser32, "EnumDisplayDevicesA");
+	if (!pd) return false;
+
+	DEVMODE devmode;
+
+    FillMemory(&devmode, sizeof(DEVMODE), 0);
+
+    devmode.dmSize = sizeof(DEVMODE);
+    devmode.dmDriverExtra = 0;
+
+    BOOL change = EnumDisplaySettings(NULL,
+                                      ENUM_CURRENT_SETTINGS,
+                                      &devmode);
+
+    devmode.dmFields = DM_BITSPERPEL |
+                       DM_PELSWIDTH | 
+					   DM_POSITION |
+                       DM_PELSHEIGHT;
+
+#if defined(MIRROR_24)
+	// for 24 bit mode, have the mirror driver use 32 bit.
+	if (devmode.dmBitsPerPel == 24)
+		devmode.dmBitsPerPel = 32;
+#endif
+	if (devmode.dmBitsPerPel!=8 && devmode.dmBitsPerPel!=16 && devmode.dmBitsPerPel!=32)
+	{
+		if (hUser32) FreeLibrary(hUser32);
+		return false;
+	}
+
+	shared_buffer_size=devmode.dmBitsPerPel/8*w*h+sizeof(CHANGES_BUF);
+
+    if (change) 
+    {
+        // query all display devices in the system until we hit
+        // our favourate mirrored driver, then extract the device name string
+        // of the format '\\.\DISPLAY#'
+       
+        DISPLAY_DEVICE dispDevice;
+       
+        FillMemory(&dispDevice, sizeof(DISPLAY_DEVICE), 0);
+       
+        dispDevice.cb = sizeof(DISPLAY_DEVICE);
+       
+        LPSTR deviceName = NULL;
+
+        devmode.dmDeviceName[0] = '\0';
+
+        INT devNum = 0;
+        BOOL result;
+
+        while ((result = (*pd)(NULL,
+                                  devNum,
+                                  &dispDevice,
+                                  0)))
+        {
+          if (strcmp(&dispDevice.DeviceString[0], driverName) == 0)
+              break;
+
+           devNum++;
+        }
+       
+        if (!result)
+        {
+           printf("No '%s' found.\n", driverName);
+		   if (hUser32) FreeLibrary(hUser32);
+           return false;
+        }
+
+        printf("DevNum:%d\nName:%s\nString:%s\nID:%s\nKey:%s\n\n",
+               devNum,
+               &dispDevice.DeviceName[0],
+               &dispDevice.DeviceString[0],
+               &dispDevice.DeviceID[0],
+               &dispDevice.DeviceKey[0]);
+
+        CHAR deviceNum[MAX_PATH];
+        LPSTR deviceSub;
+
+        // Simply extract 'DEVICE#' from registry key.  This will depend
+        // on how many mirrored devices your driver has and which ones
+        // you intend to use.
+
+        _strupr(&dispDevice.DeviceKey[0]);
+
+        deviceSub = strstr(&dispDevice.DeviceKey[0],
+                           "\\DEVICE");
+
+        if (!deviceSub) 
+            StringCbCopy(&deviceNum[0], MAX_PATH, "DEVICE0");
+        else
+            StringCbCopy(&deviceNum[0], MAX_PATH, ++deviceSub);
+        
+        // Add 'Attach.ToDesktop' setting.
+        //
+
+        HKEY hKeyProfileMirror = (HKEY)0;
+        if (RegCreateKey(HKEY_LOCAL_MACHINE,
+                        _T("SYSTEM\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\mv2"),
+                         &hKeyProfileMirror) != ERROR_SUCCESS)
+        {
+		   if (hUser32) FreeLibrary(hUser32);
+           return false;
+        }
+
+        HKEY hKeyDevice = (HKEY)0;
+        if (RegCreateKey(hKeyProfileMirror,
+                         _T(&deviceNum[0]),
+                         &hKeyDevice) != ERROR_SUCCESS)
+        {
+		   if (hUser32) FreeLibrary(hUser32);
+           return false;
+        }
+
+        DWORD one = 1;
+        if (RegSetValueEx(hKeyDevice,
+                          _T("Attach.ToDesktop"),
+                          0,
+                          REG_DWORD,
+                          (unsigned char *)&one,
+                          4) != ERROR_SUCCESS)
+        {
+		   if (hUser32) FreeLibrary(hUser32);
+           return false;
+        }
+		int depth=devmode.dmBitsPerPel;
+
+        FillMemory(&devmode, sizeof(DEVMODE), 0);
+
+        devmode.dmSize = sizeof(DEVMODE);
+        devmode.dmDriverExtra = 0;
+
+        StringCbCopy((LPSTR)&devmode.dmDeviceName[0], 32, "mv2");
+
+        devmode.dmFields = DM_BITSPERPEL |
+                           DM_PELSWIDTH | 
+		    			   DM_POSITION |
+                           DM_PELSHEIGHT;
+        deviceName = (LPSTR)&dispDevice.DeviceName[0];
+		devmode.dmPelsWidth=w;
+		devmode.dmPelsHeight=h;
+		devmode.dmPosition.x=x;
+		devmode.dmPosition.y=y;
+		devmode.dmBitsPerPel=depth;
+
+		hdeskCurrent = GetThreadDesktop(GetCurrentThreadId());
+				if (hdeskCurrent != NULL)
+					{
+						hdeskInput = OpenInputDesktop(0, FALSE, MAXIMUM_ALLOWED);
+						if (hdeskInput != NULL)
+							{
+								SetThreadDesktop(hdeskInput);
+							}
+					}
+
+        // add 'Default.*' settings to the registry under above hKeyProfile\mirror\device
+        INT code =
+        ChangeDisplaySettingsEx(deviceName,
+                                &devmode, 
+                                NULL,
+                                CDS_UPDATEREGISTRY,
+                                NULL
+                                );
+    
+//        GetDispCode(code);
+		if (code!=0) 
+		{
+			if (hUser32) FreeLibrary(hUser32);
+			return false;
+		}
+        code = ChangeDisplaySettingsEx(deviceName,
+                                &devmode, 
+                                NULL,
+                                0,
+                                NULL
+                                );
+   
+		if (hdeskCurrent)SetThreadDesktop(hdeskCurrent);
+		if (hdeskInput)CloseDesktop(hdeskInput);
+
+		RegCloseKey(hKeyProfileMirror);
+        RegCloseKey(hKeyDevice);
+		if (code!=0)
+		{
+			if (hUser32) FreeLibrary(hUser32);
+			return false;
+		}
+		if (hUser32) FreeLibrary(hUser32);
+		return true;
+	}
+	if (hUser32) FreeLibrary(hUser32);
+	return false;
+}
+
+int
+VIDEODRIVER::OSVersion()
+{
+   OSVERSIONINFOEX osvi;
+   SYSTEM_INFO si;
+   PGNSI pGNSI;
+   BOOL bOsVersionInfoEx;
+
+   ZeroMemory(&si, sizeof(SYSTEM_INFO));
+   ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
+   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+   if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) )
+   {
+      osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+      if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) ) 
+         return FALSE;
+   }
+   pGNSI = (PGNSI) GetProcAddress(
+      GetModuleHandle(TEXT("kernel32.dll")), 
+      "GetNativeSystemInfo");
+   if(NULL != pGNSI)
+      pGNSI(&si);
+   else GetSystemInfo(&si);
+
+	switch (osvi.dwPlatformId)
+   {
+      case VER_PLATFORM_WIN32_NT:
+
+      // Test for the specific product.
+
+      if ( osvi.dwMajorVersion == 6)
+      {
+         return OSVISTA;
+      }
+
+      if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
+      {
+         if( osvi.wProductType == VER_NT_WORKSTATION &&
+                   si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64)
+         {
+            return OSWINXP64;
+         }
+         else return OSWIN2003;
+      }
+
+      if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )
+         return OSWINXP;
+
+      if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )
+         return OSWIN2000;
+
+      if ( osvi.dwMajorVersion <= 4 )
+         return OSOLD;
+
+	}
+	return OSOLD;
+}
+
+
+HDC
+VIDEODRIVER::GetDcMirror()
+{
+typedef BOOL (WINAPI* pEnumDisplayDevices)(PVOID,DWORD,PVOID,DWORD);
+		HDC m_hrootdc=NULL;
+		pEnumDisplayDevices pd=NULL;
+		LPSTR driverName = "mv video hook driver2";
+		BOOL DriverFound;
+		DEVMODE devmode;
+		FillMemory(&devmode, sizeof(DEVMODE), 0);
+		devmode.dmSize = sizeof(DEVMODE);
+		devmode.dmDriverExtra = 0;
+		/*BOOL change = */EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&devmode);
+		devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+		HMODULE hUser32=LoadLibrary("USER32");
+		if (hUser32) pd = (pEnumDisplayDevices)GetProcAddress( hUser32, "EnumDisplayDevicesA");
+		if (pd)
+			{
+				LPSTR deviceName=NULL;
+				DISPLAY_DEVICE dd;
+				ZeroMemory(&dd, sizeof(dd));
+				dd.cb = sizeof(dd);
+				devmode.dmDeviceName[0] = '\0';
+				INT devNum = 0;
+				BOOL result;
+				DriverFound=false;
+				while ((result = (*pd)(NULL,devNum, &dd,0)))
+				{
+					if (strcmp((const char *)&dd.DeviceString[0], driverName) == 0)
+					{
+					DriverFound=true;
+					break;
+					}
+					devNum++;
+				}
+				if (DriverFound)
+				{
+				deviceName = (LPSTR)&dd.DeviceName[0];
+				m_hrootdc = CreateDC("DISPLAY",deviceName,NULL,NULL);	
+				if (m_hrootdc) DeleteDC(m_hrootdc);
+				}
+			}
+		if (hUser32) FreeLibrary(hUser32);
+
+		return m_hrootdc;
+}
+
+BOOL
+VIDEODRIVER:: HardwareCursor()
+{
+	HDC gdc;
+	int returnvalue;
+	gdc = GetDC(NULL);
+	returnvalue= ExtEscape(gdc, MAP1, 0, NULL, 0, NULL);
+	returnvalue= ExtEscape(gdc, CURSOREN, 0, NULL, 0, NULL);
+	ReleaseDC(NULL,gdc);
+	return true;
+}
+
+BOOL
+VIDEODRIVER:: NoHardwareCursor()
+{
+	HDC gdc;
+	int returnvalue;
+	gdc = GetDC(NULL);
+	returnvalue= ExtEscape(gdc, CURSORDIS, 0, NULL, 0, NULL);
+	ReleaseDC(NULL,gdc);
+	return true;
+}
+
diff --git a/ica/win32/winvnc/winvnc/videodriver.h b/ica/win32/winvnc/winvnc/videodriver.h
new file mode 100644
index 0000000..57fec0b
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/videodriver.h
@@ -0,0 +1,103 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#ifndef _VIDEOD_H
+#define _VIDEOD_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <windows.h>
+
+#include <tchar.h>
+#include <winbase.h>
+#include <winreg.h>
+//#include <StrSafe.h>
+
+#define MAXCHANGES_BUF 2000
+
+#define OSVISTA 6
+#define OSWINXP 5
+#define OSWIN2000 5
+#define OSWIN2003 5
+#define OSOLD 4
+#define OSWINXP64 7
+
+#define SCREEN_SCREEN 11
+#define BLIT 12
+#define SOLIDFILL 13
+#define BLEND 14
+#define TRANS 15
+#define PLG 17
+#define TEXTOUT 18
+
+typedef BOOL (WINAPI* pEnumDisplayDevices)(PVOID,DWORD,PVOID,DWORD);
+typedef LONG (WINAPI* pChangeDisplaySettingsExA)(LPCSTR,LPDEVMODEA,HWND,DWORD,LPVOID);
+typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
+typedef struct _CHANGES_RECORD
+{
+	ULONG type;  //screen_to_screen, blit, newcache,oldcache
+	RECT rect;	
+	POINT point;
+}CHANGES_RECORD;
+typedef CHANGES_RECORD *PCHANGES_RECORD;
+typedef struct _CHANGES_BUF
+	{
+	 ULONG counter;
+	 CHANGES_RECORD pointrect[MAXCHANGES_BUF];
+	}CHANGES_BUF;
+typedef CHANGES_BUF *PCHANGES_BUF;
+
+class VIDEODRIVER
+{
+public:
+	VIDEODRIVER();
+	void VIDEODRIVER_start(int x,int y,int w,int h);
+	void VIDEODRIVER_Stop();
+	virtual ~VIDEODRIVER();
+	BOOL HardwareCursor();
+	BOOL NoHardwareCursor();
+
+	ULONG oldaantal;
+	PCHAR mypVideoMemory;
+	PCHAR myframebuffer;
+	PCHANGES_BUF mypchangebuf;
+	BOOL blocked;
+	DWORD shared_buffer_size;
+	
+
+protected:
+	int OSVersion();
+	bool Mirror_driver_attach_XP(int x,int y,int w,int h);
+	void Mirror_driver_detach_XP();
+	bool Mirror_driver_Vista(DWORD dwAttach,int x,int y,int w,int h);
+	PCHAR VideoMemory_GetSharedMemory(void);
+	void VideoMemory_ReleaseSharedMemory(PCHAR pVideoMemory);
+	HDC GetDcMirror();
+
+	int OSVER;
+	
+};
+
+#endif
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/videodrivercheck.cpp b/ica/win32/winvnc/winvnc/videodrivercheck.cpp
new file mode 100644
index 0000000..233ab74
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/videodrivercheck.cpp
@@ -0,0 +1,177 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include <windows.h>
+#include <stdlib.h>
+#include "vncOSVersion.h"
+
+DWORD MessageBoxSecure(HWND hWnd,LPCTSTR lpText,LPCTSTR lpCaption,UINT uType);
+typedef BOOL (WINAPI* pEnumDisplayDevices)(PVOID,DWORD,PVOID,DWORD);
+
+/*bool CheckDriver2(void)
+{
+	SC_HANDLE       schMaster;
+	SC_HANDLE       schSlave;
+
+	schMaster = OpenSCManager (NULL, NULL, SC_MANAGER_ALL_ACCESS); 
+
+    schSlave = OpenService (schMaster, "vnccom", SERVICE_ALL_ACCESS);
+
+    if (schSlave == NULL) 
+    {
+     CloseServiceHandle(schMaster);
+	 return false;
+    }
+	else
+	{
+		CloseServiceHandle (schSlave);
+		CloseServiceHandle(schMaster);
+		return true;
+	}
+}*/
+
+
+///////////////////////////////////////////////////////////////////
+BOOL GetDllProductVersion(char* dllName, char *vBuffer, int size)
+{
+   char *versionInfo;
+   void *lpBuffer;
+   unsigned int cBytes;
+   DWORD rBuffer;
+
+   if( !dllName || !vBuffer )
+      return(FALSE);
+
+//   DWORD sName = GetModuleFileName(NULL, fileName, sizeof(fileName));
+// FYI only
+    /*char systemroot[150];
+	GetEnvironmentVariable("SystemRoot", systemroot, 150);
+	char exe_file_name[MAX_PATH];
+	strcpy(exe_file_name,systemroot);
+	strcat(exe_file_name,"\\system32\\driver\\");
+	strcat(exe_file_name,dllName);*/
+
+   DWORD sVersion = GetFileVersionInfoSize(dllName, &rBuffer);
+   if (sVersion==0) return (FALSE);
+   versionInfo = new char[sVersion];
+
+   BOOL resultValue = VerQueryValue(versionInfo,  
+
+TEXT("\\StringFileInfo\\040904b0\\ProductVersion"), 
+                                    &lpBuffer, 
+                                    &cBytes);
+
+   if( !resultValue )
+   {
+	   resultValue = VerQueryValue(versionInfo,TEXT("\\StringFileInfo\\000004b0\\ProductVersion"), 
+                                    &lpBuffer, 
+                                    &cBytes);
+
+   }
+
+   if( resultValue )
+   {
+      strncpy(vBuffer, (char *) lpBuffer, size);
+      delete []versionInfo;
+      return(TRUE);
+   }
+   else
+   {
+      *vBuffer = '\0';
+      delete []versionInfo;
+      return(FALSE);
+   }
+}
+
+///////////////////////////////////////////////////////////////////
+
+bool
+CheckVideoDriver(bool Box)
+{
+		typedef BOOL (WINAPI* pEnumDisplayDevices)(PVOID,DWORD,PVOID,DWORD);
+		pEnumDisplayDevices pd=NULL;
+		LPSTR driverName = "mv video hook driver2";
+		BOOL DriverFound;
+		DEVMODE devmode;
+		FillMemory(&devmode, sizeof(DEVMODE), 0);
+		devmode.dmSize = sizeof(DEVMODE);
+		devmode.dmDriverExtra = 0;
+		/*BOOL change = */EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&devmode);
+		devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+		HMODULE hUser32=LoadLibrary("USER32");
+		if (hUser32) pd = (pEnumDisplayDevices)GetProcAddress( hUser32, "EnumDisplayDevicesA");
+		if (pd)
+			{
+				LPSTR deviceName=NULL;
+				DISPLAY_DEVICE dd;
+				ZeroMemory(&dd, sizeof(dd));
+				dd.cb = sizeof(dd);
+				devmode.dmDeviceName[0] = '\0';
+				INT devNum = 0;
+				BOOL result;
+				DriverFound=false;
+				while ((result = (*pd)(NULL,devNum, &dd,0)))
+				{
+					if (strcmp((const char *)&dd.DeviceString[0], driverName) == 0)
+					{
+					DriverFound=true;
+					break;
+					}
+					devNum++;
+				}
+				if (DriverFound)
+				{
+					if (hUser32) FreeLibrary(hUser32);
+					if(Box)
+					{
+						char buf[512];
+						GetDllProductVersion("mv2.dll",buf,512);
+						if (dd.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
+						{
+							strcat(buf," driver Active");
+							HDC testdc=NULL;
+							deviceName = (LPSTR)&dd.DeviceName[0];
+							testdc = CreateDC("DISPLAY",deviceName,NULL,NULL);	
+							if (testdc)
+							{
+								DeleteDC(testdc);
+								strcat(buf," access ok");
+							}
+							else
+							{
+								strcat(buf," access denied, permission problem");
+							}
+						}
+						else
+							strcat(buf," driver Not Active");
+						    
+						MessageBoxSecure(NULL,buf,"driver info: required version 1.22",0);
+					}
+					return true;
+				}
+				else if(Box) MessageBoxSecure(NULL,"Driver not found: Perhaps you need to reboot after install","driver info: required version 1.22",0);
+			}
+	if (hUser32) FreeLibrary(hUser32);	
+	return false;
+}
diff --git a/ica/win32/winvnc/winvnc/vistahook.cpp b/ica/win32/winvnc/winvnc/vistahook.cpp
new file mode 100644
index 0000000..b5cfd5d
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vistahook.cpp
@@ -0,0 +1,481 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "vncdesktopthread.h"
+#include "Localization.h"
+#include "vnctimedmsgbox.h"
+namespace
+{
+    int g_Oldcounter=0;
+}
+bool stop_hookwatch=false;
+
+inline bool
+ClipRect(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);
+}
+
+DWORD WINAPI hookwatch(LPVOID lpParam)
+{
+	vncDesktopThread *dt = (vncDesktopThread *)lpParam;
+
+	while (!stop_hookwatch)
+	{
+		if (dt->g_obIPC.listall()->counter!=g_Oldcounter)
+		{
+			dt->m_desktop->TriggerUpdate();
+			Sleep(15);
+		}
+		Sleep(5);
+	}
+
+	return 0;
+}
+
+bool
+vncDesktopThread::Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &rgncache)
+{
+	bool returnvalue=false;
+	//vnclog.Print(LL_INTERR, VNCLOG("counter,g_Oldcounter %i %i  \n"),ringbuffer->counter,g_Oldcounter);
+	if (ringbuffer->counter==g_Oldcounter) return 0;
+	int counter=ringbuffer->counter;
+	if (counter<1 || counter>1999) return 0;
+
+	if (g_Oldcounter<counter)
+	{
+		for (int i =g_Oldcounter+1; i<=counter;i++)
+		{
+			if (ringbuffer->type[i]==0)
+			{
+				rfb::Rect rect;
+				rect.tl = rfb::Point(ringbuffer->rect1[i].left, ringbuffer->rect1[i].top);
+				rect.br = rfb::Point(ringbuffer->rect1[i].right, ringbuffer->rect1[i].bottom);
+				//Buffer coordinates
+				//rect.tl.x-=(m_desktop->m_SWOffsetx);
+				//rect.br.x-=(m_desktop->m_SWOffsetx);
+				//rect.tl.y-=(m_desktop->m_SWOffsety);
+				//rect.br.y-=(m_desktop->m_SWOffsety);
+				vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i  \n"),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
+	/*#ifdef _DEBUG
+					char			szText[256];
+					DWORD error=GetLastError();
+					sprintf(szText,"REct1 %i %i %i %i  \n",rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
+					SetLastError(0);
+					OutputDebugString(szText);		
+	#endif	*/		
+				rect = rect.intersect(m_desktop->m_Cliprect);
+				if (!rect.is_empty())
+				{
+/*#ifdef _DEBUG
+					char			szText[256];
+					DWORD error=GetLastError();
+					sprintf(szText,"REctXXXXXXXXXXX %i %i %i %i  \n",rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
+					SetLastError(0);
+					OutputDebugString(szText);		
+	#endif*/
+					returnvalue=true;
+					rgncache.assign_union(rect);
+				}
+			}
+			if (ringbuffer->type[i]==2 || ringbuffer->type[i]==4)
+			{
+				/*if (MyGetCursorInfo)
+					{
+						MyCURSORINFO cinfo;
+						cinfo.cbSize=sizeof(MyCURSORINFO);
+						MyGetCursorInfo(&cinfo);
+						m_desktop->SetCursor(cinfo.hCursor);
+						//vnclog.Print(LL_INTERR, VNCLOG("Cursor %i  \n"),cinfo.hCursor);
+					}*/
+	
+				
+			}
+			
+		}
+
+	}
+	else
+	{
+		int  i = 0;
+		for (i =g_Oldcounter+1;i<2000;i++)
+		{
+			if (ringbuffer->type[i]==0 )
+			{
+				rfb::Rect rect;
+				rect.tl = rfb::Point(ringbuffer->rect1[i].left, ringbuffer->rect1[i].top);
+				rect.br = rfb::Point(ringbuffer->rect1[i].right, ringbuffer->rect1[i].bottom);
+				//Buffer coordinates
+				//rect.tl.x-=m_desktop->m_ScreenOffsetx;
+				//rect.br.x-=m_desktop->m_ScreenOffsetx;
+				//rect.tl.y-=m_desktop->m_ScreenOffsety;
+				//rect.br.y-=m_desktop->m_ScreenOffsety;
+				//vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i  \n"),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
+#ifdef _DEBUG
+					char			szText[256];
+					DWORD error=GetLastError();
+					sprintf(szText,"REct2 %i %i %i %i  \n",rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
+					SetLastError(0);
+					OutputDebugString(szText);		
+	#endif				
+				rect = rect.intersect(m_desktop->m_Cliprect);
+				if (!rect.is_empty())
+				{
+					returnvalue=true;
+					rgncache.assign_union(rect);
+				}
+			}
+			if (ringbuffer->type[i]==2 || ringbuffer->type[i]==4)
+			{
+				/*if (MyGetCursorInfo)
+					{
+						MyCURSORINFO cinfo;
+						cinfo.cbSize=sizeof(MyCURSORINFO);
+						MyGetCursorInfo(&cinfo);
+						m_desktop->SetCursor(cinfo.hCursor);
+						//vnclog.Print(LL_INTERR, VNCLOG("Cursor %i  \n"),cinfo.hCursor);
+					}*/
+				
+			}
+			
+		}
+		for (i=1;i<=counter;i++)
+		{
+			if (ringbuffer->type[i]==0 )
+			{
+				rfb::Rect rect;
+				rect.tl = rfb::Point(ringbuffer->rect1[i].left, ringbuffer->rect1[i].top);
+				rect.br = rfb::Point(ringbuffer->rect1[i].right, ringbuffer->rect1[i].bottom);
+				//Buffer coordinates
+				//rect.tl.x-=m_desktop->m_ScreenOffsetx;
+				//rect.br.x-=m_desktop->m_ScreenOffsetx;
+				//rect.tl.y-=m_desktop->m_ScreenOffsety;
+				//rect.br.y-=m_desktop->m_ScreenOffsety;
+				//vnclog.Print(LL_INTERR, VNCLOG("REct %i %i %i %i  \n"),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
+				
+				rect = rect.intersect(m_desktop->m_Cliprect);
+				if (!rect.is_empty())
+				{
+					returnvalue=true;
+					rgncache.assign_union(rect);
+				}
+			}
+			if (ringbuffer->type[i]==2 || ringbuffer->type[i]==4)
+			{
+				/*if (MyGetCursorInfo)
+					{
+						MyCURSORINFO cinfo;
+						cinfo.cbSize=sizeof(MyCURSORINFO);
+						MyGetCursorInfo(&cinfo);
+						m_desktop->SetCursor(cinfo.hCursor);
+						//vnclog.Print(LL_INTERR, VNCLOG("Cursor %i  \n"),cinfo.hCursor);
+					}*/
+				
+			}
+			
+		}
+	}
+	g_Oldcounter=counter;
+	return returnvalue;
+}
+void Enable_softwareCAD_elevated();
+void delete_softwareCAD_elevated();
+DWORD GetExplorerLogonPid();
+bool IsSoftwareCadEnabled();
+bool ISUACENabled();
+extern HANDLE hShutdownEventcad;
+
+
+DWORD WINAPI Cadthread(LPVOID lpParam)
+{
+	OSVERSIONINFO OSversion;	
+	OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+	GetVersionEx(&OSversion);
+
+
+	HDESK desktop=NULL;
+	desktop = OpenInputDesktop(0, FALSE,
+								DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
+								DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
+								DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
+								DESKTOP_SWITCHDESKTOP | GENERIC_WRITE
+								);
+
+
+	
+	if (desktop == NULL)
+		vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error \n"));
+	else 
+		vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK\n"));
+
+	HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
+	DWORD dummy;
+
+	char new_name[256];
+	if (desktop)
+	{
+	if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation \n"));
+	}
+
+	vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x\n"), new_name, desktop, old_desktop);
+
+	if (!SetThreadDesktop(desktop))
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop \n"));
+	}
+	}
+
+	//////
+	if(OSversion.dwMajorVersion>=6 && vncService::RunningAsService())
+			{
+				/*if (OSversion.dwMinorVersion==0) //Vista
+				{
+					if (ISUACENabled() && !IsSoftwareCadEnabled())//ok
+					{
+						
+					}
+					if (!ISUACENabled() && IsSoftwareCadEnabled())
+					{
+						
+					}
+					if (!ISUACENabled() && !IsSoftwareCadEnabled())
+					{
+						DWORD result=MessageBoxSecure(NULL,"UAC is Disable, make registry changes to allow cad","Warning",MB_YESNO);
+						if (result==IDYES)
+						{
+							HANDLE hProcess,hPToken;
+							DWORD id=GetExplorerLogonPid();
+							if (id!=0) 
+								{
+									hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+									if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+													|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+													|TOKEN_READ|TOKEN_WRITE,&hPToken)) return 0;
+
+									char dir[MAX_PATH];
+									char exe_file_name[MAX_PATH];
+									GetModuleFileName(0, exe_file_name, MAX_PATH);
+									strcpy(dir, exe_file_name);
+									strcat(dir, " -softwarecadhelper");
+		
+							
+									STARTUPINFO          StartUPInfo;
+									PROCESS_INFORMATION  ProcessInfo;
+									HANDLE Token=NULL;
+									HANDLE process=NULL;
+									ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+									ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+									StartUPInfo.wShowWindow = SW_SHOW;
+									StartUPInfo.lpDesktop = "Winsta0\\Default";
+									StartUPInfo.cb = sizeof(STARTUPINFO);
+				
+									CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+									DWORD errorcode=GetLastError();
+									if (process) CloseHandle(process);
+									if (Token) CloseHandle(Token);
+									if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+									if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+									if (errorcode==1314)
+									{
+										Enable_softwareCAD_elevated();
+									}
+								}
+						}
+					}
+					if (ISUACENabled() && IsSoftwareCadEnabled())
+					{
+						DWORD result=MessageBoxSecure(NULL,"UAC is Enablde, make registry changes to allow cad","Warning",MB_YESNO);
+						if (result==IDYES)
+						{
+							HANDLE hProcess,hPToken;
+							DWORD id=GetExplorerLogonPid();
+							if (id!=0) 
+								{
+									hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+									if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+													|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+													|TOKEN_READ|TOKEN_WRITE,&hPToken)) return 0;
+
+									char dir[MAX_PATH];
+									char exe_file_name[MAX_PATH];
+									GetModuleFileName(0, exe_file_name, MAX_PATH);
+									strcpy(dir, exe_file_name);
+									strcat(dir, " -delsoftwarecadhelper");
+			
+							
+									STARTUPINFO          StartUPInfo;
+									PROCESS_INFORMATION  ProcessInfo;
+									HANDLE Token=NULL;
+									HANDLE process=NULL;
+									ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+									ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+									StartUPInfo.wShowWindow = SW_SHOW;
+									StartUPInfo.lpDesktop = "Winsta0\\Default";
+									StartUPInfo.cb = sizeof(STARTUPINFO);
+			
+									CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+									DWORD errorcode=GetLastError();
+									if (process) CloseHandle(process);
+									if (Token) CloseHandle(Token);
+									if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+									if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+									if (errorcode==1314)
+										{
+											delete_softwareCAD_elevated();
+										}							
+								}
+						}
+					}
+
+				}
+				else*/
+					if( vncService::RunningAsService() &&!IsSoftwareCadEnabled())
+					{
+						DWORD result=MessageBoxSecure(NULL,"UAC is Disable, make registry changes to allow cad","Warning",MB_YESNO);
+						if (result==IDYES)
+							{
+								HANDLE hProcess,hPToken;
+								DWORD id=GetExplorerLogonPid();
+								if (id!=0) 
+									{						
+									hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+									if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+													|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+													|TOKEN_READ|TOKEN_WRITE,&hPToken)) return 0;
+
+									char dir[MAX_PATH];
+									char exe_file_name[MAX_PATH];
+									GetModuleFileName(0, exe_file_name, MAX_PATH);
+									strcpy(dir, exe_file_name);
+									strcat(dir, " -softwarecadhelper");
+		
+							
+									STARTUPINFO          StartUPInfo;
+									PROCESS_INFORMATION  ProcessInfo;
+									HANDLE Token=NULL;
+									HANDLE process=NULL;
+									ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+									ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+									StartUPInfo.wShowWindow = SW_SHOW;
+									StartUPInfo.lpDesktop = "Winsta0\\Default";
+									StartUPInfo.cb = sizeof(STARTUPINFO);
+			
+									CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+									DWORD errorcode=GetLastError();
+									if (process) CloseHandle(process);
+									if (Token) CloseHandle(Token);
+									if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+									if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+									if (errorcode==1314)
+										{
+											Enable_softwareCAD_elevated();
+										}							
+									}
+							}
+					
+					}
+			}
+       /////////////////////
+	if(OSversion.dwMajorVersion==6)//&& OSversion.dwMinorVersion>=1) //win7  // test win7 +Vista
+	{
+
+		if (hShutdownEventcad==NULL ) hShutdownEventcad = OpenEvent(EVENT_MODIFY_STATE, FALSE, "Global\\SessionEventUltraCad");
+		if (hShutdownEventcad!=NULL ) SetEvent(hShutdownEventcad);
+		if (old_desktop) SetThreadDesktop(old_desktop);
+		if (desktop) CloseDesktop(desktop);
+		return 0;
+	}
+
+	 HKEY hKey; 
+	 DWORD isLUAon = 0; 
+     if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"), 0, KEY_READ, &hKey) == ERROR_SUCCESS) 
+              { 
+              DWORD LUAbufSize = 4; 
+              RegQueryValueEx(hKey, TEXT("EnableLUA"), NULL, NULL, (LPBYTE)&isLUAon, &LUAbufSize); 
+              RegCloseKey(hKey); 
+			  }
+     if (isLUAon != 1 && OSversion.dwMajorVersion==6) 
+	 {
+		 if (hShutdownEventcad==NULL ) hShutdownEventcad = OpenEvent(EVENT_MODIFY_STATE, FALSE, "Global\\SessionEventUltraCad");
+		 if (hShutdownEventcad!=NULL ) SetEvent(hShutdownEventcad);
+		 if (old_desktop) SetThreadDesktop(old_desktop);
+		 if (desktop) CloseDesktop(desktop);
+		 return 0;
+	 }
+
+//Full path needed, sometimes it just default to system32
+	char WORKDIR[MAX_PATH];
+	char mycommand[MAX_PATH];
+	if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+		{
+		char* p = strrchr(WORKDIR, '\\');
+		if (p == NULL) return 0;
+		*p = '\0';
+		}
+	strcpy(mycommand,"");
+	strcat(mycommand,WORKDIR);//set the directory
+	strcat(mycommand,"\\");
+	strcat(mycommand,"cad.exe");
+
+	int nr=(LONG_PTR)ShellExecute(GetDesktopWindow(), "open", mycommand, "", 0, SW_SHOWNORMAL);
+	if (nr<=32)
+	{
+		//error
+		//
+		if ( nr==SE_ERR_ACCESSDENIED )
+			vncTimedMsgBox::Do(
+									sz_ID_CADPERMISSION,
+									sz_ID_ULTRAVNC_WARNING,
+									MB_ICONINFORMATION | MB_OK
+									);
+
+		if ( nr==ERROR_PATH_NOT_FOUND || nr==ERROR_FILE_NOT_FOUND)
+			vncTimedMsgBox::Do(
+									sz_ID_CADERRORFILE,
+									sz_ID_ULTRAVNC_WARNING,
+									MB_ICONINFORMATION | MB_OK
+									);
+
+	}
+
+	if (old_desktop) SetThreadDesktop(old_desktop);
+	if (desktop) CloseDesktop(desktop);
+	return 0;
+}
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncDesktopSW.cpp b/ica/win32/winvnc/winvnc/vncDesktopSW.cpp
new file mode 100644
index 0000000..a1794be
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncDesktopSW.cpp
@@ -0,0 +1,226 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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://www.uvnc.com/
+
+
+// System headers
+#include <assert.h>
+#include "stdhdrs.h"
+
+// Custom headers
+#include <omnithread.h>
+#include "winvnc.h"
+#include "vnchooks/VNCHooks.h"
+#include "vncserver.h"
+#include "rfbRegion.h"
+#include "rfbRect.h"
+#include "vncdesktop.h"
+#include "vncservice.h"
+
+BOOL vncDesktop:: CalculateSWrect(RECT &rect)
+{
+
+	if (!m_Single_hWnd)
+	{
+		m_server->SingleWindow(false);
+		m_SWtoDesktop=TRUE;
+		rect.top=0;
+		rect.left=0;
+		rect.right=m_scrinfo.framebufferWidth;
+		rect.bottom=m_scrinfo.framebufferHeight;
+		return FALSE;
+	}
+
+	if (IsIconic(m_Single_hWnd))
+	{
+		m_server->SingleWindow(false);
+		m_Single_hWnd=NULL;
+		m_SWtoDesktop=TRUE;
+		rect.top=0;
+		rect.left=0;
+		rect.right=m_scrinfo.framebufferWidth;
+		rect.bottom=m_scrinfo.framebufferHeight;
+		return FALSE;
+	}
+	if ( IsWindowVisible(m_Single_hWnd) && GetWindowRect(m_Single_hWnd,&rect)) 
+		{
+			RECT taskbar;
+			rect.top=Max(rect.top,0);
+			rect.left=Max(rect.left,0);
+			rect.right=Min(rect.right,m_scrinfo.framebufferWidth);
+			rect.bottom=Min(rect.bottom,m_scrinfo.framebufferHeight);
+			APPBARDATA pabd;
+			pabd.cbSize=sizeof(APPBARDATA);
+			SHAppBarMessage(ABM_GETTASKBARPOS, &pabd);
+			taskbar.top=Max(pabd.rc.top,0);
+			taskbar.left=Max(pabd.rc.left,0);
+			taskbar.right=Min(pabd.rc.right,m_scrinfo.framebufferWidth);
+			taskbar.bottom=Min(pabd.rc.bottom,m_scrinfo.framebufferHeight);
+			///desktop
+			if (rect.top==0 && rect.left== 0&& rect.right==m_scrinfo.framebufferWidth && rect.bottom==m_scrinfo.framebufferHeight)
+				{
+					m_server->SingleWindow(false);
+					m_Single_hWnd=NULL;
+					rect.top=0;
+					rect.left=0;
+					rect.right=m_scrinfo.framebufferWidth;
+					rect.bottom=m_scrinfo.framebufferHeight;
+					return TRUE;
+				}
+			//taskbar
+			if (rect.top>=taskbar.top && rect.left== taskbar.left&& rect.right==taskbar.right && rect.bottom==taskbar.bottom)
+			
+				{
+					rect.top=taskbar.top;
+					rect.left=taskbar.left;
+					rect.right=taskbar.right;
+					rect.bottom=taskbar.bottom;
+					if ((m_SWHeight!=(rect.bottom-rect.top)) || (m_SWWidth!=(rect.right-rect.left)))
+					m_SWSizeChanged=TRUE;
+					m_SWHeight=rect.bottom-rect.top;
+					m_SWWidth=rect.right-rect.left;
+					return TRUE;	
+				}
+			//eliminate other little windows
+			if ((m_SWHeight!=(rect.bottom-rect.top)) || (m_SWWidth!=(rect.right-rect.left)))
+				m_SWSizeChanged=TRUE;
+			//vnclog.Print(LL_INTINFO, VNCLOG("screen format %d %d %d %d\n"),
+			//		rect.top,
+			//		rect.bottom,rect.right,rect.left);
+			if ((rect.bottom-rect.top)<64||(rect.right-rect.left)<128 || rect.bottom<0 ||rect.top<0 || rect.right<0 ||
+				rect.left<0 || rect.bottom>m_scrinfo.framebufferHeight||rect.top>m_scrinfo.framebufferHeight||
+				rect.right>m_scrinfo.framebufferWidth||rect.left>m_scrinfo.framebufferWidth)
+			{
+				m_server->SingleWindow(false);
+				m_Single_hWnd=NULL;
+				m_SWtoDesktop=TRUE;
+				rect.top=0;
+				rect.left=0;
+				rect.right=m_scrinfo.framebufferWidth;
+				rect.bottom=m_scrinfo.framebufferHeight;
+				m_SWSizeChanged=FALSE;
+				return FALSE;
+			}
+
+
+			m_SWHeight=rect.bottom-rect.top;
+			m_SWWidth=rect.right-rect.left;
+			return TRUE;
+		}		
+	m_server->SingleWindow(false);
+	m_Single_hWnd=NULL;
+	m_SWtoDesktop=TRUE;
+	rect.top=0;
+	rect.left=0;
+	rect.right=m_scrinfo.framebufferWidth;
+	rect.bottom=m_scrinfo.framebufferHeight;
+	return FALSE;
+}
+
+void vncDesktop::SWinit()
+{
+	m_Single_hWnd=NULL;
+	m_Single_hWnd_backup=NULL;
+	m_SWHeight=0;
+	m_SWWidth=0;
+	m_SWSizeChanged=FALSE;
+	m_SWmoved=FALSE;
+	m_SWOffsetx=0;
+	m_SWOffsety=0;
+	vnclog.Print(LL_INTINFO, VNCLOG("SWinit \n"));
+}
+
+rfb::Rect
+vncDesktop::GetSize()
+{
+	//vnclog.Print(LL_INTINFO, VNCLOG("GetSize \n"));
+	if (m_server->SingleWindow())
+		{
+		RECT rect;
+		rect.left=m_Cliprect.tl.x;
+		rect.top=m_Cliprect.tl.y;
+		rect.right=m_Cliprect.br.x;
+		rect.bottom=m_Cliprect.br.y;
+		return rfb::Rect(rect.left, rect.top, rect.right, rect.bottom);
+		
+		}
+	else if (!m_videodriver)
+		{
+		m_SWOffsetx=0;
+		m_SWOffsety=0;
+		return rfb::Rect(0, 0, m_scrinfo.framebufferWidth, m_scrinfo.framebufferHeight);
+		}
+	 else
+		{
+			if (multi_monitor)
+				return rfb::Rect(0,0,mymonitor[2].Width,mymonitor[2].Height);	
+			else
+				return rfb::Rect(0,0,mymonitor[0].Width,mymonitor[0].Height);
+		}
+}
+
+rfb::Rect
+vncDesktop::GetQuarterSize()
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("GetQuarterSize \n"));
+if (m_server->SingleWindow())
+	{
+	RECT rect;
+	if (CalculateSWrect(rect))
+	{
+		rect.left=rect.left-m_ScreenOffsetx;
+		rect.right=rect.right-m_ScreenOffsetx;
+		rect.bottom=rect.bottom-m_ScreenOffsety;
+		rect.top=rect.top-m_ScreenOffsety;
+		if (m_SWOffsetx!=rect.left || m_SWOffsety!=rect.top) m_SWmoved=TRUE;
+		m_SWOffsetx=rect.left;
+		m_SWOffsety=rect.top;
+		m_Cliprect.tl.x=rect.left;
+		m_Cliprect.tl.y=rect.top;
+		m_Cliprect.br.x=rect.right;
+		m_Cliprect.br.y=rect.bottom;
+		return rfb::Rect(rect.left, rect.bottom, rect.right-rect.left, (rect.bottom-rect.top)/4);
+	}
+	else
+	{
+	m_SWOffsetx=0;
+	m_SWOffsety=0;
+	m_Cliprect.tl.x=0;
+	m_Cliprect.tl.y=0;
+	m_Cliprect.br.x=m_bmrect.br.x;
+	m_Cliprect.br.y=m_bmrect.br.y;
+	return rfb::Rect(0, 0, m_bmrect.br.x, m_bmrect.br.y/4);
+
+	}
+	}
+else
+	{ 
+	m_SWOffsetx=0;
+	m_SWOffsety=0;
+	m_Cliprect.tl.x=0;
+	m_Cliprect.tl.y=0;
+	m_Cliprect.br.x=m_bmrect.br.x;
+	m_Cliprect.br.y=m_bmrect.br.y;
+	vnclog.Print(LL_INTINFO, VNCLOG("GetQuarterSize \n"));
+	return rfb::Rect(0, 0, m_bmrect.br.x, m_bmrect.br.y/4);
+	}
+}
+
diff --git a/ica/win32/winvnc/winvnc/vncEncodeTight.cpp b/ica/win32/winvnc/winvnc/vncEncodeTight.cpp
new file mode 100644
index 0000000..e9f28ec
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncEncodeTight.cpp
@@ -0,0 +1,1614 @@
+//  Copyright (C) 2000 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+//
+// If the source code for the VNC system is not available from the place
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeTight
+
+// This file implements the vncEncoder-derived vncEncodeTight class.
+// This class overrides some vncEncoder functions to produce a bitmap
+// to Tight encoder. Tight is much more efficient than RAW format on
+// most screen data and usually 2..10 times as efficient as hextile.
+// It's also more efficient than Zlib encoding in most cases.
+// But note that tight compression may use more CPU time on the server.
+// However, over slower (128kbps or less) connections, the reduction
+// in data transmitted usually outweighs the extra latency added
+// while the server CPU performs the compression algorithms.
+
+#include "vncEncodeTight.h"
+
+// 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).
+//
+// NOTE: m_conf[9].maxRectSize should be >= m_conf[i].maxRectSize,
+// where i in [0..8]. RequiredBuffSize() method depends on this.
+
+const TIGHT_CONF vncEncodeTight::m_conf[10] = {
+//	{	512,   32,	 6, 65536, 0, 0, 0, 0,	 0,   0,   4,  5, 10000, 23000 },
+//	{ 65536,65536,	 6, 65536, 1, 1, 0, 0,	 0,   0,   6, 15, 10000, 23000 },
+
+//	{  2048,  128,   6, 65536, 1, 1, 1, 0,   0,   0,   8, 15,  8000, 18000 },
+//	{  6144,  256,   8, 65536, 3, 3, 2, 0,   0,   0,  24, 20,  6500, 15000 },
+//	{ 10240, 1024,  12, 65536, 5, 5, 3, 0,   0,   0,  32, 25,  5000, 12000 },
+//	{ 16384, 2048,  12, 65536, 6, 6, 4, 0,   0,   0,  32, 37,  4000, 10000 },
+//	{ 32768, 2048,  12,  4096, 7, 7, 5, 4, 150, 380,  32, 50,  3000,  8000 },
+//	{ 65536, 2048,  16,  4096, 7, 7, 6, 4, 170, 420,  48, 60,  2000,  5000 },
+//	{ 65536, 2048,  16,  4096, 8, 8, 7, 5, 180, 450,  64, 70,  1000,  2500 },
+//	{ 65536, 2048,  32,  8192, 9, 9, 8, 6, 190, 475,  64, 75,   500,  1200 },
+//	{ 65536, 2048,  32,  8192, 9, 9, 9, 6, 200, 500,  96, 80,   200,   500 }
+	{ 16384,16384,	 6, 65536, 1, 1, 0, 0,	 0,   0,   8, 14, 10000, 23000 },
+	{ 16384,16384,   6, 65536, 1, 1, 1, 0,   0,   0,   8, 20,  8000, 18000 },
+	{ 16384,16384,   8, 65536, 3, 3, 2, 0,   0,   0,  24, 25,  6500, 15000 },
+	{ 32768,32768,  12, 65536, 5, 5, 3, 0,   0,   0,  32, 30,  5000, 12000 },
+	{ 32768,32768,  12, 65536, 6, 6, 4, 0,   0,   0,  32, 35,  4000, 10000 },
+	{ 32768,32768,  12,  4096, 7, 7, 5, 4, 150, 380,  32, 40,  3000,  8000 },
+	{ 65536,65536,  16,  4096, 7, 7, 6, 4, 170, 420,  48, 50,  2000,  5000 },
+	{ 65536,65536,  16,  4096, 8, 8, 7, 5, 180, 450,  64, 60,  1000,  2500 },
+	{ 65536,65536,  32,  8192, 9, 9, 8, 6, 190, 475,  64, 70,   500,  1200 },
+	{ 65536,65536,  32,  8192, 9, 9, 9, 6, 200, 500,  96, 80,   200,   500 }
+};
+
+vncEncodeTight::vncEncodeTight()
+{
+	m_buffer = NULL;
+	m_bufflen = 0;
+
+	m_hdrBuffer = new BYTE [sz_rfbFramebufferUpdateRectHeader + 8 + 256*4];
+	m_prevRowBuf = NULL;
+
+	for (int i = 0; i < 4; i++)
+		m_zsActive[i] = false;
+}
+
+vncEncodeTight::~vncEncodeTight()
+{
+	if (m_buffer != NULL) {
+		delete[] m_buffer;
+		m_buffer = NULL;
+	}
+
+	delete[] m_hdrBuffer;
+
+	for (int i = 0; i < 4; i++) {
+		if (m_zsActive[i])
+			deflateEnd(&m_zsStruct[i]);
+		m_zsActive[i] = false;
+	}
+	if (m_prevRowBuf != NULL)
+	{
+		delete[] m_prevRowBuf;
+		m_prevRowBuf=NULL;
+	}
+}
+
+void
+vncEncodeTight::Init()
+{
+	vncEncoder::Init();
+}
+
+/*****************************************************************************
+ *
+ * Routines to implement Tight Encoding.
+ *
+ */
+
+UINT
+vncEncodeTight::RequiredBuffSize(UINT width, UINT height)
+{
+	// FIXME: Use actual compression level instead of 9?
+	int result = m_conf[ m_compresslevel ].maxRectSize * (m_remoteformat.bitsPerPixel / 8);
+	result += result / 100 + 16;
+
+	return result;
+}
+
+UINT
+vncEncodeTight::NumCodedRects(RECT &rect)
+{
+	const int w = rect.right - rect.left;
+	const int h = rect.bottom - rect.top;
+
+	// No matter how many rectangles we will send if LastRect markers
+	// are used to terminate rectangle stream.
+	if (m_use_lastrect && w * h >= MIN_SPLIT_RECT_SIZE) {
+		return 0;
+	}
+
+	const int maxRectSize = m_conf[m_compresslevel].maxRectSize;
+	const int maxRectWidth = m_conf[m_compresslevel].maxRectWidth;
+
+	if (w > maxRectWidth || w * h > maxRectSize) {
+		const int subrectMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
+		const int subrectMaxHeight = maxRectSize / subrectMaxWidth;
+		return (((w - 1) / maxRectWidth + 1) *
+				((h - 1) / subrectMaxHeight + 1));
+	} else {
+		return 1;
+	}
+}
+
+UINT
+vncEncodeTight::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest,
+						   const RECT &rect)
+{
+	int x = rect.left, y = rect.top;
+	int w = rect.right - x, h = rect.bottom - y;
+
+	const int maxRectSize = m_conf[m_compresslevel].maxRectSize;
+	const int rawDataSize = maxRectSize * (m_remoteformat.bitsPerPixel / 8);
+
+	if (m_bufflen < rawDataSize) {
+		if (m_buffer != NULL)
+			delete [] m_buffer;
+
+		m_buffer = new BYTE [rawDataSize+1];
+		if (m_buffer == NULL)
+			return vncEncoder::EncodeRect(source, dest, rect);
+
+		m_bufflen = rawDataSize;
+	}
+
+	if ( m_remoteformat.depth == 24 && m_remoteformat.redMax == 0xFF &&
+		 m_remoteformat.greenMax == 0xFF && m_remoteformat.blueMax == 0xFF ) {
+		m_usePixelFormat24 = true;
+	} else {
+		m_usePixelFormat24 = false;
+	}
+
+	if (!m_use_lastrect || w * h < MIN_SPLIT_RECT_SIZE)
+		return EncodeRectSimple(source, outConn, dest, rect);
+
+	// Calculate maximum number of rows in one non-solid rectangle.
+
+	int nMaxRows;
+	{
+		int maxRectSize = m_conf[m_compresslevel].maxRectSize;
+		int maxRectWidth = m_conf[m_compresslevel].maxRectWidth;
+		int nMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
+		nMaxRows = maxRectSize / nMaxWidth;
+	}
+
+	// Try to find large solid-color areas and send them separately.
+
+	CARD32 colorValue;
+	int x_best, y_best, w_best, h_best;
+	int dx, dy, dw, dh;
+
+	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) {
+			RECT upperRect;
+			SetRect(&upperRect, x, y, x + w, y + nMaxRows);
+
+			int size = EncodeRectSimple(source, outConn, dest, upperRect);
+			outConn->SendExactQueue((char *)dest, size);
+
+			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(source, dx, dy, dw, dh, &colorValue, FALSE)) {
+
+				// Get dimensions of solid-color area.
+
+				FindBestSolidArea(source, 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(source, x, y, w, h, colorValue,
+								&x_best, &y_best, &w_best, &h_best);
+
+				// Compute dimensions of surrounding rectangles.
+
+				RECT rects[4];
+				SetRect(&rects[0],
+						x, y, x + w, y_best);
+				SetRect(&rects[1],
+						x, y_best, x_best, y_best + h_best);
+				SetRect(&rects[2],
+						x_best + w_best, y_best, x + w, y_best + h_best);
+				SetRect(&rects[3],
+						x, y_best + h_best, x + w, y + h);
+
+				// Send solid-color area and surrounding rectangles.
+
+				for (int i = 0; i < 4; i++) {
+					if (i == 2) {
+						RECT onePixel;
+						SetRect(&onePixel,
+								x_best, y_best, x_best + 1, y_best + 1);
+						Translate(source, m_buffer, onePixel);
+
+						SendTightHeader(x_best, y_best, w_best, h_best);
+						int size = SendSolidRect(dest);
+
+						outConn->SendExactQueue((char *)m_hdrBuffer, m_hdrBufferBytes);
+						outConn->SendExactQueue((char *)dest, size);
+						encodedSize += (m_hdrBufferBytes + size -
+										sz_rfbFramebufferUpdateRectHeader);
+						transmittedSize += (m_hdrBufferBytes + size);
+					}
+					if ( rects[i].left == rects[i].right ||
+						 rects[i].top  == rects[i].bottom ) {
+						continue;
+					}
+					int size = EncodeRect(source, outConn, dest, rects[i]);
+					outConn->SendExactQueue((char *)dest, size);
+				}
+
+				// Return after all recursive calls done (0 == data sent).
+
+				return 0;
+			}
+
+		}
+
+	}
+
+	// No suitable solid-color rectangles found.
+
+	return EncodeRectSimple(source, outConn, dest, rect);
+}
+
+void
+vncEncodeTight::FindBestSolidArea(BYTE *source, int x, int y, int w, int h,
+								  CARD32 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(source, 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(source, 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;
+}
+
+void vncEncodeTight::ExtendSolidArea(BYTE *source, int x, int y, int w, int h,
+									 CARD32 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(source, *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(source, *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(source, 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(source, cx, *y_ptr, 1, *h_ptr,
+									   &colorValue, TRUE);
+		  cx++ );
+	*w_ptr += cx - (*x_ptr + *w_ptr);
+}
+
+bool
+vncEncodeTight::CheckSolidTile(BYTE *source, int x, int y, int w, int h,
+							   CARD32 *colorPtr, bool needSameColor)
+{
+	switch(m_localformat.bitsPerPixel) {
+	case 32:
+		return CheckSolidTile32(source, x, y, w, h, colorPtr, needSameColor);
+	case 16:
+		return CheckSolidTile16(source, x, y, w, h, colorPtr, needSameColor);
+	default:
+		return CheckSolidTile8(source, x, y, w, h, colorPtr, needSameColor);
+	}
+}
+
+#define DEFINE_CHECK_SOLID_FUNCTION(bpp)									  \
+																			  \
+bool 																		  \
+vncEncodeTight::CheckSolidTile##bpp(BYTE *source, int x, int y, int w, int h, \
+									CARD32 *colorPtr, bool needSameColor)	  \
+{																			  \
+	CARD##bpp *fbptr;														  \
+	CARD##bpp colorValue;													  \
+	int dx, dy; 															  \
+																			  \
+	fbptr = (CARD##bpp *)													  \
+		&source[y * m_bytesPerRow + x * (bpp/8)];							  \
+																			  \
+	colorValue = *fbptr;													  \
+	if (needSameColor && (CARD32)colorValue != *colorPtr)					  \
+		return false;														  \
+																			  \
+	for (dy = 0; dy < h; dy++) {											  \
+		for (dx = 0; dx < w; dx++) {										  \
+			if (colorValue != fbptr[dx])									  \
+				return false;												  \
+		}																	  \
+		fbptr = (CARD##bpp *)((BYTE *)fbptr + m_bytesPerRow);				  \
+	}																		  \
+																			  \
+	*colorPtr = (CARD32)colorValue; 										  \
+	return true;															  \
+}
+
+DEFINE_CHECK_SOLID_FUNCTION(8)
+DEFINE_CHECK_SOLID_FUNCTION(16)
+DEFINE_CHECK_SOLID_FUNCTION(32)
+
+UINT
+vncEncodeTight::EncodeRectSimple(BYTE *source, VSocket *outConn, BYTE *dest,
+								 const RECT &rect)
+{
+	const int x = rect.left, y = rect.top;
+	const int w = rect.right - x, h = rect.bottom - y;
+
+	const int maxRectSize = m_conf[m_compresslevel].maxRectSize;
+	const int maxRectWidth = m_conf[m_compresslevel].maxRectWidth;
+
+	int partialSize = 0;
+
+	if (w > maxRectWidth || w * h > maxRectSize) {
+		const int subrectMaxWidth = (w > maxRectWidth) ? maxRectWidth : w;
+		const int subrectMaxHeight = maxRectSize / subrectMaxWidth;
+		int dx, dy, rw, rh;
+
+		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;
+
+				partialSize = EncodeSubrect(source, outConn, dest,
+											x+dx, y+dy, rw, rh);
+				if (dy + subrectMaxHeight < h || dx + maxRectWidth < w) {
+					outConn->SendExactQueue((char *)dest, partialSize);
+				}
+			}
+		}
+	} else {
+		partialSize = EncodeSubrect(source, outConn, dest, x, y, w, h);
+	}
+
+	return partialSize;
+}
+
+UINT
+vncEncodeTight::EncodeSubrect(BYTE *source, VSocket *outConn, BYTE *dest,
+							  int x, int y, int w, int h)
+{
+	SendTightHeader(x, y, w, h);
+
+	RECT r;
+	r.left = x; r.top = y;
+	r.right = x + w; r.bottom = y + h;
+	Translate(source, m_buffer, r);
+
+	m_paletteMaxColors = w * h / m_conf[m_compresslevel].idxMaxColorsDivisor;
+	if ( m_paletteMaxColors < 2 &&
+		 w * h >= m_conf[m_compresslevel].monoMinRectSize ) {
+		m_paletteMaxColors = 2;
+	}
+	switch (m_remoteformat.bitsPerPixel) {
+	case 8:
+		FillPalette8(w * h);
+		break;
+	case 16:
+		FillPalette16(w * h);
+		break;
+	default:
+		FillPalette32(w * h);
+	}
+
+	int encDataSize;
+	switch (m_paletteNumColors) {
+	case 0:
+		// Truecolor image
+		if (DetectSmoothImage(w, h)) {
+			if (m_qualitylevel != -1) {
+				encDataSize = SendJpegRect(dest, w, h,
+										   m_conf[m_qualitylevel].jpegQuality);
+			} else {
+				encDataSize = SendGradientRect(dest, w, h);
+			}
+		} else {
+			encDataSize = SendFullColorRect(dest, w, h);
+		}
+		break;
+	case 1:
+		// Solid rectangle
+		encDataSize = SendSolidRect(dest);
+		break;
+	case 2:
+		// Two-color rectangle
+		encDataSize = SendMonoRect(dest, w, h);
+		break;
+	default:
+		// Up to 256 different colors
+		if ( m_paletteNumColors > 96 &&
+			 m_qualitylevel != -1 && m_qualitylevel <= 3 &&
+			 DetectSmoothImage(w, h) ) {
+			encDataSize = SendJpegRect(dest, w, h,
+									   m_conf[m_qualitylevel].jpegQuality);
+		} else {
+			encDataSize = SendIndexedRect(dest, w, h);
+		}
+	}
+
+	if (encDataSize < 0)
+		return vncEncoder::EncodeRect(source, dest, r);
+
+	outConn->SendExactQueue((char *)m_hdrBuffer, m_hdrBufferBytes);
+
+	encodedSize += m_hdrBufferBytes - sz_rfbFramebufferUpdateRectHeader + encDataSize;
+	transmittedSize += m_hdrBufferBytes + encDataSize;
+
+	return encDataSize;
+}
+
+void
+vncEncodeTight::SendTightHeader(int x, int y, int w, int h)
+{
+	rfbFramebufferUpdateRectHeader rect;
+
+	rect.r.x = Swap16IfLE(x-m_SWOffsetx);
+	rect.r.y = Swap16IfLE(y-m_SWOffsety);
+	rect.r.w = Swap16IfLE(w);
+	rect.r.h = Swap16IfLE(h);
+	rect.encoding = Swap32IfLE(rfbEncodingTight);
+
+	dataSize += w * h * (m_remoteformat.bitsPerPixel / 8);
+	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+
+	memcpy(m_hdrBuffer, (BYTE *)&rect, sz_rfbFramebufferUpdateRectHeader);
+	m_hdrBufferBytes = sz_rfbFramebufferUpdateRectHeader;
+}
+
+//
+// Subencoding implementations.
+//
+
+int
+vncEncodeTight::SendSolidRect(BYTE *dest)
+{
+	int len;
+
+	if (m_usePixelFormat24) {
+		Pack24(m_buffer, 1);
+		len = 3;
+	} else
+		len = m_remoteformat.bitsPerPixel / 8;
+
+	m_hdrBuffer[m_hdrBufferBytes++] = rfbTightFill << 4;
+	memcpy (dest, m_buffer, len);
+
+	return len;
+}
+
+int
+vncEncodeTight::SendMonoRect(BYTE *dest, int w, int h)
+{
+	const int streamId = 1;
+	int paletteLen, dataLen;
+	CARD8 paletteBuf[8];
+
+	// Prepare tight encoding header.
+	dataLen = (w + 7) / 8;
+	dataLen *= h;
+
+	m_hdrBuffer[m_hdrBufferBytes++] = (streamId | rfbTightExplicitFilter) << 4;
+	m_hdrBuffer[m_hdrBufferBytes++] = rfbTightFilterPalette;
+	m_hdrBuffer[m_hdrBufferBytes++] = 1;
+
+	// Prepare palette, convert image.
+	switch (m_remoteformat.bitsPerPixel) {
+	case 32:
+		EncodeMonoRect32((CARD8 *)m_buffer, w, h);
+
+		((CARD32 *)paletteBuf)[0] = m_monoBackground;
+		((CARD32 *)paletteBuf)[1] = m_monoForeground;
+
+		if (m_usePixelFormat24) {
+			Pack24(paletteBuf, 2);
+			paletteLen = 6;
+		} else
+			paletteLen = 8;
+
+		memcpy(&m_hdrBuffer[m_hdrBufferBytes], paletteBuf, paletteLen);
+		m_hdrBufferBytes += paletteLen;
+		break;
+
+	case 16:
+		EncodeMonoRect16((CARD8 *)m_buffer, w, h);
+
+		((CARD16 *)paletteBuf)[0] = (CARD16)m_monoBackground;
+		((CARD16 *)paletteBuf)[1] = (CARD16)m_monoForeground;
+
+		memcpy(&m_hdrBuffer[m_hdrBufferBytes], paletteBuf, 4);
+		m_hdrBufferBytes += 4;
+		break;
+
+	default:
+		EncodeMonoRect8((CARD8 *)m_buffer, w, h);
+
+		m_hdrBuffer[m_hdrBufferBytes++] = (BYTE)m_monoBackground;
+		m_hdrBuffer[m_hdrBufferBytes++] = (BYTE)m_monoForeground;
+	}
+
+	return CompressData(dest, streamId, dataLen,
+						m_conf[m_compresslevel].monoZlibLevel,
+						Z_DEFAULT_STRATEGY);
+}
+
+int
+vncEncodeTight::SendIndexedRect(BYTE *dest, int w, int h)
+{
+	const int streamId = 2;
+	int i, entryLen;
+	CARD8 paletteBuf[256*4];
+
+	// Prepare tight encoding header.
+	m_hdrBuffer[m_hdrBufferBytes++] = (streamId | rfbTightExplicitFilter) << 4;
+	m_hdrBuffer[m_hdrBufferBytes++] = rfbTightFilterPalette;
+	m_hdrBuffer[m_hdrBufferBytes++] = (BYTE)(m_paletteNumColors - 1);
+
+	// Prepare palette, convert image.
+	switch (m_remoteformat.bitsPerPixel) {
+	case 32:
+		EncodeIndexedRect32((CARD8 *)m_buffer, w * h);
+
+		for (i = 0; i < m_paletteNumColors; i++) {
+			((CARD32 *)paletteBuf)[i] =
+				m_palette.entry[i].listNode->rgb;
+		}
+		if (m_usePixelFormat24) {
+			Pack24(paletteBuf, m_paletteNumColors);
+			entryLen = 3;
+		} else
+			entryLen = 4;
+
+		memcpy(&m_hdrBuffer[m_hdrBufferBytes], paletteBuf,
+			   m_paletteNumColors * entryLen);
+		m_hdrBufferBytes += m_paletteNumColors * entryLen;
+		break;
+
+	case 16:
+		EncodeIndexedRect16((CARD8 *)m_buffer, w * h);
+
+		for (i = 0; i < m_paletteNumColors; i++) {
+			((CARD16 *)paletteBuf)[i] =
+				(CARD16)m_palette.entry[i].listNode->rgb;
+		}
+
+		memcpy(&m_hdrBuffer[m_hdrBufferBytes], paletteBuf,
+			   m_paletteNumColors * 2);
+		m_hdrBufferBytes += m_paletteNumColors * 2;
+		break;
+
+	default:
+		return -1;				// Should never happen.
+	}
+
+	return CompressData(dest, streamId, w * h,
+						m_conf[m_compresslevel].idxZlibLevel,
+						Z_DEFAULT_STRATEGY);
+}
+
+int
+vncEncodeTight::SendFullColorRect(BYTE *dest, int w, int h)
+{
+	const int streamId = 0;
+	int len;
+
+	m_hdrBuffer[m_hdrBufferBytes++] = 0x00;
+
+	if (m_usePixelFormat24) {
+		Pack24(m_buffer, w * h);
+		len = 3;
+	} else
+		len = m_remoteformat.bitsPerPixel / 8;
+
+	return CompressData(dest, streamId, w * h * len,
+						m_conf[m_compresslevel].rawZlibLevel,
+						Z_DEFAULT_STRATEGY);
+}
+
+int
+vncEncodeTight::SendGradientRect(BYTE *dest, int w, int h)
+{
+	const int streamId = 3;
+	int len;
+
+	if (m_remoteformat.bitsPerPixel == 8)
+		return SendFullColorRect(dest, w, h);
+
+	if (m_prevRowBuf == NULL)
+		m_prevRowBuf = new int [2048*3];
+
+	m_hdrBuffer[m_hdrBufferBytes++] = (streamId | rfbTightExplicitFilter) << 4;
+	m_hdrBuffer[m_hdrBufferBytes++] = rfbTightFilterGradient;
+
+	if (m_usePixelFormat24) {
+		FilterGradient24(m_buffer, w, h);
+		len = 3;
+	} else if (m_remoteformat.bitsPerPixel == 32) {
+		FilterGradient32((CARD32 *)m_buffer, w, h);
+		len = 4;
+	} else {
+		FilterGradient16((CARD16 *)m_buffer, w, h);
+		len = 2;
+	}
+
+	return CompressData(dest, streamId, w * h * len,
+						m_conf[m_compresslevel].gradientZlibLevel,
+						Z_FILTERED);
+}
+
+int
+vncEncodeTight::CompressData(BYTE *dest, int streamId, int dataLen,
+							 int zlibLevel, int zlibStrategy)
+{
+	if (dataLen < TIGHT_MIN_TO_COMPRESS) {
+		memcpy(dest, m_buffer, dataLen);
+		return dataLen;
+	}
+
+	z_streamp pz = &m_zsStruct[streamId];
+
+	// Initialize compression stream if needed.
+	if (!m_zsActive[streamId]) {
+		pz->zalloc = Z_NULL;
+		pz->zfree = Z_NULL;
+		pz->opaque = Z_NULL;
+
+		vnclog.Print(LL_INTINFO,
+					 VNCLOG("calling deflateInit2 with zlib level:%d\n"),
+					 zlibLevel);
+		int err = deflateInit2 (pz, zlibLevel, Z_DEFLATED, MAX_WBITS,
+								MAX_MEM_LEVEL, zlibStrategy);
+		if (err != Z_OK) {
+			vnclog.Print(LL_INTINFO,
+						 VNCLOG("deflateInit2 returned error:%d:%s\n"),
+						 err, pz->msg);
+			return -1;
+		}
+
+		m_zsActive[streamId] = true;
+		m_zsLevel[streamId] = zlibLevel;
+	}
+
+	int outBufferSize = dataLen + dataLen / 100 + 16;
+
+	// Prepare buffer pointers.
+	pz->next_in = (Bytef *)m_buffer;
+	pz->avail_in = dataLen;
+	pz->next_out = (Bytef *)dest;
+	pz->avail_out = outBufferSize;
+
+	// Change compression parameters if needed.
+	if (zlibLevel != m_zsLevel[streamId]) {
+		vnclog.Print(LL_INTINFO,
+					 VNCLOG("calling deflateParams with zlib level:%d\n"),
+					 zlibLevel);
+		int err = deflateParams (pz, zlibLevel, zlibStrategy);
+		if (err != Z_OK) {
+			vnclog.Print(LL_INTINFO,
+						 VNCLOG("deflateParams returned error:%d:%s\n"),
+						 err, pz->msg);
+			return -1;
+		}
+		m_zsLevel[streamId] = zlibLevel;
+	}
+
+	// Actual compression.
+	if ( deflate (pz, Z_SYNC_FLUSH) != Z_OK ||
+		 pz->avail_in != 0 || pz->avail_out == 0 ) {
+		vnclog.Print(LL_INTINFO, VNCLOG("deflate() call failed.\n"));
+		return -1;
+	}
+
+	return SendCompressedData(outBufferSize - pz->avail_out);
+}
+
+int
+vncEncodeTight::SendCompressedData(int compressedLen)
+{
+	// Prepare compressed data size for sending.
+	m_hdrBuffer[m_hdrBufferBytes++] = compressedLen & 0x7F;
+	if (compressedLen > 0x7F) {
+		m_hdrBuffer[m_hdrBufferBytes-1] |= 0x80;
+		m_hdrBuffer[m_hdrBufferBytes++] = compressedLen >> 7 & 0x7F;
+		if (compressedLen > 0x3FFF) {
+			m_hdrBuffer[m_hdrBufferBytes-1] |= 0x80;
+			m_hdrBuffer[m_hdrBufferBytes++] = compressedLen >> 14 & 0xFF;
+		}
+	}
+	return compressedLen;
+}
+
+void
+vncEncodeTight::FillPalette8(int count)
+{
+	CARD8 *data = (CARD8 *)m_buffer;
+	CARD8 c0, c1;
+	int i, n0, n1;
+
+	m_paletteNumColors = 0;
+
+	c0 = data[0];
+	for (i = 1; i < count && data[i] == c0; i++);
+	if (i == count) {
+		m_paletteNumColors = 1;
+		return; 				// Solid rectangle
+	}
+
+	if (m_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) {
+			m_monoBackground = (CARD32)c0;
+			m_monoForeground = (CARD32)c1;
+		} else {
+			m_monoBackground = (CARD32)c1;
+			m_monoForeground = (CARD32)c0;
+		}
+		m_paletteNumColors = 2;   // Two colors
+	}
+}
+
+#define DEFINE_FILL_PALETTE_FUNCTION(bpp)									  \
+																			  \
+void																		  \
+vncEncodeTight::FillPalette##bpp(int count) 								  \
+{																			  \
+	CARD##bpp *data = (CARD##bpp *)m_buffer;								  \
+	CARD##bpp c0, c1, ci;													  \
+	int i, n0, n1, ni;														  \
+																			  \
+	c0 = data[0];															  \
+	for (i = 1; i < count && data[i] == c0; i++);							  \
+	if (i >= count) {														  \
+		m_paletteNumColors = 1; /* Solid rectangle */						  \
+		return; 															  \
+	}																		  \
+																			  \
+	if (m_paletteMaxColors < 2) {											  \
+		m_paletteNumColors = 0; /* Full-color format 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) {														  \
+			m_monoBackground = (CARD32)c0;									  \
+			m_monoForeground = (CARD32)c1;									  \
+		} else {															  \
+			m_monoBackground = (CARD32)c1;									  \
+			m_monoForeground = (CARD32)c0;									  \
+		}																	  \
+		m_paletteNumColors = 2; /* Two colors */							  \
+		return; 															  \
+	}																		  \
+																			  \
+	PaletteReset(); 														  \
+	PaletteInsert (c0, (CARD32)n0, bpp);									  \
+	PaletteInsert (c1, (CARD32)n1, bpp);									  \
+																			  \
+	ni = 1; 																  \
+	for (i++; i < count; i++) { 											  \
+		if (data[i] == ci) {												  \
+			ni++;															  \
+		} else {															  \
+			if (!PaletteInsert (ci, (CARD32)ni, bpp))						  \
+				return; 													  \
+			ci = data[i];													  \
+			ni = 1; 														  \
+		}																	  \
+	}																		  \
+	PaletteInsert (ci, (CARD32)ni, bpp);									  \
+}
+
+DEFINE_FILL_PALETTE_FUNCTION(16)
+DEFINE_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))
+
+void
+vncEncodeTight::PaletteReset(void)
+{
+	m_paletteNumColors = 0;
+	memset(m_palette.hash, 0, 256 * sizeof(COLOR_LIST *));
+}
+
+int
+vncEncodeTight::PaletteInsert(CARD32 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 = m_palette.hash[hash_key];
+
+	while (pnode != NULL) {
+		if (pnode->rgb == rgb) {
+			// Such palette entry already exists.
+			new_idx = idx = pnode->idx;
+			count = m_palette.entry[idx].numPixels + numPixels;
+			if (new_idx && m_palette.entry[new_idx-1].numPixels < count) {
+				do {
+					m_palette.entry[new_idx] = m_palette.entry[new_idx-1];
+					m_palette.entry[new_idx].listNode->idx = new_idx;
+					new_idx--;
+				}
+				while (new_idx &&
+					   m_palette.entry[new_idx-1].numPixels < count);
+				m_palette.entry[new_idx].listNode = pnode;
+				pnode->idx = new_idx;
+			}
+			m_palette.entry[new_idx].numPixels = count;
+			return m_paletteNumColors;
+		}
+		prev_pnode = pnode;
+		pnode = pnode->next;
+	}
+
+	// Check if palette is full.
+	if ( m_paletteNumColors == 256 ||
+		 m_paletteNumColors == m_paletteMaxColors ) {
+		m_paletteNumColors = 0;
+		return 0;
+	}
+
+	// Move palette entries with lesser pixel counts.
+	for ( idx = m_paletteNumColors;
+		  idx > 0 && m_palette.entry[idx-1].numPixels < numPixels;
+		  idx-- ) {
+		m_palette.entry[idx] = m_palette.entry[idx-1];
+		m_palette.entry[idx].listNode->idx = idx;
+	}
+
+	// Add new palette entry into the freed slot.
+	pnode = &m_palette.list[m_paletteNumColors];
+	if (prev_pnode != NULL) {
+		prev_pnode->next = pnode;
+	} else {
+		m_palette.hash[hash_key] = pnode;
+	}
+	pnode->next = NULL;
+	pnode->idx = idx;
+	pnode->rgb = rgb;
+	m_palette.entry[idx].listNode = pnode;
+	m_palette.entry[idx].numPixels = numPixels;
+
+	return (++m_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.
+//
+
+void
+vncEncodeTight::Pack24(BYTE *buf, int count)
+{
+	CARD32 *buf32;
+	CARD32 pix;
+	int r_shift, g_shift, b_shift;
+
+	buf32 = (CARD32 *)buf;
+
+	if (!m_localformat.bigEndian == !m_remoteformat.bigEndian) {
+		r_shift = m_remoteformat.redShift;
+		g_shift = m_remoteformat.greenShift;
+		b_shift = m_remoteformat.blueShift;
+	} else {
+		r_shift = 24 - m_remoteformat.redShift;
+		g_shift = 24 - m_remoteformat.greenShift;
+		b_shift = 24 - m_remoteformat.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) 									  \
+																			  \
+void																		  \
+vncEncodeTight::EncodeIndexedRect##bpp(BYTE *buf, int count)				  \
+{																			  \
+	COLOR_LIST *pnode;														  \
+	CARD##bpp *src; 														  \
+	CARD##bpp rgb;															  \
+	int rep = 0;															  \
+																			  \
+	src = (CARD##bpp *) buf;												  \
+																			  \
+	while (count--) {														  \
+		rgb = *src++;														  \
+		while (count && *src == rgb) {										  \
+			rep++, src++, count--;											  \
+		}																	  \
+		pnode = m_palette.hash[HASH_FUNC##bpp(rgb)];						  \
+		while (pnode != NULL) { 											  \
+			if ((CARD##bpp)pnode->rgb == rgb) { 							  \
+				*buf++ = (CARD8)pnode->idx; 								  \
+				while (rep) {												  \
+					*buf++ = (CARD8)pnode->idx; 							  \
+					rep--;													  \
+				}															  \
+				break;														  \
+			}																  \
+			pnode = pnode->next;											  \
+		}																	  \
+	}																		  \
+}
+
+DEFINE_IDX_ENCODE_FUNCTION(16)
+DEFINE_IDX_ENCODE_FUNCTION(32)
+
+#define DEFINE_MONO_ENCODE_FUNCTION(bpp)									  \
+																			  \
+void																		  \
+vncEncodeTight::EncodeMonoRect##bpp(BYTE *buf, int w, int h)				  \
+{																			  \
+	CARD##bpp *ptr; 														  \
+	CARD##bpp bg;															  \
+	unsigned int value, mask;												  \
+	int aligned_width;														  \
+	int x, y, bg_bits;														  \
+																			  \
+	ptr = (CARD##bpp *) buf;												  \
+	bg = (CARD##bpp) m_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++ = (CARD8)value;											  \
+		}																	  \
+																			  \
+		mask = 0x80;														  \
+		value = 0;															  \
+		if (x >= w) 														  \
+			continue;														  \
+																			  \
+		for (; x < w; x++) {												  \
+			if (*ptr++ != bg) { 											  \
+				value |= mask;												  \
+			}																  \
+			mask >>= 1; 													  \
+		}																	  \
+		*buf++ = (CARD8)value;												  \
+	}																		  \
+}
+
+DEFINE_MONO_ENCODE_FUNCTION(8)
+DEFINE_MONO_ENCODE_FUNCTION(16)
+DEFINE_MONO_ENCODE_FUNCTION(32)
+
+
+//
+// ``Gradient'' filter for 24-bit color samples.
+// Should be called only when redMax, greenMax and blueMax are 255.
+// Color components assumed to be byte-aligned.
+//
+
+void
+vncEncodeTight::FilterGradient24(BYTE *buf, int w, int h)
+{
+	CARD32 *buf32;
+	CARD32 pix32;
+	int *prevRowPtr;
+	int shiftBits[3];
+	int pixHere[3], pixUpper[3], pixLeft[3], pixUpperLeft[3];
+	int prediction;
+	int x, y, c;
+
+	buf32 = (CARD32 *)buf;
+	memset (m_prevRowBuf, 0, w * 3 * sizeof(int));
+
+	if (!m_localformat.bigEndian == !m_remoteformat.bigEndian) {
+		shiftBits[0] = m_remoteformat.redShift;
+		shiftBits[1] = m_remoteformat.greenShift;
+		shiftBits[2] = m_remoteformat.blueShift;
+	} else {
+		shiftBits[0] = 24 - m_remoteformat.redShift;
+		shiftBits[1] = 24 - m_remoteformat.greenShift;
+		shiftBits[2] = 24 - m_remoteformat.blueShift;
+	}
+
+	for (y = 0; y < h; y++) {
+		for (c = 0; c < 3; c++) {
+			pixUpper[c] = 0;
+			pixHere[c] = 0;
+		}
+		prevRowPtr = m_prevRowBuf;
+		for (x = 0; x < w; x++) {
+			pix32 = *buf32++;
+			for (c = 0; c < 3; c++) {
+				pixUpperLeft[c] = pixUpper[c];
+				pixLeft[c] = pixHere[c];
+				pixUpper[c] = *prevRowPtr;
+				pixHere[c] = (int)(pix32 >> shiftBits[c] & 0xFF);
+				*prevRowPtr++ = pixHere[c];
+
+				prediction = pixLeft[c] + pixUpper[c] - pixUpperLeft[c];
+				if (prediction < 0) {
+					prediction = 0;
+				} else if (prediction > 0xFF) {
+					prediction = 0xFF;
+				}
+				*buf++ = (BYTE)(pixHere[c] - prediction);
+			}
+		}
+	}
+}
+
+
+//
+// ``Gradient'' filter for other color depths.
+//
+
+#define DEFINE_GRADIENT_FILTER_FUNCTION(bpp)								  \
+																			  \
+void																		  \
+vncEncodeTight::FilterGradient##bpp(CARD##bpp *buf, int w, int h)			  \
+{																			  \
+	CARD##bpp pix, diff;													  \
+	bool endianMismatch;													  \
+	int *prevRowPtr;														  \
+	int maxColor[3], shiftBits[3];											  \
+	int pixHere[3], pixUpper[3], pixLeft[3], pixUpperLeft[3];				  \
+	int prediction; 														  \
+	int x, y, c;															  \
+																			  \
+	memset (m_prevRowBuf, 0, w * 3 * sizeof(int));							  \
+																			  \
+	endianMismatch = (!m_localformat.bigEndian != !m_remoteformat.bigEndian); \
+																			  \
+	maxColor[0] = m_remoteformat.redMax;									  \
+	maxColor[1] = m_remoteformat.greenMax;									  \
+	maxColor[2] = m_remoteformat.blueMax;									  \
+	shiftBits[0] = m_remoteformat.redShift; 								  \
+	shiftBits[1] = m_remoteformat.greenShift;								  \
+	shiftBits[2] = m_remoteformat.blueShift;								  \
+																			  \
+	for (y = 0; y < h; y++) {												  \
+		for (c = 0; c < 3; c++) {											  \
+			pixUpper[c] = 0;												  \
+			pixHere[c] = 0; 												  \
+		}																	  \
+		prevRowPtr = m_prevRowBuf;											  \
+		for (x = 0; x < w; x++) {											  \
+			pix = *buf; 													  \
+			if (endianMismatch) {											  \
+				pix = Swap##bpp(pix);										  \
+			}																  \
+			diff = 0;														  \
+			for (c = 0; c < 3; c++) {										  \
+				pixUpperLeft[c] = pixUpper[c];								  \
+				pixLeft[c] = pixHere[c];									  \
+				pixUpper[c] = *prevRowPtr;									  \
+				pixHere[c] = (int)(pix >> shiftBits[c] & maxColor[c]);		  \
+				*prevRowPtr++ = pixHere[c]; 								  \
+																			  \
+				prediction = pixLeft[c] + pixUpper[c] - pixUpperLeft[c];	  \
+				if (prediction < 0) {										  \
+					prediction = 0; 										  \
+				} else if (prediction > maxColor[c]) {						  \
+					prediction = maxColor[c];								  \
+				}															  \
+				diff |= ((pixHere[c] - prediction) & maxColor[c])			  \
+					<< shiftBits[c];										  \
+			}																  \
+			if (endianMismatch) {											  \
+				diff = Swap##bpp(diff); 									  \
+			}																  \
+			*buf++ = diff;													  \
+		}																	  \
+	}																		  \
+}
+
+DEFINE_GRADIENT_FILTER_FUNCTION(16)
+DEFINE_GRADIENT_FILTER_FUNCTION(32)
+
+
+//
+// Code to guess if given rectangle is suitable for smooth image
+// compression (by applying "gradient" filter or JPEG coder).
+//
+
+#define JPEG_MIN_RECT_SIZE	4096
+
+#define DETECT_SUBROW_WIDTH   7
+#define DETECT_MIN_WIDTH	  8
+#define DETECT_MIN_HEIGHT	  8
+
+int
+vncEncodeTight::DetectSmoothImage (int w, int h)
+{
+	if ( m_localformat.bitsPerPixel == 8 || m_remoteformat.bitsPerPixel == 8 ||
+		 w < DETECT_MIN_WIDTH || h < DETECT_MIN_HEIGHT ) {
+		return 0;
+	}
+
+	if (m_qualitylevel != -1) {
+		if (w * h < JPEG_MIN_RECT_SIZE) {
+			return 0;
+		}
+	} else {
+		if (w * h < m_conf[m_compresslevel].gradientMinRectSize) {
+			return 0;
+		}
+	}
+
+	unsigned long avgError;
+	if (m_remoteformat.bitsPerPixel == 32) {
+		if (m_usePixelFormat24) {
+			avgError = DetectSmoothImage24(w, h);
+			if (m_qualitylevel != -1) {
+				return (avgError < m_conf[m_qualitylevel].jpegThreshold24);
+			}
+			return (avgError < m_conf[m_compresslevel].gradientThreshold24);
+		} else {
+			avgError = DetectSmoothImage32(w, h);
+		}
+	} else {
+		avgError = DetectSmoothImage16(w, h);
+	}
+	if (m_qualitylevel != -1) {
+		return (avgError < m_conf[m_qualitylevel].jpegThreshold);
+	}
+	return (avgError < m_conf[m_compresslevel].gradientThreshold);
+}
+
+unsigned long
+vncEncodeTight::DetectSmoothImage24 (int w, int h)
+{
+	int diffStat[256];
+	int pixelCount = 0;
+	int pix, left[3];
+	unsigned long avgError;
+
+	// If client is big-endian, color samples begin from the second
+	// byte (offset 1) of a 32-bit pixel value.
+	int off = (m_remoteformat.bigEndian != 0);
+
+	memset(diffStat, 0, 256*sizeof(int));
+
+	int y = 0, x = 0;
+	int d, dx, c;
+	while (y < h && x < w) {
+		for (d = 0; d < h - y && d < w - x - DETECT_SUBROW_WIDTH; d++) {
+			for (c = 0; c < 3; c++) {
+				left[c] = (int)m_buffer[((y+d)*w+x+d)*4+off+c] & 0xFF;
+			}
+			for (dx = 1; dx <= DETECT_SUBROW_WIDTH; dx++) {
+				for (c = 0; c < 3; c++) {
+					pix = (int)m_buffer[((y+d)*w+x+d+dx)*4+off+c] & 0xFF;
+					diffStat[abs(pix - left[c])]++;
+					left[c] = pix;
+				}
+				pixelCount++;
+			}
+		}
+		if (w > h) {
+			x += h;
+			y = 0;
+		} else {
+			x = 0;
+			y += w;
+		}
+	}
+
+	if (diffStat[0] * 33 / pixelCount >= 95)
+		return 0;
+
+	avgError = 0;
+	for (c = 1; c < 8; c++) {
+		avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);
+		if (diffStat[c] == 0 || diffStat[c] > diffStat[c-1] * 2)
+			return 0;
+	}
+	for (; c < 256; c++) {
+		avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);
+	}
+	avgError /= (pixelCount * 3 - diffStat[0]);
+
+	return avgError;
+}
+
+#define DEFINE_DETECT_FUNCTION(bpp) 										  \
+																			  \
+unsigned long																  \
+vncEncodeTight::DetectSmoothImage##bpp (int w, int h)						  \
+{																			  \
+	bool endianMismatch;													  \
+	CARD##bpp pix;															  \
+	int maxColor[3], shiftBits[3];											  \
+	int x, y, d, dx, c; 													  \
+	int diffStat[256];														  \
+	int pixelCount = 0; 													  \
+	int sample, sum, left[3];												  \
+	unsigned long avgError; 												  \
+																			  \
+	endianMismatch = (!m_localformat.bigEndian != !m_remoteformat.bigEndian); \
+																			  \
+	maxColor[0] = m_remoteformat.redMax;									  \
+	maxColor[1] = m_remoteformat.greenMax;									  \
+	maxColor[2] = m_remoteformat.blueMax;									  \
+	shiftBits[0] = m_remoteformat.redShift; 								  \
+	shiftBits[1] = m_remoteformat.greenShift;								  \
+	shiftBits[2] = m_remoteformat.blueShift;								  \
+																			  \
+	memset(diffStat, 0, 256*sizeof(int));									  \
+																			  \
+	y = 0, x = 0;															  \
+	while (y < h && x < w) {												  \
+		for (d = 0; d < h - y && d < w - x - DETECT_SUBROW_WIDTH; d++) {	  \
+			pix = ((CARD##bpp *)m_buffer)[(y+d)*w+x+d]; 					  \
+			if (endianMismatch) {											  \
+				pix = Swap##bpp(pix);										  \
+			}																  \
+			for (c = 0; c < 3; c++) {										  \
+				left[c] = (int)(pix >> shiftBits[c] & maxColor[c]); 		  \
+			}																  \
+			for (dx = 1; dx <= DETECT_SUBROW_WIDTH; dx++) { 				  \
+				pix = ((CARD##bpp *)m_buffer)[(y+d)*w+x+d+dx];				  \
+				if (endianMismatch) {										  \
+					pix = Swap##bpp(pix);									  \
+				}															  \
+				sum = 0;													  \
+				for (c = 0; c < 3; c++) {									  \
+					sample = (int)(pix >> shiftBits[c] & maxColor[c]);		  \
+					sum += abs(sample - left[c]);							  \
+					left[c] = sample;										  \
+				}															  \
+				if (sum > 255)												  \
+					sum = 255;												  \
+				diffStat[sum]++;											  \
+				pixelCount++;												  \
+			}																  \
+		}																	  \
+		if (w > h) {														  \
+			x += h; 														  \
+			y = 0;															  \
+		} else {															  \
+			x = 0;															  \
+			y += w; 														  \
+		}																	  \
+	}																		  \
+																			  \
+	if ((diffStat[0] + diffStat[1]) * 100 / pixelCount >= 90)				  \
+		return 0;															  \
+																			  \
+	avgError = 0;															  \
+	for (c = 1; c < 8; c++) {												  \
+		avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);	  \
+		if (diffStat[c] == 0 || diffStat[c] > diffStat[c-1] * 2)			  \
+			return 0;														  \
+	}																		  \
+	for (; c < 256; c++) {													  \
+		avgError += (unsigned long)diffStat[c] * (unsigned long)(c * c);	  \
+	}																		  \
+	avgError /= (pixelCount - diffStat[0]); 								  \
+																			  \
+	return avgError;														  \
+}
+
+DEFINE_DETECT_FUNCTION(16)
+DEFINE_DETECT_FUNCTION(32)
+
+//
+// JPEG compression stuff.
+//
+
+static bool jpegError;
+static int jpegDstDataLen;
+
+static void JpegSetDstManager(j_compress_ptr cinfo, JOCTET *buf, size_t buflen);
+
+int
+vncEncodeTight::SendJpegRect(BYTE *dst, int w, int h, int quality)
+{
+	struct jpeg_compress_struct cinfo;
+	struct jpeg_error_mgr jerr;
+
+	if (m_localformat.bitsPerPixel == 8)
+		return SendFullColorRect(dst, w, h);
+
+	BYTE *srcBuf = new BYTE[w * 3];
+	JSAMPROW rowPointer[1];
+	rowPointer[0] = (JSAMPROW)srcBuf;
+
+	cinfo.err = jpeg_std_error(&jerr);
+	jpeg_create_compress(&cinfo);
+
+	cinfo.image_width = w;
+	cinfo.image_height = h;
+	cinfo.input_components = 3;
+	cinfo.in_color_space = JCS_RGB;
+
+	jpeg_set_defaults(&cinfo);
+	jpeg_set_quality(&cinfo, quality, TRUE);
+
+	JpegSetDstManager (&cinfo, (JOCTET*)dst, w * h * (m_localformat.bitsPerPixel / 8));
+
+	jpeg_start_compress(&cinfo, TRUE);
+
+	for (int dy = 0; dy < h; dy++) {
+		PrepareRowForJpeg(srcBuf, dy, w);
+		jpeg_write_scanlines(&cinfo, rowPointer, 1);
+		if (jpegError)
+			break;
+	}
+
+	if (!jpegError)
+		jpeg_finish_compress(&cinfo);
+
+	jpeg_destroy_compress(&cinfo);
+	delete[] srcBuf;
+
+	if (jpegError)
+		return SendFullColorRect(dst, w, h);
+
+	m_hdrBuffer[m_hdrBufferBytes++] = rfbTightJpeg << 4;
+
+	return SendCompressedData(jpegDstDataLen);
+}
+
+void
+vncEncodeTight::PrepareRowForJpeg(BYTE *dst, int y, int w)
+{
+	if (m_remoteformat.bitsPerPixel == 32) {
+		CARD32 *src = (CARD32 *)&m_buffer[y * w * sizeof(CARD32)];
+		if (m_usePixelFormat24) {
+			PrepareRowForJpeg24(dst, src, w);
+		} else {
+			PrepareRowForJpeg32(dst, src, w);
+		}
+	} else {
+		// 16 bpp assumed.
+		CARD16 *src = (CARD16 *)&m_buffer[y * w * sizeof(CARD16)];
+		PrepareRowForJpeg16(dst, src, w);
+	}
+}
+
+void
+vncEncodeTight::PrepareRowForJpeg24(BYTE *dst, CARD32 *src, int count)
+{
+	int r_shift, g_shift, b_shift;
+	if (!m_localformat.bigEndian == !m_remoteformat.bigEndian) {
+		r_shift = m_remoteformat.redShift;
+		g_shift = m_remoteformat.greenShift;
+		b_shift = m_remoteformat.blueShift;
+	} else {
+		r_shift = 24 - m_remoteformat.redShift;
+		g_shift = 24 - m_remoteformat.greenShift;
+		b_shift = 24 - m_remoteformat.blueShift;
+	}
+
+	CARD32 pix;
+	while (count--) {
+		pix = *src++;
+		*dst++ = (BYTE)(pix >> r_shift);
+		*dst++ = (BYTE)(pix >> g_shift);
+		*dst++ = (BYTE)(pix >> b_shift);
+	}
+}
+
+#define DEFINE_JPEG_GET_ROW_FUNCTION(bpp)									\
+																			\
+void																		\
+vncEncodeTight::PrepareRowForJpeg##bpp(BYTE *dst, CARD##bpp *src, int count)\
+{																			\
+	bool endianMismatch =													\
+		(!m_localformat.bigEndian != !m_remoteformat.bigEndian);			\
+																			\
+	int r_shift = m_remoteformat.redShift;									\
+	int g_shift = m_remoteformat.greenShift;								\
+	int b_shift = m_remoteformat.blueShift; 								\
+	int r_max = m_remoteformat.redMax;										\
+	int g_max = m_remoteformat.greenMax;									\
+	int b_max = m_remoteformat.blueMax; 									\
+																			\
+	CARD##bpp pix;															\
+	while (count--) {														\
+		pix = *src++;														\
+		if (endianMismatch) {												\
+			pix = Swap##bpp(pix);											\
+		}																	\
+		*dst++ = (BYTE)((pix >> r_shift & r_max) * 255 / r_max);			\
+		*dst++ = (BYTE)((pix >> g_shift & g_max) * 255 / g_max);			\
+		*dst++ = (BYTE)((pix >> b_shift & b_max) * 255 / b_max);			\
+	}																		\
+}
+
+DEFINE_JPEG_GET_ROW_FUNCTION(16)
+DEFINE_JPEG_GET_ROW_FUNCTION(32)
+
+/*
+ * Destination manager implementation for JPEG library.
+ */
+
+static struct jpeg_destination_mgr jpegDstManager;
+static JOCTET *jpegDstBuffer;
+static size_t jpegDstBufferLen;
+
+static void JpegInitDestination(j_compress_ptr cinfo);
+static boolean JpegEmptyOutputBuffer(j_compress_ptr cinfo);
+static void JpegTermDestination(j_compress_ptr cinfo);
+
+static void
+JpegInitDestination(j_compress_ptr cinfo)
+{
+	jpegError = false;
+	jpegDstManager.next_output_byte = jpegDstBuffer;
+	jpegDstManager.free_in_buffer = jpegDstBufferLen;
+}
+
+static boolean
+JpegEmptyOutputBuffer(j_compress_ptr cinfo)
+{
+	jpegError = true;
+	jpegDstManager.next_output_byte = jpegDstBuffer;
+	jpegDstManager.free_in_buffer = jpegDstBufferLen;
+
+	return TRUE;
+}
+
+static void
+JpegTermDestination(j_compress_ptr cinfo)
+{
+	jpegDstDataLen = jpegDstBufferLen - jpegDstManager.free_in_buffer;
+}
+
+static void
+JpegSetDstManager(j_compress_ptr cinfo, JOCTET *buf, size_t buflen)
+{
+	jpegDstBuffer = buf;
+	jpegDstBufferLen = buflen;
+	jpegDstManager.init_destination = JpegInitDestination;
+	jpegDstManager.empty_output_buffer = JpegEmptyOutputBuffer;
+	jpegDstManager.term_destination = JpegTermDestination;
+	cinfo->dest = &jpegDstManager;
+}
+
diff --git a/ica/win32/winvnc/winvnc/vncEncodeTight.h b/ica/win32/winvnc/winvnc/vncEncodeTight.h
new file mode 100644
index 0000000..ea8b901
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncEncodeTight.h
@@ -0,0 +1,199 @@
+//  Copyright (C) 2000 Constantin Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+//
+// If the source code for the VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeTight object
+
+class vncEncodeTight;
+
+#if !defined(_WINVNC_ENCODETIGHT)
+#define _WINVNC_ENCODETIGHT
+#pragma once
+
+#include "vncencoder.h"
+
+#ifdef IPP
+#include "..\..\ipp_zlib\src\zlib\zlib.h"
+#else
+#include "zlib.h"
+#endif
+extern "C"
+{
+#ifdef IPP
+#include "libjpeg/jpeglib.h"
+#else
+#include "libjpeg-turbo-win/jpeglib.h"
+#endif
+}
+#include <math.h>
+
+// Minimum amount of data to be compressed. This value should not be
+// changed, doing so will break compatibility with existing clients.
+#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
+
+// C-style structures to store palette entries and compression paramentes.
+// Such code probably should be converted into C++ classes.
+
+struct COLOR_LIST {
+	COLOR_LIST *next;
+	int idx;
+	CARD32 rgb;
+};
+
+struct PALETTE_ENTRY {
+	COLOR_LIST *listNode;
+	int numPixels;
+};
+
+struct PALETTE {
+	PALETTE_ENTRY entry[256];
+	COLOR_LIST *hash[256];
+	COLOR_LIST list[256];
+};
+
+struct TIGHT_CONF {
+	int maxRectSize, maxRectWidth;
+	int monoMinRectSize, gradientMinRectSize;
+	int idxZlibLevel, monoZlibLevel, rawZlibLevel, gradientZlibLevel;
+	unsigned long gradientThreshold, gradientThreshold24;
+	int idxMaxColorsDivisor;
+	int jpegQuality;
+	unsigned long jpegThreshold, jpegThreshold24;
+};
+
+
+// Class definition
+
+class vncEncodeTight : public vncEncoder
+{
+// Fields
+public:
+
+// Methods
+public:
+	// Create/Destroy methods
+	vncEncodeTight();
+	~vncEncodeTight();
+
+	virtual void Init();
+	virtual const char* GetEncodingName() { return "Tight"; }
+
+	virtual UINT RequiredBuffSize(UINT width, UINT height);
+	virtual UINT NumCodedRects(RECT &rect);
+
+	virtual UINT EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &rect);
+
+// Implementation
+protected:
+	int m_paletteNumColors, m_paletteMaxColors;
+	CARD32 m_monoBackground, m_monoForeground;
+	PALETTE m_palette;
+
+	z_stream m_zsStruct[4];
+	bool m_zsActive[4];
+	int m_zsLevel[4];
+
+	BYTE *m_hdrBuffer;
+	int m_hdrBufferBytes;
+	BYTE *m_buffer;
+	int m_bufflen;
+	int *m_prevRowBuf;
+
+	bool m_usePixelFormat24;
+
+	static const TIGHT_CONF m_conf[10];
+
+	// Protected member functions.
+
+	void FindBestSolidArea(BYTE *source, int x, int y, int w, int h,
+						   CARD32 colorValue, int *w_ptr, int *h_ptr);
+	void ExtendSolidArea  (BYTE *source, int x, int y, int w, int h,
+						   CARD32 colorValue,
+						   int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr);
+	bool CheckSolidTile   (BYTE *source, int x, int y, int w, int h,
+						   CARD32 *colorPtr, bool needSameColor);
+	bool CheckSolidTile8  (BYTE *source, int x, int y, int w, int h,
+						   CARD32 *colorPtr, bool needSameColor);
+	bool CheckSolidTile16 (BYTE *source, int x, int y, int w, int h,
+						   CARD32 *colorPtr, bool needSameColor);
+	bool CheckSolidTile32 (BYTE *source, int x, int y, int w, int h,
+						   CARD32 *colorPtr, bool needSameColor);
+
+	UINT EncodeRectSimple (BYTE *source, VSocket *outConn, BYTE *dest,
+						   const RECT &rect);
+	UINT EncodeSubrect    (BYTE *source, VSocket *outConn, BYTE *dest,
+						   int x, int y, int w, int h);
+	void SendTightHeader  (int x, int y, int w, int h);
+
+	int SendSolidRect     (BYTE *dest);
+	int SendMonoRect      (BYTE *dest, int w, int h);
+	int SendIndexedRect   (BYTE *dest, int w, int h);
+	int SendFullColorRect (BYTE *dest, int w, int h);
+	int SendGradientRect  (BYTE *dest, int w, int h);
+	int CompressData      (BYTE *dest, int streamId, int dataLen,
+						   int zlibLevel, int zlibStrategy);
+	int SendCompressedData(int compressedLen);
+
+	void FillPalette8 (int count);
+	void FillPalette16(int count);
+	void FillPalette32(int count);
+
+	void PaletteReset(void);
+	int PaletteInsert(CARD32 rgb, int numPixels, int bpp);
+
+	void Pack24(BYTE *buf, int count);
+
+	void EncodeIndexedRect16(BYTE *buf, int count);
+	void EncodeIndexedRect32(BYTE *buf, int count);
+
+	void EncodeMonoRect8 (BYTE *buf, int w, int h);
+	void EncodeMonoRect16(BYTE *buf, int w, int h);
+	void EncodeMonoRect32(BYTE *buf, int w, int h);
+
+	void FilterGradient24(BYTE *buf, int w, int h);
+	void FilterGradient16(CARD16 *buf, int w, int h);
+	void FilterGradient32(CARD32 *buf, int w, int h);
+
+	int DetectSmoothImage (int w, int h);
+	unsigned long DetectSmoothImage24 (int w, int h);
+	unsigned long DetectSmoothImage16 (int w, int h);
+	unsigned long DetectSmoothImage32 (int w, int h);
+
+	int SendJpegRect(BYTE *dst, int w, int h, int quality);
+	void PrepareRowForJpeg(BYTE *dst, int y, int w);
+	void PrepareRowForJpeg24(BYTE *dst, CARD32 *src, int count);
+	void PrepareRowForJpeg16(BYTE *dst, CARD16 *src, int count);
+	void PrepareRowForJpeg32(BYTE *dst, CARD32 *src, int count);
+};
+
+#endif // _WINVNC_ENCODETIGHT
+
diff --git a/ica/win32/winvnc/winvnc/vncEncodeUltra.cpp b/ica/win32/winvnc/winvnc/vncEncodeUltra.cpp
new file mode 100644
index 0000000..b292458
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncEncodeUltra.cpp
@@ -0,0 +1,406 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+//
+// If the source code for the VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeUltra
+
+// This file implements the vncEncoder-derived vncEncodeUltra class.
+// This class overrides some vncEncoder functions to produce a bitmap
+// to Ultra encoder.  Ultra is much more efficient than RAW format on
+// most screen data and usually twice as efficient as hextile.  Of
+// course, Ultra compression uses more CPU time on the server.
+// However, over slower (64kbps or less) connections, the reduction
+// in data transmitted usually outweighs the extra latency added
+// while the server CPU performs the compression algorithms.
+
+#include "vncEncodeUltra.h"
+
+#define IN_LEN		(128*1024)
+#define OUT_LEN		(IN_LEN + IN_LEN / 64 + 16 + 3)
+#define HEAP_ALLOC(var,size) \
+	lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ]
+static HEAP_ALLOC(wrkmem,LZO1X_1_MEM_COMPRESS);
+
+vncEncodeUltra::vncEncodeUltra()
+{
+	m_buffer = NULL;
+	m_Queuebuffer = NULL;
+	m_QueueCompressedbuffer = NULL;
+	m_bufflen = 0;
+	m_Queuelen = 0;
+	MaxQueuebufflen=128*1024;
+
+	m_Queuebuffer = new BYTE [MaxQueuebufflen+1];
+		if (m_Queuebuffer == NULL)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("Memory error"));
+		}
+	m_QueueCompressedbuffer = new BYTE [MaxQueuebufflen+(MaxQueuebufflen/100)+8];
+		if (m_Queuebuffer == NULL)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("Memory error"));
+		}
+	lzo=false;
+}
+
+vncEncodeUltra::~vncEncodeUltra()
+{
+	if (m_buffer != NULL)
+	{
+		delete [] m_buffer;
+		m_buffer = NULL;
+	}
+
+	if (m_Queuebuffer != NULL)
+	{
+		delete [] m_Queuebuffer;
+		m_Queuebuffer = NULL;
+	}
+
+	if (m_QueueCompressedbuffer != NULL)
+	{
+		delete [] m_QueueCompressedbuffer;
+		m_QueueCompressedbuffer = NULL;
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("Ultra  encoder stats: rawdata=%d  protocol=%d compressed=%d transmitted=%d\n"),dataSize, rectangleOverhead, encodedSize,transmittedSize);
+
+	if (dataSize != 0) {
+		vnclog.Print(LL_INTINFO, VNCLOG("Ultra  encoder efficiency: %.3f%%\n"),(double)((double)((dataSize - transmittedSize) * 100) / dataSize));
+	}
+}
+
+void
+vncEncodeUltra::Init()
+{
+	totalraw=0;
+	encodedSize=0;
+	rectangleOverhead=0;
+	transmittedSize=0;
+	dataSize=0;
+	vncEncoder::Init();
+	m_nNbRects=0;
+	m_queueEnable = true; // sf at 2003
+}
+
+UINT
+vncEncodeUltra::RequiredBuffSize(UINT width, UINT height)
+{
+	int result;
+
+	// The Ultra library specifies a maximum compressed size of
+	// the raw size plus one percent plus 8 bytes.  We also need
+	// to cover the Ultra header space.
+	result = vncEncoder::RequiredBuffSize(width, height);
+	result += result/ 64 + 16 + 3 + sz_rfbZlibHeader+sz_rfbFramebufferUpdateRectHeader;
+	return result;
+}
+
+UINT
+vncEncodeUltra::NumCodedRects(const rfb::Rect &rect)
+{
+	return 0;
+	const int rectW = rect.br.x - rect.tl.x;
+	const int rectH = rect.br.y - rect.tl.y;
+	return (( rectH - 1 ) / ( Ultra_MAX_SIZE( rectW ) / rectW ) + 1 );
+}
+
+/*****************************************************************************
+ *
+ * Routines to implement Ultra Encoding (LZ+Huffman compression) by calling
+ * the included Ultra library.
+ */
+
+// Encode the rectangle using Ultra compression
+inline UINT
+vncEncodeUltra::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const rfb::Rect &rect)
+{
+	
+	int  totalSize = 0;
+	int  partialSize = 0;
+	int  maxLines;
+	int  linesRemaining;
+	RECT partialRect;
+	const int rectW = rect.br.x - rect.tl.x;
+	const int rectH = rect.br.y - rect.tl.y;
+
+	partialRect.right = rect.br.x;
+	partialRect.left = rect.tl.x;
+	partialRect.top = rect.tl.y;
+	partialRect.bottom = rect.br.y;
+
+	/* WBB: For testing purposes only! */
+	// vnclog.Print(LL_INTINFO, VNCLOG("rect.right=%d rect.left=%d rect.top=%d rect.bottom=%d\n"), rect.right, rect.left, rect.top, rect.bottom);
+
+	if (rectW==0) return 0;
+	if (rectH==0) return 0;
+	maxLines = ( Ultra_MAX_SIZE(rectW) / rectW );
+	linesRemaining = rectH;
+
+	while ( linesRemaining > 0 ) {
+
+		int linesToComp;
+
+		if ( maxLines < linesRemaining )
+			linesToComp = maxLines;
+		else
+			linesToComp = linesRemaining;
+
+		partialRect.bottom = partialRect.top + linesToComp;
+
+		/* WBB: For testing purposes only! */
+		// vnclog.Print(LL_INTINFO, VNCLOG("partialRect.right=%d partialRect.left=%d partialRect.top=%d partialRect.bottom=%d\n"), partialRect.right, partialRect.left, partialRect.top, partialRect.bottom);
+
+		partialSize = EncodeOneRect( source,dest, partialRect,outConn );
+		totalSize += partialSize;
+
+		linesRemaining -= linesToComp;
+		partialRect.top += linesToComp;
+
+		if (( linesRemaining > 0 ) &&
+			( partialSize > 0 ))
+		{
+			// Send the encoded data
+			outConn->SendExactQueue( (char *)dest, partialSize );
+			transmittedSize += partialSize;
+		}
+
+
+	}
+	transmittedSize += partialSize;
+
+	return partialSize;
+
+}
+
+// Encode the rectangle using zlib compression
+inline UINT
+vncEncodeUltra::EncodeOneRect(BYTE *source, BYTE *dest, const RECT &rect,VSocket *outConn)
+{
+	const int rectW = rect.right - rect.left;
+	const int rectH = rect.bottom - rect.top;
+	const int rawDataSize = (rectW*rectH*m_remoteformat.bitsPerPixel / 8);
+
+	if (!outConn->m_pIntegratedPluginInterface) m_queueEnable=false;
+	// Create the rectangle header
+	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
+	// Modif rdv at 2002 - v1.1.x - Application Resize
+	surh->r.x = (CARD16) rect.left-m_SWOffsetx;
+	surh->r.y = (CARD16) rect.top-m_SWOffsety;
+	surh->r.w = (CARD16) (rectW);
+	surh->r.h = (CARD16) (rectH);
+	surh->r.x = Swap16IfLE(surh->r.x);
+	surh->r.y = Swap16IfLE(surh->r.y);
+	surh->r.w = Swap16IfLE(surh->r.w);
+	surh->r.h = Swap16IfLE(surh->r.h);
+	surh->encoding = Swap32IfLE(rfbEncodingUltra);
+
+	dataSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
+	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+	
+	// create a space big enough for the Zlib encoded pixels
+	if (m_bufflen < rawDataSize)
+	{
+		if (m_buffer != NULL)
+		{
+			delete [] m_buffer;
+			m_buffer = NULL;
+		}
+		m_buffer = new BYTE [rawDataSize+1];
+		if (m_buffer == NULL)
+			return vncEncoder::EncodeRect(source, dest, rect);
+		m_bufflen = rawDataSize;
+	}
+	// Translate the data into our new buffer
+	Translate(source, m_buffer, rect);
+
+	// Perhaps we can queue the small updates and compress them combined
+	if (rawDataSize < VNC_ENCODE_ULTRA_MIN_COMP_SIZE)
+	{
+		if (m_queueEnable)
+			{
+				surh->encoding = Swap32IfLE(rfbEncodingRaw);
+				memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,rawDataSize);
+				AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +rawDataSize,outConn,0);
+				return 0;
+			}
+		else return vncEncoder::EncodeRect(source, dest, rect);
+	}
+
+	
+	if (rawDataSize<1000 && m_queueEnable)
+		{
+			surh->encoding = Swap32IfLE(rfbEncodingRaw);
+			memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,rawDataSize);
+			AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +rawDataSize,outConn,1);
+			return 0;
+		}
+
+	surh->encoding = Swap32IfLE(rfbEncodingUltra);
+				
+	if (lzo==false)
+		{
+			if (lzo_init() == LZO_E_OK) lzo=true;
+		}
+	lzo1x_1_compress(m_buffer,rawDataSize,dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader,&out_len,wrkmem);
+	if (out_len > (lzo_uint)rawDataSize)
+				{
+					return vncEncoder::EncodeRect(source, dest, rect);
+				}
+	
+		// Format the ZlibHeader
+		rfbZlibHeader *zlibh=(rfbZlibHeader *)(dest+sz_rfbFramebufferUpdateRectHeader);
+		zlibh->nBytes = Swap32IfLE(out_len);
+	
+		// Update statistics
+		encodedSize += sz_rfbZlibHeader + out_len;
+		rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+
+		// Return the amount of data sent	
+		return sz_rfbFramebufferUpdateRectHeader +
+			sz_rfbZlibHeader +
+			out_len;
+
+}
+
+
+
+void
+vncEncodeUltra::AddToQueu(BYTE *source,int sizerect,VSocket *outConn,int updatetype)
+{
+	if (m_Queuelen+sizerect>(MaxQueuebufflen)) SendUltrarects(outConn);
+	memcpy(m_Queuebuffer+m_Queuelen,source,sizerect);
+	m_Queuelen+=sizerect;
+	m_nNbRects++;
+	if (updatetype==1) must_be_zipped=true;
+	if (m_nNbRects>0) SendUltrarects(outConn);
+}
+
+void
+vncEncodeUltra::AddToQueu2(BYTE *source,int sizerect,VSocket *outConn,int updatetype)
+{
+	BYTE *databegin=m_QueueCompressedbuffer+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader;
+	rfbFramebufferUpdateRectHeader *CacheRectsHeader=(rfbFramebufferUpdateRectHeader*)m_QueueCompressedbuffer;
+	rfbZlibHeader *CacheZipHeader=(rfbZlibHeader*)m_QueueCompressedbuffer+sz_rfbFramebufferUpdateRectHeader;
+	const lzo_uint rawDataSize = (sizerect);
+	lzo1x_1_compress(source,rawDataSize,databegin,&out_len,wrkmem);
+
+	if (out_len>rawDataSize)
+				{
+					outConn->SendExactQueue( (char *)source, sizerect); // 1 Small update
+					encodedSize += sizerect-sz_rfbFramebufferUpdateRectHeader;
+					rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+					return;
+				}
+
+	int rawDataSize1=rawDataSize/65535;
+	int rawDataSize2=rawDataSize%65535;
+
+	CacheRectsHeader->r.x = (CARD16)(1);
+	CacheRectsHeader->r.y = (CARD16)(rawDataSize2);
+	CacheRectsHeader->r.w = (CARD16)(rawDataSize1);
+	CacheRectsHeader->r.x = Swap16IfLE(CacheRectsHeader->r.x);
+	CacheRectsHeader->r.y = Swap16IfLE(CacheRectsHeader->r.y);
+	CacheRectsHeader->r.w = Swap16IfLE(CacheRectsHeader->r.w);
+ 	CacheRectsHeader->r.h = 0;
+	CacheRectsHeader->encoding = Swap32IfLE(rfbEncodingUltraZip);
+
+	// Format the UltraHeader
+	CacheZipHeader->nBytes = Swap32IfLE(out_len);
+
+	vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d\r\n"),out_len,rawDataSize,1);
+	outConn->SendExactQueue((char *)m_QueueCompressedbuffer, out_len+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader);
+	// Update statistics
+	encodedSize += sz_rfbZlibHeader + out_len;
+	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+	transmittedSize += out_len+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader;
+}
+
+void
+vncEncodeUltra::SendUltrarects(VSocket *outConn)
+{
+	int NRects=m_nNbRects;
+	const lzo_uint rawDataSize = (m_Queuelen);
+
+	if (NRects==0) return; // NO update
+	if (m_nNbRects<3 && !must_be_zipped) 
+	{
+		outConn->SendExactQueue( (char *)m_Queuebuffer, m_Queuelen); // 1 Small update
+		m_nNbRects=0;
+		m_Queuelen=0;
+		encodedSize += m_Queuelen-sz_rfbFramebufferUpdateRectHeader;
+		rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+		return;
+	}
+	m_nNbRects=0;
+	m_Queuelen=0;
+	must_be_zipped=false;
+
+	lzo1x_1_compress(m_Queuebuffer,rawDataSize,m_QueueCompressedbuffer,&out_len,wrkmem);
+
+	if (out_len>rawDataSize)
+				{
+					outConn->SendExactQueue( (char *)m_Queuebuffer, m_Queuelen); // 1 Small update
+					m_nNbRects=0;
+					m_Queuelen=0;
+					encodedSize += m_Queuelen-sz_rfbFramebufferUpdateRectHeader;
+					rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+					return;
+				}
+
+	int rawDataSize1=rawDataSize/65535;
+	int rawDataSize2=rawDataSize%65535;
+
+	rfbFramebufferUpdateRectHeader CacheRectsHeader;
+	CacheRectsHeader.r.x = (CARD16)(NRects);
+	CacheRectsHeader.r.y = (CARD16)(rawDataSize2);
+	CacheRectsHeader.r.w = (CARD16)(rawDataSize1);
+	CacheRectsHeader.r.x = Swap16IfLE(CacheRectsHeader.r.x);
+	CacheRectsHeader.r.y = Swap16IfLE(CacheRectsHeader.r.y);
+	CacheRectsHeader.r.w = Swap16IfLE(CacheRectsHeader.r.w);
+ 	CacheRectsHeader.r.h = 0;
+	CacheRectsHeader.encoding = Swap32IfLE(rfbEncodingUltraZip);
+
+	// Format the UltraHeader
+	rfbZlibHeader CacheZipHeader;
+	CacheZipHeader.nBytes = Swap32IfLE(out_len);
+
+	vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d\r\n"),out_len,rawDataSize,NRects);
+	outConn->SendExactQueue((char *)&CacheRectsHeader, sizeof(CacheRectsHeader));
+	outConn->SendExactQueue((char *)&CacheZipHeader, sizeof(CacheZipHeader));
+	outConn->SendExactQueue((char *)m_QueueCompressedbuffer, out_len);
+	// Update statistics
+	encodedSize += sz_rfbZlibHeader + out_len;
+	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+	transmittedSize += out_len+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader;
+}
+
+void
+vncEncodeUltra::LastRect(VSocket *outConn)
+{
+	SendUltrarects(outConn);
+}
diff --git a/ica/win32/winvnc/winvnc/vncEncodeUltra.h b/ica/win32/winvnc/winvnc/vncEncodeUltra.h
new file mode 100644
index 0000000..6e0d1de
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncEncodeUltra.h
@@ -0,0 +1,107 @@
+//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+//
+// If the source code for the VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeUltra object
+
+// The vncEncodeUltra object uses a Ultra based compression encoding to send rectangles
+// to a client
+
+class vncEncodeUltra;
+
+#if !defined(_WINVNC_EncodeULTRA)
+#define _WINVNC_EncodeULTRA
+#pragma once
+
+#include "vncencoder.h"
+#include "lzo/minilzo.h"
+
+// Minimum Ultra rectangle size in bytes.  Anything smaller will
+// not compress well due to overhead.
+#define VNC_ENCODE_ULTRA_MIN_COMP_SIZE (32)
+
+// Set maximum Ultra rectangle size in pixels.  Always allow at least
+// two scan lines.
+#define Ultra_MAX_RECT_SIZE (16*1024)
+#define Ultra_MAX_SIZE(min) ((( min * 2 ) > Ultra_MAX_RECT_SIZE ) ? ( min * 2 ) : Ultra_MAX_RECT_SIZE )
+#define SOLID_COLOR	0 // 1 color
+#define MONO_COLOR	1 //2 colors
+#define MULTI_COLOR	2 // >2 colors
+#define PURE_Ultra	3 
+#define	XOR_SEQUENCE 4 //XOR previous image
+
+
+// Class definition
+
+class vncEncodeUltra : public vncEncoder
+{
+// Fields
+public:
+
+// Methods
+public:
+	// Create/Destroy methods
+	vncEncodeUltra();
+	~vncEncodeUltra();
+
+	virtual void Init();
+	virtual const char* GetEncodingName() { return "Ultra"; }
+
+	virtual UINT RequiredBuffSize(UINT width, UINT height);
+	virtual UINT NumCodedRects(const rfb::Rect &rect);
+
+	virtual UINT EncodeRect(BYTE *source,VSocket *outConn, BYTE *dest, const rfb::Rect &rect);
+	virtual UINT EncodeOneRect(BYTE *source ,BYTE *dest, const RECT &rect,VSocket *outConn);
+
+	virtual void LastRect(VSocket *outConn);
+	virtual void AddToQueu(BYTE *source,int size,VSocket *outConn,int must_be_zipped);
+	virtual void AddToQueu2(BYTE *source,int size,VSocket *outConn,int must_be_zipped);
+	virtual void SendUltrarects(VSocket *outConn);
+
+	void EnableQueuing(BOOL fEnable){ m_queueEnable = fEnable; };
+
+// Implementation
+protected:
+	BYTE		      *m_buffer;
+	BYTE			  *m_Queuebuffer;
+	BYTE			  *m_QueueCompressedbuffer;
+	int			       m_bufflen;
+	int totalraw;
+	int SoMoMu; //solid/mono/multi color
+
+	int				   m_Queuebufflen;
+	int				   MaxQueuebufflen;
+	int				   m_Queuelen;
+	int				   m_nNbRects;
+	int				   must_be_zipped;
+	BOOL				m_queueEnable;
+
+	bool				lzo;
+	lzo_uint out_len;
+};
+
+#endif // _WINVNC_EncodeUltra
+
diff --git a/ica/win32/winvnc/winvnc/vncEncodeUltra2.cpp b/ica/win32/winvnc/winvnc/vncEncodeUltra2.cpp
new file mode 100644
index 0000000..01c19df
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncEncodeUltra2.cpp
@@ -0,0 +1,319 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+//
+// If the source code for the VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeUltra2
+
+// This file implements the vncEncoder-derived vncEncodeUltra2 class.
+// This class overrides some vncEncoder functions to produce a bitmap
+// to Ultra encoder.  Ultra is much more efficient than RAW format on
+// most screen data and usually twice as efficient as hextile.  Of
+// course, Ultra compression uses more CPU time on the server.
+// However, over slower (64kbps or less) connections, the reduction
+// in data transmitted usually outweighs the extra latency added
+// while the server CPU performs the compression algorithms.
+
+#include "vncEncodeUltra2.h"
+#include <mmsystem.h>
+
+struct jpeg_destination_mgr jpegDstManager;
+static JOCTET *jpegDstBuffer;
+static size_t jpegDstBufferLen;
+static void JpegInitDestination(j_compress_ptr cinfo);
+static boolean JpegEmptyOutputBuffer(j_compress_ptr cinfo);
+static void JpegTermDestination(j_compress_ptr cinfo);
+static void JpegSetDstManager(j_compress_ptr cinfo, JOCTET *buf, size_t buflen);
+static bool jpegError;
+static int jpegDstDataLen;
+
+#define IN_LEN		(128*1024)
+#define OUT_LEN		(IN_LEN + IN_LEN / 64 + 16 + 3)
+#define HEAP_ALLOC(var,size) \
+	lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ]
+static HEAP_ALLOC(wrkmem,LZO1X_1_MEM_COMPRESS);
+
+
+vncEncodeUltra2::vncEncodeUltra2()
+{
+	m_buffer = NULL;
+	m_bufflen = 0;
+	destbuffer=NULL;
+}
+
+vncEncodeUltra2::~vncEncodeUltra2()
+{
+	if (m_buffer != NULL)
+	{
+		delete [] m_buffer;
+		m_buffer = NULL;
+	}
+	if (destbuffer!=0) free (destbuffer);
+}
+
+void
+vncEncodeUltra2::Init()
+{
+	encodedSize=0;
+	rectangleOverhead=0;
+	transmittedSize=0;
+	dataSize=0;
+	vncEncoder::Init();
+}
+
+UINT
+vncEncodeUltra2::RequiredBuffSize(UINT width, UINT height)
+{
+	int result;
+
+	// The Ultra library specifies a maximum compressed size of
+	// the raw size plus one percent plus 8 bytes.  We also need
+	// to cover the Ultra header space.
+	result = vncEncoder::RequiredBuffSize(width, height);
+	result += result/ 64 + 16 + 3 + sz_rfbZlibHeader+sz_rfbFramebufferUpdateRectHeader+ sz_rfbZlibHeader;
+	return result;
+}
+
+
+UINT
+vncEncodeUltra2::NumCodedRects(const rfb::Rect &rect)
+{
+	return 0;
+}
+
+/*****************************************************************************
+ *
+ * Routines to implement Ultra Encoding (LZ+Huffman compression) by calling
+ * the included Ultra library.
+ */
+
+// Encode the rectangle using Ultra compression
+// Encode the rectangle using Ultra compression
+inline UINT
+vncEncodeUltra2::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const rfb::Rect &rect2)
+{
+
+	int  Size = 0;
+	rfb::Rect rect;
+	rect.br.x=rect2.br.x;
+	rect.br.y=rect2.br.y;
+	rect.tl.x=rect2.tl.x;
+	rect.tl.y=rect2.tl.y;
+	while(((rect.br.x-rect.tl.x))/8*8!=(rect.br.x-rect.tl.x))
+		{
+		
+			if (rect.br.x+1<=framebufferWidth) rect.br.x+=1;
+			else if (rect.tl.x-1>=0) rect.tl.x-=1;
+			
+		}
+		while(((rect.br.y-rect.tl.y))/8*8!=(rect.br.y-rect.tl.y))
+		{
+		
+			if (rect.br.y+1<=framebufferHeight) rect.br.y+=1;
+			else if (rect.tl.y-1>=0) rect.tl.y-=1;
+			
+		}
+
+	const int rectW = rect.br.x - rect.tl.x;
+	const int rectH = rect.br.y - rect.tl.y;
+	const int rawDataSize = (rectW*rectH*m_remoteformat.bitsPerPixel / 8);
+
+	if (rectW==0) return 0;
+	if (rectH==0) return 0;
+
+	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
+	// Modif rdv at 2002 - v1.1.x - Application Resize
+	surh->r.x = (CARD16) rect.tl.x-m_SWOffsetx;
+	surh->r.y = (CARD16) rect.tl.y-m_SWOffsety;
+	surh->r.w = (CARD16) (rectW);
+	surh->r.h = (CARD16) (rectH);
+	surh->r.x = Swap16IfLE(surh->r.x);
+	surh->r.y = Swap16IfLE(surh->r.y);
+	surh->r.w = Swap16IfLE(surh->r.w);
+	surh->r.h = Swap16IfLE(surh->r.h);
+	surh->encoding = Swap32IfLE(rfbEncodingUltra2);
+
+	// create a space big enough for the Zlib encoded pixels
+	if (m_bufflen < rawDataSize)
+	{
+		if (m_buffer != NULL)
+		{
+			delete [] m_buffer;
+			m_buffer = NULL;
+		}
+		m_buffer = new BYTE [rawDataSize+1];
+		if (m_buffer == NULL)
+			return vncEncoder::EncodeRect(source, dest, rect);
+		m_bufflen = rawDataSize;
+	}
+	// Translate the data into our new buffer
+	Translate(source, m_buffer, rect);
+	rfbZlibHeader *zlibh=(rfbZlibHeader *)(dest+sz_rfbFramebufferUpdateRectHeader);
+
+	if ((rectW*rectH)<1024)
+	{
+		
+		if (rawDataSize < 64)
+		{
+			return vncEncoder::EncodeRect(source, dest, rect);
+		}
+				
+		if (lzo==false)
+		{
+			if (lzo_init() == LZO_E_OK) lzo=true;
+		}
+		lzo1x_1_compress(m_buffer,rawDataSize,dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader,&out_len,wrkmem);
+		if (out_len > (lzo_uint)rawDataSize)
+				{
+					return vncEncoder::EncodeRect(source, dest, rect);
+				}
+		surh->encoding = Swap32IfLE(rfbEncodingUltra);
+		zlibh->nBytes = Swap32IfLE(out_len);
+		Size=out_len;
+	}
+	else
+	{
+		Size=SendJpegRect(m_buffer,dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader, rawDataSize, rectW , rectH , m_qualitylevel*10,m_remoteformat);		
+		zlibh->nBytes = Swap32IfLE(Size);
+	}
+	transmittedSize += sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader+ Size;
+	return sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader+ Size;
+}
+
+int
+vncEncodeUltra2::SendJpegRect(BYTE *src,BYTE *dst, int dst_size, int w, int h, int quality,rfbPixelFormat m_remoteformat)
+{
+
+  struct jpeg_compress_struct cinfo;
+  struct jpeg_error_mgr jerr;
+
+  cinfo.err = jpeg_std_error(&jerr);
+  jpeg_create_compress(&cinfo);
+  BYTE *srcBuf=NULL;
+
+  cinfo.image_width = w;
+  cinfo.image_height = h;
+  cinfo.in_color_space = JCS_RGB;
+  cinfo.input_components = 3;
+
+#ifdef JCS_EXTENSIONS
+  // Try to have libjpeg read directly from our native format
+  if(m_remoteformat.bitsPerPixel==32) {
+    int redShift, greenShift, blueShift;
+
+    if(m_remoteformat.bigEndian) {
+      redShift = 24 - m_remoteformat.redShift;
+      greenShift = 24 - m_remoteformat.greenShift;
+      blueShift = 24 - m_remoteformat.blueShift;
+    } else {
+      redShift = m_remoteformat.redShift;
+      greenShift = m_remoteformat.greenShift;
+      blueShift = m_remoteformat.blueShift;
+    }
+
+    if(redShift == 0 && greenShift == 8 && blueShift == 16)
+      cinfo.in_color_space = JCS_EXT_RGBX;
+    if(redShift == 16 && greenShift == 8 && blueShift == 0)
+      cinfo.in_color_space = JCS_EXT_BGRX;
+    if(redShift == 24 && greenShift == 16 && blueShift == 8)
+      cinfo.in_color_space = JCS_EXT_XBGR;
+    if(redShift == 8 && greenShift == 16 && blueShift == 24)
+      cinfo.in_color_space = JCS_EXT_XRGB;
+
+    if (cinfo.in_color_space != JCS_RGB) {
+      srcBuf = src;
+      cinfo.input_components = 4;
+    }
+  }
+#endif
+
+  jpeg_set_defaults(&cinfo);
+  jpeg_set_quality(&cinfo, quality, TRUE);
+  if(quality >= 96) cinfo.dct_method = JDCT_ISLOW;
+  else cinfo.dct_method = JDCT_FASTEST;
+
+   cinfo.comp_info[0].h_samp_factor = 2;
+   cinfo.comp_info[0].v_samp_factor = 2;
+
+  JpegSetDstManager(&cinfo, dst, dst_size);
+
+  JSAMPROW *rowPointer = new JSAMPROW[h];
+  for (int dy = 0; dy < h; dy++)
+    rowPointer[dy] = (JSAMPROW)(&srcBuf[dy * w * 4]);
+
+  jpeg_start_compress(&cinfo, TRUE);
+  while (cinfo.next_scanline < cinfo.image_height)
+  {
+    jpeg_write_scanlines(&cinfo, &rowPointer[cinfo.next_scanline],
+      cinfo.image_height - cinfo.next_scanline);
+	if (jpegError)
+			break;
+  }
+
+  if (!jpegError)
+		jpeg_finish_compress(&cinfo);
+  jpeg_destroy_compress(&cinfo);
+
+  delete[] rowPointer;
+  if (jpegError) return 0;
+  return jpegDstDataLen;
+}
+
+
+void
+JpegInitDestination(j_compress_ptr cinfo)
+{
+	jpegError = false;
+	jpegDstManager.next_output_byte = jpegDstBuffer;
+	jpegDstManager.free_in_buffer = jpegDstBufferLen;
+}
+
+boolean
+JpegEmptyOutputBuffer(j_compress_ptr cinfo)
+{
+	jpegError = true;
+	jpegDstManager.next_output_byte = jpegDstBuffer;
+	jpegDstManager.free_in_buffer = jpegDstBufferLen;
+
+	return TRUE;
+}
+
+void
+JpegTermDestination(j_compress_ptr cinfo)
+{
+	jpegDstDataLen = jpegDstBufferLen - jpegDstManager.free_in_buffer;
+}
+
+void
+JpegSetDstManager(j_compress_ptr cinfo, JOCTET *buf, size_t buflen)
+{
+	jpegDstBuffer = buf;
+	jpegDstBufferLen = buflen;
+	jpegDstManager.init_destination = JpegInitDestination;
+	jpegDstManager.empty_output_buffer = JpegEmptyOutputBuffer;
+	jpegDstManager.term_destination = JpegTermDestination;
+	cinfo->dest = &jpegDstManager;
+}
diff --git a/ica/win32/winvnc/winvnc/vncEncodeUltra2.h b/ica/win32/winvnc/winvnc/vncEncodeUltra2.h
new file mode 100644
index 0000000..a052666
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncEncodeUltra2.h
@@ -0,0 +1,74 @@
+//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+//
+// If the source code for the VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeUltra2 object
+
+// The vncEncodeUltra2 object uses a Ultra based compression encoding to send rectangles
+// to a client
+
+class vncEncodeUltra2;
+
+#if !defined(_WINVNC_EncodeULTRA2)
+#define _WINVNC_EncodeULTRA2
+#pragma once
+#include "vncencoder.h"
+#include "lzo/minilzo.h"
+#include "libjpeg-turbo-win/jpeglib.h"
+
+// Class definition
+
+class vncEncodeUltra2 : public vncEncoder
+{
+// Fields
+public:
+
+// Methods
+public:
+	// Create/Destroy methods
+	vncEncodeUltra2();
+	~vncEncodeUltra2();
+
+	virtual void Init();
+	virtual const char* GetEncodingName() { return "Ultra"; }
+
+	virtual UINT RequiredBuffSize(UINT width, UINT height);
+	virtual UINT NumCodedRects(const rfb::Rect &rect);
+
+	virtual UINT EncodeRect(BYTE *source,VSocket *outConn, BYTE *dest, const rfb::Rect &rect);
+
+// Implementation
+public:
+	BYTE		      *m_buffer;
+	int			       m_bufflen;
+	int SendJpegRect(BYTE *src,BYTE *dst, int dst_size, int w, int h, int quality,rfbPixelFormat m_remoteformat);
+	bool				lzo;
+	lzo_uint out_len;
+	unsigned char *destbuffer;
+};
+
+#endif // _WINVNC_EncodeUltra
+
diff --git a/ica/win32/winvnc/winvnc/vncEncodeZlib.cpp b/ica/win32/winvnc/winvnc/vncEncodeZlib.cpp
new file mode 100644
index 0000000..794f92f
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncEncodeZlib.cpp
@@ -0,0 +1,683 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+//
+// If the source code for the VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeZlib
+
+// This file implements the vncEncoder-derived vncEncodeZlib class.
+// This class overrides some vncEncoder functions to produce a bitmap
+// to Zlib encoder.  Zlib is much more efficient than RAW format on
+// most screen data and usually twice as efficient as hextile.  Of
+// course, zlib compression uses more CPU time on the server.
+// However, over slower (64kbps or less) connections, the reduction
+// in data transmitted usually outweighs the extra latency added
+// while the server CPU performs the compression algorithms.
+
+#include "vncEncodeZlib.h"
+
+vncEncodeZlib::vncEncodeZlib()
+{
+	m_buffer = NULL;
+	m_buffer2 = NULL;
+	m_Queuebuffer = NULL;
+	m_QueueCompressedbuffer = NULL;
+	m_bufflen = 0;
+	m_Queuelen = 0;
+	m_Maskbuffer =NULL;
+	m_MaskbufferSize =0;
+	compStreamInited = false;
+	MaxQueuebufflen=128*1024;
+	m_Queuebuffer = new BYTE [MaxQueuebufflen+1];
+		if (m_Queuebuffer == NULL)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("Memory error"));
+		}
+	m_QueueCompressedbuffer = new BYTE [MaxQueuebufflen+(MaxQueuebufflen/100)+8];
+		if (m_Queuebuffer == NULL)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("Memory error"));
+		}
+}
+
+vncEncodeZlib::~vncEncodeZlib()
+{
+	if (m_buffer != NULL)
+	{
+		delete [] m_buffer;
+		m_buffer = NULL;
+	}
+
+	if (m_buffer2 != NULL)
+	{
+		delete [] m_buffer2;
+		m_buffer2 = NULL;
+	}
+
+	if (m_Queuebuffer != NULL)
+	{
+		delete [] m_Queuebuffer;
+		m_Queuebuffer = NULL;
+	}
+
+	if (m_QueueCompressedbuffer != NULL)
+	{
+		delete [] m_QueueCompressedbuffer;
+		m_QueueCompressedbuffer = NULL;
+	}
+
+	if (m_Maskbuffer !=NULL)
+	{
+		delete [] m_Maskbuffer;
+		m_Maskbuffer = NULL;
+
+	}
+
+	if ( compStreamInited == true )
+	{
+		deflateEnd( &compStream );
+	}
+	compStreamInited = false;
+
+	vnclog.Print(LL_INTINFO, VNCLOG("Zlib Xor encoder stats: rawdata=%d  protocol=%d compressed=%d transmitted=%d\n"),dataSize, rectangleOverhead, encodedSize,transmittedSize);
+
+	if (dataSize != 0) {
+		vnclog.Print(LL_INTINFO, VNCLOG("Zlib Xor encoder efficiency: %.3f%%\n"),(double)((double)((dataSize - transmittedSize) * 100) / dataSize));
+	}
+}
+
+void
+vncEncodeZlib::Init()
+{
+	totalraw=0;
+	encodedSize=0;
+	rectangleOverhead=0;
+	transmittedSize=0;
+	dataSize=0;
+	vncEncoder::Init();
+	m_nNbRects=0;
+}
+
+UINT
+vncEncodeZlib::RequiredBuffSize(UINT width, UINT height)
+{
+	int result;
+
+	// The zlib library specifies a maximum compressed size of
+	// the raw size plus one percent plus 8 bytes.  We also need
+	// to cover the zlib header space.
+	result = vncEncoder::RequiredBuffSize(width, height);
+	Firstrun=result*2;//Needed to exclude xor when cachebuffer is empty
+	result += ((result / 100) + 8) + sz_rfbZlibHeader;
+	return result;
+}
+
+UINT
+vncEncodeZlib::NumCodedRects(const rfb::Rect &rect)
+{
+	const int rectW = rect.br.x - rect.tl.x;
+	const int rectH = rect.br.y - rect.tl.y;
+	int aantal=(( rectH - 1 ) / ( ZLIB_MAX_SIZE( rectW ) / rectW ) + 1 );
+	m_queueEnable=false;
+	if (m_use_lastrect && aantal>1) {
+		m_queueEnable=true;
+		return 0;
+	}
+/******************************************************************
+	return 1;
+******************************************************************/
+
+	// Return the number of rectangles needed to encode the given
+	// update.  ( ZLIB_MAX_SIZE(rectW) / rectW ) is the number of lines in 
+	// each maximum size rectangle.
+	// When solid is enabled, most of the pixels are removed
+	return (( rectH - 1 ) / ( ZLIB_MAX_SIZE( rectW ) / rectW ) + 1 );
+}
+
+/*****************************************************************************
+ *
+ * Routines to implement zlib Encoding (LZ+Huffman compression) by calling
+ * the included zlib library.
+ */
+
+// Encode the rectangle using zlib compression
+inline UINT
+vncEncodeZlib::EncodeRect(BYTE *source,BYTE *source2, VSocket *outConn, BYTE *dest, const rfb::Rect &rect)
+{
+	int  totalSize = 0;
+	int  partialSize = 0;
+	int  maxLines;
+	int  linesRemaining;
+	RECT partialRect;
+
+	const int rectW = rect.br.x - rect.tl.x;
+	const int rectH = rect.br.y - rect.tl.y;
+
+	partialRect.right = rect.br.x;
+	partialRect.left = rect.tl.x;
+	partialRect.top = rect.tl.y;
+	partialRect.bottom = rect.br.y;
+
+	/* WBB: For testing purposes only! */
+	// vnclog.Print(LL_INTINFO, VNCLOG("rect.right=%d rect.left=%d rect.top=%d rect.bottom=%d\n"), rect.right, rect.left, rect.top, rect.bottom);
+
+	maxLines = ( ZLIB_MAX_SIZE(rectW) / rectW );
+	linesRemaining = rectH;
+
+	while ( linesRemaining > 0 ) {
+
+		int linesToComp;
+
+		if ( maxLines < linesRemaining )
+			linesToComp = maxLines;
+		else
+			linesToComp = linesRemaining;
+
+		partialRect.bottom = partialRect.top + linesToComp;
+
+		/* WBB: For testing purposes only! */
+		// vnclog.Print(LL_INTINFO, VNCLOG("partialRect.right=%d partialRect.left=%d partialRect.top=%d partialRect.bottom=%d\n"), partialRect.right, partialRect.left, partialRect.top, partialRect.bottom);
+
+		partialSize = EncodeOneRect( source,source2, dest, partialRect,outConn );
+		totalSize += partialSize;
+
+		linesRemaining -= linesToComp;
+		partialRect.top += linesToComp;
+
+		if (( linesRemaining > 0 ) &&
+			( partialSize > 0 ))
+		{
+			// Send the encoded data
+			outConn->SendExactQueue( (char *)dest, partialSize );
+			transmittedSize += partialSize;
+		}
+
+
+	}
+	transmittedSize += partialSize;
+
+	return partialSize;
+
+}
+
+// Encode the rectangle using zlib compression
+inline UINT
+vncEncodeZlib::EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT &rect,VSocket *outConn)
+{
+	int totalCompDataLen = 0;
+	int previousTotalOut;
+	int deflateResult;
+
+	const int rectW = rect.right - rect.left;
+	const int rectH = rect.bottom - rect.top;
+	const int rawDataSize = (rectW*rectH*m_remoteformat.bitsPerPixel / 8);
+	const int maxCompSize = (rawDataSize + (rawDataSize/100) + 8);
+
+	if (!outConn->m_pIntegratedPluginInterface) m_queueEnable=false;
+
+	// Create the rectangle header
+	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
+	// Modif rdv at 2002 - v1.1.x - Application Resize
+	surh->r.x = (CARD16) rect.left-m_SWOffsetx;
+	surh->r.y = (CARD16) rect.top-m_SWOffsety;
+	surh->r.w = (CARD16) (rectW);
+	surh->r.h = (CARD16) (rectH);
+	surh->r.x = Swap16IfLE(surh->r.x);
+	surh->r.y = Swap16IfLE(surh->r.y);
+	surh->r.w = Swap16IfLE(surh->r.w);
+	surh->r.h = Swap16IfLE(surh->r.h);
+	surh->encoding = Swap32IfLE(rfbEncodingZlib);
+
+	dataSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
+	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+	
+	// create a space big enough for the Zlib encoded pixels
+	if (m_bufflen < rawDataSize)
+	{
+		if (m_buffer != NULL)
+		{
+			delete [] m_buffer;
+			m_buffer = NULL;
+		}
+		m_buffer = new BYTE [rawDataSize+1];
+		if (m_buffer == NULL)
+			return vncEncoder::EncodeRect(source, dest, rect);
+		m_bufflen = rawDataSize;
+		if (m_buffer2 != NULL)
+		{
+			delete [] m_buffer2;
+			m_buffer2 = NULL;
+		}
+		m_buffer2 = new BYTE [rawDataSize+1];
+	}
+	// Translate the data into our new buffer
+	compStream.avail_in = rawDataSize;
+	Translate(source, m_buffer, rect);
+	// Perhaps we can queue the small updates and compress them combined
+	if (rawDataSize < VNC_ENCODE_ZLIB_MIN_COMP_SIZE)
+	{
+		if (m_queueEnable && source2 && dataSize>Firstrun)
+			{
+				surh->encoding = Swap32IfLE(rfbEncodingRaw);
+				memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,rawDataSize);
+				AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +rawDataSize,outConn,0);
+				return 0;
+			}
+		else return vncEncoder::EncodeRect(source, dest, rect);
+	}
+
+
+	UINT newsize;
+	SoMoMu=PURE_ZLIB;
+	if (m_buffer2 && source2 && dataSize>Firstrun)
+		{
+			Translate(source2,m_buffer2, rect);
+			newsize=PrepareXOR(m_buffer,m_buffer2,rect);
+		}
+	switch (SoMoMu)
+	{
+		case SOLID_COLOR:
+			{
+				surh->encoding = Swap32IfLE(rfbEncodingSolidColor);
+				memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,compStream.avail_in);
+				//vnclog.Print(LL_INTINFO, VNCLOG("Solid \n"));
+				if (m_queueEnable)
+				{
+				AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +newsize,outConn,0);
+				return 0;
+				}
+				return sz_rfbFramebufferUpdateRectHeader +newsize;
+			}
+		case MONO_COLOR:
+			{
+				compStream.avail_in = newsize;
+				surh->encoding = Swap32IfLE(rfbEncodingXORMonoColor_Zlib);
+				//vnclog.Print(LL_INTINFO, VNCLOG("Mono \n"));
+				if (m_queueEnable)
+				{
+				memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,newsize);
+				AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +newsize,outConn,1);
+				return 0;
+				}
+				break;
+
+			}
+		case MULTI_COLOR:
+			{
+				compStream.avail_in = newsize;
+				surh->encoding = Swap32IfLE(rfbEncodingXORMultiColor_Zlib);
+				///vnclog.Print(LL_INTINFO, VNCLOG("MultiColor \n"));
+				break;
+			}
+
+		case XOR_SEQUENCE:
+			{
+				compStream.avail_in = newsize;
+				surh->encoding = Swap32IfLE(rfbEncodingXOR_Zlib);
+				memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,newsize);
+				if (newsize<1000 && m_queueEnable)
+				{
+					AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +newsize,outConn,1);
+					return 0;
+				}
+				///vnclog.Print(LL_INTINFO, VNCLOG("XOR \n"));
+				break;
+			}
+
+		case PURE_ZLIB:
+			{
+				if (rawDataSize<1000 && m_queueEnable)
+				{
+				surh->encoding = Swap32IfLE(rfbEncodingRaw);
+				memcpy(dest+sz_rfbFramebufferUpdateRectHeader,m_buffer,rawDataSize);
+				AddToQueu(dest,sz_rfbFramebufferUpdateRectHeader +rawDataSize,outConn,1);
+				return 0;
+				}
+
+				surh->encoding = Swap32IfLE(rfbEncodingZlib);
+				///vnclog.Print(LL_INTINFO, VNCLOG("Pure \n"));
+				break;
+			}
+	}
+		// Initialize input/output buffer assignment for compressor state.
+		compStream.next_in = m_buffer;
+		compStream.avail_out = maxCompSize;
+		compStream.next_out = (dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader);
+		compStream.data_type = Z_BINARY;
+	
+		// If necessary, the first time, initialize the compressor state.
+		if ( compStreamInited == false )
+		{
+	
+			compStream.total_in = 0;
+			compStream.total_out = 0;
+			compStream.zalloc = Z_NULL;
+			compStream.zfree = Z_NULL;
+			compStream.opaque = Z_NULL;
+	
+			//vnclog.Print(LL_INTINFO, VNCLOG("calling deflateInit2 with zlib level:%d\n"), m_compresslevel);
+	
+			deflateResult = deflateInit2( &compStream,
+										m_compresslevel,
+										Z_DEFLATED,
+										MAX_WBITS,
+										MAX_MEM_LEVEL,
+										Z_DEFAULT_STRATEGY );
+			if ( deflateResult != Z_OK )
+			{
+				vnclog.Print(LL_INTINFO, VNCLOG("deflateInit2 returned error:%d:%s\n"), deflateResult, compStream.msg);
+				return vncEncoder::EncodeRect(source, dest, rect);
+			}
+			compStreamInited = true;
+		}
+
+		// Record previous total output size.
+		previousTotalOut = compStream.total_out;
+
+		// Compress the raw data into the result buffer.
+		deflateResult = deflate( &compStream, Z_SYNC_FLUSH );
+
+		if ( deflateResult != Z_OK )
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("deflate returned error:%d:%s\n"), deflateResult, compStream.msg);
+			return vncEncoder::EncodeRect(source, dest, rect);
+		}
+	
+		// Calculate size of compressed data.
+		totalCompDataLen = compStream.total_out - previousTotalOut;
+	
+		// Format the ZlibHeader
+		rfbZlibHeader *zlibh=(rfbZlibHeader *)(dest+sz_rfbFramebufferUpdateRectHeader);
+		zlibh->nBytes = Swap32IfLE(totalCompDataLen);
+	
+		// Update statistics
+		encodedSize += sz_rfbZlibHeader + totalCompDataLen;
+		rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+
+		// Return the amount of data sent	
+		return sz_rfbFramebufferUpdateRectHeader +
+			sz_rfbZlibHeader +
+			totalCompDataLen;
+
+}
+
+inline UINT
+vncEncodeZlib::PrepareXOR(BYTE * m_buffer,BYTE * m_buffer2,RECT rect)
+{
+	
+	DWORD c1;
+	DWORD c2;
+	unsigned char *c1ptr;
+	unsigned char *c2ptr;
+
+	unsigned char *sourceptr = m_buffer;
+	unsigned char *source2ptr = m_buffer2;
+	unsigned char *sourceposptr = m_buffer2;
+
+	const int rectW = rect.right - rect.left;
+	const int rectH = rect.bottom - rect.top;
+	const int BytePerPixel=m_remoteformat.bitsPerPixel/8;
+	const int rawDataSize = (rectW*rectH*BytePerPixel);
+	const int maskDataSize = (((rectW*rectH)+7)/8);
+	
+	if (m_MaskbufferSize < maskDataSize)
+	{
+		if (m_Maskbuffer != NULL)
+		{
+			delete [] m_Maskbuffer;
+			m_Maskbuffer = NULL;
+		}
+		m_Maskbuffer = new mybool [maskDataSize+1];
+	}
+	
+	c1ptr=(unsigned char *)&c1;
+	c2ptr=(unsigned char *)&c2;
+
+	totalraw+=rawDataSize; //stats
+
+	memcpy(c1ptr,sourceptr,BytePerPixel);
+	// detect mono and solid parts
+	int j=0;
+	int nr_colors=1;
+	bool temparray[8];
+	int byte_nr=0;
+	for (int i=0; i<rawDataSize;i=i+BytePerPixel)
+	{
+		if (memcmp(sourceptr,c1ptr,BytePerPixel)!= 0)
+		{
+			if (nr_colors==1)
+				{
+					memcpy(c2ptr,sourceptr,BytePerPixel);
+					nr_colors++;
+					SoMoMu=MONO_COLOR;
+				}
+			else if (memcmp(sourceptr,c2ptr,BytePerPixel)!= 0)
+				{
+						SoMoMu=MULTI_COLOR;
+						nr_colors++;
+						break;//stop checking we have more then 2 colors
+				}
+			temparray[j]=true;
+		}
+		else
+		{
+			temparray[j]=false;
+		}
+		if (j==7) //0-7 byte
+		{
+			m_Maskbuffer[byte_nr].b0=temparray[0];
+			m_Maskbuffer[byte_nr].b1=temparray[1];
+			m_Maskbuffer[byte_nr].b2=temparray[2];
+			m_Maskbuffer[byte_nr].b3=temparray[3];
+			m_Maskbuffer[byte_nr].b4=temparray[4];
+			m_Maskbuffer[byte_nr].b5=temparray[5];
+			m_Maskbuffer[byte_nr].b6=temparray[6];
+			m_Maskbuffer[byte_nr].b7=temparray[7];
+			byte_nr++;
+			j=0;
+		}
+		else j++;
+		sourceptr+=BytePerPixel;
+		source2ptr+=BytePerPixel;
+	}
+	// add the last partial byte
+	if (j!=0)
+	{
+		m_Maskbuffer[byte_nr].b0=temparray[0];
+		m_Maskbuffer[byte_nr].b1=temparray[1];
+		m_Maskbuffer[byte_nr].b2=temparray[2];
+		m_Maskbuffer[byte_nr].b3=temparray[3];
+		m_Maskbuffer[byte_nr].b4=temparray[4];
+		m_Maskbuffer[byte_nr].b5=temparray[5];
+		m_Maskbuffer[byte_nr].b6=temparray[6];
+		m_Maskbuffer[byte_nr].b7=temparray[7];
+	}
+
+//SOLID COLOR
+	if (nr_colors==1)
+	{
+	//full solid rectangle
+		unsigned char *sourceptr = m_buffer;
+		memcpy(sourceptr,c1ptr,BytePerPixel);
+		SoMoMu=SOLID_COLOR;
+		return BytePerPixel;
+		}
+//MONO COLOR
+	if (nr_colors==2)
+	{
+
+		unsigned char *sourceptr = m_buffer;
+		memcpy(sourceptr,m_Maskbuffer,maskDataSize);
+		sourceptr+=maskDataSize;
+		memcpy(sourceptr,c1ptr,BytePerPixel);
+		sourceptr+=BytePerPixel;
+		memcpy(sourceptr,c2ptr,BytePerPixel);
+		SoMoMu=MONO_COLOR;
+		return maskDataSize+(2)*BytePerPixel;
+	}
+
+//USE XOR AGAINST PREVIOUS IMAGE
+	{
+		int j=0;
+		int k=0;
+		SoMoMu=XOR_SEQUENCE;
+		bool temparray[8];
+		int byte_nr=0;
+		sourceptr = m_buffer;
+		source2ptr = m_buffer2;
+		for (int i=0; i<rawDataSize;i=i+BytePerPixel)
+		{
+			if (memcmp(sourceptr,source2ptr,BytePerPixel)!= 0)
+			{
+				memcpy(sourceposptr,sourceptr,BytePerPixel);
+				temparray[j]=true;
+				sourceposptr+=BytePerPixel;
+				k++;
+			}
+			else
+			{
+				temparray[j]=false;
+			}
+			if (j==7) //0-7 byte
+			{
+				m_Maskbuffer[byte_nr].b0=temparray[0];
+				m_Maskbuffer[byte_nr].b1=temparray[1];
+				m_Maskbuffer[byte_nr].b2=temparray[2];
+				m_Maskbuffer[byte_nr].b3=temparray[3];
+				m_Maskbuffer[byte_nr].b4=temparray[4];
+				m_Maskbuffer[byte_nr].b5=temparray[5];
+				m_Maskbuffer[byte_nr].b6=temparray[6];
+				m_Maskbuffer[byte_nr].b7=temparray[7];
+				byte_nr++;
+				j=0;
+			}
+			else j++;
+			sourceptr+=BytePerPixel;
+			source2ptr+=BytePerPixel;
+		}
+		//add last byte, perhaps j==0
+		if (j!=0)
+		{
+			m_Maskbuffer[byte_nr].b0=temparray[0];
+			m_Maskbuffer[byte_nr].b1=temparray[1];
+			m_Maskbuffer[byte_nr].b2=temparray[2];
+			m_Maskbuffer[byte_nr].b3=temparray[3];
+			m_Maskbuffer[byte_nr].b4=temparray[4];
+			m_Maskbuffer[byte_nr].b5=temparray[5];
+			m_Maskbuffer[byte_nr].b6=temparray[6];
+			m_Maskbuffer[byte_nr].b7=temparray[7];
+		}
+	
+		//check if new size is better then old
+		if ((maskDataSize+(k)*BytePerPixel)<rawDataSize)
+		{
+			unsigned char *sourceptr = m_buffer;
+			memcpy(sourceptr,m_Maskbuffer,maskDataSize);
+			sourceptr+=maskDataSize;
+			memcpy(sourceptr,m_buffer2,k*BytePerPixel);
+			return maskDataSize+(k)*BytePerPixel;
+		}
+	}
+	SoMoMu=PURE_ZLIB;
+	return 0;
+}
+
+void
+vncEncodeZlib::AddToQueu(BYTE *source,int sizerect,VSocket *outConn,int updatetype)
+{
+	if (m_Queuelen+sizerect>(MaxQueuebufflen)) SendZlibrects(outConn);
+	memcpy(m_Queuebuffer+m_Queuelen,source,sizerect);
+	m_Queuelen+=sizerect;
+	m_nNbRects++;
+	if (updatetype==1) must_be_zipped=true;
+	if (m_nNbRects>50) SendZlibrects(outConn);
+}
+
+void
+vncEncodeZlib::SendZlibrects(VSocket *outConn)
+{
+	int NRects=m_nNbRects;
+	const int rawDataSize = (m_Queuelen);
+	const int maxCompSize = (m_Queuelen + (m_Queuelen/100) + 8);
+
+	if (NRects==0) return; // NO update
+	if (m_nNbRects<3 && !must_be_zipped) 
+	{
+		outConn->SendExactQueue( (char *)m_Queuebuffer, m_Queuelen); // 1 Small update
+		m_nNbRects=0;
+		m_Queuelen=0;
+		encodedSize += m_Queuelen-sz_rfbFramebufferUpdateRectHeader;
+		rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+		return;
+	}
+	m_nNbRects=0;
+	m_Queuelen=0;
+	must_be_zipped=false;
+
+
+	int nRet = compress((unsigned char*)(m_QueueCompressedbuffer),
+						(unsigned long*)&maxCompSize,
+						(unsigned char*)m_Queuebuffer,
+						rawDataSize
+						);
+
+	if (nRet != 0)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("compression error"));
+		return ;
+	}
+	int rawDataSize1=rawDataSize/65535;
+	int rawDataSize2=rawDataSize%65535;
+
+	rfbFramebufferUpdateRectHeader CacheRectsHeader;
+	CacheRectsHeader.r.x = (CARD16)(NRects);
+	CacheRectsHeader.r.y = (CARD16)(rawDataSize2);
+	CacheRectsHeader.r.w = (CARD16)(rawDataSize1);
+	CacheRectsHeader.r.x = Swap16IfLE(CacheRectsHeader.r.x);
+	CacheRectsHeader.r.y = Swap16IfLE(CacheRectsHeader.r.y);
+	CacheRectsHeader.r.w = Swap16IfLE(CacheRectsHeader.r.w);
+ 	CacheRectsHeader.r.h = 0;
+	CacheRectsHeader.encoding = Swap32IfLE(rfbEncodingSolMonoZip);
+
+	// Format the ZlibHeader
+	rfbZlibHeader CacheZipHeader;
+	CacheZipHeader.nBytes = Swap32IfLE(maxCompSize);
+
+	vnclog.Print(LL_INTINFO, VNCLOG("********QUEUEQUEUE********** %d %d %d\r\n"),maxCompSize,rawDataSize,NRects);
+	outConn->SendExactQueue((char *)&CacheRectsHeader, sizeof(CacheRectsHeader));
+	outConn->SendExactQueue((char *)&CacheZipHeader, sizeof(CacheZipHeader));
+	outConn->SendExactQueue((char *)m_QueueCompressedbuffer, maxCompSize);
+	// Update statistics
+	encodedSize += sz_rfbZlibHeader + maxCompSize;
+	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+	transmittedSize += maxCompSize+sz_rfbFramebufferUpdateRectHeader+sz_rfbZlibHeader;
+}
+
+void
+vncEncodeZlib::LastRect(VSocket *outConn)
+{
+	SendZlibrects(outConn);
+}
diff --git a/ica/win32/winvnc/winvnc/vncEncodeZlib.h b/ica/win32/winvnc/winvnc/vncEncodeZlib.h
new file mode 100644
index 0000000..df6c9d1
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncEncodeZlib.h
@@ -0,0 +1,123 @@
+//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+//
+// If the source code for the VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeZlib object
+
+// The vncEncodeZlib object uses a zlib based compression encoding to send rectangles
+// to a client
+
+class vncEncodeZlib;
+
+#if !defined(_WINVNC_ENCODEZLIB)
+#define _WINVNC_ENCODEZLIB
+#pragma once
+
+#include "vncencoder.h"
+#ifdef IPP
+#include "..\..\ipp_zlib\src\zlib\zlib.h"
+#else
+#include "zlib.h"
+#endif
+
+// 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 (8*1024)
+#define ZLIB_MAX_SIZE(min) ((( min * 2 ) > ZLIB_MAX_RECT_SIZE ) ? ( min * 2 ) : ZLIB_MAX_RECT_SIZE )
+#define SOLID_COLOR	0 // 1 color
+#define MONO_COLOR	1 //2 colors
+#define MULTI_COLOR	2 // >2 colors
+#define PURE_ZLIB	3 
+#define	XOR_SEQUENCE 4 //XOR previous image
+
+struct mybool {
+ bool b0 : 1;
+ bool b1 : 1;
+ bool b2 : 1;
+ bool b3 : 1;
+ bool b4 : 1;
+ bool b5 : 1;
+ bool b6 : 1;
+ bool b7 : 1;
+};
+
+// Class definition
+
+class vncEncodeZlib : public vncEncoder
+{
+// Fields
+public:
+
+// Methods
+public:
+	// Create/Destroy methods
+	vncEncodeZlib();
+	~vncEncodeZlib();
+
+	virtual void Init();
+	virtual const char* GetEncodingName() { return "Zlib"; }
+
+	virtual UINT RequiredBuffSize(UINT width, UINT height);
+	virtual UINT NumCodedRects(const rfb::Rect &rect);
+
+	virtual UINT EncodeRect(BYTE *source,BYTE *source2, VSocket *outConn, BYTE *dest, const rfb::Rect &rect);
+	virtual UINT EncodeOneRect(BYTE *source,BYTE *source2, BYTE *dest, const RECT &rect,VSocket *outConn);
+	virtual UINT PrepareXOR(BYTE *m_buffer,BYTE *m_buffer2,RECT rect);
+
+	virtual void LastRect(VSocket *outConn);
+	virtual void AddToQueu(BYTE *source,int size,VSocket *outConn,int must_be_zipped);
+	virtual void SendZlibrects(VSocket *outConn);
+
+
+// Implementation
+protected:
+	BYTE		      *m_buffer;
+	BYTE		      *m_buffer2;
+	BYTE			  *m_Queuebuffer;
+	BYTE			  *m_QueueCompressedbuffer;
+	mybool			  *m_Maskbuffer;
+	int				  m_MaskbufferSize;
+	int			       m_bufflen;
+	struct z_stream_s  compStream;
+	bool               compStreamInited;
+	int totalraw;
+	int SoMoMu; //solid/mono/multi color
+
+	int				   m_Queuebufflen;
+	int				   MaxQueuebufflen;
+	int				   m_Queuelen;
+	int				   m_nNbRects;
+	int				   must_be_zipped;
+	BOOL				m_queueEnable;
+	int					Firstrun;
+};
+
+#endif // _WINVNC_ENCODEZLIB
+
diff --git a/ica/win32/winvnc/winvnc/vncEncodeZlibHex.cpp b/ica/win32/winvnc/winvnc/vncEncodeZlibHex.cpp
new file mode 100644
index 0000000..9d25aac
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncEncodeZlibHex.cpp
@@ -0,0 +1,645 @@
+//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+//
+// If the source code for the VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+//  vncEncodeZlibHex
+
+// This file implements the vncEncoder-derived vncEncodeZlibHex class.
+// This class overrides some vncEncoder functions to produce a
+// Hextile encoder with zlib.  Hextile splits all top-level update rectangles
+// into smaller, 16x16 rectangles and encodes these using the
+// optimized Hextile sub-encodings, including zlib.
+
+#include "vncEncodeZlibHex.h"
+#include "rfb.h"
+// #include "MinMax.h"
+#include <stdlib.h>
+#include <time.h>
+
+//#define IN_LEN		(128*1024)
+//#define OUT_LEN		(IN_LEN + IN_LEN / 64 + 16 + 3)
+/*#define HEAP_ALLOC(var,size) \
+	lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ]*/
+//static HEAP_ALLOC(wrkmem,LZO1X_1_MEM_COMPRESS);
+
+
+vncEncodeZlibHex::vncEncodeZlibHex()
+{
+
+	m_buffer = NULL;
+	m_bufflen = 0;
+	m_Queuebuffer = NULL;
+	m_Queuelen = 0;
+	MaxQueuebufflen=128*1024;
+	compStreamRaw.total_in = ZLIBHEX_COMP_UNINITED;
+	compStreamEncoded.total_in = ZLIBHEX_COMP_UNINITED;
+	//lzo=false;
+	m_Queuebuffer = new BYTE [MaxQueuebufflen+1];
+		if (m_Queuebuffer == NULL)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("Memory error"));
+		}
+
+}
+
+vncEncodeZlibHex::~vncEncodeZlibHex()
+{
+	if (m_buffer != NULL)
+	{
+		delete [] m_buffer;
+		m_buffer = NULL;
+		m_bufflen = 0;
+	}
+	if ( compStreamRaw.total_in != ZLIBHEX_COMP_UNINITED )
+	{
+		deflateEnd( &compStreamRaw );
+		compStreamRaw.total_in = ZLIBHEX_COMP_UNINITED;
+	}
+	if ( compStreamEncoded.total_in != ZLIBHEX_COMP_UNINITED )
+	{
+		deflateEnd( &compStreamEncoded );
+		compStreamEncoded.total_in = ZLIBHEX_COMP_UNINITED;
+	}
+	if (m_Queuebuffer != NULL)
+	{
+		delete [] m_Queuebuffer;
+		m_Queuebuffer = NULL;
+	}
+
+}
+
+void
+vncEncodeZlibHex::Init()
+{
+	vncEncoder::Init();
+}
+
+UINT
+vncEncodeZlibHex::RequiredBuffSize(UINT width, UINT height)
+{
+	int accumSize;
+
+	// Start with the raw encoding size, which includes the
+	// rectangle header size.
+	accumSize = vncEncoder::RequiredBuffSize(width, height);
+	// Add overhead associated with zlib compression, worst case.
+	accumSize += ((accumSize / 100) + 8);
+	// Add zlib/other subencoding overhead, worst case.
+	accumSize += (((width/16)+1) * ((height/16)+1) * ((3 * m_remoteformat.bitsPerPixel / 8) + 2));
+
+	return accumSize;
+}
+
+UINT
+vncEncodeZlibHex::NumCodedRects(RECT &rect)
+{
+	return 0;
+	return 1;
+}
+
+/*
+ * hextile.c
+ *
+ * Routines to implement Hextile Encoding
+ */
+
+#include <stdio.h>
+#include "rfb.h"
+
+/*
+ * vncEncodeZlibHex::EncodeRect - send a rectangle using hextile encoding.
+ */
+
+UINT
+vncEncodeZlibHex::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &rect)
+{
+	const int rectW = rect.right - rect.left;
+	const int rectH = rect.bottom - rect.top;
+
+	// Create the rectangle header
+	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
+	surh->r.x = (CARD16) (rect.left-m_SWOffsetx);
+	surh->r.y = (CARD16) (rect.top-m_SWOffsety);
+	surh->r.w = (CARD16) (rectW);
+	surh->r.h = (CARD16) (rectH);
+	surh->r.x = Swap16IfLE(surh->r.x);
+	surh->r.y = Swap16IfLE(surh->r.y);
+	surh->r.w = Swap16IfLE(surh->r.w);
+	surh->r.h = Swap16IfLE(surh->r.h);
+	surh->encoding = Swap32IfLE(rfbEncodingZlibHex);
+
+	rectangleOverhead += sz_rfbFramebufferUpdateRectHeader;
+	dataSize += ( rectW * rectH * m_remoteformat.bitsPerPixel) / 8;
+
+	// Go ahead and send the RFB update header, in case partial updates
+	// are send in EncodeHextiles#() below.
+	outConn->SendExactQueue( (char *)dest, sz_rfbFramebufferUpdateRectHeader);
+//	AddToQueu((BYTE *)dest,sz_rfbFramebufferUpdateRectHeader,outConn);
+	
+	transmittedSize += sz_rfbFramebufferUpdateRectHeader;
+
+	// Do the encoding
+	UINT retval;
+    switch (m_remoteformat.bitsPerPixel)
+	{
+	case 8:
+		retval= EncodeHextiles8(source, dest, outConn, rect.left, rect.top, rectW, rectH);
+		SendZlibHexrects(outConn);
+		return retval;
+    case 16:
+		retval= EncodeHextiles16(source, dest, outConn, rect.left, rect.top, rectW, rectH);
+		SendZlibHexrects(outConn);
+		return retval;
+    case 32:
+		retval= EncodeHextiles32(source, dest, outConn, rect.left, rect.top, rectW, rectH);
+		SendZlibHexrects(outConn);
+		return retval;
+    }
+
+	return vncEncoder::EncodeRect(source, dest, rect);
+}
+
+UINT
+vncEncodeZlibHex::zlibCompress(BYTE *from_buf, BYTE *to_buf, UINT length, struct z_stream_s *compressor)
+{
+	int previousTotalOut;
+	int deflateResult;
+//	unsigned int out_len;
+
+	// Initialize input/output buffer assignment for compressor state.
+	compressor->avail_in = length;
+	compressor->next_in = from_buf;
+	compressor->avail_out = (2 * length);
+	compressor->next_out = to_buf;
+	compressor->data_type = Z_BINARY;
+	/*if (lzo==false)
+		{
+			if (lzo_init() == LZO_E_OK) lzo=true;
+		}
+	if (lzo1x_1_compress(from_buf,length,to_buf,&out_len,wrkmem)!=LZO_E_OK)
+		vnclog.Print(LL_INTINFO, VNCLOG("Error compressing  \n"));
+	return out_len;*/
+
+	//vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d %d \n"), length,out_len);
+
+
+	// If necessary, the first time, initialize the compressor state.
+	if ( compressor->total_in == ZLIBHEX_COMP_UNINITED )
+	{
+
+		compressor->total_in = 0;
+		compressor->total_out = 0;
+		compressor->zalloc = Z_NULL;
+		compressor->zfree = Z_NULL;
+		compressor->opaque = Z_NULL;
+
+		vnclog.Print(LL_INTINFO, VNCLOG("calling deflateInit2 with zlib level:%d\n"), m_compresslevel);
+
+		deflateResult = deflateInit2( compressor,
+			                          m_compresslevel,
+					                  Z_DEFLATED,
+					                  MAX_WBITS,
+					                  MAX_MEM_LEVEL,
+					                  Z_DEFAULT_STRATEGY );
+		if ( deflateResult != Z_OK )
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("deflateInit2 returned error:%d:%s\n"), deflateResult, compressor->msg);
+			return -1;
+		}
+
+	}
+
+	// Record previous total output size.
+	previousTotalOut = compressor->total_out;
+
+	// Compress the raw data into the result buffer.
+	deflateResult = deflate( compressor, Z_SYNC_FLUSH );
+
+	if ( deflateResult != Z_OK )
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("deflate returned error:%d:%s\n"), deflateResult, compressor->msg);
+		return -1;
+	}
+//	vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d %d %d \n"), length,compressor->total_out - previousTotalOut,out_len);
+//	if (length/2>out_len) vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d #####50######### \n"), length);
+//	if (length/3*2>out_len) vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d #####33######### \n"), length);
+//	if (length/4*3>out_len) vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex length %d #####25######### \n"), length);
+
+	return compressor->total_out - previousTotalOut;
+}
+
+
+#define PUT_PIXEL8(pix) (dest[destoffset++] = (pix))
+
+#define PUT_PIXEL16(pix) (dest[destoffset++] = ((char*)&(pix))[0],			\
+			  dest[destoffset++] = ((char*)&(pix))[1])
+
+#define PUT_PIXEL32(pix) (dest[destoffset++] = ((char*)&(pix))[0],			\
+			  dest[destoffset++] = ((char*)&(pix))[1],						\
+			  dest[destoffset++] = ((char*)&(pix))[2],						\
+			  dest[destoffset++] = ((char*)&(pix))[3])
+
+#define DEFINE_SEND_HEXTILES(bpp)											\
+																			\
+static UINT subrectEncode##bpp(CARD##bpp *src, BYTE *dest,					\
+				int w, int h, CARD##bpp bg,									\
+			    CARD##bpp fg, BOOL mono);									\
+static void testColours##bpp(CARD##bpp *data, int size, BOOL *mono,			\
+			     BOOL *solid, CARD##bpp *bg, CARD##bpp *fg);				\
+																			\
+																			\
+/*																			\
+ * rfbSendHextiles															\
+ */																			\
+																			\
+																			\
+UINT																		\
+vncEncodeZlibHex::EncodeHextiles##bpp(BYTE *source, BYTE *dest,				\
+				  VSocket *outConn, int rx, int ry, int rw, int rh)			\
+{																			\
+    int x, y, w, h;															\
+    int rectoffset, destoffset;												\
+    int encodedBytes, compressedSize;										\
+	CARD16* card16ptr;														\
+	CARD##bpp bg, fg, newBg, newFg;											\
+	bg=0;fg=0;newBg=0;newFg=0;												\
+	BOOL mono, solid;														\
+	BOOL validBg = FALSE;													\
+	BOOL validFg = FALSE;													\
+	int subEncodedLen;														\
+	CARD##bpp clientPixelData[(16*16+2)*(bpp/8)+8+14+2];					\
+																			\
+	destoffset = 0;															\
+																			\
+    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;												\
+																			\
+			RECT hexrect;													\
+			hexrect.left = x;												\
+			hexrect.top = y;												\
+			hexrect.right = x+w;											\
+			hexrect.bottom = y+h;											\
+			Translate(source, (BYTE *) clientPixelData, hexrect);			\
+																			\
+			rectoffset = destoffset;										\
+			dest[rectoffset] = 0;											\
+			destoffset++;													\
+																			\
+			testColours##bpp(clientPixelData, w * h,						\
+			     &mono, &solid, &newBg, &newFg);							\
+																			\
+			if (!validBg || (newBg != bg))									\
+			{																\
+				validBg = TRUE;												\
+				bg = newBg;													\
+				dest[rectoffset] |= rfbHextileBackgroundSpecified;			\
+				PUT_PIXEL##bpp(bg);											\
+			}																\
+																			\
+			if (solid)														\
+				continue;													\
+																			\
+			dest[rectoffset] |= rfbHextileAnySubrects;						\
+																			\
+			if (mono)														\
+			{																\
+				if (!validFg || (newFg != fg))								\
+				{															\
+					validFg = TRUE;											\
+					fg = newFg;												\
+					dest[rectoffset] |= rfbHextileForegroundSpecified;		\
+					PUT_PIXEL##bpp(fg);										\
+				}															\
+			}																\
+			else															\
+			{																\
+				validFg = FALSE;											\
+				dest[rectoffset] |= rfbHextileSubrectsColoured;			    \
+			}																\
+																			\
+			encodedBytes = subrectEncode##bpp(clientPixelData,				\
+											dest + destoffset,				\
+											w, h, bg, fg, mono);			\
+																			\
+			if (encodedBytes == 0)											\
+			{																\
+																			\
+				/* hextile encoding was too large, use raw/zlib */			\
+				if ((w*h*(bpp/8)) > VNC_ENCODE_ZLIBHEX_MIN_COMP_SIZE)		\
+				{															\
+					/* raw data large enough to use zlib */					\
+					validBg = FALSE;										\
+					validFg = FALSE;										\
+					destoffset = rectoffset;								\
+					dest[destoffset++] = rfbHextileZlibRaw;				\
+																			\
+					Translate(source, (BYTE *) clientPixelData, hexrect);	\
+																			\
+					compressedSize = zlibCompress((BYTE *) clientPixelData,	\
+													dest + destoffset + 2,	\
+													(w*h*(bpp/8)),			\
+													&compStreamRaw);		\
+																			\
+																			\
+					card16ptr = (CARD16*) (dest + destoffset);				\
+					*card16ptr = Swap16IfLE(compressedSize);				\
+					destoffset += compressedSize + 2;						\
+																			\
+			    }															\
+				else														\
+				{															\
+					/* raw size small enough, use directly */				\
+					validBg = FALSE;										\
+					validFg = FALSE;										\
+					destoffset = rectoffset;								\
+					dest[destoffset++] = rfbHextileRaw;						\
+																			\
+					Translate(source, (dest + destoffset), hexrect);		\
+																			\
+					destoffset += (w*h*(bpp/8));							\
+																			\
+				}															\
+			}																\
+			else /* when (encodedBytes != 0) */								\
+			{																\
+				/* Hextile encoding smaller than raw, compress further? */	\
+				/* Subencoded data harder to compress, need larger batch? */	\
+				if (encodedBytes > (VNC_ENCODE_ZLIBHEX_MIN_COMP_SIZE * 2))	\
+				{															\
+					/* hex encoded data large enough to use zlib */			\
+					subEncodedLen = (encodedBytes + destoffset - rectoffset - 1);		\
+					destoffset = rectoffset + 1;								\
+					memcpy( clientPixelData, (dest + destoffset), subEncodedLen);		\
+					dest[rectoffset] |= rfbHextileZlibHex;					\
+																			\
+					compressedSize = zlibCompress((BYTE *) clientPixelData,	\
+													dest + destoffset + 2,	\
+													subEncodedLen,			\
+													&compStreamEncoded);	\
+																			\
+																			\
+					card16ptr = (CARD16*) (dest + destoffset);				\
+					*card16ptr = Swap16IfLE(compressedSize);				\
+					destoffset += compressedSize + 2;						\
+			    }															\
+				else														\
+				{															\
+					/* hex encoded data too small for zlib, send as is */	\
+					destoffset += encodedBytes;								\
+			    }															\
+			}																\
+																			\
+		}																	\
+																			\
+		if (destoffset > VNC_ENCODE_ZLIBHEX_MIN_DATAXFER)					\
+		{																	\
+			/* Send the encoded data as partial update */					\
+			AddToQueu((BYTE *)dest,destoffset,outConn);				        \
+			transmittedSize += destoffset;									\
+			encodedSize += destoffset;										\
+			destoffset = 0;													\
+																			\
+		}																	\
+    }																		\
+	transmittedSize += destoffset;											\
+	encodedSize += destoffset;												\
+																			\
+    return destoffset;														\
+}																			\
+																			\
+static UINT																	\
+subrectEncode##bpp(CARD##bpp *src, BYTE *dest, int w, int h, CARD##bpp bg,	\
+		   CARD##bpp fg, BOOL mono)											\
+{																			\
+    CARD##bpp cl;															\
+    int x,y;																\
+    int i,j;																\
+    int hx=0,hy,vx=0,vy;													\
+    int hyflag;																\
+    CARD##bpp *seg;															\
+    CARD##bpp *line;														\
+    int hw,hh,vw,vh;														\
+    int thex,they,thew,theh;												\
+    int numsubs = 0;														\
+    int newLen;																\
+    int rectoffset;															\
+	int destoffset;															\
+																			\
+	destoffset = 0;															\
+    rectoffset = destoffset;												\
+    destoffset++;															\
+																			\
+    for (y=0; y<h; y++)														\
+	{																		\
+		line = src+(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 = src+(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;												\
+				}															\
+																			\
+				if (mono)													\
+				{															\
+				    newLen = destoffset - rectoffset + 2;					\
+				}															\
+				else														\
+				{															\
+				    newLen = destoffset - rectoffset + bpp/8 + 2;			\
+				}															\
+																			\
+				if (newLen > (w * h * (bpp/8)))								\
+				    return 0;												\
+																			\
+				numsubs += 1;												\
+																			\
+				if (!mono) PUT_PIXEL##bpp(cl);								\
+																			\
+				dest[destoffset++] = rfbHextilePackXY(thex,they);			\
+				dest[destoffset++] = rfbHextilePackWH(thew,theh);			\
+																			\
+				/*															\
+				 * Now mark the subrect as done.							\
+				 */															\
+				for (j=they; j < (they+theh); j++)							\
+				{															\
+					for (i=thex; i < (thex+thew); i++)						\
+					{														\
+						src[j*w+i] = bg;									\
+					}														\
+				}															\
+		    }																\
+		}																	\
+    }																		\
+																			\
+    dest[rectoffset] = numsubs;												\
+																			\
+    return destoffset;														\
+}																			\
+																			\
+																			\
+/*																			\
+ * 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(CARD##bpp *data, int size,									\
+				 BOOL *mono, BOOL *solid,									\
+				 CARD##bpp *bg, CARD##bpp *fg)								\
+{																			\
+    CARD##bpp colour1, colour2;												\
+    int n1 = 0, n2 = 0;														\
+    *mono = TRUE;															\
+    *solid = TRUE;															\
+	colour1=0;																\
+	colour2=0;																\
+																			\
+    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)
+
+
+void
+vncEncodeZlibHex::AddToQueu(BYTE *source,int sizerect,VSocket *outConn)
+{
+	if (m_Queuelen+sizerect>(MaxQueuebufflen)) SendZlibHexrects(outConn);
+	if (sizerect>(MaxQueuebufflen)) 
+		{
+			outConn->SendExactQueue( (char *)source,sizerect);
+			return;
+		}
+//	vnclog.Print(LL_INTINFO, VNCLOG("Add %i %i \n"),sizerect,m_Queuelen);
+	memcpy(m_Queuebuffer+m_Queuelen,source,sizerect);
+	m_Queuelen+=sizerect;
+}
+
+void
+vncEncodeZlibHex::SendZlibHexrects(VSocket *outConn)
+{
+	if (m_Queuelen==0) return; // NO update
+	
+		outConn->SendExactQueue( (char *)m_Queuebuffer, m_Queuelen); // 1 Small update
+		m_Queuelen=0;
+		encodedSize += m_Queuelen-sz_rfbFramebufferUpdateRectHeader;
+		return;
+}
+
+void
+vncEncodeZlibHex::LastRect(VSocket *outConn)
+{
+	SendZlibHexrects(outConn);
+}
diff --git a/ica/win32/winvnc/winvnc/vncEncodeZlibHex.h b/ica/win32/winvnc/winvnc/vncEncodeZlibHex.h
new file mode 100644
index 0000000..8476cd9
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncEncodeZlibHex.h
@@ -0,0 +1,114 @@
+//  Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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.
+//
+// TightVNC distribution homepage on the Web: http://www.tightvnc.com/
+//
+// If the source code for the VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeZlibHex object
+
+// The vncEncodeZlibHex object uses a compression encoding to send rectangles
+// to a client.  As with the hextile encoding, all rectangles are broken down
+// into a matrix of 16x16 (or smaller at bottom/right) tiles, which are 
+// individually encoded with a subencoding mechanism.  This encoding addds
+// the ability to apply zlib compression to the raw and other hextile
+// subencodings.
+
+class vncEncodeZlibHex;
+
+#if !defined(_WINVNC_ENCODEZLIBHEX)
+#define _WINVNC_ENCODEZLIBHEX
+#pragma once
+
+#include "vncencoder.h"
+
+#ifdef IPP
+#include "..\..\ipp_zlib\src\zlib\zlib.h"
+#else
+#include "zlib.h"
+#endif
+#include "lzo/minilzo.h"
+
+// Minimum zlib rectangle size in bytes.  Anything smaller will
+// not compress well due to overhead.
+// temp change lzo
+//#define VNC_ENCODE_ZLIBHEX_MIN_COMP_SIZE (17)
+#define VNC_ENCODE_ZLIBHEX_MIN_COMP_SIZE (64)
+// Flag used to mark our compressors as uninitialized.
+#define ZLIBHEX_COMP_UNINITED ((DWORD)-1)
+
+// Size of the smallest update portion sent independently across
+// the network.  This encoder can transmit partial updates to
+// improve latency issues with performance.
+#define VNC_ENCODE_ZLIBHEX_MIN_DATAXFER (1400)
+
+// Class definition
+
+class vncEncodeZlibHex : public vncEncoder
+{
+// Fields
+public:
+
+// Methods
+public:
+	// Create/Destroy methods
+	vncEncodeZlibHex();
+	~vncEncodeZlibHex();
+
+	void Init();
+	virtual const char* GetEncodingName() { return "ZlibHex"; }
+
+	virtual UINT RequiredBuffSize(UINT width, UINT height);
+	virtual UINT NumCodedRects(RECT &rect);
+
+	// virtual UINT EncodeRect(BYTE *source, BYTE *dest, const RECT &rect);
+	virtual UINT EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &rect);
+
+	virtual void LastRect(VSocket *outConn);
+	virtual void AddToQueu(BYTE *source,int size,VSocket *outConn);
+	virtual void SendZlibHexrects(VSocket *outConn);
+
+protected:
+	virtual UINT zlibCompress(BYTE *from_buf, BYTE *to_buf, UINT length, struct z_stream_s *compressor);
+
+	virtual UINT EncodeHextiles8(BYTE *source, BYTE *dest,
+		VSocket *outConn, int x, int y, int w, int h);
+	virtual UINT EncodeHextiles16(BYTE *source, BYTE *dest,
+		VSocket *outConn, int x, int y, int w, int h);
+	virtual UINT EncodeHextiles32(BYTE *source, BYTE *dest,
+		VSocket *outConn, int x, int y, int w, int h);
+
+// Implementation
+protected:
+	BYTE		      *m_buffer;
+	int			       m_bufflen;
+	struct z_stream_s  compStreamRaw;
+	struct z_stream_s  compStreamEncoded;
+	//bool lzo;
+	BYTE			  *m_Queuebuffer;
+	int					m_Queuelen;
+	int					MaxQueuebufflen;
+};
+
+#endif // _WINVNC_ENCODEHEXTILE
+
diff --git a/ica/win32/winvnc/winvnc/vncListDlg.cpp b/ica/win32/winvnc/winvnc/vncListDlg.cpp
new file mode 100644
index 0000000..11c46f6
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncListDlg.cpp
@@ -0,0 +1,169 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at Vnc Team Members. 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://www.uvnc.com/
+
+// vncListDlg.cpp
+
+// Implementation of the vncListDlg dialog!
+
+#include "stdhdrs.h"
+
+#include "winvnc.h"
+#include "vncListDlg.h"
+#include "common/win32_helpers.h"
+
+// [v1.0.2-jp1 fix] Load resouce from dll
+extern HINSTANCE	hInstResDLL;
+
+//
+//
+//
+vncListDlg::vncListDlg()
+{
+	m_dlgvisible = FALSE;
+}
+
+//
+//
+//
+vncListDlg::~vncListDlg()
+{
+}
+
+//
+//
+//
+BOOL vncListDlg::Init(vncServer* pServer)
+{
+	m_pServer = pServer;
+	return TRUE;
+}
+
+//
+//
+//
+void vncListDlg::Display()
+{
+	if (!m_dlgvisible)
+	{
+		// [v1.0.2-jp1 fix] Load resouce from dll
+		//DialogBoxParam(	hAppInstance,
+		DialogBoxParam(	hInstResDLL,
+						MAKEINTRESOURCE(IDD_LIST_DLG), 
+						NULL,
+						(DLGPROC) DialogProc,
+						(LONG_PTR) this
+						);
+	}
+}
+
+//
+//
+//
+BOOL CALLBACK vncListDlg::DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
+{
+    vncListDlg *_this = helper::SafeGetWindowUserData<vncListDlg>(hwnd);
+	switch (uMsg)
+	{
+
+	case WM_INITDIALOG:
+		{
+            helper::SafeSetWindowUserData(hwnd, lParam);
+			_this = (vncListDlg *) lParam;
+
+			vncClientList::iterator i;
+			HWND hList = GetDlgItem(hwnd, IDC_VIEWERS_LISTBOX);
+
+			_this->m_pServer->ListAuthClients(hList);
+			SendMessage(hList, LB_SETCURSEL, -1, 0);
+
+			// adzm 2009-07-05
+			HWND hPendingList = GetDlgItem(hwnd, IDC_PENDING_LISTBOX);
+			_this->m_pServer->ListUnauthClients(hPendingList);
+
+			SetForegroundWindow(hwnd);
+			_this->m_dlgvisible = TRUE;
+			if (!_this->m_pServer->GetAllowEditClients())
+			{
+				EnableWindow(GetDlgItem(hwnd, IDC_KILL_B), false);
+			}
+			else EnableWindow(GetDlgItem(hwnd, IDC_KILL_B), true);
+
+			// Allow TextChat if one client only
+			/*
+			EnableWindow(GetDlgItem(hwnd, IDC_TEXTCHAT_B),
+				         _this->m_pServer->AuthClientCount() == 1 ? TRUE : FALSE);
+			*/
+			return TRUE;
+		}
+
+	case WM_COMMAND:
+		switch (LOWORD(wParam))
+		{
+
+		case IDCANCEL:
+		case IDOK:
+			EndDialog(hwnd, TRUE);
+			_this->m_dlgvisible = FALSE;
+			return TRUE;
+
+		case IDC_KILL_B:
+			{
+			HWND hList = GetDlgItem(hwnd, IDC_VIEWERS_LISTBOX);
+			LRESULT nSelected = SendMessage(hList, LB_GETCURSEL, 0, 0);
+			if (nSelected != LB_ERR)
+			{
+				char szClient[128];
+				if (SendMessage(hList, LB_GETTEXT, nSelected, (LPARAM)szClient) > 0)
+					_this->m_pServer->KillClient(szClient);
+			}
+			EndDialog(hwnd, TRUE);
+			_this->m_dlgvisible = FALSE;
+			return TRUE;
+			}
+			break;
+
+		case IDC_TEXTCHAT_B:
+			{
+			HWND hList = GetDlgItem(hwnd, IDC_VIEWERS_LISTBOX);
+			LRESULT nSelected = SendMessage(hList, LB_GETCURSEL, 0, 0);
+			if (nSelected != LB_ERR)
+			{
+				char szClient[128];
+				if (SendMessage(hList, LB_GETTEXT, nSelected, (LPARAM)szClient) > 0)
+					_this->m_pServer->TextChatClient(szClient);
+			}
+			EndDialog(hwnd, TRUE);
+			_this->m_dlgvisible = FALSE;
+			return TRUE;
+			}
+			break;
+
+		}
+		break;
+
+	case WM_DESTROY:
+		EndDialog(hwnd, FALSE);
+		_this->m_dlgvisible = FALSE;
+		return TRUE;
+	}
+	return 0;
+}
diff --git a/ica/win32/winvnc/winvnc/vncListDlg.h b/ica/win32/winvnc/winvnc/vncListDlg.h
new file mode 100644
index 0000000..23347fd
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncListDlg.h
@@ -0,0 +1,47 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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://www.uvnc.com/
+
+class vncListDlg;
+
+#if (!defined(_WINVNC_VNCLISTDLG))
+#define _WINVNC_VNCLISTDLG
+
+#include "stdhdrs.h"
+#include "vncserver.h"
+
+
+class vncListDlg
+{
+public:
+	// Constructor / destructor
+	vncListDlg();
+	~vncListDlg();
+
+	BOOL Init(vncServer* pServer);
+	static BOOL CALLBACK DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+	void Display();
+
+	vncServer* m_pServer;
+	BOOL m_dlgvisible;
+};
+
+#endif
diff --git a/ica/win32/winvnc/winvnc/vncMultiMonitor.cpp b/ica/win32/winvnc/winvnc/vncMultiMonitor.cpp
new file mode 100644
index 0000000..67e1d30
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncMultiMonitor.cpp
@@ -0,0 +1,156 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+// System headers
+#include <assert.h>
+#include "stdhdrs.h"
+
+// Custom headers
+//#include <WinAble.h>
+#include <omnithread.h>
+#include "winvnc.h"
+#include "vnchooks/VNCHooks.h"
+#include "vncserver.h"
+#include "vnckeymap.h"
+#include "rfbRegion.h"
+#include "rfbRect.h"
+#include "vncdesktop.h"
+#include "vncservice.h"
+// Modif rdv at 2002 - v1.1.x - videodriver
+#include "vncOSVersion.h"
+
+#include "mmsystem.h" // sf at 2002
+#include "TextChat.h" // sf at 2002
+#include "vncdesktopthread.h"
+#include "common/win32_helpers.h"
+
+void 
+vncDesktop::Checkmonitors()
+{
+  nr_monitors=GetNrMonitors();
+  DEVMODE devMode;
+  if (nr_monitors>0)
+  {
+	if(OSversion()==1 || OSversion()==2 || OSversion()==4 )GetPrimaryDevice();
+	devMode.dmSize = sizeof(DEVMODE);
+	if(OSversion()==1 || OSversion()==2 || OSversion()==4 ) EnumDisplaySettings(mymonitor[0].device, ENUM_CURRENT_SETTINGS, &devMode);
+	else EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devMode);
+	mymonitor[0].offsetx=devMode.dmPosition.x;
+	mymonitor[0].offsety=devMode.dmPosition.y;
+	mymonitor[0].Width=devMode.dmPelsWidth;
+	mymonitor[0].Height=devMode.dmPelsHeight;
+	mymonitor[0].Depth=devMode.dmBitsPerPel;
+  }
+  if (nr_monitors>1)
+  {
+	GetSecondaryDevice();
+	devMode.dmSize = sizeof(DEVMODE);
+	EnumDisplaySettings(mymonitor[1].device, ENUM_CURRENT_SETTINGS, &devMode);
+	mymonitor[1].offsetx=devMode.dmPosition.x;
+	mymonitor[1].offsety=devMode.dmPosition.y;
+	mymonitor[1].Width=devMode.dmPelsWidth;
+	mymonitor[1].Height=devMode.dmPelsHeight;
+	mymonitor[1].Depth=devMode.dmBitsPerPel;
+  }
+	///
+    mymonitor[2].offsetx=GetSystemMetrics(SM_XVIRTUALSCREEN);
+    mymonitor[2].offsety=GetSystemMetrics(SM_YVIRTUALSCREEN);
+    mymonitor[2].Width=GetSystemMetrics(SM_CXVIRTUALSCREEN);
+    mymonitor[2].Height=GetSystemMetrics(SM_CYVIRTUALSCREEN);
+	mymonitor[2].Depth=mymonitor[0].Depth;//depth primary monitor is used
+
+}
+
+
+
+int
+vncDesktop::GetNrMonitors()
+{
+	if(OSversion()==3 || OSversion()==5) return 1;
+	int i;
+    int j=0;
+    
+    helper::DynamicFn<pEnumDisplayDevices> pd("USER32","EnumDisplayDevicesA");
+
+    if (pd.isValid())
+    {
+        DISPLAY_DEVICE dd;
+        ZeroMemory(&dd, sizeof(dd));
+        dd.cb = sizeof(dd);
+        for (i=0; (*pd)(NULL, i, &dd, 0); i++)
+			{
+				if (dd.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
+					if (!(dd.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER))j++;
+			}
+	}
+	return j;
+}
+
+void
+vncDesktop::GetPrimaryDevice()
+{
+	int i;
+    helper::DynamicFn<pEnumDisplayDevices> pd("USER32","EnumDisplayDevicesA");
+
+    if (pd.isValid())
+    {
+        DISPLAY_DEVICE dd;
+        ZeroMemory(&dd, sizeof(dd));
+        dd.cb = sizeof(dd);
+        for (i=0; (*pd)(NULL, i, &dd, 0); i++)
+			{
+				if (dd.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
+					if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
+						if (!(dd.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER))
+						{
+							strcpy(mymonitor[0].device,(char *)dd.DeviceName);
+						}
+
+			}
+	}
+}
+
+void
+vncDesktop::GetSecondaryDevice()
+{
+	int i;
+    helper::DynamicFn<pEnumDisplayDevices> pd("USER32","EnumDisplayDevicesA");
+
+    if (pd.isValid())
+    {
+        DISPLAY_DEVICE dd;
+        ZeroMemory(&dd, sizeof(dd));
+        dd.cb = sizeof(dd);
+        for (i=0; (*pd)(NULL, i, &dd, 0); i++)
+			{
+				if (dd.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
+					if (!(dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE))
+						if (!(dd.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER))
+						{
+							strcpy(mymonitor[1].device,(char *)dd.DeviceName);
+						}
+
+			}
+	}
+}
diff --git a/ica/win32/winvnc/winvnc/vncOSVersion.cpp b/ica/win32/winvnc/winvnc/vncOSVersion.cpp
new file mode 100644
index 0000000..356161c
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncOSVersion.cpp
@@ -0,0 +1,63 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include <windows.h>
+int OSTYPE=4;
+void
+SetOSVersion()
+{
+	OSVERSIONINFO OSversion;
+	
+	OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+
+	GetVersionEx(&OSversion);
+
+	switch(OSversion.dwPlatformId)
+	{
+		case VER_PLATFORM_WIN32_NT:
+								  if(OSversion.dwMajorVersion==5 && OSversion.dwMinorVersion==0)
+									 OSTYPE=1;							    
+								  if(OSversion.dwMajorVersion==5 && OSversion.dwMinorVersion==1)
+									 OSTYPE=1;
+								  if(OSversion.dwMajorVersion==5)
+									 OSTYPE=1;
+								  if(OSversion.dwMajorVersion>=6) // handle anything >= 6
+									 OSTYPE=2;
+								  if(OSversion.dwMajorVersion<=4) 	  
+								     OSTYPE=3;
+								  break;
+		case VER_PLATFORM_WIN32_WINDOWS:
+								if(OSversion.dwMinorVersion==0) 
+								{
+									OSTYPE=5; //95
+									break;
+								}
+								OSTYPE=4;
+	}
+}
+
+int OSversion()
+{
+	return OSTYPE;
+}
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncOSVersion.h b/ica/win32/winvnc/winvnc/vncOSVersion.h
new file mode 100644
index 0000000..e941a72
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncOSVersion.h
@@ -0,0 +1,30 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002 Ultr at VNC Team Members. 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/
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if !defined(DISPL)
+#define DISPL
+#pragma once
+void SetOSVersion();
+int OSversion();
+#endif
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncabout.cpp b/ica/win32/winvnc/winvnc/vncabout.cpp
new file mode 100644
index 0000000..60ea1c8
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncabout.cpp
@@ -0,0 +1,220 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncAbout.cpp
+
+// Implementation of the About dialog!
+
+#include "stdhdrs.h"
+
+#include "winvnc.h"
+#include "vncabout.h"
+
+//	[v1.0.2-jp1 fix] Load resouce from dll
+extern HINSTANCE	hInstResDLL;
+
+HBITMAP
+    DoGetBkGndBitmap(IN CONST UINT uBmpResId )
+    {
+        static HBITMAP hbmBkGnd = NULL;
+        if (NULL == hbmBkGnd)
+        {
+            /*char szFileName[MAX_PATH];
+			if (GetModuleFileName(NULL, szFileName, MAX_PATH))
+				{
+				char* p = strrchr(szFileName, '\\');
+					if (p == NULL) return false;
+					*p = '\0';
+				strcat (szFileName,"\\background2.bmp");
+			}
+			hbmBkGnd = (HBITMAP)LoadImage( NULL, szFileName, IMAGE_BITMAP, 0, 0,
+               LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE );*/
+			hbmBkGnd = (HBITMAP)LoadImage(
+                GetModuleHandle(NULL), MAKEINTRESOURCE(uBmpResId),
+                    IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
+
+            if (NULL == hbmBkGnd)
+                hbmBkGnd = (HBITMAP)-1;
+        }
+        return (hbmBkGnd == (HBITMAP)-1)
+            ? NULL : hbmBkGnd;
+    }
+BOOL
+    DoSDKEraseBkGnd(
+        IN CONST HDC hDC,
+        IN CONST COLORREF crBkGndFill
+      )
+    {
+        HBITMAP hbmBkGnd = DoGetBkGndBitmap(IDB_BITMAP1);
+        if (hDC && hbmBkGnd)
+        {
+            RECT rc;
+            if ((ERROR != GetClipBox(hDC, &rc)) && !IsRectEmpty(&rc))
+            {
+                HDC hdcMem = CreateCompatibleDC(hDC);
+                if (hdcMem)
+                {
+                    HBRUSH hbrBkGnd = CreateSolidBrush(crBkGndFill);
+                    if (hbrBkGnd)
+                    {
+                        HGDIOBJ hbrOld = SelectObject(hDC, hbrBkGnd);
+                        if (hbrOld)
+                        {
+                            SIZE size = {
+                                (rc.right-rc.left), (rc.bottom-rc.top)
+                            };
+
+                            if (PatBlt(hDC, rc.left, rc.top, size.cx, size.cy, PATCOPY))
+                            {
+                                HGDIOBJ hbmOld = SelectObject(hdcMem, hbmBkGnd);
+                                if (hbmOld)
+                                {
+                                    BitBlt(hDC, rc.left, rc.top, size.cx, size.cy,
+                                        hdcMem, rc.left, rc.top, SRCCOPY);
+                                    SelectObject(hdcMem, hbmOld);
+                                }
+                            }
+                            SelectObject(hDC, hbrOld);
+                        }
+                        DeleteObject(hbrBkGnd);
+                    }
+                    DeleteDC(hdcMem);
+                }
+            }
+        }
+        return TRUE;
+    }
+
+// Constructor/destructor
+vncAbout::vncAbout()
+{
+	m_dlgvisible = FALSE;
+}
+
+vncAbout::~vncAbout()
+{
+}
+
+// Initialisation
+BOOL
+vncAbout::Init()
+{
+	return TRUE;
+}
+
+// Dialog box handling functions
+void
+vncAbout::Show(BOOL show)
+{
+	if (show)
+	{
+		if (!m_dlgvisible)
+		{
+			//	[v1.0.2-jp1 fix]
+			//DialogBoxParam(hAppInstance,
+			DialogBoxParam(hInstResDLL,
+				MAKEINTRESOURCE(IDD_ABOUT), 
+				NULL,
+				(DLGPROC) DialogProc,
+				(LONG_PTR) this);
+		}
+	}
+}
+
+BOOL CALLBACK
+vncAbout::DialogProc(HWND hwnd,
+					 UINT uMsg,
+					 WPARAM wParam,
+					 LPARAM lParam )
+{
+	// We use the dialog-box's USERDATA to store a _this pointer
+	// This is set only once WM_INITDIALOG has been recieved, though!
+#ifndef _X64
+	vncAbout *_this = (vncAbout *) GetWindowLong(hwnd, GWL_USERDATA);
+#else
+	vncAbout *_this = (vncAbout *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+#endif
+	switch (uMsg)
+	{
+
+	case WM_INITDIALOG:
+		{
+			// Retrieve the Dialog box parameter and use it as a pointer
+			// to the calling vncProperties object
+#ifndef _X64
+			SetWindowLong(hwnd, GWL_USERDATA, lParam);
+#else
+			SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
+#endif
+			_this = (vncAbout *) lParam;
+
+			// Insert the build time information
+			extern char buildtime[];
+			SetDlgItemText(hwnd, IDC_BUILDTIME, buildtime);
+
+			// Show the dialog
+			SetForegroundWindow(hwnd);
+
+			_this->m_dlgvisible = TRUE;
+
+			return TRUE;
+		}
+
+	case WM_COMMAND:
+		switch (LOWORD(wParam))
+		{
+
+		case IDCANCEL:
+		case IDOK:
+			// Close the dialog
+			EndDialog(hwnd, TRUE);
+
+			_this->m_dlgvisible = FALSE;
+
+			return TRUE;
+		}
+
+		break;
+
+	case WM_DESTROY:
+		EndDialog(hwnd, FALSE);
+		_this->m_dlgvisible = FALSE;
+		return TRUE;
+	/*case WM_ERASEBKGND:
+            {
+                DoSDKEraseBkGnd((HDC)wParam, RGB(255,0,0));
+				return true;
+            }
+	case WM_CTLCOLORSTATIC:
+   {
+
+    //GetStockObject(NULL_BRUSH);
+    SetBkMode((HDC) wParam, TRANSPARENT);
+	return (DWORD) GetStockObject(NULL_BRUSH);
+
+   }*/
+	}
+	return 0;
+}
diff --git a/ica/win32/winvnc/winvnc/vncabout.h b/ica/win32/winvnc/winvnc/vncabout.h
new file mode 100644
index 0000000..ad7e881
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncabout.h
@@ -0,0 +1,58 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncAbout
+
+// Object implementing the About dialog for WinVNC.
+
+class vncAbout;
+
+#if (!defined(_WINVNC_VNCABOUT))
+#define _WINVNC_VNCABOUT
+
+// Includes
+#include "stdhdrs.h"
+
+// The vncAbout class itself
+class vncAbout
+{
+public:
+	// Constructor/destructor
+	vncAbout();
+	~vncAbout();
+
+	// Initialisation
+	BOOL Init();
+
+	// The dialog box window proc
+	static BOOL CALLBACK DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+	// General
+	void Show(BOOL show);
+
+	// Implementation
+	BOOL m_dlgvisible;
+};
+
+#endif // _WINVNC_VNCABOUT
diff --git a/ica/win32/winvnc/winvnc/vncacceptdialog.cpp b/ica/win32/winvnc/winvnc/vncacceptdialog.cpp
new file mode 100644
index 0000000..53293bd
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncacceptdialog.cpp
@@ -0,0 +1,204 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncAcceptDialog.cpp: implementation of the vncAcceptDialog class, used
+// to query whether or not to accept incoming connections.
+
+#include "stdhdrs.h"
+#include "vncacceptdialog.h"
+#include "winvnc.h"
+#include "vncservice.h"
+
+#include "resource.h"
+#include "common/win32_helpers.h"
+
+#include "Localization.h" // Act : add localization on messages
+
+//	[v1.0.2-jp1 fix] Load resouce from dll
+extern HINSTANCE	hInstResDLL;
+
+// Constructor
+
+vncAcceptDialog::vncAcceptDialog(UINT timeoutSecs,BOOL acceptOnTimeout, const char *ipAddress)
+{
+	m_timeoutSecs = timeoutSecs;
+	m_ipAddress = _strdup(ipAddress);
+	m_foreground_hack=FALSE;
+	m_acceptOnTimeout = acceptOnTimeout;
+}
+
+// Destructor
+
+vncAcceptDialog::~vncAcceptDialog()
+{
+	if (m_ipAddress)
+		free(m_ipAddress);
+}
+
+// Routine called to activate the dialog and, once it's done, delete it
+
+BOOL vncAcceptDialog::DoDialog()
+{
+	//	[v1.0.2-jp1 fix]
+	//int retVal = DialogBoxParam(hAppInstance, MAKEINTRESOURCE(IDD_ACCEPT_CONN), 
+	int retVal = DialogBoxParam(hInstResDLL, MAKEINTRESOURCE(IDD_ACCEPT_CONN), 
+		NULL, (DLGPROC) vncAcceptDlgProc, (LONG_PTR) this);
+	delete this;
+	switch (retVal) 
+	{
+		case IDREJECT:
+			return 0;
+		case IDACCEPT:
+			return 1;
+	}
+	return (m_acceptOnTimeout) ? 1 : 0;
+
+}
+
+// Callback function - handles messages sent to the dialog box
+
+BOOL CALLBACK vncAcceptDialog::vncAcceptDlgProc(HWND hwnd,
+											UINT uMsg,
+											WPARAM wParam,
+											LPARAM lParam) {
+	// This is a static method, so we don't know which instantiation we're 
+	// dealing with. But we can get a pseudo-this from the parameter to 
+	// WM_INITDIALOG, which we therafter store with the window and retrieve
+	// as follows:
+     vncAcceptDialog *_this = helper::SafeGetWindowUserData<vncAcceptDialog>(hwnd);
+	switch (uMsg) {
+
+		// Dialog has just been created
+	case WM_INITDIALOG:
+		{
+			// Save the lParam into our user data so that subsequent calls have
+			// access to the parent C++ object
+            helper::SafeSetWindowUserData(hwnd, lParam);
+            vncAcceptDialog *_this = (vncAcceptDialog *) lParam;
+
+			// Set the IP-address string
+			SetDlgItemText(hwnd, IDC_ACCEPT_IP, _this->m_ipAddress);
+			if (SetTimer(hwnd, 1, 1000, NULL) == 0)
+			{
+				if (_this->m_acceptOnTimeout)
+					EndDialog(hwnd, IDACCEPT);
+				else
+				EndDialog(hwnd, IDREJECT);
+			}
+			_this->m_timeoutCount = _this->m_timeoutSecs;
+
+			char temp[256];
+			if (_this->m_acceptOnTimeout)
+				sprintf(temp, "AutoAccept:%u", (_this->m_timeoutCount));
+			else
+				sprintf(temp, "AutoReject:%u", (_this->m_timeoutCount));
+			SetDlgItemText(hwnd, IDC_ACCEPT_TIMEOUT, temp);
+
+
+			// Attempt to mimic Win98/2000 dialog behaviour
+			if ((vncService::IsWinNT() && (vncService::VersionMajor() <= 4)) ||
+				(vncService::IsWin95() && (vncService::VersionMinor() == 0)))
+			{
+				// Perform special hack to display the dialog safely
+				if (GetWindowThreadProcessId(GetForegroundWindow(), NULL) != GetCurrentProcessId())
+				{
+					// We can't set our dialog as foreground if the foreground window
+					// doesn't belong to us - it's unsafe!
+					SetActiveWindow(hwnd);
+					_this->m_foreground_hack = TRUE;
+					_this->m_flash_state = FALSE;
+				}
+			}
+			if (!_this->m_foreground_hack) {
+				SetForegroundWindow(hwnd);
+			}
+
+			// Beep
+			MessageBeep(MB_ICONEXCLAMATION);
+            
+            // Return success!
+			return TRUE;
+		}
+
+		// Timer event
+	case WM_TIMER:
+		if ((_this->m_timeoutCount) == 0)
+			{
+				if ( _this->m_acceptOnTimeout ) 
+					{
+						EndDialog(hwnd, IDACCEPT);
+					}
+				else 
+					{
+						EndDialog(hwnd, IDREJECT);
+					}
+			}
+		_this->m_timeoutCount--;
+
+		// Flash if necessary
+		if (_this->m_foreground_hack) {
+			if (GetWindowThreadProcessId(GetForegroundWindow(), NULL) != GetCurrentProcessId())
+			{
+				_this->m_flash_state = !_this->m_flash_state;
+				FlashWindow(hwnd, _this->m_flash_state);
+			} else {
+				_this->m_foreground_hack = FALSE;
+			}
+		}
+
+		// Update the displayed count
+		char temp[256];
+		if ( _this->m_acceptOnTimeout )
+			sprintf(temp, "AutoAccept: %u", (_this->m_timeoutCount));
+		else
+			sprintf(temp, "AutoReject: %u", (_this->m_timeoutCount));
+		SetDlgItemText(hwnd, IDC_ACCEPT_TIMEOUT, temp);
+		break;
+
+		// Dialog has just received a command
+	case WM_COMMAND:
+		switch (LOWORD(wParam)) {
+
+			// User clicked Accept or pressed return
+		case IDACCEPT:
+		case IDOK:
+			EndDialog(hwnd, IDACCEPT);
+			return TRUE;
+
+		case IDREJECT:
+		case IDCANCEL:
+			EndDialog(hwnd, IDREJECT);
+			return TRUE;
+		};
+
+		break;
+
+		// Window is being destroyed!  (Should never happen)
+	case WM_DESTROY:
+		EndDialog(hwnd, IDREJECT);
+		return TRUE;
+	}
+	return 0;
+}
+
diff --git a/ica/win32/winvnc/winvnc/vncacceptdialog.h b/ica/win32/winvnc/winvnc/vncacceptdialog.h
new file mode 100644
index 0000000..604149f
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncacceptdialog.h
@@ -0,0 +1,73 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+class vncAcceptDialog;
+
+#if (!defined(_WINVNC_VNCACCEPTDIALOG))
+#define _WINVNC_VNCACCEPTDIALOG
+
+#pragma once
+
+// Incoming connection-rejection dialog.  vncClient creates an AcceptDialog
+// if it needs to query whether or not to accept a connection.
+
+class vncAcceptDialog  
+{
+public:
+
+	// Create an outgoing-connection dialog
+	vncAcceptDialog(UINT timeoutSecs,BOOL acceptOnTimeout, const char *ipAddress);
+
+	// Destructor
+	virtual ~vncAcceptDialog();
+
+	// Once a dialog object is created, either delete it again, or
+	// call DoDialog.  DoDialog will run the dialog and return
+	// TRUE (Accept) or FALSE (Reject).
+	// The function will also return false if the dialog times out.
+	BOOL DoDialog();
+
+	// Internal stuffs
+private:
+
+	// Routine to call when a dialog event occurs
+	static BOOL CALLBACK vncAcceptDlgProc(HWND hwndDlg,
+										UINT uMsg, 
+										WPARAM wParam,
+										LPARAM lParam);
+
+	// Storage for the timeout value
+	UINT m_timeoutSecs;
+	UINT m_timeoutCount;
+
+	// Flashing hack
+	BOOL m_foreground_hack;
+	BOOL m_flash_state;
+
+	// Address of the offending machine
+	char *m_ipAddress;
+
+	BOOL m_acceptOnTimeout;
+};
+
+#endif
diff --git a/ica/win32/winvnc/winvnc/vncauth.c b/ica/win32/winvnc/winvnc/vncauth.c
new file mode 100644
index 0000000..ef33844
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncauth.c
@@ -0,0 +1,187 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+/*
+ *  Functions for VNC password management and authentication.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <process.h>
+#include "vncauth.h"
+#include "d3des.h"
+
+/*
+ *   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.
+ */
+
+unsigned char fixedkey[8] = {23,82,107,6,35,78,88,7};
+
+/*
+ *   Encrypt a password and store it in a file.
+ */
+int
+vncEncryptPasswd(char *passwd, char *encryptedPasswd)
+{
+    size_t i;
+
+    /* pad password with nulls */
+
+    for (i = 0; i < MAXPWLEN; 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 */
+
+    deskey(fixedkey, EN0);
+    des((unsigned  char*) encryptedPasswd, (unsigned char*) encryptedPasswd);
+
+    return 8;
+}
+
+/*
+ *   Decrypt a password.  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 *
+vncDecryptPasswd(char *inouttext)
+{
+    unsigned char *passwd = (unsigned char *)malloc(9);
+
+    deskey(fixedkey, DE1);
+    des((unsigned char*) inouttext, passwd);
+
+    passwd[8] = 0;
+
+    return (char *)passwd;
+}
+
+char *
+vncDecryptPasswdMs(char *inouttext) 
+{ 
+        // Marscha at 2004: corrected bug which occured for some passwords. 
+        // See http://forum.ultravnc.net/viewtopic.php?t=803 
+    unsigned char *passwd = (unsigned char *)malloc(33); 
+        int i; 
+        for (i = 0; i < MAXMSPWLEN; i++) 
+                passwd[i] = inouttext[i]; 
+
+        //des seems only to handle the first 8 chars.. 
+    deskey(fixedkey, DE1); 
+    des(passwd, passwd); 
+    passwd[32] = 0; 
+
+        // Marscha at 2004: Seems to be not necessary, but I found no 
+        // documentation what des() guarantees beyond the 8th byte. 
+        for (i=8; i < MAXMSPWLEN; i++) 
+                passwd[i] = inouttext[i]; 
+
+    return (char *)passwd; 
+}
+
+/*
+ *   Generate a set of random bytes for use in challenge-response authentication.
+ */
+void
+vncRandomBytes(unsigned char *where) {
+  int i;
+  static unsigned int seed;
+  seed += (unsigned int) time(0) + _getpid() + _getpid() * 987654;
+
+  srand(seed);
+  for (i=0; i < CHALLENGESIZE; i++) {
+    where[i] = (unsigned char)(rand() & 255);    
+  }
+}
+
+void
+vncRandomBytesMs(unsigned char *where) {
+  int i;
+  static unsigned int seed;
+  seed += (unsigned int) time(0) + _getpid() + _getpid() * 987654;
+
+  srand(seed);
+  for (i=0; i < CHALLENGESIZEMS; i++) {
+    where[i] = (unsigned char)(rand() & 255);    
+  }
+}
+
+/*
+ *   Encrypt some bytes in memory using a password.
+ */
+void
+vncEncryptBytes(unsigned char *where, const char *passwd)
+{
+    unsigned char key[8];
+    size_t 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;
+	}
+    }
+
+    deskey(key, EN0);
+
+    for (i = 0; i < CHALLENGESIZE; i += 8) {
+	des(where+i, where+i);
+    }
+}
+
+/*
+ *   marscha at 2006
+ *   Decrypt bytes[length] in memory using key.
+ *   Key has to be 8 bytes, length a multiple of 8 bytes.
+ */
+void
+vncDecryptBytes(unsigned char *where, const int length, const unsigned char *key) {
+	int i, j;
+	deskey((unsigned char*) key, DE1);
+	for (i = length - 8; i > 0; i -= 8) {
+		des(where + i, where + i);
+		for (j = 0; j < 8; j++)
+			where[i + j] ^= where[i + j - 8];
+	}
+	/* i = 0 */
+	des (where, where);
+	for (i = 0; i < 8; i++)
+		where[i] ^= key[i];
+}
diff --git a/ica/win32/winvnc/winvnc/vncauth.h b/ica/win32/winvnc/winvnc/vncauth.h
new file mode 100644
index 0000000..eda1b24
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncauth.h
@@ -0,0 +1,48 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+/* 
+ * vncauth.h - describes the functions provided by the vncauth library.
+ */
+
+#define MAXPWLEN 8
+#define MAXMSPWLEN 32
+#define CHALLENGESIZE 16
+#define CHALLENGESIZEMS 64
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+extern int vncEncryptPasswd(char *passwd, char *fname);
+extern char *vncDecryptPasswd(char *fname);
+extern char *vncDecryptPasswdMs(char *fname);
+extern void vncRandomBytes(unsigned char *bytes);
+extern void vncRandomBytesMs(unsigned char *bytes);
+extern void vncEncryptBytes(unsigned char *bytes, const char *passwd);
+// marscha
+extern void vncDecryptBytes(unsigned char *bytes, const int length, const unsigned char *key);
+#ifdef __cplusplus
+}
+#endif
diff --git a/ica/win32/winvnc/winvnc/vncbuffer.cpp b/ica/win32/winvnc/winvnc/vncbuffer.cpp
new file mode 100644
index 0000000..8855740
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncbuffer.cpp
@@ -0,0 +1,1201 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// ScrBuffer implementation
+
+#include "stdhdrs.h"
+
+// Header
+
+#include "vncdesktop.h"
+#include "rfbMisc.h"
+
+#include "vncbuffer.h"
+
+vncBuffer::vncBuffer()
+{
+	m_freemainbuff = FALSE;
+	m_mainbuff = NULL;
+	m_backbuff = NULL;
+	m_cachebuff =NULL;
+	m_use_cache = FALSE;
+	m_cursor_shape_cleared = FALSE;
+	m_backbuffsize = 0;
+	m_desktop=NULL;
+
+	// Modif sf at 2002 - Scaling
+	m_ScaledBuff = NULL;
+	m_nScale = 1;
+	m_ScaledSize = 0;
+
+	m_nAccuracyDiv = 4;
+
+	nRowIndex = 0;
+	m_cursorpending = false;
+	m_single_monitor=1;
+	m_multi_monitor=0;
+
+	// sf at 2005 - Grey Palette
+	m_fGreyPalette = false;
+	m_videodriverused=false;
+}
+
+vncBuffer::~vncBuffer()
+{
+	if (m_freemainbuff) {
+		// We need to free the slow-blit buffer
+		// Modif rdv at 2002 - v1.1.x - Videodriver
+	if (m_mainbuff != NULL)
+		{
+			delete [] m_mainbuff;
+			m_mainbuff = NULL;
+		}
+	}
+	if (m_backbuff != NULL)
+	{
+		delete [] m_backbuff;
+		m_backbuff = NULL;
+	}
+
+	if (m_cachebuff != NULL)
+	{
+		delete [] m_cachebuff;
+		m_cachebuff = NULL;
+	}
+
+	// Modif sf at 2002 - Scaling
+	if (m_ScaledBuff != NULL)
+	{
+		delete [] m_ScaledBuff;
+		m_ScaledBuff = NULL;
+	}
+	m_ScaledSize = 0;
+
+
+	m_backbuffsize = 0;
+}
+
+BOOL 
+vncBuffer::SetDesktop(vncDesktop *desktop)
+{
+	// Called from vncdesktop startup
+	// only possible on startup or reinitialization
+	// access is block by m_desktop->m_update_lock
+	m_desktop=desktop;
+	return CheckBuffer();
+}
+
+rfb::Rect
+vncBuffer::GetSize()
+{
+try
+	{
+		return m_desktop->GetSize();
+	}
+	catch (...)
+	{	
+		//return rfb::Rect(0, 0, m_scrinfo.framebufferWidth, m_scrinfo.framebufferHeight);
+		return rfb::Rect(0, 0, 0, 0);
+	}
+
+}
+
+// Modif sf at 2002 - Scaling
+UINT vncBuffer::GetScale()
+{
+	return m_nScale;
+}
+
+
+BOOL vncBuffer::SetScale(int nScale)
+{
+	//called by
+	//vncClientThread::run(void *arg) Lock Added
+	// case rfbSetScale:  Lock Added OK
+
+	m_nScale = nScale;
+
+	// Problem, driver buffer is not writable
+	// so we always need a m_scalednuff
+	/*if (m_nScale == 1)
+	{
+		//if (m_mainbuff)memcpy(m_ScaledBuff, m_mainbuff, m_desktop->ScreenBuffSize());
+		//else ZeroMemory(m_ScaledBuff, m_desktop->ScreenBuffSize());
+		if (!CheckBuffer()) // added to remove scaled buffer
+            return FALSE;
+		if (m_mainbuff)memcpy(m_backbuff, m_mainbuff, m_desktop->ScreenBuffSize());
+		else ZeroMemory(m_ScaledBuff, m_desktop->ScreenBuffSize());
+	}
+	else
+	*/
+	{
+		// sf at 2002 - Idealy, we must do a ScaleRect of the whole screen here.
+		// ScaleRect(rfb::Rect(0, 0, m_scrinfo.framebufferWidth / m_nScale, m_scrinfo.framebufferHeight / m_nScale));
+		if (!CheckBuffer())//added to create scaled buffer
+            return FALSE;
+		ZeroMemory(m_ScaledBuff, m_desktop->ScreenBuffSize());
+		ZeroMemory(m_backbuff, m_desktop->ScreenBuffSize());
+	}
+	
+	return TRUE;
+}
+
+
+rfb::Rect vncBuffer::GetViewerSize()
+{
+	rfb::Rect rect;
+	rect=m_desktop->GetSize();
+	return rfb::Rect(rect.tl.x,rect.tl.y, rect.br.x / m_nScale, rect.br.y / m_nScale);
+}
+
+
+rfbPixelFormat
+vncBuffer::GetLocalFormat()
+{
+	return m_scrinfo.format;
+}
+
+BOOL
+vncBuffer::CheckBuffer()
+{
+	// Get the screen format, in case it has changed
+	m_desktop->FillDisplayInfo(&m_scrinfo);
+	m_bytesPerRow = m_scrinfo.framebufferWidth * m_scrinfo.format.bitsPerPixel/8;
+
+	// Check that the local format buffers are sufficient
+	if ((m_backbuffsize != m_desktop->ScreenBuffSize()) || !m_freemainbuff)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("request local buffer[%d]\n"), m_desktop->ScreenBuffSize());
+		if (m_freemainbuff) {
+			// Slow blits were enabled - free the slow blit buffer
+			// Modif rdv at 2002 - v1.1.x - Videodriver
+			if (m_mainbuff != NULL)
+			{
+				delete [] m_mainbuff;
+				m_mainbuff = NULL;
+			}
+		}
+
+		if (m_cachebuff != NULL)
+		{
+			delete [] m_cachebuff;
+			m_cachebuff = NULL;
+		}
+
+		// Check whether or not the vncDesktop is using fast blits
+		// Modif rdv at 2002 - v1.1.x - Videodriver
+		
+		m_mainbuff = (BYTE *)m_desktop->OptimisedBlitBuffer();
+		if (m_mainbuff) {
+			// Prevent us from freeing the DIBsection buffer
+			m_freemainbuff = FALSE;
+			vnclog.Print(LL_INTINFO, VNCLOG("fast blits detected - using DIBsection buffer\n"));
+		} else {
+			// Create our own buffer to copy blits through
+			m_freemainbuff = TRUE;
+			if ((m_mainbuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL)
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("unable to allocate main buffer[%d]\n"), m_desktop->ScreenBuffSize());
+				return FALSE;
+			}
+			memset(m_mainbuff, 0, m_desktop->ScreenBuffSize());
+		}
+
+		// Always create a back buffer
+        if (m_backbuffsize != m_desktop->ScreenBuffSize())
+        {
+		    if (m_backbuff != NULL)
+		    {
+			    delete [] m_backbuff;
+			    m_backbuff = NULL;
+        		m_backbuffsize = 0;
+		    }
+
+		    if ((m_backbuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL)
+		    {
+			    vnclog.Print(LL_INTERR, VNCLOG("unable to allocate back buffer[%d]\n"), m_desktop->ScreenBuffSize());
+			    return FALSE;
+		    }
+    		m_backbuffsize = m_desktop->ScreenBuffSize();
+        }
+
+		if (m_use_cache)
+		{
+			if ((m_cachebuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL)
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("unable to allocate cache buffer[%d]\n"), m_desktop->ScreenBuffSize());
+				return FALSE;
+			}
+			ClearCache();
+		}
+
+		memset(m_backbuff, 0, m_desktop->ScreenBuffSize());
+
+		// Problem, driver buffer is not writable
+		// so we always need a m_scalednuff
+		/// If scale==1 we don't need to allocate the memory
+		/*if (m_nScale > 1) 
+		{*/
+            if (m_ScaledSize != m_desktop->ScreenBuffSize())
+            {
+		        // Modif sf at 2002 - Scaling
+		        if (m_ScaledBuff != NULL)
+		        {
+			        delete [] m_ScaledBuff;
+			        m_ScaledBuff = NULL;
+            		m_ScaledSize = 0;
+		        }
+
+                // Modif sf at 2002 - Scaling
+			    if ((m_ScaledBuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL)
+			    {
+				    vnclog.Print(LL_INTERR, VNCLOG("unable to allocate scaled buffer[%d]\n"), m_desktop->ScreenBuffSize());
+				    return FALSE;
+			    }
+			    m_ScaledSize = m_desktop->ScreenBuffSize();
+            }
+		/*}
+		else
+		{
+			delete [] m_ScaledBuff;
+			m_ScaledBuff = NULL;
+    		m_ScaledSize = 0;
+		}
+
+		if (m_nScale > 1) */
+			memcpy(m_ScaledBuff, m_mainbuff, m_desktop->ScreenBuffSize());
+
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("local buffer=%d\n"), m_backbuffsize);
+
+	return TRUE;
+}
+
+
+// Modif sf at 2002 - v1.1.0
+//
+// Set the accuracy divider factor 
+// that is utilized in the GetChangedRegion function
+// for changes detection in Rectangles.
+// The higher the value the less accuracy.
+// WARNING :this value must be a 32 divider.
+//
+BOOL vncBuffer::SetAccuracy(int nAccuracy)
+{
+	m_nAccuracyDiv = nAccuracy;
+	nRowIndex = 0;
+
+	return TRUE;
+}
+
+void vncBuffer::VideDriverUsed(bool enabled)
+{
+	m_videodriverused=enabled;
+}
+
+bool vncBuffer::VideDriverUsed()
+{
+	return m_videodriverused;
+}
+
+
+// Check a specified rectangle for changes and fill the region with
+// the changed subrects
+//#pragma function(memcpy,Save_memcmp)
+
+const int BLOCK_SIZE = 32;
+void vncBuffer::CheckRect(rfb::Region2D &dest, rfb::Region2D &cacheRgn, const rfb::Rect &srcrect)
+{
+/*#ifdef _DEBUG
+					char			szText[256];
+					DWORD error=GetLastError();
+					sprintf(szText,"CheckRect ++++++++++++++++ %i %i %i %i  \n",srcrect.tl.x,srcrect.br.x,srcrect.tl.y,srcrect.br.y);
+					SetLastError(0);
+					OutputDebugString(szText);		
+#endif*/
+	//only called from desktopthread
+	if (!FastCheckMainbuffer())
+		return;
+
+	const UINT bytesPerPixel = m_scrinfo.format.bitsPerPixel >> 3; // divide by 8
+
+	rfb::Rect new_rect;
+	rfb::Rect srect = srcrect;
+
+	// Modif sf at 2002 - Scaling
+	rfb::Rect ScaledRect;
+	ScaledRect.tl.x = ((srect.tl.x < 0)? 0: srect.tl.x) / m_nScale;
+	ScaledRect.tl.y = ((srect.tl.y < 0)? 0: srect.tl.y) / m_nScale;
+
+	ScaledRect.br.x = ((srect.br.x < 0)? 0: srect.br.x) / m_nScale;
+	ScaledRect.br.y = ((srect.br.y < 0)? 0: srect.br.y) / m_nScale;
+
+	
+
+
+	int x, y;
+	UINT ay, by;
+
+	// DWORD align the incoming rectangle.  (bPP will be 8, 16 or 32)
+	if (bytesPerPixel < 4) {
+		if (bytesPerPixel == 1)				// 1 byte per pixel
+			ScaledRect.tl.x -= (ScaledRect.tl.x & 3);	// round down to nearest multiple of 4
+		else								// 2 bytes per pixel
+			ScaledRect.tl.x -= (ScaledRect.tl.x & 1);	// round down to nearest multiple of 2
+	}
+
+	// Modif sf at 2002 - Scaling
+	// Problem, driver buffer is not writable
+	// so we always need a m_scalednuff
+	unsigned char *TheBuffer;
+	if (m_nScale == 1 && !m_videodriverused)
+		TheBuffer = m_mainbuff;
+	else
+		TheBuffer = m_ScaledBuff;
+
+	// sf at 2004 - Optimization (attempt...)
+	int nOptimizedBlockSize; 
+	bool fSmallRect = false;
+	if (ScaledRect.br.x - ScaledRect.tl.x < 16)
+	{
+		nOptimizedBlockSize = BLOCK_SIZE / 4;
+		fSmallRect = true;
+	}
+	else if (ScaledRect.br.x - ScaledRect.tl.x < 32)
+		nOptimizedBlockSize = BLOCK_SIZE / 2;
+	else
+		nOptimizedBlockSize = BLOCK_SIZE * 2;
+
+	ptrdiff_t ptrBlockOffset = (ScaledRect.tl.y * m_bytesPerRow) + (ScaledRect.tl.x * bytesPerPixel);
+
+	if (m_use_cache && !m_desktop->m_UltraEncoder_used && m_cachebuff)
+	{
+	// Scan down the rectangle
+		unsigned char *o_topleft_ptr = m_backbuff  + ptrBlockOffset;
+		unsigned char *c_topleft_ptr = m_cachebuff + ptrBlockOffset;
+		unsigned char *n_topleft_ptr = TheBuffer   + ptrBlockOffset;
+		int last_x, last_y;
+		for (y = ScaledRect.tl.y, last_y = ScaledRect.br.y; y < last_y; y += nOptimizedBlockSize)
+	{
+		// Work out way down the bitmap
+		unsigned char * o_row_ptr = o_topleft_ptr;
+		unsigned char * n_row_ptr = n_topleft_ptr;
+		unsigned char * c_row_ptr = c_topleft_ptr;
+
+		const UINT blockbottom = min(y + nOptimizedBlockSize, ScaledRect.br.y);
+			for (x = ScaledRect.tl.x, last_x = ScaledRect.br.x; x < last_x; x += nOptimizedBlockSize)
+		{
+			// Work our way across the row
+			unsigned char *n_block_ptr = n_row_ptr;
+			unsigned char *o_block_ptr = o_row_ptr;
+			unsigned char *c_block_ptr = c_row_ptr;
+
+			const UINT blockright = min(x + nOptimizedBlockSize, ScaledRect.br.x);
+			const UINT bytesPerBlockRow = (blockright-x) * bytesPerPixel;
+
+				bool fCache = true; // RDV at 2002
+			// Modif sf at 2002 - v1.1.0
+			// int nRowIndex = 0; // We don't reinit nRowIndex for each rect -> we don't always miss the same changed pixels
+			int nOffset = (int)(bytesPerBlockRow / m_nAccuracyDiv);
+
+			unsigned char *y_o_ptr = o_block_ptr;
+			unsigned char *y_n_ptr = n_block_ptr;
+			unsigned char *y_c_ptr = c_block_ptr;
+
+			// Scan this block
+			for (ay = y; ay < blockbottom; ay++)
+			{
+					int nBlockOffset =  nRowIndex * nOffset;
+					if (memcmp(n_block_ptr + nBlockOffset, o_block_ptr + nBlockOffset, nOffset) != 0)
+				{
+					// A pixel has changed, so this block needs updating
+					if (fSmallRect) // Ignore unchanged first rows (samll rect : less chance to miss changes when using nAccuracy div)
+					{
+						new_rect.tl.y = ay * m_nScale;
+						y_n_ptr += ((ay-y) * m_bytesPerRow);
+						y_o_ptr += ((ay-y) * m_bytesPerRow);
+					}
+					else
+					{
+						new_rect.tl.y = y * m_nScale;
+					}
+					new_rect.tl.x = x * m_nScale;
+					new_rect.br.x = blockright * m_nScale;
+					new_rect.br.y = blockbottom * m_nScale;
+
+					for (by = ((fSmallRect) ? ay : y); by < blockbottom; by++)
+					{
+						// Until then, new rect and cached rect are equal.
+						// So test the next row
+						// TODO: send the common part as cached rect and the rest as changed rect
+						if (fCache)
+							{
+							if (memcmp(y_n_ptr, y_c_ptr, bytesPerBlockRow) != 0)
+							{
+									fCache = false; // New rect and cached rect differ
+								}
+							}
+						memcpy(y_c_ptr, y_o_ptr, bytesPerBlockRow); // Save back buffer rect in cache
+						memcpy(y_o_ptr, y_n_ptr, bytesPerBlockRow); // Save new rect in back buffer
+						y_n_ptr += m_bytesPerRow;
+						y_o_ptr += m_bytesPerRow;
+						y_c_ptr += m_bytesPerRow;
+					}
+					if (fCache) // The Rect was in the cache
+					{
+							cacheRgn.assign_union(rfb::Region2D(new_rect));
+					}
+					else // The Rect wasn't in the cache
+					{
+							dest.assign_union(new_rect);
+					}
+
+					break;
+				}
+
+				n_block_ptr += m_bytesPerRow;
+				o_block_ptr += m_bytesPerRow;
+				c_block_ptr += m_bytesPerRow;
+
+				nRowIndex = (nRowIndex + 1) % m_nAccuracyDiv; // sf at 2002 - v1.1.0
+			}
+
+			o_row_ptr += bytesPerBlockRow;
+			n_row_ptr += bytesPerBlockRow;
+			c_row_ptr += bytesPerBlockRow;
+		}
+
+		o_topleft_ptr += m_bytesPerRow * nOptimizedBlockSize;
+		n_topleft_ptr += m_bytesPerRow * nOptimizedBlockSize;
+		c_topleft_ptr += m_bytesPerRow * nOptimizedBlockSize;
+	}
+	}
+	else
+	{
+	// Scan down the rectangle
+		unsigned char *o_topleft_ptr = m_backbuff + ptrBlockOffset;
+		unsigned char *n_topleft_ptr = TheBuffer  + ptrBlockOffset;
+	for (y = ScaledRect.tl.y; y < ScaledRect.br.y; y += nOptimizedBlockSize)
+	{
+		// Work out way down the bitmap
+		unsigned char * o_row_ptr = o_topleft_ptr;
+		unsigned char * n_row_ptr = n_topleft_ptr;
+
+		const UINT blockbottom = min(y + nOptimizedBlockSize, ScaledRect.br.y);
+		for (x = ScaledRect.tl.x; x < ScaledRect.br.x; x += nOptimizedBlockSize)
+		{
+			// Work our way across the row
+			unsigned char *n_block_ptr = n_row_ptr;
+			unsigned char *o_block_ptr = o_row_ptr;
+
+			const UINT blockright = min(x+nOptimizedBlockSize, ScaledRect.br.x);
+			const UINT bytesPerBlockRow = (blockright-x) * bytesPerPixel;
+
+			// Modif sf at 2002 
+			unsigned char *y_o_ptr = o_block_ptr;
+			unsigned char *y_n_ptr = n_block_ptr;
+
+			// int nRowIndex = 0;
+			int nOffset = (int)(bytesPerBlockRow / m_nAccuracyDiv);
+
+			// Scan this block
+			for (ay = y; ay < blockbottom; ay++)
+			{
+					int nBlockOffset =  nRowIndex * nOffset;
+					if (memcmp(n_block_ptr + nBlockOffset, o_block_ptr + nBlockOffset, nOffset) != 0)
+				{
+					// A pixel has changed, so this block needs updating
+					if (fSmallRect) // Ignore unchanged first rows (samll rect : less chance to miss changes when using nAccuracy div)
+					{
+						new_rect.tl.y = ay * m_nScale;
+						y_n_ptr += ((ay-y) * m_bytesPerRow);
+						y_o_ptr += ((ay-y) * m_bytesPerRow);
+					}
+					else
+					{
+						new_rect.tl.y = y * m_nScale;
+					}
+					new_rect.tl.x = x * m_nScale;
+					new_rect.br.x = (blockright * m_nScale);
+					new_rect.br.y = (blockbottom * m_nScale);
+						dest.assign_union(new_rect);
+
+					// Copy the changes to the back buffer
+					for (by = ((fSmallRect) ? ay : y); by < blockbottom; by++)
+					{
+						memcpy(y_o_ptr, y_n_ptr, bytesPerBlockRow);
+						y_n_ptr += m_bytesPerRow;
+						y_o_ptr += m_bytesPerRow;
+					}
+
+					break;
+				}
+				// Last Run Ptr gets over de bounding
+				// Boundcheker keeps complaining
+				if (ay!=blockbottom-1)
+				{
+					n_block_ptr += m_bytesPerRow;
+					o_block_ptr += m_bytesPerRow;
+					nRowIndex = (nRowIndex + 1) % m_nAccuracyDiv;
+				}
+			}
+			if (x != ScaledRect.br.x-1)
+			{
+				o_row_ptr += bytesPerBlockRow;
+				n_row_ptr += bytesPerBlockRow;
+			}
+		}
+		if (y != ScaledRect.br.y-1)
+		{
+			o_topleft_ptr += m_bytesPerRow * nOptimizedBlockSize;
+			n_topleft_ptr += m_bytesPerRow * nOptimizedBlockSize;
+		}
+	}
+	}
+}
+
+//rdv modif scaled and videodriver
+void
+vncBuffer::GrabRegion(rfb::Region2D &src,BOOL driver,BOOL capture)
+{
+	rfb::RectVector rects;
+	rfb::RectVector::iterator i;
+	rfb::Rect grabRect;
+
+	//
+	// - Are there any rectangles to check?
+	//
+	src.get_rects(rects, 1, 1);
+	if (rects.empty()) return;
+
+	//
+	// - Grab the rectangles that may have changed
+	//
+	//
+	//************ Added extra cliprect check
+	int x,y,w,h;
+	for (i = rects.begin(); i != rects.end(); ++i)
+	{
+		rfb::Rect rect = *i;
+		x=rect.tl.x;
+		y=rect.tl.y;
+		w=rect.br.x-rect.tl.x;
+		h=rect.br.y-rect.tl.y;
+		src=src.subtract(rect);
+		if (ClipRect(&x, &y, &w, &h, m_desktop->m_Cliprect.tl.x, m_desktop->m_Cliprect.tl.y,
+				m_desktop->m_Cliprect.br.x-m_desktop->m_Cliprect.tl.x, m_desktop->m_Cliprect.br.y-m_desktop->m_Cliprect.tl.y))
+			{
+				rect.tl.x=x;
+				rect.tl.y=y;
+				rect.br.x=x+w;
+				rect.br.y=y+h;
+				src=src.union_(rect);
+			}
+	}
+	src.get_rects(rects, 1, 1);
+	if (rects.empty()) 
+		{
+			return;
+		}
+
+	// The rectangles should have arrived in order of height
+	for (i = rects.begin(); i != rects.end(); i++)
+	{
+		rfb::Rect current = *i;
+
+
+		// Check that this rectangle is part of this capture region
+		if (current.tl.y > grabRect.br.y)
+		{
+			// If the existing rect is non-null the capture it
+			if (!grabRect.is_empty()) GrabRect(grabRect,driver,capture);
+
+			grabRect = current;
+		} else {
+			grabRect = current.union_boundary(grabRect);
+		}
+	}
+
+	// If there are still some rects to be done then do them
+	if (!grabRect.is_empty()) GrabRect(grabRect,driver,capture);
+}
+
+void
+vncBuffer::CheckRegion(rfb::Region2D &dest,rfb::Region2D &cacheRgn ,const rfb::Region2D &src)
+{
+	rfb::RectVector rects;
+	rfb::RectVector::iterator i;
+
+	// If there is nothing to do then do nothing...
+	src.get_rects(rects, 1, 1);
+	if (rects.empty()) return;
+
+	//
+	// - Scan the specified rectangles for changes
+	//
+	// Block desactivation mainbuff while running
+	// No Lock Needed, only called from vncdesktopthread
+	for (i = rects.begin(); i != rects.end(); ++i)
+	{
+		CheckRect(dest,cacheRgn, *i);
+	}
+}
+
+
+
+// Reduce possible colors to 8 shades of gray
+int To8GreyColors(int r, int g, int b)
+{
+    int Value;
+    Value = (r*11 + g*16 +b*5 ) / 32;
+	
+	if (Value <= 0x20)
+		return 0x101010;
+	else if (Value <= 0x40)
+		return 0x303030;
+	else if (Value <= 0x60)
+		return 0x505050;
+	else if (Value <= 0x80)
+		return 0x707070;
+	else if (Value <= 0xa0)
+		return 0x909090;
+	else if (Value <= 0xc0)
+		return 0xb0b0b0;
+	else if (Value <= 0xe0)
+		return 0xd0d0d0;
+	else
+		return 0xf0f0f0;  
+}
+ 
+
+// Modif sf at 2002 - Scaling
+void vncBuffer::ScaleRect(rfb::Rect &rect)
+{
+    bool fCanReduceColors = true;
+
+    //JK 26th Jan, 2005: Color conversion to 8 shades of gray added,
+	//at the moment only works if server has 24/32-bit color
+
+    // this construct is faster than the old method -- it has no jumps, so there's no chance of
+    // branch mispredictions, and it generates better asm code .
+    fCanReduceColors = (((m_scrinfo.format.redMax ^ m_scrinfo.format.blueMax ^ 
+                        m_scrinfo.format.greenMax ^ 0xff) == 0)  && m_fGreyPalette);
+
+#if 0
+	if ((m_scrinfo.format.redMax == 255) 
+		&& 
+		(m_scrinfo.format.blueMax == 255)
+		&&
+		(m_scrinfo.format.greenMax == 255)
+		&&
+		m_fGreyPalette
+		)
+		fCanReduceColors = true;
+	else
+		fCanReduceColors = false;
+#endif
+	//End JK
+
+	// called from grabrect and grabmouse
+	// grabmouse is only called from desktopthread, no lock needed
+	// grebrect called from grabregion called from desktopthread, no lock needed
+	// no lock needed
+	if (!FastCheckMainbuffer())
+		return;
+	///////////
+	rect.tl.y = (rect.tl.y - (rect.tl.y % m_nScale));
+	rect.br.y = (rect.br.y - (rect.br.y % m_nScale)) + m_nScale - 1;
+	rect.tl.x = (rect.tl.x - (rect.tl.x % m_nScale));
+	rect.br.x = (rect.br.x - (rect.br.x % m_nScale)) + m_nScale - 1;
+
+	rfb::Rect ScaledRect;
+	ScaledRect.tl.y = rect.tl.y / m_nScale;
+	ScaledRect.br.y = rect.br.y / m_nScale;
+	ScaledRect.tl.x = rect.tl.x / m_nScale;
+	ScaledRect.br.x = rect.br.x / m_nScale;
+
+	// Copy and scale data from screen Main buffer to Scaled buffer
+	BYTE *pMain   =	m_mainbuff + (rect.tl.y * m_bytesPerRow) + 
+					(rect.tl.x * m_scrinfo.format.bitsPerPixel / 8);
+	BYTE *pScaled = m_ScaledBuff + (ScaledRect.tl.y * m_bytesPerRow) +
+					(ScaledRect.tl.x * m_scrinfo.format.bitsPerPixel / 8);
+
+	// We keep one pixel for m_Scale*m_nScale pixels in the Main buffer
+	// and copy it in the Scaled Buffer
+
+	// TrueColor Case.
+	// Pixels Blending (takes the "medium" pixel of each m_Scale*m_nScale square)
+	// This TrueColor Pixel blending routine comes from the Harakan's WinVNC with Server Side Scaling
+	// Extension. It replaces my own buggy Blending function that given *ugly* results.
+	if (m_nScale == 1 && !m_videodriverused)
+	{
+		//nothing to do, we use the current buffer
+		//Thebuffer=mainbuffer
+		//This avoid the memcpy, on slower systems this give
+		// a real speed boost.
+	}
+	else if (m_scrinfo.format.trueColour && m_nScale!=1)
+	{
+		unsigned long lRed;
+		unsigned long lGreen;
+		unsigned long lBlue;
+		unsigned long lScaledPixel;
+		UINT nBytesPerPixel = (m_scrinfo.format.bitsPerPixel / 8);
+
+		// For each line of the Destination ScaledRect
+		for (int y = ScaledRect.tl.y; y < ScaledRect.br.y; y++)
+		{
+			// For each Pixel of the line 
+			for (int x = 0; x < (ScaledRect.br.x - ScaledRect.tl.x); x++)
+			{
+				lRed   = 0; 
+				lGreen = 0;
+				lBlue  = 0;
+				// Take a m_Scale*m_nScale square of pixels in the Main Buffer
+				// and get the global Red, Green, Blue values for this square
+				for (UINT r = 0; r < m_nScale; r++)
+				{
+					for (UINT c = 0; c < m_nScale; c++)
+					{
+						lScaledPixel = 0;
+						for (UINT b = 0; b < nBytesPerPixel; b++)
+						{
+							lScaledPixel += (pMain[(((x * m_nScale) + c) * nBytesPerPixel) + (r * m_bytesPerRow) + b]) << (8 * b);
+						}
+						lRed   += (lScaledPixel >> m_scrinfo.format.redShift) & m_scrinfo.format.redMax;
+						lGreen += (lScaledPixel >> m_scrinfo.format.greenShift) & m_scrinfo.format.greenMax;
+						lBlue  += (lScaledPixel >> m_scrinfo.format.blueShift) & m_scrinfo.format.blueMax;
+					}
+				}
+				// Get the medium R,G,B values for the sqare
+				lRed   /= m_nScale * m_nScale;
+				lGreen /= m_nScale * m_nScale;
+				lBlue  /= m_nScale * m_nScale;
+				// Calculate the resulting "medium" pixel
+				// lScaledPixel = (lRed << m_scrinfo.format.redShift) + (lGreen << m_scrinfo.format.greenShift) + (lBlue << m_scrinfo.format.blueShift);
+                // JK 26th Jan, 2005: Reduce possible colors to 8 shades of gray
+				if (fCanReduceColors)
+				{
+					lScaledPixel = To8GreyColors(lRed, lGreen, lBlue);
+				}
+				else
+				{
+					// Calculate the resulting "medium" pixel
+					lScaledPixel = (lRed << m_scrinfo.format.redShift) + (lGreen << m_scrinfo.format.greenShift) + (lBlue << m_scrinfo.format.blueShift);
+				} 
+				
+				// Copy the resulting pixel in the Scaled Buffer
+				for (UINT b = 0; b < nBytesPerPixel; b++)
+				{
+					pScaled[(x * nBytesPerPixel) + b] = (lScaledPixel >> (8 * b)) & 0xFF;
+				}
+			}
+			// Move the buffers' pointers to their next "line"
+			pMain   += (m_bytesPerRow * m_nScale); // Skip m_nScale raws of the mainbuffer's Rect
+			pScaled += m_bytesPerRow; 
+		}
+	}
+	// Keep only the topleft pixel of each MainBuffer's m_Scale*m_nScale block
+	// Very incurate method...but bearable result in 256 and 16bit colors modes.
+	else 
+	{
+		UINT nBytesPerPixel = (m_scrinfo.format.bitsPerPixel / 8);
+		for (int y = ScaledRect.tl.y; y < ScaledRect.br.y; y++)
+		{
+			/*for (int x = 0; x < (ScaledRect.br.x - ScaledRect.tl.x); x++)
+			{
+				memcpy(&pScaled[x * nBytesPerPixel], &pMain[x * m_nScale * nBytesPerPixel], nBytesPerPixel);
+			}*/
+			memcpy(&pScaled[0], &pMain[0], nBytesPerPixel*(ScaledRect.br.x - ScaledRect.tl.x));
+			// Move the buffers' pointers to their next "line"
+			pMain   += (m_bytesPerRow * m_nScale); // Skip m_nScale lines of the mainbuffer's Rect
+			pScaled += m_bytesPerRow;
+		}
+	}
+}
+
+
+// Modif sf at 2005 - Grey Scale transformation
+// Ok, it's a little wild to do it here... should be done in Translate.cpp,..
+void vncBuffer::GreyScaleRect(rfb::Rect &rect)
+{
+	bool fCanReduceColors = true;
+    fCanReduceColors = (((m_scrinfo.format.redMax ^ m_scrinfo.format.blueMax ^ 
+                        m_scrinfo.format.greenMax ^ 0xff) == 0)  && m_fGreyPalette);
+#if 0
+    //JK 26th Jan, 2005: Color conversion to 8 shades of gray added,
+	//at the moment only works if server has 24/32-bit color
+	if ((m_scrinfo.format.redMax == 255) 
+		&& 
+		(m_scrinfo.format.blueMax == 255)
+		&&
+		(m_scrinfo.format.greenMax == 255)
+		&&
+		m_fGreyPalette
+		)
+		fCanReduceColors = true;
+	else
+		fCanReduceColors = false;
+	//End JK
+#endif
+	if (!fCanReduceColors) return;
+	if (!FastCheckMainbuffer())
+		return;
+	///////////
+	rect.tl.y = (rect.tl.y - (rect.tl.y % m_nScale));
+	rect.br.y = (rect.br.y - (rect.br.y % m_nScale)) + m_nScale - 1;
+	rect.tl.x = (rect.tl.x - (rect.tl.x % m_nScale));
+	rect.br.x = (rect.br.x - (rect.br.x % m_nScale)) + m_nScale - 1;
+
+	rfb::Rect ScaledRect;
+	ScaledRect.tl.y = rect.tl.y / m_nScale;
+	ScaledRect.br.y = rect.br.y / m_nScale;
+	ScaledRect.tl.x = rect.tl.x / m_nScale;
+	ScaledRect.br.x = rect.br.x / m_nScale;
+
+	// Copy and scale data from screen Main buffer to Scaled buffer
+	BYTE *pMain   =	m_mainbuff + (rect.tl.y * m_bytesPerRow) + 
+					(rect.tl.x * m_scrinfo.format.bitsPerPixel / 8);
+	BYTE *pScaled = m_ScaledBuff + (ScaledRect.tl.y * m_bytesPerRow) +
+					(ScaledRect.tl.x * m_scrinfo.format.bitsPerPixel / 8);
+	
+	UINT nBytesPerPixel = (m_scrinfo.format.bitsPerPixel / 8);
+
+	unsigned long lRed;
+	unsigned long lGreen;
+	unsigned long lBlue;
+	unsigned long lPixel;
+
+		for (int y = ScaledRect.tl.y; y < ScaledRect.br.y; y++)
+		{
+			for (int x = 0; x < (ScaledRect.br.x - ScaledRect.tl.x); x++)
+			{
+				lPixel = 0;
+			for (UINT b = 0; b < nBytesPerPixel; b++)
+				lPixel += ((pMain[(x * nBytesPerPixel) + b]) << (8 * b));
+
+			lRed   = (lPixel >> m_scrinfo.format.redShift) & m_scrinfo.format.redMax;
+			lGreen = (lPixel >> m_scrinfo.format.greenShift) & m_scrinfo.format.greenMax;
+			lBlue  = (lPixel >> m_scrinfo.format.blueShift) & m_scrinfo.format.blueMax;
+			lPixel = To8GreyColors(lRed, lGreen, lBlue);
+			
+			for (UINT bb = 0; bb < nBytesPerPixel; bb++)
+				pScaled[(x * nBytesPerPixel) + bb] = (lPixel >> (8 * bb)) & 0xFF;
+			}
+			// Move the buffers' pointers to their next "line"
+			pMain   += (m_bytesPerRow * m_nScale); // Skip m_nScale lines of the mainbuffer's Rect
+			pScaled += m_bytesPerRow;
+		}
+}
+
+void vncBuffer::WriteMessageOnScreen(char* tt)
+{
+	m_desktop->WriteMessageOnScreen(tt,m_mainbuff, m_backbuffsize);
+}
+
+void
+vncBuffer::GrabRect(const rfb::Rect &rect,BOOL driver,BOOL capture)
+{
+	//no lock needed
+	if (!FastCheckMainbuffer()) return;
+
+	if (!driver) m_desktop->CaptureScreen(rect, m_mainbuff, m_backbuffsize,capture);
+
+	// Modif sf at 2002 - Scaling
+	// Only use scaledbuffer if necessary !
+	rfb::Rect TheRect = rect;
+	// if (m_nScale > 1) ScaleRect(rfb::Rect(rect.tl.x, rect.tl.y, rect.br.x, rect.br.y)); // sf at 2002 - Waste of time !!!
+	// Problem, driver buffer is not writable
+	// so we always need a m_scalednuff
+	/*if (m_nScale > 1) 
+		ScaleRect(TheRect);
+	else if (m_fGreyPalette)
+		GreyScaleRect(TheRect);*/
+	if (m_fGreyPalette)GreyScaleRect(TheRect);
+	else ScaleRect(TheRect);
+
+}
+
+
+void
+vncBuffer::CopyRect(const rfb::Rect &dest, const rfb::Point &delta)
+{
+	rfb::Rect ScaledDest;
+	rfb::Rect ScaledSource;
+
+	rfb::Rect src = dest.translate(delta.negate());
+
+	// Modif sf at 2002 - Scaling
+	ScaledDest.tl.y = dest.tl.y / m_nScale;
+	ScaledDest.br.y = dest.br.y / m_nScale;
+	ScaledDest.tl.x = dest.tl.x / m_nScale;
+	ScaledDest.br.x = dest.br.x / m_nScale;
+	ScaledSource.tl.y = src.tl.y / m_nScale;
+	ScaledSource.br.y = src.br.y / m_nScale;
+	ScaledSource.tl.x = src.tl.x / m_nScale;
+	ScaledSource.br.x = src.br.x / m_nScale;
+
+	ClearCacheRect(ScaledSource);
+	ClearCacheRect(ScaledDest);
+
+
+	// Copy the data from one part of the back-buffer to another!
+	const UINT bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
+	const UINT bytesPerLine = (ScaledDest.br.x - ScaledDest.tl.x) * bytesPerPixel;
+	BYTE *srcptr = m_backbuff + (ScaledSource.tl.y * m_bytesPerRow) +
+					(ScaledSource.tl.x * bytesPerPixel);
+
+	BYTE *destptr = m_backbuff + (ScaledDest.tl.y * m_bytesPerRow) +
+					(ScaledDest.tl.x * bytesPerPixel);
+	// Copy the data around in the right order
+	if (ScaledDest.tl.y < ScaledSource.tl.y)
+	{
+		for (int y = ScaledDest.tl.y; y < ScaledDest.br.y; y++)
+		{
+			memmove(destptr, srcptr, bytesPerLine);
+			srcptr += m_bytesPerRow;
+			destptr += m_bytesPerRow;
+		}
+	}
+	else
+	{
+		srcptr += (m_bytesPerRow * ((ScaledDest.br.y - ScaledDest.tl.y)-1));
+		destptr += (m_bytesPerRow * ((ScaledDest.br.y - ScaledDest.tl.y)-1));
+		for (int y = ScaledDest.br.y; y > ScaledDest.tl.y; y--)
+		{
+			memmove(destptr, srcptr, bytesPerLine);
+			srcptr -= m_bytesPerRow;
+			destptr -= m_bytesPerRow;
+		}
+	}
+}
+
+
+void
+vncBuffer::ClearCache()
+{
+	m_cursor_shape_cleared=TRUE;
+	if (m_use_cache && m_cachebuff)
+	{
+	RECT dest;
+	dest.left=0;
+	dest.top=0;
+	dest.right=m_scrinfo.framebufferWidth;
+	dest.bottom=m_scrinfo.framebufferHeight;
+	// Modif sf at 2002 - v1.1.0 - Scramble the cache
+	int nValue = 0;
+	BYTE *cacheptr = m_cachebuff + (dest.top * m_bytesPerRow) +
+		(dest.left * m_scrinfo.format.bitsPerPixel/8);
+
+	const UINT bytesPerLine = (dest.right-dest.left)*(m_scrinfo.format.bitsPerPixel/8);
+
+		for (int y=dest.top; y < dest.bottom; y++)
+		{
+			memset(cacheptr, nValue++, bytesPerLine);
+			cacheptr+=m_bytesPerRow;
+			if (nValue == 255) nValue = 0; 
+		}
+	}
+}
+
+void
+vncBuffer::ClearCacheRect(const rfb::Rect &dest)
+{
+	if (m_use_cache && m_cachebuff)
+	{
+	int nValue = 0;
+	BYTE *cacheptr = m_cachebuff + (dest.tl.y * m_bytesPerRow) +
+		(dest.tl.x * m_scrinfo.format.bitsPerPixel/8);
+
+	const UINT bytesPerLine = (dest.br.x-dest.tl.x)*(m_scrinfo.format.bitsPerPixel/8);
+
+		for (int y=dest.tl.y; y < dest.br.y; y++)
+		{
+			memset(cacheptr, nValue++, bytesPerLine);
+			cacheptr+=m_bytesPerRow;
+			if (nValue == 255) nValue = 0; 
+		}
+	}
+}
+
+void
+vncBuffer::ClearBack()
+{
+	if (m_mainbuff) memcpy(m_backbuff, m_mainbuff, m_desktop->ScreenBuffSize());
+}
+
+//***************************
+// This is used on SW switch
+// if backbuffer is not cleared
+// the checker marks the rects
+// as already send
+//***************************
+void
+vncBuffer::BlackBack()
+{
+	RECT dest;
+	dest.left=0;
+	dest.top=0;
+	dest.right=m_scrinfo.framebufferWidth;
+	dest.bottom=m_scrinfo.framebufferHeight;
+	int nValue = 1;
+	BYTE *backptr = m_backbuff + (dest.top * m_bytesPerRow) +
+		(dest.left * m_scrinfo.format.bitsPerPixel/8);
+
+	const UINT bytesPerLine = (dest.right-dest.left)*(m_scrinfo.format.bitsPerPixel/8);
+
+		for (int y=dest.top; y < dest.bottom; y++)
+		{
+			memset(backptr, nValue, bytesPerLine);
+			backptr+=m_bytesPerRow;
+			if (nValue == 255) nValue = 0; 
+		}
+}
+
+void
+vncBuffer::GrabMouse()
+{
+	//no lock needed
+	if (!FastCheckMainbuffer()) return;
+	m_desktop->CaptureMouse(m_mainbuff, m_backbuffsize);
+
+	// Modif sf at 2002 - Scaling
+	rfb::Rect rect = m_desktop->MouseRect();
+	
+	// Problem, driver buffer is not writable
+		// so we always need a m_scalednuff
+	/*if (m_nScale > 1) */
+		ScaleRect(rect);
+}
+
+void
+vncBuffer::GetMousePos(rfb::Rect &rect)
+{
+	rect = m_desktop->MouseRect();
+}
+
+// Verify that the fast blit buffer hasn't changed
+inline BOOL
+vncBuffer::FastCheckMainbuffer() {
+	// Modif rdv at 2002 - v1.1.x - videodriver
+	VOID *tmp = m_desktop->OptimisedBlitBuffer();
+	if (tmp && (m_mainbuff != tmp))
+		{
+//			omni_mutex_lock l(m_desktop->m_videodriver_lock2);
+			BOOL result=CheckBuffer();
+			return result;
+		}
+	return TRUE;
+}
+
+
+// sf at 2005
+void vncBuffer::EnableGreyPalette(BOOL enable)
+{
+	m_fGreyPalette = enable;
+}
+
+// RDV
+void
+vncBuffer::EnableCache(BOOL enable)
+{
+	m_use_cache = enable;
+	if (m_use_cache)
+	{
+		if (m_cachebuff != NULL)
+		{
+			delete [] m_cachebuff;
+			m_cachebuff = NULL;
+		}
+		if ((m_cachebuff = new BYTE [m_desktop->ScreenBuffSize()]) == NULL)
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("unable to allocate cache buffer[%d]\n"), m_desktop->ScreenBuffSize());
+			return;
+		}
+		ClearCache();
+		// BlackBack();
+	}
+	/*else
+	{
+		if (m_cachebuff != NULL)
+		{
+			delete [] m_cachebuff;
+			m_cachebuff = NULL;
+		}
+	}*/
+}
+
+BOOL
+vncBuffer::IsCacheEnabled()
+{
+	return m_use_cache;
+}
+
+BOOL
+vncBuffer::IsShapeCleared()
+{
+	BOOL value=m_cursor_shape_cleared;
+	m_cursor_shape_cleared=FALSE;
+	return value;
+}
+
+void
+vncBuffer::MultiMonitors(int number)
+{
+	if (number==1) {m_single_monitor=true;m_multi_monitor=false;}
+	if (number==2) {m_single_monitor=false;m_multi_monitor=true;}
+}
+
+bool
+vncBuffer::IsMultiMonitor()
+{
+	if (m_single_monitor) return false;//we need at least 1 display
+	else return true;
+}
+
+
+					   
+bool
+vncBuffer::ClipRect(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);
+}
diff --git a/ica/win32/winvnc/winvnc/vncbuffer.h b/ica/win32/winvnc/winvnc/vncbuffer.h
new file mode 100644
index 0000000..f2cd7c8
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncbuffer.h
@@ -0,0 +1,158 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+// vncBuffer object
+
+// The vncBuffer object provides a client-local copy of the screen
+// It can tell the client which bits have changed in a given region
+// It uses the specified vncDesktop to read screen data from
+class vncDesktop;
+
+class vncBuffer;
+
+#if !defined(_WINVNC_VNCBUFFER)
+#define _WINVNC_VNCBUFFER
+#pragma once
+
+
+// Includes
+
+#include "stdhdrs.h"
+#include "vncencoder.h"
+#include "rfbRegion.h"
+#include "rfbRect.h"
+#include "rfb.h"
+#include "vncmemcpy.h"
+
+// Class definition
+
+class vncBuffer
+{
+// Methods
+public:
+	// Create/Destroy methods
+	vncBuffer();
+	~vncBuffer();
+
+	BOOL SetDesktop(vncDesktop *desktop);
+
+	// BUFFER INFO
+	rfb::Rect GetSize();
+	rfbPixelFormat GetLocalFormat();
+
+	// BUFFER MANIPULATION
+	BOOL CheckBuffer();
+
+	// SCREEN SCANNING
+//	void Clear(const rfb::Rect &rect);
+	void CheckRegion(rfb::Region2D &dest,rfb::Region2D &cache, const rfb::Region2D &src);
+	void CheckRect(rfb::Region2D &dest,rfb::Region2D &cache, const rfb::Rect &src);
+
+	// SCREEN CAPTURE
+	void CopyRect(const rfb::Rect &dest, const rfb::Point &delta);
+	void GrabMouse();
+	void GrabRegion(rfb::Region2D &src,BOOL driver,BOOL capture);
+	void GetMousePos(rfb::Rect &rect);
+
+	// CACHE RDV
+	void ClearCache();
+	void ClearCacheRect(const rfb::Rect &dest);
+	void ClearBack();
+	void BlackBack();
+	void EnableCache(BOOL enable);
+	BOOL IsCacheEnabled();
+	BOOL IsShapeCleared();
+	void MultiMonitors(int number);
+	bool  IsMultiMonitor();
+	void WriteMessageOnScreen(char*);
+
+	// sf at 2005 - Grey Palette
+	void EnableGreyPalette(BOOL enable);
+
+	// Modif sf at 2002 - Scaling
+	void ScaleRect(rfb::Rect &rect);
+	void GreyScaleRect(rfb::Rect &rect);
+	rfb::Rect GetViewerSize();
+	UINT GetScale();
+	BOOL SetScale(int scale);
+
+	// Modif sf at 2002 - Optim
+	BOOL SetAccuracy(int accuracy);
+
+	// CURSOR HANDLING
+	BOOL IsCursorUpdatePending(){return m_cursorpending;};
+	void SetCursorPending(BOOL enable){m_cursorpending=enable;};
+
+	bool ClipRect(int *x, int *y, int *w, int *h, int cx, int cy, int cw, int ch);
+
+// Implementation
+protected:
+
+	// Routine to verify the mainbuff handle hasn't changed
+	BOOL FastCheckMainbuffer();
+	
+	// Fetch pixel data to the main buffer from the screen
+	void GrabRect(const rfb::Rect &rect,BOOL driver,BOOL capture);
+
+	BOOL		m_freemainbuff;
+
+	UINT		m_bytesPerRow;
+
+	// CACHE RDV
+	BOOL			m_use_cache;
+	BOOL			m_single_monitor;
+	BOOL			m_multi_monitor;
+
+	// Modif sf at 2002 - Scaling
+	int			m_ScaledSize;
+	UINT		m_nScale;
+	BYTE		*m_ScaledBuff;
+
+	int			m_nAccuracyDiv; // Accuracy divider for changes detection in Rects
+	int			nRowIndex;
+
+	// CURSOR HANDLING
+	BOOL			m_cursorpending;
+
+public:
+	rfbServerInitMsg	m_scrinfo;
+	// vncEncodeMgr reads data from back buffer directly when encoding
+	BYTE		*m_backbuff;
+	int			m_backbuffsize;
+	// CACHE RDV
+	BYTE		*m_cachebuff;
+	BYTE		*m_mainbuff;
+	vncDesktop	*m_desktop;
+//	Ultravncmemcpy mem;
+	BOOL			m_cursor_shape_cleared;
+
+	// sf at 2005 - Grey palette
+	BOOL m_fGreyPalette;
+	bool m_videodriverused;
+	void VideDriverUsed(bool enabled);
+	bool VideDriverUsed();
+};
+
+#endif // _WINVNC_VNCBUFFER
diff --git a/ica/win32/winvnc/winvnc/vncclient.cpp b/ica/win32/winvnc/winvnc/vncclient.cpp
new file mode 100644
index 0000000..5f1aa58
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncclient.cpp
@@ -0,0 +1,6099 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncClient.cpp
+
+// The per-client object.  This object takes care of all per-client stuff,
+// such as socket input and buffering of updates.
+
+// vncClient class handles the following functions:
+// - Recieves requests from the connected client and
+//   handles them
+// - Handles incoming updates properly, using a vncBuffer
+//   object to keep track of screen changes
+// It uses a vncBuffer and is passed the vncDesktop and
+// vncServer to communicate with.
+
+// Includes
+#include "stdhdrs.h"
+#include <omnithread.h>
+#include <string>
+#include <sstream>
+#include "resource.h"
+
+// Custom
+#include "vncserver.h"
+#include "vncclient.h"
+#include "vsocket.h"
+#include "vncdesktop.h"
+#include "rfbRegion.h"
+#include "vncbuffer.h"
+#include "vncservice.h"
+#include "vncpasswd.h"
+#include "vncacceptdialog.h"
+#include "vnckeymap.h"
+#include "vncmenu.h"
+
+#include "rfb/dh.h"
+#include "vncauth.h"
+
+#ifdef IPP
+#include "..\..\ipp_zlib\src\zlib\zlib.h"
+#else
+#include "zlib.h"
+#endif
+#include "mmsystem.h" // sf at 2002
+#include "sys/types.h"
+#include "sys/stat.h"
+
+#include <string>
+#include <iterator>
+#include <shlobj.h>
+#include "vncOSVersion.h"
+#include "common/win32_helpers.h"
+
+#ifdef ULTRAVNC_ITALC_SUPPORT
+extern BOOL ultravnc_italc_load_int( LPCSTR valname, LONG *out );
+extern BOOL ultravnc_italc_ask_permission( const char *username, const char *host );
+#endif
+
+bool isDirectoryTransfer(const char *szFileName);
+extern BOOL SPECIAL_SC_PROMPT;
+extern BOOL SPECIAL_SC_EXIT;
+int getinfo(char mytext[1024]);
+
+#ifndef ULTRAVNC_ITALC_SUPPORT
+// take a full path & file name, split it, prepend prefix to filename, then merge it back
+static std::string make_temp_filename(const char *szFullPath)
+{
+    // don't add prefix for directory transfers.
+    if (isDirectoryTransfer(szFullPath))
+        return szFullPath;
+        
+    std::string tmpName(szFullPath);
+    std::string::size_type pos = tmpName.rfind('\\');
+    if (pos != std::string::npos)
+        tmpName.insert(pos + 1, rfbPartialFilePrefix);
+
+    return tmpName;
+}
+#endif
+
+std::string get_real_filename(std::string name)
+{
+    std::string::size_type pos;
+
+    pos = name.find(rfbPartialFilePrefix);
+    if (pos != std::string::npos)
+        name.erase(pos, sz_rfbPartialFilePrefix);
+ 
+    return name;
+}
+
+
+// #include "rfb.h"
+bool DeleteFileOrDirectory(TCHAR *srcpath)
+{
+    TCHAR path[MAX_PATH + 1]; // room for extra null; SHFileOperation requires double null terminator
+    memset(path, 0, sizeof path);
+    
+    _tcsncpy(path, srcpath, MAX_PATH);
+
+    SHFILEOPSTRUCT op;
+    memset(&op, 0, sizeof(SHFILEOPSTRUCT));
+    op.wFunc = FO_DELETE;
+    op.pFrom  = path;
+    op.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR;
+    
+    int result = SHFileOperation(&op);
+    // MSDN says to not look at the error code, just treat 0 as SUCCESS, nonzero is failure.
+    // Do not use GetLastError with the return values of this function.
+
+    return result == 0;
+}
+
+bool replaceFile(const char *src, const char *dst)
+{
+    DWORD dwFileAttribs;
+    bool status;
+    
+    dwFileAttribs = GetFileAttributes(dst);
+    // make the file read/write if it's read only.
+    if (dwFileAttribs != INVALID_FILE_ATTRIBUTES && dwFileAttribs & FILE_ATTRIBUTE_READONLY)
+        SetFileAttributes(dst, dwFileAttribs & ~FILE_ATTRIBUTE_READONLY);
+
+    if (OSversion() == 3)
+    {
+        status = ::CopyFile(src, dst, false) ? true : false;
+        if (status)
+            ::DeleteFile(src);
+    }
+    else
+        status = ::MoveFileEx(src, dst, MOVEFILE_REPLACE_EXISTING) ? true : false;
+
+    // restore orginal file attributes, if we have them. We won't have them if
+    // the destination file didn't exist prior to the copy/move.
+    if (dwFileAttribs != INVALID_FILE_ATTRIBUTES)
+        SetFileAttributes(dst, dwFileAttribs);
+
+    return status;
+}
+#include "Localization.h" // Act : add localization on messages
+typedef BOOL (WINAPI *PGETDISKFREESPACEEX)(LPCSTR,PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER);
+
+DWORD GetExplorerLogonPid();
+unsigned long updates_sent;
+
+// vncClient update thread class
+
+//	[v1.0.2-jp1 fix]
+//	yak!'s File transfer patch
+//	Simply forward strchr() and strrchr() to _mbschr() and _mbsrchr() to avoid 0x5c problem, respectively.
+//	Probably, it is better to write forward functions internally.
+#include <mbstring.h>
+#define strchr(a, b) reinterpret_cast<char*>(_mbschr(reinterpret_cast<unsigned char*>(a), b))
+#define strrchr(a, b) reinterpret_cast<char*>(_mbsrchr(reinterpret_cast<unsigned char*>(a), b))
+
+
+// 31 January 2008 jdp
+std::string AddDirPrefixAndSuffix(const char *name)
+{
+    std::string dirname(rfbDirPrefix);
+    dirname += name;
+    dirname += rfbDirSuffix;
+
+    return dirname;
+}
+
+bool isDirectory(const char *name)
+{
+    struct _stat statbuf;
+
+    _stat(name, &statbuf);
+    return (statbuf.st_mode & _S_IFDIR) == _S_IFDIR;
+}
+bool isDirectoryTransfer(const char *szFileName)
+{
+    return (strncmp(strrchr(const_cast<char*>(szFileName), '\\') + 1, rfbZipDirectoryPrefix, strlen(rfbZipDirectoryPrefix)) == 0);
+}
+
+void GetZippedFolderPathName(const char *szZipFile, char *path)
+{
+    // input lookes like: "c:\temp\!UVNCDIR-folder.zip"
+    // output should look like "c:\temp\folder"
+
+    const char *zip_ext = ".zip";
+    std::string folder_path(szZipFile);
+    std::string::size_type pos;
+
+    // remove "!UVNCDIR-"
+    pos = folder_path.find(rfbZipDirectoryPrefix);
+    if (pos != std::string::npos)
+        folder_path.replace(pos, strlen(rfbZipDirectoryPrefix),"");
+
+    // remove ".zip"
+    pos = folder_path.rfind(zip_ext);
+    if (pos != std::string::npos)
+        folder_path.replace(pos, strlen(zip_ext), "");
+
+    // remove "[ "
+    pos = folder_path.find(rfbDirPrefix);
+    if (pos != std::string::npos)
+        folder_path.replace(pos, strlen(rfbDirPrefix),"");
+
+    // remove " ]"
+    pos = folder_path.rfind(rfbDirSuffix);
+    if (pos != std::string::npos)
+        folder_path.replace(pos, strlen(rfbDirSuffix),"");
+    
+    std::copy(folder_path.begin(), folder_path.end(), path);
+    path[folder_path.size()] = 0; // terminate the string    
+}
+
+void SplitTransferredFileNameAndDate(char *szFileAndDate, char *filetime)
+{
+    char *p = strrchr(szFileAndDate, ',');
+    if (p == NULL)
+    {
+        if (filetime)
+            *filetime = '\0';
+    }
+    else
+    {
+        if (filetime)
+            strcpy(filetime, p+1);
+        *p = '\0';
+    }
+}
+
+
+/*
+ * File transfer event hooks
+ *
+ * The following functions are called from various points in the file transfer
+ * process. They are notification hooks; the hook function cannot affect the
+ * file operation. One possible use of these hooks is to implement auditing
+ * of file operations on the server side.
+ *
+ * Note that uploads are transfers from the server to the viewer and a
+ * download is a transfer from the viewer to the server.
+ *
+ * The hook will have to use the state stored in the vncClient object
+ * to figure out what was done in most cases. For those cases where it
+ * is not possible, the hook is passed enough information about the event.
+ *  
+ */
+
+// called at the successful start of a file upload
+void vncClient::FTUploadStartHook()
+{
+}
+
+// called when an abort is received from the viewer. it is assumed that it was
+// due to the user cancelling the transfer
+void vncClient::FTUploadCancelledHook()
+{
+}
+
+// Called when an upload fails for any reason: network failure, out of disk space, insufficient privileges etc.
+void vncClient::FTUploadFailureHook()
+{
+}
+
+// Called after the file is successfully uploaded. At this point the file transfer is complete.
+void vncClient::FTUploadCompleteHook()
+{
+}
+
+// called at the successful start of a file download
+void vncClient::FTDownloadStartHook()
+{
+}
+
+// called when an abort is received from the viewer. it is assumed that it was
+// due to the user cancelling the transfer
+void vncClient::FTDownloadCancelledHook()
+{
+}
+
+// Called when an dowload fails for any reason: network failure, out of disk space, insufficient privileges etc.
+void vncClient::FTDownloadFailureHook()
+{
+}
+
+// Called after the file is successfully downloaded. At this point the file transfer is complete.
+void vncClient::FTDownloadCompleteHook()
+{
+}
+
+// Called when a new folder is created.
+void vncClient::FTNewFolderHook(std::string name)
+{
+}
+
+// called when a folder is created
+void vncClient::FTDeleteHook(std::string name, bool isDir)
+{
+}
+
+// called when a file or folder is renamed.
+void vncClient::FTRenameHook(std::string oldName, std::string newname)
+{
+}
+
+
+
+class vncClientUpdateThread : public omni_thread
+{
+public:
+
+	// Init
+	BOOL Init(vncClient *client);
+
+	// Kick the thread to send an update
+	void Trigger();
+
+	// Kill the thread
+	void Kill();
+
+	// Disable/enable updates
+	void EnableUpdates(BOOL enable);
+
+	void get_time_now(unsigned long* abs_sec, unsigned long* abs_nsec);
+
+	// The main thread function
+    virtual void *run_undetached(void *arg);
+
+protected:
+	virtual ~vncClientUpdateThread();
+
+	// Fields
+protected:
+	vncClient *m_client;
+	omni_condition *m_signal;
+	omni_condition *m_sync_sig;
+	BOOL m_active;
+	BOOL m_enable;
+};
+
+// Modif cs at 2005
+#ifdef DSHOW
+class MutexAutoLock 
+{
+public:
+	MutexAutoLock(HANDLE* phMutex) 
+	{ 
+		m_phMutex = phMutex;
+
+		if(WAIT_OBJECT_0 != WaitForSingleObject(*phMutex, INFINITE))
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("Could not get access to the mutex\n"));
+		}
+	}
+	~MutexAutoLock() 
+	{ 
+		ReleaseMutex(*m_phMutex);
+	}
+
+	HANDLE* m_phMutex;
+};
+#endif
+
+BOOL
+vncClientUpdateThread::Init(vncClient *client)
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("init update thread\n"));
+
+	m_client = client;
+	omni_mutex_lock l(m_client->GetUpdateLock());
+	m_signal = new omni_condition(&m_client->GetUpdateLock());
+	m_sync_sig = new omni_condition(&m_client->GetUpdateLock());
+	m_active = TRUE;
+	m_enable = m_client->m_disable_protocol == 0;
+	if (m_signal && m_sync_sig) {
+		start_undetached();
+		return TRUE;
+	}
+	return FALSE;
+}
+
+vncClientUpdateThread::~vncClientUpdateThread()
+{
+	if (m_signal) delete m_signal;
+	if (m_sync_sig) delete m_sync_sig;
+	vnclog.Print(LL_INTINFO, VNCLOG("update thread gone\n"));
+	m_client->m_updatethread=NULL;
+}
+
+void
+vncClientUpdateThread::Trigger()
+{
+	// ALWAYS lock client UpdateLock before calling this!
+	// Only trigger an update if protocol is enabled
+	if (m_client->m_disable_protocol == 0) {
+		m_signal->signal();
+	}
+}
+
+void
+vncClientUpdateThread::Kill()
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("kill update thread\n"));
+
+	omni_mutex_lock l(m_client->GetUpdateLock());
+	m_active=FALSE;
+	m_signal->signal();
+}
+
+
+void
+vncClientUpdateThread::get_time_now(unsigned long* abs_sec, unsigned long* abs_nsec)
+{
+    static int days_in_preceding_months[12]
+	= { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+    static int days_in_preceding_months_leap[12]
+	= { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 };
+
+    SYSTEMTIME st;
+
+    GetSystemTime(&st);
+    *abs_nsec = st.wMilliseconds * 1000000;
+
+    // this formula should work until 1st March 2100
+
+    DWORD days = ((st.wYear - 1970) * 365 + (st.wYear - 1969) / 4
+		  + ((st.wYear % 4)
+		     ? days_in_preceding_months[st.wMonth - 1]
+		     : days_in_preceding_months_leap[st.wMonth - 1])
+		  + st.wDay - 1);
+
+    *abs_sec = st.wSecond + 60 * (st.wMinute + 60 * (st.wHour + 24 * days));
+}
+void
+vncClientUpdateThread::EnableUpdates(BOOL enable)
+{
+	// ALWAYS call this with the UpdateLock held!
+	if (enable) {
+		vnclog.Print(LL_INTINFO, VNCLOG("enable update thread\n"));
+	} else {
+		vnclog.Print(LL_INTINFO, VNCLOG("disable update thread\n"));
+	}
+
+	m_enable = enable;
+	m_signal->signal();
+	unsigned long now_sec, now_nsec;
+    get_time_now(&now_sec, &now_nsec);
+	m_sync_sig->wait();
+	/*if  (m_sync_sig->timedwait(now_sec+1,0)==0)
+		{
+//			m_signal->signal();
+			vnclog.Print(LL_INTINFO, VNCLOG("thread timeout\n"));
+		} */
+	vnclog.Print(LL_INTINFO, VNCLOG("enable/disable synced\n"));
+}
+
+void*
+vncClientUpdateThread::run_undetached(void *arg)
+{
+	rfb::SimpleUpdateTracker update;
+	rfb::Region2D clipregion;
+	// adzm - 2010-07 - Extended clipboard
+	//char *clipboard_text = 0;
+	update.enable_copyrect(true);
+	BOOL send_palette = FALSE;
+
+	updates_sent=0;
+
+	vnclog.Print(LL_INTINFO, VNCLOG("starting update thread\n"));
+
+	while (1)
+	{
+//#ifdef _DEBUG
+//										char			szText[256];
+//										sprintf(szText," run_undetached loop \n");
+//										OutputDebugString(szText);		
+//#endif
+		// Block waiting for an update to send
+		{
+			omni_mutex_lock l(m_client->GetUpdateLock());
+			/*#ifdef _DEBUG
+					char			szText[256];
+					sprintf(szText," ++++++ Mutex lock clientupdatethread\n");
+					OutputDebugString(szText);		
+			#endif*/
+
+			m_client->m_incr_rgn.assign_union(clipregion);
+
+			// We block as long as updates are disabled, or the client
+			// isn't interested in them, unless this thread is killed.
+			if (updates_sent < 1) 
+			{
+			while (m_active && (
+						!m_enable || (
+							m_client->m_update_tracker.get_changed_region().intersect(m_client->m_incr_rgn).is_empty() &&
+							m_client->m_update_tracker.get_copied_region().intersect(m_client->m_incr_rgn).is_empty() &&
+							m_client->m_update_tracker.get_cached_region().intersect(m_client->m_incr_rgn).is_empty() &&
+							// adzm - 2010-07 - Extended clipboard
+							!(m_client->m_clipboard.m_bNeedToProvide || m_client->m_clipboard.m_bNeedToNotify) &&
+							!m_client->m_cursor_pos_changed // nyama/marscha - PointerPos
+							)
+						)
+					) {
+				// Issue the synchronisation signal, to tell other threads
+				// where we have got to
+				m_sync_sig->broadcast();
+
+				// Wait to be kicked into action
+				m_signal->wait();
+			}
+			}
+			else
+			{
+				while (m_active && (
+						!m_enable || (
+							m_client->m_update_tracker.get_changed_region().intersect(m_client->m_incr_rgn).is_empty() &&
+							m_client->m_update_tracker.get_copied_region().intersect(m_client->m_incr_rgn).is_empty() &&
+							m_client->m_update_tracker.get_cached_region().intersect(m_client->m_incr_rgn).is_empty() &&
+							!m_client->m_encodemgr.IsCursorUpdatePending() &&
+							// adzm - 2010-07 - Extended clipboard
+							!(m_client->m_clipboard.m_bNeedToProvide || m_client->m_clipboard.m_bNeedToNotify) &&
+							!m_client->m_NewSWUpdateWaiting &&
+							!m_client->m_cursor_pos_changed // nyama/marscha - PointerPos
+							)
+						)
+					) {
+				// Issue the synchronisation signal, to tell other threads
+				// where we have got to
+				m_sync_sig->broadcast();
+
+				// Wait to be kicked into action
+				m_signal->wait();
+			}
+			}
+			// If the thread is being killed then quit
+			if (!m_active) break;
+
+			// SEND AN UPDATE!
+			// The thread is active, updates are enabled, and the
+			// client is expecting an update - let's see if there
+			// is anything to send.
+
+			// Modif sf at 2002 - FileTransfer - Don't send anything if a file transfer is running !
+			// if (m_client->m_fFileTransferRunning) return 0;
+			// if (m_client->m_pTextChat->m_fTextChatRunning) return 0;
+
+			// sf at 2002
+			// New scale requested, we do it before sending the next Update
+			if (m_client->fNewScale)
+			{
+				// Send the new framebuffer size to the client
+				rfb::Rect ViewerSize = m_client->m_encodemgr.m_buffer->GetViewerSize();
+				
+				// Copyright (C) 2001 - Harakan software
+				if (m_client->m_fPalmVNCScaling)
+				{
+					rfb::Rect ScreenSize = m_client->m_encodemgr.m_buffer->GetSize();
+					rfbPalmVNCReSizeFrameBufferMsg rsfb;
+					rsfb.type = rfbPalmVNCReSizeFrameBuffer;
+					rsfb.desktop_w = Swap16IfLE(ScreenSize.br.x);
+					rsfb.desktop_h = Swap16IfLE(ScreenSize.br.y);
+					rsfb.buffer_w = Swap16IfLE(ViewerSize.br.x);
+					rsfb.buffer_h = Swap16IfLE(ViewerSize.br.y);
+					m_client->m_socket->SendExact((char*)&rsfb,
+													sz_rfbPalmVNCReSizeFrameBufferMsg,
+													rfbPalmVNCReSizeFrameBuffer);
+				}
+				else // eSVNC-UltraVNC Scaling
+				{
+					rfbResizeFrameBufferMsg rsmsg;
+					rsmsg.type = rfbResizeFrameBuffer;
+					rsmsg.framebufferWidth  = Swap16IfLE(ViewerSize.br.x);
+					rsmsg.framebufferHeigth = Swap16IfLE(ViewerSize.br.y);
+					m_client->m_socket->SendExact((char*)&rsmsg,
+													sz_rfbResizeFrameBufferMsg,
+													rfbResizeFrameBuffer);
+					m_client->m_ScaledScreen = m_client->m_encodemgr.m_buffer->GetViewerSize();
+					m_client->m_nScale = m_client->m_encodemgr.m_buffer->GetScale();
+				}
+
+				m_client->m_encodemgr.m_buffer->ClearCache();
+				m_client->fNewScale = false;
+				m_client->m_fPalmVNCScaling = false;
+
+				// return 0;
+			}
+
+			// Has the palette changed?
+			send_palette = m_client->m_palettechanged;
+			m_client->m_palettechanged = FALSE;
+
+			// Fetch the incremental region
+			clipregion = m_client->m_incr_rgn;
+			//m_client->m_incr_rgn.clear();
+
+			// Get the clipboard data, if any
+			// adzm - 2010-07 - Extended clipboard
+			if (!(m_client->m_clipboard.m_bNeedToProvide || m_client->m_clipboard.m_bNeedToNotify))
+			{
+				m_client->m_incr_rgn.clear();
+			}
+		
+			// Get the update details from the update tracker
+			m_client->m_update_tracker.flush_update(update, clipregion);
+
+		//if (!m_client->m_encodemgr.m_buffer->m_desktop->IsVideoDriverEnabled())
+		//TEST if (!m_client->m_encodemgr.m_buffer->m_desktop->m_hookdriver)
+		{
+			// Render the mouse if required
+
+		if (updates_sent > 1 ) m_client->m_cursor_update_pending = m_client->m_encodemgr.WasCursorUpdatePending();
+		updates_sent++;
+
+		if (!m_client->m_cursor_update_sent && !m_client->m_cursor_update_pending) 
+			{
+				if (m_client->m_mousemoved)
+				{
+					// Re-render its old location
+					m_client->m_oldmousepos =
+						m_client->m_oldmousepos.intersect(m_client->m_ScaledScreen); // sf at 2002
+					if (!m_client->m_oldmousepos.is_empty())
+						update.add_changed(m_client->m_oldmousepos);
+
+					// And render its new one
+					m_client->m_encodemgr.m_buffer->GetMousePos(m_client->m_oldmousepos);
+					m_client->m_oldmousepos =
+						m_client->m_oldmousepos.intersect(m_client->m_ScaledScreen);
+					if (!m_client->m_oldmousepos.is_empty())
+						update.add_changed(m_client->m_oldmousepos);
+	
+					m_client->m_mousemoved = FALSE;
+				}
+			}
+		}
+
+		// SEND THE CLIPBOARD
+		// If there is clipboard text to be sent then send it
+		// Also allow in loopbackmode
+		// Loopback mode with winvncviewer will cause a loping
+		// But ssh is back working		
+		if (!m_client->m_fFileSessionOpen) {
+
+			bool bShouldFlush = false;
+
+			// adzm - 2010-07 - Extended clipboard
+			// send any clipboard data that should be sent automatically
+			if (m_client->m_clipboard.m_bNeedToProvide) {
+				m_client->m_clipboard.m_bNeedToProvide = false;
+				if (m_client->m_clipboard.settings.m_bSupportsEx) {
+					
+					int actualLen = m_client->m_clipboard.extendedClipboardDataMessage.GetDataLength();
+
+					rfbServerCutTextMsg message;
+					memset(&message, 0, sizeof(rfbServerCutTextMsg));
+					message.type = rfbServerCutText;
+
+					message.length = Swap32IfLE(-actualLen);
+
+					bShouldFlush = true;
+
+					//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+					if (!m_client->SendRFBMsgQueue(rfbServerCutText,
+						(BYTE *) &message, sizeof(message))) {
+						m_client->m_socket->Close();
+					}
+					if (!m_client->m_socket->SendExactQueue((char*)(m_client->m_clipboard.extendedClipboardDataMessage.GetData()), m_client->m_clipboard.extendedClipboardDataMessage.GetDataLength()))
+					{
+						m_client->m_socket->Close();
+					}
+				} else {
+					rfbServerCutTextMsg message;
+
+					const char* cliptext = m_client->m_clipboard.m_strLastCutText.c_str();
+					char* unixtext = new char[m_client->m_clipboard.m_strLastCutText.length() + 1];
+					
+					// Replace CR-LF with LF - never send CR-LF on the wire,
+					// since Unix won't like it
+					int unixpos=0;
+					int cliplen=strlen(cliptext);
+					for (int x=0; x<cliplen; x++)
+					{
+						if (cliptext[x] != '\x0d')
+						{
+							unixtext[unixpos] = cliptext[x];
+							unixpos++;
+						}
+					}
+					unixtext[unixpos] = 0;
+
+					message.length = Swap32IfLE(strlen(unixtext));
+
+					bShouldFlush = true;
+
+					//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+					if (!m_client->SendRFBMsgQueue(rfbServerCutText,
+						(BYTE *) &message, sizeof(message))) {
+						m_client->m_socket->Close();
+					}
+					if (!m_client->m_socket->SendExactQueue(unixtext, strlen(unixtext)))
+					{
+						m_client->m_socket->Close();
+					}
+
+					delete[] unixtext;
+				}
+				m_client->m_clipboard.extendedClipboardDataMessage.Reset();
+			}
+			
+			// adzm - 2010-07 - Extended clipboard
+			// notify of any other formats
+			if (m_client->m_clipboard.m_bNeedToNotify) {
+				m_client->m_clipboard.m_bNeedToNotify = false;
+				if (m_client->m_clipboard.settings.m_bSupportsEx) {
+					
+					int actualLen = m_client->m_clipboard.extendedClipboardDataNotifyMessage.GetDataLength();
+
+					rfbServerCutTextMsg message;
+					memset(&message, 0, sizeof(rfbServerCutTextMsg));
+					message.type = rfbServerCutText;
+
+					message.length = Swap32IfLE(-actualLen);
+
+					//adzm 2010-09 - minimize packets. SendExact flushes the queue.Queue
+
+					bShouldFlush = true;
+
+					if (!m_client->SendRFBMsgQueue(rfbServerCutText,
+						(BYTE *) &message, sizeof(message))) {
+						m_client->m_socket->Close();
+					}
+					if (!m_client->m_socket->SendExact((char*)(m_client->m_clipboard.extendedClipboardDataNotifyMessage.GetData()), m_client->m_clipboard.extendedClipboardDataNotifyMessage.GetDataLength()))
+					{
+						m_client->m_socket->Close();
+					}
+				}
+				m_client->m_clipboard.extendedClipboardDataNotifyMessage.Reset();
+			}
+
+			if (bShouldFlush) {
+				m_client->m_socket->ClearQueue();
+			}
+		}
+
+		// SEND AN UPDATE
+		// We do this without holding locks, to avoid network problems
+		// stalling the server.
+
+		// Update the client palette if necessary
+
+		if (send_palette) {
+			m_client->SendPalette();
+		}
+
+		//add extra check to avoid buffer/encoder sync problems
+		if ((m_client->m_encodemgr.m_scrinfo.framebufferHeight == m_client->m_encodemgr.m_buffer->m_scrinfo.framebufferHeight) &&
+			(m_client->m_encodemgr.m_scrinfo.framebufferWidth == m_client->m_encodemgr.m_buffer->m_scrinfo.framebufferWidth) &&
+			(m_client->m_encodemgr.m_scrinfo.format.bitsPerPixel == m_client->m_encodemgr.m_buffer->m_scrinfo.format.bitsPerPixel))
+		{
+
+			// Send updates to the client - this implicitly clears
+			// the supplied update tracker
+			if (m_client->SendUpdate(update)) {
+				updates_sent++;
+				clipregion.clear();
+			}
+		}
+		else
+		{
+			clipregion.clear();
+		}
+
+			/*#ifdef _DEBUG
+//					char			szText[256];
+					sprintf(szText," ++++++ Mutex unlock clientupdatethread\n");
+					OutputDebugString(szText);		
+			#endif*/
+		}
+
+		yield();
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("stopping update thread\n"));
+	
+	vnclog.Print(LL_INTERR, "client sent %lu updates\n", updates_sent);
+	return 0;
+}
+
+vncClientThread::~vncClientThread()
+{
+	if (m_client != NULL)
+		delete m_client;
+}
+
+BOOL
+vncClientThread::Init(vncClient *client, vncServer *server, VSocket *socket, BOOL auth, BOOL shared)
+{
+	// Save the server pointer and window handle
+	m_server = server;
+	m_socket = socket;
+	m_client = client;
+	m_auth = auth;
+	m_shared = shared;
+	m_autoreconnectcounter_quit=false;
+	m_client->m_Autoreconnect=m_server->AutoReconnect();
+	m_server->AutoReconnect(false);
+
+	m_AutoReconnectPort=m_server->AutoReconnectPort();
+	strcpy(m_szAutoReconnectAdr,m_server->AutoReconnectAdr());
+	strcpy(m_szAutoReconnectId,m_server->AutoReconnectId());
+	// Start the thread
+	start();
+
+	return TRUE;
+}
+
+BOOL
+vncClientThread::InitVersion()
+{
+	// adzm 2010-09
+	m_major = 0;
+	m_minor = 0;
+
+	rfbProtocolVersionMsg protocol_ver;
+	protocol_ver[12] = 0;
+	if (strcmp(m_client->ProtocolVersionMsg,"0.0.0.0")==0)
+	{
+		// Generate the server's protocol version
+		// RDV 2010-6-10 
+		// removed SPECIAL_SC_PROMPT
+		rfbProtocolVersionMsg protocolMsg;		
+		sprintf((char *)protocolMsg,
+					rfbProtocolVersionFormat,
+					rfbProtocolMajorVersion,
+					rfbProtocolMinorVersion);
+		// adzm 2010-08
+		bool bRetry = true;
+		bool bReady = false;
+		int nRetry = 0;
+		while (!bReady && bRetry) {
+			// RDV 2010-6-10 
+			// removed SPECIAL_SC_PROMPT
+
+			// Send our protocol version, and get the client's protocol version
+			if (!m_socket->SendExact((char *)&protocolMsg, sz_rfbProtocolVersionMsg) || 
+				!m_socket->ReadExact((char *)&protocol_ver, sz_rfbProtocolVersionMsg)) {
+				bReady = false;
+				// we need to reconnect!
+				
+				Sleep(min(nRetry * 1000, 30000));
+
+				if (TryReconnect()) {
+					// reconnect if in SC mode and not already using AutoReconnect
+					bRetry = true;
+					nRetry++;
+				} else {
+					bRetry = false;
+				}
+			} else {
+				bReady = true;
+			}
+		}
+
+		if (!bReady) {
+			return FALSE;
+		}
+	}
+	else 
+		memcpy(protocol_ver,m_client->ProtocolVersionMsg, sz_rfbProtocolVersionMsg);
+
+	// sf at 2006 - Trying to fix neverending authentication bug - Check if this is RFB protocole
+	if (strncmp(protocol_ver,"RFB", 3)!=0)
+		return FALSE;
+
+	// Check viewer's the protocol version
+	sscanf((char *)&protocol_ver, rfbProtocolVersionFormat, &m_major, &m_minor);
+	if (m_major != rfbProtocolMajorVersion)
+		return FALSE;
+
+	m_ms_logon = m_server->MSLogonRequired();
+	vnclog.Print(LL_INTINFO, VNCLOG("m_ms_logon set to %s"), m_ms_logon ? "true" : "false");
+
+	// adzm 2010-09 - see rfbproto.h for more discussion on all this
+	m_client->SetUltraViewer(false); // sf at 2005 - Fix Open TextChat from server bug 
+	// UltraViewer will be set when viewer responds with rfbUltraVNC Auth type
+	// RDV 2010-6-10 
+	// removed SPECIAL_SC_PROMPT
+	
+	if ( (m_minor >= 7) && m_socket->IsUsePluginEnabled() && m_server->GetDSMPluginPointer()->IsEnabled() && m_socket->GetIntegratedPlugin() != NULL) {
+		m_socket->SetPluginStreamingIn();
+		m_socket->SetPluginStreamingOut();
+	}
+
+	return TRUE;
+}
+
+// RDV 2010-4-10
+// Ask user Permission Accept/Reject
+// Interactive, destop depended
+BOOL
+vncClientThread::FilterClients_Ask_Permission()
+{
+	// Verify the peer host name against the AuthHosts string
+	vncServer::AcceptQueryReject verified;
+	if (m_auth) {
+		verified = vncServer::aqrAccept;
+	} else {
+		verified = m_server->VerifyHost(m_socket->GetPeerName());
+	}
+	
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	// If necessary, query the connection with a timed dialog
+	char username[UNLEN+1];
+	if (!vncService::CurrentUser(username, sizeof(username))) return false;
+	if ((strcmp(username, "") != 0) || m_server->QueryIfNoLogon()) // marscha at 2006 - Is AcceptDialog required even if no user is logged on
+    {
+		if (verified == vncServer::aqrQuery) {
+            // 10 Dec 2008 jdp reject/accept all incoming connections if the workstation is locked
+            if (vncService::IsWSLocked() && !m_server->QueryIfNoLogon()) {
+                verified = m_server->QueryAccept() == 1 ? vncServer::aqrAccept : vncServer::aqrReject;
+            } else {
+
+			vncAcceptDialog *acceptDlg = new vncAcceptDialog(m_server->QueryTimeout(),m_server->QueryAccept(), m_socket->GetPeerName());
+	
+			if (acceptDlg == NULL) 
+				{
+					if (m_server->QueryAccept()==1) 
+					{
+						verified = vncServer::aqrAccept;
+					}
+					else 
+					{
+						verified = vncServer::aqrReject;
+					}
+				}
+			else 
+				{
+						HDESK desktop;
+						desktop = OpenInputDesktop(0, FALSE,
+													DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
+													DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
+													DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
+													DESKTOP_SWITCHDESKTOP | GENERIC_WRITE
+													);
+
+						HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
+						
+					
+						SetThreadDesktop(desktop);
+
+						if ( !(acceptDlg->DoDialog()) ) verified = vncServer::aqrReject;
+
+						SetThreadDesktop(old_desktop);
+						CloseDesktop(desktop);
+				}
+            }
+		}
+    }
+#endif
+
+	if (verified == vncServer::aqrReject) {
+		return FALSE;
+	}
+	return TRUE;
+}
+
+// RDV 2010-4-10
+// Filter Blacklisted are refused connection
+// Not interactive, not destop depended
+BOOL
+vncClientThread::FilterClients_Blacklist()
+{
+	// Verify the peer host name against the AuthHosts string
+	vncServer::AcceptQueryReject verified;
+	if (m_auth) {
+		verified = vncServer::aqrAccept;
+	} else {
+		verified = m_server->VerifyHost(m_socket->GetPeerName());
+	}
+
+	if (verified == vncServer::aqrReject) {
+		return FALSE;
+	}
+	return TRUE;
+}
+
+BOOL vncClientThread::CheckEmptyPasswd()
+{
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	char password[MAXPWLEN];
+	m_server->GetPassword(password);
+	vncPasswd::ToText plain(password);
+	// By default we disallow passwordless workstations!
+	if ((strlen(plain) == 0) && m_server->AuthRequired())
+	{
+		vnclog.Print(LL_CONNERR, VNCLOG("no password specified for server - client rejected\n"));
+		SendConnFailed("This server does not have a valid password enabled.  "
+					"Until a password is set, incoming connections cannot be accepted.");
+		return FALSE;
+	}
+#endif
+	return TRUE;
+}
+
+BOOL
+vncClientThread::CheckLoopBack()
+{
+	// By default we filter out local loop connections, because they're pointless
+	if (!m_server->LoopbackOk())
+	{
+		char *localname = _strdup(m_socket->GetSockName());
+		char *remotename = _strdup(m_socket->GetPeerName());
+
+		// Check that the local & remote names are different!
+		if ((localname != NULL) && (remotename != NULL))
+		{
+			BOOL ok = _stricmp(localname, remotename) != 0;
+
+			if (localname != NULL)
+				free(localname);
+
+			if (remotename != NULL)
+				free(remotename);
+
+			if (!ok)
+			{
+				vnclog.Print(LL_CONNERR, VNCLOG("loopback connection attempted - client rejected\n"));
+				SendConnFailed("Local loop-back connections are disabled.");
+				return FALSE;
+			}
+		}
+	}
+	else
+	{
+		char *localname = _strdup(m_socket->GetSockName());
+		char *remotename = _strdup(m_socket->GetPeerName());
+
+		// Check that the local & remote names are different!
+		if ((localname != NULL) && (remotename != NULL))
+		{
+			BOOL ok = _stricmp(localname, remotename) != 0;
+
+			if (localname != NULL)
+				free(localname);
+
+			if (remotename != NULL)
+				free(remotename);
+
+			if (!ok)
+			{
+				vnclog.Print(LL_CONNERR, VNCLOG("loopback connection attempted - client accepted\n"));
+				m_client->m_IsLoopback=true;
+			}
+#ifdef ULTRAVNC_ITALC_SUPPORT
+			else
+			{
+				LONG val = 0;
+				if( ultravnc_italc_load_int( "LocalConnectOnly", &val ) && val )
+				{
+					// FOOOOOOO
+					vnclog.Print(LL_CONNERR, VNCLOG("non-loopback connections disabled - client rejected\n"));
+					SendConnFailed("non-loopback connections are disabled.");
+					return FALSE;
+				}
+			}
+#endif
+		}
+
+	}
+	return TRUE;
+}
+
+//WARNING  USING THIS FUNCTION AT A WRONG PLACE
+//SEND  0 ---> rfbVncAuthOK
+void vncClientThread::SendConnFailed(const char* szMessage)
+{
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+	if (m_minor>=7)
+		{
+			// 0 = Failure
+			CARD8 value=0;
+			if (!m_socket->SendExactQueue((char *)&value, sizeof(value)))
+				return;
+		}
+	else
+		{
+			CARD32 auth_val = Swap32IfLE(rfbConnFailed);
+			if (!m_socket->SendExactQueue((char *)&auth_val, sizeof(auth_val)))
+				return;
+		}
+	CARD32 errlen = Swap32IfLE(strlen(szMessage));
+	if (!m_socket->SendExactQueue((char *)&errlen, sizeof(errlen)))
+		return;
+	m_socket->SendExact(szMessage, strlen(szMessage));
+}
+
+void vncClientThread::LogAuthResult(bool success)
+{
+	if (!success)
+	{
+		vnclog.Print(LL_CONNERR, VNCLOG("authentication failed\n"));
+		typedef BOOL (*LogeventFn)(char *machine);
+		LogeventFn Logevent = 0;
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+			{
+				char* p = strrchr(szCurrentDir, '\\');
+				*p = '\0';
+				strcat (szCurrentDir,"\\logging.dll");
+			}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				//BOOL result=false;
+				Logevent = (LogeventFn) GetProcAddress( hModule, "LOGFAILED" );
+				Logevent((char *)m_client->GetClientName());
+				FreeLibrary(hModule);
+			}		
+	}
+	else
+	{
+		typedef BOOL (*LogeventFn)(char *machine);
+		LogeventFn Logevent = 0;
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+			{
+				char* p = strrchr(szCurrentDir, '\\');
+				*p = '\0';
+				strcat (szCurrentDir,"\\logging.dll");
+			}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				//BOOL result=false;
+				Logevent = (LogeventFn) GetProcAddress( hModule, "LOGLOGON" );
+				Logevent((char *)m_client->GetClientName());
+				FreeLibrary(hModule);
+			}
+	}
+}
+
+BOOL
+vncClientThread::InitAuthenticate()
+{
+	vnclog.Print(LL_INTINFO, "Entered InitAuthenticate\n");
+	// RDV 2010-4-10
+	// Split Filter in desktop in/depended
+	if (!FilterClients_Blacklist())
+		{
+			SendConnFailed("Your connection has been rejected.");
+			return FALSE;
+		}
+	if (!CheckEmptyPasswd()) return FALSE;
+	if (!CheckLoopBack()) return FALSE;
+
+	//adzm 2010-09 - Do the actual authentication
+	if (m_minor >= 7) {
+		std::vector<CARD8> current_auth;
+		if (!AuthenticateClient(current_auth)) {
+			return FALSE;
+		}
+	} else {
+		// RDV 2010-4-10
+		if (!FilterClients_Ask_Permission())
+			{
+				SendConnFailed("Your connection has been rejected.");
+				return FALSE;
+			}
+		if (!AuthenticateLegacyClient()) {
+			return FALSE;
+		}
+	}
+
+
+	// Read the client's initialisation message
+	rfbClientInitMsg client_ini;
+	if (!m_socket->ReadExact((char *)&client_ini, sz_rfbClientInitMsg))
+		return FALSE;
+
+	// If the client wishes to have exclusive access then remove other clients
+	if (m_server->ConnectPriority()==3 && !m_shared )
+	{
+		// Existing
+			if (m_server->AuthClientCount() > 0)
+			{
+				vnclog.Print(LL_CLIENTS, VNCLOG("connections already exist - client rejected\n"));
+				return FALSE;
+			}
+	}
+	// adzm 2010-09
+	if (!(client_ini.flags & clientInitShared) && !m_shared)
+	{
+		// Which client takes priority, existing or incoming?
+		if (m_server->ConnectPriority() < 1)
+		{
+			// Incoming
+			vnclog.Print(LL_INTINFO, VNCLOG("non-shared connection - disconnecting old clients\n"));
+			m_server->KillAuthClients();
+		} else if (m_server->ConnectPriority() > 1)
+		{
+			// Existing
+			if (m_server->AuthClientCount() > 0)
+			{
+				vnclog.Print(LL_CLIENTS, VNCLOG("connections already exist - client rejected\n"));
+				return FALSE;
+			}
+		}
+	}
+
+	vnclog.Print(LL_CLIENTS, VNCLOG("Leaving InitAuthenticate\n"));
+	// Tell the server that this client is ok
+	return m_server->Authenticated(m_client->GetClientId());
+}
+
+BOOL vncClientThread::AuthenticateClient(std::vector<CARD8>& current_auth)
+{
+	// adzm 2010-09 - Gather all authentication types we support
+	std::vector<CARD8> auth_types;
+
+	const bool bUseSessionSelect = false;
+	
+	// obviously needs to be one that we suggested in the first place
+	bool bSecureVNCPluginActive = std::find(current_auth.begin(), current_auth.end(), rfbUltraVNC_SecureVNCPluginAuth) != current_auth.end();
+	bool bSCPromptActive = std::find(current_auth.begin(), current_auth.end(), rfbUltraVNC_SCPrompt) != current_auth.end();
+	bool bSessionSelectActive = std::find(current_auth.begin(), current_auth.end(), rfbUltraVNC_SessionSelect) != current_auth.end();
+
+	if (current_auth.empty()) {
+		// send the UltraVNC auth type to identify ourselves as an UltraVNC server, but only initially
+		auth_types.push_back(rfbUltraVNC);
+	}
+
+	// encryption takes priority over everything, for now at least.
+	// would be useful to have a host list to configure these settings.
+	// Include the SecureVNCPluginAuth type for those that support it but are not UltraVNC viewers
+	if (!bSecureVNCPluginActive && m_socket->IsUsePluginEnabled() && m_server->GetDSMPluginPointer()->IsEnabled() && m_socket->GetIntegratedPlugin() != NULL)
+	{
+		auth_types.push_back(rfbUltraVNC_SecureVNCPluginAuth);
+	}
+	else if ( (SPECIAL_SC_PROMPT || SPECIAL_SC_EXIT) && !bSCPromptActive ) 
+	{
+		// adzm 2010-10 - Add the SCPrompt pseudo-auth
+		auth_types.push_back(rfbUltraVNC_SCPrompt);
+	}
+	else if (bUseSessionSelect)
+	{
+		// adzm 2010-10 - Add the SessionSelect pseudo-auth
+		auth_types.push_back(rfbUltraVNC_SessionSelect);
+	}
+	else
+	{			
+		// Retrieve the local password
+		char password[MAXPWLEN];
+		m_server->GetPassword(password);
+		vncPasswd::ToText plain(password);
+
+		if (!m_auth && m_ms_logon)
+		{
+			auth_types.push_back(rfbUltraVNC_MsLogonIIAuth);
+		}
+		else
+		{
+			if (m_auth || (strlen(plain) == 0))
+			{
+				auth_types.push_back(rfbNoAuth);
+			} else {
+				auth_types.push_back(rfbVncAuth);
+			}
+		}
+	}
+
+#ifdef ULTRAVNC_ITALC_SUPPORT
+	auth_types.clear();
+	if( m_ms_logon )
+	{
+		auth_types.push_back(rfbUltraVNC_MsLogonIIAuth);
+	}
+	auth_types.push_back(rfbSecTypeItalc);
+#endif
+	// adzm 2010-09 - Send the auths
+	{
+		CARD8 authCount = (CARD8)auth_types.size();
+		if (!m_socket->SendExactQueue((const char*)&authCount, sizeof(authCount)))
+			return FALSE;
+
+		for (std::vector<CARD8>::iterator auth_it = auth_types.begin(); auth_it != auth_types.end(); auth_it++)
+		{
+			CARD8 authType = *auth_it;
+			if (!m_socket->SendExactQueue((const char*)&authType, sizeof(authType)))
+				return FALSE;
+		}
+		if (!m_socket->ClearQueue())
+			return FALSE;
+	}
+	// read the accepted auth type
+	CARD8 auth_accepted = rfbInvalidAuth;
+	if (!m_socket->ReadExact((char*)&auth_accepted, sizeof(auth_accepted)))
+		return FALSE;
+
+	// obviously needs to be one that we suggested in the first place
+	if (std::find(auth_types.begin(), auth_types.end(), auth_accepted) == auth_types.end()) {
+		return FALSE;
+	}
+
+	// mslogonI never seems to be used anymore -- the old code would say if (m_ms_logon) AuthMsLogon (II) else AuthVnc
+	// and within AuthVnc would be if (m_ms_logon) { /* mslogon code */ }. THat could never be hit since the first case
+	// would always match!
+
+	// Authenticate the connection, if required
+	BOOL auth_success = FALSE;
+	std::string auth_message;
+	switch (auth_accepted)
+	{
+	case rfbUltraVNC:
+		m_client->SetUltraViewer(true);
+		auth_success = true;
+		break;
+	case rfbUltraVNC_SecureVNCPluginAuth:
+		auth_success = AuthSecureVNCPlugin(auth_message);	
+		break;
+	case rfbUltraVNC_MsLogonIIAuth:
+		auth_success = AuthMsLogon(auth_message);
+		break;
+	case rfbVncAuth:
+		auth_success = AuthVnc(auth_message);
+		break;
+	case rfbNoAuth:
+		auth_success = TRUE;
+		break;
+	case rfbUltraVNC_SCPrompt:
+		// adzm 2010-10 - Do the SCPrompt auth
+		auth_success = AuthSCPrompt(auth_message);
+		break;
+	case rfbUltraVNC_SessionSelect:
+		// adzm 2010-10 - Do the SessionSelect auth
+		auth_success = AuthSessionSelect(auth_message);
+		break;
+#ifdef ULTRAVNC_ITALC_SUPPORT
+	case rfbSecTypeItalc:
+		auth_success =
+			ItalcCoreServer::instance()->
+				authSecTypeItalc( vsocketDispatcher, m_socket );
+		break;
+#endif
+	default:
+		auth_success = FALSE;
+		break;
+	}
+	// Log authentication success or failure
+	LogAuthResult(auth_success ? true : false);
+
+	// Return the result
+	CARD32 auth_result = rfbVncAuthFailed;
+	if (auth_success) {
+		current_auth.push_back(auth_accepted);
+
+		// continue the authentication if mslogon is enabled. any method of authentication should
+		// work out fine with this method. Currently we limit ourselves to only one layer beyond
+		// the plugin to avoid deep recursion, but that can easily be changed if necessary.
+		if (m_ms_logon && auth_accepted == rfbUltraVNC_SecureVNCPluginAuth && m_socket->GetIntegratedPlugin()) {
+			auth_result = rfbVncAuthContinue;
+		} else if (auth_accepted == rfbUltraVNC) {
+			auth_result = rfbVncAuthContinue;
+		} else if ( (SPECIAL_SC_PROMPT || SPECIAL_SC_EXIT) && !bSCPromptActive) {
+			auth_result = rfbVncAuthContinue;
+		} else if (bUseSessionSelect && !bSessionSelectActive) {
+			auth_result = rfbVncAuthContinue;
+		} else {
+			auth_result = rfbVncAuthOK;
+		}
+	}
+
+	// RDV 2010-4-10
+	// This is a good spot for asking the user permission Accept/Reject
+	// Only when auth_result == rfbVncAuthOK, in all other cases it isn't needed
+	// adzm 2010-10 - This was causing failure with DSM plugin, since this is
+	// pretty much the same as another auth type we'll just move it into that code
+	// instead. So see the AuthSCPrompt function.
+
+	// Check the FilterClients thing after final auth
+	if (auth_result == rfbVncAuthOK)
+	{
+		// If not rejected by viewer
+		if (auth_result != rfbVncAuthFailed)
+		{
+			BOOL result=FilterClients_Ask_Permission();
+			if (!result)
+			{
+				auth_result = rfbVncAuthFailed;
+				auth_success = false;
+			}
+		}
+	}
+
+	CARD32 auth_result_msg = Swap32IfLE(auth_result);
+	if (!m_socket->SendExactQueue((char *)&auth_result_msg, sizeof(auth_result_msg)))
+		return FALSE;
+
+	// Send a failure reason	
+	if (!auth_success) {
+		if (auth_message.empty()) {
+			auth_message = "authentication rejected";
+		}
+		CARD32 auth_message_length = Swap32IfLE(auth_message.length());
+		if (!m_socket->SendExactQueue((char *)&auth_message_length, sizeof(auth_message_length)))
+			return FALSE;
+		if (!m_socket->SendExact(auth_message.c_str(), auth_message.length()))
+			return FALSE;
+		return FALSE;
+	}
+
+	if (!m_socket->ClearQueue())
+		return FALSE;
+	
+	//adzm 2010-09 - Set handshake complete if integrated plugin finished auth
+	if (auth_success && auth_accepted == rfbUltraVNC_SecureVNCPluginAuth && m_socket->GetIntegratedPlugin()) {			
+		m_socket->GetIntegratedPlugin()->SetHandshakeComplete();	
+	}
+
+	if (auth_success && auth_result == rfbVncAuthContinue) {
+		if (!AuthenticateClient(current_auth)) {
+			return FALSE;
+		}
+	}
+
+	if (auth_success) {
+		return TRUE;
+	} else {
+		return FALSE;
+	}
+}
+
+
+BOOL vncClientThread::AuthenticateLegacyClient()
+{
+	// Retrieve the local password
+	char password[MAXPWLEN];
+	m_server->GetPassword(password);
+	vncPasswd::ToText plain(password);
+
+	CARD32 auth_type = rfbInvalidAuth;
+
+	if (m_socket->IsUsePluginEnabled() && m_server->GetDSMPluginPointer()->IsEnabled() && m_socket->GetIntegratedPlugin() != NULL)
+	{
+		auth_type = rfbLegacy_SecureVNCPlugin;
+	}
+	else if (m_ms_logon)
+	{
+		auth_type = rfbLegacy_MsLogon;
+	}
+	else if (strlen(plain) > 0)
+	{
+		auth_type = rfbVncAuth;
+	}
+	else if (m_auth || (strlen(plain) == 0))
+	{
+		auth_type = rfbNoAuth;
+	}
+
+#ifdef ULTRAVNC_ITALC_SUPPORT
+	// always use MS logon authentication when authenticating against
+	// an old VNC viewer - this allows to use the iTALC client as regular
+	// VNC server
+	auth_type = rfbLegacy_MsLogon;
+#endif
+
+	// abort if invalid
+	if (auth_type == rfbInvalidAuth) {
+		SendConnFailed("unable to determine legacy authentication method");
+		return FALSE;
+	}
+
+	// RDV 2010-4-10
+	// CARD32, byte swap is needed
+	auth_type=Swap32IfLE(auth_type);
+	// adzm 2010-09 - Send the single auth type
+	if (!m_socket->SendExact((const char*)&auth_type, sizeof(auth_type)))
+		return FALSE;
+	// RDV 2010-4-10
+	// CARD32, reset original
+	auth_type=Swap32IfLE(auth_type);
+
+	// Authenticate the connection, if required
+	BOOL auth_success = FALSE;
+	std::string auth_message;
+	switch (auth_type)
+	{
+	case rfbLegacy_SecureVNCPlugin:
+		auth_success = AuthSecureVNCPlugin(auth_message);	
+		// adzm 2010-11 - Legacy 1.0.8.2 special build will continue here with mslogon
+		if (auth_success && m_ms_logon) {
+			CARD32 auth_result_msg = Swap32IfLE(rfbLegacy_MsLogon);
+			if (!m_socket->SendExact((char *)&auth_result_msg, sizeof(auth_result_msg)))
+				return FALSE;
+			
+			//adzm 2010-09 - Set handshake complete if integrated plugin finished auth
+			if (auth_success && auth_type == rfbLegacy_SecureVNCPlugin && m_socket->GetIntegratedPlugin()) {			
+				m_socket->GetIntegratedPlugin()->SetHandshakeComplete();
+			}
+
+			auth_type = rfbLegacy_MsLogon;
+			auth_success = AuthMsLogon(auth_message);
+		}
+		break;
+	case rfbLegacy_MsLogon:
+		auth_success = AuthMsLogon(auth_message);
+		break;
+	case rfbVncAuth:
+		auth_success = AuthVnc(auth_message);
+		break;
+	case rfbNoAuth:
+		auth_success = TRUE;
+		break;
+	default:
+		auth_success = FALSE;
+		break;
+	}
+
+	// Log authentication success or failure
+	LogAuthResult(auth_success ? true : false);
+
+	// Return the result
+	CARD32 auth_result = rfbVncAuthFailed;
+	if (auth_success) {
+		auth_result = rfbVncAuthOK;
+	}
+
+	CARD32 auth_result_msg = Swap32IfLE(auth_result);
+	if (!m_socket->SendExact((char *)&auth_result_msg, sizeof(auth_result_msg)))
+		return FALSE;
+	
+	//adzm 2010-09 - Set handshake complete if integrated plugin finished auth
+	if (auth_success && auth_type == rfbLegacy_SecureVNCPlugin && m_socket->GetIntegratedPlugin()) {			
+		m_socket->GetIntegratedPlugin()->SetHandshakeComplete();
+	}
+
+	if (auth_success) {
+		return TRUE;
+	} else {
+		return FALSE;
+	}
+}
+
+// must SetHandshakeComplete after sending auth result!
+BOOL vncClientThread::AuthSecureVNCPlugin(std::string& auth_message)
+{
+	char password[MAXPWLEN];
+	m_server->GetPassword(password);
+	vncPasswd::ToText plain(password);
+	m_socket->SetDSMPluginConfig(m_server->GetDSMPluginConfig());
+	BOOL auth_ok = FALSE;
+
+	const char* plainPassword = plain;
+
+	if (!m_ms_logon && plainPassword && strlen(plainPassword) > 0) {
+		m_socket->GetIntegratedPlugin()->SetPasswordData((const BYTE*)plainPassword, strlen(plainPassword));
+	}
+
+	int nSequenceNumber = 0;
+	bool bSendChallenge = true;
+	do
+	{
+		BYTE* pChallenge = NULL;
+		int nChallengeLength = 0;
+		if (!m_socket->GetIntegratedPlugin()->GetChallenge(pChallenge, nChallengeLength, nSequenceNumber)) {
+			m_socket->GetIntegratedPlugin()->FreeMemory(pChallenge);
+			auth_message = m_socket->GetIntegratedPlugin()->GetLastErrorString();
+			return FALSE;
+		}
+
+		WORD wChallengeLength = (WORD)nChallengeLength;
+
+		if (!m_socket->SendExactQueue((const char*)&wChallengeLength, sizeof(wChallengeLength))) {
+			m_socket->GetIntegratedPlugin()->FreeMemory(pChallenge);
+			return FALSE;
+		}
+
+		if (!m_socket->SendExact((const char*)pChallenge, nChallengeLength)) {
+			m_socket->GetIntegratedPlugin()->FreeMemory(pChallenge);
+			return FALSE;
+		}
+
+		m_socket->GetIntegratedPlugin()->FreeMemory(pChallenge);
+		WORD wResponseLength = 0;
+		if (!m_socket->ReadExact((char*)&wResponseLength, sizeof(wResponseLength))) {
+			return FALSE;
+		}
+
+		BYTE* pResponseData = new BYTE[wResponseLength];
+		
+		if (!m_socket->ReadExact((char*)pResponseData, wResponseLength)) {
+			delete[] pResponseData;
+			return FALSE;
+		}
+
+		if (!m_socket->GetIntegratedPlugin()->HandleResponse(pResponseData, (int)wResponseLength, nSequenceNumber, bSendChallenge)) {
+			auth_message = m_socket->GetIntegratedPlugin()->GetLastErrorString();
+			auth_ok = FALSE;
+			bSendChallenge = false;
+		} else if (!bSendChallenge) {
+			auth_ok = TRUE;
+		}
+
+		delete[] pResponseData;
+		nSequenceNumber++;
+	} while (bSendChallenge);
+
+	if (auth_ok) {
+		return TRUE;
+	} else {
+		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.
+BOOL 
+vncClientThread::AuthMsLogon(std::string& auth_message) 
+{
+	DH 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);
+
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.	
+	if (!m_socket->SendExactQueue(gen, sizeof(gen))) return FALSE;
+	if (!m_socket->SendExactQueue(mod, sizeof(mod))) return FALSE;
+	if (!m_socket->SendExact(pub, sizeof(pub))) return FALSE;
+	if (!m_socket->ReadExact(resp, sizeof(resp))) return FALSE;
+	if (!m_socket->ReadExact(user, sizeof(user))) return FALSE;
+	if (!m_socket->ReadExact(passwd, sizeof(passwd))) return FALSE;
+
+	int64ToBytes(dh.createEncryptionKey(bytesToInt64(resp)), (char*) key);
+	vnclog.Print(0, "After DH: g=%I64u, m=%I64u, i=%I64u, key=%I64u\n", bytesToInt64(gen), bytesToInt64(mod), bytesToInt64(pub), bytesToInt64((char*) key));
+	vncDecryptBytes((unsigned char*) user, sizeof(user), key); user[255] = '\0';
+	vncDecryptBytes((unsigned char*) passwd, sizeof(passwd), key); passwd[63] = '\0';
+
+	int result = CheckUserGroupPasswordUni(user, passwd, m_client->GetClientName());
+	vnclog.Print(LL_INTINFO, "CheckUserGroupPasswordUni result=%i\n", result);
+	if (result == 2) {
+		m_client->EnableKeyboard(false);
+		m_client->EnablePointer(false);
+	}
+
+	if (result) {
+#ifdef ULTRAVNC_ITALC_SUPPORT
+		return ultravnc_italc_ask_permission( user, m_socket->GetPeerName() );
+#endif
+		return TRUE;
+	} else {
+		return FALSE;
+	}
+}
+
+BOOL vncClientThread::AuthVnc(std::string& auth_message)
+{
+	char password[MAXPWLEN];
+	m_server->GetPassword(password);
+	vncPasswd::ToText plain(password);
+
+	BOOL auth_ok = FALSE;
+	{
+		// Now create a 16-byte challenge
+		char challenge[16];
+		char challenge2[16]; //PGM
+		char response[16];
+		vncRandomBytes((BYTE *)&challenge);
+		memcpy(challenge2, challenge, 16); //PGM
+		
+
+		{
+			vnclog.Print(LL_INTINFO, "password authentication");
+			if (!m_socket->SendExact(challenge, sizeof(challenge)))
+            {
+				vnclog.Print(LL_SOCKERR, VNCLOG("Failed to send challenge to client\n"));
+				return FALSE;
+            }
+
+
+			// Read the response
+			if (!m_socket->ReadExact(response, sizeof(response)))
+            {
+				vnclog.Print(LL_SOCKERR, VNCLOG("Failed to receive challenge response from client\n"));
+				return FALSE;
+            }
+			// Encrypt the challenge bytes
+			vncEncryptBytes((BYTE *)&challenge, plain);
+
+			auth_ok = TRUE;
+			// Compare them to the response
+			for (size_t i=0; i<sizeof(challenge); i++)
+			{
+				if (challenge[i] != response[i])
+				{
+					auth_ok = FALSE;
+					break;
+				}
+			}
+			if (!auth_ok) //PGM
+			{ //PGM
+				memset(password, '\0', MAXPWLEN); //PGM
+				m_server->GetPassword2(password); //PGM
+				vncPasswd::ToText plain2(password); //PGM
+				if ((strlen(plain2) > 0)) //PGM
+				{ //PGM
+					vnclog.Print(LL_INTINFO, "View-only password authentication"); //PGM
+					m_client->EnableKeyboard(false); //PGM
+					m_client->EnablePointer(false); //PGM
+					auth_ok = TRUE; //PGM
+
+					// Encrypt the view-only challenge bytes //PGM
+					vncEncryptBytes((BYTE *)&challenge2, plain2); //PGM
+
+					// Compare them to the response //PGM
+					for (size_t i=0; i<sizeof(challenge2); i++) //PGM
+					{ //PGM
+						if (challenge2[i] != response[i]) //PGM
+						{ //PGM
+							auth_ok = FALSE; //PGM
+							break; //PGM
+						} //PGM
+					} //PGM
+				} //PGM
+			} //PGM
+		}
+	}
+
+	if (auth_ok) {
+		return TRUE;
+	} else {
+		return FALSE;
+	}
+}
+
+// adzm 2010-10
+BOOL vncClientThread::AuthSCPrompt(std::string& auth_message)
+{
+	// Check if viewer accept connection
+	char mytext[1024];
+	getinfo(mytext);
+	int size=strlen(mytext);
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+	if (!m_socket->SendExactQueue((char *)&size, sizeof(int)))
+		return FALSE;
+	if (!m_socket->SendExact((char *)mytext, size))
+		return FALSE;
+	int nummer;
+	if (!m_socket->ReadExact((char *)&nummer, sizeof(int)))
+	{
+		return FALSE;
+	}
+	if (nummer==0)
+	{
+		auth_message = "Viewer refused connection";
+		return FALSE;
+	} else {
+		return TRUE;
+	}
+}
+
+BOOL vncClientThread::AuthSessionSelect(std::string& auth_message)
+{
+	return TRUE;
+	/* Session select */
+	/*
+	{
+		//Fake Function
+		CARD32 auth_result_msg = Swap32IfLE(rfbUltraVNC_SessionSelect);
+		if (!m_socket->SendExact((char *)&auth_result_msg, sizeof(auth_result_msg)))
+			return FALSE;
+		CARD8 Items=3;
+		if (!m_socket->SendExact((char *)&Items, sizeof(Items)))
+			return FALSE;
+		char line1[128];
+		char line2[128];
+		char line3[128];
+		strcpy(line1,"line1 ");
+		strcpy(line2,"line22 ");
+		strcpy(line3,"line312 123 ");
+		if (!m_socket->SendExact((char *)line1, 128))
+			return FALSE;
+		if (!m_socket->SendExact((char *)line2, 128))
+			return FALSE;
+		if (!m_socket->SendExact((char *)line3, 128))
+			return FALSE;
+		int nummer;
+		if (!m_socket->ReadExact((char *)&nummer, sizeof(int)))
+		{
+			return FALSE;
+		}
+		int a=0;
+	}
+	*/
+}
+
+void
+ClearKeyState(BYTE key)
+{
+	// This routine is used by the VNC client handler to clear the
+	// CAPSLOCK, NUMLOCK and SCROLL-LOCK states.
+
+	BYTE keyState[256];
+	
+	GetKeyboardState((LPBYTE)&keyState);
+
+	if(keyState[key] & 1)
+	{
+		// Simulate the key being pressed
+		keybd_event(key, 0, KEYEVENTF_EXTENDEDKEY, 0);
+
+		// Simulate it being release
+		keybd_event(key, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+	}
+}
+
+
+// Modif sf at 2002
+// Get the local ip addresses as a human-readable string.
+// If more than one, then with \n between them.
+// If not available, then gets a message to that effect.
+void GetIPString(char *buffer, int buflen)
+{
+    char namebuf[256];
+
+    if (gethostname(namebuf, 256) != 0)
+	{
+		strncpy(buffer, "Host name unavailable", buflen);
+		return;
+    }
+
+    HOSTENT *ph = NULL;
+	ph=gethostbyname(namebuf);
+    if (!ph)
+	{
+		strncpy(buffer, "IP address unavailable", buflen);
+		return;
+    }
+
+    *buffer = '\0';
+    char digtxt[5];
+    for (int i = 0; ph->h_addr_list[i]; i++)
+	{
+    	for (int j = 0; j < ph->h_length; j++)
+		{
+	    sprintf(digtxt, "%d.", (unsigned char) ph->h_addr_list[i][j]);
+	    strncat(buffer, digtxt, (buflen-1)-strlen(buffer));
+		}	
+		buffer[strlen(buffer)-1] = '\0';
+		if (ph->h_addr_list[i+1] != 0)
+			strncat(buffer, ", ", (buflen-1)-strlen(buffer));
+    }
+}
+
+// adzm 2010-08
+bool vncClientThread::InitSocket()
+{
+	// To avoid people connecting and then halting the connection, set a timeout
+
+	// adzm 2010-10 - Set 0 timeout if using repeater
+	VBool bSocketTimeoutSet = VFalse;
+	if (m_client->GetRepeaterID()) {
+		bSocketTimeoutSet = m_socket->SetTimeout(0);
+	} else {
+		bSocketTimeoutSet = m_socket->SetTimeout(30000);
+	}
+	if (!bSocketTimeoutSet) {
+		vnclog.Print(LL_INTERR, VNCLOG("failed to set socket timeout(%d)\n"), GetLastError());
+	}
+
+	// sf at 2002 - DSM Plugin - Tell the client's socket where to find the DSMPlugin 
+	if (m_server->GetDSMPluginPointer() != NULL)
+	{
+		m_socket->SetDSMPluginPointer(m_server->GetDSMPluginPointer());
+		vnclog.Print(LL_INTINFO, VNCLOG("DSMPlugin Pointer to socket OK\n"));
+
+		//adzm 2010-05-12 - dsmplugin config
+		m_socket->SetDSMPluginConfig(m_server->GetDSMPluginConfig());
+	}
+	else
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("Invalid DSMPlugin Pointer\n"));
+		return false;
+	}
+
+	// LOCK INITIAL SETUP
+	// All clients have the m_protocol_ready flag set to FALSE initially, to prevent
+	// updates and suchlike interfering with the initial protocol negotiations.
+
+	// sf at 2002 - DSMPlugin
+	// Use Plugin only from this point (now BEFORE Protocole handshaking)
+	if (m_server->GetDSMPluginPointer()->IsEnabled())
+	{
+
+		// sf at 2007 - Current DSM code does not support multithreading
+		// Data mix is causing server crash and viewer drops when more than one viewer is copnnected at a time
+		// We must reject any new viewer connection BEFORE any data passes through the plugin
+		// This is a dirty workaround. We ignore all Multi Viewer connection settings...
+		//adzm 2009-06-20 - Fixed this to use multi-threaded version, so therefore we can handle multiple
+		// clients with no issues.
+		if (!m_server->GetDSMPluginPointer()->SupportsMultithreaded() && m_server->AuthClientCount() > 0)
+		{
+			vnclog.Print(LL_CLIENTS, VNCLOG("A connection using DSM already exist - client rejected to avoid crash \n"));
+			return false;
+		} 
+
+		//adzm 2009-06-20 - TODO - Not sure about this. what about pending connections via the repeater?
+		if (m_server->AuthClientCount() == 0)
+			m_server->GetDSMPluginPointer()->ResetPlugin();	//SEC reset if needed
+		m_socket->EnableUsePlugin(true);
+		m_client->m_encodemgr.EnableQueuing(false);
+		// TODO: Make a more secured challenge (with time stamp)
+	}
+	else
+		m_client->m_encodemgr.EnableQueuing(true);
+
+	return true;
+}
+
+bool vncClientThread::TryReconnect()
+{
+	if (fShutdownOrdered || m_client->m_Autoreconnect || !m_client->GetHost() || !m_client->GetRepeaterID()) {
+		return false;
+	}
+
+	if (m_socket) {
+		m_socket->Close();
+		if (m_client && m_client->m_socket) {
+			m_client->m_socket = NULL;
+		}
+		delete m_socket;
+		m_socket = NULL;
+	}
+
+	// Attempt to create a new socket
+	VSocket *tmpsock = new VSocket;
+	if (!tmpsock) {
+		return false;
+	}
+
+	m_socket = tmpsock;
+	if (m_client) {
+		m_client->m_socket = tmpsock;
+	}
+	
+	// Connect out to the specified host on the VNCviewer listen port
+	// To be really good, we should allow a display number here but
+	// for now we'll just assume we're connecting to display zero
+	m_socket->Create();
+	if (m_socket->Connect(m_client->GetHost(), m_client->GetHostPort()))	{
+		if (m_client->GetRepeaterID()) {
+			char finalidcode[_MAX_PATH];
+			//adzm 2010-08 - this was sending uninitialized data over the wire
+			ZeroMemory(finalidcode, sizeof(finalidcode));
+			strncpy(finalidcode, m_client->GetRepeaterID(), sizeof(finalidcode) - 1);
+
+			m_socket->Send(finalidcode,250);
+
+			InitSocket();
+
+			return true;
+		}
+	}
+
+	return false;
+}
+
+void
+vncClientThread::run(void *arg)
+{
+	// All this thread does is go into a socket-receive loop,
+	// waiting for stuff on the given socket
+
+	// IMPORTANT : ALWAYS call RemoveClient on the server before quitting
+	// this thread.
+    SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX);
+
+	vnclog.Print(LL_CLIENTS, VNCLOG("client connected : %s (%hd)\n"),
+								m_client->GetClientName(),
+								m_client->GetClientId());
+	// Save the handle to the thread's original desktop
+	HDESK home_desktop = GetThreadDesktop(GetCurrentThreadId());
+	HDESK input_desktop = 0;
+
+	// Initially blacklist the client so that excess connections from it get dropped
+	m_server->AddAuthHostsBlacklist(m_client->GetClientName());
+
+	// adzm 2010-08
+	if (!InitSocket()) {
+		m_server->RemoveClient(m_client->GetClientId());
+		return;
+	}
+
+	// GET PROTOCOL VERSION
+	if (!InitVersion())
+	{
+		// adzm 2009-07-05
+		{
+			char szInfo[256];
+
+			if (m_client->GetRepeaterID() && (strlen(m_client->GetRepeaterID()) > 0) ) {
+				_snprintf(szInfo, 255, "Could not connect using %s!", m_client->GetRepeaterID());
+			} else {
+				_snprintf(szInfo, 255, "Could not connect to %s!", m_client->GetClientName());
+			}
+
+			szInfo[255] = '\0';
+
+			vncMenu::NotifyBalloon(szInfo, NULL);
+		}
+		m_server->RemoveClient(m_client->GetClientId());
+		
+		// wa at 2005 - AutoReconnection attempt if required
+		if (m_client->m_Autoreconnect)
+		{
+			for (int i=0;i<10*m_server->AutoReconnect_counter;i++)
+			{
+				Sleep(100);
+				if (m_autoreconnectcounter_quit) return;
+			}
+			m_server->AutoReconnect_counter+=10;
+			if (m_server->AutoReconnect_counter>1800) m_server->AutoReconnect_counter=1800;
+			vnclog.Print(LL_INTERR, VNCLOG("PostAddNewClient I\n"));
+			m_server->AutoReconnect(m_client->m_Autoreconnect);
+			m_server->AutoReconnectPort(m_AutoReconnectPort);
+			m_server->AutoReconnectAdr(m_szAutoReconnectAdr);
+			m_server->AutoReconnectId(m_szAutoReconnectId);
+
+			vncService::PostAddNewClient(1111, 1111);
+		}
+
+		return;
+	}
+	m_server->AutoReconnect_counter=0;
+	vnclog.Print(LL_INTINFO, VNCLOG("negotiated version\n"));
+
+	// AUTHENTICATE LINK
+	if (!InitAuthenticate())
+	{
+		m_server->RemoveClient(m_client->GetClientId());
+		return;
+	}
+
+	// Authenticated OK - remove from blacklist and remove timeout
+	m_server->RemAuthHostsBlacklist(m_client->GetClientName());
+	m_socket->SetTimeout(m_server->AutoIdleDisconnectTimeout()*1000);
+	vnclog.Print(LL_INTINFO, VNCLOG("authenticated connection\n"));
+
+	// Set Client Connect time
+	m_client->SetConnectTime(timeGetTime());
+
+	// INIT PIXEL FORMAT
+
+	// Get the screen format
+//	m_client->m_fullscreen = m_client->m_encodemgr.GetSize();
+
+	// Modif sf at 2002 - Scaling
+	{
+	omni_mutex_lock l(m_client->GetUpdateLock());
+	if (m_server->AreThereMultipleViewers()==false)
+		m_client->m_encodemgr.m_buffer->SetScale(m_server->GetDefaultScale()); // v1.1.2
+	}
+	m_client->m_ScaledScreen = m_client->m_encodemgr.m_buffer->GetViewerSize();
+	m_client->m_nScale = m_client->m_encodemgr.m_buffer->GetScale();
+
+
+	// Get the name of this desktop
+	// sf at 2002 - v1.1.x - Complete the computer name with the IP address if necessary
+	bool fIP = false;
+    char desktopname[MAX_COMPUTERNAME_LENGTH + 3 + 256] = {0};
+	DWORD desktopnamelen = MAX_COMPUTERNAME_LENGTH + 1 + 256;
+	memset((char*)desktopname, 0, sizeof(desktopname));
+	if (GetComputerName(desktopname, &desktopnamelen))
+	{
+		// Make the name lowercase
+		for (size_t x=0; x<strlen(desktopname); x++)
+		{
+			desktopname[x] = tolower(desktopname[x]);
+		}
+		// Check for the presence of "." in the string (then it's presumably an IP adr)
+		if (strchr(desktopname, '.') != NULL) fIP = true;
+	}
+	else
+	{
+		strcpy(desktopname, "WinVNC");
+	}
+
+	// We add the IP address(es) to the computer name, if possible and necessary
+	if (!fIP)
+	{
+		char szIP[256];
+		GetIPString(szIP, sizeof(szIP));
+		if (strlen(szIP) > 3 && szIP[0] != 'I' && szIP[0] != 'H') 
+		{
+			strcat(desktopname, " ( ");
+			strcat(desktopname, szIP);
+			strcat(desktopname, " )");
+		}
+	}
+
+	strcat(desktopname, " - ");
+	if (vncService::RunningAsService()) strcat(desktopname, "service mode");
+	else strcat(desktopname, "application mode");
+
+	// Send the server format message to the client
+	rfbServerInitMsg server_ini;
+	server_ini.format = m_client->m_encodemgr.m_buffer->GetLocalFormat();
+
+	// Endian swaps
+	// Modif sf at 2002 - Scaling
+	server_ini.framebufferWidth = Swap16IfLE(m_client->m_ScaledScreen.br.x - m_client->m_ScaledScreen.tl.x);
+	server_ini.framebufferHeight = Swap16IfLE(m_client->m_ScaledScreen.br.y - m_client->m_ScaledScreen.tl.y);
+	// server_ini.framebufferWidth = Swap16IfLE(m_client->m_fullscreen.br.x-m_client->m_fullscreen.tl.x);
+	// server_ini.framebufferHeight = Swap16IfLE(m_client->m_fullscreen.br.y-m_client->m_fullscreen.tl.y);
+
+	server_ini.format.redMax = Swap16IfLE(server_ini.format.redMax);
+	server_ini.format.greenMax = Swap16IfLE(server_ini.format.greenMax);
+	server_ini.format.blueMax = Swap16IfLE(server_ini.format.blueMax);
+
+	CARD32 nNameLength = strlen(desktopname);
+
+	server_ini.nameLength = Swap32IfLE(nNameLength);
+
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+	if (!m_socket->SendExactQueue((char *)&server_ini, sizeof(server_ini)))
+	{
+		m_server->RemoveClient(m_client->GetClientId());
+		return;
+	}
+	if (!m_socket->SendExact(desktopname, nNameLength))
+	{
+		m_server->RemoveClient(m_client->GetClientId());
+		return;
+	}
+	vnclog.Print(LL_INTINFO, VNCLOG("sent pixel format to client\n"));
+
+	// UNLOCK INITIAL SETUP
+	// Initial negotiation is complete, so set the protocol ready flag
+	m_client->EnableProtocol();
+	
+	// Add a fullscreen update to the client's update list
+	// sf at 2002 - Scaling
+	// m_client->m_update_tracker.add_changed(m_client->m_fullscreen);
+	{ // RealVNC 336
+		omni_mutex_lock l(m_client->GetUpdateLock());
+		m_client->m_update_tracker.add_changed(m_client->m_ScaledScreen);
+	}
+
+	// MAIN LOOP
+#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText," MAIN LOOP \n");
+										OutputDebugString(szText);		
+#endif
+	// Set the input thread to a high priority
+	set_priority(omni_thread::PRIORITY_HIGH);
+
+	BOOL connected = TRUE;
+	// added jeff
+	BOOL need_to_disable_input = m_server->LocalInputsDisabled();
+    bool need_to_clear_keyboard = true;
+    bool need_first_keepalive = false;
+    bool need_ft_version_msg =  false;
+	// adzm - 2010-07 - Extended clipboard
+	bool need_notify_extended_clipboard = false;
+	// adzm 2010-09 - Notify streaming DSM plugin support
+	bool need_notify_streaming_DSM = false;
+
+	while (connected)
+	{
+		rfbClientToServerMsg msg;
+
+		// Ensure that we're running in the correct desktop
+		if (!m_client->IsFileTransBusy())
+		// This desktop switch is responsible for the keyboard input
+		if (vncService::InputDesktopSelected()==0)
+		{
+			vnclog.Print(LL_CONNERR, VNCLOG("vncClientThread \n"));
+			if (!vncService::SelectDesktop(NULL, &input_desktop)) 
+					break;
+		}
+		// added jeff
+        // 2 May 2008 jdp paquette at atnetsend.net moved so that we're on the right desktop  when we're a service
+	    // Clear the CapsLock and NumLock keys
+	    if (m_client->m_keyboardenabled && need_to_clear_keyboard)
+	    {
+		    ClearKeyState(VK_CAPITAL);
+		    // *** JNW - removed because people complain it's wrong
+		    //ClearKeyState(VK_NUMLOCK);
+		    ClearKeyState(VK_SCROLL);
+            need_to_clear_keyboard = false;
+	    }
+        //
+        if (need_to_disable_input)
+        {
+            // have to do this here if we're a service so that we're on the correct desktop
+            m_client->m_encodemgr.m_buffer->m_desktop->SetDisableInput();
+            need_to_disable_input = false;
+        }
+
+        // reclaim input block after local C+A+D if user currently has it blocked 
+        m_client->m_encodemgr.m_buffer->m_desktop->block_input();
+
+        if (need_first_keepalive)
+        {
+            // send first keepalive to let the client know we accepted the encoding request
+            m_client->SendServerStateUpdate(rfbKeepAliveInterval, m_server->GetKeepAliveInterval());
+            m_client->SendKeepAlive();
+            need_first_keepalive = false;
+        }
+		if (m_client->m_want_update_state && m_client->m_Support_rfbSetServerInput)
+		{
+			m_client->m_want_update_state=false;
+			m_client->SendServerStateUpdate(m_client->m_state, m_client->m_value);
+#ifdef _DEBUG
+					char			szText[256];
+					sprintf(szText,"SendServerStateUpdate %i %i  \n",m_client->m_state,m_client->m_value);
+					OutputDebugString(szText);		
+#endif
+		}
+        if (need_ft_version_msg)
+        {
+            // send a ft protocol message to client.
+            m_client->SendFTProtocolMsg();
+            need_ft_version_msg = false;
+        }
+		// adzm - 2010-07 - Extended clipboard
+		if (need_notify_extended_clipboard)
+		{
+			m_client->NotifyExtendedClipboardSupport();
+			need_notify_extended_clipboard = false;
+		}
+		// adzm 2010-09 - Notify streaming DSM plugin support
+		if (need_notify_streaming_DSM)
+		{
+			m_client->NotifyPluginStreamingSupport();
+			need_notify_streaming_DSM = false;
+		}
+		// sf at 2002 - v1.1.2
+		int nTO = 1; // Type offset
+		// If DSM Plugin, we must read all the transformed incoming rfb messages (type included)
+		// adzm 2010-09
+		if (!m_socket->IsPluginStreamingIn() && m_socket->IsUsePluginEnabled() && m_server->GetDSMPluginPointer()->IsEnabled())
+		{
+			if (!m_socket->ReadExact((char *)&msg.type, sizeof(msg.type)))
+			{
+				connected = FALSE;
+				break;
+			}
+		    nTO = 0;
+		}
+		else
+		{
+			// Try to read a message ID
+			if (!m_socket->ReadExact((char *)&msg.type, sizeof(msg.type)))
+			{
+				connected = FALSE;
+				break;
+			}
+		}
+/*#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText," msg.type %i \n",msg.type);
+										OutputDebugString(szText);		
+#endif*/
+		// What to do is determined by the message id
+		switch(msg.type)
+		{
+
+        case rfbKeepAlive:
+            // nothing else to read.
+            // NO-OP
+#if defined(_DEBUG)
+                    {
+                        static time_t lastrecv = 0;
+                        time_t now = time(&now);
+                        time_t delta = now - lastrecv;
+                        lastrecv = now;
+                        char msgg[255];
+                        sprintf(msgg, "keepalive received %u seconds since last one\n", delta);
+                        OutputDebugString(msgg);
+
+                    }
+#endif
+            if (sz_rfbKeepAliveMsg > 1)
+            {
+			    if (!m_socket->ReadExact(((char *) &msg)+nTO, sz_rfbKeepAliveMsg-nTO))
+			    {
+				    connected = FALSE;
+				    break;
+			    }
+            }
+            break;
+
+		case rfbSetPixelFormat:
+			// Read the rest of the message:
+			if (!m_socket->ReadExact(((char *) &msg)+nTO, sz_rfbSetPixelFormatMsg-nTO))
+			{
+				connected = FALSE;
+				break;
+			}
+
+			// Swap the relevant bits.
+			msg.spf.format.redMax = Swap16IfLE(msg.spf.format.redMax);
+			msg.spf.format.greenMax = Swap16IfLE(msg.spf.format.greenMax);
+			msg.spf.format.blueMax = Swap16IfLE(msg.spf.format.blueMax);
+
+			// sf at 2005 - Additional param for Grey Scale transformation
+			m_client->m_encodemgr.EnableGreyPalette((msg.spf.format.pad1 == 1));
+			
+			// Prevent updates while the pixel format is changed
+			m_client->DisableProtocol();
+				
+			// Tell the buffer object of the change			
+			if (!m_client->m_encodemgr.SetClientFormat(msg.spf.format))
+			{
+				vnclog.Print(LL_CONNERR, VNCLOG("remote pixel format invalid\n"));
+
+				connected = FALSE;
+			}
+
+			// Set the palette-changed flag, just in case...
+			m_client->m_palettechanged = TRUE;
+
+			// Re-enable updates
+			m_client->EnableProtocol();
+			
+			break;
+
+		case rfbSetEncodings:
+			// Read the rest of the message:
+			if (!m_socket->ReadExact(((char *) &msg)+nTO, sz_rfbSetEncodingsMsg-nTO))
+			{
+				connected = FALSE;
+				break;
+			}
+
+			// RDV cache
+			m_client->m_encodemgr.EnableCache(FALSE);
+
+	        // RDV XOR and client detection
+			m_client->m_encodemgr.AvailableXOR(FALSE);
+			m_client->m_encodemgr.AvailableZRLE(FALSE);
+			m_client->m_encodemgr.AvailableTight(FALSE);
+
+			// sf at 2002 - Tight
+			m_client->m_encodemgr.SetQualityLevel(-1);
+			m_client->m_encodemgr.SetCompressLevel(6);
+			m_client->m_encodemgr.EnableLastRect(FALSE);
+
+			// Tight - CURSOR HANDLING
+			m_client->m_encodemgr.EnableXCursor(FALSE);
+			m_client->m_encodemgr.EnableRichCursor(FALSE);
+			m_server->EnableXRichCursor(FALSE);
+			m_client->m_cursor_update_pending = FALSE;
+			m_client->m_cursor_update_sent = FALSE;
+
+			// Prevent updates while the encoder is changed
+			m_client->DisableProtocol();
+
+			// Read in the preferred encodings
+			msg.se.nEncodings = Swap16IfLE(msg.se.nEncodings);
+			{
+				int x;
+				BOOL encoding_set = FALSE;
+
+				// By default, don't use copyrect!
+				m_client->m_update_tracker.enable_copyrect(false);
+
+				for (x=0; x<msg.se.nEncodings; x++)
+				{
+					CARD32 encoding;
+
+					// Read an encoding in
+					if (!m_socket->ReadExact((char *)&encoding, sizeof(encoding)))
+					{
+						connected = FALSE;
+						break;
+					}
+
+					// Is this the CopyRect encoding (a special case)?
+					if (Swap32IfLE(encoding) == rfbEncodingCopyRect)
+					{
+						m_client->m_update_tracker.enable_copyrect(true);
+						continue;
+					}
+
+					// Is this a NewFBSize encoding request?
+					if (Swap32IfLE(encoding) == rfbEncodingNewFBSize) {
+						m_client->m_use_NewSWSize = TRUE;
+						continue;
+					}
+
+					// CACHE RDV
+					if (Swap32IfLE(encoding) == rfbEncodingCacheEnable)
+					{
+						m_client->m_encodemgr.EnableCache(TRUE);
+						vnclog.Print(LL_INTINFO, VNCLOG("Cache protocol extension enabled\n"));
+						continue;
+					}
+
+
+					// XOR zlib
+					if (Swap32IfLE(encoding) == rfbEncodingXOREnable) {
+						m_client->m_encodemgr.AvailableXOR(TRUE);
+						vnclog.Print(LL_INTINFO, VNCLOG("XOR protocol extension enabled\n"));
+						continue;
+					}
+
+
+					// Is this a CompressLevel encoding?
+					if ((Swap32IfLE(encoding) >= rfbEncodingCompressLevel0) &&
+						(Swap32IfLE(encoding) <= rfbEncodingCompressLevel9))
+					{
+						// Client specified encoding-specific compression level
+						int level = (int)(Swap32IfLE(encoding) - rfbEncodingCompressLevel0);
+						m_client->m_encodemgr.SetCompressLevel(level);
+						vnclog.Print(LL_INTINFO, VNCLOG("compression level requested: %d\n"), level);
+						continue;
+					}
+
+					// Is this a QualityLevel encoding?
+					if ((Swap32IfLE(encoding) >= rfbEncodingQualityLevel0) &&
+						(Swap32IfLE(encoding) <= rfbEncodingQualityLevel9))
+					{
+						// Client specified image quality level used for JPEG compression
+						int level = (int)(Swap32IfLE(encoding) - rfbEncodingQualityLevel0);
+						m_client->m_encodemgr.SetQualityLevel(level);
+						vnclog.Print(LL_INTINFO, VNCLOG("image quality level requested: %d\n"), level);
+						continue;
+					}
+
+					// Is this a LastRect encoding request?
+					if (Swap32IfLE(encoding) == rfbEncodingLastRect) {
+						m_client->m_encodemgr.EnableLastRect(TRUE); // We forbid Last Rect for now 
+						vnclog.Print(LL_INTINFO, VNCLOG("LastRect protocol extension enabled\n"));
+						continue;
+					}
+
+					// Is this an XCursor encoding request?
+					if (Swap32IfLE(encoding) == rfbEncodingXCursor) {
+						m_client->m_encodemgr.EnableXCursor(TRUE);
+						m_server->EnableXRichCursor(TRUE);
+						vnclog.Print(LL_INTINFO, VNCLOG("X-style cursor shape updates enabled\n"));
+						continue;
+					}
+
+					// Is this a RichCursor encoding request?
+					if (Swap32IfLE(encoding) == rfbEncodingRichCursor) {
+						m_client->m_encodemgr.EnableRichCursor(TRUE);
+						m_server->EnableXRichCursor(TRUE);
+						vnclog.Print(LL_INTINFO, VNCLOG("Full-color cursor shape updates enabled\n"));
+						continue;
+					}
+
+					// Is this a PointerPos encoding request? nyama/marscha - PointerPos
+					if (Swap32IfLE(encoding) == rfbEncodingPointerPos) {
+						m_client->m_use_PointerPos = TRUE;
+						vnclog.Print(LL_INTINFO, VNCLOG("PointerPos protocol extension enabled\n"));
+						continue;
+					}
+					// 21 March 2008 jdp - client wants server state updates
+					if (Swap32IfLE(encoding) == rfbEncodingServerState) {
+						m_client->m_wants_ServerStateUpdates = true;
+                        m_server->EnableServerStateUpdates(true);
+						vnclog.Print(LL_INTINFO, VNCLOG("ServerState protocol extension enabled\n"));
+                        continue;
+					}
+					// 21 March 2008 jdp  - client wants keepalive messages
+					if (Swap32IfLE(encoding) == rfbEncodingpseudoSession) {
+						m_client->m_session_supported=true;
+						vnclog.Print(LL_INTINFO, VNCLOG("KeepAlive protocol extension enabled\n"));
+                        continue;
+					}
+
+					if (Swap32IfLE(encoding) == rfbEncodingEnableKeepAlive) {
+						m_client->m_wants_KeepAlive = true;
+                        m_server->EnableKeepAlives(true);
+                        need_first_keepalive = true;
+						vnclog.Print(LL_INTINFO, VNCLOG("KeepAlive protocol extension enabled\n"));
+                        continue;
+					}
+
+					if (Swap32IfLE(encoding) == rfbEncodingFTProtocolVersion) {
+                        need_ft_version_msg = true;
+						vnclog.Print(LL_INTINFO, VNCLOG("FTProtocolVersion protocol extension enabled\n"));
+                        continue;
+					}
+
+					// adzm - 2010-07 - Extended clipboard
+					if (Swap32IfLE(encoding) == rfbEncodingExtendedClipboard) {
+						need_notify_extended_clipboard = true;
+						m_client->m_clipboard.settings.m_bSupportsEx = true;
+						vnclog.Print(LL_INTINFO, VNCLOG("Extended clipboard protocol extension enabled\n"));
+						continue;
+					}
+
+					// adzm 2010-09 - Notify streaming DSM plugin support
+					if (Swap32IfLE(encoding) == rfbEncodingPluginStreaming) {
+						need_notify_streaming_DSM = true;
+						vnclog.Print(LL_INTINFO, VNCLOG("Streaming DSM support enabled\n"));
+						continue;
+					}
+
+					// RDV - We try to detect which type of viewer tries to connect
+					if (Swap32IfLE(encoding) == rfbEncodingZRLE) {
+						m_client->m_encodemgr.AvailableZRLE(TRUE);
+						vnclog.Print(LL_INTINFO, VNCLOG("ZRLE found \n"));
+						// continue;
+					}
+
+					if (Swap32IfLE(encoding) == rfbEncodingTight) {
+						m_client->m_encodemgr.AvailableTight(TRUE);
+						vnclog.Print(LL_INTINFO, VNCLOG("Tight found\n"));
+						// continue;
+					}
+
+					// Have we already found a suitable encoding?
+					if (!encoding_set)
+					{
+						// No, so try the buffer to see if this encoding will work...
+						omni_mutex_lock l(m_client->GetUpdateLock());
+						if (m_client->m_encodemgr.SetEncoding(Swap32IfLE(encoding),FALSE))
+							encoding_set = TRUE;
+					}
+				}
+
+				// If no encoding worked then default to RAW!
+				if (!encoding_set)
+				{
+					vnclog.Print(LL_INTINFO, VNCLOG("defaulting to raw encoder\n"));
+					omni_mutex_lock l(m_client->GetUpdateLock());
+					if (!m_client->m_encodemgr.SetEncoding(Swap32IfLE(rfbEncodingRaw),FALSE))
+					{
+						vnclog.Print(LL_INTERR, VNCLOG("failed to select raw encoder!\n"));
+
+						connected = FALSE;
+					}
+				}
+
+				// sf at 2002 - For now we disable cache protocole when more than one client are connected
+				// (But the cache buffer (if exists) is kept intact (for XORZlib usage))
+				if (m_server->AuthClientCount() > 1)
+					m_server->DisableCacheForAllClients();
+
+			}
+
+			// Re-enable updates
+			m_client->client_settings_passed=true;
+			m_client->EnableProtocol();
+
+
+			break;
+			
+		case rfbFramebufferUpdateRequest:
+			// Read the rest of the message:
+/*#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText," rfbFramebufferUpdateRequest \n");
+										OutputDebugString(szText);		
+#endif*/
+			if (!m_socket->ReadExact(((char *) &msg)+nTO, sz_rfbFramebufferUpdateRequestMsg-nTO))
+			{
+				connected = FALSE;
+				break;
+			}
+
+			{
+				//Fix server viewer crash, when server site scaling is used
+				//
+				m_client->m_ScaledScreen =m_client->m_encodemgr.m_buffer->GetViewerSize();
+
+				rfb::Rect update;
+				// Get the specified rectangle as the region to send updates for
+				// Modif sf at 2002 - Scaling.
+				update.tl.x = (Swap16IfLE(msg.fur.x) + m_client->m_SWOffsetx) * m_client->m_nScale;
+				update.tl.y = (Swap16IfLE(msg.fur.y) + m_client->m_SWOffsety) * m_client->m_nScale;
+				update.br.x = update.tl.x + Swap16IfLE(msg.fur.w) * m_client->m_nScale;
+				update.br.y = update.tl.y + Swap16IfLE(msg.fur.h) * m_client->m_nScale;
+				// Verify max size, scaled changed on server while not pushed to viewer
+				if (update.tl.x< ((m_client->m_ScaledScreen.tl.x + m_client->m_SWOffsetx) * m_client->m_nScale)) update.tl.x = (m_client->m_ScaledScreen.tl.x + m_client->m_SWOffsetx) * m_client->m_nScale;
+				if (update.tl.y < ((m_client->m_ScaledScreen.tl.y + m_client->m_SWOffsety) * m_client->m_nScale)) update.tl.y = (m_client->m_ScaledScreen.tl.y + m_client->m_SWOffsety) * m_client->m_nScale;
+				if (update.br.x > (update.tl.x + (m_client->m_ScaledScreen.br.x-m_client->m_ScaledScreen.tl.x) * m_client->m_nScale)) update.br.x = update.tl.x + (m_client->m_ScaledScreen.br.x-m_client->m_ScaledScreen.tl.x) * m_client->m_nScale;
+				if (update.br.y > (update.tl.y + (m_client->m_ScaledScreen.br.y-m_client->m_ScaledScreen.tl.y) * m_client->m_nScale)) update.br.y = update.tl.y + (m_client->m_ScaledScreen.br.y-m_client->m_ScaledScreen.tl.y) * m_client->m_nScale;
+				rfb::Region2D update_rgn = update;
+
+				//fullscreeen request, make it independed of the incremental rectangle
+				if (!msg.fur.incremental)
+				{
+#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText,"FULL update request \n");
+										OutputDebugString(szText);		
+#endif
+
+					update.tl.x = (m_client->m_ScaledScreen.tl.x + m_client->m_SWOffsetx) * m_client->m_nScale;
+					update.tl.y = (m_client->m_ScaledScreen.tl.y + m_client->m_SWOffsety) * m_client->m_nScale;
+					update.br.x = update.tl.x + (m_client->m_ScaledScreen.br.x-m_client->m_ScaledScreen.tl.x) * m_client->m_nScale;
+					update.br.y = update.tl.y + (m_client->m_ScaledScreen.br.y-m_client->m_ScaledScreen.tl.y) * m_client->m_nScale;
+
+					update_rgn=update;
+				}
+/*#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText,"Update asked for region %i %i %i %i %i \n",update.tl.x,update.tl.y,update.br.x,update.br.y,m_client->m_SWOffsetx);
+										OutputDebugString(szText);		
+#endif*/
+//				vnclog.Print(LL_SOCKERR, VNCLOG("Update asked for region %i %i %i %i %i\n"),update.tl.x,update.tl.y,update.br.x,update.br.y,m_client->m_SWOffsetx);
+
+				// RealVNC 336
+				if (update_rgn.is_empty()) {
+#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText,"FATAL! client update region is empty!\n");
+										OutputDebugString(szText);		
+#endif
+					vnclog.Print(LL_INTERR, VNCLOG("FATAL! client update region is empty!\n"));
+					connected = FALSE;
+					break;
+				}
+
+				{
+					omni_mutex_lock l(m_client->GetUpdateLock());
+
+					// Add the requested area to the incremental update cliprect
+					m_client->m_incr_rgn.assign_union(update_rgn);
+
+					// Is this request for a full update?
+					if (!msg.fur.incremental)
+					{
+						// Yes, so add the region to the update tracker
+						m_client->m_update_tracker.add_changed(update_rgn);
+						
+						// Tell the desktop grabber to fetch the region's latest state
+						m_client->m_encodemgr.m_buffer->m_desktop->QueueRect(update);
+					}					
+
+					 // Kick the update thread (and create it if not there already)
+					m_client->m_encodemgr.m_buffer->m_desktop->TriggerUpdate();
+					m_client->TriggerUpdateThread();
+				}
+			}
+			break;
+
+		case rfbKeyEvent:
+			// Read the rest of the message:
+			if (m_socket->ReadExact(((char *) &msg)+nTO, sz_rfbKeyEventMsg-nTO))
+			{				
+				if (m_client->m_keyboardenabled)
+				{
+					msg.ke.key = Swap32IfLE(msg.ke.key);
+
+					// Get the keymapper to do the work
+					// m_client->m_keymap.DoXkeysym(msg.ke.key, msg.ke.down);
+					vncKeymap::keyEvent(msg.ke.key, (0 != msg.ke.down),m_client->m_jap);
+
+					m_client->m_remoteevent = TRUE;
+				}
+			}
+			m_client->m_encodemgr.m_buffer->m_desktop->TriggerUpdate();
+			break;
+
+		case rfbPointerEvent:
+			// Read the rest of the message:
+			if (m_socket->ReadExact(((char *) &msg)+nTO, sz_rfbPointerEventMsg-nTO))
+			{
+				if (m_client->m_pointerenabled)
+				{
+					// Convert the coords to Big Endian
+					// Modif sf at 2002 - Scaling
+					msg.pe.x = (Swap16IfLE(msg.pe.x));
+					msg.pe.y = (Swap16IfLE(msg.pe.y));
+					//Error, msd.pe.x is defined as unsigned while with a negative secondary screen it's negative
+					//offset need to be used later in this function
+					msg.pe.x = (msg.pe.x)* m_client->m_nScale;// + (m_client->m_SWOffsetx+m_client->m_ScreenOffsetx);
+					msg.pe.y = (msg.pe.y)* m_client->m_nScale;// + (m_client->m_SWOffsety+m_client->m_ScreenOffsety);
+
+					// Work out the flags for this event
+					DWORD flags = MOUSEEVENTF_ABSOLUTE;
+
+					if (msg.pe.x != m_client->m_ptrevent.x ||
+						msg.pe.y != m_client->m_ptrevent.y)
+						flags |= MOUSEEVENTF_MOVE;
+					if ( (msg.pe.buttonMask & rfbButton1Mask) != 
+						(m_client->m_ptrevent.buttonMask & rfbButton1Mask) )
+					{
+					    if (GetSystemMetrics(SM_SWAPBUTTON))
+						flags |= (msg.pe.buttonMask & rfbButton1Mask) 
+						    ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP;
+					    else
+						flags |= (msg.pe.buttonMask & rfbButton1Mask) 
+						    ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;
+					}
+					if ( (msg.pe.buttonMask & rfbButton2Mask) != 
+						(m_client->m_ptrevent.buttonMask & rfbButton2Mask) )
+					{
+						flags |= (msg.pe.buttonMask & rfbButton2Mask) 
+						    ? MOUSEEVENTF_MIDDLEDOWN : MOUSEEVENTF_MIDDLEUP;
+					}
+					if ( (msg.pe.buttonMask & rfbButton3Mask) != 
+						(m_client->m_ptrevent.buttonMask & rfbButton3Mask) )
+					{
+					    if (GetSystemMetrics(SM_SWAPBUTTON))
+						flags |= (msg.pe.buttonMask & rfbButton3Mask) 
+						    ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP;
+					    else
+						flags |= (msg.pe.buttonMask & rfbButton3Mask) 
+						    ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_RIGHTUP;
+					}
+
+
+					// Treat buttons 4 and 5 presses as mouse wheel events
+					DWORD wheel_movement = 0;
+					if (m_client->m_encodemgr.IsMouseWheelTight())
+					{
+						if ((msg.pe.buttonMask & rfbButton4Mask) != 0 &&
+							(m_client->m_ptrevent.buttonMask & rfbButton4Mask) == 0)
+						{
+							flags |= MOUSEEVENTF_WHEEL;
+							wheel_movement = (DWORD)+120;
+						}
+						else if ((msg.pe.buttonMask & rfbButton5Mask) != 0 &&
+								 (m_client->m_ptrevent.buttonMask & rfbButton5Mask) == 0)
+						{
+							flags |= MOUSEEVENTF_WHEEL;
+							wheel_movement = (DWORD)-120;
+						}
+					}
+					else
+					{
+						// RealVNC 335 Mouse wheel support
+						if (msg.pe.buttonMask & rfbWheelUpMask) {
+							flags |= MOUSEEVENTF_WHEEL;
+							wheel_movement = WHEEL_DELTA;
+						}
+						if (msg.pe.buttonMask & rfbWheelDownMask) {
+							flags |= MOUSEEVENTF_WHEEL;
+							wheel_movement = -WHEEL_DELTA;
+						}
+					}
+
+					// Generate coordinate values
+					// bug fix John Latino
+					// offset for multi display
+					int screenX, screenY, screenDepth;
+					m_server->GetScreenInfo(screenX, screenY, screenDepth);
+					// 1 , only one display, so always positive
+					//primary display always have (0,0) as corner
+					if (m_client->m_display_type==1)
+						{
+							unsigned long x = ((msg.pe.x + (m_client->m_SWOffsetx)) *  65535) / (screenX-1);
+							unsigned long y = ((msg.pe.y + (m_client->m_SWOffsety))* 65535) / (screenY-1);
+							// Do the pointer event
+							::mouse_event(flags, (DWORD) x, (DWORD) y, wheel_movement, 0);
+//							vnclog.Print(LL_INTINFO, VNCLOG("########mouse_event :%i %i \n"),x,y);
+						}
+					else
+						{//second or spanned
+							if (m_client->Sendinput.isValid())
+							{							
+								INPUT evt;
+								evt.type = INPUT_MOUSE;
+								int xx=msg.pe.x-GetSystemMetrics(SM_XVIRTUALSCREEN)+ (m_client->m_SWOffsetx+m_client->m_ScreenOffsetx);
+								int yy=msg.pe.y-GetSystemMetrics(SM_YVIRTUALSCREEN)+ (m_client->m_SWOffsety+m_client->m_ScreenOffsety);
+								evt.mi.dx = (xx * 65535) / (GetSystemMetrics(SM_CXVIRTUALSCREEN)-1);
+								evt.mi.dy = (yy* 65535) / (GetSystemMetrics(SM_CYVIRTUALSCREEN)-1);
+								evt.mi.dwFlags = flags | MOUSEEVENTF_VIRTUALDESK;
+								evt.mi.dwExtraInfo = 0;
+								evt.mi.mouseData = wheel_movement;
+								evt.mi.time = 0;
+								(*m_client->Sendinput)(1, &evt, sizeof(evt));
+							}
+							else
+							{
+								POINT cursorPos; GetCursorPos(&cursorPos);
+								ULONG oldSpeed, newSpeed = 10;
+								ULONG mouseInfo[3];
+								if (flags & MOUSEEVENTF_MOVE) 
+									{
+										flags &= ~MOUSEEVENTF_ABSOLUTE;
+										SystemParametersInfo(SPI_GETMOUSE, 0, &mouseInfo, 0);
+										SystemParametersInfo(SPI_GETMOUSESPEED, 0, &oldSpeed, 0);
+										ULONG idealMouseInfo[] = {10, 0, 0};
+										SystemParametersInfo(SPI_SETMOUSESPEED, 0, &newSpeed, 0);
+										SystemParametersInfo(SPI_SETMOUSE, 0, &idealMouseInfo, 0);
+									}
+								::mouse_event(flags, msg.pe.x-cursorPos.x, msg.pe.y-cursorPos.y, wheel_movement, 0);
+								if (flags & MOUSEEVENTF_MOVE) 
+									{
+										SystemParametersInfo(SPI_SETMOUSE, 0, &mouseInfo, 0);
+										SystemParametersInfo(SPI_SETMOUSESPEED, 0, &oldSpeed, 0);
+									}
+							}
+					}
+					// Save the old position
+					m_client->m_ptrevent = msg.pe;
+
+					// Flag that a remote event occurred
+					m_client->m_remoteevent = TRUE;
+
+					// Tell the desktop hook system to grab the screen...
+					// removed, terrible performance
+					// Why do we grap the screen after any inch a mouse move
+					// Removing it doesn't seems to have any missing update 
+					 m_client->m_encodemgr.m_buffer->m_desktop->TriggerUpdate();
+				}
+			}	
+			break;
+
+		case rfbClientCutText:
+			// Read the rest of the message:
+			if (m_socket->ReadExact(((char *) &msg)+nTO, sz_rfbClientCutTextMsg-nTO))
+			{
+				// Allocate storage for the text
+				// adzm - 2010-07 - Extended clipboard
+				int length = Swap32IfLE(msg.cct.length);
+				if (length > 104857600) // 100 MBytes max
+					break;
+				if (length < 0 && m_client->m_clipboard.settings.m_bSupportsEx) {
+
+					length = abs(length);
+
+					ExtendedClipboardDataMessage extendedClipboardDataMessage;
+
+					extendedClipboardDataMessage.EnsureBufferLength(length, false);
+					
+					// Read in the data
+					if (!m_socket->ReadExact((char*)extendedClipboardDataMessage.GetBuffer(), length)) {
+						break;
+					}
+					
+					DWORD action = extendedClipboardDataMessage.GetFlags() & clipActionMask;
+
+					// clipCaps may be combined with other actions
+					if (action & clipCaps) {
+						action = clipCaps;
+					}
+
+					switch(action) {
+						case clipCaps:
+							m_client->m_clipboard.settings.HandleCapsPacket(extendedClipboardDataMessage, true);
+							break;
+						case clipProvide:
+							m_server->UpdateLocalClipTextEx(extendedClipboardDataMessage, m_client);
+							break;
+						case clipRequest:
+						case clipPeek:
+							{
+								ClipboardData clipboardData;
+								
+								// only need an owner window when setting clipboard data -- by using NULL we can rely on fewer locks
+								if (clipboardData.Load(NULL)) {
+									m_client->UpdateClipTextEx(clipboardData, extendedClipboardDataMessage.GetFlags());
+								}
+							}
+							break;
+						case clipNotify:	// irrelevant coming from viewer
+						default:
+							// unsupported or not implemented
+							break;
+					}
+				} else if (length >= 0) {
+					char* winStr = NULL;
+					{
+						char *text = new char [length+1];
+						if (text == NULL)
+							break;
+						text[length] = 0;
+
+						// Read in the text
+						if (!m_socket->ReadExact(text, length)) {
+							delete [] text;
+							break;
+						}
+						
+						int len = strlen(text);
+						winStr = new char[len*2+1];
+
+						int j = 0;
+						for (int i = 0; i < len; i++)
+						{
+							if (text[i] == 10)
+								winStr[j++] = 13;
+							winStr[j++] = text[i];
+						}
+						winStr[j++] = 0;
+						
+						// Free the clip text we read
+						delete [] text;
+					}
+
+					if (winStr != NULL) {
+						m_client->m_clipboard.m_strLastCutText = winStr;
+						// Get the server to update the local clipboard
+						m_server->UpdateLocalClipText(winStr);
+
+						// Free the transformed clip text
+						delete [] winStr;
+					}
+				} else {
+					break;
+				}
+			}
+			break;
+
+
+		// Modif sf at 2002 - Scaling
+		// Server Scaling Message received
+		case rfbPalmVNCSetScaleFactor:
+			if (m_server->AreThereMultipleViewers()==false)
+					m_client->m_fPalmVNCScaling = true;
+		case rfbSetScale: // Specific PalmVNC SetScaleFactor
+			// need to be ignored if multiple viewers are running, else buffer change on the fly and one of the viewers crash.
+			{
+			// m_client->m_fPalmVNCScaling = false;
+			// Read the rest of the message 
+			if (m_client->m_fPalmVNCScaling)
+			{
+				if (!m_socket->ReadExact(((char *) &msg) + nTO, sz_rfbPalmVNCSetScaleFactorMsg - nTO))
+				{
+					connected = FALSE;
+					break;
+				}
+			}
+			else
+			{
+				if (!m_socket->ReadExact(((char *) &msg) + nTO, sz_rfbSetScaleMsg - nTO))
+				{
+					connected = FALSE;
+					break;
+				}
+			}
+			if (m_server->AreThereMultipleViewers()==true) break;
+			// Only accept reasonable scales...
+			if (msg.ssc.scale < 1 || msg.ssc.scale > 9) break;
+			m_client->m_nScale_viewer = msg.ssc.scale;
+			m_client->m_nScale = msg.ssc.scale;
+			{
+				omni_mutex_lock l(m_client->GetUpdateLock());
+				if (!m_client->m_encodemgr.m_buffer->SetScale(msg.ssc.scale))
+					{
+						connected = FALSE;
+						break;
+					}
+	
+				m_client->fNewScale = true;
+				m_client->m_encodemgr.m_buffer->m_desktop->m_cursorpos.br.x=m_client->m_encodemgr.m_buffer->m_desktop->m_cursorpos.br.x/msg.ssc.scale;
+				m_client->m_encodemgr.m_buffer->m_desktop->m_cursorpos.br.y=m_client->m_encodemgr.m_buffer->m_desktop->m_cursorpos.br.y/msg.ssc.scale;
+				m_client->m_encodemgr.m_buffer->m_desktop->m_cursorpos.tl.x=m_client->m_encodemgr.m_buffer->m_desktop->m_cursorpos.tl.x/msg.ssc.scale;
+				m_client->m_encodemgr.m_buffer->m_desktop->m_cursorpos.tl.y=m_client->m_encodemgr.m_buffer->m_desktop->m_cursorpos.tl.y/msg.ssc.scale;
+				InvalidateRect(NULL,NULL,TRUE);
+				m_client->TriggerUpdateThread();
+			}
+
+			}
+			break;
+
+
+		// Set Server Input
+		case rfbSetServerInput:
+			if (!m_socket->ReadExact(((char *) &msg) + nTO, sz_rfbSetServerInputMsg - nTO))
+			{
+				connected = FALSE;
+				break;
+			}
+
+			m_client->m_Support_rfbSetServerInput=true;
+			if (m_client->m_keyboardenabled)
+				{
+					// added jeff
+                vnclog.Print(LL_INTINFO, VNCLOG("rfbSetServerInput: inputs %s\n"), (msg.sim.status==1) ? "disabled" : "enabled");
+		#ifdef _DEBUG
+					char szText[256];
+					sprintf(szText,"rfbSetServerInput  %i %i %i\n",msg.sim.status,m_server->GetDesktopPointer()->GetBlockInputState() , m_client->m_bClientHasBlockedInput);
+					OutputDebugString(szText);		
+		#endif
+                // only allow change if this is the client that originally changed the input state
+				/// fix by PGM (pgmoney)
+				if (!m_server->GetDesktopPointer()->GetBlockInputState() && msg.sim.status==1) 
+					{ 
+						//CARD32 state = rfbServerState_Enabled; 
+						m_client->m_encodemgr.m_buffer->m_desktop->SetBlockInputState(true); 
+						m_client->m_bClientHasBlockedInput = (true);
+					} 
+				if (m_server->GetDesktopPointer()->GetBlockInputState() && msg.sim.status==0)
+					{
+						//CARD32 state = rfbServerState_Disabled; 
+						m_client->m_encodemgr.m_buffer->m_desktop->SetBlockInputState(FALSE);
+						m_client->m_bClientHasBlockedInput = (FALSE); 
+					} 
+
+				if (!m_server->GetDesktopPointer()->GetBlockInputState() && msg.sim.status==0)
+					{
+						//CARD32 state = rfbServerState_Disabled; 
+						m_client->m_encodemgr.m_buffer->m_desktop->SetBlockInputState(FALSE);
+						m_client->m_bClientHasBlockedInput = (FALSE);
+					}
+				}
+			break;
+
+
+		// Set Single Window
+		case rfbSetSW:
+			if (!m_socket->ReadExact(((char *) &msg) + nTO, sz_rfbSetSWMsg - nTO))
+			{
+				connected = FALSE;
+				break;
+			}
+			if (Swap16IfLE(msg.sw.x)<5 && Swap16IfLE(msg.sw.y)<5) 
+			{
+				m_client->m_encodemgr.m_buffer->m_desktop->SetSW(1,1);
+				break;
+			}
+			m_client->m_encodemgr.m_buffer->m_desktop->SetSW(
+				(Swap16IfLE(msg.sw.x) + m_client->m_SWOffsetx+m_client->m_ScreenOffsetx) * m_client->m_nScale,
+				(Swap16IfLE(msg.sw.y) + m_client->m_SWOffsety+m_client->m_ScreenOffsety) * m_client->m_nScale);
+			break;
+
+
+#ifndef ULTRAVNC_ITALC_SUPPORT
+		// Modif sf at 2002 - TextChat
+		case rfbTextChat:
+			m_client->m_pTextChat->ProcessTextChatMsg(nTO);
+			break;
+#endif
+
+
+#ifndef ULTRAVNC_ITALC_SUPPORT
+		// Modif sf at 2002 - FileTransfer
+		// File Transfer Message
+		case rfbFileTransfer:
+			{
+			// sf at 2004 - An unlogged user can't access to FT
+			bool fUserOk = true;
+			if (m_server->FTUserImpersonation())
+			{
+				fUserOk = m_client->DoFTUserImpersonation();
+			}
+
+		    if (!m_client->m_keyboardenabled || !m_client->m_pointerenabled) fUserOk = false; //PGM
+
+			omni_mutex_lock l(m_client->GetUpdateLock());
+
+			// Read the rest of the message:
+			m_client->m_fFileTransferRunning = TRUE; 
+			if (m_socket->ReadExact(((char *) &msg) + nTO, sz_rfbFileTransferMsg - nTO))
+			{
+				switch (msg.ft.contentType)
+				{
+				// A new file is received from the client
+					// case rfbFileHeader:
+                    case rfbFileTransferSessionStart:
+                        m_client->m_fFileSessionOpen = true;
+                        break;
+                    case rfbFileTransferSessionEnd:
+                        m_client->m_fFileSessionOpen = false;
+                        break;
+					case rfbFileTransferOffer:
+						{
+						omni_mutex_lock ll(m_client->GetUpdateLock());
+						if (!m_server->FileTransferEnabled() || !fUserOk) break;
+						// bool fError = false;
+						const UINT length = Swap32IfLE(msg.ft.length);
+						memset(m_client->m_szFullDestName, 0, sizeof(m_client->m_szFullDestName));
+						if (length > sizeof(m_client->m_szFullDestName)) break;
+						// Read in the Name of the file to create
+						if (!m_socket->ReadExact(m_client->m_szFullDestName, length)) 
+						{
+							//MessageBoxSecure(NULL, "1. Abort !", "Ultra WinVNC", MB_OK);
+							// vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Failed to receive FileName from Viewer. Abort !\n"));
+							break;
+						}
+						
+						// sf at 2004 - Improving huge files size handling
+						CARD32 sizeL = Swap32IfLE(msg.ft.size);
+						CARD32 sizeH = 0;
+						CARD32 sizeHtmp = 0;
+						if (!m_socket->ReadExact((char*)&sizeHtmp, sizeof(CARD32)))
+						{
+							//MessageBoxSecure(NULL, "2. Abort !", "Ultra WinVNC", MB_OK);
+							//vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Failed to receive SizeH from Viewer. Abort !\n"));
+							break;
+						}
+						sizeH = Swap32IfLE(sizeHtmp);
+
+						// Parse the FileTime
+						char *p = strrchr(m_client->m_szFullDestName, ',');
+						if (p == NULL)
+							m_client->m_szFileTime[0] = '\0';
+						else 
+						{
+							strcpy(m_client->m_szFileTime, p+1);
+							*p = '\0';
+						}
+
+
+                        // make a temp file name
+                        strcpy(m_client->m_szFullDestName, make_temp_filename(m_client->m_szFullDestName).c_str());
+                        
+						DWORD dwDstSize = (DWORD)0; // Dummy size, actually a return value
+
+						// Also check the free space on destination drive
+						ULARGE_INTEGER lpFreeBytesAvailable;
+						ULARGE_INTEGER lpTotalBytes;		
+						ULARGE_INTEGER lpTotalFreeBytes;
+						unsigned long dwFreeKBytes;
+						char *szDestPath = new char [length + 1 + 64];
+						if (szDestPath == NULL) break;
+						memset(szDestPath, 0, length + 1 + 64);
+						strcpy(szDestPath, m_client->m_szFullDestName);
+						*strrchr(szDestPath, '\\') = '\0'; // We don't handle UNCs for now
+
+						// loadlibrary
+						// needed for 95 non OSR2
+						// Possible this will block filetransfer, but at least server will start
+						PGETDISKFREESPACEEX pGetDiskFreeSpaceEx;
+						pGetDiskFreeSpaceEx = (PGETDISKFREESPACEEX)GetProcAddress( GetModuleHandle("kernel32.dll"),"GetDiskFreeSpaceExA");
+
+						if (pGetDiskFreeSpaceEx)
+						{
+							if (!pGetDiskFreeSpaceEx((LPCTSTR)szDestPath,
+											&lpFreeBytesAvailable,
+											&lpTotalBytes,
+											&lpTotalFreeBytes)
+								) 
+								dwDstSize = 0xFFFFFFFF;
+						}
+
+						delete [] szDestPath;
+						dwFreeKBytes  = (unsigned long) (Int64ShraMod32(lpFreeBytesAvailable.QuadPart, 10));
+						__int64 nnFileSize = (((__int64)sizeH) << 32 ) + sizeL;
+						if ((__int64)dwFreeKBytes < (__int64)(nnFileSize / 1000)) dwDstSize = 0xFFFFFFFF;
+
+						// Allocate buffer for file packets
+						m_client->m_pBuff = new char [sz_rfbBlockSize + 1024];
+						if (m_client->m_pBuff == NULL)
+							dwDstSize = 0xFFFFFFFF;
+
+						// Allocate buffer for DeCompression
+						m_client->m_pCompBuff = new char [sz_rfbBlockSize];
+						if (m_client->m_pCompBuff == NULL)
+							dwDstSize = 0xFFFFFFFF;
+
+						rfbFileTransferMsg ft;
+						ft.type = rfbFileTransfer;
+
+						// sf at 2004 - Delta Transfer
+						bool fAlreadyExists = false;
+                        if (dwDstSize != 0xFFFFFFFF)
+                        {
+						    // sf at 2004 - Directory Delta Transfer
+						    // If the offered file is a zipped directory, we test if it already exists here
+						    // and create the zip accordingly. This way we can generate the checksums for it.
+						    // m_client->CheckAndZipDirectoryForChecksuming(m_client->m_szFullDestName);
+
+						    // Create Local Dest file
+						    m_client->m_hDestFile = CreateFile(m_client->m_szFullDestName,
+															    GENERIC_WRITE | GENERIC_READ,
+															    FILE_SHARE_READ | FILE_SHARE_WRITE,
+															    NULL,
+															    OPEN_ALWAYS,
+															    FILE_FLAG_SEQUENTIAL_SCAN,
+															    NULL);
+                            fAlreadyExists = (GetLastError() == ERROR_ALREADY_EXISTS);
+						    if (m_client->m_hDestFile == INVALID_HANDLE_VALUE)
+							    dwDstSize = 0xFFFFFFFF;
+						    else
+							    dwDstSize = 0x00;
+                        }
+						if (fAlreadyExists && dwDstSize != 0xFFFFFFFF)
+						{
+							ULARGE_INTEGER n2SrcSize;
+							bool bSize = m_client->MyGetFileSize(m_client->m_szFullDestName, &n2SrcSize); 
+							//DWORD dwFileSize = GetFileSize(m_client->m_hDestFile, NULL); 
+							//if (dwFileSize != 0xFFFFFFFF)
+							if (bSize)
+							{
+								int nCSBufferSize = (4 * (int)(n2SrcSize.QuadPart / sz_rfbBlockSize)) + 1024;
+								char* lpCSBuff = new char [nCSBufferSize];
+								if (lpCSBuff != NULL)
+								{
+									int nCSBufferLen = m_client->GenerateFileChecksums(	m_client->m_hDestFile,
+																						lpCSBuff,
+																						nCSBufferSize);
+									if (nCSBufferLen != -1)
+									{
+										ft.contentType = rfbFileChecksums;
+										ft.size = Swap32IfLE(nCSBufferSize);
+										ft.length = Swap32IfLE(nCSBufferLen);
+										//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+										m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+										m_socket->SendExactQueue((char *)lpCSBuff, nCSBufferLen);
+										delete [] lpCSBuff;
+									}
+								}
+							}
+						}
+
+						ft.contentType = rfbFileAcceptHeader;
+						ft.size = Swap32IfLE(dwDstSize); // File Size in bytes, 0xFFFFFFFF (-1) means error
+						ft.length = Swap32IfLE(strlen(m_client->m_szFullDestName));
+						//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+						m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+						m_socket->SendExact((char *)m_client->m_szFullDestName, strlen(m_client->m_szFullDestName));
+
+						if (dwDstSize == 0xFFFFFFFF)
+						{
+                            helper::close_handle(m_client->m_hDestFile);
+							if (m_client->m_pCompBuff != NULL)
+							{
+								delete [] m_client->m_pCompBuff;
+								m_client->m_pCompBuff = NULL;
+							}
+							if (m_client->m_pBuff != NULL)
+							{
+								delete [] m_client->m_pBuff;
+								m_client->m_pBuff = NULL;
+							}
+
+							//MessageBoxSecure(NULL, "3. Abort !", "Ultra WinVNC", MB_OK);
+							//vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Wrong Dest File size. Abort !\n"));
+                            m_client->FTDownloadFailureHook();
+							break;
+						}
+
+						m_client->m_dwFileSize = Swap32IfLE(msg.ft.size);
+						m_client->m_dwNbPackets = (DWORD)(m_client->m_dwFileSize / sz_rfbBlockSize);
+						m_client->m_dwNbReceivedPackets = 0;
+						m_client->m_dwNbBytesWritten = 0;
+						m_client->m_dwTotalNbBytesWritten = 0;
+
+						m_client->m_fUserAbortedFileTransfer = false;
+						m_client->m_fFileDownloadError = false;
+						m_client->m_fFileDownloadRunning = true;
+                        m_client->FTDownloadStartHook();
+                        m_socket->SetRecvTimeout(m_server->GetFTTimeout()*1000);
+
+						}
+						break;
+
+					// The client requests a File
+					case rfbFileTransferRequest:
+						{
+						omni_mutex_lock ll(m_client->GetUpdateLock());
+						m_client->m_fCompressionEnabled = (Swap32IfLE(msg.ft.size) == 1);
+						const UINT length = Swap32IfLE(msg.ft.length);
+						memset(m_client->m_szSrcFileName, 0, sizeof(m_client->m_szSrcFileName));
+						if (length > sizeof(m_client->m_szSrcFileName)) break;
+						// Read in the Name of the file to create
+						if (!m_socket->ReadExact(m_client->m_szSrcFileName, length))
+						{
+							//MessageBoxSecure(NULL, "4. Abort !", "Ultra WinVNC", MB_OK);
+							//vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Cannot read requested filename. Abort !\n"));
+							break;
+						}
+						
+                        // moved jdp 8/5/08 -- have to read whole packet to keep protocol in sync
+						if (!m_server->FileTransferEnabled() || !fUserOk) break;
+						// sf at 2003 - Directory Transfer trick
+						// If the file is an Ultra Directory Zip Request we zip the directory here
+						// and we give it the requested name for transfer
+						int nDirZipRet = m_client->ZipPossibleDirectory(m_client->m_szSrcFileName);
+						if (nDirZipRet == -1)
+						{
+							//MessageBoxSecure(NULL, "5. Abort !", "Ultra WinVNC", MB_OK);
+							//vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Failed to zip requested dir. Abort !\n"));
+
+							//	[v1.0.2-jp1 fix] Empty directory receive problem
+							rfbFileTransferMsg ft;
+							ft.type = rfbFileTransfer;
+							ft.contentType = rfbFileHeader;
+							ft.size = Swap32IfLE(0xffffffffu); // File Size in bytes, 0xFFFFFFFF (-1) means error
+							ft.length = Swap32IfLE(strlen(m_client->m_szSrcFileName));
+							//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+							m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+							m_socket->SendExactQueue((char *)m_client->m_szSrcFileName, strlen(m_client->m_szSrcFileName));
+                            // 2 May 2008 jdp send the highpart too, else the client will hang
+                            // sf at 2004 - Improving huge file size handling
+                            // TODO: what if we're speaking the old protocol, how can we tell? 
+					        CARD32 sizeH = Swap32IfLE(0xffffffffu);
+					        m_socket->SendExact((char *)&sizeH, sizeof(CARD32));
+
+							m_client->m_fFileUploadError = true;
+							m_client->m_fFileUploadRunning = false;
+                            m_client->FTUploadFailureHook();
+
+							break;
+						}
+
+
+						// Open source file
+						m_client->m_hSrcFile = CreateFile(
+															m_client->m_szSrcFileName,		
+															GENERIC_READ,		
+															FILE_SHARE_READ,	
+															NULL,				
+															OPEN_EXISTING,		
+															FILE_FLAG_SEQUENTIAL_SCAN,	
+															NULL
+														);				
+						
+						// DWORD dwSrcSize = (DWORD)0;
+						ULARGE_INTEGER n2SrcSize;
+						if (m_client->m_hSrcFile == INVALID_HANDLE_VALUE)
+						{
+							DWORD TheError = GetLastError();
+							// dwSrcSize = 0xFFFFFFFF;
+							n2SrcSize.LowPart = 0xFFFFFFFF;
+                            n2SrcSize.HighPart = 0xFFFFFFFF;
+						}
+						else
+						{	
+							// Source file size 
+							bool bSize = m_client->MyGetFileSize(m_client->m_szSrcFileName, &n2SrcSize); 
+							// dwSrcSize = GetFileSize(m_client->m_hSrcFile, NULL); 
+							// if (dwSrcSize == 0xFFFFFFFF)
+							if (!bSize)
+							{
+								helper::close_handle(m_client->m_hSrcFile);
+								n2SrcSize.LowPart = 0xFFFFFFFF;
+                                n2SrcSize.HighPart = 0xFFFFFFFF;
+							}
+							else
+							{
+								// Add the File Time Stamp to the filename
+								FILETIME SrcFileModifTime; 
+								BOOL fRes = GetFileTime(m_client->m_hSrcFile, NULL, NULL, &SrcFileModifTime);
+								if (fRes)
+								{
+									char szSrcFileTime[18];
+									// sf at 2003 - Convert file time to local time
+									// We've made the choice off displaying all the files 
+									// off client AND server sides converted in clients local
+									// time only. So we don't convert server's files times.
+									/*
+									FILETIME LocalFileTime;
+									FileTimeToLocalFileTime(&SrcFileModifTime, &LocalFileTime);
+									*/
+									SYSTEMTIME FileTime;
+									FileTimeToSystemTime(&SrcFileModifTime/*&LocalFileTime*/, &FileTime);
+									wsprintf(szSrcFileTime,"%2.2d/%2.2d/%4.4d %2.2d:%2.2d",
+											FileTime.wMonth,
+											FileTime.wDay,
+											FileTime.wYear,
+											FileTime.wHour,
+											FileTime.wMinute
+											);
+									strcat(m_client->m_szSrcFileName, ",");
+									strcat(m_client->m_szSrcFileName, szSrcFileTime);
+								}
+							}
+						}
+
+						// sf at 2004 - Delta Transfer
+						if (m_client->m_lpCSBuffer != NULL) 
+						{
+							delete [] m_client->m_lpCSBuffer;
+							m_client->m_lpCSBuffer = NULL;
+						}
+						m_client->m_nCSOffset = 0;
+						m_client->m_nCSBufferSize = 0;
+
+						// Send the FileTransferMsg with rfbFileHeader
+						rfbFileTransferMsg ft;
+						
+						ft.type = rfbFileTransfer;
+						ft.contentType = rfbFileHeader;
+						ft.size = Swap32IfLE(n2SrcSize.LowPart); // File Size in bytes, 0xFFFFFFFF (-1) means error
+						ft.length = Swap32IfLE(strlen(m_client->m_szSrcFileName));
+						//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+						m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+						m_socket->SendExactQueue((char *)m_client->m_szSrcFileName, strlen(m_client->m_szSrcFileName));
+						
+						// sf at 2004 - Improving huge file size handling
+						CARD32 sizeH = Swap32IfLE(n2SrcSize.HighPart);
+						m_socket->SendExact((char *)&sizeH, sizeof(CARD32));
+
+						// delete [] szSrcFileName;
+						if (n2SrcSize.LowPart == 0xFFFFFFFF && n2SrcSize.HighPart == 0xFFFFFFFF)
+						{
+							//MessageBoxSecure(NULL, "6. Abort !", "Ultra WinVNC", MB_OK);
+							//vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: Wrong Src File size. Abort !\n"));
+                            m_client->FTUploadFailureHook();
+							break; // If error, we don't send anything else
+						}
+                        m_client->FTUploadStartHook();
+						}
+						break;
+
+					// sf at 2004 - Delta Transfer
+					// Destination file already exists - the viewer sends the checksums
+					case rfbFileChecksums:
+                        m_socket->SetSendTimeout(m_server->GetFTTimeout()*1000);
+						connected = m_client->ReceiveDestinationFileChecksums(Swap32IfLE(msg.ft.size), Swap32IfLE(msg.ft.length));
+						break;
+
+					// Destination file (viewer side) is ready for reception (size > 0) or not (size = -1)
+					case rfbFileHeader:
+						{
+						// Check if the file has been created on client side
+						if (Swap32IfLE(msg.ft.size) == -1)
+						{
+							helper::close_handle(m_client->m_hSrcFile);
+                            m_client->FTUploadFailureHook();
+							// MessageBoxSecure(NULL, "7. Abort !", "Ultra WinVNC", MB_OK);
+							//vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: File not created on client side. Abort !\n"));
+							break;
+						}
+
+						// Allocate buffer for file packets
+						m_client->m_pBuff = new char [sz_rfbBlockSize];
+						if (m_client->m_pBuff == NULL)
+						{
+							helper::close_handle(m_client->m_hSrcFile);
+							//MessageBoxSecure(NULL, "8. Abort !", "Ultra WinVNC", MB_OK);
+							//vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: rfbFileHeader - Unable to allocate buffer. Abort !\n"));
+                            m_client->FTUploadFailureHook();
+							break;
+						}
+
+						// Allocate buffer for compression
+						// Todo : make a global buffer with CheckBufferSize proc
+						m_client->m_pCompBuff = new char [sz_rfbBlockSize + 1024]; // TODO: Improve this
+						if (m_client->m_pCompBuff == NULL)
+						{
+							helper::close_handle(m_client->m_hSrcFile);
+							if (m_client->m_pBuff != NULL) {
+								delete [] m_client->m_pBuff;
+								m_client->m_pBuff = NULL;
+							}
+							//MessageBoxSecure(NULL, "9. Abort !", "Ultra WinVNC", MB_OK);
+							//vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: rfbFileHeader - Unable to allocate comp. buffer. Abort !\n"));
+                            m_client->FTUploadFailureHook();
+							break;
+						}
+
+						m_client->m_fEof = false;
+						m_client->m_dwNbBytesRead = 0;
+						m_client->m_dwTotalNbBytesWritten = 0;
+						m_client->m_nPacketCount = 0;
+						m_client->m_fFileUploadError = false;
+						m_client->m_fFileUploadRunning = true;
+                        m_client->m_fUserAbortedFileTransfer = false;
+
+						connected = m_client->SendFileChunk();
+						}
+						break;
+
+
+					case rfbFilePacket:
+						if (!m_server->FileTransferEnabled() || !fUserOk) break;
+						connected = m_client->ReceiveFileChunk(Swap32IfLE(msg.ft.length), Swap32IfLE(msg.ft.size));
+                        m_client->SendKeepAlive();
+						break;
+
+
+					case rfbEndOfFile:
+						if (!m_server->FileTransferEnabled() || !fUserOk) break;
+
+						if (m_client->m_fFileDownloadRunning)
+						{
+							m_client->FinishFileReception();
+						}
+						break;
+
+					// We use this message for FileTransfer rights (<=RC18 versions)
+					// The client asks for FileTransfer permission
+					case rfbAbortFileTransfer:
+
+						// For now...
+						if (m_client->m_fFileDownloadRunning)
+						{
+							m_client->m_fFileDownloadError = true;
+                            m_client->m_fUserAbortedFileTransfer = true;
+							m_client->FinishFileReception();
+						}
+						else if (m_client->m_fFileUploadRunning)
+						{
+							m_client->m_fFileUploadError = true;
+                            m_client->m_fUserAbortedFileTransfer = true;
+							// m_client->FinishFileSending();
+						}
+						else // Old method for FileTransfer handshake perimssion (<=RC18)
+						{
+							// We reject any <=RC18 Viewer FT 
+							m_client->fFTRequest = true;
+
+							// sf at 2002 - DO IT HERE FOR THE MOMENT 
+							// FileTransfer permission requested by the client
+							if (m_client->fFTRequest)
+							{
+								rfbFileTransferMsg ft;
+								ft.type = rfbFileTransfer;
+								ft.contentType = rfbAbortFileTransfer;
+
+								bool bOldFTProtocole = (msg.ft.contentParam == 0);
+								if (bOldFTProtocole)
+									ft.contentType = rfbAbortFileTransfer; // Viewer with New V2 FT protocole
+								else
+									ft.contentType = rfbFileTransferAccess; // Viewer with old FT protocole
+
+								if (!bOldFTProtocole && m_server->FileTransferEnabled() && m_client->m_server->RemoteInputsEnabled() && fUserOk)
+								   ft.size = Swap32IfLE(1);
+								else
+								   ft.size = Swap32IfLE(-1); 
+								m_client->m_socket->SendExact((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+								m_client->fFTRequest = false;
+							}
+						}
+						break;
+
+					/* Not yet used because we want backward compatibility...
+					// From RC19 versions, the viewer uses this new message to request FT persmission
+					// It also transmits its FT versions
+					case rfbFileTransferAccess:
+						m_client->fFTRequest = true;
+
+						// FileTransfer permission requested by the client
+						if (m_client->fFTRequest)
+						{
+							rfbFileTransferMsg ft;
+							ft.type = rfbFileTransfer;
+							ft.contentType = rfbFileTransferAccess;
+
+							if (m_server->FileTransferEnabled() && m_client->m_server->RemoteInputsEnabled())
+							   ft.size = Swap32IfLE(1);
+							else
+							   ft.size = Swap32IfLE(-1); 
+							m_client->m_socket->SendExact((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+							m_client->fFTRequest = false;
+						}
+
+						break;
+					*/
+
+					// The client requests the content of a directory or Drives List
+					case rfbDirContentRequest:
+						switch (msg.ft.contentParam)
+						{
+							// Client requests the List of Local Drives
+							case rfbRDrivesList:
+								{
+								TCHAR szDrivesList[256]; // Format when filled : "C:\<NULL>D:\<NULL>....Z:\<NULL><NULL>
+								DWORD dwLen;
+								DWORD nIndex = 0;
+								int nType = 0;
+								TCHAR szDrive[4];
+								dwLen = GetLogicalDriveStrings(256, szDrivesList);
+                                // moved jdp 8/5/08 -- have to read whole packet to keep protocol in sync
+						        if (!m_server->FileTransferEnabled() || !fUserOk) break;
+
+								// We add Drives types to this drive list...
+								while (nIndex < dwLen - 3)
+								{
+									strcpy(szDrive, szDrivesList + nIndex);
+									// 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 ?
+									nType = GetDriveType(szDrive);
+									switch (nType)
+									{
+									case DRIVE_FIXED:
+										szDrivesList[nIndex + 2] = 'l';
+										break;
+									case DRIVE_REMOVABLE:
+										szDrivesList[nIndex + 2] = 'f';
+										break;
+									case DRIVE_CDROM:
+										szDrivesList[nIndex + 2] = 'c';
+										break;
+									case DRIVE_REMOTE:
+										szDrivesList[nIndex + 2] = 'n';
+										break;
+									}
+									nIndex += 4;
+								}
+
+								rfbFileTransferMsg ft;
+								ft.type = rfbFileTransfer;
+								ft.contentType = rfbDirPacket;
+								ft.contentParam = rfbADrivesList;
+								ft.length = Swap32IfLE((int)dwLen);
+								//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+								m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+								m_socket->SendExact((char *)szDrivesList, (int)dwLen);
+								}
+								break;
+
+							// Client requests the content of a directory
+							case rfbRDirContent:
+								{
+									//omni_mutex_lock l(m_client->GetUpdateLock());
+
+									const UINT length = Swap32IfLE(msg.ft.length);
+									char szDir[MAX_PATH + 2];
+									if (length > sizeof(szDir)) break;
+
+									// Read in the Name of Dir to explore
+									if (!m_socket->ReadExact(szDir, length)) break;
+									szDir[length] = 0;
+
+                                    // moved jdp 8/5/08 -- have to read whole packet to keep protocol in sync
+						            if (!m_server->FileTransferEnabled() || !fUserOk) break;
+									// sf at 2004 - Shortcuts Case
+									// Todo: Cultures translation ?
+									int nFolder = -1;
+									char szP[MAX_PATH + 2];
+									bool fShortError = false;
+									if (!_strnicmp(szDir, "My Documents", 11))
+										nFolder = CSIDL_PERSONAL;
+									if (!_strnicmp(szDir, "Desktop", 7))
+										nFolder = CSIDL_DESKTOP;
+									if (!_strnicmp(szDir, "Network Favorites", 17))
+										nFolder = CSIDL_NETHOOD;
+
+									if (nFolder != -1)
+										// if (SHGetSpecialFolderPath(NULL, szP, nFolder, FALSE))
+										if (m_client->GetSpecialFolderPath(nFolder, szP))
+										{
+											if (szP[strlen(szP)-1] != '\\') strcat(szP,"\\");
+											strcpy(szDir, szP);
+										}
+										else
+											fShortError = true;
+
+									strcat(szDir, "*");
+
+									WIN32_FIND_DATA fd;
+									HANDLE ff;
+									BOOL fRet = TRUE;
+
+									rfbFileTransferMsg ft;
+									ft.type = rfbFileTransfer;
+									ft.contentType = rfbDirPacket;
+									ft.contentParam = rfbADirectory; // or rfbAFile...
+
+									DWORD errmode = SetErrorMode(SEM_FAILCRITICALERRORS); // No popup please !
+									ff = FindFirstFile(szDir, &fd);
+									SetErrorMode( errmode );
+									
+									// Case of media not accessible
+									if (ff == INVALID_HANDLE_VALUE || fShortError)
+									{
+										ft.length = Swap32IfLE(0);										
+										m_socket->SendExact((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+										break;
+									}
+
+									ft.length = Swap32IfLE(strlen(szDir)-1);	
+									//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+									m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+									// sf at 2004 - Also send back the full directory path to the viewer (necessary for Shorcuts)
+									m_socket->SendExactQueue((char *)szDir, strlen(szDir)-1);
+
+
+									while ( fRet )
+									{
+										// sf at 2003 - Convert file time to local time
+										// We've made the choice off displaying all the files 
+										// off client AND server sides converted in clients local
+										// time only. So we don't convert server's files times.
+										/* 
+										FILETIME LocalFileTime;
+										FileTimeToLocalFileTime(&fd.ftLastWriteTime, &LocalFileTime);
+										fd.ftLastWriteTime.dwLowDateTime = LocalFileTime.dwLowDateTime;
+										fd.ftLastWriteTime.dwHighDateTime = LocalFileTime.dwHighDateTime;
+										*/
+
+										if (((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY && strcmp(fd.cFileName, "."))
+											||
+											(!strcmp(fd.cFileName, "..")))
+										{
+											// Serialize the interesting part of WIN32_FIND_DATA
+											char szFileSpec[sizeof(WIN32_FIND_DATA)];
+											int nOptLen = sizeof(WIN32_FIND_DATA) - MAX_PATH - 14 + lstrlen(fd.cFileName);
+											memcpy(szFileSpec, &fd, nOptLen);
+
+											ft.length = Swap32IfLE(nOptLen);
+											//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+											m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+											m_socket->SendExactQueue((char *)szFileSpec, nOptLen);
+										}
+										else if (strcmp(fd.cFileName, "."))
+										{
+											// Serialize the interesting part of WIN32_FIND_DATA
+											// Get rid of the trailing blanck chars. It makes a BIG
+											// difference when there's a lot of files in the dir.
+											char szFileSpec[sizeof(WIN32_FIND_DATA)];
+											int nOptLen = sizeof(WIN32_FIND_DATA) - MAX_PATH - 14 + lstrlen(fd.cFileName);
+											memcpy(szFileSpec, &fd, nOptLen);
+
+											ft.length = Swap32IfLE(nOptLen);
+											//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+											m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+											m_socket->SendExactQueue((char *)szFileSpec, nOptLen);
+
+										}
+										fRet = FindNextFile(ff, &fd);
+									}
+									FindClose(ff);
+									
+									// End of the transfer
+									ft.contentParam = 0;
+									ft.length = Swap32IfLE(0);
+									m_socket->SendExact((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+								}
+								break;
+						}
+						break;
+
+					// The client sends a command
+					case rfbCommand:
+						switch (msg.ft.contentParam)
+						{
+							// Client requests the creation of a directory
+							case rfbCDirCreate:
+								{
+									const UINT length = Swap32IfLE(msg.ft.length);
+									char szDir[MAX_PATH];
+									if (length > sizeof(szDir)) break;
+
+									// Read in the Name of Dir to explore
+									if (!m_socket->ReadExact(szDir, length))
+									{
+										// todo: manage error !
+										break;
+									}
+									szDir[length] = 0;
+
+                                    // moved jdp 8/5/08 -- have to read whole packet to keep protocol in sync
+						            if (!m_server->FileTransferEnabled() || !fUserOk) break;
+									// Create the Dir
+									BOOL fRet = CreateDirectory(szDir, NULL);
+
+									rfbFileTransferMsg ft;
+									ft.type = rfbFileTransfer;
+									ft.contentType = rfbCommandReturn;
+									ft.contentParam = rfbADirCreate;
+									ft.size = fRet ? 0 : -1;
+									ft.length = msg.ft.length;
+
+									//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+									m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+									m_socket->SendExact((char *)szDir, (int)length);
+                                    if (fRet)
+                                        m_client->FTNewFolderHook(szDir);
+								}
+								break;
+
+							// Client requests the deletion of a file
+							case rfbCFileDelete:
+								{
+									UINT length = Swap32IfLE(msg.ft.length);
+									char szFile[MAX_PATH];
+									if (length > sizeof(szFile)) break;
+
+									// Read in the Name of the File 
+									if (!m_socket->ReadExact(szFile, length))
+									{
+										// todo: manage error !
+										break;
+									}
+									szFile[length] = 0;
+                                    // moved jdp 8/5/08 -- have to read whole packet to keep protocol in sync
+						            if (!m_server->FileTransferEnabled() || !fUserOk) break;
+
+									// Delete the file
+                                    // 13 February 2008 jdp
+                                    bool isDir = isDirectory(szFile);
+                                    std::string newname(szFile);
+                                    // put the '[]' around the name if it's a folder, so that the client can display
+                                    // the proper messages. Otherwise, the client assumes it's a file.
+                                    if (isDir)
+                                        newname = AddDirPrefixAndSuffix(szFile);
+
+                                    length = newname.length()+1;
+									BOOL fRet = DeleteFileOrDirectory(szFile);
+
+									rfbFileTransferMsg ft;
+									ft.type = rfbFileTransfer;
+									ft.contentType = rfbCommandReturn;
+									ft.contentParam = rfbAFileDelete;
+									ft.size = fRet ? 0 : -1;
+									ft.length = Swap32IfLE(length);
+
+									//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+									m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+									m_socket->SendExact((char *)newname.c_str(), length);
+                                    if (fRet)
+                                        m_client->FTDeleteHook(szFile, isDir);
+								}
+								break;
+
+							// Client requests the Renaming of a file/directory
+							case rfbCFileRename:
+								{
+									const UINT length = Swap32IfLE(msg.ft.length);
+									char szNames[(2 * MAX_PATH) + 1];
+									if (length > sizeof(szNames)) break;
+
+									// Read in the Names
+									if (!m_socket->ReadExact(szNames, length))
+									{
+										// todo: manage error !
+										break;
+									}
+									szNames[length] = 0;
+                                    // moved jdp 8/5/08 -- have to read whole packet to keep protocol in sync
+						            if (!m_server->FileTransferEnabled() || !fUserOk) break;
+
+									char *p = strrchr(szNames, '*');
+									if (p == NULL) break;
+									char szCurrentName[ (2 * MAX_PATH) + 1];
+									char szNewName[ (2 * MAX_PATH) + 1];
+
+									strcpy(szNewName, p + 1); 
+									*p = '\0';
+									strcpy(szCurrentName, szNames);
+									*p = '*';
+
+									// Rename
+									BOOL fRet = MoveFile(szCurrentName, szNewName);
+
+									rfbFileTransferMsg ft;
+									ft.type = rfbFileTransfer;
+									ft.contentType = rfbCommandReturn;
+									ft.contentParam = rfbAFileRename;
+									ft.size = fRet ? 0 : -1;
+									ft.length = msg.ft.length;
+
+									//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+									m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+									m_socket->SendExact((char *)szNames, (int)length);
+                                    if (fRet)
+                                        m_client->FTRenameHook(szCurrentName, szNewName);
+								}
+								break;
+
+
+						}  // End of swith
+						break;
+
+				} // End of switch
+
+			} // End of if
+			else // Fix from Jeremy C. 
+			{
+				if (m_client->m_fFileDownloadRunning)
+				{
+					m_client->m_fFileDownloadError = true;
+					FlushFileBuffers(m_client->m_hDestFile);
+                    helper::close_handle(m_client->m_hDestFile);
+                    m_client->FTDownloadFailureHook();
+                    m_client->m_fFileDownloadRunning = false;
+				}
+                if (m_client->m_fFileUploadRunning)
+                {
+					m_client->m_fFileUploadError = true;
+                    FlushFileBuffers(m_client->m_hSrcFile);
+                    helper::close_handle(m_client->m_hSrcFile);
+                    m_client->FTUploadFailureHook();
+                    m_client->m_fFileUploadRunning = false;
+				}
+				//vnclog.Print(LL_INTINFO, VNCLOG("*** FileTransfer: message content reading error\n"));
+			}
+			/*
+			// sf at 2005 - Cancel FT User impersonation if possible
+			// Fix from byteboon (Jeremy C.)
+			if (m_server->FTUserImpersonation())
+			{
+				m_client->UndoFTUserImpersonation();
+			}
+			*/
+
+			m_client->m_fFileTransferRunning = FALSE;
+			}
+			break;
+#endif
+
+			// Modif cs at 2005
+#ifdef DSHOW
+		case rfbKeyFrameRequest:
+			{
+				MutexAutoLock l_Lock(&m_client->m_hmtxEncodeAccess);
+
+				omni_mutex_lock l(m_client->GetUpdateLock());
+
+				if(m_client->m_encodemgr.ResetZRLEEncoding())
+				{
+					rfb::Rect update;
+
+					rfb::Rect ViewerSize = m_client->m_encodemgr.m_buffer->GetViewerSize();
+
+					update.tl.x = 0;
+					update.tl.y = 0;
+					update.br.x = ViewerSize.br.x;
+					update.br.y = ViewerSize.br.y;
+					rfb::Region2D update_rgn = update;
+
+					// Add the requested area to the incremental update cliprect
+					m_client->m_incr_rgn.assign_union(update_rgn);
+
+					// Yes, so add the region to the update tracker
+					m_client->m_update_tracker.add_changed(update_rgn);
+					
+					// Tell the desktop grabber to fetch the region's latest state
+					m_client->m_encodemgr.m_buffer->m_desktop->QueueRect(update);
+
+					// Kick the update thread (and create it if not there already)
+					m_client->TriggerUpdateThread();
+
+					// Send a message back to the client to confirm that we have reset the zrle encoding			
+					rfbKeyFrameUpdateMsg header;
+					header.type = rfbKeyFrameUpdate;
+					m_client->SendRFBMsg(rfbKeyFrameUpdate, (BYTE *)&header, sz_rfbKeyFrameUpdateMsg);
+				}				
+				else
+				{
+					vnclog.Print(LL_INTERR, VNCLOG("[rfbKeyFrameRequest] Unable to Reset ZRLE Encoding\n"));
+				}
+			}
+			break;
+#endif
+		// adzm 2010-09 - Notify streaming DSM plugin support
+        case rfbNotifyPluginStreaming:
+            if (sz_rfbNotifyPluginStreamingMsg > 1)
+            {
+			    if (!m_socket->ReadExact(((char *) &msg)+nTO, sz_rfbNotifyPluginStreamingMsg-nTO))
+			    {
+				    connected = FALSE;
+				    break;
+			    }
+            }
+			m_socket->SetPluginStreamingIn();
+            break;
+#ifdef ULTRAVNC_ITALC_SUPPORT
+		case rfbItalcCoreRequest:
+		{
+			omni_mutex_lock l(m_client->GetUpdateLock());
+			if( !ItalcCoreServer::instance()->
+				handleItalcClientMessage( vsocketDispatcher, m_socket ) )
+			{
+				connected = FALSE;
+			}
+			break;
+		}
+#endif
+		default:
+			// Unknown message, so fail!
+			connected = FALSE;
+		}
+
+		// sf at 2005 - Cancel FT User impersonation if possible
+		// We do it here to ensure impersonation is cancelled
+		if (m_server->FTUserImpersonation())
+		{
+			m_client->UndoFTUserImpersonation();
+		}
+
+	}
+
+	if (fShutdownOrdered) {
+		m_autoreconnectcounter_quit=true;
+		//needed to give autoreconnect (max 100) to quit
+		Sleep(200);
+	}
+	
+
+    if (m_client->m_fFileDownloadRunning)
+    {
+        m_client->m_fFileDownloadError = true;
+        FlushFileBuffers(m_client->m_hDestFile);
+        m_client->FTDownloadFailureHook();
+        m_client->m_fFileDownloadRunning = false;
+        helper::close_handle(m_client->m_hDestFile);
+    }
+        
+    if (m_client->m_fFileUploadRunning)
+    {
+        m_client->m_fFileUploadError = true;
+        FlushFileBuffers(m_client->m_hSrcFile);
+        m_client->FTUploadFailureHook();
+        m_client->m_fFileUploadRunning = false;
+        helper::close_handle(m_client->m_hSrcFile);
+    }
+
+  
+
+	// Move into the thread's original desktop
+	// TAG 14
+	vncService::SelectHDESK(home_desktop);
+    if (m_client->m_bClientHasBlockedInput)
+    {
+        m_client->m_encodemgr.m_buffer->m_desktop->SetBlockInputState(false);
+        m_client->m_bClientHasBlockedInput = false;
+    }
+	if (input_desktop)
+		if (!CloseDesktop(input_desktop))
+		vnclog.Print(LL_INTERR, VNCLOG("failed to close desktop\n"));
+	// Quit this thread.  This will automatically delete the thread and the
+	// associated client.
+	vnclog.Print(LL_CLIENTS, VNCLOG("client disconnected : %s (%hd)\n"),
+									m_client->GetClientName(),
+									m_client->GetClientId());
+	//////////////////
+	// LOG it also in the event
+	//////////////////
+	{
+		typedef BOOL (*LogeventFn)(char *machine);
+		LogeventFn Logevent = 0;
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			*p = '\0';
+			strcat (szCurrentDir,"\\logging.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				//BOOL result=false;
+				Logevent = (LogeventFn) GetProcAddress( hModule, "LOGEXIT" );
+				Logevent((char *)m_client->GetClientName());
+				FreeLibrary(hModule);
+			}
+	}
+
+
+	// Disable the protocol to ensure that the update thread
+	// is not accessing the desktop and buffer objects
+	m_client->DisableProtocol();
+
+	// Finally, it's safe to kill the update thread here
+	if (m_client->m_updatethread) {
+		m_client->m_updatethread->Kill();
+		m_client->m_updatethread->join(NULL);
+	}
+	// Remove the client from the server
+	// This may result in the desktop and buffer being destroyed
+	// It also guarantees that the client will not be passed further
+	// updates
+	m_server->RemoveClient(m_client->GetClientId());
+
+	// sf at 2003 - AutoReconnection attempt if required
+	if (!fShutdownOrdered) {
+		if (m_client->m_Autoreconnect)
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("PostAddNewClient II\n"));
+			m_server->AutoReconnect(m_client->m_Autoreconnect);
+			m_server->AutoReconnectPort(m_AutoReconnectPort);
+			m_server->AutoReconnectAdr(m_szAutoReconnectAdr);
+			m_server->AutoReconnectId(m_szAutoReconnectId);
+			vncService::PostAddNewClient(1111, 1111);
+		}
+	}
+}
+
+// The vncClient itself
+
+// adzm - 2010-07 - Extended clipboard
+vncClient::vncClient() : m_clipboard(ClipboardSettings::defaultServerCaps), Sendinput("USER32", "SendInput")
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("vncClient() executing...\n"));
+
+	m_socket = NULL;
+	m_client_name = 0;
+
+	// Initialise mouse fields
+	m_mousemoved = FALSE;
+	m_ptrevent.buttonMask = 0;
+	m_ptrevent.x = 0;
+	m_ptrevent.y=0;
+
+	// Other misc flags
+	m_thread = NULL;
+	m_palettechanged = FALSE;
+
+	// Initialise the two update stores
+	m_updatethread = NULL;
+	m_update_tracker.init(this);
+
+	m_remoteevent = FALSE;
+
+	// adzm - 2010-07 - Extended clipboard
+	//m_clipboard_text = 0;
+
+	// IMPORTANT: Initially, client is not protocol-ready.
+	m_disable_protocol = 1;
+
+	//SINGLE WINDOW
+	m_use_NewSWSize = FALSE;
+	m_SWOffsetx=0;
+	vnclog.Print(LL_INTINFO, VNCLOG("TEST 4\n"));
+	m_SWOffsety=0;
+	m_ScreenOffsetx=0;
+	m_ScreenOffsety=0;
+
+	// sf at 2002 
+	fNewScale = false;
+	m_fPalmVNCScaling = false;
+	fFTRequest = false;
+
+	// Modif sf at 2002 - FileTransfer
+	m_fFileTransferRunning = FALSE;
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	m_pZipUnZip = new CZipUnZip32(); // Directory FileTransfer utils
+#endif
+
+	m_hDestFile = 0;
+	//m_szFullDestName = NULL;
+	m_dwFileSize = 0; 
+	m_dwNbPackets = 0;
+	m_dwNbReceivedPackets = 0;
+	m_dwNbBytesWritten = 0;
+	m_dwTotalNbBytesWritten = 0;
+	m_fFileDownloadError = false;
+    m_fUserAbortedFileTransfer  = false;
+	m_fFileDownloadRunning = false;
+	m_hSrcFile = INVALID_HANDLE_VALUE;
+	//m_szSrcFileName = NULL;
+	m_fEof = false;
+	m_dwNbBytesRead = 0;
+	m_dwTotalNbBytesRead = 0;
+	m_nPacketCount = 0;
+	m_fCompressionEnabled = false;
+	m_fFileUploadError = false;
+	m_fFileUploadRunning = false;
+
+	// sf at 2004 - Delta Transfer
+	m_lpCSBuffer = NULL;
+	m_nCSOffset = 0;
+	m_nCSBufferSize = 0;
+
+	// CURSOR HANDLING
+	m_cursor_update_pending = FALSE;
+	m_cursor_update_sent = FALSE;
+	// nyama/marscha - PointerPos
+	m_use_PointerPos = FALSE;
+	m_cursor_pos_changed = FALSE;
+	m_cursor_pos.x = 0;
+	m_cursor_pos.y = 0;
+
+	//cachestats
+	totalraw=0;
+
+	m_pRawCacheZipBuf = NULL;
+	m_nRawCacheZipBufSize = 0;
+	m_pCacheZipBuf = NULL;
+	m_nCacheZipBufSize = 0;
+
+	// sf at 2005 - FTUserImpersonation
+	m_fFTUserImpersonatedOk = false;
+	m_lLastFTUserImpersonationTime = 0L;
+
+	// Modif sf at 2002 - Text Chat
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	m_pTextChat = new TextChat(this); 	
+#endif
+	m_fUltraViewer = true;
+	m_IsLoopback=false;
+	m_NewSWUpdateWaiting=false;
+	client_settings_passed=false;
+/*	roundrobin_counter=0;
+	for (int i=0;i<rfbEncodingZRLE+1;i++)
+		for (int j=0;j<31;j++)
+		{
+		  timearray[i][j]=0;
+		  sizearray[i][j]=0;
+		}*/
+// Modif cs at 2005
+#ifdef DSHOW
+	m_hmtxEncodeAccess = CreateMutex(NULL, FALSE, NULL);
+#endif
+    m_wants_ServerStateUpdates =  false;
+    m_bClientHasBlockedInput = false;
+	m_Support_rfbSetServerInput = false;
+    m_wants_KeepAlive = false;
+	m_session_supported = false;
+    m_fFileSessionOpen = false;
+	m_pBuff = 0;
+	m_pCompBuff = 0;
+	m_NewSWDesktop = 0;
+	NewsizeW = 0;
+	NewsizeH = 0;
+
+	
+	// adzm 2009-07-05
+	m_szRepeaterID = NULL; // as in, not using
+	m_szHost = NULL;
+	m_hostPort = 0;
+	m_want_update_state=false;
+	m_initial_update=true;
+	m_nScale_viewer = 1;
+}
+
+vncClient::~vncClient()
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("~vncClient() executing...\n"));
+
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	// Modif sf at 2002 - Text Chat
+	if (m_pTextChat) 
+	{
+        m_pTextChat->KillDialog();
+		delete(m_pTextChat);
+		m_pTextChat = NULL;
+	}
+#endif
+
+	// Directory FileTransfer utils
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	if (m_pZipUnZip) delete m_pZipUnZip;
+#endif
+
+	// We now know the thread is dead, so we can clean up
+	if (m_client_name != 0) {
+		free(m_client_name);
+		m_client_name = 0;
+	}
+
+	// If we have a socket then kill it
+	if (m_socket != NULL)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("deleting socket\n"));
+
+		delete m_socket;
+		m_socket = NULL;
+	}
+	if (m_pRawCacheZipBuf != NULL)
+		{
+			delete [] m_pRawCacheZipBuf;
+			m_pRawCacheZipBuf = NULL;
+		}
+	if (m_pCacheZipBuf != NULL)
+		{
+			delete [] m_pCacheZipBuf;
+			m_pCacheZipBuf = NULL;
+		}
+	// adzm - 2010-07 - Extended clipboard
+	/*if (m_clipboard_text) {
+		free(m_clipboard_text);
+	}*/
+// Modif cs at 2005
+#ifdef DSHOW
+	CloseHandle(m_hmtxEncodeAccess);
+#endif
+	if (m_lpCSBuffer)
+		delete [] m_lpCSBuffer;
+	if (m_pBuff)
+		delete [] m_pBuff;
+	if (m_pCompBuff)
+		delete [] m_pCompBuff;
+
+	//thos give sometimes errors, hlogfile is already removed at this point
+	//vnclog.Print(LL_INTINFO, VNCLOG("cached %d \n"),totalraw);
+	if (SPECIAL_SC_EXIT && !fShutdownOrdered) // if fShutdownOrdered, hwnd may not be valid
+	{
+		//adzm 2009-06-20 - if we are SC, only exit if no other viewers are connected!
+		// (since multiple viewers is now allowed with the new DSM plugin)
+		// adzm 2009-08-02
+		// adzm 2010-08 - stay alive if we have an UnauthClientCount as well, since another connection may be pending
+		if ( (m_server == NULL) || (m_server && m_server->AuthClientCount() == 0 && m_server->UnauthClientCount() == 0) ) {
+			// We want that the server exit when the viewer exit
+			//adzm 2010-02-10 - Finds the appropriate VNC window for this process
+			HWND hwnd=FindWinVNCWindow(true);
+			if (hwnd) SendMessage(hwnd,WM_COMMAND,ID_CLOSE,0);
+		}
+	}
+
+	// adzm 2009-07-05
+	if (m_szRepeaterID) {
+		free(m_szRepeaterID);
+	}
+	// adzm 2009-08-02
+	if (m_szHost) {
+		free(m_szHost);
+	}
+}
+
+// Init
+BOOL
+vncClient::Init(vncServer *server,
+				VSocket *socket,
+				BOOL auth,
+				BOOL shared,
+				vncClientId newid)
+{
+	// Save the server id;
+	m_server = server;
+
+	// Save the socket
+	m_socket = socket;
+
+	// Save the name of the connecting client
+	char *name = m_socket->GetPeerName();
+	if (name != 0)
+		m_client_name = _strdup(name);
+	else
+		m_client_name = _strdup("<unknown>");
+
+	// Save the client id
+	m_id = newid;
+
+	// Spawn the child thread here
+	m_thread = new vncClientThread;
+	if (m_thread == NULL)
+		return FALSE;
+	return ((vncClientThread *)m_thread)->Init(this, m_server, m_socket, auth, shared);
+
+	return FALSE;
+}
+
+void
+vncClient::Kill()
+{
+	// Close the socket
+	vnclog.Print(LL_INTINFO, VNCLOG("client Kill() called"));
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	if (m_pTextChat)
+        m_pTextChat->KillDialog();
+#endif
+	if (m_socket != NULL)
+		m_socket->Close();
+}
+
+// Client manipulation functions for use by the server
+void
+vncClient::SetBuffer(vncBuffer *buffer)
+{
+	// Until authenticated, the client object has no access
+	// to the screen buffer.  This means that there only need
+	// be a buffer when there's at least one authenticated client.
+	m_encodemgr.SetBuffer(buffer);
+}
+
+void
+vncClient::TriggerUpdateThread()
+{
+	// ALWAYS lock the client UpdateLock before calling this!
+	// RealVNC 336	
+	// Check that this client has an update thread
+	// The update thread never dissappears, and this is the only
+	// thread allowed to create it, so this can be done without locking.
+	
+	if (!m_updatethread)
+	{
+		m_updatethread = new vncClientUpdateThread;
+		if (!m_updatethread || 
+			!m_updatethread->Init(this)) {
+			Kill();
+		}
+	}				
+	if (m_updatethread)
+		m_updatethread->Trigger();
+}
+
+void
+vncClient::UpdateMouse()
+{
+	if (!m_mousemoved && !m_cursor_update_sent)
+	{
+	omni_mutex_lock l(GetUpdateLock());
+    m_mousemoved=TRUE;
+	}
+	// nyama/marscha - PointerPos
+	// PointerPos code doesn take in account prim/secundary display
+	// offset needed
+	if (m_use_PointerPos && !m_cursor_pos_changed) {
+		POINT cursorPos;
+		GetCursorPos(&cursorPos);
+		cursorPos.x=cursorPos.x-(m_ScreenOffsetx+m_SWOffsetx);
+		cursorPos.y=cursorPos.y-(m_ScreenOffsety+m_SWOffsety);
+		//vnclog.Print(LL_INTINFO, VNCLOG("UpdateMouse m_cursor_pos(%d, %d), new(%d, %d)\n"), 
+		//  m_cursor_pos.x, m_cursor_pos.y, cursorPos.x, cursorPos.y);
+		if (cursorPos.x != m_cursor_pos.x || cursorPos.y != m_cursor_pos.y) {
+			// This movement isn't by this client, but generated locally or by other client.
+			// Send it to this client.
+			omni_mutex_lock l(GetUpdateLock());
+			m_cursor_pos.x = cursorPos.x;
+			m_cursor_pos.y = cursorPos.y;
+			m_cursor_pos_changed = TRUE;
+			TriggerUpdateThread();
+		}
+	}
+}
+
+// adzm - 2010-07 - Extended clipboard
+/*
+void
+vncClient::UpdateClipText(const char* text)
+{
+	//This is already locked in the vncdesktopsynk
+	//omni_mutex_lock l(GetUpdateLock());
+	if (m_clipboard_text) {
+		free(m_clipboard_text);
+		m_clipboard_text = 0;
+	}
+	m_clipboard_text = _strdup(text);
+	TriggerUpdateThread();
+}
+*/
+
+// adzm - 2010-07 - Extended clipboard
+void
+vncClient::UpdateClipTextEx(ClipboardData& clipboardData, CARD32 overrideFlags)
+{
+	//This is already locked in the vncdesktopsynk
+	//But it's just a critical section, doesn't matter how often you lock it in the same thread
+	//as long as it is unlocked the same number of times.
+	omni_mutex_lock l(GetUpdateLock());
+	if (m_clipboard.UpdateClipTextEx(clipboardData, overrideFlags)) {
+		TriggerUpdateThread();
+	}
+}
+
+void
+vncClient::UpdateCursorShape()
+{
+	omni_mutex_lock l(GetUpdateLock());
+	TriggerUpdateThread();
+}
+
+void
+vncClient::UpdatePalette(bool lock)
+{
+	if (lock) omni_mutex_lock l(GetUpdateLock());
+	m_palettechanged = TRUE;
+}
+
+void
+vncClient::UpdateLocalFormat(bool lock)
+{
+	if (lock) DisableProtocol();
+	else DisableProtocol_no_mutex();
+	vnclog.Print(LL_INTERR, VNCLOG("updating local pixel format\n"));
+	m_encodemgr.SetServerFormat();
+	if (lock) EnableProtocol();
+	else EnableProtocol_no_mutex();
+}
+
+BOOL
+vncClient::SetNewSWSize(long w,long h,BOOL Desktop)
+{
+	if (!m_use_NewSWSize) return FALSE;
+	DisableProtocol_no_mutex();
+
+	vnclog.Print(LL_INTERR, VNCLOG("updating local pixel format and buffer size\n"));
+	m_encodemgr.SetServerFormat();
+	m_palettechanged = TRUE;
+	if (Desktop) m_encodemgr.SetEncoding(0,TRUE);//0=dummy
+	m_NewSWUpdateWaiting=true;
+	NewsizeW=w;
+	NewsizeH=h;
+	EnableProtocol_no_mutex();
+
+	return TRUE;
+}
+
+BOOL
+vncClient::SetNewSWSizeFR(long w,long h,BOOL Desktop)
+{
+	if (!m_use_NewSWSize) return FALSE;
+	m_NewSWUpdateWaiting=true;
+	NewsizeW=w;
+	NewsizeH=h;
+	return TRUE;
+}
+
+// Functions used to set and retrieve the client settings
+const char*
+vncClient::GetClientName()
+{
+	return m_client_name;
+}
+
+// Enabling and disabling clipboard/GFX updates
+void
+vncClient::DisableProtocol()
+{
+	BOOL disable = FALSE;
+	{	 
+		omni_mutex_lock l(GetUpdateLock());
+		if (m_disable_protocol == 0)
+			disable = TRUE;
+		m_disable_protocol++;
+		if (disable && m_updatethread)
+			m_updatethread->EnableUpdates(FALSE);
+	}
+}
+
+void
+vncClient::EnableProtocol()
+{
+	{	 
+		omni_mutex_lock l(GetUpdateLock());
+		if (m_disable_protocol == 0) {
+			vnclog.Print(LL_INTERR, VNCLOG("protocol enabled too many times!\n"));
+			m_socket->Close();
+			return;
+		}
+		m_disable_protocol--;
+		if ((m_disable_protocol == 0) && m_updatethread)
+			m_updatethread->EnableUpdates(TRUE);
+	}
+}
+
+void
+vncClient::DisableProtocol_no_mutex()
+{
+	BOOL disable = FALSE;
+	{	 
+		if (m_disable_protocol == 0)
+			disable = TRUE;
+		m_disable_protocol++;
+		if (disable && m_updatethread)
+			m_updatethread->EnableUpdates(FALSE);
+	}
+}
+
+void
+vncClient::EnableProtocol_no_mutex()
+{
+	{	 
+		if (m_disable_protocol == 0) {
+			vnclog.Print(LL_INTERR, VNCLOG("protocol enabled too many times!\n"));
+			m_socket->Close();
+			return;
+		}
+		m_disable_protocol--;
+		if ((m_disable_protocol == 0) && m_updatethread)
+			m_updatethread->EnableUpdates(TRUE);
+	}
+}
+
+// Internal methods
+BOOL
+vncClient::SendRFBMsg(CARD8 type, BYTE *buffer, int buflen)
+{
+	// Set the message type
+	((rfbServerToClientMsg *)buffer)->type = type;
+
+	// Send the message
+	if (!m_socket->SendExact((char *) buffer, buflen, type))
+	{
+		vnclog.Print(LL_CONNERR, VNCLOG("failed to send RFB message to client\n"));
+
+		Kill();
+		return FALSE;
+	}
+	return TRUE;
+}
+
+//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+BOOL
+vncClient::SendRFBMsgQueue(CARD8 type, BYTE *buffer, int buflen)
+{
+	// Set the message type
+	((rfbServerToClientMsg *)buffer)->type = type;
+
+	// Send the message
+	if (!m_socket->SendExactQueue((char *) buffer, buflen, type))
+	{
+		vnclog.Print(LL_CONNERR, VNCLOG("failed to send RFB message to client\n"));
+
+		Kill();
+		return FALSE;
+	}
+	return TRUE;
+}
+#define min(a, b)  (((a) < (b)) ? (a) : (b))
+
+BOOL
+vncClient::SendUpdate(rfb::SimpleUpdateTracker &update)
+{
+	if (!m_initial_update) return FALSE;
+
+	// If there is nothing to send then exit
+
+	if (update.is_empty() && !m_cursor_update_pending && !m_NewSWUpdateWaiting && !m_cursor_pos_changed) return FALSE;
+	
+	// Get the update info from the tracker
+	rfb::UpdateInfo update_info;
+	update.get_update(update_info);
+	update.clear();
+	//Old update could be outsite the new bounding
+	//We first make sure the new size is send to the client
+	//The cleint ask a full update after screen_size change
+	if (m_NewSWUpdateWaiting) 
+		{
+			m_socket->ClearQueue();
+			rfbFramebufferUpdateRectHeader hdr;
+			if (m_use_NewSWSize) {
+				m_ScaledScreen = m_encodemgr.m_buffer->GetViewerSize();
+				m_nScale = m_encodemgr.m_buffer->GetScale();
+				hdr.r.x = 0;
+				hdr.r.y = 0;
+				hdr.r.w = Swap16IfLE(NewsizeW*m_nScale_viewer/m_nScale);
+				hdr.r.h = Swap16IfLE(NewsizeH*m_nScale_viewer/m_nScale);
+				hdr.encoding = Swap32IfLE(rfbEncodingNewFBSize);
+				rfbFramebufferUpdateMsg header;
+				header.nRects = Swap16IfLE(1);
+				//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+				SendRFBMsgQueue(rfbFramebufferUpdate, (BYTE *)&header,sz_rfbFramebufferUpdateMsg);
+				m_socket->SendExact((char *)&hdr, sizeof(hdr));
+				m_NewSWUpdateWaiting=false;
+				return TRUE;
+			}
+		}
+
+	// Find out how many rectangles in total will be updated
+	// This includes copyrects and changed rectangles split
+	// up by codings such as CoRRE.
+	int updates = 0;
+	int numsubrects = 0;
+	updates += update_info.copied.size();
+	if (m_encodemgr.IsCacheEnabled())
+	{
+		if (update_info.cached.size() > 5)
+		{
+			updates++;
+		}
+		else 
+		{
+			updates += update_info.cached.size();
+			//vnclog.Print(LL_INTERR, "cached %d\n", updates);
+		}
+	}
+	
+	rfb::RectVector::const_iterator i;
+	if (updates!= 0xFFFF)
+	{
+		for ( i=update_info.changed.begin(); i != update_info.changed.end(); i++)
+		{
+			// Tight specific (lastrect)
+			numsubrects = m_encodemgr.GetNumCodedRects(*i);
+			
+			// Skip rest rectangles if an encoder will use LastRect extension.
+			if (numsubrects == 0) {
+				updates = 0xFFFF;
+				break;
+			}
+			updates += numsubrects;
+			//vnclog.Print(LL_INTERR, "changed %d\n", updates);
+		}
+	}	
+	
+	// if no cache is supported by the other viewer
+	// We need to send the cache as a normal update
+	if (!m_encodemgr.IsCacheEnabled() && updates!= 0xFFFF) 
+	{
+		for (i=update_info.cached.begin(); i != update_info.cached.end(); i++)
+		{
+			// Tight specific (lastrect)
+			numsubrects = m_encodemgr.GetNumCodedRects(*i);
+			
+			// Skip rest rectangles if an encoder will use LastRect extension.
+			if (numsubrects == 0) {
+				updates = 0xFFFF;
+				//break;
+			}	
+			else updates += numsubrects;
+			//vnclog.Print(LL_INTERR, "cached2 %d\n", updates);
+		}
+	}
+	
+	// 
+	if (!m_encodemgr.IsXCursorSupported()) m_cursor_update_pending=false;
+	// Tight specific (lastrect)
+	if (updates != 0xFFFF)
+	{
+		// Tight - CURSOR HANDLING
+		if (m_cursor_update_pending)
+		{
+			updates++;
+		}
+		// nyama/marscha - PointerPos
+		if (m_cursor_pos_changed)
+			updates++;
+		if (updates == 0) return FALSE;
+	}
+
+//	Sendtimer.start();
+
+	omni_mutex_lock l(GetUpdateLock());
+	// Otherwise, send <number of rectangles> header
+	rfbFramebufferUpdateMsg header;
+	header.nRects = Swap16IfLE(updates);
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+	if (!SendRFBMsgQueue(rfbFramebufferUpdate, (BYTE *) &header, sz_rfbFramebufferUpdateMsg))
+		return TRUE;
+	
+	// CURSOR HANDLING
+	if (m_cursor_update_pending) {
+		if (!SendCursorShapeUpdate())
+			return FALSE;
+	}
+	// nyama/marscha - PointerPos
+	if (m_cursor_pos_changed)
+		if (!SendCursorPosUpdate())
+			return FALSE;
+	
+	// Send the copyrect rectangles
+	if (!update_info.copied.empty()) {
+		rfb::Point to_src_delta = update_info.copy_delta.negate();
+		for (i=update_info.copied.begin(); i!=update_info.copied.end(); i++) {
+			rfb::Point src = (*i).tl.translate(to_src_delta);
+			if (!SendCopyRect(*i, src))
+				return FALSE;
+		}
+	}
+	
+	if (m_encodemgr.IsCacheEnabled())
+	{
+		if (update_info.cached.size() > 5)
+		{
+			if (!SendCacheZip(update_info.cached))
+				return FALSE;
+		}
+		else
+		{
+			if (!SendCacheRectangles(update_info.cached))
+				return FALSE;
+		}
+	}
+	else 
+	{
+		if (!SendRectangles(update_info.cached))
+			return FALSE;
+	}
+	
+	if (!SendRectangles(update_info.changed))
+		return FALSE;
+	// Tight specific - Send LastRect marker if needed.
+	if (updates == 0xFFFF)
+	{
+		m_encodemgr.LastRect(m_socket);
+		if (!SendLastRect())
+			return FALSE;
+	}
+	m_socket->ClearQueue();
+	// vnclog.Print(LL_INTINFO, VNCLOG("Update cycle\n"));
+	return TRUE;
+}
+
+// Send a set of rectangles
+BOOL
+vncClient::SendRectangles(const rfb::RectVector &rects)
+{
+	// Modif cs at 2005
+#ifdef DSHOW
+	MutexAutoLock l_Lock(&m_hmtxEncodeAccess);
+#endif
+	rfb::RectVector::const_iterator i;
+	rfb::Rect rect;
+	int x,y;
+	int Blocksize=254;
+	int BlocksizeX=254;
+
+
+	// Work through the list of rectangles, sending each one
+	for (i=rects.begin();i!=rects.end();i++) {
+		if (m_encodemgr.ultra2_encoder_in_use)
+		{
+			//We want smaller rect, so data can be send and decoded while handling next update
+			rect.tl.x=(*i).tl.x;
+			rect.br.x=(*i).br.x;
+			rect.tl.y=(*i).tl.y;
+			rect.br.y=(*i).br.y;
+
+			if ((rect.br.x-rect.tl.x) * (rect.br.y-rect.tl.y) > Blocksize*BlocksizeX )
+			{
+ 
+			for (y = rect.tl.y; y < rect.br.y; y += Blocksize)
+			{
+				int blockbottom = min(y + Blocksize, rect.br.y);
+				for (x = rect.tl.x; x < rect.br.x; x += BlocksizeX)
+					{
+ 
+					   int blockright = min(x+BlocksizeX, rect.br.x);
+					   rfb::Rect tilerect;
+					   tilerect.tl.x=x;
+					   tilerect.br.x=blockright;
+					   tilerect.tl.y=y;
+					   tilerect.br.y=blockbottom;
+					   if (!SendRectangle(tilerect)) return FALSE;
+					}
+			}
+			}
+			else
+			{
+				if (!SendRectangle(rect)) return FALSE;
+			}
+
+		}
+		else
+		{
+		if (!SendRectangle(*i)) return FALSE;
+		}
+	}
+	return TRUE;
+}
+
+
+
+// Tell the encoder to send a single rectangle
+BOOL
+vncClient::SendRectangle(const rfb::Rect &rect)
+{
+	// Get the buffer to encode the rectangle
+	// Modif sf at 2002 - Scaling
+	rfb::Rect ScaledRect;
+	ScaledRect.tl.y = rect.tl.y / m_nScale;
+	ScaledRect.br.y = rect.br.y / m_nScale;
+	ScaledRect.tl.x = rect.tl.x / m_nScale;
+	ScaledRect.br.x = rect.br.x / m_nScale;
+
+	//	Totalsend+=(ScaledRect.br.x-ScaledRect.tl.x)*(ScaledRect.br.y-ScaledRect.tl.y);
+
+	// sf at 2002 - DSMPlugin
+	// Some encoders (Hextile, ZRLE, Raw..) store all the data to send into 
+	// m_clientbuffer and return the total size from EncodeRect()
+	// Some Encoders (Tight, Zlib, ZlibHex..) send data on the fly and return
+	// a partial size from EncodeRect(). 
+	// On the viewer side, the data is read piece by piece or in one shot 
+	// still depending on the encoding...
+	// It is not compatible with DSM: we need to read/write data blocks of same 
+	// size on both sides in one shot
+	// We create a common method to send the data 
+	// adzm 2010-09
+	if (!m_socket->IsPluginStreamingOut() && m_socket->IsUsePluginEnabled() && m_server->GetDSMPluginPointer()->IsEnabled())
+	{
+		// Tell the SendExact() calls to write into the local NetRectBuffer memory buffer
+		m_socket->SetWriteToNetRectBuffer(true);
+		m_socket->SetNetRectBufOffset(0);
+		// sf at 2003 - we can't easely predict how many rects are going to be sent 
+		// (for Tight encoding for instance)
+		// Then we take the worse case (screen buffer size * 1.5) for the net rect buffer size.
+		// m_socket->CheckNetRectBufferSize((int)(m_encodemgr.GetClientBuffSize() * 2));
+		m_socket->CheckNetRectBufferSize((int)(m_encodemgr.m_buffer->m_desktop->ScreenBuffSize() * 3 / 2));
+		UINT bytes = m_encodemgr.EncodeRect(ScaledRect, m_socket);
+		if (bytes == 0)
+		{
+			return true;
+		}
+		m_socket->SetWriteToNetRectBuffer(false);
+
+		BYTE* pDataBuffer = NULL;
+		UINT TheSize = 0;
+
+		// If SendExact() was called from inside the encoder
+		if (m_socket->GetNetRectBufOffset() > 0)
+		{
+			TheSize = m_socket->GetNetRectBufOffset();
+#ifdef _DEBUG
+					char			szText[256];
+					DWORD error=GetLastError();
+					sprintf(szText," ++++++ crashtest TheSize %i \n",TheSize);
+					SetLastError(0);
+					OutputDebugString(szText);		
+	#endif
+			m_socket->SetNetRectBufOffset(0);
+			pDataBuffer = m_socket->GetNetRectBuf();
+			// Add the rest to the data buffer if it exists
+			if (bytes > 0)
+			{
+				memcpy(pDataBuffer + TheSize, m_encodemgr.GetClientBuffer(), bytes);
+			}
+		}
+		else // If all data was stored in m_clientbuffer
+		{
+			TheSize = bytes;
+#ifdef _DEBUG
+					char			szText[256];
+					DWORD error=GetLastError();
+					sprintf(szText," ++++++ crashtest TheSize2 %i \n",TheSize);
+					SetLastError(0);
+					OutputDebugString(szText);		
+	#endif
+			bytes = 0;
+			pDataBuffer = m_encodemgr.GetClientBuffer();
+		}
+
+		// Send the header
+		m_socket->SendExactQueue((char *)pDataBuffer, sz_rfbFramebufferUpdateRectHeader);
+
+		// Send the size of the following rects data buffer
+		CARD32 Size = (CARD32)(TheSize + bytes - sz_rfbFramebufferUpdateRectHeader);
+#ifdef _DEBUG
+					char			szText[256];
+					DWORD error=GetLastError();
+					sprintf(szText," ++++++ crashtest Size %i %i\n",Size,bytes);
+					SetLastError(0);
+					OutputDebugString(szText);		
+	#endif
+		Size = Swap32IfLE(Size);
+		m_socket->SendExactQueue((char*)&Size, sizeof(CARD32));
+		// Send the data buffer
+		m_socket->SendExactQueue(((char *)pDataBuffer + sz_rfbFramebufferUpdateRectHeader),
+							TheSize + bytes - sz_rfbFramebufferUpdateRectHeader
+							);
+		
+	}
+	else // Normal case - No DSM - Symetry is not important
+	{
+		UINT bytes = m_encodemgr.EncodeRect(ScaledRect, m_socket);
+
+		// if (bytes == 0) return false; // From realvnc337. No! Causes viewer disconnections/
+
+		// Send the encoded data
+		return m_socket->SendExactQueue((char *)(m_encodemgr.GetClientBuffer()), bytes);
+	}
+
+	return true;
+}
+
+// Send a single CopyRect message
+BOOL
+vncClient::SendCopyRect(const rfb::Rect &dest, const rfb::Point &source)
+{
+	// Create the message header
+	// Modif sf at 2002 - Scaling
+	rfbFramebufferUpdateRectHeader copyrecthdr;
+	copyrecthdr.r.x = Swap16IfLE((dest.tl.x - m_SWOffsetx) / m_nScale );
+	copyrecthdr.r.y = Swap16IfLE((dest.tl.y - m_SWOffsety) / m_nScale);
+	copyrecthdr.r.w = Swap16IfLE((dest.br.x - dest.tl.x) / m_nScale);
+	copyrecthdr.r.h = Swap16IfLE((dest.br.y - dest.tl.y) / m_nScale);
+	copyrecthdr.encoding = Swap32IfLE(rfbEncodingCopyRect);
+
+	// Create the CopyRect-specific section
+	rfbCopyRect copyrectbody;
+	copyrectbody.srcX = Swap16IfLE((source.x- m_SWOffsetx) / m_nScale);
+	copyrectbody.srcY = Swap16IfLE((source.y- m_SWOffsety) / m_nScale);
+
+	// Now send the message;
+	if (!m_socket->SendExactQueue((char *)&copyrecthdr, sizeof(copyrecthdr)))
+		return FALSE;
+	if (!m_socket->SendExactQueue((char *)&copyrectbody, sizeof(copyrectbody)))
+		return FALSE;
+
+	return TRUE;
+}
+
+// Send the encoder-generated palette to the client
+// This function only returns FALSE if the SendExact fails - any other
+// error is coped with internally...
+BOOL
+vncClient::SendPalette()
+{
+	rfbSetColourMapEntriesMsg setcmap;
+	RGBQUAD *rgbquad;
+	UINT ncolours = 256;
+
+	// Reserve space for the colour data
+	rgbquad = new RGBQUAD[ncolours];
+	if (rgbquad == NULL)
+		return TRUE;
+					
+	// Get the data
+	if (!m_encodemgr.GetPalette(rgbquad, ncolours))
+	{
+		delete [] rgbquad;
+		return TRUE;
+	}
+
+	// Compose the message
+	setcmap.type = rfbSetColourMapEntries;
+	setcmap.firstColour = Swap16IfLE(0);
+	setcmap.nColours = Swap16IfLE(ncolours);
+
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+	if (!m_socket->SendExactQueue((char *) &setcmap, sz_rfbSetColourMapEntriesMsg, rfbSetColourMapEntries))
+	{
+		delete [] rgbquad;
+		return FALSE;
+	}
+
+	// Now send the actual colour data...
+	for (UINT i=0; i<ncolours; i++)
+	{
+		struct _PIXELDATA {
+			CARD16 r, g, b;
+		} pixeldata;
+
+		pixeldata.r = Swap16IfLE(((CARD16)rgbquad[i].rgbRed) << 8);
+		pixeldata.g = Swap16IfLE(((CARD16)rgbquad[i].rgbGreen) << 8);
+		pixeldata.b = Swap16IfLE(((CARD16)rgbquad[i].rgbBlue) << 8);
+
+		//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+		if (!m_socket->SendExactQueue((char *) &pixeldata, sizeof(pixeldata)))
+		{
+			delete [] rgbquad;
+			return FALSE;
+		}
+	}
+
+	// Delete the rgbquad data
+	delete [] rgbquad;
+
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+	m_socket->ClearQueue();
+
+	return TRUE;
+}
+
+void
+vncClient::SetSWOffset(int x,int y)
+{
+	//if (m_SWOffsetx!=x || m_SWOffsety!=y) m_encodemgr.m_buffer->ClearCache();
+	m_SWOffsetx=x;
+	m_SWOffsety=y;
+	m_encodemgr.SetSWOffset(x,y);
+}
+
+void
+vncClient::SetScreenOffset(int x,int y,int type)
+{
+	m_ScreenOffsetx=x;
+	m_ScreenOffsety=y;
+	m_display_type=type;
+}
+
+void
+vncClient::InitialUpdate(bool value)
+{
+	m_initial_update=value;
+}
+
+// CACHE RDV
+// Send a set of rectangles
+BOOL
+vncClient::SendCacheRectangles(const rfb::RectVector &rects)
+{
+//	rfb::Rect rect;
+	rfb::RectVector::const_iterator i;
+
+	if (rects.size() == 0) return TRUE;
+	vnclog.Print(LL_INTINFO, VNCLOG("******** Sending %d Cache Rects \r\n"), rects.size());
+
+	// Work through the list of rectangles, sending each one
+	for (i= rects.begin();i != rects.end();i++)
+	{
+		if (!SendCacheRect(*i))
+			return FALSE;
+	}
+
+	return TRUE;
+}
+
+// Tell the encoder to send a single rectangle
+BOOL
+vncClient::SendCacheRect(const rfb::Rect &dest)
+{
+	// Create the message header
+	// Modif rdv at 2002 - v1.1.x - Application Resize
+	// Modif sf at 2002 - Scaling
+	rfbFramebufferUpdateRectHeader cacherecthdr;
+	cacherecthdr.r.x = Swap16IfLE((dest.tl.x - m_SWOffsetx) / m_nScale );
+	cacherecthdr.r.y = Swap16IfLE((dest.tl.y - m_SWOffsety) / m_nScale);
+	cacherecthdr.r.w = Swap16IfLE((dest.br.x - dest.tl.x) / m_nScale);
+	cacherecthdr.r.h = Swap16IfLE((dest.br.y - dest.tl.y) / m_nScale);
+	cacherecthdr.encoding = Swap32IfLE(rfbEncodingCache);
+
+	totalraw+=(dest.br.x - dest.tl.x)*(dest.br.y - dest.tl.y)*32 / 8; // 32bit test
+	// Create the CopyRect-specific section
+	rfbCacheRect cacherectbody;
+	cacherectbody.special = Swap16IfLE(9999); //not used dummy
+
+	// Now send the message;
+	if (!m_socket->SendExactQueue((char *)&cacherecthdr, sizeof(cacherecthdr)))
+		return FALSE;
+	if (!m_socket->SendExactQueue((char *)&cacherectbody, sizeof(cacherectbody)))
+		return FALSE;
+	return TRUE;
+}
+
+BOOL
+vncClient::SendCursorShapeUpdate()
+{
+	m_cursor_update_pending = FALSE;
+
+	if (!m_encodemgr.SendCursorShape(m_socket)) {
+		m_cursor_update_sent = FALSE;
+		return m_encodemgr.SendEmptyCursorShape(m_socket);
+	}
+
+	m_cursor_update_sent = TRUE;
+	return TRUE;
+}
+
+BOOL
+vncClient::SendCursorPosUpdate()
+{
+	m_cursor_pos_changed = FALSE;
+
+	rfbFramebufferUpdateRectHeader hdr;
+	hdr.r.x = Swap16IfLE(m_cursor_pos.x);
+	hdr.r.y = Swap16IfLE(m_cursor_pos.y);
+	hdr.r.w = 0;
+	hdr.r.h = 0;
+	hdr.encoding = Swap32IfLE(rfbEncodingPointerPos);
+
+	if (!m_socket->SendExactQueue((char *)&hdr, sizeof(hdr)))
+		return FALSE;
+
+	return TRUE;
+}
+
+// Tight specific - Send LastRect marker indicating that there are no more rectangles to send
+BOOL
+vncClient::SendLastRect()
+{
+	// Create the message header
+	rfbFramebufferUpdateRectHeader hdr;
+	hdr.r.x = 0;
+	hdr.r.y = 0;
+	hdr.r.w = 0;
+	hdr.r.h = 0;
+	hdr.encoding = Swap32IfLE(rfbEncodingLastRect);
+
+	// Now send the message;
+	if (!m_socket->SendExactQueue((char *)&hdr, sizeof(hdr)))
+		return FALSE;
+
+	return TRUE;
+}
+
+
+//
+// sf at 2002 - New cache rects transport - Uses Zlib
+//
+// 
+BOOL vncClient::SendCacheZip(const rfb::RectVector &rects)
+{
+	//int totalCompDataLen = 0;
+
+	int nNbCacheRects = rects.size();
+	if (!nNbCacheRects) return true;
+	unsigned long rawDataSize = nNbCacheRects * sz_rfbRectangle;
+	unsigned long maxCompSize = (rawDataSize + (rawDataSize/100) + 8);
+
+	// Check RawCacheZipBuff
+	// create a space big enough for the Zlib encoded cache rects list
+	if (m_nRawCacheZipBufSize < rawDataSize)
+	{
+		if (m_pRawCacheZipBuf != NULL)
+		{
+			delete [] m_pRawCacheZipBuf;
+			m_pRawCacheZipBuf = NULL;
+		}
+		m_pRawCacheZipBuf = new BYTE [rawDataSize+1];
+		if (m_pRawCacheZipBuf == NULL) 
+			return false;
+		m_nRawCacheZipBufSize = rawDataSize;
+	}
+
+	// Copy all the cache rects coordinates into the RawCacheZip Buffer 
+	rfbRectangle theRect;
+	rfb::RectVector::const_iterator i;
+	BYTE* p = m_pRawCacheZipBuf;
+	for (i = rects.begin();i != rects.end();i++)
+	{
+		theRect.x = Swap16IfLE(((*i).tl.x - m_SWOffsetx) / m_nScale );
+		theRect.y = Swap16IfLE(((*i).tl.y - m_SWOffsety) / m_nScale);
+		theRect.w = Swap16IfLE(((*i).br.x - (*i).tl.x) / m_nScale);
+		theRect.h = Swap16IfLE(((*i).br.y - (*i).tl.y) / m_nScale);
+		memcpy(p, (BYTE*)&theRect, sz_rfbRectangle);
+		p += sz_rfbRectangle;
+	}
+
+	// Create a space big enough for the Zlib encoded cache rects list
+	if (m_nCacheZipBufSize < maxCompSize)
+	{
+		if (m_pCacheZipBuf != NULL)
+		{
+			delete [] m_pCacheZipBuf;
+			m_pCacheZipBuf = NULL;
+		}
+		m_pCacheZipBuf = new BYTE [maxCompSize+1];
+		if (m_pCacheZipBuf == NULL) return 0;
+		m_nCacheZipBufSize = maxCompSize;
+	}
+
+	int nRet = compress((unsigned char*)(m_pCacheZipBuf),
+						(unsigned long*)&maxCompSize,
+						(unsigned char*)m_pRawCacheZipBuf,
+						rawDataSize
+						);
+
+	if (nRet != 0)
+	{
+		return false;
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("*** Sending CacheZip Rects=%d Size=%d (%d)\r\n"), nNbCacheRects, maxCompSize, nNbCacheRects * 14);
+
+	// Send the Update Rect header
+	rfbFramebufferUpdateRectHeader CacheRectsHeader;
+	CacheRectsHeader.r.x = Swap16IfLE(nNbCacheRects);
+	CacheRectsHeader.r.y = 0;
+	CacheRectsHeader.r.w = 0;
+ 	CacheRectsHeader.r.h = 0;
+	CacheRectsHeader.encoding = Swap32IfLE(rfbEncodingCacheZip);
+
+	// Format the ZlibHeader
+	rfbZlibHeader CacheZipHeader;
+	CacheZipHeader.nBytes = Swap32IfLE(maxCompSize);
+
+	// Now send the message
+	if (!m_socket->SendExactQueue((char *)&CacheRectsHeader, sizeof(CacheRectsHeader)))
+		return FALSE;
+	if (!m_socket->SendExactQueue((char *)&CacheZipHeader, sizeof(CacheZipHeader)))
+		return FALSE;
+	if (!m_socket->SendExactQueue((char *)m_pCacheZipBuf, maxCompSize))
+		return FALSE;
+
+	return TRUE;
+}
+
+
+//
+//
+//
+void vncClient::EnableCache(BOOL enabled)
+{
+	m_encodemgr.EnableCache(enabled);
+}
+
+void vncClient::SetProtocolVersion(rfbProtocolVersionMsg *protocolMsg)
+{
+	if (protocolMsg!=NULL) memcpy(ProtocolVersionMsg,protocolMsg,sz_rfbProtocolVersionMsg);
+	else strcpy(ProtocolVersionMsg,"0.0.0.0");
+}
+
+void vncClient::Clear_Update_Tracker()
+{
+	m_update_tracker.clear();
+}
+
+void vncClient::TriggerUpdate()
+{
+	m_encodemgr.m_buffer->m_desktop->TriggerUpdate();
+}
+
+
+////////////////////////////////////////////////
+// Asynchronous & Delta File Transfer functions
+////////////////////////////////////////////////
+
+//
+// sf at 2004 - Delta Transfer
+// Create the checksums buffer of an open file
+//
+int vncClient::GenerateFileChecksums(HANDLE hFile, char* lpCSBuffer, int nCSBufferSize)
+{
+	bool fEof = false;
+	bool fError = false;
+	DWORD dwNbBytesRead = 0;
+	int nCSBufferOffset = 0;
+
+	char* lpBuffer = new char [sz_rfbBlockSize];
+	if (lpBuffer == NULL)
+		return -1;
+
+	while ( !fEof )
+	{
+		int nRes = ReadFile(hFile, lpBuffer, sz_rfbBlockSize, &dwNbBytesRead, NULL);
+		if (!nRes && dwNbBytesRead != 0)
+			fError = true;
+
+		if (nRes && dwNbBytesRead == 0)
+			fEof = true;
+		else
+		{
+			unsigned long cs = adler32(0L, Z_NULL, 0);
+			cs = adler32(cs, (unsigned char*)lpBuffer, (int)dwNbBytesRead);
+
+			memcpy(lpCSBuffer + nCSBufferOffset, &cs, 4);
+			nCSBufferOffset += 4; 
+		}
+	}
+
+	SetFilePointer(hFile, 0L, NULL, FILE_BEGIN); 
+	delete [] lpBuffer;
+
+	if (fError) 
+	{
+		return -1;
+	}
+
+	return nCSBufferOffset;
+
+}
+
+
+//
+// sf at 2004 - Delta Transfer
+// Destination file already exists
+// The server sends the checksums of this file in one shot.
+// 
+bool vncClient::ReceiveDestinationFileChecksums(int nSize, int nLen)
+{
+	if (nLen < 0 || nLen > 104857600) // 100 MBytes max
+		return false;
+
+	m_lpCSBuffer = new char [nLen+1];
+	if (m_lpCSBuffer == NULL) 
+	{
+		return false;
+	}
+
+	memset(m_lpCSBuffer, '\0', nLen+1);
+
+	VBool res = m_socket->ReadExact((char *)m_lpCSBuffer, nLen);
+	m_nCSBufferSize = nLen;
+
+	return res == VTrue;
+}
+
+//
+//
+//
+bool vncClient::ReceiveFileChunk(int nLen, int nSize)
+{
+    bool connected = true;
+	
+	if (!m_fFileDownloadRunning)
+		return  connected;
+
+	if (m_fFileDownloadError)
+	{
+		FinishFileReception();
+		return connected;
+	}
+
+	if (nLen < 0)
+		return false;
+
+	if (nLen > sz_rfbBlockSize) return connected;
+
+	bool fCompressed = true;
+	BOOL fRes = true;
+	bool fAlreadyHere = (nSize == 2);
+
+	// sf at 2004 - Delta Transfer - Empty packet
+	if (fAlreadyHere) 
+	{
+		DWORD dwPtr = SetFilePointer(m_hDestFile, nLen, NULL, FILE_CURRENT); 
+		if (dwPtr == 0xFFFFFFFF)
+			fRes = false;
+	}
+	else
+	{
+        connected = m_socket->ReadExact((char *)m_pBuff, nLen) == VTrue;
+		if (connected)
+		{
+			if (nSize == 0) fCompressed = false;
+			unsigned int nRawBytes = sz_rfbBlockSize;
+			
+			if (fCompressed)
+			{
+				// Decompress incoming data
+				int nRet = uncompress(	(unsigned char*)m_pCompBuff,	// Dest 
+										(unsigned long *)&nRawBytes, // Dest len
+										(const unsigned char*)m_pBuff,// Src
+										nLen	// Src len
+									);							
+				if (nRet != 0)
+				{
+					m_fFileDownloadError = true;
+					FinishFileReception();
+					return connected;
+				}
+			}
+
+			fRes = WriteFile(m_hDestFile,
+							fCompressed ? m_pCompBuff : m_pBuff,
+							fCompressed ? nRawBytes : nLen,
+							&m_dwNbBytesWritten,
+							NULL);
+		}
+		else
+		{
+			m_fFileDownloadError = true;
+			// FlushFileBuffers(m_client->m_hDestFile);
+			FinishFileReception();
+		}
+	}
+
+	if (!fRes)
+	{
+		// TODO : send an explicit error msg to the client...
+		m_fFileDownloadError = true;
+		FinishFileReception();
+		return connected;
+	}
+
+	m_dwTotalNbBytesWritten += (fAlreadyHere ? nLen : m_dwNbBytesWritten);
+	m_dwNbReceivedPackets++;
+
+	return connected;
+}
+
+
+void vncClient::FinishFileReception()
+{
+	if (!m_fFileDownloadRunning)
+		return;
+
+	m_fFileDownloadRunning = false;
+	m_socket->SetRecvTimeout(m_server->AutoIdleDisconnectTimeout()*1000);
+    SendKeepAlive(true);
+
+	// sf at 2004 - Delta transfer
+	SetEndOfFile(m_hDestFile);
+
+	// if error ?
+	FlushFileBuffers(m_hDestFile);
+
+	// Set the DestFile Time Stamp
+	if (strlen(m_szFileTime))
+	{
+		FILETIME DestFileTime;
+		SYSTEMTIME FileTime;
+		FileTime.wMonth  = atoi(m_szFileTime);
+		FileTime.wDay    = atoi(m_szFileTime + 3);
+		FileTime.wYear   = atoi(m_szFileTime + 6);
+		FileTime.wHour   = atoi(m_szFileTime + 11);
+		FileTime.wMinute = atoi(m_szFileTime + 14);
+		FileTime.wMilliseconds = 0;
+		FileTime.wSecond = 0;
+		SystemTimeToFileTime(&FileTime, &DestFileTime);
+		// ToDo: hook error
+		SetFileTime(m_hDestFile, &DestFileTime, &DestFileTime, &DestFileTime);
+	}
+
+	// CleanUp
+	helper::close_handle(m_hDestFile);
+
+	// sf at 2004 - Delta Transfer : we can keep the existing file data :)
+	// if (m_fFileDownloadError) DeleteFile(m_szFullDestName);
+
+	// sf at 2003 - Directory Transfer trick
+	// If the file is an Ultra Directory Zip we unzip it here and we delete the
+	// received file
+	// Todo: make a better free space check above in this particular case. The free space must be at least
+	// 3 times the size of the directory zip file (this zip file is ~50% of the real directory size) 
+	bool bWasDir = UnzipPossibleDirectory(m_szFullDestName);
+	/*
+	if (!m_fFileDownloadError && !strncmp(strrchr(m_szFullDestName, '\\') + 1, rfbZipDirectoryPrefix, strlen(rfbZipDirectoryPrefix)))
+	{
+		char szPath[MAX_PATH + MAX_PATH];
+		char szDirName[MAX_PATH]; // Todo: improve this (size) 
+		strcpy(szPath, m_szFullDestName);
+		// Todo: improve all this (p, p2, p3 NULL test or use a standard substring extraction function)
+		char *p = strrchr(szPath, '\\') + 1; 
+		char *p2 = strchr(p, '-') + 1; // rfbZipDirectoryPrefix MUST have a "-" at the end...
+		strcpy(szDirName, p2);
+		char *p3 = strrchr(szDirName, '.');
+		*p3 = '\0';
+		if (p != NULL) *p = '\0';
+		strcat(szPath, szDirName);
+
+		// Create the Directory
+		// BOOL fRet = CreateDirectory(szPath, NULL);
+		m_pZipUnZip->UnZipDirectory(szPath, m_szFullDestName);
+		DeleteFile(m_szFullDestName);
+	}
+	*/
+
+    if (m_fFileDownloadError && m_fUserAbortedFileTransfer)
+    {
+        SplitTransferredFileNameAndDate(m_szFullDestName, 0);
+        ::DeleteFile(m_szFullDestName);
+        FTDownloadCancelledHook();
+    }
+    else
+    {
+        std::string realName = get_real_filename(m_szFullDestName);
+        if (!m_fFileDownloadError && !bWasDir)
+            m_fFileDownloadError = !replaceFile(m_szFullDestName, realName.c_str());
+        if (m_fFileDownloadError)
+            FTDownloadFailureHook();
+        else
+            FTDownloadCompleteHook();
+    }
+	//delete [] m_szFullDestName;
+
+	if (m_pCompBuff != NULL)
+	{
+		delete [] m_pCompBuff;
+		m_pCompBuff = NULL;
+	}
+	if (m_pBuff != NULL)
+	{
+		delete [] m_pBuff;
+		m_pBuff = NULL;
+	}
+	if (m_lpCSBuffer)
+	{
+		delete [] m_lpCSBuffer;
+		m_lpCSBuffer = NULL;
+	}
+
+	return;
+}
+
+
+
+bool vncClient::SendFileChunk()
+{
+    bool connected = true;
+	omni_mutex_lock l(GetUpdateLock());
+
+	if (!m_fFileUploadRunning) return connected;
+	if ( m_fEof || m_fFileUploadError)
+	{
+		FinishFileSending();
+		return connected;
+	}
+
+	int nRes = ReadFile(m_hSrcFile, m_pBuff, sz_rfbBlockSize, &m_dwNbBytesRead, NULL);
+	if (!nRes && m_dwNbBytesRead != 0)
+	{
+		m_fFileUploadError = true;
+	}
+
+	if (nRes && m_dwNbBytesRead == 0)
+	{
+		m_fEof = true;
+	}
+	else
+	{
+		// sf at 2004 - Delta Transfer
+		bool fAlreadyThere = false;
+		unsigned long nCS = 0;
+		// if Checksums are available for this file
+		if (m_lpCSBuffer != NULL)
+		{
+			if (m_nCSOffset < m_nCSBufferSize)
+			{
+				memcpy(&nCS, &m_lpCSBuffer[m_nCSOffset], 4);
+				if (nCS != 0)
+				{
+					m_nCSOffset += 4;
+					unsigned long cs = adler32(0L, Z_NULL, 0);
+					cs = adler32(cs, (unsigned char*)m_pBuff, (int)m_dwNbBytesRead);
+					if (cs == nCS)
+						fAlreadyThere = true;
+				}
+			}
+		}
+
+		if (fAlreadyThere)
+		{
+			// Send the FileTransferMsg with empty rfbFilePacket
+			rfbFileTransferMsg ft;
+			ft.type = rfbFileTransfer;
+			ft.contentType = rfbFilePacket;
+			ft.size = Swap32IfLE(2); // Means "Empty packet"// Swap32IfLE(nCS); 
+			ft.length = Swap32IfLE(m_dwNbBytesRead);
+			m_socket->SendExact((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+		}
+		else
+		{
+			// Compress the data
+			// (Compressed data can be longer if it was already compressed)
+			unsigned int nMaxCompSize = sz_rfbBlockSize + 1024; // TODO: Improve this...
+			bool fCompressed = false;
+			if (m_fCompressionEnabled)
+			{
+				int nRetC = compress((unsigned char*)(m_pCompBuff),
+									(unsigned long *)&nMaxCompSize,	
+									(unsigned char*)m_pBuff,
+									m_dwNbBytesRead
+									);
+
+				if (nRetC != 0)
+				{
+					vnclog.Print(LL_INTINFO, VNCLOG("Compress returned error in File Send :%d\n"), nRetC);
+					// Todo: send data uncompressed instead
+					m_fFileUploadError = true;
+					FinishFileSending();
+					return connected;
+				}
+				fCompressed = true;
+			}
+
+			// Test if we have to deal with already compressed data
+			if (nMaxCompSize > m_dwNbBytesRead)
+				fCompressed = false;
+				// m_fCompressionEnabled = false;
+
+			rfbFileTransferMsg ft;
+
+			ft.type = rfbFileTransfer;
+			ft.contentType = rfbFilePacket;
+			ft.size = fCompressed ? Swap32IfLE(1) : Swap32IfLE(0); 
+			ft.length = fCompressed ? Swap32IfLE(nMaxCompSize) : Swap32IfLE(m_dwNbBytesRead);
+
+			//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+            connected = VFalse != m_socket->SendExactQueue((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+            if (connected) {
+			if (fCompressed)
+				connected = VFalse != m_socket->SendExact((char *)m_pCompBuff , nMaxCompSize);
+			else
+				connected = VFalse != m_socket->SendExact((char *)m_pBuff , m_dwNbBytesRead);
+			}
+            }
+		
+		m_dwTotalNbBytesRead += m_dwNbBytesRead;
+		// TODO : test on nb of bytes written
+	}
+					
+    if (connected)
+    {
+	// Order next asynchronous packet sending
+ 	PostToWinVNC( FileTransferSendPacketMessage, (WPARAM)this, (LPARAM)0);
+    }
+    return connected;
+}
+
+
+void vncClient::FinishFileSending()
+{
+	omni_mutex_lock l(GetUpdateLock());
+
+	if (!m_fFileUploadRunning)
+		return;
+
+    // restore original timeout
+	m_socket->SetSendTimeout(m_server->AutoIdleDisconnectTimeout()*1000);
+
+	m_fFileUploadRunning = false;
+
+	rfbFileTransferMsg ft;
+
+	// File Copy OK
+	if ( !m_fFileUploadError /*nRet == 1*/)
+	{
+		ft.type = rfbFileTransfer;
+		ft.contentType = rfbEndOfFile;
+		m_socket->SendExact((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+	}
+	else // Error in file copy
+	{
+		// TODO : send an error msg to the client...
+		ft.type = rfbFileTransfer;
+		ft.contentType = rfbAbortFileTransfer;
+		m_socket->SendExact((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+	}
+	
+	helper::close_handle(m_hSrcFile);
+	if (m_pBuff != NULL)
+	{
+		delete [] m_pBuff;
+		m_pBuff = NULL;
+	}
+	if (m_pCompBuff != NULL)
+	{
+		delete [] m_pCompBuff;
+		m_pCompBuff = NULL;
+	}
+
+	// sf at 2003 - Directory Transfer trick
+	// If the transfered file is a Directory zip, we delete it locally, whatever the result of the transfer
+	if (!strncmp(strrchr(m_szSrcFileName, '\\') + 1, rfbZipDirectoryPrefix, strlen(rfbZipDirectoryPrefix)))
+	{
+		char *p = strrchr(m_szSrcFileName, ',');
+		if (p != NULL) *p = '\0'; // Remove the time stamp we've added above from the file name
+		DeleteFile(m_szSrcFileName);
+	}
+    //  jdp 8/8/2008
+    if (m_fUserAbortedFileTransfer)
+        FTUploadCancelledHook();
+    else if (m_fFileUploadError)
+        FTUploadFailureHook();
+    else
+        FTUploadCompleteHook();
+
+}
+
+
+bool vncClient::GetSpecialFolderPath(int nId, char* szPath)
+{
+	LPITEMIDLIST pidl;
+    bool retval = false;
+
+    LPMALLOC pSHMalloc;
+
+    if (FAILED(SHGetMalloc(&pSHMalloc)))
+        return false;
+
+	if (SHGetSpecialFolderLocation(0, nId, &pidl) == NOERROR)
+    {
+        retval = SHGetPathFromIDList(pidl, szPath) ? true : false;
+
+        pSHMalloc->Free(pidl);
+    }
+
+    pSHMalloc->Release();
+
+	return retval;
+}
+
+//
+// Zip a possible directory
+//
+int vncClient::ZipPossibleDirectory(LPSTR szSrcFileName)
+{
+#ifndef ULTRAVNC_ITALC_SUPPORT
+//	vnclog.Print(0, _T("ZipPossibleDirectory\n"));
+	char* p1 = strrchr(szSrcFileName, '\\') + 1;
+	char* p2 = strrchr(szSrcFileName, rfbDirSuffix[0]);
+	if (
+		p1[0] == rfbDirPrefix[0] && p1[1] == rfbDirPrefix[1]  // Check dir prefix
+		&& p2[1] == rfbDirSuffix[1] && p2 != NULL && p1 < p2  // Check dir suffix
+		) //
+	{
+		// sf at 2004 - Improving Directory Transfer: Avoids ReadOnly media problem
+		char szDirZipPath[MAX_PATH];
+		char szWorkingDir[MAX_PATH];
+		::GetTempPath(MAX_PATH,szWorkingDir); //PGM Use Windows Temp folder
+		if (szWorkingDir == NULL) //PGM 
+		{ //PGM
+			if (GetModuleFileName(NULL, szWorkingDir, MAX_PATH))
+			{
+				char* p = strrchr(szWorkingDir, '\\');
+				if (p == NULL)
+					return -1;
+				*(p+1) = '\0';
+			}
+			else
+			{
+				return -1;
+			}
+		}//PGM
+
+		char szPath[MAX_PATH];
+		char szDirectoryName[MAX_PATH];
+		strcpy(szPath, szSrcFileName);
+		p1 = strrchr(szPath, '\\') + 1;
+		strcpy(szDirectoryName, p1 + 2); // Skip dir prefix (2 chars)
+		szDirectoryName[strlen(szDirectoryName) - 2] = '\0'; // Remove dir suffix (2 chars)
+		*p1 = '\0';
+        m_OrigSourceDirectoryName = std::string(szPath) + szDirectoryName;
+		if ((strlen(szPath) + strlen(rfbZipDirectoryPrefix) + strlen(szDirectoryName) + 4) > (MAX_PATH - 1)) return -1;
+		sprintf(szDirZipPath, "%s%s%s%s", szWorkingDir, rfbZipDirectoryPrefix, szDirectoryName, ".zip"); 
+		strcat(szPath, szDirectoryName);
+		strcpy(szDirectoryName, szPath);
+		if (strlen(szDirectoryName) > (MAX_PATH - 4)) return -1;
+		strcat(szDirectoryName, "\\*.*");
+		bool fZip = m_pZipUnZip->ZipDirectory(szPath, szDirectoryName, szDirZipPath, true);
+		if (!fZip) return -1;
+		strcpy(szSrcFileName, szDirZipPath);
+		return 1;
+	}
+	else
+#endif
+		return 0;
+}
+
+
+int vncClient::CheckAndZipDirectoryForChecksuming(LPSTR szSrcFileName)
+{
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	if (!m_fFileDownloadError 
+		&& 
+		!strncmp(strrchr(szSrcFileName, '\\') + 1, rfbZipDirectoryPrefix, strlen(rfbZipDirectoryPrefix))
+	   )
+	{
+		char szPath[MAX_PATH + MAX_PATH];
+		char szDirName[MAX_PATH];
+		char szDirectoryName[MAX_PATH * 2];
+		strcpy(szPath, szSrcFileName);
+		char *p = strrchr(szPath, '\\') + 1; 
+		char *p2 = strchr(p, '-') + 1;
+		strcpy(szDirName, p2);
+		char *p3 = strrchr(szDirName, '.');
+		*p3 = '\0';
+		if (p != NULL) *p = '\0';
+		strcat(szPath, szDirName);
+
+		int nRes = CreateDirectory(szPath, NULL);
+		DWORD err = GetLastError(); // debug
+		if (GetLastError() == ERROR_ALREADY_EXISTS)
+		{
+			strcpy(szDirectoryName, szPath);
+			// p = strrchr(szPath, '\\') + 1; 
+			// if (p != NULL) *p = '\0'; else return -1;
+			if (strlen(szDirectoryName) > (MAX_PATH - 4)) return -1;
+			strcat(szDirectoryName, "\\*.*");
+			bool fZip = m_pZipUnZip->ZipDirectory(szPath, szDirectoryName, szSrcFileName, true);
+			if (!fZip) return -1;
+		}
+
+	}		
+#endif
+	return 0;
+}
+
+//
+// Unzip possible directory
+// Todo: handle unzip error correctly...
+//
+bool vncClient::UnzipPossibleDirectory(LPSTR szFileName)
+{
+#ifndef ULTRAVNC_ITALC_SUPPORT
+//	vnclog.Print(0, _T("UnzipPossibleDirectory\n"));
+	if (!m_fFileDownloadError 
+		&& 
+		!strncmp(strrchr(szFileName, '\\') + 1, rfbZipDirectoryPrefix, strlen(rfbZipDirectoryPrefix))
+	   )
+	{
+		char szPath[MAX_PATH + MAX_PATH];
+		char szDirName[MAX_PATH]; // Todo: improve this (size) 
+		strcpy(szPath, szFileName);
+		// Todo: improve all this (p, p2, p3 NULL test or use a standard substring extraction function)
+		char *p = strrchr(szPath, '\\') + 1; 
+		char *p2 = strchr(p, '-') + 1; // rfbZipDirectoryPrefix MUST have a "-" at the end...
+		strcpy(szDirName, p2);
+		char *p3 = strrchr(szDirName, '.');
+		*p3 = '\0';
+		if (p != NULL) *p = '\0';
+		strcat(szPath, szDirName);
+		// Create the Directory
+		bool fUnzip = m_pZipUnZip->UnZipDirectory(szPath, szFileName);
+		DeleteFile(szFileName);
+        return true;
+	}						
+#endif
+	return false;
+}
+
+
+//
+// GetFileSize() doesn't handle files > 4GBytes...
+// GetFileSizeEx() doesn't exist under Win9x...
+// So let's write our own function.
+// 
+bool vncClient::MyGetFileSize(char* szFilePath, ULARGE_INTEGER *n2FileSize)
+{
+	WIN32_FIND_DATA fd;
+	HANDLE ff;
+
+    DWORD errmode = SetErrorMode(SEM_FAILCRITICALERRORS); // No popup please !
+	ff = FindFirstFile(szFilePath, &fd);
+	SetErrorMode( errmode );
+
+	if (ff == INVALID_HANDLE_VALUE)
+	{
+		return false;
+	}
+
+	FindClose(ff);
+
+	(*n2FileSize).LowPart = fd.nFileSizeLow;
+	(*n2FileSize).HighPart = fd.nFileSizeHigh;
+	(*n2FileSize).QuadPart = (((__int64)fd.nFileSizeHigh) << 32 ) + fd.nFileSizeLow;
+	
+	return true;
+}
+
+
+bool vncClient::DoFTUserImpersonation()
+{
+	vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - Call\n"));
+	omni_mutex_lock l(GetUpdateLock());
+
+	if (m_fFileDownloadRunning) return true;
+	if (m_fFileUploadRunning) return true;
+	if (m_fFTUserImpersonatedOk) return true;
+    // if we're already impersonating the user and have a session open, do nothing.
+    if (m_fFileSessionOpen && m_fFTUserImpersonatedOk)
+        return true;
+
+	vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - 1\n"));
+	bool fUserOk = true;
+
+	if (vncService::IsWSLocked())
+	{
+		m_fFTUserImpersonatedOk = false;
+		vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - WSLocked\n"));
+		return false;
+	}
+
+	char username[UNLEN+1];
+	vncService::CurrentUser((char *)&username, sizeof(username));
+	vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - currentUser = %s\n"), username);
+	if (strcmp(username, "") != 0)
+	{
+		// sf at 2007 - New method to achieve FTUserImpersonation - Still needs to be further tested...
+		HANDLE hProcess, hPToken;
+		DWORD pid = GetExplorerLogonPid();
+		if (pid != 0) 
+		{
+			hProcess = OpenProcess(MAXIMUM_ALLOWED, FALSE, pid);
+			if (!OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+									|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+									|TOKEN_READ|TOKEN_WRITE,&hPToken
+								 )
+			) 
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - OpenProcessToken Error\n"));
+				fUserOk = false;
+			}
+			else
+			{
+				if (!ImpersonateLoggedOnUser(hPToken))
+				{
+					vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - ImpersonateLoggedOnUser Failed\n"));
+					fUserOk = false;
+				}
+			}
+
+			CloseHandle(hProcess);
+			CloseHandle(hPToken);
+		}
+		
+		/* Old method
+		// Modif Byteboon (Jeremy C.) - Impersonnation
+		if (m_server->m_impersonationtoken)
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - Impersonationtoken exists\n"));
+			HANDLE newToken;
+			if (DuplicateToken(m_server->m_impersonationtoken, SecurityImpersonation, &newToken))
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - DuplicateToken ok\n"));
+				if(!ImpersonateLoggedOnUser(newToken))
+				{
+					vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - failed to impersonate [%d]\n"),GetLastError());
+					fUserOk = false;
+				}
+				CloseHandle(newToken);
+			}
+			else
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - DuplicateToken FAILEDk\n"));
+				fUserOk = false;
+			}
+		}
+		else
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::DoFTUserImpersonation - No impersonationtoken\n"));
+			fUserOk = false;
+		}
+		*/
+		
+		if (!vncService::RunningAsService())
+			fUserOk = true;
+	}
+	else
+	{
+		fUserOk = false;
+	}
+
+	if (fUserOk)
+		m_lLastFTUserImpersonationTime = timeGetTime();
+
+	m_fFTUserImpersonatedOk = fUserOk;
+
+	return fUserOk;
+			
+}
+
+
+void vncClient::UndoFTUserImpersonation()
+{
+	//vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::UNDoFTUserImpersonation - Call\n"));
+	//moved to after returns, Is this lock realy needed if no revert is done ?
+	//
+	//omni_mutex_lock l(GetUpdateLock());
+
+	if (!m_fFTUserImpersonatedOk) return;
+	if (m_fFileDownloadRunning) return;
+	if (m_fFileUploadRunning) return;
+    if (m_fFileSessionOpen) return;
+
+	vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::UNDoFTUserImpersonation - 1\n"));
+	DWORD lTime = timeGetTime();
+	if (lTime - m_lLastFTUserImpersonationTime < 10000) return;
+	omni_mutex_lock l(GetUpdateLock());
+	vnclog.Print(LL_INTERR, VNCLOG("%%%%%%%%%%%%% vncClient::UNDoFTUserImpersonation - Impersonationtoken exists\n"));
+	RevertToSelf();
+	m_fFTUserImpersonatedOk = false;
+}
+
+// 10 April 2008 jdp paquette at atnetsend.net
+// This can crash as we can not send middle in an update...
+
+void vncClient::Record_SendServerStateUpdate(CARD32 state, CARD32 value)
+{
+    m_state=state;
+	m_value=value;
+	m_want_update_state=true;
+#ifdef _DEBUG
+					char			szText[256];
+					sprintf(szText,"Record_SendServerStateUpdate %i %i  \n",m_state,m_value);
+					OutputDebugString(szText);		
+#endif
+}
+
+void vncClient::SendServerStateUpdate(CARD32 state, CARD32 value)
+{
+    if (m_wants_ServerStateUpdates && m_socket)
+    {
+        // send message to client
+		rfbServerStateMsg rsmsg;
+        memset(&rsmsg, 0, sizeof rsmsg);
+		rsmsg.type = rfbServerState;
+		rsmsg.state  = Swap32IfLE(state);
+		rsmsg.value = Swap32IfLE(value);
+
+		m_socket->SendExact((char*)&rsmsg, sz_rfbServerStateMsg, rfbServerState);
+    }
+}
+
+void vncClient::SendKeepAlive(bool bForce)
+{
+    if (m_wants_KeepAlive && m_socket)
+    {
+		//adzm 2010-08-01
+		DWORD nInterval = (DWORD)m_server->GetKeepAliveInterval() * 1000;
+		DWORD nTicksSinceLastSent = GetTickCount() - m_socket->GetLastSentTick();
+
+        if (!bForce && nTicksSinceLastSent < nInterval)
+            return;
+
+        rfbKeepAliveMsg kp;
+        memset(&kp, 0, sizeof kp);
+        kp.type = rfbKeepAlive;
+
+		m_socket->SendExact((char*)&kp, sz_rfbKeepAliveMsg, rfbKeepAlive);
+    }
+}
+
+void vncClient::SendFTProtocolMsg()
+{
+    rfbFileTransferMsg ft;
+    memset(&ft, 0, sizeof ft);
+    ft.type = rfbFileTransfer;
+    ft.contentType = rfbFileTransferProtocolVersion;
+    ft.contentParam = FT_PROTO_VERSION_3;
+    m_socket->SendExact((char *)&ft, sz_rfbFileTransferMsg, rfbFileTransfer);
+
+}
+
+// adzm - 2010-07 - Extended clipboard
+void vncClient::NotifyExtendedClipboardSupport()
+{	
+	ExtendedClipboardDataMessage extendedDataMessage;
+	m_clipboard.settings.PrepareCapsPacket(extendedDataMessage);
+
+	rfbServerCutTextMsg msg;
+    memset(&msg, 0, sizeof(rfbServerCutTextMsg));
+	msg.type = rfbServerCutText;
+	msg.length = Swap32IfLE(-extendedDataMessage.GetDataLength());
+
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+	m_socket->SendExactQueue((char *)&msg, sz_rfbServerCutTextMsg, rfbServerCutText);
+	m_socket->SendExact((char *)(extendedDataMessage.GetData()), extendedDataMessage.GetDataLength());
+}
+
+// adzm 2010-09 - Notify streaming DSM plugin support
+void vncClient::NotifyPluginStreamingSupport()
+{	
+	rfbNotifyPluginStreamingMsg msg;
+    memset(&msg, 0, sizeof(rfbNotifyPluginStreamingMsg));
+	msg.type = rfbNotifyPluginStreaming;
+
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+	m_socket->SendExact((char *)&msg, sz_rfbNotifyPluginStreamingMsg, rfbNotifyPluginStreaming);
+	m_socket->SetPluginStreamingOut();
+}
diff --git a/ica/win32/winvnc/winvnc/vncclient.h b/ica/win32/winvnc/winvnc/vncclient.h
new file mode 100644
index 0000000..7c414ba
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncclient.h
@@ -0,0 +1,605 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncClient.h
+
+// vncClient class handles the following functions:
+// - Recieves requests from the connected client and
+//   handles them
+// - Handles incoming updates properly, using a vncBuffer
+//   object to keep track of screen changes
+// It uses a vncBuffer and is passed the vncDesktop and
+// vncServer to communicate with.
+
+class vncClient;
+typedef SHORT vncClientId;
+
+#if (!defined(_WINVNC_VNCCLIENT))
+#define _WINVNC_VNCCLIENT
+#ifndef __GNUC__
+#pragma warning(disable : 4786)
+#endif
+
+#include <list>
+#include <string>
+#include <vector>
+#include <algorithm>
+#include "common/win32_helpers.h"
+
+typedef std::list<vncClientId> vncClientList;
+
+// Includes
+#include "stdhdrs.h"
+#include "vsocket.h"
+#include <omnithread.h>
+
+// Custom
+#include "vncdesktop.h"
+#include "rfbRegion.h"
+#include "rfbUpdateTracker.h"
+#include "vncbuffer.h"
+#include "vncencodemgr.h"
+#include "TextChat.h" // sf at 2002 - TextChat
+//#include "timer.h"
+// adzm - 2010-07 - Extended clipboard
+#include "common/Clipboard.h"
+
+// The vncClient class itself
+typedef UINT (WINAPI *pSendinput)(UINT,LPINPUT,INT);
+#define SPI_GETMOUSESPEED         0x0070
+#define SPI_SETMOUSESPEED         0x0071
+#define MOUSEEVENTF_VIRTUALDESK	  0x4000
+
+class vncClientUpdateThread;
+
+#define FT_PROTO_VERSION_OLD 1  // <= RC18 server.. "fOldFTPRotocole" version
+#define FT_PROTO_VERSION_2   2  // base ft protocol
+#define FT_PROTO_VERSION_3   3  // new ft protocol session messages
+
+
+
+extern int CheckUserGroupPasswordUni(char * userin,char *password,const char *machine);
+
+using namespace rfb;
+
+class vncClient
+{
+public:
+	// Constructor/destructor
+	vncClient();
+	~vncClient();
+
+	// Allow the client thread to see inside the client object
+	friend class vncClientThread;
+	friend class vncClientUpdateThread;
+
+	// Init
+	virtual BOOL Init(vncServer *server,
+						VSocket *socket,
+						BOOL auth,
+						BOOL shared,
+						vncClientId newid);
+
+	// Kill
+	// The server uses this to close the client socket, causing the
+	// client thread to fail, which in turn deletes the client object
+	virtual void Kill();
+
+	// Client manipulation functions for use by the server
+	virtual void SetBuffer(vncBuffer *buffer);
+
+	// Update handling functions
+	// These all lock the UpdateLock themselves
+	virtual void UpdateMouse();
+	//virtual void UpdateClipText(const char* text);
+	// adzm - 2010-07 - Extended clipboard
+	virtual void UpdateClipTextEx(ClipboardData& clipboardData, CARD32 overrideFlags = 0);
+	virtual void UpdatePalette(bool lock);
+	virtual void UpdateLocalFormat(bool lock);
+
+	// Is the client waiting on an update?
+	// YES IFF there is an incremental update region,
+	//     AND no changed or copied updates intersect it
+	virtual BOOL UpdateWanted() {
+		omni_mutex_lock l(GetUpdateLock());
+/*#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText," UpdateWanted %i \n",!m_incr_rgn.is_empty() &&
+											m_incr_rgn.intersect(m_update_tracker.get_changed_region()).is_empty() &&
+											m_incr_rgn.intersect(m_update_tracker.get_cached_region()).is_empty() &&
+											m_incr_rgn.intersect(m_update_tracker.get_copied_region()).is_empty());
+										OutputDebugString(szText);		
+#endif*/
+		return  !m_incr_rgn.is_empty() &&
+			m_incr_rgn.intersect(m_update_tracker.get_changed_region()).is_empty() &&
+			m_incr_rgn.intersect(m_update_tracker.get_cached_region()).is_empty() &&
+			m_incr_rgn.intersect(m_update_tracker.get_copied_region()).is_empty();
+
+	};
+
+	// Has the client sent an input event?
+	virtual BOOL RemoteEventReceived() {
+		BOOL result = m_remoteevent;
+		m_remoteevent = FALSE;
+		return result;
+	};
+
+	// The UpdateLock
+	// This must be held for a number of routines to be successfully invoked...
+	virtual omni_mutex& GetUpdateLock() {return m_encodemgr.GetUpdateLock();};
+
+	// Functions for setting & getting the client settings
+	virtual void EnableKeyboard(BOOL enable) {m_keyboardenabled = enable;};
+	virtual void EnablePointer(BOOL enable) {m_pointerenabled = enable;};
+	virtual void EnableJap(bool enable) {m_jap = enable;};
+	virtual void SetCapability(int capability) {m_capability = capability;};
+
+	virtual int GetCapability() {return m_capability;};
+	virtual const char *GetClientName();
+	virtual vncClientId GetClientId() {return m_id;};
+
+	// Disable/enable protocol messages to the client
+	virtual void DisableProtocol();
+	virtual void EnableProtocol();
+	virtual void DisableProtocol_no_mutex();
+	virtual void EnableProtocol_no_mutex();
+	// resize desktop
+	virtual BOOL SetNewSWSize(long w,long h,BOOL desktop);
+	virtual BOOL SetNewSWSizeFR(long w,long h,BOOL desktop);
+	virtual void SetSWOffset(int x,int y);
+	virtual void SetScreenOffset(int x,int y,int type);
+	virtual void InitialUpdate(bool value);
+
+	virtual TextChat* GetTextChatPointer() { return m_pTextChat; }; // sf at 2002
+	virtual void SetUltraViewer(bool fTrue) { m_fUltraViewer = fTrue;};
+	virtual bool IsUltraViewer() { return m_fUltraViewer;};
+
+	virtual void EnableCache(BOOL enabled);
+
+
+	// sf at 2002
+	virtual void SetConnectTime(long lTime) {m_lConnectTime = lTime;};
+	virtual long GetConnectTime() {return m_lConnectTime;};
+	virtual bool IsSlowEncoding() {return m_encodemgr.IsSlowEncoding();};
+	virtual bool IsUltraEncoding() {return m_encodemgr.IsUltraEncoding();};
+	virtual bool IsFileTransBusy(){return (m_fFileUploadRunning||m_fFileDownloadRunning || m_fFileSessionOpen);};
+	void SetProtocolVersion(rfbProtocolVersionMsg *protocolMsg);
+	void Clear_Update_Tracker();
+	void TriggerUpdate();
+	void UpdateCursorShape();
+
+	// adzm 2009-07-05 - repeater IDs
+	void SetRepeaterID(char* szid)
+	{
+		if (m_szRepeaterID) {
+			free(m_szRepeaterID);
+		}
+
+		m_szRepeaterID = NULL;
+
+		if (szid != NULL && strlen(szid) > 0) {
+			m_szRepeaterID = _strdup(szid);
+		}
+	};
+	char* GetRepeaterID() {return m_szRepeaterID;};
+
+	// adzm 2009-08-02
+	void SetHost(char* szHost)
+	{
+		if (m_szHost) {
+			free(m_szHost);
+		}
+
+		m_szHost = NULL;
+
+		if (szHost != NULL && strlen(szHost) > 0) {
+			m_szHost = _strdup(szHost);
+		}
+	};
+	char* GetHost() {return m_szHost;};
+
+	void SetHostPort(int port) {
+		m_hostPort = port;
+	};
+	int GetHostPort() {
+		return m_hostPort;
+	};
+
+	// sf at 2004 - Asynchronous FileTransfer - Delta Transfer
+	int  GenerateFileChecksums(HANDLE hFile, char* lpCSBuffer, int nCSBufferSize);
+	bool ReceiveDestinationFileChecksums(int nSize, int nLen);
+	bool ReceiveFileChunk(int nLen, int nSize);
+	void FinishFileReception();
+	bool SendFileChunk();
+	void FinishFileSending();
+	bool GetSpecialFolderPath(int nId, char* szPath);
+	int  ZipPossibleDirectory(LPSTR szSrcFileName);
+	int  CheckAndZipDirectoryForChecksuming(LPSTR szSrcFileName);
+	bool  UnzipPossibleDirectory(LPSTR szFileName);
+	bool MyGetFileSize(char* szFilePath, ULARGE_INTEGER* n2FileSize);
+	bool DoFTUserImpersonation();
+	void UndoFTUserImpersonation();
+
+    // jdp at 2008 - File Transfer event hooks
+    void FTUploadStartHook();
+    void FTUploadCancelledHook();
+    void FTUploadFailureHook();
+    void FTUploadCompleteHook();
+
+    void FTDownloadStartHook();
+    void FTDownloadCancelledHook();
+    void FTDownloadFailureHook();
+    void FTDownloadCompleteHook();
+
+    void FTNewFolderHook(std::string name);
+    void FTDeleteHook(std::string name, bool isDir);
+    void FTRenameHook(std::string oldName, std::string newname);
+    void SendServerStateUpdate(CARD32 state, CARD32 value);
+	void Record_SendServerStateUpdate(CARD32 state, CARD32 value);
+    void SendKeepAlive(bool bForce = false);
+    void SendFTProtocolMsg();
+	// adzm - 2010-07 - Extended clipboard
+	void NotifyExtendedClipboardSupport();
+	// adzm 2010-09 - Notify streaming DSM plugin support
+	void NotifyPluginStreamingSupport();
+
+	// sf at 2002 
+	// Update routines
+protected:
+	BOOL SendUpdate(rfb::SimpleUpdateTracker &update);
+	BOOL SendRFBMsg(CARD8 type, BYTE *buffer, int buflen);
+	//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+	BOOL SendRFBMsgQueue(CARD8 type, BYTE *buffer, int buflen);
+	BOOL SendRectangles(const rfb::RectVector &rects);
+	BOOL SendRectangle(const rfb::Rect &rect);
+	BOOL SendCopyRect(const rfb::Rect &dest, const rfb::Point &source);
+	BOOL SendPalette();
+	// CACHE
+	BOOL SendCacheRectangles(const rfb::RectVector &rects);
+	BOOL SendCacheRect(const rfb::Rect &dest);
+	BOOL SendCacheZip(const rfb::RectVector &rects); // sf at 2002
+
+	// Tight - CURSOR HANDLING
+	BOOL SendCursorShapeUpdate();
+	// nyama/marscha - PointerPos
+	BOOL SendCursorPosUpdate();
+	BOOL SendLastRect(); // Tight
+
+	void TriggerUpdateThread();
+
+	void PollWindow(HWND hwnd);
+
+
+	CARD32 m_state;
+	CARD32 m_value;
+	bool m_want_update_state; 
+	int unlockcounter;
+
+
+	// Specialised client-side UpdateTracker
+protected:
+
+	// This update tracker stores updates it receives and
+	// kicks the client update thread every time one is received
+
+	class ClientUpdateTracker : public rfb::SimpleUpdateTracker {
+	public:
+		ClientUpdateTracker() : m_client(0) {};
+		virtual ~ClientUpdateTracker() {};
+
+		void init(vncClient *client) {m_client=client;}
+
+		virtual void add_changed(const rfb::Region2D &region) {
+			{
+				// RealVNC 336 change - omni_mutex_lock l(m_client->GetUpdateLock());
+				SimpleUpdateTracker::add_changed(region);
+				m_client->TriggerUpdateThread();
+			}
+		}
+		virtual void add_cached(const rfb::Region2D &region) {
+			{
+				// RealVNC 336 change - omni_mutex_lock l(m_client->GetUpdateLock());
+				SimpleUpdateTracker::add_cached(region);
+				m_client->TriggerUpdateThread();
+			}
+		}
+		
+		virtual void add_copied(const rfb::Region2D &dest, const rfb::Point &delta) {
+			{
+				// RealVNC 336 change - omni_mutex_lock l(m_client->GetUpdateLock());
+				SimpleUpdateTracker::add_copied(dest, delta);
+				m_client->TriggerUpdateThread();
+			}
+		}
+
+		virtual void clear() {
+			// RealVNC 336 change - omni_mutex_lock l(m_client->GetUpdateLock());
+			SimpleUpdateTracker::clear();
+		}
+
+		virtual void flush_update(rfb::UpdateInfo &info, const rfb::Region2D &cliprgn) {;
+			// RealVNC 336 change - omni_mutex_lock l(m_client->GetUpdateLock());
+			SimpleUpdateTracker::flush_update(info, cliprgn);
+		}
+		virtual void flush_update(rfb::UpdateTracker &to, const rfb::Region2D &cliprgn) {;
+			// RealVNC 336 change - omni_mutex_lock l(m_client->GetUpdateLock());
+			SimpleUpdateTracker::flush_update(to, cliprgn);
+		}
+
+		virtual void get_update(rfb::UpdateInfo &info) const {;
+			// RealVNC 336 change - omni_mutex_lock l(m_client->GetUpdateLock());
+			SimpleUpdateTracker::get_update(info);
+		}
+		virtual void get_update(rfb::UpdateTracker &to) const {
+			// RealVNC 336 change - omni_mutex_lock l(m_client->GetUpdateLock());
+			SimpleUpdateTracker::get_update(to);
+		}
+
+		virtual bool is_empty() const{
+			// RealVNC 336 change -  omni_mutex_lock l(m_client->GetUpdateLock());
+			return SimpleUpdateTracker::is_empty();
+		}
+	protected:
+		vncClient *m_client;
+	};
+
+	friend class ClientUpdateTracker;
+
+	// Make the update tracker available externally
+public:
+
+	rfb::UpdateTracker &GetUpdateTracker() {return m_update_tracker;};
+	int				m_SWOffsetx;
+	int				m_SWOffsety;
+	int				m_ScreenOffsetx;
+	int				m_ScreenOffsety;
+	int				m_display_type;
+	BOOL			m_NewSWUpdateWaiting;
+	rfbProtocolVersionMsg ProtocolVersionMsg;
+	//Timer Sendtimer;
+	//int roundrobin_counter;
+	//int timearray[rfbEncodingZRLE+1][31];
+	//int sizearray[rfbEncodingZRLE+1][31];
+	//int Totalsend;
+	BOOL client_settings_passed;
+	bool		m_Autoreconnect;
+
+	// Internal stuffs
+protected:
+	// Per-client settings
+	BOOL			m_IsLoopback;
+	BOOL			m_keyboardenabled;
+	BOOL			m_pointerenabled;
+	bool			m_jap;
+	int				m_capability;
+	vncClientId		m_id;
+	long			m_lConnectTime;
+
+	// Pixel translation & encoding handler
+	vncEncodeMgr	m_encodemgr;
+
+	// The server
+	vncServer		*m_server;
+
+	// The socket
+	VSocket			*m_socket;
+	char			*m_client_name;
+
+	// The client thread
+	omni_thread		*m_thread;
+
+	// adzm 2009-07-05
+	char*			m_szRepeaterID;
+	// adzm 2009-08-02
+	char*			m_szHost;
+	int				m_hostPort;
+
+
+	// Count to indicate whether updates, clipboards, etc can be sent
+	// to the client.  If 0 then OK, otherwise not.
+	ULONG			m_disable_protocol;
+
+	// User input information
+	rfb::Rect		m_oldmousepos;
+	BOOL			m_mousemoved;
+	rfbPointerEventMsg	m_ptrevent;
+	// vncKeymap		m_keymap;
+
+	// Update tracking structures
+	ClientUpdateTracker	m_update_tracker;
+
+	// Client update transmission thread
+	vncClientUpdateThread *m_updatethread;
+
+	// Requested update region & requested flag
+	rfb::Region2D	m_incr_rgn;
+
+	// Full screen rectangle
+//	rfb::Rect		m_fullscreen;
+
+	// When the local display is palettized, it sometimes changes...
+	BOOL			m_palettechanged;
+
+	// Information used in polling mode!
+	BOOL			m_remoteevent;
+
+	// Clipboard data
+	//char*			m_clipboard_text;
+	Clipboard		m_clipboard;
+
+	//SINGLE WINDOW
+	BOOL			m_use_NewSWSize;
+	BOOL			m_NewSWDesktop;
+	int				NewsizeW;
+	int				NewsizeH;
+
+	// CURSOR HANDLING
+	BOOL			m_cursor_update_pending;
+	BOOL			m_cursor_update_sent;
+	// nyama/marscha - PointerPos
+	BOOL			m_cursor_pos_changed;
+	BOOL			m_use_PointerPos;
+	POINT			m_cursor_pos;
+
+	// Modif sf at 2002 - FileTransfer 
+	BOOL m_fFileTransferRunning;
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	CZipUnZip32		*m_pZipUnZip;
+#endif
+
+	char  m_szFullDestName[MAX_PATH + 64];
+	char  m_szFileTime[18];
+	char* m_pBuff;
+	char* m_pCompBuff;
+	HANDLE m_hDestFile;
+	DWORD m_dwFileSize; 
+	DWORD m_dwNbPackets;
+	DWORD m_dwNbReceivedPackets;
+	DWORD m_dwNbBytesWritten;
+	DWORD m_dwTotalNbBytesWritten;
+	bool m_fFileDownloadError;
+	bool m_fFileDownloadRunning;
+    bool m_fFileSessionOpen;
+
+    // 8 April 2008 jdp
+    bool m_fUserAbortedFileTransfer;
+	char m_szSrcFileName[MAX_PATH + 64]; // Path + timestring
+	HANDLE m_hSrcFile;
+	bool m_fEof;
+	DWORD m_dwNbBytesRead;
+	DWORD m_dwTotalNbBytesRead;
+	int m_nPacketCount;
+	bool m_fCompressionEnabled;
+	bool m_fFileUploadError;
+	bool m_fFileUploadRunning;
+
+	// sf at 2004 - Delta Transfer
+	char*	m_lpCSBuffer;
+	int		m_nCSOffset;
+	int		m_nCSBufferSize;
+
+	// Modif sf at 2002 - Scaling
+	rfb::Rect		m_ScaledScreen;
+	UINT			m_nScale;
+	UINT			m_nScale_viewer;
+	bool			fNewScale;
+	bool			m_fPalmVNCScaling;
+	bool			fFTRequest;
+
+	// sf at 2002 
+	BYTE* m_pCacheZipBuf;
+	unsigned int m_nCacheZipBufSize;
+	BYTE* m_pRawCacheZipBuf;
+	unsigned int m_nRawCacheZipBufSize;
+
+	friend class TextChat; 
+	TextChat *m_pTextChat;	// Modif sf at 2002 - Text Chat
+
+	bool m_fUltraViewer; // sf at 2002 
+
+	// sf at 2005 - FTUserImpersonation
+	bool m_fFTUserImpersonatedOk;
+	DWORD m_lLastFTUserImpersonationTime;
+
+	//stats
+	int totalraw;
+
+    helper::DynamicFn<pSendinput> Sendinput;
+	// Modif cs at 2005
+#ifdef DSHOW
+	HANDLE m_hmtxEncodeAccess;
+#endif
+
+    std::string m_OrigSourceDirectoryName;
+    bool        m_wants_ServerStateUpdates;
+    bool        m_bClientHasBlockedInput;
+	bool		m_Support_rfbSetServerInput;
+    bool        m_wants_KeepAlive;
+	bool		m_session_supported;
+	bool		m_initial_update;
+};
+
+
+// vncClient thread class
+
+class vncClientThread : public omni_thread
+{
+public:
+
+	// Init
+	virtual BOOL Init(vncClient *client,
+		vncServer *server,
+		VSocket *socket,
+		BOOL auth,
+		BOOL shared);
+
+	// Sub-Init routines
+	virtual BOOL InitVersion();
+	virtual BOOL InitAuthenticate();
+	virtual BOOL AuthenticateClient(std::vector<CARD8>& current_auth);
+	virtual BOOL AuthenticateLegacyClient();
+
+	BOOL AuthSecureVNCPlugin(std::string& auth_message); // must SetHandshakeComplete after sending auth result!
+	BOOL AuthMsLogon(std::string& auth_message);
+	BOOL AuthVnc(std::string& auth_message);
+	BOOL AuthSCPrompt(std::string& auth_message); // adzm 2010-10
+	BOOL AuthSessionSelect(std::string& auth_message); // adzm 2010-10
+
+	BOOL FilterClients_Blacklist();
+	BOOL FilterClients_Ask_Permission();
+	BOOL CheckEmptyPasswd();
+	BOOL CheckLoopBack();
+	void LogAuthResult(bool success);
+	void SendConnFailed(const char* szMessage);
+
+	// adzm 2010-08
+	virtual bool InitSocket();
+	virtual bool TryReconnect();
+
+	// The main thread function
+	virtual void run(void *arg);
+	bool m_autoreconnectcounter_quit;
+
+	UINT m_AutoReconnectPort;
+	char m_szAutoReconnectAdr[255];
+	char m_szAutoReconnectId[MAX_PATH];
+
+protected:
+	virtual ~vncClientThread();
+
+	// Fields
+protected:
+	VSocket *m_socket;
+	vncServer *m_server;
+	vncClient *m_client;
+	BOOL m_auth;
+	BOOL m_shared;
+	BOOL m_ms_logon;
+	int m_major;
+	int m_minor;
+};
+#endif
diff --git a/ica/win32/winvnc/winvnc/vncconndialog.cpp b/ica/win32/winvnc/winvnc/vncconndialog.cpp
new file mode 100644
index 0000000..8cc8f13
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncconndialog.cpp
@@ -0,0 +1,402 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncConnDialog.cpp: implementation of the vncConnDialog class, used
+// to forge outgoing connections to VNC-viewer 
+
+#include "stdhdrs.h"
+#include "vncconndialog.h"
+#include "winvnc.h"
+
+#include "resource.h"
+#include "common/win32_helpers.h"
+
+#include <ctype.h>
+
+#include "Localization.h" // ACT : Add localization on messages
+
+//	[v1.0.2-jp1 fix] Load resouce from dll
+extern HINSTANCE	hInstResDLL;
+extern BOOL SPECIAL_SC_PROMPT;
+
+// Constructor
+
+vncConnDialog::vncConnDialog(vncServer *server)
+{
+	m_server = server;
+	m_hicon = NULL;
+	m_hfont = NULL;
+}
+
+// Destructor
+
+vncConnDialog::~vncConnDialog()
+{
+}
+
+// Routine called to activate the dialog and, once it's done, delete it
+
+INT_PTR vncConnDialog::DoDialog()
+{
+	//	[v1.0.2-jp1 fix]
+	//DialogBoxParam(hAppInstance, MAKEINTRESOURCE(IDD_OUTGOING_CONN), 	
+	//adzm 2009-06-20 - Return the result
+	INT_PTR nResult = DialogBoxParam(hInstResDLL, MAKEINTRESOURCE(IDD_OUTGOING_CONN), 
+		NULL, (DLGPROC) vncConnDlgProc, (LONG_PTR) this);
+	delete this;
+	return nResult;
+}
+
+// Callback function - handles messages sent to the dialog box
+
+BOOL CALLBACK vncConnDialog::vncConnDlgProc(HWND hwnd,
+											UINT uMsg,
+											WPARAM wParam,
+											LPARAM lParam) {
+	// This is a static method, so we don't know which instantiation we're 
+	// dealing with. But we can get a pseudo-this from the parameter to 
+	// WM_INITDIALOG, which we therafter store with the window and retrieve
+	// as follows:
+     vncConnDialog *_this = helper::SafeGetWindowUserData<vncConnDialog>(hwnd);
+
+	switch (uMsg) {
+	case WM_PAINT:
+		{
+			//adzm 2009-06-20
+			if (GetUpdateRect(hwnd, NULL, TRUE)) {
+				PAINTSTRUCT ps;
+				HDC hdc = BeginPaint(hwnd, &ps);
+
+				{
+					RECT rcIcon;
+					rcIcon.top = 0;
+					rcIcon.left = 0;
+					rcIcon.bottom = 48;
+					rcIcon.right = 48;
+					
+					RECT rcClient;
+					if (GetClientRect(hwnd, &rcClient)) {
+						int nDifference = (rcClient.bottom - rcIcon.bottom) / 2;
+						if (nDifference > 0) {
+							rcIcon.top += nDifference;
+							rcIcon.bottom += nDifference;
+						}
+					}
+
+					RECT rcLabel;
+					HWND hwndLabel = GetDlgItem(hwnd, IDC_CONNECTION_NUMBER_STATIC);
+					if (GetWindowRect(hwndLabel, &rcLabel)) {
+						LPRECT lprcLabel = &rcLabel;
+						ScreenToClient(hwnd, (LPPOINT)lprcLabel);
+						ScreenToClient(hwnd, ((LPPOINT)lprcLabel)+1);
+
+						int nAdjustment = (rcLabel.left - rcIcon.right) / 2;
+
+						rcIcon.left += nAdjustment;
+						rcIcon.right += nAdjustment;
+					}
+
+					RECT rcIntersect;
+
+					if (IntersectRect(&rcIntersect, &rcIcon, &(ps.rcPaint))) {
+						if (_this->m_hicon == NULL) {
+							_this->m_hicon = (HICON)LoadImage(hInstResDLL, MAKEINTRESOURCE(IDI_WINVNC), IMAGE_ICON,
+							   48, 48, 0);
+						}
+						if (_this->m_hicon) {
+							HBRUSH hbr = (HBRUSH)SendMessage(hwnd, WM_CTLCOLORDLG, (WPARAM)hdc, (WPARAM)hwnd);
+							DrawIconEx(hdc, rcIcon.left, rcIcon.top, _this->m_hicon, 48, 48, 0, hbr, DI_NORMAL);
+						}
+					}
+				}
+
+				EndPaint(hwnd, &ps);
+			}
+
+			return 0;
+		}
+
+		// Dialog has just been created
+	case WM_INITDIALOG:
+		{
+			// Save the lParam into our user data so that subsequent calls have
+			// access to the parent C++ object
+            helper::SafeSetWindowUserData(hwnd, lParam);
+
+            vncConnDialog *_this = (vncConnDialog *) lParam;
+
+			//adzm 2009-06-20
+			if (g_szRepeaterHost) {
+				SetDlgItemText(hwnd, IDC_HOSTNAME_EDIT, g_szRepeaterHost);
+
+				//adzm 2009-06-20
+				if (SPECIAL_SC_PROMPT) {
+					HWND hwndChild = GetDlgItem(hwnd, IDC_HOSTNAME_EDIT);
+					if (hwndChild) {
+						ShowWindow(hwndChild, SW_HIDE);
+					}
+					hwndChild = GetDlgItem(hwnd, IDC_HOSTNAME_STATIC);
+					if (hwndChild) {
+						ShowWindow(hwndChild, SW_HIDE);
+					}
+
+					HWND hwndEdit = GetDlgItem(hwnd, IDC_IDCODE);
+					HWND hwndLabel = GetDlgItem(hwnd, IDC_CONNECTION_NUMBER_STATIC);
+
+					RECT rcEdit;
+					RECT rcLabel;
+					GetWindowRect(hwndEdit, &rcEdit);
+					GetWindowRect(hwndLabel, &rcLabel);
+
+					LPRECT lprcEdit = &rcEdit;
+					LPRECT lprcLabel = &rcLabel;
+
+					ScreenToClient(hwnd, (LPPOINT)lprcEdit);
+					ScreenToClient(hwnd, ((LPPOINT)lprcEdit)+1);
+					
+					ScreenToClient(hwnd, (LPPOINT)lprcLabel);
+					ScreenToClient(hwnd, ((LPPOINT)lprcLabel)+1);
+
+					RECT rcClient;
+					GetClientRect(hwnd, &rcClient);
+
+					long nTotalHeight = rcEdit.bottom - rcLabel.top;
+
+					long nAdjustedTop = (rcClient.bottom - nTotalHeight) / 2;
+
+					long nAdjustment = nAdjustedTop - rcLabel.top;
+
+					MoveWindow(hwndLabel, rcLabel.left, rcLabel.top + nAdjustment, rcLabel.right - rcLabel.left, rcLabel.bottom - rcLabel.top, TRUE);
+					MoveWindow(hwndEdit, rcEdit.left, rcEdit.top + nAdjustment, rcEdit.right - rcEdit.left, rcEdit.bottom - rcEdit.top, TRUE);
+
+					HWND hwndCaption = GetDlgItem(hwnd, IDC_CAPTION_STATIC);
+					HFONT hFont = (HFONT)SendMessage(hwndCaption, WM_GETFONT, 0, 0);
+					if (hFont) {
+						LOGFONT lf;
+						if (GetObject(hFont, sizeof(LOGFONT), &lf)) {
+							lf.lfWidth = 0;
+							lf.lfHeight = (lf.lfHeight * 6) / 4;
+
+							_this->m_hfont = CreateFontIndirect(&lf);
+
+							if (_this->m_hfont) {
+								SendMessage(hwndCaption, WM_SETFONT, (WPARAM)_this->m_hfont, (LPARAM)TRUE);
+							}
+						}
+					}
+					SetWindowText(hwndCaption, "Connect to Technical Support");
+					ShowWindow(hwndCaption, SW_SHOWNA);
+				}
+
+				SetFocus(GetDlgItem(hwnd, IDC_IDCODE));
+			} else {            
+				// Make the text entry box active
+				SetFocus(GetDlgItem(hwnd, IDC_HOSTNAME_EDIT));
+			}
+			
+			SetForegroundWindow(hwnd);
+			
+            // Return success!
+			return TRUE;
+		}
+
+		// Dialog has just received a command
+	case WM_COMMAND:
+		switch (LOWORD(wParam))
+		{
+			// User clicked OK or pressed return
+		case IDOK:
+		{
+			// sf at 2002 - host:num & host::num analyse.
+			// Compatible with both RealVNC and TightVNC methods
+			char hostname[_MAX_PATH];
+			char actualhostname[_MAX_PATH];
+			char idcode[_MAX_PATH];
+			char *portp;
+			int port;
+			bool id;
+
+			// Get the hostname of the VNCviewer
+			GetDlgItemText(hwnd, IDC_HOSTNAME_EDIT, hostname, _MAX_PATH);
+			GetDlgItemText(hwnd, IDC_IDCODE, idcode, _MAX_PATH);
+			if (strcmp(idcode,"")==0) id=false;
+			else id=true;
+
+			strcpy(actualhostname, hostname);
+			
+			//adzm 2010-02-15 - Multiple repeaters chosen by modulo of ID
+
+			char finalidcode[_MAX_PATH];
+			//adzm 2010-08 - this was sending uninitialized data over the wire
+			ZeroMemory(finalidcode, sizeof(finalidcode));
+
+			//adzm 2009-06-20
+			if (id) {
+				size_t i = 0;
+
+				for (i = 0; i < strlen(idcode); i++)
+				{
+					finalidcode[i] = toupper(idcode[i]);
+				} 
+				finalidcode[i] = 0;
+
+				if (0 != strncmp("ID:", idcode, 3)) {
+					strcpy(finalidcode, "ID:");
+					
+					for (i = 0; i < strlen(idcode); i++)
+					{
+						finalidcode[i+3] = toupper(idcode[i]);
+					} 
+					finalidcode[i+3] = 0;
+				}
+
+				
+				//adzm 2010-02-15 - At this point, finalidcode is of the form "ID:#####"
+				int numericId = atoi(finalidcode + 3);
+
+				int numberOfHosts = 1;
+				for (i = 0; i < strlen(hostname); i++) {
+					if (hostname[i] == ';') {
+						numberOfHosts++;
+					}
+				}
+
+				if (numberOfHosts <= 1) {
+					// then hostname == actualhostname
+				} else {
+					int modulo = numericId % numberOfHosts;
+
+					char* szToken = strtok(hostname, ";");
+					while (szToken) {
+						if (modulo == 0) {
+							strcpy(actualhostname, szToken);
+							break;
+						}
+
+						modulo--;
+						szToken = strtok(NULL, ";");
+					}
+				}
+			}
+
+			// Calculate the Display and Port offset.
+			port = INCOMING_PORT_OFFSET;
+			portp = strchr(actualhostname, ':');
+			if (portp)
+			{
+				*portp++ = '\0';
+				if (*portp == ':') // Tight127 method
+				{
+					port = atoi(++portp);		// Port number after "::"
+				}
+				else // RealVNC method
+				{
+					if (atoi(portp) < 100)		// If < 100 after ":" -> display number
+						port += atoi(portp);
+					else
+						port = atoi(portp);	    // If > 100 after ":" -> Port number
+				}
+			}
+
+
+			
+			// Attempt to create a new socket
+			VSocket *tmpsock;
+			tmpsock = new VSocket;
+			if (!tmpsock) {
+				return TRUE;
+			}
+			
+			// Connect out to the specified host on the VNCviewer listen port
+			// To be really good, we should allow a display number here but
+			// for now we'll just assume we're connecting to display zero
+			tmpsock->Create();
+			if (tmpsock->Connect(actualhostname, port))
+			{
+				if (id) 
+					{							
+						
+
+						tmpsock->Send(finalidcode,250);
+						tmpsock->SetTimeout(0);
+/*						if (strncmp(hostname,"ID",2)!=0)
+						{
+						while (true)
+						{
+							char result[1];
+							tmpsock->Read(result,1);
+							if (strcmp(result,"2")==0)
+								break;
+							tmpsock->Send("1",1);
+						}
+						}*/
+						
+						// adzm 2009-07-05 - repeater IDs
+						// Add the new client to this server
+						// adzm 2009-08-02
+						_this->m_server->AddClient(tmpsock, TRUE, TRUE, 0, NULL, finalidcode, actualhostname, port);
+					} else {
+						// Add the new client to this server
+						// adzm 2009-08-02
+						_this->m_server->AddClient(tmpsock, TRUE, TRUE, 0, NULL, NULL, actualhostname, port);				
+					}
+				// And close the dialog
+				EndDialog(hwnd, TRUE);
+			}
+			else
+			{
+				// Print up an error message
+				MessageBoxSecure(NULL, 
+					sz_ID_FAILED_CONNECT_LISTING_VIEW,
+					sz_ID_OUTGOING_CONNECTION,
+					MB_OK | MB_ICONEXCLAMATION );
+				delete tmpsock;
+			}
+			return TRUE;
+		}
+		
+			// Cancel the dialog
+		case IDCANCEL:
+			EndDialog(hwnd, FALSE);
+			return TRUE;
+		};
+
+		break;
+
+	case WM_DESTROY:
+		EndDialog(hwnd, FALSE);
+		if (_this->m_hicon != NULL) {
+			DestroyIcon(_this->m_hicon);
+			_this->m_hicon = NULL;
+		}
+		if (_this->m_hfont != NULL) {
+			DeleteObject(_this->m_hfont);
+			_this->m_hfont = NULL;
+		}
+		return TRUE;
+	}
+	return 0;
+}
+
diff --git a/ica/win32/winvnc/winvnc/vncconndialog.h b/ica/win32/winvnc/winvnc/vncconndialog.h
new file mode 100644
index 0000000..878b3fc
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncconndialog.h
@@ -0,0 +1,69 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+class vncConnDialog;
+
+#if (!defined(_WINVNC_VNCCONNDIALOG))
+#define _WINVNC_VNCCONNDIALOG
+
+#pragma once
+
+#include "vncserver.h"
+
+// Outgoing connection dialog.  This allows people running VNC servers on
+// Win32 platforms to _push_ their displays out to other people's screens
+// rather than having to _pull_ them across.
+
+class vncConnDialog  
+{
+public:
+
+	// Create an outgoing-connection dialog
+	vncConnDialog(vncServer *server);
+
+	// Destructor
+	virtual ~vncConnDialog();
+
+	// Once a dialog object is created, either delete it again, or
+	// call DoDialog.  DoDialog will run the object and delete it when done
+	//adzm 2009-06-20 - Return the result
+	INT_PTR DoDialog();
+
+	// Internal stuffs
+private:
+
+	// Routine to call when a dialog event occurs
+	static BOOL CALLBACK vncConnDlgProc(HWND hwndDlg,
+										UINT uMsg, 
+										WPARAM wParam,
+										LPARAM lParam);
+
+	// Pointer back to the server object
+	vncServer *m_server;
+
+	//adzm 2009-06-20
+	HICON m_hicon;
+	HFONT m_hfont;
+};
+
+#endif
diff --git a/ica/win32/winvnc/winvnc/vncdesktop.cpp b/ica/win32/winvnc/winvnc/vncdesktop.cpp
new file mode 100644
index 0000000..62d1dba
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncdesktop.cpp
@@ -0,0 +1,2459 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+// vncDesktop implementation
+
+// System headers
+#include <assert.h>
+#include "stdhdrs.h"
+
+// Custom headers
+//#include <WinAble.h>
+#include <omnithread.h>
+#include "winvnc.h"
+#include "vnchooks/VNCHooks.h"
+#include "vncserver.h"
+#include "vnckeymap.h"
+#include "rfbRegion.h"
+#include "rfbRect.h"
+#include "vncdesktop.h"
+#include "vncservice.h"
+// Modif rdv at 2002 - v1.1.x - videodriver
+#include "vncOSVersion.h"
+
+#include "mmsystem.h" // sf at 2002
+#include "TextChat.h" // sf at 2002
+#include "vncdesktopthread.h"
+#include "common/win32_helpers.h"
+#include <algorithm>
+#include <commctrl.h>
+
+
+
+// Constants
+const UINT RFB_SCREEN_UPDATE = RegisterWindowMessage("WinVNC.Update.DrawRect");
+const UINT RFB_COPYRECT_UPDATE = RegisterWindowMessage("WinVNC.Update.CopyRect");
+const UINT RFB_MOUSE_UPDATE = RegisterWindowMessage("WinVNC.Update.Mouse");
+const char szDesktopSink[] = "WinVNC desktop sink";
+
+bool g_Desktop_running;
+extern bool g_DesktopThread_running;
+extern bool g_update_triggered;
+DWORD WINAPI BlackWindow(LPVOID lpParam);
+
+//
+// // Modif sf at 2002 - v1.1.0 - Optimization
+//
+// Here we try to speed up the Poll FullScreen function.
+// Instead of adding the entire Rect to cached region,
+// we divide it in 32/32 pixels blocks and only scan the top-left
+// pixel of each block.
+// If a pixel has changed, we find the smallest window containing this pixel
+// and add the Window rect to the cached region
+//
+// This function is supposed to be a good compromise between
+// speed and efficiency.
+// The accuracy has been greatly improved and it now detects very
+// small changes on screen that are not detected by the Hooks.
+// This new accuracy is obtained by shifting the detection grid 
+// in diagonale (the function works with several grids that are tested 
+// alternatively). There's probably still room for improvements...
+//
+// NB: Changes generated by applications using hardware acceleration 
+// won't be detected (In order to see a video played on the server using
+// Media Player, the vncviewer user must desactivate "Hardware accelation"
+// in the Media Player options). 
+// 
+// 
+//
+ extern bool G_USE_PIXEL;
+PixelCaptureEngine::~PixelCaptureEngine()
+{
+}
+
+PixelCaptureEngine::PixelCaptureEngine()
+	{
+		if (OSversion()==2) m_bIsVista=true;
+		else 
+			m_bIsVista=false;
+/*		if (G_USE_PIXEL)
+			m_bIsVista=false;*/
+	}
+void
+PixelCaptureEngine::PixelCaptureEngineInit(HDC rootdc, HDC memdc, HBITMAP membitmap, bool bCaptureAlpha, void *dibbits, int bpp, int bpr)
+	{
+		m_hmemdc=memdc;
+		m_membitmap=membitmap;
+		m_oldbitmap=0;
+		m_DIBbits=dibbits;
+		m_bCaptureAlpha=bCaptureAlpha;
+		m_hrootdc=rootdc;
+		m_bytesPerPixel=bpp;
+		m_bytesPerRow=bpr;
+	}
+
+bool
+PixelCaptureEngine::CaptureRect(const rfb::Rect& rect)
+	{
+		if (m_bIsVista)
+		{
+				m_rect = rect;
+				if ((m_oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)
+					return false;
+
+				// Capture screen into bitmap
+				BOOL blitok = BitBlt(m_hmemdc, 0, 0, rect.width(), rect.height(), m_hrootdc, rect.tl.x, rect.tl.y, 
+									 m_bCaptureAlpha ? (CAPTUREBLT | SRCCOPY) : SRCCOPY);
+				return blitok ? true : false;
+		}
+		return true;
+	}
+
+COLORREF
+PixelCaptureEngine::CapturePixel(int x, int y)
+	{
+		if (m_bIsVista)
+		{
+				COLORREF cr = 0;
+				unsigned int index = (m_bytesPerRow * y) + (m_bytesPerPixel * x);
+				memcpy(&cr, ((char*)m_DIBbits)+index, m_bytesPerPixel);
+
+				return cr;
+		}
+		else
+		{
+
+				COLORREF cr=0;		
+				cr=GetPixel(m_hrootdc, x, y);
+				return cr;
+		}
+	}
+
+void
+PixelCaptureEngine::ReleaseCapture()
+	{
+		// Select the old bitmap back into the memory DC
+	if (m_bIsVista) 
+		{
+				SelectObject(m_hmemdc, m_oldbitmap);
+				m_oldbitmap = 0;
+		}
+	}
+
+
+bool vncDesktop::FastDetectChanges(rfb::Region2D &rgn, rfb::Rect &rect, int nZone, bool fTurbo)
+{
+	bool returnvalue=false;
+	bool fInitGrid = false;
+	bool fIncCycle = false;
+	// For more accuracy, we could use 24 or even 16
+	const int PIXEL_BLOCK_SIZE  = 32; // Pixels Grid definition
+	const int GRID_OFFSET = 4;  // Pixels Grid shifting during cycle (in pixels)
+								// The number of grid per zone is PIXEL_BLOCK_SIZE/GRID_OFFSET (must be int !)
+	int x, y;
+	int xo, yo;
+	// WindowsList lWList;
+	WindowsList::iterator iWindow;
+
+	// In turbo mode, we clear the list of windows at each iteration -> Lot of updates because 
+	//  the same windows can be detected several times during a complete cycle
+	// (To avoid this pb, we must update all the grids at the same coordinate when a pixel of 
+	// one grid has changed -> later)
+	// Otherwise we only clear it each time the Grid cycle loops -> Less updates, less framerate,
+	// less CPU, less bandwidth
+	if (fTurbo || (m_nGridCycle == 0))
+		m_lWList.clear();
+
+	// Create all the Grids (for all the 5 zones (4 quarter screens + 1 full screen)
+	// Actually, the quarter screens are not utilized in v1.1.0 but it does not
+	// generate any overhead neither additionnal memory consumption (see below)
+	if (m_lGridsList.empty())
+	{
+		for (int i = 0; i < (5 * PIXEL_BLOCK_SIZE / GRID_OFFSET); i++)
+		{
+			RGBPixelList *pList = new RGBPixelList;
+			pList->reserve((rect.height() / PIXEL_BLOCK_SIZE) * (rect.width() / PIXEL_BLOCK_SIZE));
+			if (pList != NULL)
+			{
+				m_lGridsList.push_back(pList);
+			    vnclog.Print(LL_INTINFO, VNCLOG("### PixelsGrid %d created !\n"), i);
+			}
+		}
+
+		hDeskWnd = GetDesktopWindow();
+		HWND hWnd = FindWindow(_T("Progman"), _T("Program Manager"));
+		if (NULL != hWnd) hWnd = FindWindowEx(hWnd, NULL, "SHELLDLL_DefView", "");
+		if (NULL != hWnd) hWnd = FindWindowEx(hWnd, NULL, "SysListView32", "FolderView");
+		hFolderView=hWnd;
+		if (NULL != hWnd)
+			{
+			nr_rects = SendMessage(hWnd, LVM_GETITEMCOUNT, 0, 0);
+			if (nr_rects>200) nr_rects=200;
+			for (int j = 0; j < nr_rects; j++)
+                {
+					DWORD pid;
+					GetWindowThreadProcessId(hWnd, &pid);
+					HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
+					RECT* ptritemrect;
+					RECT itemrect;
+					ptritemrect = (RECT*)VirtualAllocEx(hProcess, NULL, sizeof(RECT), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
+					if (ptritemrect == NULL) {
+					   
+					} else {
+					SendMessage(hWnd, LVM_GETITEMRECT, j, (LPARAM)ptritemrect);
+#ifdef _X64
+					SIZE_T copied = 0;
+#else
+					DWORD copied = 0;
+#endif
+					ReadProcessMemory(hProcess, (void*)ptritemrect, (LPVOID)&itemrect, sizeof(itemrect), &copied);
+					rfb::Rect wrect = rfb::Rect(itemrect).intersect(m_Cliprect);
+					iconregion.assign_union(wrect);
+					VirtualFreeEx(hProcess, ptritemrect, 0, MEM_RELEASE);
+					}
+				}
+			}
+
+	}
+
+	PixelEngine.PixelCaptureEngineInit(m_hrootdc, m_hmemdc, m_membitmap, m_fCaptureAlphaBlending && !m_Black_window_active, 
+		                           m_DIBbits, m_scrinfo.format.bitsPerPixel / 8, m_bytesPerRow);
+	// We test one zone at a time 
+	// vnclog.Print(LL_INTINFO, VNCLOG("### Polling Grid %d - SubGrid %d\n"), nZone, m_nGridCycle); 
+	GridsList::iterator iGrid;
+	int nGridPos = (nZone * PIXEL_BLOCK_SIZE / GRID_OFFSET) + m_nGridCycle;
+
+	iGrid = m_lGridsList.begin();
+    std::advance(iGrid, nGridPos);
+
+	RGBPixelList *pThePixelGrid  =  *iGrid;
+	RGBPixelList::iterator iPixelColor =  pThePixelGrid->begin();
+
+	if (nZone == 0 || nZone == 4)
+	{
+	   // vnclog.Print(LL_INTINFO, VNCLOG("### IncCycle Please !\n")); 
+	   fIncCycle = true;
+	}
+
+	if (pThePixelGrid->empty())
+	{
+		// vnclog.Print(LL_INTINFO, VNCLOG("### PixelsGrid Init\n"));
+		fInitGrid = true;
+	}
+
+	int nOffset = GRID_OFFSET * m_nGridCycle;
+
+
+
+	PixelEngine.CaptureRect(rect);
+	if (PixelEngine.m_bIsVista) returnvalue=true;
+	// Try to detect if screen is almost idle
+	// no need to poll static screens very fast, it only use cpu
+	change_found=0;
+	// We walk our way through the Grids
+	for (y = rect.tl.y; y < (rect.br.y -nOffset -1) ; y += PIXEL_BLOCK_SIZE)
+	{
+		yo = y + nOffset;
+
+		for (x = rect.tl.x; x < (rect.br.x -nOffset); x += PIXEL_BLOCK_SIZE)
+		{
+			xo = x + nOffset;
+			bool AlreadyInRegion=rgn.IsPtInRegion(xo,yo);
+			// Read the pixel's color on the screen
+			COLORREF PixelColor = 0;
+			//if (!AlreadyInRegion || fInitGrid ) 
+				PixelColor =PixelEngine.CapturePixel(xo, yo);
+
+			// If init list
+			if (fInitGrid)
+			{
+				int off = iPixelColor - pThePixelGrid->begin();
+			   pThePixelGrid->push_back(PixelColor);
+				iPixelColor = pThePixelGrid->begin() + off;
+			   // vnclog.Print(LL_INTINFO, VNCLOG("### PixelsGrid Init : Pixel xo=%d - yo=%d - C=%ld\n"), xo, yo, (long)PixelColor); 
+			   continue;
+			}
+
+//			vnclog.Print(LL_INTINFO, VNCLOG("### GetPixel %i\n"),OSversion());
+			// If the pixel has changed
+			if (*iPixelColor != PixelColor)
+			{
+				change_found=1;
+				// Save the new Pixel in the list
+				*iPixelColor = PixelColor;
+				if (!AlreadyInRegion)
+				{
+				// Then find the corresponding Window
+				POINT point;
+				RECT rect;
+
+				point.x = xo;
+				point.y = yo;
+
+				// Find the smallest, non-hidden, non-disabled Window containing this pixel
+				// REM: We don't use ChildWindowFromPoint because we don't want of hidden windows
+				HWND hwnd = WindowFromPoint(point);
+
+				/// This is the fulldesktop, cause a full scan performance !
+				if (hFolderView == hwnd && hFolderView)
+				{
+					if (iconregion.IsPtInRegion(xo,yo))rgn.assign_union(iconregion);
+					else
+					{
+							rect.left=xo-PIXEL_BLOCK_SIZE-m_ScreenOffsetx;
+							rect.right=xo+PIXEL_BLOCK_SIZE-m_ScreenOffsetx;
+							rect.top=yo-PIXEL_BLOCK_SIZE-m_ScreenOffsetx;
+							rect.bottom=yo+PIXEL_BLOCK_SIZE-m_ScreenOffsetx;
+							rfb::Rect wrect = rfb::Rect(rect).intersect(m_Cliprect);
+							if (!wrect.is_empty())
+							{
+								rgn.assign_union(wrect);
+							}
+					}
+				}
+				// Look if we've already detected this window
+				if (hwnd != hDeskWnd  && hFolderView != hwnd)
+				{
+					
+					// Look if we've already detected this window
+					if (std::find(m_lWList.begin(), m_lWList.end(), hwnd) == m_lWList.end())
+					{			    
+						// Add the corresponding rect to the cache region 
+						if (GetWindowRect(hwnd, &rect))
+							{
+								//Buffer coordinates
+								rect.left-=m_ScreenOffsetx;
+								rect.right-=m_ScreenOffsetx;
+								rect.top-=m_ScreenOffsety;
+								rect.bottom-=m_ScreenOffsety;
+								rfb::Rect wrect = rfb::Rect(rect).intersect(m_Cliprect);
+								if (!wrect.is_empty())
+									{
+/*#ifdef _DEBUG
+					char			szText[256];
+					DWORD error=GetLastError();
+					sprintf(szText,"CheckRect 222222 ++++++++++++++++ %i %i %i %i  \n",wrect.tl.x,wrect.br.x,wrect.tl.y,wrect.br.y);
+					SetLastError(0);
+					OutputDebugString(szText);		
+#endif*/
+										rgn.assign_union(wrect);
+										m_lWList.insert(hwnd);
+									}
+							}
+					}
+				}
+			}
+			}
+
+			++iPixelColor; // Next PixelColor in the list
+		}
+	}
+	PixelEngine.ReleaseCapture();
+	///////////////////////
+	// We coun the number of idle detects
+	// after x time, force some timeout
+	if (change_found)
+	{
+		idle_counter=0;
+	}
+	else
+	{
+		idle_counter=idle_counter+5;
+	}
+	if (idle_counter>20) 
+	{
+		//Beep(100,idle_counter);
+		Sleep (idle_counter);
+	}
+	// 250 increased to 500, possible even 1000 will still have a good reaction time
+	if (idle_counter>1000) idle_counter=1000;
+	///////////////////////
+
+	if (fIncCycle)
+	{
+	   m_nGridCycle = (m_nGridCycle + 1) % (PIXEL_BLOCK_SIZE / GRID_OFFSET);
+	}
+	return returnvalue;
+}
+
+
+
+
+// Implementation
+
+vncDesktop::vncDesktop()
+{
+	m_thread = NULL;
+#ifdef AVILOG
+	AviGen=NULL;
+#endif
+	m_Black_window_active=false;
+	m_hwnd = NULL;
+	//m_timerid = 0;
+	// adzm - 2010-07 - Fix clipboard hangs
+	m_settingClipboardViewer = false;
+	m_hnextviewer = NULL;
+	m_hcursor = NULL;
+	m_hOldcursor = NULL; // sf at 2002
+
+	m_displaychanged = FALSE;
+	m_update_triggered = FALSE;
+	g_update_triggered = FALSE;
+
+	m_hrootdc = NULL;
+	m_hmemdc = NULL;
+	m_membitmap = NULL;
+
+	// adzm - 2010-07 - Fix clipboard hangs
+	//m_initialClipBoardSeen = FALSE;
+
+	m_foreground_window = NULL;
+
+	// Vars for Will Dean's DIBsection patch
+	m_DIBbits = NULL;
+	m_formatmunged = FALSE;
+
+	m_clipboard_active = FALSE;
+
+	m_pollingcycle = 0;
+
+	// Modif sf at 2002 - v1.1.0 
+	m_lWList.clear();
+    m_lGridsList.clear();
+	m_nGridCycle = 0;
+
+	// Modif sf at 2002 - v1.1.0
+	// m_lLastTempo = 0L;
+	m_lLastMouseUpdateTime = 0L;
+	m_lLastSlowClientTestTime = timeGetTime();
+
+	// sf at 2002 - TextChat - No more used for now
+	// m_fTextChatRunning = false;
+	// m_pCurrentTextChat = NULL;
+
+	// Modif rdv at 2002 - v1.1.x - videodriver
+	m_videodriver=NULL;
+	m_ScreenOffsetx=0;
+	m_ScreenOffsety=0;
+	m_hookdriver=false;
+
+	OldPowerOffTimeout=0;
+
+	On_Off_hookdll=false;
+	g_Desktop_running=true;
+	hUser32=LoadLibrary("USER32");
+	if (hUser32) pbi = (pBlockInput)GetProcAddress( hUser32, "BlockInput");
+	m_OrigpollingSet=false;
+	m_Origpolling=false;
+	DriverWantedSet=false;
+	can_be_hooked=false;
+
+	multi_monitor=true;
+    m_bIsInputDisabledByClient = false;
+	m_input_desktop = 0;
+	m_home_desktop = 0;
+	idle_counter=0;
+	trigger_events[0]=CreateEvent(NULL,TRUE,FALSE,"timer");
+	trigger_events[1]=CreateEvent(NULL,TRUE,FALSE,"screenupdate");
+	trigger_events[2]=CreateEvent(NULL,TRUE,FALSE,"mouseupdate");
+	trigger_events[3]=CreateEvent(NULL,TRUE,FALSE,"user1");
+	trigger_events[4]=CreateEvent(NULL,TRUE,FALSE,"user2");
+	trigger_events[5]=CreateEvent(NULL,TRUE,FALSE,"quit");
+	restart_event=CreateEvent(NULL,TRUE,TRUE,"restart");
+	rgnpump.clear();
+	lock_region_add=false;
+	InitWindowThreadh=NULL;
+	old_Blockinput=2;
+	old_Blockinput1=2;
+	old_Blockinput2=2;
+	nr_rects=0;
+	iconregion.clear();
+	blankmonitorstate=false;
+}
+
+vncDesktop::~vncDesktop()
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("~vncDesktop \n"));
+
+	// If we created a thread then here we delete it
+	// The thread itself does most of the cleanup
+	if(m_thread != NULL)
+	{
+		StopInitWindowthread();
+		int counter=0;
+		while (g_DesktopThread_running!=false)
+		{
+			if (Window()==NULL)SetEvent(trigger_events[5]);;
+			Sleep(100);
+			counter++;
+			if (counter>50) 
+			{
+				vnclog.Print(LL_INTINFO, VNCLOG("Desktop thread running, force close \n"));
+				SetEvent(trigger_events[5]);
+				break;
+			}
+		}
+		// Join with the desktop handler thread
+		void *returnval;
+		m_thread->join(&returnval);
+		m_thread = NULL;
+	}
+
+
+
+	// added jeff
+    SetBlockInputState(false);
+	// Let's call Shutdown just in case something went wrong...
+	Shutdown();
+	vnclog.Print(LL_INTINFO, VNCLOG("~vncDesktop Shutdown()\n"));
+	// Modif sf at 2002
+	m_lWList.clear();
+	GridsList::iterator iGrid;
+	for (iGrid = m_lGridsList.begin(); iGrid != m_lGridsList.end(); iGrid++)
+	{
+		if (*iGrid)
+		{
+			// Since we've replaced this:
+			// "typedef std::list<RGBPixelList*> GridsList;"
+			// with this:
+			// "typedef std::list<void*> GridsList;"
+			// we must be carefull to avoid memory leaks...
+			((RGBPixelList*)(*iGrid))->clear();
+			delete ((RGBPixelList*)(*iGrid));
+			//vnclog.Print(LL_INTWARN, VNCLOG("delete ((RGBPixelList) \n"));
+		}
+	}
+	vnclog.Print(LL_INTINFO, VNCLOG("~vncDesktop m_lGridsList.clear\n"));
+	m_lGridsList.clear();
+	if (hUser32) FreeLibrary(hUser32);
+	g_Desktop_running=false;
+	for (int i=0;i<6;i++)
+	CloseHandle(trigger_events[i]);
+	CloseHandle(restart_event);
+	//problems, sync could be restarted in the little time the desktop thread was still running
+	//then this doesn't exist on desktop close and sink window crash
+	// Fix E. SAG
+	if (InitWindowThreadh)
+	{
+      vnclog.Print(LL_INTERR, VNCLOG("~vncDesktop:: second request to close InitWindowthread\n"));
+      StopInitWindowthread();
+	}
+}
+
+
+// Tell the desktop hooks to grab & update a particular rectangle
+void
+vncDesktop::QueueRect(const rfb::Rect &rect)
+{
+	//Full screen Update
+	SetEvent(trigger_events[4]);
+}
+	
+// Kick the desktop hooks to perform an update
+void
+vncDesktop::TriggerUpdate()
+{
+	// Note that we should really lock the update lock here,
+	// but there are periodic timer updates anyway, so
+	// we don't actually need to.  Something to think about.
+	if (!m_update_triggered) {
+		m_update_triggered = TRUE;
+		g_update_triggered = TRUE;
+		SetEvent(trigger_events[0]);
+	}
+}
+
+
+// Routine to startup and install all the hooks and stuff
+DWORD
+vncDesktop::Startup()
+{
+	// Initialise the Desktop object
+    DWORD status;
+	if (!InitDesktop())
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("InitDesktop Failed\n"));
+			return ERROR_DESKTOP_INIT_FAILED;
+		}
+
+	// Modif rdv at 2002 - v1.1.x - videodriver
+	vnclog.Print(LL_INTINFO, VNCLOG("InitVideo driver Called\n"));
+	if (FALSE != DriverWantedSet)
+			{
+			m_server->Driver(DriverWanted);
+			m_server->Hook(HookWanted);
+			DriverWantedSet=FALSE;
+			}
+	if (m_server->Driver())
+				{
+					vnclog.Print(LL_INTINFO, VNCLOG("Driver option enabled \n"));
+					if(OSversion()==1 || OSversion()==2 )
+						{
+							//Enable only the video driver for the Default desktop
+							HDESK desktop = GetThreadDesktop(GetCurrentThreadId());
+							DWORD dummy;
+							char new_name[256];
+							if (GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
+								{
+									if (strcmp(new_name,"Default")==0)
+										{
+											InitVideoDriver();
+										}
+									else 
+										vnclog.Print(LL_INTINFO, VNCLOG("no default desktop \n"));
+								}
+						}
+				}
+    else
+	vnclog.Print(LL_INTINFO, VNCLOG("Driver option disabled \n"));
+	if (m_Origpolling) m_server->PollFullScreen(m_Origpolling);
+	m_OrigpollingSet=false;
+	
+	if (VideoBuffer())
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("Break log\n"));
+	}
+	if ((status = InitBitmap()) != 0)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("InitBitmap Failed\n"));
+			return status;
+		}
+
+	if (!ThunkBitmapInfo())
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("ThunkBitmapInfo Failed\n"));
+			return FALSE;
+		}
+
+	if (VideoBuffer())
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("Removing real Dib buffer and replace by driver communication buffer\n"));
+		if (m_membitmap != NULL)
+			{
+				DeleteObject(m_membitmap);
+				m_membitmap = NULL;
+			}
+		m_DIBbits=m_videodriver->myframebuffer;
+		pchanges_buf=m_videodriver->mypchangebuf;
+		m_buffer.VideDriverUsed(true);
+		InvalidateRect(NULL,NULL,TRUE);
+	}
+    else if ((status = EnableOptimisedBlits()) != 0)
+    {
+		vnclog.Print(LL_INTINFO, VNCLOG("EnableOptimisedBlits Failed\n"));
+		m_buffer.VideDriverUsed(false);
+		return status;
+    }
+	else m_buffer.VideDriverUsed(false);
+
+	if ((status = SetPixFormat()) != 0)
+		{
+		vnclog.Print(LL_INTINFO, VNCLOG("SetPixFormat Failed\n"));
+		return status;
+		}
+
+	if (!SetPixShifts())
+		{
+		vnclog.Print(LL_INTINFO, VNCLOG("SetPixShift Failed\n"));
+		return ERROR_DESKTOP_UNSUPPORTED_PIXEL_FORMAT;
+		}
+	
+	if (!SetPalette())
+		{
+		vnclog.Print(LL_INTINFO, VNCLOG("SetPalette Failed\n"));
+		return ERROR_DESKTOP_NO_PALETTE;
+		}
+	
+		StartInitWindowthread();
+
+	// Start a timer to handle Polling Mode.  The timer will cause
+	// an "idle" event once every 1/10 second, which is necessary if Polling
+	// Mode is being used, to cause TriggerUpdate to be called.
+
+
+	// Initialise the buffer object
+	if (!m_buffer.SetDesktop(this))
+        return ERROR_DESKTOP_OUT_OF_MEMORY;
+	GetQuarterSize();
+#ifdef AVILOG
+	if(vnclog.GetVideo()){
+		SYSTEMTIME lt;    
+		GetLocalTime(&lt);
+		char str[MAX_PATH + 32]; // 29 January 2008 jdp 
+		_snprintf(str, sizeof str, "%02d_%02d_%02d_%02d_%02d", lt.wMonth,lt.wDay,lt.wHour, lt.wMinute,lt.wSecond);
+		strcat(str,"_vnc.avi");
+		AviGen = new CAVIGenerator(str,"c:\\temp",&m_bminfo.bmi.bmiHeader,5);
+		HRESULT hr;
+		hr=AviGen->InitEngine();
+		if (FAILED(hr))
+		{
+			AviGen->ReleaseEngine(); 
+			delete AviGen;
+			AviGen=NULL;
+		}
+
+	}
+#endif
+	// Everything is ok, so return success
+	return 0;
+}
+
+// Routine to shutdown all the hooks and stuff
+BOOL
+vncDesktop::Shutdown()
+{
+#ifdef AVILOG
+	if (AviGen)
+		{
+			AviGen->ReleaseEngine(); 
+			delete AviGen;
+			AviGen=NULL;
+		}
+#endif
+
+	ShutdownInitWindowthread();
+
+	// Now free all the bitmap stuff
+	if (m_hrootdc != NULL)
+	{
+		if (!DeleteDC(m_hrootdc))
+				vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteDC hrootdc\n"));
+		m_hrootdc = NULL;
+	}
+	if (m_hmemdc != NULL)
+	{
+		// Release our device context
+		if (!DeleteDC(m_hmemdc))
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteDC hmemdc\n"));
+		}
+		m_hmemdc = NULL;
+	}
+	if (m_membitmap != NULL)
+	{
+		// Release the custom bitmap, if any
+		if (!DeleteObject(m_membitmap))
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("failed to DeleteObject\n"));
+		}
+		m_membitmap = NULL;
+	}
+
+    m_DIBbits = NULL;
+
+    if (m_hcursor)
+    {
+        DeleteObject(m_hcursor);
+        m_hcursor = NULL;
+    }
+    if (m_hOldcursor)
+    {
+        DeleteObject(m_hOldcursor);
+        m_hOldcursor = NULL;
+    }
+	// Modif rdv at 2002 - v1.1.x - videodriver
+	ShutdownVideoDriver();
+
+	if (m_home_desktop)
+		vncService::SelectHDESK(m_home_desktop);
+	if (m_input_desktop)
+	{
+		if (!CloseDesktop(m_input_desktop))
+			vnclog.Print(LL_INTERR, VNCLOG("failed to close desktop\n"));
+		m_input_desktop = 0;
+	}
+	GridsList::iterator iGrid;
+	for (iGrid = m_lGridsList.begin(); iGrid != m_lGridsList.end(); iGrid++)
+	{
+		if (*iGrid)
+		{
+			// Since we've replaced this:
+			// "typedef std::list<RGBPixelList*> GridsList;"
+			// with this:
+			// "typedef std::list<void*> GridsList;"
+			// we must be carefull to avoid memory leaks...
+			((RGBPixelList*)(*iGrid))->clear();
+			delete ((RGBPixelList*)(*iGrid));
+			vnclog.Print(LL_INTWARN, VNCLOG("delete ((RGBPixelList) \n"));
+		}
+	}
+	m_lGridsList.clear();
+	m_foreground_window_rect.clear();
+	return TRUE;
+}
+
+// Routine to ensure we're on the correct NT desktop
+
+BOOL
+vncDesktop::InitDesktop()
+{
+	int result=vncService::InputDesktopSelected();
+	if (result==1 || result==2)
+		return TRUE;
+	vnclog.Print(LL_INTINFO, VNCLOG("InitDesktop...\n"));
+	return vncService::SelectDesktop(NULL, &m_input_desktop);
+}
+
+// Routine used to close the screen saver, if it's active...
+
+BOOL CALLBACK
+KillScreenSaverFunc(HWND hwnd, LPARAM lParam)
+{
+	char buffer[256];
+
+	// - ONLY try to close Screen-saver windows!!!
+	if ((GetClassName(hwnd, buffer, 256) != 0) &&
+		(strcmp(buffer, "WindowsScreenSaverClass") == 0))
+		PostMessage(hwnd, WM_CLOSE, 0, 0);
+	return TRUE;
+}
+
+void
+vncDesktop::KillScreenSaver()
+{
+	OSVERSIONINFO osversioninfo;
+	osversioninfo.dwOSVersionInfoSize = sizeof(osversioninfo);
+
+	// Get the current OS version
+	if (!GetVersionEx(&osversioninfo))
+		return;
+
+	vnclog.Print(LL_INTINFO, VNCLOG("KillScreenSaver...\n"));
+
+	// How to kill the screen saver depends on the OS
+	switch (osversioninfo.dwPlatformId)
+	{
+	case VER_PLATFORM_WIN32_WINDOWS:
+		{
+			// Windows 95
+
+			// Fidn the ScreenSaverClass window
+			HWND hsswnd = FindWindow ("WindowsScreenSaverClass", NULL);
+			if (hsswnd != NULL)
+				PostMessage(hsswnd, WM_CLOSE, 0, 0); 
+			break;
+		} 
+	case VER_PLATFORM_WIN32_NT:
+		{
+			// Windows NT
+
+			// Find the screensaver desktop
+			HDESK hDesk = OpenDesktop(
+				"Screen-saver",
+				0,
+				FALSE,
+				DESKTOP_READOBJECTS | DESKTOP_WRITEOBJECTS
+				);
+			if (hDesk != NULL)
+			{
+				vnclog.Print(LL_INTINFO, VNCLOG("Killing ScreenSaver\n"));
+
+				// Close all windows on the screen saver desktop
+				EnumDesktopWindows(hDesk, (WNDENUMPROC) &KillScreenSaverFunc, 0);
+				CloseDesktop(hDesk);
+				// Pause long enough for the screen-saver to close
+				//Sleep(2000);
+				// Reset the screen saver so it can run again
+				SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, TRUE, 0, SPIF_SENDWININICHANGE); 
+			}
+			break;
+		}
+	}
+}
+
+
+//
+// Modif sf at 2002 - Single Window
+//
+BOOL CALLBACK EnumWindowsHnd(HWND hwnd, LPARAM arg)
+{
+ int  nRet;
+ char buffer[128];
+ char szNameAppli[16];
+
+ strncpy(szNameAppli, (LPSTR)(((vncDesktop*)arg)->GetServerPointer()->GetWindowName()),15);
+ szNameAppli[15]=0;
+ nRet = GetWindowText(hwnd, buffer, sizeof(buffer));
+ if (nRet > 0)
+ {
+  if ( !_strnicmp(buffer, szNameAppli, lstrlen(szNameAppli)))
+  {
+       ((vncDesktop*)arg)->m_Single_hWnd = hwnd;
+       return FALSE;
+  }
+  else
+	  return TRUE;
+ }
+ return TRUE;
+}
+
+
+DWORD
+vncDesktop::InitBitmap()
+{	
+	// Get the device context for the whole screen and find it's size
+	DriverType=NONE;
+	if (OSversion()==1 || OSversion()==2) //XP W2k
+		{	
+			if (VideoBuffer())
+				{
+					pEnumDisplayDevices pd=NULL;
+					LPSTR driverName = "mv video hook driver2";
+					BOOL DriverFound;
+					DEVMODE devmode;
+					FillMemory(&devmode, sizeof(DEVMODE), 0);
+					devmode.dmSize = sizeof(DEVMODE);
+					devmode.dmDriverExtra = 0;
+					/*BOOL change = */EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&devmode);
+					devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+					HMODULE hUser32=LoadLibrary("USER32");
+					if (hUser32) pd = (pEnumDisplayDevices)GetProcAddress( hUser32, "EnumDisplayDevicesA");
+						if (pd)
+							{
+								LPSTR deviceName=NULL;
+								DISPLAY_DEVICE dd;
+								ZeroMemory(&dd, sizeof(dd));
+								dd.cb = sizeof(dd);
+								devmode.dmDeviceName[0] = '\0';
+								INT devNum = 0;
+								BOOL result;
+								DriverFound=false;
+								while ((result = (*pd)(NULL,devNum, &dd,0)))
+									{
+										if (strcmp((const char *)&dd.DeviceString[0], driverName) == 0)
+											{
+												DriverFound=true;
+												break;
+											}
+										devNum++;
+									}
+								if (DriverFound)
+									{
+										deviceName = (LPSTR)&dd.DeviceName[0];
+										m_hrootdc = CreateDC("DISPLAY",deviceName,NULL,NULL);
+										/*BOOL change = */EnumDisplaySettings(deviceName,ENUM_CURRENT_SETTINGS,&devmode);
+										m_ScreenOffsetx=devmode.dmPosition.x;
+										m_ScreenOffsety=devmode.dmPosition.y;
+										if (m_hrootdc) DriverType=MIRROR;
+										Checkmonitors();
+										requested_multi_monitor=m_buffer.IsMultiMonitor();
+										multi_monitor=false;
+										if (requested_multi_monitor && nr_monitors>1) multi_monitor=true;
+									}
+							}
+					if (hUser32) FreeLibrary(hUser32);
+				}//VIDEOBUFFER
+			}//OS
+
+	// RDV SINGLE WINDOW
+	if (m_server->SingleWindow() && m_Single_hWnd==NULL)
+	{		
+		EnumWindows((WNDENUMPROC)EnumWindowsHnd, (LPARAM) this);
+	}
+
+	if (m_hrootdc == NULL) {
+		vnclog.Print(LL_INTERR, VNCLOG("No driver used \n"));
+		//Multi-Monitor changes
+		Checkmonitors();
+		requested_multi_monitor=m_buffer.IsMultiMonitor();
+		multi_monitor=false;
+		if (requested_multi_monitor && nr_monitors>1) multi_monitor=true;
+
+		if (!multi_monitor)
+		{
+			m_hrootdc = CreateDC(("DISPLAY"),mymonitor[0].device,NULL,NULL);
+			m_ScreenOffsetx=mymonitor[0].offsetx;
+			m_ScreenOffsety=mymonitor[0].offsety;
+		}
+		else
+		{
+			m_hrootdc = GetDC(NULL);
+			m_ScreenOffsetx=mymonitor[2].offsetx;
+			m_ScreenOffsety=mymonitor[2].offsety;;
+		}
+		if (m_hrootdc == NULL) {
+				vnclog.Print(LL_INTERR, VNCLOG("Failed m_rootdc \n"));
+				return ERROR_DESKTOP_NO_ROOTDC;
+		}
+		
+	}
+	if (multi_monitor && !VideoBuffer()) m_bmrect = rfb::Rect(0, 0,mymonitor[2].Width,mymonitor[2].Height);
+	else if (!VideoBuffer()) m_bmrect = rfb::Rect(0, 0,mymonitor[0].Width,mymonitor[0].Height);
+	else m_bmrect = rfb::Rect(0, 0,GetDeviceCaps(m_hrootdc, HORZRES),GetDeviceCaps(m_hrootdc, VERTRES));
+	vnclog.Print(LL_INTINFO, VNCLOG("bitmap dimensions are %d x %d\n"), m_bmrect.br.x, m_bmrect.br.y);
+
+	// Create a compatible memory DC
+	m_hmemdc = CreateCompatibleDC(m_hrootdc);
+	if (m_hmemdc == NULL) {
+		vnclog.Print(LL_INTERR, VNCLOG("failed to create compatibleDC(%d)\n"), GetLastError());
+		return ERROR_DESKTOP_NO_ROOTDC;
+	}
+
+	// Check that the device capabilities are ok
+	if ((GetDeviceCaps(m_hrootdc, RASTERCAPS) & RC_BITBLT) == 0)
+	{
+		MessageBoxSecure(
+			NULL,
+			"vncDesktop : root device doesn't support BitBlt\n"
+			"WinVNC cannot be used with this graphic device driver",
+			szAppName,
+			MB_ICONSTOP | MB_OK
+			);
+		return ERROR_DESKTOP_NO_BITBLT;
+	}
+	if ((GetDeviceCaps(m_hmemdc, RASTERCAPS) & RC_DI_BITMAP) == 0)
+	{
+		MessageBoxSecure(
+			NULL,
+			"vncDesktop : memory device doesn't support GetDIBits\n"
+			"WinVNC cannot be used with this graphics device driver",
+			szAppName,
+			MB_ICONSTOP | MB_OK
+			);
+		return ERROR_DESKTOP_NO_GETDIBITS;
+	}
+
+	// Create the bitmap to be compatible with the ROOT DC!!!
+	m_membitmap = CreateCompatibleBitmap(m_hrootdc,1,1); //m_bmrect.br.x, m_bmrect.br.y);
+	if (m_membitmap == NULL) {
+		vnclog.Print(LL_INTERR, VNCLOG("failed to create memory bitmap(%d)\n"), GetLastError());
+		return ERROR_DESKTOP_NO_COMPATBITMAP;
+	}
+	vnclog.Print(LL_INTINFO, VNCLOG("created memory bitmap\n"));
+
+	// Get the bitmap's format and colour details
+	int result;
+	memset(&m_bminfo, 0, sizeof(m_bminfo));
+	m_bminfo.bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+	m_bminfo.bmi.bmiHeader.biBitCount = 0;
+	result = ::GetDIBits(m_hmemdc, m_membitmap, 0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS);
+	if (result == 0) {
+		vnclog.Print(LL_INTERR, VNCLOG("unable to get display format\n"));
+		return ERROR_DESKTOP_NO_DISPLAYFORMAT;
+	}
+	result = ::GetDIBits(m_hmemdc, m_membitmap,  0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS);
+	if (result == 0) {
+		vnclog.Print(LL_INTERR, VNCLOG("unable to get display colour info\n"));
+		return ERROR_DESKTOP_NO_DISPLAYFORMAT;
+	}
+	vnclog.Print(LL_INTINFO, VNCLOG("got bitmap format\n"));
+
+	// Henceforth we want to use a top-down scanning representation
+    m_bminfo.bmi.bmiHeader.biWidth = m_bmrect.br.x;
+    m_bminfo.bmi.bmiHeader.biHeight = m_bmrect.br.y;
+    m_bminfo.bmi.bmiHeader.biSizeImage = abs((m_bminfo.bmi.bmiHeader.biWidth *
+				m_bminfo.bmi.bmiHeader.biHeight *
+				m_bminfo.bmi.bmiHeader.biBitCount)/ 8);
+	m_bminfo.bmi.bmiHeader.biHeight = - abs(m_bminfo.bmi.bmiHeader.biHeight);
+
+	// Is the bitmap palette-based or truecolour?
+	m_bminfo.truecolour = (GetDeviceCaps(m_hmemdc, RASTERCAPS) & RC_PALETTE) == 0;
+	InvalidateRect(NULL,NULL,TRUE);
+	return 0;
+}
+
+BOOL
+vncDesktop::ThunkBitmapInfo()
+{
+	// If we leave the pixel format intact, the blist can be optimised (Will Dean's patch)
+	m_formatmunged = FALSE;
+
+	// HACK ***.  Optimised blits don't work with palette-based displays, yet
+	if (!m_bminfo.truecolour) {
+		m_formatmunged = TRUE;
+	}
+
+	// Attempt to force the actual format into one we can handle
+	// We can handle 8-bit-palette and 16/32-bit-truecolour modes
+	switch (m_bminfo.bmi.bmiHeader.biBitCount)
+	{
+	case 1:
+	case 4:
+		vnclog.Print(LL_INTINFO, VNCLOG("DBG:used/bits/planes/comp/size = %d/%d/%d/%d/%d\n"),
+			(int)m_bminfo.bmi.bmiHeader.biClrUsed,
+			(int)m_bminfo.bmi.bmiHeader.biBitCount,
+			(int)m_bminfo.bmi.bmiHeader.biPlanes,
+			(int)m_bminfo.bmi.bmiHeader.biCompression,
+			(int)m_bminfo.bmi.bmiHeader.biSizeImage);
+		
+		// Correct the BITMAPINFO header to the format we actually want
+		m_bminfo.bmi.bmiHeader.biClrUsed = 0;
+		m_bminfo.bmi.bmiHeader.biPlanes = 1;
+		m_bminfo.bmi.bmiHeader.biCompression = BI_RGB;
+		m_bminfo.bmi.bmiHeader.biBitCount = 8;
+		m_bminfo.bmi.bmiHeader.biSizeImage =
+			abs((m_bminfo.bmi.bmiHeader.biWidth *
+				m_bminfo.bmi.bmiHeader.biHeight *
+				m_bminfo.bmi.bmiHeader.biBitCount)/ 8);
+		m_bminfo.bmi.bmiHeader.biClrImportant = 0;
+		m_bminfo.truecolour = FALSE;
+
+		// Display format is non-VNC compatible - use the slow blit method
+		m_formatmunged = TRUE;
+		break;	
+	case 24:
+		// Update the bitmapinfo header
+		m_bminfo.bmi.bmiHeader.biBitCount = 32;
+		m_bminfo.bmi.bmiHeader.biPlanes = 1;
+		m_bminfo.bmi.bmiHeader.biCompression = BI_RGB;
+		m_bminfo.bmi.bmiHeader.biSizeImage =
+			abs((m_bminfo.bmi.bmiHeader.biWidth *
+				m_bminfo.bmi.bmiHeader.biHeight *
+				m_bminfo.bmi.bmiHeader.biBitCount)/ 8);
+		// Display format is non-VNC compatible - use the slow blit method
+		m_formatmunged = TRUE;
+		break;
+	}
+
+	return TRUE;
+}
+
+DWORD
+vncDesktop::SetPixFormat()
+{
+ // If we are using a memory bitmap then check how many planes it uses
+  // The VNC code can only handle formats with a single plane (CHUNKY pixels)
+  if (!m_DIBbits) {
+	  vnclog.Print(LL_INTINFO, VNCLOG("DBG:display context has %d planes!\n"),
+      GetDeviceCaps(m_hrootdc, PLANES));
+	  vnclog.Print(LL_INTINFO, VNCLOG("DBG:memory context has %d planes!\n"),
+      GetDeviceCaps(m_hmemdc, PLANES));
+	  if (GetDeviceCaps(m_hmemdc, PLANES) != 1)
+	  {
+		  MessageBoxSecure(
+			  NULL,
+			  "vncDesktop : current display is PLANAR, not CHUNKY!\n"
+			  "WinVNC cannot be used with this graphics device driver",
+			  szAppName,
+			  MB_ICONSTOP | MB_OK
+			  );
+          return ERROR_DESKTOP_UNSUPPORTED_PIXEL_ORGANIZATION;
+	  }
+  }
+	
+	
+	// Examine the bitmapinfo structure to obtain the current pixel format
+	m_scrinfo.format.trueColour = m_bminfo.truecolour;
+	m_scrinfo.format.bigEndian = 0;
+
+	// Set up the native buffer width, height and format
+	m_scrinfo.framebufferWidth = (CARD16) (m_bmrect.br.x - m_bmrect.tl.x);		// Swap endian before actually sending
+	m_scrinfo.framebufferHeight = (CARD16) (m_bmrect.br.y - m_bmrect.tl.y);	// Swap endian before actually sending
+	m_scrinfo.format.bitsPerPixel = (CARD8) m_bminfo.bmi.bmiHeader.biBitCount;
+	m_scrinfo.format.depth        = (CARD8) m_bminfo.bmi.bmiHeader.biBitCount;
+
+	// Calculate the number of bytes per row
+	m_bytesPerRow = m_scrinfo.framebufferWidth * m_scrinfo.format.bitsPerPixel / 8;
+
+	return 0;
+}
+
+BOOL
+vncDesktop::SetPixShifts()
+{
+	// Sort out the colour shifts, etc.
+	DWORD redMask=0, blueMask=0, greenMask = 0;
+
+	switch (m_bminfo.bmi.bmiHeader.biBitCount)
+	{
+	case 16:
+		// Standard 16-bit display
+		if (m_bminfo.bmi.bmiHeader.biCompression == BI_RGB)
+		{
+			// each word single pixel 5-5-5
+			redMask = 0x7c00; greenMask = 0x03e0; blueMask = 0x001f;
+		}
+		else
+		{
+			if (m_bminfo.bmi.bmiHeader.biCompression == BI_BITFIELDS)
+			{
+				redMask =   *(DWORD *) &m_bminfo.bmi.bmiColors[0];
+				greenMask = *(DWORD *) &m_bminfo.bmi.bmiColors[1];
+				blueMask =  *(DWORD *) &m_bminfo.bmi.bmiColors[2];
+			}
+		}
+		break;
+
+	case 32:
+		// Standard 24/32 bit displays
+		if (m_bminfo.bmi.bmiHeader.biCompression == BI_RGB)
+		{
+			redMask = 0xff0000; greenMask = 0xff00; blueMask = 0x00ff;
+		}
+		else
+		{
+			if (m_bminfo.bmi.bmiHeader.biCompression == BI_BITFIELDS)
+			{
+				redMask =   *(DWORD *) &m_bminfo.bmi.bmiColors[0];
+				greenMask = *(DWORD *) &m_bminfo.bmi.bmiColors[1];
+				blueMask =  *(DWORD *) &m_bminfo.bmi.bmiColors[2];
+			}
+		}
+		break;
+
+	default:
+		// Other pixel formats are only valid if they're palette-based
+		if (m_bminfo.truecolour)
+		{
+			vnclog.Print(LL_INTERR, "unsupported truecolour pixel format for setpixshifts\n");
+			return FALSE;
+		}
+		return TRUE;
+	}
+
+	// Convert the data we just retrieved
+	MaskToMaxAndShift(redMask, m_scrinfo.format.redMax, m_scrinfo.format.redShift);
+	MaskToMaxAndShift(greenMask, m_scrinfo.format.greenMax, m_scrinfo.format.greenShift);
+	MaskToMaxAndShift(blueMask, m_scrinfo.format.blueMax, m_scrinfo.format.blueShift);
+
+	return TRUE;
+}
+
+BOOL
+vncDesktop::SetPalette()
+{
+	// Lock the current display palette into the memory DC we're holding
+	// *** CHECK THIS FOR LEAKS!
+    if (VideoBuffer())
+        return TRUE;
+	if (!m_bminfo.truecolour)
+	{
+		if (!m_DIBbits)
+		{
+			// - Handle the palette for a non DIB-Section
+			
+			LOGPALETTE *palette;
+			UINT size = sizeof(LOGPALETTE) + (sizeof(PALETTEENTRY) * 256);
+			
+			palette = (LOGPALETTE *) new char[size];
+			if (palette == NULL) {
+				vnclog.Print(LL_INTERR, VNCLOG("unable to allocate logical palette\n"));
+				return FALSE;
+			}
+			
+			// Initialise the structure
+			palette->palVersion = 0x300;
+			palette->palNumEntries = 256;
+			
+			// Get the system colours
+			if (GetSystemPaletteEntries(m_hrootdc,
+				0, 256, palette->palPalEntry) == 0)
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("unable to get system palette entries\n"));
+				delete [] palette;
+				return FALSE;
+			}
+			
+			// Create a palette from those
+			HPALETTE pal = CreatePalette(palette);
+			if (pal == NULL)
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("unable to create HPALETTE\n"));
+				delete [] palette;
+				return FALSE;
+			}
+			
+			// Select the palette into our memory DC
+			HPALETTE oldpalette = SelectPalette(m_hmemdc, pal, FALSE);
+			if (oldpalette == NULL)
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("unable to select() HPALETTE\n"));
+				delete [] palette;
+				DeleteObject(pal);
+				return FALSE;
+			}
+			
+			// Worked, so realise the palette
+			if (RealizePalette(m_hmemdc) == GDI_ERROR)
+				vnclog.Print(LL_INTWARN, VNCLOG("warning - failed to RealizePalette\n"));
+			
+			// It worked!
+			delete [] palette;
+			DeleteObject(oldpalette);
+			
+			vnclog.Print(LL_INTINFO, VNCLOG("initialised palette OK\n"));
+			return TRUE;
+		}
+		else
+		{
+			// - Handle a DIB-Section's palette
+			
+			// - Fetch the system palette for the framebuffer
+			PALETTEENTRY syspalette[256];
+			UINT entries = ::GetSystemPaletteEntries(m_hrootdc, 0, 256, syspalette);
+			vnclog.Print(LL_INTERR, VNCLOG("framebuffer has %u palette entries"), entries);
+			
+			// - Store it and convert it to RGBQUAD format
+			RGBQUAD dibpalette[256];
+			unsigned int i;
+			for (i=0;i<entries;i++) {
+				dibpalette[i].rgbRed = syspalette[i].peRed;
+				dibpalette[i].rgbGreen = syspalette[i].peGreen;
+				dibpalette[i].rgbBlue = syspalette[i].peBlue;
+				dibpalette[i].rgbReserved = 0;
+			}
+			
+			// - Set the rest of the palette to something nasty but usable
+			for (i=entries;i<256;i++) {
+				dibpalette[i].rgbRed = i % 2 ? 255 : 0;
+				dibpalette[i].rgbGreen = i/2 % 2 ? 255 : 0;
+				dibpalette[i].rgbBlue = i/4 % 2 ? 255 : 0;
+				dibpalette[i].rgbReserved = 0;
+			}
+			
+			// - Update the DIB section to use the same palette
+			HDC bitmapDC=::CreateCompatibleDC(m_hrootdc);
+			if (!bitmapDC) {
+				vnclog.Print(LL_INTERR, VNCLOG("unable to create temporary DC"), GetLastError());
+				return FALSE;
+			}
+			HBITMAP old_bitmap = (HBITMAP)::SelectObject(bitmapDC, m_membitmap);
+			if (!old_bitmap) {
+				vnclog.Print(LL_INTERR, VNCLOG("unable to select DIB section into temporary DC"), GetLastError());
+                DeleteDC(bitmapDC);
+				return FALSE;
+			}
+			UINT entries_set = ::SetDIBColorTable(bitmapDC, 0, 256, dibpalette);
+			if (entries_set == 0) {
+				vnclog.Print(LL_INTERR, VNCLOG("unable to set DIB section palette"), GetLastError());
+//				return FALSE;
+			}
+			if (!::SelectObject(bitmapDC, old_bitmap)) {
+				vnclog.Print(LL_INTERR, VNCLOG("unable to restore temporary DC bitmap"), GetLastError());
+                DeleteObject(old_bitmap);
+                DeleteDC(bitmapDC);
+				return FALSE;
+			}
+            DeleteObject(old_bitmap);
+            DeleteDC(bitmapDC);
+            return TRUE;
+		}
+    }
+ 
+	// Not a palette based local screen - forget it!
+	vnclog.Print(LL_INTERR, VNCLOG("no palette data for truecolour display\n"));
+	return TRUE;
+}
+////////////////////////////////////////////////////////////////////////////////
+DWORD WINAPI Driverwatch(LPVOID lpParam)
+{
+	//Mouse shape changed
+	if (OSversion()==1 || OSversion()==2)
+	{
+		HANDLE event;
+		//DrvWatch *mywatch=(DrvWatch*)lpParam;
+		HWND hwnd=(HWND)lpParam;
+		event=NULL;
+		while (event==NULL)
+		{
+			event = OpenEvent (SYNCHRONIZE, FALSE, "VncEvent") ;
+			Sleep(900);
+			if (!IsWindow(hwnd)) 
+			{
+				if (event) CloseHandle(event);
+				return 0;
+			}
+		}
+		SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL);
+		for (;;)
+		{
+		if (WaitForSingleObject(event, 2000) == WAIT_OBJECT_0)
+			{
+				PostMessage(hwnd, WM_MOUSESHAPE, 0, 0);
+			}
+		if (!IsWindow(hwnd) || !g_Desktop_running)
+		{
+			if (event) CloseHandle(event);
+			break;
+		}
+		}
+	}
+	return 0;
+}
+
+
+
+DWORD
+vncDesktop::EnableOptimisedBlits()
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("attempting to enable DIBsection blits\n"));
+
+	// Create a new DIB section
+	//HBITMAP tempbitmap=NULL;
+	HBITMAP tempbitmap = CreateDIBSection(m_hmemdc, &m_bminfo.bmi, DIB_RGB_COLORS, &m_DIBbits, NULL, 0);
+	if (tempbitmap == NULL) {
+		vnclog.Print(LL_INTINFO, VNCLOG("failed to build DIB section - reverting to slow blits\n"));
+		m_DIBbits = NULL;
+        tempbitmap = CreateCompatibleBitmap(m_hrootdc, m_bmrect.br.x, m_bmrect.br.y);
+	    if (tempbitmap == NULL) {
+		    vnclog.Print(LL_INTERR, VNCLOG("failed to create memory bitmap(%d)\n"), GetLastError());
+		    return ERROR_DESKTOP_NO_DIBSECTION_OR_COMPATBITMAP;
+	    }
+	    else
+	        vnclog.Print(LL_INTINFO, VNCLOG("enabled slow blits OK\n"));
+	}
+    else
+        vnclog.Print(LL_INTINFO, VNCLOG("enabled fast DIBsection blits OK\n"));
+
+	// Delete the old memory bitmap
+	if (m_membitmap != NULL) {
+		DeleteObject(m_membitmap);
+		m_membitmap = NULL;
+	}
+
+	// Replace old membitmap with DIB section
+	m_membitmap = tempbitmap;
+    return 0;
+}
+
+DWORD
+vncDesktop::Init(vncServer *server)
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("initialising desktop handler\n"));
+
+	// Save the server pointer
+	m_server = server;
+
+	// sf at 2005
+	if (OSversion()==1 || OSversion()==2)
+	m_fCaptureAlphaBlending = m_server->CaptureAlphaBlending();
+	else m_fCaptureAlphaBlending=false;
+
+	// Load in the arrow cursor
+	m_hdefcursor = LoadCursor(NULL, IDC_ARROW);
+	m_hcursor = m_hdefcursor;
+	m_hOldcursor = m_hdefcursor; //sf at 2002
+
+	// Spawn a thread to handle that window's message queue
+	vncDesktopThread *thread = new vncDesktopThread;
+	if (thread == NULL) {
+		vnclog.Print(LL_INTERR, VNCLOG("failed to start hook thread\n"));
+		return ERROR_DESKTOP_NO_DESKTOPTHREAD;
+	}
+	m_thread = thread;
+	//SINGEL WINDOW
+	SWinit();
+	// InitHookSettings();
+	return thread->Init(this, m_server);
+}
+
+int
+vncDesktop::ScreenBuffSize()
+{
+	return m_scrinfo.format.bitsPerPixel/8 *
+		m_scrinfo.framebufferWidth *
+		m_scrinfo.framebufferHeight;
+}
+
+void
+vncDesktop::FillDisplayInfo(rfbServerInitMsg *scrinfo)
+{
+	memcpy(scrinfo, &m_scrinfo, sz_rfbServerInitMsg);
+}
+
+
+void
+vncDesktop::WriteMessageOnScreen(char * tt,BYTE *scrBuff, UINT scrBuffSize)
+{
+	// Select the memory bitmap into the memory DC
+	RECT rect;
+	SetRect(&rect, 0,0, 300, 120);
+	COLORREF bgcol =RGB(0xff, 0x00, 0x00);
+	COLORREF oldtxtcol =SetTextColor(m_hmemdc, RGB(0,0,254));
+	COLORREF oldbgcol  =SetBkColor(  m_hmemdc, bgcol);
+	HBRUSH backgroundBrush = CreateSolidBrush(bgcol);
+
+	HBITMAP oldbitmap;
+	if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)
+					return;
+
+	FillRect(m_hmemdc, &rect, backgroundBrush); 
+	DrawText(m_hmemdc,tt,strlen(tt),&rect,DT_CENTER | DT_VCENTER);
+				// Select the old bitmap back into the memory DC
+	//DWORD err= GetLastError();
+
+	
+	//ExtTextOut(m_hmemdc, 0, 0, ETO_OPAQUE,&rect,tt,strlen(tt), NULL); 
+        
+
+	SetBkColor(  m_hmemdc, oldbgcol);
+	SetTextColor(m_hmemdc, oldtxtcol);
+	SelectObject(m_hmemdc, oldbitmap);
+	DeleteObject(backgroundBrush); 
+
+	CopyToBuffer(rect, scrBuff, scrBuffSize);
+}
+
+#ifndef CAPTUREBLT
+#define CAPTUREBLT  0x40000000
+#endif
+
+// Function to capture an area of the screen immediately prior to sending
+// an update.
+void
+vncDesktop::CaptureScreen(const rfb::Rect &rect, BYTE *scrBuff, UINT scrBuffSize,BOOL capture)
+{
+	assert(rect.enclosed_by(m_bmrect));
+	if (capture)
+	{
+		if (OSversion()==1 || OSversion()==2)
+		m_fCaptureAlphaBlending = m_server->CaptureAlphaBlending();
+
+
+		// Select the memory bitmap into the memory DC
+		HBITMAP oldbitmap;
+		if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)
+			return;
+
+	#if defined(_DEBUG)
+		DWORD t = timeGetTime();
+	#endif
+		// Capture screen into bitmap
+		BOOL blitok = false;
+		if (multi_monitor)
+		{
+		blitok=BitBlt(m_hmemdc, 
+			 rect.tl.x,
+			 rect.tl.y,
+			(rect.br.x-rect.tl.x),
+			(rect.br.y-rect.tl.y),
+			m_hrootdc,
+			rect.tl.x+m_ScreenOffsetx,
+			rect.tl.y+m_ScreenOffsety,
+			(m_fCaptureAlphaBlending && !m_Black_window_active) ? (CAPTUREBLT | SRCCOPY) : SRCCOPY
+			);
+		}
+		else
+		{
+			blitok=BitBlt(m_hmemdc, 
+			 rect.tl.x,
+			 rect.tl.y,
+			(rect.br.x-rect.tl.x),
+			(rect.br.y-rect.tl.y),
+			m_hrootdc, rect.tl.x, rect.tl.y, (m_fCaptureAlphaBlending && !m_Black_window_active) ? (CAPTUREBLT | SRCCOPY) : SRCCOPY);
+		}
+	#if defined(_DEBUG)
+		DWORD e = timeGetTime() - t;
+		vnclog.Print(LL_INTWARN, VNCLOG("Blit (%u,%u - %u,%u) (%ux%u took %ums\n"), 
+			rect.tl.x, rect.tl.y, rect.br.x, rect.br.y,
+			rect.width(), rect.height(), e);
+	#endif
+	#if 0
+		//*******************************
+		static int cycle(0);
+		static COLORREF c[] = {RGB(0xFF,0,0), RGB(0,0xFF,0),RGB(0,0,0xFF), RGB(0xFF, 0,0xFF), RGB(0,0xFF,0xFF)};
+	HPEN pen = CreatePen(PS_SOLID|PS_INSIDEFRAME, 2, c[cycle]);
+	HPEN oldpen = (HPEN)SelectObject(m_hmemdc, pen);
+	SelectObject(m_hmemdc, GetStockObject(HOLLOW_BRUSH));
+	Rectangle(m_hmemdc, rect.tl.x, rect.tl.y, rect.br.x, rect.br.y);
+	SelectObject(m_hmemdc, oldpen);
+	DeleteObject(pen);
+		cycle = (cycle + 1) % (sizeof c / sizeof c[0]);
+		//*******************************
+	#endif
+		// Select the old bitmap back into the memory DC
+		SelectObject(m_hmemdc, oldbitmap);
+
+		if (blitok)
+		{
+			// Copy the new data to the screen buffer (CopyToBuffer optimises this if possible)
+			CopyToBuffer(rect, scrBuff, scrBuffSize);
+		}
+	}
+	else
+	{
+		CopyToBuffer(rect, scrBuff, scrBuffSize);
+	}
+
+}
+
+// Add the mouse pointer to the buffer
+void
+vncDesktop::CaptureMouse(BYTE *scrBuff, UINT scrBuffSize)
+{
+	POINT CursorPos;
+	ICONINFO IconInfo = {0};
+
+	// If the mouse cursor handle is invalid then forget it
+	if (m_hcursor == NULL)
+		return;
+
+	// Get the cursor position
+	if (!GetCursorPos(&CursorPos))
+		return;
+	CursorPos.x -= m_ScreenOffsetx;
+	CursorPos.y -= m_ScreenOffsety;
+	//vnclog.Print(LL_INTINFO, VNCLOG("CursorPos %i %i\n"),CursorPos.x, CursorPos.y);
+	// Translate position for hotspot
+	if (GetIconInfo(m_hcursor, &IconInfo))
+	{
+		CursorPos.x -= ((int) IconInfo.xHotspot);
+		CursorPos.y -= ((int) IconInfo.yHotspot);
+		/// Buffer has (0,0) coordinates, Cursor (screencoordinates)
+		CursorPos.x -= m_ScreenOffsetx;
+		CursorPos.y -= m_ScreenOffsety;
+		///
+		
+		if (CursorPos.x<=m_bmrect.tl.x || CursorPos.y<=m_bmrect.tl.y || CursorPos.x>=m_bmrect.br.x || CursorPos.y>=m_bmrect.br.y) 
+		{
+			if ((m_cursorpos.tl.x<=m_bmrect.tl.x)||
+				(m_cursorpos.tl.y<=m_bmrect.tl.y)||
+				(m_cursorpos.br.x>=m_bmrect.br.x)||
+				(m_cursorpos.br.y>=m_bmrect.br.y))
+			{
+				m_cursorpos.tl.x=0;
+				m_cursorpos.tl.y=0;
+				m_cursorpos.br.x=16;
+				m_cursorpos.br.y=16;
+			}
+			//Error, cursor isn't on the visbale display.
+			if (IconInfo.hbmMask != NULL)
+					DeleteObject(IconInfo.hbmMask);
+				if (IconInfo.hbmColor != NULL)
+					DeleteObject(IconInfo.hbmColor);
+			return;
+		}
+
+		// Save the bounding rectangle
+		m_cursorpos.tl = CursorPos;
+		m_cursorpos.br = rfb::Point(GetSystemMetrics(SM_CXCURSOR),
+		GetSystemMetrics(SM_CYCURSOR)).translate(CursorPos);
+		// Clip the bounding rect to the screen
+		// Copy the mouse cursor into the screen buffer, if any of it is visible
+		m_cursorpos = m_cursorpos.intersect(m_bmrect);
+
+		if (IconInfo.hbmMask && IconInfo.hbmColor)
+			{
+					HBITMAP oldbitmap;
+					if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)
+							return;
+					HDC mdc1, mdc2;
+					mdc1 = CreateCompatibleDC(m_hmemdc);
+					mdc2 = CreateCompatibleDC(m_hmemdc);
+					HBITMAP oldbmp1 = (HBITMAP)SelectObject(mdc1, IconInfo.hbmMask);
+					HBITMAP oldbmp2 = (HBITMAP)SelectObject(mdc2, IconInfo.hbmColor);
+					BitBlt(m_hmemdc,m_cursorpos.tl.x, m_cursorpos.tl.y,m_cursorpos.br.x-m_cursorpos.tl.x, m_cursorpos.br.y-m_cursorpos.tl.y, mdc1, 0, 0, SRCAND);
+					BitBlt(m_hmemdc, m_cursorpos.tl.x, m_cursorpos.tl.y, m_cursorpos.br.x-m_cursorpos.tl.x, m_cursorpos.br.y-m_cursorpos.tl.y, mdc2, 0, 0, SRCINVERT);
+
+					SelectObject(m_hmemdc, oldbitmap);
+					SelectObject(mdc1, oldbmp1);
+					SelectObject(mdc2, oldbmp2);
+					DeleteDC(mdc1);
+					DeleteDC(mdc2);
+			}
+		else
+			{
+
+				// Select the memory bitmap into the memory DC
+				HBITMAP oldbitmap;
+				if ((oldbitmap = (HBITMAP) SelectObject(m_hmemdc, m_membitmap)) == NULL)
+					return;
+
+				// Draw the cursor
+				DrawIconEx(
+					m_hmemdc,									// handle to device context 
+					CursorPos.x, CursorPos.y,
+					m_hcursor,									// handle to icon to draw 
+					0,0,										// width of the icon 
+					0,											// index of frame in animated cursor 
+					NULL,										// handle to background brush 
+					DI_NORMAL | DI_COMPAT						// icon-drawing flags 
+					);
+
+				// Select the old bitmap back into the memory DC
+				SelectObject(m_hmemdc, oldbitmap);
+		}
+
+		if (IconInfo.hbmMask != NULL)
+			DeleteObject(IconInfo.hbmMask);
+		if (IconInfo.hbmColor != NULL)
+			DeleteObject(IconInfo.hbmColor);
+	}
+
+
+	if (!m_cursorpos.is_empty()) {
+		CopyToBuffer(m_cursorpos, scrBuff, scrBuffSize);
+	}
+}
+
+
+// CURSOR HANDLING
+// Obtain cursor image data in server's local format.
+// The length of databuf[] should be at least (width * height * 4).
+BOOL
+vncDesktop::GetRichCursorData(BYTE *databuf, HCURSOR hcursor, int width, int height)
+{
+	// Protect the memory bitmap (is it really necessary here?)
+	omni_mutex_lock l(m_update_lock);
+
+	// Create bitmap, select it into memory DC
+	HBITMAP membitmap = CreateCompatibleBitmap(m_hrootdc, width, height);
+	if (membitmap == NULL) {
+		return FALSE;
+	}
+	HBITMAP oldbitmap = (HBITMAP) SelectObject(m_hmemdc, membitmap);
+	if (oldbitmap == NULL) {
+		DeleteObject(membitmap);
+		return FALSE;
+	}
+
+	// Draw the cursor
+	DrawIconEx(m_hmemdc, 0, 0, hcursor, 0, 0, 0, NULL, DI_IMAGE);
+	SelectObject(m_hmemdc, oldbitmap);
+
+	// Prepare BITMAPINFO structure (copy most m_bminfo fields)
+	BITMAPINFO *bmi = (BITMAPINFO *)calloc(1, sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD));
+	int lines=0;
+	if (bmi)
+	{
+	memcpy(bmi, &m_bminfo.bmi, sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD));
+	bmi->bmiHeader.biWidth = width;
+	bmi->bmiHeader.biHeight = -height;
+
+	// Clear data buffer and extract RGB data
+	memset(databuf, 0x00, width * height * 4);
+	lines = GetDIBits(m_hmemdc, membitmap, 0, height, databuf, bmi, DIB_RGB_COLORS);
+
+	// Cleanup
+	free(bmi);
+	}
+	DeleteObject(membitmap);
+
+	return (lines != 0);
+}
+
+// Return the current mouse pointer position
+rfb::Rect
+vncDesktop::MouseRect()
+{
+	return m_cursorpos;
+}
+
+void
+vncDesktop::SetCursor(HCURSOR cursor)
+{
+	if (cursor == NULL)
+		m_hcursor = m_hdefcursor;
+	else
+	{
+		m_hOldcursor = m_hcursor; // sf at 2002
+		m_hcursor = cursor;
+	}
+}
+
+// Manipulation of the clipboard
+void vncDesktop::SetClipText(char* rfbStr)
+{
+  // Open the system clipboard
+  if (OpenClipboard(m_hwnd))
+  {
+    // Empty it
+    if (EmptyClipboard())
+    {
+	  // adzm - 2010-07 - Extended clipboard
+      HANDLE hMem = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, strlen(rfbStr) + 1);
+
+      if (hMem != NULL)
+      {
+        LPSTR pMem = (char*)GlobalLock(hMem);
+
+        // Get the data
+		if (pMem)
+		{
+			strcpy(pMem, rfbStr);
+        	// Tell the clipboard
+        	GlobalUnlock(hMem);
+        	SetClipboardData(CF_TEXT, hMem);
+		}
+      }
+    }
+  }
+
+  // Now close it
+  CloseClipboard();
+}
+
+// adzm - 2010-07 - Extended clipboard
+void vncDesktop::SetClipTextEx(ExtendedClipboardDataMessage& extendedClipboardDataMessage)
+{
+	bool bRestored = false;
+	{
+		ClipboardData newClipboard;
+
+		if (newClipboard.Restore(Window(), extendedClipboardDataMessage)) {
+			vnclog.Print(LL_INTINFO, VNCLOG("Set extended clipboard data\n"));
+
+			bRestored = true;
+			newClipboard.FreeData();
+		} else {
+			vnclog.Print(LL_INTWARN, VNCLOG("Failed to set extended clipboard data\n"));
+		}
+	}
+}
+
+// INTERNAL METHODS
+
+inline void
+vncDesktop::MaskToMaxAndShift(DWORD mask, CARD16 &max, CARD8 &shift)
+{
+	for (shift = 0; (mask & 1) == 0; shift++)
+		mask >>= 1;
+	max = (CARD16) mask;
+}
+
+// Copy data from the memory bitmap into a buffer
+void
+vncDesktop::CopyToBuffer(const rfb::Rect &rect, BYTE *destbuff, UINT destbuffsize)
+{
+	// Finish drawing anything in this thread 
+	// Wish we could do this for the whole system - maybe we should
+	// do something with LockWindowUpdate here.
+	GdiFlush();
+
+	// Are we being asked to blit from the DIBsection to itself?
+	if (destbuff == m_DIBbits) {
+		// Yes.  Ignore the request!
+		return;
+	}
+
+	int y_inv;
+	BYTE * destbuffpos;
+
+	// Calculate the scanline-ordered y position to copy from
+	y_inv = m_scrinfo.framebufferHeight-rect.tl.y-(rect.br.y-rect.tl.y);
+
+	// Calculate where in the output buffer to put the data
+	destbuffpos = destbuff + (m_bytesPerRow * rect.tl.y);
+
+	// Set the number of bytes for GetDIBits to actually write
+	// NOTE : GetDIBits pads the destination buffer if biSizeImage < no. of bytes required
+	m_bminfo.bmi.bmiHeader.biSizeImage = (rect.br.y-rect.tl.y) * m_bytesPerRow;
+
+	// Get the actual bits from the bitmap into the bit buffer
+	// If fast (DIBsection) blits are disabled then use the old GetDIBits technique
+	if (m_DIBbits == NULL) {
+		if (GetDIBits(m_hmemdc, m_membitmap, y_inv,
+					(rect.br.y-rect.tl.y), destbuffpos,
+					&m_bminfo.bmi, DIB_RGB_COLORS) == 0)
+		{
+#ifdef _MSC_VER
+			_RPT1(_CRT_WARN, "vncDesktop : [1] GetDIBits failed! %d\n", GetLastError());
+			_RPT3(_CRT_WARN, "vncDesktop : thread = %d, DC = %d, bitmap = %d\n", omni_thread::self(), m_hmemdc, m_membitmap);
+			_RPT2(_CRT_WARN, "vncDesktop : y = %d, height = %d\n", y_inv, (rect.br.y-rect.tl.y));
+#endif
+		}
+	} else {
+		// Fast blits are enabled.  [I have a sneaking suspicion this will never get used, unless
+		// something weird goes wrong in the code.  It's here to keep the function general, though!]
+
+		int bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
+		BYTE *srcbuffpos = (BYTE*)m_DIBbits;
+
+		srcbuffpos += (m_bytesPerRow * rect.tl.y) + (bytesPerPixel * rect.tl.x);
+		destbuffpos += bytesPerPixel * rect.tl.x;
+
+		int widthBytes = (rect.br.x-rect.tl.x) * bytesPerPixel;
+
+		for(int y = rect.tl.y; y < rect.br.y; y++)
+		{
+			memcpy(destbuffpos, srcbuffpos, widthBytes);
+			srcbuffpos += m_bytesPerRow;
+			destbuffpos += m_bytesPerRow;
+		}
+	}
+}
+
+// Routine to find out which windows have moved
+// If copyrect detection isn't perfect then this call returns
+// the copyrect destination region, to allow the caller to check
+// for mistakes
+bool
+vncDesktop::CalcCopyRects(rfb::UpdateTracker &tracker)
+{
+	HWND foreground = GetForegroundWindow();
+	RECT foreground_rect;
+
+	// Actually, we just compare the new and old foreground window & its position
+	if (foreground != m_foreground_window) {
+		m_foreground_window=foreground;
+		// Is the window invisible or can we not get its rect?
+		if (!IsWindowVisible(foreground) ||
+			!GetWindowRect(foreground, &foreground_rect)) {
+			//Buffer coordinates
+			m_foreground_window_rect.clear();
+		} else {
+			foreground_rect.left-=m_ScreenOffsetx;
+			foreground_rect.right-=m_ScreenOffsetx;
+			foreground_rect.top-=m_ScreenOffsety;
+			foreground_rect.bottom-=m_ScreenOffsety;
+			m_foreground_window_rect = foreground_rect;
+		}
+	} else {
+		// Same window is in the foreground - let's see if it's moved
+		RECT destrect;
+		rfb::Rect dest;
+		rfb::Point source;
+
+		// Get the window rectangle
+		if (IsWindowVisible(foreground) && GetWindowRect(foreground, &destrect))
+		{
+			//vnclog.Print(LL_INTERR, VNCLOG("foreground %i %i %i %i\n"),destrect.left,destrect.right,destrect.top,destrect.bottom);
+			//screen to buffer coordinates
+			destrect.left-=m_ScreenOffsetx;
+			destrect.right-=m_ScreenOffsetx;
+			destrect.top-=m_ScreenOffsety;
+			destrect.bottom-=m_ScreenOffsety;
+			//vnclog.Print(LL_INTERR, VNCLOG("foreground %i %i %i %i\n"),destrect.left,destrect.right,destrect.top,destrect.bottom);
+
+			//We cant have negative coordinates
+			//move window on desktop 1 and show desktop 2
+			if (destrect.left<0 || destrect.right<0 || destrect.top<0 || destrect.bottom<0) return false;
+			// we also can have to big coordinates
+			// move window on desktop2 and show desktop 1
+			if (destrect.left > m_Cliprect.br.x ||destrect.right > m_Cliprect.br.x ||destrect.top > m_Cliprect.br.y ||destrect.bottom > m_Cliprect.br.y)
+			return false;
+
+
+			rfb::Rect old_foreground_window_rect = m_foreground_window_rect;
+			source = m_foreground_window_rect.tl;
+			m_foreground_window_rect = dest = destrect;
+			//vnclog.Print(LL_INTERR, VNCLOG("dest %i %i %i %i\n"),dest.tl.x,dest.br.x,dest.tl.y,dest.br.y);
+			//vnclog.Print(LL_INTERR, VNCLOG("source %i %i \n"),source.x,source.y);
+
+			if (!dest.is_empty() && !old_foreground_window_rect.is_empty())
+			{
+				// Got the destination position.  Now send to clients!
+				if (!source.equals(dest.tl))
+				{
+					rfb::Point delta;
+					delta= rfb::Point(dest.tl.x-source.x, dest.tl.y-source.y);
+				//	if (dest.tl.x-source.x==0 || dest.tl.y-source.y==0) return false;
+					//vnclog.Print(LL_INTERR, VNCLOG("delta %i %i \n"),delta.x,delta.y);
+
+					// Clip the destination rectangle
+					dest = dest.intersect(m_bmrect);
+					//vnclog.Print(LL_INTERR, VNCLOG("dest2 %i %i %i %i\n"),dest.tl.x,dest.br.x,dest.tl.y,dest.br.y);
+					if (dest.is_empty()) return false;
+					// Clip the source rectangle
+					dest = dest.translate(delta.negate()).intersect(m_bmrect);
+					//vnclog.Print(LL_INTERR, VNCLOG("dest3 %i %i %i %i\n"),dest.tl.x,dest.br.x,dest.tl.y,dest.br.y);
+					if (dest.tl.x<0 || dest.br.x<0 || dest.tl.y<0 || dest.br.y<0) return false;
+					if (dest.tl.x > m_Cliprect.br.x ||dest.br.x > m_Cliprect.br.x ||dest.tl.y > m_Cliprect.br.y ||dest.br.y > m_Cliprect.br.y)
+					return false;
+					m_buffer.ClearCacheRect(dest);
+					dest = dest.translate(delta);
+					//vnclog.Print(LL_INTERR, VNCLOG("dest4 %i %i %i %i\n"),dest.tl.x,dest.br.x,dest.tl.y,dest.br.y);
+					m_buffer.ClearCacheRect(dest);
+					if (!dest.is_empty()) {
+						tracker.add_copied(dest, delta);
+						return true;
+					}
+				}
+			}
+		} else {
+			m_foreground_window_rect.clear();
+		}
+	}
+	return false;
+}
+
+
+// added jef
+void vncDesktop::SetBlankMonitor(bool enabled)
+{
+
+	// Added Jef Fix
+	typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);
+	PSLWA pSetLayeredWindowAttributes=NULL;
+	HMODULE hDLL = LoadLibrary ("user32");
+	if (hDLL) pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL,"SetLayeredWindowAttributes");
+	if (!pSetLayeredWindowAttributes) m_server->BlackAlphaBlending(false);
+	//if (VideoBuffer()) m_server->BlackAlphaBlending(false);
+
+    vnclog.Print(LL_INTINFO, VNCLOG("SetBlankMonitor: monitor %s, using alpha %s\n"), 
+        enabled ? "off" : "on",
+        m_server->BlackAlphaBlending() ? "true" : "false");
+
+	// Also Turn Off the Monitor if allowed ("Blank Screen", "Blank Monitor")
+	if (m_server->BlankMonitorEnabled())
+    {
+	    if (enabled)
+	    {
+		    if ((!m_server->BlackAlphaBlending() || VideoBuffer()) && (OSversion()!=2))
+		    {
+			    SetProcessShutdownParameters(0x100, 0);
+			    SystemParametersInfo(SPI_GETPOWEROFFTIMEOUT, 0, &OldPowerOffTimeout, 0);
+			    SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT, 100, NULL, 0);
+			    SystemParametersInfo(SPI_SETPOWEROFFACTIVE, 1, NULL, 0);
+			    SendMessage(m_hwnd,WM_SYSCOMMAND,SC_MONITORPOWER,(LPARAM)2);
+		    }
+		    else
+		    {
+			    HANDLE ThreadHandle2=NULL;
+			    DWORD dwTId;
+			    ThreadHandle2 = CreateThread(NULL, 0, BlackWindow, NULL, 0, &dwTId);
+			   if (ThreadHandle2)  CloseHandle(ThreadHandle2);
+			    m_Black_window_active=true;
+		    }
+	    }
+	    else // Monitor On
+	    {
+		    if ((!m_server->BlackAlphaBlending() || VideoBuffer()) && (OSversion()!=2))
+		    {
+			    if (OldPowerOffTimeout!=0)
+				    SystemParametersInfo(SPI_SETPOWEROFFTIMEOUT, OldPowerOffTimeout, NULL, 0);
+			    SystemParametersInfo(SPI_SETPOWEROFFACTIVE, 0, NULL, 0);
+			    if (m_hwnd!=NULL) SendMessage(m_hwnd,WM_SYSCOMMAND,SC_MONITORPOWER,(LPARAM)-1);
+			    OldPowerOffTimeout=0;
+				//JUst in case video driver state was changed
+				HWND Blackhnd = FindWindow(("blackscreen"), 0);
+			    if (Blackhnd) PostMessage(Blackhnd, WM_CLOSE, 0, 0);
+		    }
+		    else
+		    {
+			    HWND Blackhnd = FindWindow(("blackscreen"), 0);
+			    if (Blackhnd) PostMessage(Blackhnd, WM_CLOSE, 0, 0);
+			    m_Black_window_active=false;
+		    }
+	    }
+    }
+}
+
+
+// Modif rdv at 2002 Dis/enable input
+void
+vncDesktop::SetDisableInput()
+{
+    CARD32 state;
+    state=!block_input();
+    m_server->NotifyClients_StateChange(rfbServerRemoteInputsState, state);
+}
+
+
+// SW
+void vncDesktop::SetSW(int x,int y)
+{
+	POINT point;
+	point.x=x;
+	point.y=y;
+	MONITORINFO monitorinfo;
+	monitorinfo.cbSize=sizeof(MONITORINFO);
+
+    helper::DynamicFn<LPGETMONITORINFO> GetMonitorInfo("USER32","GetMonitorInfoA");
+    helper::DynamicFn<LPMONITOTFROMPOINT> MonitorFromPoint("USER32","MonitorFromPointA");
+
+	if (x <= 5 && y<=5 && x>-5 && y>-5) 
+		{
+			// 2= multi monitor
+			// 1= single monitor
+			if (requested_multi_monitor)m_buffer.MultiMonitors(1);
+			else m_buffer.MultiMonitors(2);
+			m_Single_hWnd=NULL;
+			return;
+		}
+	//SW is disabled seems to crash server
+	//until found and fixed we better disabled it to avoid
+	//this
+	return;
+
+	m_Single_hWnd=WindowFromPoint(point);
+
+	if (m_Single_hWnd==GetDesktopWindow())
+		{
+			if (GetMonitorInfo.isValid() && MonitorFromPoint.isValid())
+			{
+				HMONITOR hmonitor= (*MonitorFromPoint)(point,MONITOR_DEFAULTTONEAREST);
+				(*GetMonitorInfo)(hmonitor,&monitorinfo);
+				if (monitorinfo.dwFlags ==MONITORINFOF_PRIMARY) 
+				{
+					m_buffer.MultiMonitors(1);
+					m_Single_hWnd=NULL;
+				}
+				else
+				{
+					m_buffer.MultiMonitors(2);
+					m_Single_hWnd=NULL;
+				}
+			}
+			return;
+		}
+
+	if (m_Single_hWnd==NULL) m_server->SingleWindow(false);
+	else
+		{
+		HWND parent;
+		while((parent=GetParent(m_Single_hWnd))!=NULL)
+			{
+				m_Single_hWnd=parent;
+			}
+		m_server->SingleWindow(true);
+		}
+
+}
+
+/***************************************************************************
+* Ultravnc use 2 different software hooking methods 
+* hookdll: Hook the messages between the windows (nt,9.x)
+* ddihook: Hook the messages to the video buffer (9.x)
+* Driver hooking
+* Driver hooking is done at kernel level.
+* and exist of 2 parts
+* update mechanism: rectangles are send from kernel to vnc (shared mem)
+* shared video buffer: direct access the memeory without bitblit
+*  m_hookdriver: use driver update mechanism (ddihook in case of 9.x)
+*  m_hookdll: use software update mechanism
+***************************************************************************/
+
+// Modif rdv at 2002 - v1.1.x - videodriver
+
+BOOL vncDesktop::VideoBuffer()
+{
+	//Always access the shared mememory thru this function
+	// Check NULL
+	if (m_videodriver==NULL) return FALSE;
+	if (m_videodriver->mypVideoMemory) return true;
+
+	if (!m_videodriver->mypVideoMemory)
+	{
+		m_hookswitch=true;
+		Hookdll_Changed=true;
+		return FALSE;
+	}
+	return FALSE;
+}
+
+DWORD WINAPI Warningbox_non_locked(LPVOID lpParam)
+{
+	MessageBoxSecure(NULL,"Current driver to old for this version \nUpdate driver or disable Video hook driver\n in the server properties window","",0);
+	return 0;
+}
+
+// Modif rdv at 2002 - v1.1.x - videodriver
+BOOL vncDesktop::InitVideoDriver()
+{
+	omni_mutex_lock l(m_videodriver_lock);
+	
+	if(!(OSversion()==1  || OSversion()==2)) return true; //we need w2k or xp
+	vnclog.Print(LL_INTERR, VNCLOG("Driver option is enabled\n"));
+	// If m_videodriver exist, the driver was activated.
+	// This does not mean he is still active
+	// Screen switching disable the driver at kernel level
+	// The pointers to the shared memory still exist, but no more memeory
+	// associated...This is the biggest risk when using the driver
+	//
+
+	// First check driver version
+	if (m_videodriver!=NULL) 
+	{
+		
+								vnclog.Print(LL_INTERR, VNCLOG("Closing pending driver driver version\n"));
+								if (m_videodriver!=NULL) delete m_videodriver;
+			
+	}
+
+	m_videodriver=new VIDEODRIVER;
+	//try to use the mirror driver if he is still active
+	Checkmonitors();
+	nr_monitors=GetNrMonitors();
+	if (nr_monitors==1)
+		{
+			m_ScreenOffsetx=mymonitor[0].offsetx;
+			m_ScreenOffsety=mymonitor[0].offsety;
+			m_videodriver->VIDEODRIVER_start(mymonitor[0].offsetx,mymonitor[0].offsety,mymonitor[0].Width,mymonitor[0].Height);
+		}
+	if (nr_monitors>1)
+		{
+			m_ScreenOffsetx=mymonitor[2].offsetx;
+			m_ScreenOffsety=mymonitor[2].offsety;
+			m_videodriver->VIDEODRIVER_start(mymonitor[2].offsetx,mymonitor[2].offsety,mymonitor[2].Width,mymonitor[2].Height);
+		}		
+	vnclog.Print(LL_INTERR, VNCLOG("Start Mirror driver\n"));
+	m_hookdriver=true;
+	m_hookdll=false;
+	// check if driver has mapped the shared memory
+	if (!m_videodriver->mypVideoMemory) 
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("Start Mirror driver Failed\n"));
+		vnclog.Print(LL_INTERR, VNCLOG("Using non driver mode\n"));
+		if (m_videodriver!=NULL) delete m_videodriver;
+		m_videodriver=NULL;
+		// If driver selected and fialed to start default to hookdll
+		// 
+		m_hookdriver=false;
+		m_hookdll=true;
+		// sf at 2002 - Necessary for the following InitHookSettings() call
+		// Remember old states
+		DriverWantedSet=true;
+		DriverWanted=m_server->Driver();
+		HookWanted=m_server->Hook();
+		m_server->Driver(false);
+		m_server->Hook(true);
+		return false;
+	}
+	
+	if (m_videodriver->mypVideoMemory)
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("Driver Used\n"));
+		if (!m_videodriver->mypVideoMemory)
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("Unable to map memory\n"));
+			delete m_videodriver;
+			m_videodriver=NULL;
+			// If driver selected and fialed to start default to hookdll
+			// 
+			m_hookdriver=false;
+			m_hookdll=true;
+			return false;
+		}
+		vnclog.Print(LL_INTERR, VNCLOG("Shared memory mapped\n"));
+		InvalidateRect(NULL,NULL,TRUE);
+
+		return true;
+	}
+	return true;
+}
+
+
+// Modif rdv at 2002 - v1.1.x - videodriver
+void vncDesktop::ShutdownVideoDriver()
+{
+	if(!(OSversion()!=1 || OSversion()!=2)) return;
+	if (m_videodriver==NULL) return;
+	if (m_videodriver!=NULL)
+	{
+		delete m_videodriver;
+		m_videodriver=NULL;
+	}
+	StopDriverWatches=true;
+}
+
+
+//
+// This proc sets the Desktop update handling params depending
+// on tranitted settings and internal constraints.
+// It is called from several places (InitHookSettings(), SetHookings()
+// and from Desktop thread loop).
+// 
+void vncDesktop::SethookMechanism(BOOL hookall,BOOL hookdriver)
+{
+	m_hookswitch=false;
+	// Force at least one updates handling method !
+	if (!hookall && !hookdriver && !m_server->PollFullScreen())
+	{
+		hookall = TRUE;
+		m_server->PollFullScreen(TRUE);
+	}
+
+	// 9,x case 
+	vnclog.Print(LL_INTERR, VNCLOG("SethookMechanism called\r\n"));
+	if(OSversion()==4 || OSversion()==5)
+	{
+		m_hookdriver=false;//(user driver updates)
+		m_hookdll=false;//(use hookdll updates)
+		if (hookall || hookdriver) m_hookdll=true;
+		//always try to stop the ddihook before starting
+		StartStopddihook(false);ddihook=false;
+		if (hookdriver) StartStopddihook(true);
+		// same for the hookdll
+		BOOL old_On_Off_hookdll=On_Off_hookdll;
+		if (hookdriver || hookall) On_Off_hookdll=true;
+		else On_Off_hookdll=false;
+		if (old_On_Off_hookdll!=On_Off_hookdll) Hookdll_Changed=true;
+		else Hookdll_Changed=false;
+	}
+	// W2k-XP case
+	else if(OSversion()==1 || OSversion()==2)
+	{
+		// sf at 2002 - We forbid hoodll and hookdriver at the same time (pointless and high CPU load)
+		if (!hookall && !hookdriver) {m_hookdll=false;m_hookdriver=false;}
+		if (hookall && hookdriver) {m_hookdll=false;m_hookdriver=true;}
+		if (hookall && !hookdriver) {m_hookdll=true;m_hookdriver=false;}
+		if (!hookall && hookdriver) {m_hookdll=false;m_hookdriver=true;}
+
+		BOOL old_On_Off_hookdll=On_Off_hookdll;
+		if (m_hookdll) On_Off_hookdll=true;
+		else On_Off_hookdll=false;
+		if (old_On_Off_hookdll!=On_Off_hookdll) Hookdll_Changed=true;
+		else Hookdll_Changed=false;
+		if (OSversion()==2) Hookdll_Changed=true;
+		
+		vnclog.Print(LL_INTERR, VNCLOG("Sethook_restart_wanted hook=%d driver=%d \r\n"),m_hookdll,m_hookdriver);
+		if (Hookdll_Changed)
+			vnclog.Print(LL_INTERR, VNCLOG("Hookdll status changed \r\n"));
+
+		if ((m_hookdriver && !VideoBuffer()) || (!m_hookdriver && VideoBuffer()))
+		{
+			m_hookswitch=true;
+			vnclog.Print(LL_INTERR, VNCLOG("Driver Status changed\r\n"));
+		}
+	}
+	else //NT4
+	{
+		if (!hookall && !hookdriver) {m_hookdll=false;m_hookdriver=false;}
+		if (hookall && hookdriver) {m_hookdll=true;m_hookdriver=false;}
+		if (hookall && !hookdriver) {m_hookdll=true;m_hookdriver=false;}
+		if (!hookall && hookdriver) {m_hookdll=false;m_hookdriver=false;}
+		BOOL old_On_Off_hookdll=On_Off_hookdll;
+		if (m_hookdll) On_Off_hookdll=true;
+		else On_Off_hookdll=false;
+		if (old_On_Off_hookdll!=On_Off_hookdll) Hookdll_Changed=true;
+		else Hookdll_Changed=false;
+	}
+
+}
+void vncDesktop::StartStopddihook(BOOL enabled)
+{
+	if (enabled)
+	{
+		STARTUPINFO ssi;
+		PROCESS_INFORMATION ppi;
+		m_hddihook=NULL;
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return;
+			*p = '\0';
+			strcat (szCurrentDir,"\\16bithlp.exe");
+		}
+		// Add ddi hook
+		ZeroMemory( &ssi, sizeof(ssi) );
+		ssi.cb = sizeof(ssi);
+		// Start the child process. 
+		if( !CreateProcess( NULL,szCurrentDir, NULL,NULL,FALSE,0,NULL,NULL,&ssi,&ppi ) ) 
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("set ddihooks Failed\n"));
+			ddihook=false;
+		}
+		else
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("set ddihooks OK\n"));
+			ddihook=true;
+			WaitForInputIdle(ppi.hProcess, 10000);
+			m_hddihook=ppi.hProcess;
+		}
+	}
+	else
+	{
+		if (m_hddihook != NULL)
+		{
+			TerminateProcess(m_hddihook,0);
+			m_hddihook=NULL;
+			ddihook=false;
+		}
+	}
+
+}
+
+void vncDesktop::StartStophookdll(BOOL enabled)
+{
+	vnclog.Print(LL_INTERR, VNCLOG("PostMessage(m_hwnd, WM_HOOKCHANGE \n"));
+	PostMessage(m_hwnd, WM_HOOKCHANGE, enabled, 0);
+}
+
+
+//
+//
+//
+void vncDesktop::InitHookSettings()
+{
+	SethookMechanism(m_server->Hook(),m_server->Driver());
+}
+
+
+void vncDesktop::SetBlockInputState(bool newstate)
+{
+	CARD32 state = 0;
+	if (m_server->BlankMonitorEnabled())
+    {
+		if (!m_server->BlankInputsOnly()) 
+			{
+				if (blankmonitorstate==1 && newstate==1) 
+					{
+						SetBlankMonitor(0);
+						blankmonitorstate=0;
+					}
+				else
+				{
+					SetBlankMonitor(newstate);	
+					blankmonitorstate=newstate;
+				}
+			}
+		m_bIsInputDisabledByClient=newstate;
+		state=!block_input();
+		
+    }
+	else state=!newstate;
+
+	m_bIsInputDisabledByClient = !state;
+
+ m_server->NotifyClients_StateChange(rfbServerRemoteInputsState, state);
+}
+
+bool vncDesktop::block_input()
+{
+    int Blockinput_val;
+	BOOL returnvalue;
+	if(m_bIsInputDisabledByClient || m_server->LocalInputsDisabled())
+	{
+		Blockinput_val=true;
+	}
+	else
+	{
+		Blockinput_val=false;
+	}
+
+	/*#ifdef _DEBUG
+					char			szText[256];
+					sprintf(szText," blockinput %i %i %i %i\n",m_bIsInputDisabledByClient,m_server->LocalInputsDisabled(),old_Blockinput1,old_Blockinput2);
+					SetLastError(0);
+					OutputDebugString(szText);		
+	#endif*/
+
+	if (old_Blockinput1!=m_bIsInputDisabledByClient || old_Blockinput2!=m_server->LocalInputsDisabled())
+	{
+		CARD32 state;
+		state=!Blockinput_val;
+		m_server->NotifyClients_StateChange(rfbServerRemoteInputsState, state);
+	}
+    if (pbi)
+    {
+        returnvalue = (*pbi)(Blockinput_val);
+		DWORD aa=GetLastError();
+		if (old_Blockinput!=Blockinput_val && aa==5)
+		{
+			if (m_hookinited)
+			PostMessage(m_hwnd, WM_HOOKCHANGE, 2, 0);
+			else Blockinput_val=false;
+		}
+
+    }
+	old_Blockinput1=m_bIsInputDisabledByClient;
+	old_Blockinput2=m_server->LocalInputsDisabled();
+	old_Blockinput=Blockinput_val;
+
+    return Blockinput_val;
+}
diff --git a/ica/win32/winvnc/winvnc/vncdesktop.h b/ica/win32/winvnc/winvnc/vncdesktop.h
new file mode 100644
index 0000000..a908907
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncdesktop.h
@@ -0,0 +1,537 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncDesktop object
+
+// The vncDesktop object handles retrieval of data from the
+// display buffer.  It also uses the RFBLib DLL to supply
+// information on mouse movements and screen updates to
+// the server
+
+class vncDesktop;
+
+#if !defined(_WINVNC_VNCDESKTOP)
+#define _WINVNC_VNCDESKTOP
+#pragma once
+
+// Include files
+#include "stdhdrs.h"
+
+class vncServer;
+#include "rfbRegion.h"
+#include "rfbUpdateTracker.h"
+#include "vncbuffer.h"
+#include "translate.h"
+#include <omnithread.h>
+
+// Modif rdv at 2002 - v1.1.x - videodriver
+#include "videodriver.h"
+
+// Modif sf at 2002 - v1.1.0
+#include <list>
+#include <set>
+#include "TextChat.h"
+#ifdef AVILOG
+#include "avilog/avilog/AVIGenerator.h"
+#endif
+// adzm - 2010-07 - Extended clipboard
+#include "common/Clipboard.h"
+//#define COMPILE_MULTIMON_STUBS
+//#include "Multimon.h"
+#ifndef SM_CMONITORS
+
+#define SM_XVIRTUALSCREEN       76
+#define SM_YVIRTUALSCREEN       77
+#define SM_CXVIRTUALSCREEN      78
+#define SM_CYVIRTUALSCREEN      79
+#define SM_CMONITORS            80
+#define SM_SAMEDISPLAYFORMAT    81
+
+// HMONITOR is already declared if WINVER >= 0x0500 in windef.h
+// This is for components built with an older version number.
+//
+#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
+DECLARE_HANDLE(HMONITOR);
+#define HMONITOR_DECLARED
+#endif
+
+#define MONITOR_DEFAULTTONULL       0x00000000
+#define MONITOR_DEFAULTTOPRIMARY    0x00000001
+#define MONITOR_DEFAULTTONEAREST    0x00000002
+
+#define MONITORINFOF_PRIMARY        0x00000001
+
+typedef struct tagMONITORINFO
+{
+    DWORD   cbSize;
+    RECT    rcMonitor;
+    RECT    rcWork;
+    DWORD   dwFlags;
+} MONITORINFO, *LPMONITORINFO;
+
+#ifndef CCHDEVICENAME
+#define CCHDEVICENAME 32
+#endif
+
+#ifdef __cplusplus
+typedef struct tagMONITORINFOEXA : public tagMONITORINFO
+{
+    CHAR        szDevice[CCHDEVICENAME];
+} MONITORINFOEXA, *LPMONITORINFOEXA;
+typedef struct tagMONITORINFOEXW : public tagMONITORINFO
+{
+    WCHAR       szDevice[CCHDEVICENAME];
+} MONITORINFOEXW, *LPMONITORINFOEXW;
+#ifdef UNICODE
+typedef MONITORINFOEXW MONITORINFOEX;
+typedef LPMONITORINFOEXW LPMONITORINFOEX;
+#else
+typedef MONITORINFOEXA MONITORINFOEX;
+typedef LPMONITORINFOEXA LPMONITORINFOEX;
+#endif // UNICODE
+#else // ndef __cplusplus
+typedef struct tagMONITORINFOEXA
+{
+    MONITORINFO;
+    CHAR        szDevice[CCHDEVICENAME];
+} MONITORINFOEXA, *LPMONITORINFOEXA;
+typedef struct tagMONITORINFOEXW
+{
+    MONITORINFO;
+    WCHAR       szDevice[CCHDEVICENAME];
+} MONITORINFOEXW, *LPMONITORINFOEXW;
+#ifdef UNICODE
+typedef MONITORINFOEXW MONITORINFOEX;
+typedef LPMONITORINFOEXW LPMONITORINFOEX;
+#else
+typedef MONITORINFOEXA MONITORINFOEX;
+typedef LPMONITORINFOEXA LPMONITORINFOEX;
+#endif // UNICODE
+#endif
+#endif
+
+typedef std::vector<COLORREF> RGBPixelList;   // List of RGB values (pixels)
+// sf at 2002 - Generates ClassName lenght warning in debug mode compile.
+// typedef std::list<RGBPixelList*> GridsList; // List of Grids of pixels
+typedef std::vector<RGBPixelList*> GridsList; // List of Grids of pixels
+typedef std::set<HWND> WindowsList;       // List of windows handles
+
+
+// Constants
+extern const UINT RFB_SCREEN_UPDATE;
+extern const UINT RFB_COPYRECT_UPDATE;
+extern const UINT RFB_MOUSE_UPDATE;
+extern const char szDesktopSink[];
+
+#define NONE 0
+#define MIRROR 1
+#define PSEUDO 2
+
+// initialization errors
+#define ERROR_DESKTOP_NO_PALETTE 					    1
+#define ERROR_DESKTOP_INIT_FAILED 					    2
+#define ERROR_DESKTOP_UNSUPPORTED_PIXEL_ORGANIZATION    3
+#define ERROR_DESKTOP_UNSUPPORTED_PIXEL_FORMAT 		    4
+#define ERROR_DESKTOP_NO_HOOKWINDOW 				    5
+#define ERROR_DESKTOP_NO_ROOTDC                         6
+#define ERROR_DESKTOP_NO_BITBLT                         7
+#define ERROR_DESKTOP_NO_GETDIBITS                      8
+#define ERROR_DESKTOP_NO_COMPATBITMAP                   9
+#define ERROR_DESKTOP_NO_DISPLAYFORMAT                  10
+#define ERROR_DESKTOP_OUT_OF_MEMORY                     11
+#define ERROR_DESKTOP_NO_DIBSECTION_OR_COMPATBITMAP     12
+#define ERROR_DESKTOP_NO_DESKTOPTHREAD                  13
+typedef struct DrvWatch
+{
+	HWND hwnd;
+	bool *stop;
+}DrvWatch;
+
+typedef BOOL (*SetHooksFn)(DWORD thread_id,UINT UpdateMsg,UINT CopyMsg,UINT MouseMsg,BOOL ddihook);
+typedef BOOL (*UnSetHooksFn)(DWORD thread_id);
+typedef BOOL (*SetKeyboardFilterHookFn)(BOOL activate);	
+typedef BOOL (*SetMouseFilterHookFn)(BOOL activate);
+typedef BOOL (*SetHookFn)(HWND hwnd);
+typedef BOOL (*UnSetHookFn)(HWND hwnd);
+
+typedef BOOL (WINAPI*  pBlockInput) (BOOL);
+typedef BOOL (WINAPI* LPGETMONITORINFO)(HMONITOR, LPMONITORINFO);
+typedef HMONITOR (WINAPI* LPMONITOTFROMPOINT) (POINT,DWORD);
+
+
+// Class definition
+// multi monitor
+struct monitor
+{
+	int Width;
+	int Height;
+	int Depth;
+	char device[32];
+	int offsetx;
+	int offsety;
+};
+
+
+class PixelCaptureEngine
+{
+public:
+	PixelCaptureEngine();
+	~PixelCaptureEngine();
+	void PixelCaptureEngineInit(HDC rootdc, HDC memdc, HBITMAP membitmap, bool bCaptureAlpha, void *dibbits, int bpp, int bpr);
+	bool CaptureRect(const rfb::Rect& rect);
+	COLORREF CapturePixel(int x, int y);
+	void ReleaseCapture();
+	bool		m_bIsVista;
+
+private:
+	HDC			m_hrootdc;
+	HDC			m_hmemdc;
+	HBITMAP		m_membitmap;
+	HBITMAP		m_oldbitmap;
+	void		*m_DIBbits;
+	rfb::Rect	m_rect;
+	bool		m_bCaptureAlpha;
+	int			m_bytesPerPixel;
+	int			m_bytesPerRow;
+};
+
+class vncDesktop
+{
+
+// Fields
+public:
+
+// Methods
+public:
+	// Make the desktop thread & window proc friends
+	friend class vncDesktopThread;
+	friend LRESULT CALLBACK DesktopWndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
+
+	// Create/Destroy methods
+	vncDesktop();
+	~vncDesktop();
+
+	DWORD Init(vncServer *pSrv);
+
+	// Tell the desktop hooks to grab & update a particular rectangle
+	void QueueRect(const rfb::Rect &rect);
+	
+	// Kick the desktop hooks to perform an update
+	void TriggerUpdate();
+
+	// Get a reference to the desktop update lock
+	// The lock is held while data is being grabbed and copied
+	// to the back buffer, and while changes are being passed to
+	// clients
+	omni_mutex &GetUpdateLock() {return m_update_lock;};
+
+	// Screen translation, capture, info
+	void FillDisplayInfo(rfbServerInitMsg *scrInfo);
+	void CaptureScreen(const rfb::Rect &UpdateArea, BYTE *scrBuff, UINT scrBuffSize,BOOL capture);
+	int ScreenBuffSize();
+	HWND Window() {return m_hwnd;};
+
+	// Mouse related
+	void CaptureMouse(BYTE *scrBuff, UINT scrBuffSize);
+	rfb::Rect MouseRect();
+	void SetCursor(HCURSOR cursor);
+	// CURSOR HANDLING
+	BOOL GetRichCursorData(BYTE *databuf, HCURSOR hcursor, int width, int height);
+	HCURSOR GetCursor() { return m_hcursor; }
+
+	// Clipboard manipulation
+	void SetClipText(LPSTR text);
+	// adzm - 2010-07 - Extended clipboard
+	void SetClipTextEx(ExtendedClipboardDataMessage& extendedClipboardDataMessage);
+
+	// Method to obtain the DIBsection buffer if fast blits are enabled
+	// If they're disabled, it'll return NULL
+	inline VOID *OptimisedBlitBuffer() {return m_DIBbits;};
+
+	// adzm - 2010-07 - Extended clipboard
+	//BOOL	m_initialClipBoardSeen;
+
+	// Handler for pixel data grabbing and region change checking
+	vncBuffer		m_buffer;
+		//SINGLE WINDOW
+	vncServer		*GetServerPointer() {return m_server;};
+	HWND			m_Single_hWnd;
+	HWND			m_Single_hWnd_backup;
+	BOOL			CalculateSWrect(RECT &rect);
+	rfb::Rect		GetSize();
+	rfb::Rect		GetQuarterSize();
+
+	// Modif rdv at 2002 - v1.1.x - videodriver
+	//BOOL IsVideoDriverEnabled();
+	BOOL VideoBuffer();
+	int m_ScreenOffsetx;
+	int m_ScreenOffsety;
+	int DriverType;
+	DWORD color[10];
+	// added jeff
+	void SetBlankMonitor(bool enabled);
+	// Modif rdv at 2002 Dis/enable input
+	void SetDisableInput();
+	void SetSW(int x,int y);
+	//hook selection
+	BOOL m_hookdriver;
+	void SethookMechanism(BOOL hookall,BOOL hookdriver);
+	bool m_UltraEncoder_used;
+	rfb::Rect		m_Cliprect;//the region to check
+	bool StopDriverWatches;
+
+	PCHANGES_BUF pchanges_buf;
+	CHANGES_BUF changes_buf;
+
+	int GetNrMonitors();
+	void GetPrimaryDevice();
+	void GetSecondaryDevice();
+	void Checkmonitors();
+    // 28 Mar 2008 jdp
+    void SetBlockInputState(bool newstate);
+    bool GetBlockInputState() { return m_bIsInputDisabledByClient; }
+    bool block_input();
+	BOOL InitWindow();
+	HANDLE trigger_events[6];
+	HANDLE restart_event;
+	DWORD pumpID;
+	rfb::Region2D rgnpump;
+	bool lock_region_add;
+
+	// The current mouse position
+	rfb::Rect		m_cursorpos;
+	void WriteMessageOnScreen(char*,BYTE *scrBuff, UINT scrBuffSize);
+
+	// Implementation
+protected:
+
+	// Routines to hook and unhook us
+	DWORD Startup();
+	BOOL Shutdown();
+	
+	// Init routines called by the child thread
+	BOOL InitDesktop();
+	void KillScreenSaver();
+//	void KillWallpaper();
+//	void RestoreWallpaper();
+	DWORD InitBitmap();
+	BOOL ThunkBitmapInfo();
+	DWORD SetPixFormat();
+	BOOL SetPixShifts();
+	BOOL InitHooks();
+	BOOL SetPalette();
+	int m_timer;
+
+	// Fetching pixel data to a buffer, and handling copyrects
+	void CopyToBuffer(const rfb::Rect &rect, BYTE *scrBuff, UINT scrBuffSize);
+	bool CalcCopyRects(rfb::UpdateTracker &tracker);
+
+	// Routine to attempt enabling optimised DIBsection blits
+	DWORD EnableOptimisedBlits();
+
+	// Convert a bit mask eg. 00111000 to max=7, shift=3
+	static void MaskToMaxAndShift(DWORD mask, CARD16 &max, CARD8 &shift);
+	
+	// Enabling & disabling clipboard handling
+	void SetClipboardActive(BOOL active) {m_clipboard_active = active;};
+
+	// Modif sf at 2002 - v1.1.0 - FastDetectChanges stuff
+	bool FastDetectChanges(rfb::Region2D &rgn, rfb::Rect &rect, int nZone, bool fTurbo);
+	GridsList    m_lGridsList;   // List of changes detection grids
+	WindowsList  m_lWList;		 // List of Windows handles  
+	// HDC	         m_hDC;			 // Local Screen Device context to capture our Grid of pixels 
+	int          m_nGridCycle;   // Cycle index for grid shifting
+
+	// Modif sf at 2002 - v1.1.0
+	long         m_lLastMouseUpdateTime;
+	long         m_lLastSlowClientTestTime;
+	// long			m_lLastTempo;
+
+	// sf at 2002 - TextChat - No more used for now
+	// bool m_fTextChatRunning;
+	// TextChat* m_pCurrentTextChat;
+
+	BOOL m_fCaptureAlphaBlending;
+	// DATA
+
+	// Generally useful stuff
+	vncServer 		*m_server;
+	omni_thread 	*m_thread;
+	HWND			m_hwnd;
+	//UINT			m_timerid;
+	HWND			m_hnextviewer;
+	// adzm - 2010-07 - Fix clipboard hangs
+	bool			m_settingClipboardViewer;
+	BOOL			m_clipboard_active;
+
+	// device contexts for memory and the screen
+	HDC				m_hmemdc;
+	HDC				m_hrootdc;
+
+	// New and old bitmaps
+	HBITMAP			m_membitmap;
+	omni_mutex		m_update_lock;
+
+	rfb::Rect		m_bmrect;
+	struct _BMInfo {
+		BOOL			truecolour;
+		BITMAPINFO		bmi;
+		// Colormap info - comes straight after BITMAPINFO - **HACK**
+		RGBQUAD			cmap[256];
+	} m_bminfo;
+
+	// Screen info
+	rfbServerInitMsg	m_scrinfo;
+
+	// These are the red, green & blue masks for a pixel
+	DWORD			m_rMask, m_gMask, m_bMask;
+
+	// This is always handy to have
+	int				m_bytesPerRow;
+
+	// Handle of the default cursor
+	HCURSOR			m_hcursor;
+	HCURSOR			m_hOldcursor; // sf at 2002
+
+	// Handle of the basic arrow cursor
+	HCURSOR			m_hdefcursor;
+
+	// Boolean flag to indicate when the display resolution has changed
+	BOOL			m_displaychanged;
+
+	// Boolean flag to indicate whether or not an update trigger message
+	// is already in the desktop thread message queue
+	BOOL			m_update_triggered;
+
+	// Extra vars used for the DIBsection optimisation
+	VOID			*m_DIBbits;
+	BOOL			m_formatmunged;
+
+	// Info used for polling modes
+	UINT			m_pollingcycle;
+	// rfb::Rect		m_fullscreen; // sf at 2002 - v1.1.0
+
+	// Handling of the foreground window, to produce CopyRects
+	HWND			m_foreground_window;
+	rfb::Rect		m_foreground_window_rect;
+
+	//SINGLE WINDOW
+	void SWinit();
+	int m_SWHeight;
+	int m_SWWidth;
+	BOOL m_SWSizeChanged;
+	BOOL m_SWmoved;
+	BOOL m_SWtoDesktop;
+	int m_SWOffsetx;
+	int m_SWOffsety;
+
+	//DDIHOOK
+
+	// Modif rdv at 2002 - v1.1.x - videodriver
+	VIDEODRIVER *m_videodriver;
+	BOOL InitVideoDriver();
+ 	void ShutdownVideoDriver();
+	omni_mutex		m_videodriver_lock;
+
+	// Modif input dis/enabke
+	DWORD m_thread_hooks;
+	BOOL ddihook;
+	UINT OldPowerOffTimeout;
+	bool m_Black_window_active;
+
+	//	[v1.0.2-jp1 fix] Monitor Blanking
+	//BOOL m_grayed;
+	//WORD bk_gamma[3][256];
+	
+	//hook selection
+	BOOL m_hookdll;
+	BOOL On_Off_hookdll;
+	BOOL m_hookswitch;
+	BOOL Hookdll_Changed;
+	BOOL m_hookinited;
+	HANDLE m_hddihook;
+	void StartStopddihook(BOOL enabled);
+	void StartStophookdll(BOOL enabled);
+	void InitHookSettings();
+	HMODULE hModule;
+	HMODULE hSCModule;
+	SetHooksFn SetHooks;
+	UnSetHooksFn  UnSetHooks;
+	SetHookFn SetHook;
+	UnSetHookFn  UnSetHook;
+	SetKeyboardFilterHookFn SetKeyboardFilterHook;
+	SetMouseFilterHookFn SetMouseFilterHook;
+	//hooks in schook Hook(s)
+	SetKeyboardFilterHookFn SetKeyboardFilterHooks;
+	SetMouseFilterHookFn SetMouseFilterHooks;
+
+
+	pBlockInput pbi;
+	HMODULE hUser32;
+	BOOL m_OrigpollingSet;
+	BOOL m_Origpolling;
+/*	BOOL Check24bit();*/
+	COLORREF CapturePixel(int x,int y);
+	HANDLE InitWindowThreadh;
+	void StopInitWindowthread();
+	void StartInitWindowthread();
+	void ShutdownInitWindowthread();
+	bool can_be_hooked;
+	int old_Blockinput;
+	int old_Blockinput1;
+	int old_Blockinput2;
+	int nr_rects;
+	HWND hDeskWnd;
+	HWND hFolderView;
+	rfb::Region2D iconregion;
+	bool blankmonitorstate;
+
+	
+BOOL DriverWanted;
+BOOL HookWanted;
+BOOL DriverWantedSet;
+
+//Multi monitor
+monitor mymonitor[3];
+int nr_monitors;
+bool multi_monitor;
+bool requested_multi_monitor;
+
+bool m_bIsInputDisabledByClient; // 28 March 2008 jdp
+#ifdef AVILOG
+CAVIGenerator *AviGen;
+#endif
+
+private:
+	HDESK m_input_desktop;
+	HDESK m_home_desktop;
+	PixelCaptureEngine PixelEngine;
+	int idle_counter;
+	bool change_found;
+};
+
+#endif // _WINVNC_VNCDESKTOP
diff --git a/ica/win32/winvnc/winvnc/vncdesktopsink.cpp b/ica/win32/winvnc/winvnc/vncdesktopsink.cpp
new file mode 100644
index 0000000..789e497
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncdesktopsink.cpp
@@ -0,0 +1,751 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "winvnc.h"
+#include "vncserver.h"
+#include "vncdesktop.h"
+#include "vncservice.h"
+#include <string.h>
+
+#define MSGFLT_ADD		1
+typedef BOOL (WINAPI *CHANGEWINDOWMESSAGEFILTER)(UINT message, DWORD dwFlag);
+int OSversion();
+DWORD WINAPI Driverwatch(LPVOID lpParam);
+DWORD WINAPI InitWindowThread(LPVOID lpParam);
+
+void
+vncDesktop::ShutdownInitWindowthread()
+{
+	// we keep the sink window running
+	// but ignore info
+	can_be_hooked=false;
+	vnclog.Print(LL_INTINFO, VNCLOG("ShutdownInitWindowthread \n"));
+}
+
+void
+vncDesktop::StopInitWindowthread()
+{
+	//vndesktopthread is closing, all threads need to be stopped
+	//else winvnc wil stay running in background on exit
+		can_be_hooked=true;
+		if (InitWindowThreadh)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("~vncDesktop::Tell initwindowthread to close \n"));
+			PostThreadMessage(pumpID, WM_QUIT, 0, 0);
+			DWORD status=WaitForSingleObject(InitWindowThreadh,2000);
+			if (status==WAIT_TIMEOUT)
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("~vncDesktop::ERROR:  messageloop blocked \n"));
+				// WE need to kill the thread to prevent a winvnc lock
+				TerminateThread(InitWindowThreadh,0);
+				CloseHandle(InitWindowThreadh);
+				m_hwnd=NULL;
+				InitWindowThreadh=NULL;
+			}
+			else
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("~vncDesktop:: iniwindowthread proper closed \n"));
+				CloseHandle(InitWindowThreadh);
+				InitWindowThreadh=NULL;
+			}
+		}
+		else
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("initwindowthread already closed \n"));
+		}
+}
+
+void
+vncDesktop::StartInitWindowthread()
+{
+	// Check if the input desktop == Default desktop
+	// Hooking the winlogon is not needed, no clipboard
+	// see if the threaddesktop== Default
+	HDESK desktop = GetThreadDesktop(GetCurrentThreadId());
+	DWORD dummy;
+	char new_name[256];
+	can_be_hooked=false;
+	vnclog.Print(LL_INTINFO, VNCLOG("StartInitWindowthread \n"));
+	if (GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
+	{
+		if (strcmp(new_name,"Default")==0)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("StartInitWindowthread default desk\n"));
+			if (InitWindowThreadh==NULL)
+			{
+				ResetEvent(restart_event);
+				InitWindowThreadh=CreateThread(NULL,0,InitWindowThread,this,0,&pumpID);
+				DWORD status=WaitForSingleObject(restart_event,10000);
+				if (status==WAIT_TIMEOUT)
+				{
+					vnclog.Print(LL_INTINFO, VNCLOG("ERROR: initwindowthread failed to start \n"));
+					if (InitWindowThreadh!=NULL)
+					{
+						TerminateThread(InitWindowThreadh,0);
+						CloseHandle(InitWindowThreadh);
+						m_hwnd=NULL;
+						InitWindowThreadh=NULL;
+					}
+					can_be_hooked=false;
+				}
+				else
+				{
+					vnclog.Print(LL_INTINFO, VNCLOG("StartInitWindowthread started\n"));
+					can_be_hooked=true;
+				}
+			}
+			else
+			{
+				// initwindowthread is still running
+				// make it back active
+				vnclog.Print(LL_INTINFO, VNCLOG("StartInitWindowthread reactivate\n"));
+				can_be_hooked=true;
+			}
+		}
+		else
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("StartInitWindowthread no default desk\n"));
+		}
+	}
+}
+
+DWORD WINAPI
+InitWindowThread(LPVOID lpParam)
+{
+	vncDesktop *mydesk=(vncDesktop*)lpParam;
+	mydesk->InitWindow();
+	return 0;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Window procedure for the Desktop window
+LRESULT CALLBACK
+DesktopWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
+{
+#ifndef _X64
+	vncDesktop *_this = (vncDesktop*)GetWindowLong(hwnd, GWL_USERDATA);
+#else
+	vncDesktop *_this = (vncDesktop*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+#endif
+	#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText,"Message %i\n",iMsg );
+										OutputDebugString(szText);
+										//vnclog.Print(LL_INTERR, VNCLOG("%i  \n"),iMsg);
+			#endif
+	switch (iMsg)
+	{
+	case WM_CREATE:
+		vnclog.Print(LL_INTERR, VNCLOG("wmcreate  \n"));
+		break;
+	case WM_TIMER:
+		if (_this->can_be_hooked)
+		{
+			if (wParam==100)
+			{
+					KillTimer(hwnd, 100); 
+					if (_this->SetHook)
+					{
+						_this->SetHook(hwnd);
+						vnclog.Print(LL_INTERR, VNCLOG("set SC hooks OK\n"));
+						_this->m_hookinited = TRUE;
+						if (_this->SetKeyboardFilterHooks) _this->SetKeyboardFilterHooks( _this->m_bIsInputDisabledByClient || _this->m_server->LocalInputsDisabled());
+						if (_this->SetMouseFilterHooks) _this->SetMouseFilterHooks( _this->m_bIsInputDisabledByClient || _this->m_server->LocalInputsDisabled());
+					}
+					else if (_this->SetHooks)
+					{
+						if (!_this->SetHooks(
+							GetCurrentThreadId(),
+							RFB_SCREEN_UPDATE,
+							RFB_COPYRECT_UPDATE,
+							RFB_MOUSE_UPDATE, 0
+							))
+						{
+							vnclog.Print(LL_INTERR, VNCLOG("failed to set system hooks\n"));
+							// Switch on full screen polling, so they can see something, at least...
+							_this->m_server->PollFullScreen(TRUE);
+							_this->m_hookinited = FALSE;
+						} 
+						else 
+						{
+							vnclog.Print(LL_INTERR, VNCLOG("set hooks OK\n"));
+							_this->m_hookinited = TRUE;
+							// Start up the keyboard and mouse filters
+							if (_this->SetKeyboardFilterHook) _this->SetKeyboardFilterHook(_this->m_bIsInputDisabledByClient || _this->m_server->LocalInputsDisabled());
+							if (_this->SetMouseFilterHook) _this->SetMouseFilterHook(_this->m_bIsInputDisabledByClient || _this->m_server->LocalInputsDisabled());
+						}
+					}
+			}
+			else SetEvent(_this->trigger_events[0]);
+		}
+		break;
+	case WM_MOUSESHAPE:
+		if (_this->can_be_hooked)
+		{
+			SetEvent(_this->trigger_events[3]);
+		}
+		break;
+	case WM_HOOKCHANGE:
+		if (wParam==1)
+			{
+				if (_this->m_hookinited==FALSE)
+				SetTimer(hwnd,100,4000,NULL);
+			}
+		else if (wParam==2)
+		{
+			if (_this->m_hookinited)
+				{						
+					if (_this->SetHook)
+					{
+						if (_this->SetKeyboardFilterHooks) _this->SetKeyboardFilterHooks( _this->m_bIsInputDisabledByClient || _this->m_server->LocalInputsDisabled());
+						if (_this->SetMouseFilterHooks) _this->SetMouseFilterHooks( _this->m_bIsInputDisabledByClient || _this->m_server->LocalInputsDisabled());
+					}
+					else if (_this->SetHooks)
+					{
+
+						if (_this->SetKeyboardFilterHook) _this->SetKeyboardFilterHook( _this->m_bIsInputDisabledByClient || _this->m_server->LocalInputsDisabled());
+						if (_this->SetMouseFilterHook) _this->SetMouseFilterHook( _this->m_bIsInputDisabledByClient || _this->m_server->LocalInputsDisabled());
+					}
+
+				}
+		}
+		else if (_this->m_hookinited)
+			{
+				_this->m_hookinited=FALSE;
+				if (_this->UnSetHook)
+				{
+					vnclog.Print(LL_INTERR, VNCLOG("unset SC hooks OK\n"));
+					_this->UnSetHook(hwnd);
+				}
+				else if (_this->UnSetHooks)
+				{
+				if(!_this->UnSetHooks(GetCurrentThreadId()) )
+					vnclog.Print(LL_INTERR, VNCLOG("Unsethooks Failed\n"));
+				else vnclog.Print(LL_INTERR, VNCLOG("Unsethooks OK\n"));
+				}
+				
+			}
+		return true;
+
+	case WM_QUERYENDSESSION:
+
+		/*if (OSversion()==2) 
+		{
+		if (_this->m_hnextviewer!=NULL) ChangeClipboardChain(hwnd, _this->m_hnextviewer);
+		_this->m_hnextviewer=NULL;
+		if (_this->m_hookinited)
+			{
+				_this->m_hookinited=FALSE;
+				if (_this->UnSetHook)
+				{
+					vnclog.Print(LL_INTERR, VNCLOG("unset SC hooks OK\n"));
+					_this->UnSetHook(hwnd);
+				}
+				else if (_this->UnSetHooks)
+				{
+				if(!_this->UnSetHooks(GetCurrentThreadId()) )
+					vnclog.Print(LL_INTERR, VNCLOG("Unsethooks Failed\n"));
+				else vnclog.Print(LL_INTERR, VNCLOG("Unsethooks OK\n"));
+				}
+				
+			}
+		vnclog.Print(LL_INTERR, VNCLOG("WM_QUERYENDSESSION\n"));
+		PostQuitMessage(0);
+		SetEvent(_this->trigger_events[5]);
+		}*/
+		return DefWindowProc(hwnd, iMsg, wParam, lParam);
+
+	case WM_CLOSE:
+		if (_this->m_hnextviewer!=NULL) ChangeClipboardChain(hwnd, _this->m_hnextviewer);
+		_this->m_hnextviewer=NULL;
+		DestroyWindow(hwnd);
+		break;
+	case WM_DESTROY:		
+		KillTimer(hwnd, 100); 
+		if (_this->m_hnextviewer!=NULL) ChangeClipboardChain(hwnd, _this->m_hnextviewer);
+		_this->m_hnextviewer=NULL;
+		if (_this->m_hookinited)
+			{
+				_this->m_hookinited=FALSE;
+				if (_this->UnSetHook)
+				{
+					vnclog.Print(LL_INTERR, VNCLOG("unset SC hooks OK\n"));
+					_this->UnSetHook(hwnd);
+				}
+				else if (_this->UnSetHooks)
+				{
+				if(!_this->UnSetHooks(GetCurrentThreadId()) )
+					vnclog.Print(LL_INTERR, VNCLOG("Unsethooks Failed\n"));
+				else vnclog.Print(LL_INTERR, VNCLOG("Unsethooks OK\n"));
+				}
+				
+			}
+		vnclog.Print(LL_INTERR, VNCLOG("WM_DESTROY\n"));
+		break;
+	///ddihook
+	case WM_SYSCOMMAND:
+		// User has clicked an item on the tray menu
+		switch (wParam)
+		{
+			case SC_MONITORPOWER:
+				vnclog.Print(LL_INTINFO, VNCLOG("Monitor22 %i\n"),lParam);
+		}
+		vnclog.Print(LL_INTINFO, VNCLOG("Monitor3 %i %i\n"),wParam,lParam);
+		return DefWindowProc(hwnd, iMsg, wParam, lParam);
+	case WM_POWER:
+	case WM_POWERBROADCAST:
+		// User has clicked an item on the tray menu
+		switch (wParam)
+		{
+			case SC_MONITORPOWER:
+				vnclog.Print(LL_INTINFO, VNCLOG("Monitor222 %i\n"),lParam);
+		}
+		vnclog.Print(LL_INTINFO, VNCLOG("Power3 %i %i\n"),wParam,lParam);
+		return DefWindowProc(hwnd, iMsg, wParam, lParam);
+
+	case WM_COPYDATA:
+        {
+			PCOPYDATASTRUCT pMyCDS = (PCOPYDATASTRUCT) lParam;
+			if (pMyCDS->dwData==112233)
+			{
+					DWORD mysize=pMyCDS->cbData;
+					char mytext[1024];
+					char *myptr;
+					char split[4][6];
+					strcpy(mytext,(LPCSTR)pMyCDS->lpData);
+					myptr=mytext;
+					for (DWORD j =0; j<(mysize/20);j++)
+					{
+						for (int i=0;i<4;i++)
+							{
+								strcpy(split[i],"     ");
+								strncpy(split[i],myptr,4);
+								myptr=myptr+5;
+							}
+						_this->QueueRect(rfb::Rect(atoi(split[0]), atoi(split[1]), atoi(split[2]), atoi(split[3])));
+					}
+					
+			}
+			//vnclog.Print(LL_INTINFO, VNCLOG("copydata\n"));	
+        }
+			return 0;
+
+	// GENERAL
+
+	case WM_DISPLAYCHANGE:
+		// The display resolution is changing
+		// We must kick off any clients since their screen size will be wrong
+		// WE change the clients screensize, if they support it.
+		vnclog.Print(LL_INTERR, VNCLOG("WM_DISPLAYCHANGE\n"));
+		// We First check if the Resolution changed is caused by a temp resolution switch
+		// For a temp resolution we don't use the driver, to fix the mirror driver
+		// to the new change, a resolution switch is needed, preventing screensaver locking.
+
+		if (_this->m_videodriver != NULL) //Video driver active
+		{
+			if (!_this->m_videodriver->blocked)
+			{
+				_this->m_displaychanged = TRUE;
+				_this->m_hookdriver=true;
+				_this->m_videodriver->blocked=true;
+				vnclog.Print(LL_INTERR, VNCLOG("Resolution switch detected, driver active\n"));	
+			}
+			else
+			{
+				//Remove display change, cause by driver activation
+				_this->m_videodriver->blocked=false;
+				vnclog.Print(LL_INTERR, VNCLOG("Resolution switch by driver activation removed\n"));
+			}
+		}
+		else 
+		{
+				_this->m_displaychanged = TRUE;
+				_this->m_hookdriver=true;
+				vnclog.Print(LL_INTERR, VNCLOG("Resolution switch detected, driver NOT active\n"));
+			
+		}
+		return 0;
+
+	case WM_SYSCOLORCHANGE:
+	case WM_PALETTECHANGED:
+		if (!_this->m_displaychanged)
+		{
+		// The palette colours have changed, so tell the server
+
+		// Get the system palette
+            // better to use the wrong colors than close the connection
+		_this->SetPalette();
+
+		// Update any palette-based clients, too
+		_this->m_server->UpdatePalette(true);
+		}
+		return 0;
+
+		// CLIPBOARD MESSAGES
+
+	case WM_CHANGECBCHAIN:
+		// The clipboard chain has changed - check our nextviewer handle
+		if ((HWND)wParam == _this->m_hnextviewer)
+			_this->m_hnextviewer = (HWND)lParam;
+		else
+			if (_this->m_hnextviewer != NULL) {				
+				// adzm - 2010-07 - Fix clipboard hangs
+				// use SendNotifyMessage instead of SendMessage so misbehaving or hung applications
+				// won't cause our thread to hang.
+				SendNotifyMessage(_this->m_hnextviewer,
+							WM_CHANGECBCHAIN,
+							wParam, lParam);
+			}
+
+		return 0;
+
+	case WM_DRAWCLIPBOARD:
+		// adzm - 2010-07 - Fix clipboard hangs
+		if (_this->can_be_hooked && !_this->m_settingClipboardViewer)
+		{
+			// The clipboard contents have changed
+			if((GetClipboardOwner() != _this->Window()) &&
+				//_this->m_initialClipBoardSeen &&
+				_this->m_clipboard_active && !_this->m_server->IsThereFileTransBusy())
+			{
+				// adzm - 2010-07 - Extended clipboard
+				{
+					// only need a window when setting clipboard data
+					omni_mutex_lock l(_this->m_update_lock);
+					_this->m_server->UpdateClipTextEx(NULL);
+				}
+				/*
+				LPSTR cliptext = NULL;
+
+				// Open the clipboard
+				if (OpenClipboard(_this->Window()))
+				{
+					// Get the clipboard data
+					HGLOBAL cliphandle = GetClipboardData(CF_TEXT);
+					if (cliphandle != NULL)
+					{
+						LPSTR clipdata = (LPSTR) GlobalLock(cliphandle);
+
+						// Copy it into a new buffer
+						if (clipdata == NULL)
+							cliptext = NULL;
+						else
+							cliptext = _strdup(clipdata);
+
+						// Release the buffer and close the clipboard
+						GlobalUnlock(cliphandle);
+					}
+
+					CloseClipboard();
+				}
+
+				if (cliptext != NULL)
+				{
+					int cliplen = strlen(cliptext);
+					LPSTR unixtext = (char *)malloc(cliplen+1);
+
+					// Replace CR-LF with LF - never send CR-LF on the wire,
+					// since Unix won't like it
+					int unixpos=0;
+					for (int x=0; x<cliplen; x++)
+					{
+						if (cliptext[x] != '\x0d')
+						{
+							unixtext[unixpos] = cliptext[x];
+							unixpos++;
+						}
+					}
+					unixtext[unixpos] = 0;
+
+					// Free the clip text
+					free(cliptext);
+					cliptext = NULL;
+
+					// Now send the unix text to the server
+					omni_mutex_lock l(_this->m_update_lock);
+					_this->m_server->UpdateClipText(unixtext);
+
+					free(unixtext);
+				}
+				*/
+			}
+
+			//_this->m_initialClipBoardSeen = TRUE;
+		}
+
+		if (_this->m_hnextviewer != NULL)
+		{
+			// adzm - 2010-07 - Fix clipboard hangs
+			// Pass the message to the next window in clipboard viewer chain.  
+			
+			// use SendNotifyMessage instead of SendMessage so misbehaving or hung applications
+			// won't cause our thread to hang.
+			return SendNotifyMessage(_this->m_hnextviewer, WM_DRAWCLIPBOARD, wParam, lParam); 
+		}
+
+		return 0;
+
+	default:
+		return DefWindowProc(hwnd, iMsg, wParam, lParam);
+	}
+	return 0;
+}
+//////////////////////////////////////////////////////////////////////////////////////////
+
+ATOM m_wndClass = INVALID_ATOM;
+
+BOOL
+vncDesktop::InitWindow()
+{
+	vnclog.Print(LL_INTERR, VNCLOG("InitWindow called\n"));
+	
+	HDESK desktop;
+	desktop = OpenInputDesktop(0, FALSE,
+								DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
+								DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
+								DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
+								DESKTOP_SWITCHDESKTOP | GENERIC_WRITE
+								);
+
+	if (desktop == NULL)
+		vnclog.Print(LL_INTERR, VNCLOG("InitWindow:OpenInputdesktop Error \n"));
+	else 
+		vnclog.Print(LL_INTERR, VNCLOG("InitWindow:OpenInputdesktop OK\n"));
+
+	HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
+	DWORD dummy;
+
+	char new_name[256];
+
+	if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("InitWindow:!GetUserObjectInformation \n"));
+	}
+
+	vnclog.Print(LL_INTERR, VNCLOG("InitWindow:SelectHDESK to %s (%x) from %x\n"), new_name, desktop, old_desktop);
+
+	if (!SetThreadDesktop(desktop))
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("InitWindow:SelectHDESK:!SetThreadDesktop \n"));
+	}
+
+	HMODULE  hUser32 = LoadLibrary("user32.dll");
+	CHANGEWINDOWMESSAGEFILTER pfnFilter = NULL;
+	pfnFilter =(CHANGEWINDOWMESSAGEFILTER)GetProcAddress(hUser32,"ChangeWindowMessageFilter");
+	if (pfnFilter) pfnFilter(RFB_SCREEN_UPDATE, MSGFLT_ADD);
+	if (pfnFilter) pfnFilter(RFB_COPYRECT_UPDATE, MSGFLT_ADD);
+	if (pfnFilter) pfnFilter(RFB_MOUSE_UPDATE, MSGFLT_ADD);
+	if (pfnFilter) pfnFilter(WM_QUIT, MSGFLT_ADD);
+	if (pfnFilter) pfnFilter(WM_SHUTDOWN, MSGFLT_ADD);
+
+
+	
+	if (m_wndClass == 0) {
+		// Create the window class
+		WNDCLASSEX wndclass;
+
+		wndclass.cbSize			= sizeof(wndclass);
+		wndclass.style			= 0;
+		wndclass.lpfnWndProc	= &DesktopWndProc;
+		wndclass.cbClsExtra		= 0;
+		wndclass.cbWndExtra		= 0;
+		wndclass.hInstance		= hAppInstance;
+		wndclass.hIcon			= NULL;
+		wndclass.hCursor		= NULL;
+		wndclass.hbrBackground	= (HBRUSH) GetStockObject(WHITE_BRUSH);
+		wndclass.lpszMenuName	= (const char *) NULL;
+		wndclass.lpszClassName	= szDesktopSink;
+		wndclass.hIconSm		= NULL;
+
+		// Register it
+		m_wndClass = RegisterClassEx(&wndclass);
+		if (!m_wndClass) {
+			vnclog.Print(LL_INTERR, VNCLOG("failed to register window class\n"));
+			SetEvent(restart_event);
+			return FALSE;
+		}
+	}
+
+	// And create a window
+	m_hwnd = CreateWindow(szDesktopSink,
+				"WinVNC",
+				WS_OVERLAPPEDWINDOW,
+				CW_USEDEFAULT,
+				CW_USEDEFAULT,
+				400, 200,
+				NULL,
+				NULL,
+				hAppInstance,
+				NULL);
+
+	if (m_hwnd == NULL) {
+		vnclog.Print(LL_INTERR, VNCLOG("failed to create hook window\n"));
+		SetEvent(restart_event);
+		return FALSE;
+	}
+
+	// Set the "this" pointer for the window
+    helper::SafeSetWindowUserData(m_hwnd, (LONG_PTR)this);
+
+	// Enable clipboard hooking
+	// adzm - 2010-07 - Fix clipboard hangs
+	m_settingClipboardViewer = true;
+	m_hnextviewer = SetClipboardViewer(m_hwnd);
+	m_settingClipboardViewer = false;
+	StopDriverWatches=false;
+		DrvWatch mywatch;
+		mywatch.stop=&StopDriverWatches;
+		mywatch.hwnd=m_hwnd;
+	if (VideoBuffer())
+	{
+		DWORD myword;
+		HANDLE T1=NULL;
+		T1=CreateThread(NULL,0,Driverwatch,m_hwnd,0,&myword);
+		if (T1) CloseHandle(T1);
+	}
+	vnclog.Print(LL_INTERR, VNCLOG("OOOOOOOOOOOO load hookdll's\n"));
+	////////////////////////
+		hModule=NULL;
+	char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return 0;
+			*p = '\0';
+			strcat (szCurrentDir,"\\vnchooks.dll");
+		}
+	hSCModule=NULL;
+	char szCurrentDirSC[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDirSC, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDirSC, '\\');
+			if (p == NULL) return 0;
+			*p = '\0';
+#ifdef _X64
+			strcat (szCurrentDirSC,"\\schook64.dll");
+#else
+			strcat (szCurrentDirSC,"\\schook.dll");
+#endif
+		}
+
+	UnSetHooks=NULL;
+	SetMouseFilterHook=NULL;
+	SetKeyboardFilterHook=NULL;
+	SetMouseFilterHooks=NULL;
+	SetKeyboardFilterHooks=NULL;
+	SetHooks=NULL;
+
+	UnSetHook=NULL;
+	SetHook=NULL;
+
+	hModule = LoadLibrary(szCurrentDir);
+	hSCModule = LoadLibrary(szCurrentDirSC);//TOFIX resource leak
+	if (hModule)
+		{
+			UnSetHooks = (UnSetHooksFn) GetProcAddress( hModule, "UnSetHooks" );
+			SetMouseFilterHook  = (SetMouseFilterHookFn) GetProcAddress( hModule, "SetMouseFilterHook" );
+			SetKeyboardFilterHook  = (SetKeyboardFilterHookFn) GetProcAddress( hModule, "SetKeyboardFilterHook" );
+			SetHooks  = (SetHooksFn) GetProcAddress( hModule, "SetHooks" );
+		}
+	if (hSCModule)
+		{
+			UnSetHook = (UnSetHookFn) GetProcAddress( hSCModule, "UnSetHook" );
+			SetHook  = (SetHookFn) GetProcAddress( hSCModule, "SetHook" );
+			SetMouseFilterHooks  = (SetMouseFilterHookFn) GetProcAddress( hSCModule, "SetMouseFilterHook" );
+			SetKeyboardFilterHooks  = (SetKeyboardFilterHookFn) GetProcAddress( hSCModule, "SetKeyboardFilterHook" );
+		}
+	///////////////////////////////////////////////
+	vnclog.Print(LL_INTERR, VNCLOG("OOOOOOOOOOOO start dispatch\n"));
+	MSG msg;
+	SetEvent(restart_event);
+	while (TRUE)
+	{
+		if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("OOOOOOOOOOOO %i %i\n"),msg.message,msg.hwnd);
+			if (msg.message==WM_QUIT || fShutdownOrdered)		
+				{
+					vnclog.Print(LL_INTERR, VNCLOG("OOOOOOOOOOOO called wm_quit\n"));
+					DestroyWindow(m_hwnd);
+					SetEvent(trigger_events[5]);
+					break;
+				}
+			else if (msg.message==WM_SHUTDOWN)
+				{
+					vnclog.Print(LL_INTERR, VNCLOG("OOOOOOOOOOOO called wm_user+4\n"));
+					DestroyWindow(m_hwnd);
+					break;
+				}
+			else if (msg.message==RFB_SCREEN_UPDATE)
+				{
+					if (can_be_hooked)
+					{
+					vnclog.Print(LL_INTERR, VNCLOG("RFB_SCREEN_UPDATE  \n"));
+					rfb::Rect rect;
+					rect.tl = rfb::Point((SHORT)LOWORD(msg.wParam), (SHORT)HIWORD(msg.wParam));
+					rect.br = rfb::Point((SHORT)LOWORD(msg.lParam), (SHORT)HIWORD(msg.lParam));
+					//Buffer coordinates
+					rect.tl.x-=m_ScreenOffsetx;
+					rect.br.x-=m_ScreenOffsetx;
+					rect.tl.y-=m_ScreenOffsety;
+					rect.br.y-=m_ScreenOffsety;
+					vnclog.Print(LL_INTERR, VNCLOG("REct3 %i %i %i %i  \n"),rect.tl.x,rect.br.x,rect.tl.y,rect.br.y);
+				
+					rect = rect.intersect(m_Cliprect);
+					if (!rect.is_empty())
+						{
+							while (lock_region_add) Sleep(5);
+							rgnpump.assign_union(rect);
+							SetEvent(trigger_events[1]);
+						}
+					}
+				}
+			else if (msg.message==RFB_MOUSE_UPDATE)
+				{
+					if (can_be_hooked)
+					{
+					vnclog.Print(LL_INTERR, VNCLOG("RFB_MOUSE_UPDATE  \n"));
+					SetCursor((HCURSOR) msg.wParam);
+					SetEvent(trigger_events[2]);
+					}
+				}
+			else
+				{
+					if (msg.message==WM_USER+3 )vnclog.Print(LL_INTERR, VNCLOG("OOOOOOOOOOOO called wm_user+3\n"));
+					TranslateMessage(&msg);
+					DispatchMessage(&msg);
+				}
+		}
+		else WaitMessage();
+	}
+
+	if (hModule)FreeLibrary(hModule);
+	if (hSCModule)FreeLibrary(hSCModule);
+	SetThreadDesktop(old_desktop);
+    CloseDesktop(desktop);
+	///////////////////////
+	vnclog.Print(LL_INTERR, VNCLOG("OOOOOOOOOOOO end dispatch\n"));
+	m_hwnd = NULL;
+	return TRUE;
+}
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncdesktopthread.cpp b/ica/win32/winvnc/winvnc/vncdesktopthread.cpp
new file mode 100644
index 0000000..5fb2251
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncdesktopthread.cpp
@@ -0,0 +1,1334 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "vncdesktopthread.h"
+#include "vncOSVersion.h"
+bool g_DesktopThread_running;
+bool g_update_triggered;
+DWORD WINAPI hookwatch(LPVOID lpParam);
+extern bool stop_hookwatch;
+void testBench();
+
+
+inline bool
+ClipRect(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);
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+// Modif rdv at 2002 - v1.1.x - videodriver
+void
+vncDesktopThread::copy_bitmaps_to_buffer(ULONG i,rfb::Region2D &rgncache,rfb::UpdateTracker &tracker)
+{
+	
+		rfb::Rect rect;
+		int x = m_desktop->pchanges_buf->pointrect[i].rect.left;
+		int w = m_desktop->pchanges_buf->pointrect[i].rect.right-m_desktop->pchanges_buf->pointrect[i].rect.left;
+		int y = m_desktop->pchanges_buf->pointrect[i].rect.top;
+		int h = m_desktop->pchanges_buf->pointrect[i].rect.bottom-m_desktop->pchanges_buf->pointrect[i].rect.top;
+		//vnclog.Print(LL_INTINFO, VNCLOG("Driver ************* %i %i %i %i \n"),x,y,w,h);
+
+		if (!ClipRect(&x, &y, &w, &h, m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.tl.y,
+			m_desktop->m_bmrect.br.x-m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.br.y-m_desktop->m_bmrect.tl.y)) return;
+		//vnclog.Print(LL_INTINFO, VNCLOG("Driver ************* %i %i %i %i \n"),x,y,w,h);
+		rect.tl.x = x;
+		rect.br.x = x+w;
+		rect.tl.y = y;
+		rect.br.y = y+h;
+
+		switch(m_desktop->pchanges_buf->pointrect[i].type)
+			{
+				case SCREEN_SCREEN:
+					{
+						int dx=m_desktop->pchanges_buf->pointrect[i].point.x;
+						int dy=m_desktop->pchanges_buf->pointrect[i].point.y;
+						if (!m_screen_moved && (dx==0 || dy==0) )
+								{
+//// Fix in case !Cliprect
+									int xx=x;
+                                    int yy=y;
+                                    int hh=h;
+                                    int ww=w;
+                                    if (ClipRect(&xx,&yy,&ww,&hh,m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.tl.y,
+                                                m_desktop->m_bmrect.br.x-m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.br.y-m_desktop->m_bmrect.tl.y))
+									{
+                                    rect.tl.x=xx;
+                                    rect.tl.y=yy;
+                                    rect.br.x=xx+ww;
+                                    rect.br.y=yy+hh;
+                                    rgncache.assign_union(rect);
+									}
+
+//////////////////////
+// Fix Eckerd
+									x=x+dx;;
+									y=y+dy;;
+									if (!ClipRect(&x,&y,&w,&h,m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.tl.y,
+												m_desktop->m_bmrect.br.x-m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.br.y-m_desktop->m_bmrect.tl.y)) return;
+//////////////////////
+// Fix Eckerd
+									rect.tl.x=x-dx;
+									rect.tl.y=y-dy;
+									rect.br.x=x+w-dx;
+									rect.br.y=y+h-dy;
+
+									rfb::Point delta = rfb::Point(-dx,-dy);
+									rgncache.assign_union(rect);
+									tracker.add_copied(rect, delta);
+								//	vnclog.Print(LL_INTINFO, VNCLOG("Copyrect \n"));
+								}
+						else
+								{
+									rgncache.assign_union(rect);
+								}
+						break;
+					}
+
+				case SOLIDFILL:
+				case TEXTOUT:
+				case BLEND:
+				case TRANS:
+				case PLG:
+				case BLIT:;
+					rgncache.assign_union(rect);
+					break;
+				default:
+					break;
+			}
+}
+
+
+
+// Modif rdv at 2002 - v1.1.x - videodriver
+BOOL
+vncDesktopThread::handle_driver_changes(rfb::Region2D &rgncache,rfb::UpdateTracker &tracker)
+{ 
+
+	omni_mutex_lock l(m_desktop->m_videodriver_lock);
+
+	int oldaantal=m_desktop->m_videodriver->oldaantal;
+	int counter=m_desktop->pchanges_buf->counter;
+//	int nr_updates=m_desktop->pchanges_buf->pointrect[0].type;
+//	vnclog.Print(LL_INTERR, VNCLOG("updates, rects %i\n"),oldaantal-counter);
+	if (oldaantal==counter) return FALSE;
+	if (counter<1 || counter >1999) return FALSE;
+//	m_desktop->pchanges_buf->pointrect[0].type=0;
+	if (!m_server->SingleWindow()) m_screen_moved=m_desktop->CalcCopyRects(tracker);
+	else m_screen_moved=true;
+
+/// HEITE01E
+// buffer was overloaded, so we use the bounding rect
+/*	if (nr_updates>2000)
+	{
+		rfb::Rect rect;
+		int x = m_desktop->pchanges_buf->pointrect[0].rect.left;
+		int w = m_desktop->pchanges_buf->pointrect[0].rect.right-m_desktop->pchanges_buf->pointrect[0].rect.left;
+		int y = m_desktop->pchanges_buf->pointrect[0].rect.top;
+		int h = m_desktop->pchanges_buf->pointrect[0].rect.bottom-m_desktop->pchanges_buf->pointrect[0].rect.top;
+		if (ClipRect(&x, &y, &w, &h, m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.tl.y,
+			m_desktop->m_bmrect.br.x-m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.br.y-m_desktop->m_bmrect.tl.y))
+		{
+		rect.tl.x = x;
+		rect.br.x = x+w;
+		rect.tl.y = y;
+		rect.br.y = y+h;
+		rgncache=rgncache.union_(rect);
+		m_desktop->m_videodriver->oldaantal=counter;
+		}
+	    return TRUE;
+	}*/
+	if (m_server->SingleWindow()) m_screen_moved=true;
+	if (oldaantal<counter)
+		{
+			for (int i =oldaantal+1; i<=counter;i++)
+				{
+					copy_bitmaps_to_buffer(i,rgncache,tracker);
+				}
+
+		}
+	else
+		{
+		    int i = 0;
+			for (i =oldaantal+1;i<MAXCHANGES_BUF;i++)
+				{
+					copy_bitmaps_to_buffer(i,rgncache,tracker);
+				}
+			for (i=1;i<=counter;i++)
+				{
+					copy_bitmaps_to_buffer(i,rgncache,tracker);
+				}
+		}	
+//	vnclog.Print(LL_INTINFO, VNCLOG("Nr rects %i \n"),rgncache.Numrects());
+	m_desktop->m_videodriver->oldaantal=counter;
+// A lot updates left after combining 
+// This generates an overflow
+// We expand each single update to minimum 32x32
+	if (rgncache.Numrects()>150)
+	{
+		rfb::Region2D rgntemp;
+		rfb::RectVector rects;
+		rfb::RectVector::iterator i;
+		rgncache.get_rects(rects, 1, 1);
+		for (i = rects.begin(); i != rects.end(); i++)
+			{
+				rfb::Rect rect = *i;
+				rect.tl.x=rect.tl.x/32*32;
+				rect.tl.y=rect.tl.y/32*32;
+				rect.br.x=rect.br.x/32*32+32;
+				rect.br.y=rect.br.y/32*32+32;
+				if (rect.br.x>m_desktop->m_bmrect.br.x) rect.br.x=m_desktop->m_bmrect.br.x;
+				if (rect.br.y>m_desktop->m_bmrect.br.y) rect.br.y=m_desktop->m_bmrect.br.y;
+				rgntemp.assign_union(rect);
+			}
+//Still to many little updates
+//Use the bounding rectangle for updates
+		if (rgntemp.Numrects()>50)
+		{
+			Rect brect=rgntemp.get_bounding_rect();
+			rgncache.clear();
+			rgncache.assign_union(brect);
+		}
+		else
+		{
+		rgncache.clear();
+		rgncache.assign_union(rgntemp);
+		}
+	}
+	return TRUE;
+}
+
+BOOL
+vncDesktopThread::Init(vncDesktop *desktop, vncServer *server)
+{
+	// Save the server pointer
+	m_server = server;
+	m_desktop = desktop;
+	m_returnset = FALSE;
+	m_returnsig = new omni_condition(&m_returnLock);
+	// Start the thread
+	start_undetached();
+	// Wait for the thread to let us know if it failed to init
+	{	omni_mutex_lock l(m_returnLock);
+
+		while (!m_returnset)
+		{
+			m_returnsig->wait();
+		}
+	}
+	if (m_return!=0) 
+    {
+        g_DesktopThread_running=false;
+    }
+	return m_return;
+}
+
+void
+vncDesktopThread::ReturnVal(DWORD result)
+{
+	omni_mutex_lock l(m_returnLock);
+	m_returnset = TRUE;
+	m_return = result;
+	m_returnsig->signal();
+}
+
+void
+vncDesktopThread::PollWindow(rfb::Region2D &rgn, HWND hwnd)
+{
+	// Are we set to low-load polling?
+	if (m_server->PollOnEventOnly())
+	{
+		// Yes, so only poll if the remote user has done something
+		if (!m_server->RemoteEventReceived()) {
+			return;
+		}
+	}
+
+	// Does the client want us to poll only console windows?
+	if (m_desktop->m_server->PollConsoleOnly())
+	{
+		char classname[20];
+
+		// Yes, so check that this is a console window...
+		if (GetClassName(hwnd, classname, sizeof(classname))) {
+			if ((strcmp(classname, "tty") != 0) &&
+				(strcmp(classname, "ConsoleWindowClass") != 0)) {
+				return;
+			}
+		}
+	}
+
+	RECT rect;
+
+	// Get the rectangle
+	if (GetWindowRect(hwnd, &rect)) {
+		//Buffer coordinates
+			rect.left-=m_desktop->m_ScreenOffsetx;
+			rect.right-=m_desktop->m_ScreenOffsetx;
+			rect.top-=m_desktop->m_ScreenOffsety;
+			rect.bottom-=m_desktop->m_ScreenOffsety;
+		rfb::Rect wrect = rfb::Rect(rect).intersect(m_desktop->m_Cliprect);
+		if (!wrect.is_empty()) {
+			rgn.assign_union(wrect);
+		}
+	}
+}
+
+
+bool vncDesktopThread::handle_display_change(HANDLE& threadHandle, rfb::Region2D& rgncache, rfb::SimpleUpdateTracker& clipped_updates, rfb::ClippedUpdateTracker& updates)
+{
+	BOOL screensize_changed=false;
+	if (first_run)
+	{
+		first_run=false;
+		m_server->SetNewSWSizeFR(m_desktop->m_scrinfo.framebufferWidth,m_desktop->m_scrinfo.framebufferHeight,FALSE);//changed no lock ok
+		//m_server->SetScreenOffset(m_desktop->m_ScreenOffsetx,m_desktop->m_ScreenOffsety,m_desktop->nr_monitors);// no lock ok
+		//m_desktop->m_displaychanged=true;
+		//screensize_changed=true;
+	}
+
+	if (vncService::InputDesktopSelected()==2)
+	{
+		m_desktop->m_buffer.WriteMessageOnScreen("UltraVVNC running as application doesn't \nhave permission to acces \nUAC protected windows.\n\nThe is screen is locked until the remote user \nunlock this window");
+		rfb::Rect rect;
+		rect.tl = rfb::Point(0,0);
+		rect.br = rfb::Point(300,120);
+		rgncache.assign_union(rect);
+	}
+		
+	if ((m_desktop->m_displaychanged ||									//WM_DISPLAYCHANGE
+			vncService::InputDesktopSelected()==0 ||							//handle logon and screensaver desktops
+			m_desktop->m_SWtoDesktop ||										//switch from SW to full desktop or visa versa
+			m_desktop->m_hookswitch||										//hook change request
+			m_desktop->requested_multi_monitor!=m_desktop->m_buffer.IsMultiMonitor()		//monitor change request
+			) )
+			{
+				// We need to wait until viewer has send if he support Size changes
+				if (!m_server->All_clients_initialalized())
+				{
+					Sleep(30);
+					vnclog.Print(LL_INTERR, VNCLOG("Wait for viewer init \n"));
+				}
+
+				//logging
+				if (m_desktop->m_displaychanged)								vnclog.Print(LL_INTERR, VNCLOG("++++Screensize changed \n"));
+				if (m_desktop->m_SWtoDesktop)									vnclog.Print(LL_INTERR, VNCLOG("m_SWtoDesktop \n"));
+				if (m_desktop->m_hookswitch)									vnclog.Print(LL_INTERR, VNCLOG("m_hookswitch \n"));
+				if (m_desktop->requested_multi_monitor!=m_desktop->m_buffer.IsMultiMonitor()) vnclog.Print(LL_INTERR, VNCLOG("desktop switch %i %i \n"),m_desktop->requested_multi_monitor,m_desktop->m_buffer.IsMultiMonitor());
+				if (!m_server->IsThereFileTransBusy())
+				if (vncService::InputDesktopSelected()==0)						vnclog.Print(LL_INTERR, VNCLOG("++++InputDesktopSelected \n"));
+				
+				
+				//BOOL screensize_changed=false;
+				BOOL monitor_changed=false;
+				rfbServerInitMsg oldscrinfo;
+				//*******************************************************
+				// Lock Buffers from here
+				//*******************************************************
+				{
+					if (XRichCursorEnabled) m_server->UpdateCursorShape();
+					/// We lock all buffers,,and also back the client thread update mechanism
+					omni_mutex_lock l(m_desktop->m_update_lock);
+					/*#ifdef _DEBUG
+					char			szText[256];
+					sprintf(szText," ++++++ Mutex lock display changes\n");
+					OutputDebugString(szText);		
+			#endif*/
+					// We remove all queue updates from the tracker
+					m_server->Clear_Update_Tracker();
+					// Also clear the current updates
+					rgncache.clear();
+					// Also clear the copy_rect updates
+					clipped_updates.clear();
+					// TESTTESTTEST
+					// Are all updates cleared....old updates could generate bounding errors
+					// any other queues to clear ? Yep cursor positions
+					m_desktop->m_cursorpos.tl.x=0;
+					m_desktop->m_cursorpos.tl.y=0;
+					m_desktop->m_cursorpos.br.x=0;
+					m_desktop->m_cursorpos.br.y=0;
+					//keep a copy of the old screen size, so we can check for changes later on
+					oldscrinfo = m_desktop->m_scrinfo;
+						
+					if (m_desktop->requested_multi_monitor!=m_desktop->m_buffer.IsMultiMonitor())
+						{
+							m_desktop->Checkmonitors();
+							m_desktop->requested_multi_monitor=m_desktop->m_buffer.IsMultiMonitor();
+							int old_monitor=m_desktop->multi_monitor;	
+							m_desktop->multi_monitor=true;
+							if (m_desktop->requested_multi_monitor && m_desktop->nr_monitors>1) m_desktop->multi_monitor=true;
+							else m_desktop->multi_monitor=false;							
+							if ( old_monitor!=m_desktop->multi_monitor) monitor_changed=true;
+						}
+
+					//*******************************************************
+					// Reinitialize buffers,color, etc
+					// monitor change, for non driver, use another buffer
+					//*******************************************************
+					if (!m_server->IsThereFileTransBusy())
+					if (m_desktop->m_displaychanged || vncService::InputDesktopSelected()==0 || m_desktop->m_hookswitch || (monitor_changed && !m_desktop->m_videodriver))
+					{
+								// Attempt to close the old hooks
+								// shutdown(true) driver is reinstalled without shutdown,(shutdown need a 640x480x8 switch)
+								vnclog.Print(LL_INTERR, VNCLOG("m_desktop->Shutdown"));
+								monitor_changed=false;
+								if (!m_desktop->Shutdown())
+									{
+										vnclog.Print(LL_INTERR, VNCLOG("Shutdown KillAuthClients\n"));
+										m_server->KillAuthClients();
+										return false;
+									}					
+								bool fHookDriverWanted = (FALSE != m_desktop->m_hookdriver);
+                                Sleep(1000);
+								vnclog.Print(LL_INTERR, VNCLOG("m_desktop->Startup"));
+								if (m_desktop->Startup() != 0)
+									{
+										vnclog.Print(LL_INTERR, VNCLOG("Startup KillAuthClients\n"));
+										m_server->KillAuthClients();
+										SetEvent(m_desktop->restart_event);
+										return false;
+									}
+
+								if (m_desktop->m_videodriver)
+									{
+										if (!XRichCursorEnabled) m_desktop->m_videodriver->HardwareCursor();
+										else m_desktop->m_videodriver->NoHardwareCursor();
+									}
+								m_server->SetScreenOffset(m_desktop->m_ScreenOffsetx,m_desktop->m_ScreenOffsety,m_desktop->nr_monitors);
+
+								// sf at 2003 - After a new Startup(), we check if the required video driver
+								// is actually available. If not, we force hookdll
+								// No need for m_hookswitch again because the driver is NOT available anyway.
+								// All the following cases are now handled:
+								// 1. Desktop thread starts with "Video Driver" checked and no video driver available...
+								//    -> HookDll forced (handled by the first InitHookSettings() after initial Startup() call
+								// 2. Desktop Thread starts without "Video Driver" checked but available driver
+								//    then the user checks "Video Driver" -> Video Driver used
+								// 3. Desktop thread starts with "Video Driver" and available driver used
+								//    Then driver is switched off (-> hookDll) 
+								//    Then the driver is switched on again (-> hook driver used again)
+								// 4. Desktop thread starts without "Video Driver" checked and no driver available
+								//    then the users checks "Video Driver" 
+								if (fHookDriverWanted && m_desktop->m_videodriver == NULL)
+									{
+										vnclog.Print(LL_INTERR, VNCLOG("m_videodriver == NULL \n"));
+										m_desktop->SethookMechanism(true, false); 	// InitHookSettings() would work as well;
+									}
+								stop_hookwatch=true;
+								vnclog.Print(LL_INTERR, VNCLOG("threadHandle \n"));
+								if (threadHandle)
+								{
+									WaitForSingleObject( threadHandle, INFINITE );
+									CloseHandle(threadHandle);
+									stop_hookwatch=false;
+									threadHandle=NULL;
+								}
+								vnclog.Print(LL_INTERR, VNCLOG("threadHandle2 \n"));
+
+					}
+					//*******************************************************
+					// end reinit
+					//*******************************************************
+
+					if ((m_desktop->m_scrinfo.framebufferWidth != oldscrinfo.framebufferWidth) ||
+						(m_desktop->m_scrinfo.framebufferHeight != oldscrinfo.framebufferHeight ||
+							m_desktop->m_SWtoDesktop==TRUE ))
+							{
+								screensize_changed=true;	
+								vnclog.Print(LL_INTINFO, VNCLOG("SCR: new screen format %dx%dx%d\n"),
+								m_desktop->m_scrinfo.framebufferWidth,
+								m_desktop->m_scrinfo.framebufferHeight,
+								m_desktop->m_scrinfo.format.bitsPerPixel);
+							}
+
+					m_desktop->m_displaychanged = FALSE;
+					m_desktop->m_hookswitch = FALSE;
+					m_desktop->Hookdll_Changed = m_desktop->On_Off_hookdll; // Set the hooks again if necessary !
+					m_desktop->m_SWtoDesktop=FALSE;
+					//****************************************************************************
+					//************* SCREEN SIZE CHANGED 
+					//****************************************************************************
+
+					if (screensize_changed)
+						{
+							vnclog.Print(LL_INTERR, VNCLOG("Size changed\n"));
+							POINT CursorPos;
+							m_desktop->SWinit();
+							m_desktop->GetQuarterSize();
+							GetCursorPos(&CursorPos);
+							CursorPos.x -= m_desktop->m_ScreenOffsetx;
+							CursorPos.y -= m_desktop->m_ScreenOffsety;
+							m_desktop->m_cursorpos.tl = CursorPos;
+							m_desktop->m_cursorpos.br = rfb::Point(GetSystemMetrics(SM_CXCURSOR),
+							GetSystemMetrics(SM_CYCURSOR)).translate(CursorPos);
+							m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
+							// Adjust the UpdateTracker clip region
+							updates.set_clip_region(m_desktop->m_Cliprect);
+							m_desktop->m_buffer.ClearCache();
+						}
+					if (monitor_changed)
+					{
+						// we are using the driver, so a monitor change is a view change, like a special kind of single window
+						// m_desktop->current_monitor is the new monitor we want to see
+						// monitor size mymonitor[m_desktop->current_monitor-1]
+						// m_SWOffset is used by the encoders to send the correct coordinates to the viewer
+						// Cliprect, buffer coordinates
+						if (m_desktop->multi_monitor)
+						{
+							m_desktop->m_SWOffsetx=0;
+							m_desktop->m_SWOffsety=0;
+							m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
+
+							m_desktop->m_Cliprect.tl.x=0;
+							m_desktop->m_Cliprect.tl.y=0;
+							m_desktop->m_Cliprect.br.x=m_desktop->mymonitor[2].offsetx+m_desktop->mymonitor[2].Width-m_desktop->mymonitor[2].offsetx;
+							m_desktop->m_Cliprect.br.y=m_desktop->mymonitor[2].offsety+m_desktop->mymonitor[2].Height-m_desktop->mymonitor[2].offsety;
+						}
+						else
+						{
+							m_desktop->m_SWOffsetx=m_desktop->mymonitor[0].offsetx-m_desktop->mymonitor[2].offsetx;
+							m_desktop->m_SWOffsety=m_desktop->mymonitor[0].offsety-m_desktop->mymonitor[2].offsety;
+							m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
+
+							m_desktop->m_Cliprect.tl.x=m_desktop->mymonitor[0].offsetx-m_desktop->mymonitor[2].offsetx;
+							m_desktop->m_Cliprect.tl.y=m_desktop->mymonitor[0].offsety-m_desktop->mymonitor[2].offsety;
+							m_desktop->m_Cliprect.br.x=m_desktop->mymonitor[0].offsetx+m_desktop->mymonitor[0].Width-m_desktop->mymonitor[2].offsetx;
+							m_desktop->m_Cliprect.br.y=m_desktop->mymonitor[0].offsety+m_desktop->mymonitor[0].Height-m_desktop->mymonitor[2].offsety;
+						}
+
+
+
+						vnclog.Print(LL_INTERR, VNCLOG("***********###############************ %i %i %i %i %i %i\n"),m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety
+							,m_desktop->m_Cliprect.tl.x,m_desktop->m_Cliprect.tl.y,m_desktop->m_Cliprect.br.x,m_desktop->m_Cliprect.br.y);
+
+
+						rgncache.assign_union(rfb::Region2D(m_desktop->m_Cliprect));
+						updates.set_clip_region(m_desktop->m_Cliprect);				
+						m_desktop->m_buffer.ClearCache();
+						m_desktop->m_buffer.BlackBack();
+
+
+					}
+					m_desktop->m_buffer.ClearCache();
+					m_desktop->m_buffer.BlackBack();
+					InvalidateRect(NULL,NULL,TRUE);
+					rgncache.assign_union(rfb::Region2D(m_desktop->m_Cliprect));
+					
+					if (memcmp(&m_desktop->m_scrinfo.format, &oldscrinfo.format, sizeof(rfbPixelFormat)) != 0)
+						{
+							vnclog.Print(LL_INTERR, VNCLOG("Format changed\n"));
+							m_server->UpdatePalette(false); // changed no lock ok
+							m_server->UpdateLocalFormat(false); // changed no lock ok
+						}
+
+					if (screensize_changed) 
+						{
+							screensize_changed=false;
+							m_server->SetNewSWSize(m_desktop->m_scrinfo.framebufferWidth,m_desktop->m_scrinfo.framebufferHeight,FALSE);//changed no lock ok
+							m_server->SetScreenOffset(m_desktop->m_ScreenOffsetx,m_desktop->m_ScreenOffsety,m_desktop->nr_monitors);// no lock ok
+						}
+					
+					if (monitor_changed)
+						{
+								monitor_changed=false;
+								if (m_desktop->multi_monitor)
+									m_server->SetNewSWSize(m_desktop->mymonitor[2].Width,m_desktop->mymonitor[2].Height,TRUE); //changed no lock ok
+								else
+									m_server->SetNewSWSize(m_desktop->mymonitor[0].Width,m_desktop->mymonitor[0].Height,TRUE); //changed no lock ok
+						}
+
+		/*#ifdef _DEBUG
+					//char			szText[256];
+					sprintf(szText," ++++++ Mutex unlock display changes\n");
+					OutputDebugString(szText);		
+			#endif*/
+			}// end lock
+	}
+
+	return true;
+}
+
+void vncDesktopThread::do_polling(HANDLE& threadHandle, rfb::Region2D& rgncache, int& fullpollcounter, bool cursormoved)
+{
+	// POLL PROBLEM AREAS
+	// We add specific areas of the screen to the region cache,
+	// causing them to be fetched for processing.
+	// if can_be_hooked==false, hooking is temp disabled, use polling
+
+	if (m_desktop->SetHook && g_obIPC.listall()!=NULL && m_desktop->can_be_hooked) 
+	{
+		DWORD dwTId(0);
+		if (threadHandle==NULL) threadHandle = CreateThread(NULL, 0, hookwatch, this, 0, &dwTId);
+		if (Handle_Ringbuffer(g_obIPC.listall(),rgncache)) return;
+	}
+	DWORD lTime = timeGetTime();
+
+	m_desktop->m_buffer.SetAccuracy(m_desktop->m_server->TurboMode() ? 8 : 4); 
+
+	//if (cursormoved)
+	//	m_lLastMouseMoveTime = lTime;
+	if (cursormoved) m_desktop->idle_counter=0;
+	if ((m_desktop->m_server->PollFullScreen() /*&& !cursormoved*/) || (!m_desktop->can_be_hooked && !cursormoved))
+	{
+		int timeSinceLastMouseMove = lTime - m_lLastMouseMoveTime;
+		if (timeSinceLastMouseMove > 150) // 150 ms pause after a Mouse move 
+		{
+			m_lLastMouseMoveTime = lTime;
+			++fullpollcounter;
+			rfb::Rect r = m_desktop->GetSize();
+			// THIS FUNCTION IS A PIG. It uses too much CPU on older machines (PIII, P4)
+			if (vncService::InputDesktopSelected()!=2)
+			{
+				if (m_desktop->FastDetectChanges(rgncache, r, 0, true)) capture=false;
+			}
+			else
+			{
+				capture=false;
+			}
+
+			/*#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText," Capture %i\n",capture);
+										OutputDebugString(szText);		
+			#endif*/
+
+			// force full screen scan every three seconds after the mouse stops moving
+			if (fullpollcounter > 200) 
+			{
+				rgncache.assign_union(m_desktop->m_Cliprect);
+				fullpollcounter = 0;
+			}
+		}
+	}
+		
+    HWND hWndToPoll = 0;
+	if (m_desktop->m_server->PollForeground() || !m_desktop->can_be_hooked)
+	{
+		// Get the window rectangle for the currently selected window
+		hWndToPoll = GetForegroundWindow();
+		if (hWndToPoll != NULL)
+			 PollWindow(rgncache, hWndToPoll);
+		
+	}
+	
+	if (m_desktop->m_server->PollUnderCursor() || !m_desktop->can_be_hooked)
+	{
+		// Find the mouse position
+		POINT mousepos;
+		if (GetCursorPos(&mousepos))
+		{
+			// Find the window under the mouse
+			HWND hwnd = WindowFromPoint(mousepos);
+            // exclude the foreground window (done above) and desktop
+			if (hwnd != NULL && hwnd != hWndToPoll && hwnd != GetDesktopWindow())
+				 PollWindow(rgncache, hwnd);
+
+		}
+	}
+}
+void *
+vncDesktopThread::run_undetached(void *arg)
+{
+	//*******************************************************
+	// INIT
+	//*******************************************************
+	//testBench();
+	capture=true;
+	vnclog.Print(LL_INTERR, VNCLOG("Hook changed 1\n"));
+	// Save the thread's "home" desktop, under NT (no effect under 9x)
+	m_desktop->m_home_desktop = GetThreadDesktop(GetCurrentThreadId());
+    vnclog.Print(LL_INTERR, VNCLOG("Hook changed 2\n"));
+	// Attempt to initialise and return success or failure
+	m_desktop->KillScreenSaver();
+	{
+		keybd_event(VK_CONTROL, 0, 0, 0);
+        keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
+		Sleep(500); //Give screen some time to kill screensaver
+	}
+    DWORD startup_error;
+	if ((startup_error = m_desktop->Startup()) != 0)
+	{
+		//TAG14
+		vncService::SelectHDESK(m_desktop->m_home_desktop);
+		if (m_desktop->m_input_desktop)
+			CloseDesktop(m_desktop->m_input_desktop);
+		ReturnVal(startup_error);
+		return NULL;
+	}
+	// Succeeded to initialise ok
+	ReturnVal(0);
+
+	//telling running viewers to wait until first update
+	m_server->InitialUpdate(false);
+	// sf at 2003 - Done here to take into account if the driver is actually activated
+	m_desktop->InitHookSettings(); 
+	initialupdate=false;
+
+	// We set a flag inside the desktop handler here, to indicate it's now safe
+	// to handle clipboard messages
+	m_desktop->SetClipboardActive(TRUE);
+
+	// All changes in the state of the display are stored in a local
+	// UpdateTracker object, and are flushed to the vncServer whenever
+	// client updates are about to be triggered
+	rfb::SimpleUpdateTracker clipped_updates;
+	rfb::ClippedUpdateTracker updates(clipped_updates, m_desktop->m_Cliprect);
+	clipped_updates.enable_copyrect(true);
+	rfb::Region2D rgncache;
+
+
+	// Incoming update messages are collated into a single region cache
+	// The region cache areas are checked for changes before an update
+	// is triggered, and the changed areas are passed to the UpdateTracker
+	rgncache = m_desktop->m_Cliprect;
+	m_server->SetScreenOffset(m_desktop->m_ScreenOffsetx,m_desktop->m_ScreenOffsety,m_desktop->nr_monitors);
+
+	// The previous cursor position is stored, to allow us to erase the
+	// old instance whenever it moves.
+	rfb::Point oldcursorpos;
+
+	// The driver gives smaller rectangles to check
+	// if Accuracy is 4 you eliminate pointer updates
+	if (m_desktop->VideoBuffer() && m_desktop->m_hookdriver)
+		m_desktop->m_buffer.SetAccuracy(4);
+
+	//init vars
+	m_desktop->m_SWSizeChanged=FALSE;
+	m_desktop->m_SWtoDesktop=FALSE;
+	m_desktop->m_SWmoved=FALSE;
+	m_desktop->Hookdll_Changed = true;
+	m_desktop->m_displaychanged=false;
+	m_desktop->m_hookswitch=false;
+	m_desktop->m_hookinited = FALSE;
+
+	// Set driver cursor state
+	XRichCursorEnabled= (FALSE != m_desktop->m_server->IsXRichCursorEnabled());
+	if (!XRichCursorEnabled && m_desktop->m_videodriver) m_desktop->m_videodriver->HardwareCursor();
+	if (XRichCursorEnabled && m_desktop->m_videodriver) m_desktop->m_videodriver->NoHardwareCursor();
+	if (XRichCursorEnabled) m_server->UpdateCursorShape();
+
+	InvalidateRect(NULL,NULL,TRUE);
+	oldtick=timeGetTime();
+	oldtick2=timeGetTime();
+	int fullpollcounter=0;
+	//*******************************************************
+	// END INIT
+	//*******************************************************
+	// START PROCESSING DESKTOP MESSAGES
+	/////////////////////
+	HANDLE threadHandle=NULL;
+	stop_hookwatch=false;
+	/////////////////////
+	// We use a dynmiac value based on cpu usage
+    //DWORD MIN_UPDATE_INTERVAL=33;
+	/////////////////////
+	bool looping=true;
+	int waiting_update=0;
+	SetEvent(m_desktop->restart_event);
+	///
+	Sleep(1000);
+	rgncache.assign_union(rfb::Region2D(m_desktop->m_Cliprect));
+	if (m_desktop->VideoBuffer() && m_desktop->m_hookdriver)
+											{
+												m_desktop->m_buffer.GrabRegion(rgncache,true,true);
+											}
+										else
+											{
+												m_desktop->m_buffer.GrabRegion(rgncache,false,true);
+											}
+	//telling running viewers to wait until first update, done
+	if  (m_server->MaxCpu() <50)
+		{
+			MIN_UPDATE_INTERVAL_MIN=50;
+			MIN_UPDATE_INTERVAL_MAX=1000;
+		}
+	if (m_server->IsUltraVncViewer()) first_run=true;
+	else first_run=false;
+
+	while (looping && !fShutdownOrdered)
+	{		
+		DWORD result;
+		newtick = timeGetTime();
+		int waittime;
+		waittime=33;
+		if (m_desktop->VideoBuffer() && m_desktop->m_hookdriver) 
+		{
+			int fastcounter=0;
+			POINT cursorpos;
+			while (m_desktop->m_videodriver->oldaantal==m_desktop->pchanges_buf->counter)
+			{
+				Sleep(5);
+				fastcounter++;
+				if (fastcounter>20)
+				{
+					/*#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText,"fastcounter\n");
+										OutputDebugString(szText);		
+					#endif*/
+					break;
+				}
+				if (GetCursorPos(&cursorpos) && 
+										((cursorpos.x != oldcursorpos.x) ||
+										(cursorpos.y != oldcursorpos.y))) break;
+			}
+			waittime=0;
+		}
+		/*else
+		{
+			waittime=waittime-(waiting_update*10);
+		}
+		if (waittime<0) waittime=0;
+		if (waittime>100) waittime=100;*/
+
+		result=WaitForMultipleObjects(6,m_desktop->trigger_events,FALSE,waittime);
+		{
+			//#ifdef _DEBUG
+			//							char			szText[256];
+			//							sprintf(szText,"WaitForMultipleObjects %i\n",result );
+			//							OutputDebugString(szText);		
+			//#endif
+
+			// We need to wait until restart is done
+			// else wait_timeout goes in to looping while sink window is not ready
+			// if no window could be started in 10 seconds something went wrong, close
+			// desktop thread.
+			DWORD status=WaitForSingleObject(m_desktop->restart_event,10000);
+			if (status==WAIT_TIMEOUT) looping=false;
+			switch(result)
+			{
+				case WAIT_TIMEOUT:
+				case WAIT_OBJECT_0:
+				{
+				waiting_update=0;
+				ResetEvent(m_desktop->trigger_events[0]);
+							{
+								//measure current cpu usage of winvnc
+								if (fullpollcounter==10 || fullpollcounter==0 || fullpollcounter==5) cpuUsage = usage.GetUsage();
+								if (cpuUsage > m_server->MaxCpu()) 
+									MIN_UPDATE_INTERVAL+=10;
+								else MIN_UPDATE_INTERVAL-=10;
+								if (MIN_UPDATE_INTERVAL<MIN_UPDATE_INTERVAL_MIN) MIN_UPDATE_INTERVAL=MIN_UPDATE_INTERVAL_MIN;
+								if (MIN_UPDATE_INTERVAL>MIN_UPDATE_INTERVAL_MAX) MIN_UPDATE_INTERVAL=MIN_UPDATE_INTERVAL_MAX;
+
+
+					//			vnclog.Print(LL_INTERR, VNCLOG("!PeekMessage \n"));
+								// MAX 30fps
+								newtick = timeGetTime(); // Better resolution than GetTickCount ;)
+								if ((newtick-oldtick)<MIN_UPDATE_INTERVAL)
+								{
+									Sleep(MIN_UPDATE_INTERVAL-(newtick-oldtick));
+									//continue;  Verify, this can cause screen lockup
+									// We need another PeekMessage, but this is only done
+									// by hookdll and viewer asking for new update
+									// can cause a very long wait time
+								}	
+								
+								/*#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText," cpu2: %d %i %i\n",cpuUsage,MIN_UPDATE_INTERVAL,newtick-oldtick);
+										OutputDebugString(szText);		
+								#endif*/
+								//oldtick=newtick;
+								if (m_desktop->VideoBuffer() && m_desktop->m_hookdriver) handle_driver_changes(rgncache,updates);
+								m_desktop->m_update_triggered = FALSE;
+								g_update_triggered = FALSE;
+								//if (m_desktop->m_timerid==NULL) m_desktop->m_timerid = SetTimer(m_desktop->m_hwnd, 1, 100, NULL);
+
+								//*******************************************************
+								// HOOKDLL START STOP need to be executed from the thread
+								//*******************************************************
+								if (m_desktop->Hookdll_Changed && !m_desktop->m_hookswitch)
+								{
+									vnclog.Print(LL_INTERR, VNCLOG("Hook changed \n"));
+									m_desktop->StartStophookdll(m_desktop->On_Off_hookdll);
+									if (m_desktop->On_Off_hookdll)
+										m_desktop->m_hOldcursor = NULL; // Force mouse cursor grabbing if hookdll On
+									// Todo: in case of hookdriver Off - Hoodll On -> hookdriver On - Hoodll Off
+									// we must send an empty mouse cursor to the clients so they get rid of their local
+									// mouse cursor bitmap
+									m_desktop->Hookdll_Changed=false;
+								}
+								//*******************************************************
+								// SCREEN DISPLAY HAS CHANGED, RESTART DRIVER (IF Used)
+								//*******************************************************
+								if (!m_server->IsThereFileTransBusy())
+									if (!handle_display_change(threadHandle, rgncache, clipped_updates, updates))
+									{
+										//failed we need to quit thread
+										looping=false;
+										break;
+									}
+								//*******************************************************
+								// END SCREEN DISPLAY HAS CHANGED
+								//*******************************************************
+					//			m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
+							
+								//*******************************************************************
+								// SINGLE WINDOW 
+								// size SW changed
+								// Position change -->change offsets
+								//*******************************************************************
+								bool SWSizeChanged=false;
+								if (m_server->SingleWindow())
+								{
+									omni_mutex_lock l(m_desktop->m_update_lock);
+									m_desktop->GetQuarterSize();
+									m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);
+									//SW size changed
+									if (m_desktop->m_SWSizeChanged)
+									{
+										SWSizeChanged=true;
+										m_desktop->m_SWSizeChanged=FALSE;
+										m_desktop->GetQuarterSize();
+										rgncache.assign_union(rfb::Region2D(m_desktop->m_Cliprect));
+					//					vnclog.Print(LL_INTINFO, VNCLOG("4 %i %i %i %i \n"),m_desktop->m_Cliprect.br.x,m_desktop->m_Cliprect.br.y,m_desktop->m_Cliprect.tl.x,m_desktop->m_Cliprect.tl.y);
+										updates.set_clip_region(m_desktop->m_Cliprect);
+										m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);				
+										m_desktop->m_buffer.ClearCache();
+										m_desktop->m_buffer.BlackBack();
+									}
+									//SW position changed
+									if (m_desktop->m_SWmoved)
+									{
+										m_desktop->m_SWmoved=FALSE;
+										updates.set_clip_region(m_desktop->m_Cliprect);
+										m_server->SetSWOffset(m_desktop->m_SWOffsetx,m_desktop->m_SWOffsety);				
+										rgncache.assign_union(rfb::Region2D(m_desktop->m_Cliprect));
+					//					vnclog.Print(LL_INTINFO, VNCLOG("5 %i %i %i %i \n"),m_desktop->m_Cliprect.br.x,m_desktop->m_Cliprect.br.y,m_desktop->m_Cliprect.tl.x,m_desktop->m_Cliprect.tl.y);
+										m_desktop->m_buffer.ClearCache();
+										m_desktop->m_buffer.BlackBack();
+									}
+
+								if (m_server->SingleWindow() && SWSizeChanged)
+									{
+										m_server->SetNewSWSize(m_desktop->m_SWWidth,m_desktop->m_SWHeight,FALSE);
+										m_server->SetScreenOffset(m_desktop->m_ScreenOffsetx,m_desktop->m_ScreenOffsety,m_desktop->nr_monitors);
+									}
+								}// end update lock
+								
+								////////////////////////////////////////////////////////////////////////////////
+								// END DYNAMIC CHANGES
+								////////////////////////////////////////////////////////////////////////////////
+
+								//Beep(1000,10);
+								//
+								// CALCULATE CHANGES
+								m_desktop->m_UltraEncoder_used=m_desktop->m_server->IsThereAUltraEncodingClient();
+					//			vnclog.Print(LL_INTERR, VNCLOG("UpdateWanted B\n"));
+//#ifdef _DEBUG
+////										char			szText[256];
+//									sprintf(szText," m_desktop->m_server->UpdateWanted check\n");
+//										OutputDebugString(szText);		
+//#endif
+								omni_mutex_lock l(m_desktop->m_update_lock);
+								if (m_desktop->m_server->UpdateWanted())
+								{
+									oldtick=newtick;
+					//				vnclog.Print(LL_INTERR, VNCLOG("UpdateWanted N\n"));
+									//TEST4
+									// Re-render the mouse's old location if it's moved
+									bool cursormoved = false;
+									POINT cursorpos;
+									if (GetCursorPos(&cursorpos) && 
+										((cursorpos.x != oldcursorpos.x) ||
+										(cursorpos.y != oldcursorpos.y)))
+									{
+					//					vnclog.Print(LL_INTERR, VNCLOG("UpdateWanted M %i %i %i %i\n"),cursorpos.x, oldcursorpos.x,cursorpos.y,oldcursorpos.y);
+										cursormoved = TRUE;
+										oldcursorpos = rfb::Point(cursorpos);
+										// nyama/marscha - PointerPos. Inform clients about mouse move.
+										m_desktop->m_server->UpdateMouse();
+										if (MyGetCursorInfo)
+										{
+											MyCURSORINFO cinfo;
+											cinfo.cbSize=sizeof(MyCURSORINFO);
+											MyGetCursorInfo(&cinfo);
+											m_desktop->SetCursor(cinfo.hCursor);
+										}
+									}
+
+									//****************************************************************************
+									//************* Check for moved windows
+									//****************************************************************************
+									// Back removed, to many artifacts
+									bool s_moved=false;
+									//if ((cpuUsage >= m_server->MaxCpu()/2))
+									{
+									if (!m_desktop->m_hookdriver && !m_server->SingleWindow()) 
+											s_moved=m_desktop->CalcCopyRects(updates);
+									}
+								
+									//****************************************************************************
+									//************* Polling ---- no driver
+									//****************************************************************************
+									if (!m_desktop->m_hookdriver || !m_desktop->can_be_hooked)
+									{
+										if (!s_moved)
+										do_polling(threadHandle, rgncache, fullpollcounter, cursormoved);
+									}
+									//****************************************************************************
+									//************* driver  No polling
+									//****************************************************************************
+									else 
+									{
+										// long lTime = timeGetTime();
+										if (cursormoved)
+										{
+											// if (lTime - m_desktop->m_lLastMouseUpdateTime < 200)
+											// 	continue;
+											m_desktop->m_buffer.SetAccuracy(m_desktop->m_server->TurboMode() ? 2 : 1);
+											// m_desktop->m_lLastMouseUpdateTime = lTime;
+										}
+										else
+											// 4 is not that bad...but not perfect (especially with tree branchs display)
+											m_desktop->m_buffer.SetAccuracy(m_desktop->m_server->TurboMode() ? 4 : 2); 
+									}
+									
+									
+									// PROCESS THE MOUSE POINTER
+									// Some of the hard work is done in clients, some here
+									// This code fetches the desktop under the old pointer position
+									// but the client is responsible for actually encoding and sending
+									// it when required.
+									// This code also renders the pointer and saves the rendered position
+									// Clients include this when rendering updates.
+									// The code is complicated in this way because we wish to avoid 
+									// rendering parts of the screen the mouse moved through between
+									// client updates, since in practice they will probably not have changed.
+								
+									if (cursormoved && !m_desktop->m_hookdriver)
+										{
+											if (!m_desktop->m_cursorpos.is_empty())
+											{
+												// Cursor position seems to be outsite the bounding
+												// When you make the screen smaller
+												// add extra check
+												rfb::Rect rect;
+												int x = m_desktop->m_cursorpos.tl.x;
+												int w = m_desktop->m_cursorpos.br.x-x;
+												int y = m_desktop->m_cursorpos.tl.y;
+												int h = m_desktop->m_cursorpos.br.y-y;
+												if (ClipRect(&x, &y, &w, &h, m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.tl.y,
+													m_desktop->m_bmrect.br.x-m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.br.y-m_desktop->m_bmrect.tl.y))
+													{
+														rect.tl.x = x;
+														rect.br.x = x+w;
+														rect.tl.y = y;
+														rect.br.y = y+h;
+														rgncache.assign_union(rect);
+					//									vnclog.Print(LL_INTINFO, VNCLOG("6 %i %i %i %i \n"),m_desktop->m_cursorpos.br.x,m_desktop->m_cursorpos.br.y,m_desktop->m_cursorpos.tl.x,m_desktop->m_cursorpos.tl.y);
+					//									vnclog.Print(LL_INTINFO, VNCLOG("6 %i %i %i %i \n"),rect.br.x,rect.br.y,rect.tl.x,rect.tl.y);
+													}
+											}
+
+										}
+									
+
+									{
+										// Prevent any clients from accessing the Buffer
+										omni_mutex_lock ll(m_desktop->m_update_lock);
+										
+										// CHECK FOR COPYRECTS
+										// This actually just checks where the Foreground window is
+										// Back added, no need to stop polling during move
+										if ((cpuUsage < m_server->MaxCpu()/2))
+										{
+										if (!m_desktop->m_hookdriver && !m_server->SingleWindow() && !s_moved) 
+											s_moved=m_desktop->CalcCopyRects(updates);
+										}
+										
+										// GRAB THE DISPLAY
+										// Fetch data from the display to our display cache.
+										// Update the scaled rects when using server side scaling
+										// something wrong inithooking again
+										// We make sure no updates are in the regions
+										// sf at 2002 - Added "&& m_desktop->m_hookdriver"
+										// Otherwise we're still getting driver updates (from shared memory buffer)
+										// after a m_hookdriver switching from on to off 
+										// (and m_hookdll from off to on) that causes mouse cursor garbage,
+										// or missing mouse cursor.
+										/*char tempchar[10];
+										if ((newtick-oldtick2) != 0) itoa(1000/((newtick-oldtick2)),tempchar,10);
+										oldtick2=newtick;
+										m_desktop->m_buffer.WriteMessageOnScreen(tempchar);*/
+										if (m_desktop->VideoBuffer() && m_desktop->m_hookdriver)
+											{
+												m_desktop->m_buffer.GrabRegion(rgncache,true,capture);
+											}
+										else
+											{
+												m_desktop->m_buffer.GrabRegion(rgncache,false,capture);
+											}
+/*#ifdef _DEBUG
+										char			szText[256];
+										sprintf(szText," capture %i\n",capture);
+										OutputDebugString(szText);		
+#endif*/
+										capture=true;
+											
+										// sf at 2002 - v1.1.x - Mouse handling
+										// If one client, send cursor shapes only when the cursor changes.
+										// This is Disabled for now.
+										if( !XRichCursorEnabled==m_desktop->m_server->IsXRichCursorEnabled())
+											{
+												XRichCursorEnabled= (FALSE != m_desktop->m_server->IsXRichCursorEnabled());
+												if (m_desktop->m_videodriver)
+														{
+																if (!XRichCursorEnabled) m_desktop->m_videodriver->HardwareCursor();
+																else m_desktop->m_videodriver->NoHardwareCursor();
+														}
+
+											}
+										if (m_desktop->m_server->IsXRichCursorEnabled() && !m_desktop->m_UltraEncoder_used)
+											{
+												if (m_desktop->m_hcursor != m_desktop->m_hOldcursor || m_desktop->m_buffer.IsShapeCleared())
+														{
+																m_desktop->m_hOldcursor = m_desktop->m_hcursor;
+																m_desktop->m_buffer.SetCursorPending(TRUE);
+																if (!m_desktop->m_hookdriver) m_desktop->m_buffer.GrabMouse(); // Grab mouse cursor in all cases
+																m_desktop->m_server->UpdateMouse();
+																rfb::Rect rect;
+																int x = m_desktop->m_cursorpos.tl.x;
+																int w = m_desktop->m_cursorpos.br.x-x;
+																int y = m_desktop->m_cursorpos.tl.y;
+																int h = m_desktop->m_cursorpos.br.y-y;
+																if (ClipRect(&x, &y, &w, &h, m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.tl.y,
+																	m_desktop->m_bmrect.br.x-m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.br.y-m_desktop->m_bmrect.tl.y))
+																		{
+																			rect.tl.x = x;
+																			rect.br.x = x+w;
+																			rect.tl.y = y;
+																			rect.br.y = y+h;
+																			rgncache.assign_union(rect);
+					//														vnclog.Print(LL_INTINFO, VNCLOG("7 %i %i %i %i \n"),m_desktop->m_cursorpos.br.x,m_desktop->m_cursorpos.br.y,m_desktop->m_cursorpos.tl.x,m_desktop->m_cursorpos.tl.y);
+					//														vnclog.Print(LL_INTINFO, VNCLOG("6 %i %i %i %i \n"),rect.br.x,rect.br.y,rect.tl.x,rect.tl.y);
+																		}
+																m_server->UpdateCursorShape();
+																}
+											}
+										else if (!m_desktop->m_hookdriver)// If several clients, send them all the mouse updates
+											{												
+												// Render the mouse
+												//if (!m_desktop->VideoBuffer())
+												m_desktop->m_buffer.GrabMouse();
+												
+												if (cursormoved /*&& !m_desktop->m_buffer.IsCursorUpdatePending()*/) 
+															{
+																// Inform clients that it has moved
+																m_desktop->m_server->UpdateMouse();
+																// Get the buffer to fetch the pointer bitmap
+																if (!m_desktop->m_cursorpos.is_empty())
+																{
+																	rfb::Rect rect;
+																int x = m_desktop->m_cursorpos.tl.x;
+																int w = m_desktop->m_cursorpos.br.x-x;
+																int y = m_desktop->m_cursorpos.tl.y;
+																int h = m_desktop->m_cursorpos.br.y-y;
+																if (ClipRect(&x, &y, &w, &h, m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.tl.y,
+																	m_desktop->m_bmrect.br.x-m_desktop->m_bmrect.tl.x, m_desktop->m_bmrect.br.y-m_desktop->m_bmrect.tl.y))
+																		{
+																			rect.tl.x = x;
+																			rect.br.x = x+w;
+																			rect.tl.y = y;
+																			rect.br.y = y+h;
+																			rgncache.assign_union(rect);
+																		}
+																}
+
+															}
+												}	
+										
+											
+										// SCAN THE CHANGED REGION FOR ACTUAL CHANGES
+										// The hooks return hints as to areas that may have changed.
+										// We check the suggested areas, and just send the ones that
+										// have actually changed.
+										// Note that we deliberately don't check the copyrect destination
+										// here, to reduce the overhead & the likelihood of corrupting the
+										// backbuffer contents.
+										rfb::Region2D checkrgn;
+										rfb::Region2D changedrgn;
+										rfb::Region2D cachedrgn;
+
+											
+										//Update the backbuffer for the copyrect region
+										if (!clipped_updates.get_copied_region().is_empty()) 
+											{
+												rfb::UpdateInfo update_info;
+												rfb::RectVector::const_iterator i;
+												clipped_updates.get_update(update_info);
+												if (!update_info.copied.empty()) 
+													{
+														for (i=update_info.copied.begin(); i!=update_info.copied.end(); i++) 						
+															m_desktop->m_buffer.CopyRect(*i, update_info.copy_delta);
+													}
+											}
+										//Remove the copyrect region from the other updates					
+										//checkrgn = rgncache.union_(clipped_updates.get_copied_region());	
+										checkrgn = rgncache.subtract(clipped_updates.get_copied_region());	
+										//make sure the copyrect is checked next update
+										if (!clipped_updates.get_copied_region().is_empty() && (cpuUsage < m_server->MaxCpu()/2))
+										{
+
+											rfb::UpdateInfo update_info;
+												rfb::RectVector::const_iterator i;
+												clipped_updates.get_update(update_info);
+												if (!update_info.copied.empty()) 
+													{
+														for (i=update_info.copied.begin(); i!=update_info.copied.end(); i++) 						
+														{
+															rfb::Rect rect;
+															rect.br.x=i->br.x+4;
+															rect.br.y=i->br.y+4;
+															rect.tl.x=i->tl.x-4;
+															rect.tl.y=i->tl.y-4;
+															rect = rect.intersect(m_desktop->m_Cliprect);
+															rgncache=rgncache.union_(rect);
+															rfb::Rect src = rect.translate(update_info.copy_delta.negate());
+															src = src.intersect(m_desktop->m_Cliprect);
+															rgncache=rgncache.union_(src);
+														}
+													}
+										}
+										else
+											rgncache = clipped_updates.get_copied_region();
+										
+										//Check all regions for changed and cached parts
+										//This is very cpu intensive, only check once for all viewers
+										if (!checkrgn.is_empty())
+											m_desktop->m_buffer.CheckRegion(changedrgn,cachedrgn, checkrgn);
+										if (!initialupdate)
+											{
+												m_server->InitialUpdate(true);
+												initialupdate=true;
+											}
+										updates.add_changed(changedrgn);
+										updates.add_cached(cachedrgn);
+												
+										clipped_updates.get_update(m_server->GetUpdateTracker());
+									}  // end mutex lock
+
+									// Clear the update tracker and region cache an solid
+									clipped_updates.clear();
+									// screen blanking
+									if (m_desktop->OldPowerOffTimeout!=0)
+										{
+										if (!m_server->BlackAlphaBlending() || m_desktop->VideoBuffer())
+											{
+												if(OSversion()!=2)
+												{
+												SystemParametersInfo(SPI_SETPOWEROFFACTIVE, 1, NULL, 0);
+												SendMessage(m_desktop->m_hwnd,WM_SYSCOMMAND,SC_MONITORPOWER,(LPARAM)2);
+												}
+					// don't block input here, this is the wrong thread!
+											}
+										}
+					#ifdef AVILOG
+									if (m_desktop->AviGen) m_desktop->AviGen->AddFrame((BYTE*)m_desktop->m_DIBbits);
+					#endif
+								}
+								//newtick = timeGetTime(); 
+							}
+						}
+					break;
+
+				case WAIT_OBJECT_0+1:
+					ResetEvent(m_desktop->trigger_events[1]);
+					m_desktop->lock_region_add=true;
+					rgncache.assign_union(m_desktop->rgnpump);
+					m_desktop->rgnpump.clear();
+					m_desktop->lock_region_add=false;
+					waiting_update++;
+					break;
+				case WAIT_OBJECT_0+2:
+					ResetEvent(m_desktop->trigger_events[2]);
+					break;
+				case WAIT_OBJECT_0+3:
+					if (MyGetCursorInfo)
+					{
+						MyCURSORINFO cinfo;
+						cinfo.cbSize=sizeof(MyCURSORINFO);
+						MyGetCursorInfo(&cinfo);
+						m_desktop->SetCursor(cinfo.hCursor);
+					}
+					ResetEvent(m_desktop->trigger_events[3]);
+					break;
+				case WAIT_OBJECT_0+4:
+					rgncache.assign_union(m_desktop->m_Cliprect);
+					ResetEvent(m_desktop->trigger_events[4]);
+					break;
+				case WAIT_OBJECT_0+5:
+					//break to close
+					looping=false;
+					ResetEvent(m_desktop->trigger_events[5]);
+					break;
+			}
+		}
+		
+	}//while
+
+	stop_hookwatch=true;
+	if (threadHandle)
+	{
+		WaitForSingleObject( threadHandle, 5000 );
+		CloseHandle(threadHandle);
+	}
+	
+	m_desktop->SetClipboardActive(FALSE);
+	vnclog.Print(LL_INTINFO, VNCLOG("quitting desktop server thread\n"));
+	
+	// Clear all the hooks and close windows, etc.
+    m_desktop->SetBlockInputState(false);
+	m_server->SingleWindow(false);
+	vnclog.Print(LL_INTINFO, VNCLOG("quitting desktop server thread:SetBlockInputState\n"));
+	
+	// Clear the shift modifier keys, now that there are no remote clients
+	vncKeymap::ClearShiftKeys();
+	vnclog.Print(LL_INTINFO, VNCLOG("quitting desktop server thread:ClearShiftKeys\n"));
+	
+	// Switch back into our home desktop, under NT (no effect under 9x)
+	//TAG14
+	HWND mywin=FindWindow("blackscreen",NULL);
+	if (mywin)SendMessage(mywin,WM_CLOSE, 0, 0);
+	g_DesktopThread_running=false;
+	vnclog.Print(LL_INTINFO, VNCLOG("quitting desktop server thread:g_DesktopThread_running=false\n"));
+	m_desktop->Shutdown();
+	vnclog.Print(LL_INTINFO, VNCLOG("quitting desktop server thread:m_desktop->Shutdown\n"));
+	return NULL;
+}
diff --git a/ica/win32/winvnc/winvnc/vncdesktopthread.h b/ica/win32/winvnc/winvnc/vncdesktopthread.h
new file mode 100644
index 0000000..a6e674e
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncdesktopthread.h
@@ -0,0 +1,132 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#if !defined(_WINVNC_VNCDESKTOPTHREAD)
+#define _WINVNC_VNCDESKTOPTHREAD
+#include "stdhdrs.h"
+#include "vncserver.h"
+#include "vnckeymap.h"
+#include "vncdesktop.h"
+#include "vncservice.h"
+#include "mmsystem.h"
+#include "IPC.h"
+#include "CpuUsage.h"
+
+typedef struct _CURSORINFO
+{
+    DWORD   cbSize;
+    DWORD   flags;
+    HCURSOR hCursor;
+    POINT   ptScreenPos;
+} MyCURSORINFO, *PMyCURSORINFO, *LPMyCURSORINFO;
+// The desktop handler thread
+// This handles the messages posted by RFBLib to the vncDesktop window
+typedef BOOL (WINAPI *_GetCursorInfo)(PMyCURSORINFO pci);
+extern bool g_DesktopThread_running;
+#define MSGFLT_ADD		1
+typedef BOOL (WINAPI *CHANGEWINDOWMESSAGEFILTER)(UINT message, DWORD dwFlag);
+
+extern const UINT RFB_SCREEN_UPDATE;
+extern const UINT RFB_COPYRECT_UPDATE;
+extern const UINT RFB_MOUSE_UPDATE;
+
+class vncDesktopThread : public omni_thread
+{
+public:
+	vncDesktopThread() {
+		m_returnsig = NULL;
+		user32 = LoadLibrary("user32.dll");
+		MyGetCursorInfo=NULL;
+		if (user32) MyGetCursorInfo=(_GetCursorInfo )GetProcAddress(user32, "GetCursorInfo");
+		g_DesktopThread_running=true;
+
+		m_lLastMouseMoveTime = 0L;
+		
+		hUser32 = LoadLibrary("user32.dll");
+		CHANGEWINDOWMESSAGEFILTER pfnFilter = NULL;
+		if (hUser32)
+		{
+		pfnFilter =(CHANGEWINDOWMESSAGEFILTER)GetProcAddress(hUser32,"ChangeWindowMessageFilter");
+		if (pfnFilter) pfnFilter(RFB_SCREEN_UPDATE, MSGFLT_ADD);
+		if (pfnFilter) pfnFilter(RFB_COPYRECT_UPDATE, MSGFLT_ADD);
+		if (pfnFilter) pfnFilter(RFB_MOUSE_UPDATE, MSGFLT_ADD);
+		}
+		cpuUsage=0;
+		MIN_UPDATE_INTERVAL=33;
+		MIN_UPDATE_INTERVAL_MAX=500;
+		MIN_UPDATE_INTERVAL_MIN=33;
+		// replaced by macpu ini setting
+		MAX_CPU_USAGE=20;
+	};
+protected:
+	~vncDesktopThread() {
+		if (m_returnsig != NULL) delete m_returnsig;
+		if (user32) FreeLibrary(user32);
+		g_DesktopThread_running=false;
+		if (hUser32) FreeLibrary(hUser32);
+	};
+private:
+	bool handle_display_change(HANDLE& threadhandle, rfb::Region2D& rgncache, rfb::SimpleUpdateTracker& clipped_updates, rfb::ClippedUpdateTracker& updates);
+	void do_polling(HANDLE& threadHandle, rfb::Region2D& rgncache, int& fullpollcounter, bool cursormoved);
+
+public:
+	virtual BOOL Init(vncDesktop *desktop, vncServer *server);
+	virtual void *run_undetached(void *arg);
+	virtual void ReturnVal(DWORD result);
+	void PollWindow(rfb::Region2D &rgn, HWND hwnd);
+	// Modif rdv at 2002 - v1.1.x - videodriver
+	virtual BOOL handle_driver_changes(rfb::Region2D &rgncache,rfb::UpdateTracker &tracker);
+	virtual void copy_bitmaps_to_buffer(ULONG i,rfb::Region2D &rgncache,rfb::UpdateTracker &tracker);
+	bool Handle_Ringbuffer(mystruct *ringbuffer,rfb::Region2D &rgncache);
+	CIPC g_obIPC;
+	vncDesktop *m_desktop;
+
+protected:
+	vncServer *m_server;
+
+	omni_mutex m_returnLock;
+	omni_condition *m_returnsig;
+	DWORD m_return;
+	BOOL m_returnset;
+	bool m_screen_moved;
+	bool lastsend;
+	HMODULE user32;
+	_GetCursorInfo MyGetCursorInfo;
+	bool XRichCursorEnabled;
+	DWORD newtick,oldtick,oldtick2;
+
+	DWORD m_lLastMouseMoveTime;
+	HMODULE  hUser32;
+	CProcessorUsage usage;
+	short cpuUsage;
+	DWORD MIN_UPDATE_INTERVAL;
+	DWORD MIN_UPDATE_INTERVAL_MAX;
+	DWORD MIN_UPDATE_INTERVAL_MIN;
+	DWORD MAX_CPU_USAGE;
+	bool capture;
+	bool first_run;
+	bool initialupdate;
+
+};
+#endif
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncencodecorre.cpp b/ica/win32/winvnc/winvnc/vncencodecorre.cpp
new file mode 100644
index 0000000..e0cc787
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencodecorre.cpp
@@ -0,0 +1,522 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeCoRRE
+
+// This file implements the vncEncoder-derived vncEncodeCoRRE class.
+// This class overrides some vncEncoder functions to produce a 
+// Compact RRE encoder.  Compact RRE (CoRRE) uses fewer bytes to
+// encode each subrect, which makes it faster in general.  It also
+// splits large rectangles up into ones of at most 256 pixels width
+// & height.  This results in better granularity to use for deciding
+// whether to send RAW or CoRRE/RRE. 
+
+#include "vncencodecorre.h"
+#include "rfb.h"
+#include "rfbMisc.h"
+#include <stdlib.h>
+#include <time.h>
+
+vncEncodeCoRRE::vncEncodeCoRRE()
+{
+	m_buffer = NULL;
+	m_bufflen = 0;
+
+	// Set some sensible defaults
+	m_maxwidth = 24;
+	m_maxheight = 24;
+	m_maxadjust = 1;
+
+	// Set the threshold up/down probability
+	m_threshold = 50;
+
+	// Seed the random number generator
+	srand((unsigned)time(NULL));
+
+	m_statsready = FALSE;
+	m_encodedbytes = 0;
+	m_rectbytes = 0;
+}
+
+vncEncodeCoRRE::~vncEncodeCoRRE()
+{
+	if (m_buffer != NULL)
+	{
+		delete [] m_buffer;
+		m_buffer = NULL;
+	}
+}
+
+void vncEncodeCoRRE::Init()
+{
+	vncEncoder::Init();
+}
+
+UINT vncEncodeCoRRE::RequiredBuffSize(UINT width, UINT height)
+{
+	rfb::Rect fullscreen = rfb::Rect(0, 0, width, height);
+	UINT codedrects;
+
+	// Work out how many rectangles the entire screen would
+	// be re-encoded to...
+	codedrects = NumCodedRects(fullscreen);
+
+	// The buffer size required is the size of raw data for the whole
+	// screen plus enough space for the required number of rectangle
+	// headers.
+	// This is inherently always greater than the RAW encoded size of
+	// the whole screen!
+	return (codedrects * sz_rfbFramebufferUpdateRectHeader) +
+			(width * height * m_remoteformat.bitsPerPixel)/8;
+}
+
+UINT
+vncEncodeCoRRE::NumCodedRects(const rfb::Rect &rect)
+{
+	// If we have any statistical data handy then adjust the CoRRE sizes
+	if (m_statsready)
+	{
+		m_statsready = FALSE;
+
+		UINT newscore = m_encodedbytes * m_lastrectbytes;
+		UINT oldscore = m_lastencodedbytes * m_rectbytes;
+
+		if (newscore <= oldscore)
+		{
+			// The change was a good one, so adjust the threshold accordingly!
+			m_threshold = max(5, min(95, m_threshold + m_maxadjust));
+
+			m_maxwidth = max(8, min(255, m_maxwidth + m_maxadjust));
+			m_maxheight = max(8, min(255, m_maxheight + m_maxadjust));
+		}
+		else
+		{
+			// The change was a bad one, so adjust the threshold accordingly!
+			// m_threshold = Max(5, Min(95, m_threshold - m_maxadjust));
+		}
+
+		// Now calculate a new adjustment and apply it
+		m_maxadjust = ((rand() % 99)<m_threshold) ? 1 : -1;
+		
+		// Prepare the stats data for next time...
+		m_lastencodedbytes = m_encodedbytes;
+		m_lastrectbytes = m_rectbytes;
+
+		m_encodedbytes = 0;
+		m_rectbytes = 0;
+	}
+
+	// Now return the number of rects that this one would encode to
+    if ((UINT)(rect.br.y-rect.tl.y) > m_maxheight)
+	{
+		rfb::Rect subrect1, subrect2;
+
+		// Find how many rects the two subrects would take
+		subrect1.tl.x = rect.tl.x;
+		subrect1.br.x = rect.br.x;
+		subrect1.tl.y = rect.tl.y;
+		subrect1.br.y = rect.tl.y + m_maxheight;
+
+		subrect2.tl.x = rect.tl.x;
+		subrect2.br.x = rect.br.x;
+		subrect2.tl.y = rect.tl.y + m_maxheight;
+		subrect2.br.y = rect.br.y;
+
+		return NumCodedRects(subrect1) + NumCodedRects(subrect2);
+	}
+
+    if ((UINT)(rect.br.x-rect.tl.x) > m_maxwidth)
+	{
+		rfb::Rect subrect1, subrect2;
+
+		// Find how many rects the two subrects would take
+		subrect1.tl.x = rect.tl.x;
+		subrect1.br.x = rect.tl.x + m_maxwidth;
+		subrect1.tl.y = rect.tl.y;
+		subrect1.br.y = rect.br.y;
+
+		subrect2.tl.x = rect.tl.x + m_maxwidth;
+		subrect2.br.x = rect.br.x;
+		subrect2.tl.y = rect.tl.y;
+		subrect2.br.y = rect.br.y;
+		return NumCodedRects(subrect1) + NumCodedRects(subrect2);
+	}
+
+	// This rectangle is small enough not to require splitting
+	return 1;
+}
+
+/*
+ * corre.c
+ *
+ * Routines to implement Compact Rise-and-Run-length Encoding (CoRRE).  This
+ * code is based on krw's original javatel rfbserver.
+ */
+
+/*
+ * This version modified for WinVNC by jnw.
+ */
+
+static int rreAfterBufLen;
+
+static int subrectEncode8 (CARD8 *source, CARD8 *dest, int w, int h, int max);
+static int subrectEncode16 (CARD16 *source, CARD8 *dest, int w, int h, int max);
+static int subrectEncode32 (CARD32 *source, CARD8 *dest, int w, int h, int max);
+static CARD32 getBgColour (char *data, int size, int bpp);
+
+/*
+ * vncEncodeCoRRE::EncodeRect - send an arbitrary size rectangle using CoRRE
+ * encoding.
+ */
+
+UINT
+vncEncodeCoRRE::EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect)
+{
+	// Do the encoding
+	UINT size = InternalEncodeRect(source, dest, rect);
+
+	const UINT rectW = rect.br.x - rect.tl.x;
+	const UINT rectH = rect.br.y - rect.tl.y;
+
+	// Will this rectangle have been split for encoding?
+	if ((rectW>m_maxwidth) || (rectH>m_maxheight))
+	{
+		// Yes : Once we return, the stats will be valid!
+		m_statsready = TRUE;
+
+		// Update the stats
+		m_encodedbytes += size;
+		m_rectbytes += sz_rfbFramebufferUpdateRectHeader +
+			(rectW*rectH*m_remoteformat.bitsPerPixel/8);
+	}
+
+	return size;
+}
+
+UINT
+vncEncodeCoRRE::InternalEncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect)
+{
+	int size = 0;
+
+    if ((UINT)(rect.br.y-rect.tl.y) > m_maxheight)
+	{
+		rfb::Rect subrect;
+
+		// Rectangle is too high - split it into two subrects to send
+		subrect.tl.x = rect.tl.x;
+		subrect.br.x = rect.br.x;
+		subrect.tl.y = rect.tl.y;
+		subrect.br.y = rect.tl.y + m_maxheight;
+		size += InternalEncodeRect(source, dest + size, subrect);
+
+		subrect.tl.x = rect.tl.x;
+		subrect.br.x = rect.br.x;
+		subrect.tl.y = rect.tl.y + m_maxheight;
+		subrect.br.y = rect.br.y;
+		size += InternalEncodeRect(source, dest + size, subrect);
+
+		return size;
+    }
+
+    if ((UINT)(rect.br.x-rect.tl.x) > m_maxwidth)
+	{
+		rfb::Rect subrect;
+
+		// Rectangle is too high - split it into two subrects to send
+		subrect.tl.x = rect.tl.x;
+		subrect.br.x = rect.tl.x + m_maxwidth;
+		subrect.tl.y = rect.tl.y;
+		subrect.br.y = rect.br.y;
+		size += InternalEncodeRect(source, dest + size, subrect);
+
+		subrect.tl.x = rect.tl.x + m_maxwidth;
+		subrect.br.x = rect.br.x;
+		subrect.tl.y = rect.tl.y;
+		subrect.br.y = rect.br.y;
+		size += InternalEncodeRect(source, dest + size, subrect);
+
+		return size;
+	}
+
+    return EncodeSmallRect(source, dest, rect);
+}
+
+void
+vncEncodeCoRRE::SetCoRREMax(BYTE width, BYTE height)
+{
+	m_maxwidth = width;
+	m_maxheight = height;
+}
+
+/*
+ * EncodeSmallRect - send a small (guaranteed < 256x256)
+ * rectangle using CoRRE encoding.
+ */
+
+UINT
+vncEncodeCoRRE::EncodeSmallRect(BYTE *source, BYTE *dest, const rfb::Rect &rect)
+{
+	int subrects = -1;
+
+	const UINT rectW = rect.br.x - rect.tl.x;
+	const UINT rectH = rect.br.y - rect.tl.y;
+
+	// Create the rectangle header
+	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
+	surh->r.x = (CARD16) (rect.tl.x-m_SWOffsetx);
+	surh->r.y = (CARD16) (rect.tl.y-m_SWOffsety);
+	surh->r.w = (CARD16) (rectW);
+	surh->r.h = (CARD16) (rectH);
+	surh->r.x = Swap16IfLE(surh->r.x);
+	surh->r.y = Swap16IfLE(surh->r.y);
+	surh->r.w = Swap16IfLE(surh->r.w);
+	surh->r.h = Swap16IfLE(surh->r.h);
+	surh->encoding = Swap32IfLE(rfbEncodingCoRRE);
+	
+	// create a space big enough for the CoRRE encoded pixels
+	if (m_bufflen < (int)(rectW*rectH*m_remoteformat.bitsPerPixel / 8))
+	{
+		if (m_buffer != NULL)
+		{
+			delete [] m_buffer;
+			m_buffer = NULL;
+		}
+		m_buffer = new BYTE [rectW*rectH*m_remoteformat.bitsPerPixel/8+1];
+		if (m_buffer == NULL)
+			return vncEncoder::EncodeRect(source, dest, rect);
+
+		m_bufflen = rectW*rectH*m_remoteformat.bitsPerPixel/8;
+	}
+	
+	// Translate the data into our new buffer
+	Translate(source, m_buffer, rect);
+
+	// The Buffer object will have ensured that the destination buffer is
+	// big enough using RequiredBuffSize
+
+	// Choose the appropriate encoding routine (for speed...)
+	switch(m_remoteformat.bitsPerPixel)
+	{
+	case 8:
+		subrects = subrectEncode8(
+			m_buffer,
+			dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader,
+			rectW,
+			rectH,
+			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
+			);
+		break;
+	case 16:
+		subrects = subrectEncode16(
+			(CARD16 *)m_buffer,
+			(CARD8 *)(dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader),
+			rectW,
+			rectH,
+			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
+			);
+		break;
+	case 32:
+		subrects = subrectEncode32(
+			(CARD32 *)m_buffer,
+			(CARD8 *)(dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader),
+			rectW,
+			rectH,
+			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
+			);
+		break;
+	}
+
+	// If we couldn't encode the rectangles then just send the data raw
+	if (subrects < 0)
+		return vncEncoder::EncodeRect(source, dest, rect);
+
+	// Send the RREHeader
+	rfbRREHeader *rreh=(rfbRREHeader *)(dest+sz_rfbFramebufferUpdateRectHeader);
+	rreh->nSubrects = Swap32IfLE(subrects);
+
+	// Calculate the size of the buffer produced
+	return sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + rreAfterBufLen;
+}
+
+/*
+ * 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 rreAfterBuf.  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(											\
+	CARD##bpp *source,										\
+    CARD8 *dest,											\
+	int w,													\
+	int h,													\
+	int maxbytes)											\
+{															\
+    CARD##bpp cl;											\
+    rfbCoRRERectangle subrect;								\
+    int x,y;												\
+    int i,j;												\
+    int hx=0,hy,vx=0,vy;									\
+    int hyflag;												\
+    CARD##bpp *seg;											\
+    CARD##bpp *line;										\
+    int hw,hh,vw,vh;										\
+    int thex,they,thew,theh;								\
+    int numsubs = 0;										\
+    int newLen;												\
+    CARD##bpp bg = (CARD##bpp)getBgColour((char*)source,w*h,bpp);	\
+															\
+    *((CARD##bpp*)dest) = bg;								\
+															\
+    rreAfterBufLen = (bpp/8);								\
+															\
+    for (y=0; y<h; y++) {									\
+      line = source+(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 = source+(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 = rreAfterBufLen + (bpp/8) + sz_rfbCoRRERectangle;			\
+          if ((newLen > (w * h * (bpp/8))) || (newLen > maxbytes))		\
+	    return -1;											\
+															\
+	  numsubs += 1;											\
+	  *((CARD##bpp*)(dest + rreAfterBufLen)) = cl;			\
+	  rreAfterBufLen += (bpp/8);							\
+	  memcpy(&dest[rreAfterBufLen],&subrect,sz_rfbCoRRERectangle);		\
+	  rreAfterBufLen += sz_rfbCoRRERectangle;			    \
+															\
+		  /*												\
+           * Now mark the subrect as done.				    \
+           */												\
+          for (j=they; j < (they+theh); j++) {				\
+            for (i=thex; i < (thex+thew); i++) {			\
+              source[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 CARD32
+getBgColour(
+	char *data,
+	int size,
+	int bpp)
+{
+    
+#define NUMCLRS 256
+  
+  static int counts[NUMCLRS];
+  int i,j,k;
+
+  int maxcount = 0;
+  CARD8 maxclr = 0;
+
+  if (bpp != 8) {
+    if (bpp == 16) {
+      return ((CARD16 *)data)[0];
+    } else if (bpp == 32) {
+      return ((CARD32 *)data)[0];
+    } else {
+      fprintf(stderr,"getBgColour: bpp %d?\n",bpp);
+      exit(1);
+    }
+  }
+
+  for (i=0; i<NUMCLRS; i++) {
+    counts[i] = 0;
+  }
+
+  for (j=0; j<size; j++) {
+    k = (int)(((CARD8 *)data)[j]);
+    if (k >= NUMCLRS) {
+      fprintf(stderr, "%s: unusual colour = %d\n", "getBgColour",k);
+      exit(1);
+    }
+    counts[k] += 1;
+    if (counts[k] > maxcount) {
+      maxcount = counts[k];
+      maxclr = ((CARD8 *)data)[j];
+    }
+  }
+  
+  return maxclr;
+}
diff --git a/ica/win32/winvnc/winvnc/vncencodecorre.h b/ica/win32/winvnc/winvnc/vncencodecorre.h
new file mode 100644
index 0000000..0f0ff2a
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencodecorre.h
@@ -0,0 +1,81 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeCoRRE object
+
+// The vncEncodeCoRRE object uses a compression encoding to send rectangles
+// to a client
+
+class vncEncodeCoRRE;
+
+#if !defined(_WINVNC_ENCODECORRRE)
+#define _WINVNC_ENCODECORRE
+#pragma once
+
+#include "vncencoder.h"
+
+// Class definition
+
+class vncEncodeCoRRE : public vncEncoder
+{
+// Fields
+public:
+
+// Methods
+public:
+	// Create/Destroy methods
+	vncEncodeCoRRE();
+	~vncEncodeCoRRE();
+
+	virtual void Init();
+
+	virtual UINT RequiredBuffSize(UINT width, UINT height);
+	virtual UINT NumCodedRects(const rfb::Rect &rect);
+
+	virtual UINT EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect);
+	virtual void SetCoRREMax(BYTE width, BYTE height);
+protected:
+	virtual UINT InternalEncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect);
+	virtual UINT EncodeSmallRect(BYTE *source, BYTE *dest, const rfb::Rect &rect);
+
+// Implementation
+protected:
+	BYTE		*m_buffer;
+	int			m_bufflen;
+
+	// Maximum height & width for CoRRE
+	UINT		m_maxwidth;
+	UINT		m_maxheight;
+
+	// Last-update stats for CoRRE
+	UINT		m_encodedbytes, m_rectbytes;
+	UINT		m_lastencodedbytes, m_lastrectbytes;
+	int			m_maxadjust;
+	int			m_threshold;
+	BOOL		m_statsready;
+};
+
+#endif // _WINVNC_ENCODECORRE
+
diff --git a/ica/win32/winvnc/winvnc/vncencodehext.cpp b/ica/win32/winvnc/winvnc/vncencodehext.cpp
new file mode 100644
index 0000000..82b117c
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencodehext.cpp
@@ -0,0 +1,411 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeHexT
+
+// This file implements the vncEncoder-derived vncEncodeHexT class.
+// This class overrides some vncEncoder functions to produce a
+// Hextile encoder.  Hextile splits all top-level update rectangles
+// into smaller, 16x16 rectangles and encodes these using the
+// optimised Hextile sub-encodings.
+
+#include "vncencodehext.h"
+#include "rfb.h"
+#include "rfbMisc.h"
+#include <stdlib.h>
+#include <time.h>
+
+vncEncodeHexT::vncEncodeHexT()
+{
+}
+
+vncEncodeHexT::~vncEncodeHexT()
+{
+}
+
+void
+vncEncodeHexT::Init()
+{
+	vncEncoder::Init();
+}
+
+UINT
+vncEncodeHexT::RequiredBuffSize(UINT width, UINT height)
+{
+	return vncEncoder::RequiredBuffSize(width, height) + (((width/16)+1) * ((height/16)+1));
+}
+
+UINT
+vncEncodeHexT::NumCodedRects(const rfb::Rect &rect)
+{
+	return 1;
+}
+
+/*
+ * hextile.c
+ *
+ * Routines to implement Hextile Encoding
+ */
+
+#include <stdio.h>
+#include "rfb.h"
+
+/*
+ * vncEncodeHexT::EncodeRect - send a rectangle using hextile encoding.
+ */
+
+UINT
+vncEncodeHexT::EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect_IN)
+{
+	rfb::Rect rect;
+	rect.tl.x=(rect_IN.tl.x < 0)? 0: rect_IN.tl.x;
+	rect.tl.y=(rect_IN.tl.y < 0)? 0: rect_IN.tl.y;
+	rect.br.x=(rect_IN.br.x < 0)? 0: rect_IN.br.x;
+	rect.br.y=(rect_IN.br.y < 0)? 0: rect_IN.br.y;
+
+	const UINT rectW = rect.br.x - rect.tl.x;
+	const UINT rectH = rect.br.y - rect.tl.y;
+
+	// Create the rectangle header
+	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
+	surh->r.x = (CARD16) (rect.tl.x-m_SWOffsetx);
+	surh->r.y = (CARD16) (rect.tl.y-m_SWOffsety);
+	surh->r.w = (CARD16) (rectW);
+	surh->r.h = (CARD16) (rectH);
+	surh->r.x = Swap16IfLE(surh->r.x);
+	surh->r.y = Swap16IfLE(surh->r.y);
+	surh->r.w = Swap16IfLE(surh->r.w);
+	surh->r.h = Swap16IfLE(surh->r.h);
+	surh->encoding = Swap32IfLE(rfbEncodingHextile);
+
+	// Do the encoding
+    switch (m_remoteformat.bitsPerPixel)
+	{
+	case 8:
+		return sz_rfbFramebufferUpdateRectHeader +
+			EncodeHextiles8(source, dest + sz_rfbFramebufferUpdateRectHeader,
+				rect.tl.x, rect.tl.y, rectW, rectH);
+    case 16:
+		return sz_rfbFramebufferUpdateRectHeader +
+			EncodeHextiles16(source, dest + sz_rfbFramebufferUpdateRectHeader,
+				rect.tl.x, rect.tl.y, rectW, rectH);
+    case 32:
+		return sz_rfbFramebufferUpdateRectHeader +
+			EncodeHextiles32(source, dest + sz_rfbFramebufferUpdateRectHeader,
+				rect.tl.x, rect.tl.y, rectW, rectH);
+    }
+
+	return vncEncoder::EncodeRect(source, dest, rect);
+}
+
+#define PUT_PIXEL8(pix) (dest[destoffset++] = (pix))
+
+#define PUT_PIXEL16(pix) (dest[destoffset++] = ((char*)&(pix))[0],			\
+			  dest[destoffset++] = ((char*)&(pix))[1])
+
+#define PUT_PIXEL32(pix) (dest[destoffset++] = ((char*)&(pix))[0],			\
+			  dest[destoffset++] = ((char*)&(pix))[1],						\
+			  dest[destoffset++] = ((char*)&(pix))[2],						\
+			  dest[destoffset++] = ((char*)&(pix))[3])
+
+#define DEFINE_SEND_HEXTILES(bpp)											\
+																			\
+static UINT subrectEncode##bpp(CARD##bpp *src, BYTE *dest,					\
+				int w, int h, CARD##bpp bg,									\
+			    CARD##bpp fg, BOOL mono);									\
+static void testColours##bpp(CARD##bpp *data, int size, BOOL *mono,			\
+			     BOOL *solid, CARD##bpp *bg, CARD##bpp *fg);				\
+																			\
+																			\
+/*																			\
+ * rfbSendHextiles															\
+ */																			\
+																			\
+UINT																		\
+vncEncodeHexT::EncodeHextiles##bpp(BYTE *source, BYTE *dest,				\
+				  int rx, int ry, int rw, int rh)							\
+{																			\
+    int x, y, w, h;															\
+    int rectoffset, destoffset;												\
+    CARD##bpp bg = 0, fg = 0, newBg, newFg;									\
+    BOOL mono, solid;														\
+    BOOL validBg = FALSE;													\
+    CARD##bpp clientPixelData[16*16*(bpp/8)];								\
+    BOOL validFg = FALSE;													\
+																			\
+	destoffset = 0;															\
+																			\
+    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;												\
+																			\
+			rfb::Rect hexrect;												\
+			hexrect.tl.x = x;												\
+			hexrect.tl.y = y;												\
+			hexrect.br.x = x+w;												\
+			hexrect.br.y = y+h;												\
+			Translate(source, (BYTE *) &clientPixelData, hexrect);			\
+																			\
+			rectoffset = destoffset;										\
+			dest[rectoffset] = 0;											\
+			destoffset++;													\
+																			\
+			testColours##bpp(clientPixelData, w * h,						\
+			     &mono, &solid, &newBg, &newFg);							\
+																			\
+			if (!validBg || (newBg != bg))									\
+			{																\
+				validBg = TRUE;												\
+				bg = newBg;													\
+				dest[rectoffset] |= rfbHextileBackgroundSpecified;			\
+				PUT_PIXEL##bpp(bg);											\
+			}																\
+																			\
+			if (solid)														\
+				continue;													\
+																			\
+			dest[rectoffset] |= rfbHextileAnySubrects;						\
+																			\
+			if (mono)														\
+			{																\
+				if (!validFg || (newFg != fg))								\
+				{															\
+					validFg = TRUE;											\
+					fg = newFg;												\
+					dest[rectoffset] |= rfbHextileForegroundSpecified;		\
+					PUT_PIXEL##bpp(fg);										\
+				}															\
+			}																\
+			else															\
+			{																\
+				validFg = FALSE;											\
+				dest[rectoffset] |= rfbHextileSubrectsColoured;			    \
+			}																\
+																			\
+			int encodedbytes = subrectEncode##bpp(clientPixelData,			\
+								   dest + destoffset,						\
+								   w, h, bg, fg, mono);						\
+			destoffset += encodedbytes;										\
+			if (encodedbytes == 0)											\
+			{																\
+				/* encoding was too large, use raw */						\
+				validBg = FALSE;											\
+				validFg = FALSE;											\
+				destoffset = rectoffset;									\
+				dest[destoffset++] = rfbHextileRaw;							\
+																			\
+				Translate(source, (BYTE *) &clientPixelData, hexrect);		\
+																			\
+				memcpy(dest + destoffset, (char *)clientPixelData,			\
+			       w * h * (bpp/8));										\
+																			\
+				destoffset += w * h * (bpp/8);								\
+		    }																\
+		}																	\
+    }																		\
+																			\
+    return destoffset;														\
+}																			\
+																			\
+static UINT																	\
+subrectEncode##bpp(CARD##bpp *src, BYTE *dest, int w, int h, CARD##bpp bg,	\
+		   CARD##bpp fg, BOOL mono)											\
+{																			\
+    CARD##bpp cl;															\
+    int x,y;																\
+    int i,j;																\
+    int hx=0,hy,vx=0,vy;													\
+    int hyflag;																\
+    CARD##bpp *seg;															\
+    CARD##bpp *line;														\
+    int hw,hh,vw,vh;														\
+    int thex,they,thew,theh;												\
+    int numsubs = 0;														\
+    int newLen;																\
+    int rectoffset;															\
+	int destoffset;															\
+																			\
+	destoffset = 0;															\
+    rectoffset = destoffset;												\
+    destoffset++;															\
+																			\
+    for (y=0; y<h; y++)														\
+	{																		\
+		line = src+(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 = src+(j*w);										\
+					if (seg[x] != cl) {break;}								\
+					i = x;													\
+					while ((i < w) && (seg[i] == cl)) 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 = destoffset - rectoffset + 2;					\
+				}															\
+				else														\
+				{															\
+				    newLen = destoffset - rectoffset + bpp/8 + 2;			\
+				}															\
+																			\
+				if (newLen > (w * h * (bpp/8)))								\
+				    return 0;												\
+																			\
+				numsubs += 1;												\
+																			\
+				if (!mono) PUT_PIXEL##bpp(cl);								\
+																			\
+				dest[destoffset++] = rfbHextilePackXY(thex,they);			\
+				dest[destoffset++] = rfbHextilePackWH(thew,theh);			\
+																			\
+				/*															\
+				 * Now mark the subrect as done.							\
+				 */															\
+				for (j=they; j < (they+theh); j++)							\
+				{															\
+					for (i=thex; i < (thex+thew); i++)						\
+					{														\
+						src[j*w+i] = bg;									\
+					}														\
+				}															\
+		    }																\
+		}																	\
+    }																		\
+																			\
+    dest[rectoffset] = numsubs;												\
+																			\
+    return destoffset;														\
+}																			\
+																			\
+																			\
+/*																			\
+ * 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(CARD##bpp *data, int size,									\
+				 BOOL *mono, BOOL *solid,									\
+				 CARD##bpp *bg, CARD##bpp *fg)								\
+{																			\
+    CARD##bpp colour1, colour2;												\
+    int n1 = 0, n2 = 0;														\
+    *mono = TRUE;															\
+    *solid = TRUE;															\
+	colour1=0;																\
+	colour2=0;																\
+																			\
+    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/win32/winvnc/winvnc/vncencodehext.h b/ica/win32/winvnc/winvnc/vncencodehext.h
new file mode 100644
index 0000000..6fccec8
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencodehext.h
@@ -0,0 +1,72 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeHexT object
+
+// The vncEncodeHexT object uses a compression encoding to send rectangles
+// to a client
+
+class vncEncodeHexT;
+
+#if !defined(_WINVNC_ENCODEHEXTILE)
+#define _WINVNC_ENCODEHEXTILE
+#pragma once
+
+#include "vncencoder.h"
+
+// Class definition
+
+class vncEncodeHexT : public vncEncoder
+{
+// Fields
+public:
+
+// Methods
+public:
+	// Create/Destroy methods
+	vncEncodeHexT();
+	~vncEncodeHexT();
+
+	virtual void Init();
+
+	virtual UINT RequiredBuffSize(UINT width, UINT height);
+	virtual UINT NumCodedRects(const rfb::Rect &rect);
+
+	virtual UINT EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect);
+
+protected:
+	virtual UINT EncodeHextiles8(BYTE *source, BYTE *dest,
+		int x, int y, int w, int h);
+	virtual UINT EncodeHextiles16(BYTE *source, BYTE *dest,
+		int x, int y, int w, int h);
+	virtual UINT EncodeHextiles32(BYTE *source, BYTE *dest,
+		int x, int y, int w, int h);
+
+// Implementation
+protected:
+};
+
+#endif // _WINVNC_ENCODEHEXTILE
+
diff --git a/ica/win32/winvnc/winvnc/vncencodemgr.h b/ica/win32/winvnc/winvnc/vncencodemgr.h
new file mode 100644
index 0000000..f86a1ad
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencodemgr.h
@@ -0,0 +1,923 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+// vncEncodeMgr
+
+// This class is used internally by vncClient to offload the handling of
+// bitmap data encoding and translation.  Trying to avoid bloating the
+// already rather bloaty vncClient class!
+
+class vncEncodeMgr;
+
+#if !defined(_WINVNC_VNCENCODEMGR)
+#define _WINVNC_VNCENCODEMGR
+#pragma once
+
+// Includes
+
+#include "vncencoder.h"
+#include "vncencoderre.h"
+#include "vncencodecorre.h"
+#include "vncencodehext.h"
+#include "vncencodezrle.h"
+#include "vncEncodeZlib.h"
+#include "vncEncodeZlibHex.h"
+#include "vncEncodeTight.h"
+#include "vncEncodeUltra.h"
+#include "vncEncodeUltra2.h"
+#include "vncbuffer.h"
+
+//
+// -=- Define the Encoding Manager interface
+// 
+
+class vncEncodeMgr
+{
+public:
+	// Create/Destroy methods
+	inline vncEncodeMgr();
+	inline ~vncEncodeMgr();
+
+	inline void SetBuffer(vncBuffer *buffer);
+
+	// BUFFER INFO
+	inline rfb::Rect GetSize();
+	inline BYTE *GetClientBuffer();
+	inline UINT GetClientBuffSize() {return m_clientbuffsize;}; // sf at 2002
+	inline BOOL GetPalette(RGBQUAD *quadbuff, UINT ncolours);
+
+	inline omni_mutex& GetUpdateLock() {return m_buffer->m_desktop->GetUpdateLock();};
+
+	// ENCODING & TRANSLATION
+	inline UINT GetNumCodedRects(const rfb::Rect &rect);
+	inline BOOL SetEncoding(CARD32 encoding,BOOL reinitialize);
+	//inline UINT EncodeRect(const rfb::Rect &rect);
+	inline UINT EncodeRect(const rfb::Rect &rect,VSocket *outconn);
+
+
+	// Tight - CONFIGURING ENCODER
+	inline void SetCompressLevel(int level);
+	inline void SetQualityLevel(int level);
+	inline void EnableLastRect(BOOL enable);
+	inline BOOL IsLastRectEnabled() { return m_use_lastrect; }
+
+	// CURSOR HANDLING
+	inline void EnableXCursor(BOOL enable);
+	inline void EnableRichCursor(BOOL enable);
+	inline BOOL SetServerFormat();
+	inline BOOL SetClientFormat(rfbPixelFormat &format);
+	inline rfbPixelFormat GetClientFormat() {return m_clientformat;};
+	inline void SetSWOffset(int x,int y);
+	// CURSOR HANDLING
+	inline BOOL IsCursorUpdatePending();
+	inline BOOL WasCursorUpdatePending();
+	inline BOOL SendCursorShape(VSocket *outConn);
+	inline BOOL SendEmptyCursorShape(VSocket *outConn);
+	inline BOOL IsXCursorSupported();
+	// CLIENT OPTIONS
+	inline void AvailableXOR(BOOL enable){m_use_xor = enable;};
+	inline void AvailableZRLE(BOOL enable){m_use_zrle = enable;};
+	inline void AvailableTight(BOOL enable){m_use_tight = enable;};
+	inline void EnableQueuing(BOOL enable){m_fEnableQueuing = enable;};
+	inline BOOL IsMouseWheelTight();
+	// CACHE HANDLING
+	inline void EnableCache(BOOL enabled);
+	inline BOOL IsCacheEnabled();
+
+	// sf at 2005 - Grey palette
+	inline void EnableGreyPalette(BOOL enable);
+
+	// QUEUE ZLIBXOR
+	inline void LastRect(VSocket *outConn);
+	// Modif cs at 2005
+#ifdef DSHOW
+	inline BOOL ResetZRLEEncoding(void);
+#endif
+
+	inline bool IsSlowEncoding() {return (m_encoding == rfbEncodingZYWRLE || m_encoding == rfbEncodingZRLE || m_encoding == rfbEncodingTight || m_encoding == rfbEncodingZlib);};
+	inline bool IsUltraEncoding() {return (m_encoding == rfbEncodingUltra || m_encoding == rfbEncodingUltra2);};
+
+
+
+protected:
+
+	// Routine used internally to ensure the client buffer is OK
+	inline BOOL CheckBuffer();
+
+	// Pixel buffers and access to display buffer
+	BYTE		*m_clientbuff;
+	UINT		m_clientbuffsize;
+/*	BYTE		*m_clientbackbuff;
+	UINT		m_clientbackbuffsize;*/
+	//RESIZE
+
+	// Pixel formats, translation and encoding
+	rfbPixelFormat	m_clientformat;
+	BOOL			m_clientfmtset;
+	rfbTranslateFnType	m_transfunc;
+	vncEncoder*		m_encoder;
+	vncEncoder*		zrleEncoder;
+	bool			zlib_encoder_in_use;
+	vncEncoder*		m_hold_zlib_encoder;
+	bool			ultra_encoder_in_use;
+	vncEncoder*		m_hold_ultra_encoder;
+	vncEncoder*		m_hold_ultra2_encoder;
+	bool			zlibhex_encoder_in_use;
+	vncEncoder*		m_hold_zlibhex_encoder;
+	bool			tight_encoder_in_use;
+	vncEncoder*		m_hold_tight_encoder;
+
+	// Tight 
+	int				m_compresslevel;
+	int				m_qualitylevel;
+	BOOL			m_use_lastrect;
+
+	// Tight - CURSOR HANDLING
+	BOOL			m_use_xcursor;
+	BOOL			m_use_richcursor;
+	HCURSOR			m_hcursor;		// Used to track cursor shape changes
+
+	// Client detection
+	// if tight->tight zrle->zrle both=ultra
+	BOOL			m_use_xor;
+	BOOL			m_use_zrle;
+	BOOL			m_use_tight;
+	BOOL			m_fEnableQueuing;
+
+	// cache handling
+	BOOL			m_cache_enabled;
+	int				m_SWOffsetx;
+	int				m_SWOffsety;
+
+public:
+	vncBuffer	*m_buffer;
+	rfbServerInitMsg	m_scrinfo;
+	CARD32		m_encoding;
+	bool			ultra2_encoder_in_use;
+};
+
+//
+// -=- Constructor/destructor
+//
+
+inline vncEncodeMgr::vncEncodeMgr()
+{
+	zrleEncoder=NULL;
+	m_encoder = NULL;
+	m_buffer=NULL;
+
+	m_clientbuff = NULL;
+	m_clientbuffsize = 0;
+/*	m_clientbackbuff = NULL;
+	m_clientbackbuffsize = 0;*/
+
+	m_clientfmtset = FALSE;
+	zlib_encoder_in_use = false;
+	m_hold_zlib_encoder = NULL;
+    ultra_encoder_in_use = false;
+	ultra2_encoder_in_use = false;
+	m_hold_ultra_encoder = NULL;
+	m_hold_ultra2_encoder = NULL;
+	zlibhex_encoder_in_use = false;
+	m_hold_zlibhex_encoder = NULL;
+	tight_encoder_in_use = false;
+	m_hold_tight_encoder = NULL;
+
+	// Tight 
+	m_compresslevel = 6;
+	m_qualitylevel = -1;
+	m_use_lastrect = FALSE;
+	// Tight CURSOR HANDLING
+	m_use_xcursor = FALSE;
+	m_use_richcursor = FALSE;
+//	m_hcursor = NULL;
+
+	m_SWOffsetx=0;
+	m_SWOffsety=0;
+
+}
+
+inline vncEncodeMgr::~vncEncodeMgr()
+{
+	if (zrleEncoder && zrleEncoder != m_encoder)
+		delete zrleEncoder;
+
+	if (m_hold_zlib_encoder != NULL && m_hold_zlib_encoder != m_encoder) {
+		delete m_hold_zlib_encoder;
+		m_hold_zlib_encoder = NULL;
+	}
+
+	if (m_hold_ultra_encoder != NULL && m_hold_ultra_encoder != m_encoder) {
+		delete m_hold_ultra_encoder;
+		m_hold_ultra_encoder = NULL;
+	}
+
+	if (m_hold_ultra2_encoder != NULL && m_hold_ultra2_encoder != m_encoder) {
+		delete m_hold_ultra2_encoder;
+		m_hold_ultra2_encoder = NULL;
+	}
+
+	if (m_hold_zlibhex_encoder != NULL && m_hold_zlibhex_encoder != m_encoder) {
+		delete m_hold_zlibhex_encoder;
+		m_hold_zlibhex_encoder = NULL;
+	}
+
+	if (m_hold_tight_encoder != NULL && m_hold_tight_encoder != m_encoder)
+	{
+		// m_hold_tight_encoder->LogStats();
+		delete m_hold_tight_encoder;
+		m_hold_tight_encoder = NULL;
+	}
+
+	if (m_encoder != NULL)
+	{
+		delete m_encoder;
+		m_encoder = NULL;
+		m_hold_zlib_encoder = NULL;
+		m_hold_ultra_encoder = NULL;
+		m_hold_ultra2_encoder = NULL;
+		m_hold_zlibhex_encoder = NULL;
+		m_hold_tight_encoder = NULL;
+
+	}
+	if (m_clientbuff != NULL)
+	{
+		delete [] m_clientbuff;
+		m_clientbuff = NULL;
+	}
+/*	if (m_clientbackbuff != NULL)
+	{
+		delete m_clientbackbuff;
+		m_clientbackbuff = NULL;
+	}*/
+}
+
+inline void
+vncEncodeMgr::SetBuffer(vncBuffer *buffer)
+{
+	m_buffer=buffer;
+	CheckBuffer();
+}
+
+//
+// -=- Encoding of pixel data for transmission
+//
+
+inline BYTE *
+vncEncodeMgr::GetClientBuffer()
+{
+	return m_clientbuff;
+}
+
+inline BOOL
+vncEncodeMgr::GetPalette(RGBQUAD *quadlist, UINT ncolours)
+{
+	// Try to get the RGBQUAD data from the encoder
+	// This will only work if the remote client is palette-based,
+	// in which case the encoder will be storing RGBQUAD data
+	if (m_encoder == NULL)
+	{
+		vnclog.Print(LL_INTWARN, VNCLOG("GetPalette called but no encoder set\n"));
+		return FALSE;
+	}
+
+	// Now get the palette data
+	return m_encoder->GetRemotePalette(quadlist, ncolours);
+}
+
+inline BOOL
+vncEncodeMgr::CheckBuffer()
+{
+	// Get the screen format, in case it has changed
+	m_buffer->m_desktop->FillDisplayInfo(&m_scrinfo);
+
+	// If the client has not specified a pixel format then set one for it
+	if (!m_clientfmtset) {
+	    m_clientfmtset = TRUE;
+	    m_clientformat = m_scrinfo.format;
+	}
+
+	// If the client has not selected an encoding then set one for it
+	if ((m_encoder == NULL) && (!SetEncoding(rfbEncodingRaw,FALSE)))
+		return FALSE;
+
+	// Check the client buffer is sufficient
+	const UINT clientbuffsize =
+	    m_encoder->RequiredBuffSize(m_scrinfo.framebufferWidth,
+									m_scrinfo.framebufferHeight);
+	if (m_clientbuffsize != clientbuffsize)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("request client buffer[%u]\n"), clientbuffsize);
+	    if (m_clientbuff != NULL)
+	    {
+			delete [] m_clientbuff;
+			m_clientbuff = NULL;
+	    }
+	    m_clientbuffsize = 0;
+
+	    m_clientbuff = new BYTE [clientbuffsize];
+	    if (m_clientbuff == NULL)
+	    {		
+			vnclog.Print(LL_INTERR, VNCLOG("unable to allocate client buffer[%u]\n"), clientbuffsize);
+			return FALSE;
+	    }
+		memset(m_clientbuff, 0, clientbuffsize);
+	    m_clientbuffsize = clientbuffsize;
+	}
+
+/*	// Check the client backing buffer matches the server back buffer
+	const UINT backbuffsize = m_buffer->m_backbuffsize;
+	if (m_clientbackbuffsize != backbuffsize)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("request client back buffer[%u]\n"), backbuffsize);
+		if (m_clientbackbuff) {
+			delete [] m_clientbackbuff;
+			m_clientbackbuff = 0;
+		}
+		m_clientbackbuffsize = 0;
+
+		m_clientbackbuff = new BYTE[backbuffsize];
+		if (!m_clientbackbuff) {
+			vnclog.Print(LL_INTERR, VNCLOG("unable to allocate client back buffer[%u]\n"), backbuffsize);
+			return FALSE;
+		}
+		memset(m_clientbackbuff, 0, backbuffsize);
+		m_clientbackbuffsize = backbuffsize;
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("remote buffer=%u\n"), m_clientbuffsize);*/
+
+	return TRUE;
+}
+
+// Set the encoding to use
+inline BOOL
+vncEncodeMgr::SetEncoding(CARD32 encoding,BOOL reinitialize)
+{
+	if (reinitialize)
+	{
+		encoding=m_encoding;
+		if (!m_buffer->CheckBuffer())
+            return FALSE;
+	}
+	else m_encoding=encoding;
+
+	// Delete the old encoder
+	if (m_encoder != NULL)
+	{
+		if ( zlib_encoder_in_use )
+		{
+			m_hold_zlib_encoder = m_encoder;
+		}
+		else if ( ultra_encoder_in_use )
+		{
+			m_hold_ultra_encoder = m_encoder;
+		}
+		else if ( ultra2_encoder_in_use )
+		{
+			m_hold_ultra2_encoder = m_encoder;
+		}
+		else if ( zlibhex_encoder_in_use )
+		{
+			m_hold_zlibhex_encoder = m_encoder;
+		}
+		else if ( tight_encoder_in_use )
+		{
+			m_hold_tight_encoder = m_encoder;
+		}
+		else
+		{
+		if (m_encoder != zrleEncoder)
+			delete m_encoder;
+		}
+		m_encoder = NULL;
+		
+	}
+	zlib_encoder_in_use = false;
+	ultra_encoder_in_use = false;
+	ultra2_encoder_in_use = false;
+	zlibhex_encoder_in_use = false;
+	tight_encoder_in_use = false;
+	// Returns FALSE if the desired encoding cannot be used
+	switch(encoding)
+	{
+
+	case rfbEncodingRaw:
+
+		vnclog.Print(LL_INTINFO, VNCLOG("raw encoder requested\n"));
+
+		// Create a RAW encoder
+		m_encoder = new vncEncoder;
+		if (m_encoder == NULL)
+			return FALSE;
+		break;
+
+	case rfbEncodingRRE:
+
+		vnclog.Print(LL_INTINFO, VNCLOG("RRE encoder requested\n"));
+
+		// Create a RRE encoder
+		m_encoder = new vncEncodeRRE;
+		if (m_encoder == NULL)
+			return FALSE;
+		break;
+
+	case rfbEncodingCoRRE:
+
+		vnclog.Print(LL_INTINFO, VNCLOG("CoRRE encoder requested\n"));
+
+		// Create a CoRRE encoder
+		m_encoder = new vncEncodeCoRRE;
+		if (m_encoder == NULL)
+			return FALSE;
+		break;
+
+	case rfbEncodingHextile:
+
+		vnclog.Print(LL_INTINFO, VNCLOG("Hextile encoder requested\n"));
+
+		// Create a CoRRE encoder
+		m_encoder = new vncEncodeHexT;
+		if (m_encoder == NULL)
+			return FALSE;
+		break;
+
+	case rfbEncodingUltra:
+
+		vnclog.Print(LL_INTINFO, VNCLOG("Ultra encoder requested\n"));
+
+		// Create a Zlib encoder, if needed.
+		// If a Zlib encoder was used previously, then reuse it here
+		// to maintain zlib dictionary synchronization with the viewer.
+		if ( m_hold_ultra_encoder == NULL )
+		{
+			m_encoder = new vncEncodeUltra;
+		}
+		else
+		{
+			m_encoder = m_hold_ultra_encoder;
+		}
+		if (m_encoder == NULL)
+			return FALSE;
+		ultra_encoder_in_use = true;//
+
+		// sf at 2003 - UltraEncoder Queing does not work with DSM - Disable it in this case until
+		// some work is done to improve Queuing/DSM compatibility
+		((vncEncodeUltra*)(m_encoder))->EnableQueuing(m_fEnableQueuing);
+		EnableXCursor(false);
+		EnableRichCursor(false);
+		EnableCache(false);
+		break;
+
+	case rfbEncodingUltra2:
+
+		vnclog.Print(LL_INTINFO, VNCLOG("Ultra encoder requested\n"));
+
+		// Create a Zlib encoder, if needed.
+		// If a Zlib encoder was used previously, then reuse it here
+		// to maintain zlib dictionary synchronization with the viewer.
+		if ( m_hold_ultra2_encoder == NULL )
+		{
+			m_encoder = new vncEncodeUltra2;
+		}
+		else
+		{
+			m_encoder = m_hold_ultra2_encoder;
+		}
+		if (m_encoder == NULL)
+			return FALSE;
+		ultra2_encoder_in_use = true;//
+
+		// sf at 2003 - UltraEncoder Queing does not work with DSM - Disable it in this case until
+		// some work is done to improve Queuing/DSM compatibility
+		EnableXCursor(false);
+		EnableRichCursor(false);
+		EnableCache(false);
+		break;
+
+	case rfbEncodingZRLE:
+		vnclog.Print(LL_INTINFO, VNCLOG("ZRLE encoder requested\n"));
+		if (!zrleEncoder)
+			zrleEncoder = new vncEncodeZRLE;
+		m_encoder = zrleEncoder;
+		((vncEncodeZRLE*)zrleEncoder)->m_use_zywrle = FALSE;
+		break;
+
+	case rfbEncodingZYWRLE:
+		vnclog.Print(LL_INTINFO, VNCLOG("ZYWRLE encoder requested\n"));
+		if (!zrleEncoder)
+			zrleEncoder = new vncEncodeZRLE;
+		m_encoder = zrleEncoder;
+		((vncEncodeZRLE*)zrleEncoder)->m_use_zywrle = TRUE;
+		break;
+
+	case rfbEncodingZlib:
+
+		vnclog.Print(LL_INTINFO, VNCLOG("Zlib encoder requested\n"));
+
+		// Create a Zlib encoder, if needed.
+		// If a Zlib encoder was used previously, then reuse it here
+		// to maintain zlib dictionary synchronization with the viewer.
+		if ( m_hold_zlib_encoder == NULL )
+		{
+			m_encoder = new vncEncodeZlib;
+		}
+		else
+		{
+			m_encoder = m_hold_zlib_encoder;
+		}
+		if (m_encoder == NULL)
+			return FALSE;
+		zlib_encoder_in_use = true;//
+		break;
+
+
+	case rfbEncodingZlibHex:
+		vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex encoder requested\n"));
+
+		// Create a ZlibHex encoder, if needed.
+		// If a Zlibhex encoder was used previously, then reuse it here
+		// to maintain zlib dictionary synchronization with the viewer.
+		if ( m_hold_zlibhex_encoder == NULL )
+		{
+			m_encoder = new vncEncodeZlibHex;
+		}
+		else
+		{
+			m_encoder = m_hold_zlibhex_encoder;
+		}
+		if (m_encoder == NULL)
+			return FALSE;
+		zlibhex_encoder_in_use = true;//
+		break;
+
+
+	case rfbEncodingTight:
+		vnclog.Print(LL_INTINFO, VNCLOG("Tight encoder requested\n"));
+
+		// Create a Tight encoder, if needed.
+		// If a Tight encoder was used previously, then reuse it here
+		// to maintain zlib dictionaries synchronization with the viewer.
+		if ( m_hold_tight_encoder == NULL )
+		{
+			m_encoder = new vncEncodeTight;
+		}
+		else
+		{
+			m_encoder = m_hold_tight_encoder;
+		}
+		if (m_encoder == NULL)
+			return FALSE;
+		tight_encoder_in_use = true;
+		break;
+
+	default:
+		// An unknown encoding was specified
+		vnclog.Print(LL_INTERR, VNCLOG("unknown encoder requested\n"));
+
+		return FALSE;
+	}
+
+	// Initialise it and give it the pixel format
+	m_encoder->Init();
+	m_encoder->SetLocalFormat(
+			m_scrinfo.format,
+			m_scrinfo.framebufferWidth,
+			m_scrinfo.framebufferHeight);
+	if (m_clientfmtset)
+		if (!m_encoder->SetRemoteFormat(m_clientformat))
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("client pixel format is not supported\n"));
+
+			return FALSE;
+		}
+
+	if (reinitialize)
+	{
+		if (m_encoder != NULL)
+		{
+			m_encoder->EnableXCursor(m_use_xcursor);
+			m_encoder->EnableRichCursor(m_use_richcursor);
+			m_encoder->SetCompressLevel(m_compresslevel);
+			m_encoder->SetQualityLevel(m_qualitylevel);
+			m_encoder->EnableLastRect(m_use_lastrect);
+		}
+
+	}
+		m_buffer->ClearCache();
+		m_buffer->ClearBack();
+		m_encoder->SetSWOffset(m_SWOffsetx,m_SWOffsety);
+	// Check that the client buffer is compatible
+	return CheckBuffer();
+}
+
+// Predict how many update rectangles a given rect will encode to
+// For Raw, RRE or Hextile, this is always 1.  For CoRRE, may be more,
+// because each update rect is limited in size.
+inline UINT
+vncEncodeMgr::GetNumCodedRects(const rfb::Rect &rect)
+{
+	// sf at 2002 - Tight encoding
+	// TODO: Add the appropriate virtual NumCodedRects function to Tight encoder instead.
+	if (tight_encoder_in_use || zlibhex_encoder_in_use)
+	{
+		RECT TRect;
+		TRect.right = rect.br.x;
+		TRect.left = rect.tl.x;
+		TRect.top = rect.tl.y;
+		TRect.bottom = rect.br.y;
+		return m_encoder->NumCodedRects(TRect);
+	}
+
+	return m_encoder->NumCodedRects(rect);
+}
+
+//
+// -=- Pixel format translation
+//
+
+// Update the local pixel format used by the encoder
+inline BOOL
+vncEncodeMgr::SetServerFormat()
+{
+	if (m_encoder) {
+		return CheckBuffer() && m_encoder->SetLocalFormat(
+			m_scrinfo.format,
+			m_scrinfo.framebufferWidth,
+			m_scrinfo.framebufferHeight);
+	}
+	return FALSE;
+}
+
+// Specify the client's pixel format
+inline BOOL
+vncEncodeMgr::SetClientFormat(rfbPixelFormat &format)
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("SetClientFormat called\n"));
+	
+	// Save the desired format
+	m_clientfmtset = TRUE;
+	m_clientformat = format;
+
+	// Tell the encoder of the new format
+	if (m_encoder != NULL)
+		m_encoder->SetRemoteFormat(format);
+
+	// Check that the output buffer is sufficient
+	if (!CheckBuffer())
+		return FALSE;
+
+	return TRUE;
+}
+
+// Translate a rectangle to the client's pixel format
+inline UINT
+vncEncodeMgr::EncodeRect(const rfb::Rect &rect,VSocket *outconn)
+{
+	//Fix crash after resolution change
+	// vncencoder seems still to have to old resolution while other parts are already updated
+	// Could not find it, but this extra check eliminate the out of buffer updates during transition
+	if(rect.br.x>m_scrinfo.framebufferWidth) 
+		return 0;
+	if(rect.br.y>m_scrinfo.framebufferHeight) 
+		return 0;
+	// Call the encoder to encode the rectangle into the client buffer...
+	/*if (!m_clientbackbuffif){*/
+	if (!m_buffer->m_backbuff){
+		vnclog.Print(LL_INTERR, "no client back-buffer available in EncodeRect\n");
+		return 0;
+	}
+	if (zlib_encoder_in_use)
+	{
+		if (m_use_xor)
+		{
+		return m_encoder->EncodeRect(m_buffer->m_backbuff, m_buffer->m_cachebuff, outconn ,m_clientbuff, rect);
+		}
+		else return m_encoder->EncodeRect(m_buffer->m_backbuff, NULL, outconn ,m_clientbuff, rect);
+	}
+	if (ultra_encoder_in_use)
+	{
+		return m_encoder->EncodeRect(m_buffer->m_backbuff, outconn ,m_clientbuff, rect);
+	}
+	if (ultra2_encoder_in_use)
+	{
+		return m_encoder->EncodeRect(m_buffer->m_backbuff, outconn ,m_clientbuff, rect);
+	}
+
+	// sf at 2002 - Tight encoding
+	if (tight_encoder_in_use || zlibhex_encoder_in_use  || ultra_encoder_in_use || ultra2_encoder_in_use)
+	{
+		RECT TRect;
+		TRect.right = rect.br.x;
+		TRect.left = rect.tl.x;
+		TRect.top = rect.tl.y;
+		TRect.bottom = rect.br.y;
+		return m_encoder->EncodeRect(m_buffer->m_backbuff, outconn, m_clientbuff, TRect); // sf at 2002 - For Tight...
+	}
+
+	return m_encoder->EncodeRect(m_buffer->m_backbuff, m_clientbuff, rect);
+}
+
+rfb::Rect 
+vncEncodeMgr::GetSize()
+{
+	return m_buffer->GetSize();
+}
+inline void
+vncEncodeMgr::SetSWOffset(int x,int y)
+{
+	m_SWOffsetx=x;
+	m_SWOffsety=y;
+	m_encoder->SetSWOffset(x,y);
+}
+
+inline void
+vncEncodeMgr::EnableXCursor(BOOL enable)
+{
+	m_use_xcursor = enable;
+	if (m_encoder != NULL) {
+		m_encoder->EnableXCursor(enable);
+	}
+	m_hcursor = NULL;
+}
+
+inline void
+vncEncodeMgr::EnableRichCursor(BOOL enable)
+{
+	m_use_richcursor = enable;
+	if (m_encoder != NULL) {
+		m_encoder->EnableRichCursor(enable);
+	}
+	m_hcursor = NULL;
+}
+
+// Check if cursor shape update should be sent
+inline BOOL
+vncEncodeMgr::IsCursorUpdatePending()
+{
+	if (m_use_xcursor || m_use_richcursor) {
+		return m_buffer->IsCursorUpdatePending();
+	}
+	return false;
+}
+
+inline BOOL
+vncEncodeMgr::WasCursorUpdatePending()
+{
+	BOOL pending=m_buffer->IsCursorUpdatePending();
+	m_buffer->SetCursorPending(FALSE);
+	return pending;
+}
+
+inline BOOL
+vncEncodeMgr::SendCursorShape(VSocket *outConn) {
+	return m_encoder->SendCursorShape(outConn, m_buffer->m_desktop);
+}
+
+inline BOOL
+vncEncodeMgr::SendEmptyCursorShape(VSocket *outConn) {
+	return m_encoder->SendEmptyCursorShape(outConn);
+}
+
+inline BOOL
+vncEncodeMgr::IsXCursorSupported() {
+	return m_encoder->IsXCursorSupported();
+}
+
+// Tight
+inline void
+vncEncodeMgr::SetCompressLevel(int level)
+{
+	m_compresslevel = (level >= 0 && level <= 9) ? level : 6;
+	if (m_encoder != NULL)
+		m_encoder->SetCompressLevel(m_compresslevel);
+}
+
+inline void
+vncEncodeMgr::SetQualityLevel(int level)
+{
+	m_qualitylevel = (level >= 0 && level <= 9) ? level : -1;
+	if (m_encoder != NULL)
+		m_encoder->SetQualityLevel(m_qualitylevel);
+}
+
+inline void
+vncEncodeMgr::EnableLastRect(BOOL enable)
+{
+	m_use_lastrect = enable;
+	if (m_encoder != NULL) {
+		m_encoder->EnableLastRect(enable);
+	}
+}
+
+inline BOOL
+vncEncodeMgr::IsMouseWheelTight()
+{
+	if (m_use_tight && !m_use_xor) //tight client
+		return true;
+	return false;
+}
+
+// sf at 2005
+inline void vncEncodeMgr::EnableGreyPalette(BOOL enable)
+{
+	m_buffer->EnableGreyPalette(enable);
+}
+
+inline void
+vncEncodeMgr::EnableCache(BOOL enabled)
+{
+	m_cache_enabled = enabled;
+	// if (enabled)
+	m_buffer->EnableCache(enabled);
+}
+
+inline BOOL
+vncEncodeMgr::IsCacheEnabled()
+{
+	return m_cache_enabled;
+}
+
+inline void
+vncEncodeMgr::LastRect(VSocket *outConn)
+{
+	m_encoder->LastRect(outConn);
+}
+
+// Modif cs at 2005
+#ifdef DSHOW
+inline BOOL
+vncEncodeMgr::ResetZRLEEncoding(void)
+{
+	if (NULL != zrleEncoder)
+	{
+		delete zrleEncoder;
+
+		zrleEncoder = NULL;
+
+		zrleEncoder = new vncEncodeZRLE;
+
+		m_encoder = zrleEncoder;
+
+		// Initialise it and give it the pixel format
+		m_encoder->Init();
+
+		m_encoder->SetLocalFormat(	m_scrinfo.format,
+									m_scrinfo.framebufferWidth,
+									m_scrinfo.framebufferHeight);
+
+		if (m_clientfmtset)
+		{
+			if (!m_encoder->SetRemoteFormat(m_clientformat))
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("client pixel format is not supported\n"));
+
+				return FALSE;
+			}
+		}
+
+		if (m_encoder != NULL)
+		{
+			m_encoder->EnableXCursor(m_use_xcursor);
+			m_encoder->EnableRichCursor(m_use_richcursor);
+			m_encoder->SetCompressLevel(m_compresslevel);
+			m_encoder->SetQualityLevel(m_qualitylevel);
+			m_encoder->EnableLastRect(m_use_lastrect);
+		}
+
+		m_buffer->ClearCache();
+		m_buffer->ClearBack();
+
+		// Check that the client buffer is compatible
+		return CheckBuffer();
+	}
+
+	return FALSE;
+}			
+#endif
+
+#endif // _WINVNC_VNCENCODEMGR
+
diff --git a/ica/win32/winvnc/winvnc/vncencoder.cpp b/ica/win32/winvnc/winvnc/vncencoder.cpp
new file mode 100644
index 0000000..1ffb6c6
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencoder.cpp
@@ -0,0 +1,445 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncoder - Object used to encode data for RFB
+
+#include "vncencoder.h"
+#include "vncbuffer.h"
+
+// Pixel format used internally when the client is palette-based & server is truecolour
+
+static const rfbPixelFormat BGR233Format = {
+    8, 8, 0, 1, 7, 7, 3, 0, 3, 6
+};
+
+// The base (RAW) encoder class
+
+vncEncoder::vncEncoder()
+{
+	ZeroMemory(&m_remoteformat, sizeof(m_remoteformat));
+	ZeroMemory(&m_localformat, sizeof(m_localformat));
+	ZeroMemory(&m_transformat, sizeof(m_transformat));
+	m_transtable = NULL;
+	m_localpalette = NULL;
+	m_bytesPerRow = 0;
+
+	m_SWOffsetx=0;
+	m_SWOffsety=0;
+
+	// Tight - CURSOR HANDLING
+	m_compresslevel = 6;
+	m_qualitylevel = -1;
+	m_use_lastrect = FALSE;
+	m_use_xcursor = FALSE;
+	m_use_richcursor = FALSE;
+
+}
+
+vncEncoder::~vncEncoder()
+{
+	if (m_transtable != NULL)
+	{
+		free(m_transtable);
+		m_transtable = NULL;
+	}
+	if (m_localpalette != NULL)
+	{
+		free(m_localpalette);
+		m_localpalette = NULL;
+	}
+}
+
+void
+vncEncoder::Init()
+{
+	transmittedSize = 0;
+	dataSize = 0;
+	rectangleOverhead = 0;
+	encodedSize = 0;
+}
+
+UINT
+vncEncoder::RequiredBuffSize(UINT width, UINT height)
+{
+	return sz_rfbFramebufferUpdateRectHeader +
+		(width * height * m_remoteformat.bitsPerPixel)/8;
+}
+
+UINT
+vncEncoder::NumCodedRects(const rfb::Rect &rect)
+{
+	return 1;
+}
+
+
+// Tight
+UINT vncEncoder::NumCodedRects(RECT &rect)
+{
+	rfb::Rect TRect;
+	TRect.br.x = rect.right;
+	TRect.tl.x = rect.left;
+	TRect.tl.y = rect.top;
+	TRect.br.y = rect.bottom;
+	
+	return NumCodedRects(TRect);
+}
+
+// Translate a rectangle
+inline void
+vncEncoder::Translate(BYTE *source, BYTE *dest, const rfb::Rect &rect)
+{
+	// Calculate where in the source rectangle to read from
+	BYTE *sourcepos = (BYTE *)(source + (m_bytesPerRow * rect.tl.y)+(rect.tl.x * (m_localformat.bitsPerPixel / 8)));
+
+	// Call the translation function
+	(*m_transfunc) (m_transtable,
+					&m_localformat,
+					&m_transformat,
+					(char *)sourcepos,
+					(char *)dest,
+					m_bytesPerRow,
+					rect.br.x-rect.tl.x,
+					rect.br.y-rect.tl.y
+					);
+}
+
+// Encode a rectangle
+inline UINT
+vncEncoder::EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect)
+{
+	// Create the header for the update in the destination area
+	rfbFramebufferUpdateRectHeader *surh = (rfbFramebufferUpdateRectHeader *)dest;
+	surh->r.x = (CARD16) (rect.tl.x-m_SWOffsetx);
+	surh->r.y = (CARD16) (rect.tl.y-m_SWOffsety);
+	surh->r.w = (CARD16) (rect.br.x-rect.tl.x);
+	surh->r.h = (CARD16) (rect.br.y-rect.tl.y);
+	surh->r.x = Swap16IfLE(surh->r.x);
+	surh->r.y = Swap16IfLE(surh->r.y);
+	surh->r.w = Swap16IfLE(surh->r.w);
+	surh->r.h = Swap16IfLE(surh->r.h);
+	surh->encoding = Swap32IfLE(rfbEncodingRaw);
+
+	// Translate the data in place in the output buffer
+	Translate(source, dest + sz_rfbFramebufferUpdateRectHeader, rect);
+
+	// Return the buffer size
+	return sz_rfbFramebufferUpdateRectHeader +
+		((rect.br.x-rect.tl.x)*(rect.br.y-rect.tl.y)*m_remoteformat.bitsPerPixel) / 8;
+}
+
+inline UINT
+vncEncoder::EncodeRect(BYTE *source, BYTE *source2,VSocket *outConn, BYTE *dest, const rfb::Rect &rect)
+{
+
+	return EncodeRect(source, dest, rect);
+
+}
+
+inline UINT
+vncEncoder::EncodeRect(BYTE *source,VSocket *outConn, BYTE *dest, const rfb::Rect &rect)
+{
+
+	return EncodeRect(source, dest, rect);
+
+}
+
+
+// Tight
+inline UINT
+vncEncoder::EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &rect)
+{
+	rfb::Rect TRect;
+	TRect.br.x = rect.right;
+	TRect.tl.x = rect.left;
+	TRect.tl.y = rect.top;
+	TRect.br.y = rect.bottom;
+	
+	return EncodeRect(source, dest, TRect);
+}
+
+
+BOOL
+vncEncoder::GetRemotePalette(RGBQUAD *quadlist, UINT ncolours)
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("remote palette data requested\n"));
+
+	// If the local server is palette-based then call SetTranslateFunction
+	// to update the palette-to-truecolour mapping:
+	if (!m_localformat.trueColour)
+	{
+		if (!SetTranslateFunction())
+			return FALSE;
+	}
+
+	// If the client is truecolour then don't fill in the palette buffer...
+	if (m_remoteformat.trueColour)
+		return FALSE;
+
+	// If the server is truecolour then fake BGR233
+	if (m_localformat.trueColour)
+	{
+		// Fake BGR233...
+		vnclog.Print(LL_INTINFO, VNCLOG("generating BGR233 palette data\n"));
+
+		int ncolors = 1 << m_transformat.bitsPerPixel;
+		if (m_localpalette != NULL)
+			free(m_localpalette);
+		m_localpalette = (char *)malloc(ncolors * sizeof(RGBQUAD));
+		
+		if (m_localpalette != NULL)
+		{
+			RGBQUAD *colour = (RGBQUAD *)m_localpalette;
+
+			for (int i=0; i<ncolors; i++)
+			{
+				colour[i].rgbBlue = (((i >> m_transformat.blueShift) & m_transformat.blueMax) * 255) / m_transformat.blueMax;
+				colour[i].rgbRed = (((i >> m_transformat.redShift) & m_transformat.redMax) * 255) / m_transformat.redMax;
+				colour[i].rgbGreen = (((i >> m_transformat.greenShift) & m_transformat.greenMax) * 255) / m_transformat.greenMax;
+			}
+		}
+	}
+	else
+	{
+		// Set up RGBQUAD rfbPixelFormat info
+		vnclog.Print(LL_INTINFO, VNCLOG("generating 8-bit palette data\n"));
+
+		rfbPixelFormat remote;
+		remote.trueColour = TRUE;
+		remote.bitsPerPixel = 32;
+		remote.depth = 24;
+		remote.bigEndian = FALSE;
+		remote.redMax = remote.greenMax = remote.blueMax = 255;
+		remote.redShift = 16;
+		remote.greenShift = 8;
+		remote.blueShift = 0;
+
+		// We get the ColourMapSingleTableFns procedure to handle retrieval of the
+		// palette for us, to avoid replicating the code!
+		(*rfbInitColourMapSingleTableFns[remote.bitsPerPixel / 16])
+			(&m_localpalette, &m_localformat, &remote);
+	}
+
+	// Did we create some palette info?
+	if (m_localpalette == NULL)
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("failed to obtain colour map data!\n"));
+		return FALSE;
+	}
+
+	// Copy the data into the RGBQUAD buffer
+	memcpy(quadlist, m_localpalette, ncolours*sizeof(RGBQUAD));
+
+	return TRUE;
+}
+
+BOOL
+vncEncoder::SetTranslateFunction()
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("settranslatefunction called\n"));
+
+	// By default, the actual format translated to matches the client format
+	m_transformat = m_remoteformat;
+
+    // Check that bits per pixel values are valid
+
+    if ((m_transformat.bitsPerPixel != 8) &&
+		(m_transformat.bitsPerPixel != 16) &&
+		(m_transformat.bitsPerPixel != 32))
+    {
+		vnclog.Print(LL_CONNERR,
+			VNCLOG("only 8, 16 or 32 bits supported remotely - %d requested\n"),
+			m_transformat.bitsPerPixel
+			);
+
+		return FALSE;
+    }
+	
+    if ((m_localformat.bitsPerPixel != 8) &&
+		(m_localformat.bitsPerPixel != 16) &&
+		(m_localformat.bitsPerPixel != 32))
+    {
+		vnclog.Print(LL_CONNERR,
+			VNCLOG("only 8, 16 or 32 bits supported locally - %d in use\n"),
+			m_localformat.bitsPerPixel
+			);
+
+		return FALSE;
+    }
+
+	if (!m_transformat.trueColour && (m_transformat.bitsPerPixel != 8))
+	{
+		vnclog.Print(LL_CONNERR, VNCLOG("only 8-bit palette format supported remotely\n"));
+		return FALSE;
+	}
+	if (!m_localformat.trueColour && (m_localformat.bitsPerPixel != 8))
+	{
+		vnclog.Print(LL_CONNERR, VNCLOG("only 8-bit palette format supported locally\n"));
+		return FALSE;
+	}
+
+	// Now choose the translation function to use
+
+	// We don't do remote palettes unless they're 8-bit
+    if (!m_transformat.trueColour)
+	{
+		// Is the local format the same?
+		if (!m_localformat.trueColour &&
+			(m_localformat.bitsPerPixel == m_transformat.bitsPerPixel))
+		{
+			// Yes, so don't do any encoding
+			vnclog.Print(LL_INTINFO, VNCLOG("no encoding required - both 8-bit palettized\n"));
+
+			m_transfunc = rfbTranslateNone;
+
+			// The first time the client sends an update, it will call
+			// GetRemotePalette to get the palette information required
+			return TRUE;
+		}
+		else if (m_localformat.trueColour)
+		{
+			// Local side is truecolour, remote is palettized
+			vnclog.Print(LL_INTINFO, VNCLOG("local truecolour, remote palettized.  using BGR233 palette\n"));
+
+			// Fill out the translation table as if writing to BGR233
+			m_transformat = BGR233Format;
+
+			// Continue on down to the main translation section
+		}
+		else
+		{
+			// No, so not supported yet...
+			vnclog.Print(LL_CONNERR, VNCLOG("unknown local pixel format in use!\n"));
+			return FALSE;
+		}
+	}
+
+	// REMOTE FORMAT IS TRUE-COLOUR
+
+	// Handle 8-bit palette-based local data
+	if (!m_localformat.trueColour)
+	{
+		// 8-bit palette to truecolour...
+
+		// Yes, so pick the right translation function!
+		vnclog.Print(LL_INTINFO, VNCLOG("using 8-bit colourmap to truecolour translation\n"));
+
+		m_transfunc = rfbTranslateWithSingleTableFns
+			[m_localformat.bitsPerPixel / 16]
+			[m_transformat.bitsPerPixel / 16];
+
+		(*rfbInitColourMapSingleTableFns[m_transformat.bitsPerPixel / 16])
+			(&m_transtable, &m_localformat, &m_transformat);
+		return m_transtable != NULL;
+	}
+
+	// If we reach here then we're doing truecolour to truecolour
+
+	// Are the formats identical?
+    if (PF_EQ(m_transformat,m_localformat))
+	{
+		// Yes, so use the null translation function
+		vnclog.Print(LL_INTINFO, VNCLOG("no translation required\n"));
+
+		m_transfunc = rfbTranslateNone;
+
+		return TRUE;
+    }
+
+	// Is the local display a 16-bit one
+    if (m_localformat.bitsPerPixel == 16)
+	{
+		// Yes, so use a single lookup-table
+		vnclog.Print(LL_INTINFO, VNCLOG("single LUT used\n"));
+
+		m_transfunc = rfbTranslateWithSingleTableFns
+			[m_localformat.bitsPerPixel / 16]
+			[m_transformat.bitsPerPixel / 16];
+
+		(*rfbInitTrueColourSingleTableFns[m_transformat.bitsPerPixel / 16])
+			(&m_transtable, &m_localformat, &m_transformat);
+    }
+	else
+	{
+		// No, so use three tables - one for each of R, G, B.
+		vnclog.Print(LL_INTINFO, VNCLOG("triple LUT used\n"));
+
+		m_transfunc = rfbTranslateWithRGBTablesFns
+			[m_localformat.bitsPerPixel / 16]
+			[m_transformat.bitsPerPixel / 16];
+
+		(*rfbInitTrueColourRGBTablesFns[m_transformat.bitsPerPixel / 16])
+			(&m_transtable, &m_localformat, &m_transformat);
+    }
+
+	return m_transtable != NULL;
+}
+
+BOOL
+vncEncoder::SetLocalFormat(rfbPixelFormat &pixformat, int width, int height)
+{
+	// Work out the bytes per row at the local end - useful
+	m_bytesPerRow = width * pixformat.bitsPerPixel/8;
+	framebufferWidth=width;
+	framebufferHeight=height;
+	// Save the pixel format
+	m_localformat = pixformat;
+	return SetTranslateFunction();
+}
+
+BOOL
+vncEncoder::SetRemoteFormat(rfbPixelFormat &pixformat)
+{
+	// Save the client pixel format
+	m_remoteformat = pixformat;
+
+	return SetTranslateFunction();
+}
+
+void
+vncEncoder::SetSWOffset(int x,int y)
+{
+	m_SWOffsetx=x;
+	m_SWOffsety=y;
+}
+
+// Tight
+void
+vncEncoder::SetCompressLevel(int level)
+{
+	m_compresslevel = (level >= 0 && level <= 9) ? level : 6;
+}
+
+void
+vncEncoder::SetQualityLevel(int level)
+{
+	m_qualitylevel = (level >= 0 && level <= 9) ? level : -1;
+}
+
+inline void
+vncEncoder::LastRect(VSocket *outConn)
+{
+
+}
diff --git a/ica/win32/winvnc/winvnc/vncencoder.h b/ica/win32/winvnc/winvnc/vncencoder.h
new file mode 100644
index 0000000..3675c0a
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencoder.h
@@ -0,0 +1,139 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncoder object
+
+// The vncEncoder object encodes regions of a display buffer for sending
+// to a client
+
+class vncEncoder;
+
+#if !defined(RFBENCODER_DEFINED)
+#define RFBENCODER_DEFINED
+#pragma once
+
+#include "vncbuffer.h"
+#include "translate.h"
+#include "vsocket.h"
+#include "vncmemcpy.h"
+
+// Class definition
+
+class vncEncoder
+{
+// Fields
+public:
+
+// Methods
+public:
+	// Create/Destroy methods
+	vncEncoder();
+	virtual ~vncEncoder();
+
+	// Initialisation
+	virtual void Init();
+
+	// Encoder stats used by the buffer object
+	virtual UINT RequiredBuffSize(UINT width, UINT height);
+	virtual UINT NumCodedRects(const rfb::Rect &rect);
+	virtual UINT NumCodedRects(RECT &rect); // For Tight
+
+
+	// Translation & encoding routines
+	//  - Source is the base address of the ENTIRE SCREEN buffer.
+	//    The Translate routine compensates automatically for the desired rectangle.
+	//  - Dest is the base address to encode the rect to.  The rect will be encoded
+	//    into a contiguous region of the buffer.
+	virtual void Translate(BYTE *source, BYTE *dest, const rfb::Rect &rect);
+	virtual UINT EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect);
+	virtual UINT EncodeRect(BYTE *source, BYTE *source2,VSocket *outConn, BYTE *dest, const rfb::Rect &rect);
+	virtual UINT EncodeRect(BYTE *source,VSocket *outConn, BYTE *dest, const rfb::Rect &rect);
+	virtual UINT EncodeRect(BYTE *source, VSocket *outConn, BYTE *dest, const RECT &rect); // sf at 2002 - For Tight...
+
+	// CURSOR HANDLING
+	void Translate(BYTE *source, BYTE *dest, int w, int h, int bytesPerRow);
+
+	// Translation handling
+	BOOL SetLocalFormat(rfbPixelFormat &pixformat, int width, int height);
+	BOOL SetRemoteFormat(rfbPixelFormat &pixformat);
+
+	// Colour map handling
+	BOOL GetRemotePalette(RGBQUAD *quadlist, UINT ncolours);
+	void SetSWOffset(int x,int y);
+
+	// Tight
+	void SetCompressLevel(int level);
+	void SetQualityLevel(int level);
+	void EnableLastRect(BOOL enable) { m_use_lastrect = enable; }
+
+	// Tight - CURSOR HANDLING
+	void EnableXCursor(BOOL enable) { m_use_xcursor = enable; }
+	void EnableRichCursor(BOOL enable) { m_use_richcursor = enable; }
+	BOOL SendEmptyCursorShape(VSocket *outConn);
+	BOOL SendCursorShape(VSocket *outConn, vncDesktop *desktop);
+	BOOL IsXCursorSupported();
+
+	virtual void LastRect(VSocket *outConn); //xorzlib
+
+protected:
+	BOOL SetTranslateFunction();
+
+	// Tight - CURSOR HANDLING
+	BOOL SendXCursorShape(VSocket *outConn, BYTE *mask, int xhot,int yhot,int width,int height);
+	BOOL SendRichCursorShape(VSocket *outConn, BYTE *mbits, BYTE *cbits, int xhot,int yhot,int width,int height);
+	void FixCursorMask(BYTE *mbits, BYTE *cbits, int width, int height, int width_bytes);
+
+// Implementation
+protected:
+	rfbTranslateFnType	m_transfunc;			// Translator function
+	char*				m_transtable;			// Colour translation LUT
+	char*				m_localpalette;			// Palette info if client is palette-based
+	rfbPixelFormat		m_localformat;			// Pixel Format info
+	rfbPixelFormat		m_remoteformat;			// Client pixel format info
+	rfbPixelFormat		m_transformat;			// Internal format used for translation (usually == client format)
+	int					m_bytesPerRow;			// Number of bytes per row locally
+	int					framebufferWidth;
+	int					framebufferHeight;
+	int m_SWOffsetx;
+	int m_SWOffsety;
+	int					dataSize;				// Total size of raw data encoded
+	int					rectangleOverhead;		// Total size of rectangle header data
+	int					encodedSize;			// Total size of encoded data
+	int					transmittedSize;		// Total amount of data sent
+
+	// Tight
+	int					m_compresslevel;		// Encoding-specific compression level (if needed).
+	int					m_qualitylevel;			// Image quality level for lossy JPEG compression.
+	BOOL				m_use_lastrect;
+	// Tight - CURSOR HANDLING
+	BOOL				m_use_xcursor;			// XCursor cursor shape updates allowed.
+	BOOL				m_use_richcursor;		// RichCursor cursor shape updates allowed.
+
+//	Ultravncmemcpy mem;
+};
+
+#endif // vncENCODER_DEFINED
diff --git a/ica/win32/winvnc/winvnc/vncencoderCursor.cpp b/ica/win32/winvnc/winvnc/vncencoderCursor.cpp
new file mode 100644
index 0000000..e734f70
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencoderCursor.cpp
@@ -0,0 +1,280 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+//  Copyright (C) 2000 Const Kaplinsky. All Rights Reserved.
+
+#include "vncencoder.h"
+#include "vncbuffer.h"
+#include "vncdesktop.h"
+
+//
+// New code implementing cursor shape updates.
+//
+BOOL
+vncEncoder::IsXCursorSupported()
+{
+	if (m_use_xcursor) return true;
+	if (m_use_richcursor) return true;
+	return false;
+}
+BOOL
+vncEncoder::SendEmptyCursorShape(VSocket *outConn)
+{
+	rfbFramebufferUpdateRectHeader hdr;
+	hdr.r.x = Swap16IfLE(0);
+	hdr.r.y = Swap16IfLE(0);
+	hdr.r.w = Swap16IfLE(0);
+	hdr.r.h = Swap16IfLE(0);
+	if (m_use_xcursor) {
+		hdr.encoding = Swap32IfLE(rfbEncodingXCursor);
+	} else {
+		hdr.encoding = Swap32IfLE(rfbEncodingRichCursor);
+	}
+
+	return outConn->SendExactQueue((char *)&hdr, sizeof(hdr));
+}
+
+BOOL
+vncEncoder::SendCursorShape(VSocket *outConn, vncDesktop *desktop)
+{
+	// Make sure the function is used correctly
+	if (!m_use_xcursor && !m_use_richcursor)
+		return FALSE;
+
+	// Check mouse cursor handle
+	HCURSOR hcursor = desktop->GetCursor();
+	if (hcursor == NULL) {
+		vnclog.Print(LL_INTINFO, VNCLOG("cursor handle is NULL.\n"));
+		return FALSE;
+	}
+
+	// Get cursor info
+	ICONINFO IconInfo;
+	if (!GetIconInfo(hcursor, &IconInfo)) {
+		vnclog.Print(LL_INTINFO, VNCLOG("GetIconInfo() failed.\n"));
+		return FALSE;
+	}
+	BOOL isColorCursor = FALSE;
+	if (IconInfo.hbmColor != NULL) {
+		isColorCursor = TRUE;
+		DeleteObject(IconInfo.hbmColor);
+	}
+	if (IconInfo.hbmMask == NULL) {
+		vnclog.Print(LL_INTINFO, VNCLOG("cursor bitmap handle is NULL.\n"));
+		return FALSE;
+	}
+
+	// Check bitmap info for the cursor
+	BITMAP bmMask;
+	if (!GetObject(IconInfo.hbmMask, sizeof(BITMAP), (LPVOID)&bmMask)) {
+		vnclog.Print(LL_INTINFO, VNCLOG("GetObject() for bitmap failed.\n"));
+		DeleteObject(IconInfo.hbmMask);
+		return FALSE;
+	}
+	if (bmMask.bmPlanes != 1 || bmMask.bmBitsPixel != 1) {
+		vnclog.Print(LL_INTINFO, VNCLOG("incorrect data in cursor bitmap.\n"));
+		DeleteObject(IconInfo.hbmMask);
+		return FALSE;
+	}
+
+	// Get monochrome bitmap data for cursor
+	// NOTE: they say we should use GetDIBits() instead of GetBitmapBits().
+	BYTE *mbits = new BYTE[bmMask.bmWidthBytes * bmMask.bmHeight];
+	if (mbits == NULL)
+    {
+		DeleteObject(IconInfo.hbmMask);
+		return FALSE;
+    }
+
+	BOOL success = GetBitmapBits(IconInfo.hbmMask,
+								 bmMask.bmWidthBytes * bmMask.bmHeight, mbits);
+	DeleteObject(IconInfo.hbmMask);
+
+	if (!success) {
+		vnclog.Print(LL_INTINFO, VNCLOG("GetBitmapBits() failed.\n"));
+		delete[] mbits;
+		return FALSE;
+	}
+
+	// Compute cursor dimensions
+	int width = bmMask.bmWidth;
+	int height = (isColorCursor) ? bmMask.bmHeight : bmMask.bmHeight/2;
+
+	// Call appropriate routine to send cursor shape update
+	if (!isColorCursor && m_use_xcursor) {
+		FixCursorMask(mbits, NULL, width, bmMask.bmHeight, bmMask.bmWidthBytes);
+		success = SendXCursorShape(outConn, mbits,
+								   IconInfo.xHotspot, IconInfo.yHotspot,
+								   width, height);
+	}
+	else if (m_use_richcursor) {
+		int cbits_size = width * height * 4;
+		BYTE *cbits = new BYTE[cbits_size];
+		if (cbits == NULL) {
+			delete[] mbits;
+			return FALSE;
+		}
+		if (!desktop->GetRichCursorData(cbits, hcursor, width, height)) {
+			vnclog.Print(LL_INTINFO, VNCLOG("vncDesktop::GetRichCursorData() failed.\n"));
+			delete[] mbits;
+			delete[] cbits;
+			return FALSE;
+		}
+		FixCursorMask(mbits, cbits, width, height, bmMask.bmWidthBytes);
+		success = SendRichCursorShape(outConn, mbits, cbits,
+									  IconInfo.xHotspot, IconInfo.yHotspot,
+									  width, height);
+		delete[] cbits;
+	}
+	else {
+		success = FALSE;	// FIXME: We could convert RichCursor -> XCursor.
+	}
+
+	// Cleanup
+	delete[] mbits;
+
+	return success;
+}
+
+BOOL
+vncEncoder::SendXCursorShape(VSocket *outConn, BYTE *mask,
+							 int xhot, int yhot, int width, int height)
+{
+	rfbFramebufferUpdateRectHeader hdr;
+	hdr.r.x = Swap16IfLE(xhot);
+	hdr.r.y = Swap16IfLE(yhot);
+	hdr.r.w = Swap16IfLE(width);
+	hdr.r.h = Swap16IfLE(height);
+	hdr.encoding = Swap32IfLE(rfbEncodingXCursor);
+
+	BYTE colors[6] = { 0, 0, 0, 0xFF, 0xFF, 0xFF };
+	int maskRowSize = (width + 7) / 8;
+	int maskSize = maskRowSize * height;
+
+	if ( !outConn->SendExactQueue((char *)&hdr, sizeof(hdr)) ||
+		 !outConn->SendExactQueue((char *)colors, 6) ||
+		 !outConn->SendExactQueue((char *)&mask[maskSize], maskSize) ||
+		 !outConn->SendExactQueue((char *)mask, maskSize) ) {
+		return FALSE;
+	}
+	return TRUE;
+}
+
+BOOL
+vncEncoder::SendRichCursorShape(VSocket *outConn, BYTE *mbits, BYTE *cbits,
+								int xhot, int yhot, int width, int height)
+{
+	rfbFramebufferUpdateRectHeader hdr;
+	hdr.r.x = Swap16IfLE(xhot);
+	hdr.r.y = Swap16IfLE(yhot);
+	hdr.r.w = Swap16IfLE(width);
+	hdr.r.h = Swap16IfLE(height);
+	hdr.encoding = Swap32IfLE(rfbEncodingRichCursor);
+
+	// Cet cursor image in local pixel format
+	int srcbuf_rowsize = width * (m_localformat.bitsPerPixel / 8);
+	while (srcbuf_rowsize % sizeof(DWORD))
+		srcbuf_rowsize++;	// Actually, this should never happen
+
+	// Translate image to client pixel format
+	int dstbuf_size = width * height * (m_remoteformat.bitsPerPixel / 8);
+	BYTE *dstbuf = new BYTE[dstbuf_size];
+	Translate(cbits, dstbuf, width, height, srcbuf_rowsize);
+
+	// Send the data
+	int mask_rowsize = (width + 7) / 8;
+	int mask_size = mask_rowsize * height;
+	if ( !outConn->SendExactQueue((char *)&hdr, sizeof(hdr)) ||
+		 !outConn->SendExactQueue((char *)dstbuf, dstbuf_size) ||
+		 !outConn->SendExactQueue((char *)mbits, mask_size) ) {
+		delete[] dstbuf;
+		return FALSE;
+	}
+	delete[] dstbuf;
+	return TRUE;
+}
+
+void
+vncEncoder::FixCursorMask(BYTE *mbits, BYTE *cbits,
+						  int width, int height, int width_bytes)
+{
+	int packed_width_bytes = (width + 7) / 8;
+
+	// Pack and invert bitmap data (mbits)
+	int x, y;
+	for (y = 0; y < height; y++)
+		for (x = 0; x < packed_width_bytes; x++)
+			mbits[y * packed_width_bytes + x] = ~mbits[y * width_bytes + x];
+
+	// Replace "inverted background" bits with black color to ensure
+	// cross-platform interoperability. Not beautiful but necessary code.
+	if (cbits == NULL) {
+		BYTE m, c;
+		height /= 2;
+		for (y = 0; y < height; y++) {
+			for (x = 0; x < packed_width_bytes; x++) {
+				m = mbits[y * packed_width_bytes + x];
+				c = mbits[(height + y) * packed_width_bytes + x];
+				mbits[y * packed_width_bytes + x] |= ~(m | c);
+				mbits[(height + y) * packed_width_bytes + x] |= ~(m | c);
+			}
+		}
+	} else {
+		int bytes_pixel = m_localformat.bitsPerPixel / 8;
+		int bytes_row = width * bytes_pixel;
+		while (bytes_row % sizeof(DWORD))
+			bytes_row++;	// Actually, this should never happen
+
+		BYTE bitmask;
+		int b1, b2;
+		for (y = 0; y < height; y++) {
+			bitmask = 0x80;
+			for (x = 0; x < width; x++) {
+				if ((mbits[y * packed_width_bytes + x / 8] & bitmask) == 0) {
+					for (b1 = 0; b1 < bytes_pixel; b1++) {
+						if (cbits[y * bytes_row + x * bytes_pixel + b1] != 0) {
+							mbits[y * packed_width_bytes + x / 8] ^= bitmask;
+							for (b2 = b1; b2 < bytes_pixel; b2++)
+								cbits[y * bytes_row + x * bytes_pixel + b2] = 0x00;
+							break;
+						}
+					}
+				}
+				if ((bitmask >>= 1) == 0)
+					bitmask = 0x80;
+			}
+		}
+	}
+}
+
+// Translate a rectangle (using arbitrary m_bytesPerRow value,
+// always translating from the beginning of the source pixel array)
+// NOTE: overloaded function!
+inline void
+vncEncoder::Translate(BYTE *source, BYTE *dest, int w, int h, int bytesPerRow)
+{
+	// Call the translation function
+	(*m_transfunc) (m_transtable, &m_localformat, &m_transformat,
+					(char *)source, (char *)dest, bytesPerRow, w, h);
+}
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncencoderre.cpp b/ica/win32/winvnc/winvnc/vncencoderre.cpp
new file mode 100644
index 0000000..45f96d2
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencoderre.cpp
@@ -0,0 +1,333 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeRRE
+
+// This file implements the vncEncoder-derived vncEncodeRRE class.
+// This class overrides some vncEncoder functions to produce a bitmap
+// to RRE encoder.  RRE is much more efficient than RAW format on
+// most screen data.
+
+#include "vncencoderre.h"
+
+vncEncodeRRE::vncEncodeRRE()
+{
+	m_buffer = NULL;
+	m_bufflen = 0;
+}
+
+vncEncodeRRE::~vncEncodeRRE()
+{
+	if (m_buffer != NULL)
+	{
+		delete [] m_buffer;
+		m_buffer = NULL;
+	}
+}
+
+void
+vncEncodeRRE::Init()
+{
+	vncEncoder::Init();
+}
+
+UINT
+vncEncodeRRE::RequiredBuffSize(UINT width, UINT height)
+{
+	return vncEncoder::RequiredBuffSize(width, height);
+}
+
+UINT
+vncEncodeRRE::NumCodedRects(const rfb::Rect &rect)
+{
+	return 1;
+}
+
+/*****************************************************************************
+ *
+ * Routines to implement Rise-and-Run-length Encoding (RRE).  This code is
+ * based on krw's original javatel rfbserver.
+ * This code courtesy of tjr
+ */
+
+/*
+ * rreBeforeBuf contains pixel data in the client's format.
+ * rreAfterBuf contains the RRE encoded version.  If the RRE encoded version is
+ * larger than the raw data or if it exceeds rreAfterBufSize then
+ * normal encoding is used instead.
+ */
+
+static int rreAfterBufLen;
+
+static int subrectEncode8 (CARD8 *data, CARD8 *buf, int w, int h, int maxBytes);
+static int subrectEncode16 (CARD16 *data, CARD8 *buf, int w, int h, int maxBytes);
+static int subrectEncode32 (CARD32 *data, CARD8 *buf, int w, int h, int maxBytes);
+static CARD32 getBgColour (char *data, int size, int bpp);
+
+/*
+ * 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 rreAfterBuf.  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>].
+ *
+ * This code has been modified from tjr's original by Wez(jnw)
+ */
+
+#define DEFINE_SUBRECT_ENCODE(bpp)											\
+static int																	\
+subrectEncode##bpp(															\
+	CARD##bpp *data,														\
+	CARD8 *buf,																\
+	int w,																	\
+	int h,																	\
+	int maxBytes															\
+	)																		\
+{																			\
+    CARD##bpp cl;															\
+    rfbRectangle subrect;													\
+    int x,y;																\
+    int i,j;																\
+    int hx=0,hy=0,vx=0,vy=0;														\
+    int hyflag;																\
+    CARD##bpp *seg;															\
+    CARD##bpp *line;														\
+    int hw,hh,vw,vh;														\
+    int thex,they,thew,theh;												\
+    int numsubs = 0;														\
+    int newLen;																\
+    CARD##bpp bg = (CARD##bpp)getBgColour((char*)data,w*h,bpp);				\
+																			\
+	/* Set the background colour value */									\
+	*((CARD##bpp *)buf) = bg;																\
+																			\
+    rreAfterBufLen = (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 ((i < w) && (seg[i] == cl)) 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 = rreAfterBufLen + (bpp/8) + sz_rfbRectangle;					\
+	if ((newLen > (w * h * (bpp/8))) || (newLen > maxBytes))				\
+	    return -1;															\
+																			\
+	  numsubs += 1;															\
+	  *((CARD##bpp *)(buf + rreAfterBufLen)) = cl;											\
+	  rreAfterBufLen += (bpp/8);											\
+	  memcpy(&buf[rreAfterBufLen],&subrect, sz_rfbRectangle);				\
+	  rreAfterBufLen += 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 CARD32
+getBgColour(char *data, int size, int bpp)
+{
+    
+#define NUMCLRS 256
+  
+  static int counts[NUMCLRS];
+  int i,j,k;
+
+  int maxcount = 0;
+  CARD8 maxclr = 0;
+
+  if (bpp != 8) {
+    if (bpp == 16) {
+      return ((CARD16 *)data)[0];
+    } else if (bpp == 32) {
+      return ((CARD32 *)data)[0];
+    } else {
+      fprintf(stderr,"getBgColour: bpp %d?\n",bpp);
+      exit(1);
+    }
+  }
+
+  for (i=0; i<NUMCLRS; i++) {
+    counts[i] = 0;
+  }
+
+  for (j=0; j<size; j++) {
+    k = (int)(((CARD8 *)data)[j]);
+    if (k >= NUMCLRS) {
+      fprintf(stderr, "%s: unusual colour = %d\n", "getBgColour",k);
+      exit(1);
+    }
+    counts[k] += 1;
+    if (counts[k] > maxcount) {
+      maxcount = counts[k];
+      maxclr = ((CARD8 *)data)[j];
+    }
+  }
+  
+  return maxclr;
+}
+
+// Encode the rectangle using RRE
+inline UINT
+vncEncodeRRE::EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect)
+{
+	int subrects = -1;
+
+	const UINT rectW = rect.br.x - rect.tl.x;
+	const UINT rectH = rect.br.y - rect.tl.y;
+
+	// Create the rectangle header
+	rfbFramebufferUpdateRectHeader *surh=(rfbFramebufferUpdateRectHeader *)dest;
+	surh->r.x = (CARD16) (rect.tl.x-m_SWOffsetx);
+	surh->r.y = (CARD16) (rect.tl.y-m_SWOffsety);
+	surh->r.w = (CARD16) (rectW);
+	surh->r.h = (CARD16) (rectH);
+	surh->r.x = Swap16IfLE(surh->r.x);
+	surh->r.y = Swap16IfLE(surh->r.y);
+	surh->r.w = Swap16IfLE(surh->r.w);
+	surh->r.h = Swap16IfLE(surh->r.h);
+	surh->encoding = Swap32IfLE(rfbEncodingRRE);
+	
+	// create a space big enough for the RRE encoded pixels
+	if (m_bufflen < (int)(rectW*rectH*m_remoteformat.bitsPerPixel / 8))
+	{
+		if (m_buffer != NULL)
+		{
+			delete [] m_buffer;
+			m_buffer = NULL;
+		}
+		m_buffer = new BYTE [rectW*rectH*m_remoteformat.bitsPerPixel/8+1];
+		if (m_buffer == NULL)
+			return vncEncoder::EncodeRect(source, dest, rect);
+		m_bufflen = rectW*rectH*m_remoteformat.bitsPerPixel/8;
+	}
+	
+	// Translate the data into our new buffer
+	Translate(source, m_buffer, rect);
+
+	// Choose the appropriate encoding routine (for speed...)
+	switch(m_remoteformat.bitsPerPixel)
+	{
+	case 8:
+		subrects = subrectEncode8(
+			m_buffer,
+			dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader,
+			rectW,
+			rectH,
+			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
+			);
+		break;
+	case 16:
+		subrects = subrectEncode16(
+			(CARD16 *)m_buffer,
+			(CARD8 *)(dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader),
+			rectW,
+			rectH,
+			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
+			);
+		break;
+	case 32:
+		subrects = subrectEncode32(
+			(CARD32 *)m_buffer,
+			(CARD8 *)(dest+sz_rfbFramebufferUpdateRectHeader+sz_rfbRREHeader),
+			rectW,
+			rectH,
+			m_bufflen-sz_rfbFramebufferUpdateRectHeader-sz_rfbRREHeader
+			);
+		break;
+	}
+
+	// If we couldn't encode the rectangles then just send the data raw
+	if (subrects < 0)
+		return vncEncoder::EncodeRect(source, dest, rect);
+
+	// Send the RREHeader
+	rfbRREHeader *rreh=(rfbRREHeader *)(dest+sz_rfbFramebufferUpdateRectHeader);
+	rreh->nSubrects = Swap32IfLE(subrects);
+	
+	// Return the amount of data sent	
+	return sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader +
+		(m_remoteformat.bitsPerPixel / 8) +
+		(subrects * (sz_rfbRectangle + m_remoteformat.bitsPerPixel / 8));
+}
diff --git a/ica/win32/winvnc/winvnc/vncencoderre.h b/ica/win32/winvnc/winvnc/vncencoderre.h
new file mode 100644
index 0000000..f9d0471
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencoderre.h
@@ -0,0 +1,66 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncEncodeRRE object
+
+// The vncEncodeRRE object uses a compression encoding to send rectangles
+// to a client
+
+class vncEncodeRRE;
+
+#if !defined(_WINVNC_ENCODERRRE)
+#define _WINVNC_ENCODERRE
+#pragma once
+
+#include "vncencoder.h"
+
+// Class definition
+
+class vncEncodeRRE : public vncEncoder
+{
+// Fields
+public:
+
+// Methods
+public:
+	// Create/Destroy methods
+	vncEncodeRRE();
+	~vncEncodeRRE();
+
+	virtual void Init();
+
+	virtual UINT RequiredBuffSize(UINT width, UINT height);
+	virtual UINT NumCodedRects(const rfb::Rect &rect);
+
+	virtual UINT EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect);
+
+// Implementation
+protected:
+	BYTE		*m_buffer;
+	int			m_bufflen;
+};
+
+#endif // _WINVNC_ENCODERRE
+
diff --git a/ica/win32/winvnc/winvnc/vncencodezrle.cpp b/ica/win32/winvnc/winvnc/vncencodezrle.cpp
new file mode 100644
index 0000000..179c86f
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencodezrle.cpp
@@ -0,0 +1,221 @@
+//  Copyright (C) 2002 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+#include "vncencodezrle.h"
+#include "rfb.h"
+#include "rfbMisc.h"
+#include <stdlib.h>
+#include <time.h>
+#include <rdr/MemOutStream.h>
+#include <rdr/ZlibOutStream.h>
+
+#define GET_IMAGE_INTO_BUF(tx,ty,tw,th,buf)     \
+  rfb::Rect rect;                                    \
+  rect.tl.x = tx;                               \
+  rect.tl.y = ty;                                \
+  rect.br.x = tx+tw;                           \
+  rect.br.y = ty+th;                          \
+  encoder->Translate(source, (BYTE*)buf, rect);
+
+#define EXTRA_ARGS , BYTE* source, vncEncoder* encoder
+
+#define ENDIAN_LITTLE 0
+#define ENDIAN_BIG 1
+#define ENDIAN_NO 2
+#define BPP 8
+#define ZYWRLE_ENDIAN ENDIAN_NO
+#include <rfb/zrleEncode.h>
+#undef BPP
+#define BPP 15
+#undef ZYWRLE_ENDIAN
+#define ZYWRLE_ENDIAN ENDIAN_LITTLE
+#include <rfb/zrleEncode.h>
+#undef ZYWRLE_ENDIAN
+#define ZYWRLE_ENDIAN ENDIAN_BIG
+#include <rfb/zrleEncode.h>
+#undef BPP
+#define BPP 16
+#undef ZYWRLE_ENDIAN
+#define ZYWRLE_ENDIAN ENDIAN_LITTLE
+#include <rfb/zrleEncode.h>
+#undef ZYWRLE_ENDIAN
+#define ZYWRLE_ENDIAN ENDIAN_BIG
+#include <rfb/zrleEncode.h>
+#undef BPP
+#define BPP 32
+#undef ZYWRLE_ENDIAN
+#define ZYWRLE_ENDIAN ENDIAN_LITTLE
+#include <rfb/zrleEncode.h>
+#undef ZYWRLE_ENDIAN
+#define ZYWRLE_ENDIAN ENDIAN_BIG
+#include <rfb/zrleEncode.h>
+#define CPIXEL 24A
+#undef ZYWRLE_ENDIAN
+#define ZYWRLE_ENDIAN ENDIAN_LITTLE
+#include <rfb/zrleEncode.h>
+#undef ZYWRLE_ENDIAN
+#define ZYWRLE_ENDIAN ENDIAN_BIG
+#include <rfb/zrleEncode.h>
+#undef CPIXEL
+#define CPIXEL 24B
+#undef ZYWRLE_ENDIAN
+#define ZYWRLE_ENDIAN ENDIAN_LITTLE
+#include <rfb/zrleEncode.h>
+#undef ZYWRLE_ENDIAN
+#define ZYWRLE_ENDIAN ENDIAN_BIG
+#include <rfb/zrleEncode.h>
+#undef CPIXEL
+#undef BPP
+
+vncEncodeZRLE::vncEncodeZRLE()
+{
+  mos = new rdr::MemOutStream;
+  zos = new rdr::ZlibOutStream;
+  beforeBuf = new rdr::U32[rfbZRLETileWidth * rfbZRLETileHeight + 1];
+  m_use_zywrle = FALSE;
+}
+
+vncEncodeZRLE::~vncEncodeZRLE()
+{
+  delete mos;
+  delete zos;
+  delete [] (rdr::U32 *) beforeBuf;
+}
+
+void vncEncodeZRLE::Init()
+{
+  vncEncoder::Init();
+}
+
+UINT vncEncodeZRLE::RequiredBuffSize(UINT width, UINT height)
+{
+  // this is a guess - 12 bytes plus 1.5 times raw... (zlib.h says compress
+  // needs 12 bytes plus 1.001 times raw data but that's not quite what we give
+  // zlib anyway)
+  return (sz_rfbFramebufferUpdateRectHeader + sz_rfbZRLEHeader + 12 +
+          width * height * (m_remoteformat.bitsPerPixel / 8) * 3 / 2);
+}
+
+UINT vncEncodeZRLE::EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect)
+{
+  int x = rect.tl.x;
+  int y = rect.tl.y;
+  int w = rect.br.x - x;
+  int h = rect.br.y - y;
+
+  mos->clear();
+
+  if( m_use_zywrle ){
+	  if( m_qualitylevel < 0 ){
+		  zywrle_level = 1;
+	  }else if( m_qualitylevel < 3 ){
+		  zywrle_level = 3;
+	  }else if( m_qualitylevel < 6 ){
+		  zywrle_level = 2;
+	  }else{
+		  zywrle_level = 1;
+	  }
+  }else{
+	  zywrle_level = 0;
+  }
+
+  switch (m_remoteformat.bitsPerPixel) {
+
+  case 8:
+    zrleEncode8NE( x, y, w, h, mos, zos, beforeBuf, source, this);
+    break;
+
+  case 16:
+    if( m_remoteformat.greenMax > 0x1F ){
+      if( m_remoteformat.bigEndian ){
+        zrleEncode16BE(x, y, w, h, mos, zos, beforeBuf, source, this);
+	  }else{
+        zrleEncode16LE(x, y, w, h, mos, zos, beforeBuf, source, this);
+	  }
+	}else{
+      if( m_remoteformat.bigEndian ){
+        zrleEncode15BE(x, y, w, h, mos, zos, beforeBuf, source, this);
+	  }else{
+        zrleEncode15LE(x, y, w, h, mos, zos, beforeBuf, source, this);
+	  }
+	}
+    break;
+
+  case 32:
+    bool fitsInLS3Bytes
+      = ((m_remoteformat.redMax   << m_remoteformat.redShift)   < (1<<24) &&
+         (m_remoteformat.greenMax << m_remoteformat.greenShift) < (1<<24) &&
+         (m_remoteformat.blueMax  << m_remoteformat.blueShift)  < (1<<24));
+
+    bool fitsInMS3Bytes = (m_remoteformat.redShift   > 7  &&
+                           m_remoteformat.greenShift > 7  &&
+                           m_remoteformat.blueShift  > 7);
+
+    if ((fitsInLS3Bytes && !m_remoteformat.bigEndian) ||
+        (fitsInMS3Bytes && m_remoteformat.bigEndian))
+    {
+      if( m_remoteformat.bigEndian ){
+        zrleEncode24ABE(x, y, w, h, mos, zos, beforeBuf, source, this);
+	  }else{
+        zrleEncode24ALE(x, y, w, h, mos, zos, beforeBuf, source, this);
+	  }
+    }
+    else if ((fitsInLS3Bytes && m_remoteformat.bigEndian) ||
+             (fitsInMS3Bytes && !m_remoteformat.bigEndian))
+    {
+      if( m_remoteformat.bigEndian ){
+        zrleEncode24BBE(x, y, w, h, mos, zos, beforeBuf, source, this);
+	  }else{
+        zrleEncode24BLE(x, y, w, h, mos, zos, beforeBuf, source, this);
+	  }
+    }
+    else
+    {
+      if( m_remoteformat.bigEndian ){
+        zrleEncode32BE(x, y, w, h, mos, zos, beforeBuf, source, this);
+	  }else{
+        zrleEncode32LE(x, y, w, h, mos, zos, beforeBuf, source, this);
+	  }
+    }
+    break;
+  }
+
+  rfbFramebufferUpdateRectHeader* surh = (rfbFramebufferUpdateRectHeader*)dest;
+  surh->r.x = Swap16IfLE(x-m_SWOffsetx);
+  surh->r.y = Swap16IfLE(y-m_SWOffsety);
+  surh->r.w = Swap16IfLE(w);
+  surh->r.h = Swap16IfLE(h);
+  if( m_use_zywrle ){
+    surh->encoding = Swap32IfLE(rfbEncodingZYWRLE);
+  }else{
+    surh->encoding = Swap32IfLE(rfbEncodingZRLE);
+  }
+
+  rfbZRLEHeader* hdr = (rfbZRLEHeader*)(dest +
+                                        sz_rfbFramebufferUpdateRectHeader);
+
+  hdr->length = Swap32IfLE(mos->length());
+
+  memcpy(dest + sz_rfbFramebufferUpdateRectHeader + sz_rfbZRLEHeader,
+         (rdr::U8*)mos->data(), mos->length());
+
+  return sz_rfbFramebufferUpdateRectHeader + sz_rfbZRLEHeader + mos->length();
+}
diff --git a/ica/win32/winvnc/winvnc/vncencodezrle.h b/ica/win32/winvnc/winvnc/vncencodezrle.h
new file mode 100644
index 0000000..0e554f5
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncencodezrle.h
@@ -0,0 +1,49 @@
+//  Copyright (C) 2002 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+#ifndef _WINVNC_ENCODEZRLE
+#define _WINVNC_ENCODEZRLE
+
+#include "vncencoder.h"
+
+namespace rdr { class ZlibOutStream; class MemOutStream; }
+
+class vncEncodeZRLE : public vncEncoder
+{
+public:
+  vncEncodeZRLE();
+  ~vncEncodeZRLE();
+
+  virtual void Init();
+
+  virtual UINT RequiredBuffSize(UINT width, UINT height);
+
+  virtual UINT EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect);
+
+  BOOL m_use_zywrle;
+
+private:
+  rdr::ZlibOutStream* zos;
+  rdr::MemOutStream* mos;
+  void* beforeBuf;
+};
+
+#endif
diff --git a/ica/win32/winvnc/winvnc/vnchttpconnect.cpp b/ica/win32/winvnc/winvnc/vnchttpconnect.cpp
new file mode 100644
index 0000000..9d57c71
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vnchttpconnect.cpp
@@ -0,0 +1,664 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncHTTPConnect.cpp
+
+// Implementation of the HTTP server class
+
+#include "stdhdrs.h"
+#include "vsocket.h"
+#include "vnchttpconnect.h"
+#include "vncserver.h"
+#include <omnithread.h>
+#include "resource.h"
+
+#include <ctype.h>
+
+//	[v1.0.2-jp1 fix]
+extern	HINSTANCE	hInstResDLL;
+extern bool			fShutdownOrdered;
+
+/* Old viewer - TODO: remove
+// HTTP messages/message formats
+const char HTTP_MSG_OK []			="HTTP/1.0 200 OK\r\n\r\n";
+const char HTTP_FMT_INDEX[]			="<HTML><TITLE>VNC desktop [%.256s]</TITLE>\n"
+	"<APPLET CODE=vncviewer.class ARCHIVE=vncviewer.jar WIDTH=%d HEIGHT=%d>\n"
+	"<param name=PORT value=%d></APPLET></HTML>\n";
+const char HTTP_MSG_NOSOCKCONN []	="<HTML><TITLE>Ultr at VNC desktop</TITLE>\n"
+	"<BODY>The requested desktop is not configured to accept incoming connections.</BODY>\n"
+	"</HTML>\n";
+const char HTTP_MSG_NOSUCHFILE []	="HTTP/1.0 404 Not found\r\n\r\n"
+    "<HEAD><TITLE>File Not Found</TITLE></HEAD>\n"
+    "<BODY><H1>The requested file could not be found</H1></BODY>\n";
+*/
+
+// HTTP messages / message formats
+const char HTTP_MSG_OK[] = "HTTP/1.0 200 OK\n\n";
+
+const char HTTP_FMT_INDEX[] =
+"<HTML>\n"
+"  <HEAD><TITLE> [%.256s] </TITLE></HEAD>\n"
+"  <BODY>\n"
+"  <SPAN style='position: absolute; top:0px;left:0px'>\n" // sf at 2002 - Hopefully supported by all recent browsers... to be checked.
+"<OBJECT \n"
+"    ID='VncViewer'\n"
+"    classid = 'clsid:8AD9C840-044E-11D1-B3E9-00805F499D93'\n"
+"    codebase = 'http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0'\n"
+"    WIDTH = %d HEIGHT = %d >\n"
+"    <PARAM NAME = CODE VALUE = VncViewer.class >\n"
+"    <PARAM NAME = ARCHIVE VALUE = VncViewer.jar >\n"
+"    <PARAM NAME = 'type' VALUE = 'application/x-java-applet;version=1.4'>\n"
+"    <PARAM NAME = 'scriptable' VALUE = 'false'>\n"
+"    <PARAM NAME = PORT VALUE=%d>\n"
+"    <PARAM NAME = ENCODING VALUE=Tight>\n"
+"    <PARAM NAME = 'Open New Window' VALUE='Yes'>\n"
+"    %s\n"
+"    <COMMENT>\n"
+"	<EMBED \n"
+"            type = 'application/x-java-applet;version=1.4' \\\n"
+"            CODE = VncViewer.class \\\n"
+"            ARCHIVE = VncViewer.jar \\\n"
+"            WIDTH = %d \\\n"
+"            HEIGHT = %d \\\n"
+"            PORT =%d \\\n"
+"            ENCODING =Tight \\\n"
+"            %s\\\n"
+"	    scriptable = false \\\n"
+"	    pluginspage ='http://java.sun.com/products/plugin/index.html#download'>\n"
+"	    <NOEMBED>\n"            
+"            </NOEMBED>\n"
+"	</EMBED>\n"
+"    </COMMENT>\n"
+"</OBJECT>\n"
+/*
+"    <APPLET CODE=VncViewer.class ARCHIVE=VncViewer.jar WIDTH=%d HEIGHT=%d>\n"
+"      <PARAM NAME=PORT VALUE=%d>\n"
+"      <PARAM NAME=ENCODING VALUE=Tight>\n"
+"    </APPLET>"*/
+"  </SPAN>\n"
+// "    <BR>\n"
+// "    <A href=\"http://ultravnc.sf.net\">Ultr at VNC Home Page</A></HTML>\n" // sf at 2002: don't waste space 
+"  </BODY>\n"
+"</HTML>\n";
+
+const char HTTP_MSG_NOSOCKCONN [] =
+"<HTML>\n"
+"  <HEAD><TITLE>Ultr at VNC desktop</TITLE></HEAD>\n"
+"  <BODY>\n"
+"    <H1>Connections Disabled</H1>\n"
+"    The requested desktop is not configured to accept incoming connections.\n"
+"  </BODY>\n"
+"</HTML>\n";
+
+const char HTTP_MSG_BADPARAMS [] =
+"<HTML>\n"
+"  <HEAD><TITLE>Ultr at VNC desktop</TITLE></HEAD>\n"
+"  <BODY>\n"
+"    <H1>Bad Parameters</H1>\n"
+"    The sequence of applet parameters specified within the URL is invalid.\n"
+"  </BODY>\n"
+"</HTML>\n";
+
+const char HTTP_MSG_NOSUCHFILE [] =
+"HTTP/1.0 404 Not Found\n\n"
+"<HTML>\n"
+"  <HEAD><TITLE>404 Not Found</TITLE></HEAD>\n"
+"  <BODY>\n"
+"    <H1>Not Found</H1>\n"
+"    The requested file could not be found.\n"
+"  </BODY>\n"
+"</HTML>\n";
+
+
+
+// Filename to resource ID mappings for the Java class files:
+typedef struct _FileToResourceMap {
+	char *filename;
+	char *type;
+	int resourceID;
+} FileMap;
+
+const FileMap filemapping []	={
+	{"/VncViewer.jar", "JavaArchive", IDR_VNCVIEWER_JAR},
+	{"/AuthPanel.class", "JavaClass", IDR_AUTHPANEL_CLASS},
+	{"/ClipboardFrame.class", "JavaClass", IDR_CLIPBOARDFRAME_CLASS},
+	{"/DesCipher.class", "JavaClass", IDR_DESCIPHER_CLASS},
+	{"/OptionsFrame.class", "JavaClass", IDR_OPTIONSFRAME_CLASS},
+	{"/RfbProto.class", "JavaClass", IDR_RFBPROTO_CLASS},
+	{"/VncCanvas.class", "JavaClass", IDR_VNCCANVAS_CLASS},
+	{"/VncViewer.class", "JavaClass", IDR_VNCVIEWER_CLASS},
+	{"/ButtonPanel.class", "JavaClass", IDR_BUTTONPANEL_CLASS},
+	{"/RecordingFrame.class", "JavaClass", IDR_RECFRAME_CLASS},
+	{"/SessionRecorder.class", "JavaClass", IDR_SESSIONREC_CLASS},
+	{"/FTPFrame.class", "JavaClass", IDR_FTPFRAME_CLASS},
+	{"/DH.class", "JavaClass", IDR_DH_CLASS},
+	{"/FTPFRame$StrComp.class", "JavaClass", IDR_FTPFRAMESTRCOMP_CLASS},
+	};
+
+const FileMap filemapping2 []	={
+	{"/VncViewer.jar", "JavaArchive", IDR_JAVAARCHIVE1},
+	{"/AuthPanel.class", "JavaClass", IDR_JAVACLASS1},
+	{"/ClipboardFrame.class", "JavaClass", IDR_JAVACLASS3},
+	{"/DesCipher.class", "JavaClass", IDR_JAVACLASS4},
+	{"/OptionsFrame.class", "JavaClass", IDR_JAVACLASS8},
+	{"/RfbProto.class", "JavaClass", IDR_JAVACLASS10},
+	{"/VncCanvas.class", "JavaClass", IDR_JAVACLASS12},
+	{"/VncViewer.class", "JavaClass", IDR_JAVACLASS13},
+	{"/ButtonPanel.class", "JavaClass", IDR_JAVACLASS2},
+	{"/RecordingFrame.class", "JavaClass", IDR_JAVACLASS9},
+	{"/SessionRecorder.class", "JavaClass", IDR_JAVACLASS11},
+	{"/FTPFrame.class", "JavaClass", IDR_JAVACLASS7},
+	{"/DH.class", "JavaClass", IDR_JAVACLASS5},
+	{"/FTPFRame$StrComp.class", "JavaClass", IDR_JAVACLASS6},
+	};
+const int filemappingsize		= 14;
+
+#ifdef HTTP_SAMEPORT
+// Added for HTTP-via-RFB. Allows us to handle an HTTP transaction
+// without starting a separate thread.
+class vncHTTPConnectThreadHelper {
+public:
+	// Routines to handle HTTP requests
+	void Init(vncServer* svr) { m_server = svr; }
+	void DoHTTP(VSocket *socket);
+	char *ReadLine(VSocket *socket, char delimiter);
+protected:
+	vncServer	*m_server;
+};
+#endif
+
+#ifdef HTTP_SAMEPORT
+class vncHTTPConnectThread : public omni_thread, public vncHTTPConnectThreadHelper
+#else
+// The function for the spawned thread to run
+class vncHTTPConnectThread : public omni_thread
+#endif
+{
+public:
+	// Init routine
+	virtual BOOL Init(VSocket *socket, vncServer *server);
+
+	// Code to be executed by the thread
+	virtual void *run_undetached(void * arg);
+#ifndef HTTP_SAMEPORT
+	// Routines to handle HTTP requests
+	virtual void DoHTTP(VSocket *socket);
+	virtual char *ReadLine(VSocket *socket, char delimiter);
+#endif
+
+	// Fields used internally
+	BOOL		m_shutdown;
+protected:
+#ifndef HTTP_SAMEPORT
+	vncServer	*m_server;
+#endif
+	VSocket		*m_socket;
+};
+
+#ifdef HTTP_SAMEPORT
+// Added for HTTP-via-RFB. This function is called when a connection is
+// accepted on the RFB port. If the client sends an HTTP request we
+// handle it here and return TRUE. Otherwise we return
+// FALSE and the caller continues with the RFB handshake.
+VBool maybeHandleHTTPRequest(VSocket* sock,vncServer* svr)
+{
+	if (!sock->ReadSelect(2000)) return false;
+
+	// Client is sending data. Create a vncHTTPConnectThread to
+	// handle it.
+	vncHTTPConnectThreadHelper http;
+	http.Init(svr);
+	http.DoHTTP(sock);
+	sock->Shutdown();
+	sock->Close();
+	delete sock;
+	return true;
+}
+#endif
+
+// Method implementations
+BOOL vncHTTPConnectThread::Init(VSocket *socket, vncServer *server)
+{
+	// Save the server pointer
+	m_server = server;
+
+	// Save the socket pointer
+	m_socket = socket;
+
+	// Start the thread
+	m_shutdown = FALSE;
+	start_undetached();
+
+	return TRUE;
+}
+
+// Code to be executed by the thread
+void *vncHTTPConnectThread::run_undetached(void * arg)
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("started HTTP server thread\n"));
+
+	// Go into a loop, listening for connections on the given socket
+	while (!m_shutdown)
+	{
+		// Accept an incoming connection
+		VSocket *new_socket = m_socket->Accept();
+		if (new_socket == NULL)
+			break;
+		if (m_shutdown)
+		{
+			delete new_socket;
+			break;
+		}
+		vnclog.Print(LL_CLIENTS, VNCLOG("HTTP client connected\n"));
+		Sleep(250);
+		// Successful accept - perform the transaction
+		new_socket->SetTimeout(15000); //ms
+		DoHTTP(new_socket);
+		Sleep(500);
+		// And close the client
+		new_socket->Shutdown();
+		new_socket->Close();
+		delete new_socket;
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("quitting HTTP server thread\n"));
+
+	return NULL;
+}
+
+#ifdef HTTP_SAMEPORT
+void vncHTTPConnectThreadHelper::DoHTTP(VSocket *socket)
+#else
+void vncHTTPConnectThread::DoHTTP(VSocket *socket)
+#endif
+{
+	char filename[1024];
+	char *line;
+
+	// Read in the HTTP header
+	if ((line = ReadLine(socket, '\n')) == NULL)
+		return;
+
+	// Scan the header for the filename and free the storage
+	int result = sscanf(line, "GET %s ", (char*)&filename);
+	delete [] line;
+	if ((result == 0) || (result == EOF))
+		return;
+
+	vnclog.Print(LL_CLIENTS, VNCLOG("file %s requested\n"), filename);
+
+	// Read in the rest of the browser's request data and discard...
+	BOOL emptyline=TRUE;
+
+	for (;;)
+	{
+		char c;
+
+		if (!socket->ReadExactHTTP(&c, 1))
+			return;
+		if (c=='\n')
+		{
+			if (emptyline)
+				break;
+			emptyline = TRUE;
+		}
+		else
+			if (c >= ' ')
+			{
+				emptyline = FALSE;
+			}
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("parameters read\n"));
+
+    if (filename[0] != '/')
+	{
+		vnclog.Print(LL_CONNERR, VNCLOG("filename didn't begin with '/'\n"));
+		socket->SendExactHTTP(HTTP_MSG_NOSUCHFILE, strlen(HTTP_MSG_NOSUCHFILE));
+		return;
+	}
+
+	// Switch, dependent upon the filename:
+	if (strcmp(filename, "/") == 0 ||
+			( strlen(filename) > 4 &&
+				filename[0]=='/' && filename[1]=='?' ) )
+	{
+		char indexpage[2048 + MAX_COMPUTERNAME_LENGTH + 1];
+
+		vnclog.Print(LL_CLIENTS, VNCLOG("sending main page\n"));
+
+		// Send the OK notification message to the client
+		if (!socket->SendExactHTTP(HTTP_MSG_OK, strlen(HTTP_MSG_OK)))
+			return;
+
+		// Compose the index page
+		if (m_server->SockConnected())
+		{
+			int width, height, depth;
+
+			// Get the screen's dimensions
+			m_server->GetScreenInfo(width, height, depth);
+
+			// Get the name of this desktop
+			char desktopname[MAX_COMPUTERNAME_LENGTH+1];
+			DWORD desktopnamelen = MAX_COMPUTERNAME_LENGTH + 1;
+			if (GetComputerName(desktopname, &desktopnamelen))
+			{
+				// Make the name lowercase
+				for (size_t x=0; x<strlen(desktopname); x++)
+				{
+					desktopname[x] = tolower(desktopname[x]);
+				}
+			}
+			else
+			{
+				strcpy(desktopname, "WinVNC");
+			}
+
+			// Tobias Doerffel, 2010/12
+			char paramsObj[4096];
+			char paramsEmbed[4096];
+			paramsObj[0] = 0;
+			paramsEmbed[0] = 0;
+			char *pf = filename+1;
+			while( ( *pf == '?' || ( pf = strchr( pf, '&' ) ) != NULL ) && pf[1] )
+			{
+				pf = pf+1;
+				char buf[128];
+				size_t curlen = strlen( pf );
+				char *next = strchr( pf, '&' );
+				if( next )
+				{
+					curlen = next - pf;
+				}
+				if( curlen > 0 && curlen+1 < sizeof( buf ) )
+				{
+					strncpy( buf, pf, curlen );
+					buf[curlen] = 0;
+					char *eq = strchr( buf, '=' );
+					if( eq )
+					{
+						*eq = 0;
+						char paramObj[128];
+						char paramEmbed[128];
+						sprintf( paramObj, "<PARAM NAME=%s VALUE=%s>\n", buf, eq+1 );
+						sprintf( paramEmbed, "%s = %s\n", buf, eq+1 );
+						if( strlen(paramObj)+strlen(paramsObj) < sizeof( paramsObj ) )
+						{
+							strcat( paramsObj, paramObj );
+						}
+						if( strlen(paramEmbed)+strlen(paramsEmbed) < sizeof( paramsEmbed ) )
+						{
+							strcat( paramsEmbed, paramEmbed );
+						}
+					}
+				}
+			}
+			// END - Tobias Doerffel, 2010/12
+
+			// Send the java applet page
+			sprintf(indexpage, HTTP_FMT_INDEX,
+				desktopname, width, height+32,
+				m_server->GetPort(),
+				paramsObj,
+				width, height+32,
+				m_server->GetPort(),
+				paramsEmbed
+				);
+		}
+		else
+		{
+			// Send a "sorry, not allowed" page
+			sprintf(indexpage, HTTP_MSG_NOSOCKCONN);
+		}
+
+		// Send the page
+		if (socket->SendExactHTTP(indexpage, strlen(indexpage)))
+			vnclog.Print(LL_INTINFO, VNCLOG("sent page\n"));
+
+		return;
+	}
+
+	// File requested was not the index so check the mappings
+	// list for a different file.
+
+	if (m_server->MSLogonRequired())
+	{
+
+		for (int x=0; x < filemappingsize; x++)
+	{
+		if (strcmp(filename, filemapping2[x].filename) == 0)
+		{
+			HRSRC resource;
+			HGLOBAL resourcehan;
+			char *resourceptr;
+			int resourcesize;
+
+			vnclog.Print(LL_INTINFO, VNCLOG("requested file recognised\n"));
+
+			// Find the resource here
+			//	[v1.0.2-jp1 fix]
+			//resource = FindResource(NULL,
+			resource = FindResource(hInstResDLL,
+					MAKEINTRESOURCE(filemapping2[x].resourceID),
+					filemapping2[x].type
+					);
+			if (resource == NULL)
+				return;
+
+			// Get its size
+			//	[v1.0.2-jp1 fix]
+			//resourcesize = SizeofResource(NULL, resource);
+			resourcesize = SizeofResource(hInstResDLL, resource);
+
+			// Load the resource
+			//	[v1.0.2-jp1 fix]
+			//resourcehan = LoadResource(NULL, resource);
+			resourcehan = LoadResource(hInstResDLL, resource);
+			if (resourcehan == NULL)
+				return;
+
+			// Lock the resource
+			resourceptr = (char *)LockResource(resourcehan);
+			if (resourceptr == NULL)
+				return;
+
+			vnclog.Print(LL_INTINFO, VNCLOG("sending file...\n"));
+
+			// Send the OK message
+			if (!socket->SendExactHTTP(HTTP_MSG_OK, strlen(HTTP_MSG_OK)))
+				return;
+
+			// Now send the entirety of the data to the client
+			if (!socket->SendExactHTTP(resourceptr, resourcesize))
+				return;
+
+			vnclog.Print(LL_INTINFO, VNCLOG("file successfully sent\n"));
+
+			return;
+		}
+	}
+	}
+	else
+	{
+	// Now search the mappings for the desired file
+	for (int x=0; x < filemappingsize; x++)
+	{
+		if (strcmp(filename, filemapping[x].filename) == 0)
+		{
+			HRSRC resource;
+			HGLOBAL resourcehan;
+			char *resourceptr;
+			int resourcesize;
+
+			vnclog.Print(LL_INTINFO, VNCLOG("requested file recognised\n"));
+
+			// Find the resource here
+			//	[v1.0.2-jp1 fix]
+			//resource = FindResource(NULL,
+			resource = FindResource(hInstResDLL,
+					MAKEINTRESOURCE(filemapping[x].resourceID),
+					filemapping[x].type
+					);
+			if (resource == NULL)
+				return;
+
+			// Get its size
+			//	[v1.0.2-jp1 fix]
+			//resourcesize = SizeofResource(NULL, resource);
+			resourcesize = SizeofResource(hInstResDLL, resource);
+
+			// Load the resource
+			//	[v1.0.2-jp1 fix]
+			//resourcehan = LoadResource(NULL, resource);
+			resourcehan = LoadResource(hInstResDLL, resource);
+			if (resourcehan == NULL)
+				return;
+
+			// Lock the resource
+			resourceptr = (char *)LockResource(resourcehan);
+			if (resourceptr == NULL)
+				return;
+
+			vnclog.Print(LL_INTINFO, VNCLOG("sending file...\n"));
+
+			// Send the OK message
+			if (!socket->SendExactHTTP(HTTP_MSG_OK, strlen(HTTP_MSG_OK)))
+				return;
+
+			// Now send the entirety of the data to the client
+			if (!socket->SendExactHTTP(resourceptr, resourcesize))
+				return;
+
+			vnclog.Print(LL_INTINFO, VNCLOG("file successfully sent\n"));
+
+			return;
+		}
+	}
+	}
+
+	// Send the NoSuchFile notification message to the client
+	if (!socket->SendExactHTTP(HTTP_MSG_NOSUCHFILE, strlen(HTTP_MSG_NOSUCHFILE)))
+		return;
+}
+#ifdef HTTP_SAMEPORT
+char *vncHTTPConnectThreadHelper::ReadLine(VSocket *socket, char delimiter)
+#else
+char *vncHTTPConnectThread::ReadLine(VSocket *socket, char delimiter)
+#endif
+{
+	int max=1024;
+	// Allocate the maximum required buffer
+	char *buffer = new char[max+1];
+	int buffpos = 0;
+
+	// Read in data until a delimiter is read
+	for (;;)
+	{
+		char c;
+
+		if (!socket->ReadExactHTTP(&c, 1))
+		{
+			delete [] buffer;
+			return NULL;
+		}
+
+		if (c == delimiter)
+		{
+			buffer[buffpos] = 0;
+			return buffer;
+		}
+
+		buffer[buffpos] = c;
+		buffpos++;
+
+		if (buffpos == (max-1))
+		{
+			buffer[buffpos] = 0;
+			return buffer;
+		}
+	}
+}
+
+// The vncSockConnect class implementation
+
+vncHTTPConnect::vncHTTPConnect()
+{
+	m_thread = NULL;
+}
+
+vncHTTPConnect::~vncHTTPConnect()
+{
+   m_socket.Shutdown();
+
+    // Join with our lovely thread
+    if (m_thread != NULL)
+    {
+		// *** This is a hack to force the listen thread out of the accept call,
+		// because Winsock accept semantics are broken.
+		((vncHTTPConnectThread *)m_thread)->m_shutdown = TRUE;
+
+		VSocket socket;
+		socket.Create();
+		socket.Bind(0);
+		socket.Connect("localhost", m_port);
+		socket.Close();
+
+		void *returnval;
+		m_thread->join(&returnval);
+		m_thread = NULL;
+
+		m_socket.Close();
+    }
+}
+
+BOOL vncHTTPConnect::Init(vncServer *server, UINT port)
+{
+	// Save the port id
+	m_port = port;
+
+	// Create the listening socket
+	if (!m_socket.Create())
+		return FALSE;
+
+	// Bind it
+	if (!m_socket.Bind(m_port, server->LoopbackOnly()))
+		return FALSE;
+
+	// Set it to listen
+	if (!m_socket.Listen())
+		return FALSE;
+
+	// Create the new thread
+	m_thread = new vncHTTPConnectThread;
+	if (m_thread == NULL)
+		return FALSE;
+
+	// And start it running
+	return ((vncHTTPConnectThread *)m_thread)->Init(&m_socket, server);
+}
+
diff --git a/ica/win32/winvnc/winvnc/vnchttpconnect.h b/ica/win32/winvnc/winvnc/vnchttpconnect.h
new file mode 100644
index 0000000..c40fc5e
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vnchttpconnect.h
@@ -0,0 +1,70 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncHTTPConnect.h
+
+// The vncHTTPConnect class creates a listening socket and binds
+// it to the specified port number.  It then creates a listen
+// thread which goes into a loop, listening on the socket.
+// When the vncHTTPConnect object is destroyed, all resources are
+// freed automatically, including the listen thread.
+// This server allows clients to request the java classes required
+// to view the desktop remotely.
+
+class vncHTTPConnect;
+
+#if (!defined(_WINVNC_VNCHTTPCONNECT))
+#define _WINVNC_VNCHTTPCONNECT
+
+// Includes
+#include "stdhdrs.h"
+#include "vsocket.h"
+#include <omnithread.h>
+
+class vncServer;
+
+// The vncHTTPConnect class itself
+class vncHTTPConnect
+{
+public:
+	// Constructor/destructor
+	vncHTTPConnect();
+	~vncHTTPConnect();
+
+	// Init
+	virtual VBool Init(vncServer *server, UINT port);
+
+	// Implementation
+protected:
+	// The listening socket
+	VSocket m_socket;
+
+	// The port to listen on
+	UINT m_port;
+
+	// The in-coming accept thread
+	omni_thread *m_thread;
+};
+
+#endif // _WINVNC_VNCHTTPCONNECT
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncinsthandler.cpp b/ica/win32/winvnc/winvnc/vncinsthandler.cpp
new file mode 100644
index 0000000..cc9c356
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncinsthandler.cpp
@@ -0,0 +1,65 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncInstHandler.cpp
+
+// Implementation of the class used to ensure that only
+// one instance is running
+
+#include "stdhdrs.h"
+#include "vncinsthandler.h"
+
+// Name of the mutex
+
+const char mutexname [] = "WinVNC_Win32_Instance_Mutex";
+
+// The class methods
+vncInstHandler::vncInstHandler()
+{
+	mutex=NULL;
+}
+
+vncInstHandler::~vncInstHandler()
+{
+	if (mutex)
+	{
+		ReleaseMutex(mutex);
+		CloseHandle (mutex);
+	}
+}
+
+BOOL
+vncInstHandler::Init()
+{
+	// Create the named mutex
+	mutex = CreateMutex(NULL, FALSE, mutexname);
+	if (mutex == NULL)
+		return FALSE;
+
+	// Check that the mutex didn't already exist
+	if (GetLastError() == ERROR_ALREADY_EXISTS)
+		return FALSE;
+
+	return TRUE;
+}
diff --git a/ica/win32/winvnc/winvnc/vncinsthandler.h b/ica/win32/winvnc/winvnc/vncinsthandler.h
new file mode 100644
index 0000000..1aebf1c
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncinsthandler.h
@@ -0,0 +1,52 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncInstHandler
+
+// The WinMain procedure for WinVNC produces one of these objects.
+// It creates a named mutex and checks to see whether that mutex
+// already existed in the system.  If it did, then there is a previous
+// instance of WinVNC running, which must be requested to quit cleanly.
+
+class vncInstHandler;
+
+#if (!defined(_WINVNC_VNCINSTHANDLER))
+#define _WINVNC_VNCINSTHANDLER
+
+// Includes
+#include "stdhdrs.h"
+
+// The vncInstHandler class itself
+class vncInstHandler
+{
+	
+public:
+	vncInstHandler();
+	~vncInstHandler();
+	// Constructor/destructor
+	BOOL Init();
+	HANDLE mutex;
+};
+
+#endif // _WINVNC_VNCINSTHANDLER
diff --git a/ica/win32/winvnc/winvnc/vnckeymap.cpp b/ica/win32/winvnc/winvnc/vnckeymap.cpp
new file mode 100644
index 0000000..1f9b91b
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vnckeymap.cpp
@@ -0,0 +1,832 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+// vncKeymap.cpp
+
+// This code originally just mapped between X keysyms and local Windows
+// virtual keycodes.  Now it actually does the local-end simulation of
+// key presses, to keep this messy code on one place!
+#ifndef __GNUC__
+#pragma warning(disable : 4786)
+#endif
+#include "vncservice.h"
+#include "vnckeymap.h"
+#include <rdr/types.h>
+#define XK_MISCELLANY
+#define XK_LATIN1
+#define XK_CURRENCY
+#define XK_GREEK
+#define XK_TECHNICAL
+#define XK_XKB_KEYS
+
+//	[v1.0.2-jp1 fix] IOport's patch (Define XK_KATAKANA)
+#define XK_KATAKANA
+
+#include "keysymdef.h"
+
+//	[v1.0.2-jp1 fix] IOport's patch (Include "ime.h" for IME control)
+#include <ime.h>
+ 
+#include <map>
+#include <vector>
+DWORD WINAPI Cadthread(LPVOID lpParam);
+
+// Mapping of X keysyms to windows VK codes.  Ordering here is the same as
+// keysymdef.h to make checking easier
+rdr::U32 keysymDead=0;
+
+struct keymap_t {
+  rdr::U32 keysym;
+  rdr::U8 vk;
+  bool extended;
+};
+
+std::vector<unsigned char> deadChars;
+
+static keymap_t keymap[] = {
+
+  // TTY functions
+
+  { XK_BackSpace,        VK_BACK, 0 },
+  { XK_Tab,              VK_TAB, 0 },
+  { XK_Clear,            VK_CLEAR, 0 },
+  { XK_Return,           VK_RETURN, 0 },
+  { XK_Pause,            VK_PAUSE, 0 },
+  { XK_Escape,           VK_ESCAPE, 0 },
+  { XK_Delete,           VK_DELETE, 1 },
+
+  // Japanese stuff - almost certainly wrong...
+  //	[v1.0.2-jp1 fix] IOport's patch (Correct definition of Japanese key)
+  //{ XK_Kanji,            VK_KANJI, 0 },
+  //{ XK_Kana_Shift,       VK_KANA, 0 },
+  // Japanese key
+  { XK_Kanji,            VK_KANJI, 0 },				/* 0x19: Kanji, Kanji convert */
+  { XK_Muhenkan,         VK_NONCONVERT, 0 },		/* 0x1d: Cancel Conversion */
+  { XK_Romaji,           VK_DBE_ROMAN, 0 },			/* 0xf5: to Romaji */
+  { XK_Hiragana,         VK_DBE_HIRAGANA, 0 },		/* 0xf2: to Hiragana */
+  { XK_Katakana,         VK_DBE_KATAKANA, 0 },		/* 0xf1: to Katakana */
+  { XK_Zenkaku,          VK_DBE_SBCSCHAR, 0 },		/* 0xf3: to Zenkaku */
+  { XK_Hankaku,          VK_DBE_DBCSCHAR, 0 },		/* 0xf4: to Hankaku */
+  { XK_Eisu_toggle,      VK_DBE_ALPHANUMERIC, 0 },	/* 0xf0: Alphanumeric toggle */
+  { XK_Mae_Koho,         VK_CONVERT, 0 },			/* 0x1c: Previous Candidate */
+
+  // Cursor control & motion
+
+  { XK_Home,             VK_HOME, 1 },
+  { XK_Left,             VK_LEFT, 1 },
+  { XK_Up,               VK_UP, 1 },
+  { XK_Right,            VK_RIGHT, 1 },
+  { XK_Down,             VK_DOWN, 1 },
+  { XK_Page_Up,          VK_PRIOR, 1 },
+  { XK_Page_Down,        VK_NEXT, 1 },
+  { XK_End,              VK_END, 1 },
+
+  // Misc functions
+
+  { XK_Select,           VK_SELECT, 0 },
+  { XK_Print,            VK_SNAPSHOT, 0 },
+  { XK_Execute,          VK_EXECUTE, 0 },
+  { XK_Insert,           VK_INSERT, 1 },
+  { XK_Help,             VK_HELP, 0 },
+  { XK_Break,            VK_CANCEL, 1 },
+
+  // Keypad Functions, keypad numbers
+
+  { XK_KP_Space,         VK_SPACE, 0 },
+  { XK_KP_Tab,           VK_TAB, 0 },
+  { XK_KP_Enter,         VK_RETURN, 1 },
+  { XK_KP_F1,            VK_F1, 0 },
+  { XK_KP_F2,            VK_F2, 0 },
+  { XK_KP_F3,            VK_F3, 0 },
+  { XK_KP_F4,            VK_F4, 0 },
+  { XK_KP_Home,          VK_HOME, 0 },
+  { XK_KP_Left,          VK_LEFT, 0 },
+  { XK_KP_Up,            VK_UP, 0 },
+  { XK_KP_Right,         VK_RIGHT, 0 },
+  { XK_KP_Down,          VK_DOWN, 0 },
+  { XK_KP_End,           VK_END, 0 },
+  { XK_KP_Page_Up,       VK_PRIOR, 0 },
+  { XK_KP_Page_Down,     VK_NEXT, 0 },
+  { XK_KP_Begin,         VK_CLEAR, 0 },
+  { XK_KP_Insert,        VK_INSERT, 0 },
+  { XK_KP_Delete,        VK_DELETE, 0 },
+  // XXX XK_KP_Equal should map in the same way as ascii '='
+  { XK_KP_Multiply,      VK_MULTIPLY, 0 },
+  { XK_KP_Add,           VK_ADD, 0 },
+  { XK_KP_Separator,     VK_SEPARATOR, 0 },
+  { XK_KP_Subtract,      VK_SUBTRACT, 0 },
+  { XK_KP_Decimal,       VK_DECIMAL, 0 },
+  { XK_KP_Divide,        VK_DIVIDE, 1 },
+
+  { XK_KP_0,             VK_NUMPAD0, 0 },
+  { XK_KP_1,             VK_NUMPAD1, 0 },
+  { XK_KP_2,             VK_NUMPAD2, 0 },
+  { XK_KP_3,             VK_NUMPAD3, 0 },
+  { XK_KP_4,             VK_NUMPAD4, 0 },
+  { XK_KP_5,             VK_NUMPAD5, 0 },
+  { XK_KP_6,             VK_NUMPAD6, 0 },
+  { XK_KP_7,             VK_NUMPAD7, 0 },
+  { XK_KP_8,             VK_NUMPAD8, 0 },
+  { XK_KP_9,             VK_NUMPAD9, 0 },
+
+  // Auxilliary Functions
+
+  { XK_F1,               VK_F1, 0 },
+  { XK_F2,               VK_F2, 0 },
+  { XK_F3,               VK_F3, 0 },
+  { XK_F4,               VK_F4, 0 },
+  { XK_F5,               VK_F5, 0 },
+  { XK_F6,               VK_F6, 0 },
+  { XK_F7,               VK_F7, 0 },
+  { XK_F8,               VK_F8, 0 },
+  { XK_F9,               VK_F9, 0 },
+  { XK_F10,              VK_F10, 0 },
+  { XK_F11,              VK_F11, 0 },
+  { XK_F12,              VK_F12, 0 },
+  { XK_F13,              VK_F13, 0 },
+  { XK_F14,              VK_F14, 0 },
+  { XK_F15,              VK_F15, 0 },
+  { XK_F16,              VK_F16, 0 },
+  { XK_F17,              VK_F17, 0 },
+  { XK_F18,              VK_F18, 0 },
+  { XK_F19,              VK_F19, 0 },
+  { XK_F20,              VK_F20, 0 },
+  { XK_F21,              VK_F21, 0 },
+  { XK_F22,              VK_F22, 0 },
+  { XK_F23,              VK_F23, 0 },
+  { XK_F24,              VK_F24, 0 },
+
+    // Modifiers
+    
+  { XK_Shift_L,          VK_SHIFT, 0 },
+  { XK_Shift_R,          VK_RSHIFT, 0 },
+  { XK_Control_L,        VK_CONTROL, 0 },
+  { XK_Control_R,        VK_CONTROL, 1 },
+  { XK_Alt_L,            VK_MENU, 0 },
+  { XK_Alt_R,            VK_RMENU, 1 },
+
+// Left & Right Windows keys & Windows Menu Key
+
+  { XK_Super_L,			VK_LWIN, 0 }, 
+  { XK_Super_R,			VK_RWIN, 0 }, 
+  { XK_Menu,			VK_APPS, 0 }, 
+
+};
+
+struct latin1ToDeadChars_t {
+  rdr::U8 latin1Char;
+  rdr::U8 deadChar;
+  rdr::U8 baseChar;
+  int a,b,c;
+};
+
+latin1ToDeadChars_t latin1ToDeadChars[] = {
+
+  { XK_Agrave, XK_grave, XK_A },
+  { XK_Egrave, XK_grave, XK_E },
+  { XK_Igrave, XK_grave, XK_I },
+  { XK_Ograve, XK_grave, XK_O },
+  { XK_Ugrave, XK_grave, XK_U },
+  { XK_agrave, XK_grave, XK_a },
+  { XK_egrave, XK_grave, XK_e },
+  { XK_igrave, XK_grave, XK_i },
+  { XK_ograve, XK_grave, XK_o},
+  { XK_ugrave, XK_grave, XK_u },
+
+  { XK_Aacute, XK_acute, XK_A },
+  { XK_Eacute, XK_acute, XK_E },
+  { XK_Iacute, XK_acute, XK_I },
+  { XK_Oacute, XK_acute, XK_O },
+  { XK_Uacute, XK_acute, XK_U },
+  { XK_Yacute, XK_acute, XK_Y },
+  { XK_aacute, XK_acute, XK_a },
+  { XK_eacute, XK_acute, XK_e },
+  { XK_iacute, XK_acute, XK_i },
+  { XK_oacute, XK_acute, XK_o},
+  { XK_uacute, XK_acute, XK_u },
+  { XK_yacute, XK_acute, XK_y },
+
+  { XK_Acircumflex, XK_asciicircum, XK_A },
+  { XK_Ecircumflex, XK_asciicircum, XK_E },
+  { XK_Icircumflex, XK_asciicircum, XK_I },
+  { XK_Ocircumflex, XK_asciicircum, XK_O },
+  { XK_Ucircumflex, XK_asciicircum, XK_U },
+  { XK_acircumflex, XK_asciicircum, XK_a },
+  { XK_ecircumflex, XK_asciicircum, XK_e },
+  { XK_icircumflex, XK_asciicircum, XK_i },
+  { XK_ocircumflex, XK_asciicircum, XK_o},
+  { XK_ucircumflex, XK_asciicircum, XK_u },
+
+  { XK_Adiaeresis, XK_diaeresis, XK_A },
+  { XK_Ediaeresis, XK_diaeresis, XK_E },
+  { XK_Idiaeresis, XK_diaeresis, XK_I },
+  { XK_Odiaeresis, XK_diaeresis, XK_O },
+  { XK_Udiaeresis, XK_diaeresis, XK_U },
+  { XK_adiaeresis, XK_diaeresis, XK_a },
+  { XK_ediaeresis, XK_diaeresis, XK_e },
+  { XK_idiaeresis, XK_diaeresis, XK_i },
+  { XK_odiaeresis, XK_diaeresis, XK_o},
+  { XK_udiaeresis, XK_diaeresis, XK_u },
+  { XK_ydiaeresis, XK_diaeresis, XK_y },
+
+  { XK_Aring, XK_degree, XK_A },
+  { XK_aring, XK_degree, XK_a },
+
+  { XK_Ccedilla, XK_cedilla, XK_C },
+  { XK_ccedilla, XK_cedilla, XK_c },
+
+  { XK_Atilde, XK_asciitilde, XK_A },
+  { XK_Ntilde, XK_asciitilde, XK_N },
+  { XK_Otilde, XK_asciitilde, XK_O },
+  { XK_atilde, XK_asciitilde, XK_a },
+  { XK_ntilde, XK_asciitilde, XK_n },
+  { XK_otilde, XK_asciitilde, XK_o },
+};
+
+rdr::U8 latin1DeadChars[] = {
+  XK_grave, XK_acute, XK_asciicircum, XK_diaeresis, XK_degree, XK_cedilla,
+  XK_asciitilde
+};
+
+#define NoSymbol 0xfff
+rdr::U16 ascii_to_x[256] = {
+	NoSymbol,	NoSymbol,	NoSymbol,	XK_KP_Enter,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	XK_Delete,	XK_Tab,		XK_Linefeed,	NoSymbol,
+	NoSymbol,	XK_Return,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	XK_Escape,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	XK_space,	XK_exclam,	XK_quotedbl,	XK_numbersign,
+	XK_dollar,	XK_percent,	XK_ampersand,	XK_apostrophe,
+	XK_parenleft,	XK_parenright,	XK_asterisk,	XK_plus,
+	XK_comma,	XK_minus,	XK_period,	XK_slash,
+	XK_0,		XK_1,		XK_2,		XK_3,
+	XK_4,		XK_5,		XK_6,		XK_7,
+	XK_8,		XK_9,		XK_colon,	XK_semicolon,
+	XK_less,	XK_equal,	XK_greater,	XK_question,
+	XK_at,		XK_A,		XK_B,		XK_C,
+	XK_D,		XK_E,		XK_F,		XK_G,
+	XK_H,		XK_I,		XK_J,		XK_K,
+	XK_L,		XK_M,		XK_N,		XK_O,
+	XK_P,		XK_Q,		XK_R,		XK_S,
+	XK_T,		XK_U,		XK_V,		XK_W,
+	XK_X,		XK_Y,		XK_Z,		XK_bracketleft,
+	XK_backslash,	XK_bracketright,XK_asciicircum,	XK_underscore,
+	XK_grave,	XK_a,		XK_b,		XK_c,
+	XK_d,		XK_e,		XK_f,		XK_g,
+	XK_h,		XK_i,		XK_j,		XK_k,
+	XK_l,		XK_m,		XK_n,		XK_o,
+	XK_p,		XK_q,		XK_r,		XK_s,
+	XK_t,		XK_u,		XK_v,		XK_w,
+	XK_x,		XK_y,		XK_z,		XK_braceleft,
+	XK_bar,		XK_braceright,	XK_asciitilde,	XK_BackSpace,
+// 128
+	XK_Ccedilla,	XK_udiaeresis,	XK_eacute,	XK_acircumflex,
+	XK_adiaeresis,	XK_agrave,	XK_aring,	XK_ccedilla,
+	XK_ecircumflex,	XK_ediaeresis,	XK_egrave,	XK_idiaeresis,
+	XK_icircumflex,	XK_igrave,	XK_Adiaeresis,	XK_Aring,
+	XK_Eacute,	XK_ae,		XK_AE,		XK_ocircumflex,
+	XK_odiaeresis,	XK_ograve,	XK_ntilde,	XK_ugrave,
+	XK_ydiaeresis,	XK_Odiaeresis,	XK_Udiaeresis,	XK_cent,
+	XK_sterling,	XK_yen,		XK_paragraph,	XK_section,
+// 160
+	XK_aacute,	XK_degree,	XK_cent,	XK_sterling,
+	XK_ntilde,	XK_Ntilde,	XK_paragraph,	XK_Greek_BETA,
+	XK_questiondown,XK_hyphen,	XK_notsign,	XK_onehalf,
+	XK_onequarter,	XK_exclamdown,	XK_guillemotleft,XK_guillemotright,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+// 192
+	XK_questiondown,XK_exclamdown,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	XK_Agrave,
+	NoSymbol,	NoSymbol,	XK_AE,		XK_ae,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
+// 224
+	XK_Greek_alpha,	XK_ssharp,	XK_Greek_GAMMA,	XK_Greek_pi,
+	XK_Greek_SIGMA,	XK_Greek_sigma,	XK_mu,	        XK_Greek_tau,
+	XK_Greek_PHI,	XK_Greek_THETA,	XK_Greek_OMEGA,	XK_Greek_delta,
+	XK_infinity,	XK_Ooblique,	XK_Greek_epsilon, XK_intersection,
+	XK_identical,	XK_plusminus,	XK_greaterthanequal, XK_lessthanequal,
+	XK_topintegral,	XK_botintegral,	XK_division,	XK_similarequal,
+	XK_degree,	NoSymbol,	NoSymbol,	XK_radical,
+	XK_Greek_eta,	XK_twosuperior,	XK_periodcentered, NoSymbol,
+  };
+
+
+
+
+// doKeyboardEvent wraps the system keybd_event function and attempts to find
+// the appropriate scancode corresponding to the supplied virtual keycode.
+
+inline void doKeyboardEvent(BYTE vkCode, DWORD flags) {
+  keybd_event(vkCode, MapVirtualKey(vkCode, 0), flags, 0);
+}
+
+// KeyStateModifier is a class which helps simplify generating a "fake" press
+// or release of shift, ctrl, alt, etc.  An instance of the class is created
+// for every key which may need to be pressed or released.  Then either press()
+// or release() may be called to make sure that the corresponding key is in the
+// right state.  The destructor of the class automatically reverts to the
+// previous state.
+
+class KeyStateModifier {
+public:
+  KeyStateModifier(int vkCode_, int flags_=0)
+    : vkCode(vkCode_), flags(flags_), pressed(false), released(false)
+  {}
+  void press() {
+    if (!(GetAsyncKeyState(vkCode) & 0x8000)) {
+      doKeyboardEvent(vkCode, flags);
+      vnclog.Print(LL_INTINFO, "fake %d down\n", vkCode);
+      pressed = true;
+    }
+  }
+  void release() {
+    if (GetAsyncKeyState(vkCode) & 0x8000) {
+      doKeyboardEvent(vkCode, flags | KEYEVENTF_KEYUP);
+      vnclog.Print(LL_INTINFO, "fake %d up\n", vkCode);
+      released = true;
+    }
+  }
+  ~KeyStateModifier() {
+    if (pressed) {
+      doKeyboardEvent(vkCode, flags | KEYEVENTF_KEYUP);
+      vnclog.Print(LL_INTINFO, "fake %d up\n", vkCode);
+    } else if (released) {
+      doKeyboardEvent(vkCode, flags);
+      vnclog.Print(LL_INTINFO, "fake %d down\n", vkCode);
+    }
+  }
+  int vkCode;
+  int flags;
+  bool pressed;
+  bool released;
+};
+
+// Keymapper - a single instance of this class is used to generate Windows key
+// events.
+void doKeyEventWithModifiers(BYTE vkCode, BYTE modifierState, bool down)
+{
+  KeyStateModifier ctrl(VK_CONTROL);
+  KeyStateModifier alt(VK_MENU);
+  KeyStateModifier shift(VK_SHIFT);
+
+  if (down) {
+    if (modifierState & 2) ctrl.press();
+    if (modifierState & 4) alt.press();
+    if (modifierState & 1) {
+      shift.press(); 
+    } else {
+      shift.release();
+    }
+  }
+  doKeyboardEvent(vkCode, down ? 0 : KEYEVENTF_KEYUP);
+}
+
+class Keymapper {
+
+public:
+  Keymapper()
+  {
+    for (size_t i = 0; i < sizeof(keymap) / sizeof(keymap_t); i++) {
+      vkMap[keymap[i].keysym] = keymap[i].vk;
+      extendedMap[keymap[i].keysym] = keymap[i].extended;
+    }
+
+	// Find dead characters for the current keyboard layout
+  // XXX how could we handle the keyboard layout changing?
+  BYTE keystate[256];
+  memset(keystate, 0, 256);
+  for (size_t j = 0; j < sizeof(latin1DeadChars); j++) {
+    SHORT s = VkKeyScan(latin1DeadChars[j]);
+    if (s != -1) {
+      BYTE vkCode = LOBYTE(s);
+      BYTE modifierState = HIBYTE(s);
+      keystate[VK_SHIFT] = (modifierState & 1) ? 0x80 : 0;
+      keystate[VK_CONTROL] = (modifierState & 2) ? 0x80 : 0;
+      keystate[VK_MENU] = (modifierState & 4) ? 0x80 : 0;
+      rdr::U8 chars[2];
+      int nchars = ToAscii(vkCode, 0, keystate, (WORD*)&chars, 0);
+      if (nchars < 0) {
+        vnclog.Print(LL_INTWARN, "Found dead key 0x%x '%c'",
+                   latin1DeadChars[j], latin1DeadChars[j]);
+        deadChars.push_back(latin1DeadChars[j]);
+        ToAscii(vkCode, 0, keystate, (WORD*)&chars, 0);
+      }
+    }
+  }
+
+  }
+
+
+  
+
+  
+
+
+
+
+  void keyEvent(rdr::U32 keysym, bool down, bool jap)
+  {
+	  //vnclog.Print(LL_INTWARN, " keysym 0x%x",keysym);
+	if (keysym>=XK_dead_grave && keysym <=XK_dead_belowdot)// && down)
+	{
+		keysymDead=keysym;
+		vnclog.Print(LL_INTWARN, " ************** DEAD KEY");
+		//we have a dead key
+		//Record dead key
+		return;
+	}
+
+    if ((keysym >= 32 && keysym <= 126) ||
+        (keysym >= 160 && keysym <= 255))
+    {
+	if (keysymDead!=0 && down)
+	{
+		vnclog.Print(LL_INTWARN, " Compose dead 0x%x 0x%x",keysymDead,keysym);
+		switch (keysymDead)
+		{
+		case XK_dead_grave:
+			switch(keysym)
+			{
+			case XK_A: keysym=XK_Agrave;break;
+			case XK_E: keysym=XK_Egrave;break;
+			case XK_I: keysym=XK_Igrave;break;
+			case XK_O: keysym=XK_Ograve;break;
+			case XK_U: keysym=XK_Ugrave;break;
+			case XK_a: keysym=XK_agrave;break;
+			case XK_e: keysym=XK_egrave;break;
+			case XK_i: keysym=XK_igrave;break;
+			case XK_o: keysym=XK_ograve;break;
+			case XK_u: keysym=XK_ugrave;break;
+			}
+		case XK_dead_acute:
+			switch(keysym)
+			{
+			case XK_A: keysym=XK_Aacute;break;
+			case XK_E: keysym=XK_Eacute;break;
+			case XK_I: keysym=XK_Iacute;break;
+			case XK_O: keysym=XK_Oacute;break;
+			case XK_U: keysym=XK_Uacute;break;
+			case XK_a: keysym=XK_aacute;break;
+			case XK_e: keysym=XK_eacute;break;
+			case XK_i: keysym=XK_iacute;break;
+			case XK_o: keysym=XK_oacute;break;
+			case XK_u: keysym=XK_uacute;break;
+			case XK_y: keysym=XK_yacute;break;
+			case XK_Y: keysym=XK_Yacute;break;
+
+			}
+		case XK_dead_circumflex:
+			switch(keysym)
+			{
+			case XK_A: keysym=XK_Acircumflex;break;
+			case XK_E: keysym=XK_Ecircumflex;break;
+			case XK_I: keysym=XK_Icircumflex;break;
+			case XK_O: keysym=XK_Ocircumflex;break;
+			case XK_U: keysym=XK_Ucircumflex;break;
+			case XK_a: keysym=XK_acircumflex;break;
+			case XK_e: keysym=XK_ecircumflex;break;
+			case XK_i: keysym=XK_icircumflex;break;
+			case XK_o: keysym=XK_ocircumflex;break;
+			case XK_u: keysym=XK_ucircumflex;break;
+			}
+		case XK_dead_tilde:
+			switch(keysym)
+			{
+			case XK_A : keysym=XK_Ntilde;break;
+			case XK_O : keysym=XK_Otilde;break;
+			case XK_a : keysym=XK_atilde;break;
+			case XK_n : keysym=XK_ntilde;break;
+			case XK_o : keysym=XK_otilde;break;
+			}
+
+		case XK_dead_diaeresis:
+			switch(keysym)
+			{
+			case XK_A: keysym=XK_Adiaeresis;break;
+			case XK_E: keysym=XK_Ediaeresis;break;
+			case XK_I: keysym=XK_Idiaeresis;break;
+			case XK_O: keysym=XK_Odiaeresis;break;
+			case XK_U: keysym=XK_Udiaeresis;break;
+			case XK_a: keysym=XK_adiaeresis;break;
+			case XK_e: keysym=XK_ediaeresis;break;
+			case XK_i: keysym=XK_idiaeresis;break;
+			case XK_o: keysym=XK_odiaeresis;break;
+			case XK_u: keysym=XK_udiaeresis;break;
+			case XK_y: keysym=XK_ydiaeresis;break;
+
+			}
+		case XK_dead_cedilla:
+			switch(keysym)
+			{
+			case XK_C: keysym=XK_Ccedilla;break;
+			case XK_c: keysym=XK_ccedilla;break;
+			}
+		}
+		keysymDead=0;
+		vnclog.Print(LL_INTWARN, " Composed 0x%x",keysym);
+
+	}
+      // ordinary Latin-1 character
+
+      SHORT s = VkKeyScan(keysym);
+
+      //	[v1.0.2-jp1 fix] yak!'s patch
+	  // This break Other keyboards, we need an easy way of fixing this
+	  if (jap)
+	  {
+		  if (keysym==XK_kana_WO) {
+			s = 0x0130;
+		  } else if (keysym==XK_backslash) {
+			s = 0x00e2;
+		  } else if (keysym==XK_yen) {
+			s = 0x00dc;
+		  }
+	  }
+
+	  //vnclog.Print(LL_INTWARN, " SHORT s %i",s);
+
+	 if (s == -1)
+	 {
+		 
+      if (down) {
+		  vnclog.Print(LL_INTWARN, "down");
+        // not a single keypress - try synthesizing dead chars.
+			{
+			  vnclog.Print(LL_INTWARN, " Found key");
+			  //Lookup ascii representation
+			  int ascii=0;
+#if 0
+              // 11 Dec 2008 jdp disabled since the viewer is sending unicode now
+			  for (ascii=0;ascii<256;ascii++)
+			  {
+				  if (keysym==ascii_to_x[ascii]) break;
+			  }
+#endif
+              ascii = keysym;
+			  if (ascii <= 255)
+			  {
+
+			  rdr::U8 a0=ascii/100;
+			  ascii=ascii%100;
+			  rdr::U8 a1=ascii/10;
+			  ascii=ascii%10;
+			  rdr::U8 a2=ascii;
+
+              KeyStateModifier shift(VK_SHIFT);
+              KeyStateModifier lshift(VK_LSHIFT);
+              KeyStateModifier rshift(VK_RSHIFT);
+
+              if (vncService::IsWin95()) {
+                shift.release();
+              } else {
+                lshift.release();
+                rshift.release();
+			  }
+
+              vnclog.Print(LL_INTWARN, " Simulating ALT+%d%d%d\n", a0, a1 ,a2);
+
+			  keybd_event(VK_MENU,MapVirtualKey( VK_MENU, 0 ), 0 ,0);
+              /**
+                Pressing the Alt+NNN combinations without leading zero (for example, Alt+20, Alt+130, Alt+221) 
+                will insert characters from the Extended ASCII (or MS DOS ASCII, or OEM) table. The character 
+                glyphs contained by this table depend on the language of Windows. See the table below for the 
+                list of characters that can be inserted through the Alt+NNN combinations (without leading zero)
+                in English Windows.
+
+                Pressing the Alt+0NNN combinations will insert the ANSI characters corresponding to the activate 
+                keyboard layout. Please see Windows Character Map utility (charmap.exe) for the possible Alt+0NNN
+                combinations.
+
+                Finally, the Alt+00NNN combinations (two leading zeros) will insert Unicode characters. The Unicode 
+                codes of characters are displayed in Charmap.
+
+              **/
+              // jdp 11 December 2008 - Need the leading 0! 
+			  keybd_event(VK_NUMPAD0,    MapVirtualKey(VK_NUMPAD0,    0), 0, 0);
+			  keybd_event(VK_NUMPAD0,    MapVirtualKey(VK_NUMPAD0,    0),KEYEVENTF_KEYUP,0);
+			  keybd_event(VK_NUMPAD0+a0, MapVirtualKey(VK_NUMPAD0+a0, 0), 0, 0);
+			  keybd_event(VK_NUMPAD0+a0, MapVirtualKey(VK_NUMPAD0+a0, 0),KEYEVENTF_KEYUP,0);
+			  keybd_event(VK_NUMPAD0+a1, MapVirtualKey(VK_NUMPAD0+a1, 0),0,0);
+			  keybd_event(VK_NUMPAD0+a1, MapVirtualKey(VK_NUMPAD0+a1, 0),KEYEVENTF_KEYUP, 0);
+			  keybd_event(VK_NUMPAD0+a2, MapVirtualKey(VK_NUMPAD0+a2, 0) ,0, 0);
+			  keybd_event(VK_NUMPAD0+a2, MapVirtualKey(VK_NUMPAD0+a2, 0),KEYEVENTF_KEYUP, 0);
+			  keybd_event(VK_MENU, MapVirtualKey( VK_MENU, 0 ),KEYEVENTF_KEYUP, 0);
+			  return;
+			  }
+        }
+        vnclog.Print(LL_INTWARN, "ignoring unrecognised Latin-1 keysym 0x%x",keysym);
+      }
+      return;
+    }
+
+      /*if (s == -1) {
+        vnclog.Print(LL_INTWARN, "ignoring unrecognised Latin-1 keysym %d\n",
+                     keysym);
+		keybd_event( VK_MENU, MapVirtualKey(VK_MENU, 0),0, 0);
+		keybd_event( VK_MENU, MapVirtualKey(VK_MENU, 0),KEYEVENTF_KEYUP, 0);
+
+
+        return;
+      }*/
+
+      BYTE vkCode = LOBYTE(s);
+
+      // 18 March 2008 jdp
+      // Correct the keymask shift state to cope with the capslock state
+      BOOL capslockOn = (GetKeyState(VK_CAPITAL) & 1) != 0;
+
+      BYTE modifierState = HIBYTE(s);
+      modifierState = capslockOn ? modifierState ^ 1 : modifierState;
+      KeyStateModifier ctrl(VK_CONTROL);
+      KeyStateModifier alt(VK_MENU);
+      KeyStateModifier shift(VK_SHIFT);
+      KeyStateModifier lshift(VK_LSHIFT);
+      KeyStateModifier rshift(VK_RSHIFT);
+
+      if (down) {
+        if (modifierState & 2) ctrl.press();
+        if (modifierState & 4) alt.press();
+        if (modifierState & 1) {
+          shift.press(); 
+        } else {
+		  // [v1.0.2-jp1 fix] Even if "SHIFT + SPACE" are pressed, "SHIFT" is valid
+          if (vkCode == 0x20){
+		  }
+		  else{
+            if (vncService::IsWin95()) {
+              shift.release();
+			} else {
+              lshift.release();
+              rshift.release();
+			}
+		  }
+        }
+      }
+      vnclog.Print(LL_INTINFO,
+                   "latin-1 key: keysym %d(0x%x) vkCode 0x%x down %d capslockOn %d\n",
+                   keysym, keysym, vkCode, down, capslockOn);
+
+      doKeyboardEvent(vkCode, down ? 0 : KEYEVENTF_KEYUP);
+
+    } else {
+
+      // see if it's a recognised keyboard key, otherwise ignore it
+
+      if (vkMap.find(keysym) == vkMap.end()) {
+        vnclog.Print(LL_INTWARN, "ignoring unknown keysym %d\n",keysym);
+        return;
+      }
+      BYTE vkCode = vkMap[keysym];
+      DWORD flags = 0;
+      if (extendedMap[keysym]) flags |= KEYEVENTF_EXTENDEDKEY;
+      if (!down) flags |= KEYEVENTF_KEYUP;
+
+//      vnclog.Print(LL_INTINFO,
+  //                "keyboard key: keysym %d(0x%x) vkCode 0x%x ext %d down %d\n",
+    //               keysym, keysym, vkCode, extendedMap[keysym], down);
+
+      if (down && (vkCode == VK_DELETE) &&
+          ((GetAsyncKeyState(VK_CONTROL) & 0x8000) != 0) &&
+          ((GetAsyncKeyState(VK_MENU) & 0x8000) != 0) &&
+          vncService::IsWinNT())
+      {
+		vnclog.Print(LL_INTINFO,
+                 "CAD\n");
+		// If running under Vista and started from Session0 in Application mode
+		if (vncService::VersionMajor()>=6 && vncService::RunningFromExternalService() )
+		{
+			      vnclog.Print(LL_INTINFO,
+                 "Vista and runnning as system -> CAD\n");
+
+				// Try to run the special Vista cad.exe file...
+				HANDLE ThreadHandle2;
+				DWORD dwTId;
+				ThreadHandle2 = CreateThread(NULL, 0, Cadthread, NULL, 0, &dwTId);
+				CloseHandle(ThreadHandle2);
+		}
+		else if (vncService::VersionMajor()>=6)
+		{
+			vnclog.Print(LL_INTINFO,
+                 "Vista and runnning as user -> Taskmgr\n");
+			WinExec("taskmgr.exe", SW_SHOWNORMAL);
+		}
+		else if (vncService::VersionMajor()<6 && vncService::RunningFromExternalService() )
+		{
+			vnclog.Print(LL_INTINFO,
+                 "Not Vista and runnning as system, use old method\n");
+			vncService::SimulateCtrlAltDel();
+		}
+		else if (vncService::VersionMajor()<6)
+		{
+			vnclog.Print(LL_INTINFO,
+                 "Not Vista and runnning as user -> Taskmgr\n");
+			WinExec("taskmgr.exe", SW_SHOWNORMAL);
+		}
+        return;
+      }
+
+      if (vncService::IsWin95()) {
+        switch (vkCode) {
+        case VK_RSHIFT:   vkCode = VK_SHIFT;   break;
+        case VK_RCONTROL: vkCode = VK_CONTROL; break;
+        case VK_RMENU:    vkCode = VK_MENU;    break;
+        }
+      }
+
+      doKeyboardEvent(vkCode, flags);
+    }
+  }
+
+private:
+  std::map<rdr::U32,rdr::U8> vkMap;
+  std::map<rdr::U32,bool> extendedMap;
+} key_mapper;
+
+void vncKeymap::keyEvent(CARD32 keysym, bool down,bool jap)
+{
+  key_mapper.keyEvent(keysym, down,jap);
+}
+
+
+
+void
+SetShiftState(BYTE key, BOOL down)
+{
+	BOOL keystate = (GetAsyncKeyState(key) & 0x8000) != 0;
+
+	// This routine sets the specified key to the desired value (up or down)
+	if ((keystate && down) || ((!keystate) && (!down)))
+		return;
+
+	vnclog.Print(LL_INTINFO,
+		VNCLOG("setshiftstate %d - (%s->%s)\n"),
+		key, keystate ? "down" : "up",
+		down ? "down" : "up");
+
+	// Now send a key event to set the key to the new value
+	doKeyboardEvent(key, down ? 0 : KEYEVENTF_KEYUP);
+	keystate = (GetAsyncKeyState(key) & 0x8000) != 0;
+
+	vnclog.Print(LL_INTINFO,
+		VNCLOG("new state %d (%s)\n"),
+		key, keystate ? "down" : "up");
+}
+
+void
+vncKeymap::ClearShiftKeys()
+{
+	if (vncService::IsWinNT())
+	{
+		// On NT, clear both sets of keys
+
+		// LEFT
+		SetShiftState(VK_LSHIFT, FALSE);
+		SetShiftState(VK_LCONTROL, FALSE);
+		SetShiftState(VK_LMENU, FALSE);
+
+		// RIGHT
+		SetShiftState(VK_RSHIFT, FALSE);
+		SetShiftState(VK_RCONTROL, FALSE);
+		SetShiftState(VK_RMENU, FALSE);
+	}
+	else
+	{
+		// Otherwise, we can't distinguish the keys anyway...
+
+		// Clear the shift key states
+		SetShiftState(VK_SHIFT, FALSE);
+		SetShiftState(VK_CONTROL, FALSE);
+		SetShiftState(VK_MENU, FALSE);
+	}
+}
diff --git a/ica/win32/winvnc/winvnc/vnckeymap.h b/ica/win32/winvnc/winvnc/vnckeymap.h
new file mode 100644
index 0000000..becc9c3
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vnckeymap.h
@@ -0,0 +1,37 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+#ifndef KEYMAP_H__
+#define KEYMAP_H__
+
+#include "rfb.h"
+
+class vncKeymap {
+public:
+  static void keyEvent(CARD32 keysym, bool down,bool jap);
+  static void ClearShiftKeys();
+};
+
+
+#endif
diff --git a/ica/win32/winvnc/winvnc/vnclog.cpp b/ica/win32/winvnc/winvnc/vnclog.cpp
new file mode 100644
index 0000000..ba744d0
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vnclog.cpp
@@ -0,0 +1,302 @@
+//  Copyright (C) 2002 RealVNC Ltd. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+// Log.cpp: implementation of the VNCLog class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "stdhdrs.h"
+#include <io.h>
+#include "vnclog.h"
+#include "inifile.h"
+
+//////////////////////////////////////////////////////////////////////
+// Construction/Destruction
+//////////////////////////////////////////////////////////////////////
+
+const int VNCLog::ToDebug   =  1;
+const int VNCLog::ToFile    =  2;
+const int VNCLog::ToConsole =  4;
+
+static const int LINE_BUFFER_SIZE = 1024;
+
+VNCLog::VNCLog()
+    : m_tofile(false)
+    , m_todebug(false)
+    , m_toconsole(false)
+    , m_mode(0)
+    , m_level(0)
+    , hlogfile(NULL)
+    , m_append(false)
+	, m_video(false)
+    , m_lastLogTime(0)
+{
+	strcpy(m_filename,"");
+}
+
+void VNCLog::SetMode(int mode)
+{
+	m_mode = mode;
+    if (mode & ToDebug)
+        m_todebug = true;
+    else
+        m_todebug = false;
+
+    if (mode & ToFile)  {
+		if (!m_tofile)
+			OpenFile();
+	} else {
+		CloseFile();
+        m_tofile = false;
+    }
+    
+    if (mode & ToConsole) {
+        if (!m_toconsole) {
+            AllocConsole(); //lint !e534
+            fclose(stdout);
+            fclose(stderr);
+#ifdef _MSC_VER
+            int fh = _open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), 0);
+            _dup2(fh, 1);
+            _dup2(fh, 2);
+            _fdopen(1, "wt");
+            _fdopen(2, "wt");
+            printf("fh is %d\n",fh);
+            fflush(stdout);
+#endif
+        }
+
+        m_toconsole = true;
+
+    } else {
+        m_toconsole = false;
+    }
+}
+
+
+void VNCLog::SetLevel(int level) {
+    m_level = level;
+}
+
+void VNCLog::SetFile() 
+{
+	//SetMode(2);
+	//SetLevel(10);
+	char temp[512];
+	IniFile myIniFile;
+	myIniFile.ReadString("admin", "path", temp,512);
+	SetPath(temp);
+	strcpy(m_filename,m_path);
+	strcat(m_filename,"\\");
+	strcat(m_filename,"WinVNC.log");
+	m_append = true;
+	if (m_tofile)
+		OpenFile();
+}
+
+void VNCLog::OpenFile()
+{
+	// Is there a file-name?
+	if (strlen(m_filename) == 0)
+	{
+        m_todebug = true;
+        m_tofile = false;
+        Print(0, "Error opening log file\n");
+		return;
+	}
+
+    m_tofile  = true;
+    
+	// If there's an existing log and we're not appending then move it
+	if (!m_append)
+	{
+		// Build the backup filename
+		char *backupfilename = new char[strlen(m_filename)+5];
+		if (backupfilename)
+		{
+			strcpy(backupfilename, m_filename);
+			strcat(backupfilename, ".bak");
+			// Attempt the move and replace any existing backup
+			// Note that failure is silent - where would we log a message to? ;)
+			MoveFileEx(m_filename, backupfilename, MOVEFILE_REPLACE_EXISTING);
+			delete [] backupfilename;
+		}
+	}
+
+	CloseFile();
+
+    // If filename is NULL or invalid we should throw an exception here
+    hlogfile = CreateFile(
+        m_filename,  GENERIC_WRITE, FILE_SHARE_READ, NULL,
+        OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL  );
+    
+    if (hlogfile == INVALID_HANDLE_VALUE) {
+        // We should throw an exception here
+        m_todebug = true;
+        m_tofile = false;
+        Print(0, "Error opening log file %s\n", m_filename);
+    }
+    if (m_append) {
+        SetFilePointer( hlogfile, 0, NULL, FILE_END );
+    } else {
+        SetEndOfFile( hlogfile );
+    }
+}
+
+// if a log file is open, close it now.
+void VNCLog::CloseFile() {
+    if (hlogfile != NULL) {
+        CloseHandle(hlogfile);
+        hlogfile = NULL;
+    }
+}
+
+#ifdef ULTRAVNC_ITALC_SUPPORT
+#include "Logger.h"
+#endif
+
+inline void VNCLog::ReallyPrintLine(int level, const char* line) 
+{
+#ifdef ULTRAVNC_ITALC_SUPPORT
+	if( level == LL_SOCKERR || level == LL_ERROR )
+	{
+		ilog( Error, line );
+	}
+	else if( level == LL_INTWARN || level == LL_CONNERR )
+	{
+		ilog( Warning, line );
+	}
+	else if( level == LL_STATE ||
+				level == LL_CLIENTS || level == LL_INTERR )
+	{
+		ilog( Info, line );
+	}
+	else
+	{
+		ilog( Debug, line );
+	}
+#else
+    if (m_todebug) OutputDebugString(line);
+    if (m_toconsole) {
+        DWORD byteswritten;
+        WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), line, strlen(line), &byteswritten, NULL); 
+    };
+    if (m_tofile && (hlogfile != NULL)) {
+        DWORD byteswritten;
+        WriteFile(hlogfile, line, strlen(line), &byteswritten, NULL); 
+    }
+#endif
+}
+
+void VNCLog::ReallyPrint(int level, const char* format, va_list ap) 
+{
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	time_t current = time(0);
+	if (current != m_lastLogTime) {
+		m_lastLogTime = current;
+		ReallyPrintLine(ctime(&m_lastLogTime));
+	}
+#endif
+
+	// - Write the log message, safely, limiting the output buffer size
+	TCHAR line[(LINE_BUFFER_SIZE * 2) + 1]; // sf at 2006 - Prevents buffer overflow
+	TCHAR szErrorMsg[LINE_BUFFER_SIZE];
+	DWORD  dwErrorCode = GetLastError();
+    _vsnprintf(line, LINE_BUFFER_SIZE, format, ap);
+	SetLastError(0);
+    if (dwErrorCode != 0) {
+	    if (FormatMessage( 
+             FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode,
+             MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),(char *)&szErrorMsg,
+             LINE_BUFFER_SIZE, NULL) == 0)
+        {
+            sprintf(szErrorMsg, "error code 0x%08X", (unsigned int) dwErrorCode);
+        }
+	strcat(line," --");
+	strcat(line,szErrorMsg);
+	level = LL_ERROR;
+    }
+	ReallyPrintLine(level, line);
+}
+
+VNCLog::~VNCLog()
+{
+    try
+    {
+        CloseFile();
+    }
+    catch(...)
+    {
+    }
+}
+
+void VNCLog::GetLastErrorMsg(LPSTR szErrorMsg) const {
+
+   DWORD  dwErrorCode = GetLastError();
+
+   // Format the error message.
+   FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER 
+         | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode,
+         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR) &szErrorMsg,
+         0, NULL);
+}
+
+void VNCLog::SetPath(char path[512])
+{
+	if (strlen(path)==0)
+	{
+		char WORKDIR[MAX_PATH];
+	if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+		{
+		char* p = strrchr(WORKDIR, '\\');
+		if (p == NULL) return;
+		*p = '\0';
+		}
+		strcpy(m_path,WORKDIR);
+	}
+	else
+	strcpy(m_path,path);
+}
+char *VNCLog::GetPath()
+{
+	if (strlen(m_path)==0)
+	{
+		char WORKDIR[MAX_PATH];
+	if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+		{
+		char* p = strrchr(WORKDIR, '\\');
+		if (p == NULL) return "";
+		*p = '\0';
+		}
+		strcpy(m_path,WORKDIR);
+	}
+	
+	return m_path;
+}
+
+void VNCLog::ClearAviConfig()
+{
+	char WORKDIR[MAX_PATH];
+	strcpy(WORKDIR,m_path);
+	strcat(WORKDIR,"\\");
+	strcat(WORKDIR,"codec.cfg");
+	DeleteFile(WORKDIR);
+}
diff --git a/ica/win32/winvnc/winvnc/vnclog.h b/ica/win32/winvnc/winvnc/vnclog.h
new file mode 100644
index 0000000..8e6b88d
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vnclog.h
@@ -0,0 +1,109 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. 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://www.realvnc.com/ or contact
+// the authors on info at realvnc.com for information on obtaining it.
+
+// This is an object and macros which provide general logging and debugging functions.
+// It can log to a file, to a new console, and/or to debug - others maybe to follow.
+// Every log object has a logging level (which can be changed).
+// Only log requests with a high enough level attached get logged. So the
+// level can be thought of as 'amount of detail'.
+// We use Unicode-portable stuff here for compatibility with WinCE.
+//
+// Typical use:
+//
+//       Log log;
+//       log.SetFile( _T("myapp.log") );
+//       ...
+//       log.Print(2, _T("x = %d\n"), x);
+//
+
+#ifndef VNCLOGGING
+#define VNCLOGGING
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <time.h>
+
+class VNCLog  
+{
+public:
+    // Logging mode flags:
+    static const int ToDebug;
+    static const int ToFile;
+    static const int ToConsole;
+
+    // Create a new log object.
+    // Parameters as follows:
+    //    mode     - specifies where output should go, using combination
+    //               of flags above.
+    //    level    - the default level
+    //    filename - if flag Log::ToFile is specified in the type,
+    //               a filename must be specified here.
+    //    append   - if logging to a file, whether or not to append to any
+    //               existing log.
+	VNCLog();
+
+    inline void Print(int level, const char* format, ...) {
+        va_list ap;
+        va_start(ap, format);
+        ReallyPrint(level, format, ap);
+        va_end(ap);
+    }
+    
+    // Change the log level
+    void SetLevel(int level);
+	int  GetLevel() const {return m_level;};
+
+	void SetVideo(bool enable) {m_video=enable;};
+	bool GetVideo() {return m_video;};
+	void SetPath(char path[512]);
+	char *GetPath();
+	void ClearAviConfig();
+
+    // Change the logging mode
+    void SetMode(int mode);
+	int  GetMode() const {return m_mode;};
+
+    // Change or set the logging filename.  This only has an effect if
+	// the log mode includes ToFile
+    void SetFile();
+
+	virtual ~VNCLog();
+
+private:
+	void ReallyPrintLine(int level, const char* line);
+    void ReallyPrint(int level, const char* format, va_list ap);
+	void OpenFile();
+    void CloseFile();
+    bool m_tofile, m_todebug, m_toconsole;
+	int m_mode;
+    int m_level;
+    HANDLE hlogfile;
+	char m_filename[512];
+	bool m_append;
+	bool m_video;
+	char m_path[MAX_PATH];
+
+	time_t m_lastLogTime;
+	void GetLastErrorMsg(LPSTR szErrorMsg) const;
+};
+
+#endif // VNCLOGGING
diff --git a/ica/win32/winvnc/winvnc/vnclogon.cpp b/ica/win32/winvnc/winvnc/vnclogon.cpp
new file mode 100644
index 0000000..5deec2a
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vnclogon.cpp
@@ -0,0 +1,143 @@
+#include "stdhdrs.h"
+#include "resource.h"
+#include <omnithread.h>
+#include "vncdesktop.h"
+#include "vnclogon.h"
+
+
+extern HINSTANCE	hAppInstance;
+extern BOOL WINAPI SSPLogonUser(LPTSTR szDomain, LPTSTR szUser, LPTSTR szPassword);
+TCHAR szUsername[64];
+TCHAR szPassword[64];
+TCHAR szDomain[64];
+
+// [v1.0.2-jp1 fix] Load resouce from dll
+extern HINSTANCE	hInstResDLL;
+
+BOOL vncLogonThread::Init(vncDesktop *desktop)
+{
+	m_desktop = desktop;
+	m_desktop->logon=1;
+	logonhwnd=NULL;
+	rect.left=0;
+	rect.top=0;
+	rect.right=32;
+	rect.bottom=32;
+	start_undetached();
+	return TRUE;
+}
+
+void *vncLogonThread::run_undetached(void * arg)
+{
+	int logonstatus;
+	logonstatus=CreateLogonWindow(hAppInstance);
+	m_desktop->logon=logonstatus;
+
+	return NULL;
+}
+BOOL CALLBACK  
+vncLogonThread::LogonDlgProc(HWND hDlg,
+							 UINT Message,
+							 WPARAM wParam,
+							 LPARAM lParam)
+{
+ TCHAR TempString[63];
+ vncLogonThread *_this = (vncLogonThread *) GetWindowLong(hDlg, GWL_USERDATA);
+  switch (Message)
+    {
+    case WM_INITDIALOG:
+		_this = (vncLogonThread *) lParam;
+      _this->CenterWindow(hDlg);
+	  SetDlgItemText(hDlg, IDD_DOMAIN,TEXT("."));
+      SetDlgItemText(hDlg, IDD_USER_NAME,TEXT(""));
+      SetDlgItemText(hDlg, IDD_PASSWORD, TEXT(""));
+      SetFocus(GetDlgItem(hDlg, IDD_USER_NAME));
+
+      return(TRUE);
+
+    case WM_COMMAND:
+      if (LOWORD(wParam) == IDCANCEL)
+			{
+				EndDialog(hDlg, 0);
+			}
+      if (LOWORD(wParam) == IDOK)
+			{
+			GetDlgItemText(hDlg, IDD_USER_NAME, TempString, 63);
+			strcpy(szUsername,TempString);
+			GetDlgItemText(hDlg, IDD_PASSWORD,TempString, 63);
+			strcpy(szPassword,TempString);
+			GetDlgItemText(hDlg, IDD_DOMAIN,TempString, 63);
+			strcpy(szDomain,TempString);
+			EndDialog(hDlg, 1);
+			}
+      return(TRUE);
+    }
+
+  return(FALSE);
+
+}
+int vncLogonThread::CreateLogonWindow(HINSTANCE hInstance)
+{
+	int returnvalue=0;
+
+	// [v1.0.2-jp1 fix] Load resouce from dll
+	//returnvalue = DialogBoxParam(hAppInstance,MAKEINTRESOURCE(IDD_LOGON),
+	returnvalue = DialogBoxParam(hInstResDLL,MAKEINTRESOURCE(IDD_LOGON),
+				NULL,
+				(DLGPROC) LogonDlgProc,
+				(LONG) this);
+
+	if (returnvalue==1)
+			
+				if ((strcmp(szUsername ,TEXT(""))!=0) && (strcmp(szPassword ,TEXT(""))!=0))
+					
+						
+						if (SSPLogonUser(szDomain, szUsername,szPassword)) return 3;
+						
+						
+					
+	
+		
+	return 2;
+}
+VOID vncLogonThread::CenterWindow(HWND hwnd)
+{
+  LONG    dx, dy;
+  LONG    dxParent, dyParent;
+  LONG    Style;
+  logonhwnd=hwnd;
+  GetWindowRect(hwnd, &rect);
+  dx = rect.right - rect.left;
+  dy = rect.bottom - rect.top;
+
+  Style = GetWindowLong(hwnd, GWL_STYLE);
+  if ((Style & WS_CHILD) == 0) 
+    {
+      dxParent = GetSystemMetrics(SM_CXSCREEN);
+      dyParent = GetSystemMetrics(SM_CYSCREEN);
+    } 
+  else 
+    {
+      HWND    hwndParent;
+      RECT    rectParent;
+
+      hwndParent = GetParent(hwnd);
+      if (hwndParent == NULL) 
+	{
+	  hwndParent = GetDesktopWindow();
+	}
+
+      GetWindowRect(hwndParent, &rectParent);
+
+      dxParent = rectParent.right - rectParent.left;
+      dyParent = rectParent.bottom - rectParent.top;
+    }
+
+  rect.left = (dxParent - dx) / 2+m_desktop->m_ScreenOffsetx;
+  rect.top  = (dyParent - dy) / 3+m_desktop->m_ScreenOffsety;
+
+  SetWindowPos(hwnd, HWND_TOPMOST, rect.left, rect.top, 0, 0, SWP_NOSIZE);
+
+  SetForegroundWindow(hwnd);
+}
+
diff --git a/ica/win32/winvnc/winvnc/vnclogon.h b/ica/win32/winvnc/winvnc/vnclogon.h
new file mode 100644
index 0000000..14e8384
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vnclogon.h
@@ -0,0 +1,25 @@
+#include "stdhdrs.h"
+#if !defined(_WINVNC_LOGON)
+#define _WINVNC_LOGON
+#pragma once
+class vncLogonThread : public omni_thread
+{
+public:
+	vncLogonThread() {m_returnsig = NULL;};
+	~vncLogonThread() {if (m_returnsig != NULL) delete m_returnsig;};
+public:
+	virtual BOOL Init(vncDesktop *desktop);
+	virtual void *run_undetached(void *arg);
+	HWND logonhwnd;
+	RECT    rect;
+
+protected:
+	omni_mutex m_returnLock;
+	omni_condition *m_returnsig;
+	vncDesktop *m_desktop;
+	int x1,x2,y1,y2;
+	VOID CenterWindow(HWND hwnd);
+	static BOOL CALLBACK LogonDlgProc(HWND hDlg,UINT Message,WPARAM wParam,LPARAM lParam);
+	int CreateLogonWindow(HINSTANCE hInstance);
+};
+#endif
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncmemcpy.h b/ica/win32/winvnc/winvnc/vncmemcpy.h
new file mode 100644
index 0000000..836f6d2
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncmemcpy.h
@@ -0,0 +1,57 @@
+#ifndef __CPU_H__
+#define __CPU_H__
+#define CPUID_STD_FPU          0x00000001
+#define CPUID_STD_VME          0x00000002
+#define CPUID_STD_DEBUGEXT     0x00000004
+#define CPUID_STD_4MPAGE       0x00000008
+#define CPUID_STD_TSC          0x00000010
+#define CPUID_STD_MSR          0x00000020
+#define CPUID_STD_PAE          0x00000040
+#define CPUID_STD_MCHKXCP      0x00000080
+#define CPUID_STD_CMPXCHG8B    0x00000100
+#define CPUID_STD_APIC         0x00000200
+#define CPUID_STD_SYSENTER     0x00000800
+#define CPUID_STD_MTRR         0x00001000
+#define CPUID_STD_GPE          0x00002000
+#define CPUID_STD_MCHKARCH     0x00004000
+#define CPUID_STD_CMOV         0x00008000
+#define CPUID_STD_PAT          0x00010000
+#define CPUID_STD_PSE36        0x00020000
+#define CPUID_STD_MMX          0x00800000
+#define CPUID_STD_FXSAVE       0x01000000
+#define CPUID_STD_SSE          0x02000000
+#define CPUID_STD_SSE2         0x04000000
+#define CPUID_EXT_3DNOW        0x80000000
+#define CPUID_EXT_AMD_3DNOWEXT 0x40000000
+#define CPUID_EXT_AMD_MMXEXT   0x00400000
+
+#define FEATURE_CPUID           0x00000001
+#define FEATURE_STD_FEATURES    0x00000002
+#define FEATURE_EXT_FEATURES    0x00000004
+#define FEATURE_TSC             0x00000010
+#define FEATURE_MMX             0x00000020
+#define FEATURE_CMOV            0x00000040
+#define FEATURE_3DNOW           0x00000080
+#define FEATURE_3DNOWEXT        0x00000100
+#define FEATURE_MMXEXT          0x00000200
+#define FEATURE_SSEFP           0x00000400
+#define FEATURE_K6_MTRR         0x00000800
+#define FEATURE_P6_MTRR         0x00001000
+#define FEATURE_SSE				0x00002000
+#define FEATURE_SSE2            0x00004000
+
+class Ultravncmemcpy
+{
+public:
+	Ultravncmemcpy();
+	~Ultravncmemcpy();
+	inline void Set_memcpu();
+	bool Save_memcpy(void* dest,void* src,size_t count);
+	bool Save_memcmp(void* dest,void* src,size_t count);
+	inline void memcpyMMX(void* dest,void* src,DWORD count);
+	inline void memcpySSE(void *dest, const void *src, size_t nbytes);
+	UINT get_feature_flags(void);
+	bool cputype;
+};
+
+#endif
diff --git a/ica/win32/winvnc/winvnc/vncmenu.cpp b/ica/win32/winvnc/winvnc/vncmenu.cpp
new file mode 100644
index 0000000..ce03791
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncmenu.cpp
@@ -0,0 +1,2012 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncMenu
+
+// Implementation of a system tray icon & menu for WinVNC
+
+#include "stdhdrs.h"
+#include "winvnc.h"
+#include "vncservice.h"
+#include "vncconndialog.h"
+#include <lmcons.h>
+#include <wininet.h>
+#include <shlobj.h>
+
+// Header
+
+#include "vncmenu.h"
+#include "HideDesktop.h"
+#include "common/win32_helpers.h"
+
+#ifndef __GNUC__
+// [v1.0.2-jp1 fix]
+#pragma comment(lib, "imm32.lib")
+#endif
+
+extern bool G_1111;
+// Constants
+const UINT MENU_ADD_CLIENT_MSG_INIT = RegisterWindowMessage("WinVNC.AddClient.Message.Init");
+const UINT MENU_ADD_CLIENT_MSG = RegisterWindowMessage("WinVNC.AddClient.Message");
+const UINT MENU_AUTO_RECONNECT_MSG = RegisterWindowMessage("WinVNC.AddAutoClient.Message");
+const UINT MENU_STOP_RECONNECT_MSG = RegisterWindowMessage("WinVNC.AddStopClient.Message");
+const UINT MENU_STOP_ALL_RECONNECT_MSG = RegisterWindowMessage("WinVNC.AddStopAllClient.Message");
+const UINT MENU_REPEATER_ID_MSG = RegisterWindowMessage("WinVNC.AddRepeaterID.Message");
+// adzm 2009-07-05 - Tray icon balloon tips
+// adzm 2010-02-10 - Changed this window message (added 2) to prevent receiving the same message from older UltraVNC builds 
+// which will send this message between processes with process-local pointers to strings as the wParam and lParam
+const UINT MENU_TRAYICON_BALLOON_MSG = RegisterWindowMessage("WinVNC.TrayIconBalloon2.Message");
+ 
+
+const UINT FileTransferSendPacketMessage = RegisterWindowMessage("UltraVNC.Viewer.FileTransferSendPacketMessage");
+
+const char *MENU_CLASS_NAME = "WinVNC Tray Icon";
+
+BOOL g_restore_ActiveDesktop = FALSE;
+bool RunningAsAdministrator ();
+// [v1.0.2-jp1 fix] Load resouce from dll
+extern HINSTANCE	hInstResDLL;
+
+extern bool			fShutdownOrdered;
+
+extern BOOL SPECIAL_SC_PROMPT;
+
+// sf at 2007 - WTS notifications stuff
+#define NOTIFY_FOR_THIS_SESSION 0
+typedef BOOL (WINAPI *WTSREGISTERSESSIONNOTIFICATION)(HWND, DWORD);
+typedef BOOL (WINAPI *WTSUNREGISTERSESSIONNOTIFICATION)(HWND);
+
+static HMODULE DMdll = NULL; 
+typedef HRESULT (CALLBACK *P_DwmIsCompositionEnabled) (BOOL *pfEnabled); 
+static P_DwmIsCompositionEnabled pfnDwmIsCompositionEnabled = NULL; 
+typedef HRESULT (CALLBACK *P_DwmEnableComposition) (BOOL   fEnable); 
+static P_DwmEnableComposition pfnDwmEnableComposition = NULL; 
+static BOOL AeroWasEnabled = FALSE;
+DWORD GetExplorerLogonPid();
+
+void Set_uninstall_service_as_admin();
+void Set_install_service_as_admin();
+void Set_stop_service_as_admin();
+void Set_start_service_as_admin();
+
+DWORD GetCurrentSessionID();
+static unsigned int WM_TASKBARCREATED = 0;
+void Open_homepage();
+void Open_forum();
+
+#define MSGFLT_ADD		1
+typedef BOOL (WINAPI *CHANGEWINDOWMESSAGEFILTER)(UINT message, DWORD dwFlag);
+
+void Enable_softwareCAD_elevated();
+void delete_softwareCAD_elevated();
+void Reboot_in_safemode_elevated();
+bool IsSoftwareCadEnabled();
+bool ISUACENabled();
+void Reboot_with_force_reboot_elevated();
+//HACK to use name in autoreconnect from service with dyn dns
+extern char dnsname[255];
+
+
+static inline VOID UnloadDM(VOID) 
+ { 
+         pfnDwmEnableComposition = NULL; 
+         pfnDwmIsCompositionEnabled = NULL; 
+         if (DMdll) FreeLibrary(DMdll); 
+         DMdll = NULL; 
+ } 
+static inline BOOL LoadDM(VOID) 
+ { 
+         if (DMdll) 
+                 return TRUE; 
+  
+         DMdll = LoadLibraryA("dwmapi.dll"); 
+         if (!DMdll) return FALSE; 
+  
+         pfnDwmIsCompositionEnabled = (P_DwmIsCompositionEnabled)GetProcAddress(DMdll, "DwmIsCompositionEnabled");  
+         pfnDwmEnableComposition = (P_DwmEnableComposition)GetProcAddress(DMdll, "DwmEnableComposition"); 
+  
+         return TRUE; 
+ } 
+
+
+
+//bool disable_aero_set=false;
+static inline VOID DisableAero(VOID) 
+ { 
+	    /* if (disable_aero_set)
+		 {
+			 vnclog.Print(LL_INTINFO, VNCLOG("DisableAero already done %i \n"),AeroWasEnabled);
+			 return;
+		 }*/
+         BOOL pfnDwmEnableCompositiond = FALSE; 
+         //AeroWasEnabled = FALSE; 
+  
+         if (!LoadDM()) 
+                 return; 
+  
+         if (pfnDwmIsCompositionEnabled && SUCCEEDED(pfnDwmIsCompositionEnabled(&pfnDwmEnableCompositiond))) 
+                 ; 
+         else 
+                 return; 
+  
+		 //disable_aero_set=true;
+		 vnclog.Print(LL_INTINFO, VNCLOG("DisableAero %i \n"),pfnDwmEnableCompositiond);
+          if (!pfnDwmEnableCompositiond)
+			  return; 
+
+  
+		  if (pfnDwmEnableComposition && SUCCEEDED(pfnDwmEnableComposition(FALSE))) {			  
+			AeroWasEnabled = pfnDwmEnableCompositiond;
+		  }
+		 
+ } 
+  
+ static inline VOID ResetAero(VOID) 
+ { 
+	     vnclog.Print(LL_INTINFO, VNCLOG("Reset %i \n"),AeroWasEnabled);
+         if (pfnDwmEnableComposition && AeroWasEnabled) 
+         { 
+                 if (SUCCEEDED(pfnDwmEnableComposition(AeroWasEnabled))) 
+                         ; 
+                 else 
+                         ; 
+         } 
+		 //disable_aero_set=false;
+         UnloadDM(); 
+ } 
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+static bool IsUserDesktop()
+{
+	//only kill wallpaper if desktop is user desktop
+	HDESK desktop = GetThreadDesktop(GetCurrentThreadId());
+	DWORD dummy;
+	char new_name[256];
+	if (GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
+	{
+		if (strcmp(new_name,"Default")==0) {
+			return true;
+		}
+	}	
+
+	return false;
+}
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+static void KillWallpaper()
+{
+	HideDesktop();
+}
+
+static void RestoreWallpaper()
+{
+  RestoreDesktop();
+}
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+static void KillEffects()
+{
+	DisableEffects();
+}
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+static void RestoreEffects()
+{
+	EnableEffects();
+}
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+static void KillFontSmoothing()
+{
+	DisableFontSmoothing();
+}
+
+// adzm - 2010-07 - Disable more effects or font smoothing
+static void RestoreFontSmoothing()
+{
+	EnableFontSmoothing();
+}
+
+// Implementation
+
+vncMenu::vncMenu(vncServer *server)
+{
+	vnclog.Print(LL_INTERR, VNCLOG("vncmenu(server)\n"));
+	hWTSDll = NULL;
+	ports_set=false;
+    CoInitialize(0);
+	IsIconSet=false;
+	IconFaultCounter=0;
+
+	HMODULE hUser32 = LoadLibrary("user32.dll");
+	CHANGEWINDOWMESSAGEFILTER pfnFilter = NULL;
+	if (hUser32)
+	{
+	pfnFilter =(CHANGEWINDOWMESSAGEFILTER)GetProcAddress(hUser32,"ChangeWindowMessageFilter");
+	if (pfnFilter) pfnFilter(MENU_ADD_CLIENT_MSG, MSGFLT_ADD);
+	if (pfnFilter) pfnFilter(MENU_ADD_CLIENT_MSG_INIT, MSGFLT_ADD);
+	if (pfnFilter) pfnFilter(MENU_AUTO_RECONNECT_MSG, MSGFLT_ADD);
+	if (pfnFilter) pfnFilter(MENU_STOP_RECONNECT_MSG, MSGFLT_ADD);
+	if (pfnFilter) pfnFilter(MENU_STOP_ALL_RECONNECT_MSG, MSGFLT_ADD);
+	if (pfnFilter) pfnFilter(MENU_REPEATER_ID_MSG, MSGFLT_ADD);
+	// adzm 2009-07-05 - Tray icon balloon tips
+	if (pfnFilter) pfnFilter(MENU_TRAYICON_BALLOON_MSG, MSGFLT_ADD);
+    FreeLibrary (hUser32);
+	}
+	
+	// adzm 2009-07-05 - Tray icon balloon tips
+	m_BalloonInfo = NULL;
+	m_BalloonTitle = NULL;
+
+	// Save the server pointer
+	m_server = server;
+
+	// Set the initial user name to something sensible...
+	vncService::CurrentUser((char *)&m_username, sizeof(m_username));
+
+	//if (strcmp(m_username, "") == 0)
+	//	strcpy((char *)&m_username, "SYSTEM");
+	//vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::vncMenu - UserName = %s\n"), m_username);
+
+	// Create a dummy window to handle tray icon messages
+	WNDCLASSEX wndclass;
+
+	wndclass.cbSize			= sizeof(wndclass);
+	wndclass.style			= 0;
+	wndclass.lpfnWndProc	= vncMenu::WndProc;
+	wndclass.cbClsExtra		= 0;
+	wndclass.cbWndExtra		= 0;
+	wndclass.hInstance		= hAppInstance;
+	wndclass.hIcon			= LoadIcon(NULL, IDI_APPLICATION);
+	wndclass.hCursor		= LoadCursor(NULL, IDC_ARROW);
+	wndclass.hbrBackground	= (HBRUSH) GetStockObject(WHITE_BRUSH);
+	wndclass.lpszMenuName	= (const char *) NULL;
+	wndclass.lpszClassName	= MENU_CLASS_NAME;
+	wndclass.hIconSm		= LoadIcon(NULL, IDI_APPLICATION);
+
+	RegisterClassEx(&wndclass);
+
+#ifdef ULTRAVNC_ITALC_SUPPORT
+	m_hwnd = NULL;
+#else
+	m_hwnd = CreateWindow(MENU_CLASS_NAME,
+				MENU_CLASS_NAME,
+				WS_OVERLAPPEDWINDOW,
+				CW_USEDEFAULT,
+				CW_USEDEFAULT,
+				200, 200,
+				NULL,
+				NULL,
+				hAppInstance,
+				NULL);
+	if (m_hwnd == NULL)
+	{
+		PostQuitMessage(0);
+		return;
+	}
+
+	if (!hWTSDll) hWTSDll = LoadLibrary( ("wtsapi32.dll") );
+	if (hWTSDll)
+	{
+		WTSREGISTERSESSIONNOTIFICATION FunctionWTSRegisterSessionNotification;    
+		FunctionWTSRegisterSessionNotification = (WTSREGISTERSESSIONNOTIFICATION)GetProcAddress((HINSTANCE)hWTSDll, "WTSRegisterSessionNotification" );
+		if (FunctionWTSRegisterSessionNotification)
+			FunctionWTSRegisterSessionNotification( m_hwnd, NOTIFY_FOR_THIS_SESSION );
+	}
+
+	// record which client created this window
+    helper::SafeSetWindowUserData(m_hwnd, (LONG_PTR) this);
+
+	// Ask the server object to notify us of stuff
+	server->AddNotify(m_hwnd);
+#endif
+
+	// Initialise the properties dialog object
+	if (!m_properties.Init(m_server))
+	{
+		PostQuitMessage(0);
+		return;
+	}
+	if (!m_propertiesPoll.Init(m_server))
+	{
+		PostQuitMessage(0);
+		return;
+	}
+	
+	/* Does not work when vncMenu is created from imp_thread
+	hEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, "Global\\SessionEvent");
+	ResetEvent(hEvent);
+	*/
+
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	SetTimer(m_hwnd, 1, 5000, NULL);
+#endif
+
+
+	// sf at 2002
+	if (!m_ListDlg.Init(m_server))
+	{
+		PostQuitMessage(0);
+		return;
+	}
+
+	// Load the icons for the tray
+//	m_winvnc_icon = LoadIcon(hAppInstance, MAKEINTRESOURCE(IDI_WINVNC));
+//	m_flash_icon = LoadIcon(hAppInstance, MAKEINTRESOURCE(IDI_FLASH));
+	{
+	osvi.dwOSVersionInfoSize = sizeof(osvi);
+	GetVersionEx(&osvi);
+/*if (osvi.dwPlatformId==VER_PLATFORM_WIN32_NT)
+		{
+		  if(osvi.dwMajorVersion==5 && osvi.dwMinorVersion>=1)
+		  {
+			m_winvnc_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_WINVNC), IMAGE_ICON,
+                        GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
+			m_flash_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_FLASH), IMAGE_ICON,
+                        GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
+		  }
+		  else
+		 {
+			  m_winvnc_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_WINVNC), IMAGE_ICON,
+                        GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_VGACOLOR);
+			m_flash_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_FLASH), IMAGE_ICON,
+                        GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_VGACOLOR);
+		  }
+		 }
+	else
+		 {
+			  m_winvnc_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_WINVNC), IMAGE_ICON,
+                        GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_VGACOLOR);
+			m_flash_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_FLASH), IMAGE_ICON,
+                        GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_VGACOLOR);
+		  }
+	}*/
+
+	if (osvi.dwPlatformId==VER_PLATFORM_WIN32_NT)
+		{
+		  if(osvi.dwMajorVersion==5 && osvi.dwMinorVersion>=1)
+		  {
+			m_winvnc_icon=(HICON)LoadImage(NULL, "icon1.ico", IMAGE_ICON, GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_LOADFROMFILE|LR_DEFAULTCOLOR);
+			m_flash_icon=(HICON)LoadImage(NULL, "icon2.ico", IMAGE_ICON, GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_LOADFROMFILE|LR_DEFAULTCOLOR);
+			// [v1.0.2-jp1 fix]
+			//if (!m_winvnc_icon) m_winvnc_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_WINVNC), IMAGE_ICON,
+			if (!m_winvnc_icon) m_winvnc_icon=(HICON)LoadImage(hInstResDLL, MAKEINTRESOURCE(IDI_WINVNC), IMAGE_ICON,
+                        GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
+			// [v1.0.2-jp1 fix]
+			//if (!m_flash_icon) m_flash_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_FLASH), IMAGE_ICON,
+ 			if (!m_flash_icon) m_flash_icon=(HICON)LoadImage(hInstResDLL, MAKEINTRESOURCE(IDI_FLASH), IMAGE_ICON,
+                       GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
+			
+		  }
+		  else
+		 {
+			  m_winvnc_icon=(HICON)LoadImage(NULL, "icon1.ico", IMAGE_ICON, GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_LOADFROMFILE|LR_VGACOLOR);
+				m_flash_icon=(HICON)LoadImage(NULL, "icon2.ico", IMAGE_ICON, GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_LOADFROMFILE|LR_VGACOLOR);
+				
+			  // [v1.0.2-jp1 fix]
+			  //if (!m_winvnc_icon)m_winvnc_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_WINVNC), IMAGE_ICON,
+ 			  if (!m_winvnc_icon)m_winvnc_icon=(HICON)LoadImage(hInstResDLL, MAKEINTRESOURCE(IDI_WINVNC), IMAGE_ICON,
+                       GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_VGACOLOR);
+			 // [v1.0.2-jp1 fix]
+			 //if (!m_flash_icon)m_flash_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_FLASH), IMAGE_ICON,
+ 			 if (!m_flash_icon)m_flash_icon=(HICON)LoadImage(hInstResDLL, MAKEINTRESOURCE(IDI_FLASH), IMAGE_ICON,
+                       GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_VGACOLOR);
+			 
+		  }
+		 }
+	else
+		 {
+				m_winvnc_icon=(HICON)LoadImage(NULL, "icon1.ico", IMAGE_ICON, GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_LOADFROMFILE|LR_VGACOLOR);
+				m_flash_icon=(HICON)LoadImage(NULL, "icon2.ico", IMAGE_ICON, GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_LOADFROMFILE|LR_VGACOLOR);
+				
+				// [v1.0.2-jp1 fix]
+				//if (!m_winvnc_icon)m_winvnc_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_WINVNC), IMAGE_ICON,
+				if (!m_winvnc_icon)m_winvnc_icon=(HICON)LoadImage(hInstResDLL, MAKEINTRESOURCE(IDI_WINVNC), IMAGE_ICON,
+                       GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_VGACOLOR);
+				// [v1.0.2-jp1 fix]
+				//if (!m_flash_icon)m_flash_icon=(HICON)LoadImage(hAppInstance, MAKEINTRESOURCE(IDI_FLASH), IMAGE_ICON,
+				if (!m_flash_icon)m_flash_icon=(HICON)LoadImage(hInstResDLL, MAKEINTRESOURCE(IDI_FLASH), IMAGE_ICON,
+                        GetSystemMetrics(SM_CXSMICON),
+                        GetSystemMetrics(SM_CYSMICON), LR_VGACOLOR);
+				
+		  }
+	}
+
+	// Load the popup menu
+	// [v1.0.2-jp1 fix]
+	//m_hmenu = LoadMenu(hAppInstance, MAKEINTRESOURCE(IDR_TRAYMENU));
+	m_hmenu = LoadMenu(hInstResDLL, MAKEINTRESOURCE(IDR_TRAYMENU));
+
+	// Install the tray icon!
+	AddTrayIcon();
+	CoUninitialize();
+}
+
+vncMenu::~vncMenu()
+{
+	vnclog.Print(LL_INTERR, VNCLOG("vncmenu killed\n"));
+
+	// adzm 2009-07-05 - Tray icon balloon tips
+	if (m_BalloonInfo) {		
+		free(m_BalloonInfo);
+		m_BalloonInfo = NULL;
+	}
+	if (m_BalloonTitle) {
+		free(m_BalloonTitle);
+		m_BalloonTitle = NULL;
+	}
+
+	if (hWTSDll)
+	{
+		WTSUNREGISTERSESSIONNOTIFICATION FunctionWTSUnRegisterSessionNotification;
+		FunctionWTSUnRegisterSessionNotification = (WTSUNREGISTERSESSIONNOTIFICATION)GetProcAddress((HINSTANCE)hWTSDll,"WTSUnRegisterSessionNotification" );
+		if (FunctionWTSUnRegisterSessionNotification)
+			FunctionWTSUnRegisterSessionNotification( m_hwnd );
+		FreeLibrary( hWTSDll );
+		hWTSDll = NULL;
+	}
+
+
+    if (m_winvnc_icon)
+        DestroyIcon(m_winvnc_icon);
+    if (m_flash_icon)
+        DestroyIcon(m_flash_icon);
+
+
+	// Remove the tray icon
+	DelTrayIcon();
+	
+	// Destroy the loaded menu
+	if (m_hmenu != NULL)
+		DestroyMenu(m_hmenu);
+
+	// Tell the server to stop notifying us!
+	if (m_server != NULL)
+		m_server->RemNotify(m_hwnd);
+
+	if (m_server->RemoveWallpaperEnabled())
+		RestoreWallpaper();
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	if (m_server->RemoveEffectsEnabled())
+		RestoreEffects();
+	if (m_server->RemoveFontSmoothingEnabled())
+		RestoreFontSmoothing();
+	if (m_server->RemoveAeroEnabled())
+		ResetAero();
+	CoUninitialize();
+}
+
+void
+vncMenu::AddTrayIcon()
+{
+	//vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon \n"));
+	vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - UserName = %s\n"), m_username);
+
+	// If the user name is non-null then we have a user!
+	if (strcmp(m_username, "") != 0 && strcmp(m_username, "SYSTEM") != 0)
+	{
+		//vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - User exists\n"));
+		// Make sure the server has not been configured to
+		// suppress the tray icon.
+		HWND tray = FindWindow(("Shell_TrayWnd"), 0);
+		if (!tray)
+		{
+			IsIconSet=false;
+			vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - User exists, traywnd is not found reset when counter reach %i=3\n"),IconFaultCounter);
+			IconFaultCounter++;
+			m_server->TriggerUpdate();
+			return;
+		}
+		else
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::AddTrayIcon - ADD Tray Icon call\n"));
+		}
+
+		if (osvi.dwPlatformId==VER_PLATFORM_WIN32_NT && osvi.dwMinorVersion==0 && osvi.dwMajorVersion==5)
+		{
+			if ( ! m_server->GetDisableTrayIcon())
+				{
+					vnclog.Print(LL_INTERR, VNCLOG("########### Shell_TrayWnd found %i\n"),IsIconSet);
+					SendTrayMsg(NIM_ADD, FALSE);
+				}
+		}
+		else
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("########### Shell_TrayWnd found %i\n"),IsIconSet);
+			SendTrayMsg(NIM_ADD, FALSE);
+		}
+		if (m_server->AuthClientCount() != 0) { //PGM @ Advantig
+			// adzm - 2010-07 - Disable more effects or font smoothing
+			if (IsUserDesktop()) {				
+				if (m_server->RemoveWallpaperEnabled()) //PGM @ Advantig
+					KillWallpaper(); //PGM @ Advantig
+				if (m_server->RemoveEffectsEnabled())
+					KillEffects();
+				if (m_server->RemoveFontSmoothingEnabled())
+					KillFontSmoothing();
+			}
+			if (m_server->RemoveAeroEnabled()) //PGM @ Advantig
+				DisableAero(); //PGM @ Advantig
+		} //PGM @ Advantig
+	}
+}
+
+void
+vncMenu::DelTrayIcon()
+{
+	//vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::DelTrayIcon - DEL Tray Icon call\n"));
+	SendTrayMsg(NIM_DELETE, FALSE);
+}
+
+void
+vncMenu::FlashTrayIcon(BOOL flash)
+{
+	//vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::FlashTrayIcon - FLASH Tray Icon call\n"));
+	SendTrayMsg(NIM_MODIFY, flash);
+}
+
+// Get the local ip addresses as a human-readable string.
+// If more than one, then with \n between them.
+// If not available, then gets a message to that effect.
+// The ip address is not likely to change while running
+// this function is an overhead, each time calculating the ip
+// the ip is just used in the tray tip
+char old_buffer[512];
+char old_buflen=0;
+int dns_counter=0; // elimate to many dns requests once every 250s is ok
+void 
+vncMenu::GetIPAddrString(char *buffer, int buflen) {
+	if (old_buflen!=0 && dns_counter<50)
+	{
+		dns_counter++;
+		strcpy(buffer,old_buffer);
+		return;
+	}
+	dns_counter=0;
+    char namebuf[256];
+
+    if (gethostname(namebuf, 256) != 0) {
+		strncpy(buffer, "Host name unavailable", buflen);
+		return;
+    };
+
+    HOSTENT *ph = gethostbyname(namebuf);
+    if (!ph) {
+		strncpy(buffer, "IP address unavailable", buflen);
+		return;
+    };
+
+    *buffer = '\0';
+    char digtxt[5];
+    for (int i = 0; ph->h_addr_list[i]; i++) {
+    	for (int j = 0; j < ph->h_length; j++) {
+			sprintf(digtxt, "%d.", (unsigned char) ph->h_addr_list[i][j]);
+			strncat(buffer, digtxt, (buflen-1)-strlen(buffer));
+		}	
+		buffer[strlen(buffer)-1] = '\0';
+		if (ph->h_addr_list[i+1] != 0)
+			strncat(buffer, ", ", (buflen-1)-strlen(buffer));
+    }
+	if (strlen(buffer)<512) // just in case it would be bigger then our buffer
+	{
+		if (old_buflen!=0)//first time old_buflen=0
+		{
+			if (strcmp(buffer,old_buffer)!=0) //ip changed
+			{
+				if (m_server->SockConnected())
+				{
+					// if connected restart
+					m_server->SockConnect(false);
+					m_server->SockConnect(true);
+				}
+			}
+		}
+	old_buflen=strlen(buffer);
+	strncpy(old_buffer,buffer,strlen(buffer));
+	}
+}
+
+void
+vncMenu::SendTrayMsg(DWORD msg, BOOL flash)
+{
+	// adzm 2009-07-05
+	omni_mutex_lock sync(m_mutexTrayIcon);
+
+	// Create the tray icon message
+	m_nid.hWnd = m_hwnd;
+	m_nid.cbSize = sizeof(m_nid);
+	m_nid.uID = IDI_WINVNC;			// never changes after construction	
+	m_nid.hIcon = flash ? m_flash_icon : m_winvnc_icon;
+	m_nid.uFlags = NIF_ICON | NIF_MESSAGE |NIF_STATE;
+	m_nid.uCallbackMessage = WM_TRAYNOTIFY;
+	if (m_server->GetDisableTrayIcon())
+	{
+	m_nid.dwState = NIS_HIDDEN;
+	m_nid.dwStateMask = NIS_HIDDEN;
+	}
+	else
+	{
+		m_nid.dwState = 0;
+		m_nid.dwStateMask = NIS_HIDDEN;
+
+	}
+
+	// adzm 2009-07-05 - Tray icon balloon tips
+
+	if (m_BalloonInfo && (strlen(m_BalloonInfo) > 0)) {
+		m_nid.uFlags |= NIF_INFO;
+		strncpy(m_nid.szInfo, m_BalloonInfo, 255);
+		m_nid.szInfo[255] = '\0';
+
+		if (m_BalloonTitle && (strlen(m_BalloonTitle) > 0)) {
+			strncpy(m_nid.szInfoTitle, m_BalloonTitle, 63);
+			m_nid.szInfoTitle[63] = '\0';
+		} else {
+			strcpy(m_nid.szInfoTitle, "Remote Connection");
+		}
+
+		m_nid.uTimeout=10000; // minimum
+		m_nid.dwInfoFlags=NIIF_INFO;
+	}
+	
+	if (m_BalloonInfo) {		
+		free(m_BalloonInfo);
+		m_BalloonInfo = NULL;
+	}
+	if (m_BalloonTitle) {
+		free(m_BalloonTitle);
+		m_BalloonTitle = NULL;
+	}
+
+	//vnclog.Print(LL_INTINFO, VNCLOG("SendTRaymesg\n"));
+
+	// Use resource string as tip if there is one
+	// [v1.0.2-jp1 fix]
+	//if (LoadString(hAppInstance, IDI_WINVNC, m_nid.szTip, sizeof(m_nid.szTip)))
+	if (LoadString(hInstResDLL, IDI_WINVNC, m_nid.szTip, sizeof(m_nid.szTip)))
+	{
+	    m_nid.uFlags |= NIF_TIP;
+	}
+	
+	// Try to add the server's IP addresses to the tip string, if possible
+	if (m_nid.uFlags & NIF_TIP)
+	{
+	    strncat(m_nid.szTip, " - ", (sizeof(m_nid.szTip)-1)-strlen(m_nid.szTip));
+
+	    if (m_server->SockConnected())
+	    {
+		unsigned long tiplen = strlen(m_nid.szTip);
+		char *tipptr = ((char *)&m_nid.szTip) + tiplen;
+
+		GetIPAddrString(tipptr, sizeof(m_nid.szTip) - tiplen);
+	    }
+	    else
+	    {
+		strncat(m_nid.szTip, "Not listening", (sizeof(m_nid.szTip)-1)-strlen(m_nid.szTip));
+	    }
+	}
+
+	char namebuf[256];
+
+    if (gethostname(namebuf, 256) == 0) {
+		strncat(m_nid.szTip, " - ", strlen(" - "));
+		strncat(m_nid.szTip, namebuf, strlen(namebuf));
+    }
+
+	if (vncService::RunningAsService())
+	{
+		strncat(m_nid.szTip, " - service", strlen(" - service"));
+	}
+	else
+	{
+		strncat(m_nid.szTip, " - application", strlen(" - application"));
+	}
+
+//	vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call\n"));
+	// Send the message
+	if ((msg == NIM_MODIFY) && (IsIconSet == FALSE)) return; //no icon to modify
+	if ((msg ==NIM_ADD) && (IsIconSet != FALSE)) return; //no icon to set
+	if (msg == NIM_DELETE)
+	{
+		IsIconSet=false;
+		IconFaultCounter=0;
+	}
+	if (Shell_NotifyIcon(msg, &m_nid))
+	{
+//			vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call SUCCESS\n"));
+			// Set the enabled/disabled state of the menu items
+			//		vnclog.Print(LL_INTINFO, VNCLOG("tray icon added ok\n"));
+			EnableMenuItem(m_hmenu, ID_ADMIN_PROPERTIES,
+			m_properties.AllowProperties() ? MF_ENABLED : MF_GRAYED);
+			EnableMenuItem(m_hmenu, ID_PROPERTIES,
+			m_properties.AllowProperties() ? MF_ENABLED : MF_GRAYED);
+			EnableMenuItem(m_hmenu, ID_CLOSE,
+			m_properties.AllowShutdown() ? MF_ENABLED : MF_GRAYED);
+			EnableMenuItem(m_hmenu, ID_KILLCLIENTS,
+			m_properties.AllowEditClients() ? MF_ENABLED : MF_GRAYED);
+			EnableMenuItem(m_hmenu, ID_OUTGOING_CONN,
+			m_properties.AllowEditClients() ? MF_ENABLED : MF_GRAYED);
+			if (vncService::RunningAsService() && !vncService::IsInstalled())
+			{
+				//service is already disabled, but this winvnc was still started from the service
+				vncService::RunningFromExternalService(false);
+			}
+			EnableMenuItem(m_hmenu, ID_CLOSE_SERVICE,(vncService::RunningAsService()&&m_properties.AllowShutdown()) ? MF_ENABLED : MF_GRAYED);
+			EnableMenuItem(m_hmenu, ID_START_SERVICE,(vncService::IsInstalled() && !vncService::RunningAsService() && m_properties.AllowShutdown()) ? MF_ENABLED : MF_GRAYED);
+			EnableMenuItem(m_hmenu, ID_RUNASSERVICE,(!vncService::IsInstalled() &&!vncService::RunningAsService() && m_properties.AllowShutdown()) ? MF_ENABLED : MF_GRAYED);
+			EnableMenuItem(m_hmenu, ID_UNINSTALL_SERVICE,(vncService::IsInstalled()&&m_properties.AllowShutdown()) ? MF_ENABLED : MF_GRAYED);
+			EnableMenuItem(m_hmenu, ID_REBOOTSAFEMODE,(vncService::RunningAsService()&&m_properties.AllowShutdown()) ? MF_ENABLED : MF_GRAYED);
+			EnableMenuItem(m_hmenu, ID_REBOOT_FORCE,(vncService::RunningAsService()&&m_properties.AllowShutdown()) ? MF_ENABLED : MF_GRAYED);
+			OSVERSIONINFO OSversion;	
+			OSversion.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+			GetVersionEx(&OSversion);
+			/*if(OSversion.dwMajorVersion>=6 && m_properties.AllowShutdown() && vncService::RunningAsService())
+			{
+				if (OSversion.dwMinorVersion==0) //Vista
+				{
+					if (ISUACENabled() && !IsSoftwareCadEnabled())//ok
+					{
+						RemoveMenu(m_hmenu, ID_DELSOFTWARECAD, MF_BYCOMMAND);
+						RemoveMenu(m_hmenu, ID_SOFTWARECAD, MF_BYCOMMAND);
+					}
+					if (!ISUACENabled() && IsSoftwareCadEnabled())
+					{
+						RemoveMenu(m_hmenu, ID_DELSOFTWARECAD, MF_BYCOMMAND);
+						RemoveMenu(m_hmenu, ID_SOFTWARECAD, MF_BYCOMMAND);
+					}
+					if (!ISUACENabled() && !IsSoftwareCadEnabled())
+					{
+						RemoveMenu(m_hmenu, ID_DELSOFTWARECAD, MF_BYCOMMAND);
+						GetSubMenu(m_hmenu,ID_SOFTWARECAD);
+					}
+					if (ISUACENabled() && IsSoftwareCadEnabled())
+					{
+						RemoveMenu(m_hmenu, ID_SOFTWARECAD, MF_BYCOMMAND);
+						GetSubMenu(m_hmenu,ID_DELSOFTWARECAD);
+					}
+
+				}
+				else  //WIN7
+				{
+					EnableMenuItem(m_hmenu, ID_SOFTWARECAD,(vncService::RunningAsService()&&m_properties.AllowShutdown()&&!IsSoftwareCadEnabled()) ? MF_ENABLED : MF_GRAYED);
+					if (IsSoftwareCadEnabled()) RemoveMenu(m_hmenu, ID_SOFTWARECAD, MF_BYCOMMAND);
+					RemoveMenu(m_hmenu, ID_DELSOFTWARECAD, MF_BYCOMMAND);
+				}
+			}
+			else */
+			{
+				RemoveMenu(m_hmenu, ID_DELSOFTWARECAD, MF_BYCOMMAND);
+				RemoveMenu(m_hmenu, ID_SOFTWARECAD, MF_BYCOMMAND);
+			}
+
+
+			// adzm 2009-07-05
+			if (SPECIAL_SC_PROMPT) {
+				RemoveMenu(m_hmenu, ID_ADMIN_PROPERTIES, MF_BYCOMMAND);
+
+				RemoveMenu(m_hmenu, ID_CLOSE_SERVICE, MF_BYCOMMAND);
+				RemoveMenu(m_hmenu, ID_START_SERVICE, MF_BYCOMMAND);
+				RemoveMenu(m_hmenu, ID_RUNASSERVICE, MF_BYCOMMAND);
+				RemoveMenu(m_hmenu, ID_UNINSTALL_SERVICE, MF_BYCOMMAND);
+				RemoveMenu(m_hmenu, ID_REBOOTSAFEMODE, MF_BYCOMMAND);
+				RemoveMenu(m_hmenu, ID_REBOOT_FORCE, MF_BYCOMMAND);
+				RemoveMenu(m_hmenu, ID_SOFTWARECAD, MF_BYCOMMAND);
+				RemoveMenu(m_hmenu, ID_DELSOFTWARECAD, MF_BYCOMMAND);
+			}
+
+			if (msg == NIM_ADD)
+			{
+				IsIconSet=true;
+				IconFaultCounter=0;
+				vnclog.Print(LL_INTINFO, VNCLOG("IsIconSet \n"));
+			}
+
+	} else {
+
+//		vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call FAILED ( %u ) \n"), 0);
+		if (!vncService::RunningAsService())
+		{
+//			//vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call FAILED NOT runasservice\n"));
+			if (msg == NIM_ADD)
+			{
+				// The tray icon couldn't be created, so use the Properties dialog
+				// as the main program window
+				if (!m_server->RunningFromExternalService()) // sf at 2007 - Do not display Properties pages when running in Application0 mode
+				{
+//					vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::SendTrayMsg - Shell_NotifyIcon call FAILED NOT runfromexternalservice\n"));
+					//vnclog.Print(LL_INTINFO, VNCLOG("opening dialog box\n"));
+					m_properties.ShowAdmin(TRUE, TRUE);
+					PostQuitMessage(0);
+				}
+			}
+		}
+		else
+		{
+			if (msg == NIM_ADD)
+			{
+			IsIconSet=false;
+			IconFaultCounter++;
+			m_server->TriggerUpdate();
+			vnclog.Print(LL_INTINFO, VNCLOG("Failed IsIconSet \n"));
+			}
+		}
+	}
+}
+
+
+// sf at 2007
+void vncMenu::Shutdown(bool kill_client)
+{
+	vnclog.Print(LL_INTERR, VNCLOG("vncMenu::Shutdown: Close menu - Disconnect all - Shutdown server\n"));
+//	m_server->AutoRestartFlag(TRUE);
+//	m_server->KillAuthClients();
+//	m_server->KillSockConnect();
+//	m_server->ShutdownServer();
+	SendMessage(m_hwnd, WM_CLOSE, 0, 0);
+	if (kill_client) m_server->KillAuthClients();
+}
+
+extern BOOL G_HTTP;
+
+char newuser[UNLEN+1];
+// Process window messages
+LRESULT CALLBACK vncMenu::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
+{
+	// This is a static method, so we don't know which instantiation we're 
+	// dealing with. We use Allen Hadden's (ahadden at taratec.com) suggestion 
+	// from a newsgroup to get the pseudo-this.
+     vncMenu *_this = helper::SafeGetWindowUserData<vncMenu>(hwnd);
+	//	Beep(100,10);
+	//	vnclog.Print(LL_INTINFO, VNCLOG("iMsg 0x%x \n"),iMsg);
+
+	 if (iMsg==WM_TASKBARCREATED)
+	 {
+		 if (_this->m_server->RunningFromExternalService())
+			{
+				Sleep(1000);
+				vnclog.Print(LL_INTINFO,
+				VNCLOG("WM_TASKBARCREATED \n"));
+				// User has changed!
+				strcpy(_this->m_username, newuser);
+				vnclog.Print(LL_INTINFO,
+				VNCLOG("############## Kill vncMenu thread\n"));
+				// Order impersonation thread killing
+				KillTimer(hwnd,1);
+				PostQuitMessage(0);
+			}
+	 }
+
+	switch (iMsg)
+	{
+
+	// Every five seconds, a timer message causes the icon to update
+	case WM_TIMER:
+		// sf at 2007 - Can't get the WTS_CONSOLE_CONNECT message work properly for now..
+		// So use a hack instead
+#ifdef ULTRAVNC_ITALC_SUPPORT
+		break;
+#endif
+        // jdp reread some ini settings
+        _this->m_properties.ReloadDynamicSettings();
+
+		// G_1111==true --> reconnect
+		if (G_1111==true)
+		{
+			if (_this->IsIconSet==true)
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("Add client reconnect from timer\n"));
+				G_1111=false;
+				PostMessage(hwnd,MENU_ADD_CLIENT_MSG,1111,1111);
+			}
+		}
+
+
+		vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::TIMER TrayIcon 5s hack\n"));
+
+		if (_this->m_server->RunningFromExternalService())
+			{
+				strcpy(newuser,"");
+				if (vncService::CurrentUser((char *) &newuser, sizeof(newuser)))
+				{
+					// Check whether the user name has changed!
+					if (_stricmp(newuser, _this->m_username) != 0 || _this->IconFaultCounter>2)
+					{
+						Sleep(1000);
+						vnclog.Print(LL_INTINFO,
+						VNCLOG("user name has changed\n"));
+						// User has changed!
+						strcpy(_this->m_username, newuser);
+						vnclog.Print(LL_INTINFO,
+						VNCLOG("############## Kill vncMenu thread\n"));
+						// Order impersonation thread killing
+						PostQuitMessage(0);
+						break;
+					}
+				}
+			}
+
+		// *** HACK for running servicified
+		if (vncService::RunningAsService())
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("########### vncMenu::TIMER TrayIcon 5s hack call - Runningasservice\n"));
+				// Attempt to add the icon if it's not already there
+				_this->AddTrayIcon();
+				// Trigger a check of the current user
+				PostMessage(hwnd, WM_USERCHANGED, 0, 0);
+			}
+		// Update the icon
+		_this->FlashTrayIcon(_this->m_server->AuthClientCount() != 0);
+		break;
+
+		// DEAL WITH NOTIFICATIONS FROM THE SERVER:
+	case WM_SRV_CLIENT_AUTHENTICATED:
+	case WM_SRV_CLIENT_DISCONNECT:
+		// Adjust the icon accordingly
+		_this->FlashTrayIcon(_this->m_server->AuthClientCount() != 0);
+
+		if (_this->m_server->AuthClientCount() != 0) {
+			// adzm - 2010-07 - Disable more effects or font smoothing
+			if (IsUserDesktop()) {
+				if (_this->m_server->RemoveWallpaperEnabled())
+					KillWallpaper();
+				if (_this->m_server->RemoveEffectsEnabled())
+					KillEffects();
+				if (_this->m_server->RemoveFontSmoothingEnabled())
+					KillFontSmoothing();
+			}
+			if (_this->m_server->RemoveAeroEnabled()) // Moved, redundant if //PGM @ Advantig
+				DisableAero(); // Moved, redundant if //PGM @ Advantig
+		} else {
+			if (_this->m_server->RemoveAeroEnabled()) // Moved, redundant if //PGM @ Advantig
+				ResetAero(); // Moved, redundant if //PGM @ Advantig
+			if (_this->m_server->RemoveWallpaperEnabled()) { // Added { //PGM @ Advantig
+				Sleep(2000); // Added 2 second delay to help wallpaper restore //PGM @ Advantig
+				RestoreWallpaper();
+			} //PGM @ Advantig
+			// adzm - 2010-07 - Disable more effects or font smoothing
+			if (_this->m_server->RemoveEffectsEnabled()) {
+				RestoreEffects();
+			}
+			if (_this->m_server->RemoveFontSmoothingEnabled()) {
+				RestoreFontSmoothing();
+			}
+		}
+//PGM @ Advantig		if (_this->m_server->AuthClientCount() != 0) {
+//PGM @ Advantig			if (_this->m_server->RemoveAeroEnabled())
+//PGM @ Advantig				DisableAero();
+//PGM @ Advantig		} else {
+//PGM @ Advantig			if (_this->m_server->RemoveAeroEnabled())
+//PGM @ Advantig				ResetAero();
+//PGM @ Advantig		}
+		return 0;
+
+		// STANDARD MESSAGE HANDLING
+	case WM_CREATE:
+		WM_TASKBARCREATED = RegisterWindowMessage("TaskbarCreated");
+		return 0;
+
+	case WM_COMMAND:
+		// User has clicked an item on the tray menu
+		switch (LOWORD(wParam))
+		{
+		case ID_DEFAULT_PROPERTIES:
+			// Show the default properties dialog, unless it is already displayed
+			vnclog.Print(LL_INTINFO, VNCLOG("show default properties requested\n"));
+			_this->m_properties.ShowAdmin(TRUE, FALSE);
+			_this->FlashTrayIcon(_this->m_server->AuthClientCount() != 0);
+			break;
+		
+		case ID_PROPERTIES:
+			// Show the properties dialog, unless it is already displayed
+			vnclog.Print(LL_INTINFO, VNCLOG("show user properties requested\n"));
+			_this->m_propertiesPoll.Show(TRUE, TRUE);
+			_this->FlashTrayIcon(_this->m_server->AuthClientCount() != 0);
+			break;
+
+        case ID_ADMIN_PROPERTIES:
+			// Show the properties dialog, unless it is already displayed
+			vnclog.Print(LL_INTINFO, VNCLOG("show user properties requested\n"));
+			_this->m_properties.ShowAdmin(TRUE, TRUE);
+			_this->FlashTrayIcon(_this->m_server->AuthClientCount() != 0);
+			break;
+		
+		case ID_OUTGOING_CONN:
+			// Connect out to a listening VNC viewer
+			{
+				vncConnDialog *newconn = new vncConnDialog(_this->m_server);
+				if (newconn)
+				{
+					newconn->DoDialog();
+					// delete newconn; // NO ! Already done in vncConnDialog.
+				}
+			}
+			break;
+
+		case ID_KILLCLIENTS:
+			// Disconnect all currently connected clients
+			vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_KILLCLIENTS \n"));
+			_this->m_server->KillAuthClients();
+			break;
+
+		// sf at 2002
+		case ID_LISTCLIENTS:
+			_this->m_ListDlg.Display();
+			break;
+
+		case ID_ABOUT:
+			// Show the About box
+			_this->m_about.Show(TRUE);
+			break;
+
+		case ID_VISITUSONLINE_HOMEPAGE:
+			{
+						HANDLE hProcess,hPToken;
+						DWORD id=GetExplorerLogonPid();
+						if (id!=0) 
+						{
+							hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+							if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+													|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+													|TOKEN_READ|TOKEN_WRITE,&hPToken)) break;
+
+							char dir[MAX_PATH];
+							char exe_file_name[MAX_PATH];
+							GetModuleFileName(0, exe_file_name, MAX_PATH);
+							strcpy(dir, exe_file_name);
+							strcat(dir, " -openhomepage");
+				
+							{
+								STARTUPINFO          StartUPInfo;
+								PROCESS_INFORMATION  ProcessInfo;
+								ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+								ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+								StartUPInfo.wShowWindow = SW_SHOW;
+								StartUPInfo.lpDesktop = "Winsta0\\Default";
+								StartUPInfo.cb = sizeof(STARTUPINFO);
+						
+								CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+								GetLastError();
+                                if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+                                if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+								//if (error==1314)
+								//	{
+								//		Open_homepage();
+								//	}
+
+							}
+						}
+			}
+			break;
+
+		case ID_VISITUSONLINE_FORUM:
+			{
+						HANDLE hProcess,hPToken;
+						DWORD id=GetExplorerLogonPid();
+						if (id!=0) 
+						{
+							hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+							if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+													|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+													|TOKEN_READ|TOKEN_WRITE,&hPToken)) break;
+
+							char dir[MAX_PATH];
+							char exe_file_name[MAX_PATH];
+							GetModuleFileName(0, exe_file_name, MAX_PATH);
+							strcpy(dir, exe_file_name);
+							strcat(dir, " -openforum");
+				
+							{
+								STARTUPINFO          StartUPInfo;
+								PROCESS_INFORMATION  ProcessInfo;
+								ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+								ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+								StartUPInfo.wShowWindow = SW_SHOW;
+								StartUPInfo.lpDesktop = "Winsta0\\Default";
+								StartUPInfo.cb = sizeof(STARTUPINFO);
+						
+								CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+								GetLastError();
+                                if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+                                if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+								//if (error==1314)
+								//	{
+								//		Open_forum();
+								//	}
+
+							}
+						}
+			}
+			break;
+
+		case ID_CLOSE:
+			// User selected Close from the tray menu
+			fShutdownOrdered=TRUE;
+			Sleep(1000);
+			vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_CLOSE \n"));
+			_this->m_server->KillAuthClients();
+			PostMessage(hwnd, WM_CLOSE, 0, 0);
+			break;
+		case ID_SOFTWARECAD:
+			{
+			HANDLE hProcess,hPToken;
+			DWORD id=GetExplorerLogonPid();
+				if (id!=0) 
+				{
+					hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+					if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+											|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+											|TOKEN_READ|TOKEN_WRITE,&hPToken)) break;
+
+					char dir[MAX_PATH];
+					char exe_file_name[MAX_PATH];
+					GetModuleFileName(0, exe_file_name, MAX_PATH);
+					strcpy(dir, exe_file_name);
+					strcat(dir, " -softwarecadhelper");
+		
+					{
+					STARTUPINFO          StartUPInfo;
+					PROCESS_INFORMATION  ProcessInfo;
+					HANDLE Token=NULL;
+					HANDLE process=NULL;
+					ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+					ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+					StartUPInfo.wShowWindow = SW_SHOW;
+					StartUPInfo.lpDesktop = "Winsta0\\Default";
+					StartUPInfo.cb = sizeof(STARTUPINFO);
+			
+					CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+					DWORD errorcode=GetLastError();
+					if (process) CloseHandle(process);
+					if (Token) CloseHandle(Token);
+					if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+					if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+					if (errorcode==1314)
+					{
+						Enable_softwareCAD_elevated();
+					}
+
+					}
+				}
+			}
+			break;
+
+		case ID_DELSOFTWARECAD:
+			{
+			HANDLE hProcess,hPToken;
+			DWORD id=GetExplorerLogonPid();
+				if (id!=0) 
+				{
+					hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+					if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+											|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+											|TOKEN_READ|TOKEN_WRITE,&hPToken)) break;
+
+					char dir[MAX_PATH];
+					char exe_file_name[MAX_PATH];
+					GetModuleFileName(0, exe_file_name, MAX_PATH);
+					strcpy(dir, exe_file_name);
+					strcat(dir, " -delsoftwarecadhelper");
+		
+					{
+					STARTUPINFO          StartUPInfo;
+					PROCESS_INFORMATION  ProcessInfo;
+					HANDLE Token=NULL;
+					HANDLE process=NULL;
+					ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+					ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+					StartUPInfo.wShowWindow = SW_SHOW;
+					StartUPInfo.lpDesktop = "Winsta0\\Default";
+					StartUPInfo.cb = sizeof(STARTUPINFO);
+			
+					CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+					DWORD errorcode=GetLastError();
+					if (process) CloseHandle(process);
+					if (Token) CloseHandle(Token);
+					if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+					if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+					if (errorcode==1314)
+					{
+						delete_softwareCAD_elevated();
+					}
+
+					}
+				}
+			}
+			break;
+
+		case ID_REBOOTSAFEMODE:
+			{
+			HANDLE hProcess,hPToken;
+			DWORD id=GetExplorerLogonPid();
+				if (id!=0) 
+				{
+					hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+					if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+											|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+											|TOKEN_READ|TOKEN_WRITE,&hPToken)) break;
+
+					char dir[MAX_PATH];
+					char exe_file_name[MAX_PATH];
+					GetModuleFileName(0, exe_file_name, MAX_PATH);
+					strcpy(dir, exe_file_name);
+					strcat(dir, " -rebootsafemodehelper");
+		
+					{
+					STARTUPINFO          StartUPInfo;
+					PROCESS_INFORMATION  ProcessInfo;
+					HANDLE Token=NULL;
+					HANDLE process=NULL;
+					ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+					ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+					StartUPInfo.wShowWindow = SW_SHOW;
+					StartUPInfo.lpDesktop = "Winsta0\\Default";
+					StartUPInfo.cb = sizeof(STARTUPINFO);
+			
+					CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+					DWORD errorcode=GetLastError();
+					if (process) CloseHandle(process);
+					if (Token) CloseHandle(Token);
+					if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+					if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+					if (errorcode==1314)
+					{
+						Reboot_in_safemode_elevated();
+					}
+
+					}
+				}
+			}
+			break;
+
+		case ID_REBOOT_FORCE:
+			{
+			HANDLE hProcess,hPToken;
+			DWORD id=GetExplorerLogonPid();
+				if (id!=0) 
+				{
+					hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+					if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+											|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+											|TOKEN_READ|TOKEN_WRITE,&hPToken)) break;
+
+					char dir[MAX_PATH];
+					char exe_file_name[MAX_PATH];
+					GetModuleFileName(0, exe_file_name, MAX_PATH);
+					strcpy(dir, exe_file_name);
+					strcat(dir, " -rebootforcedehelper");
+		
+					{
+					STARTUPINFO          StartUPInfo;
+					PROCESS_INFORMATION  ProcessInfo;
+					HANDLE Token=NULL;
+					HANDLE process=NULL;
+					ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+					ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+					StartUPInfo.wShowWindow = SW_SHOW;
+					StartUPInfo.lpDesktop = "Winsta0\\Default";
+					StartUPInfo.cb = sizeof(STARTUPINFO);
+			
+					CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+					DWORD errorcode=GetLastError();
+					if (process) CloseHandle(process);
+					if (Token) CloseHandle(Token);
+					if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+					if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+					if (errorcode==1314)
+					{
+						 Reboot_with_force_reboot_elevated();
+					}
+
+					}
+				}
+			}
+			break;
+
+		case ID_UNINSTALL_SERVICE:
+			{
+			HANDLE hProcess,hPToken;
+			DWORD id=GetExplorerLogonPid();
+				if (id!=0) 
+				{
+					hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+					if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+											|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+											|TOKEN_READ|TOKEN_WRITE,&hPToken)) break;
+
+					char dir[MAX_PATH];
+					char exe_file_name[MAX_PATH];
+					GetModuleFileName(0, exe_file_name, MAX_PATH);
+					strcpy(dir, exe_file_name);
+					strcat(dir, " -uninstallhelper");
+		
+					{
+					STARTUPINFO          StartUPInfo;
+					PROCESS_INFORMATION  ProcessInfo;
+					HANDLE Token=NULL;
+					HANDLE process=NULL;
+					ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+					ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+					StartUPInfo.wShowWindow = SW_SHOW;
+					StartUPInfo.lpDesktop = "Winsta0\\Default";
+					StartUPInfo.cb = sizeof(STARTUPINFO);
+			
+					CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+					DWORD errorcode=GetLastError();
+					if (process) CloseHandle(process);
+					if (Token) CloseHandle(Token);
+					if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+					if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+					if (errorcode==1314)
+					{
+						Set_uninstall_service_as_admin();
+					}
+
+					}
+					/*fShutdownOrdered=TRUE;
+					vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_CLOSE \n"));
+					_this->m_server->KillAuthClients();					
+					PostMessage(hwnd, WM_CLOSE, 0, 0);*/
+				}
+			}
+			break;
+		case ID_RUNASSERVICE:
+			{
+			HANDLE hProcess,hPToken;
+			DWORD id=GetExplorerLogonPid();
+				if (id!=0) 
+				{
+					hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+					if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+											|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+											|TOKEN_READ|TOKEN_WRITE,&hPToken)) break;
+
+					char dir[MAX_PATH];
+					char exe_file_name[MAX_PATH];
+					GetModuleFileName(0, exe_file_name, MAX_PATH);
+					strcpy(dir, exe_file_name);
+					strcat(dir, " -installhelper");
+		
+
+					STARTUPINFO          StartUPInfo;
+					PROCESS_INFORMATION  ProcessInfo;
+					HANDLE Token=NULL;
+					HANDLE process=NULL;
+					ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+					ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+					StartUPInfo.wShowWindow = SW_SHOW;
+					StartUPInfo.lpDesktop = "Winsta0\\Default";
+					StartUPInfo.cb = sizeof(STARTUPINFO);
+			
+					CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+					DWORD error=GetLastError();
+					if (process) CloseHandle(process);
+					if (Token) CloseHandle(Token);
+					if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+					if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+					if (error==1314)
+					{
+						Set_install_service_as_admin();
+					}
+				}
+			fShutdownOrdered=TRUE;
+			Sleep(1000);
+			vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_CLOSE \n"));
+			_this->m_server->KillAuthClients();
+			PostMessage(hwnd, WM_CLOSE, 0, 0);
+			}
+			break;
+		case ID_CLOSE_SERVICE:
+			{
+			HANDLE hProcess,hPToken;
+			DWORD id=GetExplorerLogonPid();
+				if (id!=0) 
+				{
+					hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+					if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+											|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+											|TOKEN_READ|TOKEN_WRITE,&hPToken))
+					{
+						CloseHandle(hProcess);
+						break;
+					}
+
+					char dir[MAX_PATH];
+					char exe_file_name[MAX_PATH];
+					GetModuleFileName(0, exe_file_name, MAX_PATH);
+					strcpy(dir, exe_file_name);
+					strcat(dir, " -stopservicehelper");
+		
+
+					STARTUPINFO          StartUPInfo;
+					PROCESS_INFORMATION  ProcessInfo;
+					HANDLE Token=NULL;
+					HANDLE process=NULL;
+					ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+					ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+					StartUPInfo.wShowWindow = SW_SHOW;
+					StartUPInfo.lpDesktop = "Winsta0\\Default";
+					StartUPInfo.cb = sizeof(STARTUPINFO);
+			
+					CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+					DWORD error=GetLastError();
+					if (process) CloseHandle(process);
+					if (Token) CloseHandle(Token);
+					if (hProcess) CloseHandle(hProcess);
+					if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+					if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+					if (error==1314)
+					{
+						Set_stop_service_as_admin();
+					}
+				}
+			}
+			break;
+		case ID_START_SERVICE:
+			{
+			HANDLE hProcess,hPToken;
+			DWORD id=GetExplorerLogonPid();
+				if (id!=0) 
+				{
+					hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+					if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+											|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+											|TOKEN_READ|TOKEN_WRITE,&hPToken))
+					{
+						CloseHandle(hProcess);
+						break;
+					}
+
+					char dir[MAX_PATH];
+					char exe_file_name[MAX_PATH];
+					GetModuleFileName(0, exe_file_name, MAX_PATH);
+					strcpy(dir, exe_file_name);
+					strcat(dir, " -startservicehelper");
+		
+
+					STARTUPINFO          StartUPInfo;
+					PROCESS_INFORMATION  ProcessInfo;
+					HANDLE Token=NULL;
+					HANDLE process=NULL;
+					ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+					ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+					StartUPInfo.wShowWindow = SW_SHOW;
+					StartUPInfo.lpDesktop = "Winsta0\\Default";
+					StartUPInfo.cb = sizeof(STARTUPINFO);
+			
+					CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+					DWORD error=GetLastError();
+					if (hPToken) CloseHandle(hPToken);
+					if (process) CloseHandle(process);
+					if (Token) CloseHandle(Token);
+					if (hProcess) CloseHandle(hProcess);
+					if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+					if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+					if (error==1314)
+					{
+						Set_start_service_as_admin();
+					}
+					fShutdownOrdered=TRUE;
+					Sleep(1000);
+					vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_CLOSE \n"));
+					_this->m_server->KillAuthClients();
+					PostMessage(hwnd, WM_CLOSE, 0, 0);
+				}
+			}
+			break;
+
+		}
+		return 0;
+
+	case WM_TRAYNOTIFY:
+		// User has clicked on the tray icon or the menu
+		{
+			// Get the submenu to use as a pop-up menu
+			HMENU submenu = GetSubMenu(_this->m_hmenu, 0);
+
+			// What event are we responding to, RMB click?
+			if (lParam==WM_RBUTTONUP)
+			{
+				if (submenu == NULL)
+				{ 
+					vnclog.Print(LL_INTERR, VNCLOG("no submenu available\n"));
+					return 0;
+				}
+
+				// Make the first menu item the default (bold font)
+				SetMenuDefaultItem(submenu, 0, TRUE);
+				
+				// Get the current cursor position, to display the menu at
+				POINT mouse;
+				GetCursorPos(&mouse);
+
+				// There's a "bug"
+				// (Microsoft calls it a feature) in Windows 95 that requires calling
+				// SetForegroundWindow. To find out more, search for Q135788 in MSDN.
+				//
+				SetForegroundWindow(_this->m_nid.hWnd);
+
+				// Display the menu at the desired position
+				TrackPopupMenu(submenu,
+						0, mouse.x, mouse.y, 0,
+						_this->m_nid.hWnd, NULL);
+
+                PostMessage(hwnd, WM_NULL, 0, 0);
+
+				return 0;
+			}
+			
+			// Or was there a LMB double click?
+			if (lParam==WM_LBUTTONDBLCLK)
+			{
+				// double click: execute first menu item
+				SendMessage(_this->m_nid.hWnd,
+							WM_COMMAND, 
+							GetMenuItemID(submenu, 0),
+							0);
+			}
+
+			return 0;
+		}
+		
+	case WM_CLOSE:
+		
+		// Only accept WM_CLOSE if the logged on user has AllowShutdown set
+		// Error this clock the service restart.
+		/*if (!_this->m_properties.AllowShutdown())
+		{
+			return 0;
+		}*/
+		// tnatsni Wallpaper fix
+		if (_this->m_server->RemoveWallpaperEnabled())
+			RestoreWallpaper();
+		// adzm - 2010-07 - Disable more effects or font smoothing
+		if (_this->m_server->RemoveEffectsEnabled())
+			RestoreEffects();
+		if (_this->m_server->RemoveFontSmoothingEnabled())
+			RestoreFontSmoothing();
+		if (_this->m_server->RemoveAeroEnabled())
+			ResetAero();
+
+		vnclog.Print(LL_INTERR, VNCLOG("vncMenu WM_CLOSE call - All cleanup done\n"));
+		Sleep(2000);
+		DestroyWindow(hwnd);
+		break;
+		
+	case WM_DESTROY:
+		// The user wants WinVNC to quit cleanly...
+		vnclog.Print(LL_INTINFO, VNCLOG("quitting from WM_DESTROY\n"));
+		PostQuitMessage(0);
+		return 0;
+		
+	case WM_QUERYENDSESSION:
+		{
+			//shutdown or reboot
+			if((lParam & ENDSESSION_LOGOFF) != ENDSESSION_LOGOFF)
+			{
+				fShutdownOrdered=TRUE;
+				Sleep(1000);
+				vnclog.Print(LL_INTERR, VNCLOG("SHUTDOWN OS detected\n"));
+				vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_CLOSE \n"));
+				_this->m_server->OS_Shutdown=true;
+				_this->m_server->KillAuthClients();				
+				PostMessage(hwnd, WM_CLOSE, 0, 0);
+				break;
+			}
+
+
+			DWORD SessionID;
+			SessionID=GetCurrentSessionID();
+			vnclog.Print(LL_INTERR, VNCLOG("Session ID %i\n"),SessionID);
+			if (SessionID!=0)
+			{
+				fShutdownOrdered=TRUE;
+				Sleep(1000);
+				vnclog.Print(LL_INTERR, VNCLOG("WM_QUERYENDSESSION session!=0\n"));
+				vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() ID_CLOSE \n"));
+				_this->m_server->KillAuthClients();				
+				PostMessage(hwnd, WM_CLOSE, 0, 0);
+			}
+		}	
+		break;
+		
+	case WM_ENDSESSION:
+		vnclog.Print(LL_INTERR, VNCLOG("WM_ENDSESSION\n"));
+		break;
+
+	case WM_USERCHANGED:
+		// The current user may have changed.
+		{
+			strcpy(newuser,"");
+
+			if (vncService::CurrentUser((char *) &newuser, sizeof(newuser)))
+			{
+				vnclog.Print(LL_INTINFO,
+					VNCLOG("############### Usernames change: old=\"%s\", new=\"%s\"\n"),
+					_this->m_username, newuser);
+
+				// Check whether the user name has changed!
+				if (_stricmp(newuser, _this->m_username) != 0)
+				{
+					vnclog.Print(LL_INTINFO,
+						VNCLOG("user name has changed\n"));
+
+					// User has changed!
+					strcpy(_this->m_username, newuser);
+
+					// Redraw the tray icon and set it's state
+					_this->DelTrayIcon();
+					_this->AddTrayIcon();
+					_this->FlashTrayIcon(_this->m_server->AuthClientCount() != 0);
+					// We should load in the prefs for the new user
+					if (_this->m_properties.m_fUseRegistry)
+					{
+						_this->m_properties.Load(TRUE);
+						_this->m_propertiesPoll.Load(TRUE);
+					}
+					else
+					{
+						_this->m_properties.LoadFromIniFile();
+						_this->m_propertiesPoll.LoadFromIniFile();
+					}
+				}
+			}
+		}
+		return 0;
+
+	// [v1.0.2-jp1 fix] Don't show IME toolbar on right click menu.
+	case WM_INITMENU:
+	case WM_INITMENUPOPUP:
+		SendMessage(ImmGetDefaultIMEWnd(hwnd), WM_IME_CONTROL, IMC_CLOSESTATUSWINDOW, 0);
+		return 0;
+
+	default:
+		// Deal with any of our custom message types		
+		// wa at 2005 -- added support for the AutoReconnectId
+		// removed the previous code that used 999,999
+		if ( iMsg == MENU_STOP_RECONNECT_MSG )
+		{
+			_this->m_server->AutoReconnect(false);
+		}
+		if ( iMsg == MENU_STOP_ALL_RECONNECT_MSG )
+		{
+			_this->m_server->StopReconnectAll();
+		}
+		if ( iMsg == MENU_AUTO_RECONNECT_MSG )
+		{
+			char szId[MAX_PATH] = {0};
+			UINT ret = 0;
+			if ( lParam != 0 )
+			{
+				ret = GlobalGetAtomName( (ATOM)lParam, szId, sizeof( szId ) );
+				GlobalDeleteAtom( (ATOM)lParam );
+			}
+			_this->m_server->AutoReconnect(true);
+			
+			if ( ret > 0 )
+				_this->m_server->AutoReconnectId(szId);
+			
+			return 0;
+		}
+		if ( iMsg == MENU_REPEATER_ID_MSG )
+ 		{
+			char szId[MAX_PATH] = {0};
+			UINT ret = 0;
+			if ( lParam != 0 )
+			{
+				ret = GlobalGetAtomName( (ATOM)lParam, szId, sizeof( szId ) );
+				GlobalDeleteAtom( (ATOM)lParam );
+			}
+			_this->m_server->IdReconnect(true);
+			
+			if ( ret > 0 )
+				_this->m_server->AutoReconnectId(szId);
+			
+			return 0;
+		}
+
+
+		if (iMsg == MENU_ADD_CLIENT_MSG || iMsg == MENU_ADD_CLIENT_MSG_INIT)
+		{
+
+			if (iMsg == MENU_ADD_CLIENT_MSG_INIT) 
+				_this->m_server->AutoReconnectAdr("");
+
+			// Add Client message.  This message includes an IP address
+			// of a listening client, to which we should connect.
+
+			//adzm 2009-06-20 - Check for special add repeater client message
+			if (wParam == 0xFFFFFFFF && (ULONG) lParam == 0xFFFFFFFF) {
+				vncConnDialog *newconn = new vncConnDialog(_this->m_server);
+				if (newconn)
+				{
+					if (IDOK != newconn->DoDialog()) {
+						if (SPECIAL_SC_PROMPT && _this->m_server->AuthClientCount() == 0 && _this->m_server->UnauthClientCount() == 0) {
+							PostMessage(hwnd, WM_COMMAND, ID_CLOSE, 0);
+						}
+					}
+				}
+				return 0;
+			}
+
+			// If there is no IP address then show the connection dialog
+			if (!lParam) {
+				vncConnDialog *newconn = new vncConnDialog(_this->m_server);
+				if (newconn)
+				{
+					newconn->DoDialog();
+					// winvnc -connect fixed
+					//CHECH memeory leak
+					//			delete newconn;
+				}
+				return 0;
+			}
+
+			unsigned short nport = 0;
+			char *nameDup = 0;
+			char szAdrName[64];
+			char szId[MAX_PATH] = {0};
+			// sf at 2003 - Values are already converted
+
+			if (_this->m_server->m_retry_timeout!=0 && !fShutdownOrdered) Sleep(5000);
+
+
+			if ((_this->m_server->AutoReconnect()|| _this->m_server->IdReconnect() )&& strlen(_this->m_server->AutoReconnectAdr()) > 0)
+			{
+				struct in_addr address;
+				nport = _this->m_server->AutoReconnectPort();
+				VCard32 ipaddress = VSocket::Resolve(_this->m_server->AutoReconnectAdr());
+				unsigned long ipaddress_long=ipaddress;
+				address.S_un.S_addr = ipaddress_long;
+				char *name = inet_ntoa(address);
+				if (name == 0)
+					return 0;
+				nameDup = _strdup(name);
+				if (nameDup == 0)
+					return 0;
+				strcpy(szAdrName, nameDup);
+				// Free the duplicate name
+				if (nameDup != 0) free(nameDup);
+			}
+			else
+			{
+				// Get the IP address stringified
+				struct in_addr address;
+				address.S_un.S_addr = lParam;
+				char *name = inet_ntoa(address);
+				if (name == 0)
+					return 0;
+				nameDup = _strdup(name);
+				if (nameDup == 0)
+					return 0;
+				strcpy(szAdrName, nameDup);
+				// Free the duplicate name
+				if (nameDup != 0) free(nameDup);
+
+				// Get the port number
+				nport = (unsigned short)wParam;
+				if (nport == 0)
+					nport = INCOMING_PORT_OFFSET;
+				
+			}
+
+			// wa at 2005 -- added support for the AutoReconnectId
+			// (but it's not required)
+			bool bId = ( strlen(_this->m_server->AutoReconnectId() ) > 0);
+			if ( bId )
+				strcpy( szId, _this->m_server->AutoReconnectId() );
+			
+			// sf at 2003
+			// Stores the client adr/ports the first time we try to connect
+			// This way we can call this message again later to reconnect with the same values
+			if ((_this->m_server->AutoReconnect() || _this->m_server->IdReconnect())&& strlen(_this->m_server->AutoReconnectAdr()) == 0)
+			{
+				if (strlen(dnsname)>0) _this->m_server->AutoReconnectAdr(dnsname);
+				else 
+				_this->m_server->AutoReconnectAdr(szAdrName);
+				strcpy(dnsname,"");
+
+				_this->m_server->AutoReconnectPort(nport);
+			}
+
+			if (_this->m_server->AutoReconnect())
+			{
+				_this->m_server->AutoConnectRetry();
+			}
+			else
+			{
+				// Attempt to create a new socket
+				VSocket *tmpsock;
+				tmpsock = new VSocket;
+				if (tmpsock) {
+
+					// Connect out to the specified host on the VNCviewer listen port
+					if (G_HTTP)
+					{
+						if (tmpsock->Http_CreateConnect(szAdrName))
+						{
+							if ( bId )
+							{
+							// wa at 2005 -- added support for the AutoReconnectId
+							// Set the ID for this client -- code taken from vncconndialog.cpp (ln:142)
+							tmpsock->Send(szId,250);
+							tmpsock->SetTimeout(0);
+						
+							// adzm 2009-07-05 - repeater IDs
+							// Add the new client to this server
+							// adzm 2009-08-02
+							_this->m_server->AddClient(tmpsock, TRUE, TRUE, 0, NULL, szId, szAdrName, nport);
+							} else {
+							// Add the new client to this server
+							// adzm 2009-08-02
+							_this->m_server->AddClient(tmpsock, TRUE, TRUE, 0, NULL, NULL, szAdrName, nport);
+							}
+						}
+						else
+						{
+							tmpsock->Create();
+							if (tmpsock->Connect(szAdrName, nport)) {
+							if ( bId )
+								{
+									// wa at 2005 -- added support for the AutoReconnectId
+									// Set the ID for this client -- code taken from vncconndialog.cpp (ln:142)
+									tmpsock->Send(szId,250);
+									tmpsock->SetTimeout(0);
+						
+									// adzm 2009-07-05 - repeater IDs
+									// Add the new client to this server
+									// adzm 2009-08-02
+									_this->m_server->AddClient(tmpsock, TRUE, TRUE, 0, NULL, szId, szAdrName, nport);
+								} else {
+									// Add the new client to this server
+									// adzm 2009-08-02
+									_this->m_server->AddClient(tmpsock, TRUE, TRUE, 0, NULL, NULL, szAdrName, nport);
+								}
+							} else {
+								delete tmpsock;
+							}
+						}
+
+					}
+					else
+					{
+					tmpsock->Create();
+					if (tmpsock->Connect(szAdrName, nport)) {
+						if ( bId )
+						{
+							// wa at 2005 -- added support for the AutoReconnectId
+							// Set the ID for this client -- code taken from vncconndialog.cpp (ln:142)
+							tmpsock->Send(szId,250);
+							tmpsock->SetTimeout(0);
+						
+							// adzm 2009-07-05 - repeater IDs
+							// Add the new client to this server
+							// adzm 2009-08-02
+							_this->m_server->AddClient(tmpsock, TRUE, TRUE, 0, NULL, szId, szAdrName, nport);
+						} else {
+							// Add the new client to this server
+							// adzm 2009-08-02
+							_this->m_server->AddClient(tmpsock, TRUE, TRUE, 0, NULL, NULL, szAdrName, nport);
+						}
+					} else {
+						delete tmpsock;
+					}
+					}
+				}
+			}
+		
+			return 0;
+		}
+
+		// Process FileTransfer asynchronous Send Packet Message
+		if (iMsg == FileTransferSendPacketMessage) 
+		{
+		  vncClient* pClient = (vncClient*) wParam;
+		  if (_this->m_server->IsClient(pClient)) pClient->SendFileChunk();
+		}
+
+		// adzm 2009-07-05 - Tray icon balloon tips
+		if (iMsg == MENU_TRAYICON_BALLOON_MSG) {
+			try {
+				omni_mutex_lock sync(_this->m_mutexTrayIcon);
+
+				// adzm 2009-07-05 - Tray icon balloon tips
+				if (_this->m_BalloonInfo) {		
+					free(_this->m_BalloonInfo);
+					_this->m_BalloonInfo = NULL;
+				}
+				if (_this->m_BalloonTitle) {
+					free(_this->m_BalloonTitle);
+					_this->m_BalloonTitle = NULL;
+				}
+
+				char* szInfo = (char*)wParam;
+				char* szTitle = (char*)lParam;
+				
+				if (szInfo && (strlen(szInfo) > 0) ) {
+					_this->m_BalloonInfo = _strdup(szInfo);
+				}
+				if (szTitle && (strlen(szTitle) > 0) ) {
+					_this->m_BalloonTitle = _strdup(szTitle);
+				}
+
+				if (szInfo) {
+					free(szInfo);
+				}
+				if (szTitle) {
+					free(szTitle);
+				}
+
+				if (_this->IsIconSet) {
+					_this->SendTrayMsg(NIM_MODIFY, _this->m_nid.hIcon == _this->m_winvnc_icon ? FALSE : TRUE);
+				}
+			} catch (...) {
+				// just in case
+				vnclog.Print(LL_INTWARN,
+					VNCLOG("Warning: exception handling balloon message\n"));
+			}
+		}
+	}
+
+	// Message not recognised
+	return DefWindowProc(hwnd, iMsg, wParam, lParam);
+}
+
+// adzm 2009-07-05 - Tray icon balloon tips
+BOOL vncMenu::NotifyBalloon(char* szInfo, char* szTitle)
+{
+	char* szInfoCopy = _strdup(szInfo); // TOFIX memory leak;
+	char* szTitleCopy = _strdup(szTitle);
+
+	//adzm 2010-02-10 - Only posts to the same process
+	BOOL returnvalue= PostToThisWinVNC(MENU_TRAYICON_BALLOON_MSG, (WPARAM)szInfoCopy, (LPARAM)szTitleCopy);
+	if (returnvalue==FALSE)
+	{
+			if (szInfoCopy) {
+				free(szInfoCopy);
+			}
+			if (szTitleCopy) {
+				free(szTitleCopy);
+			}
+	}
+	return returnvalue;
+}
diff --git a/ica/win32/winvnc/winvnc/vncmenu.h b/ica/win32/winvnc/winvnc/vncmenu.h
new file mode 100644
index 0000000..88b79da
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncmenu.h
@@ -0,0 +1,140 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncMenu
+
+// This class handles creation of a system-tray icon & menu
+
+class vncMenu;
+
+#if (!defined(_WINVNC_VNCMENU))
+#define _WINVNC_VNCMENU
+
+#include "stdhdrs.h"
+#include <lmcons.h>
+#include "vncserver.h"
+#include "vncproperties.h"
+#include "vncpropertiesPoll.h"
+#include "vncabout.h"
+#include "vncListDlg.h"
+
+// Constants
+extern const UINT MENU_ADD_CLIENT_MSG;
+extern const UINT MENU_ADD_CLIENT_MSG_INIT;
+extern const UINT MENU_AUTO_RECONNECT_MSG;
+extern const UINT MENU_STOP_RECONNECT_MSG;
+extern const UINT MENU_STOP_ALL_RECONNECT_MSG;
+extern const UINT MENU_REPEATER_ID_MSG;
+// adzm 2009-07-05 - Tray icon balloon tips
+extern const UINT MENU_TRAYICON_BALLOON_MSG;
+extern const char *MENU_CLASS_NAME;
+
+// WTS Stuff for FastUserSwitching management
+typedef BOOL (WINAPI *WTSREGISTERSESSIONNOTIFICATION)(HWND, DWORD);
+typedef BOOL (WINAPI *WTSUNREGISTERSESSIONNOTIFICATION)(HWND);
+#define WM_WTSSESSION_CHANGE            0x02B1
+#define WTS_CONSOLE_CONNECT                0x1
+#define WTS_CONSOLE_DISCONNECT             0x2
+#define WTS_REMOTE_CONNECT                 0x3
+#define WTS_REMOTE_DISCONNECT              0x4
+#define WTS_SESSION_LOGON                  0x5
+#define WTS_SESSION_LOGOFF                 0x6
+#define WTS_SESSION_LOCK                   0x7
+#define WTS_SESSION_UNLOCK                 0x8
+#define WTS_SESSION_REMOTE_CONTROL         0x9
+#define NOTIFY_FOR_THIS_SESSION     0
+
+extern const UINT FileTransferSendPacketMessage;
+
+// The tray menu class itself
+class vncMenu
+{
+public:
+	vncMenu(vncServer *server);
+	~vncMenu();
+
+	void Shutdown(bool kill_client); // sf at 2007
+
+	// adzm 2009-07-05 - Tray icon balloon tips
+	static BOOL NotifyBalloon(char* szInfo, char* szTitle);
+
+protected:
+	// Tray icon handling
+	void AddTrayIcon();
+	void DelTrayIcon();
+	void FlashTrayIcon(BOOL flash);
+	void SendTrayMsg(DWORD msg, BOOL flash);
+	void GetIPAddrString(char *buffer, int buflen);
+
+	// Message handler for the tray window
+	static LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
+
+	// Fields
+protected:
+	// Check that the password has been set
+	void CheckPassword();
+
+	// The server that this tray icon handles
+	vncServer		*m_server;
+
+	// Properties object for this server
+	vncProperties	m_properties;
+	vncPropertiesPoll	m_propertiesPoll;
+
+	// About dialog for this server
+	vncAbout		m_about;
+
+	// List of viewers
+	vncListDlg		m_ListDlg;
+
+	HWND			m_hwnd;
+	HMENU			m_hmenu;
+
+	NOTIFYICONDATA	m_nid;
+	omni_mutex		m_mutexTrayIcon; // adzm 2009-07-05
+	char*			m_BalloonInfo;
+	char*			m_BalloonTitle;
+
+	char			m_username[UNLEN+1];
+
+	// The icon handles
+	HICON			m_winvnc_icon;
+	HICON			m_flash_icon;
+
+	HINSTANCE   hWTSDll;
+	BOOL bConnectSock;
+	BOOL bAutoPort;
+	UINT port_rfb;
+	UINT port_http;
+	BOOL ports_set;
+
+	bool IsIconSet;
+	int IconFaultCounter;
+	//HANDLE hEvent;
+	OSVERSIONINFO	osvi;
+
+};
+
+
+#endif
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncntlm.cpp b/ica/win32/winvnc/winvnc/vncntlm.cpp
new file mode 100644
index 0000000..3cd8067
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncntlm.cpp
@@ -0,0 +1,1127 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "stdhdrs.h"
+#include "omnithread.h"
+#include <objbase.h>
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+// Marscha at 2004 - authSSP: from stdhdrs.h, required for logging
+#include "vnclog.h"
+extern VNCLog vnclog;
+#include "inifile.h"
+
+// Marscha at 2004 - authSSP: end of change
+
+#include "Localization.h" // Act : add localization on messages
+
+typedef BOOL (*CheckUserGroupPasswordFn)( char * userin,char *password,char *machine,char *group,int locdom);
+CheckUserGroupPasswordFn CheckUserGroupPassword = 0;
+
+int CheckUserGroupPasswordUni(char * userin,char *password,const char *machine);
+int CheckUserGroupPasswordUni2(char * userin,char *password,const char *machine);
+
+// Marscha at 2004 - authSSP: if "New MS-Logon" is checked, call CheckUserPasswordSDUni
+BOOL IsNewMSLogon();
+//char *AddToModuleDir(char *filename, int length);
+typedef int (*CheckUserPasswordSDUniFn)(const char * userin, const char *password, const char *machine);
+CheckUserPasswordSDUniFn CheckUserPasswordSDUni = 0;
+
+#define MAXSTRING 254
+
+const TCHAR REGISTRY_KEY [] = "Software\\UltraVnc";
+
+HKEY hkLocal=NULL;
+HKEY hkDefault=NULL;
+HKEY hkUser=NULL;
+
+void
+OpenRegistry()
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		DWORD dw;
+		if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+			REGISTRY_KEY,
+			0,REG_NONE, REG_OPTION_NON_VOLATILE,
+			KEY_READ,
+			NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+			return;
+		if (RegCreateKeyEx(hkLocal,
+			"mslogon",
+			0, REG_NONE, REG_OPTION_NON_VOLATILE,
+			KEY_WRITE | KEY_READ,
+			NULL, &hkDefault, &dw) != ERROR_SUCCESS)
+			return;
+	}
+}
+
+void
+CloseRegistry()
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		if (hkDefault != NULL) RegCloseKey(hkDefault);
+		if (hkUser != NULL) RegCloseKey(hkUser);
+		if (hkLocal != NULL) RegCloseKey(hkLocal);
+	}
+}
+
+LONG
+LoadInt(HKEY key, LPCSTR valname, LONG defval)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		LONG pref;
+		ULONG type = REG_DWORD;
+		ULONG prefsize = sizeof(pref);
+
+		if (RegQueryValueEx(key,
+			valname,
+			NULL,
+			&type,
+			(LPBYTE) &pref,
+			&prefsize) != ERROR_SUCCESS)
+			return defval;
+
+		if (type != REG_DWORD)
+			return defval;
+
+		if (prefsize != sizeof(pref))
+			return defval;
+
+		return pref;
+	}
+	else
+	{
+		return myIniFile.ReadInt("admin_auth", (char *)valname, defval);
+	}
+}
+
+TCHAR *
+LoadString(HKEY key, LPCSTR keyname)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		DWORD type = REG_SZ;
+		DWORD buflen = 256*sizeof(TCHAR);
+		TCHAR *buffer = 0;
+
+		// Get the length of the string
+		if (RegQueryValueEx(key,
+			keyname,
+			NULL,
+			&type,
+			NULL,
+			&buflen) != ERROR_SUCCESS)
+			return 0;
+
+		if (type != REG_BINARY)
+			return 0;
+		buflen = 256*sizeof(TCHAR);
+		buffer = new TCHAR[buflen];
+		if (buffer == 0)
+			return 0;
+
+		// Get the string data
+		if (RegQueryValueEx(key,
+			keyname,
+			NULL,
+			&type,
+			(BYTE*)buffer,
+			&buflen) != ERROR_SUCCESS) {
+			delete [] buffer;
+			return 0;
+		}
+
+		// Verify the type
+		if (type != REG_BINARY) {
+			delete [] buffer;
+			return 0;
+		}
+
+		return (TCHAR *)buffer;
+	}
+	else
+	{
+		TCHAR *authhosts=new char[150];
+		myIniFile.ReadString("admin_auth", (char *)keyname,authhosts,150);
+		return (TCHAR *)authhosts;
+	}
+}
+
+void
+SaveInt(HKEY key, LPCSTR valname, LONG val)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		RegSetValueEx(key, valname, 0, REG_DWORD, (LPBYTE) &val, sizeof(val));
+	}
+	else
+	{
+		myIniFile.WriteInt("admin_auth", (char *)valname, val);
+	}
+}
+
+void
+SaveString(HKEY key,LPCSTR valname, TCHAR *buffer)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		RegSetValueEx(key, valname, 0, REG_BINARY, (LPBYTE) buffer, MAXSTRING);
+	}
+	else
+	{
+		myIniFile.WriteString("admin_auth", (char *)valname,buffer);
+	}
+}
+
+void
+savegroup1(TCHAR *value)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveString(hkDefault, "group1", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveString(hkDefault, "group1", value);
+	}
+}
+TCHAR*
+Readgroup1()
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		TCHAR *value=NULL;
+		OpenRegistry();
+		if (hkDefault) value=LoadString (hkDefault, "group1");
+		CloseRegistry();
+		return value;
+	}
+	else
+	{
+		TCHAR *value=NULL;
+		value=LoadString (hkDefault, "group1");
+		return value;
+	}
+}
+
+void
+savegroup2(TCHAR *value)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveString(hkDefault, "group2", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveString(hkDefault, "group2", value);
+	}
+}
+TCHAR*
+Readgroup2()
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		TCHAR *value=NULL;
+		OpenRegistry();
+		if (hkDefault) value=LoadString (hkDefault, "group2");
+		CloseRegistry();
+		return value;
+	}
+	else
+	{
+		TCHAR *value=NULL;
+		value=LoadString (hkDefault, "group2");
+		return value;
+	}
+}
+
+void
+savegroup3(TCHAR *value)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveString(hkDefault, "group3", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveString(hkDefault, "group3", value);
+	}
+}
+TCHAR*
+Readgroup3()
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		TCHAR *value=NULL;
+		OpenRegistry();
+		if (hkDefault) value=LoadString (hkDefault, "group3");
+		CloseRegistry();
+		return value;
+	}
+	else
+	{
+		TCHAR *value=NULL;
+		value=LoadString (hkDefault, "group3");
+		return value;
+	}
+}
+
+LONG
+Readlocdom1(LONG returnvalue)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault) returnvalue=LoadInt(hkDefault, "locdom1",returnvalue);
+		CloseRegistry();
+		return returnvalue;
+	}
+	else
+	{
+		returnvalue=LoadInt(hkDefault, "locdom1",returnvalue);
+		return returnvalue;
+	}
+}
+
+void
+savelocdom1(LONG value)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveInt(hkDefault, "locdom1", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveInt(hkDefault, "locdom1", value);
+	}
+
+}
+
+LONG
+Readlocdom2(LONG returnvalue)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault) returnvalue=LoadInt(hkDefault, "locdom2",returnvalue);
+		CloseRegistry();
+		return returnvalue;
+	}
+	else
+	{
+		returnvalue=LoadInt(hkDefault, "locdom2",returnvalue);
+		return returnvalue;
+	}
+}
+
+void
+savelocdom2(LONG value)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveInt(hkDefault, "locdom2", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveInt(hkDefault, "locdom2", value);
+	}
+
+}
+
+LONG
+Readlocdom3(LONG returnvalue)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault) returnvalue=LoadInt(hkDefault, "locdom3",returnvalue);
+		CloseRegistry();
+		return returnvalue;
+	}
+	else
+	{
+		returnvalue=LoadInt(hkDefault, "locdom3",returnvalue);
+		return returnvalue;
+	}
+}
+
+void
+savelocdom3(LONG value)
+{
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	if (fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveInt(hkDefault, "locdom3", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveInt(hkDefault, "locdom3", value);
+	}
+
+}
+
+///////////////////////////////////////////////////////////
+bool CheckAD()
+{
+	HMODULE hModule = LoadLibrary("Activeds.dll");
+	if (hModule)
+	{
+		FreeLibrary(hModule);
+		return true;
+	}
+	return false;
+}
+
+bool CheckNetapi95()
+{
+	HMODULE hModule = LoadLibrary("netapi32.dll");
+	if (hModule)
+	{
+		FreeLibrary(hModule);
+		return true;
+	}
+	return false;
+}
+
+bool CheckDsGetDcNameW()
+{
+	HMODULE hModule = LoadLibrary("netapi32.dll");
+	if (hModule)
+	{
+		FARPROC test=NULL;
+		test=GetProcAddress( hModule, "DsGetDcNameW" );
+		FreeLibrary(hModule);
+		if (test) return true;
+	}
+	return false;
+}
+
+bool CheckNetApiNT()
+{
+	HMODULE hModule = LoadLibrary("radmin32.dll");
+	if (hModule)
+	{
+		FreeLibrary(hModule);
+		return true;
+	}
+	return false;
+}
+
+int CheckUserGroupPasswordUni(char * userin,char *password,const char *machine)
+{
+	int result = 0;
+	// Marscha at 2004 - authSSP: if "New MS-Logon" is checked, call CUPSD in authSSP.dll,
+	// else call "old" mslogon method.
+	if (IsNewMSLogon()){
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH)) {
+			char* p = strrchr(szCurrentDir, '\\');
+			*p = '\0';
+			strcat (szCurrentDir,"\\authSSP.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule) {
+
+			static omni_mutex authSSPMutex;
+			omni_mutex_lock l( authSSPMutex );
+
+			CheckUserPasswordSDUni = (CheckUserPasswordSDUniFn) GetProcAddress(hModule, "CUPSD");
+			vnclog.Print(LL_INTINFO, VNCLOG("GetProcAddress"));
+			/*HRESULT hr =*/ CoInitialize(NULL);
+			result = CheckUserPasswordSDUni(userin, password, machine);
+			vnclog.Print(LL_INTINFO, "CheckUserPasswordSDUni result=%i", result);
+			CoUninitialize();
+			FreeLibrary(hModule);
+			//result = CheckUserPasswordSDUni(userin, password, machine);
+		} else {
+			LPCTSTR sz_ID_AUTHSSP_NOT_FO = // to be moved to localization.h
+				"You selected ms-logon, but authSSP.dll\nwas not found.Check you installation";
+			MessageBoxSecure(NULL, sz_ID_AUTHSSP_NOT_FO, sz_ID_WARNING, MB_OK);
+		}
+	} else 
+		result = CheckUserGroupPasswordUni2(userin, password, machine);
+	return result;
+}
+
+int CheckUserGroupPasswordUni2(char * userin,char *password,const char *machine)
+{
+	int result=0;
+	BOOL NT4OS=false;
+	BOOL W2KOS=false;
+	char clientname[256];
+	strcpy_s(clientname,256,machine);
+	if (!CheckNetapi95() && !CheckNetApiNT())
+	{
+		return false;
+	}
+	OSVERSIONINFO VerInfo;
+	VerInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+	if (!GetVersionEx (&VerInfo))   // If this fails, something has gone wrong
+		{
+		  return FALSE;
+		}
+	if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && VerInfo.dwMajorVersion == 4)
+		{
+			NT4OS=true;
+		}
+	if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && VerInfo.dwMajorVersion >= 5)
+		{
+			W2KOS=true;
+		}
+	//////////////////////////////////////////////////
+	// Load reg settings
+	//////////////////////////////////////////////////
+	char pszgroup1[256];
+	char pszgroup2[256];
+	char pszgroup3[256];
+	char *group1=NULL;
+	char *group2=NULL;
+	char *group3=NULL;
+	long locdom1=1;
+	long locdom2=0;
+	long locdom3=0;
+	group1=Readgroup1();
+	group2=Readgroup2();
+	group3=Readgroup3();
+	locdom1=Readlocdom1(locdom1);
+	locdom2=Readlocdom2(locdom2);
+	locdom3=Readlocdom3(locdom3);
+	strcpy(pszgroup1,"VNCACCESS");
+	strcpy(pszgroup2,"Administrators");
+	strcpy(pszgroup3,"VNCVIEWONLY");
+	if (group1){strcpy(pszgroup1,group1);}
+	if (group2){strcpy(pszgroup2,group2);}
+	if (group3){strcpy(pszgroup3,group3);}
+
+	savegroup1(pszgroup1);
+	savegroup2(pszgroup2);
+	savegroup3(pszgroup3);
+	savelocdom1(locdom1);
+	savelocdom2(locdom2);
+	savelocdom3(locdom3);
+
+	if (group1){strcpy(pszgroup1,group1);delete group1;}
+	if (group2){strcpy(pszgroup2,group2);delete group2;}
+	if (group3){strcpy(pszgroup3,group3);delete group3;}
+
+	//////////////////////////////////////////////////
+	// logon user only works on NT>
+	// NT4/w2k only as service (system account)
+	// XP> works also as application
+	// Group is not used...admin access rights is needed
+	// MS keep changes there security model for each version....
+	//////////////////////////////////////////////////
+////////////////////////////////////////////////////
+if (strcmp(pszgroup1,"")==0 && strcmp(pszgroup2,"")==0 && strcmp(pszgroup3,"")==0)
+	if ( NT4OS || W2KOS){
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\authadmin.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup1,locdom1);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "authadmin.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+
+	}
+	if (result==1) goto accessOK;
+
+if (strcmp(pszgroup1,"")!=0)
+{
+	
+	///////////////////////////////////////////////////
+	// NT4 domain and workgroups
+	//
+	///////////////////////////////////////////////////
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\workgrpdomnt4.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup1,locdom1);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else
+			{
+				MessageBoxSecure(NULL, "workgrpdomnt4.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+
+	}
+	if (result==1) goto accessOK;
+	/////////////////////////////////////////////////////////////////
+	if (CheckAD() && W2KOS && (locdom1==2||locdom1==3))
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\ldapauth.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup1,locdom1);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "ldapauth.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+	}
+	if (result==1) goto accessOK;
+	//////////////////////////////////////////////////////////////////////
+	if (CheckAD() && NT4OS && CheckDsGetDcNameW() && (locdom1==2||locdom1==3))
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\ldapauthnt4.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup1,locdom1);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "ldapauthnt4.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+	}
+	if (result==1) goto accessOK;
+	//////////////////////////////////////////////////////////////////////
+	if (CheckAD() && !NT4OS && !W2KOS && (locdom1==2||locdom1==3))
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\ldapauth9x.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup1,locdom1);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "ldapauth9x.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+	}
+	if (result==1) goto accessOK;
+}
+/////////////////////////////////////////////////
+if (strcmp(pszgroup2,"")!=0)
+{
+	///////////////////////////////////////////////////
+	// NT4 domain and workgroups
+	//
+	///////////////////////////////////////////////////
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\workgrpdomnt4.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup2,locdom2);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "workgrpdomnt4.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+
+	}
+	if (result==1) goto accessOK;
+	//////////////////////////////////////////////////////
+	if ( NT4OS || W2KOS){
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\authadmin.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup2,locdom2);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "authadmin.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+
+	}
+	if (result==1) goto accessOK;
+	//////////////////////////////////////////////////////////////////
+	if (CheckAD() && W2KOS && (locdom2==2||locdom2==3))
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\ldapauth.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup2,locdom2);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "ldapauth.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+	}
+	if (result==1) goto accessOK;
+	///////////////////////////////////////////////////////////////////////
+	if (CheckAD() && NT4OS && CheckDsGetDcNameW() && (locdom2==2||locdom2==3))
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\ldapauthnt4.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup2,locdom2);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "ldapauthnt4.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+	}
+	if (result==1) goto accessOK;
+	///////////////////////////////////////////////////////////////////////
+	if (CheckAD() && !NT4OS && !W2KOS && (locdom2==2||locdom2==3))
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\ldapauth9x.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup2,locdom2);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "ldapauth9x.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+	}
+	if (result==1) goto accessOK;
+}
+////////////////////////////
+if (strcmp(pszgroup3,"")!=0)
+{
+	///////////////////////////////////////////////////
+	// NT4 domain and workgroups
+	//
+	///////////////////////////////////////////////////
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\workgrpdomnt4.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup3,locdom3);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "workgrpdomnt4.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+
+	}
+	if (result==1) goto accessOK;
+	////////////////////////////////////////////////////////
+	if ( NT4OS || W2KOS){
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\authadmin.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup3,locdom3);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "authadmin.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+
+	}
+	if (result==1) goto accessOK;
+	////////////////////////////////////////////////////////////////
+	if (CheckAD() && W2KOS && (locdom3==2||locdom3==3))
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\ldapauth.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup3,locdom3);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "ldapauth.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+	}
+	if (result==1) goto accessOK;
+	///////////////////////////////////////////////////////////////////
+	if (CheckAD() && NT4OS && CheckDsGetDcNameW() && (locdom3==2||locdom3==3))
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\ldapauthnt4.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup3,locdom3);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "ldapauthnt4.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+		}
+		if (result==1) goto accessOK2;
+		///////////////////////////////////////////////////////////////////
+	if (CheckAD() && !NT4OS && !W2KOS && (locdom3==2||locdom3==3))
+	{
+		char szCurrentDir[MAX_PATH];
+		if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+		{
+			char* p = strrchr(szCurrentDir, '\\');
+			if (p == NULL) return false;
+			*p = '\0';
+			strcat (szCurrentDir,"\\ldapauth9x.dll");
+		}
+		HMODULE hModule = LoadLibrary(szCurrentDir);
+		if (hModule)
+			{
+				CheckUserGroupPassword = (CheckUserGroupPasswordFn) GetProcAddress( hModule, "CUGP" );
+				/*HRESULT hr =*/ CoInitialize(NULL);
+				result=CheckUserGroupPassword(userin,password,clientname,pszgroup3,locdom3);
+				CoUninitialize();
+				FreeLibrary(hModule);
+			}
+		else 
+			{
+				MessageBoxSecure(NULL, "ldapauth9x.dll not found", sz_ID_WARNING, MB_OK);
+				result=0;
+			}
+		}
+		if (result==1) goto accessOK2;
+	}
+
+	/////////////////////////////////////////////////
+	// If we reach this place auth failed
+	/////////////////////////////////////////////////
+	{
+				typedef BOOL (*LogeventFn)(char *machine,char *user);
+				LogeventFn Logevent = 0;
+				char szCurrentDir[MAX_PATH];
+				if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+					{
+						char* p = strrchr(szCurrentDir, '\\');
+						*p = '\0';
+						strcat (szCurrentDir,"\\logging.dll");
+					}
+				HMODULE hModule = LoadLibrary(szCurrentDir);
+				if (hModule)
+					{
+						Logevent = (LogeventFn) GetProcAddress( hModule, "LOGFAILEDUSER" );
+						Logevent((char *)clientname,userin);
+						FreeLibrary(hModule);
+					}
+				return result;
+	}
+
+	accessOK://full access
+	{
+				typedef BOOL (*LogeventFn)(char *machine,char *user);
+				LogeventFn Logevent = 0;
+				char szCurrentDir[MAX_PATH];
+				if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+					{
+						char* p = strrchr(szCurrentDir, '\\');
+						*p = '\0';
+						strcat (szCurrentDir,"\\logging.dll");
+					}
+				HMODULE hModule = LoadLibrary(szCurrentDir);
+				if (hModule)
+					{
+						Logevent = (LogeventFn) GetProcAddress( hModule, "LOGLOGONUSER" );
+						Logevent((char *)clientname,userin);
+						FreeLibrary(hModule);
+					}
+				return result;
+	}
+
+	accessOK2://readonly
+	{
+				typedef BOOL (*LogeventFn)(char *machine,char *user);
+				LogeventFn Logevent = 0;
+				char szCurrentDir[MAX_PATH];
+				if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+					{
+						char* p = strrchr(szCurrentDir, '\\');
+						*p = '\0';
+						strcat (szCurrentDir,"\\logging.dll");
+					}
+				HMODULE hModule = LoadLibrary(szCurrentDir);
+				if (hModule)
+					{
+						Logevent = (LogeventFn) GetProcAddress( hModule, "LOGLOGONUSER" );
+						Logevent((char *)clientname,userin);
+						FreeLibrary(hModule);
+					}
+				result=2;
+	}
+
+	return result;
+}
+
+// Marscha at 2004 - authSSP: Is New MS-Logon activated?
+BOOL IsNewMSLogon(){
+	return TRUE;
+	HKEY hKLocal=NULL;
+	BOOL isNewMSLogon = FALSE;
+	LONG data;
+	ULONG type = REG_DWORD;
+	ULONG datasize = sizeof(data);
+	IniFile myIniFile;
+	BOOL fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+		
+	if (fUseRegistry)
+	{
+		if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+				"Software\\ORL\\WinVNC3",
+				0,
+				KEY_QUERY_VALUE,
+				&hKLocal) != ERROR_SUCCESS)
+				return false;
+			
+		if (RegQueryValueEx(hKLocal,
+				"NewMSLogon",
+				NULL,
+				&type,
+				(LPBYTE) &data,
+				&datasize) != ERROR_SUCCESS)
+				return false;
+			
+		if (type != REG_DWORD ||
+				datasize != sizeof(data))
+				return false;
+			
+		isNewMSLogon = data;
+		if (hKLocal != NULL) RegCloseKey(hKLocal);
+		return isNewMSLogon;
+	}
+	else
+	{
+		BOOL newmslogon=false;
+		newmslogon=myIniFile.ReadInt("admin", "NewMSLogon", newmslogon);
+		return newmslogon;
+	}
+
+}
diff --git a/ica/win32/winvnc/winvnc/vncpasswd.h b/ica/win32/winvnc/winvnc/vncpasswd.h
new file mode 100644
index 0000000..38e69a8
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncpasswd.h
@@ -0,0 +1,106 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncPasswd
+
+// This header provides helpers for handling encrypted password data.
+// The password handling routines found in vncauth.h should not be used directly
+
+class vncPasswd;
+
+#if (!defined(_WINVNC_VNCPASSWD))
+#define _WINVNC_VNCPASSWD
+
+#include "stdhdrs.h"
+#ifdef _MSC_VER
+extern "C" {
+#include "vncauth.h"
+}
+#else
+#include "vncauth.h"
+#endif
+
+// Password handling helper class
+class vncPasswd
+{
+public:
+
+    // Password decryptor!
+    class ToText
+    {
+    public:
+	inline ToText(const char encrypted[MAXPWLEN])
+	{
+	    vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : ToText called\n"));
+	    plaintext = vncDecryptPasswd((char *)encrypted);
+	}
+	inline ~ToText()
+	{
+	    if (plaintext != NULL)
+	    {
+		ZeroMemory(plaintext, strlen(plaintext));
+		free(plaintext);
+	    }
+	}
+	inline operator const char*() const {return plaintext;};
+    private:
+	char *plaintext;
+    };
+
+    class FromText
+    {
+    public:
+	inline FromText(char *unencrypted)
+	{
+	    vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : FromText called\n"));
+	    vncEncryptPasswd(unencrypted, encrypted);
+	    // ZeroMemory(unencrypted, strlen(unencrypted));
+	}
+	inline ~FromText()
+	{
+	}
+	inline operator const char*() const {return encrypted;};
+    private:
+	char encrypted[MAXPWLEN];
+    };
+
+    class FromClear
+    {
+    public:
+	inline FromClear()
+	{
+	    vnclog.Print(LL_INTINFO, VNCLOG("PASSWD : FromClear called\n"));
+	    vncEncryptPasswd((char*)"", encrypted);
+	}
+	inline ~FromClear()
+	{
+	}
+	inline operator const char*() const {return encrypted;};
+    private:
+	char encrypted[MAXPWLEN];
+    };
+};
+
+#endif
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncproperties.cpp b/ica/win32/winvnc/winvnc/vncproperties.cpp
new file mode 100644
index 0000000..67d87c8
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncproperties.cpp
@@ -0,0 +1,2612 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 TightVNC. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncProperties.cpp
+
+// Implementation of the Properties dialog!
+
+#include "stdhdrs.h"
+#include "lmcons.h"
+#include "vncservice.h"
+
+#include "winvnc.h"
+#include "vncproperties.h"
+#include "vncserver.h"
+#include "vncpasswd.h"
+#include "vncOSVersion.h"
+#include "common/win32_helpers.h"
+
+#include "Localization.h" // ACT : Add localization on messages
+
+//extern HINSTANCE g_hInst;
+
+bool RunningAsAdministrator ();
+const char WINVNC_REGISTRY_KEY [] = "Software\\ORL\\WinVNC3";
+
+// [v1.0.2-jp1 fix] Load resouce from dll
+extern HINSTANCE	hInstResDLL;
+
+// Marscha at 2004 - authSSP: Function pointer for dyn. linking
+typedef void (*vncEditSecurityFn) (HWND hwnd, HINSTANCE hInstance);
+vncEditSecurityFn vncEditSecurity = 0;
+DWORD GetExplorerLogonPid();
+// ethernet packet 1500 - 40 tcp/ip header - 8 PPPoE info
+//unsigned int G_SENDBUFFER=8192;
+unsigned int G_SENDBUFFER=1452;
+
+// Constructor & Destructor
+vncProperties::vncProperties()
+{
+    m_alloweditclients = TRUE;
+	m_allowproperties = TRUE;
+	m_allowshutdown = TRUE;
+	m_dlgvisible = FALSE;
+	m_usersettings = TRUE;
+	Lock_service_helper=TRUE;
+	m_fUseRegistry = FALSE;
+    m_ftTimeout = FT_RECV_TIMEOUT;
+    m_keepAliveInterval = KEEPALIVE_INTERVAL;
+	m_socketKeepAliveTimeout = SOCKET_KEEPALIVE_TIMEOUT; // adzm 2010-08
+	m_pref_Primary=true;
+	m_pref_Secondary=false;
+
+	m_pref_DSMPluginConfig[0] = '\0';
+}
+
+vncProperties::~vncProperties()
+{
+}
+
+
+BOOL CALLBACK
+DialogProc1(HWND hwnd,
+					 UINT uMsg,
+					 WPARAM wParam,
+					 LPARAM lParam )
+{
+	switch (uMsg)
+	{
+
+	case WM_INITDIALOG:
+		{
+
+			// Show the dialog
+			SetForegroundWindow(hwnd);
+
+			return TRUE;
+		}
+
+	case WM_COMMAND:
+		switch (LOWORD(wParam))
+		{
+
+		case IDCANCEL:
+		case IDOK:
+			EndDialog(hwnd, TRUE);
+			return TRUE;
+		}
+
+		break;
+
+	case WM_DESTROY:
+		EndDialog(hwnd, FALSE);
+		return TRUE;
+	}
+	return 0;
+}
+
+// Initialisation
+BOOL
+vncProperties::Init(vncServer *server)
+{
+	// Save the server pointer
+	m_server = server;
+
+	// sf at 2007 - Registry mode can still be forced for backward compatibility and OS version < Vista
+	m_fUseRegistry = TRUE;//((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+
+	// Load the settings
+	if (m_fUseRegistry)
+		Load(TRUE);
+	else
+		LoadFromIniFile();
+
+	// If the password is empty then always show a dialog
+	char passwd[MAXPWLEN];
+	m_server->GetPassword(passwd);
+	if(0){
+	    vncPasswd::ToText plain(passwd);
+	    if (strlen(plain) == 0)
+		{
+			 if (!m_allowproperties || !RunningAsAdministrator ()) {
+				if(m_server->AuthRequired()) {
+					MessageBoxSecure(NULL, sz_ID_NO_PASSWD_NO_OVERRIDE_ERR,
+								sz_ID_WINVNC_ERROR,
+								MB_OK | MB_ICONSTOP);
+					PostQuitMessage(0);
+				} else {
+					if (!vncService::RunningAsService())
+						MessageBoxSecure(NULL, sz_ID_NO_PASSWD_NO_OVERRIDE_WARN,
+								sz_ID_WINVNC_ERROR,
+								MB_OK | MB_ICONEXCLAMATION);
+				}
+			} else {
+				// If null passwords are not allowed, ensure that one is entered!
+				if (m_server->AuthRequired()) {
+					char username[UNLEN+1];
+					if (!vncService::CurrentUser(username, sizeof(username)))
+						return FALSE;
+					if (strcmp(username, "") == 0) {
+						Lock_service_helper=true;
+						MessageBoxSecure(NULL, sz_ID_NO_PASSWD_NO_LOGON_WARN,
+									sz_ID_WINVNC_ERROR,
+									MB_OK | MB_ICONEXCLAMATION);
+						ShowAdmin(TRUE, FALSE);
+						Lock_service_helper=false;
+					} else {
+						//Warning box removed, to ugly
+						//DialogBoxParam(hInstResDLL,MAKEINTRESOURCE(IDD_ABOUT1), NULL,(DLGPROC) DialogProc1,(LONG) this);
+						ShowAdmin(TRUE, TRUE);
+					}
+				}
+			}
+		}
+	}
+	Lock_service_helper=false;
+	return TRUE;
+}
+
+
+
+// Dialog box handling functions
+void
+vncProperties::ShowAdmin(BOOL show, BOOL usersettings)
+{
+//	if (Lock_service_helper) return;
+	HANDLE hProcess=NULL;
+	HANDLE hPToken=NULL;
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	DWORD id=GetExplorerLogonPid();
+#endif
+	int iImpersonateResult=0;
+	{
+		char WORKDIR[MAX_PATH];
+		if (!GetTempPath(MAX_PATH,WORKDIR))
+			{
+				//Function failed, just set something
+				if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+				{
+					char* p = strrchr(WORKDIR, '\\');
+					if (p == NULL) return;
+					*p = '\0';
+				}
+					strcpy(m_Tempfile,"");
+					strcat(m_Tempfile,WORKDIR);//set the directory
+					strcat(m_Tempfile,"\\");
+					strcat(m_Tempfile,INIFILE_NAME);
+		}
+		else
+		{
+			strcpy(m_Tempfile,"");
+			strcat(m_Tempfile,WORKDIR);//set the directory
+			strcat(m_Tempfile,INIFILE_NAME);
+		}
+	}
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	if (id!=0) 
+			{
+				hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+				if(OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+										|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+										|TOKEN_READ|TOKEN_WRITE,&hPToken))
+				{
+					ImpersonateLoggedOnUser(hPToken);
+					iImpersonateResult = GetLastError();
+					if(iImpersonateResult == ERROR_SUCCESS)
+					{
+						ExpandEnvironmentStringsForUser(hPToken, "%TEMP%", m_Tempfile, MAX_PATH);
+						strcat(m_Tempfile,"\\");
+						strcat(m_Tempfile,INIFILE_NAME);
+					}
+				}
+	}
+#endif
+
+	if (!m_allowproperties) 
+	{
+		if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+		if (hProcess) CloseHandle(hProcess);
+		if (hPToken) CloseHandle(hPToken);
+		return;
+	}
+	/*if (!RunningAsAdministrator ())
+		{
+		if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+		CloseHandle(hProcess);
+		CloseHandle(hPToken);
+		return;
+		}*/
+
+	if (m_fUseRegistry)
+	{
+		if (vncService::RunningAsService()) usersettings=false;
+		m_usersettings=usersettings;
+	}
+
+	if (show)
+	{
+
+		if (!m_fUseRegistry) // Use the ini file
+		{
+			// We're trying to edit the default local settings - verify that we can
+			/*if (!myIniFile.IsWritable())
+			{
+				if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+				CloseHandle(hProcess);
+				CloseHandle(hPToken);
+				return;
+			}*/
+		}
+		else // Use the registry
+		{
+			// Verify that we know who is logged on
+			if (usersettings)
+			{
+				char username[UNLEN+1];
+				if (!vncService::CurrentUser(username, sizeof(username)))
+					{
+						if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+						CloseHandle(hProcess);
+						CloseHandle(hPToken);
+						return;
+					}
+				if (strcmp(username, "") == 0) {
+					MessageBoxSecure(NULL, sz_ID_NO_CURRENT_USER_ERR, sz_ID_WINVNC_ERROR, MB_OK | MB_ICONEXCLAMATION);
+					if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+					CloseHandle(hProcess);
+					CloseHandle(hPToken);
+					return;
+				}
+			}
+			else
+			{
+				// We're trying to edit the default local settings - verify that we can
+				HKEY hkLocal=NULL;
+				HKEY hkDefault=NULL;
+				BOOL canEditDefaultPrefs = 1;
+				DWORD dw;
+				if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+					WINVNC_REGISTRY_KEY,
+					0, REG_NONE, REG_OPTION_NON_VOLATILE,
+					KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+					canEditDefaultPrefs = 0;
+				else if (RegCreateKeyEx(hkLocal,
+					"Default",
+					0, REG_NONE, REG_OPTION_NON_VOLATILE,
+					KEY_WRITE | KEY_READ, NULL, &hkDefault, &dw) != ERROR_SUCCESS)
+					canEditDefaultPrefs = 0;
+				if (hkLocal) RegCloseKey(hkLocal);
+				if (hkDefault) RegCloseKey(hkDefault);
+
+				if (!canEditDefaultPrefs) {
+					MessageBoxSecure(NULL, sz_ID_CANNOT_EDIT_DEFAULT_PREFS, sz_ID_WINVNC_ERROR, MB_OK | MB_ICONEXCLAMATION);
+					if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+					if (hProcess) CloseHandle(hProcess);
+					if (hPToken) CloseHandle(hPToken);
+					return;
+				}
+			}
+		}
+
+		// Now, if the dialog is not already displayed, show it!
+		if (!m_dlgvisible)
+		{
+			if (m_fUseRegistry) 
+			{
+				if (usersettings)
+					vnclog.Print(LL_INTINFO, VNCLOG("show per-user Properties\n"));
+				else
+					vnclog.Print(LL_INTINFO, VNCLOG("show default system Properties\n"));
+
+				// Load in the settings relevant to the user or system
+				//Load(usersettings);
+				m_usersettings=usersettings;
+			}
+
+			for (;;)
+			{
+				m_returncode_valid = FALSE;
+
+				// Do the dialog box
+				// [v1.0.2-jp1 fix]
+				//int result = DialogBoxParam(hAppInstance,
+				int result = DialogBoxParam(hInstResDLL,
+				    MAKEINTRESOURCE(IDD_PROPERTIES1), 
+				    NULL,
+				    (DLGPROC) DialogProc,
+				    (LONG_PTR) this);
+
+				if (!m_returncode_valid)
+				    result = IDCANCEL;
+
+				vnclog.Print(LL_INTINFO, VNCLOG("dialog result = %d\n"), result);
+
+				if (result == -1)
+				{
+					// Dialog box failed, so quit
+					PostQuitMessage(0);
+					if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+					CloseHandle(hProcess);
+					CloseHandle(hPToken);
+					return;
+				}
+
+				// We're allowed to exit if the password is not empty
+				char passwd[MAXPWLEN];
+				m_server->GetPassword(passwd);
+				{
+				    vncPasswd::ToText plain(passwd);
+				    if ((strlen(plain) != 0) || !m_server->AuthRequired())
+					break;
+				}
+
+				vnclog.Print(LL_INTERR, VNCLOG("warning - empty password\n"));
+#ifdef ULTRAVNC_ITALC_SUPPORT
+					break;
+#endif
+
+				// The password is empty, so if OK was used then redisplay the box,
+				// otherwise, if CANCEL was used, close down WinVNC
+				if (result == IDCANCEL)
+				{
+				    vnclog.Print(LL_INTERR, VNCLOG("no password - QUITTING\n"));
+				    PostQuitMessage(0);
+				    if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+					CloseHandle(hProcess);
+					CloseHandle(hPToken);
+					return;
+				}
+
+				// If we reached here then OK was used & there is no password!
+				MessageBoxSecure(NULL, sz_ID_NO_PASSWORD_WARN,
+				    sz_ID_WINVNC_WARNIN, MB_OK | MB_ICONEXCLAMATION);
+
+				omni_thread::sleep(4);
+			}
+
+			// Load in all the settings
+			// If you run as service, you reload the saved settings before they are actual saved
+			// via runas.....
+			if (!vncService::RunningAsService())
+			{
+			if (m_fUseRegistry) 
+				Load(TRUE);
+			else
+				LoadFromIniFile();
+			}
+
+		}
+	}
+	if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+	if (hProcess) CloseHandle(hProcess);
+	if (hPToken) CloseHandle(hPToken);
+}
+
+BOOL CALLBACK
+vncProperties::DialogProc(HWND hwnd,
+						  UINT uMsg,
+						  WPARAM wParam,
+						  LPARAM lParam )
+{
+	// We use the dialog-box's USERDATA to store a _this pointer
+	// This is set only once WM_INITDIALOG has been recieved, though!
+     vncProperties *_this = helper::SafeGetWindowUserData<vncProperties>(hwnd);
+
+	switch (uMsg)
+	{
+
+	case WM_INITDIALOG:
+		{			
+			vnclog.Print(LL_INTINFO, VNCLOG("INITDIALOG properties\n"));
+			// Retrieve the Dialog box parameter and use it as a pointer
+			// to the calling vncProperties object
+            helper::SafeSetWindowUserData(hwnd, lParam);
+
+			_this = (vncProperties *) lParam;
+			_this->m_dlgvisible = TRUE;
+			if (_this->m_fUseRegistry)
+			{
+				_this->Load(_this->m_usersettings);
+
+				// Set the dialog box's title to indicate which Properties we're editting
+				if (_this->m_usersettings) {
+					SetWindowText(hwnd, sz_ID_CURRENT_USER_PROP);
+				} else {
+					SetWindowText(hwnd, sz_ID_DEFAULT_SYST_PROP);
+				}
+			}
+			else
+			{
+				_this->LoadFromIniFile();
+			}
+
+			// Initialise the properties controls
+			HWND hConnectSock = GetDlgItem(hwnd, IDC_CONNECT_SOCK);
+
+			// Tight 1.2.7 method
+			BOOL bConnectSock = _this->m_server->SockConnected();
+			SendMessage(hConnectSock, BM_SETCHECK, bConnectSock, 0);
+
+			// Set the content of the password field to a predefined string.
+		    SetDlgItemText(hwnd, IDC_PASSWORD, "~~~~~~~~");
+			EnableWindow(GetDlgItem(hwnd, IDC_PASSWORD), bConnectSock);
+
+			// Set the content of the view-only password field to a predefined string. //PGM
+		    SetDlgItemText(hwnd, IDC_PASSWORD2, "~~~~~~~~"); //PGM
+			EnableWindow(GetDlgItem(hwnd, IDC_PASSWORD2), bConnectSock); //PGM
+
+			// Set the initial keyboard focus
+			if (bConnectSock)
+			{
+				SetFocus(GetDlgItem(hwnd, IDC_PASSWORD));
+				SendDlgItemMessage(hwnd, IDC_PASSWORD, EM_SETSEL, 0, (LPARAM)-1);
+			}
+			else
+				SetFocus(hConnectSock);
+			// Set display/ports settings
+			_this->InitPortSettings(hwnd);
+
+			HWND hConnectHTTP = GetDlgItem(hwnd, IDC_CONNECT_HTTP);
+			SendMessage(hConnectHTTP,
+				BM_SETCHECK,
+				_this->m_server->HTTPConnectEnabled(),
+				0);
+//			HWND hConnectXDMCP = GetDlgItem(hwnd, IDC_CONNECT_XDMCP);
+//			SendMessage(hConnectXDMCP,
+//				BM_SETCHECK,
+//				_this->m_server->XDMCPConnectEnabled(),
+//				0);
+
+			// Modif sf at 2002
+//		   HWND hSingleWindow = GetDlgItem(hwnd, IDC_SINGLE_WINDOW);
+//           SendMessage(hSingleWindow, BM_SETCHECK, _this->m_server->SingleWindow(), 0);
+
+		   // handler to get window name
+//           HWND hWindowName = GetDlgItem(hwnd, IDC_NAME_APPLI);
+//           if ( _this->m_server->GetWindowName() != NULL)
+//		   {
+  //             SetDlgItemText(hwnd, IDC_NAME_APPLI,_this->m_server->GetWindowName());
+    //       }
+    //     EnableWindow(hWindowName, _this->m_server->SingleWindow());
+
+		   // Modif sf at 2002 - v1.1.0
+		   HWND hFileTransfer = GetDlgItem(hwnd, IDC_FILETRANSFER);
+           SendMessage(hFileTransfer, BM_SETCHECK, _this->m_server->FileTransferEnabled(), 0);
+
+		   HWND hFileTransferUserImp = GetDlgItem(hwnd, IDC_FTUSERIMPERSONATION_CHECK);
+           SendMessage(hFileTransferUserImp, BM_SETCHECK, _this->m_server->FTUserImpersonation(), 0);
+		   
+		   HWND hBlank = GetDlgItem(hwnd, IDC_BLANK);
+           SendMessage(hBlank, BM_SETCHECK, _this->m_server->BlankMonitorEnabled(), 0);
+
+		   HWND hBlank2 = GetDlgItem(hwnd, IDC_BLANK2); //PGM
+           SendMessage(hBlank2, BM_SETCHECK, _this->m_server->BlankInputsOnly(), 0); //PGM
+
+		   HWND hAlpha = GetDlgItem(hwnd, IDC_ALPHA);
+           SendMessage(hAlpha, BM_SETCHECK, _this->m_server->CaptureAlphaBlending(), 0);
+		   HWND hAlphab = GetDlgItem(hwnd, IDC_ALPHABLACK);
+           SendMessage(hAlphab, BM_SETCHECK, _this->m_server->BlackAlphaBlending(), 0);
+
+		   // [v1.0.2-jp1 fix]
+//		   HWND hGammaGray = GetDlgItem(hwnd, IDC_GAMMAGRAY);
+//         SendMessage(hGammaGray, BM_SETCHECK, _this->m_server->GammaGray(), 0);
+		   
+		   HWND hLoopback = GetDlgItem(hwnd, IDC_ALLOWLOOPBACK);
+		   BOOL fLoopback = _this->m_server->LoopbackOk();
+		   SendMessage(hLoopback, BM_SETCHECK, fLoopback, 0);
+
+		   HWND hLoopbackonly = GetDlgItem(hwnd, IDC_LOOPBACKONLY);
+		   BOOL fLoopbackonly = _this->m_server->LoopbackOnly();
+		   SendMessage(hLoopbackonly, BM_SETCHECK, fLoopbackonly, 0);
+
+		   HWND hTrayicon = GetDlgItem(hwnd, IDC_DISABLETRAY);
+		   BOOL fTrayicon = _this->m_server->GetDisableTrayIcon();
+		   SendMessage(hTrayicon, BM_SETCHECK, fTrayicon, 0);
+
+		   HWND hAllowshutdown = GetDlgItem(hwnd, IDC_ALLOWSHUTDOWN);
+		   SendMessage(hAllowshutdown, BM_SETCHECK, !_this->m_allowshutdown , 0);
+
+		   HWND hm_alloweditclients = GetDlgItem(hwnd, IDC_ALLOWEDITCLIENTS);
+		   SendMessage(hm_alloweditclients, BM_SETCHECK, !_this->m_alloweditclients , 0);
+		   _this->m_server->SetAllowEditClients(_this->m_alloweditclients);
+		   
+
+		   if (vnclog.GetMode() >= 2)
+			   CheckDlgButton(hwnd, IDC_LOG, BST_CHECKED);
+		   else
+			   CheckDlgButton(hwnd, IDC_LOG, BST_UNCHECKED);
+
+#ifndef AVILOG
+		   ShowWindow (GetDlgItem(hwnd, IDC_CLEAR), SW_HIDE);
+		   ShowWindow (GetDlgItem(hwnd, IDC_VIDEO), SW_HIDE);
+#endif
+		   if (vnclog.GetVideo())
+		   {
+			   SetDlgItemText(hwnd, IDC_EDIT_PATH, vnclog.GetPath());
+			   EnableWindow(GetDlgItem(hwnd, IDC_EDIT_PATH), true);
+			   CheckDlgButton(hwnd, IDC_VIDEO, BST_CHECKED);
+		   }
+		   else
+		   {
+			   SetDlgItemText(hwnd, IDC_EDIT_PATH, vnclog.GetPath());
+			   EnableWindow(GetDlgItem(hwnd, IDC_EDIT_PATH), false);
+			   CheckDlgButton(hwnd, IDC_VIDEO, BST_UNCHECKED);
+		   }
+		   
+			// Marscha at 2004 - authSSP: moved MS-Logon checkbox back to admin props page
+			// added New MS-Logon checkbox
+			// only enable New MS-Logon checkbox and Configure MS-Logon groups when MS-Logon
+			// is checked.
+			HWND hMSLogon = GetDlgItem(hwnd, IDC_MSLOGON_CHECKD);
+			SendMessage(hMSLogon, BM_SETCHECK, _this->m_server->MSLogonRequired(), 0);
+
+			HWND hNewMSLogon = GetDlgItem(hwnd, IDC_NEW_MSLOGON);
+			SendMessage(hNewMSLogon, BM_SETCHECK, _this->m_server->GetNewMSLogon(), 0);
+
+			EnableWindow(GetDlgItem(hwnd, IDC_NEW_MSLOGON), _this->m_server->MSLogonRequired());
+			EnableWindow(GetDlgItem(hwnd, IDC_MSLOGON), _this->m_server->MSLogonRequired());
+			// Marscha at 2004 - authSSP: end of change
+
+		   SetDlgItemInt(hwnd, IDC_SCALE, _this->m_server->GetDefaultScale(), false);
+
+		   
+		   // Remote input settings
+			HWND hEnableRemoteInputs = GetDlgItem(hwnd, IDC_DISABLE_INPUTS);
+			SendMessage(hEnableRemoteInputs,
+				BM_SETCHECK,
+				!(_this->m_server->RemoteInputsEnabled()),
+				0);
+
+			// Local input settings
+			HWND hDisableLocalInputs = GetDlgItem(hwnd, IDC_DISABLE_LOCAL_INPUTS);
+			SendMessage(hDisableLocalInputs,
+				BM_SETCHECK,
+				_this->m_server->LocalInputsDisabled(),
+				0);
+
+			// japanese keybaord
+			HWND hJapInputs = GetDlgItem(hwnd, IDC_JAP_INPUTS);
+			SendMessage(hJapInputs,
+				BM_SETCHECK,
+				_this->m_server->JapInputEnabled(),
+				0);
+
+			// Remove the wallpaper
+			HWND hRemoveWallpaper = GetDlgItem(hwnd, IDC_REMOVE_WALLPAPER);
+			SendMessage(hRemoveWallpaper,
+				BM_SETCHECK,
+				_this->m_server->RemoveWallpaperEnabled(),
+				0);
+			// Remove the composit desktop
+			HWND hRemoveAero = GetDlgItem(hwnd, IDC_REMOVE_Aero);
+			SendMessage(hRemoveAero,
+				BM_SETCHECK,
+				_this->m_server->RemoveAeroEnabled(),
+				0);
+
+			// Lock settings
+			HWND hLockSetting;
+			switch (_this->m_server->LockSettings()) {
+			case 1:
+				hLockSetting = GetDlgItem(hwnd, IDC_LOCKSETTING_LOCK);
+				break;
+			case 2:
+				hLockSetting = GetDlgItem(hwnd, IDC_LOCKSETTING_LOGOFF);
+				break;
+			default:
+				hLockSetting = GetDlgItem(hwnd, IDC_LOCKSETTING_NOTHING);
+			};
+			SendMessage(hLockSetting,
+				BM_SETCHECK,
+				TRUE,
+				0);
+
+			HWND hmvSetting = 0;
+			switch (_this->m_server->ConnectPriority()) {
+			case 0:
+				hmvSetting = GetDlgItem(hwnd, IDC_MV1);
+				break;
+			case 1:
+				hmvSetting = GetDlgItem(hwnd, IDC_MV2);
+				break;
+			case 2:
+				hmvSetting = GetDlgItem(hwnd, IDC_MV3);
+				break;
+			case 3:
+				hmvSetting = GetDlgItem(hwnd, IDC_MV4);
+				break;
+			};
+			SendMessage(hmvSetting,
+				BM_SETCHECK,
+				TRUE,
+				0);
+
+
+			HWND hQuerySetting;
+			switch (_this->m_server->QueryAccept()) {
+			case 0:
+				hQuerySetting = GetDlgItem(hwnd, IDC_DREFUSE);
+				break;
+			case 1:
+				hQuerySetting = GetDlgItem(hwnd, IDC_DACCEPT);
+				break;
+			default:
+				hQuerySetting = GetDlgItem(hwnd, IDC_DREFUSE);
+			};
+			SendMessage(hQuerySetting,
+				BM_SETCHECK,
+				TRUE,
+				0);
+
+			// sf at 2002 - List available DSM Plugins
+			HWND hPlugins = GetDlgItem(hwnd, IDC_PLUGINS_COMBO);
+			int nPlugins = _this->m_server->GetDSMPluginPointer()->ListPlugins(hPlugins);
+			if (!nPlugins) 
+			{
+				SendMessage(hPlugins, CB_ADDSTRING, 0, (LPARAM) sz_ID_NO_PLUGIN_DETECT);
+				SendMessage(hPlugins, CB_SETCURSEL, 0, 0);
+			}
+			else
+				SendMessage(hPlugins, CB_SELECTSTRING, 0, (LPARAM)_this->m_server->GetDSMPluginName());
+
+			// Modif sf at 2002
+			HWND hUsePlugin = GetDlgItem(hwnd, IDC_PLUGIN_CHECK);
+			SendMessage(hUsePlugin,
+				BM_SETCHECK,
+				_this->m_server->IsDSMPluginEnabled(),
+				0);
+			HWND hButton = GetDlgItem(hwnd, IDC_PLUGIN_BUTTON);
+			EnableWindow(hButton, _this->m_server->IsDSMPluginEnabled());
+
+			// Query window option - Taken from TightVNC advanced properties 
+			HWND hQuery = GetDlgItem(hwnd, IDQUERY);
+			BOOL queryEnabled = (_this->m_server->QuerySetting() == 4);
+			SendMessage(hQuery, BM_SETCHECK, queryEnabled, 0);
+			HWND hQueryTimeout = GetDlgItem(hwnd, IDQUERYTIMEOUT);
+			EnableWindow(hQueryTimeout, queryEnabled);
+			EnableWindow(GetDlgItem(hwnd, IDC_DREFUSE), queryEnabled);
+			EnableWindow(GetDlgItem(hwnd, IDC_DACCEPT), queryEnabled);
+
+
+			char timeout[128];
+			UINT t = _this->m_server->QueryTimeout();
+			sprintf(timeout, "%d", (int)t);
+		    SetDlgItemText(hwnd, IDQUERYTIMEOUT, (const char *) timeout);
+
+			// 2006 - Patch from KP774 - disable some options depending on this OS version
+			// for Win9x, no user impersonation, no LockWorkstation
+			if(OSversion() == 4 || OSversion() == 5)
+			{
+				// Disable userimpersonation
+				_this->m_server->FTUserImpersonation(FALSE);
+				EnableWindow(hFileTransferUserImp, FALSE);
+				SendMessage(hFileTransferUserImp, BM_SETCHECK, FALSE, 0);
+
+				// Disable Lock Workstation
+				if(_this->m_server->LockSettings() == 1)
+				{
+					SendMessage(GetDlgItem(hwnd, IDC_LOCKSETTING_LOCK), BM_SETCHECK, FALSE, 0);
+					_this->m_server->SetLockSettings(0);
+					SendMessage(GetDlgItem(hwnd, IDC_LOCKSETTING_NOTHING), BM_SETCHECK, TRUE, 0);
+				}
+				EnableWindow(GetDlgItem(hwnd, IDC_LOCKSETTING_LOCK), FALSE);
+			}
+
+			// if not XP or above (if win9x or NT4 or NT3.51), disable Alpha blending
+			if(!(OSversion() == 1 || OSversion()==2))
+			{
+				// Disable Capture Alpha Blending
+				_this->m_server->CaptureAlphaBlending(FALSE);
+				EnableWindow(hAlpha, FALSE);
+				SendMessage(hAlpha, BM_SETCHECK, FALSE, 0);
+
+				// Disable Alpha Blending Monitor Blanking
+				_this->m_server->BlackAlphaBlending(FALSE);
+				EnableWindow(hAlphab, FALSE);
+				SendMessage(hAlphab, BM_SETCHECK, FALSE, 0);
+			}
+
+			SetForegroundWindow(hwnd);
+
+			return FALSE; // Because we've set the focus
+		}
+
+	case WM_COMMAND:
+		switch (LOWORD(wParam))
+		{
+
+		case IDOK:
+		case IDC_APPLY:
+			{
+				char path[512];
+				int lenpath = GetDlgItemText(hwnd, IDC_EDIT_PATH, (LPSTR) &path, 512);
+				if (lenpath != 0)
+					{
+						vnclog.SetPath(path);
+				}
+				else
+				{
+					strcpy(path,"");
+					vnclog.SetPath(path);
+				}
+
+				// Save the password
+				char passwd[MAXPWLEN+1];
+				// TightVNC method
+				int len = GetDlgItemText(hwnd, IDC_PASSWORD, (LPSTR) &passwd, MAXPWLEN+1);
+				if (strcmp(passwd, "~~~~~~~~") != 0) {
+					if (len == 0)
+					{
+						vncPasswd::FromClear crypt;
+						_this->m_server->SetPassword(crypt);
+					}
+					else
+					{
+						vncPasswd::FromText crypt(passwd);
+						_this->m_server->SetPassword(crypt);
+					}
+				}
+
+				memset(passwd, '\0', MAXPWLEN+1); //PGM
+				len = 0; //PGM
+				len = GetDlgItemText(hwnd, IDC_PASSWORD2, (LPSTR) &passwd, MAXPWLEN+1); //PGM
+				if (strcmp(passwd, "~~~~~~~~") != 0) { //PGM
+					if (len == 0) //PGM
+					{ //PGM
+						vncPasswd::FromClear crypt2; //PGM
+						_this->m_server->SetPassword2(crypt2); //PGM
+					} //PGM
+					else //PGM
+					{ //PGM
+						vncPasswd::FromText crypt2(passwd); //PGM
+						_this->m_server->SetPassword2(crypt2); //PGM
+					} //PGM
+				} //PGM
+
+				memset(passwd, '\0', MAXPWLEN+1); //PGM
+				len = 0; //PGM
+				len = GetDlgItemText(hwnd, IDC_PASSWORD2, (LPSTR) &passwd, MAXPWLEN+1); //PGM
+				if (strcmp(passwd, "~~~~~~~~") != 0) { //PGM
+					if (len == 0) //PGM
+					{ //PGM
+						vncPasswd::FromClear crypt2; //PGM
+						_this->m_server->SetPassword2(crypt2); //PGM
+					} //PGM
+					else //PGM
+					{ //PGM
+						vncPasswd::FromText crypt2(passwd); //PGM
+						_this->m_server->SetPassword2(crypt2); //PGM
+					} //PGM
+				} //PGM
+
+				// Save the new settings to the server
+				int state = SendDlgItemMessage(hwnd, IDC_PORTNO_AUTO, BM_GETCHECK, 0, 0);
+				_this->m_server->SetAutoPortSelect(state == BST_CHECKED);
+
+				// Save port numbers if we're not auto selecting
+				if (!_this->m_server->AutoPortSelect()) {
+					if ( SendDlgItemMessage(hwnd, IDC_SPECDISPLAY,
+											BM_GETCHECK, 0, 0) == BST_CHECKED ) {
+						// Display number was specified
+						BOOL ok;
+						UINT display = GetDlgItemInt(hwnd, IDC_DISPLAYNO, &ok, TRUE);
+						if (ok)
+							_this->m_server->SetPorts(DISPLAY_TO_PORT(display),
+													  DISPLAY_TO_HPORT(display));
+					} else {
+						// Assuming that port numbers were specified
+						BOOL ok1, ok2;
+						UINT port_rfb = GetDlgItemInt(hwnd, IDC_PORTRFB, &ok1, TRUE);
+						UINT port_http = GetDlgItemInt(hwnd, IDC_PORTHTTP, &ok2, TRUE);
+						if (ok1 && ok2)
+							_this->m_server->SetPorts(port_rfb, port_http);
+					}
+				}
+				HWND hConnectSock = GetDlgItem(hwnd, IDC_CONNECT_SOCK);
+				_this->m_server->SockConnect(
+					SendMessage(hConnectSock, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				// Update display/port controls on pressing the "Apply" button
+				if (LOWORD(wParam) == IDC_APPLY)
+					_this->InitPortSettings(hwnd);
+
+				
+
+				HWND hConnectHTTP = GetDlgItem(hwnd, IDC_CONNECT_HTTP);
+				_this->m_server->EnableHTTPConnect(
+					SendMessage(hConnectHTTP, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				HWND hConnectXDMCP = GetDlgItem(hwnd, IDC_CONNECT_XDMCP);
+				_this->m_server->EnableXDMCPConnect(
+					SendMessage(hConnectXDMCP, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+				
+				// Remote input stuff
+				HWND hEnableRemoteInputs = GetDlgItem(hwnd, IDC_DISABLE_INPUTS);
+				_this->m_server->EnableRemoteInputs(
+					SendMessage(hEnableRemoteInputs, BM_GETCHECK, 0, 0) != BST_CHECKED
+					);
+
+				// Local input stuff
+				HWND hDisableLocalInputs = GetDlgItem(hwnd, IDC_DISABLE_LOCAL_INPUTS);
+				_this->m_server->DisableLocalInputs(
+					SendMessage(hDisableLocalInputs, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				// japanese keyboard
+				HWND hJapInputs = GetDlgItem(hwnd, IDC_JAP_INPUTS);
+				_this->m_server->EnableJapInput(
+					SendMessage(hJapInputs, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				// Wallpaper handling
+				HWND hRemoveWallpaper = GetDlgItem(hwnd, IDC_REMOVE_WALLPAPER);
+				_this->m_server->EnableRemoveWallpaper(
+					SendMessage(hRemoveWallpaper, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				// Aero handling
+				HWND hRemoveAero = GetDlgItem(hwnd, IDC_REMOVE_Aero);
+				_this->m_server->EnableRemoveAero(
+					SendMessage(hRemoveAero, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				// Lock settings handling
+				if (SendMessage(GetDlgItem(hwnd, IDC_LOCKSETTING_LOCK), BM_GETCHECK, 0, 0)
+					== BST_CHECKED) {
+					_this->m_server->SetLockSettings(1);
+				} else if (SendMessage(GetDlgItem(hwnd, IDC_LOCKSETTING_LOGOFF), BM_GETCHECK, 0, 0)
+					== BST_CHECKED) {
+					_this->m_server->SetLockSettings(2);
+				} else {
+					_this->m_server->SetLockSettings(0);
+				}
+
+				if (SendMessage(GetDlgItem(hwnd, IDC_DREFUSE), BM_GETCHECK, 0, 0)
+					== BST_CHECKED) {
+					_this->m_server->SetQueryAccept(0);
+				} else if (SendMessage(GetDlgItem(hwnd, IDC_DACCEPT), BM_GETCHECK, 0, 0)
+					== BST_CHECKED) {
+					_this->m_server->SetQueryAccept(1);
+				} 
+
+				if (SendMessage(GetDlgItem(hwnd, IDC_MV1), BM_GETCHECK, 0, 0)
+					== BST_CHECKED) {
+					_this->m_server->SetConnectPriority(0);
+				} else if (SendMessage(GetDlgItem(hwnd, IDC_MV2), BM_GETCHECK, 0, 0)
+					== BST_CHECKED) {
+					_this->m_server->SetConnectPriority(1);
+				} 
+				 else if (SendMessage(GetDlgItem(hwnd, IDC_MV3), BM_GETCHECK, 0, 0)
+					== BST_CHECKED) {
+					_this->m_server->SetConnectPriority(2);
+				} else if (SendMessage(GetDlgItem(hwnd, IDC_MV4), BM_GETCHECK, 0, 0)
+					== BST_CHECKED) {
+					_this->m_server->SetConnectPriority(3);
+				} 
+
+				
+
+				// Modif sf at 2002
+				// [v1.0.2-jp2 fix-->] Move to vncpropertiesPoll.cpp
+//				HWND hSingleWindow = GetDlgItem(hwnd, IDC_SINGLE_WINDOW);
+//				_this->m_server->SingleWindow(SendMessage(hSingleWindow, BM_GETCHECK, 0, 0) == BST_CHECKED);
+//
+//				char szName[32];
+//				if (GetDlgItemText(hwnd, IDC_NAME_APPLI, (LPSTR) szName, 32) == 0)
+//				{
+//					vnclog.Print(LL_INTINFO,VNCLOG("Error while reading Window Name %d \n"), GetLastError());
+//				}
+//				else
+//				{
+//					_this->m_server->SetSingleWindowName(szName);
+//				}
+				// [<--v1.0.2-jp2 fix] Move to vncpropertiesPoll.cpp
+				
+				// Modif sf at 2002 - v1.1.0
+				HWND hFileTransfer = GetDlgItem(hwnd, IDC_FILETRANSFER);
+				_this->m_server->EnableFileTransfer(SendMessage(hFileTransfer, BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+				HWND hFileTransferUserImp = GetDlgItem(hwnd, IDC_FTUSERIMPERSONATION_CHECK);
+				_this->m_server->FTUserImpersonation(SendMessage(hFileTransferUserImp, BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+				HWND hBlank = GetDlgItem(hwnd, IDC_BLANK);
+				_this->m_server->BlankMonitorEnabled(SendMessage(hBlank, BM_GETCHECK, 0, 0) == BST_CHECKED);
+				HWND hBlank2 = GetDlgItem(hwnd, IDC_BLANK2); //PGM
+				_this->m_server->BlankInputsOnly(SendMessage(hBlank2, BM_GETCHECK, 0, 0) == BST_CHECKED); //PGM
+				HWND hAlpha = GetDlgItem(hwnd, IDC_ALPHA);
+				_this->m_server->CaptureAlphaBlending(SendMessage(hAlpha, BM_GETCHECK, 0, 0) == BST_CHECKED);
+				HWND hAlphab = GetDlgItem(hwnd, IDC_ALPHABLACK);
+				_this->m_server->BlackAlphaBlending(SendMessage(hAlphab, BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+				// [v1.0.2-jp1 fix]
+//				HWND hGammaGray = GetDlgItem(hwnd, IDC_GAMMAGRAY);
+//				_this->m_server->GammaGray(SendMessage(hGammaGray, BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+				_this->m_server->SetLoopbackOk(IsDlgButtonChecked(hwnd, IDC_ALLOWLOOPBACK));
+				_this->m_server->SetLoopbackOnly(IsDlgButtonChecked(hwnd, IDC_LOOPBACKONLY));
+
+				_this->m_server->SetDisableTrayIcon(IsDlgButtonChecked(hwnd, IDC_DISABLETRAY));
+				_this->m_allowshutdown=!IsDlgButtonChecked(hwnd, IDC_ALLOWSHUTDOWN);
+				_this->m_alloweditclients=!IsDlgButtonChecked(hwnd, IDC_ALLOWEDITCLIENTS);
+				_this->m_server->SetAllowEditClients(_this->m_alloweditclients);
+				if (IsDlgButtonChecked(hwnd, IDC_LOG))
+				{
+					vnclog.SetMode(2);
+					vnclog.SetLevel(10);
+				}
+				else
+				{
+					vnclog.SetMode(0);
+				}
+				if (IsDlgButtonChecked(hwnd, IDC_VIDEO))
+				{
+					vnclog.SetVideo(true);
+				}
+				else
+				{
+					vnclog.SetVideo(false);
+				}
+				// Modif sf at 2002 - v1.1.0
+				// Marscha at 2004 - authSSP: moved MS-Logon checkbox back to admin props page
+				// added New MS-Logon checkbox
+				HWND hMSLogon = GetDlgItem(hwnd, IDC_MSLOGON_CHECKD);
+				_this->m_server->RequireMSLogon(SendMessage(hMSLogon, BM_GETCHECK, 0, 0) == BST_CHECKED);
+				
+				HWND hNewMSLogon = GetDlgItem(hwnd, IDC_NEW_MSLOGON);
+				_this->m_server->SetNewMSLogon(SendMessage(hNewMSLogon, BM_GETCHECK, 0, 0) == BST_CHECKED);
+				// Marscha at 2004 - authSSP: end of change
+
+				int nDScale = GetDlgItemInt(hwnd, IDC_SCALE, NULL, FALSE);
+				if (nDScale < 1 || nDScale > 9) nDScale = 1;
+				_this->m_server->SetDefaultScale(nDScale);
+				
+				// sf at 2002 - DSM Plugin loading
+				// If Use plugin is checked, load the plugin if necessary
+				HWND hPlugin = GetDlgItem(hwnd, IDC_PLUGIN_CHECK);
+				if (SendMessage(hPlugin, BM_GETCHECK, 0, 0) == BST_CHECKED)
+				{
+					TCHAR szPlugin[MAX_PATH];
+					GetDlgItemText(hwnd, IDC_PLUGINS_COMBO, szPlugin, MAX_PATH);
+					_this->m_server->SetDSMPluginName(szPlugin);
+					_this->m_server->EnableDSMPlugin(true);
+				}
+				else // If Use plugin unchecked but the plugin is loaded, unload it
+				{
+					_this->m_server->EnableDSMPlugin(false);
+					if (_this->m_server->GetDSMPluginPointer()->IsLoaded())
+					{
+						_this->m_server->GetDSMPluginPointer()->UnloadPlugin();
+						_this->m_server->GetDSMPluginPointer()->SetEnabled(false);
+					}	
+				}
+
+				//adzm 2010-05-12 - dsmplugin config
+				_this->m_server->SetDSMPluginConfig(_this->m_pref_DSMPluginConfig);
+
+				// Query Window options - Taken from TightVNC advanced properties
+				char timeout[256];
+				if (GetDlgItemText(hwnd, IDQUERYTIMEOUT, (LPSTR) &timeout, 256) == 0)
+				    _this->m_server->SetQueryTimeout(atoi(timeout));
+				else
+				    _this->m_server->SetQueryTimeout(atoi(timeout));
+				HWND hQuery = GetDlgItem(hwnd, IDQUERY);
+				_this->m_server->SetQuerySetting((SendMessage(hQuery, BM_GETCHECK, 0, 0) == BST_CHECKED) ? 4 : 2);
+
+				// And to the registry
+
+				/*if (!RunningAsAdministrator () && vncService::RunningAsService())
+				{
+					MessageBoxSecure(NULL,"Only admins are allowed to save","Warning", MB_OK | MB_ICONINFORMATION);
+				}
+				else*/
+				{
+				// Load the settings
+				if (_this->m_fUseRegistry)
+					_this->Save();
+				else
+					_this->SaveToIniFile();
+				}
+
+				// Was ok pressed?
+				if (LOWORD(wParam) == IDOK)
+				{
+					// Yes, so close the dialog
+					vnclog.Print(LL_INTINFO, VNCLOG("enddialog (OK)\n"));
+
+					_this->m_returncode_valid = TRUE;
+
+					EndDialog(hwnd, IDOK);
+					_this->m_dlgvisible = FALSE;
+				}
+
+				_this->m_server->SetHookings();
+
+				return TRUE;
+			}
+
+		// Modif sf at 2002
+		// [v1.0.2-jp2 fix-->] Move to vncpropertiesPoll.cpp
+//		 case IDC_SINGLE_WINDOW:
+//			 {
+//				 HWND hSingleWindow = GetDlgItem(hwnd, IDC_SINGLE_WINDOW);
+//				 BOOL fSingleWindow = (SendMessage(hSingleWindow, BM_GETCHECK,0, 0) == BST_CHECKED);
+//				 HWND hWindowName   = GetDlgItem(hwnd, IDC_NAME_APPLI);
+//				 EnableWindow(hWindowName, fSingleWindow);
+//			 }
+//			 return TRUE;
+		// [<--v1.0.2-jp2 fix] Move to vncpropertiesPoll.cpp
+
+		case IDCANCEL:
+			vnclog.Print(LL_INTINFO, VNCLOG("enddialog (CANCEL)\n"));
+
+			_this->m_returncode_valid = TRUE;
+
+			EndDialog(hwnd, IDCANCEL);
+			_this->m_dlgvisible = FALSE;
+			return TRUE;
+
+	    // Added Jef Fix - 5 March 2008 paquette at atnetsend.net
+        case IDC_BLANK:
+            {
+                // only enable alpha blanking if blanking is enabled
+                HWND hBlank = ::GetDlgItem(hwnd, IDC_BLANK);
+                HWND hAlphab = ::GetDlgItem(hwnd, IDC_ALPHABLACK);
+                ::EnableWindow(hAlphab, ::SendMessage(hBlank, BM_GETCHECK, 0, 0) == BST_CHECKED);
+                HWND hBlank2 = ::GetDlgItem(hwnd, IDC_BLANK2); //PGM
+                ::EnableWindow(hBlank2, ::SendMessage(hBlank, BM_GETCHECK, 0, 0) == BST_CHECKED); //PGM
+            }
+            break;
+
+        case IDC_BLANK2: //PGM
+            { //PGM
+                // only enable alpha blanking if Disable Only Inputs is disabled //PGM
+                HWND hBlank = ::GetDlgItem(hwnd, IDC_BLANK2); //PGM
+                HWND hAlphab = ::GetDlgItem(hwnd, IDC_ALPHABLACK); //PGM
+                ::EnableWindow(hAlphab, ::SendMessage(hBlank, BM_GETCHECK, 0, 0) == BST_UNCHECKED); //PGM
+            } //PGM
+            break; //PGM
+
+		case IDC_VIDEO:
+			{
+				if (IsDlgButtonChecked(hwnd, IDC_VIDEO))
+				   {
+					   EnableWindow(GetDlgItem(hwnd, IDC_EDIT_PATH), true);
+					   
+				   }
+				   else
+				   {
+					   EnableWindow(GetDlgItem(hwnd, IDC_EDIT_PATH), false);
+					   
+				   }
+				break;
+			}
+
+		case IDC_CLEAR:
+			{
+				vnclog.ClearAviConfig();
+				break;
+			}
+
+		case IDC_CONNECT_SOCK:
+			// TightVNC 1.2.7 method
+			// The user has clicked on the socket connect tickbox
+			{
+				BOOL bConnectSock =
+					(SendDlgItemMessage(hwnd, IDC_CONNECT_SOCK,
+										BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+				EnableWindow(GetDlgItem(hwnd, IDC_PASSWORD), bConnectSock);
+
+				HWND hPortNoAuto = GetDlgItem(hwnd, IDC_PORTNO_AUTO);
+				EnableWindow(hPortNoAuto, bConnectSock);
+				HWND hSpecDisplay = GetDlgItem(hwnd, IDC_SPECDISPLAY);
+				EnableWindow(hSpecDisplay, bConnectSock);
+				HWND hSpecPort = GetDlgItem(hwnd, IDC_SPECPORT);
+				EnableWindow(hSpecPort, bConnectSock);
+
+				EnableWindow(GetDlgItem(hwnd, IDC_DISPLAYNO), bConnectSock &&
+					(SendMessage(hSpecDisplay, BM_GETCHECK, 0, 0) == BST_CHECKED));
+				EnableWindow(GetDlgItem(hwnd, IDC_PORTRFB), bConnectSock &&
+					(SendMessage(hSpecPort, BM_GETCHECK, 0, 0) == BST_CHECKED));
+				EnableWindow(GetDlgItem(hwnd, IDC_PORTHTTP), bConnectSock &&
+					(SendMessage(hSpecPort, BM_GETCHECK, 0, 0) == BST_CHECKED));
+			}
+			// RealVNC method
+			/*
+			// The user has clicked on the socket connect tickbox
+			{
+				HWND hConnectSock = GetDlgItem(hwnd, IDC_CONNECT_SOCK);
+				BOOL connectsockon =
+					(SendMessage(hConnectSock, BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+				HWND hAutoDisplayNo = GetDlgItem(hwnd, IDC_AUTO_DISPLAY_NO);
+				EnableWindow(hAutoDisplayNo, connectsockon);
+			
+				HWND hPortNo = GetDlgItem(hwnd, IDC_PORTNO);
+				EnableWindow(hPortNo, connectsockon
+					&& (SendMessage(hAutoDisplayNo, BM_GETCHECK, 0, 0) != BST_CHECKED));
+			
+				HWND hPassword = GetDlgItem(hwnd, IDC_PASSWORD);
+				EnableWindow(hPassword, connectsockon);
+			}
+			*/
+			return TRUE;
+
+		// TightVNC 1.2.7 method
+		case IDC_PORTNO_AUTO:
+			{
+				EnableWindow(GetDlgItem(hwnd, IDC_DISPLAYNO), FALSE);
+				EnableWindow(GetDlgItem(hwnd, IDC_PORTRFB), FALSE);
+				EnableWindow(GetDlgItem(hwnd, IDC_PORTHTTP), FALSE);
+
+				SetDlgItemText(hwnd, IDC_DISPLAYNO, "");
+				SetDlgItemText(hwnd, IDC_PORTRFB, "");
+				SetDlgItemText(hwnd, IDC_PORTHTTP, "");
+			}
+			return TRUE;
+
+		case IDC_SPECDISPLAY:
+			{
+				EnableWindow(GetDlgItem(hwnd, IDC_DISPLAYNO), TRUE);
+				EnableWindow(GetDlgItem(hwnd, IDC_PORTRFB), FALSE);
+				EnableWindow(GetDlgItem(hwnd, IDC_PORTHTTP), FALSE);
+
+				int display = PORT_TO_DISPLAY(_this->m_server->GetPort());
+				if (display < 0 || display > 99)
+					display = 0;
+				SetDlgItemInt(hwnd, IDC_DISPLAYNO, display, FALSE);
+				SetDlgItemInt(hwnd, IDC_PORTRFB, _this->m_server->GetPort(), FALSE);
+				SetDlgItemInt(hwnd, IDC_PORTHTTP, _this->m_server->GetHttpPort(), FALSE);
+
+				SetFocus(GetDlgItem(hwnd, IDC_DISPLAYNO));
+				SendDlgItemMessage(hwnd, IDC_DISPLAYNO, EM_SETSEL, 0, (LPARAM)-1);
+			}
+			return TRUE;
+
+		case IDC_SPECPORT:
+			{
+				EnableWindow(GetDlgItem(hwnd, IDC_DISPLAYNO), FALSE);
+				EnableWindow(GetDlgItem(hwnd, IDC_PORTRFB), TRUE);
+				EnableWindow(GetDlgItem(hwnd, IDC_PORTHTTP), TRUE);
+
+				int d1 = PORT_TO_DISPLAY(_this->m_server->GetPort());
+				int d2 = HPORT_TO_DISPLAY(_this->m_server->GetHttpPort());
+				if (d1 == d2 && d1 >= 0 && d1 <= 99) {
+					SetDlgItemInt(hwnd, IDC_DISPLAYNO, d1, FALSE);
+				} else {
+					SetDlgItemText(hwnd, IDC_DISPLAYNO, "");
+				}
+				SetDlgItemInt(hwnd, IDC_PORTRFB, _this->m_server->GetPort(), FALSE);
+				SetDlgItemInt(hwnd, IDC_PORTHTTP, _this->m_server->GetHttpPort(), FALSE);
+
+				SetFocus(GetDlgItem(hwnd, IDC_PORTRFB));
+				SendDlgItemMessage(hwnd, IDC_PORTRFB, EM_SETSEL, 0, (LPARAM)-1);
+			}
+			return TRUE;
+
+		// RealVNC method
+		/*
+		case IDC_AUTO_DISPLAY_NO:
+			// User has toggled the Auto Port Select feature.
+			// If this is in use, then we don't allow the Display number field
+			// to be modified!
+			{
+				// Get the auto select button
+				HWND hPortNoAuto = GetDlgItem(hwnd, IDC_AUTO_DISPLAY_NO);
+
+				// Should the portno field be modifiable?
+				BOOL enable = SendMessage(hPortNoAuto, BM_GETCHECK, 0, 0) != BST_CHECKED;
+
+				// Set the state
+				HWND hPortNo = GetDlgItem(hwnd, IDC_PORTNO);
+				EnableWindow(hPortNo, enable);
+			}
+			return TRUE;
+		*/
+
+		// Query window option - Taken from TightVNC advanced properties code
+		case IDQUERY:
+			{
+				HWND hQuery = GetDlgItem(hwnd, IDQUERY);
+				BOOL queryon = (SendMessage(hQuery, BM_GETCHECK, 0, 0) == BST_CHECKED);
+				EnableWindow(GetDlgItem(hwnd, IDQUERYTIMEOUT), queryon);
+				EnableWindow(GetDlgItem(hwnd, IDC_DREFUSE), queryon);
+				EnableWindow(GetDlgItem(hwnd, IDC_DACCEPT), queryon);
+			}
+			return TRUE;
+
+		// sf at 2002 - DSM Plugin
+		case IDC_PLUGIN_CHECK:
+			{
+				HWND hUse = GetDlgItem(hwnd, IDC_PLUGIN_CHECK);
+				BOOL enable = SendMessage(hUse, BM_GETCHECK, 0, 0) == BST_CHECKED;
+				HWND hButton = GetDlgItem(hwnd, IDC_PLUGIN_BUTTON);
+				EnableWindow(hButton, enable);
+			}
+			return TRUE;
+			// Marscha at 2004 - authSSP: moved MSLogon checkbox back to admin props page
+			// Reason: Different UI for old and new mslogon group config.
+		case IDC_MSLOGON_CHECKD:
+			{
+				BOOL bMSLogonChecked =
+				(SendDlgItemMessage(hwnd, IDC_MSLOGON_CHECKD,
+										BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+				EnableWindow(GetDlgItem(hwnd, IDC_NEW_MSLOGON), bMSLogonChecked);
+				EnableWindow(GetDlgItem(hwnd, IDC_MSLOGON), bMSLogonChecked);
+
+			}
+			return TRUE;
+		case IDC_MSLOGON:
+			{
+				// Marscha at 2004 - authSSP: if "New MS-Logon" is checked,
+				// call vncEditSecurity from SecurityEditor.dll,
+				// else call "old" dialog.
+				BOOL bNewMSLogonChecked =
+				(SendDlgItemMessage(hwnd, IDC_NEW_MSLOGON,
+										BM_GETCHECK, 0, 0) == BST_CHECKED);
+				if (bNewMSLogonChecked) {
+					void winvncSecurityEditorHelper_as_admin();
+						HANDLE hProcess,hPToken;
+						DWORD id=GetExplorerLogonPid();
+						if (id!=0) 
+						{
+							hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+							if(!OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+													|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+													|TOKEN_READ|TOKEN_WRITE,&hPToken)) break;
+
+							char dir[MAX_PATH];
+							char exe_file_name[MAX_PATH];
+							GetModuleFileName(0, exe_file_name, MAX_PATH);
+							strcpy(dir, exe_file_name);
+							strcat(dir, " -securityeditorhelper");
+				
+							{
+								STARTUPINFO          StartUPInfo;
+								PROCESS_INFORMATION  ProcessInfo;
+								ZeroMemory(&StartUPInfo,sizeof(STARTUPINFO));
+								ZeroMemory(&ProcessInfo,sizeof(PROCESS_INFORMATION));
+								StartUPInfo.wShowWindow = SW_SHOW;
+								StartUPInfo.lpDesktop = "Winsta0\\Default";
+								StartUPInfo.cb = sizeof(STARTUPINFO);
+						
+								CreateProcessAsUser(hPToken,NULL,dir,NULL,NULL,FALSE,DETACHED_PROCESS,NULL,NULL,&StartUPInfo,&ProcessInfo);
+								DWORD error=GetLastError();
+                                if (ProcessInfo.hThread) CloseHandle(ProcessInfo.hThread);
+                                if (ProcessInfo.hProcess) CloseHandle(ProcessInfo.hProcess);
+								if (error==1314)
+									{
+										winvncSecurityEditorHelper_as_admin();
+									}
+
+							}
+						}
+
+/*
+					char szCurrentDir[MAX_PATH];
+					if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH)) {
+						char* p = strrchr(szCurrentDir, '\\');
+						*p = '\0';
+						strcat (szCurrentDir,"\\authSSP.dll");
+					}
+					HMODULE hModule = LoadLibrary(szCurrentDir);
+					if (hModule) {
+						vncEditSecurity = (vncEditSecurityFn) GetProcAddress(hModule, "vncEditSecurity");
+						HRESULT hr = CoInitialize(NULL);
+						vncEditSecurity(hwnd, hAppInstance);
+						CoUninitialize();
+						FreeLibrary(hModule);
+					}*/
+				} else { 
+					// Marscha at 2004 - authSSP: end of change
+					_this->m_vncauth.Init(_this->m_server);
+					_this->m_vncauth.SetTemp(_this->m_Tempfile);
+					_this->m_vncauth.Show(TRUE);
+				}
+			}
+			return TRUE;
+		case IDC_CHECKDRIVER:
+			{
+				CheckVideoDriver(1);
+			}
+			return TRUE;
+		case IDC_PLUGIN_BUTTON:
+			{
+				HWND hPlugin = GetDlgItem(hwnd, IDC_PLUGIN_CHECK);
+				if (SendMessage(hPlugin, BM_GETCHECK, 0, 0) == BST_CHECKED)
+				{
+					TCHAR szPlugin[MAX_PATH];
+					GetDlgItemText(hwnd, IDC_PLUGINS_COMBO, szPlugin, MAX_PATH);
+					if (!_this->m_server->GetDSMPluginPointer()->IsLoaded())
+						_this->m_server->GetDSMPluginPointer()->LoadPlugin(szPlugin, false);
+					else
+					{
+						// sf at 2003 - We check if the loaded plugin is the same than
+						// the currently selected one or not
+						_this->m_server->GetDSMPluginPointer()->DescribePlugin();
+						if (_stricmp(_this->m_server->GetDSMPluginPointer()->GetPluginFileName(), szPlugin))
+						{
+							_this->m_server->GetDSMPluginPointer()->UnloadPlugin();
+							_this->m_server->GetDSMPluginPointer()->LoadPlugin(szPlugin, false);
+						}
+					}
+				
+					if (_this->m_server->GetDSMPluginPointer()->IsLoaded())
+					{
+						// We don't send the password yet... no matter the plugin requires
+						// it or not, we will provide it later (at plugin "real" init)
+						// Knowing the environnement ("server-svc" or "server-app") right 
+						// now can be usefull or even mandatory for the plugin 
+						// (specific params saving and so on...)
+						char szParams[32];
+						strcpy(szParams, "NoPassword,");
+						strcat(szParams, vncService::RunningAsService() ? "server-svc" : "server-app");
+						//adzm 2010-05-12 - dsmplugin config
+						char* szNewConfig = NULL;
+						if (_this->m_server->GetDSMPluginPointer()->SetPluginParams(hwnd, szParams, _this->m_pref_DSMPluginConfig, &szNewConfig)) {
+							if (szNewConfig != NULL && strlen(szNewConfig) > 0) {
+								strcpy_s(_this->m_pref_DSMPluginConfig, 511, szNewConfig);
+							}
+						}
+					}
+					else
+					{
+						MessageBoxSecure(NULL, 
+							sz_ID_PLUGIN_NOT_LOAD, 
+							sz_ID_PLUGIN_LOADIN, MB_OK | MB_ICONEXCLAMATION );
+					}
+				}				
+				return TRUE;
+			}
+
+
+
+		}
+		break;
+	}
+	return 0;
+}
+
+
+
+// TightVNC 1.2.7
+// Set display/port settings to the correct state
+void
+vncProperties::InitPortSettings(HWND hwnd)
+{
+	BOOL bConnectSock = m_server->SockConnected();
+	BOOL bAutoPort = m_server->AutoPortSelect();
+	UINT port_rfb = m_server->GetPort();
+	UINT port_http = m_server->GetHttpPort();
+	int d1 = PORT_TO_DISPLAY(port_rfb);
+	int d2 = HPORT_TO_DISPLAY(port_http);
+	BOOL bValidDisplay = (d1 == d2 && d1 >= 0 && d1 <= 99);
+
+	CheckDlgButton(hwnd, IDC_PORTNO_AUTO,
+		(bAutoPort) ? BST_CHECKED : BST_UNCHECKED);
+	CheckDlgButton(hwnd, IDC_SPECDISPLAY,
+		(!bAutoPort && bValidDisplay) ? BST_CHECKED : BST_UNCHECKED);
+	CheckDlgButton(hwnd, IDC_SPECPORT,
+		(!bAutoPort && !bValidDisplay) ? BST_CHECKED : BST_UNCHECKED);
+
+	EnableWindow(GetDlgItem(hwnd, IDC_PORTNO_AUTO), bConnectSock);
+	EnableWindow(GetDlgItem(hwnd, IDC_SPECDISPLAY), bConnectSock);
+	EnableWindow(GetDlgItem(hwnd, IDC_SPECPORT), bConnectSock);
+
+	if (bValidDisplay) {
+		SetDlgItemInt(hwnd, IDC_DISPLAYNO, d1, FALSE);
+	} else {
+		SetDlgItemText(hwnd, IDC_DISPLAYNO, "");
+	}
+	SetDlgItemInt(hwnd, IDC_PORTRFB, port_rfb, FALSE);
+	SetDlgItemInt(hwnd, IDC_PORTHTTP, port_http, FALSE);
+
+	EnableWindow(GetDlgItem(hwnd, IDC_DISPLAYNO),
+		bConnectSock && !bAutoPort && bValidDisplay);
+	EnableWindow(GetDlgItem(hwnd, IDC_PORTRFB),
+		bConnectSock && !bAutoPort && !bValidDisplay);
+	EnableWindow(GetDlgItem(hwnd, IDC_PORTHTTP),
+		bConnectSock && !bAutoPort && !bValidDisplay);
+}
+
+#ifdef ULTRAVNC_ITALC_SUPPORT
+extern BOOL ultravnc_italc_load_int( LPCSTR valname, LONG *out );
+#endif
+
+// Functions to load & save the settings
+LONG
+vncProperties::LoadInt(HKEY key, LPCSTR valname, LONG defval)
+{
+	LONG pref;
+	ULONG type = REG_DWORD;
+	ULONG prefsize = sizeof(pref);
+
+#ifdef ULTRAVNC_ITALC_SUPPORT
+	LONG out;
+	if( ultravnc_italc_load_int( valname, &out ) )
+	{
+		return out;
+	}
+#endif
+	if (RegQueryValueEx(key,
+		valname,
+		NULL,
+		&type,
+		(LPBYTE) &pref,
+		&prefsize) != ERROR_SUCCESS)
+		return defval;
+
+	if (type != REG_DWORD)
+		return defval;
+
+	if (prefsize != sizeof(pref))
+		return defval;
+
+	return pref;
+}
+
+void
+vncProperties::LoadPassword(HKEY key, char *buffer)
+{
+	DWORD type = REG_BINARY;
+	int slen=MAXPWLEN;
+	char inouttext[MAXPWLEN];
+
+	// Retrieve the encrypted password
+	if (RegQueryValueEx(key,
+		"Password",
+		NULL,
+		&type,
+		(LPBYTE) &inouttext,
+		(LPDWORD) &slen) != ERROR_SUCCESS)
+		return;
+
+	if (slen > MAXPWLEN)
+		return;
+
+	memcpy(buffer, inouttext, MAXPWLEN);
+}
+
+void //PGM
+vncProperties::LoadPassword2(HKEY key, char *buffer) //PGM
+{ //PGM
+	DWORD type = REG_BINARY; //PGM
+	int slen=MAXPWLEN; //PGM
+	char inouttext[MAXPWLEN]; //PGM
+
+	// Retrieve the encrypted password //PGM
+	if (RegQueryValueEx(key, //PGM
+		"Password2", //PGM
+		NULL, //PGM
+		&type, //PGM
+		(LPBYTE) &inouttext, //PGM
+		(LPDWORD) &slen) != ERROR_SUCCESS) //PGM
+		return; //PGM
+
+	if (slen > MAXPWLEN) //PGM
+		return; //PGM
+
+	memcpy(buffer, inouttext, MAXPWLEN); //PGM
+} //PGM
+
+char *
+vncProperties::LoadString(HKEY key, LPCSTR keyname)
+{
+	DWORD type = REG_SZ;
+	DWORD buflen = 0;
+	BYTE *buffer = 0;
+
+	// Get the length of the AuthHosts string
+	if (RegQueryValueEx(key,
+		keyname,
+		NULL,
+		&type,
+		NULL,
+		&buflen) != ERROR_SUCCESS)
+		return 0;
+
+	if (type != REG_SZ)
+		return 0;
+	buffer = new BYTE[buflen];
+	if (buffer == 0)
+		return 0;
+
+	// Get the AuthHosts string data
+	if (RegQueryValueEx(key,
+		keyname,
+		NULL,
+		&type,
+		buffer,
+		&buflen) != ERROR_SUCCESS) {
+		delete [] buffer;
+		return 0;
+	}
+
+	// Verify the type
+	if (type != REG_SZ) {
+		delete [] buffer;
+		return 0;
+	}
+
+	return (char *)buffer;
+}
+
+
+void
+vncProperties::ResetRegistry()
+{	
+	char username[UNLEN+1];
+	HKEY hkLocal, hkLocalUser, hkDefault;
+	DWORD dw;
+
+	if (!vncService::CurrentUser((char *)&username, sizeof(username)))
+		return;
+
+	// If there is no user logged on them default to SYSTEM
+	if (strcmp(username, "") == 0)
+		strcpy((char *)&username, "SYSTEM");
+
+	// Try to get the machine registry key for WinVNC
+	if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+		WINVNC_REGISTRY_KEY,
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+		{
+		hkLocalUser=NULL;
+		hkDefault=NULL;
+		goto LABELUSERSETTINGS;
+		}
+
+	// Now try to get the per-user local key
+	if (RegOpenKeyEx(hkLocal,
+		username,
+		0, KEY_READ,
+		&hkLocalUser) != ERROR_SUCCESS)
+		hkLocalUser = NULL;
+
+	// Get the default key
+	if (RegCreateKeyEx(hkLocal,
+		"Default",
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ,
+		NULL,
+		&hkDefault,
+		&dw) != ERROR_SUCCESS)
+		hkDefault = NULL;
+
+	if (hkLocalUser != NULL) RegCloseKey(hkLocalUser);
+	if (hkDefault != NULL) RegCloseKey(hkDefault);
+	if (hkLocal != NULL) RegCloseKey(hkLocal);
+	RegCloseKey(HKEY_LOCAL_MACHINE);
+LABELUSERSETTINGS:
+	if ((strcmp(username, "SYSTEM") != 0))
+		{
+			HKEY hkGlobalUser;
+			if (RegCreateKeyEx(HKEY_CURRENT_USER,
+				WINVNC_REGISTRY_KEY,
+				0, REG_NONE, REG_OPTION_NON_VOLATILE,
+				KEY_READ, NULL, &hkGlobalUser, &dw) == ERROR_SUCCESS)
+			{
+				RegCloseKey(hkGlobalUser);
+				RegCloseKey(HKEY_CURRENT_USER);
+			}
+		}
+
+}
+
+void
+vncProperties::Load(BOOL usersettings)
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Entering Load\n"));
+
+	//if (m_dlgvisible) {
+	//	vnclog.Print(LL_INTWARN, VNCLOG("service helper invoked while Properties panel displayed\n"));
+	//	return;
+	//}
+	ResetRegistry();
+
+	if (vncService::RunningAsService()) usersettings=false;
+
+	// sf at 2007 - Vista mode
+	// The WinVNC service mode is not used under Vista (due to Session0 isolation)
+	// Default settings (Service mode) are used when WinVNC app in run under Vista login screen
+	// User settings (loggued user mode) are used when WinVNC app in run in a user session
+	// Todo: Maybe we should additionally check OS version...
+	if (m_server->RunningFromExternalService())
+		usersettings=false;
+
+	m_usersettings = usersettings;
+
+	if (m_usersettings)
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - User mode\n"));
+	else
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Service mode\n"));
+	
+	char username[UNLEN+1];
+	HKEY hkLocal, hkLocalUser, hkDefault;
+	DWORD dw;
+	
+	// NEW (R3) PREFERENCES ALGORITHM
+	// 1.	Look in HKEY_LOCAL_MACHINE/Software/ORL/WinVNC3/%username%
+	//		for sysadmin-defined, user-specific settings.
+	// 2.	If not found, fall back to %username%=Default
+	// 3.	If AllowOverrides is set then load settings from
+	//		HKEY_CURRENT_USER/Software/ORL/WinVNC3
+
+	// GET THE CORRECT KEY TO READ FROM
+
+	// Get the user name / service name
+	if (!vncService::CurrentUser((char *)&username, sizeof(username)))
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - NO current user\n"));
+		return;
+	}
+
+	// If there is no user logged on them default to SYSTEM
+	if (strcmp(username, "") == 0)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Force USER SYSTEM 1\n"));
+		strcpy((char *)&username, "SYSTEM");
+	}
+
+
+	vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - UserName = %s\n"), username);
+
+	// Try to get the machine registry key for WinVNC
+	if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+		WINVNC_REGISTRY_KEY,
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+		{
+		hkLocalUser=NULL;
+		hkDefault=NULL;
+		goto LABELUSERSETTINGS;
+		}
+
+	// Now try to get the per-user local key
+	if (RegOpenKeyEx(hkLocal,
+		username,
+		0, KEY_READ,
+		&hkLocalUser) != ERROR_SUCCESS)
+		hkLocalUser = NULL;
+
+	// Get the default key
+	if (RegCreateKeyEx(hkLocal,
+		"Default",
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ,
+		NULL,
+		&hkDefault,
+		&dw) != ERROR_SUCCESS)
+		hkDefault = NULL;
+
+	// LOAD THE MACHINE-LEVEL PREFS
+
+	vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Machine level prefs\n"));
+
+	// Logging/debugging prefs
+	vnclog.Print(LL_INTINFO, VNCLOG("loading local-only settings\n"));
+	//vnclog.SetMode(LoadInt(hkLocal, "DebugMode", 0));
+	//vnclog.SetLevel(LoadInt(hkLocal, "DebugLevel", 0));
+
+	// Disable Tray Icon
+	m_server->SetDisableTrayIcon(LoadInt(hkLocal, "DisableTrayIcon", false));
+
+	// Authentication required, loopback allowed, loopbackOnly
+
+	m_server->SetLoopbackOnly(LoadInt(hkLocal, "LoopbackOnly", false));
+
+	m_pref_RequireMSLogon=false;
+	m_pref_RequireMSLogon = LoadInt(hkLocal, "MSLogonRequired", m_pref_RequireMSLogon);
+	m_server->RequireMSLogon(m_pref_RequireMSLogon);
+
+	// Marscha at 2004 - authSSP: added NewMSLogon checkbox to admin props page
+	m_pref_NewMSLogon = false;
+	m_pref_NewMSLogon = LoadInt(hkLocal, "NewMSLogon", m_pref_NewMSLogon);
+	m_server->SetNewMSLogon(m_pref_NewMSLogon);
+
+	// sf at 2003 - Moved DSM params here
+	m_pref_UseDSMPlugin=false;
+	m_pref_UseDSMPlugin = LoadInt(hkLocal, "UseDSMPlugin", m_pref_UseDSMPlugin);
+	LoadDSMPluginName(hkLocal, m_pref_szDSMPlugin);	
+	
+	//adzm 2010-05-12 - dsmplugin config
+	{
+		char* szBuffer = LoadString(hkLocal, "DSMPluginConfig");
+		if (szBuffer) {
+			strncpy_s(m_pref_DSMPluginConfig, sizeof(m_pref_DSMPluginConfig) - 1, szBuffer, _TRUNCATE);
+			delete[] szBuffer;
+		} else {
+			m_pref_DSMPluginConfig[0] = '\0';
+		}
+	}
+
+	if (m_server->LoopbackOnly()) m_server->SetLoopbackOk(true);
+	else m_server->SetLoopbackOk(LoadInt(hkLocal, "AllowLoopback", false));
+	m_server->SetAuthRequired(LoadInt(hkLocal, "AuthRequired", true));
+
+	m_server->SetConnectPriority(LoadInt(hkLocal, "ConnectPriority", 0));
+	if (!m_server->LoopbackOnly())
+	{
+		char *authhosts = LoadString(hkLocal, "AuthHosts");
+		if (authhosts != 0) {
+			m_server->SetAuthHosts(authhosts);
+			delete [] authhosts;
+		} else {
+			m_server->SetAuthHosts(0);
+		}
+	} else {
+		m_server->SetAuthHosts(0);
+	}
+
+	// If Socket connections are allowed, should the HTTP server be enabled?
+LABELUSERSETTINGS:
+	// LOAD THE USER PREFERENCES
+	vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Load User Preferences\n"));
+
+	// Set the default user prefs
+	vnclog.Print(LL_INTINFO, VNCLOG("clearing user settings\n"));
+	m_pref_AutoPortSelect=TRUE;
+    m_pref_HTTPConnect = TRUE;
+	m_pref_XDMCPConnect = TRUE;
+	m_pref_PortNumber = RFB_PORT_OFFSET; 
+	m_pref_SockConnect=TRUE;
+	{
+	    vncPasswd::FromClear crypt;
+	    memcpy(m_pref_passwd, crypt, MAXPWLEN);
+	}
+	m_pref_QuerySetting=2;
+	m_pref_QueryTimeout=10;
+	m_pref_QueryAccept=0;
+	m_pref_IdleTimeout=0;
+	m_pref_EnableRemoteInputs=TRUE;
+	m_pref_DisableLocalInputs=FALSE;
+	m_pref_EnableJapInput=FALSE;
+	m_pref_clearconsole=FALSE;
+	m_pref_LockSettings=-1;
+
+	m_pref_RemoveWallpaper=TRUE;
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	m_pref_RemoveEffects=FALSE;
+	m_pref_RemoveFontSmoothing=FALSE;
+	m_pref_RemoveAero=TRUE;
+    m_alloweditclients = TRUE;
+	m_allowshutdown = TRUE;
+	m_allowproperties = TRUE;
+
+	// Modif sf at 2002
+	// [v1.0.2-jp2 fix] Move to vncpropertiesPoll.cpp
+//	m_pref_SingleWindow = FALSE;
+	m_pref_UseDSMPlugin = FALSE;
+	*m_pref_szDSMPlugin = '\0';
+	m_pref_DSMPluginConfig[0] = '\0';
+
+	m_pref_EnableFileTransfer = TRUE;
+	m_pref_FTUserImpersonation = TRUE;
+	m_pref_EnableBlankMonitor = TRUE;
+	m_pref_BlankInputsOnly = FALSE;
+	m_pref_QueryIfNoLogon = FALSE;
+	m_pref_DefaultScale = 1;
+	m_pref_CaptureAlphaBlending = FALSE; 
+	m_pref_BlackAlphaBlending = FALSE; 
+//	m_pref_GammaGray = FALSE;			// [v1.0.2-jp1 fix]
+
+
+	// Load the local prefs for this user
+	if (hkDefault != NULL)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Local Preferences - Default\n"));
+
+		vnclog.Print(LL_INTINFO, VNCLOG("loading DEFAULT local settings\n"));
+		LoadUserPrefs(hkDefault);
+		m_allowshutdown = LoadInt(hkDefault, "AllowShutdown", m_allowshutdown);
+		m_allowproperties = LoadInt(hkDefault, "AllowProperties", m_allowproperties);
+		m_alloweditclients = LoadInt(hkDefault, "AllowEditClients", m_alloweditclients);
+	}
+
+	// Are we being asked to load the user settings, or just the default local system settings?
+	if (usersettings)
+	{
+		// We want the user settings, so load them!
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - User Settings on\n"));
+
+		if (hkLocalUser != NULL)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - LoadUser Preferences\n"));
+
+			vnclog.Print(LL_INTINFO, VNCLOG("loading \"%s\" local settings\n"), username);
+			LoadUserPrefs(hkLocalUser);
+			m_allowshutdown = LoadInt(hkLocalUser, "AllowShutdown", m_allowshutdown);
+			m_allowproperties = LoadInt(hkLocalUser, "AllowProperties", m_allowproperties);
+		  m_alloweditclients = LoadInt(hkLocalUser, "AllowEditClients", m_alloweditclients);
+		}
+
+		// Now override the system settings with the user's settings
+		// If the username is SYSTEM then don't try to load them, because there aren't any...
+		if (m_allowproperties && (strcmp(username, "SYSTEM") != 0))
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Override system settings with users settings\n"));
+			HKEY hkGlobalUser;
+			if (RegCreateKeyEx(HKEY_CURRENT_USER,
+				WINVNC_REGISTRY_KEY,
+				0, REG_NONE, REG_OPTION_NON_VOLATILE,
+				KEY_READ, NULL, &hkGlobalUser, &dw) == ERROR_SUCCESS)
+			{
+				vnclog.Print(LL_INTINFO, VNCLOG("loading \"%s\" global settings\n"), username);
+				LoadUserPrefs(hkGlobalUser);
+				RegCloseKey(hkGlobalUser);
+
+				// Close the user registry hive so it can unload if required
+				RegCloseKey(HKEY_CURRENT_USER);
+			}
+		}
+	} else {
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - User Settings off\n"));
+		if (hkLocalUser != NULL)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("loading \"%s\" local settings\n"), username);
+			LoadUserPrefs(hkLocalUser);
+			m_allowshutdown = LoadInt(hkLocalUser, "AllowShutdown", m_allowshutdown);
+			m_allowproperties = LoadInt(hkLocalUser, "AllowProperties", m_allowproperties);
+		    m_alloweditclients = LoadInt(hkLocalUser, "AllowEditClients", m_alloweditclients);
+		}
+		vnclog.Print(LL_INTINFO, VNCLOG("bypassing user-specific settings (both local and global)\n"));
+	}
+
+	if (hkLocalUser != NULL) RegCloseKey(hkLocalUser);
+	if (hkDefault != NULL) RegCloseKey(hkDefault);
+	if (hkLocal != NULL) RegCloseKey(hkLocal);
+
+	// Make the loaded settings active..
+	ApplyUserPrefs();
+}
+
+void
+vncProperties::LoadUserPrefs(HKEY appkey)
+{
+	// LOAD USER PREFS FROM THE SELECTED KEY
+
+	// Modif sf at 2002
+	m_pref_EnableFileTransfer = LoadInt(appkey, "FileTransferEnabled", m_pref_EnableFileTransfer);
+	m_pref_FTUserImpersonation = LoadInt(appkey, "FTUserImpersonation", m_pref_FTUserImpersonation); // sf at 2005
+	m_pref_EnableBlankMonitor = LoadInt(appkey, "BlankMonitorEnabled", m_pref_EnableBlankMonitor);
+	m_pref_BlankInputsOnly = LoadInt(appkey, "BlankInputsOnly", m_pref_BlankInputsOnly); //PGM
+	m_pref_DefaultScale = LoadInt(appkey, "DefaultScale", m_pref_DefaultScale);
+	m_pref_CaptureAlphaBlending = LoadInt(appkey, "CaptureAlphaBlending", m_pref_CaptureAlphaBlending); // sf at 2005
+	m_pref_BlackAlphaBlending = LoadInt(appkey, "BlackAlphaBlending", m_pref_BlackAlphaBlending); // sf at 2005
+	
+	m_pref_Primary=LoadInt(appkey, "primary", m_pref_Primary);
+	m_pref_Secondary=LoadInt(appkey, "secondary", m_pref_Secondary);
+
+	m_pref_UseDSMPlugin = LoadInt(appkey, "UseDSMPlugin", m_pref_UseDSMPlugin);
+	LoadDSMPluginName(appkey, m_pref_szDSMPlugin);
+
+	// Connection prefs
+	m_pref_SockConnect=LoadInt(appkey, "SocketConnect", m_pref_SockConnect);
+	m_pref_HTTPConnect=LoadInt(appkey, "HTTPConnect", m_pref_HTTPConnect);
+	m_pref_XDMCPConnect=LoadInt(appkey, "XDMCPConnect", m_pref_XDMCPConnect);
+	m_pref_AutoPortSelect=LoadInt(appkey, "AutoPortSelect", m_pref_AutoPortSelect);
+	m_pref_PortNumber=LoadInt(appkey, "PortNumber", m_pref_PortNumber);
+	m_pref_HttpPortNumber=LoadInt(appkey, "HTTPPortNumber",
+									DISPLAY_TO_HPORT(PORT_TO_DISPLAY(m_pref_PortNumber)));
+	m_pref_IdleTimeout=LoadInt(appkey, "IdleTimeout", m_pref_IdleTimeout);
+	
+	m_pref_RemoveWallpaper=LoadInt(appkey, "RemoveWallpaper", m_pref_RemoveWallpaper);
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	m_pref_RemoveEffects=LoadInt(appkey, "RemoveEffects", m_pref_RemoveEffects);
+	m_pref_RemoveFontSmoothing=LoadInt(appkey, "RemoveFontSmoothing", m_pref_RemoveFontSmoothing);
+	m_pref_RemoveAero=LoadInt(appkey, "RemoveAero", m_pref_RemoveAero);
+
+	// Connection querying settings
+	m_pref_QuerySetting=LoadInt(appkey, "QuerySetting", m_pref_QuerySetting);
+	m_server->SetQuerySetting(m_pref_QuerySetting);
+	m_pref_QueryTimeout=LoadInt(appkey, "QueryTimeout", m_pref_QueryTimeout);
+	m_server->SetQueryTimeout(m_pref_QueryTimeout);
+	m_pref_QueryAccept=LoadInt(appkey, "QueryAccept", m_pref_QueryAccept);
+	m_server->SetQueryAccept(m_pref_QueryAccept);
+
+	// marscha at 2006 - Is AcceptDialog required even if no user is logged on
+	m_pref_QueryIfNoLogon=LoadInt(appkey, "QueryIfNoLogon", m_pref_QueryIfNoLogon);
+	m_server->SetQueryIfNoLogon(m_pref_QueryIfNoLogon);
+
+	// Load the password
+	LoadPassword(appkey, m_pref_passwd);
+	LoadPassword2(appkey, m_pref_passwd2); //PGM
+
+	// Remote access prefs
+	m_pref_EnableRemoteInputs=LoadInt(appkey, "InputsEnabled", m_pref_EnableRemoteInputs);
+	m_pref_LockSettings=LoadInt(appkey, "LockSetting", m_pref_LockSettings);
+	m_pref_DisableLocalInputs=LoadInt(appkey, "LocalInputsDisabled", m_pref_DisableLocalInputs);
+	m_pref_EnableJapInput=LoadInt(appkey, "EnableJapInput", m_pref_EnableJapInput);
+	m_pref_clearconsole=LoadInt(appkey, "clearconsole", m_pref_clearconsole);
+}
+
+void
+vncProperties::ApplyUserPrefs()
+{
+	// APPLY THE CACHED PREFERENCES TO THE SERVER
+
+	// Modif sf at 2002
+	m_server->EnableFileTransfer(m_pref_EnableFileTransfer);
+	m_server->FTUserImpersonation(m_pref_FTUserImpersonation); // sf at 2005
+	m_server->CaptureAlphaBlending(m_pref_CaptureAlphaBlending); // sf at 2005
+	m_server->BlackAlphaBlending(m_pref_BlackAlphaBlending); // sf at 2005
+	m_server->Primary(m_pref_Primary);
+	m_server->Secondary(m_pref_Secondary);
+
+	m_server->BlankMonitorEnabled(m_pref_EnableBlankMonitor);
+	m_server->BlankInputsOnly(m_pref_BlankInputsOnly); //PGM
+	m_server->SetDefaultScale(m_pref_DefaultScale);
+
+	// Update the connection querying settings
+	m_server->SetQuerySetting(m_pref_QuerySetting);
+	m_server->SetQueryTimeout(m_pref_QueryTimeout);
+	m_server->SetQueryAccept(m_pref_QueryAccept);
+	m_server->SetAutoIdleDisconnectTimeout(m_pref_IdleTimeout);
+	m_server->EnableRemoveWallpaper(m_pref_RemoveWallpaper);
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	m_server->EnableRemoveFontSmoothing(m_pref_RemoveFontSmoothing);
+	m_server->EnableRemoveEffects(m_pref_RemoveEffects);
+	m_server->EnableRemoveAero(m_pref_RemoveAero);
+
+	// Is the listening socket closing?
+
+	if (!m_pref_SockConnect)
+		m_server->SockConnect(m_pref_SockConnect);
+
+	m_server->EnableHTTPConnect(m_pref_HTTPConnect);
+	m_server->EnableXDMCPConnect(m_pref_XDMCPConnect);
+
+	// Are inputs being disabled?
+	if (!m_pref_EnableRemoteInputs)
+		m_server->EnableRemoteInputs(m_pref_EnableRemoteInputs);
+	if (m_pref_DisableLocalInputs)
+		m_server->DisableLocalInputs(m_pref_DisableLocalInputs);
+	if (m_pref_EnableJapInput)
+		m_server->EnableJapInput(m_pref_EnableJapInput);
+	m_server->Clearconsole(m_pref_clearconsole);
+
+	// Update the password
+	m_server->SetPassword(m_pref_passwd);
+	m_server->SetPassword2(m_pref_passwd2); //PGM
+
+	// Now change the listening port settings
+	m_server->SetAutoPortSelect(m_pref_AutoPortSelect);
+	if (!m_pref_AutoPortSelect)
+		// m_server->SetPort(m_pref_PortNumber);
+		m_server->SetPorts(m_pref_PortNumber, m_pref_HttpPortNumber); // Tight 1.2.7
+
+	m_server->SockConnect(m_pref_SockConnect);
+
+
+	// Remote access prefs
+	m_server->EnableRemoteInputs(m_pref_EnableRemoteInputs);
+	m_server->SetLockSettings(m_pref_LockSettings);
+	m_server->DisableLocalInputs(m_pref_DisableLocalInputs);
+	m_server->EnableJapInput(m_pref_EnableJapInput);
+	m_server->Clearconsole(m_pref_clearconsole);
+
+	// DSM Plugin prefs
+	m_server->EnableDSMPlugin(m_pref_UseDSMPlugin);
+	m_server->SetDSMPluginName(m_pref_szDSMPlugin);
+	
+	//adzm 2010-05-12 - dsmplugin config
+	m_server->SetDSMPluginConfig(m_pref_DSMPluginConfig);
+
+	if (m_server->IsDSMPluginEnabled()) 
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ ApplyUserPrefs - Plugin Enabled - Call SetDSMPlugin() \n"));
+		m_server->SetDSMPlugin(false);
+	}
+	else
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ ApplyUserPrefs - Plugin NOT enabled \n"));
+	}
+
+}
+
+void
+vncProperties::SaveInt(HKEY key, LPCSTR valname, LONG val)
+{
+	RegSetValueEx(key, valname, 0, REG_DWORD, (LPBYTE) &val, sizeof(val));
+}
+
+void
+vncProperties::SavePassword(HKEY key, char *buffer)
+{
+	RegSetValueEx(key, "Password", 0, REG_BINARY, (LPBYTE) buffer, MAXPWLEN);
+}
+void //PGM
+vncProperties::SavePassword2(HKEY key, char *buffer) //PGM
+{ //PGM
+	RegSetValueEx(key, "Password2", 0, REG_BINARY, (LPBYTE) buffer, MAXPWLEN); //PGM
+} //PGM
+void
+vncProperties::SaveString(HKEY key,LPCSTR valname, const char *buffer)
+{
+	RegSetValueEx(key, valname, 0, REG_BINARY, (LPBYTE) buffer, strlen(buffer)+1);
+}
+
+void
+vncProperties::SaveDSMPluginName(HKEY key, char *buffer)
+{
+	RegSetValueEx(key, "DSMPlugin", 0, REG_BINARY, (LPBYTE) buffer, MAXPATH);
+}
+
+void
+vncProperties::LoadDSMPluginName(HKEY key, char *buffer)
+{
+	DWORD type = REG_BINARY;
+	int slen=MAXPATH;
+	char inouttext[MAXPATH];
+
+	if (RegQueryValueEx(key,
+		"DSMPlugin",
+		NULL,
+		&type,
+		(LPBYTE) &inouttext,
+		(LPDWORD) &slen) != ERROR_SUCCESS)
+		return;
+
+	if (slen > MAXPATH)
+		return;
+
+	memcpy(buffer, inouttext, MAXPATH);
+}
+
+void
+vncProperties::Save()
+{
+	HKEY appkey;
+	DWORD dw;
+
+	if (!m_allowproperties)
+		return;
+
+	// NEW (R3) PREFERENCES ALGORITHM
+	// The user's prefs are only saved if the user is allowed to override
+	// the machine-local settings specified for them.  Otherwise, the
+	// properties entry on the tray icon menu will be greyed out.
+
+	// GET THE CORRECT KEY TO READ FROM
+
+	// Have we loaded user settings, or system settings?
+	if (m_usersettings) {
+		// Verify that we know who is logged on
+		char username[UNLEN+1];
+		if (!vncService::CurrentUser((char *)&username, sizeof(username)))
+			return;
+		if (strcmp(username, "") == 0)
+			return;
+
+		// Try to get the per-user, global registry key for WinVNC
+		if (RegCreateKeyEx(HKEY_CURRENT_USER,
+			WINVNC_REGISTRY_KEY,
+			0, REG_NONE, REG_OPTION_NON_VOLATILE,
+			KEY_WRITE | KEY_READ, NULL, &appkey, &dw) != ERROR_SUCCESS)
+			return;
+	} else {
+		// Try to get the default local registry key for WinVNC
+		HKEY hkLocal;
+		if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+			WINVNC_REGISTRY_KEY,
+			0, REG_NONE, REG_OPTION_NON_VOLATILE,
+			KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS) {
+			MessageBoxSecure(NULL, sz_ID_MB1, sz_ID_WVNC, MB_OK);
+			return;
+		}
+
+		if (RegCreateKeyEx(hkLocal,
+			"Default",
+			0, REG_NONE, REG_OPTION_NON_VOLATILE,
+			KEY_WRITE | KEY_READ, NULL, &appkey, &dw) != ERROR_SUCCESS) {
+			RegCloseKey(hkLocal);
+			return;
+		}
+		RegCloseKey(hkLocal);
+	}
+
+	// SAVE PER-USER PREFS IF ALLOWED
+	SaveUserPrefs(appkey);
+	RegCloseKey(appkey);
+	RegCloseKey(HKEY_CURRENT_USER);
+
+	// Machine Preferences
+	// Get the machine registry key for WinVNC
+	HKEY hkLocal,hkDefault;
+	if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+		WINVNC_REGISTRY_KEY,
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_WRITE | KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+		return;
+	if (RegCreateKeyEx(hkLocal,
+		"Default",
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_WRITE | KEY_READ,
+		NULL,
+		&hkDefault,
+		&dw) != ERROR_SUCCESS)
+		hkDefault = NULL;
+	// sf at 2003
+	SaveInt(hkLocal, "DebugMode", vnclog.GetMode());
+	SaveInt(hkLocal, "Avilog", vnclog.GetVideo());
+	SaveString(hkLocal, "path", vnclog.GetPath());
+	SaveInt(hkLocal, "DebugLevel", vnclog.GetLevel());
+	SaveInt(hkLocal, "AllowLoopback", m_server->LoopbackOk());
+	SaveInt(hkLocal, "LoopbackOnly", m_server->LoopbackOnly());
+	if (hkDefault) SaveInt(hkDefault, "AllowShutdown", m_allowshutdown);
+	if (hkDefault) SaveInt(hkDefault, "AllowProperties",  m_allowproperties);
+	if (hkDefault) SaveInt(hkDefault, "AllowEditClients", m_alloweditclients);
+
+	SaveInt(hkLocal, "DisableTrayIcon", m_server->GetDisableTrayIcon());
+	SaveInt(hkLocal, "MSLogonRequired", m_server->MSLogonRequired());
+	// Marscha at 2004 - authSSP: save "New MS-Logon" state
+	SaveInt(hkLocal, "NewMSLogon", m_server->GetNewMSLogon());
+	// sf at 2003 - DSM params here
+	SaveInt(hkLocal, "UseDSMPlugin", m_server->IsDSMPluginEnabled());
+	SaveInt(hkLocal, "ConnectPriority", m_server->ConnectPriority());
+	SaveDSMPluginName(hkLocal, m_server->GetDSMPluginName());	
+	
+	//adzm 2010-05-12 - dsmplugin config
+	SaveString(hkLocal, "DSMPluginConfig", m_server->GetDSMPluginConfig());
+
+	if (hkDefault) RegCloseKey(hkDefault);
+	if (hkLocal) RegCloseKey(hkLocal);
+}
+
+void
+vncProperties::SaveUserPrefs(HKEY appkey)
+{
+	// SAVE THE PER USER PREFS
+	vnclog.Print(LL_INTINFO, VNCLOG("saving current settings to registry\n"));
+
+	// Modif sf at 2002
+	SaveInt(appkey, "FileTransferEnabled", m_server->FileTransferEnabled());
+	SaveInt(appkey, "FTUserImpersonation", m_server->FTUserImpersonation()); // sf at 2005
+	SaveInt(appkey, "BlankMonitorEnabled", m_server->BlankMonitorEnabled());
+	SaveInt(appkey, "BlankInputsOnly", m_server->BlankInputsOnly()); //PGM
+	SaveInt(appkey, "CaptureAlphaBlending", m_server->CaptureAlphaBlending()); // sf at 2005
+	SaveInt(appkey, "BlackAlphaBlending", m_server->BlackAlphaBlending()); // sf at 2005
+	SaveInt(appkey, "primary", m_server->Primary());
+	SaveInt(appkey, "secondary", m_server->Secondary());
+
+	SaveInt(appkey, "DefaultScale", m_server->GetDefaultScale());
+
+	SaveInt(appkey, "UseDSMPlugin", m_server->IsDSMPluginEnabled());
+	SaveDSMPluginName(appkey, m_server->GetDSMPluginName());
+	//adzm 2010-05-12 - dsmplugin config
+	SaveString(appkey, "DSMPluginConfig", m_server->GetDSMPluginConfig());
+
+	// Connection prefs
+	SaveInt(appkey, "SocketConnect", m_server->SockConnected());
+	SaveInt(appkey, "HTTPConnect", m_server->HTTPConnectEnabled());
+	SaveInt(appkey, "XDMCPConnect", m_server->XDMCPConnectEnabled());
+	SaveInt(appkey, "AutoPortSelect", m_server->AutoPortSelect());
+	if (!m_server->AutoPortSelect()) {
+		SaveInt(appkey, "PortNumber", m_server->GetPort());
+		SaveInt(appkey, "HTTPPortNumber", m_server->GetHttpPort());
+	}
+	SaveInt(appkey, "InputsEnabled", m_server->RemoteInputsEnabled());
+	SaveInt(appkey, "LocalInputsDisabled", m_server->LocalInputsDisabled());
+	SaveInt(appkey, "IdleTimeout", m_server->AutoIdleDisconnectTimeout());
+	SaveInt(appkey, "EnableJapInput", m_server->JapInputEnabled());
+
+	// Connection querying settings
+	SaveInt(appkey, "QuerySetting", m_server->QuerySetting());
+	SaveInt(appkey, "QueryTimeout", m_server->QueryTimeout());
+	SaveInt(appkey, "QueryAccept", m_server->QueryAccept());
+
+	// Lock settings
+	SaveInt(appkey, "LockSetting", m_server->LockSettings());
+
+	// Wallpaper removal
+	SaveInt(appkey, "RemoveWallpaper", m_server->RemoveWallpaperEnabled());
+	// UI Effects
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	SaveInt(appkey, "RemoveEffects", m_server->RemoveEffectsEnabled());
+	SaveInt(appkey, "RemoveFontSmoothing", m_server->RemoveFontSmoothingEnabled());
+	// Composit desktop removal
+	SaveInt(appkey, "RemoveAero", m_server->RemoveAeroEnabled());
+
+	// Save the password
+	char passwd[MAXPWLEN];
+	m_server->GetPassword(passwd);
+	SavePassword(appkey, passwd);
+	memset(passwd, '\0', MAXPWLEN); //PGM
+	m_server->GetPassword2(passwd); //PGM
+	SavePassword2(appkey, passwd); //PGM
+}
+
+
+// ********************************************************************
+// Ini file part - Wwill replace registry access completely, some day
+// WARNING: until then, when adding/modifying a config parameter
+//          don't forget to modify both ini file & registry parts !
+// ********************************************************************
+
+void vncProperties::LoadFromIniFile()
+{
+	//if (m_dlgvisible)
+	//{
+	//	vnclog.Print(LL_INTWARN, VNCLOG("service helper invoked while Properties panel displayed\n"));
+	//	return;
+	//}
+
+	char username[UNLEN+1];
+
+	// Get the user name / service name
+	if (!vncService::CurrentUser((char *)&username, sizeof(username)))
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - NO current user\n"));
+		return;
+	}
+
+	// If there is no user logged on them default to SYSTEM
+	if (strcmp(username, "") == 0)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Force USER SYSTEM 2\n"));
+		strcpy((char *)&username, "SYSTEM");
+	}
+
+	// Logging/debugging prefs
+	vnclog.SetMode(myIniFile.ReadInt("admin", "DebugMode", 0));
+	char temp[512];
+	myIniFile.ReadString("admin", "path", temp,512);
+	vnclog.SetPath(temp);
+	vnclog.SetLevel(myIniFile.ReadInt("admin", "DebugLevel", 0));
+	vnclog.SetVideo(myIniFile.ReadInt("admin", "Avilog", 0) ? true : false);
+
+	// Disable Tray Icon
+	m_server->SetDisableTrayIcon(myIniFile.ReadInt("admin", "DisableTrayIcon", false));
+
+	// Authentication required, loopback allowed, loopbackOnly
+
+	m_server->SetLoopbackOnly(myIniFile.ReadInt("admin", "LoopbackOnly", false));
+
+	m_pref_RequireMSLogon=false;
+	m_pref_RequireMSLogon = myIniFile.ReadInt("admin", "MSLogonRequired", m_pref_RequireMSLogon);
+	m_server->RequireMSLogon(m_pref_RequireMSLogon);
+
+	// Marscha at 2004 - authSSP: added NewMSLogon checkbox to admin props page
+	m_pref_NewMSLogon = false;
+	m_pref_NewMSLogon = myIniFile.ReadInt("admin", "NewMSLogon", m_pref_NewMSLogon);
+	m_server->SetNewMSLogon(m_pref_NewMSLogon);
+
+	// sf at 2003 - Moved DSM params here
+	m_pref_UseDSMPlugin=false;
+	m_pref_UseDSMPlugin = myIniFile.ReadInt("admin", "UseDSMPlugin", m_pref_UseDSMPlugin);
+	myIniFile.ReadString("admin", "DSMPlugin",m_pref_szDSMPlugin,128);
+	
+	//adzm 2010-05-12 - dsmplugin config
+	myIniFile.ReadString("admin", "DSMPluginConfig", m_pref_DSMPluginConfig, 512);
+
+	if (m_server->LoopbackOnly()) m_server->SetLoopbackOk(true);
+	else m_server->SetLoopbackOk(myIniFile.ReadInt("admin", "AllowLoopback", false));
+	m_server->SetAuthRequired(myIniFile.ReadInt("admin", "AuthRequired", true));
+
+	m_server->SetConnectPriority(myIniFile.ReadInt("admin", "ConnectPriority", 0));
+	if (!m_server->LoopbackOnly())
+	{
+		char *authhosts=new char[150];
+		myIniFile.ReadString("admin", "AuthHosts",authhosts,150);
+		if (authhosts != 0) {
+			m_server->SetAuthHosts(authhosts);
+			delete [] authhosts;
+		} else {
+			m_server->SetAuthHosts(0);
+		}
+	} else {
+		m_server->SetAuthHosts(0);
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Load User Preferences\n"));
+
+	// Set the default user prefs
+	vnclog.Print(LL_INTINFO, VNCLOG("clearing user settings\n"));
+	m_pref_AutoPortSelect=TRUE;
+    m_pref_HTTPConnect = TRUE;
+	m_pref_XDMCPConnect = TRUE;
+	m_pref_PortNumber = RFB_PORT_OFFSET; 
+	m_pref_SockConnect=TRUE;
+	{
+	    vncPasswd::FromClear crypt;
+	    memcpy(m_pref_passwd, crypt, MAXPWLEN);
+	}
+	m_pref_QuerySetting=2;
+	m_pref_QueryTimeout=10;
+	m_pref_QueryAccept=0;
+	m_pref_IdleTimeout=0;
+	m_pref_EnableRemoteInputs=TRUE;
+	m_pref_DisableLocalInputs=FALSE;
+	m_pref_EnableJapInput=FALSE;
+	m_pref_clearconsole=FALSE;
+	m_pref_LockSettings=-1;
+
+	m_pref_RemoveWallpaper=TRUE;
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	m_pref_RemoveEffects=FALSE;
+	m_pref_RemoveFontSmoothing=FALSE;
+	m_pref_RemoveAero=TRUE;
+    m_alloweditclients = TRUE;
+	m_allowshutdown = TRUE;
+	m_allowproperties = TRUE;
+
+	// Modif sf at 2002
+	m_pref_SingleWindow = FALSE;
+	m_pref_UseDSMPlugin = FALSE;
+	*m_pref_szDSMPlugin = '\0';
+	m_pref_DSMPluginConfig[0] = '\0';
+
+	m_pref_EnableFileTransfer = TRUE;
+	m_pref_FTUserImpersonation = TRUE;
+	m_pref_EnableBlankMonitor = TRUE;
+	m_pref_BlankInputsOnly = FALSE;
+	m_pref_QueryIfNoLogon = FALSE;
+	m_pref_DefaultScale = 1;
+	m_pref_CaptureAlphaBlending = FALSE; 
+	m_pref_BlackAlphaBlending = FALSE; 
+
+	LoadUserPrefsFromIniFile();
+	m_allowshutdown = myIniFile.ReadInt("admin", "AllowShutdown", m_allowshutdown);
+	m_allowproperties = myIniFile.ReadInt("admin", "AllowProperties", m_allowproperties);
+	m_alloweditclients = myIniFile.ReadInt("admin", "AllowEditClients", m_alloweditclients);
+
+    m_ftTimeout = myIniFile.ReadInt("admin", "FileTransferTimeout", m_ftTimeout);
+    if (m_ftTimeout > 60)
+        m_ftTimeout = 60;
+
+    m_keepAliveInterval = myIniFile.ReadInt("admin", "KeepAliveInterval", m_keepAliveInterval);
+    if (m_keepAliveInterval >= (m_ftTimeout - KEEPALIVE_HEADROOM))
+        m_keepAliveInterval = m_ftTimeout - KEEPALIVE_HEADROOM;
+
+	// adzm 2010-08
+	m_socketKeepAliveTimeout = myIniFile.ReadInt("admin", "SocketKeepAliveTimeout", m_socketKeepAliveTimeout); 
+	if (m_socketKeepAliveTimeout < 0) m_socketKeepAliveTimeout = 0;
+
+    m_server->SetFTTimeout(m_ftTimeout);
+    m_server->SetKeepAliveInterval(m_keepAliveInterval);
+	m_server->SetSocketKeepAliveTimeout(m_socketKeepAliveTimeout); // adzm 2010-08
+    
+
+	ApplyUserPrefs();
+}
+
+
+void vncProperties::LoadUserPrefsFromIniFile()
+{
+	// Modif sf at 2002
+	m_pref_EnableFileTransfer = myIniFile.ReadInt("admin", "FileTransferEnabled", m_pref_EnableFileTransfer);
+	m_pref_FTUserImpersonation = myIniFile.ReadInt("admin", "FTUserImpersonation", m_pref_FTUserImpersonation); // sf at 2005
+	m_pref_EnableBlankMonitor = myIniFile.ReadInt("admin", "BlankMonitorEnabled", m_pref_EnableBlankMonitor);
+	m_pref_BlankInputsOnly = myIniFile.ReadInt("admin", "BlankInputsOnly", m_pref_BlankInputsOnly); //PGM
+	m_pref_DefaultScale = myIniFile.ReadInt("admin", "DefaultScale", m_pref_DefaultScale);
+	m_pref_CaptureAlphaBlending = myIniFile.ReadInt("admin", "CaptureAlphaBlending", m_pref_CaptureAlphaBlending); // sf at 2005
+	m_pref_BlackAlphaBlending = myIniFile.ReadInt("admin", "BlackAlphaBlending", m_pref_BlackAlphaBlending); // sf at 2005
+
+	m_pref_UseDSMPlugin = myIniFile.ReadInt("admin", "UseDSMPlugin", m_pref_UseDSMPlugin);
+	myIniFile.ReadString("admin", "DSMPlugin",m_pref_szDSMPlugin,128);
+	
+	//adzm 2010-05-12 - dsmplugin config
+	myIniFile.ReadString("admin", "DSMPluginConfig", m_pref_DSMPluginConfig, 512);
+	
+	m_pref_Primary = myIniFile.ReadInt("admin", "primary", m_pref_Primary);
+	m_pref_Secondary = myIniFile.ReadInt("admin", "secondary", m_pref_Secondary);
+
+	// Connection prefs
+	m_pref_SockConnect=myIniFile.ReadInt("admin", "SocketConnect", m_pref_SockConnect);
+	m_pref_HTTPConnect=myIniFile.ReadInt("admin", "HTTPConnect", m_pref_HTTPConnect);
+	m_pref_XDMCPConnect=myIniFile.ReadInt("admin", "XDMCPConnect", m_pref_XDMCPConnect);
+	m_pref_AutoPortSelect=myIniFile.ReadInt("admin", "AutoPortSelect", m_pref_AutoPortSelect);
+	m_pref_PortNumber=myIniFile.ReadInt("admin", "PortNumber", m_pref_PortNumber);
+	m_pref_HttpPortNumber=myIniFile.ReadInt("admin", "HTTPPortNumber",
+									DISPLAY_TO_HPORT(PORT_TO_DISPLAY(m_pref_PortNumber)));
+	m_pref_IdleTimeout=myIniFile.ReadInt("admin", "IdleTimeout", m_pref_IdleTimeout);
+	
+	m_pref_RemoveWallpaper=myIniFile.ReadInt("admin", "RemoveWallpaper", m_pref_RemoveWallpaper);
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	m_pref_RemoveEffects=myIniFile.ReadInt("admin", "RemoveEffects", m_pref_RemoveEffects);
+	m_pref_RemoveFontSmoothing=myIniFile.ReadInt("admin", "RemoveFontSmoothing", m_pref_RemoveFontSmoothing);
+	m_pref_RemoveAero=myIniFile.ReadInt("admin", "RemoveAero", m_pref_RemoveAero);
+
+	// Connection querying settings
+	m_pref_QuerySetting=myIniFile.ReadInt("admin", "QuerySetting", m_pref_QuerySetting);
+	m_server->SetQuerySetting(m_pref_QuerySetting);
+	m_pref_QueryTimeout=myIniFile.ReadInt("admin", "QueryTimeout", m_pref_QueryTimeout);
+	m_server->SetQueryTimeout(m_pref_QueryTimeout);
+	m_pref_QueryAccept=myIniFile.ReadInt("admin", "QueryAccept", m_pref_QueryAccept);
+	m_server->SetQueryAccept(m_pref_QueryAccept);
+
+	// marscha at 2006 - Is AcceptDialog required even if no user is logged on
+	m_pref_QueryIfNoLogon=myIniFile.ReadInt("admin", "QueryIfNoLogon", m_pref_QueryIfNoLogon);
+	m_server->SetQueryIfNoLogon(m_pref_QueryIfNoLogon);
+
+	// Load the password
+	myIniFile.ReadPassword(m_pref_passwd,MAXPWLEN);
+	myIniFile.ReadPassword2(m_pref_passwd2,MAXPWLEN); //PGM
+
+	// Remote access prefs
+	m_pref_EnableRemoteInputs=myIniFile.ReadInt("admin", "InputsEnabled", m_pref_EnableRemoteInputs);
+	m_pref_LockSettings=myIniFile.ReadInt("admin", "LockSetting", m_pref_LockSettings);
+	m_pref_DisableLocalInputs=myIniFile.ReadInt("admin", "LocalInputsDisabled", m_pref_DisableLocalInputs);
+	m_pref_EnableJapInput=myIniFile.ReadInt("admin", "EnableJapInput", m_pref_EnableJapInput);
+	m_pref_clearconsole=myIniFile.ReadInt("admin", "clearconsole", m_pref_clearconsole);
+	G_SENDBUFFER=myIniFile.ReadInt("admin", "sendbuffer", G_SENDBUFFER);
+}
+
+
+void vncProperties::SaveToIniFile()
+{
+	if (!m_allowproperties)
+		return;
+
+	// SAVE PER-USER PREFS IF ALLOWED
+	bool use_uac=false;
+	if (!myIniFile.IsWritable()  || vncService::RunningAsService())
+			{
+				// We can't write to the ini file , Vista in service mode
+				if (!Copy_to_Temp( m_Tempfile)) return;
+				myIniFile.IniFileSetTemp( m_Tempfile);
+				use_uac=true;
+			}
+
+	SaveUserPrefsToIniFile();
+	myIniFile.WriteInt("admin", "DebugMode", vnclog.GetMode());
+	myIniFile.WriteInt("admin", "Avilog", vnclog.GetVideo());
+	myIniFile.WriteString("admin", "path", vnclog.GetPath());
+	myIniFile.WriteInt("admin", "DebugLevel", vnclog.GetLevel());
+	myIniFile.WriteInt("admin", "AllowLoopback", m_server->LoopbackOk());
+	myIniFile.WriteInt("admin", "LoopbackOnly", m_server->LoopbackOnly());
+	myIniFile.WriteInt("admin", "AllowShutdown", m_allowshutdown);
+	myIniFile.WriteInt("admin", "AllowProperties",  m_allowproperties);
+	myIniFile.WriteInt("admin", "AllowEditClients", m_alloweditclients);
+    myIniFile.WriteInt("admin", "FileTransferTimeout", m_ftTimeout);
+    myIniFile.WriteInt("admin", "KeepAliveInterval", m_keepAliveInterval);
+	// adzm 2010-08
+    myIniFile.WriteInt("admin", "SocketKeepAliveTimeout", m_socketKeepAliveTimeout);
+
+	myIniFile.WriteInt("admin", "DisableTrayIcon", m_server->GetDisableTrayIcon());
+	myIniFile.WriteInt("admin", "MSLogonRequired", m_server->MSLogonRequired());
+	// Marscha at 2004 - authSSP: save "New MS-Logon" state
+	myIniFile.WriteInt("admin", "NewMSLogon", m_server->GetNewMSLogon());
+	// sf at 2003 - DSM params here
+	myIniFile.WriteInt("admin", "UseDSMPlugin", m_server->IsDSMPluginEnabled());
+	myIniFile.WriteInt("admin", "ConnectPriority", m_server->ConnectPriority());
+	myIniFile.WriteString("admin", "DSMPlugin",m_server->GetDSMPluginName());
+
+	//adzm 2010-05-12 - dsmplugin config
+	myIniFile.WriteString("admin", "DSMPluginConfig", m_server->GetDSMPluginConfig());
+
+	if (use_uac==true)
+	{
+	myIniFile.copy_to_secure();
+	myIniFile.IniFileSetSecure();
+	}
+}
+
+
+void vncProperties::SaveUserPrefsToIniFile()
+{
+	// SAVE THE PER USER PREFS
+	vnclog.Print(LL_INTINFO, VNCLOG("saving current settings to registry\n"));
+
+	// Modif sf at 2002
+	myIniFile.WriteInt("admin", "FileTransferEnabled", m_server->FileTransferEnabled());
+	myIniFile.WriteInt("admin", "FTUserImpersonation", m_server->FTUserImpersonation()); // sf at 2005
+	myIniFile.WriteInt("admin", "BlankMonitorEnabled", m_server->BlankMonitorEnabled());
+	myIniFile.WriteInt("admin", "BlankInputsOnly", m_server->BlankInputsOnly()); //PGM
+	myIniFile.WriteInt("admin", "CaptureAlphaBlending", m_server->CaptureAlphaBlending()); // sf at 2005
+	myIniFile.WriteInt("admin", "BlackAlphaBlending", m_server->BlackAlphaBlending()); // sf at 2005
+
+	myIniFile.WriteInt("admin", "DefaultScale", m_server->GetDefaultScale());
+
+	myIniFile.WriteInt("admin", "UseDSMPlugin", m_server->IsDSMPluginEnabled());
+	myIniFile.WriteString("admin", "DSMPlugin",m_server->GetDSMPluginName());
+
+	//adzm 2010-05-12 - dsmplugin config
+	myIniFile.WriteString("admin", "DSMPluginConfig", m_server->GetDSMPluginConfig());
+
+	myIniFile.WriteInt("admin", "primary", m_server->Primary());
+	myIniFile.WriteInt("admin", "secondary", m_server->Secondary());
+
+	// Connection prefs
+	myIniFile.WriteInt("admin", "SocketConnect", m_server->SockConnected());
+	myIniFile.WriteInt("admin", "HTTPConnect", m_server->HTTPConnectEnabled());
+	myIniFile.WriteInt("admin", "XDMCPConnect", m_server->XDMCPConnectEnabled());
+	myIniFile.WriteInt("admin", "AutoPortSelect", m_server->AutoPortSelect());
+	if (!m_server->AutoPortSelect()) {
+		myIniFile.WriteInt("admin", "PortNumber", m_server->GetPort());
+		myIniFile.WriteInt("admin", "HTTPPortNumber", m_server->GetHttpPort());
+	}
+	myIniFile.WriteInt("admin", "InputsEnabled", m_server->RemoteInputsEnabled());
+	myIniFile.WriteInt("admin", "LocalInputsDisabled", m_server->LocalInputsDisabled());
+	myIniFile.WriteInt("admin", "IdleTimeout", m_server->AutoIdleDisconnectTimeout());
+	myIniFile.WriteInt("admin", "EnableJapInput", m_server->JapInputEnabled());
+
+	// Connection querying settings
+	myIniFile.WriteInt("admin", "QuerySetting", m_server->QuerySetting());
+	myIniFile.WriteInt("admin", "QueryTimeout", m_server->QueryTimeout());
+	myIniFile.WriteInt("admin", "QueryAccept", m_server->QueryAccept());
+
+	// Lock settings
+	myIniFile.WriteInt("admin", "LockSetting", m_server->LockSettings());
+
+	// Wallpaper removal
+	myIniFile.WriteInt("admin", "RemoveWallpaper", m_server->RemoveWallpaperEnabled());
+	// UI Effects
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	myIniFile.WriteInt("admin", "RemoveEffects", m_server->RemoveEffectsEnabled());
+	myIniFile.WriteInt("admin", "RemoveFontSmoothing", m_server->RemoveFontSmoothingEnabled());
+	// Composit desktop removal
+	myIniFile.WriteInt("admin", "RemoveAero", m_server->RemoveAeroEnabled());
+
+	// Save the password
+	char passwd[MAXPWLEN];
+	m_server->GetPassword(passwd);
+	myIniFile.WritePassword(passwd);
+	memset(passwd, '\0', MAXPWLEN); //PGM
+	m_server->GetPassword2(passwd); //PGM
+	myIniFile.WritePassword2(passwd); //PGM
+}
+
+
+void vncProperties::ReloadDynamicSettings()
+{
+	char username[UNLEN+1];
+
+	// Get the user name / service name
+	if (!vncService::CurrentUser((char *)&username, sizeof(username)))
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - NO current user\n"));
+		return;
+	}
+
+	// If there is no user logged on them default to SYSTEM
+	if (strcmp(username, "") == 0)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Force USER SYSTEM 2\n"));
+		strcpy((char *)&username, "SYSTEM");
+	}
+
+	// Logging/debugging prefs
+	vnclog.SetMode(myIniFile.ReadInt("admin", "DebugMode", 0));
+	vnclog.SetLevel(myIniFile.ReadInt("admin", "DebugLevel", 0));
+}
diff --git a/ica/win32/winvnc/winvnc/vncproperties.h b/ica/win32/winvnc/winvnc/vncproperties.h
new file mode 100644
index 0000000..0b8ba53
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncproperties.h
@@ -0,0 +1,185 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+
+class vncProperties;
+
+#if (!defined(_WINVNC_VNCPROPERTIES))
+#define _WINVNC_VNCPROPERTIES
+
+// Includes
+// Marscha at 2004 - authSSP: objbase.h needed for CoInitialize etc.
+#include <objbase.h>
+
+#include "stdhdrs.h"
+#include "vncserver.h"
+#include "vncsetauth.h"
+#include "inifile.h"
+#include <userenv.h>
+// The vncProperties class itself
+class vncProperties
+{
+public:
+	// Constructor/destructor
+	vncProperties();
+	~vncProperties();
+
+	// Initialisation
+	BOOL Init(vncServer *server);
+
+	// The dialog box window proc
+	static BOOL CALLBACK DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+	// Display the properties dialog
+	// If usersettings is TRUE then the per-user settings come up
+	// If usersettings is FALSE then the default system settings come up
+	void ShowAdmin(BOOL show, BOOL usersettings);
+
+	// Loading & saving of preferences
+	void Load(BOOL usersettings);
+	void ResetRegistry();
+
+	void Save();
+
+
+	// TRAY ICON MENU SETTINGS
+	BOOL AllowProperties() {return m_allowproperties;};
+	BOOL AllowShutdown() {return m_allowshutdown;};
+	BOOL AllowEditClients() {return m_alloweditclients;};
+	bool Lock_service_helper;
+
+	BOOL m_fUseRegistry;
+	// Ini file
+	IniFile myIniFile;
+	void LoadFromIniFile();
+	void LoadUserPrefsFromIniFile();
+	void SaveToIniFile();
+	void SaveUserPrefsToIniFile();
+    void ReloadDynamicSettings();
+
+	// Implementation
+protected:
+	// The server object to which this properties object is attached.
+	vncServer *			m_server;
+
+	// Flag to indicate whether the currently loaded settings are for
+	// the current user, or are default system settings
+	BOOL				m_usersettings;
+
+	// Tray icon menu settings
+	BOOL				m_allowproperties;
+	BOOL				m_allowshutdown;
+	BOOL				m_alloweditclients;
+    int                 m_ftTimeout;
+    int                 m_keepAliveInterval;
+	int                 m_socketKeepAliveTimeout; // adzm 2010-08
+
+
+	// Password handling
+	void LoadPassword(HKEY k, char *buffer);
+	void SavePassword(HKEY k, char *buffer);
+	void LoadPassword2(HKEY k, char *buffer); //PGM
+	void SavePassword2(HKEY k, char *buffer); //PGM
+
+	// String handling
+	char * LoadString(HKEY k, LPCSTR valname);
+	void SaveString(HKEY k, LPCSTR valname, const char *buffer);
+
+	// Manipulate the registry settings
+	LONG LoadInt(HKEY key, LPCSTR valname, LONG defval);
+	void SaveInt(HKEY key, LPCSTR valname, LONG val);
+
+	// Loading/saving all the user prefs
+	void LoadUserPrefs(HKEY appkey);
+	void SaveUserPrefs(HKEY appkey);
+
+	// Making the loaded user prefs active
+	void ApplyUserPrefs();
+	
+	BOOL m_returncode_valid;
+	BOOL m_dlgvisible;
+
+	// STORAGE FOR THE PROPERTIES PRIOR TO APPLICATION
+	BOOL m_pref_SockConnect;
+	BOOL m_pref_HTTPConnect;
+	BOOL m_pref_XDMCPConnect;
+	BOOL m_pref_AutoPortSelect;
+	LONG m_pref_PortNumber;
+	LONG m_pref_HttpPortNumber;  // TightVNC 1.1.7
+	char m_pref_passwd[MAXPWLEN];
+	char m_pref_passwd2[MAXPWLEN]; //PGM
+	UINT m_pref_QuerySetting;
+	// Marscha at 2006 - Is AcceptDialog required even if no user is logged on
+	UINT m_pref_QueryIfNoLogon;
+	UINT m_pref_QueryAccept;
+	UINT m_pref_QueryTimeout;
+	UINT m_pref_IdleTimeout;
+	BOOL m_pref_RemoveWallpaper;
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	BOOL m_pref_RemoveEffects;
+	BOOL m_pref_RemoveFontSmoothing;
+	BOOL m_pref_RemoveAero;
+	BOOL m_pref_EnableRemoteInputs;
+	int m_pref_LockSettings;
+	BOOL m_pref_DisableLocalInputs;
+	BOOL m_pref_EnableJapInput;
+	BOOL m_pref_clearconsole;
+
+	// Modif sf at 2002
+	// [v1.0.2-jp2 fix]
+	BOOL m_pref_SingleWindow;
+	BOOL m_pref_EnableFileTransfer;
+	BOOL m_pref_FTUserImpersonation;
+	BOOL m_pref_EnableBlankMonitor;
+	BOOL m_pref_BlankInputsOnly; //PGM
+	int  m_pref_DefaultScale;
+	BOOL m_pref_RequireMSLogon;
+	BOOL m_pref_CaptureAlphaBlending;
+	BOOL m_pref_BlackAlphaBlending;
+//	BOOL m_pref_GammaGray;	// [v1.0.2-jp1 fix1]
+
+	
+	// Marscha at 2004 - authSSP: added state of "New MS-Logon"
+	BOOL m_pref_NewMSLogon;
+
+	BOOL m_pref_UseDSMPlugin;
+	char m_pref_szDSMPlugin[128];
+	//adzm 2010-05-12 - dsmplugin config
+	char m_pref_DSMPluginConfig[512];
+
+    void LoadDSMPluginName(HKEY key, char *buffer);
+	void SaveDSMPluginName(HKEY key, char *buffer); 
+	vncSetAuth		m_vncauth;
+
+	char m_pref_path111[500];
+	char m_Tempfile[MAX_PATH];
+	BOOL m_pref_Primary;
+	BOOL m_pref_Secondary;
+
+private:
+	void InitPortSettings(HWND hwnd); // TightVNC 1.1.7
+
+
+};
+
+#endif // _WINVNC_VNCPROPERTIES
diff --git a/ica/win32/winvnc/winvnc/vncpropertiesPoll.cpp b/ica/win32/winvnc/winvnc/vncpropertiesPoll.cpp
new file mode 100644
index 0000000..e2d8f02
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncpropertiesPoll.cpp
@@ -0,0 +1,1049 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 TightVNC. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncPropertiesPoll.cpp
+
+// Implementation of the Properties dialog!
+
+#include "stdhdrs.h"
+#include "lmcons.h"
+#include "vncservice.h"
+
+#include "winvnc.h"
+#include "vncpropertiesPoll.h"
+#include "vncserver.h"
+#include "vncOSVersion.h"
+#include "common/win32_helpers.h"
+
+
+#include "Localization.h" // ACT : Add localization on messages
+
+// [v1.0.2-jp1 fix] Load resouce from dll
+extern HINSTANCE	hInstResDLL;
+
+bool RunningAsAdministrator ();
+const char WINVNC_REGISTRY_KEY [] = "Software\\ORL\\WinVNC3";
+DWORD GetExplorerLogonPid();
+
+// Constructor & Destructor
+vncPropertiesPoll::vncPropertiesPoll()
+{
+	m_dlgvisible = FALSE;
+	m_usersettings = TRUE;
+}
+
+vncPropertiesPoll::~vncPropertiesPoll()
+{
+}
+
+// Initialisation
+BOOL
+vncPropertiesPoll::Init(vncServer *server)
+{
+	// Save the server pointer
+	m_server = server;	
+
+	// sf at 2007 - Registry mode can still be forced for backward compatibility and OS version < Vista
+	m_fUseRegistry = TRUE;//((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+
+	// Load the settings
+	if (m_fUseRegistry)
+		Load(TRUE);
+	else
+		LoadFromIniFile();
+
+	return TRUE;
+}
+
+// Dialog box handling functions
+void
+vncPropertiesPoll::Show(BOOL show, BOOL usersettings)
+{
+	HANDLE hProcess=NULL;
+	HANDLE hPToken=NULL;
+	//DWORD id=GetExplorerLogonPid();
+	int iImpersonateResult=0;
+	{
+		char WORKDIR[MAX_PATH];
+		if (!GetTempPath(MAX_PATH,WORKDIR))
+			{
+				//Function failed, just set something
+				if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+				{
+					char* p = strrchr(WORKDIR, '\\');
+					if (p == NULL) return;
+					*p = '\0';
+				}
+					strcpy(m_Tempfile,"");
+					strcat(m_Tempfile,WORKDIR);//set the directory
+					strcat(m_Tempfile,"\\");
+					strcat(m_Tempfile,INIFILE_NAME);
+		}
+		else
+		{
+			strcpy(m_Tempfile,"");
+			strcat(m_Tempfile,WORKDIR);//set the directory
+			strcat(m_Tempfile,INIFILE_NAME);
+		}
+	}
+/*	if (id!=0) 
+			{
+				hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,id);
+				if(OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+										|TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+										|TOKEN_READ|TOKEN_WRITE,&hPToken))
+				{
+					ImpersonateLoggedOnUser(hPToken);
+					iImpersonateResult = GetLastError();
+					if(iImpersonateResult == ERROR_SUCCESS)
+					{
+						ExpandEnvironmentStringsForUser(hPToken, "%TEMP%", m_Tempfile, MAX_PATH);
+						strcat(m_Tempfile,"\\");
+						strcat(m_Tempfile,INIFILE_NAME);
+					}
+				}
+			}*/
+
+	if (show)
+	{
+
+		if (!m_fUseRegistry) // Use the ini file
+		{
+			// We're trying to edit the default local settings - verify that we can
+			/*
+			if (!myIniFile.IsWritable())
+			{
+				if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+				CloseHandle(hProcess);
+				CloseHandle(hPToken);
+				return;
+			}
+			*/
+		}
+		else // Use the registry
+		{
+			// Verify that we know who is logged on
+			if (usersettings) {
+				char username[UNLEN+1];
+				if (!vncService::CurrentUser(username, sizeof(username)))
+				{
+					if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+					CloseHandle(hProcess);
+					CloseHandle(hPToken);
+					return;
+				}
+				if (strcmp(username, "") == 0) {
+					MessageBoxSecure(NULL, sz_ID_NO_CURRENT_USER_ERR, sz_ID_WINVNC_ERROR, MB_OK | MB_ICONEXCLAMATION);
+					if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+					CloseHandle(hProcess);
+					CloseHandle(hPToken);
+					return;
+				}
+			} else {
+				// We're trying to edit the default local settings - verify that we can
+				HKEY hkLocal=NULL;
+				HKEY hkDefault=NULL;
+				BOOL canEditDefaultPrefs = 1;
+				DWORD dw;
+				if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+					WINVNC_REGISTRY_KEY,
+					0, REG_NONE, REG_OPTION_NON_VOLATILE,
+					KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+					canEditDefaultPrefs = 0;
+				else if (RegCreateKeyEx(hkLocal,
+					"Default",
+					0, REG_NONE, REG_OPTION_NON_VOLATILE,
+					KEY_WRITE | KEY_READ, NULL, &hkDefault, &dw) != ERROR_SUCCESS)
+					canEditDefaultPrefs = 0;
+				if (hkLocal) RegCloseKey(hkLocal);
+				if (hkDefault) RegCloseKey(hkDefault);
+
+				if (!canEditDefaultPrefs) {
+					MessageBoxSecure(NULL, sz_ID_CANNOT_EDIT_DEFAULT_PREFS, sz_ID_WINVNC_ERROR, MB_OK | MB_ICONEXCLAMATION);
+					if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+					if (hProcess) CloseHandle(hProcess);
+					if (hPToken) CloseHandle(hPToken);
+					return;
+				}
+			}
+		}
+
+		// Now, if the dialog is not already displayed, show it!
+		if (!m_dlgvisible)
+		{
+			if (m_fUseRegistry) 
+			{
+				if (usersettings)
+					vnclog.Print(LL_INTINFO, VNCLOG("show per-user Properties\n"));
+				else
+					vnclog.Print(LL_INTINFO, VNCLOG("show default system Properties\n"));
+
+				// Load in the settings relevant to the user or system
+				//Load(usersettings);
+				m_usersettings=usersettings;
+				// Load in the settings relevant to the user or system
+				Load(usersettings);
+			}
+			else
+				LoadFromIniFile();
+
+
+			for (;;)
+			{
+				m_returncode_valid = FALSE;
+
+				// Do the dialog box
+				// [v1.0.2-jp1 fix]
+				//int result = DialogBoxParam(hAppInstance,
+				int result = DialogBoxParam(hInstResDLL,
+				    MAKEINTRESOURCE(IDD_PROPERTIES), 
+				    NULL,
+				    (DLGPROC) DialogProcPoll,
+				    (LONG_PTR) this);
+
+				if (!m_returncode_valid)
+				    result = IDCANCEL;
+
+				vnclog.Print(LL_INTINFO, VNCLOG("dialog result = %d\n"), result);
+
+				if (result == -1)
+				{
+					// Dialog box failed, so quit
+					PostQuitMessage(0);
+					if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+					CloseHandle(hProcess);
+					CloseHandle(hPToken);
+					return;
+				}
+				break;
+				omni_thread::sleep(4);
+			}
+
+			// Load in all the settings
+			if (!vncService::RunningAsService())
+			{
+			if (m_fUseRegistry) 
+				Load(TRUE);
+			else
+				LoadFromIniFile();
+			}
+		}
+	}
+	if(iImpersonateResult == ERROR_SUCCESS)RevertToSelf();
+	if (hProcess) CloseHandle(hProcess);
+	if (hPToken) CloseHandle(hPToken);
+}
+
+
+
+
+BOOL CALLBACK
+vncPropertiesPoll::DialogProcPoll(HWND hwnd,
+						  UINT uMsg,
+						  WPARAM wParam,
+						  LPARAM lParam )
+{
+	// We use the dialog-box's USERDATA to store a _this pointer
+	// This is set only once WM_INITDIALOG has been recieved, though!
+    vncPropertiesPoll *_this = helper::SafeGetWindowUserData<vncPropertiesPoll>(hwnd);
+
+	switch (uMsg)
+	{
+
+	case WM_INITDIALOG:
+		{
+			// Retrieve the Dialog box parameter and use it as a pointer
+			// to the calling vncPropertiesPoll object
+            helper::SafeSetWindowUserData(hwnd, lParam);
+
+			_this = (vncPropertiesPoll *) lParam;
+			_this->m_dlgvisible = TRUE;
+
+			if (_this->m_fUseRegistry)
+			{
+				_this->Load(_this->m_usersettings);
+
+				// Set the dialog box's title to indicate which Properties we're editting
+				if (_this->m_usersettings) {
+					SetWindowText(hwnd, sz_ID_CURRENT_USER_PROP);
+				} else {
+					SetWindowText(hwnd, sz_ID_DEFAULT_SYST_PROP);
+				}
+			}
+			else
+			{
+				//LoadFromIniFile();
+			}
+
+			// Modif sf at 2002
+
+		   SetDlgItemInt(hwnd, IDC_MAXCPU, _this->m_server->MaxCpu(), false);
+
+		   HWND hTurboMode = GetDlgItem(hwnd, IDC_TURBOMODE);
+           SendMessage(hTurboMode, BM_SETCHECK, _this->m_server->TurboMode(), 0);
+
+			// Set the polling options
+			HWND hDriver = GetDlgItem(hwnd, IDC_DRIVER);
+			SendMessage(hDriver,
+				BM_SETCHECK,
+				_this->m_server->Driver(),0);
+
+			if (OSversion()==3) // If NT4 or below, no driver
+			{
+				SendMessage(hDriver,BM_SETCHECK,false,0);
+				_this->m_server->Driver(false);
+				EnableWindow(hDriver, false);
+			}
+
+			HWND hHook = GetDlgItem(hwnd, IDC_HOOK);
+			SendMessage(hHook,
+				BM_SETCHECK,
+				_this->m_server->Hook(),
+				0);
+
+			HWND hPollFullScreen = GetDlgItem(hwnd, IDC_POLL_FULLSCREEN);
+			SendMessage(hPollFullScreen,
+				BM_SETCHECK,
+				_this->m_server->PollFullScreen(),
+				0);
+
+			HWND hPollForeground = GetDlgItem(hwnd, IDC_POLL_FOREGROUND);
+			SendMessage(hPollForeground,
+				BM_SETCHECK,
+				_this->m_server->PollForeground(),
+				0);
+
+			HWND hPollUnderCursor = GetDlgItem(hwnd, IDC_POLL_UNDER_CURSOR);
+			SendMessage(hPollUnderCursor,
+				BM_SETCHECK,
+				_this->m_server->PollUnderCursor(),
+				0);
+
+			HWND hPollConsoleOnly = GetDlgItem(hwnd, IDC_CONSOLE_ONLY);
+			SendMessage(hPollConsoleOnly,
+				BM_SETCHECK,
+				_this->m_server->PollConsoleOnly(),
+				0);
+			EnableWindow(hPollConsoleOnly,
+				_this->m_server->PollUnderCursor() || _this->m_server->PollForeground()
+				);
+
+			HWND hPollOnEventOnly = GetDlgItem(hwnd, IDC_ONEVENT_ONLY);
+			SendMessage(hPollOnEventOnly,
+				BM_SETCHECK,
+				_this->m_server->PollOnEventOnly(),
+				0);
+			EnableWindow(hPollOnEventOnly,
+				_this->m_server->PollUnderCursor() || _this->m_server->PollForeground()
+				);
+
+			// [v1.0.2-jp2 fix-->]
+			HWND hSingleWindow = GetDlgItem(hwnd, IDC_SINGLE_WINDOW);
+			SendMessage(hSingleWindow, BM_SETCHECK, _this->m_server->SingleWindow(), 0);
+
+			HWND hWindowName = GetDlgItem(hwnd, IDC_NAME_APPLI);
+			if ( _this->m_server->GetWindowName() != NULL){
+			   SetDlgItemText(hwnd, IDC_NAME_APPLI,_this->m_server->GetWindowName());
+			}
+			EnableWindow(hWindowName, _this->m_server->SingleWindow());
+			// [<--v1.0.2-jp2 fix]
+
+			SetForegroundWindow(hwnd);
+
+			return FALSE; // Because we've set the focus
+		}
+
+	case WM_COMMAND:
+		switch (LOWORD(wParam))
+		{
+
+		case IDOK:
+		case IDC_APPLY:
+			{
+				
+
+				int maxcpu = GetDlgItemInt(hwnd, IDC_MAXCPU, NULL, FALSE);
+				_this->m_server->MaxCpu(maxcpu);
+
+				// Modif sf at 2002
+				HWND hTurboMode = GetDlgItem(hwnd, IDC_TURBOMODE);
+				_this->m_server->TurboMode(SendMessage(hTurboMode, BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+				// Handle the polling stuff
+				HWND hDriver = GetDlgItem(hwnd, IDC_DRIVER);
+				bool result=(SendMessage(hDriver, BM_GETCHECK, 0, 0) == BST_CHECKED);
+				if (result)
+				{
+					_this->m_server->Driver(CheckVideoDriver(0));
+				}
+				else _this->m_server->Driver(false);
+				HWND hHook = GetDlgItem(hwnd, IDC_HOOK);
+				_this->m_server->Hook(
+					SendMessage(hHook, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+				HWND hPollFullScreen = GetDlgItem(hwnd, IDC_POLL_FULLSCREEN);
+				_this->m_server->PollFullScreen(
+					SendMessage(hPollFullScreen, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				HWND hPollForeground = GetDlgItem(hwnd, IDC_POLL_FOREGROUND);
+				_this->m_server->PollForeground(
+					SendMessage(hPollForeground, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				HWND hPollUnderCursor = GetDlgItem(hwnd, IDC_POLL_UNDER_CURSOR);
+				_this->m_server->PollUnderCursor(
+					SendMessage(hPollUnderCursor, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				HWND hPollConsoleOnly = GetDlgItem(hwnd, IDC_CONSOLE_ONLY);
+				_this->m_server->PollConsoleOnly(
+					SendMessage(hPollConsoleOnly, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				HWND hPollOnEventOnly = GetDlgItem(hwnd, IDC_ONEVENT_ONLY);
+				_this->m_server->PollOnEventOnly(
+					SendMessage(hPollOnEventOnly, BM_GETCHECK, 0, 0) == BST_CHECKED
+					);
+
+				// [v1.0.2-jp2 fix-->] Move to vncpropertiesPoll.cpp
+				HWND hSingleWindow = GetDlgItem(hwnd, IDC_SINGLE_WINDOW);
+				_this->m_server->SingleWindow(SendMessage(hSingleWindow, BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+				char szName[32];
+				if (GetDlgItemText(hwnd, IDC_NAME_APPLI, (LPSTR) szName, 32) == 0){
+					vnclog.Print(LL_INTINFO,VNCLOG("Error while reading Window Name %d \n"), GetLastError());
+				}
+				else{
+					_this->m_server->SetSingleWindowName(szName);
+				}
+				// [<--v1.0.2-jp2 fix] Move to vncpropertiesPoll.cpp
+
+				// Save the settings
+				if (_this->m_fUseRegistry)
+					_this->Save();
+				else
+					_this->SaveToIniFile();
+
+				// Was ok pressed?
+				if (LOWORD(wParam) == IDOK)
+				{
+					// Yes, so close the dialog
+					vnclog.Print(LL_INTINFO, VNCLOG("enddialog (OK)\n"));
+
+					_this->m_returncode_valid = TRUE;
+
+					EndDialog(hwnd, IDOK);
+					_this->m_dlgvisible = FALSE;
+				}
+
+				_this->m_server->SetHookings();
+
+				return TRUE;
+			}
+
+		// [v1.0.2-jp2 fix-->] Move to vncpropertiesPoll.cpp
+		 case IDC_SINGLE_WINDOW:
+			 {
+				 HWND hSingleWindow = GetDlgItem(hwnd, IDC_SINGLE_WINDOW);
+				 BOOL fSingleWindow = (SendMessage(hSingleWindow, BM_GETCHECK,0, 0) == BST_CHECKED);
+				 HWND hWindowName   = GetDlgItem(hwnd, IDC_NAME_APPLI);
+				 EnableWindow(hWindowName, fSingleWindow);
+			 }
+			 return TRUE;
+		// [<--v1.0.2-jp2 fix] Move to vncpropertiesPoll.cpp
+
+		 case IDCANCEL:
+			vnclog.Print(LL_INTINFO, VNCLOG("enddialog (CANCEL)\n"));
+
+			_this->m_returncode_valid = TRUE;
+
+			EndDialog(hwnd, IDCANCEL);
+			_this->m_dlgvisible = FALSE;
+			return TRUE;
+		
+
+		case IDC_POLL_FOREGROUND:
+		case IDC_POLL_UNDER_CURSOR:
+			// User has clicked on one of the polling mode buttons
+			// affected by the pollconsole and pollonevent options
+			{
+				// Get the poll-mode buttons
+				HWND hPollForeground = GetDlgItem(hwnd, IDC_POLL_FOREGROUND);
+				HWND hPollUnderCursor = GetDlgItem(hwnd, IDC_POLL_UNDER_CURSOR);
+
+				// Determine whether to enable the modifier options
+				BOOL enabled = (SendMessage(hPollForeground, BM_GETCHECK, 0, 0) == BST_CHECKED) ||
+					(SendMessage(hPollUnderCursor, BM_GETCHECK, 0, 0) == BST_CHECKED);
+
+				HWND hPollConsoleOnly = GetDlgItem(hwnd, IDC_CONSOLE_ONLY);
+				EnableWindow(hPollConsoleOnly, enabled);
+
+				HWND hPollOnEventOnly = GetDlgItem(hwnd, IDC_ONEVENT_ONLY);
+				EnableWindow(hPollOnEventOnly, enabled);
+			}
+			return TRUE;
+
+		
+		case IDC_CHECKDRIVER:
+			{
+				CheckVideoDriver(1);
+			}
+			return TRUE;
+		
+
+
+
+		}
+		break;
+	}
+	return 0;
+}
+
+
+
+#ifdef ULTRAVNC_ITALC_SUPPORT
+extern BOOL ultravnc_italc_load_int( LPCSTR valname, LONG *out );
+#endif
+
+// Functions to load & save the settings
+LONG
+vncPropertiesPoll::LoadInt(HKEY key, LPCSTR valname, LONG defval)
+{
+	LONG pref;
+	ULONG type = REG_DWORD;
+	ULONG prefsize = sizeof(pref);
+
+#ifdef ULTRAVNC_ITALC_SUPPORT
+	LONG out;
+	if( ultravnc_italc_load_int( valname, &out ) )
+	{
+		return out;
+	}
+#endif
+	if (RegQueryValueEx(key,
+		valname,
+		NULL,
+		&type,
+		(LPBYTE) &pref,
+		&prefsize) != ERROR_SUCCESS)
+		return defval;
+
+	if (type != REG_DWORD)
+		return defval;
+
+	if (prefsize != sizeof(pref))
+		return defval;
+
+	return pref;
+}
+
+void
+vncPropertiesPoll::LoadSingleWindowName(HKEY key, char *buffer)
+{
+	DWORD type = REG_BINARY;
+	int slen=32;
+	char inouttext[32];
+
+	if (RegQueryValueEx(key,
+		"SingleWindowName",
+		NULL,
+		&type,
+		(LPBYTE) &inouttext,
+		(LPDWORD) &slen) != ERROR_SUCCESS)
+		return;
+
+	if (slen > MAXPATH)
+		return;
+
+	memcpy(buffer, inouttext, 32);
+}
+
+char *
+vncPropertiesPoll::LoadString(HKEY key, LPCSTR keyname)
+{
+	DWORD type = REG_SZ;
+	DWORD buflen = 0;
+	BYTE *buffer = 0;
+
+	// Get the length of the AuthHosts string
+	if (RegQueryValueEx(key,
+		keyname,
+		NULL,
+		&type,
+		NULL,
+		&buflen) != ERROR_SUCCESS)
+		return 0;
+
+	if (type != REG_SZ)
+		return 0;
+	buffer = new BYTE[buflen];
+	if (buffer == 0)
+		return 0;
+
+	// Get the AuthHosts string data
+	if (RegQueryValueEx(key,
+		keyname,
+		NULL,
+		&type,
+		buffer,
+		&buflen) != ERROR_SUCCESS) {
+		delete [] buffer;
+		return 0;
+	}
+
+	// Verify the type
+	if (type != REG_SZ) {
+		delete [] buffer;
+		return 0;
+	}
+
+	return (char *)buffer;
+}
+
+void
+vncPropertiesPoll::ResetRegistry()
+{	
+	vnclog.Print(LL_CLIENTS, VNCLOG("Reset Reg\n"));
+	char username[UNLEN+1];
+	HKEY hkLocal, hkLocalUser, hkDefault;
+	DWORD dw;
+
+	if (!vncService::CurrentUser((char *)&username, sizeof(username)))
+		return;
+
+	// If there is no user logged on them default to SYSTEM
+	if (strcmp(username, "") == 0)
+		strcpy((char *)&username, "SYSTEM");
+
+	// Try to get the machine registry key for WinVNC
+	if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+		WINVNC_REGISTRY_KEY,
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+		{
+		hkLocalUser=NULL;
+		hkDefault=NULL;
+		goto LABELUSERSETTINGS;
+		}
+
+	// Now try to get the per-user local key
+	if (RegOpenKeyEx(hkLocal,
+		username,
+		0, KEY_READ,
+		&hkLocalUser) != ERROR_SUCCESS)
+		hkLocalUser = NULL;
+
+	// Get the default key
+	if (RegCreateKeyEx(hkLocal,
+		"Default",
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ,
+		NULL,
+		&hkDefault,
+		&dw) != ERROR_SUCCESS)
+		hkDefault = NULL;
+
+	if (hkLocalUser != NULL) RegCloseKey(hkLocalUser);
+	if (hkDefault != NULL) RegCloseKey(hkDefault);
+	if (hkLocal != NULL) RegCloseKey(hkLocal);
+	RegCloseKey(HKEY_LOCAL_MACHINE);
+LABELUSERSETTINGS:
+	if ((strcmp(username, "SYSTEM") != 0))
+		{
+			HKEY hkGlobalUser;
+			if (RegCreateKeyEx(HKEY_CURRENT_USER,
+				WINVNC_REGISTRY_KEY,
+				0, REG_NONE, REG_OPTION_NON_VOLATILE,
+				KEY_READ, NULL, &hkGlobalUser, &dw) == ERROR_SUCCESS)
+			{
+				RegCloseKey(hkGlobalUser);
+				RegCloseKey(HKEY_CURRENT_USER);
+			}
+		}
+
+}
+
+void
+vncPropertiesPoll::Load(BOOL usersettings)
+{
+//	if (m_dlgvisible) {
+//		vnclog.Print(LL_INTWARN, VNCLOG("service helper invoked while Properties panel displayed\n"));
+//		return;
+//	}
+	ResetRegistry();
+	
+	char username[UNLEN+1];
+	HKEY hkLocal, hkLocalUser, hkDefault;
+	DWORD dw;
+	
+	// NEW (R3) PREFERENCES ALGORITHM
+	// 1.	Look in HKEY_LOCAL_MACHINE/Software/ORL/WinVNC3/%username%
+	//		for sysadmin-defined, user-specific settings.
+	// 2.	If not found, fall back to %username%=Default
+	// 3.	If AllowOverrides is set then load settings from
+	//		HKEY_CURRENT_USER/Software/ORL/WinVNC3
+
+	// GET THE CORRECT KEY TO READ FROM
+
+	// Get the user name / service name
+	if (!vncService::CurrentUser((char *)&username, sizeof(username)))
+		return;
+
+	// If there is no user logged on them default to SYSTEM
+	if (strcmp(username, "") == 0)
+		strcpy((char *)&username, "SYSTEM");
+
+	// Try to get the machine registry key for WinVNC
+	if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+		WINVNC_REGISTRY_KEY,
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+		{
+		hkLocalUser=NULL;
+		hkDefault=NULL;
+		goto LABELUSERSETTINGS;
+		}
+
+	// Now try to get the per-user local key
+	if (RegOpenKeyEx(hkLocal,
+		username,
+		0, KEY_READ,
+		&hkLocalUser) != ERROR_SUCCESS)
+		hkLocalUser = NULL;
+
+	// Get the default key
+	if (RegCreateKeyEx(hkLocal,
+		"Default",
+		0, REG_NONE, REG_OPTION_NON_VOLATILE,
+		KEY_READ,
+		NULL,
+		&hkDefault,
+		&dw) != ERROR_SUCCESS)
+		hkDefault = NULL;
+
+
+LABELUSERSETTINGS:
+	// LOAD THE USER PREFERENCES
+
+	// Set the default user prefs
+	vnclog.Print(LL_INTINFO, VNCLOG("clearing user settings\n"));
+	m_pref_TurboMode = ((vncService::VersionMajor() >= 6) ? TRUE : FALSE);
+	m_pref_PollUnderCursor=FALSE;
+	m_pref_PollForeground= TRUE;
+	m_pref_PollFullScreen= ((vncService::VersionMajor() >= 6) ? FALSE : TRUE);
+	m_pref_PollConsoleOnly=FALSE;
+	m_pref_PollOnEventOnly=TRUE;
+	m_pref_MaxCpu=40;
+	m_pref_Driver=CheckVideoDriver(0);
+	m_pref_Hook=TRUE;
+	m_pref_Virtual=FALSE;
+
+	// [v1.0.2-jp2 fix]
+	m_pref_SingleWindow = 0;
+	*m_pref_szSingleWindowName = '\0';
+
+	// Load the local prefs for this user
+	if (hkDefault != NULL)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("loading DEFAULT local settings\n"));
+		LoadUserPrefsPoll(hkDefault);
+	}
+
+	
+	if (m_usersettings) {
+		// We want the user settings, so load them!
+
+		if (hkLocalUser != NULL)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("loading \"%s\" local settings\n"), username);
+			LoadUserPrefsPoll(hkLocalUser);
+		}
+
+		// Now override the system settings with the user's settings
+		// If the username is SYSTEM then don't try to load them, because there aren't any...
+		if ((strcmp(username, "SYSTEM") != 0))
+		{
+			HKEY hkGlobalUser;
+			if (RegCreateKeyEx(HKEY_CURRENT_USER,
+				WINVNC_REGISTRY_KEY,
+				0, REG_NONE, REG_OPTION_NON_VOLATILE,
+				KEY_READ, NULL, &hkGlobalUser, &dw) == ERROR_SUCCESS)
+			{
+				vnclog.Print(LL_INTINFO, VNCLOG("loading \"%s\" global settings\n"), username);
+				LoadUserPrefsPoll(hkGlobalUser);
+				RegCloseKey(hkGlobalUser);
+
+				// Close the user registry hive so it can unload if required
+				RegCloseKey(HKEY_CURRENT_USER);
+			}
+		}
+	}
+
+	if (hkLocalUser != NULL) RegCloseKey(hkLocalUser);
+	if (hkDefault != NULL) RegCloseKey(hkDefault);
+	if (hkLocal != NULL) RegCloseKey(hkLocal);
+
+	// Make the loaded settings active..
+	ApplyUserPrefs();
+
+	// Note whether we loaded the user settings or just the default system settings
+	m_usersettings = usersettings;
+}
+
+
+void
+vncPropertiesPoll::LoadUserPrefsPoll(HKEY appkey)
+{
+	m_pref_TurboMode = LoadInt(appkey, "TurboMode", m_pref_TurboMode);
+	// Polling prefs
+	m_pref_PollUnderCursor=LoadInt(appkey, "PollUnderCursor", m_pref_PollUnderCursor);
+	m_pref_PollForeground=LoadInt(appkey, "PollForeground", m_pref_PollForeground);
+	m_pref_PollFullScreen=LoadInt(appkey, "PollFullScreen", m_pref_PollFullScreen);
+	m_pref_PollConsoleOnly=LoadInt(appkey, "OnlyPollConsole", m_pref_PollConsoleOnly);
+	m_pref_PollOnEventOnly=LoadInt(appkey, "OnlyPollOnEvent", m_pref_PollOnEventOnly);
+	m_pref_MaxCpu=LoadInt(appkey, "MaxCpu", m_pref_MaxCpu);
+	if (m_pref_MaxCpu==0) m_pref_MaxCpu=100;
+	m_pref_Driver=LoadInt(appkey, "EnableDriver", m_pref_Driver);
+	if (m_pref_Driver)m_pref_Driver=CheckVideoDriver(0);
+	m_pref_Hook=LoadInt(appkey, "EnableHook", m_pref_Hook);
+	m_pref_Virtual=LoadInt(appkey, "EnableVirtual", m_pref_Virtual);
+	// [v1.0.2-jp2 fix]
+	m_pref_SingleWindow=LoadInt(appkey, "SingleWindow", m_pref_SingleWindow);
+	LoadSingleWindowName(appkey, m_pref_szSingleWindowName);
+
+}
+
+void
+vncPropertiesPoll::ApplyUserPrefs()
+{
+	// APPLY THE CACHED PREFERENCES TO THE SERVER
+
+	
+    m_server->TurboMode(m_pref_TurboMode);
+	// Polling prefs
+	m_server->PollUnderCursor(m_pref_PollUnderCursor);
+	m_server->PollForeground(m_pref_PollForeground);
+	m_server->PollFullScreen(m_pref_PollFullScreen);
+	m_server->PollConsoleOnly(m_pref_PollConsoleOnly);
+	m_server->PollOnEventOnly(m_pref_PollOnEventOnly);
+	m_server->MaxCpu(m_pref_MaxCpu);	
+	if (CheckVideoDriver(0) && m_pref_Driver) m_server->Driver(m_pref_Driver);
+	else m_server->Driver(false);
+	m_server->Hook(m_pref_Hook);
+	m_server->Virtual(m_pref_Virtual);
+	// [v1.0.2-jp2 fix]
+	m_server->SingleWindow(m_pref_SingleWindow);
+	m_server->SetSingleWindowName(m_pref_szSingleWindowName);
+
+}
+
+void
+vncPropertiesPoll::SaveInt(HKEY key, LPCSTR valname, LONG val)
+{
+	RegSetValueEx(key, valname, 0, REG_DWORD, (LPBYTE) &val, sizeof(val));
+}
+
+// [v1.0.2-jp2 fix-->]
+void
+vncPropertiesPoll::SaveString(HKEY key,LPCSTR valname, const char *buffer)
+{
+	RegSetValueEx(key, valname, 0, REG_BINARY, (LPBYTE) buffer, strlen(buffer)+1);
+}
+// [<--v1.0.2-jp2 fix]
+
+void
+vncPropertiesPoll::Save()
+{
+	HKEY appkey;
+	DWORD dw;
+
+	// NEW (R3) PREFERENCES ALGORITHM
+	// The user's prefs are only saved if the user is allowed to override
+	// the machine-local settings specified for them.  Otherwise, the
+	// properties entry on the tray icon menu will be greyed out.
+
+	// GET THE CORRECT KEY TO READ FROM
+
+	if (m_usersettings) {
+		// Verify that we know who is logged on
+		char username[UNLEN+1];
+		if (!vncService::CurrentUser((char *)&username, sizeof(username)))
+			return;
+		if (strcmp(username, "") == 0)
+			return;
+
+		// Try to get the per-user, global registry key for WinVNC
+		if (RegCreateKeyEx(HKEY_CURRENT_USER,
+			WINVNC_REGISTRY_KEY,
+			0, REG_NONE, REG_OPTION_NON_VOLATILE,
+			KEY_WRITE | KEY_READ, NULL, &appkey, &dw) != ERROR_SUCCESS)
+			return;
+	} else {
+		// Try to get the default local registry key for WinVNC
+		HKEY hkLocal;
+		if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+			WINVNC_REGISTRY_KEY,
+			0, REG_NONE, REG_OPTION_NON_VOLATILE,
+			KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS) {
+			MessageBoxSecure(NULL, sz_ID_MB1, sz_ID_WVNC, MB_OK);
+			return;
+		}
+
+		if (RegCreateKeyEx(hkLocal,
+			"Default",
+			0, REG_NONE, REG_OPTION_NON_VOLATILE,
+			KEY_WRITE | KEY_READ, NULL, &appkey, &dw) != ERROR_SUCCESS) {
+			RegCloseKey(hkLocal);
+			return;
+		}
+		RegCloseKey(hkLocal);
+	}
+
+	// SAVE PER-USER PREFS IF ALLOWED
+	SaveUserPrefsPoll(appkey);
+	RegCloseKey(appkey);
+	RegCloseKey(HKEY_CURRENT_USER);
+
+}
+
+void
+vncPropertiesPoll::SaveUserPrefsPoll(HKEY appkey)
+{
+	SaveInt(appkey, "TurboMode", m_server->TurboMode());
+	// Polling prefs
+	SaveInt(appkey, "PollUnderCursor", m_server->PollUnderCursor());
+	SaveInt(appkey, "PollForeground", m_server->PollForeground());
+	SaveInt(appkey, "PollFullScreen", m_server->PollFullScreen());
+
+	SaveInt(appkey, "OnlyPollConsole", m_server->PollConsoleOnly());
+	SaveInt(appkey, "OnlyPollOnEvent", m_server->PollOnEventOnly());
+	SaveInt(appkey, "MaxCpu", m_server->MaxCpu());
+	SaveInt(appkey, "EnableDriver", m_server->Driver());
+	SaveInt(appkey, "EnableHook", m_server->Hook());
+	SaveInt(appkey, "EnableVirtual", m_server->Virtual());
+	// [v1.0.2-jp2 fix]
+	SaveInt(appkey, "SingleWindow", m_server->SingleWindow());
+	SaveString(appkey, "SingleWindowName", m_server->GetWindowName());
+}
+
+
+// ********************************************************************
+// Ini file part - Wwill replace registry access completely, some day
+// WARNING: until then, when adding/modifying a config parameter
+//          don't forget to modify both ini file & registry parts !
+// ********************************************************************
+
+void vncPropertiesPoll::LoadFromIniFile()
+{
+//	if (m_dlgvisible)
+//	{
+//		vnclog.Print(LL_INTWARN, VNCLOG("service helper invoked while Properties panel displayed\n"));
+//		return;
+//	}
+	
+	m_pref_TurboMode = ((vncService::VersionMajor() >= 6) ? TRUE : FALSE);
+	m_pref_PollUnderCursor=FALSE;
+	m_pref_PollForeground= TRUE;
+	m_pref_PollFullScreen= ((vncService::VersionMajor() >= 6) ? FALSE : TRUE);
+	m_pref_PollConsoleOnly=FALSE;
+	m_pref_PollOnEventOnly=TRUE;
+	m_pref_MaxCpu=40;
+	m_pref_Driver=CheckVideoDriver(0);
+	m_pref_Hook=TRUE;
+	m_pref_Virtual=FALSE;
+
+	m_pref_SingleWindow = 0;
+	*m_pref_szSingleWindowName = '\0';
+
+	LoadUserPrefsPollFromIniFile();
+	ApplyUserPrefs();
+}
+
+
+void vncPropertiesPoll::LoadUserPrefsPollFromIniFile()
+{
+	m_pref_TurboMode = myIniFile.ReadInt("poll", "TurboMode", m_pref_TurboMode);
+	// Polling prefs
+	m_pref_PollUnderCursor=myIniFile.ReadInt("poll", "PollUnderCursor", m_pref_PollUnderCursor);
+	m_pref_PollForeground=myIniFile.ReadInt("poll", "PollForeground", m_pref_PollForeground);
+	m_pref_PollFullScreen=myIniFile.ReadInt("poll", "PollFullScreen", m_pref_PollFullScreen);
+	m_pref_PollConsoleOnly=myIniFile.ReadInt("poll", "OnlyPollConsole", m_pref_PollConsoleOnly);
+	m_pref_PollOnEventOnly=myIniFile.ReadInt("poll", "OnlyPollOnEvent", m_pref_PollOnEventOnly);
+	m_pref_MaxCpu=myIniFile.ReadInt("poll", "MaxCpu", m_pref_MaxCpu);
+	if (m_pref_MaxCpu==0) m_pref_MaxCpu=100;
+	m_pref_Driver=myIniFile.ReadInt("poll", "EnableDriver", m_pref_Driver);
+	if (m_pref_Driver)m_pref_Driver=CheckVideoDriver(0);
+	m_pref_Hook=myIniFile.ReadInt("poll", "EnableHook", m_pref_Hook);
+	m_pref_Virtual=myIniFile.ReadInt("poll", "EnableVirtual", m_pref_Virtual);
+	
+	m_pref_SingleWindow=myIniFile.ReadInt("poll","SingleWindow",m_pref_SingleWindow);
+	myIniFile.ReadString("poll", "SingleWindowName", m_pref_szSingleWindowName,32);
+
+}
+
+
+void vncPropertiesPoll::SaveToIniFile()
+{
+	bool use_uac=false;
+	if (!myIniFile.IsWritable())
+			{
+				// We can't write to the ini file , Vista in service mode
+				if (!Copy_to_Temp(m_Tempfile)) return ;
+				myIniFile.IniFileSetTemp(m_Tempfile);
+				use_uac=true;
+			}
+	SaveUserPrefsPollToIniFile();
+	if (use_uac==true)
+	{
+	myIniFile.copy_to_secure();
+	myIniFile.IniFileSetSecure();
+	}
+}
+
+
+void vncPropertiesPoll::SaveUserPrefsPollToIniFile()
+{
+	myIniFile.WriteInt("poll", "TurboMode", m_server->TurboMode());
+	// Polling prefs
+	myIniFile.WriteInt("poll", "PollUnderCursor", m_server->PollUnderCursor());
+	myIniFile.WriteInt("poll", "PollForeground", m_server->PollForeground());
+	myIniFile.WriteInt("poll", "PollFullScreen", m_server->PollFullScreen());
+
+	myIniFile.WriteInt("poll", "OnlyPollConsole", m_server->PollConsoleOnly());
+	myIniFile.WriteInt("poll", "OnlyPollOnEvent", m_server->PollOnEventOnly());
+	myIniFile.WriteInt("poll", "MaxCpu", m_server->MaxCpu());
+
+	myIniFile.WriteInt("poll", "EnableDriver", m_server->Driver());
+	myIniFile.WriteInt("poll", "EnableHook", m_server->Hook());
+	myIniFile.WriteInt("poll", "EnableVirtual", m_server->Virtual());
+
+	myIniFile.WriteInt("poll", "SingleWindow", m_server->SingleWindow());
+	myIniFile.WriteString("poll", "SingleWindowName", m_server->GetWindowName());
+	
+}
diff --git a/ica/win32/winvnc/winvnc/vncpropertiesPoll.h b/ica/win32/winvnc/winvnc/vncpropertiesPoll.h
new file mode 100644
index 0000000..0542719
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncpropertiesPoll.h
@@ -0,0 +1,119 @@
+/////////////////////////////////////////////////////////////////////////////
+//  Copyright (C) 2002-2010 Ultr at VNC Team Members. 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://www.uvnc.com/
+//
+////////////////////////////////////////////////////////////////////////////
+class vncPropertiesPoll;
+
+#if (!defined(_WINVNC_VNCPROPERTIESPOLL))
+#define _WINVNC_VNCPROPERTIESPOLL
+
+// Includes
+#include "stdhdrs.h"
+#include "vncserver.h"
+#include "inifile.h"
+#include <userenv.h>
+// The vncPropertiesPoll class itself
+class vncPropertiesPoll
+{
+public:
+	// Constructor/destructor
+	vncPropertiesPoll();
+	~vncPropertiesPoll();
+
+	// Initialisation
+	BOOL Init(vncServer *server);
+
+	// The dialog box window proc
+	static BOOL CALLBACK DialogProcPoll(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+	// Display the properties dialog
+	// If usersettings is TRUE then the per-user settings come up
+	// If usersettings is FALSE then the default system settings come up
+	void Show(BOOL show, BOOL usersettings);
+
+	// Loading & saving of preferences
+	void Load(BOOL usersettings);
+	void ResetRegistry();
+
+	void Save();
+
+	BOOL m_fUseRegistry;
+	// Ini file
+	IniFile myIniFile;
+	void LoadFromIniFile();
+	void LoadUserPrefsPollFromIniFile();
+	void SaveToIniFile();
+	void SaveUserPrefsPollToIniFile();
+
+	// Implementation
+protected:
+	// The server object to which this properties object is attached.
+	vncServer *			m_server;
+
+	// Flag to indicate whether the currently loaded settings are for
+	// the current user, or are default system settings
+	BOOL				m_usersettings;
+
+
+	// String handling
+	char * LoadString(HKEY k, LPCSTR valname);
+	void SaveString(HKEY k, LPCSTR valname, const char *buffer);
+
+	// Manipulate the registry settings
+	LONG LoadInt(HKEY key, LPCSTR valname, LONG defval);
+	void SaveInt(HKEY key, LPCSTR valname, LONG val);
+
+
+	// Loading/saving all the user prefs
+	void LoadUserPrefsPoll(HKEY appkey);
+	void SaveUserPrefsPoll(HKEY appkey);
+
+	// [v1.0.2-jp2 fix]
+	void LoadSingleWindowName(HKEY key, char *buffer);
+
+	// Making the loaded user prefs active
+	void ApplyUserPrefs();
+	
+	BOOL m_returncode_valid;
+	BOOL m_dlgvisible;
+
+	BOOL m_pref_TurboMode;
+	
+	BOOL m_pref_PollUnderCursor;
+	BOOL m_pref_PollForeground;
+	BOOL m_pref_PollFullScreen;
+	BOOL m_pref_PollConsoleOnly;
+	BOOL m_pref_PollOnEventOnly;
+	LONG m_pref_MaxCpu;
+
+	BOOL m_pref_Driver;
+	BOOL m_pref_Hook;
+	BOOL m_pref_Virtual;
+
+	// [v1.0.2-jp2 fix]
+	BOOL m_pref_SingleWindow;
+	char m_pref_szSingleWindowName[32];
+	char m_Tempfile[MAX_PATH];
+
+};
+
+#endif // _WINVNC_vncPropertiesPoll
diff --git a/ica/win32/winvnc/winvnc/vncserver.cpp b/ica/win32/winvnc/winvnc/vncserver.cpp
new file mode 100644
index 0000000..1b9009b
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncserver.cpp
@@ -0,0 +1,2723 @@
+//  Copyright (C) 2002 Ultr at Vnc Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncServer.cpp
+
+// vncServer class implementation
+
+// Includes
+#include "stdhdrs.h"
+#include <omnithread.h>
+#include <string.h>
+#include <lmcons.h>
+
+// Custom
+#include "winvnc.h"
+#include "vncserver.h"
+#include "vncsockconnect.h"
+#include "vncclient.h"
+#include "vncservice.h"
+#include "vnctimedmsgbox.h"
+#include "mmsystem.h" // sf at 2002
+
+#include "vncmenu.h"
+
+#include "Localization.h" // ACT : Add localization on messages
+bool g_Server_running;
+extern bool g_Desktop_running;
+extern bool g_DesktopThread_running;
+void*	vncServer::pThis;
+
+// adzm 2009-07-05
+extern BOOL SPECIAL_SC_PROMPT;
+extern BOOL G_HTTP;
+// vncServer::UpdateTracker routines
+
+void
+vncServer::ServerUpdateTracker::add_changed(const rfb::Region2D &rgn) {
+	vncClientList::iterator i;
+	
+	omni_mutex_lock l(m_server->m_clientsLock);
+
+	// Post this update to all the connected clients
+	for (i = m_server->m_authClients.begin(); i != m_server->m_authClients.end(); i++)
+	{
+		// Post the update
+		// REalVNC 336 change
+		// m_server->GetClient(*i)->GetUpdateTracker().add_changed(rgn);
+		vncClient* client = m_server->GetClient(*i);
+		omni_mutex_lock ll(client->GetUpdateLock());
+		client->GetUpdateTracker().add_changed(rgn);
+
+	}
+}
+
+void
+vncServer::ServerUpdateTracker::add_cached(const rfb::Region2D &rgn) {
+	vncClientList::iterator i;
+	
+	omni_mutex_lock l(m_server->m_clientsLock);
+
+	// Post this update to all the connected clients
+	for (i = m_server->m_authClients.begin(); i != m_server->m_authClients.end(); i++)
+	{
+		// Post the update
+		// RealVNC 336 change
+		// m_server->GetClient(*i)->GetUpdateTracker().add_cached(rgn);
+		vncClient* client = m_server->GetClient(*i);
+		omni_mutex_lock ll(client->GetUpdateLock());
+		client->GetUpdateTracker().add_cached(rgn);
+	}
+}
+
+
+
+
+
+void
+vncServer::ServerUpdateTracker::add_copied(const rfb::Region2D &dest, const rfb::Point &delta) {
+	vncClientList::iterator i;
+	
+	omni_mutex_lock l(m_server->m_clientsLock);
+
+	// Post this update to all the connected clients
+	for (i = m_server->m_authClients.begin(); i != m_server->m_authClients.end(); i++)
+	{
+		// Post the update
+		// RealVNC 336 change
+		//m_server->GetClient(*i)->GetUpdateTracker().add_copied(dest, delta);
+		vncClient* client = m_server->GetClient(*i);
+		omni_mutex_lock ll(client->GetUpdateLock());
+		client->GetUpdateTracker().add_copied(dest, delta);
+
+	}
+}
+
+
+
+// Constructor/destructor
+vncServer::vncServer()
+{
+	// used for our retry timer proc;
+	pThis = this;
+	AutoReconnect_counter=0;
+
+	// Initialise some important stuffs...
+	g_Server_running=true;
+	m_socketConn = NULL;
+	m_httpConn = NULL;
+	m_enableHttpConn = false;
+	m_enableXdmcpConn = false;
+	m_desktop = NULL;
+	m_name = NULL;
+	m_port = DISPLAY_TO_PORT(0);
+	m_port_http = DISPLAY_TO_HPORT(0); // TightVNC 1.2.7
+	m_autoportselect = TRUE;
+	m_passwd_required = TRUE;
+	m_auth_hosts = 0;
+	m_blacklist = 0;
+	{
+	    vncPasswd::FromClear clearPWD;
+	    memcpy(m_password, clearPWD, MAXPWLEN);
+	}
+	m_querysetting = 2;
+	m_queryaccept = 0;
+	m_querytimeout = 10;
+	m_retry_timeout = 0;
+
+	// Autolock settings
+	m_lock_on_exit = 0;
+
+	// Set the polling mode options
+	m_poll_fullscreen = FALSE;
+	m_poll_foreground = FALSE;
+	m_poll_undercursor = TRUE;
+
+	m_poll_oneventonly = FALSE;
+	m_MaxCpu=20;
+	m_poll_consoleonly = TRUE;
+
+	m_driver = FALSE;
+	m_hook = FALSE;
+	m_virtual = FALSE;
+	sethook=false;
+	
+	// General options
+	m_loopbackOnly = FALSE;
+	m_loopback_allowed = FALSE;
+	m_lock_on_exit = 0;
+	m_connect_pri = 0;
+	m_disableTrayIcon = FALSE;
+	m_AllowEditClients = FALSE;
+
+	// Set the input options
+	m_enable_remote_inputs = TRUE;
+	m_disable_local_inputs = FALSE;
+	m_enable_jap_input = FALSE;
+
+	// Clear the client mapping table
+	for (int x=0; x<MAX_CLIENTS; x++)
+		m_clientmap[x] = NULL;
+	m_nextid = 0;
+
+	// Initialise the update tracker
+	m_update_tracker.init(this);
+
+	// Signal set when a client quits
+	m_clientquitsig = new omni_condition(&m_clientsLock);
+
+	// Modif sf at 2002
+	m_SingleWindow = FALSE;
+	strcpy(m_szWindowName, "");
+
+	// Modif sf at 2002
+	m_TurboMode = false;
+	// m_fCursorMoved = false;
+
+	// sf at 2002 - v1.1.2
+	// m_fQueuingEnabled = false;
+	m_fFileTransferEnabled = true;
+	m_nDefaultScale = 1;
+
+	// sf at 2002 - Data Stream Modification Plugin handling
+	m_pDSMPlugin = new CDSMPlugin();
+
+	m_fDSMPluginEnabled = false;
+	strcpy(m_szDSMPlugin, "");
+
+	m_fMSLogonRequired = false;
+
+	m_fXRichCursor = false;
+
+	// sf at 2003 - Autoreconnect
+	m_fAutoReconnect = false;
+	m_fIdReconnect = false;
+	m_AutoReconnectPort = 0;
+	strcpy(m_szAutoReconnectAdr, "");
+	strcpy(m_szAutoReconnectId, "");
+
+	// sf at 2005 - No FT User Impersonnation
+	m_fFTUserImpersonation = true;
+	m_fCaptureAlphaBlending = false;
+	m_fBlackAlphaBlending = false;
+
+	m_impersonationtoken=NULL; //byteboon
+
+	m_xdmcpConn=NULL;
+
+	m_impersonationtoken=NULL; // Modif Jeremy C. 
+
+	m_fRunningFromExternalService = true;
+	m_fAutoRestart = false;
+    m_ftTimeout = FT_RECV_TIMEOUT;
+    m_keepAliveInterval = KEEPALIVE_INTERVAL;
+
+	// adzm 2010-08
+	m_socketKeepAliveTimeout = SOCKET_KEEPALIVE_TIMEOUT;
+
+	
+	//adzm 2010-05-12 - dsmplugin config
+	m_szDSMPluginConfig[0] = '\0';
+	OS_Shutdown=false;
+}
+
+vncServer::~vncServer()
+{
+	vnclog.Print(LL_STATE, VNCLOG("shutting down server object1\n"));
+
+	// We don't want to retry when we are shutting down...
+	m_fAutoReconnect = FALSE;
+	m_fIdReconnect = FALSE;
+
+	// if we are in the middle of retrying our autoreconnect - kill the timer
+	if ( m_retry_timeout > 0 )
+	{
+		KillTimer( NULL, m_retry_timeout );
+		m_retry_timeout = 0;
+	}
+
+	// If there is a socket_conn object then delete it
+	if (m_socketConn != NULL)
+	{
+		delete m_socketConn;
+		m_socketConn = NULL;
+	}
+
+	if (m_httpConn != NULL)
+	{
+		delete m_httpConn;
+		m_httpConn = NULL;
+	}
+
+	// Modif Jeremy C. 
+	if(m_impersonationtoken) 
+		CloseHandle(m_impersonationtoken);
+
+	// Remove any active clients!
+	KillAuthClients();
+	KillUnauthClients();
+
+	// Wait for all the clients to die
+	WaitUntilAuthEmpty();
+	WaitUntilUnauthEmpty();
+
+	// Don't free the desktop until no KillClient is likely to free it
+	{	omni_mutex_lock l(m_desktopLock);
+
+		if (m_desktop != NULL)
+		{
+			delete m_desktop;
+			m_desktop = NULL;
+		}
+	}
+	while (g_Desktop_running)
+	{
+		Sleep(100);
+		vnclog.Print(LL_STATE, VNCLOG("Waiting for desktop to shutdown\n"));
+	}
+
+	// Don't free the authhosts string until no more connections are possible
+	if (m_auth_hosts != 0)
+	{
+		free(m_auth_hosts);
+		m_auth_hosts = 0;
+	}
+
+	if (m_name != NULL)
+	{
+		free(m_name);
+		m_name = NULL;
+	}
+
+	if (m_clientquitsig != NULL)
+	{
+		delete m_clientquitsig;
+		m_clientquitsig = NULL;
+	}
+
+	// Modif sf at 2002 - DSMPlugin handling
+	if (m_pDSMPlugin != NULL)
+	{
+		delete(m_pDSMPlugin);
+		m_pDSMPlugin=NULL;
+		vnclog.Print(LL_SOCKINFO, VNCLOG("~server m_pDSMPlugin = NULL \n"));
+	}
+
+	// Free the host blacklist
+	while (m_blacklist) {
+		vncServer::BlacklistEntry *current = m_blacklist;
+		m_blacklist=m_blacklist->_next;
+
+		free (current->_machineName);
+		delete current;
+	}
+	//We need to give the client thread to give some time to close
+	// bad hack
+	//Sleep(500);
+	//sometimes crash, vnclog seems already removed
+	//	vnclog.Print(LL_STATE, VNCLOG("shutting down server object(4)\n"));
+	g_Server_running=false;
+}
+
+void
+vncServer::ShutdownServer()
+{
+	vnclog.Print(LL_STATE, VNCLOG("shutting down server object2\n"));
+
+	// We don't want to retry when we are shutting down...
+	m_fAutoReconnect = FALSE;
+	m_fIdReconnect = FALSE;
+
+	// if we are in the middle of retrying our autoreconnect - kill the timer
+	if ( m_retry_timeout > 0 )
+	{
+		KillTimer( NULL, m_retry_timeout );
+		m_retry_timeout = 0;
+	}
+
+	// If there is a socket_conn object then delete it
+	if (m_socketConn != NULL)
+	{
+		delete m_socketConn;
+		m_socketConn = NULL;
+	}
+
+	if (m_httpConn != NULL)
+	{
+		delete m_httpConn;
+		m_httpConn = NULL;
+	}
+
+	// Modif Jeremy C. 
+	if(m_impersonationtoken) 
+		CloseHandle(m_impersonationtoken);
+
+	// Remove any active clients!
+	KillAuthClients();
+	KillUnauthClients();
+
+	// Wait for all the clients to die
+	WaitUntilAuthEmpty();
+	WaitUntilUnauthEmpty();
+
+	// Don't free the desktop until no KillClient is likely to free it
+	{	omni_mutex_lock l(m_desktopLock);
+
+		if (m_desktop != NULL)
+		{
+			delete m_desktop;
+			m_desktop = NULL;
+		}
+	}
+	while (g_Desktop_running)
+	{
+		Sleep(100);
+		vnclog.Print(LL_STATE, VNCLOG("Waiting for desktop to shutdown\n"));
+	}
+
+	// Don't free the authhosts string until no more connections are possible
+	if (m_auth_hosts != 0)
+	{
+		free(m_auth_hosts);
+		m_auth_hosts = 0;
+	}
+
+	if (m_name != NULL)
+	{
+		free(m_name);
+		m_name = NULL;
+	}
+
+	if (m_clientquitsig != NULL)
+	{
+		delete m_clientquitsig;
+		m_clientquitsig = NULL;
+	}
+
+	// Modif sf at 2002 - DSMPlugin handling
+	if (m_pDSMPlugin != NULL)
+	{
+		delete(m_pDSMPlugin);
+		m_pDSMPlugin=NULL;
+		vnclog.Print(LL_SOCKINFO, VNCLOG("ShutdownServer m_pDSMPlugin = NULL \n"));
+	}
+
+	// Free the host blacklist
+	while (m_blacklist) {
+		vncServer::BlacklistEntry *current = m_blacklist;
+		m_blacklist=m_blacklist->_next;
+
+		free (current->_machineName);
+		delete current;
+	}
+	//We need to give the client thread to give some time to close
+	// bad hack
+	//Sleep(500);
+	//sometimes crash, vnclog seems already removed
+//	vnclog.Print(LL_STATE, VNCLOG("shutting down server object(4)\n"));
+	g_Server_running=false;
+}
+
+// Client handling functions
+vncClientId vncServer::AddClient(VSocket *socket, BOOL auth, BOOL shared)
+{
+	return AddClient(socket, auth, shared, /*FALSE,*/ 0, /*TRUE, TRUE,*/NULL); 
+}
+
+vncClientId vncServer::AddClient(VSocket *socket, BOOL auth, BOOL shared, rfbProtocolVersionMsg *protocolMsg)
+{
+	return AddClient(socket, auth, shared, /*FALSE,*/ 0, /*TRUE, TRUE,*/protocolMsg); 
+}
+
+// adzm 2009-07-05 - repeater IDs
+vncClientId vncServer::AddClient(VSocket *socket,
+					 BOOL auth,
+					 BOOL shared,
+					 int capability,
+					 /*BOOL keysenabled, BOOL ptrenabled,*/
+					 rfbProtocolVersionMsg *protocolMsg)
+{
+	return AddClient(socket, auth, shared, /*FALSE,*/ 0, /*TRUE, TRUE,*/protocolMsg, NULL, NULL, 0);
+}
+
+// adzm 2009-07-05 - repeater IDs
+vncClientId vncServer::AddClient(VSocket *socket,
+					 BOOL auth,
+					 BOOL shared,
+					 int capability,
+					 /*BOOL keysenabled, BOOL ptrenabled,*/
+					 rfbProtocolVersionMsg *protocolMsg,
+					 VString szRepeaterID,
+					 VString szHost,
+					 VCard port)
+{
+	vnclog.Print(LL_STATE, VNCLOG("AddClient() started\n"));
+	
+	vncClient *client;
+
+	omni_mutex_lock l(m_clientsLock);
+
+	// Try to allocate a client id...
+	vncClientId clientid = m_nextid;
+	do
+	{
+		clientid = (clientid+1) % MAX_CLIENTS;
+		if (clientid == m_nextid)
+		{
+			delete socket;
+			return -1;
+		}
+	}
+	while (m_clientmap[clientid] != NULL);
+
+	// Create a new client and add it to the relevant client list
+	client = new vncClient();
+	if (client == NULL)
+	{
+		delete socket;
+		return -1;
+	}
+
+	// Set the client's settings
+	client->SetProtocolVersion(protocolMsg);
+	client->SetCapability(capability);
+	client->EnableKeyboard(/*keysenabled &&*/ m_enable_remote_inputs);
+	client->EnablePointer(/*ptrenabled &&*/ m_enable_remote_inputs);
+    client->EnableJap(/*ptrenabled &&*/ m_enable_jap_input ? true : false);
+
+	// adzm 2009-07-05 - repeater IDs
+	if (szRepeaterID) {
+		client->SetRepeaterID(szRepeaterID);
+	}
+	// adzm 2009-08-02
+	if (szHost) {
+		client->SetHost(szHost);
+	}
+	client->SetHostPort(port);
+
+	// Start the client
+	if (!client->Init(this, socket, auth, shared, clientid))
+	{
+		// The client will delete the socket for us...
+		vnclog.Print(LL_CONNERR, VNCLOG("failed to initialise client object\n"));
+		delete client;
+		return -1;
+	}
+
+	m_clientmap[clientid] = client;
+
+	// Add the client to unauth the client list
+	m_unauthClients.push_back(clientid);
+
+	// Notify anyone interested about this event
+	DoNotify(WM_SRV_CLIENT_CONNECT, 0, 0);
+
+	vnclog.Print(LL_INTINFO, VNCLOG("AddClient() done\n"));
+
+	// adzm 2009-07-05 - Balloon
+	if (SPECIAL_SC_PROMPT) {
+		vncClientList::iterator i;
+		char szInfo[256];
+		strcpy(szInfo, "Waiting for connection... ");
+
+		for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
+		{
+
+
+			vncClient* pclient = GetClient(*i);
+			if (pclient->GetRepeaterID() && (strlen(pclient->GetRepeaterID()) > 0) ) {
+				strncat_s(szInfo, 255, pclient->GetRepeaterID(), _TRUNCATE);
+			} else {
+				strncat_s(szInfo, 255, pclient->GetClientName(), _TRUNCATE);
+			}			
+			
+			// adzm 2009-07-05			
+			strncat_s(szInfo, 255, ", ", _TRUNCATE);
+		}
+
+		if (m_unauthClients.size() > 0) {
+			szInfo[strlen(szInfo) - 2] = '\0';
+			vncMenu::NotifyBalloon(szInfo, NULL);
+		}		
+	}
+
+	return clientid;
+}
+
+char *vncDeskThreadError(DWORD code)
+{
+    // create default message
+    static char msg[255];
+    _snprintf(msg, sizeof msg, "Unknown error %u", code);
+    msg[sizeof msg - 1] = 0;
+
+    switch (code)
+    {
+        case ERROR_DESKTOP_NO_PALETTE:
+            return "Unable to determine color palette";
+        case ERROR_DESKTOP_INIT_FAILED:
+            return "Unable to select input desktop";
+        case ERROR_DESKTOP_UNSUPPORTED_PIXEL_ORGANIZATION:
+            return "Incompatible graphics device driver (planar pixel format)";
+        case ERROR_DESKTOP_UNSUPPORTED_PIXEL_FORMAT:
+            return "Unsupported true color pixel format";
+        case ERROR_DESKTOP_NO_HOOKWINDOW:
+            return "Unable to create hook window";
+        case ERROR_DESKTOP_NO_ROOTDC:
+        	return "Unable to create compatible device context";
+        case ERROR_DESKTOP_NO_BITBLT:
+        	return "Unsupported graphics device driver (no BitBlt)";
+        case ERROR_DESKTOP_NO_GETDIBITS:
+        	return "Unsupported graphics device driver (no GetDIBits)";
+		case ERROR_DESKTOP_NO_COMPATBITMAP:
+			return "Unable to create compatible bitmap";
+		case ERROR_DESKTOP_NO_DISPLAYFORMAT:
+			return 	"Unable to get Display format";
+        case ERROR_DESKTOP_OUT_OF_MEMORY:
+            return "Out of memory";
+        case ERROR_DESKTOP_NO_DESKTOPTHREAD:
+            return "Unable to create desktop hook thread";
+		case ERROR_DESKTOP_NO_DIBSECTION_OR_COMPATBITMAP:
+			return "Unable to create device independent bitmap or fallback bitmap";
+        default:
+            break;
+    }
+
+    return msg;
+}
+BOOL
+vncServer::Authenticated(vncClientId clientid)
+{
+	vncClientList::iterator i;
+	BOOL authok = TRUE;
+//	vnclog.Print(LL_INTINFO, VNCLOG("Lock2\n"));
+	omni_mutex_lock l1(m_desktopLock);
+//	vnclog.Print(LL_INTINFO, VNCLOG("Lock3\n"));
+	omni_mutex_lock l2(m_clientsLock);
+
+	vncClient *client = NULL;
+
+	// Search the unauthenticated client list
+	for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
+	{
+		// Is this the right client?
+		if ((*i) == clientid)
+		{
+			client = GetClient(clientid);
+			
+
+			// Yes, so remove the client and add it to the auth list
+			m_unauthClients.erase(i);
+
+			// Create the screen handler if necessary
+			if (m_desktop == NULL)
+			{
+				m_desktop = new vncDesktop();
+
+				if (m_desktop == NULL)
+				{
+					client->Kill();
+					authok = FALSE;
+					break;
+				}
+				// Preset toggle prim/sec/both
+				// change, to get it final stable, we only gonna handle single and multi monitors
+				// 1=single monitor, 2 is multi monitor
+				m_desktop->m_buffer.MultiMonitors(1);
+				if (Secondary()) m_desktop->m_buffer.MultiMonitors(2);
+
+
+                DWORD startup_status = 0;
+				if ((startup_status = m_desktop->Init(this)) != 0)
+				{
+					vnclog.Print(LL_INTINFO, VNCLOG("Desktop init failed, unlock in application mode ? \n"));
+					client->Kill();
+					authok = FALSE;
+					delete m_desktop;
+					m_desktop = NULL;
+
+					break;
+				}
+			}
+
+			// Tell the client about this new buffer
+			client->SetBuffer(&(m_desktop->m_buffer));
+
+			// Add the client to the auth list
+			m_authClients.push_back(clientid);
+
+			break;
+		}
+	}
+
+	// Notify anyone interested of this event
+	DoNotify(WM_SRV_CLIENT_AUTHENTICATED, 0, 0);
+
+	// adzm 2009-07-05 - Balloon
+	if (SPECIAL_SC_PROMPT && (client != NULL) ) {
+		char szInfo[256];
+
+		if (client->GetRepeaterID() && (strlen(client->GetRepeaterID()) > 0) ) {
+			_snprintf(szInfo, 255, "Remote user successfully connected (%s) and is currently sharing your desktop.", client->GetRepeaterID());
+		} else {
+			_snprintf(szInfo, 255, "Remote user successfully connected (%s) and is currently sharing your desktop.", client->GetClientName());
+		}
+
+		szInfo[255] = '\0';
+
+		vncMenu::NotifyBalloon(szInfo, NULL);
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("Authenticated() done\n"));
+
+	return authok;
+}
+
+void
+vncServer::KillClient(vncClientId clientid)
+{
+	vncClientList::iterator i;
+	BOOL done = FALSE;
+
+	omni_mutex_lock l(m_clientsLock);
+
+	// Find the client in one of the two lists
+	for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
+	{
+		// Is this the right client?
+		if ((*i) == clientid)
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("killing unauth client\n"));
+
+			// Ask the client to die
+			vncClient *client = GetClient(clientid);
+			client->Kill();
+
+			done = TRUE;
+			break;
+		}
+	}
+	if (!done)
+	{
+		for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+		{
+			// Is this the right client?
+			if ((*i) == clientid)
+			{
+				vnclog.Print(LL_INTINFO, VNCLOG("killing auth client\n"));
+
+				// Yes, so kill it
+				vncClient *client = GetClient(clientid);
+				client->Kill();
+
+				done = TRUE;
+				break;
+			}
+		}
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("KillClient() done\n"));
+}
+
+//
+// sf at 2002 - Kill the client which has the passed name
+//
+void vncServer::KillClient(LPSTR szClientName)
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+	vncClient *pClient = NULL;
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		pClient = GetClient(*i);
+		if (!_stricmp(pClient->GetClientName(), szClientName))
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("Killing client named: %s\n"), szClientName);
+			pClient->Kill();
+		}
+	}
+	vnclog.Print(LL_INTINFO, VNCLOG("KillClient() from name done\n"));
+}
+
+
+//
+// sf at 2002 - Open a textchat window with the named client
+//
+void vncServer::TextChatClient(LPSTR szClientName)
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+	vncClient *pClient = NULL;
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		pClient = GetClient(*i);
+		if (!_stricmp(pClient->GetClientName(), szClientName))
+		{
+			if (!pClient->IsUltraViewer())
+			{
+				vnclog.Print(LL_INTINFO, VNCLOG("Client %s is not Ultra. Doesn't know TextChat\n"), szClientName);
+				vncTimedMsgBox::Do(
+									sz_ID_ULTRAVNC_TEXTCHAT,
+									sz_ID_ULTRAVNC_WARNING,
+									MB_ICONINFORMATION | MB_OK
+									);
+				break;
+			}
+			vnclog.Print(LL_INTINFO, VNCLOG("TextChat with client named: %s\n"), szClientName);
+#ifndef ULTRAVNC_ITALC_SUPPORT
+			pClient->GetTextChatPointer()->OrderTextChat();
+#endif
+			break;
+		}
+	}
+	vnclog.Print(LL_INTINFO, VNCLOG("KillClient() from name done\n"));
+}
+
+bool vncServer::IsUltraVncViewer()
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{	
+		if (GetClient(*i)->IsUltraViewer())return true;
+	}
+	return false;
+}
+
+bool vncServer::AreThereMultipleViewers()
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+	int a=0;
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{	
+		a++;
+	}
+	if (a<=1) return false;
+	else return true;
+}
+
+
+void
+vncServer::KillAuthClients()
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+
+	// Tell all the authorised clients to die!
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("killing auth client\n"));
+
+		// Kill the client
+		GetClient(*i)->Kill();
+	}
+	//autoreconnect and service
+	//if (m_fRunningFromExternalService) fShutdownOrdered=true;
+	vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() done\n"));
+}
+
+//
+// sf at 2002 - Fill the passed ListBox with clients names
+//
+void vncServer::ListAuthClients(HWND hListBox)
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// adzm 2009-07-05
+		vncClient* client = GetClient(*i);
+		if (client->GetRepeaterID() && (strlen(client->GetRepeaterID()) > 0) ) {
+			char szDescription[256];
+			_snprintf(szDescription, 255, "%s - %s", client->GetRepeaterID(), client->GetClientName());
+			szDescription[255] = '\0';
+
+			SendMessage(hListBox, 
+						LB_ADDSTRING,
+						0,
+						(LPARAM) szDescription
+						);
+		} else {
+			SendMessage(hListBox, 
+						LB_ADDSTRING,
+						0,
+						(LPARAM) client->GetClientName()
+						);
+		}
+	}
+}
+
+// adzm 2009-07-05
+void vncServer::ListUnauthClients(HWND hListBox)
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+
+	for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
+	{
+		// adzm 2009-07-05
+		vncClient* client = GetClient(*i);
+		if (client->GetRepeaterID() && (strlen(client->GetRepeaterID()) > 0) ) {
+			char szDescription[256];
+			_snprintf(szDescription, 255, "%s - %s", client->GetRepeaterID(), client->GetClientName());
+			szDescription[255] = '\0';
+
+			SendMessage(hListBox, 
+						LB_ADDSTRING,
+						0,
+						(LPARAM) szDescription
+						);
+		} else {
+			SendMessage(hListBox, 
+						LB_ADDSTRING,
+						0,
+						(LPARAM) client->GetClientName()
+						);
+		}
+	}
+}
+
+/*
+//
+// sf at 2003 - Returns the first client name (IP)
+//
+void vncServer::FirstClientName()
+{
+	omni_mutex_lock l(m_clientsLock);
+	return GetClient(*(m_authClients.begin()))->GetClientName();
+}
+*/
+
+
+//
+// sf at 2002 - test if there's a slow client connected
+// The criteria is a client that has been using a slow
+// encoding for more than 10 seconds after its connection
+//
+bool vncServer::IsThereASlowClient()
+{
+	vncClientList::iterator i;
+	bool fFound = false;
+	omni_mutex_lock l(m_clientsLock);
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		if (GetClient(*i)->IsSlowEncoding())
+		{
+			if (timeGetTime() - GetClient(*i)->GetConnectTime() > 10000) 
+			{
+				fFound = true;
+				break;
+			}	
+			else
+				continue;
+		}
+		else
+			continue;
+	}
+	return fFound;
+}
+
+bool vncServer::IsThereAUltraEncodingClient()
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		if (GetClient(*i)->IsUltraEncoding())
+		{
+			return true;
+		}
+	}
+	return false;
+}
+
+bool vncServer::IsThereFileTransBusy()
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		if (GetClient(*i)->IsFileTransBusy())
+		{
+			return true;
+		}
+	}
+	return false;
+}
+
+
+void
+vncServer::KillUnauthClients()
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+
+	// Tell all the authorised clients to die!
+	for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("killing unauth client\n"));
+
+		// Kill the client
+		GetClient(*i)->Kill();
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("KillUnauthClients() done\n"));
+}
+
+
+UINT
+vncServer::AuthClientCount()
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	return m_authClients.size();
+}
+
+UINT
+vncServer::UnauthClientCount()
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	return m_unauthClients.size();
+}
+
+BOOL
+vncServer::UpdateWanted()
+{
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+
+	// Iterate over the authorised clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		if (GetClient(*i)->UpdateWanted())
+			return TRUE;
+	}
+	return FALSE;
+}
+
+BOOL
+vncServer::RemoteEventReceived()
+{
+	vncClientList::iterator i;
+	BOOL result = FALSE;
+	omni_mutex_lock l(m_clientsLock);
+
+	// Iterate over the authorised clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		result = result || GetClient(*i)->RemoteEventReceived();
+	}
+	return result;
+}
+
+void
+vncServer::WaitUntilAuthEmpty()
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	// Wait for all the clients to exit
+	while (!m_authClients.empty())
+	{
+		// Wait for a client to quit
+		m_clientquitsig->wait();
+	}
+}
+
+void
+vncServer::WaitUntilUnauthEmpty()
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	// Wait for all the clients to exit
+	while (!m_unauthClients.empty())
+	{
+		// Wait for a client to quit
+		m_clientquitsig->wait();
+	}
+}
+
+// Client info retrieval/setup
+vncClient*
+vncServer::GetClient(vncClientId clientid)
+{
+	if ((clientid >= 0) && (clientid < MAX_CLIENTS))
+		return m_clientmap[clientid];
+	return NULL;
+}
+
+vncClientList
+vncServer::ClientList()
+{
+	vncClientList clients;
+
+	omni_mutex_lock l(m_clientsLock);
+
+	clients = m_authClients;
+
+	return clients;
+}
+
+void
+vncServer::SetCapability(vncClientId clientid, int capability)
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	vncClient *client = GetClient(clientid);
+	if (client != NULL)
+		client->SetCapability(capability);
+}
+
+void
+vncServer::SetKeyboardEnabled(vncClientId clientid, BOOL enabled)
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	vncClient *client = GetClient(clientid);
+	if (client != NULL)
+		client->EnableKeyboard(enabled);
+}
+
+void
+vncServer::SetPointerEnabled(vncClientId clientid, BOOL enabled)
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	vncClient *client = GetClient(clientid);
+	if (client != NULL)
+		client->EnablePointer(enabled);
+}
+
+int
+vncServer::GetCapability(vncClientId clientid)
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	vncClient *client = GetClient(clientid);
+	if (client != NULL)
+		return client->GetCapability();
+	return 0;
+}
+
+const char*
+vncServer::GetClientName(vncClientId clientid)
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	vncClient *client = GetClient(clientid);
+	if (client != NULL)
+		return client->GetClientName();
+	return NULL;
+}
+
+// RemoveClient should ONLY EVER be used by the client to remove itself.
+void
+vncServer::RemoveClient(vncClientId clientid)
+{
+	vncClientList::iterator i;
+	BOOL done = FALSE;
+//	vnclog.Print(LL_INTINFO, VNCLOG("Lock1\n"));
+	omni_mutex_lock l1(m_desktopLock);
+//	vnclog.Print(LL_INTINFO, VNCLOG("Lock3\n"));
+	{	omni_mutex_lock l2(m_clientsLock);
+
+		// Find the client in one of the two lists
+		for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
+		{
+			// Is this the right client?
+			if ((*i) == clientid)
+			{
+				vnclog.Print(LL_INTINFO, VNCLOG("removing unauthorised client\n"));
+
+				// Yes, so remove the client and kill it
+				m_unauthClients.erase(i);
+				if ( clientid>=0 && clientid< 512) m_clientmap[clientid] = NULL;
+				done = TRUE;
+				break;
+			}
+		}
+		if (!done)
+		{
+			for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+			{
+				// Is this the right client?
+				if ((*i) == clientid)
+				{
+					vnclog.Print(LL_INTINFO, VNCLOG("removing authorised client\n"));
+
+					// Yes, so remove the client and kill it
+					m_authClients.erase(i);
+					if ( clientid>=0 && clientid< 512) m_clientmap[clientid] = NULL;
+
+					done = TRUE;
+					break;
+				}
+			}
+		}
+
+		// Signal that a client has quit
+		m_clientquitsig->signal();
+
+	} // Unlock the clientLock
+
+	// Are there any authorised clients connected?
+	if (m_authClients.empty() && (m_desktop != NULL))
+	{
+		vnclog.Print(LL_STATE, VNCLOG("deleting desktop server\n"));
+
+		// sf at 2007 - Do not lock/logoff even if required when WinVNC autorestarts (on desktop change (XP FUS / Vista))
+		if (!AutoRestartFlag() && !OS_Shutdown)
+		{
+			// Are there locksettings set?
+			if (LockSettings() == 1 || clearconsole)
+			{
+				// Yes - lock the machine on disconnect!
+				vncService::LockWorkstation();
+			} 
+			else if (LockSettings() > 1)
+			{
+				char username[UNLEN+1];
+
+				vncService::CurrentUser((char *)&username, sizeof(username));
+				if (strcmp(username, "") != 0)
+				{
+					// Yes - force a user logoff on disconnect!
+					if (!ExitWindowsEx(EWX_LOGOFF, 0))
+						vnclog.Print(LL_CONNERR, VNCLOG("client disconnect - failed to logoff user!\n"));
+				}
+			}
+		}
+
+		// Delete the screen server
+		delete m_desktop;
+		m_desktop = NULL;
+		vnclog.Print(LL_STATE, VNCLOG("desktop deleted\n"));
+	}
+
+	// Notify anyone interested of the change
+	DoNotify(WM_SRV_CLIENT_DISCONNECT, 0, 0);
+
+	vnclog.Print(LL_INTINFO, VNCLOG("RemoveClient() done\n"));
+}
+
+// NOTIFICATION HANDLING!
+
+// Connect/disconnect notification
+BOOL
+vncServer::AddNotify(HWND hwnd)
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	// Add the window handle to the list
+	m_notifyList.push_front(hwnd);
+
+	return TRUE;
+}
+
+BOOL
+vncServer::RemNotify(HWND hwnd)
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	// Remove the window handle from the list
+	vncNotifyList::iterator i;
+	for (i=m_notifyList.begin(); i!=m_notifyList.end(); i++)
+	{
+		if ((*i) == hwnd)
+		{
+			// Found the handle, so remove it
+			m_notifyList.erase(i);
+			return TRUE;
+		}
+	}
+
+	return FALSE;
+}
+
+// Send a notification message
+void
+vncServer::DoNotify(UINT message, WPARAM wparam, LPARAM lparam)
+{
+	omni_mutex_lock l(m_clientsLock);
+
+	// Send the given message to all the notification windows
+	vncNotifyList::iterator i;
+	for (i=m_notifyList.begin(); i!=m_notifyList.end(); i++)
+	{
+		PostMessage((*i), message, wparam, lparam);
+	}
+}
+
+void
+vncServer::UpdateMouse()
+{
+	vncClientList::iterator i;
+	
+	omni_mutex_lock l(m_clientsLock);
+
+	// Post this mouse update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Post the update
+		GetClient(*i)->UpdateMouse();
+	}
+}
+
+// adzm - 2010-07 - Extended clipboard
+/*
+void
+vncServer::UpdateClipText(const char* text)
+{
+	vncClientList::iterator i;
+	
+	omni_mutex_lock l(m_clientsLock);
+
+	// Post this update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Post the update
+		GetClient(*i)->UpdateClipText(text);
+	}
+}
+*/
+
+
+// adzm - 2010-07 - Extended clipboard
+void
+vncServer::UpdateClipTextEx(HWND hwndOwner, vncClient* excludeClient)
+{
+	ClipboardData clipboardData;
+	if (clipboardData.Load(hwndOwner)) {
+		vncClientList::iterator i;
+		
+		omni_mutex_lock l(m_clientsLock);
+
+		// Post this update to all the connected clients
+		for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+		{
+			// Post the update
+			vncClient* client = GetClient(*i);
+			if (client != excludeClient) {
+				client->UpdateClipTextEx(clipboardData);
+			}
+		}
+	}
+}
+
+void
+vncServer::UpdateCursorShape()
+{
+	vncClientList::iterator i;
+	
+	omni_mutex_lock l(m_clientsLock);
+
+	// Post this update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Post the update
+		GetClient(*i)->UpdateCursorShape();
+	}
+}
+
+void
+vncServer::UpdatePalette(bool lock)
+{
+	vncClientList::iterator i;
+	
+	omni_mutex_lock l(m_clientsLock);
+
+	// Post this update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Post the update
+		GetClient(*i)->UpdatePalette(lock);
+	}
+}
+
+void
+vncServer::UpdateLocalFormat(bool lock)
+{
+	vncClientList::iterator i;
+	
+	omni_mutex_lock l(m_clientsLock);
+
+	// Post this update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Post the update
+		GetClient(*i)->UpdateLocalFormat(lock);
+	}
+}
+
+void
+vncServer::UpdateLocalClipText(LPSTR text)
+{
+//	vnclog.Print(LL_INTINFO, VNCLOG("Lock5\n"));
+	omni_mutex_lock l(m_desktopLock);
+
+	if (m_desktop != NULL)
+		m_desktop->SetClipText(text);
+}
+
+
+// adzm - 2010-07 - Extended clipboard
+void
+vncServer::UpdateLocalClipTextEx(ExtendedClipboardDataMessage& extendedClipboardDataMessage, vncClient* sourceClient)
+{
+//	vnclog.Print(LL_INTINFO, VNCLOG("Lock5\n"));
+	{
+		omni_mutex_lock l(m_desktopLock);
+
+		if (m_desktop != NULL)
+			m_desktop->SetClipTextEx(extendedClipboardDataMessage);
+	}
+
+	// At this point we could notify other viewers and update their clipboards too, but in practice this is very confusing.
+	// Perhaps what should be done is to notify the viewers that the clipboard has changed?
+	// Worry about it later.
+	/*
+	{ 
+		omni_mutex_lock l(m_clientsLock);
+
+		// Post this update to all the connected clients
+		for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+		{
+			// Post the update
+			vncClient* client = GetClient(*i);
+			if (client != excludeClient) {
+				client->UpdateClipTextEx(clipboardData, (CARD32)clipPeek);
+			}
+		}
+	}
+	*/
+}
+
+// Name and port number handling
+void
+vncServer::SetName(const char * name)
+{
+	// Set the name of the desktop
+	if (m_name != NULL)
+	{
+		free(m_name);
+		m_name = NULL;
+	}
+	
+	m_name = _strdup(name);
+}
+
+// TightVNC 1.2.7
+void
+vncServer::SetPorts(const UINT port_rfb, const UINT port_http)
+{
+	if (m_port != port_rfb || m_port_http != port_http) {
+		// Set port numbers to use
+		m_port = port_rfb;
+		m_port_http = port_http;
+
+		// If there is already a listening socket then close and re-open it...
+		BOOL socketon = SockConnected();
+		SockConnect(FALSE);
+		if (socketon)
+			SockConnect(TRUE);
+    }
+}
+
+// RealVNC method
+/*
+void
+vncServer::SetPort(const UINT port)
+{
+    if (m_port != port)
+    {
+	/////////////////////////////////
+	// Adjust the listen socket
+
+	// Set the port number to use
+	m_port = port;
+
+	// If there is already a listening socket then close and re-open it...
+	BOOL socketon = SockConnected();
+
+	SockConnect(FALSE);
+	if (socketon)
+	    SockConnect(TRUE);
+
+    }
+}
+
+
+UINT
+vncServer::GetPort()
+{
+	return m_port;
+}
+*/
+
+void
+vncServer::SetPassword(const char *passwd)
+{
+	memcpy(m_password, passwd, MAXPWLEN);
+}
+
+void
+vncServer::GetPassword(char *passwd)
+{
+	memcpy(passwd, m_password, MAXPWLEN);
+}
+
+void //PGM
+vncServer::SetPassword2(const char *passwd2) //PGM
+{ //PGM
+	memcpy(m_password2, passwd2, MAXPWLEN); //PGM
+} //PGM
+
+void //PGM
+vncServer::GetPassword2(char *passwd2) //PGM
+{ //PGM
+	memcpy(passwd2, m_password2, MAXPWLEN); //PGM
+} //PGM
+
+// Remote input handling
+void
+vncServer::EnableRemoteInputs(BOOL enable)
+{
+	m_enable_remote_inputs = enable;
+	vncClientList::iterator i;
+		
+	omni_mutex_lock l(m_clientsLock);
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		GetClient(*i)->EnableKeyboard(m_enable_remote_inputs);
+		GetClient(*i)->EnablePointer(m_enable_remote_inputs);
+	}
+}
+
+BOOL vncServer::RemoteInputsEnabled()
+{
+	return m_enable_remote_inputs;
+}
+
+// Local input handling
+void
+vncServer::DisableLocalInputs(BOOL disable)
+{
+	m_disable_local_inputs = disable;
+}
+
+bool vncServer::LocalInputsDisabled()
+{
+    return m_disable_local_inputs ? true : false;
+}
+
+BOOL vncServer::JapInputEnabled()
+{
+	return m_enable_jap_input;
+}
+
+void
+vncServer::EnableJapInput(BOOL enable)
+{
+	m_enable_jap_input = enable;
+	vncClientList::iterator i;
+		
+	omni_mutex_lock l(m_clientsLock);
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+        GetClient(*i)->EnableJap(m_enable_jap_input ? true : false);
+	}
+}
+
+void
+vncServer::Clearconsole(BOOL enable)
+{
+	clearconsole=(enable != FALSE);
+}
+
+
+
+void 
+vncServer::KillSockConnect()
+{
+	if (m_socketConn != NULL)
+		delete m_socketConn;
+	m_socketConn = NULL;
+
+}
+
+// Socket connection handling
+BOOL
+vncServer::SockConnect(BOOL On)
+{
+	// Are we being asked to switch socket connects on or off?
+	vnclog.Print(20, VNCLOG("SockConnect %d\n"), On);
+	if (On)
+	{
+		// Is there a listening socket?
+		if (m_socketConn == NULL)
+		{
+			m_socketConn = new vncSockConnect();
+			if (m_socketConn == NULL)
+				return FALSE;
+
+			// Are we to use automatic port selection?
+			if (m_autoportselect)
+			{
+				BOOL ok = FALSE;
+
+				// Yes, so cycle through the ports, looking for a free one!
+				for (int i=0; i < 99; i++)
+				{
+					m_port = DISPLAY_TO_PORT(i);
+					m_port_http = DISPLAY_TO_HPORT(i);
+
+					vnclog.Print(LL_CLIENTS, VNCLOG("trying port number %d\n"), m_port);
+
+					// Attempt to connect to the port
+					VSocket tempsock;
+					if (tempsock.Create())
+					{
+						if (!tempsock.Connect("localhost", m_port))
+						{
+							// Couldn't connect, so this port is probably usable!
+							if (m_socketConn->Init(this, m_port))
+							{
+								ok = TRUE;
+								break;
+							}
+						}
+					}
+				}
+
+				if (!ok)
+				{
+					delete m_socketConn;
+					m_socketConn = NULL;
+					return FALSE;
+				}
+			} else
+			{
+				// No autoportselect
+				if (!m_socketConn->Init(this, m_port))
+				{
+					delete m_socketConn;
+					m_socketConn = NULL;
+					return FALSE;
+				}
+			}
+
+			// Now let's start the HTTP connection stuff
+			EnableHTTPConnect(m_enableHttpConn);
+			EnableXDMCPConnect(m_enableXdmcpConn);
+			vnclog.Print(20, VNCLOG("SockConnect  Done %d\n"), On);
+		}
+	}
+	else
+	{
+
+		// Is there a listening socket?
+		if (m_socketConn != NULL)
+		{
+
+			// *** JNW - Trying to fix up a lock-up when the listening socket closes
+			vnclog.Print(LL_INTINFO, VNCLOG("KillAuthClients() fix up a lock-up \n"));
+			KillAuthClients();
+			KillUnauthClients();
+			WaitUntilAuthEmpty();
+			WaitUntilUnauthEmpty();
+
+			// Close the socket
+			delete m_socketConn;
+			m_socketConn = NULL;
+		}
+
+		// Is there an HTTP socket active?
+		EnableHTTPConnect(m_enableHttpConn);
+	}
+
+	return TRUE;
+}
+
+BOOL
+vncServer::SockConnected()
+{
+	return m_socketConn != NULL;
+}
+
+BOOL
+vncServer::EnableHTTPConnect(BOOL enable)
+{
+	m_enableHttpConn = enable;
+	if (enable && m_socketConn)
+	{
+		if (m_httpConn == NULL)
+		{
+			m_httpConn = new vncHTTPConnect;
+			if (m_httpConn != NULL)
+			{
+				// Start up the HTTP server
+				// TODO: allow applet params handling like in TightVNC 1.2.7
+				if (!m_httpConn->Init(this,
+									// PORT_TO_DISPLAY(m_port) + HTTP_PORT_OFFSET)
+									m_port_http)
+					)
+				{
+					delete m_httpConn;
+					m_httpConn = NULL;
+					return FALSE;
+				}
+			}
+		}
+	}
+	else
+	{
+		if (m_httpConn != NULL)
+		{
+			// Close the socket
+			delete m_httpConn;
+			m_httpConn = NULL;
+		}
+	}
+
+	return TRUE;
+}
+
+BOOL
+vncServer::EnableXDMCPConnect(BOOL enable)
+{
+	m_enableXdmcpConn = enable;
+	if (enable && m_socketConn)
+	{
+		if (m_xdmcpConn==NULL)
+		{
+			char szCurrentDir[MAX_PATH];
+			if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+				{
+					char* p = strrchr(szCurrentDir, '\\');
+					if (p == NULL) return 0;
+					*p = '\0';
+					strcat (szCurrentDir,"\\xdmcp\\xdmcp.exe");
+				}
+			STARTUPINFO ssi;
+			PROCESS_INFORMATION ppi;
+			ZeroMemory( &ssi, sizeof(ssi) );
+			ssi.cb = sizeof(ssi);
+			// Start the child process. 
+			if( !CreateProcess( NULL, // No module name (use command line). 
+				szCurrentDir, // Command line. 
+		       NULL,             // Process handle not inheritable. 
+		        NULL,             // Thread handle not inheritable. 
+		       FALSE,            // Set handle inheritance to FALSE. 
+		       0,                // No creation flags. 
+		       NULL,             // Use parent's environment block. 
+		       ".\\xdmcp",             // Use parent's starting directory. 
+		       &ssi,              // Pointer to STARTUPINFO structure.
+		       &ppi )             // Pointer to PROCESS_INFORMATION structure.
+		   ) 
+			{
+				m_xdmcpConn=NULL;
+				if (ppi.hThread) CloseHandle(ppi.hThread);
+			}
+			else
+			{
+				WaitForInputIdle(ppi.hProcess, 10000);
+				m_xdmcpConn=ppi.hProcess;
+			}
+			
+		}
+	}
+	else
+	{
+		if (m_xdmcpConn != NULL)
+		{
+				TerminateProcess(m_xdmcpConn,0);
+				m_xdmcpConn=NULL;
+
+		}
+	}
+
+	return TRUE;
+}
+
+BOOL
+vncServer::SetLoopbackOnly(BOOL loopbackOnly)
+{
+	if (loopbackOnly != m_loopbackOnly)
+	{
+		m_loopbackOnly = loopbackOnly;
+		BOOL socketConn = SockConnected();
+		SockConnect(FALSE);
+		SockConnect(socketConn);
+	}
+	return TRUE;
+}
+
+BOOL
+vncServer::LoopbackOnly()
+{
+	return m_loopbackOnly;
+}
+
+void
+vncServer::GetScreenInfo(int &width, int &height, int &depth)
+{
+	rfbServerInitMsg scrinfo;
+//	vnclog.Print(LL_INTINFO, VNCLOG("Lock6\n"));
+	omni_mutex_lock l(m_desktopLock);
+
+	//vnclog.Print(LL_INTINFO, VNCLOG("GetScreenInfo called\n"));
+
+	// Is a desktop object currently active?
+	// No, so create a dummy desktop and interrogate it
+	if (m_desktop == NULL)
+	{
+		HDC				hrootdc;
+		hrootdc = GetDC(NULL);
+		if (hrootdc == NULL) {
+				vnclog.Print(LL_INTERR, VNCLOG("Failed rootdc \n"));
+				scrinfo.framebufferWidth = 0;
+				scrinfo.framebufferHeight = 0;
+				scrinfo.format.bitsPerPixel = 0;
+		}
+		else
+		{
+			scrinfo.framebufferWidth = GetDeviceCaps(hrootdc, HORZRES);
+			scrinfo.framebufferHeight = GetDeviceCaps(hrootdc, VERTRES);
+			HBITMAP membitmap = CreateCompatibleBitmap(hrootdc, scrinfo.framebufferWidth, scrinfo.framebufferHeight);
+			if (membitmap == NULL) {
+				scrinfo.framebufferWidth = 0;
+				scrinfo.framebufferHeight = 0;
+				scrinfo.format.bitsPerPixel = 0;
+				}
+			else
+			{
+				struct _BMInfo {
+				BOOL			truecolour;
+				BITMAPINFO		bmi;
+				// Colormap info - comes straight after BITMAPINFO - **HACK**
+				RGBQUAD			cmap[256];
+				} m_bminfo;
+				int result;
+				HDC				hmemdc;
+				memset(&m_bminfo, 0, sizeof(m_bminfo));
+				m_bminfo.bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+				m_bminfo.bmi.bmiHeader.biBitCount = 0;
+				hmemdc = CreateCompatibleDC(hrootdc);
+				if (hmemdc == NULL) 
+					{
+						scrinfo.framebufferWidth = 0;
+						scrinfo.framebufferHeight = 0;
+						scrinfo.format.bitsPerPixel = 0;
+					}
+				else
+					{
+						result = ::GetDIBits(hmemdc, membitmap, 0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS);
+						if (result == 0) 
+							{
+											scrinfo.framebufferWidth = 0;
+											scrinfo.framebufferHeight = 0;
+											scrinfo.format.bitsPerPixel = 0;
+							}
+						else
+							{
+								result = ::GetDIBits(hmemdc, membitmap,  0, 1, NULL, &m_bminfo.bmi, DIB_RGB_COLORS);
+								if (result == 0) 
+									{
+										scrinfo.framebufferWidth = 0;
+										scrinfo.framebufferHeight = 0;
+										scrinfo.format.bitsPerPixel = 0;
+									}
+								else
+									{
+										scrinfo.format.bitsPerPixel = (CARD8)(m_bminfo.bmi.bmiHeader.biBitCount);
+										if (scrinfo.format.bitsPerPixel==24) scrinfo.format.bitsPerPixel=32;
+									}
+							}//result
+					if (hmemdc != NULL) DeleteDC(hmemdc);
+					}//memdc
+				if (membitmap != NULL) DeleteObject(membitmap);
+			}//membitmap
+			if (hrootdc != NULL) ReleaseDC(NULL, hrootdc);
+		}//rootdc
+	
+		// No, so create a dummy desktop and interrogate it
+	/*	if (!desktop.Init(this))
+		{
+			scrinfo.framebufferWidth = 0;
+			scrinfo.framebufferHeight = 0;
+			scrinfo.format.bitsPerPixel = 0;
+		}
+		else
+		{
+			desktop.FillDisplayInfo(&scrinfo);
+		}*/
+	}
+	else
+	{
+		m_desktop->FillDisplayInfo(&scrinfo);
+	}
+
+	// Get the info from the scrinfo structure
+	width = scrinfo.framebufferWidth;
+	height = scrinfo.framebufferHeight;
+	depth = scrinfo.format.bitsPerPixel;
+}
+
+void
+vncServer::SetAuthHosts(const char*hostlist) {
+	omni_mutex_lock l(m_clientsLock);
+
+	if (hostlist == 0) {
+		vnclog.Print(LL_INTINFO, VNCLOG("authhosts cleared\n"));
+		m_auth_hosts = 0;
+		return;
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("authhosts set to \"%s\"\n"), hostlist);
+	if (m_auth_hosts != 0)
+		free(m_auth_hosts);
+
+	m_auth_hosts = _strdup(hostlist);
+}
+
+char*
+vncServer::AuthHosts() {
+	omni_mutex_lock l(m_clientsLock);
+
+	if (m_auth_hosts == 0)
+		return _strdup("");
+	else
+		return _strdup(m_auth_hosts);
+}
+
+inline BOOL
+MatchStringToTemplate(const char *addr, UINT addrlen,
+				      const char *filtstr, UINT filtlen) {
+	if (filtlen == 0)
+		return 1;
+	if (addrlen < filtlen)
+		return 0;
+	for (UINT x = 0; x < filtlen; x++) {
+		if (addr[x] != filtstr[x])
+			return 0;
+	}
+	if ((addrlen > filtlen) && (addr[filtlen] != '.'))
+		return 0;
+	return 1;
+}
+
+vncServer::AcceptQueryReject
+vncServer::VerifyHost(const char *hostname) {
+	omni_mutex_lock l(m_clientsLock);
+
+	// -=- Is the specified host blacklisted?
+	vncServer::BlacklistEntry	*current = m_blacklist;
+	vncServer::BlacklistEntry	*previous = 0;
+	SYSTEMTIME					systime;
+	FILETIME					ftime;
+	LARGE_INTEGER				now;
+
+	// Get the current time as a 64-bit value
+	GetSystemTime(&systime);
+	SystemTimeToFileTime(&systime, &ftime);
+	now.LowPart=ftime.dwLowDateTime;now.HighPart=ftime.dwHighDateTime;
+	now.QuadPart /= 10000000; // Convert it into seconds
+
+	while (current) {
+
+		// Has the blacklist entry timed out?
+		if ((now.QuadPart - current->_lastRefTime.QuadPart) > 0) {
+
+			// Yes.  Is it a "blocked" entry?
+			if (current->_blocked) {
+				// Yes, so unblock it & re-set the reference time
+				current->_blocked = FALSE;
+				current->_lastRefTime.QuadPart = now.QuadPart + 10;
+			} else {
+				// No, so remove it
+				if (previous)
+					previous->_next = current->_next;
+				else
+					m_blacklist = current->_next;
+				vncServer::BlacklistEntry *next = current->_next;
+				free(current->_machineName);
+				delete current;
+				current = next;
+				continue;
+			}
+
+		}
+
+		// Is this the entry we're interested in?
+		if ((_stricmp(current->_machineName, hostname) == 0) &&
+			(current->_blocked)) {
+			// Machine is blocked, so just reject it
+    		vnclog.Print(LL_CONNERR, VNCLOG("client %s rejected due to blacklist entry\n"), hostname);
+
+			return vncServer::aqrReject;
+		}
+
+		previous = current;
+		current = current->_next;
+	}
+
+	// Has a hostname been specified?
+	if (hostname == 0) {
+		vnclog.Print(LL_INTWARN, VNCLOG("verify failed - null hostname\n"));
+		return vncServer::aqrReject;
+	}
+
+	// Set the state machine into the correct mode & process the filter
+	enum vh_Mode {vh_ExpectDelimiter, vh_ExpectIncludeExclude, vh_ExpectPattern};
+	vh_Mode machineMode = vh_ExpectIncludeExclude;
+	
+	vncServer::AcceptQueryReject verifiedHost = vncServer::aqrAccept;
+
+	vncServer::AcceptQueryReject patternType = vncServer::aqrReject;
+	UINT authHostsPos = 0;
+	UINT patternStart = 0;
+	UINT hostNameLen = strlen(hostname);
+
+	// Run through the auth hosts string until we hit the end
+	if (m_auth_hosts) {
+		while (1) {
+
+			// Which mode are we in?
+			switch (machineMode) {
+
+				// ExpectIncludeExclude - we should see a + or -.
+			case vh_ExpectIncludeExclude:
+				if (m_auth_hosts[authHostsPos] == '+') {
+					patternType = vncServer::aqrAccept;
+					patternStart = authHostsPos+1;
+					machineMode = vh_ExpectPattern;
+				} else if (m_auth_hosts[authHostsPos] == '-') {	
+					patternType = vncServer::aqrReject;
+					patternStart = authHostsPos+1;
+					machineMode = vh_ExpectPattern;
+				} else if (m_auth_hosts[authHostsPos] == '?') {	
+					patternType = vncServer::aqrQuery;
+					patternStart = authHostsPos+1;
+					machineMode = vh_ExpectPattern;
+				} else if (m_auth_hosts[authHostsPos] != '\0') {
+					vnclog.Print(LL_INTWARN, VNCLOG("verify host - malformed AuthHosts string\n"));
+					machineMode = vh_ExpectDelimiter;
+				}
+				break;
+
+				// ExpectPattern - we expect to see a valid pattern
+			case vh_ExpectPattern:
+				// ExpectDelimiter - we're scanning for the next ':', skipping a pattern
+			case vh_ExpectDelimiter:
+				if ((m_auth_hosts[authHostsPos] == ':') ||
+					(m_auth_hosts[authHostsPos] == '\0')) {
+					if (machineMode == vh_ExpectPattern) {
+						if (patternStart == 0) {
+							vnclog.Print(LL_INTWARN, VNCLOG("verify host - pattern processing failed!\n"));
+						} else {
+							// Process the match
+							if (MatchStringToTemplate(hostname, hostNameLen,
+								&(m_auth_hosts[patternStart]), authHostsPos-patternStart)) {
+								// The hostname matched - apply the include/exclude rule
+								verifiedHost = patternType;
+							}
+						}
+					}
+
+					// We now expect another + or -
+					machineMode = vh_ExpectIncludeExclude;
+				}
+				break;
+			}
+
+			// Have we hit the end of the pattern string?
+			if (m_auth_hosts[authHostsPos] == '\0')
+				break;
+			authHostsPos++;
+		}
+	}
+
+    vnclog.Print(LL_INTINFO, VNCLOG("client %s verifiedHost %u prior to adjustment\n"), hostname, verifiedHost);
+
+	// Based on the server's QuerySetting, adjust the verification result
+	switch (verifiedHost) {
+	case vncServer::aqrAccept:
+		if (QuerySetting() >= 3)
+			verifiedHost = vncServer::aqrQuery;
+		break;
+	case vncServer::aqrQuery:
+		if (QuerySetting() <= 1)
+			verifiedHost = vncServer::aqrAccept;
+		else if (QuerySetting() == 4)
+			verifiedHost = vncServer::aqrReject;
+		break;
+	case vncServer::aqrReject:
+		if (QuerySetting() == 0)
+			verifiedHost = vncServer::aqrQuery;
+		break;
+	};
+
+    vnclog.Print(LL_INTINFO, VNCLOG("client %s verifiedHost %u after adjustment\n"), hostname, verifiedHost);
+	return verifiedHost;
+}
+
+void
+vncServer::AddAuthHostsBlacklist(const char *machine) {
+	omni_mutex_lock l(m_clientsLock);
+
+	// -=- Is the specified host blacklisted?
+	vncServer::BlacklistEntry	*current = m_blacklist;
+
+	// Get the current time as a 64-bit value
+	SYSTEMTIME					systime;
+	FILETIME					ftime;
+	LARGE_INTEGER				now;
+	GetSystemTime(&systime);
+	SystemTimeToFileTime(&systime, &ftime);
+	now.LowPart=ftime.dwLowDateTime;now.HighPart=ftime.dwHighDateTime;
+	now.QuadPart /= 10000000; // Convert it into seconds
+
+	while (current) {
+
+		// Is this the entry we're interested in?
+		if (_stricmp(current->_machineName, machine) == 0) {
+
+			// If the host is already blocked then ignore
+			if (current->_blocked)
+				return;
+
+			// Set the RefTime & failureCount
+			current->_lastRefTime.QuadPart = now.QuadPart + 10;
+			current->_failureCount++;
+
+			if (current->_failureCount > 50)
+				current->_blocked = TRUE;
+			return;
+		}
+
+		current = current->_next;
+	}
+
+	if( strcmp( machine, "127.0.0.1" ) == 0 )
+	{
+		return;
+	}
+
+	// Didn't find the entry
+	current = new vncServer::BlacklistEntry;
+	current->_blocked = FALSE;
+	current->_failureCount = 0;
+	current->_lastRefTime.QuadPart = now.QuadPart + 10;
+	current->_machineName = _strdup(machine);
+	current->_next = m_blacklist;
+	m_blacklist = current;
+}
+
+void
+vncServer::RemAuthHostsBlacklist(const char *machine) {
+	omni_mutex_lock l(m_clientsLock);
+
+	// -=- Is the specified host blacklisted?
+	vncServer::BlacklistEntry	*current = m_blacklist;
+	vncServer::BlacklistEntry	*previous = 0;
+
+	while (current) {
+
+		// Is this the entry we're interested in?
+		if (_stricmp(current->_machineName, machine) == 0) {
+			if (previous)
+				previous->_next = current->_next;
+			else
+				m_blacklist = current->_next;
+			vncServer::BlacklistEntry *next = current->_next;
+			free (current->_machineName);
+			delete current;
+			current = next;
+			continue;
+		}
+
+		previous = current;
+		current = current->_next;
+	}
+}
+
+// Modif sf at 2002
+void vncServer::SetSingleWindowName(const char *szName)
+{
+    memcpy(m_szWindowName, szName, 32);
+}
+
+// Modef rdv at 202
+void
+vncServer::SetNewSWSize(long w,long h,BOOL desktop)
+{
+	vncClientList::iterator i;
+		
+	omni_mutex_lock l(m_clientsLock);
+
+	// Post this screen size update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Post the update
+		if (!GetClient(*i)->SetNewSWSize(w,h,desktop)) {
+			vnclog.Print(LL_INTINFO, VNCLOG("Unable to set new desktop size\n"));
+			KillClient(*i);
+		}
+	}
+}
+
+void
+vncServer::SetNewSWSizeFR(long w,long h,BOOL desktop)
+{
+	vncClientList::iterator i;
+		
+	omni_mutex_lock l(m_clientsLock);
+
+	// Post this screen size update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Post the update
+		if (!GetClient(*i)->SetNewSWSizeFR(w,h,desktop)) {
+			vnclog.Print(LL_INTINFO, VNCLOG("Unable to set new desktop size\n"));
+			KillClient(*i);
+		}
+	}
+}
+
+void
+vncServer::SetSWOffset(int x,int y)
+{
+	vncClientList::iterator i;
+		
+	omni_mutex_lock l(m_clientsLock);
+
+	// Post this screen size update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Post the update
+		GetClient(*i)->SetSWOffset(x,y);
+	}
+
+}
+
+void
+vncServer::InitialUpdate(bool value)
+{
+	vncClientList::iterator i;
+		
+	omni_mutex_lock l(m_clientsLock);
+
+	// Post this screen size update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Post the update
+		GetClient(*i)->InitialUpdate(value);
+	}
+
+}
+
+void
+vncServer::SetScreenOffset(int x,int y,int type)
+{
+	vncClientList::iterator i;
+		
+	omni_mutex_lock l(m_clientsLock);
+
+	// Post this screen size update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Post the update
+		GetClient(*i)->SetScreenOffset(x,y,type);
+	}
+
+}
+
+// Modif sf at 2002 - v1.1.0 - Default Scaling
+UINT vncServer::GetDefaultScale()
+{
+	return m_nDefaultScale;
+}
+
+
+BOOL vncServer::SetDefaultScale(int nScale)
+{
+	m_nDefaultScale = nScale;
+
+	return TRUE;
+}
+
+
+BOOL vncServer::FileTransferEnabled()
+{
+	return m_fFileTransferEnabled;
+}
+
+BOOL vncServer::EnableFileTransfer(BOOL fEnable)
+{
+	m_fFileTransferEnabled = fEnable;
+
+	return TRUE;
+}
+
+BOOL vncServer::MSLogonRequired()
+{
+	return m_fMSLogonRequired;
+}
+
+BOOL vncServer::RequireMSLogon(BOOL fEnable)
+{
+	m_fMSLogonRequired = fEnable;
+
+	return TRUE;
+}
+
+BOOL vncServer::GetNewMSLogon()
+{
+	return m_fNewMSLogon;
+}
+
+BOOL vncServer::SetNewMSLogon(BOOL fEnable)
+{
+	m_fNewMSLogon = fEnable;
+
+	return TRUE;
+}
+
+//
+// sf at 2002 - v1.1.x - DSM Plugin
+//
+BOOL vncServer::IsDSMPluginEnabled()
+{
+	return m_fDSMPluginEnabled;
+}
+
+void vncServer::EnableDSMPlugin(BOOL fEnable)
+{
+	m_fDSMPluginEnabled = fEnable;
+}
+
+char* vncServer::GetDSMPluginName()
+{
+	return m_szDSMPlugin;
+}
+
+
+void vncServer::SetDSMPluginName(char* szDSMPlugin)
+{
+	strcpy_s(m_szDSMPlugin, 128,szDSMPlugin);
+	return;
+}
+
+//
+// Load if necessary and initialize the current DSMPlugin
+// This can only be done if NO client is connected (for the moment)
+//
+BOOL vncServer::SetDSMPlugin(BOOL bForceReload)
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Entry \n"));
+	if (AuthClientCount() > 0) return FALSE;
+
+	if (!IsDSMPluginEnabled()) return FALSE;
+
+	vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Enabled \n"));
+
+	// If the plugin is loaded, unload it first
+	// sf at 2003 - it has been possibly pre-configured by
+	// clicking on the plugin config button
+	if (m_pDSMPlugin->IsLoaded())
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Is Loaded \n"));
+
+		// sf at 2003 - We check if the loaded plugin is the same than
+		// the currently selected one or not
+		m_pDSMPlugin->DescribePlugin();
+		if (_stricmp(m_pDSMPlugin->GetPluginFileName(), GetDSMPluginName()) || bForceReload)
+		{
+			if (bForceReload)
+				vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - FORCE RELOADING OF THE PLUGIN \n"));
+			vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - New one - Unload the current \n"));
+			m_pDSMPlugin->SetEnabled(false);
+			m_pDSMPlugin->UnloadPlugin();
+		}
+	}
+
+	if (!m_pDSMPlugin->IsLoaded())
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Plugin NOT loaded - Try to load it \n"));
+		if (!m_pDSMPlugin->LoadPlugin(GetDSMPluginName(), false))
+		{
+			vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ DSMPlugin cannot be loaded\n"));
+			return FALSE;
+		}
+	}
+
+	vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Plugin successfully loaded \n"));
+
+	// Now that it is loaded, init it
+	if (m_pDSMPlugin->InitPlugin())
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - Init plugin call \n"));
+		char szParams[MAXPWLEN + 64];
+		char password[MAXPWLEN];
+		GetPassword(password);
+		// Does the plugin need the VNC password to do its job ?
+		if (!_stricmp(m_pDSMPlugin->GetPluginParams(), "VNCPasswordNeeded"))
+			strcpy(szParams, vncDecryptPasswd((char *)password));
+		else
+			strcpy(szParams, "NoPassword");
+
+		// The second parameter tells the plugin the kind of program is using it
+		// (in WinVNC : "server-app" or "server-svc"
+		strcat(szParams, ",");
+		strcat(szParams, vncService::RunningAsService() ? "server-svc" : "server-app");
+
+		//::MessageBoxSecure(NULL, szParams, "SetDSMPlugin info", MB_OK);
+
+		vnclog.Print(LL_INTINFO, VNCLOG("$$$$$$$$$$ SetDSMPlugin - SetPluginParams call \n"));
+
+
+		//adzm 2010-05-12 - dsmplugin config
+		if (m_pDSMPlugin->SetPluginParams(NULL, szParams/*vncDecryptPasswd((char *)password)*/, GetDSMPluginConfig(), NULL))
+		{
+			m_pDSMPlugin->SetEnabled(true); // The plugin is ready to be used
+			vnclog.Print(LL_INTINFO, VNCLOG("DSMPlugin Params OK\n"));
+			return TRUE;
+		}
+		else
+		{
+			m_pDSMPlugin->SetEnabled(false);
+			vnclog.Print(LL_INTINFO, VNCLOG("Unable to set DSMPlugin Params\n"));
+		}
+	}
+	else
+	{
+		m_pDSMPlugin->SetEnabled(false);
+		vnclog.Print(LL_INTINFO, VNCLOG("Unable to init DSMPlugin\n"));
+	}
+
+	/*
+	MessageBoxSecure(NULL, 
+	_T(_this->m_pDSMPlugin->DescribePlugin()),
+	_T("Plugin Description"), MB_OK | MB_ICONEXCLAMATION );
+	*/
+
+	return TRUE;
+}
+
+//adzm 2010-05-12 - dsmplugin config
+void vncServer::SetDSMPluginConfig(char* szDSMPluginConfig)
+{
+	strncpy_s(m_szDSMPluginConfig, sizeof(m_szDSMPluginConfig) - 1, szDSMPluginConfig, _TRUNCATE);
+}
+
+//
+// sgf at 2002 - for now, we disable cache rects when more than one client
+// 
+void vncServer::DisableCacheForAllClients()
+{
+	vncClientList::iterator i;
+		
+	omni_mutex_lock l(m_clientsLock);
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		GetClient(*i)->EnableCache(FALSE);
+	}
+
+}
+
+void
+vncServer::Clear_Update_Tracker() {
+	vncClientList::iterator i;
+	omni_mutex_lock l(m_clientsLock);
+	// Post this update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		GetClient(*i)->Clear_Update_Tracker();
+
+	}
+}
+
+
+void vncServer::Driver(BOOL enable)
+{
+	sethook=true;
+	m_driver = enable;
+}
+	
+void vncServer::Hook(BOOL enable)
+{
+	sethook=true;
+	m_hook=enable;
+}
+
+void vncServer::SetHookings()
+{
+	if (sethook && m_desktop)
+	{
+		 m_desktop->SethookMechanism(Hook(),Driver());
+	}
+	sethook=false;
+}
+
+void vncServer::EnableXRichCursor(BOOL fEnable)
+{
+	m_fXRichCursor = fEnable;
+}
+
+BOOL
+vncServer::SetDisableTrayIcon(BOOL disableTrayIcon)
+{
+	if (disableTrayIcon != m_disableTrayIcon)
+	{
+		m_disableTrayIcon = disableTrayIcon;
+	}
+	return TRUE;
+}
+
+BOOL
+vncServer::GetDisableTrayIcon()
+{
+	return m_disableTrayIcon;
+}
+BOOL
+vncServer::SetAllowEditClients(BOOL AllowEditClients)
+{
+	if (AllowEditClients != m_AllowEditClients)
+	{
+		m_AllowEditClients = AllowEditClients;
+	}
+	return TRUE;
+}
+
+BOOL
+vncServer::GetAllowEditClients()
+{
+	return m_AllowEditClients;
+}
+
+BOOL
+vncServer::All_clients_initialalized() {
+	vncClientList::iterator i;
+	// Post this update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		if (!GetClient(*i)->client_settings_passed) return false;
+
+	}
+	return true;
+}
+
+void
+vncServer::TriggerUpdate() {
+	vncClientList::iterator i;
+	// Post this update to all the connected clients
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		GetClient(*i)->TriggerUpdate();
+
+	}
+}
+
+
+bool vncServer::IsClient(vncClient* pClient)
+{
+  vncClientList::iterator i;
+  for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+    if (GetClient(*i) == pClient) return true;
+
+  return false;
+}
+void vncServer::AutoConnectRetry( )
+{
+	if ( m_fAutoReconnect && !fShutdownOrdered)
+	{
+		vnclog.Print(LL_INTINFO, VNCLOG("AutoConnectRetry(): started\n"));
+		if (m_retry_timeout == 0) m_retry_timeout = SetTimer( NULL, 0, (100), (TIMERPROC)_timerRetryHandler );
+	}
+}
+void CALLBACK vncServer::_timerRetryHandler( HWND /*hWnd*/, UINT /*uMsg*/, UINT_PTR /*idEvent*/, DWORD /*dwTime*/ )
+{
+	vncServer* pIface = (vncServer*)pThis;
+	pIface->_actualTimerRetryHandler( );
+}
+void vncServer::_actualTimerRetryHandler()
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("Attempting AutoReconnect....\n"));
+	
+	KillTimer( NULL, m_retry_timeout );
+	
+	
+	if ( m_fAutoReconnect && strlen(m_szAutoReconnectAdr) > 0 && !fShutdownOrdered)
+	{
+
+		VSocket *tmpsock;
+		tmpsock = new VSocket;
+		if (tmpsock) {
+
+
+			if (G_HTTP)
+				{
+					if (tmpsock->Http_CreateConnect(m_szAutoReconnectAdr))
+					{
+						if ( strlen( m_szAutoReconnectId ) > 0 )
+						{
+						// wa at 2005 -- added support for the AutoReconnectId
+						// Set the ID for this client -- code taken from vncconndialog.cpp (ln:142)
+						tmpsock->Send(m_szAutoReconnectId,250);
+						tmpsock->SetTimeout(0);
+						
+						// adzm 2009-07-05 - repeater IDs
+						// Add the new client to this server
+						// adzm 2009-08-02
+						AddClient(tmpsock, TRUE, TRUE, 0, NULL, m_szAutoReconnectId, m_szAutoReconnectAdr, m_AutoReconnectPort);
+						m_retry_timeout = 0;
+						} else {
+						// Add the new client to this server
+						// adzm 2009-08-02
+						AddClient(tmpsock, TRUE, TRUE, 0, NULL, NULL, m_szAutoReconnectAdr, m_AutoReconnectPort);
+						m_retry_timeout = 0;
+						}
+					}
+					else
+					{
+						// Connect out to the specified host on the VNCviewer listen port
+						tmpsock->Create();
+						if (tmpsock->Connect(m_szAutoReconnectAdr, m_AutoReconnectPort)) {
+							if ( strlen( m_szAutoReconnectId ) > 0 )
+							{
+								tmpsock->Send(m_szAutoReconnectId,250);
+								tmpsock->SetTimeout(0);
+								// adzm 2009-07-05 - repeater IDs
+								// Add the new client to this server
+								AddClient(tmpsock, TRUE, TRUE, 0, NULL, m_szAutoReconnectId, m_szAutoReconnectAdr, m_AutoReconnectPort);
+								m_retry_timeout = 0;
+							} else {
+								// Add the new client to this server
+								// adzm 2009-08-02
+								AddClient(tmpsock, TRUE, TRUE, 0, NULL, NULL, m_szAutoReconnectAdr, m_AutoReconnectPort);
+								m_retry_timeout = 0;
+							}
+						} else {
+							delete tmpsock;
+							m_retry_timeout = SetTimer( NULL, 0, (1000*30), (TIMERPROC)_timerRetryHandler );
+						}
+					}
+
+				}
+				else
+				{
+					// Connect out to the specified host on the VNCviewer listen port
+					tmpsock->Create();
+					if (tmpsock->Connect(m_szAutoReconnectAdr, m_AutoReconnectPort)) {
+						if ( strlen( m_szAutoReconnectId ) > 0 )
+						{
+							tmpsock->Send(m_szAutoReconnectId,250);
+							tmpsock->SetTimeout(0);
+							// adzm 2009-07-05 - repeater IDs
+							// Add the new client to this server
+							AddClient(tmpsock, TRUE, TRUE, 0, NULL, m_szAutoReconnectId, m_szAutoReconnectAdr, m_AutoReconnectPort);
+							m_retry_timeout = 0;
+						} else {
+							// Add the new client to this server
+							// adzm 2009-08-02
+							AddClient(tmpsock, TRUE, TRUE, 0, NULL, NULL, m_szAutoReconnectAdr, m_AutoReconnectPort);
+							m_retry_timeout = 0;
+						}
+					} else {
+						delete tmpsock;
+						m_retry_timeout = SetTimer( NULL, 0, (1000*30), (TIMERPROC)_timerRetryHandler );
+					}
+			}
+		} //tempsocket
+	}
+	else
+	{
+		m_retry_timeout = 0;
+	}
+}
+void vncServer::NotifyClients_StateChange(CARD32 state, CARD32 value)
+{
+	omni_mutex_lock l(m_clientsLock);
+    vncClient *client = NULL;
+
+    vncClientList::iterator i;
+
+	for (i = m_unauthClients.begin(); i != m_unauthClients.end(); i++)
+		{
+
+			// Is this the right client?
+        client = GetClient(*i);
+        if (!client)
+            continue;
+
+        client->Record_SendServerStateUpdate(state, value);
+		}
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Is this the right client?
+        client = GetClient(*i);
+        if (!client)
+            continue;
+
+        client->Record_SendServerStateUpdate(state, value);
+	}
+}
+
+void vncServer::StopReconnectAll()
+{
+	omni_mutex_lock l(m_clientsLock);
+    vncClient *client = NULL;
+
+    vncClientList::iterator i;
+
+	for (i = m_authClients.begin(); i != m_authClients.end(); i++)
+	{
+		// Is this the right client?
+        client = GetClient(*i);
+        if (!client)
+            continue;
+
+        client->m_Autoreconnect=false;
+	}
+}
+
+void vncServer::SetFTTimeout(int msecs)
+{
+    m_ftTimeout = msecs;
+}
diff --git a/ica/win32/winvnc/winvnc/vncserver.h b/ica/win32/winvnc/winvnc/vncserver.h
new file mode 100644
index 0000000..3ad569d
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncserver.h
@@ -0,0 +1,614 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 2000-2002 Const Kaplinsky. All Rights Reserved.
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncServer.h
+
+// vncServer class handles the following functions:
+// - Allowing clients to be dynamically added and removed
+// - Propagating updates from the local vncDesktop object
+//   to all the connected clients
+// - Propagating mouse movements and keyboard events from
+//   clients to the local vncDesktop
+// It also creates the vncSockConnect
+// servers, which respectively allow connections via sockets
+// and via the ORB interface
+extern bool			fShutdownOrdered;
+class vncServer;
+
+#if (!defined(_WINVNC_VNCSERVER))
+#define _WINVNC_VNCSERVER
+
+// Custom
+#include "vncsockconnect.h"
+#include "vnchttpconnect.h"
+#include "vncclient.h"
+#include "rfbRegion.h"
+#include "vncpasswd.h"
+
+// Includes
+#include "stdhdrs.h"
+#include <omnithread.h>
+#include <list>
+
+// adzm - 2010-07 - Extended clipboard
+#include "common/Clipboard.h"
+
+typedef BOOL (WINAPI *WTSREGISTERSESSIONNOTIFICATION)(HWND, DWORD);
+typedef BOOL (WINAPI *WTSUNREGISTERSESSIONNOTIFICATION)(HWND);
+#define WM_WTSSESSION_CHANGE            0x02B1
+#define WTS_CONSOLE_CONNECT                0x1
+#define WTS_CONSOLE_DISCONNECT             0x2
+#define WTS_REMOTE_CONNECT                 0x3
+#define WTS_REMOTE_DISCONNECT              0x4
+#define WTS_SESSION_LOGON                  0x5
+#define WTS_SESSION_LOGOFF                 0x6
+#define WTS_SESSION_LOCK                   0x7
+#define WTS_SESSION_UNLOCK                 0x8
+#define WTS_SESSION_REMOTE_CONTROL         0x9
+
+// Define a datatype to handle lists of windows we wish to notify
+typedef std::list<HWND> vncNotifyList;
+
+// Some important constants;
+const int MAX_CLIENTS = 128;
+
+// The vncServer class itself
+
+class vncServer
+{
+public:
+
+	HANDLE m_impersonationtoken;
+
+	// Constructor/destructor
+	vncServer();
+	~vncServer();
+
+	// Client handling functions
+	virtual vncClientId AddClient(VSocket *socket, BOOL auth, BOOL shared);
+	virtual vncClientId AddClient(VSocket *socket, BOOL auth, BOOL shared,rfbProtocolVersionMsg *protocolMsg);
+	virtual vncClientId AddClient(VSocket *socket,
+		BOOL auth, BOOL shared, int capability,
+		/*BOOL keysenabled, BOOL ptrenabled,*/rfbProtocolVersionMsg *protocolMsg);
+	
+	// adzm 2009-07-05
+	// adzm 2009-08-02
+	virtual vncClientId AddClient(VSocket *socket,
+		BOOL auth, BOOL shared, int capability,
+		/*BOOL keysenabled, BOOL ptrenabled,*/rfbProtocolVersionMsg *protocolMsg,VString szRepeaterID,VString szHost,VCard port);
+
+	virtual BOOL Authenticated(vncClientId client);
+	virtual void KillClient(vncClientId client);
+	virtual void KillClient(LPSTR szClientName); // sf at 2002
+	virtual void TextChatClient(LPSTR szClientName); // sf at 2002
+	bool IsUltraVncViewer();
+	bool AreThereMultipleViewers();
+
+	virtual UINT AuthClientCount();
+	virtual UINT UnauthClientCount();
+
+	virtual void KillAuthClients();
+	virtual void ListAuthClients(HWND hListBox);
+	virtual void WaitUntilAuthEmpty();
+
+	virtual void KillUnauthClients();
+	virtual void ListUnauthClients(HWND hListBox); // adzm 2009-07-05
+	virtual void WaitUntilUnauthEmpty();
+
+	// Are any clients ready to send updates?
+	virtual BOOL UpdateWanted();
+
+	// Has at least one client had a remote event?
+	virtual BOOL RemoteEventReceived();
+
+	// Client info retrieval/setup
+	virtual vncClient* GetClient(vncClientId clientid);
+	virtual vncClientList ClientList();
+
+	virtual void SetCapability(vncClientId client, int capability);
+	virtual void SetKeyboardEnabled(vncClientId client, BOOL enabled);
+	virtual void SetPointerEnabled(vncClientId client, BOOL enabled);
+
+	virtual int GetCapability(vncClientId client);
+	virtual const char* GetClientName(vncClientId client);
+
+	// Let a client remove itself
+	virtual void RemoveClient(vncClientId client);
+
+	// Connect/disconnect notification
+	virtual BOOL AddNotify(HWND hwnd);
+	virtual BOOL RemNotify(HWND hwnd);
+
+	// Modif sf at 2002 - Single Window
+	virtual void SingleWindow(BOOL fEnabled) { m_SingleWindow = fEnabled; };
+	virtual BOOL SingleWindow() { return m_SingleWindow; };
+	virtual void SetSingleWindowName(const char *szName);
+	virtual char *GetWindowName() { return m_szWindowName; };
+	virtual vncDesktop* GetDesktopPointer() {return m_desktop;}
+	virtual void SetNewSWSize(long w,long h,BOOL desktop);
+	virtual void SetNewSWSizeFR(long w,long h,BOOL desktop);
+	virtual void SetSWOffset(int x,int y);
+	virtual void SetScreenOffset(int x,int y,int type); //never locked
+	virtual void InitialUpdate(bool value);
+
+	virtual BOOL All_clients_initialalized();
+
+	// Lock to protect the client list from concurrency - lock when reading/updating client list
+	omni_mutex			m_clientsLock;
+
+	UINT				m_port;
+	UINT				m_port_http; // TightVNC 1.2.7
+
+	virtual void ShutdownServer();
+
+protected:
+	// Send a notification message
+	
+
+public:
+	int AutoReconnect_counter;
+	virtual void DoNotify(UINT message, WPARAM wparam, LPARAM lparam);
+	// Update handling, used by the screen server
+	virtual rfb::UpdateTracker &GetUpdateTracker() {return m_update_tracker;};
+	virtual void UpdateMouse();
+	// adzm - 2010-07 - Extended clipboard
+	//virtual void UpdateClipText(const char* text);
+	virtual void UpdateClipTextEx(HWND hwndOwner, vncClient* excludeClient = NULL);
+	virtual void UpdatePalette(bool lock);
+	virtual void UpdateLocalFormat(bool lock);
+
+	// Polling mode handling
+	virtual void PollUnderCursor(BOOL enable) {m_poll_undercursor = enable;};
+	virtual BOOL PollUnderCursor() {return m_poll_undercursor;};
+	virtual void PollForeground(BOOL enable) {m_poll_foreground = enable;};
+	virtual BOOL PollForeground() {return m_poll_foreground;};
+	virtual void PollFullScreen(BOOL enable) {m_poll_fullscreen = enable;};
+	virtual BOOL PollFullScreen() {return m_poll_fullscreen;};
+
+	virtual void Driver(BOOL enable);
+	virtual BOOL Driver() {return m_driver;};
+	virtual void Hook(BOOL enable);
+	virtual BOOL Hook() {return m_hook;};
+	virtual void Virtual(BOOL enable) {m_virtual = enable;};
+	virtual BOOL Virtual() {return m_virtual;};
+	virtual void SetHookings();
+
+	virtual void PollConsoleOnly(BOOL enable) {m_poll_consoleonly = enable;};
+	virtual BOOL PollConsoleOnly() {return m_poll_consoleonly;};
+	virtual void PollOnEventOnly(BOOL enable) {m_poll_oneventonly = enable;};
+	virtual BOOL PollOnEventOnly() {return m_poll_oneventonly;};
+	virtual void MaxCpu(LONG maxcpu) {m_MaxCpu = maxcpu;};
+	virtual LONG MaxCpu() {return m_MaxCpu;};
+
+	// Client manipulation of the clipboard
+	virtual void UpdateLocalClipText(LPSTR text);
+	// adzm - 2010-07 - Extended clipboard
+	virtual void UpdateLocalClipTextEx(ExtendedClipboardDataMessage& extendedClipboardDataMessage, vncClient* sourceClient);
+
+	// Name and port number handling
+	// TightVNC 1.2.7
+	virtual void SetName(const char * name);
+	virtual void SetPorts(const UINT port_rfb, const UINT port_http);
+	virtual UINT GetPort() { return m_port; };
+	virtual UINT GetHttpPort() { return m_port_http; };
+	// RealVNC method
+	/*
+	virtual void SetPort(const UINT port);
+	virtual UINT GetPort();
+	*/
+	virtual void KillSockConnect();
+	virtual void SetAutoPortSelect(const BOOL autoport) {
+	    if (autoport && !m_autoportselect)
+	    {
+		BOOL sockconnect = SockConnected();
+		SockConnect(FALSE);
+		m_autoportselect = autoport;
+		SockConnect(sockconnect);
+	    }
+		else
+		{
+			m_autoportselect = autoport;
+		}
+	};
+	virtual BOOL AutoPortSelect() {return m_autoportselect;};
+
+	// Password set/retrieve.  Note that these functions now handle the encrypted
+	// form, not the plaintext form.  The buffer passwed MUST be MAXPWLEN in size.
+	virtual void SetPassword(const char *passwd);
+	virtual void GetPassword(char *passwd);
+	virtual void SetPassword2(const char *passwd2); //PGM
+	virtual void GetPassword2(char *passwd2); //PGM
+
+	// Remote input handling
+	virtual void EnableRemoteInputs(BOOL enable);
+	virtual BOOL RemoteInputsEnabled();
+
+	// Local input handling
+	virtual void DisableLocalInputs(BOOL disable);
+	virtual bool LocalInputsDisabled();
+	virtual BOOL JapInputEnabled();
+	virtual void EnableJapInput(BOOL enable);
+	virtual void Clearconsole(BOOL enable);
+
+	// General connection handling
+	virtual void SetConnectPriority(UINT priority) {m_connect_pri = priority;};
+	virtual UINT ConnectPriority() {return m_connect_pri;};
+
+	// Socket connection handling
+	virtual BOOL SockConnect(BOOL on);
+	virtual BOOL SockConnected();
+	virtual BOOL SetLoopbackOnly(BOOL loopbackOnly);
+	virtual BOOL LoopbackOnly();
+
+
+	// Tray icon disposition
+	virtual BOOL SetDisableTrayIcon(BOOL disableTrayIcon);
+	virtual BOOL GetDisableTrayIcon();
+	virtual BOOL SetAllowEditClients(BOOL AllowEditClients);
+	virtual BOOL GetAllowEditClients();
+
+
+	// HTTP daemon handling
+	virtual BOOL EnableHTTPConnect(BOOL enable);
+	virtual BOOL HTTPConnectEnabled() {return m_enableHttpConn;};
+	virtual BOOL EnableXDMCPConnect(BOOL enable);
+	virtual BOOL XDMCPConnectEnabled() {return m_enableXdmcpConn;};
+
+	virtual void GetScreenInfo(int &width, int &height, int &depth);
+
+	// Allow connections if no password is set?
+	virtual void SetAuthRequired(BOOL reqd) {m_passwd_required = reqd;};
+	virtual BOOL AuthRequired() {return m_passwd_required;};
+
+	// Handling of per-client connection authorisation
+	virtual void SetAuthHosts(const char *hostlist);
+	virtual char *AuthHosts();
+	enum AcceptQueryReject {aqrAccept, aqrQuery, aqrReject};
+	virtual AcceptQueryReject VerifyHost(const char *hostname);
+
+	// Blacklisting of machines which fail connection attempts too often
+	// Such machines will fail VerifyHost for a short period
+	virtual void AddAuthHostsBlacklist(const char *machine);
+	virtual void RemAuthHostsBlacklist(const char *machine);
+
+	// Connection querying settings
+	virtual void SetQuerySetting(const UINT setting) {m_querysetting = setting;};
+	virtual UINT QuerySetting() {return m_querysetting;};
+	virtual void SetQueryAccept(const UINT setting) {m_queryaccept = setting;};
+	virtual UINT QueryAccept() {return m_queryaccept;};
+	virtual void SetQueryTimeout(const UINT setting) {m_querytimeout = setting;};
+	virtual UINT QueryTimeout() {return m_querytimeout;};
+
+	// marscha at 2006 - Is AcceptDialog required even if no user is logged on
+    virtual void SetQueryIfNoLogon(const UINT setting) {m_queryifnologon = (setting != 0);};
+	virtual BOOL QueryIfNoLogon() {return m_queryifnologon;};
+
+	// Whether or not to allow connections from the local machine
+	virtual void SetLoopbackOk(BOOL ok) {m_loopback_allowed = ok;};
+	virtual BOOL LoopbackOk() {return m_loopback_allowed;};
+
+	// Whether or not to shutdown or logoff when the last client leaves
+	virtual void SetLockSettings(int ok) {m_lock_on_exit = ok;};
+	virtual int LockSettings() {return m_lock_on_exit;};
+
+	// Timeout for automatic disconnection of idle connections
+	virtual void SetAutoIdleDisconnectTimeout(const UINT timeout) {m_idle_timeout = timeout;};
+	virtual UINT AutoIdleDisconnectTimeout() {return m_idle_timeout;};
+
+	// Removal of desktop wallpaper, etc
+	virtual void EnableRemoveWallpaper(const BOOL enable) {m_remove_wallpaper = enable;};
+	virtual BOOL RemoveWallpaperEnabled() {return m_remove_wallpaper;};
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	virtual void EnableRemoveEffects(const BOOL enable) {m_remove_effects = enable;};
+	virtual BOOL RemoveEffectsEnabled() {return m_remove_effects;};
+	virtual void EnableRemoveFontSmoothing(const BOOL enable) {m_remove_fontsmoothing = enable;};
+	virtual BOOL RemoveFontSmoothingEnabled() {return m_remove_fontsmoothing;};
+	// Removal of desktop composit desktop, etc
+	virtual void EnableRemoveAero(const BOOL enable) {m_remove_Aero = enable;};
+	virtual BOOL RemoveAeroEnabled() {return m_remove_Aero;};
+
+	// sf at 2002 - v1.1.x - Server Default Scale
+	virtual UINT GetDefaultScale();
+	virtual BOOL SetDefaultScale(int nScale);
+	virtual BOOL FileTransferEnabled();
+	virtual BOOL EnableFileTransfer(BOOL fEnable);
+	virtual BOOL BlankMonitorEnabled() {return m_fBlankMonitorEnabled;};
+	virtual void BlankMonitorEnabled(BOOL fEnable) {m_fBlankMonitorEnabled = fEnable;};
+	virtual BOOL BlankInputsOnly() {return m_fBlankInputsOnly;}; //PGM
+	virtual void BlankInputsOnly(BOOL fEnable) {m_fBlankInputsOnly = fEnable;}; //PGM
+	virtual BOOL MSLogonRequired();
+	virtual BOOL RequireMSLogon(BOOL fEnable);
+	virtual BOOL GetNewMSLogon();
+	virtual BOOL SetNewMSLogon(BOOL fEnable);
+
+	virtual BOOL Primary() {return m_PrimaryEnabled;};
+	virtual void Primary(BOOL fEnable) {m_PrimaryEnabled = fEnable;};
+	virtual BOOL Secondary() {return m_SecondaryEnabled;};
+	virtual void Secondary(BOOL fEnable) {m_SecondaryEnabled = fEnable;};
+
+	// sf at 2002 - DSM Plugin
+	virtual BOOL IsDSMPluginEnabled();
+	virtual void EnableDSMPlugin(BOOL fEnable);
+	virtual char* GetDSMPluginName();
+	virtual void SetDSMPluginName(char* szDSMPlugin);
+	virtual BOOL SetDSMPlugin(BOOL fForceReload);
+	virtual CDSMPlugin* GetDSMPluginPointer() { return m_pDSMPlugin;};
+	//adzm 2010-05-12 - dsmplugin config
+	virtual void SetDSMPluginConfig(char* szDSMPluginConfig);
+	virtual char* GetDSMPluginConfig() { return m_szDSMPluginConfig;};
+
+	// sf at 2002 - Cursor handling
+	virtual void EnableXRichCursor(BOOL fEnable);
+	virtual BOOL IsXRichCursorEnabled() {return m_fXRichCursor;}; 
+
+	// sf at 2002
+	virtual void DisableCacheForAllClients();
+	virtual bool IsThereASlowClient();
+	virtual bool IsThereAUltraEncodingClient();
+	virtual bool IsThereFileTransBusy();
+
+	// sf at 2002 - Turbo Mode
+	virtual void TurboMode(BOOL fEnabled) { m_TurboMode = fEnabled; };
+	virtual BOOL TurboMode() { return m_TurboMode; };
+
+	// sf at 2003 - AutoReconnect
+	virtual BOOL AutoReconnect()
+	{
+		if (fShutdownOrdered) return false;
+		return m_fAutoReconnect;
+	};
+	virtual BOOL IdReconnect(){return m_fIdReconnect;};
+	virtual UINT AutoReconnectPort(){return m_AutoReconnectPort;};
+	virtual char* AutoReconnectAdr(){return m_szAutoReconnectAdr;}
+	virtual char* AutoReconnectId(){return m_szAutoReconnectId;}
+	virtual void AutoReconnect(BOOL fEnabled){m_fAutoReconnect = fEnabled;};
+	virtual void IdReconnect(BOOL fEnabled){m_fIdReconnect = fEnabled;};
+	virtual void AutoReconnectPort(UINT nPort){m_AutoReconnectPort = nPort;};
+	virtual void AutoReconnectAdr(char* szAdr){strcpy_s(m_szAutoReconnectAdr,255, szAdr);}
+	virtual void AutoReconnectId(char* szId){strcpy_s(m_szAutoReconnectId,MAX_PATH, szId);}
+	virtual void AutoConnectRetry( );
+	static void CALLBACK _timerRetryHandler( HWND /*hWnd*/, UINT /*uMsg*/, UINT_PTR /*idEvent*/, DWORD /*dwTime*/ );
+	void _actualTimerRetryHandler();
+
+	// sf at 2007 - Vista / XP FUS special modes
+	virtual BOOL RunningFromExternalService(){return m_fRunningFromExternalService;};
+	virtual void RunningFromExternalService(BOOL fEnabled){m_fRunningFromExternalService = true;};
+
+	virtual void AutoRestartFlag(BOOL fOn){m_fAutoRestart = fOn;};
+	virtual BOOL AutoRestartFlag(){return m_fAutoRestart;};
+
+	// sf at 2005 - FTUserImpersonation
+	virtual BOOL FTUserImpersonation(){return m_fFTUserImpersonation;};
+	virtual void FTUserImpersonation(BOOL fEnabled){m_fFTUserImpersonation = fEnabled;};
+
+	virtual BOOL CaptureAlphaBlending(){return m_fCaptureAlphaBlending;};
+	virtual void CaptureAlphaBlending(BOOL fEnabled){m_fCaptureAlphaBlending = fEnabled;};
+	virtual BOOL BlackAlphaBlending(){return m_fBlackAlphaBlending;};
+	virtual void BlackAlphaBlending(BOOL fEnabled){m_fBlackAlphaBlending = fEnabled;};
+
+	// [v1.0.2-jp1 fix]
+//	virtual BOOL GammaGray(){return m_fGammaGray;};
+//	virtual void GammaGray(BOOL fEnabled){m_fGammaGray = fEnabled;};
+
+	virtual void Clear_Update_Tracker();
+	virtual void UpdateCursorShape();
+
+	bool IsClient(vncClient* pClient);
+
+    void EnableServerStateUpdates(bool newstate) { m_fEnableStateUpdates = newstate; }
+    bool DoServerStateUpdates() { return m_fEnableStateUpdates; }
+    void NotifyClients_StateChange(CARD32 state, CARD32 value);
+    int  GetFTTimeout() { return m_ftTimeout; }
+    int  GetKeepAliveInterval () { return m_keepAliveInterval; }
+    void SetFTTimeout(int msecs);
+    void EnableKeepAlives(bool newstate) { m_fEnableKeepAlive = newstate; }
+    bool DoKeepAlives() { return m_fEnableKeepAlive; }
+    void SetKeepAliveInterval(int secs) { 
+        m_keepAliveInterval = secs; 
+    if (m_keepAliveInterval >= (m_ftTimeout - KEEPALIVE_HEADROOM))
+        m_keepAliveInterval = m_ftTimeout  - KEEPALIVE_HEADROOM;
+    }
+
+	// adzm 2010-08
+	void SetSocketKeepAliveTimeout(int timeout)	{ m_socketKeepAliveTimeout = timeout > 0 ? timeout : 0; VSocket::SetSocketKeepAliveTimeoutDefault(m_socketKeepAliveTimeout); }
+	int GetSocketKeepAliveTimeout() { return m_socketKeepAliveTimeout; }
+
+	void TriggerUpdate();
+	UINT				m_retry_timeout;
+	bool OS_Shutdown;
+	void StopReconnectAll();
+
+protected:
+	// The vncServer UpdateTracker class
+	// Behaves like a standard UpdateTracker, but propagates update
+	// information to active clients' trackers
+
+	class ServerUpdateTracker : public rfb::UpdateTracker {
+	public:
+		ServerUpdateTracker() : m_server(0) {};
+
+		virtual void init(vncServer *server) {m_server=server;};
+
+		virtual void add_changed(const rfb::Region2D &region);
+		virtual void add_cached(const rfb::Region2D &region);
+		virtual void add_copied(const rfb::Region2D &dest, const rfb::Point &delta);
+	protected:
+		vncServer *m_server;
+	};
+
+	friend class ServerUpdateTracker;
+
+	ServerUpdateTracker	m_update_tracker;
+
+	// Internal stuffs
+protected:
+	static void*	pThis;
+
+	// Connection servers
+	vncSockConnect		*m_socketConn;
+	vncHTTPConnect		*m_httpConn;
+	HANDLE				m_xdmcpConn;
+	BOOL				m_enableHttpConn;
+	BOOL				m_enableXdmcpConn;
+
+	// The desktop handler
+	vncDesktop			*m_desktop;
+
+	// General preferences
+//	UINT				m_port;
+//	UINT				m_port_http; // TightVNC 1.2.7
+	BOOL				m_autoportselect;
+	char				m_password[MAXPWLEN];
+	char				m_password2[MAXPWLEN]; //PGM
+	BOOL				m_passwd_required;
+	BOOL				m_loopback_allowed;
+	BOOL				m_loopbackOnly;
+	char				*m_auth_hosts;
+	BOOL				m_enable_remote_inputs;
+	BOOL				m_disable_local_inputs;
+	BOOL				m_enable_jap_input;
+	int					m_lock_on_exit;
+	int					m_connect_pri;
+	UINT				m_querysetting;
+	UINT				m_queryaccept;
+	UINT				m_querytimeout;
+	BOOL				m_queryifnologon;
+ 	UINT				m_idle_timeout;
+
+	BOOL				m_remove_wallpaper;
+	// adzm - 2010-07 - Disable more effects or font smoothing
+	BOOL				m_remove_effects;
+	BOOL				m_remove_fontsmoothing;
+	BOOL				m_remove_Aero;
+	BOOL				m_disableTrayIcon;
+	BOOL				m_AllowEditClients;
+
+	// Polling preferences
+	BOOL				m_poll_fullscreen;
+	BOOL				m_poll_foreground;
+	BOOL				m_poll_undercursor;
+
+	BOOL				m_poll_oneventonly;
+	LONG				m_MaxCpu;
+	BOOL				m_poll_consoleonly;
+
+	BOOL				m_driver;
+	BOOL				m_hook;
+	BOOL				m_virtual;
+	BOOL				sethook;
+
+	// Name of this desktop
+	char				*m_name;
+
+	// Blacklist structures
+	struct BlacklistEntry {
+		BlacklistEntry *_next;
+		char *_machineName;
+		LARGE_INTEGER _lastRefTime;
+		UINT _failureCount;
+		BOOL _blocked;
+	};
+	BlacklistEntry		*m_blacklist;
+	
+	// The client lists - list of clients being authorised and ones
+	// already authorised
+	vncClientList		m_unauthClients;
+	vncClientList		m_authClients;
+	vncClient			*m_clientmap[MAX_CLIENTS];
+	vncClientId			m_nextid;
+
+	// Lock to protect the client list from concurrency - lock when reading/updating client list
+//	omni_mutex			m_clientsLock;
+	// Lock to protect the desktop object from concurrency - lock when updating client list
+	omni_mutex			m_desktopLock;
+
+	// Signal set when a client removes itself
+	omni_condition		*m_clientquitsig;
+
+	// Set of windows to send notifications to
+	vncNotifyList		m_notifyList;
+
+		// Modif sf at 2002 - Single Window
+	BOOL    m_SingleWindow;
+	char    m_szWindowName[32]; // to keep the window name
+
+	// Modif sf at 2002
+	BOOL    m_TurboMode;
+
+	// Modif sf at 2002 - v1.1.x
+	// BOOL    m_fQueuingEnabled;
+	BOOL    m_fFileTransferEnabled;
+	BOOL    m_fBlankMonitorEnabled;
+	BOOL    m_fBlankInputsOnly; //PGM
+	int     m_nDefaultScale;
+
+	BOOL m_PrimaryEnabled;
+	BOOL m_SecondaryEnabled;
+
+	BOOL    m_fMSLogonRequired;
+	BOOL    m_fNewMSLogon;
+
+	// sf at 2002 - DSMPlugin
+	BOOL m_fDSMPluginEnabled;
+	char m_szDSMPlugin[128];
+	CDSMPlugin *m_pDSMPlugin;
+	//adzm 2010-05-12 - dsmplugin config
+	char m_szDSMPluginConfig[512];
+
+	// sf at 2002 - Cursor handling
+	BOOL m_fXRichCursor; 
+
+	// sf at 2003 - AutoReconnect
+	BOOL m_fAutoReconnect;
+	BOOL m_fIdReconnect;
+	UINT m_AutoReconnectPort;
+	char m_szAutoReconnectAdr[255];
+	char m_szAutoReconnectId[MAX_PATH];
+
+	// sf at 2007
+	BOOL m_fRunningFromExternalService;
+	BOOL m_fAutoRestart;
+
+	// sf at 2005 - FTUserImpersonation
+	BOOL m_fFTUserImpersonation;
+
+	// sf at 2005
+	BOOL m_fCaptureAlphaBlending;
+	BOOL m_fBlackAlphaBlending;
+	//BOOL m_fGammaGray;	// [v1.0.2-jp1 fix]
+
+	HINSTANCE   hWtsLib;
+    bool m_fEnableStateUpdates;
+    bool m_fEnableKeepAlive;
+    int m_ftTimeout;
+    int m_keepAliveInterval;
+	// adzm 2010-08
+	int m_socketKeepAliveTimeout;
+	bool clearconsole;
+};
+
+#endif
diff --git a/ica/win32/winvnc/winvnc/vncservice.cpp b/ica/win32/winvnc/winvnc/vncservice.cpp
new file mode 100644
index 0000000..526f3a6
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncservice.cpp
@@ -0,0 +1,953 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncService
+
+// Implementation of service-oriented functionality of WinVNC
+
+#include "stdhdrs.h"
+
+// Header
+
+#include "vncservice.h"
+
+#include <cassert>
+#include <lmcons.h>
+#include "omnithread.h"
+#include "winvnc.h"
+#include "vncmenu.h"
+#include "vnctimedmsgbox.h"
+
+#include "Localization.h" // Act : add localization on messages
+
+
+// OS-SPECIFIC ROUTINES
+
+// Create an instance of the vncService class to cause the static fields to be
+// initialised properly
+
+vncService init;
+bool G_1111=false;
+DWORD	g_platform_id;
+BOOL	g_impersonating_user = 0;
+DWORD	g_version_major;
+DWORD	g_version_minor;
+BOOL	m_fRunningFromExternalService = true;
+
+typedef DWORD (WINAPI* pWTSGetActiveConsoleSessionId)(VOID);
+typedef BOOL (WINAPI * pProcessIdToSessionId)(DWORD,DWORD*);
+#include <tlhelp32.h>
+
+pProcessIdToSessionId WTSProcessIdToSessionIdF=NULL;
+
+#ifndef SM_REMOTESESSION
+#define SM_REMOTESESSION 0X1000
+#endif
+
+extern BOOL SPECIAL_SC_EXIT;
+extern BOOL SPECIAL_SC_PROMPT;
+
+void ClearKeyState(BYTE key);
+DWORD GetCurrentSessionID()
+{
+	DWORD dwSessionId;
+	pWTSGetActiveConsoleSessionId WTSGetActiveConsoleSessionIdF=NULL;
+	WTSProcessIdToSessionIdF=NULL;
+
+	HMODULE  hlibkernel = LoadLibrary("kernel32.dll");
+	if (hlibkernel)
+	{
+	WTSGetActiveConsoleSessionIdF=(pWTSGetActiveConsoleSessionId)GetProcAddress(hlibkernel, "WTSGetActiveConsoleSessionId");
+	WTSProcessIdToSessionIdF=(pProcessIdToSessionId)GetProcAddress(hlibkernel, "ProcessIdToSessionId");
+	}
+	if (WTSGetActiveConsoleSessionIdF!=NULL)
+	   dwSessionId =WTSGetActiveConsoleSessionIdF();
+	else dwSessionId=0;
+
+	if( GetSystemMetrics( SM_REMOTESESSION))
+		if (WTSProcessIdToSessionIdF!=NULL)
+		{
+			DWORD dw		 = GetCurrentProcessId();
+			DWORD pSessionId = 0xFFFFFFFF;
+			WTSProcessIdToSessionIdF( dw, &pSessionId );
+			dwSessionId=pSessionId;
+		}
+	if (hlibkernel) FreeLibrary(hlibkernel);
+	return dwSessionId;
+}
+
+DWORD GetExplorerLogonPid()
+{
+	DWORD dwSessionId;
+	DWORD dwExplorerLogonPid=0;
+	PROCESSENTRY32 procEntry;
+//	HANDLE hProcess,hPToken;
+
+	pWTSGetActiveConsoleSessionId WTSGetActiveConsoleSessionIdF=NULL;
+	WTSProcessIdToSessionIdF=NULL;
+
+	HMODULE  hlibkernel = LoadLibrary("kernel32.dll"); 
+	if (hlibkernel)
+	{
+	WTSGetActiveConsoleSessionIdF=(pWTSGetActiveConsoleSessionId)GetProcAddress(hlibkernel, "WTSGetActiveConsoleSessionId");
+	WTSProcessIdToSessionIdF=(pProcessIdToSessionId)GetProcAddress(hlibkernel, "ProcessIdToSessionId");
+	}
+	if (WTSGetActiveConsoleSessionIdF!=NULL)
+	   dwSessionId =WTSGetActiveConsoleSessionIdF();
+	else dwSessionId=0;
+
+	if( GetSystemMetrics( SM_REMOTESESSION))
+		if (WTSProcessIdToSessionIdF!=NULL)
+		{
+			DWORD dw		 = GetCurrentProcessId();
+			DWORD pSessionId = 0xFFFFFFFF;
+			WTSProcessIdToSessionIdF( dw, &pSessionId );
+			dwSessionId=pSessionId;
+		}
+
+	
+
+    HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+    if (hSnap == INVALID_HANDLE_VALUE)
+    {
+		if (hlibkernel) FreeLibrary(hlibkernel);
+        return 0 ;
+    }
+
+    procEntry.dwSize = sizeof(PROCESSENTRY32);
+
+    if (!Process32First(hSnap, &procEntry))
+    {
+		CloseHandle(hSnap);
+		if (hlibkernel) FreeLibrary(hlibkernel);
+        return 0 ;
+    }
+
+    do
+    {
+        if (_stricmp(procEntry.szExeFile, "explorer.exe") == 0)
+        {
+          DWORD dwExplorerSessId = 0;
+		  if (WTSProcessIdToSessionIdF!=NULL)
+		  {
+			  if (WTSProcessIdToSessionIdF(procEntry.th32ProcessID, &dwExplorerSessId) 
+						&& dwExplorerSessId == dwSessionId)
+				{
+					dwExplorerLogonPid = procEntry.th32ProcessID;
+					break;
+				}
+		  }
+		  else dwExplorerLogonPid = procEntry.th32ProcessID;
+        }
+
+    } while (Process32Next(hSnap, &procEntry));
+	CloseHandle(hSnap);
+	if (hlibkernel) FreeLibrary(hlibkernel);
+	return dwExplorerLogonPid;
+}
+
+char aa[16384];
+#include <tlhelp32.h>
+bool
+GetConsoleUser(char *buffer, UINT size)
+{
+
+	HANDLE hProcess,hPToken;
+	DWORD dwExplorerLogonPid=GetExplorerLogonPid();
+	if (dwExplorerLogonPid==0) 
+	{
+		strcpy(buffer,"");
+		return 0;
+	}
+	hProcess = OpenProcess(MAXIMUM_ALLOWED,FALSE,dwExplorerLogonPid);
+
+   if(!::OpenProcessToken(hProcess,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY
+                                    |TOKEN_DUPLICATE|TOKEN_ASSIGN_PRIMARY|TOKEN_ADJUST_SESSIONID
+                                    |TOKEN_READ|TOKEN_WRITE,&hPToken))
+		{     
+			   strcpy(buffer,"");
+			   CloseHandle(hProcess);
+			   return 0 ;
+		}
+
+
+   // token user
+    TOKEN_USER *ptu;
+	DWORD needed;
+	ptu = (TOKEN_USER *) aa;//malloc( 16384 );
+	if (GetTokenInformation( hPToken, TokenUser, ptu, 16384, &needed ) )
+	{
+		char  DomainName[64];
+		memset(DomainName, 0, sizeof(DomainName));
+		DWORD DomainSize;
+		DomainSize =sizeof(DomainName)-1;
+		SID_NAME_USE SidType;
+		DWORD dwsize=size;
+		LookupAccountSid(NULL, ptu->User.Sid, buffer, &dwsize, DomainName, &DomainSize, &SidType);
+		//free(ptu);
+		CloseHandle(hPToken);
+		CloseHandle(hProcess);
+		return 1;
+	}
+	//free(ptu);
+	strcpy(buffer,"");
+	CloseHandle(hPToken);
+	CloseHandle(hProcess);
+	return 0;
+}
+
+
+
+vncService::vncService()
+{
+    OSVERSIONINFO osversioninfo;
+    osversioninfo.dwOSVersionInfoSize = sizeof(osversioninfo);
+
+    // Get the current OS version
+    if (!GetVersionEx(&osversioninfo))
+	    g_platform_id = 0;
+    g_platform_id = osversioninfo.dwPlatformId;
+	g_version_major = osversioninfo.dwMajorVersion;
+	g_version_minor = osversioninfo.dwMinorVersion;
+}
+
+// CurrentUser - fills a buffer with the name of the current user!
+BOOL
+GetCurrentUser(char *buffer, UINT size) // RealVNC 336 change
+{	
+	if (vncService::RunningFromExternalService())
+	{
+//		vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Forcing g_impersonating_user \n"));
+		g_impersonating_user = TRUE;
+	}
+
+	// How to obtain the name of the current user depends upon the OS being used
+	if ((g_platform_id == VER_PLATFORM_WIN32_NT) && vncService::RunningAsService())
+	{
+		// Windows NT, service-mode
+
+		// -=- FIRSTLY - verify that a user is logged on
+
+		// Get the current Window station
+		HWINSTA station = GetProcessWindowStation();
+		if (station == NULL)
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - ERROR : No window station \n"));
+			return FALSE;
+		}
+
+		// Get the current user SID size
+		DWORD usersize;
+		GetUserObjectInformation(station, UOI_USER_SID, NULL, 0, &usersize);
+		SetLastError(0);
+
+		// Check the required buffer size isn't zero
+		if (usersize == 0)
+		{
+			// No user is logged in - ensure we're not impersonating anyone
+			RevertToSelf();
+			g_impersonating_user = FALSE;
+
+			// Return "" as the name...
+			if (strlen("") >= size)
+			{
+				vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: Bad buffer size \n"));
+				return FALSE;
+			}
+			strcpy(buffer, "");
+
+			vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: Usersize 0\n"));
+			return TRUE;
+		}
+
+		// -=- SECONDLY - a user is logged on but if we're not impersonating
+		//     them then we can't continue!
+		if (!g_impersonating_user)
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: NOT impersonating user \n"));
+			// Return "" as the name...
+			if (strlen("") >= size)
+				return FALSE;
+			strcpy(buffer, "");
+			return TRUE;
+		}
+	}
+		
+	// -=- When we reach here, we're either running under Win9x, or we're running
+	//     under NT as an application or as a service impersonating a user
+	// Either way, we should find a suitable user name.
+
+	switch (g_platform_id)
+	{
+
+	case VER_PLATFORM_WIN32_WINDOWS:
+	case VER_PLATFORM_WIN32_NT:
+		{
+			// Just call GetCurrentUser
+			DWORD length = size;
+
+//			vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - GetUserName call \n"));
+			if ( GetConsoleUser(buffer, size) == 0)
+			{
+				if (GetUserName(buffer, &length) == 0)
+				{
+					UINT error = GetLastError();
+
+					if (error == ERROR_NOT_LOGGED_ON)
+					{
+						vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: No user logged on \n"));
+						// No user logged on
+						if (strlen("") >= size)
+							return FALSE;
+						strcpy(buffer, "");
+						return TRUE;
+					}
+					else
+					{
+						// Genuine error...
+						vnclog.Print(LL_INTERR, VNCLOG("getusername error %d\n"), GetLastError());
+						return FALSE;
+					}
+				}
+			}
+		}
+		vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - UserNAme found: %s \n"), buffer);
+		return TRUE;
+	};
+
+	// OS was not recognised!
+	vnclog.Print(LL_INTERR, VNCLOG("@@@@@@@@@@@@@ GetCurrentUser - Error: Unknown OS \n"));
+	return FALSE;
+}
+
+// RealVNC 336 change
+BOOL
+vncService::CurrentUser(char *buffer, UINT size)
+{
+  BOOL result = GetCurrentUser(buffer, size);
+  if (result && (strcmp(buffer, "") == 0) && !vncService::RunningAsService()) {
+    strncpy(buffer, "Default", size);
+  }
+  return result;
+}
+
+
+BOOL vncService::IsWSLocked()
+{
+	if (!IsWinNT()) 
+		return false;
+
+	bool bLocked = false;
+
+
+	HDESK hDesk;
+	BOOL bRes;
+	DWORD dwLen;
+	char sName[200];
+	
+	hDesk = OpenInputDesktop(0, FALSE, 0);
+
+	if (hDesk == NULL)
+	{
+		 bLocked = true;
+	}
+	else 
+	{
+		bRes = GetUserObjectInformation(hDesk, UOI_NAME, sName, sizeof(sName), &dwLen);
+
+		if (bRes)
+			sName[dwLen]='\0';
+		else
+			sName[0]='\0';
+
+
+		if (_stricmp(sName,"Default") != 0)
+			 bLocked = true; // WS is locked or screen saver active
+		else
+			 bLocked = false ;
+	}
+	if (hDesk != NULL)
+		CloseDesktop(hDesk);
+
+	return bLocked;
+}
+
+
+// IsWin95 - returns a BOOL indicating whether the current OS is Win95
+BOOL
+vncService::IsWin95()
+{
+	return (g_platform_id == VER_PLATFORM_WIN32_WINDOWS);
+}
+
+// IsWinNT - returns a bool indicating whether the current OS is WinNT
+BOOL
+vncService::IsWinNT()
+{
+	return (g_platform_id == VER_PLATFORM_WIN32_NT);
+}
+
+// Version info
+DWORD
+vncService::VersionMajor()
+{
+	return g_version_major;
+}
+
+DWORD
+vncService::VersionMinor()
+{
+	return g_version_minor;
+}
+
+//adzm 2010-02-10 - Finds the appropriate VNC window
+HWND
+FindWinVNCWindow(bool bThisProcess)
+{
+	// Locate the hidden WinVNC menu window
+
+	if (!bThisProcess) {
+		// Find any window with the MENU_CLASS_NAME window class
+		return FindWindow(MENU_CLASS_NAME, NULL);
+	} else {
+		// Find one that matches the class and is the same process		
+		HWND hwndZ = NULL;
+		HWND hwndServer = NULL;
+		while (!hwndServer) {
+			hwndServer = FindWindowEx(NULL, hwndZ, MENU_CLASS_NAME, NULL);
+
+			if (hwndServer != NULL) {
+				DWORD dwProcessId = 0;
+				//DWORD dwThreadId = GetWindowThreadProcessId(hwndServer, &dwProcessId);
+
+				if (dwProcessId == GetCurrentProcessId()) {
+					return hwndServer;
+				} else {
+					hwndZ = hwndServer;
+					hwndServer = NULL;
+				}
+			} else {
+				return NULL;
+			}
+		}
+	}
+
+	return NULL;
+}
+
+// Internal routine to find the WinVNC menu class window and
+// post a message to it!
+
+BOOL
+PostToWinVNC(UINT message, WPARAM wParam, LPARAM lParam)
+{
+	// Locate the hidden WinVNC menu window
+	// adzm 2010-02-10 - If we are in SC mode, then we know we want to only post messages to our own instance. This prevents
+	// conflicts if the user already has another copy of a WinVNC-derived application running.
+	if (SPECIAL_SC_EXIT || SPECIAL_SC_PROMPT) {
+		return PostToThisWinVNC(message, wParam, lParam);
+	}
+
+	//adzm 2010-02-10 - Finds the appropriate VNC window
+	HWND hservwnd = FindWinVNCWindow(false);
+	if (hservwnd == NULL)
+		return FALSE;
+
+	// Post the message to WinVNC
+	PostMessage(hservwnd, message, wParam, lParam);
+	return TRUE;
+}
+
+//adzm 2010-02-10 - Only posts to the same process
+BOOL 
+PostToThisWinVNC(UINT message, WPARAM wParam, LPARAM lParam)
+{
+	//adzm 2010-02-10 - Finds the appropriate VNC window for this process
+	HWND hservwnd = FindWinVNCWindow(true);
+	if (hservwnd == NULL)
+		return FALSE;
+
+	// Post the message to WinVNC
+	PostMessage(hservwnd, message, wParam, lParam);
+	return TRUE;
+}
+
+
+// Static routines only used on Windows NT to ensure we're in the right desktop
+// These routines are generally available to any thread at any time.
+
+// - SelectDesktop(HDESK)
+// Switches the current thread into a different desktop by deskto handle
+// This call takes care of all the evil memory management involved
+
+BOOL
+vncService::SelectHDESK(HDESK new_desktop)
+{
+	// Are we running on NT?
+	if (IsWinNT())
+	{
+		HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
+
+		DWORD dummy;
+		char new_name[256];
+
+		if (!GetUserObjectInformation(new_desktop, UOI_NAME, &new_name, 256, &dummy)) {
+			vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation \n"));
+			return FALSE;
+		}
+
+		vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x\n"), new_name, new_desktop, old_desktop);
+
+		// Switch the desktop
+		if(!SetThreadDesktop(new_desktop)) {
+			vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop \n"));
+			return FALSE;
+		}
+
+		return TRUE;
+	}
+
+	return TRUE;
+}
+
+// - SelectDesktop(char *)
+// Switches the current thread into a different desktop, by name
+// Calling with a valid desktop name will place the thread in that desktop.
+// Calling with a NULL name will place the thread in the current input desktop.
+BOOL
+vncService::SelectDesktop(char *name, HDESK *new_desktop)
+{
+	//return false;
+	// Are we running on NT?
+	if (IsWinNT())
+	{
+		HDESK desktop;
+		vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop \n"));
+		if (name != NULL)
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 named\n"));
+			// Attempt to open the named desktop
+			desktop = OpenDesktop(name, 0, FALSE,
+				DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
+				DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
+				DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
+				DESKTOP_SWITCHDESKTOP | GENERIC_WRITE);
+		}
+		else
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL\n"));
+			// No, so open the input desktop
+			desktop = OpenInputDesktop(0, FALSE,
+				DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
+				DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
+				DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
+				DESKTOP_SWITCHDESKTOP | GENERIC_WRITE);
+		}
+
+		// Did we succeed?
+		if (desktop == NULL) {
+				vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 \n"));
+				return FALSE;
+		}
+		else vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 OK\n"));
+
+		// Switch to the new desktop
+		if (!SelectHDESK(desktop)) {
+			// Failed to enter the new desktop, so free it!
+			if (!CloseDesktop(desktop))
+				vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop failed to close desktop\n"));
+			return FALSE;
+		}
+
+
+		if (new_desktop)
+		{
+			if (*new_desktop)
+				CloseDesktop(*new_desktop);
+			*new_desktop = desktop;
+		}
+
+		// We successfully switched desktops!
+		return TRUE;
+	}
+
+	return (name == NULL);
+}
+
+
+
+// Find the visible window station and switch to it
+// This would allow the service to be started non-interactive
+// Needs more supporting code & a redesign of the server core to
+// work, with better partitioning between server & UI components.
+
+static HWINSTA home_window_station = GetProcessWindowStation();
+
+BOOL CALLBACK WinStationEnumProc(LPTSTR name, LPARAM param) {
+	HWINSTA station = OpenWindowStation(name, FALSE, GENERIC_ALL);
+	HWINSTA oldstation = GetProcessWindowStation();
+	USEROBJECTFLAGS flags;
+	if (!GetUserObjectInformation(station, UOI_FLAGS, &flags, sizeof(flags), NULL)) {
+		return TRUE;
+	}
+	BOOL visible = flags.dwFlags & WSF_VISIBLE;
+	if (visible) {
+		if (SetProcessWindowStation(station)) {
+			if (oldstation != home_window_station) {
+				CloseWindowStation(oldstation);
+			}
+		} else {
+			CloseWindowStation(station);
+		}
+		return FALSE;
+	}
+	return TRUE;
+}
+
+// NT only function to establish whether we're on the current input desktop
+
+int
+vncService::InputDesktopSelected()
+{
+//	vnclog.Print(LL_INTERR, VNCLOG("InputDesktopSelected()\n"));
+	// Are we running on NT?
+	if (IsWinNT())
+	{
+		// Get the input and thread desktops
+		HDESK threaddesktop = GetThreadDesktop(GetCurrentThreadId());
+		HDESK inputdesktop = OpenInputDesktop(0, FALSE,
+				DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
+				DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
+				DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
+				DESKTOP_SWITCHDESKTOP);
+
+
+		// Get the desktop names:
+		// *** I think this is horribly inefficient but I'm not sure.
+		if (inputdesktop == NULL)
+		{
+			//Running as SC we want to keep the viewer open in case UAC or screensaver jump in
+			if (!m_fRunningFromExternalService)return 2;
+			DWORD lasterror;
+			lasterror=GetLastError();
+			vnclog.Print(LL_INTERR, VNCLOG("OpenInputDesktop %i I\n"),lasterror);
+			if (lasterror==170) return TRUE;
+			if (lasterror==624) return TRUE;
+			vnclog.Print(LL_INTERR, VNCLOG("OpenInputDesktop II\n"));
+			return 0;
+		}
+
+		DWORD dummy;
+		char threadname[256];
+		char inputname[256];
+
+		if (!GetUserObjectInformation(threaddesktop, UOI_NAME, &threadname, 256, &dummy)) {
+			if (!CloseDesktop(inputdesktop))
+				vnclog.Print(LL_INTERR, VNCLOG("failed to close input desktop\n"));
+			vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation(threaddesktop\n"));
+			//Running as SC we want to keep the viewer open in case UAC or screensaver jump in
+			if (!m_fRunningFromExternalService)return 2;
+			return 0;
+		}
+		assert(dummy <= 256);
+		if (!GetUserObjectInformation(inputdesktop, UOI_NAME, &inputname, 256, &dummy)) {
+			if (!CloseDesktop(inputdesktop))
+				vnclog.Print(LL_INTERR, VNCLOG("failed to close input desktop\n"));
+			vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation(inputdesktop\n"));
+			//Running as SC we want to keep the viewer open in case UAC or screensaver jump in
+			if (!m_fRunningFromExternalService)return 2;
+			return 0;
+		}
+		assert(dummy <= 256);
+
+		if (!CloseDesktop(inputdesktop))
+			vnclog.Print(LL_INTERR, VNCLOG("failed to close input desktop\n"));
+
+		if (strcmp(threadname, inputname) != 0)
+		{
+			vnclog.Print(LL_INTERR, VNCLOG("threadname, inputname differ\n"));
+			//Running as SC we want to keep the viewer open in case UAC or screensaver jump in
+			if (!m_fRunningFromExternalService)return 2;
+		   return 0;
+		}	
+	}
+
+	return 1;
+}
+
+
+// Static routine used to fool Winlogon into thinking CtrlAltDel was pressed
+
+void *
+SimulateCtrlAltDelThreadFn(void *context)
+{
+	HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
+	HDESK winlogon_desk = 0;
+	// Switch into the Winlogon desktop
+	if (!vncService::SelectDesktop("Winlogon", &winlogon_desk))
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("failed to select logon desktop\n"));
+		vncTimedMsgBox::Do(
+									sz_ID_CADERROR,
+									sz_ID_ULTRAVNC_WARNING,
+									MB_ICONINFORMATION | MB_OK
+									);
+		return FALSE;
+	}
+
+    // 9 April 2008 jdp
+    // turn off capslock if on
+    ClearKeyState(VK_CAPITAL);
+	vnclog.Print(LL_ALL, VNCLOG("generating ctrl-alt-del\n"));
+
+	// Fake a hotkey event to any windows we find there.... :(
+	// Winlogon uses hotkeys to trap Ctrl-Alt-Del...
+	PostMessage(HWND_BROADCAST, WM_HOTKEY, 0, MAKELONG(MOD_ALT | MOD_CONTROL, VK_DELETE));
+
+	// Switch back to our original desktop
+	if (old_desktop != NULL)
+	{
+			vncService::SelectHDESK(old_desktop);
+		CloseDesktop(winlogon_desk);
+	}
+	return NULL;
+}
+
+// Static routine to simulate Ctrl-Alt-Del locally
+
+BOOL
+vncService::SimulateCtrlAltDel()
+{
+	vnclog.Print(LL_ALL, VNCLOG("preparing to generate ctrl-alt-del\n"));
+
+	// Are we running on NT?
+	if (IsWinNT())
+	{
+		vnclog.Print(LL_ALL, VNCLOG("spawn ctrl-alt-del thread...\n"));
+
+		// *** This is an unpleasant hack.  Oh dear.
+
+		// I simulate CtrAltDel by posting a WM_HOTKEY message to all
+		// the windows on the Winlogon desktop.
+		// This requires that the current thread is part of the Winlogon desktop.
+		// But the current thread has hooks set & a window open, so it can't
+		// switch desktops, so I instead spawn a new thread & let that do the work...
+
+		omni_thread *thread = omni_thread::create(SimulateCtrlAltDelThreadFn);
+		if (thread == NULL)
+			return FALSE;
+		thread->join(NULL);
+
+		return TRUE;
+	}
+
+	return TRUE;
+}
+
+// Static routine to lock a 2K or above workstation
+
+BOOL
+vncService::LockWorkstation()
+{
+	if (!IsWinNT()) {
+		vnclog.Print(LL_INTERR, VNCLOG("unable to lock workstation - not NT\n"));
+		return FALSE;
+	}
+
+	vnclog.Print(LL_ALL, VNCLOG("locking workstation\n"));
+
+	// Load the user32 library
+	HMODULE user32 = LoadLibrary("user32.dll");
+	if (!user32) {
+		vnclog.Print(LL_INTERR, VNCLOG("unable to load User32 DLL (%u)\n"), GetLastError());
+		return FALSE;
+	}
+
+	// Get the LockWorkstation function
+	typedef BOOL (*LWProc) ();
+	LWProc lockworkstation = (LWProc)GetProcAddress(user32, "LockWorkStation");
+	if (!lockworkstation) {
+		vnclog.Print(LL_INTERR, VNCLOG("unable to locate LockWorkStation - requires Windows 2000 or above (%u)\n"), GetLastError());
+		FreeLibrary(user32);
+		return FALSE;
+	}
+	
+	// Attempt to lock the workstation
+	BOOL result = (lockworkstation)();
+
+	if (!result) {
+		vnclog.Print(LL_INTERR, VNCLOG("call to LockWorkstation failed\n"));
+		FreeLibrary(user32);
+		return FALSE;
+	}
+
+	FreeLibrary(user32);
+	return result;
+}
+
+// Static routine to tell a locally-running instance of the server
+// to connect out to a new client
+
+BOOL
+vncService::PostAddNewClient(unsigned long ipaddress, unsigned short port)
+{
+	// Post to the WinVNC menu window
+	if (!PostToWinVNC(MENU_ADD_CLIENT_MSG, (WPARAM)port, (LPARAM)ipaddress))
+	{
+
+		//MessageBoxSecure(NULL, sz_ID_NO_EXIST_INST, szAppName, MB_ICONEXCLAMATION | MB_OK);
+
+		//Little hack, seems postmessage fail in some cases on some os.
+		//permission proble
+		//use G_var + WM_time to reconnect
+		vnclog.Print(LL_INTERR, VNCLOG("PostAddNewClient failed\n"));
+		if (port==1111 && ipaddress==1111) G_1111=true;
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+BOOL
+vncService::PostAddNewClientInit(unsigned long ipaddress, unsigned short port)
+{
+	// Post to the WinVNC menu window
+	if (!PostToWinVNC(MENU_ADD_CLIENT_MSG_INIT, (WPARAM)port, (LPARAM)ipaddress))
+	{
+
+		//MessageBoxSecure(NULL, sz_ID_NO_EXIST_INST, szAppName, MB_ICONEXCLAMATION | MB_OK);
+
+		//Little hack, seems postmessage fail in some cases on some os.
+		//permission proble
+		//use G_var + WM_time to reconnect
+		vnclog.Print(LL_INTERR, VNCLOG("PostAddNewClient failed\n"));
+		if (port==1111 && ipaddress==1111) G_1111=true;
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+//adzm 2009-06-20
+// Static routine to tell a locally-running instance of the server
+// to prompt for a new ID to connect out to the repeater
+
+BOOL
+vncService::PostAddNewRepeaterClient()
+{
+	// assumes the -repeater command line set the repeater global variable.
+
+	// Post to the WinVNC menu window (usually expected to fail at program startup)
+	if (!PostToWinVNC(MENU_ADD_CLIENT_MSG, (WPARAM)0xFFFFFFFF, (LPARAM)0xFFFFFFFF))
+	{
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+// Static routine to tell a locally-running instance of the server
+// about a reconnect
+
+BOOL
+vncService::PostAddAutoConnectClient( const char* pszId )
+{
+	ATOM aId = INVALID_ATOM;
+	if ( pszId )
+	{
+		aId = GlobalAddAtom( pszId );
+//		delete pszId;
+	}
+	return ( PostToWinVNC(MENU_AUTO_RECONNECT_MSG, 0, (LPARAM)aId) );
+}
+
+BOOL
+vncService::PostAddStopConnectClient()
+{
+	return ( PostToWinVNC(MENU_STOP_RECONNECT_MSG, 0, 0) );
+}
+
+BOOL
+vncService::PostAddStopConnectClientAll()
+{
+	PostToWinVNC(MENU_STOP_RECONNECT_MSG, 0, 0); // stop running reconnect in server class
+	return ( PostToWinVNC(MENU_STOP_ALL_RECONNECT_MSG, 0, 0) ); //disable reconnect for tunning clients
+}
+
+BOOL
+vncService::PostAddConnectClient( const char* pszId )
+{
+	ATOM aId = INVALID_ATOM;
+	if ( pszId )
+	{
+		aId = GlobalAddAtom( pszId );
+//		delete pszId;
+	}
+	return ( PostToWinVNC(MENU_REPEATER_ID_MSG, 0, (LPARAM)aId) );
+}
+
+BOOL
+vncService::RunningAsService()
+{
+	if (m_fRunningFromExternalService) return true;
+	else return false;
+}
+
+BOOL 
+vncService::RunningFromExternalService()
+{
+	return m_fRunningFromExternalService;
+}
+
+
+void 
+vncService::RunningFromExternalService(BOOL fEnabled)
+{
+	m_fRunningFromExternalService = true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+extern char service_name[];
+bool
+vncService::IsInstalled()
+{
+    BOOL bResult = FALSE;
+    SC_HANDLE hSCM = ::OpenSCManager(NULL, // local machine
+                                     NULL, // ServicesActive database
+                                     SC_MANAGER_ENUMERATE_SERVICE); // full access
+    if (hSCM) {
+        SC_HANDLE hService = ::OpenService(hSCM,
+                                           service_name,
+                                           SERVICE_QUERY_CONFIG);
+        if (hService) {
+            bResult = TRUE;
+            ::CloseServiceHandle(hService);
+        }
+        ::CloseServiceHandle(hSCM);
+    }
+    return (FALSE != bResult);
+}
+
+
diff --git a/ica/win32/winvnc/winvnc/vncservice.h b/ica/win32/winvnc/winvnc/vncservice.h
new file mode 100644
index 0000000..f41ccf2
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncservice.h
@@ -0,0 +1,122 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncService
+
+// SERVICE-MODE CODE
+
+// This class provides access to service-oriented routines, under both
+// Windows NT and Windows 95.  Some routines only operate under one
+// OS, others operate under any OS.
+
+class vncService;
+
+#if (!defined(_WINVNC_VNCSERVICE))
+#define _WINVNC_VNCSERVICE
+
+#include "stdhdrs.h"
+
+BOOL PostToWinVNC(UINT message, WPARAM wParam, LPARAM lParam);
+
+//adzm 2010-02-10 - Only posts to the same process
+BOOL PostToThisWinVNC(UINT message, WPARAM wParam, LPARAM lParam);
+
+//adzm 2010-02-10 - Finds the appropriate VNC window
+HWND FindWinVNCWindow(bool bThisProcess);
+
+
+// The NT-specific code wrapper class
+class vncService
+{
+
+public:
+	vncService();
+	// Routine to establish and return the currently logged in user name
+	static BOOL CurrentUser(char *buffer, UINT size);
+	static BOOL IsWSLocked(); // sf at 2005
+
+	// Routines to establish which OS we're running on
+	static BOOL IsWin95();
+	static BOOL IsWinNT();
+	static DWORD VersionMajor();
+	static DWORD VersionMinor();
+
+	// Routine to establish whether the current instance is running
+	// as a service or not
+	static BOOL RunningAsService();
+
+	// Routine to kill any other running copy of WinVNC
+	static BOOL KillRunningCopy();
+
+	// Routine to set the current thread into the given desktop
+	static BOOL SelectHDESK(HDESK newdesktop);
+
+	// Routine to set the current thread into the named desktop,
+	// or the input desktop if no name is given
+	static BOOL SelectDesktop(char *name, HDESK *desktop);
+
+	// Routine to switch the service process across to the currently
+	// visible Window Station and back to its home window station again
+
+	// Routine to establish whether the current thread desktop is the
+	// current user input one
+	static int InputDesktopSelected();
+
+	// Routine to fake a CtrlAltDel to winlogon when required.
+	// *** This is a nasty little hack...
+	static BOOL SimulateCtrlAltDel();
+
+	// Routine to lock the workstation.  Returns TRUE if successful.
+	// Main cause of failure will be when locking is not supported
+	static BOOL LockWorkstation();
+
+	// Routine to make the an already running copy of WinVNC bring up its
+	// About box so you can check the version!
+	static BOOL ShowAboutBox();
+
+	// Routine to make an already running copy of WinVNC form an outgoing
+	// connection to a new VNC client
+	static BOOL PostAddNewClient(unsigned long ipaddress, unsigned short port);
+	static BOOL PostAddNewClientInit(unsigned long ipaddress, unsigned short port);
+
+	//adzm 2009-06-20
+	// Static routine to tell a locally-running instance of the server
+	// to prompt for a new ID to connect out to the repeater
+	static BOOL PostAddNewRepeaterClient();
+	
+	// Routine to make an already running copy of WinVNC deal with Auto Reconnect
+	// along with an ID
+	static BOOL PostAddAutoConnectClient( const char* pszId );
+	static BOOL PostAddConnectClient( const char* pszId );
+	static BOOL PostAddStopConnectClient();
+	static BOOL PostAddStopConnectClientAll();
+
+	static BOOL RunningFromExternalService();
+	static void RunningFromExternalService(BOOL fEnabled);
+	static bool IsInstalled();
+
+};
+
+#endif
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vncsetauth.cpp b/ica/win32/winvnc/winvnc/vncsetauth.cpp
new file mode 100644
index 0000000..aa81d5d
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncsetauth.cpp
@@ -0,0 +1,685 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncSetAuth.cpp
+
+// Implementation of the About dialog!
+
+#include "stdhdrs.h"
+
+#include "winvnc.h"
+#include "vncsetauth.h"
+#include "vncservice.h"
+#include "common/win32_helpers.h"
+
+#define MAXSTRING 254
+
+const TCHAR REGISTRY_KEY [] = "Software\\UltraVnc";
+
+// [v1.0.2-jp1 fix] Load resouce from dll
+extern HINSTANCE	hInstResDLL;
+
+void
+vncSetAuth::OpenRegistry()
+{
+	if (m_fUseRegistry)
+	{
+		DWORD dw;
+		if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
+			REGISTRY_KEY,
+			0,REG_NONE, REG_OPTION_NON_VOLATILE,
+			KEY_READ,
+			NULL, &hkLocal, &dw) != ERROR_SUCCESS)
+			return;
+		if (RegCreateKeyEx(hkLocal,
+			"mslogon",
+			0, REG_NONE, REG_OPTION_NON_VOLATILE,
+			KEY_WRITE | KEY_READ,
+			NULL, &hkDefault, &dw) != ERROR_SUCCESS)
+			return;
+	}
+}
+
+void
+vncSetAuth::CloseRegistry()
+{
+	if (m_fUseRegistry)
+	{
+		if (hkDefault != NULL) RegCloseKey(hkDefault);
+		if (hkUser != NULL) RegCloseKey(hkUser);
+		if (hkLocal != NULL) RegCloseKey(hkLocal);
+	}
+}
+
+LONG
+vncSetAuth::LoadInt(HKEY key, LPCSTR valname, LONG defval)
+{
+	if (m_fUseRegistry)
+	{
+		LONG pref;
+		ULONG type = REG_DWORD;
+		ULONG prefsize = sizeof(pref);
+
+		if (RegQueryValueEx(key,
+			valname,
+			NULL,
+			&type,
+			(LPBYTE) &pref,
+			&prefsize) != ERROR_SUCCESS)
+			return defval;
+
+		if (type != REG_DWORD)
+			return defval;
+
+		if (prefsize != sizeof(pref))
+			return defval;
+
+		return pref;
+	}
+	else
+	{
+		return myIniFile.ReadInt("admin_auth", (char *)valname, defval);
+	}
+}
+
+TCHAR *
+vncSetAuth::LoadString(HKEY key, LPCSTR keyname)
+{
+	if (m_fUseRegistry)
+	{
+		DWORD type = REG_SZ;
+		DWORD buflen = 256*sizeof(TCHAR);
+		TCHAR *buffer = 0;
+
+		// Get the length of the string
+		if (RegQueryValueEx(key,
+			keyname,
+			NULL,
+			&type,
+			NULL,
+			&buflen) != ERROR_SUCCESS)
+			return 0;
+
+		if (type != REG_BINARY)
+			return 0;
+		buflen = 256*sizeof(TCHAR);
+		buffer = new TCHAR[buflen];
+		if (buffer == 0)
+			return 0;
+
+		// Get the string data
+		if (RegQueryValueEx(key,
+			keyname,
+			NULL,
+			&type,
+			(BYTE*)buffer,
+			&buflen) != ERROR_SUCCESS) {
+			delete [] buffer;
+			return 0;
+		}
+
+		// Verify the type
+		if (type != REG_BINARY) {
+			delete [] buffer;
+			return 0;
+		}
+
+		return (TCHAR *)buffer;
+	}
+	else
+	{
+		TCHAR *authhosts=new char[150];
+		myIniFile.ReadString("admin_auth", (char *)keyname,authhosts,150);
+		return (TCHAR *)authhosts;
+	}
+}
+
+void
+vncSetAuth::SaveInt(HKEY key, LPCSTR valname, LONG val)
+{
+	if (m_fUseRegistry)
+	{
+		RegSetValueEx(key, valname, 0, REG_DWORD, (LPBYTE) &val, sizeof(val));
+	}
+	else
+	{
+		myIniFile.WriteInt("admin_auth", (char *)valname, val);
+	}
+}
+
+void
+vncSetAuth::SaveString(HKEY key,LPCSTR valname, TCHAR *buffer)
+{
+	if (m_fUseRegistry)
+	{
+		RegSetValueEx(key, valname, 0, REG_BINARY, (LPBYTE) buffer, MAXSTRING);
+	}
+	else
+	{
+		myIniFile.WriteString("admin_auth", (char *)valname,buffer);
+	}
+}
+
+void
+vncSetAuth::savegroup1(TCHAR *value)
+{
+	if (m_fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveString(hkDefault, "group1", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveString(hkDefault, "group1", value);
+	}
+}
+TCHAR*
+vncSetAuth::Readgroup1()
+{
+	if (m_fUseRegistry)
+	{
+		TCHAR *value=NULL;
+		OpenRegistry();
+		if (hkDefault) value=LoadString (hkDefault, "group1");
+		CloseRegistry();
+		return value;
+	}
+	else
+	{
+		TCHAR *value=NULL;
+		value=LoadString (hkDefault, "group1");
+		return value;
+	}
+}
+
+void
+vncSetAuth::savegroup2(TCHAR *value)
+{
+	if (m_fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveString(hkDefault, "group2", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveString(hkDefault, "group2", value);
+	}
+}
+TCHAR*
+vncSetAuth::Readgroup2()
+{
+	if (m_fUseRegistry)
+		{
+		TCHAR *value=NULL;
+		OpenRegistry();
+		if (hkDefault) value=LoadString (hkDefault, "group2");
+		CloseRegistry();
+		return value;
+	}
+	else
+	{
+		TCHAR *value=NULL;
+		value=LoadString (hkDefault, "group2");
+		return value;
+	}
+}
+
+void
+vncSetAuth::savegroup3(TCHAR *value)
+{
+	if (m_fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveString(hkDefault, "group3", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveString(hkDefault, "group3", value);
+	}
+}
+TCHAR*
+vncSetAuth::Readgroup3()
+{
+	if (m_fUseRegistry)
+	{
+		TCHAR *value=NULL;
+		OpenRegistry();
+		if (hkDefault) value=LoadString (hkDefault, "group3");
+		CloseRegistry();
+		return value;
+	}
+	else
+	{
+		TCHAR *value=NULL;
+		value=LoadString (hkDefault, "group3");
+		return value;
+	}
+}
+
+LONG
+vncSetAuth::Readlocdom1(LONG returnvalue)
+{
+	if (m_fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault) returnvalue=LoadInt(hkDefault, "locdom1",returnvalue);
+		CloseRegistry();
+		return returnvalue;
+	}
+	else
+	{
+		returnvalue=LoadInt(hkDefault, "locdom1",returnvalue);
+		return returnvalue;
+	}
+}
+
+void
+vncSetAuth::savelocdom1(LONG value)
+{
+	if (m_fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveInt(hkDefault, "locdom1", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveInt(hkDefault, "locdom1", value);
+	}
+
+}
+
+LONG
+vncSetAuth::Readlocdom2(LONG returnvalue)
+{
+	if (m_fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault) returnvalue=LoadInt(hkDefault, "locdom2",returnvalue);
+		CloseRegistry();
+		return returnvalue;
+	}
+	else
+	{
+		returnvalue=LoadInt(hkDefault, "locdom2",returnvalue);
+		return returnvalue;
+	}
+}
+
+void
+vncSetAuth::savelocdom2(LONG value)
+{
+	if (m_fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveInt(hkDefault, "locdom2", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveInt(hkDefault, "locdom2", value);
+	}
+
+}
+
+LONG
+vncSetAuth::Readlocdom3(LONG returnvalue)
+{
+	if (m_fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault) returnvalue=LoadInt(hkDefault, "locdom3",returnvalue);
+		CloseRegistry();
+		return returnvalue;
+	}
+	else
+	{
+		returnvalue=LoadInt(hkDefault, "locdom3",returnvalue);
+		return returnvalue;
+	}
+}
+
+void
+vncSetAuth::savelocdom3(LONG value)
+{
+	if (m_fUseRegistry)
+	{
+		OpenRegistry();
+		if (hkDefault)SaveInt(hkDefault, "locdom3", value);
+		CloseRegistry();
+	}
+	else
+	{
+		SaveInt(hkDefault, "locdom3", value);
+	}
+
+}
+
+///////////////////////////////////////////////////////////
+
+
+
+// Constructor/destructor
+vncSetAuth::vncSetAuth()
+{
+	m_fUseRegistry = ((myIniFile.ReadInt("admin", "UseRegistry", 0) == 1) ? TRUE : FALSE);
+	m_dlgvisible = FALSE;
+	hkLocal=NULL;
+	hkDefault=NULL;
+	hkUser=NULL;
+	locdom1=0;
+	locdom2=0;
+	locdom3=0;
+	group1=Readgroup1();
+	group2=Readgroup2();
+	group3=Readgroup3();
+	locdom1=Readlocdom1(locdom1);
+	locdom2=Readlocdom2(locdom2);
+	locdom3=Readlocdom3(locdom3);
+	if (group1){strcpy(pszgroup1,group1);delete [] group1;}
+	else strcpy(pszgroup1,"");
+	if (group2){strcpy(pszgroup2,group2);delete [] group2;}
+	else strcpy(pszgroup2,"");
+	if (group3){strcpy(pszgroup3,group3);delete [] group3;}
+	else strcpy(pszgroup3,"");
+}
+
+vncSetAuth::~vncSetAuth()
+{
+}
+
+// Initialisation
+BOOL
+vncSetAuth::Init(vncServer *server)
+{
+	m_server = server;
+	m_dlgvisible = FALSE;
+	hkLocal=NULL;
+	hkDefault=NULL;
+	hkUser=NULL;
+	locdom1=0;
+	locdom2=0;
+	locdom3=0;
+	group1=Readgroup1();
+	group2=Readgroup2();
+	group3=Readgroup3();
+	locdom1=Readlocdom1(locdom1);
+	locdom2=Readlocdom2(locdom2);
+	locdom3=Readlocdom3(locdom3);
+	if (group1){strcpy(pszgroup1,group1);delete group1;}
+	else strcpy(pszgroup1,"");
+	if (group2){strcpy(pszgroup2,group2);delete group2;}
+	else strcpy(pszgroup2,"");
+	if (group3){strcpy(pszgroup3,group3);delete group3;}
+	else strcpy(pszgroup3,"");
+	return TRUE;
+}
+
+// Dialog box handling functions
+void
+vncSetAuth::Show(BOOL show)
+{
+	if (show)
+	{
+		if (!m_dlgvisible)
+		{
+			// [v1.0.2-jp1 fix] Load resouce from dll
+			//DialogBoxParam(hAppInstance,
+			DialogBoxParam(hInstResDLL,
+				MAKEINTRESOURCE(IDD_MSLOGON), 
+				NULL,
+				(DLGPROC) DialogProc,
+				(LONG_PTR) this);
+		}
+	}
+}
+
+BOOL CALLBACK
+vncSetAuth::DialogProc(HWND hwnd,
+					 UINT uMsg,
+					 WPARAM wParam,
+					 LPARAM lParam )
+{
+	// We use the dialog-box's USERDATA to store a _this pointer
+	// This is set only once WM_INITDIALOG has been recieved, though!
+    vncSetAuth *_this = helper::SafeGetWindowUserData<vncSetAuth>(hwnd);
+
+	switch (uMsg)
+	{
+
+	case WM_INITDIALOG:
+		{
+			// Retrieve the Dialog box parameter and use it as a pointer
+			// to the calling vncProperties object
+            helper::SafeSetWindowUserData(hwnd, lParam);
+
+			_this = (vncSetAuth *) lParam;
+			SetDlgItemText(hwnd, IDC_GROUP1, _this->pszgroup1);
+			SetDlgItemText(hwnd, IDC_GROUP2, _this->pszgroup2);
+			SetDlgItemText(hwnd, IDC_GROUP3, _this->pszgroup3);
+			if (_this->locdom1==1 || _this->locdom1==3)
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG1L);
+				SendMessage(hG1l,BM_SETCHECK,true,0);
+			}
+			else
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG1L);
+				SendMessage(hG1l,BM_SETCHECK,false,0);
+			}
+			if (_this->locdom1==2 || _this->locdom1==3)
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG1D);
+				SendMessage(hG1l,BM_SETCHECK,true,0);
+			}
+			else
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG1D);
+				SendMessage(hG1l,BM_SETCHECK,false,0);
+			}
+			if (_this->locdom2==1 || _this->locdom2==3)
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG2L);
+				SendMessage(hG1l,BM_SETCHECK,true,0);
+			}
+			else
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG2L);
+				SendMessage(hG1l,BM_SETCHECK,false,0);
+			}
+			if (_this->locdom2==2 || _this->locdom2==3)
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG2D);
+				SendMessage(hG1l,BM_SETCHECK,true,0);
+			}
+			else
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG2D);
+				SendMessage(hG1l,BM_SETCHECK,false,0);
+			}
+			if (_this->locdom3==1 || _this->locdom3==3)
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG3L);
+				SendMessage(hG1l,BM_SETCHECK,true,0);
+			}
+			else
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG3L);
+				SendMessage(hG1l,BM_SETCHECK,false,0);
+			}
+			if (_this->locdom3==2 || _this->locdom3==3)
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG3D);
+				SendMessage(hG1l,BM_SETCHECK,true,0);
+			}
+			else
+			{
+				HWND hG1l = GetDlgItem(hwnd, IDC_CHECKG3D);
+				SendMessage(hG1l,BM_SETCHECK,false,0);
+			}
+			//already handled by vncproperties
+			//if we get at thgis place
+			//IDC_MSLOGON_CHECKD was checked
+			/*HWND hMSLogon = GetDlgItem(hwnd, IDC_MSLOGON_CHECKD);
+            SendMessage(hMSLogon, BM_SETCHECK, _this->m_server->MSLogonRequired(), 0);
+			if (SendMessage(hMSLogon, BM_GETCHECK,0, 0) == BST_CHECKED)
+				{
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG1D), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG2D), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG3D), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG1L), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG2L), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG3L), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP1), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP2), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP3), true);
+				}
+			else
+				{
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG1D), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG2D), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG3D), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG1L), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG2L), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG3L), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP1), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP2), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP3), FALSE);
+				}*/
+
+
+
+			// Show the dialog
+			SetForegroundWindow(hwnd);
+
+			_this->m_dlgvisible = TRUE;
+
+			return TRUE;
+		}
+
+	case WM_COMMAND:
+		switch (LOWORD(wParam))
+		{
+
+		case IDCANCEL:
+			EndDialog(hwnd, TRUE);
+				_this->m_dlgvisible = FALSE;
+				return TRUE;
+		case IDOK:
+			{
+				_this->locdom1=0;
+				_this->locdom2=0;
+				_this->locdom3=0;
+				if (SendMessage(GetDlgItem(hwnd, IDC_CHECKG1L),BM_GETCHECK,0,0) == BST_CHECKED) _this->locdom1=_this->locdom1+1;
+				if (SendMessage(GetDlgItem(hwnd, IDC_CHECKG1D),BM_GETCHECK,0,0) == BST_CHECKED) _this->locdom1=_this->locdom1+2;
+
+				if (SendMessage(GetDlgItem(hwnd, IDC_CHECKG2L),BM_GETCHECK,0,0) == BST_CHECKED) _this->locdom2=_this->locdom2+1;
+				if (SendMessage(GetDlgItem(hwnd, IDC_CHECKG2D),BM_GETCHECK,0,0) == BST_CHECKED) _this->locdom2=_this->locdom2+2;
+
+				if (SendMessage(GetDlgItem(hwnd, IDC_CHECKG3L),BM_GETCHECK,0,0) == BST_CHECKED) _this->locdom3=_this->locdom3+1;
+				if (SendMessage(GetDlgItem(hwnd, IDC_CHECKG3D),BM_GETCHECK,0,0) == BST_CHECKED) _this->locdom3=_this->locdom3+2;
+
+				GetDlgItemText(hwnd, IDC_GROUP1, (LPSTR) _this->pszgroup1, 240);
+				GetDlgItemText(hwnd, IDC_GROUP2, (LPSTR) _this->pszgroup2, 240);
+				GetDlgItemText(hwnd, IDC_GROUP3, (LPSTR) _this->pszgroup3, 240);
+
+				bool use_uac=false;
+				if (!_this->myIniFile.IsWritable() || vncService::RunningAsService() )
+				{
+					// We can't write to the ini file , Vista in service mode
+					if (!Copy_to_Temp(_this->m_Tempfile))
+					{
+						// temp is not writable, we need to close else
+						// ini get overwritten by default
+						EndDialog(hwnd, TRUE);
+						_this->m_dlgvisible = FALSE;
+						return TRUE;
+					}
+					_this->myIniFile.IniFileSetTemp(_this->m_Tempfile);
+					use_uac=true;
+				}
+	
+				_this->savegroup1(_this->pszgroup1);
+				_this->savegroup2(_this->pszgroup2);
+				_this->savegroup3(_this->pszgroup3);
+				_this->savelocdom1(_this->locdom1);
+				_this->savelocdom2(_this->locdom2);
+				_this->savelocdom3(_this->locdom3);
+				if (use_uac==true)
+				{
+				_this->myIniFile.copy_to_secure();
+				_this->myIniFile.IniFileSetSecure();
+				}
+
+				EndDialog(hwnd, TRUE);
+				_this->m_dlgvisible = FALSE;
+				return TRUE;
+			}
+		// rdv not needed, already handled by vncproperties
+		// 
+		/*case IDC_MSLOGON_CHECKD:
+			{
+				HWND hMSLogon = GetDlgItem(hwnd, IDC_MSLOGON_CHECKD);
+				_this->m_server->RequireMSLogon(SendMessage(hMSLogon, BM_GETCHECK, 0, 0) == BST_CHECKED);
+				if (SendMessage(hMSLogon, BM_GETCHECK,0, 0) == BST_CHECKED)
+					{
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG1D), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG2D), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG3D), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG1L), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG2L), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG3L), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP1), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP2), true);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP3), true);
+						
+					}
+				else
+					{
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG1D), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG2D), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG3D), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG1L), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG2L), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_CHECKG3L), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP1), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP2), FALSE);
+					EnableWindow(GetDlgItem(hwnd, IDC_GROUP3), FALSE);
+					}
+			}*/
+		}
+
+		break;
+
+	case WM_DESTROY:
+		EndDialog(hwnd, FALSE);
+		_this->m_dlgvisible = FALSE;
+		return TRUE;
+	}
+	return 0;
+}
diff --git a/ica/win32/winvnc/winvnc/vncsetauth.h b/ica/win32/winvnc/winvnc/vncsetauth.h
new file mode 100644
index 0000000..952924a
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncsetauth.h
@@ -0,0 +1,98 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncSetAuth
+
+// Object implementing the About dialog for WinVNC.
+#include "inifile.h"
+class vncSetAuth;
+
+#if (!defined(_WINVNC_VNCSETAUTH))
+#define _WINVNC_VNCSETAUTH
+
+// Includes
+#include "stdhdrs.h"
+#include "vncserver.h"
+
+// The vncSetAuth class itself
+class vncSetAuth
+{
+public:
+	// Constructor/destructor
+	vncSetAuth();
+	~vncSetAuth();
+
+	// Initialisation
+	BOOL Init(vncServer *server);
+
+	// The dialog box window proc
+	static BOOL CALLBACK DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+	// General
+	void Show(BOOL show);
+	void SetTemp(char *TempFile){strcpy_s(m_Tempfile,MAXPATH,TempFile);};
+	char m_Tempfile[MAXPATH];
+
+	// Implementation
+	BOOL m_dlgvisible;
+
+	void OpenRegistry();
+	void CloseRegistry();
+	LONG LoadInt(HKEY key, LPCSTR valname, LONG defval);
+	TCHAR * LoadString(HKEY key, LPCSTR keyname);
+	void SaveInt(HKEY key, LPCSTR valname, LONG val);
+	void SaveString(HKEY key,LPCSTR valname, TCHAR *buffer);
+	void savegroup1(TCHAR *value);
+	TCHAR* Readgroup1();
+	void savegroup2(TCHAR *value);
+	TCHAR* Readgroup2();
+	void savegroup3(TCHAR *value);
+	TCHAR* Readgroup3();
+	LONG Readlocdom1(LONG returnvalue);
+	void savelocdom1(LONG value);
+	LONG Readlocdom2(LONG returnvalue);
+	void savelocdom2(LONG value);
+	LONG Readlocdom3(LONG returnvalue);
+	void savelocdom3(LONG value);
+
+	HKEY hkLocal;
+	HKEY hkDefault;
+	HKEY hkUser;
+
+	char *group1;
+	char *group2;
+	char *group3;
+	long locdom1;
+	long locdom2;
+	long locdom3;
+	char pszgroup1[256];
+	char pszgroup2[256];
+	char pszgroup3[256];
+
+	vncServer *			m_server;
+	BOOL m_fUseRegistry;
+	IniFile myIniFile;
+};
+
+#endif // _WINVNC_VNCPROPERTIES
diff --git a/ica/win32/winvnc/winvnc/vncsockconnect.cpp b/ica/win32/winvnc/winvnc/vncsockconnect.cpp
new file mode 100644
index 0000000..a0220a0
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncsockconnect.cpp
@@ -0,0 +1,227 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncSockConnect.cpp
+
+// Implementation of the listening socket class
+
+#include "stdhdrs.h"
+#include "vsocket.h"
+#include "vncsockconnect.h"
+#include "vncserver.h"
+#include <omnithread.h>
+
+#ifdef HTTP_SAMEPORT
+// Added for HTTP-via-RFB
+VBool maybeHandleHTTPRequest(VSocket* sock,vncServer* svr);
+#endif
+
+// The function for the spawned thread to run
+class vncSockConnectThread : public omni_thread
+{
+public:
+	// Init routine
+	virtual BOOL Init(VSocket *socket, vncServer *server);
+
+	// Code to be executed by the thread
+	virtual void *run_undetached(void * arg);
+
+	// Fields used internally
+	BOOL		m_shutdown;
+protected:
+	VSocket		*m_socket;
+	vncServer	*m_server;
+};
+
+// Method implementations
+BOOL vncSockConnectThread::Init(VSocket *socket, vncServer *server)
+{
+	// Save the server pointer
+	m_server = server;
+
+	// Save the socket pointer
+	m_socket = socket;
+
+	// Start the thread
+	m_shutdown = FALSE;
+	start_undetached();
+
+	return TRUE;
+}
+
+// Code to be executed by the thread
+void *vncSockConnectThread::run_undetached(void * arg)
+{
+	vnclog.Print(LL_STATE, VNCLOG("started socket connection thread\n"));
+
+	// Go into a loop, listening for connections on the given socket
+	while (!m_shutdown)
+	{
+		// Accept an incoming connection
+		VSocket *new_socket = m_socket->Accept();
+		if (new_socket == NULL)
+			break;
+		else
+		{
+#ifdef HTTP_SAMEPORT
+		if (maybeHandleHTTPRequest(new_socket,m_server)) {
+ 			// HTTP request has been handled and new_socket closed. The client will
+ 			// now reconnect to the RFB port and we will carry on.
+ 			vnclog.Print(LL_CLIENTS,VNCLOG("Woo hoo! Served Java applet via RFB!"));
+ 			continue;
+ 		}
+#endif
+			vnclog.Print(LL_CLIENTS, VNCLOG("accepted connection from %s\n"), new_socket->GetPeerName());
+			if ((!m_shutdown && !fShutdownOrdered)) m_server->AddClient(new_socket, FALSE, FALSE,NULL);
+		}
+
+		if (m_shutdown) 
+		{
+			delete new_socket;
+			break;
+		}
+
+		// sf at 2007 - The following had be done to avoid to spawn a new client object/thread
+		// when the connection was not from a vncviewer or had bad RFB protocole version
+		// but it might be the cause of the v1.0.2 WinVNC connection unavailability/crash problems
+		// due to thread conflict at socket level (between this thread and vncClient thread)
+		/*
+		if (m_server->GetDSMPluginPointer()->IsEnabled())
+		{
+		m_server->AddClient(new_socket, FALSE, FALSE,NULL);
+		}
+		else
+		{
+		///////////////Eliminate polling and non vncviewers ////////////////
+		///////////////Unfindable memeory leak ?////////////////////////////
+		////////////////////////////////////////////////////////////////////
+#ifdef HTTP_SAMEPORT
+		if (maybeHandleHTTPRequest(new_socket,m_server)) {
+ 			// HTTP request has been handled and new_socket closed. The client will
+ 			// now reconnect to the RFB port and we will carry on.
+ 			vnclog.Print(LL_CLIENTS,VNCLOG("Woo hoo! Served Java applet via RFB!"));
+ 			continue;
+ 		}
+#endif
+		rfbProtocolVersionMsg protocolMsg;
+		sprintf((char *)protocolMsg,
+		rfbProtocolVersionFormat,
+		rfbProtocolMajorVersion,
+		rfbProtocolMinorVersion + (m_server->MSLogonRequired() ? 0 : 2)); // 4: mslogon+FT,
+																		 // 6: VNClogon+FT
+		// Send the protocol message
+		if (new_socket->SendExact((char *)&protocolMsg, sz_rfbProtocolVersionMsg))
+			{
+				// Now, get the client's protocol version
+				rfbProtocolVersionMsg protocol_ver;
+				protocol_ver[12] = 0;
+				if (new_socket->ReadExact((char *)&protocol_ver, sz_rfbProtocolVersionMsg))
+				{
+					///////////////////////////////////////////////////////////////////
+					///////////////////////////////////////////////////////////////////
+					//We need at least a RFB start in the message
+					if (strncmp(protocol_ver,"RFB",3)==NULL)
+					{
+						vnclog.Print(LL_CLIENTS, VNCLOG("accepted connection from %s\n"), new_socket->GetPeerName());
+						// Successful accept - start the client unauthenticated
+						m_server->AddClient(new_socket, FALSE, FALSE,&protocol_ver);
+					}
+					else
+					{
+						delete new_socket;
+					}
+				}
+				else delete new_socket;
+			}
+		else delete new_socket;
+		}
+		*/
+	}
+	//if (new_socket != null)
+	//	delete new_socket;
+
+	vnclog.Print(LL_STATE, VNCLOG("quitting socket connection thread\n"));
+
+	return NULL;
+}
+
+// The vncSockConnect class implementation
+
+vncSockConnect::vncSockConnect()
+{
+	m_thread = NULL;
+}
+
+vncSockConnect::~vncSockConnect()
+{
+    m_socket.Shutdown();
+	m_socket.Close();
+
+    // Join with our lovely thread
+    if (m_thread != NULL)
+    {
+	// *** This is a hack to force the listen thread out of the accept call,
+	// because Winsock accept semantics are broken
+	((vncSockConnectThread *)m_thread)->m_shutdown = TRUE;
+
+	VSocket socket;
+	socket.Create();
+	socket.Bind(0);
+	socket.Connect("localhost", m_port);
+	socket.Close();
+
+	void *returnval;
+	m_thread->join(&returnval);
+	m_thread = NULL;
+
+	m_socket.Close();
+    }
+}
+
+BOOL vncSockConnect::Init(vncServer *server, UINT port)
+{
+	// Save the port id
+	m_port = port;
+
+	// Create the listening socket
+	if (!m_socket.Create())
+		return FALSE;
+
+	// Bind it
+	if (!m_socket.Bind(m_port, server->LoopbackOnly()))
+		return FALSE;
+
+	// Set it to listen
+	if (!m_socket.Listen())
+		return FALSE;
+
+	// Create the new thread
+	m_thread = new vncSockConnectThread;
+	if (m_thread == NULL)
+		return FALSE;
+
+	// And start it running
+	return ((vncSockConnectThread *)m_thread)->Init(&m_socket, server);
+}
+
diff --git a/ica/win32/winvnc/winvnc/vncsockconnect.h b/ica/win32/winvnc/winvnc/vncsockconnect.h
new file mode 100644
index 0000000..bd6a15c
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vncsockconnect.h
@@ -0,0 +1,68 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// vncSockConnect.h
+
+// The vncSockConnect class creates a listening socket and binds
+// it to the specified port.  It then creates a listen thread which
+// goes into a loop, listening on the socket.
+// When the vncSockConnect object is destroyed, all resources are
+// freed automatically, including the listen thread.
+
+class vncSockConnect;
+
+#if (!defined(_WINVNC_VNCSOCKCONNECT))
+#define _WINVNC_VNCSOCKCONNECT
+
+// Includes
+#include "stdhdrs.h"
+#include "vsocket.h"
+#include <omnithread.h>
+
+class vncServer;
+
+// The vncSockConnect class itself
+class vncSockConnect
+{
+public:
+	// Constructor/destructor
+	vncSockConnect();
+	~vncSockConnect();
+
+	// Init
+	virtual VBool Init(vncServer *server, UINT port);
+
+	// Implementation
+protected:
+	// The listening socket
+	VSocket m_socket;
+
+	// The port to listen on
+	UINT m_port;
+
+	// The in-coming accept thread
+	omni_thread *m_thread;
+};
+
+#endif // _WINVNC_VNCSOCKCONNECT
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vnctimedmsgbox.cpp b/ica/win32/winvnc/winvnc/vnctimedmsgbox.cpp
new file mode 100644
index 0000000..169f6a8
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vnctimedmsgbox.cpp
@@ -0,0 +1,84 @@
+//  Copyright (C) 2002 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+// vncTimedMsgBox
+
+// vncTimedMsgBox::Do spawns an omni-thread to draw the message
+// box and wait a few seconds before returning, leaving the message-box displayed
+// until WinVNC quits.
+
+#include "stdhdrs.h"
+#include "omnithread.h"
+
+#include "vnctimedmsgbox.h"
+
+// The message-box delay
+const UINT TIMED_MSGBOX_DELAY = 1000;
+
+// The vncTimedMsgBoxThread class
+
+class vncTimedMsgBoxThread : public omni_thread
+{
+public:
+	vncTimedMsgBoxThread(const char *caption, const char *title, UINT type)
+	{
+		m_type = type;
+		m_caption = _strdup(caption);
+		m_title = _strdup(title);
+	};
+	virtual ~vncTimedMsgBoxThread()
+	{
+		if (m_caption != NULL)
+			free(m_caption);
+		if (m_title != NULL)
+			free(m_title);
+	};
+	virtual void run(void *)
+	{
+		// Create the desired dialog box
+		if (m_caption == NULL)
+			return;
+		MessageBoxSecure(NULL, m_caption, m_title, m_type | MB_OK|MB_SETFOREGROUND|MB_SERVICE_NOTIFICATION);
+	};
+	char *m_caption;
+	char *m_title;
+	UINT m_type;
+};
+
+// The main vncTimedMsgBox class
+
+void
+vncTimedMsgBox::Do(const char *caption, const char *title, UINT type)
+{
+	// Create the thread object
+	vncTimedMsgBoxThread *thread = new vncTimedMsgBoxThread(caption, title, type);
+	if (thread == NULL)
+		return;
+
+	// Start the thread object
+	thread->start();
+
+	// And wait a few seconds
+	Sleep(TIMED_MSGBOX_DELAY);
+}
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/vnctimedmsgbox.h b/ica/win32/winvnc/winvnc/vnctimedmsgbox.h
new file mode 100644
index 0000000..aae642a
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vnctimedmsgbox.h
@@ -0,0 +1,42 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+// vncTimedMsgBox
+
+// Static class used to generate message boxes which allow the program's
+// execution to continue after a set delay (4 seconds at present)
+
+class vncTimedMsgBox;
+
+#if(!defined(_WINVNC_VNCTIMEDMSGBOX))
+#define _WINVNC_VNCTIMEDMSGBOX
+
+class vncTimedMsgBox
+{
+public:
+	// Bring up a message box, wait for two seconds, then return
+	static void Do(const char *caption, const char *title, UINT type);
+};
+
+#endif
+
diff --git a/ica/win32/winvnc/winvnc/vsocket.cpp b/ica/win32/winvnc/winvnc/vsocket.cpp
new file mode 100644
index 0000000..41b2ef5
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vsocket.cpp
@@ -0,0 +1,1143 @@
+//  Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
+//  Copyright (C) 2001 HorizonLive.com, Inc. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// VSocket.cpp
+
+// The VSocket class provides a platform-independent socket abstraction
+// with the simple functionality required for an RFB server.
+
+class VSocket;
+
+////////////////////////////////////////////////////////
+// System includes
+
+#include "stdhdrs.h"
+#ifdef _VC80
+#include <iostream>
+#else
+#include <iostream>
+#endif
+
+#include <stdio.h>
+#ifdef __WIN32__
+#include <io.h>
+#include <winsock2.h>
+#include <in6addr.h>
+#include <mstcpip.h>
+#else
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <signal.h>
+#endif
+#include <sys/types.h>
+
+////////////////////////////////////////////////////////
+// Custom includes
+
+#include <assert.h>
+#include "vtypes.h"
+extern unsigned int G_SENDBUFFER;
+////////////////////////////////////////////////////////
+// *** Lovely hacks to make Win32 work.  Hurrah!
+
+#ifdef __WIN32__
+#ifndef EWOULDBLOCK
+#define EWOULDBLOCK WSAEWOULDBLOCK
+#endif
+#endif
+
+////////////////////////////////////////////////////////
+// Socket implementation
+
+#include "vsocket.h"
+
+// The socket timeout value (currently 5 seconds, for no reason...)
+// *** THIS IS NOT CURRENTLY USED ANYWHERE
+const VInt rfbMaxClientWait = 5000;
+
+////////////////////////////
+// Socket implementation initialisation
+static WORD winsockVersion = 0;
+bool sendall(SOCKET RemoteSocket,char *buff,unsigned int bufflen,int dummy);
+
+VSocketSystem::VSocketSystem()
+{
+  // Initialise the socket subsystem
+  // This is only provided for compatibility with Windows.
+
+#ifdef __WIN32__
+  // Initialise WinPoxySockets on Win32
+  WORD wVersionRequested;
+  WSADATA wsaData;
+	
+  wVersionRequested = MAKEWORD(2, 0);
+  if (WSAStartup(wVersionRequested, &wsaData) != 0)
+  {
+    m_status = VFalse;
+	return;
+  }
+
+  winsockVersion = wsaData.wVersion;
+ 
+#else
+  // Disable the nasty read/write failure signals on UNIX
+  signal(SIGPIPE, SIG_IGN);
+#endif
+
+  // If successful, or if not required, then continue!
+  m_status = VTrue;
+}
+
+VSocketSystem::~VSocketSystem()
+{
+	if (m_status)
+	{
+		WSACleanup();
+	}
+}
+
+////////////////////////////
+
+
+// adzm 2010-08
+int VSocket::m_defaultSocketKeepAliveTimeout = 10000;
+
+VSocket::VSocket()
+{
+	// Clear out the internal socket fields
+	sock = -1;
+	vnclog.Print(LL_SOCKINFO, VNCLOG("VSocket() m_pDSMPlugin = NULL \n"));
+	m_pDSMPlugin = NULL;
+	//adzm 2009-06-20
+	m_pPluginInterface = NULL;
+	//adzm 2010-05-10
+	m_pIntegratedPluginInterface = NULL;
+	m_fUsePlugin = false;
+	
+	m_pNetRectBuf = NULL;
+	m_nNetRectBufSize = 0;
+	m_fWriteToNetRectBuf = false;
+	m_nNetRectBufOffset = 0;
+	queuebuffersize=0;
+	
+	//adzm 2010-08-01
+	m_LastSentTick = 0;
+
+	//adzm 2010-09
+	m_fPluginStreamingIn = false;
+	m_fPluginStreamingOut = false;
+}
+
+////////////////////////////
+
+VSocket::~VSocket()
+{
+  // Close the socket
+  Close();
+
+  if (m_pNetRectBuf != NULL)
+ 	delete [] m_pNetRectBuf;
+
+}
+
+////////////////////////////
+#include "httpconnect.h"
+VBool VSocket::Http_CreateConnect(const VString address)
+{
+	httpconnect http_class;
+	sock=http_class.Get_https_socket("443",address);
+	if (sock==0) return false;
+	else return true;
+}
+
+VBool
+VSocket::Create()
+{
+  const int one = 1;
+
+  // Check that the old socket was closed
+  if (sock >= 0)
+    Close();
+
+  // Create the socket
+  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+    {
+      return VFalse;
+    }
+
+  // Set the socket options:
+//#ifndef WIN32
+  // sf at 2006 - Trying to fix the neverending authentication bug
+  /*
+  // Usefull for NT4 ?
+  if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (char *)&one, sizeof(one)))
+    {
+      return VFalse;
+    }
+  */
+  // sf at 2006 - Trying to fix the neverending authentication bug
+  if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&one, sizeof(one)))
+  {
+      return VFalse;
+  }
+  //#endif
+
+  // adzm 2010-08
+  SetDefaultSocketOptions();
+
+  return VTrue;
+}
+
+////////////////////////////
+
+VBool
+VSocket::Close()
+{
+  if (sock >= 0)
+    {
+	  vnclog.Print(LL_SOCKINFO, VNCLOG("closing socket\n"));
+
+	  shutdown(sock, SD_BOTH);
+#ifdef __WIN32__
+	  closesocket(sock);
+#else
+	  close(sock);
+#endif
+      sock = -1;
+    }
+
+  //adzm 2009-06-20
+  if (m_pPluginInterface) {
+    delete m_pPluginInterface;
+	m_pPluginInterface=NULL;
+	//adzm 2010-05-10
+	m_pIntegratedPluginInterface=NULL;
+  }
+  return VTrue;
+}
+
+////////////////////////////
+
+VBool
+VSocket::Shutdown()
+{
+  if (sock >= 0)
+    {
+	  vnclog.Print(LL_SOCKINFO, VNCLOG("shutdown socket\n"));
+
+	  shutdown(sock, SD_BOTH);
+//	  sock = -1;
+    }
+  return VTrue;
+}
+
+////////////////////////////
+
+VBool
+VSocket::Bind(const VCard port, const VBool localOnly)
+{
+  struct sockaddr_in addr;
+
+  // Check that the socket is open!
+  if (sock < 0)
+    return VFalse;
+
+  // Set up the address to bind the socket to
+  addr.sin_family = AF_INET;
+  addr.sin_port = htons(port);
+  if (localOnly)
+	addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+  else
+	addr.sin_addr.s_addr = htonl(INADDR_ANY);
+
+  // And do the binding
+  if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0)
+      return VFalse;
+
+  return VTrue;
+}
+
+////////////////////////////
+
+VBool
+VSocket::Connect(const VString address, const VCard port)
+{
+  // Check the socket
+  if (sock < 0)
+    return VFalse;
+
+  // Create an address structure and clear it
+  struct sockaddr_in addr;
+  memset(&addr, 0, sizeof(addr));
+
+  // Fill in the address if possible
+  addr.sin_family = AF_INET;
+  addr.sin_addr.s_addr = inet_addr(address);
+
+  // Was the string a valid IP address?
+  if ((int) addr.sin_addr.s_addr == -1)
+    {
+      // No, so get the actual IP address of the host name specified
+      struct hostent *pHost=NULL;
+      pHost = gethostbyname(address);
+      if (pHost != NULL)
+	  {
+		  if (pHost->h_addr == NULL)
+			  return VFalse;
+		  addr.sin_addr.s_addr = ((struct in_addr *)pHost->h_addr)->s_addr;
+	  }
+	  else
+	    return VFalse;
+    }
+
+  // Set the port number in the correct format
+  addr.sin_port = htons(port);
+
+  // Actually connect the socket
+  if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0)
+    return VFalse;
+
+  // sf at 2006 - Trying to fix the neverending authentication bug
+  // Put the socket into non-blocking mode
+/*
+#ifdef __WIN32__
+  u_long arg = 1;
+  if (ioctlsocket(sock, FIONBIO, &arg) != 0)
+	return VFalse;
+#else
+  if (fcntl(sock, F_SETFL, O_NDELAY) != 0)
+	return VFalse;
+#endif
+*/
+  
+  // adzm 2010-08
+  SetDefaultSocketOptions();
+
+  return VTrue;
+}
+
+////////////////////////////
+
+VBool
+VSocket::Listen()
+{
+  // Check socket
+  if (sock < 0)
+    return VFalse;
+
+	// Set it to listen
+  if (listen(sock, 5) < 0)
+    return VFalse;
+
+  return VTrue;
+}
+
+////////////////////////////
+
+VSocket *
+VSocket::Accept()
+{
+  int new_socket_id;
+  VSocket * new_socket;
+
+  // Check this socket
+  if (sock < 0)
+    return NULL;
+
+  int optVal;
+  int optLen = sizeof(int);
+  getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&optVal, &optLen); 
+  optVal=32000;
+  setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&optVal, optLen); 
+
+  // Accept an incoming connection
+  if ((new_socket_id = accept(sock, NULL, 0)) < 0)
+    return NULL;
+
+  // Create a new VSocket and return it
+  new_socket = new VSocket;
+  if (new_socket != NULL)
+  {
+      new_socket->sock = new_socket_id;
+  }
+  else
+  {
+	  shutdown(new_socket_id, SD_BOTH);
+	  closesocket(new_socket_id);
+	  return NULL;
+  }
+  
+  // adzm 2010-08
+  new_socket->SetDefaultSocketOptions();
+
+  // Put the socket into non-blocking mode
+  return new_socket;
+}
+
+////////////////////////////
+////////////////////////////
+
+VString
+VSocket::GetPeerName()
+{
+	struct sockaddr_in	sockinfo;
+	struct in_addr		address;
+	int					sockinfosize = sizeof(sockinfo);
+	VString				name;
+
+	// Get the peer address for the client socket
+	getpeername(sock, (struct sockaddr *)&sockinfo, &sockinfosize);
+	memcpy(&address, &sockinfo.sin_addr, sizeof(address));
+
+	name = inet_ntoa(address);
+	if (name == NULL)
+		return "<unavailable>";
+	else
+		return name;
+}
+
+////////////////////////////
+
+VString
+VSocket::GetSockName()
+{
+	struct sockaddr_in	sockinfo;
+	struct in_addr		address;
+	int					sockinfosize = sizeof(sockinfo);
+	VString				name;
+
+	// Get the peer address for the client socket
+	getsockname(sock, (struct sockaddr *)&sockinfo, &sockinfosize);
+	memcpy(&address, &sockinfo.sin_addr, sizeof(address));
+
+	name = inet_ntoa(address);
+	if (name == NULL)
+		return "<unavailable>";
+	else
+		return name;
+}
+
+// 25 January 2008 jdp
+bool VSocket::GetPeerAddress(char *address, int size)
+{
+    struct sockaddr_in addr;
+    int addrsize = sizeof(sockaddr_in);
+
+    if (sock < 0)
+        return false;
+
+    if (getpeername(sock, (struct sockaddr *) &addr, &addrsize) != 0)
+        return false;
+
+    _snprintf(address, size, "%s:%d",
+              inet_ntoa(addr.sin_addr),
+              ntohs(addr.sin_port));
+
+    return true;
+}
+////////////////////////////
+
+VCard32
+VSocket::Resolve(const VString address)
+{
+  VCard32 addr;
+
+  // Try converting the address as IP
+  addr = inet_addr(address);
+
+  // Was it a valid IP address?
+  if (addr == 0xffffffff)
+    {
+      // No, so get the actual IP address of the host name specified
+      struct hostent *pHost;
+      pHost = gethostbyname(address);
+      if (pHost != NULL)
+	  {
+		  if (pHost->h_addr == NULL)
+			  return 0;
+		  addr = ((struct in_addr *)pHost->h_addr)->s_addr;
+	  }
+	  else
+		  return 0;
+    }
+
+  // Return the resolved IP address as an integer
+  return addr;
+}
+
+////////////////////////////
+
+// adzm 2010-08
+VBool
+VSocket::SetDefaultSocketOptions()
+{
+	VBool result = VTrue;
+
+	const int one = 1;
+
+	if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&one, sizeof(one)))
+	{
+		result = VFalse;
+	}
+
+	int defaultSocketKeepAliveTimeout = m_defaultSocketKeepAliveTimeout;
+	if (defaultSocketKeepAliveTimeout > 0) {
+		if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (const char *)&one, sizeof(one))) {
+			result = VFalse;
+		} else {
+			DWORD bytes_returned = 0;
+			tcp_keepalive keepalive_requested;
+			tcp_keepalive keepalive_returned;
+			ZeroMemory(&keepalive_requested, sizeof(keepalive_requested));
+			ZeroMemory(&keepalive_returned, sizeof(keepalive_returned));
+
+			keepalive_requested.onoff = 1;
+			keepalive_requested.keepalivetime = defaultSocketKeepAliveTimeout;
+			keepalive_requested.keepaliveinterval = 1000;
+			// 10 probes always used by default in Vista+; not changeable. 
+
+			if (0 != WSAIoctl(sock, SIO_KEEPALIVE_VALS, 
+					&keepalive_requested, sizeof(keepalive_requested), 
+					&keepalive_returned, sizeof(keepalive_returned), 
+					&bytes_returned, NULL, NULL))
+			{
+				result = VFalse;
+			}
+		}
+	}
+
+	assert(result);
+
+	return result;
+}
+
+////////////////////////////
+
+VBool
+VSocket::SetTimeout(VCard32 msecs)
+{
+	if (LOBYTE(winsockVersion) < 2)
+		return VFalse;
+	int timeout=msecs;
+	if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeout, sizeof(timeout)) == SOCKET_ERROR)
+	{
+		return VFalse;
+	}
+	if (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char*)&timeout, sizeof(timeout)) == SOCKET_ERROR)
+	{
+		return VFalse;
+	}
+	return VTrue;
+}
+
+VBool VSocket::SetSendTimeout(VCard32 msecs)
+{
+#if 1
+    return SetTimeout (msecs);
+#else
+	if (LOBYTE(winsockVersion) < 2)
+		return VFalse;
+	int timeout=msecs;
+
+	if (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char*)&timeout, sizeof(timeout)) == SOCKET_ERROR)
+	{
+		return VFalse;
+	}
+
+	return VTrue;
+#endif
+}
+
+VBool VSocket::SetRecvTimeout(VCard32 msecs)
+{
+#if 1
+    return SetTimeout (msecs);
+#else
+	if (LOBYTE(winsockVersion) < 2)
+		return VFalse;
+	int timeout=msecs;
+	if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeout, sizeof(timeout)) == SOCKET_ERROR)
+	{
+		return VFalse;
+	}
+	return VTrue;
+#endif
+}
+
+////////////////////////////
+VInt
+VSocket::Send(const char *buff, const VCard bufflen)
+{
+	//adzm 2010-08-01
+	m_LastSentTick = GetTickCount();
+
+	unsigned int newsize=queuebuffersize+bufflen;
+	char *buff2;
+	buff2=(char*)buff;
+	unsigned int bufflen2=bufflen;
+
+	// adzm 2010-09 - flush as soon as we have a full buffer, not if we have exceeded it.
+	if (newsize >= G_SENDBUFFER)
+	{
+		    memcpy(queuebuffer+queuebuffersize,buff2,G_SENDBUFFER-queuebuffersize);
+			if (!sendall(sock,queuebuffer,G_SENDBUFFER,0)) return FALSE;
+//			vnclog.Print(LL_SOCKERR, VNCLOG("SEND  %i\n") ,G_SENDBUFFER);
+			buff2+=(G_SENDBUFFER-queuebuffersize);
+			bufflen2-=(G_SENDBUFFER-queuebuffersize);
+			queuebuffersize=0;
+			// adzm 2010-09 - flush as soon as we have a full buffer, not if we have exceeded it.
+			while (bufflen2 >= G_SENDBUFFER)
+			{
+				if (!sendall(sock,buff2,G_SENDBUFFER,0)) return false;
+//				vnclog.Print(LL_SOCKERR, VNCLOG("SEND 1 %i\n") ,G_SENDBUFFER);
+				buff2+=G_SENDBUFFER;
+				bufflen2-=G_SENDBUFFER;
+			}
+	}
+	memcpy(queuebuffer+queuebuffersize,buff2,bufflen2);
+	queuebuffersize+=bufflen2;
+	if (queuebuffersize > 0) {
+		if (!sendall(sock,queuebuffer,queuebuffersize,0)) 
+			return false;
+	}
+//	vnclog.Print(LL_SOCKERR, VNCLOG("SEND 2 %i\n") ,queuebuffersize);
+	queuebuffersize=0;
+	return bufflen;
+}
+////////////////////////////
+VInt
+VSocket::SendQueued(const char *buff, const VCard bufflen)
+{
+	unsigned int newsize=queuebuffersize+bufflen;
+	char *buff2;
+	buff2=(char*)buff;
+	unsigned int bufflen2=bufflen;
+	
+	// adzm 2010-09 - flush as soon as we have a full buffer, not if we have exceeded it.
+	if (newsize >= G_SENDBUFFER)
+	{	
+			//adzm 2010-08-01
+			m_LastSentTick = GetTickCount();
+
+		    memcpy(queuebuffer+queuebuffersize,buff2,G_SENDBUFFER-queuebuffersize);
+			if (!sendall(sock,queuebuffer,G_SENDBUFFER,0)) return FALSE;
+		//	vnclog.Print(LL_SOCKERR, VNCLOG("SEND Q  %i\n") ,G_SENDBUFFER);
+			buff2+=(G_SENDBUFFER-queuebuffersize);
+			bufflen2-=(G_SENDBUFFER-queuebuffersize);
+			queuebuffersize=0;			
+
+			// adzm 2010-09 - flush as soon as we have a full buffer, not if we have exceeded it.
+			while (bufflen2 >= G_SENDBUFFER)
+			{
+				if (!sendall(sock,buff2,G_SENDBUFFER,0)) return false;				
+				//adzm 2010-08-01
+				m_LastSentTick = GetTickCount();
+			//	vnclog.Print(LL_SOCKERR, VNCLOG("SEND Q  %i\n") ,G_SENDBUFFER);
+				buff2+=G_SENDBUFFER;
+				bufflen2-=G_SENDBUFFER;
+			}
+	}
+	memcpy(queuebuffer+queuebuffersize,buff2,bufflen2);
+	queuebuffersize+=bufflen2;
+	return bufflen;
+}
+/////////////////////////////
+
+// sf at 2002 - DSMPlugin
+VBool
+VSocket::SendExact(const char *buff, const VCard bufflen, unsigned char msgType)
+{
+	if (sock==-1) return VFalse;
+	//vnclog.Print(LL_SOCKERR, VNCLOG("SendExactMsg %i\n") ,bufflen);
+	// adzm 2010-09
+	if (!IsPluginStreamingOut() && m_fUsePlugin && m_pDSMPlugin->IsEnabled())
+	{
+		// Send the transformed message type first
+		char t = (char)msgType;
+		SendExact(&t, 1);
+		// Then we send the transformed rfb message content
+		SendExact(buff, bufflen);
+	}
+	else
+		SendExact(buff, bufflen);
+
+	return VTrue;
+}
+
+
+//adzm 2010-09 - minimize packets. SendExact flushes the queue.
+VBool 
+VSocket::SendExactQueue(const char *buff, const VCard bufflen, unsigned char msgType)
+{
+	if (sock==-1) return VFalse;
+	//vnclog.Print(LL_SOCKERR, VNCLOG("SendExactMsg %i\n") ,bufflen);
+	// adzm 2010-09
+	if (!IsPluginStreamingOut() && m_fUsePlugin && m_pDSMPlugin->IsEnabled())
+	{
+		// Send the transformed message type first
+		char t = (char)msgType;
+		SendExactQueue(&t, 1);
+		// Then we send the transformed rfb message content
+		SendExactQueue(buff, bufflen);
+	}
+	else
+		SendExactQueue(buff, bufflen);
+
+	return VTrue;
+}
+
+//////////////////////////////////////////
+VBool
+VSocket::SendExact(const char *buff, const VCard bufflen)
+{	
+	if (sock==-1) return VFalse;
+	//adzm 2010-09
+	if (bufflen <=0) {
+		return VTrue;
+	}
+//	vnclog.Print(LL_SOCKERR, VNCLOG("SendExact %i\n") ,bufflen);
+	// sf at 2002 - DSMPlugin
+	VCard nBufflen = bufflen;
+	char* pBuffer = NULL;
+	if (m_fUsePlugin && m_pDSMPlugin->IsEnabled())
+	{
+		// omni_mutex_lock l(m_TransMutex);
+
+		// If required to store data into memory
+		if (m_fWriteToNetRectBuf)
+		{
+			memcpy((char*)(m_pNetRectBuf + m_nNetRectBufOffset), buff, bufflen);
+			m_nNetRectBufOffset += bufflen;
+			return VTrue;
+		}
+		else // Tell the plugin to transform data
+		{
+			int nTransDataLen = 0;
+			//adzm 2009-06-20
+			pBuffer = (char*)(TransformBuffer((BYTE*)buff, bufflen, &nTransDataLen));
+			if (pBuffer == NULL || (bufflen > 0 && nTransDataLen == 0))
+			{
+				// throw WarningException("SendExact: DSMPlugin-TransformBuffer Error.");
+			}
+			nBufflen = nTransDataLen;
+		}
+		
+	}
+	else
+		pBuffer = (char*) buff;
+	
+	VInt result=Send(pBuffer, nBufflen);
+  return result == (VInt)nBufflen;
+}
+///////////////////////////////////////
+VBool
+VSocket::SendExactQueue(const char *buff, const VCard bufflen)
+{
+	if (sock==-1) return VFalse;
+	//adzm 2010-09
+	if (bufflen <=0) {
+		return VTrue;
+	}
+//	vnclog.Print(LL_SOCKERR, VNCLOG("SendExactQueue %i %i\n") ,bufflen,queuebuffersize);
+//	vnclog.Print(LL_SOCKERR, VNCLOG("socket size %i\n") ,bufflen);
+	// sf at 2002 - DSMPlugin
+	VCard nBufflen = bufflen;
+	char* pBuffer = NULL;
+	if (m_fUsePlugin && m_pDSMPlugin->IsEnabled())
+	{
+		// omni_mutex_lock l(m_TransMutex);
+
+		// If required to store data into memory
+		if (m_fWriteToNetRectBuf)
+		{
+			memcpy((char*)(m_pNetRectBuf + m_nNetRectBufOffset), buff, bufflen);
+			m_nNetRectBufOffset += bufflen;
+			return VTrue;
+		}
+		else // Tell the plugin to transform data
+		{
+			int nTransDataLen = 0;
+			//adzm 2009-06-20
+			pBuffer = (char*)(TransformBuffer((BYTE*)buff, bufflen, &nTransDataLen));
+			if (pBuffer == NULL || (bufflen > 0 && nTransDataLen == 0))
+			{
+				// throw WarningException("SendExact: DSMPlugin-TransformBuffer Error.");
+			}
+			nBufflen = nTransDataLen;
+		}
+		
+	}
+	else
+		pBuffer = (char*) buff;
+	
+	VInt result=SendQueued(pBuffer, nBufflen);
+  return result == (VInt)nBufflen;
+}
+///////////////////////////////
+VBool
+VSocket::ClearQueue()
+{
+	if (sock==-1) return VFalse;
+	if (queuebuffersize!=0)
+  {
+	//adzm 2010-08-01
+	m_LastSentTick = GetTickCount();
+	//adzm 2010-09 - return a bool in ClearQueue
+	if (!sendall(sock,queuebuffer,queuebuffersize,0)) 
+		return VFalse;
+	queuebuffersize=0;
+  }
+  return VTrue;
+}
+////////////////////////////
+
+VInt
+VSocket::Read(char *buff, const VCard bufflen)
+{
+	if (sock==-1) return sock;
+    int s = recv(sock, buff, bufflen, 0);
+#if defined(_DEBUG)
+    if (s == SOCKET_ERROR)
+    {
+        OutputDebugString("recv: SOCKET_ERROR");
+    }
+
+    if (s == 0)
+    {
+        OutputDebugString("recv: connection closed");
+    }
+#endif
+  return s;
+}
+
+////////////////////////////
+
+VBool
+VSocket::ReadExact(char *buff, const VCard bufflen)
+{	
+	if (sock==-1) return VFalse;
+	//adzm 2010-09
+	if (bufflen <=0) {
+		return VTrue;
+	}
+	int n;
+	VCard currlen = bufflen;
+    
+	// sf at 2002 - DSM Plugin
+	if (m_fUsePlugin && m_pDSMPlugin->IsEnabled())
+	{
+		//omni_mutex_lock l(m_pDSMPlugin->m_RestMutex); 
+		//adzm 2009-06-20 - don't lock if we are using the new interface
+		omni_mutex_conditional_lock l(m_pDSMPlugin->m_RestMutex, m_pPluginInterface ? false : true);
+
+		// Get the DSMPlugin destination buffer where to put transformed incoming data
+		// The number of bytes to read calculated from bufflen is given back in nTransDataLen
+		int nTransDataLen = 0;
+		//adzm 2009-06-20
+		BYTE* pTransBuffer = RestoreBufferStep1(NULL, bufflen, &nTransDataLen);
+		if (pTransBuffer == NULL)
+		{
+			// m_pDSMPlugin->RestoreBufferUnlock();
+			// throw WarningException("WriteExact: DSMPlugin-RestoreBuffer Alloc Error.");
+			vnclog.Print(LL_SOCKERR, VNCLOG("WriteExact: DSMPlugin-RestoreBuffer Alloc Error\n"));
+			return VFalse;
+		}
+		
+		// Read bytes directly into Plugin Dest Rest. buffer
+		int nTransDataLenSave = nTransDataLen;
+		while (nTransDataLen > 0)
+		{
+			// Try to read some data in
+			n = Read((char*)pTransBuffer, nTransDataLen);
+			if (n > 0)
+			{
+				// Adjust the buffer position and size
+				pTransBuffer += n;
+				nTransDataLen -= n;
+			} else if (n == 0) {
+				//m_pDSMPlugin->RestoreBufferUnlock();
+				vnclog.Print(LL_SOCKERR, VNCLOG("zero bytes read1\n"));
+				return VFalse;
+			} else {
+				if (WSAGetLastError() != WSAEWOULDBLOCK)
+				{
+					//m_pDSMPlugin->RestoreBufferUnlock();
+					vnclog.Print(LL_SOCKERR, VNCLOG("socket error 1: %d\n"), WSAGetLastError());
+					return VFalse;
+				}
+			}
+		}
+		
+		// Ask plugin to restore data from rest. buffer into inbuf
+		int nRestDataLen = 0;
+		nTransDataLen = nTransDataLenSave;
+		//adzm 2009-06-20
+		RestoreBufferStep2((BYTE*)buff, nTransDataLen, &nRestDataLen);
+
+		// Check if we actually get the real original data length
+		if ((VCard)nRestDataLen != bufflen)
+		{
+			// throw WarningException("WriteExact: DSMPlugin-RestoreBuffer Error.");
+		}
+	}
+	else // Non-Transformed
+	{
+		while (currlen > 0)
+		{
+			// Try to read some data in
+			n = Read(buff, currlen);
+			
+			if (n > 0)
+			{
+				// Adjust the buffer position and size
+				buff += n;
+				currlen -= n;
+			} else if (n == 0) {
+				vnclog.Print(LL_SOCKERR, VNCLOG("zero bytes read2\n"));
+				
+				return VFalse;
+			} else {
+				if (WSAGetLastError() != WSAEWOULDBLOCK)
+				{
+					//int aa=WSAGetLastError();
+					//vnclog.Print(LL_SOCKERR, VNCLOG("socket error 2: %d\n"), aa);
+					return VFalse;
+				}
+			}
+		}
+	}
+
+return VTrue;
+}
+
+
+//
+// sf at 2002 - DSMPlugin
+// 
+
+//adzm 2009-06-20
+void VSocket::SetDSMPluginPointer(CDSMPlugin* pDSMPlugin)
+{
+	m_pDSMPlugin = pDSMPlugin;
+
+	if (m_pPluginInterface) {
+		delete m_pPluginInterface;
+		m_pPluginInterface = NULL;
+		//adzm 2010-05-10
+		m_pIntegratedPluginInterface = NULL;
+	}
+
+	if (m_pDSMPlugin && m_pDSMPlugin->SupportsMultithreaded()) {
+		//adzm 2010-05-10
+		if (m_pDSMPlugin->SupportsIntegrated()) {
+			m_pIntegratedPluginInterface = m_pDSMPlugin->CreateIntegratedPluginInterface();
+			m_pPluginInterface = m_pIntegratedPluginInterface;
+		} else {
+			m_pIntegratedPluginInterface = NULL;
+			m_pPluginInterface = m_pDSMPlugin->CreatePluginInterface();
+		}
+	} else {
+		m_pPluginInterface = NULL;
+		m_pIntegratedPluginInterface = NULL;
+	}
+}
+
+//adzm 2010-05-12 - dsmplugin config
+void VSocket::SetDSMPluginConfig(char* szDSMPluginConfig)
+{
+	if (m_pIntegratedPluginInterface) {
+		m_pIntegratedPluginInterface->SetServerOptions(szDSMPluginConfig);
+	}
+}
+
+//
+// Tell the plugin to do its transformation on the source data buffer
+// Return: pointer on the new transformed buffer (allocated by the plugin)
+// nTransformedDataLen is the number of bytes contained in the transformed buffer
+//adzm 2009-06-20
+BYTE* VSocket::TransformBuffer(BYTE* pDataBuffer, int nDataLen, int* pnTransformedDataLen)
+{
+	if (m_pPluginInterface) {
+		return m_pPluginInterface->TransformBuffer(pDataBuffer, nDataLen, pnTransformedDataLen);
+	} else {
+		return m_pDSMPlugin->TransformBuffer(pDataBuffer, nDataLen, pnTransformedDataLen);
+	}
+}
+
+
+// - If pRestoredDataBuffer = NULL, the plugin check its local buffer and return the pointer
+// - Otherwise, restore data contained in its rest. buffer and put the result in pRestoredDataBuffer
+//   pnRestoredDataLen is the number bytes put in pRestoredDataBuffers
+//adzm 2009-06-20
+BYTE* VSocket::RestoreBufferStep1(BYTE* pRestoredDataBuffer, int nDataLen, int* pnRestoredDataLen)
+{	
+	if (m_pPluginInterface) {
+		return m_pPluginInterface->RestoreBuffer(pRestoredDataBuffer, nDataLen, pnRestoredDataLen);
+	} else {
+		return m_pDSMPlugin->RestoreBufferStep1(pRestoredDataBuffer, nDataLen, pnRestoredDataLen);
+	}
+}
+
+//adzm 2009-06-20
+BYTE* VSocket::RestoreBufferStep2(BYTE* pRestoredDataBuffer, int nDataLen, int* pnRestoredDataLen)
+{	
+	if (m_pPluginInterface) {
+		return m_pPluginInterface->RestoreBuffer(pRestoredDataBuffer, nDataLen, pnRestoredDataLen);
+	} else {
+		return m_pDSMPlugin->RestoreBufferStep2(pRestoredDataBuffer, nDataLen, pnRestoredDataLen);
+	}
+}
+
+//
+// Ensures that the temporary "alignement" buffer in large enough 
+//
+void VSocket::CheckNetRectBufferSize(int nBufSize)
+{
+    omni_mutex_lock l(m_CheckMutex); 
+
+	if (m_nNetRectBufSize > nBufSize) return;
+
+	BYTE *newbuf = new BYTE[nBufSize + 256];
+	if (newbuf == NULL) 
+	{
+		// throw ErrorException("Insufficient memory to allocate network crypt buffer.");
+	}
+
+	if (m_pNetRectBuf != NULL)
+	{
+		// memcpy(newbuf, m_pNetRectBuf, m_nNetRectBufSize);
+		delete [] m_pNetRectBuf;
+	}
+
+	m_pNetRectBuf = newbuf;
+	m_nNetRectBufSize = nBufSize + 256;
+	// vnclog.Print(4, _T("crypt bufsize expanded to %d\n"), m_netbufsize);
+}
+
+
+// sf at 2002 - DSMPlugin
+// Necessary for HTTP server (we'll see later if we can do something more intelligent...
+
+VBool
+VSocket::SendExactHTTP(const char *buff, const VCard bufflen)
+{
+  return Send(buff, bufflen) == (VInt)bufflen;
+}
+
+
+////////////////////////////
+
+VBool
+VSocket::ReadExactHTTP(char *buff, const VCard bufflen)
+{
+	int n;
+	VCard currlen = bufflen;
+    
+	while (currlen > 0)
+	{
+		// Try to read some data in
+		n = Read(buff, currlen);
+
+		if (n > 0)
+		{
+			// Adjust the buffer position and size
+			buff += n;
+			currlen -= n;
+		} else if (n == 0) {
+			vnclog.Print(LL_SOCKERR, VNCLOG("zero bytes read3\n"));
+
+			return VFalse;
+		} else {
+			if (WSAGetLastError() != WSAEWOULDBLOCK)
+			{
+				vnclog.Print(LL_SOCKERR, VNCLOG("HTTP socket error: %d\n"), WSAGetLastError());
+				return VFalse;
+			}
+		}
+    }
+
+	return VTrue;
+}
+#ifdef HTTP_SAMEPORT
+VBool
+VSocket::ReadSelect(VCard to)
+ {
+ 	fd_set fds;
+ 	FD_ZERO(&fds);
+ 	FD_SET((unsigned long)sock,&fds);
+	struct timeval tv;
+ 	tv.tv_sec = to/1000;
+ 	tv.tv_usec = (to % 1000)*1000;
+ 	int rc = select(sock+1,&fds,0,0,&tv);
+ 	if (rc>0) return true;
+ 	return false;
+ }
+#endif
+
+extern bool			fShutdownOrdered;
+bool
+sendall(SOCKET RemoteSocket,char *buff,unsigned int bufflen,int dummy)
+{
+int val =0;
+	unsigned int totsend=0;
+	while (totsend <bufflen)
+	  {
+		struct fd_set write_fds;
+		struct timeval tm;
+		int count;
+		int aa=0;
+		do {
+			FD_ZERO(&write_fds);
+			FD_SET(RemoteSocket, &write_fds);
+			tm.tv_sec = 1;
+			tm.tv_usec = 0;
+			count = select(RemoteSocket+ 1, NULL, &write_fds, NULL, &tm);
+			aa++;
+		} while (count == 0&& !fShutdownOrdered && aa<20);
+		if (aa>=20) return 0;
+		if (fShutdownOrdered) return 0;
+		if (count < 0 || count > 1) return 0;
+		if (FD_ISSET(RemoteSocket, &write_fds)) 
+		{
+			val=send(RemoteSocket, buff+totsend, bufflen-totsend, 0);
+		}
+		if (val==0) 
+			return false;
+		if (val==SOCKET_ERROR) 
+			return false;
+		totsend+=val;
+	  }
+	return 1;
+}
+
+
+
diff --git a/ica/win32/winvnc/winvnc/vsocket.h b/ica/win32/winvnc/winvnc/vsocket.h
new file mode 100644
index 0000000..d38601c
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vsocket.h
@@ -0,0 +1,224 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//  Copyright (C) 2001 HorizonLive.com, Inc. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// VSocket.h
+
+// RFB V3.0
+
+// The VSocket class provides simple socket functionality,
+// independent of platform.  Hurrah.
+
+class VSocket;
+
+#if (!defined(_ATT_VSOCKET_DEFINED))
+#define _ATT_VSOCKET_DEFINED
+
+#include "vtypes.h"
+#include <DSMPlugin/DSMPlugin.h>
+
+////////////////////////////
+// Socket implementation
+
+// Create one or more VSocketSystem objects per application
+class VSocketSystem
+{
+public:
+	VSocketSystem();
+	~VSocketSystem();
+	VBool Initialised() {return m_status;};
+private:
+	VBool m_status;
+};
+
+// The main socket class
+class VSocket
+{
+public:
+  // Constructor/Destructor
+  VSocket();
+  virtual ~VSocket();
+
+  ////////////////////////////
+  // Socket implementation
+
+  // Create
+  //        Create a socket and attach it to this VSocket object
+  VBool Create();
+
+  // Shutdown
+  //        Shutdown the currently attached socket
+  VBool Shutdown();
+
+  // Close
+  //        Close the currently attached socket
+  VBool Close();
+
+  // Bind
+  //        Bind the attached socket to the specified port
+  //		If localOnly is VTrue then the socket is bound only
+  //        to the loopback adapter.
+  VBool Bind(const VCard port, const VBool localOnly=VFalse);
+
+  // Connect
+  //        Make a stream socket connection to the specified port
+  //        on the named machine.
+  VBool Connect(const VString address, const VCard port);
+
+  // Listen
+  //        Set the attached socket to listen for connections
+  VBool Listen();
+
+  // Accept
+  //        If the attached socket is set to listen then this
+  //        call blocks waiting for an incoming connection, then
+  //        returns a new socket object for the new connection
+  VSocket *Accept();
+
+  // GetPeerName
+  //        If the socket is connected then this returns the name
+  //        of the machine to which it is connected.
+  //        This string MUST be copied before the next socket call...
+  VString GetPeerName();
+
+  // GetSockName
+  //		If the socket exists then the name of the local machine
+  //		is returned.  This string MUST be copied before the next
+  //		socket call!
+  VString GetSockName();
+
+  // Resolve
+  //        Uses the Winsock API to resolve the supplied DNS name to
+  //        an IP address and returns it as an Int32
+  static VCard32 Resolve(const VString name);
+
+  // SetTimeout
+  //        Sets the socket timeout on reads and writes.
+  VBool SetTimeout(VCard32 msecs);
+  VBool SetSendTimeout(VCard32 msecs);
+  VBool SetRecvTimeout(VCard32 msecs);
+  
+  // adzm 2010-08
+  VBool SetDefaultSocketOptions();
+
+  // adzm 2010-08
+  static void SetSocketKeepAliveTimeoutDefault(int timeout) { m_defaultSocketKeepAliveTimeout = timeout; }
+
+  bool GetPeerAddress(char *address, int size);
+
+  VBool Http_CreateConnect(const VString address);
+  SOCKET GetChannel() const { return (SOCKET) sock; }
+  // I/O routines
+#ifdef HTTP_SAMEPORT
+  // Check to see if the socket becomes readable within <to> msec.
+  // Added to support HTTP-via-RFB.
+  VBool ReadSelect(VCard to);
+#endif
+
+  // Send and Read return the number of bytes sent or recieved.
+  VInt Send(const char *buff, const VCard bufflen);
+  VInt SendQueued(const char *buff, const VCard bufflen);
+  VInt Read(char *buff, const VCard bufflen);
+
+  // SendExact and ReadExact attempt to send and recieve exactly
+  // the specified number of bytes.
+  VBool SendExact(const char *buff, const VCard bufflen);
+  VBool SendExact(const char *buff, const VCard bufflen, unsigned char msgType); // sf at 2002 - DSMPlugin
+  VBool SendExactQueue(const char *buff, const VCard bufflen);
+  //adzm 2010-09 - minimize packets. SendExact flushes the queue.
+  VBool SendExactQueue(const char *buff, const VCard bufflen, unsigned char msgType);
+  VBool ReadExact(char *buff, const VCard bufflen);
+  VBool ClearQueue();
+
+  // sf at 2002 - DSMPlugin
+  //adzm 2009-06-20
+  void SetDSMPluginPointer(CDSMPlugin* pDSMPlugin);
+  void EnableUsePlugin(bool fEnable) { m_fUsePlugin = fEnable;};
+  bool IsUsePluginEnabled(void) { return m_fUsePlugin;};
+  //adzm 2010-05-12 - dsmplugin config
+  void SetDSMPluginConfig(char* szDSMPluginConfig);
+  // adzm 2010-09
+  void SetPluginStreamingIn() { m_fPluginStreamingIn = true; }
+  void SetPluginStreamingOut() { m_fPluginStreamingOut = true; }
+  bool IsPluginStreamingIn(void) { return m_fPluginStreamingIn; }
+  bool IsPluginStreamingOut(void) { return m_fPluginStreamingOut; }
+
+  void SetWriteToNetRectBuffer(bool fEnable) {m_fWriteToNetRectBuf = fEnable;}; 
+  bool GetWriteToNetRectBuffer(void) {return m_fWriteToNetRectBuf;};
+  int  GetNetRectBufOffset(void) {return m_nNetRectBufOffset;};
+  void SetNetRectBufOffset(int nValue) {m_nNetRectBufOffset = nValue;};
+  BYTE* GetNetRectBuf(void) {return m_pNetRectBuf;};
+  void CheckNetRectBufferSize(int nBufSize);
+  VBool SendExactHTTP(const char *buff, const VCard bufflen);
+  VBool ReadExactHTTP(char *buff, const VCard bufflen);
+
+  //adzm 2010-05-10
+  IIntegratedPlugin* GetIntegratedPlugin() { return m_pIntegratedPluginInterface; };
+
+  //adzm 2010-08-01
+  DWORD GetLastSentTick() { return m_LastSentTick; };
+  IIntegratedPlugin* m_pIntegratedPluginInterface;
+
+
+  ////////////////////////////
+  // Internal structures
+protected:
+  // The internal socket id
+  int sock;	      
+
+  //adzm 2010-08-01
+  DWORD m_LastSentTick;
+
+  CDSMPlugin* m_pDSMPlugin; // sf at 2002 - DSMPlugin
+  //adzm 2009-06-20
+  IPlugin* m_pPluginInterface;
+  //adzm 2010-05-10
+  //IIntegratedPlugin* m_pIntegratedPluginInterface;
+  bool m_fUsePlugin;
+  bool m_fPluginStreamingIn; //adzm 2010-09
+  bool m_fPluginStreamingOut; //adzm 2010-09
+  omni_mutex m_TransMutex;
+  omni_mutex m_RestMutex;
+  omni_mutex m_CheckMutex;
+
+  //adzm 2009-06-20
+  BYTE* TransformBuffer(BYTE* pDataBuffer, int nDataLen, int* nTransformedDataLen);
+  BYTE* RestoreBufferStep1(BYTE* pDataBuffer, int nDataLen, int* nRestoredDataLen);
+  BYTE* RestoreBufferStep2(BYTE* pDataBuffer, int nDataLen, int* nRestoredDataLen);
+
+  // All this should be private with accessors -> later
+  BYTE* m_pNetRectBuf;
+  bool m_fWriteToNetRectBuf;
+  int m_nNetRectBufOffset;
+  int m_nNetRectBufSize;
+
+  char queuebuffer[9000];
+  DWORD queuebuffersize;
+
+  // adzm 2010-08
+  static int m_defaultSocketKeepAliveTimeout;
+
+};
+
+#endif // _ATT_VSOCKET_DEFINED
diff --git a/ica/win32/winvnc/winvnc/vtypes.h b/ica/win32/winvnc/winvnc/vtypes.h
new file mode 100644
index 0000000..52616cf
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/vtypes.h
@@ -0,0 +1,87 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+// VTypes.h
+
+// RFB V3.0
+
+// Datatypes used by the VGui system
+
+#if (!defined(_ATT_VTYPES_DEFINED))
+#define _ATT_VTYPES_DEFINED
+
+////////////////////////////
+// Numeric data types
+
+////////////////////////////
+// Fixed size (derived from rfb.h)
+
+typedef unsigned int VCard32;
+typedef unsigned short VCard16;
+typedef unsigned char VCard8;
+typedef int VInt32;
+typedef short VInt16;
+typedef char VInt8;
+
+////////////////////////////
+// Variable size
+//		These will always be at least as big as the largest
+//		fixed-size data-type
+
+typedef VCard32 VCard;
+typedef VInt32 VInt;
+
+////////////////////////////
+// Useful functions on integers
+
+static inline VInt Max(VInt x, VInt y) {if (x>y) return x; else return y;}
+static inline VInt Min(VInt x, VInt y) {if (x<y) return x; else return y;}
+
+////////////////////////////
+// Boolean
+
+typedef int VBool;
+const VBool VTrue = -1;
+const VBool VFalse = 0;
+
+////////////////////////////
+// Others
+
+typedef char VChar;
+#if (!defined(NULL))
+#define NULL 0
+#endif
+
+////////////////////////////
+// Compound data types
+
+// #include "rfbgui/VPoint.h"
+// #include "rfbgui/VRect.h"
+typedef VChar * VString;
+
+#endif // _ATT_VTYPES_DEFINED
+
+
+
+
+
diff --git a/ica/win32/winvnc/winvnc/winvnc.cpp b/ica/win32/winvnc/winvnc/winvnc.cpp
new file mode 100644
index 0000000..2e6d48e
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvnc.cpp
@@ -0,0 +1,1129 @@
+//  Copyright (C) 2007 Ultr at VNC Team Members. All Rights Reserved.
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+// WinVNC.cpp
+
+// 24/11/97		WEZ
+
+// WinMain and main WndProc for the new version of WinVNC
+
+////////////////////////////
+// System headers
+#include "stdhdrs.h"
+
+#include "mmsystem.h"
+
+////////////////////////////
+// Custom headers
+#include "vsocket.h"
+#include "winvnc.h"
+
+#include "vncserver.h"
+#include "vncmenu.h"
+#include "vncinsthandler.h"
+#include "vncservice.h"
+///unload driver
+#include "vncOSVersion.h"
+#include "videodriver.h"
+
+#ifdef IPP
+void InitIpp();
+#endif
+
+#define LOCALIZATION_MESSAGES   // ACT: full declaration instead on extern ones
+#include "Localization.h" // Act : add localization on messages
+
+
+
+// Application instance and name
+HINSTANCE	hAppInstance;
+const char	*szAppName = "WinVNC";
+DWORD		mainthreadId;
+BOOL		fRunningFromExternalService=false;
+
+//adzm 2009-06-20
+char* g_szRepeaterHost = NULL;
+
+// sf at 2007 - New shutdown order handling stuff (with uvnc_service)
+bool			fShutdownOrdered = false;
+static HANDLE		hShutdownEvent = NULL;
+HANDLE		hShutdownEventcad = NULL;
+MMRESULT			mmRes;
+
+void WRITETOLOG(char *szText, int size, DWORD *byteswritten, void *);
+
+
+//// Handle Old PostAdd message
+bool PostAddAutoConnectClient_bool=false;
+bool PostAddNewClient_bool=false;
+bool PostAddAutoConnectClient_bool_null=false;
+
+bool PostAddConnectClient_bool=false;
+bool PostAddConnectClient_bool_null=false;
+
+//adzm 2009-06-20
+bool PostAddNewRepeaterClient_bool=false;
+
+char pszId_char[20];
+VCard32 address_vcard;
+int port_int;
+
+int start_service(char *cmd);
+int install_service(void);
+int uninstall_service(void);
+extern char service_name[];
+
+void Real_stop_service();
+void Set_stop_service_as_admin();
+void Real_start_service();
+void Set_start_service_as_admin();
+void Real_settings(char *mycommand);
+void Set_settings_as_admin(char *mycommand);
+void Set_uninstall_service_as_admin();
+void Set_install_service_as_admin();
+void winvncSecurityEditorHelper_as_admin();
+bool GetServiceName(TCHAR *pszAppPath, TCHAR *pszServiceName);
+void Open_homepage();
+void Open_forum();
+
+// [v1.0.2-jp1 fix] Load resouce from dll
+HINSTANCE	hInstResDLL;
+BOOL SPECIAL_SC_EXIT=false;
+BOOL SPECIAL_SC_PROMPT=false;
+BOOL G_HTTP;
+BOOL multi=false;
+
+void Enable_softwareCAD_elevated();
+void Enable_softwareCAD();
+void Reboot_in_safemode_elevated();
+void Reboot_in_safemode();
+void delete_softwareCAD_elevated();
+void delete_softwareCAD();
+void Reboot_with_force_reboot_elevated();
+void Reboot_with_force_reboot();
+
+//HACK to use name in autoreconnect from service with dyn dns
+char dnsname[255];
+
+// winvnc.exe will also be used for helper exe
+// This allow us to minimize the number of seperate exe
+bool
+Myinit(HINSTANCE hInstance)
+{
+	SetOSVersion();
+	setbuf(stderr, 0);
+
+	// [v1.0.2-jp1 fix] Load resouce from dll
+
+	hInstResDLL = NULL;
+
+	 //limit the vnclang.dll searchpath to avoid
+	char szCurrentDir[MAX_PATH];
+	char szCurrentDir_vnclangdll[MAX_PATH];
+	if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+	{
+		char* p = strrchr(szCurrentDir, '\\');
+		*p = '\0';
+	}
+	strcpy (szCurrentDir_vnclangdll,szCurrentDir);
+	strcat (szCurrentDir_vnclangdll,"\\");
+	strcat (szCurrentDir_vnclangdll,"vnclang_server.dll");
+
+	hInstResDLL = LoadLibrary(szCurrentDir_vnclangdll);
+
+	if (hInstResDLL == NULL)
+	{
+		hInstResDLL = hInstance;
+	}
+//	RegisterLinkLabel(hInstResDLL);
+
+    //Load all messages from ressource file
+    Load_Localization(hInstResDLL) ;
+	vnclog.SetFile();
+//	vnclog.SetMode(2);
+//	vnclog.SetLevel(10);
+
+#ifdef _DEBUG
+	{
+		// Get current flag
+		int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
+
+		// Turn on leak-checking bit
+		tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
+
+		// Set flag to the new value
+		_CrtSetDbgFlag( tmpFlag );
+	}
+#endif
+
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	// Save the application instance and main thread id
+	hAppInstance = hInstance;
+	mainthreadId = GetCurrentThreadId();
+
+
+	// Initialise the VSocket system
+	VSocketSystem socksys;
+	if (!socksys.Initialised())
+	{
+		MessageBoxSecure(NULL, sz_ID_FAILED_INIT, szAppName, MB_OK);
+		return 0;
+	}
+#endif
+	return 1;
+}
+//#define CRASHRPT
+#ifdef CRASHRPT
+#include "C:/DATA/crash/crashrpt/include/crashrpt.h"
+#pragma comment(lib, "C:/DATA/crash/crashrpt/lib/crashrpt")
+#endif
+
+// WinMain parses the command line and either calls the main App
+// routine or, under NT, the main service routine.
+int WINAPI WinMainVNC(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
+{
+	// make vnc last service to stop
+	SetProcessShutdownParameters(0x100,false);
+	// handle dpi on aero
+	HMODULE hUser32 = LoadLibrary(_T("user32.dll"));
+	typedef BOOL (*SetProcessDPIAwareFunc)();
+	SetProcessDPIAwareFunc setDPIAware = (SetProcessDPIAwareFunc)GetProcAddress(hUser32, "SetProcessDPIAware");
+	if (setDPIAware) setDPIAware();
+	FreeLibrary(hUser32);
+
+#ifdef IPP
+	InitIpp();
+#endif
+#ifdef CRASHRPT
+	Install(NULL, _T("ultravnc at skynet.be"), _T(""));
+#endif
+	bool Injected_autoreconnect=false;
+	SPECIAL_SC_EXIT=false;
+	SPECIAL_SC_PROMPT=false;
+	SetOSVersion();
+	setbuf(stderr, 0);
+
+	// [v1.0.2-jp1 fix] Load resouce from dll
+	hInstResDLL = NULL;
+
+	 //limit the vnclang.dll searchpath to avoid
+	char szCurrentDir[MAX_PATH];
+	char szCurrentDir_vnclangdll[MAX_PATH];
+	if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH))
+	{
+		char* p = strrchr(szCurrentDir, '\\');
+		*p = '\0';
+	}
+	strcpy (szCurrentDir_vnclangdll,szCurrentDir);
+	strcat (szCurrentDir_vnclangdll,"\\");
+	strcat (szCurrentDir_vnclangdll,"vnclang_server.dll");
+
+	hInstResDLL = LoadLibrary(szCurrentDir_vnclangdll);
+
+	if (hInstResDLL == NULL)
+	{
+		hInstResDLL = hInstance;
+	}
+//	RegisterLinkLabel(hInstResDLL);
+
+    //Load all messages from ressource file
+    Load_Localization(hInstResDLL) ;
+
+	char WORKDIR[MAX_PATH];
+	if (GetModuleFileName(NULL, WORKDIR, MAX_PATH))
+		{
+		char* p = strrchr(WORKDIR, '\\');
+		if (p == NULL) return 0;
+		*p = '\0';
+		}
+    char progname[MAX_PATH];
+    strncpy(progname, WORKDIR, sizeof progname);
+    progname[MAX_PATH - 1] = 0;
+	//strcat(WORKDIR,"\\");
+	//strcat(WORKDIR,"WinVNC.log");
+
+	vnclog.SetFile();
+//	vnclog.SetMode(2);
+//	vnclog.SetLevel(10);
+
+#ifdef _DEBUG
+	{
+		// Get current flag
+		int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
+
+		// Turn on leak-checking bit
+		tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
+
+		// Set flag to the new value
+		_CrtSetDbgFlag( tmpFlag );
+	}
+#endif
+
+	// Save the application instance and main thread id
+	hAppInstance = hInstance;
+	mainthreadId = GetCurrentThreadId();
+
+
+	// Initialise the VSocket system
+	VSocketSystem socksys;
+	if (!socksys.Initialised())
+	{
+		MessageBoxSecure(NULL, sz_ID_FAILED_INIT, szAppName, MB_OK);
+		return 0;
+	}
+    // look up the current service name in the registry.
+    GetServiceName(progname, service_name);
+
+	// Make the command-line lowercase and parse it
+	size_t i;
+	for (i = 0; i < strlen(szCmdLine); i++)
+	{
+		szCmdLine[i] = tolower(szCmdLine[i]);
+	} 
+	BOOL argfound = FALSE;
+	for (i = 0; i < strlen(szCmdLine); i++)
+	{
+		if (szCmdLine[i] <= ' ')
+			continue;
+		argfound = TRUE;
+
+		if (strncmp(&szCmdLine[i], winvncSettingshelper, strlen(winvncSettingshelper)) == 0)
+		{
+			Sleep(3000);
+			char mycommand[MAX_PATH];
+			i+=strlen(winvncSettingshelper);
+			strcpy( mycommand, &(szCmdLine[i+1]));
+			Set_settings_as_admin(mycommand);
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncStopserviceHelper, strlen(winvncStopserviceHelper)) == 0)
+		{
+			Sleep(3000);
+			Set_stop_service_as_admin();
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncKill, strlen(winvncKill)) == 0)
+		{
+			static HANDLE		hShutdownEventTmp;
+			hShutdownEventTmp = OpenEvent(EVENT_ALL_ACCESS, FALSE, "Global\\SessionEventUltra");
+			SetEvent(hShutdownEventTmp);
+			CloseHandle(hShutdownEventTmp);
+
+			//adzm 2010-02-10 - Finds the appropriate VNC window for any process. Sends this message to all of them!
+			HWND hservwnd = NULL;
+			do {
+				if (hservwnd!=NULL)
+				{
+					PostMessage(hservwnd, WM_COMMAND, 40002, 0);
+					PostMessage(hservwnd, WM_CLOSE, 0, 0);
+				}
+				hservwnd = FindWinVNCWindow(false);
+			} while (hservwnd!=NULL);
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncopenhomepage, strlen(winvncopenhomepage)) == 0)
+		{
+			Open_homepage();
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncopenforum, strlen(winvncopenforum)) == 0)
+		{
+			Open_forum();
+			return 0;
+		}
+
+
+		if (strncmp(&szCmdLine[i], winvncStartserviceHelper, strlen(winvncStartserviceHelper)) == 0)
+		{
+			Sleep(3000);
+			Set_start_service_as_admin();
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncInstallServiceHelper, strlen(winvncInstallServiceHelper)) == 0)
+			{
+				//Sleeps are realy needed, else runas fails...
+				Sleep(3000);
+				Set_install_service_as_admin();
+				return 0;
+			}
+		if (strncmp(&szCmdLine[i], winvncUnInstallServiceHelper, strlen(winvncUnInstallServiceHelper)) == 0)
+			{
+				Sleep(3000);
+				Set_uninstall_service_as_admin();
+				return 0;
+			}
+		if (strncmp(&szCmdLine[i], winvncSoftwarecadHelper, strlen(winvncSoftwarecadHelper)) == 0)
+			{
+				Sleep(3000);
+				Enable_softwareCAD_elevated();
+				return 0;
+			}
+		if (strncmp(&szCmdLine[i], winvncdelSoftwarecadHelper, strlen(winvncdelSoftwarecadHelper)) == 0)
+			{
+				Sleep(3000);
+				delete_softwareCAD_elevated();
+				return 0;
+			}
+		if (strncmp(&szCmdLine[i], winvncRebootSafeHelper, strlen(winvncRebootSafeHelper)) == 0)
+			{
+				Sleep(3000);
+				Reboot_in_safemode_elevated();
+				return 0;
+			}
+
+		if (strncmp(&szCmdLine[i], winvncRebootForceHelper, strlen(winvncRebootForceHelper)) == 0)
+			{
+				Sleep(3000);
+				Reboot_with_force_reboot_elevated();
+				return 0;
+			}
+
+		if (strncmp(&szCmdLine[i], winvncSecurityEditorHelper, strlen(winvncSecurityEditorHelper)) == 0)
+			{
+				Sleep(3000);
+				winvncSecurityEditorHelper_as_admin();
+				return 0;
+			}
+		if (strncmp(&szCmdLine[i], winvncSecurityEditor, strlen(winvncSecurityEditor)) == 0)
+			{
+			    typedef void (*vncEditSecurityFn) (HWND hwnd, HINSTANCE hInstance);
+				vncEditSecurityFn vncEditSecurity = 0;
+				char szCurrentDir[MAX_PATH];
+					if (GetModuleFileName(NULL, szCurrentDir, MAX_PATH)) {
+						char* p = strrchr(szCurrentDir, '\\');
+						*p = '\0';
+						strcat (szCurrentDir,"\\authSSP.dll");
+					}
+					HMODULE hModule = LoadLibrary(szCurrentDir);
+					if (hModule) {
+						vncEditSecurity = (vncEditSecurityFn) GetProcAddress(hModule, "vncEditSecurity");
+						/*HRESULT hr = */CoInitialize(NULL);
+						vncEditSecurity(NULL, hAppInstance);
+						CoUninitialize();
+						FreeLibrary(hModule);
+					}
+				return 0;
+			}
+
+		if (strncmp(&szCmdLine[i], winvncSettings, strlen(winvncSettings)) == 0)
+		{
+			char mycommand[MAX_PATH];
+			i+=strlen(winvncSettings);
+			strcpy( mycommand, &(szCmdLine[i+1]));
+			Real_settings(mycommand);
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncSoftwarecad, strlen(winvncSoftwarecad)) == 0)
+		{
+			Enable_softwareCAD();
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncdelSoftwarecad, strlen(winvncdelSoftwarecad)) == 0)
+		{
+			delete_softwareCAD();
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncRebootSafe, strlen(winvncRebootSafe)) == 0)
+		{
+			Reboot_in_safemode();
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncRebootForce, strlen(winvncRebootForce)) == 0)
+		{
+			Reboot_with_force_reboot();
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncStopservice, strlen(winvncStopservice)) == 0)
+		{
+			Real_stop_service();
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncStartservice, strlen(winvncStartservice)) == 0)
+		{
+			Real_start_service();
+			return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncInstallService, strlen(winvncInstallService)) == 0)
+			{
+                // rest of command line service name, if provided.
+                char *pServiceName = &szCmdLine[i];
+                // skip over command switch, find next whitepace
+                while (*pServiceName && !isspace(*(unsigned char*)pServiceName))
+                    ++pServiceName;
+
+                // skip past whitespace to service name
+                while (*pServiceName && isspace(*(unsigned char*)pServiceName))
+                    ++pServiceName;
+
+                // strip off any quotes
+                if (*pServiceName && *pServiceName == '\"')
+                    ++pServiceName;
+
+                if (*pServiceName)
+                {
+                    // look for trailing quote, if found, terminate the string there.
+                    char *pQuote = pServiceName;
+                    pQuote = strrchr(pServiceName, '\"');
+                    if (pQuote)
+                        *pQuote = 0;
+                }
+                // if a service name is supplied, and it differs except in case from
+                // the default, use the supplied service name instead
+                if (*pServiceName && (_strcmpi(pServiceName, service_name) != 0))
+                {
+                    strncpy(service_name, pServiceName, 256);
+                    service_name[255] = 0;
+                }
+				install_service();
+				Sleep(2000);
+				char command[MAX_PATH + 32]; // 29 January 2008 jdp
+                _snprintf(command, sizeof command, "net start \"%s\"", service_name);
+				WinExec(command,SW_HIDE);
+				return 0;
+			}
+		if (strncmp(&szCmdLine[i], winvncUnInstallService, strlen(winvncUnInstallService)) == 0)
+			{
+				char command[MAX_PATH + 32]; // 29 January 2008 jdp 
+                // rest of command line service name, if provided.
+                char *pServiceName = &szCmdLine[i];
+                // skip over command switch, find next whitepace
+                while (*pServiceName && !isspace(*(unsigned char*)pServiceName))
+                    ++pServiceName;
+
+                // skip past whitespace to service name
+                while (*pServiceName && isspace(*(unsigned char*)pServiceName))
+                    ++pServiceName;
+
+                // strip off any quotes
+                if (*pServiceName && *pServiceName == '\"')
+                    ++pServiceName;
+
+                if (*pServiceName)
+                {
+                    // look for trailing quote, if found, terminate the string there.
+                    char *pQuote = pServiceName;
+                    pQuote = strrchr(pServiceName, '\"');
+                    if (pQuote)
+                        *pQuote = 0;
+                }
+
+                if (*pServiceName && (_strcmpi(pServiceName, service_name) != 0))
+                {
+                    strncpy(service_name, pServiceName, 256);
+                    service_name[255] = 0;
+                }
+                _snprintf(command, sizeof command, "net stop \"%s\"", service_name);
+				WinExec(command,SW_HIDE);
+				uninstall_service();
+				return 0;
+			}
+
+
+
+		if (strncmp(&szCmdLine[i], winvncRunService, strlen(winvncRunService)) == 0)
+		{
+			//Run as service
+			if (!Myinit(hInstance)) return 0;
+			fRunningFromExternalService = true;
+			vncService::RunningFromExternalService(true); 
+			return WinVNCAppMain();
+		}
+
+		if (strncmp(&szCmdLine[i], winvncStartService, strlen(winvncStartService)) == 0)
+		{
+		start_service(szCmdLine);
+		return 0;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncRunAsUserApp, strlen(winvncRunAsUserApp)) == 0)
+		{
+			// WinVNC is being run as a user-level program
+			if (!Myinit(hInstance)) return 0;
+			return WinVNCAppMain();
+		}
+
+		if (strncmp(&szCmdLine[i], winvncSCexit, strlen(winvncSCexit)) == 0)
+		{
+			SPECIAL_SC_EXIT=true;
+			i+=strlen(winvncSCexit);
+			continue;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncSCprompt, strlen(winvncSCprompt)) == 0)
+		{
+			SPECIAL_SC_PROMPT=true;
+			i+=strlen(winvncSCprompt);
+			continue;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncmulti, strlen(winvncmulti)) == 0)
+		{
+			multi=true;
+			i+=strlen(winvncmulti);
+			continue;
+		}
+
+		if (strncmp(&szCmdLine[i], winvnchttp, strlen(winvnchttp)) == 0)
+		{
+			G_HTTP=true;
+			i+=strlen(winvnchttp);
+			continue;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncStopReconnect, strlen(winvncStopReconnect)) == 0)
+		{
+			i+=strlen(winvncStopReconnect);
+			vncService::PostAddStopConnectClientAll();
+			continue;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncAutoReconnect, strlen(winvncAutoReconnect)) == 0)
+		{
+			// Note that this "autoreconnect" param MUST be BEFORE the "connect" one
+			// on the command line !
+			// wa at 2005 -- added support for the AutoReconnectId
+			i+=strlen(winvncAutoReconnect);
+			Injected_autoreconnect=true;
+			int start, end;
+			char* pszId = NULL;
+			start = i;
+			// skip any spaces and grab the parameter
+			while (szCmdLine[start] <= ' ' && szCmdLine[start] != 0) start++;
+			
+			if ( strncmp( &szCmdLine[start], winvncAutoReconnectId, strlen(winvncAutoReconnectId) ) == 0 )
+			{
+				end = start;
+				while (szCmdLine[end] > ' ') end++;
+				
+				pszId = new char[ end - start + 1 ];
+				if (pszId != 0) 
+				{
+					strncpy( pszId, &(szCmdLine[start]), end - start );
+					pszId[ end - start ] = 0;
+					pszId = _strupr( pszId );
+				}
+//multiple spaces between autoreconnect and id 
+				i = end;
+			}// end of condition we found the ID: parameter
+			
+			// NOTE:  id must be NULL or the ID:???? (pointer will get deleted when message is processed)
+			// We can not contact a runnning service, permissions, so we must store the settings
+			// and process until the vncmenu has been started
+
+			if (!vncService::PostAddAutoConnectClient( pszId ))
+			{
+				PostAddAutoConnectClient_bool=true;
+				if (pszId==NULL)
+				{
+					PostAddAutoConnectClient_bool_null=true;
+					PostAddAutoConnectClient_bool=false;
+				}
+				else
+				{
+					strcpy(pszId_char,pszId);
+					//memory leak fix
+					delete [] pszId;
+				}
+			}
+			continue;
+		}
+
+			
+		if ( strncmp( &szCmdLine[i], winvncReconnectId, strlen(winvncReconnectId) ) == 0 )
+			{
+				i+=strlen("-");
+				int start, end;
+				char* pszId = NULL;
+				start = i;
+				end = start;
+				while (szCmdLine[end] > ' ') end++;
+
+				pszId = new char[ end - start + 1 ];
+				if (pszId != 0) 
+				{
+					strncpy( pszId, &(szCmdLine[start]), end - start );
+					pszId[ end - start ] = 0;
+					pszId = _strupr( pszId );
+				}
+				i = end;
+			if (!vncService::PostAddConnectClient( pszId ))
+			{
+				PostAddConnectClient_bool=true;
+				if (pszId==NULL)
+				{
+					PostAddConnectClient_bool_null=true;
+					PostAddConnectClient_bool=false;
+				}
+				else
+				{
+					strcpy(pszId_char,pszId);
+					//memory leak fix
+					delete [] pszId;
+				}
+				}
+			continue;
+		}
+
+		if (strncmp(&szCmdLine[i], winvncConnect, strlen(winvncConnect)) == 0)
+		{
+			if (!Injected_autoreconnect)
+			{
+				vncService::PostAddStopConnectClient();
+			}
+			// Add a new client to an existing copy of winvnc
+			i+=strlen(winvncConnect);
+
+			// First, we have to parse the command line to get the filename to use
+			int start, end;
+			start=i;
+			while (szCmdLine[start] <= ' ' && szCmdLine[start] != 0) start++;
+			end = start;
+			while (szCmdLine[end] > ' ') end++;
+
+			// Was there a hostname (and optionally a port number) given?
+			if (end-start > 0)
+			{
+				char *name = new char[end-start+1];
+				if (name != 0) {
+					strncpy(name, &(szCmdLine[start]), end-start);
+					name[end-start] = 0;
+
+					int port = INCOMING_PORT_OFFSET;
+					char *portp = strchr(name, ':');
+					if (portp) {
+						*portp++ = '\0';
+						if (*portp == ':') {
+							port = atoi(++portp);	// Port number after "::"
+						} else {
+							port = atoi(portp);	// Display number after ":"
+						}
+					}
+					vnclog.Print(LL_STATE, VNCLOG("test... %s %d\n"),name,port);
+					strcpy(dnsname,name);
+					VCard32 address = VSocket::Resolve(name);
+					delete [] name;
+					if (address != 0) {
+						// Post the IP address to the server
+						// We can not contact a runnning service, permissions, so we must store the settings
+						// and process until the vncmenu has been started
+						vnclog.Print(LL_INTERR, VNCLOG("PostAddNewClient III \n"));
+						if (!vncService::PostAddNewClientInit(address, port))
+						{
+						PostAddNewClient_bool=true;
+						port_int=port;
+						address_vcard=address;
+						}
+					}
+					else
+					{
+						//ask for host,port
+						PostAddNewClient_bool=true;
+						port_int=0;
+						address_vcard=0;
+						Sleep(2000);
+						Beep(200,1000);
+						return 0;
+					}
+				}
+				i=end;
+				continue;
+			}
+			else 
+			{
+				// Tell the server to show the Add New Client dialog
+				// We can not contact a runnning service, permissions, so we must store the settings
+				// and process until the vncmenu has been started
+				vnclog.Print(LL_INTERR, VNCLOG("PostAddNewClient IIII\n"));
+				if (!vncService::PostAddNewClient(0, 0))
+				{
+				PostAddNewClient_bool=true;
+				port_int=0;
+				address_vcard=0;
+				}
+			}
+			continue;
+		}
+
+		//adzm 2009-06-20
+		if (strncmp(&szCmdLine[i], winvncRepeater, strlen(winvncRepeater)) == 0)
+		{
+			// set the default repeater host
+			i+=strlen(winvncRepeater);
+
+			// First, we have to parse the command line to get the host to use
+			int start, end;
+			start=i;
+			while (szCmdLine[start] <= ' ' && szCmdLine[start] != 0) start++;
+			end = start;
+			while (szCmdLine[end] > ' ') end++;
+
+			// Was there a hostname (and optionally a port number) given?
+			if (end-start > 0)
+			{
+				if (g_szRepeaterHost) {
+					delete[] g_szRepeaterHost;
+					g_szRepeaterHost = NULL;
+				}
+				g_szRepeaterHost = new char[end-start+1];
+				if (g_szRepeaterHost != 0) {
+					strncpy(g_szRepeaterHost, &(szCmdLine[start]), end-start);
+					g_szRepeaterHost[end-start] = 0;
+					
+					// We can not contact a runnning service, permissions, so we must store the settings
+					// and process until the vncmenu has been started
+					vnclog.Print(LL_INTERR, VNCLOG("PostAddNewRepeaterClient I\n"));
+					if (!vncService::PostAddNewRepeaterClient())
+					{
+						PostAddNewRepeaterClient_bool=true;
+						port_int=0;
+						address_vcard=0;
+					}
+				}
+				i=end;
+				continue;
+			}
+			else 
+			{
+				/*
+				// Tell the server to show the Add New Client dialog
+				// We can not contact a runnning service, permissions, so we must store the settings
+				// and process until the vncmenu has been started
+				vnclog.Print(LL_INTERR, VNCLOG("PostAddNewClient IIII\n"));
+				if (!vncService::PostAddNewClient(0, 0))
+				{
+				PostAddNewClient_bool=true;
+				port_int=0;
+				address_vcard=0;
+				}
+				*/
+			}
+			continue;
+		}
+
+		// Either the user gave the -help option or there is something odd on the cmd-line!
+
+		// Show the usage dialog
+		MessageBoxSecure(NULL, winvncUsageText, sz_ID_WINVNC_USAGE, MB_OK | MB_ICONINFORMATION);
+		break;
+	};
+
+	// If no arguments were given then just run
+	if (!argfound)
+	{
+		if (!Myinit(hInstance)) return 0;
+		return WinVNCAppMain();
+	}
+
+	return 0;
+}
+
+
+// rdv&sf at 2007 - New TrayIcon impuDEsktop/impersonation thread stuff
+
+DWORD WINAPI imp_desktop_thread(LPVOID lpParam)
+{
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	vncServer *server = (vncServer *)lpParam;
+#endif
+	HDESK desktop;
+	//vnclog.Print(LL_INTERR, VNCLOG("SelectDesktop \n"));
+	//vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop2 NULL\n"));
+	desktop = OpenInputDesktop(0, FALSE,
+								DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
+								DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
+								DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
+								DESKTOP_SWITCHDESKTOP | GENERIC_WRITE
+								);
+
+	if (desktop == NULL)
+		vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop Error \n"));
+	else 
+		vnclog.Print(LL_INTERR, VNCLOG("OpenInputdesktop OK\n"));
+
+	HDESK old_desktop = GetThreadDesktop(GetCurrentThreadId());
+	DWORD dummy;
+
+	char new_name[256];
+
+	if (!GetUserObjectInformation(desktop, UOI_NAME, &new_name, 256, &dummy))
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("!GetUserObjectInformation \n"));
+	}
+
+	vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK to %s (%x) from %x\n"), new_name, desktop, old_desktop);
+
+	if (!SetThreadDesktop(desktop))
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("SelectHDESK:!SetThreadDesktop \n"));
+	}
+
+//	ImpersonateCurrentUser_();
+
+	char m_username[UNLEN+1];
+	HWINSTA station = GetProcessWindowStation();
+	if (station != NULL)
+	{
+		DWORD usersize;
+		GetUserObjectInformation(station, UOI_USER_SID, NULL, 0, &usersize);
+		SetLastError(0);
+		if (usersize != 0)
+		{
+			DWORD length = sizeof(m_username);
+			if (GetUserName(m_username, &length) == 0)
+			{
+				UINT error = GetLastError();
+				if (error != ERROR_NOT_LOGGED_ON)
+				{
+					vnclog.Print(LL_INTERR, VNCLOG("getusername error %d\n"), GetLastError());
+					SetThreadDesktop(old_desktop);
+                	CloseDesktop(desktop);
+					Sleep(500);
+					return FALSE;
+				}
+			}
+		}
+	}
+    vnclog.Print(LL_INTERR, VNCLOG("Username %s \n"),m_username);
+
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	// Create tray icon and menu
+	vncMenu *menu = new vncMenu(server);
+	if (menu == NULL)
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("failed to create tray menu\n"));
+		PostQuitMessage(0);
+	}
+#endif
+
+	// This is a good spot to handle the old PostAdd messages
+	if (PostAddAutoConnectClient_bool)
+		vncService::PostAddAutoConnectClient( pszId_char );
+	if (PostAddAutoConnectClient_bool_null)
+		vncService::PostAddAutoConnectClient( NULL );
+
+	if (PostAddConnectClient_bool)
+		vncService::PostAddConnectClient( pszId_char );
+	if (PostAddConnectClient_bool_null)
+		vncService::PostAddConnectClient( NULL );
+
+
+	if (PostAddNewClient_bool)
+	{
+		PostAddNewClient_bool=false;
+		vnclog.Print(LL_INTERR, VNCLOG("PostAddNewClient IIIII\n"));
+		vncService::PostAddNewClient(address_vcard, port_int);
+	}
+	//adzm 2009-06-20
+	if (PostAddNewRepeaterClient_bool)
+	{
+		PostAddNewRepeaterClient_bool=false;
+		vnclog.Print(LL_INTERR, VNCLOG("PostAddNewRepeaterClient II\n"));
+		vncService::PostAddNewRepeaterClient();
+	}
+	bool Runonce=false;
+	MSG msg;
+	while (GetMessage(&msg,0,0,0) != 0)
+	{
+		TranslateMessage(&msg);
+		DispatchMessage(&msg);
+		if (fShutdownOrdered && !Runonce)
+		{
+			Runonce=true;
+#ifndef ULTRAVNC_ITALC_SUPPORT
+			menu->Shutdown(true);
+#endif
+		}
+	}
+
+#ifndef ULTRAVNC_ITALC_SUPPORT
+	// sf at 2007 - Close all (vncMenu,tray icon, connections...)
+
+	if (menu != NULL)
+		delete menu;
+#endif
+
+	//vnclog.Print(LL_INTERR, VNCLOG("GetMessage stop \n"));
+	SetThreadDesktop(old_desktop);
+	CloseDesktop(desktop);
+//	RevertToSelf();
+	return 0;
+
+}
+
+
+// sf at 2007 - For now we use a mmtimer to test the shutdown event periodically
+// Maybe there's a less rude method...
+void CALLBACK fpTimer(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
+{
+	if (hShutdownEvent)
+	{
+		// vnclog.Print(LL_INTERR, VNCLOG("****************** SDTimer tic\n"));
+		DWORD result=WaitForSingleObject(hShutdownEvent, 0);
+		if (WAIT_OBJECT_0==result)
+		{
+			ResetEvent(hShutdownEvent);
+			fShutdownOrdered = true;
+			vnclog.Print(LL_INTERR, VNCLOG("****************** WaitForSingleObject - Shutdown server\n"));
+		}
+	}
+}
+
+void InitSDTimer()
+{
+	if (mmRes != (MMRESULT)-1) return;
+	vnclog.Print(LL_INTINFO, VNCLOG("****************** Init SDTimer\n"));
+	mmRes = timeSetEvent( 2000, 0, (LPTIMECALLBACK)fpTimer, 0, TIME_PERIODIC );
+}
+
+
+void KillSDTimer()
+{
+	vnclog.Print(LL_INTINFO, VNCLOG("****************** Kill SDTimer\n"));
+	timeKillEvent(mmRes);
+	mmRes = -1;
+}
+
+
+
+// This is the main routine for WinVNC when running as an application
+// (under Windows 95 or Windows NT)
+// Under NT, WinVNC can also run as a service.  The WinVNCServerMain routine,
+// defined in the vncService header, is used instead when running as a service.
+
+
+int WinVNCAppMain()
+{
+	SetOSVersion();
+	vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - WinVNCAPPMain\n"));
+#ifdef CRASH_ENABLED
+	LPVOID lpvState = Install(NULL,  "rudi.de.vos at skynet.be", "UltraVnc");
+#endif
+
+	// Set this process to be the last application to be shut down.
+	// Check for previous instances of WinVNC!
+	vncInstHandler *instancehan=new vncInstHandler;
+	if (!multi) // this allow to overwrite the multiple instance check
+	{
+		if (!instancehan->Init())
+		{	
+    		vnclog.Print(LL_ERROR, VNCLOG("%s -- exiting\n"), sz_ID_ANOTHER_INST);
+			// We don't allow multiple instances!
+			/*if (!fRunningFromExternalService)
+				MessageBoxSecure(NULL, sz_ID_ANOTHER_INST, szAppName, MB_OK);*/
+			Sleep( 5000 );
+			return 0;
+		}
+	}
+
+	// Initialise the VSocket system
+	VSocketSystem socksys;
+	if (!socksys.Initialised())
+	{
+		MessageBoxSecure(NULL, sz_ID_FAILED_INIT, szAppName, MB_OK);
+		return 0;
+	}
+
+	//vnclog.Print(LL_INTINFO, VNCLOG("***** DBG - Previous instance checked - Trying to create server\n"));
+	// CREATE SERVER
+	vncServer server;
+
+	// Set the name and port number
+	server.SetName(szAppName);
+	server.SockConnect( TRUE );
+	vnclog.Print(LL_STATE, VNCLOG("server created ok\n"));
+	///uninstall driver before cont
+	
+	// sf at 2007 - Set Application0 special mode
+	server.RunningFromExternalService(fRunningFromExternalService);
+
+	// Create tray icon and menu
+	vncMenu *menu = new vncMenu(&server);
+	if (menu == NULL)
+	{
+		vnclog.Print(LL_INTERR, VNCLOG("failed to create tray menu\n"));
+		PostQuitMessage(0);
+	}
+
+
+	// sf at 2007 - New impersonation thread stuff for tray icon & menu
+	// Subscribe to shutdown event
+	hShutdownEvent = OpenEvent(EVENT_ALL_ACCESS, FALSE, "Global\\SessionEventUltra");
+	hShutdownEventcad = OpenEvent(EVENT_MODIFY_STATE, FALSE, "Global\\SessionEventUltraCad");
+	if (hShutdownEvent) ResetEvent(hShutdownEvent);
+	vnclog.Print(LL_STATE, VNCLOG("***************** SDEvent created \n"));
+	// Create the timer that looks periodicaly for shutdown event
+	mmRes = -1;
+	InitSDTimer();
+
+	while ( !fShutdownOrdered)
+	{
+#ifdef ULTRAVNC_ITALC_SUPPORT
+		DWORD result = WaitForSingleObject( hShutdownEvent, INFINITE );
+		if( WAIT_OBJECT_0 == result )
+		{
+			fShutdownOrdered = true;
+			server.KillAuthClients();
+		}
+#else
+		//vnclog.Print(LL_STATE, VNCLOG("################## Creating Imp Thread : %d \n"), nn);
+		HANDLE threadHandle;
+		DWORD dwTId;
+		threadHandle = CreateThread(NULL, 0, imp_desktop_thread, &server, 0, &dwTId);
+
+		if (threadHandle)  
+		{
+			WaitForSingleObject( threadHandle, INFINITE );
+			CloseHandle(threadHandle);
+		}
+		vnclog.Print(LL_STATE, VNCLOG("################## Closing Imp Thread\n"));
+#endif
+	}
+
+	KillSDTimer();
+	if (instancehan!=NULL)
+		delete instancehan;
+
+	if (hShutdownEvent)CloseHandle(hShutdownEvent);
+	if (hShutdownEventcad)CloseHandle(hShutdownEventcad);
+	vnclog.Print(LL_STATE, VNCLOG("################## SHUTING DOWN SERVER ####################\n"));
+
+	//adzm 2009-06-20
+	if (g_szRepeaterHost) {
+		delete[] g_szRepeaterHost;
+		g_szRepeaterHost = NULL;
+	}
+	return 1;
+};
diff --git a/ica/win32/winvnc/winvnc/winvnc.dsp b/ica/win32/winvnc/winvnc/winvnc.dsp
new file mode 100644
index 0000000..d44377c
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvnc.dsp
@@ -0,0 +1,791 @@
+# Microsoft Developer Studio Project File - Name="winvnc" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=winvnc - Win32 Release
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "winvnc.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "winvnc.mak" CFG="winvnc - Win32 Release"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "winvnc - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "winvnc - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "winvnc - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release"
+# PROP Intermediate_Dir "..\Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "..\omnithread" /I ".." /I "..\.." /D "NDEBUG" /D "__x86__" /D "__WIN32__" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D _WIN32_WINNT=0x501 /D "XMD_H" /D "_WINSTATIC" /YX /FD /D /O3 /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /i "..\.." /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 wsock32.lib winmm.lib kernel32.lib user32.lib gdi32.lib shell32.lib advapi32.lib ole32.lib version.lib comctl32.lib userenv.lib wtsapi32.lib vfw32.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib"
+# SUBTRACT LINK32 /pdb:none /nodefaultlib
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PreLink_Cmds=cl /nologo /MT /Fo..\Release\ /Fd..\Release\ /c buildtime.cpp
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "winvnc - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\Debug"
+# PROP Intermediate_Dir "..\Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\omnithread" /I ".." /I "..\.." /D "_DEBUG" /D "__x86__" /D "__WIN32__" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D _WIN32_WINNT=0x501 /D "XMD_H" /D "_WINSTATIC" /Fr /YX /FD /D /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 ws2_32.lib winmm.lib kernel32.lib user32.lib gdi32.lib shell32.lib advapi32.lib ole32.lib version.lib userenv.lib WtsApi32.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib"
+# SUBTRACT LINK32 /profile
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PreLink_Cmds=cl /nologo /MTd /Fo..\Debug\ /Fd..\Debug\ /c buildtime.cpp
+# End Special Build Tool
+
+!ENDIF 
+
+# Begin Target
+
+# Name "winvnc - Win32 Release"
+# Name "winvnc - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\black_layered.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\buildtime.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\d3des.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\rfb\dh.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\DSMPlugin\DSMPlugin.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\helpers.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\HideDesktop.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\inifile.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\IPC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\IPC.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\lzo\minilzo.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\read_write_ini.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfbRegion.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfbRegion_X11.cxx
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfbUpdateTracker.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\security.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\service.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\service_motor.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\stdhdrs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\tableinitcmtemplate.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\tableinittctemplate.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\tabletranstemplate.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\TextChat.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\translate.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\videodriver.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\videodrivercheck.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vistahook.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncabout.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncacceptdialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncauth.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncbuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncclient.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncconndialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnccorbaconnect.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncdesktop.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncDesktopSW.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncdesktopthread.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencodecorre.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencodehext.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencoderCursor.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencoderre.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncEncodeTight.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncEncodeUltra.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncEncodeZlib.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncEncodeZlibHex.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencodezrle.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnchttpconnect.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncinsthandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnckeymap.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncListDlg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnclog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncmenu.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncMultiMonitor.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncntlm.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncOSVersion.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncproperties.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncpropertiesPoll.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncserver.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncservice.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncsetauth.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncsk.cpp
+# PROP Exclude_From_Build 1
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncsockconnect.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnctimedmsgbox.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vsocket.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\common\win32_helpers.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\winvnc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\winvnc.rc
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\ZipUnZip32\ZipUnzip32.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\d3des.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\rfb\dh.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\DSMPlugin\DSMPlugin.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\inifile.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\keysymdef.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\lzo\lzoconf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\lzo\lzodefs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\lzo\minilzo.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\MultiMon.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfb.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfbMisc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\rfb\rfbproto.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfbRect.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfbRegion.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfbRegion_win32.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfbRegion_X11.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\rfbUpdateTracker.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\stdhdrs.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TextChat.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\translate.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\videodriver.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnc.hh
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncabout.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncacceptdialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncauth.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncbuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncclient.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncconndialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnccorbaconnect.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncdesktop.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncdesktopthread.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencodecorre.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencodehext.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencodemgr.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencoderre.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncEncodeTight.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncEncodeUltra.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncEncodeZlib.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncEncodeZlibHex.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncencodezrle.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnchttpconnect.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncinsthandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnckeymap.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncListDlg.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnclog.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncmenu.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncpasswd.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncproperties.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncpropertiesPoll.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncpropPath.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncserver.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncservice.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncsetauth.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vncsockconnect.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnctimedmsgbox.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vsocket.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\vtypes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\common\win32_helpers.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\winvnc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\ZipUnZip32\ZipUnZip32.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\res\background.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\background2.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\clipboardframe.class
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\descipher.class
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\Finger.cur
+# End Source File
+# Begin Source File
+
+SOURCE=.\HideDesktop.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\ico00001.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\icon1.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\icon2.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\optionsframe.class
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\rfbproto.class
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\vdacc.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\vnc-1.bmp"
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\vnc-1.ico"
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\vnc.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\vnc.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\vnc64.BMP
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\vnccanvas.class
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\vncviewer.class
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\vncviewer.jar
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\winvnc.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\world3a.ico
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\ww-grn-sq2.ico"
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\res\AuthPanel.class
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\BUILDING.txt
+# End Source File
+# Begin Source File
+
+SOURCE=..\building.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\ButtonPanel.class
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\DH.class
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\DH.class
+# End Source File
+# Begin Source File
+
+SOURCE=".\res\ftpframe$strcomp.class"
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\FTPFrame.class
+# End Source File
+# Begin Source File
+
+SOURCE=..\history.txt
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LICENCE.txt
+# End Source File
+# Begin Source File
+
+SOURCE=..\README_BINARY.txt
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\RecordingFrame.class
+# End Source File
+# Begin Source File
+
+SOURCE=.\res\SessionRecorder.class
+# End Source File
+# Begin Source File
+
+SOURCE=.\winvnc.exe.manifest
+# End Source File
+# End Target
+# End Project
diff --git a/ica/win32/winvnc/winvnc/winvnc.exe.manifest b/ica/win32/winvnc/winvnc/winvnc.exe.manifest
new file mode 100644
index 0000000..1267450
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvnc.exe.manifest
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+   version="1.0.0.20"
+   processorArchitecture="X86"
+   name="UltraVNC..exe"
+   type="win32"
+/>
+<description>UltraVNC</description>
+<dependency>
+   <dependentAssembly>
+     <assemblyIdentity
+       type="win32"
+       name="Microsoft.Windows.Common-Controls"
+       version="6.0.0.0"
+       processorArchitecture="X86"
+       publicKeyToken="6595b64144ccf1df"
+       language="*"
+     />
+   </dependentAssembly>
+</dependency>
+<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+<security>
+<requestedPrivileges>
+<requestedExecutionLevel 
+level="asInvoker"
+uiAccess="false"/> 
+</requestedPrivileges>
+</security>
+</trustInfo> 
+</assembly>
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/winvnc.exe.x64.manifest b/ica/win32/winvnc/winvnc/winvnc.exe.x64.manifest
new file mode 100644
index 0000000..bd98755
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvnc.exe.x64.manifest
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+    <security>
+      <requestedPrivileges>
+        <requestedExecutionLevel level='asInvoker' uiAccess='false' />
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+  <dependency>
+    <dependentAssembly>
+      <assemblyIdentity type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*' />
+    </dependentAssembly>
+  </dependency>
+</assembly>
diff --git a/ica/win32/winvnc/winvnc/winvnc.exe.x86.manifest b/ica/win32/winvnc/winvnc/winvnc.exe.x86.manifest
new file mode 100644
index 0000000..1267450
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvnc.exe.x86.manifest
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+   version="1.0.0.20"
+   processorArchitecture="X86"
+   name="UltraVNC..exe"
+   type="win32"
+/>
+<description>UltraVNC</description>
+<dependency>
+   <dependentAssembly>
+     <assemblyIdentity
+       type="win32"
+       name="Microsoft.Windows.Common-Controls"
+       version="6.0.0.0"
+       processorArchitecture="X86"
+       publicKeyToken="6595b64144ccf1df"
+       language="*"
+     />
+   </dependentAssembly>
+</dependency>
+<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+<security>
+<requestedPrivileges>
+<requestedExecutionLevel 
+level="asInvoker"
+uiAccess="false"/> 
+</requestedPrivileges>
+</security>
+</trustInfo> 
+</assembly>
\ No newline at end of file
diff --git a/ica/win32/winvnc/winvnc/winvnc.h b/ica/win32/winvnc/winvnc/winvnc.h
new file mode 100644
index 0000000..5a1511f
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvnc.h
@@ -0,0 +1,104 @@
+//  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
+//
+//  This file is part of the VNC system.
+//
+//  The VNC system is free software; you can redistribute it and/or modify
+//  it under the terms of the 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 VNC system is not available from the place 
+// whence you received this file, check http://www.uk.research.att.com/vnc or contact
+// the authors on vnc at uk.research.att.com for information on obtaining it.
+
+
+// WinVNC header file
+
+#include "stdhdrs.h"
+#include "resource.h"
+
+// Application specific messages
+
+// Message used for system tray notifications
+#define WM_TRAYNOTIFY				WM_APP+1
+
+// Messages used for the server object to notify windows of things
+#define WM_SRV_CLIENT_CONNECT		WM_APP+2
+#define WM_SRV_CLIENT_AUTHENTICATED	WM_APP+3
+#define WM_SRV_CLIENT_DISCONNECT	WM_APP+4
+
+#define WM_MOUSESHAPE				WM_APP+6
+#define WM_HOOKCHANGE				WM_APP+7
+#define WM_SHUTDOWN					WM_APP+8
+
+
+// Export the application details
+extern HINSTANCE	hAppInstance;
+extern const char	*szAppName;
+extern DWORD		mainthreadId;
+
+// Main VNC server routine
+
+extern int WinVNCAppMain();
+
+// Standard command-line flag definitions
+const char winvncRunService[]		= "-service_run";
+const char winvncStartService[]		= "-service";
+const char winvncRunAsUserApp[]		= "-run";
+const char winvncConnect[]		= "-connect";
+const char winvncAutoReconnect[]	= "-autoreconnect";
+const char winvncStopReconnect[]	= "-stopreconnect";
+const char winvncAutoReconnectId[]	= "id:";
+const char winvncReconnectId[]	= "-id:";
+const char winvncSCexit[]	= "-sc_exit";
+const char winvncSCprompt[]	= "-sc_prompt";
+const char winvncmulti[]	= "-multi";
+const char winvnchttp[]	= "-httpproxy";
+
+//adzm 2009-06-20
+// for use with -sc
+const char winvncRepeater[]	= "-repeater"; // set default repeater host
+extern char* g_szRepeaterHost;
+
+const char winvncSettingshelper[]		= "-settingshelper";
+const char winvncSettings[]				= "-settings";
+const char winvncStopserviceHelper[]	= "-stopservicehelper";
+const char winvncStopservice[]			= "-stopservice";
+const char winvncStartserviceHelper[]	= "-startservicehelper";
+const char winvncStartservice[]			= "-startservice";
+
+const char winvncInstallService[]		= "-install";
+const char winvncUnInstallService[]		= "-uninstall";
+const char winvncInstallServiceHelper[]		= "-installhelper";
+const char winvncUnInstallServiceHelper[]	= "-uninstallhelper";
+
+const char winvncSoftwarecad[]		= "-softwarecad";
+const char winvncSoftwarecadHelper[]		= "-softwarecadhelper";
+
+const char winvncRebootSafe[]		= "-rebootsafemode";
+const char winvncRebootSafeHelper[]	= "-rebootsafemodehelper";
+
+const char winvncRebootForce[]		= "-rebootforce";
+const char winvncRebootForceHelper[]	= "-rebootforcehelper";
+
+const char winvncdelSoftwarecad[]		= "-delsoftwarecad";
+const char winvncdelSoftwarecadHelper[]		= "-delsoftwarecadhelper";
+
+const char winvncSecurityEditorHelper[]		= "-securityeditorhelper";
+const char winvncSecurityEditor[]			= "-securityeditor";
+const char winvncKill[]						= "-kill";
+const char winvncopenhomepage[]				= "-openhomepage";
+const char winvncopenforum[]				= "-openforum";
+
+// Usage string
+const char winvncUsageText[]		= "winvnc [-sc_prompt] [-sc_exit] [-id:????] [-stopreconnect][-autoreconnect[ ID:????]] [-connect host[:display]] [-connect host[::port]] [-repeater host[:port]] [-run]\n";
diff --git a/ica/win32/winvnc/winvnc/winvnc.rc b/ica/win32/winvnc/winvnc/winvnc.rc
new file mode 100644
index 0000000..33b1ea7
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvnc.rc
@@ -0,0 +1,708 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (United States) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Cursor
+//
+
+IDC_FINGER              CURSOR                  "res\\Finger.cur"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// JAVACLASS
+//
+
+IDR_FTPFRAME_CLASS      JAVACLASS               "res\\FTPFrame.class"
+IDR_AUTHPANEL_CLASS     JAVACLASS               "res\\AuthPanel.class"
+IDR_CLIPBOARDFRAME_CLASS JAVACLASS               "res\\clipboardFrame.class"
+IDR_OPTIONSFRAME_CLASS  JAVACLASS               "res\\optionsFrame.class"
+IDR_RFBPROTO_CLASS      JAVACLASS               "res\\rfbProto.class"
+IDR_VNCCANVAS_CLASS     JAVACLASS               "res\\vncCanvas.class"
+IDR_VNCVIEWER_CLASS     JAVACLASS               "res\\vncviewer.class"
+IDR_BUTTONPANEL_CLASS   JAVACLASS               "res\\ButtonPanel.class"
+IDR_DESCIPHER_CLASS     JAVACLASS               "res\\DesCipher.class"
+IDR_RECFRAME_CLASS      JAVACLASS               "res\\RecordingFrame.class"
+IDR_SESSIONREC_CLASS    JAVACLASS               "res\\SessionRecorder.class"
+IDR_DH_CLASS            JAVACLASS               "res\\dh.class"
+IDR_FTPFRAMESTRCOMP_CLASS JAVACLASS               "res\\ftpframe$strcomp.class"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_TEXTCHAT_DLG DIALOGEX 0, 0, 308, 177
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_THICKFRAME
+CAPTION " Chat - Ultr at VNC"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+    EDITTEXT        IDC_INPUTAREA_EDIT,4,135,255,39,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_VSCROLL,WS_EX_STATICEDGE
+    PUSHBUTTON      "Send",IDC_SEND_B,264,135,39,16,BS_MULTILINE
+    PUSHBUTTON      "Minimize",IDC_HIDE_B,264,153,39,11
+    PUSHBUTTON      "Close",IDCANCEL,264,164,39,11
+    CONTROL         "",IDC_CHATAREA_EDIT,"RICHEDIT",TCS_HOTTRACK | TCS_RAGGEDRIGHT | TCS_FOCUSONBUTTONDOWN | TCS_MULTISELECT | WS_VSCROLL | WS_TABSTOP,4,4,300,122,WS_EX_STATICEDGE
+    PUSHBUTTON      "",IDOK,303,0,6,6,NOT WS_VISIBLE
+    LTEXT           "",IDC_STATIC_SPLIT,5,127,298,8,SS_NOTIFY
+END
+
+IDD_LIST_DLG DIALOGEX 0, 0, 288, 123
+STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_TOOLWINDOW
+CAPTION " List of Clients - UltraVNC"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON   "Close",IDOK,118,94,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,118,78,50,14,NOT WS_VISIBLE
+    LTEXT           " Currently Connected Clients :",IDC_STATIC,5,4,105,8
+    LISTBOX         IDC_VIEWERS_LISTBOX,7,16,103,93,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
+    PUSHBUTTON      "Kill Client",IDC_KILL_B,118,17,50,14
+    PUSHBUTTON      "Chat with    Client",IDC_TEXTCHAT_B,118,35,50,22,BS_MULTILINE
+    LTEXT           "Pending Clients:",IDC_STATIC,173,4,105,8
+    LISTBOX         IDC_PENDING_LISTBOX,175,16,103,93,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
+END
+
+IDD_ABOUT DIALOGEX 0, 0, 282, 158
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION " About WinVNC"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,8,135,54,16
+    CONTROL         139,IDC_VNCLOGO,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN,7,5,53,46,WS_EX_TRANSPARENT
+    LTEXT           "UltraVNC Win32 Server 1.0.9.6.1",IDC_VERSION,73,5,195,11
+    LTEXT           "Copyright © 2002-2009 UltraVNC Team\nCopyright © 2001-2002 Sam - eSVNC \nCopyright © 1999-2002 Rudi D. V. - VdaccVNC \nCopyright © 2001 Harakan Software - PalmVNC\nCopyright © 1999-2002 Const. Kaplinsky - TightVNC \n",IDC_NAME,74,27,202,41
+    LTEXT           "For more Information and Links please visit: \nhttp://www.uvnc.com",IDC_WWW,74,135,141,19
+    LTEXT           "Build:",IDC_BUILDTEXT,74,16,20,10
+    LTEXT           "BuildTime",IDC_BUILDTIME,97,16,92,10
+    LTEXT           "Copyright © 2002 RealVNC Ltd. - RealVNC\nCopyright © 1999-2002 Tridia Corporation - TridiaVNC \nCopyright © 1994-2001 AT&&T Laboratories Cambridge/Olivetti Research Ltd. - VNC",IDC_STATIC,74,67,203,32
+    LTEXT           "Copyright © 1990-2002 Info-ZIP\nCopyright © 1996-2002 Markus Franz Xaver Johannes Oberhumer - Mini LZO library",IDC_STATIC,74,99,200,27
+END
+
+IDD_OUTGOING_CONN DIALOGEX 0, 0, 223, 102
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Initiate Connection"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+    CTEXT           "",IDC_CAPTION_STATIC,7,6,209,20,NOT WS_VISIBLE
+    LTEXT           "Host Name:",IDC_HOSTNAME_STATIC,90,9,58,8,SS_CENTERIMAGE
+    EDITTEXT        IDC_HOSTNAME_EDIT,90,22,121,14,ES_AUTOHSCROLL
+    LTEXT           "Connection #",IDC_CONNECTION_NUMBER_STATIC,90,43,58,8
+    EDITTEXT        IDC_IDCODE,90,56,121,14,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "OK",IDOK,90,78,46,14
+    PUSHBUTTON      "Cancel",IDCANCEL,165,78,46,14
+END
+
+IDD_ACCEPT_CONN DIALOGEX 0, 0, 186, 95
+STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
+EXSTYLE WS_EX_TOPMOST
+CAPTION "Accept WinVNC Connection?"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+    DEFPUSHBUTTON   "&Accept",IDACCEPT,7,74,53,14
+    PUSHBUTTON      "&Reject",IDREJECT,130,74,49,14
+    CTEXT           "WinVNC has received an incoming connection from",IDC_STATIC_TEXT1,7,7,172,17,SS_CENTERIMAGE
+    CTEXT           "<unknown host>",IDC_ACCEPT_IP,7,30,172,16,SS_CENTERIMAGE
+    CTEXT           "Do you wish to Accept or Reject the connection?",IDC_STATIC_TEXT,7,50,172,15,SS_CENTERIMAGE
+    CTEXT           "AutoReject:",IDC_ACCEPT_TIMEOUT,60,74,70,14,SS_CENTERIMAGE
+END
+
+IDD_PROPERTIES DIALOGEX 0, 0, 224, 191
+STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION " Ultr at VNC Server Property Page"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+    GROUPBOX        "Server Screen Updates Handling",IDC_UPDATE_BORDER,6,2,214,118
+    CONTROL         "Poll Full Screen ( Ultra Fast )",IDC_POLL_FULLSCREEN,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,13,112,13
+    CONTROL         "Poll Foreground Window",IDC_POLL_FOREGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,28,95,9
+    CONTROL         "Poll Window Under Cursor",IDC_POLL_UNDER_CURSOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,37,95,16
+    CONTROL         "Poll Console Windows Only",IDC_CONSOLE_ONLY,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,117,26,99,15
+    CONTROL         "Poll On Event Only",IDC_ONEVENT_ONLY,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,117,39,78,12
+    CONTROL         "System HookDll",IDC_HOOK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,56,66,10
+    CONTROL         "Video Hook Driver",IDC_DRIVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,68,74,10
+    CONTROL         "Low Accuracy ( Turbo Speed )",IDC_TURBOMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,81,112,10
+    PUSHBUTTON      "Check the Video Hook Driver",IDC_CHECKDRIVER,92,67,121,11
+    GROUPBOX        "Single Window Sharing",IDC_STATIC,5,124,214,47,BS_LEFT
+    CONTROL         "Share only the Server Window Named :",IDC_SINGLE_WINDOW,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,137,188,10
+    EDITTEXT        IDC_NAME_APPLI,14,151,195,13,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "&OK",IDOK,82,174,44,14
+    PUSHBUTTON      "&Apply",IDC_APPLY,131,174,43,14
+    PUSHBUTTON      "&Cancel",IDCANCEL,178,174,41,14
+    EDITTEXT        IDC_MAXCPU,54,99,40,14,ES_AUTOHSCROLL | ES_NUMBER
+    LTEXT           "Max Cpu :",IDC_STATIC,14,102,34,8
+END
+
+IDD_PROPERTIES1 DIALOGEX 0, 0, 390, 297
+STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION " UltraVNC Server Property Page"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+    GROUPBOX        "Incoming Connections",IDC_CONNECT_BORDER,5,3,132,116,BS_LEFT
+    CONTROL         "Accept Socket Connections",IDC_CONNECT_SOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,15,112,11
+    LTEXT           "Display Number or Ports to use:",IDC_DISPLAY_NO_LABEL,11,28,102,9,SS_CENTERIMAGE
+    CONTROL         "Display",IDC_SPECDISPLAY,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,11,41,35,10
+    EDITTEXT        IDC_DISPLAYNO,66,41,29,12,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "Auto",IDC_AUTO_DISPLAY_NO,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,102,39,35,13
+    CONTROL         "Ports",IDC_SPECPORT,"Button",BS_AUTORADIOBUTTON,11,54,30,10
+    CONTROL         "Auto",IDC_PORTNO_AUTO,"Button",BS_AUTORADIOBUTTON,101,54,31,9
+    RTEXT           "Main:",IDC_STATIC,45,55,18,8
+    EDITTEXT        IDC_PORTRFB,66,53,29,12,ES_AUTOHSCROLL
+    RTEXT           "Http:",IDC_STATIC,36,67,27,8
+    EDITTEXT        IDC_PORTHTTP,66,65,29,12,ES_AUTOHSCROLL
+    CONTROL         "Enable JavaViewer (Http Connect)",IDC_CONNECT_HTTP,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,80,122,10
+    CONTROL         "Allow Loopback Connections",IDC_ALLOWLOOPBACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,91,105,10
+    CONTROL         "LoopbackOnly",IDC_LOOPBACKONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,102,59,10
+    GROUPBOX        "When Last Client Disconnects",IDC_LOCKSETTINGS,142,3,104,52,BS_LEFT
+    CONTROL         "Do Nothing",IDC_LOCKSETTING_NOTHING,"Button",BS_AUTORADIOBUTTON | WS_GROUP,146,15,80,12
+    CONTROL         "Lock Workstation (W2K)",IDC_LOCKSETTING_LOCK,"Button",BS_AUTORADIOBUTTON,146,26,96,13
+    CONTROL         "Logoff Workstation",IDC_LOCKSETTING_LOGOFF,"Button",BS_AUTORADIOBUTTON,146,39,80,11
+    GROUPBOX        "Keyboard && Mouse",IDC_STATIC,142,59,103,60,BS_LEFT
+    CONTROL         "Disable Viewers inputs",IDC_DISABLE_INPUTS,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,150,70,92,11
+    CONTROL         "Disable Local inputs",IDC_DISABLE_LOCAL_INPUTS,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,150,82,83,12
+    CONTROL         "Alternate keyboard method",IDC_JAP_INPUTS,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,150,95,89,18
+    GROUPBOX        "Query on incoming connection",IDC_STATIC,250,3,136,53,BS_LEFT
+    CONTROL         "Display Query Window",IDQUERY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,257,15,86,10
+    LTEXT           "Timeout:",IDC_STATIC,275,29,28,8
+    EDITTEXT        IDQUERYTIMEOUT,308,27,19,12,ES_AUTOHSCROLL
+    LTEXT           "seconds",IDC_STATIC,330,29,29,8
+    LTEXT           "Default action:",IDC_STATIC,257,43,47,8
+    CONTROL         "Refuse",IDC_DREFUSE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,307,43,39,10
+    CONTROL         "Accept",IDC_DACCEPT,"Button",BS_AUTORADIOBUTTON,346,43,37,10
+    GROUPBOX        "Multi viewer connections",IDC_STATIC,250,59,136,60,BS_LEFT
+    CONTROL         "Disconnect all existing connections",IDC_MV1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,255,71,127,10
+    CONTROL         "Keep existing connections",IDC_MV2,"Button",BS_AUTORADIOBUTTON,255,81,104,10
+    CONTROL         "Refuse the new connection",IDC_MV3,"Button",BS_AUTORADIOBUTTON,255,92,103,9
+    CONTROL         "Refuse all new connection ",IDC_MV4,"Button",BS_AUTORADIOBUTTON,255,103,102,10
+    GROUPBOX        "Authentication",IDC_STATIC,6,122,210,88,BS_LEFT
+    LTEXT           "VNC Password:",IDC_PASSWORD_LABEL,33,136,50,11,SS_CENTERIMAGE
+    EDITTEXT        IDC_PASSWORD,85,135,74,13,ES_PASSWORD | ES_AUTOHSCROLL
+    LTEXT           "View-Only Password:",IDC_PASSWORD_LABEL2,14,150,69,11,SS_CENTERIMAGE
+    EDITTEXT        IDC_PASSWORD2,85,150,74,13,ES_PASSWORD | ES_AUTOHSCROLL
+    CONTROL         "Require MS Logon  (User/Pass./Domain)",IDC_MSLOGON_CHECKD,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,164,146,10
+    CONTROL         "New MS Logon (supports multiple domains)",IDC_NEW_MSLOGON,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,175,153,11
+    PUSHBUTTON      "Configure MS Logon Groups",IDC_MSLOGON,13,190,195,12
+    GROUPBOX        "Misc.",IDC_STATIC,221,122,165,116,BS_LEFT
+    CONTROL         "Remove Aero (Vista)",IDC_REMOVE_Aero,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,228,130,81,10
+    CONTROL         "Remove Wallpaper for Viewers",IDC_REMOVE_WALLPAPER,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,228,140,134,10
+    CONTROL         "Enable Blank Monitor on Viewer Request",IDC_BLANK,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,228,151,144,10
+    CONTROL         "Disable Only Inputs on Blanking Request",IDC_BLANK2,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,239,161,142,10
+    CONTROL         "Enable Alpha-Blending Monitor Blanking",IDC_ALPHABLACK,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,239,172,142,10
+    CONTROL         "Capture Alpha-Blending",IDC_ALPHA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,228,183,99,10
+    CONTROL         "DisableTrayIcon",IDC_DISABLETRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,228,194,67,10
+    CONTROL         "Disable clients options in tray icon menu",IDC_ALLOWEDITCLIENTS,
+                    "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,228,205,141,10
+    CONTROL         "Forbid the user to close down WinVNC",IDC_ALLOWSHUTDOWN,
+                    "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,228,216,135,10
+    LTEXT           "Default Server Screen Scale:",IDC_STATIC,237,225,92,8
+    LTEXT           "1 / ",IDC_STATIC,348,225,12,8
+    EDITTEXT        IDC_SCALE,363,222,12,12,ES_AUTOHSCROLL
+    GROUPBOX        "File Transfer",IDC_STATIC,6,213,210,25
+    CONTROL         "Enable",IDC_FILETRANSFER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,224,38,10
+    CONTROL         "User impersonation (for Service only)",IDC_FTUSERIMPERSONATION_CHECK,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,71,224,133,10
+    GROUPBOX        "DSM Plugin",IDC_STATIC,5,241,211,32,BS_LEFT
+    CONTROL         "Use :",IDC_PLUGIN_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,255,31,10
+    COMBOBOX        IDC_PLUGINS_COMBO,45,253,129,86,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "Config.",IDC_PLUGIN_BUTTON,179,253,29,12
+    GROUPBOX        "Logging",IDC_STATIC,221,241,165,51
+    CONTROL         "Log debug infos to the WinVNC.log file",IDC_LOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,228,251,139,10
+    CONTROL         "Log to video",IDC_VIDEO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,228,262,58,10
+    PUSHBUTTON      "Clear avi encoder",IDC_CLEAR,297,262,75,9
+    LTEXT           "Path:",IDC_STATIC,229,276,18,8
+    EDITTEXT        IDC_EDIT_PATH,250,274,132,14,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "&OK",IDOK,32,279,43,14
+    PUSHBUTTON      "&Apply",IDC_APPLY,81,279,43,14
+    PUSHBUTTON      "&Cancel",IDCANCEL,129,279,44,14
+    RTEXT           "N°",IDC_STATIC,53,42,9,8
+END
+
+IDD_ABOUT1 DIALOGEX 0, 0, 286, 222
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION " Info"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,210,204,54,16
+    CONTROL         153,IDC_VNCLOGO,"Static",SS_BITMAP | SS_CENTERIMAGE | SS_SUNKEN,7,5,269,199,WS_EX_TRANSPARENT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+    IDD_TEXTCHAT_DLG, DIALOG
+    BEGIN
+        LEFTMARGIN, 5
+        RIGHTMARGIN, 303
+        TOPMARGIN, 5
+        BOTTOMMARGIN, 172
+    END
+
+    IDD_LIST_DLG, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 281
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 116
+    END
+
+    IDD_ABOUT, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 275
+        VERTGUIDE, 80
+        VERTGUIDE, 90
+        VERTGUIDE, 100
+        VERTGUIDE, 120
+        TOPMARGIN, 5
+        HORZGUIDE, 9
+        HORZGUIDE, 20
+        HORZGUIDE, 30
+        HORZGUIDE, 40
+        HORZGUIDE, 50
+        HORZGUIDE, 60
+        HORZGUIDE, 70
+        HORZGUIDE, 80
+        HORZGUIDE, 90
+        HORZGUIDE, 100
+    END
+
+    IDD_OUTGOING_CONN, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 216
+        VERTGUIDE, 50
+        VERTGUIDE, 55
+        VERTGUIDE, 185
+        VERTGUIDE, 190
+        TOPMARGIN, 6
+        BOTTOMMARGIN, 95
+        HORZGUIDE, 20
+        HORZGUIDE, 49
+    END
+
+    IDD_ACCEPT_CONN, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 179
+        VERTGUIDE, 60
+        VERTGUIDE, 130
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 88
+        HORZGUIDE, 24
+        HORZGUIDE, 30
+        HORZGUIDE, 46
+        HORZGUIDE, 50
+        HORZGUIDE, 65
+        HORZGUIDE, 74
+    END
+
+    IDD_PROPERTIES, DIALOG
+    BEGIN
+        VERTGUIDE, 14
+        BOTTOMMARGIN, 172
+    END
+
+    IDD_PROPERTIES1, DIALOG
+    BEGIN
+        VERTGUIDE, 150
+        VERTGUIDE, 257
+        BOTTOMMARGIN, 280
+        HORZGUIDE, 270
+    END
+
+    IDD_ABOUT1, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 282
+        VERTGUIDE, 80
+        VERTGUIDE, 90
+        VERTGUIDE, 100
+        VERTGUIDE, 120
+        TOPMARGIN, 5
+        BOTTOMMARGIN, 158
+        HORZGUIDE, 9
+        HORZGUIDE, 20
+        HORZGUIDE, 30
+        HORZGUIDE, 40
+        HORZGUIDE, 50
+        HORZGUIDE, 60
+        HORZGUIDE, 70
+        HORZGUIDE, 80
+        HORZGUIDE, 90
+        HORZGUIDE, 100
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,9,6
+ PRODUCTVERSION 1,0,9,6
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x2dL
+#else
+ FILEFLAGS 0x2cL
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "000004b0"
+        BEGIN
+            VALUE "Comments", "UltraVNC - Remote Control for all"
+            VALUE "CompanyName", "UltraVNC"
+            VALUE "FileDescription", "VNC server for win32"
+            VALUE "FileVersion", "1.0.9.6.1"
+            VALUE "InternalName", "WinVNC"
+            VALUE "LegalCopyright", "Copyright © 2010 UltraVNC"
+            VALUE "LegalTrademarks", "VNC"
+            VALUE "OriginalFilename", "WinVNC.exe"
+            VALUE "PrivateBuild", "1.0.9.6.1"
+            VALUE "ProductName", "UltraVNC"
+            VALUE "ProductVersion", "1.0.9.6.1"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0, 1200
+    END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_TRAYMENU MENU
+BEGIN
+    POPUP "tray"
+    BEGIN
+        MENUITEM "&Properties",                 ID_PROPERTIES
+        MENUITEM "&Admin Properties",           ID_ADMIN_PROPERTIES
+        MENUITEM SEPARATOR
+        MENUITEM "&About WinVNC",               ID_ABOUT
+        POPUP "Visit our site"
+        BEGIN
+            MENUITEM "Homepage",                    ID_VISITUSONLINE_HOMEPAGE
+            MENUITEM "Forum",                       ID_VISITUSONLINE_FORUM
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "Add &New Client",             ID_OUTGOING_CONN
+        MENUITEM "&Kill All Clients",           ID_KILLCLIENTS
+        MENUITEM SEPARATOR
+        MENUITEM "&List All Clients",           ID_LISTCLIENTS
+        MENUITEM SEPARATOR
+        MENUITEM "Install Service",             ID_RUNASSERVICE
+        MENUITEM "Uninstall Service",           ID_UNINSTALL_SERVICE
+        MENUITEM "Stop Service",                ID_CLOSE_SERVICE
+        MENUITEM "Start Service (must be installed first)", ID_START_SERVICE
+        MENUITEM "Fix1 SoftwareCad",            ID_SOFTWARECAD
+        MENUITEM "Fix2 SoftwareCad",            ID_DELSOFTWARECAD
+        MENUITEM "Reboot in safemode",          ID_REBOOTSAFEMODE
+        MENUITEM "Force Reboot (unsafe)",       ID_REBOOT_FORCE
+        MENUITEM SEPARATOR
+        MENUITEM "&Close VNC Connections",      ID_CLOSE
+    END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// JAVAARCHIVE
+//
+
+IDR_VNCVIEWER_JAR       JAVAARCHIVE             "res\\vncviewer.jar"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+    IDI_WINVNC              "WinVNC"
+    IDS_WARNING             "WARNING: By default, this session do not use any encryption whatsoever. Please do not use it to send sensitive data unless you are sure your connection is secure.\n\n"
+END
+
+STRINGTABLE
+BEGIN
+    ID_FAILED_INIT          "Failed to initialise the socket system"
+    ID_WINVNC_USAGE         "WinVNC Usage"
+    ID_ANOTHER_INST         "Another instance of WinVNC is already running"
+    ID_NO_EXIST_INST        "No existing instance of WinVNC could be contacted"
+    ID_UNABLE_INST          "Unable to install WinVNC service"
+    ID_SCM_NOT_HERE         "The SCM could not be contacted - the WinVNC service was not installed"
+    ID_SERV_NOT_REG         "The WinVNC service could not be registered"
+    ID_SERV_FAIL_ST         "The WinVNC service failed to start"
+END
+
+STRINGTABLE
+BEGIN
+    ID_SERV_CT_MISS         "The Service Control Manager could not be contacted - the WinVNC service was not registered"
+    ID_SERV_OLD_REG         "The WinVNC service is already registered"
+    ID_SERVHELP_UNAB        "WARNING:Unable to install the ServiceHelper hook\nGlobal user-specific registry settings will not be loaded"
+    ID_SERV_CT_UNREG        "The Service Control Manager could not be contacted - the WinVNC service was not unregistered"
+    ID_SERV_NOT_UNRG        "The WinVNC service could not be unregistered"
+    ID_SERV_NCONTACT        "The WinVNC service could not be contacted"
+    ID_SERVHELP_NREM        "WARNING:The ServiceHelper hook entry could not be removed from the registry"
+    ID_SERV_NOT_STOP        "The WinVNC service could not be stopped"
+    ID_SERV_MK_UNREG        "The WinVNC service is already marked to be unregistered"
+    ID_SERV_NT_FOUND        "The WinVNC service could not be found"
+    ID_WINVNC_ERROR         "WinVNC Error"
+    ID_WINVNC_WARNIN        "WinVNC Warning"
+    ID_PLUGIN_LOADIN        "Plugin Loading"
+    ID_NO_PASSWD_NO_OVERRIDE_ERR 
+                            "No password has been set & this machine has been preconfigured to prevent users from setting their own.\nYou must contact a System Administrator to configure WinVNC properly."
+    ID_NO_PASSWD_NO_OVERRIDE_WARN 
+                            "WARNING : This machine has been preconfigured to allow un-authenticated\nconnections to be accepted and to prevent users from enabling authentication."
+    ID_NO_PASSWD_NO_LOGON_WARN 
+                            "WARNING : This machine has no default password set.  WinVNC will present the Default Properties dialog now to allow one to be entered."
+END
+
+STRINGTABLE
+BEGIN
+    ID_NO_OVERRIDE_ERR      "This machine has been preconfigured with WinVNC settings, which cannot be overridden by individual users.  The preconfigured settings may be modified only by a System Administrator."
+    ID_NO_CURRENT_USER_ERR  "The WinVNC settings for the current user are unavailable at present."
+    ID_CANNOT_EDIT_DEFAULT_PREFS 
+                            "You do not have sufficient priviliges to edit the default local WinVNC settings."
+    ID_NO_PASSWORD_WARN     "WARNING : Running WinVNC without setting a password is a dangerous security risk!\nUntil you set a password, WinVNC will not accept incoming connections."
+    ID_PLUGIN_NOT_LOAD      "The Plugin cannot be loaded.\n\rPlease check its integrity."
+    ID_MB1                  "MB1"
+    ID_WVNC                 "WVNC"
+    ID_AUTHAD_NOT_FO        "You selected ms-logon, but the authad.dll\nwas not found.Check you installation"
+    ID_WARNING              "WARNING"
+    ID_AUTH_NOT_FO          "You selected ms-logon, but the auth.dll\nwas not found.Check you installation"
+    ID_DESKTOP_BITBLT_ROOT  "vncDesktop : root device doesn't support BitBlt\nWinVNC cannot be used with this graphic device driver"
+    ID_DESKTOP_BITBLT_MEM   "vncDesktop : memory device doesn't support GetDIBits\nWinVNC cannot be used with this graphics device driver"
+    ID_DESKTOP_PLANAR_NOTC  "vncDesktop : current display is PLANAR, not CHUNKY!\nWinVNC cannot be used with this graphics device driver"
+    ID_FAILED_CONNECT_LISTING_VIEW "Failed to connect to listening VNC viewer"
+    ID_OUTGOING_CONNECTION  "Outgoing Connection"
+    ID_UNABLE_PROC_MSLOGON  "Unable to process MS logon"
+END
+
+STRINGTABLE
+BEGIN
+    ID_RICHED32_UNLOAD      "Unable to load the Rich Edit (RICHED32.DLL) control!"
+    ID_RICHED32_DLL_LD      "Rich Edit Dll Loading"
+    ID_SERV_SUCCESS_INST    "The WinVNC service was successfully installed\nThe service will start now and will automatically\nbe run the next time this machine is reset"
+    ID_SERV_SUCCESS_REG     "The WinVNC service was successfully registered\nThe service may be started from the Control Panel, and will\nautomatically be run the next time this machine is reset"
+    ID_SERV_SUCCESS_UNREG   "The WinVNC service has been unregistered"
+    ID_ULTRAVNC_TEXTCHAT    "The selected client is not an Ultr at VNC Viewer !\nIt presumably does not support TextChat\n"
+    ID_ULTRAVNC_WARNING     "Ultr at VNC Warning"
+    ID_NO_PLUGIN_DETECT     "No Plugin detected..."
+    ID_CHAT_WITH_S_ULTRAVNC " Chat with <%s> - Ultr at VNC"
+    ID_CURRENT_USER_PROP    "WinVNC: Current User Properties"
+    ID_DEFAULT_SYST_PROP    "WinVNC: Default Local System Properties"
+    ID_AUTOREJECT_U         "AutoReject:%u"
+    ID_AUTOACCEPT_U         "AutoAccept:%u"
+    ID_CADERROR             "Ctrl-alt-del require service, no permission"
+    ID_CADERRORFILE         "The file cad.exe was not found in the same folder as winvnc"
+    ID_CADPERMISSION        "Permission denied on cad.exe, Ultravnc must be installed in ""program files"" else special cad permission is refused."
+END
+
+#endif    // English (United States) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (United Kingdom) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
+#pragma code_page(1252)
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+#endif    // English (United Kingdom) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Dutch (Belgium) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLB)
+LANGUAGE LANG_DUTCH, SUBLANG_DUTCH_BELGIAN
+#pragma code_page(1252)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// JAVACLASS
+//
+
+IDR_JAVACLASS1          JAVACLASS               "res\\mslogon\\AuthPanel.class"
+IDR_JAVACLASS2          JAVACLASS               "res\\mslogon\\ButtonPanel.class"
+IDR_JAVACLASS3          JAVACLASS               "res\\mslogon\\ClipboardFrame.class"
+IDR_JAVACLASS4          JAVACLASS               "res\\mslogon\\DesCipher.class"
+IDR_JAVACLASS5          JAVACLASS               "res\\mslogon\\DH.class"
+IDR_JAVACLASS6          JAVACLASS               "res\\mslogon\\FTPFrame$StrComp.class"
+IDR_JAVACLASS7          JAVACLASS               "res\\mslogon\\FTPFrame.class"
+IDR_JAVACLASS8          JAVACLASS               "res\\mslogon\\OptionsFrame.class"
+IDR_JAVACLASS9          JAVACLASS               "res\\mslogon\\RecordingFrame.class"
+IDR_JAVACLASS10         JAVACLASS               "res\\mslogon\\RfbProto.class"
+IDR_JAVACLASS11         JAVACLASS               "res\\mslogon\\SessionRecorder.class"
+IDR_JAVACLASS12         JAVACLASS               "res\\mslogon\\VncCanvas.class"
+IDR_JAVACLASS13         JAVACLASS               "res\\mslogon\\VncViewer.class"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_MSLOGON DIALOGEX 0, 0, 186, 166
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "MS logon setup"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+    GROUPBOX        "",IDC_STATIC,5,0,178,74
+    LTEXT           "Group",IDC_STATIC,23,8,20,8
+    LTEXT           "Local",IDC_STATIC,127,8,18,8
+    LTEXT           "Domain",IDC_STATIC,153,8,25,8
+    EDITTEXT        IDC_GROUP1,21,19,93,13,ES_AUTOHSCROLL
+    CONTROL         "",IDC_CHECKG1L,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,20,13,10
+    CONTROL         "",IDC_CHECKG1D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,153,22,16,8
+    EDITTEXT        IDC_GROUP2,21,36,93,13,ES_AUTOHSCROLL
+    CONTROL         "",IDC_CHECKG2L,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,38,16,8
+    CONTROL         "",IDC_CHECKG2D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,153,38,16,8
+    EDITTEXT        IDC_GROUP3,21,53,93,13,ES_AUTOHSCROLL
+    CONTROL         "",IDC_CHECKG3L,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,56,16,8
+    CONTROL         "",IDC_CHECKG3D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,153,56,16,8
+    GROUPBOX        "Rules",IDC_STATIC,5,77,178,68
+    LTEXT           "Group 1, 2 = Full Access       Group 3 = Read Only",IDC_STATIC,16,88,162,8
+    LTEXT           "Must be run as a Service on NT4, W2K\nCan be run as a Service or Application on XP, W2003\nLocal admins have always access.\nFor NT4 and W2K in Application mode you need to add the Local Admin Group.",IDC_STATIC,8,100,174,41
+    DEFPUSHBUTTON   "OK",IDOK,77,148,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,132,148,50,14
+    LTEXT           "1",IDC_STATIC,11,22,8,8
+    LTEXT           "2",IDC_STATIC,11,38,8,8
+    LTEXT           "3",IDC_STATIC,11,56,8,8
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+    IDD_MSLOGON, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 182
+        VERTGUIDE, 17
+        VERTGUIDE, 110
+        VERTGUIDE, 123
+        VERTGUIDE, 149
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 162
+        HORZGUIDE, 46
+        HORZGUIDE, 66
+        HORZGUIDE, 88
+        HORZGUIDE, 105
+        HORZGUIDE, 164
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// JAVAARCHIVE
+//
+
+IDR_JAVAARCHIVE1        JAVAARCHIVE             "res\\mslogon\\VncViewer.jar"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_WINVNC              ICON                    "res\\world3a.ico"
+IDI_FLASH               ICON                    "res\\icon2.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_LOGO64              BITMAP                  "res\\vnc-1.bmp"
+#endif    // Dutch (Belgium) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/winvnc/winvnc/winvnc.vcproj b/ica/win32/winvnc/winvnc/winvnc.vcproj
new file mode 100644
index 0000000..4ca7482
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvnc.vcproj
@@ -0,0 +1,4444 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9,00"
+	Name="winvnc"
+	ProjectGUID="{C05AE605-1250-4F58-911B-EC99AE2C25AF}"
+	RootNamespace="winvnc"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\..\Debug"
+			IntermediateDirectory=".\..\Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\..\Debug/winvnc.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\omnithread,..,..\.."
+				PreprocessorDefinitions="_DEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_CRT_SECURE_NO_WARNINGS;_VC80;_WIN32_IE=0x0600"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\..\Debug/winvnc.pch"
+				AssemblerListingLocation=".\..\Debug/"
+				ObjectFile=".\..\Debug/"
+				ProgramDataBaseFileName=".\..\Debug/"
+				BrowseInformation="1"
+				BrowseInformationFile=".\..\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="cl /nologo /MTd /Fo..\Debug\ /Fd..\Debug\ /c buildtime.cpp"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib winmm.lib version.lib wtsapi32.lib userenv.lib"
+				OutputFile=".\..\Debug/winvnc.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Debug/winvnc.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				FixedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Debug/winvnc.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName=".\..\Debug/winvnc.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\omnithread,..,..\.."
+				PreprocessorDefinitions="_DEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_CRT_SECURE_NO_WARNINGS;_VC80;_X64"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\..\Debug/winvnc.pch"
+				AssemblerListingLocation=".\..\Debug/"
+				ObjectFile=".\..\Debug/"
+				ProgramDataBaseFileName=".\..\Debug/"
+				BrowseInformation="1"
+				BrowseInformationFile=".\..\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="cl /nologo /MTd /Fo..\Debug\ /Fd..\Debug\ /c buildtime.cpp"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib winmm.lib version.lib wtsapi32.lib userenv.lib"
+				OutputFile=".\..\Debug/winvnc.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Debug/winvnc.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Debug/winvnc.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\..\Release"
+			IntermediateDirectory=".\..\Release"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\..\Release/winvnc.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				EnableFiberSafeOptimizations="true"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories="..\omnithread,..,..\.."
+				PreprocessorDefinitions="NDEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_VC80;_CRT_SECURE_NO_WARNINGS;_WIN32_IE=0x0600"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				StructMemberAlignment="5"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/winvnc.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="cl /nologo /MT /Fo..\Release\ /Fd..\Release\ /c buildtime.cpp"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/LTCG"
+				AdditionalDependencies="ws2_32.lib winmm.lib version.lib comctl32.lib wtsapi32.lib userenv.lib"
+				OutputFile=".\..\Release/winvnc_32.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				GenerateManifest="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Release/winvnc.pdb"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="0"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/winvnc.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName=".\..\Release/winvnc.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\omnithread,..,..\.."
+				PreprocessorDefinitions="NDEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_VC80;_CRT_SECURE_NO_WARNINGS;_X64"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/winvnc.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="cl /nologo /MT /Fo..\Release\ /Fd..\Release\ /c buildtime.cpp"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib winmm.lib version.lib comctl32.lib wtsapi32.lib userenv.lib"
+				OutputFile=".\..\Release/winvnc_64.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\..\Release/winvnc.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/winvnc.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="IPP|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\..\Release/winvnc.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				InlineFunctionExpansion="2"
+				EnableIntrinsicFunctions="true"
+				FavorSizeOrSpeed="1"
+				EnableFiberSafeOptimizations="true"
+				WholeProgramOptimization="true"
+				AdditionalIncludeDirectories="..\omnithread,..,..\.."
+				PreprocessorDefinitions="NDEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_VC80;_CRT_SECURE_NO_WARNINGS;IPP"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/winvnc.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="cl /nologo /MT /Fo..\Release\ /Fd..\Release\ /c buildtime.cpp"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/LTCG"
+				AdditionalDependencies="ws2_32.lib winmm.lib version.lib comctl32.lib wtsapi32.lib userenv.lib ippjemerged.lib ippiemerged.lib ippsemerged.lib ippjmerged.lib ippimerged.lib ippsmerged.lib ippcorel.lib ippdcemerged.lib ippdcmerged.lib ippcpmerged.lib ippcpemerged.lib"
+				OutputFile=".\..\Release/winvnc.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				GenerateManifest="true"
+				ProgramDatabaseFile=".\..\Release/winvnc.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/winvnc.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="IPP|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName=".\..\Release/winvnc.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\omnithread,..,..\.."
+				PreprocessorDefinitions="NDEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_VC80;_CRT_SECURE_NO_WARNINGS;_X64"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/winvnc.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="cl /nologo /MT /Fo..\Release\ /Fd..\Release\ /c buildtime.cpp"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib winmm.lib version.lib comctl32.lib wtsapi32.lib userenv.lib"
+				OutputFile=".\..\Release/winvnc.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\..\Release/winvnc.pdb"
+				SubSystem="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/winvnc.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath=".\benchmark.cpp"
+				>
+			</File>
+			<File
+				RelativePath="black_layered.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="buildtime.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\common\Clipboard.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\CpuUsage.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\CpuUsage.h"
+				>
+			</File>
+			<File
+				RelativePath="d3des.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\rfb\dh.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\DSMPlugin\DSMPlugin.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\Dtwinver.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\Dtwinver.h"
+				>
+			</File>
+			<File
+				RelativePath=".\getinfo.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\helpers.cpp"
+				>
+			</File>
+			<File
+				RelativePath="HideDesktop.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\httpconnect.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\httpconnect.h"
+				>
+			</File>
+			<File
+				RelativePath="inifile.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\initipp.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\IPC.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\lzo\minilzo.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\read_write_ini.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\rfbRegion_win32.cpp"
+				>
+			</File>
+			<File
+				RelativePath="rfbRegion_X11.cxx"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="rfbUpdateTracker.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="security.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\service.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\service_motor.cpp"
+				>
+			</File>
+			<File
+				RelativePath="stdhdrs.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="tableinitcmtemplate.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="tableinittctemplate.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="tabletranstemplate.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="TextChat.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="translate.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="videodriver.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="videodrivercheck.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\vistahook.cpp"
+				>
+			</File>
+			<File
+				RelativePath="vncabout.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncacceptdialog.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncauth.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncbuffer.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncclient.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncconndialog.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncdesktop.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\vncdesktopsink.cpp"
+				>
+			</File>
+			<File
+				RelativePath="vncDesktopSW.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncdesktopthread.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencodecorre.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencodehext.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencoder.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencoderCursor.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencoderre.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncEncodeTight.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncEncodeUltra.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\vncEncodeUltra2.cpp"
+				>
+			</File>
+			<File
+				RelativePath="vncEncodeZlib.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncEncodeZlibHex.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencodezrle.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vnchttpconnect.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncinsthandler.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vnckeymap.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncListDlg.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vnclog.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncmenu.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncMultiMonitor.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncntlm.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncOSVersion.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncproperties.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncpropertiesPoll.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncserver.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncservice.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncsetauth.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncsockconnect.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vnctimedmsgbox.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vsocket.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\common\win32_helpers.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\win32_helpers.h"
+				>
+			</File>
+			<File
+				RelativePath="winvnc.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="winvnc.rc"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="IPP|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\ZipUnZip32\ZipUnzip32.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\ZipUnZip32\ZipUnZip32.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\..\common\Clipboard.h"
+				>
+			</File>
+			<File
+				RelativePath="d3des.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\rfb\dh.h"
+				>
+			</File>
+			<File
+				RelativePath=".\dpi.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\DSMPlugin\DSMPlugin.h"
+				>
+			</File>
+			<File
+				RelativePath="HideDesktop.h"
+				>
+			</File>
+			<File
+				RelativePath="inifile.h"
+				>
+			</File>
+			<File
+				RelativePath=".\IPC.h"
+				>
+			</File>
+			<File
+				RelativePath="keysymdef.h"
+				>
+			</File>
+			<File
+				RelativePath=".\LinkLabel.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\md5.h"
+				>
+			</File>
+			<File
+				RelativePath="MultiMon.h"
+				>
+			</File>
+			<File
+				RelativePath="resource.h"
+				>
+			</File>
+			<File
+				RelativePath="rfb.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbMisc.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\rfb\rfbproto.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbRect.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbRegion.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbRegion_win32.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbRegion_X11.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbUpdateTracker.h"
+				>
+			</File>
+			<File
+				RelativePath="stdhdrs.h"
+				>
+			</File>
+			<File
+				RelativePath="TextChat.h"
+				>
+			</File>
+			<File
+				RelativePath="translate.h"
+				>
+			</File>
+			<File
+				RelativePath="videodriver.h"
+				>
+			</File>
+			<File
+				RelativePath="vnc.hh"
+				>
+			</File>
+			<File
+				RelativePath="vncabout.h"
+				>
+			</File>
+			<File
+				RelativePath="vncacceptdialog.h"
+				>
+			</File>
+			<File
+				RelativePath="vncauth.h"
+				>
+			</File>
+			<File
+				RelativePath="vncbuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="vncclient.h"
+				>
+			</File>
+			<File
+				RelativePath="vncconndialog.h"
+				>
+			</File>
+			<File
+				RelativePath="vnccorbaconnect.h"
+				>
+			</File>
+			<File
+				RelativePath="vncdesktop.h"
+				>
+			</File>
+			<File
+				RelativePath="vncdesktopthread.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencodecorre.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencodehext.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencodemgr.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencoder.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencoderre.h"
+				>
+			</File>
+			<File
+				RelativePath="vncEncodeTight.h"
+				>
+			</File>
+			<File
+				RelativePath="vncEncodeUltra.h"
+				>
+			</File>
+			<File
+				RelativePath="vncEncodeZlib.h"
+				>
+			</File>
+			<File
+				RelativePath="vncEncodeZlibHex.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencodezrle.h"
+				>
+			</File>
+			<File
+				RelativePath="vnchttpconnect.h"
+				>
+			</File>
+			<File
+				RelativePath="vncinsthandler.h"
+				>
+			</File>
+			<File
+				RelativePath="vnckeymap.h"
+				>
+			</File>
+			<File
+				RelativePath="vncListDlg.h"
+				>
+			</File>
+			<File
+				RelativePath="vnclog.h"
+				>
+			</File>
+			<File
+				RelativePath="vncmenu.h"
+				>
+			</File>
+			<File
+				RelativePath="vncpasswd.h"
+				>
+			</File>
+			<File
+				RelativePath="vncproperties.h"
+				>
+			</File>
+			<File
+				RelativePath="vncpropertiesPoll.h"
+				>
+			</File>
+			<File
+				RelativePath="vncpropPath.h"
+				>
+			</File>
+			<File
+				RelativePath="vncserver.h"
+				>
+			</File>
+			<File
+				RelativePath="vncservice.h"
+				>
+			</File>
+			<File
+				RelativePath="vncsetauth.h"
+				>
+			</File>
+			<File
+				RelativePath="vncsockconnect.h"
+				>
+			</File>
+			<File
+				RelativePath="vnctimedmsgbox.h"
+				>
+			</File>
+			<File
+				RelativePath="vsocket.h"
+				>
+			</File>
+			<File
+				RelativePath="vtypes.h"
+				>
+			</File>
+			<File
+				RelativePath="winvnc.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+			<File
+				RelativePath="res\background.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\background2.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\clipboardframe.class"
+				>
+			</File>
+			<File
+				RelativePath="res\descipher.class"
+				>
+			</File>
+			<File
+				RelativePath=".\res\Finger.cur"
+				>
+			</File>
+			<File
+				RelativePath="res\ico00001.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\icon1.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\icon2.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\optionsframe.class"
+				>
+			</File>
+			<File
+				RelativePath="res\rfbproto.class"
+				>
+			</File>
+			<File
+				RelativePath=".\res\runas.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\vdacc.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\vnc-1.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\vnc-1.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\vnc.bmp"
+				>
+			</File>
+			<File
+				RelativePath="vnc.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\vnc64.BMP"
+				>
+			</File>
+			<File
+				RelativePath="res\vnccanvas.class"
+				>
+			</File>
+			<File
+				RelativePath="res\vncviewer.class"
+				>
+			</File>
+			<File
+				RelativePath="res\vncviewer.jar"
+				>
+			</File>
+			<File
+				RelativePath="res\winvnc.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\world3a.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\ww-grn-sq2.ico"
+				>
+			</File>
+		</Filter>
+		<File
+			RelativePath="res\AuthPanel.class"
+			>
+		</File>
+		<File
+			RelativePath="..\building.txt"
+			>
+		</File>
+		<File
+			RelativePath="..\..\BUILDING.txt"
+			>
+		</File>
+		<File
+			RelativePath="res\ButtonPanel.class"
+			>
+		</File>
+		<File
+			RelativePath="res\DH.class"
+			>
+		</File>
+		<File
+			RelativePath=".\res\ding_dong.wav"
+			>
+		</File>
+		<File
+			RelativePath=".\res\ftpframe$strcomp.class"
+			>
+		</File>
+		<File
+			RelativePath="res\FTPFrame.class"
+			>
+		</File>
+		<File
+			RelativePath="..\history.txt"
+			>
+		</File>
+		<File
+			RelativePath="..\..\LICENCE.txt"
+			>
+		</File>
+		<File
+			RelativePath="..\README_BINARY.txt"
+			>
+		</File>
+		<File
+			RelativePath="res\RecordingFrame.class"
+			>
+		</File>
+		<File
+			RelativePath="res\SessionRecorder.class"
+			>
+		</File>
+		<File
+			RelativePath=".\VTune\winvnc.vpj"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/ica/win32/winvnc/winvnc/winvncVS2005.vcproj b/ica/win32/winvnc/winvnc/winvncVS2005.vcproj
new file mode 100644
index 0000000..d34fbf5
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvncVS2005.vcproj
@@ -0,0 +1,3213 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8,00"
+	Name="winvnc"
+	ProjectGUID="{C05AE605-1250-4F58-911B-EC99AE2C25AF}"
+	RootNamespace="winvnc"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\..\Debug"
+			IntermediateDirectory=".\..\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\..\Debug/winvnc.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\omnithread,..,..\.."
+				PreprocessorDefinitions="_DEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_CRT_SECURE_NO_WARNINGS;_VC80;_WIN32_IE=0x0500"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\..\Debug/winvnc.pch"
+				AssemblerListingLocation=".\..\Debug/"
+				ObjectFile=".\..\Debug/"
+				ProgramDataBaseFileName=".\..\Debug/"
+				BrowseInformation="1"
+				BrowseInformationFile=".\..\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="cl /nologo /MTd /Fo..\Debug\ /Fd..\Debug\ /c buildtime.cpp"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib winmm.lib version.lib userenv.lib wtsapi32.lib"
+				OutputFile=".\..\Debug/winvnc.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateManifest="false"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Debug/winvnc.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+				FixedBaseAddress="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Debug/winvnc.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\..\Release"
+			IntermediateDirectory=".\..\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\..\Release/winvnc.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\omnithread,..,..\.."
+				PreprocessorDefinitions="NDEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_VC80;_CRT_SECURE_NO_WARNINGS;AVILOG"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/winvnc.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="cl /nologo /MT /Fo..\Release\ /Fd..\Release\ /c buildtime.cpp"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib winmm.lib version.lib comctl32.lib wtsapi32.lib userenv.lib"
+				OutputFile=".\..\Release/winvnc.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				GenerateManifest="false"
+				ProgramDatabaseFile=".\..\Release/winvnc.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/winvnc.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName=".\..\Debug/winvnc.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\omnithread,..,..\.."
+				PreprocessorDefinitions="_DEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_CRT_SECURE_NO_WARNINGS;_VC80"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\..\Debug/winvnc.pch"
+				AssemblerListingLocation=".\..\Debug/"
+				ObjectFile=".\..\Debug/"
+				ProgramDataBaseFileName=".\..\Debug/"
+				BrowseInformation="1"
+				BrowseInformationFile=".\..\Debug/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="cl /nologo /MTd /Fo..\Debug\ /Fd..\Debug\ /c buildtime.cpp"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib winmm.lib version.lib userenv.lib wtsapi32.lib"
+				OutputFile=".\..\Debug/winvnc.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\..\Debug/winvnc.pdb"
+				SubSystem="2"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Debug/winvnc.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="3"
+				TypeLibraryName=".\..\Release/winvnc.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				AdditionalIncludeDirectories="..\omnithread,..,..\.."
+				PreprocessorDefinitions="NDEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_VC80;_CRT_SECURE_NO_WARNINGS;_X64"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\..\Release/winvnc.pch"
+				AssemblerListingLocation=".\..\Release/"
+				ObjectFile=".\..\Release/"
+				ProgramDataBaseFileName=".\..\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG"
+				Culture="2057"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+				CommandLine="cl /nologo /MT /Fo..\Release\ /Fd..\Release\ /c buildtime.cpp"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="ws2_32.lib winmm.lib version.lib comctl32.lib wtsapi32.lib userenv.lib"
+				OutputFile=".\..\Release/winvnc.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\..\Release/winvnc.pdb"
+				SubSystem="2"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\..\Release/winvnc.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="black_layered.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="buildtime.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\CpuUsage.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\CpuUsage.h"
+				>
+			</File>
+			<File
+				RelativePath="d3des.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\rfb\dh.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\DSMPlugin\DSMPlugin.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\Dtwinver.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\Dtwinver.h"
+				>
+			</File>
+			<File
+				RelativePath=".\getinfo.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\helpers.cpp"
+				>
+			</File>
+			<File
+				RelativePath="HideDesktop.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="inifile.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\IPC.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\lzo\minilzo.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\read_write_ini.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\rfbRegion_win32.cpp"
+				>
+			</File>
+			<File
+				RelativePath="rfbRegion_X11.cxx"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="rfbUpdateTracker.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="security.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\service.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\service_motor.cpp"
+				>
+			</File>
+			<File
+				RelativePath="stdhdrs.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="tableinitcmtemplate.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="tableinittctemplate.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="tabletranstemplate.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="TextChat.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="translate.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="videodriver.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="videodrivercheck.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\vistahook.cpp"
+				>
+			</File>
+			<File
+				RelativePath="vncabout.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncacceptdialog.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncauth.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncbuffer.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncclient.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncconndialog.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncdesktop.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath=".\vncdesktopsink.cpp"
+				>
+			</File>
+			<File
+				RelativePath="vncDesktopSW.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncdesktopthread.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencodecorre.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencodehext.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencoder.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencoderCursor.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencoderre.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncEncodeTight.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncEncodeUltra.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncEncodeZlib.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncEncodeZlibHex.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncencodezrle.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vnchttpconnect.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncinsthandler.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vnckeymap.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncListDlg.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vnclog.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncmenu.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncMultiMonitor.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncntlm.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncOSVersion.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncproperties.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncpropertiesPoll.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncserver.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncservice.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncsetauth.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vncsockconnect.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vnctimedmsgbox.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="vsocket.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\common\win32_helpers.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\common\win32_helpers.h"
+				>
+			</File>
+			<File
+				RelativePath="winvnc.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="winvnc.rc"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\ZipUnZip32\ZipUnzip32.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|x64"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						AdditionalIncludeDirectories=""
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="d3des.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\rfb\dh.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\DSMPlugin\DSMPlugin.h"
+				>
+			</File>
+			<File
+				RelativePath="inifile.h"
+				>
+			</File>
+			<File
+				RelativePath=".\IPC.h"
+				>
+			</File>
+			<File
+				RelativePath="keysymdef.h"
+				>
+			</File>
+			<File
+				RelativePath=".\LinkLabel.h"
+				>
+			</File>
+			<File
+				RelativePath="MultiMon.h"
+				>
+			</File>
+			<File
+				RelativePath="resource.h"
+				>
+			</File>
+			<File
+				RelativePath="rfb.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbMisc.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\rfb\rfbproto.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbRect.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbRegion.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbRegion_win32.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbRegion_X11.h"
+				>
+			</File>
+			<File
+				RelativePath="rfbUpdateTracker.h"
+				>
+			</File>
+			<File
+				RelativePath="stdhdrs.h"
+				>
+			</File>
+			<File
+				RelativePath="TextChat.h"
+				>
+			</File>
+			<File
+				RelativePath="translate.h"
+				>
+			</File>
+			<File
+				RelativePath="videodriver.h"
+				>
+			</File>
+			<File
+				RelativePath="vnc.hh"
+				>
+			</File>
+			<File
+				RelativePath="vncabout.h"
+				>
+			</File>
+			<File
+				RelativePath="vncacceptdialog.h"
+				>
+			</File>
+			<File
+				RelativePath="vncauth.h"
+				>
+			</File>
+			<File
+				RelativePath="vncbuffer.h"
+				>
+			</File>
+			<File
+				RelativePath="vncclient.h"
+				>
+			</File>
+			<File
+				RelativePath="vncconndialog.h"
+				>
+			</File>
+			<File
+				RelativePath="vnccorbaconnect.h"
+				>
+			</File>
+			<File
+				RelativePath="vncdesktop.h"
+				>
+			</File>
+			<File
+				RelativePath="vncdesktopthread.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencodecorre.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencodehext.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencodemgr.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencoder.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencoderre.h"
+				>
+			</File>
+			<File
+				RelativePath="vncEncodeTight.h"
+				>
+			</File>
+			<File
+				RelativePath="vncEncodeUltra.h"
+				>
+			</File>
+			<File
+				RelativePath="vncEncodeZlib.h"
+				>
+			</File>
+			<File
+				RelativePath="vncEncodeZlibHex.h"
+				>
+			</File>
+			<File
+				RelativePath="vncencodezrle.h"
+				>
+			</File>
+			<File
+				RelativePath="vnchttpconnect.h"
+				>
+			</File>
+			<File
+				RelativePath="vncinsthandler.h"
+				>
+			</File>
+			<File
+				RelativePath="vnckeymap.h"
+				>
+			</File>
+			<File
+				RelativePath="vncListDlg.h"
+				>
+			</File>
+			<File
+				RelativePath="vnclog.h"
+				>
+			</File>
+			<File
+				RelativePath="vncmenu.h"
+				>
+			</File>
+			<File
+				RelativePath="vncpasswd.h"
+				>
+			</File>
+			<File
+				RelativePath="vncproperties.h"
+				>
+			</File>
+			<File
+				RelativePath="vncpropertiesPoll.h"
+				>
+			</File>
+			<File
+				RelativePath="vncpropPath.h"
+				>
+			</File>
+			<File
+				RelativePath="vncserver.h"
+				>
+			</File>
+			<File
+				RelativePath="vncservice.h"
+				>
+			</File>
+			<File
+				RelativePath="vncsetauth.h"
+				>
+			</File>
+			<File
+				RelativePath="vncsockconnect.h"
+				>
+			</File>
+			<File
+				RelativePath="vnctimedmsgbox.h"
+				>
+			</File>
+			<File
+				RelativePath="vsocket.h"
+				>
+			</File>
+			<File
+				RelativePath="vtypes.h"
+				>
+			</File>
+			<File
+				RelativePath="winvnc.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\ZipUnZip32\ZipUnZip32.h"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+			<File
+				RelativePath="res\background.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\background2.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\clipboardframe.class"
+				>
+			</File>
+			<File
+				RelativePath="res\descipher.class"
+				>
+			</File>
+			<File
+				RelativePath=".\res\Finger.cur"
+				>
+			</File>
+			<File
+				RelativePath="HideDesktop.h"
+				>
+			</File>
+			<File
+				RelativePath="res\ico00001.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\icon1.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\icon2.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\optionsframe.class"
+				>
+			</File>
+			<File
+				RelativePath="res\rfbproto.class"
+				>
+			</File>
+			<File
+				RelativePath=".\res\sec.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\vdacc.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\vnc-1.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\vnc-1.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\vnc.bmp"
+				>
+			</File>
+			<File
+				RelativePath="vnc.bmp"
+				>
+			</File>
+			<File
+				RelativePath="res\vnc64.BMP"
+				>
+			</File>
+			<File
+				RelativePath="res\vnccanvas.class"
+				>
+			</File>
+			<File
+				RelativePath="res\vncviewer.class"
+				>
+			</File>
+			<File
+				RelativePath="res\vncviewer.jar"
+				>
+			</File>
+			<File
+				RelativePath="res\winvnc.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\world3a.ico"
+				>
+			</File>
+			<File
+				RelativePath="res\ww-grn-sq2.ico"
+				>
+			</File>
+		</Filter>
+		<File
+			RelativePath="res\AuthPanel.class"
+			>
+		</File>
+		<File
+			RelativePath="..\building.txt"
+			>
+		</File>
+		<File
+			RelativePath="..\..\BUILDING.txt"
+			>
+		</File>
+		<File
+			RelativePath="res\ButtonPanel.class"
+			>
+		</File>
+		<File
+			RelativePath="res\DH.class"
+			>
+		</File>
+		<File
+			RelativePath=".\res\ftpframe$strcomp.class"
+			>
+		</File>
+		<File
+			RelativePath="res\FTPFrame.class"
+			>
+		</File>
+		<File
+			RelativePath="..\history.txt"
+			>
+		</File>
+		<File
+			RelativePath="..\..\LICENCE.txt"
+			>
+		</File>
+		<File
+			RelativePath="..\README_BINARY.txt"
+			>
+		</File>
+		<File
+			RelativePath="res\RecordingFrame.class"
+			>
+		</File>
+		<File
+			RelativePath="res\SessionRecorder.class"
+			>
+		</File>
+		<File
+			RelativePath="winvnc.exe.manifest"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/ica/win32/winvnc/winvnc/winvnc_fr.rc b/ica/win32/winvnc/winvnc/winvnc_fr.rc
new file mode 100644
index 0000000..e4535bc
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvnc_fr.rc
@@ -0,0 +1,686 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// French (France) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_TEXTCHAT_DLG DIALOGEX 0, 0, 307, 175
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CAPTION
+CAPTION " Chat - Ultr at VNC"
+FONT 8, "MS Sans Serif", 0, 0, 0x1
+BEGIN
+    EDITTEXT        IDC_INPUTAREA_EDIT,4,138,255,34,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_WANTRETURN | NOT WS_BORDER | 
+                    WS_VSCROLL,WS_EX_STATICEDGE
+    PUSHBUTTON      "Fermer",IDCANCEL,264,160,39,11
+    PUSHBUTTON      "",IDOK,301,0,6,6,NOT WS_VISIBLE
+    CONTROL         "",IDC_CHATAREA_EDIT,"RICHEDIT",ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | 
+                    WS_VSCROLL | WS_TABSTOP,4,5,300,130,WS_EX_STATICEDGE
+    PUSHBUTTON      "Envoyer",IDC_SEND_B,264,138,39,19,BS_MULTILINE
+    LTEXT           "",IDC_STATIC_SPLIT,5,127,298,8,SS_NOTIFY
+END
+
+IDD_LIST_DLG DIALOGEX 0, 0, 164, 116
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CAPTION | 
+    WS_SYSMENU
+EXSTYLE WS_EX_TOOLWINDOW
+CAPTION " Liste des Clients - Ultr at VNC"
+FONT 8, "MS Sans Serif", 0, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON   "Fermer",IDOK,106,94,50,14
+    PUSHBUTTON      "Annuler",IDCANCEL,106,78,50,14,NOT WS_VISIBLE
+    LTEXT           "Clients connectés :",IDC_STATIC,5,4,105,8
+    LISTBOX         IDC_VIEWERS_LISTBOX,7,16,91,93,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP,WS_EX_STATICEDGE
+    PUSHBUTTON      "Tuer ce Client",IDC_KILL_B,106,17,50,14
+    PUSHBUTTON      "t'Chat avec   ce Client",IDC_TEXTCHAT_B,106,35,50,22,
+                    BS_MULTILINE
+END
+
+IDD_ABOUT DIALOGEX 0, 0, 282, 156
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION " A propos de WinVNC"
+FONT 8, "MS Sans Serif", 0, 0, 0x1
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,8,132,54,16
+    CONTROL         139,IDC_VNCLOGO,"Static",SS_BITMAP | SS_CENTERIMAGE | 
+                    SS_SUNKEN,7,5,53,46,WS_EX_TRANSPARENT
+    LTEXT           "Ultr at VNC Win32 Serveur v1.0.0 RC 12",IDC_VERSION,73,5,
+                    195,9
+    LTEXT           "Copyright © 2002-2003 Ultr at VNC Team\nCopyright © 2001-2002 Sam - eSVNC \nCopyright © 1999-2002 Rudi D. V. - VdaccVNC \nCopyright © 2001 Harakan Software - PalmVNC\nCopyright © 1999-2002 Const. Kaplinsky - TightVNC \n",
+                    IDC_NAME,74,27,202,41
+    LTEXT           "Pour plus d'informations et liens, merci de visiter: \nhttp://ultravnc.sf.net",
+                    IDC_WWW,73,129,182,19
+    LTEXT           "Compilation:",IDC_BUILDTEXT,74,16,38,10
+    LTEXT           "BuildTime",IDC_BUILDTIME,120,16,92,10
+    LTEXT           "Copyright © 2002 RealVNC Ltd. - RealVNC\nCopyright © 1999-2002 Tridia Corporation - TridiaVNC \nCopyright © 1994-2001 AT&&T Laboratories Cambridge/Olivetti Research Ltd. - VNC",
+                    IDC_STATIC,74,67,203,32
+    LTEXT           "Copyright © 1990-2002 Info-ZIP\nCopyright © 1996-2002 Markus Franz Xaver Johannes Oberhumer - Mini LZO library",
+                    IDC_STATIC,74,99,200,26
+END
+
+IDD_OUTGOING_CONN DIALOG DISCARDABLE  0, 0, 243, 47
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | 
+    WS_SYSMENU
+CAPTION "Connexion sortante (Ajout Nouveau Viewer Client)"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,190,6,46,14
+    PUSHBUTTON      "Annuler",IDCANCEL,190,25,46,15
+    EDITTEXT        IDC_HOSTNAME_EDIT,58,6,126,14,ES_AUTOHSCROLL
+    RTEXT           "Viewer VNC :",IDC_HOSTNAME_STATIC,7,6,47,14,
+                    SS_CENTERIMAGE
+    CTEXT           "(La cible doit avoir un VNCViewer en mode 'écoute')",
+                    IDC_NOTE_STATIC,7,25,178,15,SS_CENTERIMAGE
+END
+
+IDD_ACCEPT_CONN DIALOG DISCARDABLE  0, 0, 186, 95
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
+CAPTION "Accepter la connexion WinVNC?"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "&Accepter",IDACCEPT,7,74,53,14
+    PUSHBUTTON      "&Rejeter",IDREJECT,130,74,49,14
+    CTEXT           "WinVNC reçoit une connexion entrante depuis",
+                    IDC_STATIC_TEXT1,7,7,172,17,SS_CENTERIMAGE
+    CTEXT           "<unknown host>",IDC_ACCEPT_IP,7,30,172,16,
+                    SS_CENTERIMAGE
+    CTEXT           "Souhaitez-vous Accepter ou Rejeter cette connexion?",
+                    IDC_STATIC_TEXT,7,50,172,15,SS_CENTERIMAGE
+    CTEXT           "AutoRejeter:",IDC_ACCEPT_TIMEOUT,60,74,70,14,
+                    SS_CENTERIMAGE
+END
+
+IDD_PROPERTIES DIALOG DISCARDABLE  0, 0, 365, 263
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | 
+    WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Propriétés du Serveur Ultr at VNC"
+FONT 8, "MS Sans Serif"
+BEGIN
+    PUSHBUTTON      "&Annuler",IDCANCEL,319,244,41,14
+    DEFPUSHBUTTON   "&OK",IDOK,194,244,44,14
+    GROUPBOX        "Connexions entrantes",IDC_CONNECT_BORDER,5,5,165,122
+    CONTROL         "Accepter les connexions Socket",IDC_CONNECT_SOCK,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,12,13,123,13
+    CONTROL         "Activer CORBA",IDC_CONNECT_CORBA,"Button",
+                    BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,99,180,66,
+                    10
+    EDITTEXT        IDC_DISPLAYNO,71,55,29,12,ES_AUTOHSCROLL | ES_NUMBER
+    EDITTEXT        IDC_PASSWORD,86,26,70,13,ES_PASSWORD | ES_AUTOHSCROLL
+    GROUPBOX        "Détection des Modifications de l'écran du Serveur",
+                    IDC_UPDATE_BORDER,176,60,184,87
+    CONTROL         "Tout l'écran ( Rapide )",IDC_POLL_FULLSCREEN,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,185,70,93,13
+    CONTROL         "Fenêtres Consoles Uniquement",IDC_CONSOLE_ONLY,"Button",
+                    BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,285,70,71,18
+    CONTROL         "Fenêtre au premier plan ---|",IDC_POLL_FOREGROUND,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,185,84,108,9
+    CONTROL         "Fenêtre sous le curseur",IDC_POLL_UNDER_CURSOR,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,185,93,96,16
+    CONTROL         "Sur évenements reçus par Fenêtre",IDC_ONEVENT_ONLY,
+                    "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,285,
+                    88,69,21
+    CONTROL         "Désactiver le clavier et le pointeur distants",
+                    IDC_DISABLE_INPUTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    185,14,153,15
+    PUSHBUTTON      "&Enregistrer",IDC_APPLY,259,244,43,14
+    CONTROL         "Désactiver le clavier et le pointeur localement",
+                    IDC_DISABLE_LOCAL_INPUTS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,185,27,162,13
+    GROUPBOX        "Paramètres de connexion",IDC_CONNSETTINGS_BORDER,176,5,
+                    184,51
+    CONTROL         "Supprimer le papier peint du Bureau",
+                    IDC_REMOVE_WALLPAPER,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,185,42,145,10
+    LTEXT           "Mot de passe:",IDC_PASSWORD_LABEL,27,27,55,11,
+                    SS_CENTERIMAGE
+    CONTROL         "Activer le visualiseur Java (en http)",IDC_CONNECT_HTTP,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,98,152,8
+    GROUPBOX        "Quand le dernier client se déconnecte",IDC_LOCKSETTINGS,
+                    5,129,165,51
+    CONTROL         "Ne rien faire",IDC_LOCKSETTING_NOTHING,"Button",
+                    BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,12,141,80,12
+    CONTROL         "Fermer la session",IDC_LOCKSETTING_LOGOFF,"Button",
+                    BS_AUTORADIOBUTTON | WS_TABSTOP,12,166,80,11
+    CONTROL         "Vérrouiller la session (Win2000)",IDC_LOCKSETTING_LOCK,
+                    "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,12,153,120,13
+    LTEXT           "Numero d'affichage ou Port à utiliser:",
+                    IDC_DISPLAY_NO_LABEL,11,44,120,9,SS_CENTERIMAGE
+    CONTROL         "Auto",IDC_AUTO_DISPLAY_NO,"Button",BS_AUTOCHECKBOX | 
+                    NOT WS_VISIBLE | WS_TABSTOP,138,12,32,13
+    CONTROL         "Partager",IDC_SINGLE_WINDOW,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,185,196,40,10
+    EDITTEXT        IDC_NAME_APPLI,231,195,119,13,ES_AUTOHSCROLL
+    GROUPBOX        "Partager seulement la fenêtre nommée :",IDC_STATIC,176,
+                    185,185,26,BS_LEFT
+    GROUPBOX        "Divers",IDC_STATIC,5,183,165,76
+    CONTROL         "Autoriser le Transfert de Fichiers",IDC_FILETRANSFER,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,208,118,10
+    LTEXT           "Echelle par défaut de l'écran:",IDC_STATIC,24,245,96,8
+    LTEXT           "1 / ",IDC_STATIC,121,245,12,8
+    EDITTEXT        IDC_SCALE,134,243,12,12,ES_AUTOHSCROLL
+    GROUPBOX        "Plugin DSM (pour modifier le flux de données)",
+                    IDC_STATIC,176,151,185,30
+    CONTROL         "Utiliser",IDC_PLUGIN_CHECK,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,185,165,34,10
+    COMBOBOX        IDC_PLUGINS_COMBO,221,163,102,86,CBS_DROPDOWN | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "Config",IDC_PLUGIN_BUTTON,326,163,27,12
+    CONTROL         "Auto",IDC_PORTNO_AUTO,"Button",BS_AUTORADIOBUTTON,134,
+                    45,31,10
+    CONTROL         "Affichage",IDC_SPECDISPLAY,"Button",BS_AUTORADIOBUTTON,
+                    12,57,44,10
+    CONTROL         "Ports",IDC_SPECPORT,"Button",BS_AUTORADIOBUTTON,12,70,
+                    30,10
+    EDITTEXT        IDC_PORTRFB,71,68,29,12,ES_AUTOHSCROLL
+    EDITTEXT        IDC_PORTHTTP,126,68,31,12,ES_AUTOHSCROLL
+    RTEXT           "N°",IDC_STATIC,57,57,9,8
+    RTEXT           "Main:",IDC_STATIC,47,70,18,8
+    RTEXT           "Http:",IDC_STATIC,105,70,17,8
+    CONTROL         "Uiliser le Driver Video de détection bas niveau",
+                    IDC_DRIVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,185,122,
+                    162,10
+    CONTROL         "Utiliser la Dll de détection systême (Hookdll)",
+                    IDC_HOOK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,185,111,
+                    158,10
+    CONTROL         "Activer Xdmcp (Connexion  X11)",IDC_CONNECT_XDMCP,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,109,119,10
+    CONTROL         "Autoriser l'écran vide ",IDC_BLANK,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,11,196,146,10
+    CONTROL         "Faible précision ( en général plus rapide)",
+                    IDC_TURBOMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,185,
+                    134,158,10
+    CONTROL         "Enregistrer plus d'infos dans WinVNC.log",IDC_LOG,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,220,144,10
+    CONTROL         "Autoriser les connexions Loopback",IDC_ALLOWLOOPBACK,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,232,132,10
+    GROUPBOX        "Demande de permission pour connection entrante",
+                    IDC_STATIC,175,214,186,26
+    CONTROL         "Afficher la demande",IDQUERY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,185,226,78,10
+    LTEXT           "Expiration:",IDC_STATIC,280,226,34,8
+    EDITTEXT        IDQUERYTIMEOUT,317,224,27,12,ES_AUTOHSCROLL
+    LTEXT           "s",IDC_STATIC,347,225,8,8
+    LTEXT           "Login MS Obligatoire (User/Pass)",IDC_STATIC,36,86,114,
+                    8
+    PUSHBUTTON      "MS",IDC_MSLOGON,12,85,15,9
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    IDD_TEXTCHAT_DLG, DIALOG
+    BEGIN
+        LEFTMARGIN, 5
+        RIGHTMARGIN, 302
+        TOPMARGIN, 5
+        BOTTOMMARGIN, 170
+    END
+
+    IDD_LIST_DLG, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 157
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 109
+    END
+
+    IDD_ABOUT, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 275
+        VERTGUIDE, 80
+        VERTGUIDE, 90
+        VERTGUIDE, 100
+        VERTGUIDE, 120
+        TOPMARGIN, 5
+        BOTTOMMARGIN, 148
+        HORZGUIDE, 9
+        HORZGUIDE, 20
+        HORZGUIDE, 30
+        HORZGUIDE, 40
+        HORZGUIDE, 50
+        HORZGUIDE, 60
+        HORZGUIDE, 70
+        HORZGUIDE, 80
+        HORZGUIDE, 90
+        HORZGUIDE, 100
+    END
+
+    IDD_OUTGOING_CONN, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 236
+        VERTGUIDE, 50
+        VERTGUIDE, 55
+        VERTGUIDE, 185
+        VERTGUIDE, 190
+        TOPMARGIN, 6
+        BOTTOMMARGIN, 40
+        HORZGUIDE, 20
+        HORZGUIDE, 25
+    END
+
+    IDD_ACCEPT_CONN, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 179
+        VERTGUIDE, 60
+        VERTGUIDE, 130
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 88
+        HORZGUIDE, 24
+        HORZGUIDE, 30
+        HORZGUIDE, 46
+        HORZGUIDE, 50
+        HORZGUIDE, 65
+        HORZGUIDE, 74
+    END
+
+    IDD_PROPERTIES, DIALOG
+    BEGIN
+        LEFTMARGIN, 5
+        RIGHTMARGIN, 360
+        VERTGUIDE, 10
+        VERTGUIDE, 12
+        VERTGUIDE, 20
+        VERTGUIDE, 70
+        VERTGUIDE, 75
+        VERTGUIDE, 85
+        VERTGUIDE, 90
+        VERTGUIDE, 95
+        VERTGUIDE, 115
+        VERTGUIDE, 120
+        VERTGUIDE, 150
+        VERTGUIDE, 155
+        VERTGUIDE, 160
+        VERTGUIDE, 165
+        VERTGUIDE, 170
+        VERTGUIDE, 176
+        VERTGUIDE, 220
+        VERTGUIDE, 225
+        VERTGUIDE, 270
+        VERTGUIDE, 275
+        VERTGUIDE, 280
+        VERTGUIDE, 330
+        TOPMARGIN, 5
+        BOTTOMMARGIN, 256
+        HORZGUIDE, 15
+        HORZGUIDE, 20
+        HORZGUIDE, 25
+        HORZGUIDE, 30
+        HORZGUIDE, 40
+        HORZGUIDE, 45
+        HORZGUIDE, 50
+        HORZGUIDE, 55
+        HORZGUIDE, 60
+        HORZGUIDE, 65
+        HORZGUIDE, 70
+        HORZGUIDE, 75
+        HORZGUIDE, 85
+        HORZGUIDE, 88
+        HORZGUIDE, 94
+        HORZGUIDE, 98
+        HORZGUIDE, 109
+        HORZGUIDE, 114
+        HORZGUIDE, 120
+        HORZGUIDE, 125
+        HORZGUIDE, 134
+        HORZGUIDE, 140
+        HORZGUIDE, 144
+        HORZGUIDE, 149
+        HORZGUIDE, 155
+        HORZGUIDE, 163
+        HORZGUIDE, 165
+        HORZGUIDE, 241
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+#ifndef _MAC
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,12
+ PRODUCTVERSION 1,0,0,12
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040c04e4"
+        BEGIN
+            VALUE "Comments", "\0"
+            VALUE "CompanyName", "UltraVNC\0"
+            VALUE "FileDescription", "VNC serveur pour Win32\0"
+            VALUE "FileVersion", "1, 0, 0, 12\0"
+            VALUE "InternalName", "WinVNC\0"
+            VALUE "LegalCopyright", "Copyright UltraVNC\0"
+            VALUE "LegalTrademarks", "VNC\0"
+            VALUE "OriginalFilename", "WinVNC.exe\0"
+            VALUE "PrivateBuild", "\0"
+            VALUE "ProductName", "Ultravnc\0"
+            VALUE "ProductVersion", "1, 0, 0, 12\0"
+            VALUE "SpecialBuild", "\0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x40c, 1252
+    END
+END
+
+#endif    // !_MAC
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_WINVNC              ICON    DISCARDABLE     "res\\winvnc.ico"
+IDI_FLASH               ICON    DISCARDABLE     "res\\icon1.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_TRAYMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "tray"
+    BEGIN
+        MENUITEM "&Propriétés",                 ID_PROPERTIES
+        MENUITEM SEPARATOR
+        MENUITEM "Aide en ligne",               ID_ONLINEHELP
+        MENUITEM "Page d'accueil",              ID_HOME
+        MENUITEM SEPARATOR
+        MENUITEM "Ajouter un &Nouveau client",  ID_OUTGOING_CONN
+        MENUITEM "&Déconnecter tous les clients", ID_KILLCLIENTS
+        MENUITEM SEPARATOR
+        MENUITEM "&Lister tous les clients",    ID_LISTCLIENTS
+        MENUITEM SEPARATOR
+        MENUITEM "&A propos de WinVNC",         ID_ABOUT
+        MENUITEM SEPARATOR
+        MENUITEM "&Fermer WinVNC",              ID_CLOSE
+    END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// JAVAARCHIVE
+//
+
+IDR_VNCVIEWER_JAR       JAVAARCHIVE DISCARDABLE "res\\vncviewer.jar"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// JAVACLASS
+//
+
+IDR_AUTHPANEL_CLASS     JAVACLASS DISCARDABLE   "res\\AuthPanel.class"
+IDR_CLIPBOARDFRAME_CLASS JAVACLASS DISCARDABLE   "res\\clipboardFrame.class"
+IDR_OPTIONSFRAME_CLASS  JAVACLASS DISCARDABLE   "res\\optionsFrame.class"
+IDR_RFBPROTO_CLASS      JAVACLASS DISCARDABLE   "res\\rfbProto.class"
+IDR_VNCCANVAS_CLASS     JAVACLASS DISCARDABLE   "res\\vncCanvas.class"
+IDR_VNCVIEWER_CLASS     JAVACLASS DISCARDABLE   "res\\vncviewer.class"
+IDR_BUTTONPANEL_CLASS   JAVACLASS DISCARDABLE   "res\\ButtonPanel.class"
+IDR_DESCIPHER_CLASS     JAVACLASS DISCARDABLE   "res\\DesCipher.class"
+IDR_RECFRAME_CLASS      JAVACLASS DISCARDABLE   "res\\RecordingFrame.class"
+IDR_SESSIONREC_CLASS    JAVACLASS DISCARDABLE   "res\\SessionRecorder.class"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_LOGO64              BITMAP  DISCARDABLE     "RES\\vnc64.BMP"
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDI_WINVNC              "WinVNC"
+    IDS_WARNING             "ALERTE: Par défaut, cette session n'utilise pas de cryptage. Ne l'utilisez pas pour envoyer des données sensibles sans vous assurer que votre connexion est sécurisée.\n\n"
+END
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    ID_FAILED_INIT          "Echec d'initialisation du système de socket"
+    ID_WINVNC_USAGE         "Usage de WinVNC"
+    ID_ANOTHER_INST         "Une autre instance de WinVNC est déjà lancée"
+    ID_NO_EXIST_INST        "Aucune instance de WinVNC ne peut être contactée"
+    ID_UNABLE_INST          "Impossible d'installer le service WinVNC"
+    ID_SCM_NOT_HERE         "Le SCM ne peut être contacté - le service WinVNC n'a pas été installé"
+    ID_SERV_NOT_REG         "Le service WinVNC ne peut pas être enregistré"
+    ID_SERV_FAIL_ST         "Le service WinVNC échoue au démarrage"
+END
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    ID_SERV_CT_MISS         "Le ""Service Control Manager"" ne peut être contacté - le service WinVNC n'a pas été enregistré"
+    ID_SERV_OLD_REG         "Le service WinVNC est déjà enregistré"
+    ID_SERVHELP_UNAB        "ATTENTION:impossible d'installer l'icône d'aide au service\nLes paramètres globaux spécifique utilisateur ne seront pas chargé"
+    ID_SERV_CT_UNREG        "Le ""Service Control Manager"" ne peut être contacté - le service WinVNC n'a pas été désenregistré"
+    ID_SERV_NOT_UNRG        "Le service WinVNC ne peut pas être désenregistré"
+    ID_SERV_NCONTACT        "Le service WinVNC ne peut pas être contacté"
+    ID_SERVHELP_NREM        "ATTENTION: l'entrée ""ServiceHelper"" de la base de registre ne peut être supprimé"
+    ID_SERV_NOT_STOP        "Le service WinVNC ne peut pas être arrété"
+    ID_SERV_MK_UNREG        "Le service WinVNC est déjà marqué pour être désenregistré"
+    ID_SERV_NT_FOUND        "Le service WinVNC est introuvable"
+    ID_WINVNC_ERROR         "Erreur WinVNC"
+    ID_WINVNC_WARNIN        "Alerte WinVNC"
+    ID_PLUGIN_LOADIN        "Chargement du Plugin"
+    ID_NO_PASSWD_NO_OVERRIDE_ERR 
+                            "Aucun mot de passe n'a été precisé & cette machine a été préconfigurée pour interdire aux utilisateurs de définir le leur.\nVous devez contacter un Administrateur pour configurer WinVNC correctement."
+    ID_NO_PASSWD_NO_OVERRIDE_WARN 
+                            "ATTENTION : Cette machine a été préconfigurée pour permettre d'accepter\ndes connexions non authentifiées et pour interdire aux utilisateurs d'activer l'authentification."
+    ID_NO_PASSWD_NO_LOGON_WARN 
+                            "ATTENTION : Cette machine n'a pas de mot de passe défini par défaut. WinVNC va ouvrir la fenêtre de propriétés pour permettre d'en saisir un. "
+END
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    ID_NO_OVERRIDE_ERR      "Cette machine a été préconfigurée avec des propriétés qui ne peuvent être réécrites. Ces paramètres préconfigurés ne peuvent être modifiés que par un Administrateur Système."
+    ID_NO_CURRENT_USER_ERR  "Les paramètres WinVNC pour cet utilisateur ne sont pas valides actuellement."
+    ID_CANNOT_EDIT_DEFAULT_PREFS 
+                            "Vous n'avez pas de droits suffisants pour éditer les paramètres par défauts de WinVNC."
+    ID_NO_PASSWORD_WARN     "ATTENTION : Lancer WinVNC sans définir un mot de passe est un trou de sécurité dangereux!\nTant qu'un mot de passe n'est pas défini, WinVNC n'acceptera pas de connexion."
+    ID_PLUGIN_NOT_LOAD      "Le plugin ne peut être chargé.\n\rSVP, vérifier son intégrité."
+    ID_MB1                  "MB1"
+    ID_WVNC                 "WVNC"
+    ID_AUTHAD_NOT_FO        "Vous avez sélectionné ms-logon, mais la dll\nauthad.dll n'a pas été trouvée.Vérifiez votre installation"
+    ID_WARNING              "ATTENTION"
+    ID_AUTH_NOT_FO          "Vous avez sélectionné ms-logon, mais la dll\nauth.dll n'a pas été trouvée.Vérifiez votre installation"
+    ID_DESKTOP_BITBLT_ROOT  "Bureau VNC : le driver ne supporte pas ""BitBlt""\nWinVNC ne peut pas utiliser ce driver vidéo."
+    ID_DESKTOP_BITBLT_MEM   "Bureau VNC : la mémoire ne supporte pas ""GetDIBits""\nWinVNC ne peut pas utiliser ce driver vidéo."
+    ID_DESKTOP_PLANAR_NOTC  "Bureau VNC : l'affichage courant est ""PLANAR"", et pas ""CHUNKY""!\nWinVNC ne peut pas utiliser ce driver vidéo."
+    ID_FAILED_CONNECT_LISTING_VIEW 
+                            "Echec de connexion au visualiseur en mode écoute"
+    ID_OUTGOING_CONNECTION  "Connexion sortante"
+    ID_UNABLE_PROC_MSLOGON  "Impossible d'utiliser MS Logon"
+END
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    ID_RICHED32_UNLOAD      "Impossible de charger le contrôle RichEdit (RICHED32.DLL)!"
+    ID_RICHED32_DLL_LD      "Chargement de la Dll RichEdit"
+    ID_SERV_SUCCESS_INST    "Le service WinVNC a été installé avec succès\nLe service va être lancé maintenant et sera automatiquement\nlancé au démarrage de la machine"
+    ID_SERV_SUCCESS_REG     "Le service WinVNC a été enregistré avec succès\nLe service peut être lancé depuis le panneau de configuration, et\n sera automatiquement lancé qu'au démarrage de la machine"
+    ID_SERV_SUCCESS_UNREG   "Le service WinVNC a été désenregistré"
+    ID_ULTRAVNC_TEXTCHAT    "Le client sélectionné n'est pas un visualiseur Ultr at VNC !\n Il ne supporte peut être pas le t'Chat\n"
+    ID_ULTRAVNC_WARNING     "Alerte Ultr at VNC"
+    ID_NO_PLUGIN_DETECT     "Pas de Plugin détecté..."
+    ID_CHAT_WITH_S_ULTRAVNC " Chat avec <%s> - Ultr at VNC"
+    ID_CURRENT_USER_PROP    "WinVNC: Propriétés de l'utilisateur courant"
+    ID_DEFAULT_SYST_PROP    "WinVNC: Propriétés par défaut du système"
+    ID_AUTOREJECT_U         "Auto Rejet:%u"
+END
+
+#endif    // French (France) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Dutch (Belgium) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLB)
+#ifdef _WIN32
+LANGUAGE LANG_DUTCH, SUBLANG_DUTCH_BELGIAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_MSLOGON DIALOG DISCARDABLE  0, 0, 186, 135
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "MS logon setup"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,17,114,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,110,114,50,14
+    CONTROL         "Login MS Obligatoire (User/Pass)",IDC_MSLOGON_CHECKD,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,7,121,10
+    EDITTEXT        IDC_GROUP1,17,35,93,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_GROUP2,17,56,93,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_GROUP3,17,77,93,14,ES_AUTOHSCROLL
+    CONTROL         "",IDC_CHECKG1L,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    123,36,13,10
+    CONTROL         "",IDC_CHECKG2L,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    123,58,16,8
+    CONTROL         "",IDC_CHECKG3L,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    123,80,16,8
+    CONTROL         "",IDC_CHECKG1D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    149,38,16,8
+    CONTROL         "",IDC_CHECKG2D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    149,58,16,8
+    CONTROL         "",IDC_CHECKG3D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    149,80,16,8
+    LTEXT           "Local",IDC_STATIC,123,24,18,8
+    LTEXT           "Domain",IDC_STATIC,149,24,25,8
+    LTEXT           "Group",IDC_STATIC,47,24,20,8
+    LTEXT           "1",IDC_STATIC,7,38,8,8
+    LTEXT           "2",IDC_STATIC,7,58,8,8
+    LTEXT           "3",IDC_STATIC,7,80,8,8
+    LTEXT           "Group 1 2= Full Access    Group 3=ReadOnly",IDC_STATIC,
+                    17,97,162,8
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    IDD_MSLOGON, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 179
+        VERTGUIDE, 17
+        VERTGUIDE, 110
+        VERTGUIDE, 123
+        VERTGUIDE, 149
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 128
+        HORZGUIDE, 46
+        HORZGUIDE, 66
+        HORZGUIDE, 88
+        HORZGUIDE, 105
+        HORZGUIDE, 114
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+#endif    // Dutch (Belgium) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/ica/win32/winvnc/winvnc/winvnc_vs90_Release_Win32.lnt b/ica/win32/winvnc/winvnc/winvnc_vs90_Release_Win32.lnt
new file mode 100644
index 0000000..3bd6324
--- /dev/null
+++ b/ica/win32/winvnc/winvnc/winvnc_vs90_Release_Win32.lnt
@@ -0,0 +1,80 @@
+
+// Generated by Visual Lint 1.5.8.77 from file: D:\UltraVNC-src\UltraVNC Project Root\UltraVNC\winvnc\winvnc\winvnc.vcproj
+// -dConfiguration=Release|Win32
+//
+-D_MBCS                         // CharacterSet = "2"
+-DNDEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_VC80;_CRT_SECURE_NO_WARNINGS
+                                // PreprocessorDefinitions = "NDEBUG;__x86__;__WIN32__;WIN32;_WINDOWS;_WIN32_WINNT=0x501;XMD_H;_WINSTATIC;_VC80;_CRT_SECURE_NO_WARNINGS"
+-D_NATIVE_WCHAR_T_DEFINED       // TreatWChar_tAsBuiltInType = "TRUE"
+-D_MT                           // RuntimeLibrary = "0"
+
+                                // AdditionalIncludeDirectories = "..\omnithread,..,..\.."
+-i"..\omnithread"               // 
+-i".."                          // 
+-i"..\.."                       // 
+
+black_layered.cpp               // RelativePath = "black_layered.cpp"
+buildtime.cpp                   // RelativePath = "buildtime.cpp"
+d3des.c                         // RelativePath = "d3des.c"
+..\..\rfb\dh.cpp                // RelativePath = "..\..\rfb\dh.cpp"
+..\..\DSMPlugin\DSMPlugin.cpp   // RelativePath = "..\..\DSMPlugin\DSMPlugin.cpp"
+helpers.cpp                     // RelativePath = "helpers.cpp"
+HideDesktop.cpp                 // RelativePath = "HideDesktop.cpp"
+inifile.cpp                     // RelativePath = "inifile.cpp"
+IPC.cpp                         // RelativePath = "IPC.cpp"
+LinkLabel.cpp                   // RelativePath = "LinkLabel.cpp"
+..\..\lzo\minilzo.c             // RelativePath = "..\..\lzo\minilzo.c"
+read_write_ini.cpp              // RelativePath = "read_write_ini.cpp"
+rfbRegion_X11.cxx               // RelativePath = "rfbRegion_X11.cxx"
+rfbUpdateTracker.cpp            // RelativePath = "rfbUpdateTracker.cpp"
+security.cpp                    // RelativePath = "security.cpp"
+service.cpp                     // RelativePath = "service.cpp"
+service_motor.cpp               // RelativePath = "service_motor.cpp"
+stdhdrs.cpp                     // RelativePath = "stdhdrs.cpp"
+tableinitcmtemplate.cpp         // RelativePath = "tableinitcmtemplate.cpp"
+tableinittctemplate.cpp         // RelativePath = "tableinittctemplate.cpp"
+tabletranstemplate.cpp          // RelativePath = "tabletranstemplate.cpp"
+TextChat.cpp                    // RelativePath = "TextChat.cpp"
+translate.cpp                   // RelativePath = "translate.cpp"
+videodriver.cpp                 // RelativePath = "videodriver.cpp"
+videodrivercheck.cpp            // RelativePath = "videodrivercheck.cpp"
+vistahook.cpp                   // RelativePath = "vistahook.cpp"
+vncabout.cpp                    // RelativePath = "vncabout.cpp"
+vncacceptdialog.cpp             // RelativePath = "vncacceptdialog.cpp"
+vncauth.c                       // RelativePath = "vncauth.c"
+vncbuffer.cpp                   // RelativePath = "vncbuffer.cpp"
+vncclient.cpp                   // RelativePath = "vncclient.cpp"
+vncconndialog.cpp               // RelativePath = "vncconndialog.cpp"
+vncdesktop.cpp                  // RelativePath = "vncdesktop.cpp"
+vncDesktopSW.cpp                // RelativePath = "vncDesktopSW.cpp"
+vncdesktopthread.cpp            // RelativePath = "vncdesktopthread.cpp"
+vncencodecorre.cpp              // RelativePath = "vncencodecorre.cpp"
+vncencodehext.cpp               // RelativePath = "vncencodehext.cpp"
+vncencoder.cpp                  // RelativePath = "vncencoder.cpp"
+vncencoderCursor.cpp            // RelativePath = "vncencoderCursor.cpp"
+vncencoderre.cpp                // RelativePath = "vncencoderre.cpp"
+vncEncodeTight.cpp              // RelativePath = "vncEncodeTight.cpp"
+vncEncodeUltra.cpp              // RelativePath = "vncEncodeUltra.cpp"
+vncEncodeZlib.cpp               // RelativePath = "vncEncodeZlib.cpp"
+vncEncodeZlibHex.cpp            // RelativePath = "vncEncodeZlibHex.cpp"
+vncencodezrle.cpp               // RelativePath = "vncencodezrle.cpp"
+vnchttpconnect.cpp              // RelativePath = "vnchttpconnect.cpp"
+vncinsthandler.cpp              // RelativePath = "vncinsthandler.cpp"
+vnckeymap.cpp                   // RelativePath = "vnckeymap.cpp"
+vncListDlg.cpp                  // RelativePath = "vncListDlg.cpp"
+vnclog.cpp                      // RelativePath = "vnclog.cpp"
+vncmenu.cpp                     // RelativePath = "vncmenu.cpp"
+vncMultiMonitor.cpp             // RelativePath = "vncMultiMonitor.cpp"
+vncntlm.cpp                     // RelativePath = "vncntlm.cpp"
+vncOSVersion.cpp                // RelativePath = "vncOSVersion.cpp"
+vncproperties.cpp               // RelativePath = "vncproperties.cpp"
+vncpropertiesPoll.cpp           // RelativePath = "vncpropertiesPoll.cpp"
+vncserver.cpp                   // RelativePath = "vncserver.cpp"
+vncservice.cpp                  // RelativePath = "vncservice.cpp"
+vncsetauth.cpp                  // RelativePath = "vncsetauth.cpp"
+vncsockconnect.cpp              // RelativePath = "vncsockconnect.cpp"
+vnctimedmsgbox.cpp              // RelativePath = "vnctimedmsgbox.cpp"
+vsocket.cpp                     // RelativePath = "vsocket.cpp"
+winvnc.cpp                      // RelativePath = "winvnc.cpp"
+..\..\ZipUnZip32\ZipUnzip32.cpp
+                                // RelativePath = "..\..\ZipUnZip32\ZipUnzip32.cpp"
diff --git a/ica/win32/winvnc/winvncvs2005.sln b/ica/win32/winvnc/winvncvs2005.sln
new file mode 100644
index 0000000..01647f9
--- /dev/null
+++ b/ica/win32/winvnc/winvncvs2005.sln
@@ -0,0 +1,681 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSLogonACL", "ms-logon\MSLogonACL\MSLogonACLvs2005.vcproj", "{F4E39BD7-C841-4F21-B40C-293D7E017EA1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Xregion", "..\Xregion\Xregionvs2005.vcproj", "{74900370-5ED2-4A5E-99A8-37EFE1D27552}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "authSSP", "ms-logon\authSSP\authSSPvs2005.vcproj", "{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "authadmin", "ms-logon\authadmin\authadminvs2005.vcproj", "{334467FD-E35E-4C3D-9410-69B2171C2BB2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ldapauth", "ms-logon\ldapauth\ldapauthvs2005.vcproj", "{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ldapauth9x", "ms-logon\ldapauth9x\ldapauth9xvs2005.vcproj", "{CAA83204-EBF8-4369-B152-011EA957784C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ldapauthnt4", "ms-logon\ldapauthNT4\ldapauthnt4vs2005.vcproj", "{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjpeg", "..\libjpeg\libjpegvs2005.vcproj", "{181769CB-5295-452F-A421-FE1F9ED2022A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logging", "ms-logon\logging\loggingvs2005.vcproj", "{D50AEB07-5F5E-4401-9B50-C1660E693833}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logmessages", "logger\logmessagesvs2005.vcproj", "{E543B602-5529-4B23-8D2A-3709857F5066}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "omnithread", "omnithread\omnithreadvs2005.vcproj", "{E52B9956-FE67-47F7-BC4F-67CC5A64B708}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdr", "..\rdr\rdrvs2005.vcproj", "{F5244002-0FFF-4F19-A941-FCCE1861F132}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testauth", "ms-logon\testauth\testauthvs2005.vcproj", "{C05BE60B-FBDF-430F-B041-5089262E8FB5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vnchooks", "vnchooks\vnchooksvs2005.vcproj", "{1D18E045-6B72-43F4-ACBD-3E679A3DE349}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winvnc", "winvnc\winvncvs2005.vcproj", "{C05AE605-1250-4F58-911B-EC99AE2C25AF}"
+	ProjectSection(ProjectDependencies) = postProject
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048} = {4CF0DF92-7F53-446C-8223-8DE4F6B40048}
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27} = {85445BB7-B95B-4DE1-BA52-7311AA700A27}
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683} = {CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769} = {DDA225E9-1A32-4065-8BAD-4BDDFBF81769}
+		{181769CB-5295-452F-A421-FE1F9ED2022A} = {181769CB-5295-452F-A421-FE1F9ED2022A}
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552} = {74900370-5ED2-4A5E-99A8-37EFE1D27552}
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708} = {E52B9956-FE67-47F7-BC4F-67CC5A64B708}
+		{F5244002-0FFF-4F19-A941-FCCE1861F132} = {F5244002-0FFF-4F19-A941-FCCE1861F132}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "workgrpdomnt4", "ms-logon\workgrpdomnt4\workgrpdomnt4vs2005.vcproj", "{8D7757CB-5125-4633-AFB1-4B30ED24955F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "..\zlib\zlibvs2005.vcproj", "{85445BB7-B95B-4DE1-BA52-7311AA700A27}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avilog", "..\avilog\avilog\avilog_VS2005.vcproj", "{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unz32lib", "..\zipunzip_src\unzip\windll\vc6\lib\unz32lib_VS2005.vcproj", "{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zip32", "..\zipunzip_src\zip20\windll\visualc\lib\zip32_VS2005.vcproj", "{4CF0DF92-7F53-446C-8223-8DE4F6B40048}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		ASM Debug|Win32 = ASM Debug|Win32
+		ASM Debug|x64 = ASM Debug|x64
+		ASM Release|Win32 = ASM Release|Win32
+		ASM Release|x64 = ASM Release|x64
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Http|Win32 = Http|Win32
+		Http|x64 = Http|x64
+		Profile|Win32 = Profile|Win32
+		Profile|x64 = Profile|x64
+		Release CORBA DEBUG|Win32 = Release CORBA DEBUG|Win32
+		Release CORBA DEBUG|x64 = Release CORBA DEBUG|x64
+		Release CORBA|Win32 = Release CORBA|Win32
+		Release CORBA|x64 = Release CORBA|x64
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.ASM Debug|x64.Build.0 = Debug|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.ASM Release|Win32.Build.0 = Release|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.ASM Release|x64.ActiveCfg = Release|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.ASM Release|x64.Build.0 = Release|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Debug|Win32.Build.0 = Debug|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Debug|x64.ActiveCfg = Debug|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Debug|x64.Build.0 = Debug|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Http|Win32.ActiveCfg = Debug|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Http|Win32.Build.0 = Debug|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Http|x64.ActiveCfg = Debug|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Http|x64.Build.0 = Debug|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Profile|Win32.ActiveCfg = Debug|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Profile|Win32.Build.0 = Debug|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Profile|x64.ActiveCfg = Debug|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Profile|x64.Build.0 = Debug|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release CORBA|Win32.Build.0 = Release|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release CORBA|x64.ActiveCfg = Release|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release CORBA|x64.Build.0 = Release|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release|Win32.ActiveCfg = Release|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release|Win32.Build.0 = Release|Win32
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release|x64.ActiveCfg = Release|x64
+		{F4E39BD7-C841-4F21-B40C-293D7E017EA1}.Release|x64.Build.0 = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.ASM Debug|x64.Build.0 = Debug|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.ASM Release|Win32.Build.0 = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.ASM Release|x64.ActiveCfg = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.ASM Release|x64.Build.0 = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Debug|Win32.ActiveCfg = Debug|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Debug|Win32.Build.0 = Debug|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Debug|x64.ActiveCfg = Debug|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Debug|x64.Build.0 = Debug|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Http|Win32.ActiveCfg = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Http|Win32.Build.0 = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Http|x64.ActiveCfg = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Http|x64.Build.0 = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Profile|Win32.ActiveCfg = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Profile|Win32.Build.0 = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Profile|x64.ActiveCfg = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Profile|x64.Build.0 = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release CORBA|Win32.Build.0 = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release CORBA|x64.ActiveCfg = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release CORBA|x64.Build.0 = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release|Win32.ActiveCfg = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release|Win32.Build.0 = Release|Win32
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release|x64.ActiveCfg = Release|x64
+		{74900370-5ED2-4A5E-99A8-37EFE1D27552}.Release|x64.Build.0 = Release|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.ASM Debug|x64.Build.0 = Debug|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.ASM Release|Win32.Build.0 = Release|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.ASM Release|x64.ActiveCfg = Release|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.ASM Release|x64.Build.0 = Release|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Debug|Win32.Build.0 = Debug|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Debug|x64.ActiveCfg = Debug|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Debug|x64.Build.0 = Debug|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Http|Win32.ActiveCfg = Debug|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Http|Win32.Build.0 = Debug|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Http|x64.ActiveCfg = Debug|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Http|x64.Build.0 = Debug|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Profile|Win32.ActiveCfg = Debug|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Profile|Win32.Build.0 = Debug|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Profile|x64.ActiveCfg = Debug|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Profile|x64.Build.0 = Debug|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release CORBA|Win32.Build.0 = Release|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release CORBA|x64.ActiveCfg = Release|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release CORBA|x64.Build.0 = Release|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release|Win32.ActiveCfg = Release|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release|Win32.Build.0 = Release|Win32
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release|x64.ActiveCfg = Release|x64
+		{2F5FBC3F-4CCD-4C26-9719-C9166D8B0C7D}.Release|x64.Build.0 = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.ASM Debug|x64.Build.0 = Debug|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.ASM Release|Win32.Build.0 = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.ASM Release|x64.ActiveCfg = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.ASM Release|x64.Build.0 = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Debug|Win32.ActiveCfg = Debug|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Debug|Win32.Build.0 = Debug|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Debug|x64.ActiveCfg = Debug|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Debug|x64.Build.0 = Debug|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Http|Win32.ActiveCfg = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Http|Win32.Build.0 = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Http|x64.ActiveCfg = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Http|x64.Build.0 = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Profile|Win32.ActiveCfg = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Profile|Win32.Build.0 = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Profile|x64.ActiveCfg = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Profile|x64.Build.0 = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release CORBA|Win32.Build.0 = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release CORBA|x64.ActiveCfg = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release CORBA|x64.Build.0 = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release|Win32.ActiveCfg = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release|Win32.Build.0 = Release|Win32
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release|x64.ActiveCfg = Release|x64
+		{334467FD-E35E-4C3D-9410-69B2171C2BB2}.Release|x64.Build.0 = Release|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.ASM Debug|x64.Build.0 = Debug|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.ASM Release|Win32.Build.0 = Release|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.ASM Release|x64.ActiveCfg = Release|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.ASM Release|x64.Build.0 = Release|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Debug|Win32.Build.0 = Debug|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Debug|x64.ActiveCfg = Debug|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Debug|x64.Build.0 = Debug|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Http|Win32.ActiveCfg = Debug|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Http|Win32.Build.0 = Debug|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Http|x64.ActiveCfg = Debug|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Http|x64.Build.0 = Debug|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Profile|Win32.ActiveCfg = Debug|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Profile|Win32.Build.0 = Debug|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Profile|x64.ActiveCfg = Debug|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Profile|x64.Build.0 = Debug|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release CORBA|Win32.Build.0 = Release|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release CORBA|x64.ActiveCfg = Release|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release CORBA|x64.Build.0 = Release|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release|Win32.ActiveCfg = Release|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release|Win32.Build.0 = Release|Win32
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release|x64.ActiveCfg = Release|x64
+		{BC78A3C8-2280-42AB-BB6F-14FB674E2A0C}.Release|x64.Build.0 = Release|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.ASM Debug|x64.Build.0 = Debug|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.ASM Release|Win32.Build.0 = Release|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.ASM Release|x64.ActiveCfg = Release|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.ASM Release|x64.Build.0 = Release|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Debug|Win32.Build.0 = Debug|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Debug|x64.ActiveCfg = Debug|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Debug|x64.Build.0 = Debug|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Http|Win32.ActiveCfg = Debug|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Http|Win32.Build.0 = Debug|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Http|x64.ActiveCfg = Debug|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Http|x64.Build.0 = Debug|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Profile|Win32.ActiveCfg = Debug|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Profile|Win32.Build.0 = Debug|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Profile|x64.ActiveCfg = Debug|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Profile|x64.Build.0 = Debug|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release CORBA|Win32.Build.0 = Release|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release CORBA|x64.ActiveCfg = Release|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release CORBA|x64.Build.0 = Release|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release|Win32.ActiveCfg = Release|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release|Win32.Build.0 = Release|Win32
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release|x64.ActiveCfg = Release|x64
+		{CAA83204-EBF8-4369-B152-011EA957784C}.Release|x64.Build.0 = Release|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.ASM Debug|x64.Build.0 = Debug|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.ASM Release|Win32.Build.0 = Release|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.ASM Release|x64.ActiveCfg = Release|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.ASM Release|x64.Build.0 = Release|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Debug|Win32.ActiveCfg = Debug|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Debug|Win32.Build.0 = Debug|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Debug|x64.ActiveCfg = Debug|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Debug|x64.Build.0 = Debug|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Http|Win32.ActiveCfg = Debug|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Http|Win32.Build.0 = Debug|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Http|x64.ActiveCfg = Debug|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Http|x64.Build.0 = Debug|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Profile|Win32.ActiveCfg = Debug|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Profile|Win32.Build.0 = Debug|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Profile|x64.ActiveCfg = Debug|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Profile|x64.Build.0 = Debug|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release CORBA|Win32.Build.0 = Release|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release CORBA|x64.ActiveCfg = Release|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release CORBA|x64.Build.0 = Release|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release|Win32.ActiveCfg = Release|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release|Win32.Build.0 = Release|Win32
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release|x64.ActiveCfg = Release|x64
+		{31AC9E7D-64B7-4301-ADE2-5EFF15AA6BDE}.Release|x64.Build.0 = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.ASM Debug|x64.Build.0 = Debug|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.ASM Release|Win32.Build.0 = Release|Win32
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.ASM Release|x64.ActiveCfg = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.ASM Release|x64.Build.0 = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Debug|Win32.Build.0 = Debug|Win32
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Debug|x64.ActiveCfg = Debug|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Debug|x64.Build.0 = Debug|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Http|Win32.ActiveCfg = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Http|x64.ActiveCfg = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Http|x64.Build.0 = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Profile|Win32.ActiveCfg = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Profile|x64.ActiveCfg = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Profile|x64.Build.0 = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Release CORBA DEBUG|Win32.ActiveCfg = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Release CORBA|Win32.ActiveCfg = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Release CORBA|x64.ActiveCfg = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Release CORBA|x64.Build.0 = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Release|Win32.ActiveCfg = Release|Win32
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Release|Win32.Build.0 = Release|Win32
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Release|x64.ActiveCfg = Release|x64
+		{181769CB-5295-452F-A421-FE1F9ED2022A}.Release|x64.Build.0 = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.ASM Debug|x64.Build.0 = Debug|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.ASM Release|Win32.Build.0 = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.ASM Release|x64.ActiveCfg = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.ASM Release|x64.Build.0 = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Debug|Win32.Build.0 = Debug|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Debug|x64.ActiveCfg = Debug|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Debug|x64.Build.0 = Debug|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Http|Win32.ActiveCfg = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Http|Win32.Build.0 = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Http|x64.ActiveCfg = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Http|x64.Build.0 = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Profile|Win32.ActiveCfg = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Profile|Win32.Build.0 = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Profile|x64.ActiveCfg = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Profile|x64.Build.0 = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release CORBA|Win32.Build.0 = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release CORBA|x64.ActiveCfg = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release CORBA|x64.Build.0 = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release|Win32.ActiveCfg = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release|Win32.Build.0 = Release|Win32
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release|x64.ActiveCfg = Release|x64
+		{D50AEB07-5F5E-4401-9B50-C1660E693833}.Release|x64.Build.0 = Release|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.ASM Debug|x64.Build.0 = Debug|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.ASM Release|Win32.Build.0 = Release|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.ASM Release|x64.ActiveCfg = Release|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.ASM Release|x64.Build.0 = Release|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Debug|Win32.Build.0 = Debug|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Debug|x64.ActiveCfg = Debug|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Debug|x64.Build.0 = Debug|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Http|Win32.ActiveCfg = Debug|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Http|Win32.Build.0 = Debug|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Http|x64.ActiveCfg = Debug|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Http|x64.Build.0 = Debug|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Profile|Win32.ActiveCfg = Debug|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Profile|Win32.Build.0 = Debug|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Profile|x64.ActiveCfg = Debug|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Profile|x64.Build.0 = Debug|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release CORBA|Win32.Build.0 = Release|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release CORBA|x64.ActiveCfg = Release|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release CORBA|x64.Build.0 = Release|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release|Win32.ActiveCfg = Release|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release|Win32.Build.0 = Release|Win32
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release|x64.ActiveCfg = Release|x64
+		{E543B602-5529-4B23-8D2A-3709857F5066}.Release|x64.Build.0 = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Debug|x64.Build.0 = Debug|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Release|Win32.Build.0 = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Release|x64.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.ASM Release|x64.Build.0 = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Debug|Win32.Build.0 = Debug|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Debug|x64.ActiveCfg = Debug|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Debug|x64.Build.0 = Debug|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Http|Win32.ActiveCfg = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Http|Win32.Build.0 = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Http|x64.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Http|x64.Build.0 = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Profile|Win32.ActiveCfg = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Profile|Win32.Build.0 = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Profile|x64.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Profile|x64.Build.0 = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release CORBA|Win32.Build.0 = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release CORBA|x64.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release CORBA|x64.Build.0 = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release|Win32.ActiveCfg = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release|Win32.Build.0 = Release|Win32
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release|x64.ActiveCfg = Release|x64
+		{E52B9956-FE67-47F7-BC4F-67CC5A64B708}.Release|x64.Build.0 = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Debug|x64.Build.0 = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Release|Win32.Build.0 = Release|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Release|x64.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.ASM Release|x64.Build.0 = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Debug|Win32.Build.0 = Debug|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Debug|x64.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Debug|x64.Build.0 = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Http|Win32.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Http|x64.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Http|x64.Build.0 = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Profile|Win32.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Profile|x64.ActiveCfg = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Profile|x64.Build.0 = Debug|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release CORBA DEBUG|Win32.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release CORBA|Win32.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release CORBA|x64.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release CORBA|x64.Build.0 = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release|Win32.ActiveCfg = Release|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release|Win32.Build.0 = Release|Win32
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release|x64.ActiveCfg = Release|x64
+		{F5244002-0FFF-4F19-A941-FCCE1861F132}.Release|x64.Build.0 = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.ASM Debug|x64.Build.0 = Debug|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.ASM Release|Win32.Build.0 = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.ASM Release|x64.ActiveCfg = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.ASM Release|x64.Build.0 = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Debug|Win32.Build.0 = Debug|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Debug|x64.ActiveCfg = Debug|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Debug|x64.Build.0 = Debug|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Http|Win32.ActiveCfg = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Http|Win32.Build.0 = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Http|x64.ActiveCfg = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Http|x64.Build.0 = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Profile|Win32.ActiveCfg = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Profile|Win32.Build.0 = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Profile|x64.ActiveCfg = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Profile|x64.Build.0 = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release CORBA|Win32.Build.0 = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release CORBA|x64.ActiveCfg = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release CORBA|x64.Build.0 = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release|Win32.ActiveCfg = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release|Win32.Build.0 = Release|Win32
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release|x64.ActiveCfg = Release|x64
+		{C05BE60B-FBDF-430F-B041-5089262E8FB5}.Release|x64.Build.0 = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Debug|x64.Build.0 = Debug|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Release|Win32.Build.0 = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Release|x64.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.ASM Release|x64.Build.0 = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Debug|Win32.Build.0 = Debug|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Debug|x64.ActiveCfg = Debug|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Debug|x64.Build.0 = Debug|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Http|Win32.ActiveCfg = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Http|Win32.Build.0 = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Http|x64.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Http|x64.Build.0 = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Profile|Win32.ActiveCfg = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Profile|Win32.Build.0 = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Profile|x64.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Profile|x64.Build.0 = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release CORBA|Win32.Build.0 = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release CORBA|x64.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release CORBA|x64.Build.0 = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release|Win32.ActiveCfg = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release|Win32.Build.0 = Release|Win32
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release|x64.ActiveCfg = Release|x64
+		{1D18E045-6B72-43F4-ACBD-3E679A3DE349}.Release|x64.Build.0 = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Debug|x64.Build.0 = Debug|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Release|Win32.Build.0 = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Release|x64.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.ASM Release|x64.Build.0 = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Debug|Win32.Build.0 = Debug|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Debug|x64.ActiveCfg = Debug|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Debug|x64.Build.0 = Debug|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Http|Win32.ActiveCfg = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Http|Win32.Build.0 = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Http|x64.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Http|x64.Build.0 = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Profile|Win32.ActiveCfg = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Profile|Win32.Build.0 = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Profile|x64.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Profile|x64.Build.0 = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release CORBA|Win32.Build.0 = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release CORBA|x64.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release CORBA|x64.Build.0 = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release|Win32.ActiveCfg = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release|Win32.Build.0 = Release|Win32
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release|x64.ActiveCfg = Release|x64
+		{C05AE605-1250-4F58-911B-EC99AE2C25AF}.Release|x64.Build.0 = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.ASM Debug|x64.Build.0 = Debug|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.ASM Release|Win32.Build.0 = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.ASM Release|x64.ActiveCfg = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.ASM Release|x64.Build.0 = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Debug|Win32.Build.0 = Debug|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Debug|x64.ActiveCfg = Debug|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Debug|x64.Build.0 = Debug|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Http|Win32.ActiveCfg = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Http|Win32.Build.0 = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Http|x64.ActiveCfg = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Http|x64.Build.0 = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Profile|Win32.ActiveCfg = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Profile|Win32.Build.0 = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Profile|x64.ActiveCfg = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Profile|x64.Build.0 = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release CORBA|Win32.Build.0 = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release CORBA|x64.ActiveCfg = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release CORBA|x64.Build.0 = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release|Win32.ActiveCfg = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release|Win32.Build.0 = Release|Win32
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release|x64.ActiveCfg = Release|x64
+		{8D7757CB-5125-4633-AFB1-4B30ED24955F}.Release|x64.Build.0 = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.ASM Debug|x64.ActiveCfg = Debug|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.ASM Debug|x64.Build.0 = Debug|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.ASM Release|Win32.Build.0 = Release|Win32
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.ASM Release|x64.ActiveCfg = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.ASM Release|x64.Build.0 = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Debug|Win32.ActiveCfg = Debug|Win32
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Debug|Win32.Build.0 = Debug|Win32
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Debug|x64.ActiveCfg = Debug|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Debug|x64.Build.0 = Debug|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Http|Win32.ActiveCfg = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Http|x64.ActiveCfg = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Http|x64.Build.0 = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Profile|Win32.ActiveCfg = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Profile|x64.ActiveCfg = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Profile|x64.Build.0 = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Release CORBA DEBUG|Win32.ActiveCfg = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Release CORBA DEBUG|x64.ActiveCfg = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Release CORBA DEBUG|x64.Build.0 = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Release CORBA|Win32.ActiveCfg = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Release CORBA|x64.ActiveCfg = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Release CORBA|x64.Build.0 = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Release|Win32.ActiveCfg = Release|Win32
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Release|Win32.Build.0 = Release|Win32
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Release|x64.ActiveCfg = Release|x64
+		{85445BB7-B95B-4DE1-BA52-7311AA700A27}.Release|x64.Build.0 = Release|x64
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Debug|x64.ActiveCfg = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Release|Win32.Build.0 = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.ASM Release|x64.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Debug|Win32.ActiveCfg = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Debug|Win32.Build.0 = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Debug|x64.ActiveCfg = Debug|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Http|Win32.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Http|Win32.Build.0 = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Http|x64.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Profile|Win32.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Profile|Win32.Build.0 = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Profile|x64.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release CORBA DEBUG|x64.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release CORBA|Win32.Build.0 = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release CORBA|x64.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release|Win32.ActiveCfg = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release|Win32.Build.0 = Release|Win32
+		{CD0D6EC9-D652-4D1B-B23B-18E1AC3AA683}.Release|x64.ActiveCfg = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.ASM Debug|Win32.ActiveCfg = ASM Debug|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.ASM Debug|Win32.Build.0 = ASM Debug|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.ASM Debug|x64.ActiveCfg = ASM Debug|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.ASM Release|Win32.ActiveCfg = ASM Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.ASM Release|Win32.Build.0 = ASM Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.ASM Release|x64.ActiveCfg = ASM Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Debug|Win32.Build.0 = Debug|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Debug|x64.ActiveCfg = Debug|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Http|Win32.ActiveCfg = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Http|Win32.Build.0 = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Http|x64.ActiveCfg = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Profile|Win32.ActiveCfg = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Profile|Win32.Build.0 = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Profile|x64.ActiveCfg = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Release CORBA DEBUG|x64.ActiveCfg = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Release CORBA|Win32.Build.0 = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Release CORBA|x64.ActiveCfg = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Release|Win32.ActiveCfg = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Release|Win32.Build.0 = Release|Win32
+		{DDA225E9-1A32-4065-8BAD-4BDDFBF81769}.Release|x64.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.ASM Debug|Win32.ActiveCfg = Debug|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.ASM Debug|Win32.Build.0 = Debug|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.ASM Debug|x64.ActiveCfg = Debug|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.ASM Release|Win32.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.ASM Release|Win32.Build.0 = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.ASM Release|x64.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Debug|Win32.Build.0 = Debug|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Debug|x64.ActiveCfg = Debug|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Http|Win32.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Http|Win32.Build.0 = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Http|x64.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Profile|Win32.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Profile|Win32.Build.0 = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Profile|x64.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Release CORBA DEBUG|Win32.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Release CORBA DEBUG|Win32.Build.0 = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Release CORBA DEBUG|x64.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Release CORBA|Win32.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Release CORBA|Win32.Build.0 = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Release CORBA|x64.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Release|Win32.ActiveCfg = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Release|Win32.Build.0 = Release|Win32
+		{4CF0DF92-7F53-446C-8223-8DE4F6B40048}.Release|x64.ActiveCfg = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/ica/win32/zlib/zlib.h b/ica/win32/winvnc/zlib/zlib.h
similarity index 100%
rename from ica/win32/zlib/zlib.h
rename to ica/win32/winvnc/zlib/zlib.h
diff --git a/ica/x11/AUTHORS b/ica/x11/AUTHORS
new file mode 100644
index 0000000..4e1b618
--- /dev/null
+++ b/ica/x11/AUTHORS
@@ -0,0 +1,50 @@
+*  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 and George Kiagiadakis.
+
+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.
+
+A hearty unthanks goes to Michael and Erick, who provided me with nothing
+but hollow words. Finally I got that configure and install working, but
+it would have been so much better for them not just to complain, but also
+help. As you showed me real egoism, you are the main reasons I am not
+working one dot to make this library less than GPL, so that nobody ever
+can make profit of my and others work without giving something back to me
+and others.
+
+Speaking of hollow words, another hearty unthanks goes to Sam, who thought
+he could let me work for him, not paying me in any way.
diff --git a/ica/x11/ChangeLog b/ica/x11/ChangeLog
new file mode 100644
index 0000000..5dc55b8
--- /dev/null
+++ b/ica/x11/ChangeLog
@@ -0,0 +1,6672 @@
+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 for little endian mode.     we must make and check 24 bit colors and big endian mode.  Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
+
+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/libvncserver/d3des.c b/ica/x11/common/d3des.c
similarity index 100%
rename from ica/x11/libvncserver/d3des.c
rename to ica/x11/common/d3des.c
diff --git a/ica/x11/libvncserver/d3des.h b/ica/x11/common/d3des.h
similarity index 100%
rename from ica/x11/libvncserver/d3des.h
rename to ica/x11/common/d3des.h
diff --git a/ica/x11/common/lzoconf.h b/ica/x11/common/lzoconf.h
new file mode 100644
index 0000000..1d0fe14
--- /dev/null
+++ b/ica/x11/common/lzoconf.h
@@ -0,0 +1,446 @@
+/* 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             0x2050
+#define LZO_VERSION_STRING      "2.05"
+#define LZO_VERSION_DATE        "Apr 23 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
new file mode 100644
index 0000000..0e40e33
--- /dev/null
+++ b/ica/x11/common/lzodefs.h
@@ -0,0 +1,1852 @@
+/* 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/minilzo.c b/ica/x11/common/minilzo.c
new file mode 100644
index 0000000..25a1f68
--- /dev/null
+++ b/ica/x11/common/minilzo.c
@@ -0,0 +1,4562 @@
+/* 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 != 0x2050)
+#  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
+
+#if 0
+#define WANT_lzo_bitops_clz32 1
+#define WANT_lzo_bitops_clz64 1
+#endif
+#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)
+#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 < 31; 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 < 63; 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 < 31; 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 < 63; 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)
+#  define WANT_lzo_bitops_ctz64 1
+#elif defined(UA_GET32)
+#  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)
+#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 - ti;
+
+    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
+
+        {
+        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_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_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);
+}
+
+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
new file mode 100644
index 0000000..74fefa9
--- /dev/null
+++ b/ica/x11/common/minilzo.h
@@ -0,0 +1,109 @@
+/* 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         0x2050
+
+#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/vncauth.c b/ica/x11/common/vncauth.c
new file mode 100644
index 0000000..82c1b68
--- /dev/null
+++ b/ica/x11/common/vncauth.c
@@ -0,0 +1,211 @@
+/*
+ *  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
+#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
new file mode 100644
index 0000000..904de40
--- /dev/null
+++ b/ica/x11/common/zywrletemplate.c
@@ -0,0 +1,828 @@
+
+/********************************************************************
+ *                                                                  *
+ * 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/listen.c b/ica/x11/libvncclient/listen.c
index 637abb1..58275a0 100644
--- a/ica/x11/libvncclient/listen.c
+++ b/ica/x11/libvncclient/listen.c
@@ -29,6 +29,7 @@
 #ifdef __MINGW32__
 #define close closesocket
 #include <winsock2.h>
+#undef max
 #else
 #include <sys/wait.h>
 #include <sys/utsname.h>
diff --git a/ica/x11/libvncclient/minilzo.c b/ica/x11/libvncclient/minilzo.c
deleted file mode 100644
index 85771eb..0000000
--- a/ica/x11/libvncclient/minilzo.c
+++ /dev/null
@@ -1,2935 +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) 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.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, 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
-#define LZO_BUILD
-
-#ifdef MINILZO_HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#undef LZO_HAVE_CONFIG_H
-#include "minilzo.h"
-
-#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x1080)
-#  error "version mismatch in miniLZO source files"
-#endif
-
-#ifdef MINILZO_HAVE_CONFIG_H
-#  define LZO_HAVE_CONFIG_H
-#endif
-
-#if !defined(LZO_NO_SYS_TYPES_H)
-#  include <sys/types.h>
-#endif
-#include <stdio.h>
-
-#ifndef __LZO_CONF_H
-#define __LZO_CONF_H
-
-#if !defined(__LZO_IN_MINILZO)
-#  ifndef __LZOCONF_H
-#    include <lzoconf.h>
-#  endif
-#endif
-
-#if 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_HAVE_CONFIG_H)
-#  include <stddef.h>
-#  include <string.h>
-#  if !defined(NO_STDLIB_H)
-#    include <stdlib.h>
-#  endif
-#  define HAVE_MEMCMP
-#  define HAVE_MEMCPY
-#  define HAVE_MEMMOVE
-#  define HAVE_MEMSET
-#else
-#  include <sys/types.h>
-#  if defined(HAVE_STDDEF_H)
-#    include <stddef.h>
-#  endif
-#  if defined(STDC_HEADERS)
-#    include <string.h>
-#    include <stdlib.h>
-#  endif
-#endif
-
-#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
-#  define HAVE_MALLOC_H
-#  define HAVE_HALLOC
-#endif
-
-#undef NDEBUG
-#if !defined(LZO_DEBUG)
-#  define NDEBUG
-#endif
-#if defined(LZO_DEBUG) || !defined(NDEBUG)
-#  if !defined(NO_STDIO_H)
-#    include <stdio.h>
-#  endif
-#endif
-#include <assert.h>
-
-#if !defined(LZO_COMPILE_TIME_ASSERT)
-#  define LZO_COMPILE_TIME_ASSERT(expr) \
-	{ typedef int __lzo_compile_time_assert_fail[1 - 2 * !(expr)]; }
-#endif
-
-#if !defined(LZO_UNUSED)
-#  if 1
-#    define LZO_UNUSED(var)     ((void)&var)
-#  elif 0
-#    define LZO_UNUSED(var)     { typedef int __lzo_unused[sizeof(var) ? 2 : 1]; }
-#  else
-#    define LZO_UNUSED(parm)    (parm = parm)
-#  endif
-#endif
-
-#if !defined(__inline__) && !defined(__GNUC__)
-#  if defined(__cplusplus)
-#    define __inline__      inline
-#  else
-#    define __inline__
-#  endif
-#endif
-
-#if defined(NO_MEMCMP)
-#  undef HAVE_MEMCMP
-#endif
-
-#if !defined(HAVE_MEMCMP)
-#  undef memcmp
-#  define memcmp    lzo_memcmp
-#endif
-#if !defined(HAVE_MEMCPY)
-#  undef memcpy
-#  define memcpy    lzo_memcpy
-#endif
-#if !defined(HAVE_MEMMOVE)
-#  undef memmove
-#  define memmove   lzo_memmove
-#endif
-#if !defined(HAVE_MEMSET)
-#  undef memset
-#  define memset    lzo_memset
-#endif
-
-#if 0
-#  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)
-
-#define LZO_STYPE_MAX(b)    (((1l  << (8*(b)-2)) - 1l)  + (1l  << (8*(b)-2)))
-#define LZO_UTYPE_MAX(b)    (((1ul << (8*(b)-1)) - 1ul) + (1ul << (8*(b)-1)))
-
-#if !defined(SIZEOF_UNSIGNED)
-#  if (UINT_MAX == 0xffff)
-#    define SIZEOF_UNSIGNED         2
-#  elif (UINT_MAX == LZO_0xffffffffL)
-#    define SIZEOF_UNSIGNED         4
-#  elif (UINT_MAX >= LZO_0xffffffffL)
-#    define SIZEOF_UNSIGNED         8
-#  else
-#    error "SIZEOF_UNSIGNED"
-#  endif
-#endif
-
-#if !defined(SIZEOF_UNSIGNED_LONG)
-#  if (ULONG_MAX == LZO_0xffffffffL)
-#    define SIZEOF_UNSIGNED_LONG    4
-#  elif (ULONG_MAX >= LZO_0xffffffffL)
-#    define SIZEOF_UNSIGNED_LONG    8
-#  else
-#    error "SIZEOF_UNSIGNED_LONG"
-#  endif
-#endif
-
-#if !defined(SIZEOF_SIZE_T)
-#  define SIZEOF_SIZE_T             SIZEOF_UNSIGNED
-#endif
-#if !defined(SIZE_T_MAX)
-#  define SIZE_T_MAX                LZO_UTYPE_MAX(SIZEOF_SIZE_T)
-#endif
-
-#if 1 && defined(__LZO_i386) && (UINT_MAX == LZO_0xffffffffL)
-#  if !defined(LZO_UNALIGNED_OK_2) && (USHRT_MAX == 0xffff)
-#    define LZO_UNALIGNED_OK_2
-#  endif
-#  if !defined(LZO_UNALIGNED_OK_4) && (LZO_UINT32_MAX == LZO_0xffffffffL)
-#    define LZO_UNALIGNED_OK_4
-#  endif
-#endif
-
-#if defined(LZO_UNALIGNED_OK_2) || defined(LZO_UNALIGNED_OK_4)
-#  if !defined(LZO_UNALIGNED_OK)
-#    define LZO_UNALIGNED_OK
-#  endif
-#endif
-
-#if defined(__LZO_NO_UNALIGNED)
-#  undef LZO_UNALIGNED_OK
-#  undef LZO_UNALIGNED_OK_2
-#  undef LZO_UNALIGNED_OK_4
-#endif
-
-#if defined(LZO_UNALIGNED_OK_2) && (USHRT_MAX != 0xffff)
-#  error "LZO_UNALIGNED_OK_2 must not be defined on this system"
-#endif
-#if defined(LZO_UNALIGNED_OK_4) && (LZO_UINT32_MAX != LZO_0xffffffffL)
-#  error "LZO_UNALIGNED_OK_4 must not be defined on this system"
-#endif
-
-#if defined(__LZO_NO_ALIGNED)
-#  undef LZO_ALIGNED_OK_4
-#endif
-
-#if defined(LZO_ALIGNED_OK_4) && (LZO_UINT32_MAX != LZO_0xffffffffL)
-#  error "LZO_ALIGNED_OK_4 must not be defined on this system"
-#endif
-
-#define LZO_LITTLE_ENDIAN       1234
-#define LZO_BIG_ENDIAN          4321
-#define LZO_PDP_ENDIAN          3412
-
-#if !defined(LZO_BYTE_ORDER)
-#  if defined(MFX_BYTE_ORDER)
-#    define LZO_BYTE_ORDER      MFX_BYTE_ORDER
-#  elif defined(__LZO_i386)
-#    define LZO_BYTE_ORDER      LZO_LITTLE_ENDIAN
-#  elif defined(BYTE_ORDER)
-#    define LZO_BYTE_ORDER      BYTE_ORDER
-#  elif defined(__BYTE_ORDER)
-#    define LZO_BYTE_ORDER      __BYTE_ORDER
-#  endif
-#endif
-
-#if defined(LZO_BYTE_ORDER)
-#  if (LZO_BYTE_ORDER != LZO_LITTLE_ENDIAN) && \
-      (LZO_BYTE_ORDER != LZO_BIG_ENDIAN)
-#    error "invalid LZO_BYTE_ORDER"
-#  endif
-#endif
-
-#if defined(LZO_UNALIGNED_OK) && !defined(LZO_BYTE_ORDER)
-#  error "LZO_BYTE_ORDER is not defined"
-#endif
-
-#define LZO_OPTIMIZE_GNUC_i386_IS_BUGGY
-
-#if defined(NDEBUG) && !defined(LZO_DEBUG) && !defined(__LZO_CHECKER)
-#  if defined(__GNUC__) && defined(__i386__)
-#    if !defined(LZO_OPTIMIZE_GNUC_i386_IS_BUGGY)
-#      define LZO_OPTIMIZE_GNUC_i386
-#    endif
-#  endif
-#endif
-
-__LZO_EXTERN_C int __lzo_init_done;
-__LZO_EXTERN_C const lzo_byte __lzo_copyright[];
-LZO_EXTERN(const lzo_byte *) lzo_copyright(void);
-__LZO_EXTERN_C const lzo_uint32 _lzo_crc32_table[256];
-
-#define _LZO_STRINGIZE(x)           #x
-#define _LZO_MEXPAND(x)             _LZO_STRINGIZE(x)
-
-#define _LZO_CONCAT2(a,b)           a ## b
-#define _LZO_CONCAT3(a,b,c)         a ## b ## c
-#define _LZO_CONCAT4(a,b,c,d)       a ## b ## c ## d
-#define _LZO_CONCAT5(a,b,c,d,e)     a ## b ## c ## d ## e
-
-#define _LZO_ECONCAT2(a,b)          _LZO_CONCAT2(a,b)
-#define _LZO_ECONCAT3(a,b,c)        _LZO_CONCAT3(a,b,c)
-#define _LZO_ECONCAT4(a,b,c,d)      _LZO_CONCAT4(a,b,c,d)
-#define _LZO_ECONCAT5(a,b,c,d,e)    _LZO_CONCAT5(a,b,c,d,e)
-
-#if 0
-
-#define __LZO_IS_COMPRESS_QUERY(i,il,o,ol,w)    ((lzo_voidp)(o) == (w))
-#define __LZO_QUERY_COMPRESS(i,il,o,ol,w,n,s) \
-		(*ol = (n)*(s), LZO_E_OK)
-
-#define __LZO_IS_DECOMPRESS_QUERY(i,il,o,ol,w)  ((lzo_voidp)(o) == (w))
-#define __LZO_QUERY_DECOMPRESS(i,il,o,ol,w,n,s) \
-		(*ol = (n)*(s), LZO_E_OK)
-
-#define __LZO_IS_OPTIMIZE_QUERY(i,il,o,ol,w)    ((lzo_voidp)(o) == (w))
-#define __LZO_QUERY_OPTIMIZE(i,il,o,ol,w,n,s) \
-		(*ol = (n)*(s), LZO_E_OK)
-
-#endif
-
-#ifndef __LZO_PTR_H
-#define __LZO_PTR_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
-#  include <dos.h>
-#  if 1 && defined(__WATCOMC__)
-#    include <i86.h>
-     __LZO_EXTERN_C unsigned char _HShift;
-#    define __LZO_HShift    _HShift
-#  elif 1 && defined(_MSC_VER)
-     __LZO_EXTERN_C unsigned short __near _AHSHIFT;
-#    define __LZO_HShift    ((unsigned) &_AHSHIFT)
-#  elif defined(__LZO_WIN16)
-#    define __LZO_HShift    3
-#  else
-#    define __LZO_HShift    12
-#  endif
-#  if !defined(_FP_SEG) && defined(FP_SEG)
-#    define _FP_SEG         FP_SEG
-#  endif
-#  if !defined(_FP_OFF) && defined(FP_OFF)
-#    define _FP_OFF         FP_OFF
-#  endif
-#endif
-
-#if !defined(lzo_ptrdiff_t)
-#  if (UINT_MAX >= LZO_0xffffffffL)
-     typedef ptrdiff_t          lzo_ptrdiff_t;
-#  else
-     typedef long               lzo_ptrdiff_t;
-#  endif
-#endif
-
-#if !defined(__LZO_HAVE_PTR_T)
-#  if defined(lzo_ptr_t)
-#    define __LZO_HAVE_PTR_T
-#  endif
-#endif
-#if !defined(__LZO_HAVE_PTR_T)
-#  if defined(SIZEOF_CHAR_P) && defined(SIZEOF_UNSIGNED_LONG)
-#    if (SIZEOF_CHAR_P == SIZEOF_UNSIGNED_LONG)
-       typedef unsigned long    lzo_ptr_t;
-       typedef long             lzo_sptr_t;
-#      define __LZO_HAVE_PTR_T
-#    endif
-#  endif
-#endif
-#if !defined(__LZO_HAVE_PTR_T)
-#  if defined(SIZEOF_CHAR_P) && defined(SIZEOF_UNSIGNED)
-#    if (SIZEOF_CHAR_P == SIZEOF_UNSIGNED)
-       typedef unsigned int     lzo_ptr_t;
-       typedef int              lzo_sptr_t;
-#      define __LZO_HAVE_PTR_T
-#    endif
-#  endif
-#endif
-#if !defined(__LZO_HAVE_PTR_T)
-#  if defined(SIZEOF_CHAR_P) && defined(SIZEOF_UNSIGNED_SHORT)
-#    if (SIZEOF_CHAR_P == SIZEOF_UNSIGNED_SHORT)
-       typedef unsigned short   lzo_ptr_t;
-       typedef short            lzo_sptr_t;
-#      define __LZO_HAVE_PTR_T
-#    endif
-#  endif
-#endif
-#if !defined(__LZO_HAVE_PTR_T)
-#  if defined(LZO_HAVE_CONFIG_H) || defined(SIZEOF_CHAR_P)
-#    error "no suitable type for lzo_ptr_t"
-#  else
-     typedef unsigned long      lzo_ptr_t;
-     typedef long               lzo_sptr_t;
-#    define __LZO_HAVE_PTR_T
-#  endif
-#endif
-
-#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
-#define PTR(a)              ((lzo_bytep) (a))
-#define PTR_ALIGNED_4(a)    ((_FP_OFF(a) & 3) == 0)
-#define PTR_ALIGNED2_4(a,b) (((_FP_OFF(a) | _FP_OFF(b)) & 3) == 0)
-#else
-#define PTR(a)              ((lzo_ptr_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)       ((lzo_ptrdiff_t) (PTR(a) - PTR(b)))
-#define pd(a,b)             ((lzo_uint) ((a)-(b)))
-
-LZO_EXTERN(lzo_ptr_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;
-    ptrdiff_t       a_ptrdiff_t;
-    lzo_ptrdiff_t   a_lzo_ptrdiff_t;
-    lzo_ptr_t       a_lzo_ptr_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
-
-#define LZO_DETERMINISTIC
-
-#define LZO_DICT_USE_PTR
-#if defined(__LZO_DOS16) || defined(__LZO_WIN16) || defined(__LZO_STRICT_16BIT)
-#  undef LZO_DICT_USE_PTR
-#endif
-
-#if defined(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
-
-#if !defined(lzo_moff_t)
-#define lzo_moff_t      lzo_uint
-#endif
-
-#endif
-
-LZO_PUBLIC(lzo_ptr_t)
-__lzo_ptr_linear(const lzo_voidp ptr)
-{
-    lzo_ptr_t p;
-
-#if defined(__LZO_DOS16) || defined(__LZO_WIN16)
-    p = (((lzo_ptr_t)(_FP_SEG(ptr))) << (16 - __LZO_HShift)) + (_FP_OFF(ptr));
-#else
-    p = PTR_LINEAR(ptr);
-#endif
-
-    return p;
-}
-
-LZO_PUBLIC(unsigned)
-__lzo_align_gap(const lzo_voidp ptr, lzo_uint size)
-{
-    lzo_ptr_t p, s, n;
-
-    assert(size > 0);
-
-    p = __lzo_ptr_linear(ptr);
-    s = (lzo_ptr_t) (size - 1);
-#if 0
-    assert((size & (size - 1)) == 0);
-    n = ((p + s) & ~s) - p;
-#else
-    n = (((p + s) / size) * size) - p;
-#endif
-
-    assert((long)n >= 0);
-    assert(n <= s);
-
-    return (unsigned)n;
-}
-
-#ifndef __LZO_UTIL_H
-#define __LZO_UTIL_H
-
-#ifndef __LZO_CONF_H
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if 1 && defined(HAVE_MEMCPY)
-#if !defined(__LZO_DOS16) && !defined(__LZO_WIN16)
-
-#define MEMCPY8_DS(dest,src,len) \
-    memcpy(dest,src,len); \
-    dest += len; \
-    src += len
-
-#endif
-#endif
-
-#if 0 && !defined(MEMCPY8_DS)
-
-#define MEMCPY8_DS(dest,src,len) \
-    { do { \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	len -= 8; \
-    } while (len > 0); }
-
-#endif
-
-#if !defined(MEMCPY8_DS)
-
-#define MEMCPY8_DS(dest,src,len) \
-    { register lzo_uint __l = (len) / 8; \
-    do { \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-	*dest++ = *src++; \
-    } while (--__l > 0); }
-
-#endif
-
-#define MEMCPY_DS(dest,src,len) \
-    do *dest++ = *src++; \
-    while (--len > 0)
-
-#define MEMMOVE_DS(dest,src,len) \
-    do *dest++ = *src++; \
-    while (--len > 0)
-
-#if 0 && defined(LZO_OPTIMIZE_GNUC_i386)
-
-#define BZERO8_PTR(s,l,n) \
-__asm__ __volatile__( \
-    "movl  %0,%%eax \n"             \
-    "movl  %1,%%edi \n"             \
-    "movl  %2,%%ecx \n"             \
-    "cld \n"                        \
-    "rep \n"                        \
-    "stosl %%eax,(%%edi) \n"        \
-    :               \
-    :"g" (0),"g" (s),"g" (n)        \
-    :"eax","edi","ecx", "memory", "cc" \
-)
-
-#elif (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMSET)
-
-#if 1
-#define BZERO8_PTR(s,l,n)   memset((s),0,(lzo_uint)(l)*(n))
-#else
-#define BZERO8_PTR(s,l,n)   memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n))
-#endif
-
-#else
-
-#define BZERO8_PTR(s,l,n) \
-    lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n))
-
-#endif
-
-#if 0
-#if defined(__GNUC__) && defined(__i386__)
-
-unsigned char lzo_rotr8(unsigned char value, int shift);
-extern __inline__ unsigned char lzo_rotr8(unsigned char value, int shift)
-{
-    unsigned char result;
-
-    __asm__ __volatile__ ("movb %b1, %b0; rorb %b2, %b0"
-			: "=a"(result) : "g"(value), "c"(shift));
-    return result;
-}
-
-unsigned short lzo_rotr16(unsigned short value, int shift);
-extern __inline__ unsigned short lzo_rotr16(unsigned short value, int shift)
-{
-    unsigned short result;
-
-    __asm__ __volatile__ ("movw %b1, %b0; rorw %b2, %b0"
-			: "=a"(result) : "g"(value), "c"(shift));
-    return result;
-}
-
-#endif
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-LZO_PUBLIC(lzo_bool)
-lzo_assert(int expr)
-{
-    return (expr) ? 1 : 0;
-}
-
-/* If you use the LZO library in a product, you *must* keep this
- * copyright string in the executable of your product.
- */
-
-const lzo_byte __lzo_copyright[] =
-#if !defined(__LZO_IN_MINLZO)
-    LZO_VERSION_STRING;
-#else
-    "\n\n\n"
-    "LZO real-time data compression library.\n"
-    "Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Markus Franz Xaver Johannes Oberhumer\n"
-    "<markus.oberhumer at jk.uni-linz.ac.at>\n"
-    "http://www.oberhumer.com/opensource/lzo/\n"
-    "\n"
-    "LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE "\n"
-    "LZO build date: " __DATE__ " " __TIME__ "\n\n"
-    "LZO special compilation options:\n"
-#ifdef __cplusplus
-    " __cplusplus\n"
-#endif
-#if defined(__PIC__)
-    " __PIC__\n"
-#elif defined(__pic__)
-    " __pic__\n"
-#endif
-#if (UINT_MAX < LZO_0xffffffffL)
-    " 16BIT\n"
-#endif
-#if defined(__LZO_STRICT_16BIT)
-    " __LZO_STRICT_16BIT\n"
-#endif
-#if (UINT_MAX > LZO_0xffffffffL)
-    " UINT_MAX=" _LZO_MEXPAND(UINT_MAX) "\n"
-#endif
-#if (ULONG_MAX > LZO_0xffffffffL)
-    " ULONG_MAX=" _LZO_MEXPAND(ULONG_MAX) "\n"
-#endif
-#if defined(LZO_BYTE_ORDER)
-    " LZO_BYTE_ORDER=" _LZO_MEXPAND(LZO_BYTE_ORDER) "\n"
-#endif
-#if defined(LZO_UNALIGNED_OK_2)
-    " LZO_UNALIGNED_OK_2\n"
-#endif
-#if defined(LZO_UNALIGNED_OK_4)
-    " LZO_UNALIGNED_OK_4\n"
-#endif
-#if defined(LZO_ALIGNED_OK_4)
-    " LZO_ALIGNED_OK_4\n"
-#endif
-#if defined(LZO_DICT_USE_PTR)
-    " LZO_DICT_USE_PTR\n"
-#endif
-#if defined(__LZO_QUERY_COMPRESS)
-    " __LZO_QUERY_COMPRESS\n"
-#endif
-#if defined(__LZO_QUERY_DECOMPRESS)
-    " __LZO_QUERY_DECOMPRESS\n"
-#endif
-#if defined(__LZO_IN_MINILZO)
-    " __LZO_IN_MINILZO\n"
-#endif
-    "\n\n"
-    "$Id: LZO " LZO_VERSION_STRING " built " __DATE__ " " __TIME__
-#if defined(__GNUC__) && defined(__VERSION__)
-    " by gcc " __VERSION__
-#elif defined(__BORLANDC__)
-    " by Borland C " _LZO_MEXPAND(__BORLANDC__)
-#elif defined(_MSC_VER)
-    " by Microsoft C " _LZO_MEXPAND(_MSC_VER)
-#elif defined(__PUREC__)
-    " by Pure C " _LZO_MEXPAND(__PUREC__)
-#elif defined(__SC__)
-    " by Symantec C " _LZO_MEXPAND(__SC__)
-#elif defined(__TURBOC__)
-    " by Turbo C " _LZO_MEXPAND(__TURBOC__)
-#elif defined(__WATCOMC__)
-    " by Watcom C " _LZO_MEXPAND(__WATCOMC__)
-#endif
-    " $\n"
-    "$Copyright: LZO (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Markus Franz Xaver Johannes Oberhumer $\n";
-#endif
-
-LZO_PUBLIC(const lzo_byte *)
-lzo_copyright(void)
-{
-    return __lzo_copyright;
-}
-
-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_byte *buf, lzo_uint len)
-{
-    lzo_uint32 s1 = adler & 0xffff;
-    lzo_uint32 s2 = (adler >> 16) & 0xffff;
-    int k;
-
-    if (buf == NULL)
-	return 1;
-
-    while (len > 0)
-    {
-	k = len < LZO_NMAX ? (int) 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;
-}
-
-LZO_PUBLIC(int)
-lzo_memcmp(const lzo_voidp s1, const lzo_voidp s2, lzo_uint len)
-{
-#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMCMP)
-    return memcmp(s1,s2,len);
-#else
-    const lzo_byte *p1 = (const lzo_byte *) s1;
-    const lzo_byte *p2 = (const lzo_byte *) s2;
-    int d;
-
-    if (len > 0) do
-    {
-	d = *p1 - *p2;
-	if (d != 0)
-	    return d;
-	p1++;
-	p2++;
-    }
-    while (--len > 0);
-    return 0;
-#endif
-}
-
-LZO_PUBLIC(lzo_voidp)
-lzo_memcpy(lzo_voidp dest, const lzo_voidp src, lzo_uint len)
-{
-#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMCPY)
-    return memcpy(dest,src,len);
-#else
-    lzo_byte *p1 = (lzo_byte *) dest;
-    const lzo_byte *p2 = (const lzo_byte *) src;
-
-    if (len <= 0 || p1 == p2)
-	return dest;
-    do
-	*p1++ = *p2++;
-    while (--len > 0);
-    return dest;
-#endif
-}
-
-LZO_PUBLIC(lzo_voidp)
-lzo_memmove(lzo_voidp dest, const lzo_voidp src, lzo_uint len)
-{
-#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMMOVE)
-    return memmove(dest,src,len);
-#else
-    lzo_byte *p1 = (lzo_byte *) dest;
-    const lzo_byte *p2 = (const lzo_byte *) src;
-
-    if (len <= 0 || p1 == p2)
-	return dest;
-
-    if (p1 < p2)
-    {
-	do
-	    *p1++ = *p2++;
-	while (--len > 0);
-    }
-    else
-    {
-	p1 += len;
-	p2 += len;
-	do
-	    *--p1 = *--p2;
-	while (--len > 0);
-    }
-    return dest;
-#endif
-}
-
-LZO_PUBLIC(lzo_voidp)
-lzo_memset(lzo_voidp s, int c, lzo_uint len)
-{
-#if (LZO_UINT_MAX <= SIZE_T_MAX) && defined(HAVE_MEMSET)
-    return memset(s,c,len);
-#else
-    lzo_byte *p = (lzo_byte *) s;
-
-    if (len > 0) do
-	*p++ = LZO_BYTE(c);
-    while (--len > 0);
-    return s;
-#endif
-}
-
-#if 0
-#  define IS_SIGNED(type)       (((type) (1ul << (8 * sizeof(type) - 1))) < 0)
-#  define IS_UNSIGNED(type)     (((type) (1ul << (8 * sizeof(type) - 1))) > 0)
-#else
-#  define IS_SIGNED(type)       (((type) (-1)) < ((type) 0))
-#  define IS_UNSIGNED(type)     (((type) (-1)) > ((type) 0))
-#endif
-
-#define IS_POWER_OF_2(x)        (((x) & ((x) - 1)) == 0)
-
-static lzo_bool schedule_insns_bug(void);
-static lzo_bool strength_reduce_bug(int *);
-
-#if 0 || defined(LZO_DEBUG)
-#include <stdio.h>
-static lzo_bool __lzo_assert_fail(const char *s, unsigned line)
-{
-#if defined(__palmos__)
-    printf("LZO assertion failed in line %u: '%s'\n",line,s);
-#else
-    fprintf(stderr,"LZO assertion failed in line %u: '%s'\n",line,s);
-#endif
-    return 0;
-}
-#  define __lzo_assert(x)   ((x) ? 1 : __lzo_assert_fail(#x,__LINE__))
-#else
-#  define __lzo_assert(x)   ((x) ? 1 : 0)
-#endif
-
-#undef COMPILE_TIME_ASSERT
-#if 0
-#  define COMPILE_TIME_ASSERT(expr)     r &= __lzo_assert(expr)
-#else
-#  define COMPILE_TIME_ASSERT(expr)     LZO_COMPILE_TIME_ASSERT(expr)
-#endif
-
-static lzo_bool basic_integral_check(void)
-{
-    lzo_bool r = 1;
-
-    COMPILE_TIME_ASSERT(CHAR_BIT == 8);
-    COMPILE_TIME_ASSERT(sizeof(char) == 1);
-    COMPILE_TIME_ASSERT(sizeof(short) >= 2);
-    COMPILE_TIME_ASSERT(sizeof(long) >= 4);
-    COMPILE_TIME_ASSERT(sizeof(int) >= sizeof(short));
-    COMPILE_TIME_ASSERT(sizeof(long) >= sizeof(int));
-
-    COMPILE_TIME_ASSERT(sizeof(lzo_uint) == sizeof(lzo_int));
-    COMPILE_TIME_ASSERT(sizeof(lzo_uint32) == sizeof(lzo_int32));
-
-    COMPILE_TIME_ASSERT(sizeof(lzo_uint32) >= 4);
-    COMPILE_TIME_ASSERT(sizeof(lzo_uint32) >= sizeof(unsigned));
-#if defined(__LZO_STRICT_16BIT)
-    COMPILE_TIME_ASSERT(sizeof(lzo_uint) == 2);
-#else
-    COMPILE_TIME_ASSERT(sizeof(lzo_uint) >= 4);
-    COMPILE_TIME_ASSERT(sizeof(lzo_uint) >= sizeof(unsigned));
-#endif
-
-#if (USHRT_MAX == 65535u)
-    COMPILE_TIME_ASSERT(sizeof(short) == 2);
-#elif (USHRT_MAX == LZO_0xffffffffL)
-    COMPILE_TIME_ASSERT(sizeof(short) == 4);
-#elif (USHRT_MAX >= LZO_0xffffffffL)
-    COMPILE_TIME_ASSERT(sizeof(short) > 4);
-#endif
-#if (UINT_MAX == 65535u)
-    COMPILE_TIME_ASSERT(sizeof(int) == 2);
-#elif (UINT_MAX == LZO_0xffffffffL)
-    COMPILE_TIME_ASSERT(sizeof(int) == 4);
-#elif (UINT_MAX >= LZO_0xffffffffL)
-    COMPILE_TIME_ASSERT(sizeof(int) > 4);
-#endif
-#if (ULONG_MAX == 65535ul)
-    COMPILE_TIME_ASSERT(sizeof(long) == 2);
-#elif (ULONG_MAX == LZO_0xffffffffL)
-    COMPILE_TIME_ASSERT(sizeof(long) == 4);
-#elif (ULONG_MAX >= LZO_0xffffffffL)
-    COMPILE_TIME_ASSERT(sizeof(long) > 4);
-#endif
-
-#if defined(SIZEOF_UNSIGNED)
-    COMPILE_TIME_ASSERT(SIZEOF_UNSIGNED == sizeof(unsigned));
-#endif
-#if defined(SIZEOF_UNSIGNED_LONG)
-    COMPILE_TIME_ASSERT(SIZEOF_UNSIGNED_LONG == sizeof(unsigned long));
-#endif
-#if defined(SIZEOF_UNSIGNED_SHORT)
-    COMPILE_TIME_ASSERT(SIZEOF_UNSIGNED_SHORT == sizeof(unsigned short));
-#endif
-#if !defined(__LZO_IN_MINILZO)
-#if defined(SIZEOF_SIZE_T)
-    COMPILE_TIME_ASSERT(SIZEOF_SIZE_T == sizeof(size_t));
-#endif
-#endif
-
-    COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned char));
-    COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned short));
-    COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned));
-    COMPILE_TIME_ASSERT(IS_UNSIGNED(unsigned long));
-    COMPILE_TIME_ASSERT(IS_SIGNED(short));
-    COMPILE_TIME_ASSERT(IS_SIGNED(int));
-    COMPILE_TIME_ASSERT(IS_SIGNED(long));
-
-    COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_uint32));
-    COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_uint));
-    COMPILE_TIME_ASSERT(IS_SIGNED(lzo_int32));
-    COMPILE_TIME_ASSERT(IS_SIGNED(lzo_int));
-
-    COMPILE_TIME_ASSERT(INT_MAX    == LZO_STYPE_MAX(sizeof(int)));
-    COMPILE_TIME_ASSERT(UINT_MAX   == LZO_UTYPE_MAX(sizeof(unsigned)));
-    COMPILE_TIME_ASSERT(LONG_MAX   == LZO_STYPE_MAX(sizeof(long)));
-    COMPILE_TIME_ASSERT(ULONG_MAX  == LZO_UTYPE_MAX(sizeof(unsigned long)));
-    COMPILE_TIME_ASSERT(SHRT_MAX   == LZO_STYPE_MAX(sizeof(short)));
-    COMPILE_TIME_ASSERT(USHRT_MAX  == LZO_UTYPE_MAX(sizeof(unsigned short)));
-    COMPILE_TIME_ASSERT(LZO_UINT32_MAX == LZO_UTYPE_MAX(sizeof(lzo_uint32)));
-    COMPILE_TIME_ASSERT(LZO_UINT_MAX   == LZO_UTYPE_MAX(sizeof(lzo_uint)));
-#if !defined(__LZO_IN_MINILZO)
-    COMPILE_TIME_ASSERT(SIZE_T_MAX     == LZO_UTYPE_MAX(sizeof(size_t)));
-#endif
-
-    r &= __lzo_assert(LZO_BYTE(257) == 1);
-
-    return r;
-}
-
-static lzo_bool basic_ptr_check(void)
-{
-    lzo_bool r = 1;
-
-    COMPILE_TIME_ASSERT(sizeof(char *) >= sizeof(int));
-    COMPILE_TIME_ASSERT(sizeof(lzo_byte *) >= sizeof(char *));
-
-    COMPILE_TIME_ASSERT(sizeof(lzo_voidp) == sizeof(lzo_byte *));
-    COMPILE_TIME_ASSERT(sizeof(lzo_voidp) == sizeof(lzo_voidpp));
-    COMPILE_TIME_ASSERT(sizeof(lzo_voidp) == sizeof(lzo_bytepp));
-    COMPILE_TIME_ASSERT(sizeof(lzo_voidp) >= sizeof(lzo_uint));
-
-    COMPILE_TIME_ASSERT(sizeof(lzo_ptr_t) == sizeof(lzo_voidp));
-    COMPILE_TIME_ASSERT(sizeof(lzo_ptr_t) == sizeof(lzo_sptr_t));
-    COMPILE_TIME_ASSERT(sizeof(lzo_ptr_t) >= sizeof(lzo_uint));
-
-    COMPILE_TIME_ASSERT(sizeof(lzo_ptrdiff_t) >= 4);
-    COMPILE_TIME_ASSERT(sizeof(lzo_ptrdiff_t) >= sizeof(ptrdiff_t));
-
-    COMPILE_TIME_ASSERT(sizeof(ptrdiff_t) >= sizeof(size_t));
-    COMPILE_TIME_ASSERT(sizeof(lzo_ptrdiff_t) >= sizeof(lzo_uint));
-
-#if defined(SIZEOF_CHAR_P)
-    COMPILE_TIME_ASSERT(SIZEOF_CHAR_P == sizeof(char *));
-#endif
-#if defined(SIZEOF_PTRDIFF_T)
-    COMPILE_TIME_ASSERT(SIZEOF_PTRDIFF_T == sizeof(ptrdiff_t));
-#endif
-
-    COMPILE_TIME_ASSERT(IS_SIGNED(ptrdiff_t));
-    COMPILE_TIME_ASSERT(IS_UNSIGNED(size_t));
-    COMPILE_TIME_ASSERT(IS_SIGNED(lzo_ptrdiff_t));
-    COMPILE_TIME_ASSERT(IS_SIGNED(lzo_sptr_t));
-    COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_ptr_t));
-    COMPILE_TIME_ASSERT(IS_UNSIGNED(lzo_moff_t));
-
-    return r;
-}
-
-static lzo_bool ptr_check(void)
-{
-    lzo_bool r = 1;
-    int i;
-    char _wrkmem[10 * sizeof(lzo_byte *) + sizeof(lzo_full_align_t)];
-    lzo_bytep wrkmem;
-    lzo_bytepp dict;
-    unsigned char x[4 * sizeof(lzo_full_align_t)];
-    long d;
-    lzo_full_align_t a;
-    lzo_full_align_t u;
-
-    for (i = 0; i < (int) sizeof(x); i++)
-	x[i] = LZO_BYTE(i);
-
-    wrkmem = LZO_PTR_ALIGN_UP((lzo_byte *)_wrkmem,sizeof(lzo_full_align_t));
-
-#if 0
-    dict = (lzo_bytepp) wrkmem;
-#else
-
-    u.a_lzo_bytep = wrkmem; dict = u.a_lzo_bytepp;
-#endif
-
-    d = (long) ((const lzo_bytep) dict - (const lzo_bytep) _wrkmem);
-    r &= __lzo_assert(d >= 0);
-    r &= __lzo_assert(d < (long) sizeof(lzo_full_align_t));
-
-    memset(&a,0,sizeof(a));
-    r &= __lzo_assert(a.a_lzo_voidp == NULL);
-
-    memset(&a,0xff,sizeof(a));
-    r &= __lzo_assert(a.a_ushort == USHRT_MAX);
-    r &= __lzo_assert(a.a_uint == UINT_MAX);
-    r &= __lzo_assert(a.a_ulong == ULONG_MAX);
-    r &= __lzo_assert(a.a_lzo_uint == LZO_UINT_MAX);
-    r &= __lzo_assert(a.a_lzo_uint32 == LZO_UINT32_MAX);
-
-    if (r == 1)
-    {
-	for (i = 0; i < 8; i++)
-	    r &= __lzo_assert((const lzo_voidp) (&dict[i]) == (const lzo_voidp) (&wrkmem[i * sizeof(lzo_byte *)]));
-    }
-
-    memset(&a,0,sizeof(a));
-    r &= __lzo_assert(a.a_char_p == NULL);
-    r &= __lzo_assert(a.a_lzo_bytep == NULL);
-    r &= __lzo_assert(NULL == (void *)0);
-    if (r == 1)
-    {
-	for (i = 0; i < 10; i++)
-	    dict[i] = wrkmem;
-	BZERO8_PTR(dict+1,sizeof(dict[0]),8);
-	r &= __lzo_assert(dict[0] == wrkmem);
-	for (i = 1; i < 9; i++)
-	    r &= __lzo_assert(dict[i] == NULL);
-	r &= __lzo_assert(dict[9] == wrkmem);
-    }
-
-    if (r == 1)
-    {
-	unsigned k = 1;
-	const unsigned n = (unsigned) sizeof(lzo_uint32);
-	lzo_byte *p0;
-	lzo_byte *p1;
-
-	k += __lzo_align_gap(&x[k],n);
-	p0 = (lzo_bytep) &x[k];
-#if defined(PTR_LINEAR)
-	r &= __lzo_assert((PTR_LINEAR(p0) & (n-1)) == 0);
-#else
-	r &= __lzo_assert(n == 4);
-	r &= __lzo_assert(PTR_ALIGNED_4(p0));
-#endif
-
-	r &= __lzo_assert(k >= 1);
-	p1 = (lzo_bytep) &x[1];
-	r &= __lzo_assert(PTR_GE(p0,p1));
-
-	r &= __lzo_assert(k < 1+n);
-	p1 = (lzo_bytep) &x[1+n];
-	r &= __lzo_assert(PTR_LT(p0,p1));
-
-	if (r == 1)
-	{
-	    lzo_uint32 v0, v1;
-#if 0
-	    v0 = * (lzo_uint32 *) &x[k];
-	    v1 = * (lzo_uint32 *) &x[k+n];
-#else
-
-	    u.a_uchar_p = &x[k];
-	    v0 = *u.a_lzo_uint32_p;
-	    u.a_uchar_p = &x[k+n];
-	    v1 = *u.a_lzo_uint32_p;
-#endif
-	    r &= __lzo_assert(v0 > 0);
-	    r &= __lzo_assert(v1 > 0);
-	}
-    }
-
-    return r;
-}
-
-LZO_PUBLIC(int)
-_lzo_config_check(void)
-{
-    lzo_bool r = 1;
-    int i;
-    union {
-	lzo_uint32 a;
-	unsigned short b;
-	lzo_uint32 aa[4];
-	unsigned char x[4*sizeof(lzo_full_align_t)];
-    } u;
-
-    COMPILE_TIME_ASSERT( (int) ((unsigned char) ((signed char) -1)) == 255);
-    COMPILE_TIME_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0);
-
-#if 0
-    r &= __lzo_assert((const void *)&u == (const void *)&u.a);
-    r &= __lzo_assert((const void *)&u == (const void *)&u.b);
-    r &= __lzo_assert((const void *)&u == (const void *)&u.x[0]);
-    r &= __lzo_assert((const void *)&u == (const void *)&u.aa[0]);
-#endif
-
-    r &= basic_integral_check();
-    r &= basic_ptr_check();
-    if (r != 1)
-	return LZO_E_ERROR;
-
-    u.a = 0; u.b = 0;
-    for (i = 0; i < (int) sizeof(u.x); i++)
-	u.x[i] = LZO_BYTE(i);
-
-#if defined(LZO_BYTE_ORDER)
-    if (r == 1)
-    {
-#  if (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
-	lzo_uint32 a = (lzo_uint32) (u.a & LZO_0xffffffffL);
-	unsigned short b = (unsigned short) (u.b & 0xffff);
-	r &= __lzo_assert(a == 0x03020100L);
-	r &= __lzo_assert(b == 0x0100);
-#  elif (LZO_BYTE_ORDER == LZO_BIG_ENDIAN)
-	lzo_uint32 a = u.a >> (8 * sizeof(u.a) - 32);
-	unsigned short b = u.b >> (8 * sizeof(u.b) - 16);
-	r &= __lzo_assert(a == 0x00010203L);
-	r &= __lzo_assert(b == 0x0001);
-#  else
-#    error "invalid LZO_BYTE_ORDER"
-#  endif
-    }
-#endif
-
-#if defined(LZO_UNALIGNED_OK_2)
-    COMPILE_TIME_ASSERT(sizeof(short) == 2);
-    if (r == 1)
-    {
-	unsigned short b[4];
-
-	for (i = 0; i < 4; i++)
-	    b[i] = * (const unsigned short *) &u.x[i];
-
-#  if (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
-	r &= __lzo_assert(b[0] == 0x0100);
-	r &= __lzo_assert(b[1] == 0x0201);
-	r &= __lzo_assert(b[2] == 0x0302);
-	r &= __lzo_assert(b[3] == 0x0403);
-#  elif (LZO_BYTE_ORDER == LZO_BIG_ENDIAN)
-	r &= __lzo_assert(b[0] == 0x0001);
-	r &= __lzo_assert(b[1] == 0x0102);
-	r &= __lzo_assert(b[2] == 0x0203);
-	r &= __lzo_assert(b[3] == 0x0304);
-#  endif
-    }
-#endif
-
-#if defined(LZO_UNALIGNED_OK_4)
-    COMPILE_TIME_ASSERT(sizeof(lzo_uint32) == 4);
-    if (r == 1)
-    {
-	lzo_uint32 a[4];
-
-	for (i = 0; i < 4; i++)
-	    a[i] = * (const lzo_uint32 *) &u.x[i];
-
-#  if (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
-	r &= __lzo_assert(a[0] == 0x03020100L);
-	r &= __lzo_assert(a[1] == 0x04030201L);
-	r &= __lzo_assert(a[2] == 0x05040302L);
-	r &= __lzo_assert(a[3] == 0x06050403L);
-#  elif (LZO_BYTE_ORDER == LZO_BIG_ENDIAN)
-	r &= __lzo_assert(a[0] == 0x00010203L);
-	r &= __lzo_assert(a[1] == 0x01020304L);
-	r &= __lzo_assert(a[2] == 0x02030405L);
-	r &= __lzo_assert(a[3] == 0x03040506L);
-#  endif
-    }
-#endif
-
-#if defined(LZO_ALIGNED_OK_4)
-    COMPILE_TIME_ASSERT(sizeof(lzo_uint32) == 4);
-#endif
-
-    COMPILE_TIME_ASSERT(lzo_sizeof_dict_t == sizeof(lzo_dict_t));
-
-#if defined(__LZO_IN_MINLZO)
-    if (r == 1)
-    {
-	lzo_uint32 adler;
-	adler = lzo_adler32(0, NULL, 0);
-	adler = lzo_adler32(adler, lzo_copyright(), 200);
-	r &= __lzo_assert(adler == 0xc76f1751L);
-    }
-#endif
-
-    if (r == 1)
-    {
-	r &= __lzo_assert(!schedule_insns_bug());
-    }
-
-    if (r == 1)
-    {
-	static int x[3];
-	static unsigned xn = 3;
-	register unsigned j;
-
-	for (j = 0; j < xn; j++)
-	    x[j] = (int)j - 3;
-	r &= __lzo_assert(!strength_reduce_bug(x));
-    }
-
-    if (r == 1)
-    {
-	r &= ptr_check();
-    }
-
-    return r == 1 ? LZO_E_OK : LZO_E_ERROR;
-}
-
-static lzo_bool schedule_insns_bug(void)
-{
-#if defined(__LZO_CHECKER)
-    return 0;
-#else
-    const int clone[] = {1, 2, 0};
-    const int *q;
-    q = clone;
-    return (*q) ? 0 : 1;
-#endif
-}
-
-static lzo_bool strength_reduce_bug(int *x)
-{
-    return x[0] != -3 || x[1] != -2 || x[2] != -1;
-}
-
-#undef COMPILE_TIME_ASSERT
-
-int __lzo_init_done = 0;
-
-LZO_PUBLIC(int)
-__lzo_init2(unsigned v, int s1, int s2, int s3, int s4, int s5,
-			int s6, int s7, int s8, int s9)
-{
-    int r;
-
-    __lzo_init_done = 1;
-
-    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_compress_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)
-
-LZO_EXTERN(int)
-__lzo_init(unsigned v,int s1,int s2,int s3,int s4,int s5,int s6,int s7);
-
-LZO_PUBLIC(int)
-__lzo_init(unsigned v,int s1,int s2,int s3,int s4,int s5,int s6,int s7)
-{
-    if (v == 0 || v > 0x1010)
-	return LZO_E_ERROR;
-    return __lzo_init2(v,s1,s2,s3,s4,s5,-1,-1,s6,s7);
-}
-
-#endif
-
-#define do_compress         _lzo1x_1_do_compress
-
-#define LZO_NEED_DICT_H
-#define D_BITS          14
-#define D_INDEX1(d,p)       d = DM((0x21*DX3(p,5,5,6)) >> 5)
-#define D_INDEX2(d,p)       d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f)
-
-#ifndef __LZO_CONFIG1X_H
-#define __LZO_CONFIG1X_H
-
-#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
-#  define LZO1X
-#endif
-
-#if !defined(__LZO_IN_MINILZO)
-#include <lzo1x.h>
-#endif
-
-#define LZO_EOF_CODE
-#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
-
-#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 < 8 || D_BITS > 18)
-#  error "invalid D_BITS"
-#endif
-#if (DL_BITS < 8 || 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
-
-#if (DL_MIN_LEN == 3)
-#  define _DV2_A(p,shift1,shift2) \
-	(((( (lzo_uint32)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2])
-#  define _DV2_B(p,shift1,shift2) \
-	(((( (lzo_uint32)((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_uint32)(p[0]) << shift1) ^ p[1])
-#  define _DV2_B(p,shift1,shift2) \
-	(( (lzo_uint32)(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_uint32)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0])
-#define DS2(p,s1,s2) \
-	(((((lzo_uint32)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0])
-#define DX2(p,s1,s2) \
-	(((((lzo_uint32)((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
-#  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
-#  define DVAL_FIRST(dv,p)  dv = _DV_A((p),5)
-#  define DVAL_NEXT(dv,p) \
-		dv ^= (lzo_uint32)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2])
-#  define _DINDEX(dv,p)     ((0x9f5f * (dv)) >> 5)
-#  define DVAL_LOOKAHEAD    DL_MIN_LEN
-
-#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B)
-#  define __LZO_HASH_INCREMENTAL
-#  define DVAL_FIRST(dv,p)  dv = _DV_B((p),5)
-#  define DVAL_NEXT(dv,p) \
-		dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_uint32)(p[2]) << (2*5)))
-#  define _DINDEX(dv,p)     ((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)
-static void DVAL_ASSERT(lzo_uint32 dv, const lzo_byte *p)
-{
-    lzo_uint32 df;
-    DVAL_FIRST(df,(p));
-    assert(DINDEX(dv,p) == DINDEX(df,p));
-}
-#else
-#  define DVAL_ASSERT(dv,p) ((void) 0)
-#endif
-#endif
-
-#if defined(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_uint) ((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 defined(LZO_DICT_USE_PTR)
-
-#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
-	(m_pos == NULL || (m_off = (lzo_moff_t) (ip - m_pos)) > max_offset)
-
-#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
-    (BOUNDS_CHECKING_OFF_IN_EXPR( \
-	(PTR_LT(m_pos,in) || \
-	 (m_off = (lzo_moff_t) 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 = (lzo_moff_t) ((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) \
-	((lzo_moff_t) ((ip)-(in)) <= m_off || \
-	 ((m_off = (lzo_moff_t) ((ip)-(in)) - m_off) > max_offset) || \
-	 (m_pos = (ip) - (m_off), 0) )
-
-#endif
-
-#if defined(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 DO_COMPRESS     lzo1x_1_compress
-
-static
-lzo_uint do_compress     ( const lzo_byte *in , lzo_uint  in_len,
-				 lzo_byte *out, lzo_uintp out_len,
-				 lzo_voidp wrkmem )
-{
-#if 0 && defined(__GNUC__) && defined(__i386__)
-    register const lzo_byte *ip __asm__("%esi");
-#else
-    register const lzo_byte *ip;
-#endif
-    lzo_byte *op;
-    const lzo_byte * const in_end = in + in_len;
-    const lzo_byte * const ip_end = in + in_len - M2_MAX_LEN - 5;
-    const lzo_byte *ii;
-    lzo_dict_p const dict = (lzo_dict_p) wrkmem;
-
-    op = out;
-    ip = in;
-    ii = ip;
-
-    ip += 4;
-    for (;;)
-    {
-#if 0 && defined(__GNUC__) && defined(__i386__)
-	register const lzo_byte *m_pos __asm__("%edi");
-#else
-	register const lzo_byte *m_pos;
-#endif
-	lzo_moff_t m_off;
-	lzo_uint m_len;
-	lzo_uint dindex;
-
-	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 1 && defined(LZO_UNALIGNED_OK_2)
-	if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip)
-#else
-	if (m_pos[0] != ip[0] || m_pos[1] != ip[1])
-#endif
-	{
-	}
-	else
-	{
-	    if (m_pos[2] == ip[2])
-	    {
-#if 0
-		if (m_off <= M2_MAX_OFFSET)
-		    goto match;
-		if (lit <= 3)
-		    goto match;
-		if (lit == 3)
-		{
-		    assert(op - 2 > out); op[-2] |= LZO_BYTE(3);
-		    *op++ = *ii++; *op++ = *ii++; *op++ = *ii++;
-		    goto code_match;
-		}
-		if (m_pos[3] == ip[3])
-#endif
-		    goto match;
-	    }
-	    else
-	    {
-#if 0
-#if 0
-		if (m_off <= M1_MAX_OFFSET && lit > 0 && lit <= 3)
-#else
-		if (m_off <= M1_MAX_OFFSET && lit == 3)
-#endif
-		{
-		    register lzo_uint t;
-
-		    t = lit;
-		    assert(op - 2 > out); op[-2] |= LZO_BYTE(t);
-		    do *op++ = *ii++; while (--t > 0);
-		    assert(ii == ip);
-		    m_off -= 1;
-		    *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
-		    *op++ = LZO_BYTE(m_off >> 2);
-		    ip += 2;
-		    goto match_done;
-		}
-#endif
-	    }
-	}
-
-literal:
-	UPDATE_I(dict,0,dindex,ip,in);
-	++ip;
-	if (ip >= ip_end)
-	    break;
-	continue;
-
-match:
-	UPDATE_I(dict,0,dindex,ip,in);
-	if (pd(ip,ii) > 0)
-	{
-	    register lzo_uint t = pd(ip,ii);
-
-	    if (t <= 3)
-	    {
-		assert(op - 2 > out);
-		op[-2] |= LZO_BYTE(t);
-	    }
-	    else if (t <= 18)
-		*op++ = LZO_BYTE(t - 3);
-	    else
-	    {
-		register lzo_uint tt = t - 18;
-
-		*op++ = 0;
-		while (tt > 255)
-		{
-		    tt -= 255;
-		    *op++ = 0;
-		}
-		assert(tt > 0);
-		*op++ = LZO_BYTE(tt);
-	    }
-	    do *op++ = *ii++; while (--t > 0);
-	}
-
-	assert(ii == ip);
-	ip += 3;
-	if (m_pos[3] != *ip++ || m_pos[4] != *ip++ || m_pos[5] != *ip++ ||
-	    m_pos[6] != *ip++ || m_pos[7] != *ip++ || m_pos[8] != *ip++
-#ifdef LZO1Y
-	    || m_pos[ 9] != *ip++ || m_pos[10] != *ip++ || m_pos[11] != *ip++
-	    || m_pos[12] != *ip++ || m_pos[13] != *ip++ || m_pos[14] != *ip++
-#endif
-	   )
-	{
-	    --ip;
-	    m_len = ip - ii;
-	    assert(m_len >= 3); assert(m_len <= M2_MAX_LEN);
-
-	    if (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;
-		*op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
-		goto m3_m4_offset;
-	    }
-	    else
-#if defined(LZO1X)
-	    {
-		m_off -= 0x4000;
-		assert(m_off > 0); assert(m_off <= 0x7fff);
-		*op++ = LZO_BYTE(M4_MARKER |
-				 ((m_off & 0x4000) >> 11) | (m_len - 2));
-		goto m3_m4_offset;
-	    }
-#elif defined(LZO1Y)
-		goto m4_match;
-#endif
-	}
-	else
-	{
-	    {
-		const lzo_byte *end = in_end;
-		const lzo_byte *m = m_pos + M2_MAX_LEN + 1;
-		while (ip < end && *m == *ip)
-		    m++, ip++;
-		m_len = (ip - ii);
-	    }
-	    assert(m_len > M2_MAX_LEN);
-
-	    if (m_off <= M3_MAX_OFFSET)
-	    {
-		m_off -= 1;
-		if (m_len <= 33)
-		    *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
-		else
-		{
-		    m_len -= 33;
-		    *op++ = M3_MARKER | 0;
-		    goto m3_m4_len;
-		}
-	    }
-	    else
-	    {
-#if defined(LZO1Y)
-m4_match:
-#endif
-		m_off -= 0x4000;
-		assert(m_off > 0); assert(m_off <= 0x7fff);
-		if (m_len <= M4_MAX_LEN)
-		    *op++ = LZO_BYTE(M4_MARKER |
-				     ((m_off & 0x4000) >> 11) | (m_len - 2));
-		else
-		{
-		    m_len -= M4_MAX_LEN;
-		    *op++ = LZO_BYTE(M4_MARKER | ((m_off & 0x4000) >> 11));
-m3_m4_len:
-		    while (m_len > 255)
-		    {
-			m_len -= 255;
-			*op++ = 0;
-		    }
-		    assert(m_len > 0);
-		    *op++ = LZO_BYTE(m_len);
-		}
-	    }
-
-m3_m4_offset:
-	    *op++ = LZO_BYTE((m_off & 63) << 2);
-	    *op++ = LZO_BYTE(m_off >> 6);
-	}
-
-#if 0
-match_done:
-#endif
-	ii = ip;
-	if (ip >= ip_end)
-	    break;
-    }
-
-    *out_len = op - out;
-    return pd(in_end,ii);
-}
-
-LZO_PUBLIC(int)
-DO_COMPRESS      ( const lzo_byte *in , lzo_uint  in_len,
-			 lzo_byte *out, lzo_uintp out_len,
-			 lzo_voidp wrkmem )
-{
-    lzo_byte *op = out;
-    lzo_uint t;
-
-#if defined(__LZO_QUERY_COMPRESS)
-    if (__LZO_IS_COMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
-	return __LZO_QUERY_COMPRESS(in,in_len,out,out_len,wrkmem,D_SIZE,lzo_sizeof(lzo_dict_t));
-#endif
-
-    if (in_len <= M2_MAX_LEN + 5)
-	t = in_len;
-    else
-    {
-	t = do_compress(in,in_len,op,out_len,wrkmem);
-	op += *out_len;
-    }
-
-    if (t > 0)
-    {
-	const lzo_byte *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;
-		*op++ = 0;
-	    }
-	    assert(tt > 0);
-	    *op++ = LZO_BYTE(tt);
-	}
-	do *op++ = *ii++; while (--t > 0);
-    }
-
-    *op++ = M4_MARKER | 1;
-    *op++ = 0;
-    *op++ = 0;
-
-    *out_len = op - out;
-    return LZO_E_OK;
-}
-
-#undef do_compress
-#undef DO_COMPRESS
-#undef LZO_HASH
-
-#undef LZO_TEST_DECOMPRESS_OVERRUN
-#undef LZO_TEST_DECOMPRESS_OVERRUN_INPUT
-#undef LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT
-#undef LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
-#undef DO_DECOMPRESS
-#define DO_DECOMPRESS       lzo1x_decompress
-
-#if defined(LZO_TEST_DECOMPRESS_OVERRUN)
-#  if !defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
-#    define LZO_TEST_DECOMPRESS_OVERRUN_INPUT       2
-#  endif
-#  if !defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
-#    define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT      2
-#  endif
-#  if !defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
-#    define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
-#  endif
-#endif
-
-#undef TEST_IP
-#undef TEST_OP
-#undef TEST_LOOKBEHIND
-#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_DECOMPRESS_OVERRUN_INPUT)
-#  if (LZO_TEST_DECOMPRESS_OVERRUN_INPUT >= 1)
-#    define TEST_IP             (ip < ip_end)
-#  endif
-#  if (LZO_TEST_DECOMPRESS_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_DECOMPRESS_OVERRUN_OUTPUT)
-#  if (LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT >= 1)
-#    define TEST_OP             (op <= op_end)
-#  endif
-#  if (LZO_TEST_DECOMPRESS_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_DECOMPRESS_OVERRUN_LOOKBEHIND)
-#  define TEST_LOOKBEHIND(m_pos,out)    if (m_pos < out) goto lookbehind_overrun
-#else
-#  define TEST_LOOKBEHIND(m_pos,op)     ((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
-#else
-#  define TEST_IP               1
-#endif
-#if defined(TEST_OP)
-#  define HAVE_TEST_OP
-#else
-#  define TEST_OP               1
-#endif
-
-#if defined(NEED_IP)
-#  define HAVE_NEED_IP
-#else
-#  define NEED_IP(x)            ((void) 0)
-#endif
-#if defined(NEED_OP)
-#  define HAVE_NEED_OP
-#else
-#  define NEED_OP(x)            ((void) 0)
-#endif
-
-#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
-#  define HAVE_ANY_IP
-#endif
-#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
-#  define HAVE_ANY_OP
-#endif
-
-#undef __COPY4
-#define __COPY4(dst,src)    * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
-
-#undef COPY4
-#if defined(LZO_UNALIGNED_OK_4)
-#  define COPY4(dst,src)    __COPY4(dst,src)
-#elif defined(LZO_ALIGNED_OK_4)
-#  define COPY4(dst,src)    __COPY4((lzo_ptr_t)(dst),(lzo_ptr_t)(src))
-#endif
-
-#if defined(DO_DECOMPRESS)
-LZO_PUBLIC(int)
-DO_DECOMPRESS  ( const lzo_byte *in , lzo_uint  in_len,
-		       lzo_byte *out, lzo_uintp out_len,
-		       lzo_voidp wrkmem )
-#endif
-{
-    register lzo_byte *op;
-    register const lzo_byte *ip;
-    register lzo_uint t;
-#if defined(COPY_DICT)
-    lzo_uint m_off;
-    const lzo_byte *dict_end;
-#else
-    register const lzo_byte *m_pos;
-#endif
-
-    const lzo_byte * const ip_end = in + in_len;
-#if defined(HAVE_ANY_OP)
-    lzo_byte * const op_end = out + *out_len;
-#endif
-#if defined(LZO1Z)
-    lzo_uint last_m_off = 0;
-#endif
-
-    LZO_UNUSED(wrkmem);
-
-#if defined(__LZO_QUERY_DECOMPRESS)
-    if (__LZO_IS_DECOMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
-	return __LZO_QUERY_DECOMPRESS(in,in_len,out,out_len,wrkmem,0,0);
-#endif
-
-#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_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
-	if (PTR_ALIGNED2_4(op,ip))
-	{
-#endif
-	COPY4(op,ip);
-	op += 4; ip += 4;
-	if (--t > 0)
-	{
-	    if (t >= 4)
-	    {
-		do {
-		    COPY4(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)
-	{
-	    *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_LOOKBEHIND(m_pos,out); NEED_OP(3);
-	*op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
-#endif
-	goto match_done;
-
-	while (TEST_IP && TEST_OP)
-	{
-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_LOOKBEHIND(m_pos,out); 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) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
-		m_pos = op - 1;
-		m_pos -= (* (const lzo_ushortp) 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) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
-		m_pos -= (* (const lzo_ushortp) 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 = 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_LOOKBEHIND(m_pos,out); 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_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
-#if 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
-		COPY4(op,m_pos);
-		op += 4; m_pos += 4; t -= 4 - (3 - 1);
-		do {
-		    COPY4(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); NEED_OP(t); NEED_IP(t+1);
-	    do *op++ = *ip++; while (--t > 0);
-	    t = *ip++;
-	}
-    }
-
-#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
-    *out_len = op - out;
-    return LZO_E_EOF_NOT_FOUND;
-#endif
-
-eof_found:
-    assert(t == 1);
-    *out_len = 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 = op - out;
-    return LZO_E_INPUT_OVERRUN;
-#endif
-
-#if defined(HAVE_NEED_OP)
-output_overrun:
-    *out_len = op - out;
-    return LZO_E_OUTPUT_OVERRUN;
-#endif
-
-#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
-lookbehind_overrun:
-    *out_len = op - out;
-    return LZO_E_LOOKBEHIND_OVERRUN;
-#endif
-}
-
-#define LZO_TEST_DECOMPRESS_OVERRUN
-#undef DO_DECOMPRESS
-#define DO_DECOMPRESS       lzo1x_decompress_safe
-
-#if defined(LZO_TEST_DECOMPRESS_OVERRUN)
-#  if !defined(LZO_TEST_DECOMPRESS_OVERRUN_INPUT)
-#    define LZO_TEST_DECOMPRESS_OVERRUN_INPUT       2
-#  endif
-#  if !defined(LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT)
-#    define LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT      2
-#  endif
-#  if !defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
-#    define LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND
-#  endif
-#endif
-
-#undef TEST_IP
-#undef TEST_OP
-#undef TEST_LOOKBEHIND
-#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_DECOMPRESS_OVERRUN_INPUT)
-#  if (LZO_TEST_DECOMPRESS_OVERRUN_INPUT >= 1)
-#    define TEST_IP             (ip < ip_end)
-#  endif
-#  if (LZO_TEST_DECOMPRESS_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_DECOMPRESS_OVERRUN_OUTPUT)
-#  if (LZO_TEST_DECOMPRESS_OVERRUN_OUTPUT >= 1)
-#    define TEST_OP             (op <= op_end)
-#  endif
-#  if (LZO_TEST_DECOMPRESS_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_DECOMPRESS_OVERRUN_LOOKBEHIND)
-#  define TEST_LOOKBEHIND(m_pos,out)    if (m_pos < out) goto lookbehind_overrun
-#else
-#  define TEST_LOOKBEHIND(m_pos,op)     ((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
-#else
-#  define TEST_IP               1
-#endif
-#if defined(TEST_OP)
-#  define HAVE_TEST_OP
-#else
-#  define TEST_OP               1
-#endif
-
-#if defined(NEED_IP)
-#  define HAVE_NEED_IP
-#else
-#  define NEED_IP(x)            ((void) 0)
-#endif
-#if defined(NEED_OP)
-#  define HAVE_NEED_OP
-#else
-#  define NEED_OP(x)            ((void) 0)
-#endif
-
-#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
-#  define HAVE_ANY_IP
-#endif
-#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
-#  define HAVE_ANY_OP
-#endif
-
-#undef __COPY4
-#define __COPY4(dst,src)    * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
-
-#undef COPY4
-#if defined(LZO_UNALIGNED_OK_4)
-#  define COPY4(dst,src)    __COPY4(dst,src)
-#elif defined(LZO_ALIGNED_OK_4)
-#  define COPY4(dst,src)    __COPY4((lzo_ptr_t)(dst),(lzo_ptr_t)(src))
-#endif
-
-#if defined(DO_DECOMPRESS)
-LZO_PUBLIC(int)
-DO_DECOMPRESS  ( const lzo_byte *in , lzo_uint  in_len,
-		       lzo_byte *out, lzo_uintp out_len,
-		       lzo_voidp wrkmem )
-#endif
-{
-    register lzo_byte *op;
-    register const lzo_byte *ip;
-    register lzo_uint t;
-#if defined(COPY_DICT)
-    lzo_uint m_off;
-    const lzo_byte *dict_end;
-#else
-    register const lzo_byte *m_pos;
-#endif
-
-    const lzo_byte * const ip_end = in + in_len;
-#if defined(HAVE_ANY_OP)
-    lzo_byte * const op_end = out + *out_len;
-#endif
-#if defined(LZO1Z)
-    lzo_uint last_m_off = 0;
-#endif
-
-    LZO_UNUSED(wrkmem);
-
-#if defined(__LZO_QUERY_DECOMPRESS)
-    if (__LZO_IS_DECOMPRESS_QUERY(in,in_len,out,out_len,wrkmem))
-	return __LZO_QUERY_DECOMPRESS(in,in_len,out,out_len,wrkmem,0,0);
-#endif
-
-#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_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
-	if (PTR_ALIGNED2_4(op,ip))
-	{
-#endif
-	COPY4(op,ip);
-	op += 4; ip += 4;
-	if (--t > 0)
-	{
-	    if (t >= 4)
-	    {
-		do {
-		    COPY4(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)
-	{
-	    *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_LOOKBEHIND(m_pos,out); NEED_OP(3);
-	*op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos;
-#endif
-	goto match_done;
-
-	while (TEST_IP && TEST_OP)
-	{
-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_LOOKBEHIND(m_pos,out); 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) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
-		m_pos = op - 1;
-		m_pos -= (* (const lzo_ushortp) 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) && (LZO_BYTE_ORDER == LZO_LITTLE_ENDIAN)
-		m_pos -= (* (const lzo_ushortp) 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 = 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_LOOKBEHIND(m_pos,out); 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_LOOKBEHIND(m_pos,out); assert(t > 0); NEED_OP(t+3-1);
-#if 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
-		COPY4(op,m_pos);
-		op += 4; m_pos += 4; t -= 4 - (3 - 1);
-		do {
-		    COPY4(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); NEED_OP(t); NEED_IP(t+1);
-	    do *op++ = *ip++; while (--t > 0);
-	    t = *ip++;
-	}
-    }
-
-#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP)
-    *out_len = op - out;
-    return LZO_E_EOF_NOT_FOUND;
-#endif
-
-eof_found:
-    assert(t == 1);
-    *out_len = 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 = op - out;
-    return LZO_E_INPUT_OVERRUN;
-#endif
-
-#if defined(HAVE_NEED_OP)
-output_overrun:
-    *out_len = op - out;
-    return LZO_E_OUTPUT_OVERRUN;
-#endif
-
-#if defined(LZO_TEST_DECOMPRESS_OVERRUN_LOOKBEHIND)
-lookbehind_overrun:
-    *out_len = op - out;
-    return LZO_E_LOOKBEHIND_OVERRUN;
-#endif
-}
-
-/***** End of minilzo.c *****/
-
diff --git a/ica/x11/libvncclient/rfbproto.c b/ica/x11/libvncclient/rfbproto.c
index 83ba3a5..e046fd8 100644
--- a/ica/x11/libvncclient/rfbproto.c
+++ b/ica/x11/libvncclient/rfbproto.c
@@ -31,8 +31,6 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#else
-#define strncasecmp _strnicmp
 #endif
 #include <errno.h>
 #ifndef WIN32
@@ -52,9 +50,19 @@
 #include <stdarg.h>
 #include <time.h>
 
+#ifdef LIBVNCSERVER_WITH_CLIENT_GCRYPT
+#ifdef WIN32
+#undef SOCKET
+#undef socklen_t
+#endif
+#include <gcrypt.h>
+#endif
+
 #include "minilzo.h"
 #include "tls.h"
 
+#include "ItalcRfbExt.h"
+
 /*
  * rfbClientLog prints a time-stamped message to the log file (stderr).
  */
@@ -418,6 +426,9 @@ ConnectToRFBServer(rfbClient* client,const char *hostname, int port)
     return FALSE;
   }
 
+  if(client->QoS_DSCP && !SetDSCP(client->sock, client->QoS_DSCP))
+     return FALSE;
+
   return SetNonBlocking(client->sock);
 }
 
@@ -549,11 +560,6 @@ ReadSupportedSecurityType(rfbClient* client, uint32_t *result, rfbBool subAuth)
         ReadReason(client);
         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;
@@ -563,7 +569,10 @@ ReadSupportedSecurityType(rfbClient* client, uint32_t *result, rfbBool subAuth)
         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]==rfbMSLogon ||
+        if (tAuth[loop]==rfbVncAuth || tAuth[loop]==rfbNoAuth ||
+			( tAuth[loop] == rfbUltraVNC_MsLogonIIAuth && isLogonAuthenticationEnabled( client ) ) ||
+			tAuth[loop] == rfbSecTypeItalc ||
+            tAuth[loop]==rfbARD ||
             (!subAuth && (tAuth[loop]==rfbTLS || tAuth[loop]==rfbVeNCrypt)))
         {
             if (!subAuth && client->clientAuthSchemes)
@@ -793,6 +802,208 @@ HandleMSLogonAuth(rfbClient *client)
   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.
  */
@@ -832,7 +1043,9 @@ InitialiseRFBConnection(rfbClient* client)
   rfbProtocolVersionMsg pv;
   int major,minor;
   uint32_t authScheme;
+#ifdef LIBVNCSERVER_WITH_CLIENT_TLS
   uint32_t subAuthScheme;
+#endif
   rfbClientInitMsg ci;
 
   /* if the connection is immediately closed, don't report anything, so
@@ -926,6 +1139,15 @@ InitialiseRFBConnection(rfbClient* client)
     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:
 #ifndef LIBVNCSERVER_WITH_CLIENT_TLS
     rfbClientLog("TLS support was not compiled in\n");
@@ -997,6 +1219,16 @@ InitialiseRFBConnection(rfbClient* client)
 #endif
     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);
@@ -1228,6 +1460,9 @@ SetFormatAndEncodings(rfbClient* client)
   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)
@@ -1268,6 +1503,13 @@ 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;
   
@@ -1393,6 +1635,37 @@ rfbBool PermitServerInput(rfbClient* client, int enabled)
 
 
 /*
+ * 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.
  */
 
@@ -1982,6 +2255,24 @@ HandleRFBServerMessage(rfbClient* client)
       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,
@@ -2131,5 +2422,5 @@ PrintPixelFormat(rfbPixelFormat *format)
 #define rfbUseKey rfbClientUseKey
 #define rfbCPKey rfbClientCPKey
 
-#include "../libvncserver/vncauth.c"
-#include "../libvncserver/d3des.c"
+#include "vncauth.c"
+#include "d3des.c"
diff --git a/ica/x11/libvncclient/sockets.c b/ica/x11/libvncclient/sockets.c
index 28b0256..1e44fa3 100644
--- a/ica/x11/libvncclient/sockets.c
+++ b/ica/x11/libvncclient/sockets.c
@@ -153,6 +153,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
 	    /* TODO:
 	       ProcessXtEvents();
 	    */
+	    WaitForMessage(client, 100000);
 	    i = 0;
 	  } else {
 	    rfbClientErr("read (%d: %s)\n",errno,strerror(errno));
@@ -194,6 +195,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
 	    /* TODO:
 	       ProcessXtEvents();
 	    */
+	    WaitForMessage(client, 100000);
 	    i = 0;
 	  } else {
 	    rfbClientErr("read (%s)\n",strerror(errno));
@@ -252,6 +254,9 @@ WriteToRFBServer(rfbClient* client, char *buf, int 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 ||
@@ -325,7 +330,7 @@ ConnectClientToTcpAddr(unsigned int host, int port)
   }
 
   if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
-    rfbClientErr("ConnectToTcpAddr: connect\n");
+    /*rfbClientErr("ConnectToTcpAddr: connect\n");*/
     close(sock);
     return -1;
   }
@@ -566,6 +571,55 @@ SetNonBlocking(int sock)
 }
 
 
+
+/*
+ * 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.
  */
@@ -676,8 +730,12 @@ int WaitForMessage(rfbClient* client,unsigned int usecs)
   FD_SET(client->sock,&fds);
 
   num=select(client->sock+1, &fds, NULL, NULL, &timeout);
-  if(num<0)
+  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/tls.c b/ica/x11/libvncclient/tls.c
index 206dbda..5d29362 100644
--- a/ica/x11/libvncclient/tls.c
+++ b/ica/x11/libvncclient/tls.c
@@ -19,14 +19,20 @@
 
 #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"
 
 #ifdef LIBVNCSERVER_WITH_CLIENT_TLS
 
-static const int rfbCertTypePriority[] = { GNUTLS_CRT_X509, 0 };
-static const int rfbProtoPriority[]= { GNUTLS_TLS1_1, GNUTLS_TLS1_0, GNUTLS_SSL3, 0 };
-static const int rfbKXPriority[] = {GNUTLS_KX_DHE_DSS, GNUTLS_KX_RSA, GNUTLS_KX_DHE_RSA, GNUTLS_KX_SRP, 0};
-static const int rfbKXAnon[] = {GNUTLS_KX_ANON_DH, 0};
+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;
@@ -51,6 +57,33 @@ InitializeTLS(void)
   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)
 {
@@ -62,6 +95,9 @@ PushTLS(gnutls_transport_ptr_t transport, const void *data, size_t len)
     ret = write(client->sock, data, len);
     if (ret < 0)
     {
+#ifdef WIN32
+      WSAtoTLSErrno();
+#endif
       if (errno == EINTR) continue;
       return -1;
     }
@@ -81,6 +117,9 @@ PullTLS(gnutls_transport_ptr_t transport, void *data, size_t len)
     ret = read(client->sock, data, len);
     if (ret < 0)
     {
+#ifdef WIN32
+      WSAtoTLSErrno();
+#endif
       if (errno == EINTR) continue;
       return -1;
     }
@@ -92,6 +131,7 @@ static rfbBool
 InitializeTLSSession(rfbClient* client, rfbBool anonTLS)
 {
   int ret;
+  const char *p;
 
   if (client->tlsSession) return TRUE;
 
@@ -101,14 +141,10 @@ InitializeTLSSession(rfbClient* client, rfbBool anonTLS)
     return FALSE;
   }
 
-  if ((ret = gnutls_set_default_priority(client->tlsSession)) < 0 ||
-      (ret = gnutls_kx_set_priority(client->tlsSession, anonTLS ? rfbKXAnon : rfbKXPriority)) < 0 ||
-      (ret = gnutls_certificate_type_set_priority(client->tlsSession, rfbCertTypePriority)) < 0 ||
-      (ret = gnutls_protocol_set_priority(client->tlsSession, rfbProtoPriority)) < 0)
+  if ((ret = gnutls_priority_set_direct(client->tlsSession,
+    anonTLS ? rfbAnonTLSPriority : rfbTLSPriority, &p)) < 0)
   {
-    FreeTLS(client);
-    rfbClientLog("Failed to set TLS priority: %s.\n", gnutls_strerror(ret));
-    return FALSE;
+    rfbClientLog("Warning: Failed to set TLS priority: %s (%s).\n", gnutls_strerror(ret), p);
   }
 
   gnutls_transport_set_ptr(client->tlsSession, (gnutls_transport_ptr_t)client);
@@ -186,6 +222,7 @@ ReadVeNCryptSecurityType(rfbClient* client, uint32_t *result)
         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));
diff --git a/ica/x11/libvncclient/ultra.c b/ica/x11/libvncclient/ultra.c
index 3be150d..dac89b5 100644
--- a/ica/x11/libvncclient/ultra.c
+++ b/ica/x11/libvncclient/ultra.c
@@ -37,7 +37,7 @@ HandleUltraBPP (rfbClient* client, int rx, int ry, int rw, int rh)
   rfbZlibHeader hdr;
   int toRead=0;
   int inflateResult=0;
-  int uncompressedBytes = (( rw * rh ) * ( BPP / 8 ));
+  lzo_uint uncompressedBytes = (( rw * rh ) * ( BPP / 8 ));
 
   if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader))
     return FALSE;
@@ -57,7 +57,7 @@ HandleUltraBPP (rfbClient* client, int rx, int ry, int rw, int rh)
    * buffer, this buffer allocation should only happen once, on the
    * first update.
    */
-  if ( client->raw_buffer_size < uncompressedBytes) {
+  if ( client->raw_buffer_size < (int)uncompressedBytes) {
     if ( client->raw_buffer != NULL ) {
       free( client->raw_buffer );
     }
@@ -119,7 +119,7 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
   int toRead=0;
   int inflateResult=0;
   unsigned char *ptr=NULL;
-  int uncompressedBytes = ry + (rw * 65535);
+  lzo_uint uncompressedBytes = ry + (rw * 65535);
   unsigned int numCacheRects = rx;
 
   if (!ReadFromRFBServer(client, (char *)&hdr, sz_rfbZlibHeader))
@@ -141,7 +141,7 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
    * buffer, this buffer allocation should only happen once, on the
    * first update.
    */
-  if ( client->raw_buffer_size < (uncompressedBytes + 500)) {
+  if ( client->raw_buffer_size < (int)(uncompressedBytes + 500)) {
     if ( client->raw_buffer != NULL ) {
       free( client->raw_buffer );
     }
@@ -170,7 +170,7 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
   uncompressedBytes = client->raw_buffer_size;
   inflateResult = lzo1x_decompress(
               (lzo_byte *)client->ultra_buffer, toRead,
-              (lzo_byte *)client->raw_buffer, (lzo_uintp) &uncompressedBytes, NULL);
+              (lzo_byte *)client->raw_buffer, &uncompressedBytes, NULL);
   if ( inflateResult != LZO_E_OK ) 
   {
     rfbClientLog("ultra decompress returned error: %d\n",
diff --git a/ica/x11/libvncclient/vncviewer.c b/ica/x11/libvncclient/vncviewer.c
index 6541c1d..1c5ea6e 100644
--- a/ica/x11/libvncclient/vncviewer.c
+++ b/ica/x11/libvncclient/vncviewer.c
@@ -186,6 +186,7 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
   client->Bell = Dummy;
   client->CurrentKeyboardLedState = 0;
   client->HandleKeyboardLedState = (HandleKeyboardLedStateProc)DummyPoint;
+  client->QoS_DSCP = 0;
 
   client->authScheme = 0;
   client->subAuthScheme = 0;
@@ -288,6 +289,9 @@ rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) {
       } 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],':');
 
diff --git a/ica/x11/libvncclient/zrle.c b/ica/x11/libvncclient/zrle.c
index da2db4b..a14ad44 100644
--- a/ica/x11/libvncclient/zrle.c
+++ b/ica/x11/libvncclient/zrle.c
@@ -72,7 +72,7 @@
 #define PIXEL_T __RFB_CONCAT3E(uint,BPP,_t)
 #if BPP!=8
 #define ZYWRLE_DECODE 1
-#include "../libvncserver/zywrletemplate.c"
+#include "zywrletemplate.c"
 #endif
 #undef CPIXEL
 
@@ -363,7 +363,7 @@ static int HandleZRLETile(rfbClient* client,
 		{
 			return -8;
 		}
-		else if( (type >= 130)&&(type <= 255) ) /* palette RLE */
+		else if( type >= 130 ) /* palette RLE */
 		{
 			CARDBPP palette[128];
 			int i,j;
diff --git a/ica/x11/libvncserver/auth.c b/ica/x11/libvncserver/auth.c
index bb7f62a..f4c4a33 100644
--- a/ica/x11/libvncserver/auth.c
+++ b/ica/x11/libvncserver/auth.c
@@ -30,7 +30,7 @@
 #include <rfb/rfb.h>
 
 /* RFB 3.8 clients are well informed */
-void rfbClientSendString(rfbClientPtr cl, char *reason);
+void rfbClientSendString(rfbClientPtr cl, const char *reason);
 
 
 /*
@@ -226,10 +226,9 @@ rfbSendSecurityTypeList(rfbClientPtr cl, int primaryType)
  * Tell the client what security type will be used (protocol 3.3).
  */
 static void
-rfbSendSecurityType(rfbClientPtr cl, int32_t securityType)
+rfbSendSecurityType(rfbClientPtr cl, uint32_t securityType)
 {
     uint32_t value32;
-
     /* Send the value. */
     value32 = Swap32IfLE(securityType);
     if (rfbWriteExact(cl, (char *)&value32, 4) < 0) {
@@ -249,6 +248,15 @@ rfbSendSecurityType(rfbClientPtr cl, int32_t securityType)
 	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);
@@ -267,7 +275,7 @@ rfbSendSecurityType(rfbClientPtr cl, int32_t securityType)
 void
 rfbAuthNewClient(rfbClientPtr cl)
 {
-    int32_t securityType = rfbSecTypeInvalid;
+    uint32_t securityType = rfbSecTypeInvalid;
 #if 0
     if (!cl->screen->authPasswdData || cl->reverseConnection) {
 	/* chk if this condition is valid or not. */
@@ -275,6 +283,8 @@ rfbAuthNewClient(rfbClientPtr cl)
     } else if (cl->screen->authPasswdData) {
  	    securityType = rfbSecTypeVncAuth;
     }
+#else
+	securityType = rfbMSLogon;
 #endif
 
     if (cl->protocolMajorVersion==3 && cl->protocolMinorVersion < 7)
diff --git a/ica/x11/libvncserver/corre.c b/ica/x11/libvncserver/corre.c
index bb07c77..8a845ea 100644
--- a/ica/x11/libvncserver/corre.c
+++ b/ica/x11/libvncserver/corre.c
@@ -30,37 +30,19 @@
 #include <rfb/rfb.h>
 
 /*
- * rreBeforeBuf contains pixel data in the client's format.
- * rreAfterBuf contains the RRE encoded version.  If the RRE encoded version is
- * larger than the raw data or if it exceeds rreAfterBufSize then
+ * 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 rreBeforeBufSize = 0;
-static char *rreBeforeBuf = NULL;
-
-static int rreAfterBufSize = 0;
-static char *rreAfterBuf = NULL;
-static int rreAfterBufLen = 0;
-
-static int subrectEncode8(uint8_t *data, int w, int h);
-static int subrectEncode16(uint16_t *data, int w, int h);
-static int subrectEncode32(uint32_t *data, int w, int h);
+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);
 
-void rfbCoRRECleanup(rfbScreenInfoPtr screen)
-{
-  if (rreBeforeBufSize) {
-    free(rreBeforeBuf);
-    rreBeforeBufSize=0;
-  }
-  if (rreAfterBufSize) {
-    free(rreAfterBuf);
-    rreAfterBufSize=0;
-  }
-}
 
 /*
  * rfbSendRectEncodingCoRRE - send an arbitrary size rectangle using CoRRE
@@ -114,35 +96,35 @@ rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
     int maxRawSize = (cl->scaledScreen->width * cl->scaledScreen->height
                       * (cl->format.bitsPerPixel / 8));
 
-    if (rreBeforeBufSize < maxRawSize) {
-        rreBeforeBufSize = maxRawSize;
-        if (rreBeforeBuf == NULL)
-            rreBeforeBuf = (char *)malloc(rreBeforeBufSize);
+    if (cl->beforeEncBufSize < maxRawSize) {
+        cl->beforeEncBufSize = maxRawSize;
+        if (cl->beforeEncBuf == NULL)
+            cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize);
         else
-            rreBeforeBuf = (char *)realloc(rreBeforeBuf, rreBeforeBufSize);
+            cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize);
     }
 
-    if (rreAfterBufSize < maxRawSize) {
-        rreAfterBufSize = maxRawSize;
-        if (rreAfterBuf == NULL)
-            rreAfterBuf = (char *)malloc(rreAfterBufSize);
+    if (cl->afterEncBufSize < maxRawSize) {
+        cl->afterEncBufSize = maxRawSize;
+        if (cl->afterEncBuf == NULL)
+            cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize);
         else
-            rreAfterBuf = (char *)realloc(rreAfterBuf, rreAfterBufSize);
+            cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize);
     }
 
     (*cl->translateFn)(cl->translateLookupTable,&(cl->screen->serverFormat),
-                       &cl->format, fbptr, rreBeforeBuf,
+                       &cl->format, fbptr, cl->beforeEncBuf,
                        cl->scaledScreen->paddedWidthInBytes, w, h);
 
     switch (cl->format.bitsPerPixel) {
     case 8:
-        nSubrects = subrectEncode8((uint8_t *)rreBeforeBuf, w, h);
+        nSubrects = subrectEncode8(cl, (uint8_t *)cl->beforeEncBuf, w, h);
         break;
     case 16:
-        nSubrects = subrectEncode16((uint16_t *)rreBeforeBuf, w, h);
+        nSubrects = subrectEncode16(cl, (uint16_t *)cl->beforeEncBuf, w, h);
         break;
     case 32:
-        nSubrects = subrectEncode32((uint32_t *)rreBeforeBuf, w, h);
+        nSubrects = subrectEncode32(cl, (uint32_t *)cl->beforeEncBuf, w, h);
         break;
     default:
         rfbLog("getBgColour: bpp %d?\n",cl->format.bitsPerPixel);
@@ -157,7 +139,7 @@ rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
     }
 
     rfbStatRecordEncodingSent(cl,rfbEncodingCoRRE,
-        sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + rreAfterBufLen,
+        sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + cl->afterEncBufLen,
         sz_rfbFramebufferUpdateRectHeader + w * h * (cl->format.bitsPerPixel / 8));
 
     if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader
@@ -182,15 +164,15 @@ rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
     memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbRREHeader);
     cl->ublen += sz_rfbRREHeader;
 
-    for (i = 0; i < rreAfterBufLen;) {
+    for (i = 0; i < cl->afterEncBufLen;) {
 
         int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
 
-        if (i + bytesToCopy > rreAfterBufLen) {
-            bytesToCopy = rreAfterBufLen - i;
+        if (i + bytesToCopy > cl->afterEncBufLen) {
+            bytesToCopy = cl->afterEncBufLen - i;
         }
 
-        memcpy(&cl->updateBuf[cl->ublen], &rreAfterBuf[i], bytesToCopy);
+        memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy);
 
         cl->ublen += bytesToCopy;
         i += bytesToCopy;
@@ -210,7 +192,7 @@ rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
  * 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 rreAfterBuf.  The
+ * 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.
@@ -221,7 +203,7 @@ rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl,
 
 #define DEFINE_SUBRECT_ENCODE(bpp)                                            \
 static int                                                                    \
-subrectEncode##bpp(uint##bpp##_t *data, int w, int h) {                       \
+subrectEncode##bpp(rfbClientPtr client, uint##bpp##_t *data, int w, int h) {                       \
     uint##bpp##_t cl;                                                         \
     rfbCoRRERectangle subrect;                                                \
     int x,y;                                                                  \
@@ -236,9 +218,9 @@ subrectEncode##bpp(uint##bpp##_t *data, int w, int h) {                       \
     int newLen;                                                               \
     uint##bpp##_t bg = (uint##bpp##_t)getBgColour((char*)data,w*h,bpp);       \
                                                                               \
-    *((uint##bpp##_t*)rreAfterBuf) = bg;                                      \
+    *((uint##bpp##_t*)client->afterEncBuf) = bg;                                      \
                                                                               \
-    rreAfterBufLen = (bpp/8);                                                 \
+    client->afterEncBufLen = (bpp/8);                                                 \
                                                                               \
     for (y=0; y<h; y++) {                                                     \
       line = data+(y*w);                                                      \
@@ -283,15 +265,15 @@ subrectEncode##bpp(uint##bpp##_t *data, int w, int h) {                       \
           subrect.w = thew;                                                   \
           subrect.h = theh;                                                   \
                                                                               \
-          newLen = rreAfterBufLen + (bpp/8) + sz_rfbCoRRERectangle;           \
-          if ((newLen > (w * h * (bpp/8))) || (newLen > rreAfterBufSize))     \
+          newLen = client->afterEncBufLen + (bpp/8) + sz_rfbCoRRERectangle;           \
+          if ((newLen > (w * h * (bpp/8))) || (newLen > client->afterEncBufSize))     \
             return -1;                                                        \
                                                                               \
           numsubs += 1;                                                       \
-          *((uint##bpp##_t*)(rreAfterBuf + rreAfterBufLen)) = cl;             \
-          rreAfterBufLen += (bpp/8);                                          \
-          memcpy(&rreAfterBuf[rreAfterBufLen],&subrect,sz_rfbCoRRERectangle); \
-          rreAfterBufLen += sz_rfbCoRRERectangle;                             \
+          *((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.                                    \
diff --git a/ica/x11/libvncserver/httpd.c b/ica/x11/libvncserver/httpd.c
index 320e6d2..ad2a51b 100644
--- a/ica/x11/libvncserver/httpd.c
+++ b/ica/x11/libvncserver/httpd.c
@@ -269,6 +269,9 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
 	    if (got == 0) {
 		rfbErr("httpd: premature connection close\n");
 	    } else {
+#ifdef WIN32
+	        errno=WSAGetLastError();
+#endif
 		if (errno == EAGAIN) {
 		    return;
 		}
diff --git a/ica/x11/libvncserver/main.c b/ica/x11/libvncserver/main.c
index 807d782..0edf994 100644
--- a/ica/x11/libvncserver/main.c
+++ b/ica/x11/libvncserver/main.c
@@ -145,6 +145,11 @@ rfbUnregisterProtocolExtension(rfbProtocolExtension* extension)
 
 rfbProtocolExtension* rfbGetExtensionIterator()
 {
+	if (! extMutex_initialized) {
+		INIT_MUTEX(extMutex);
+		extMutex_initialized = 1;
+	}
+
 	LOCK(extMutex);
 	return rfbExtensionHead;
 }
@@ -512,6 +517,11 @@ clientInput(void *data)
 	struct timeval tv;
 	int n;
 
+	if (cl->sock == -1) {
+	  /* Client has disconnected. */
+            break;
+        }
+
 	FD_ZERO(&rfds);
 	FD_SET(cl->sock, &rfds);
 	FD_ZERO(&efds);
@@ -541,11 +551,6 @@ clientInput(void *data)
 
         if (FD_ISSET(cl->sock, &rfds) || FD_ISSET(cl->sock, &efds))
             rfbProcessClientMessage(cl);
-
-        if (cl->sock == -1) {
-            /* Client has disconnected. */
-            break;
-        }
     }
 
     /* Get rid of the output thread. */
@@ -896,6 +901,7 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
    screen->displayHook = NULL;
    screen->displayFinishedHook = NULL;
    screen->getKeyboardLedStateHook = NULL;
+   screen->xvpHook = NULL;
 
    /* initialize client list and iterator mutex */
    rfbClientListInit(screen);
@@ -997,9 +1003,6 @@ void rfbScreenCleanup(rfbScreenInfoPtr screen)
   if(screen->cursor && screen->cursor->cleanup)
     rfbFreeCursor(screen->cursor);
 
-  rfbRRECleanup(screen);
-  rfbCoRRECleanup(screen);
-  rfbUltraCleanup(screen);
 #ifdef LIBVNCSERVER_HAVE_LIBZ
   rfbZlibCleanup(screen);
 #ifdef LIBVNCSERVER_HAVE_LIBJPEG
@@ -1068,7 +1071,6 @@ rfbProcessEvents(rfbScreenInfoPtr screen,long usec)
 {
   rfbClientIteratorPtr i;
   rfbClientPtr cl,clPrev;
-  struct timeval tv;
   rfbBool result=FALSE;
   extern rfbClientIteratorPtr
     rfbGetClientIteratorWithClosed(rfbScreenInfoPtr rfbScreen);
@@ -1082,24 +1084,44 @@ rfbProcessEvents(rfbScreenInfoPtr screen,long usec)
   i = rfbGetClientIteratorWithClosed(screen);
   cl=rfbClientIteratorHead(i);
   while(cl) {
-    if (cl->sock >= 0 && !cl->onHold && FB_UPDATE_PENDING(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);
+          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++;
+        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);
-	}
+        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);
+        }
       }
     }
 
@@ -1116,23 +1138,15 @@ rfbProcessEvents(rfbScreenInfoPtr screen,long usec)
            +(tv.tv_usec-cl->startPtrDeferring.tv_usec)/1000)
            > cl->screen->deferPtrUpdateTime) {
           cl->startPtrDeferring.tv_usec = 0;
-          cl->screen->ptrAddEvent(cl->lastPtrButtons, 
-                                  cl->lastPtrX, 
+          cl->screen->ptrAddEvent(cl->lastPtrButtons,
+                                  cl->lastPtrX,
                                   cl->lastPtrY, cl);
-	  cl->lastPtrX = -1;
+          cl->lastPtrX = -1;
         }
       }
     }
-    clPrev=cl;
-    cl=rfbClientIteratorNext(i);
-    if(clPrev->sock==-1) {
-      rfbClientConnectionGone(clPrev);
-      result=TRUE;
-    }
-  }
-  rfbReleaseClientIterator(i);
 
-  return result;
+    return result;
 }
 
 rfbBool rfbIsActive(rfbScreenInfoPtr screenInfo) {
diff --git a/ica/x11/libvncserver/private.h b/ica/x11/libvncserver/private.h
index 71370b5..d656e39 100644
--- a/ica/x11/libvncserver/private.h
+++ b/ica/x11/libvncserver/private.h
@@ -29,16 +29,7 @@ void rfbFreeZrleData(rfbClientPtr cl);
 
 /* from ultra.c */
 
-extern void rfbUltraCleanup(rfbScreenInfoPtr screen);
 extern void rfbFreeUltraData(rfbClientPtr cl);
 
-/* from rre.c */
-
-extern void rfbRRECleanup(rfbScreenInfoPtr screen);
-
-/* from corre.c */
-
-extern void rfbCoRRECleanup(rfbScreenInfoPtr screen);
-
 #endif
 
diff --git a/ica/x11/libvncserver/rfbserver.c b/ica/x11/libvncserver/rfbserver.c
index 5f8d22a..8f0e390 100644
--- a/ica/x11/libvncserver/rfbserver.c
+++ b/ica/x11/libvncserver/rfbserver.c
@@ -486,6 +486,10 @@ rfbClientConnectionGone(rfbClientPtr cl)
 
     rfbFreeUltraData(cl);
 
+    /* free buffers holding pixel data before and after encoding */
+    free(cl->beforeEncBuf);
+    free(cl->afterEncBuf);
+
 #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
     if(cl->screen->backgroundLoop != FALSE) {
       int i;
@@ -599,14 +603,9 @@ rfbProcessClientProtocolVersion(rfbClientPtr cl)
 
     pv[sz_rfbProtocolVersionMsg] = 0;
     if (sscanf(pv,rfbProtocolVersionFormat,&major_,&minor_) != 2) {
-        char name[1024]; 
-	if(sscanf(pv,"RFB %03d.%03d %1023s\n",&major_,&minor_,name) != 3) {
-	    rfbErr("rfbProcessClientProtocolVersion: not a valid RFB client: %s\n", pv);
-	    rfbCloseClient(cl);
-	    return;
-	}
-	free(cl->host);
-	cl->host=strdup(name);
+	rfbErr("rfbProcessClientProtocolVersion: not a valid RFB client: %s\n", pv);
+	rfbCloseClient(cl);
+	return;
     }
     rfbLog("Client Protocol Version %d.%d\n", major_, minor_);
 
@@ -637,7 +636,7 @@ rfbProcessClientProtocolVersion(rfbClientPtr cl)
 
 
 void
-rfbClientSendString(rfbClientPtr cl, char *reason)
+rfbClientSendString(rfbClientPtr cl, const char *reason)
 {
     char *buf;
     int len = strlen(reason);
@@ -662,7 +661,7 @@ rfbClientSendString(rfbClientPtr cl, char *reason)
 
 void
 rfbClientConnFailed(rfbClientPtr cl,
-                    char *reason)
+                    const char *reason)
 {
     char *buf;
     int len = strlen(reason);
@@ -872,16 +871,16 @@ rfbSendSupportedMessages(rfbClientPtr cl)
     /*rfbSetBit(msgs.client2server, rfbSetServerInput);  */
     /*rfbSetBit(msgs.client2server, rfbSetSW);           */
     /*rfbSetBit(msgs.client2server, rfbTextChat);        */
-    /*rfbSetBit(msgs.client2server, rfbKeyFrameRequest); */
     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, rfbKeyFrameUpdate);  */
     rfbSetBit(msgs.server2client, rfbPalmVNCReSizeFrameBuffer);
+    rfbSetBit(msgs.server2client, rfbXvp);
 
     memcpy(&cl->updateBuf[cl->ublen], (char *)&msgs, sz_rfbSupportedMessages);
     cl->ublen += sz_rfbSupportedMessages;
@@ -1027,6 +1026,33 @@ rfbSendServerIdentity(rfbClientPtr cl)
     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;
@@ -1078,7 +1104,7 @@ rfbBool rfbSendTextChatMessage(rfbClientPtr cl, uint32_t length, char *buffer)
 
 int DB = 1;
 
-rfbBool rfbSendFileTransferMessage(rfbClientPtr cl, uint8_t contentType, uint8_t contentParam, uint32_t size, uint32_t length, char *buffer)
+rfbBool rfbSendFileTransferMessage(rfbClientPtr cl, uint8_t contentType, uint8_t contentParam, uint32_t size, uint32_t length, const char *buffer)
 {
     rfbFileTransferMsg ft;
     ft.type = rfbFileTransfer;
@@ -1244,7 +1270,11 @@ rfbBool rfbSendDirContent(rfbClientPtr cl, int length, char *buffer)
                 /*
                 rfbLog("rfbProcessFileTransfer() rfbDirContentRequest: rfbRDirContent: Sending \"%s\"\n", (char *)win32filename.cFileName);
                 */
-                if (rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADirectory, 0, nOptLen, (char *)&win32filename)==FALSE) return FALSE;
+                if (rfbSendFileTransferMessage(cl, rfbDirPacket, rfbADirectory, 0, nOptLen, (char *)&win32filename)==FALSE)
+                {
+                    closedir(dirp);
+                    return FALSE;
+                }
             }
         }
     }
@@ -1320,6 +1350,9 @@ rfbBool rfbSendFileTransferChunk(rfbClientPtr cl)
 	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 */
@@ -1339,6 +1372,9 @@ rfbBool rfbSendFileTransferChunk(rfbClientPtr cl)
                 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);
@@ -1621,7 +1657,7 @@ rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t con
 #ifdef LIBVNCSERVER_HAVE_LIBZ
                 /* compressed packet */
                 nRet = uncompress(compBuff,&nRawBytes,(const unsigned char*)buffer, length);
-                retval=write(cl->fileTransfer.fd, compBuff, nRawBytes);
+                retval=write(cl->fileTransfer.fd, (char*)compBuff, nRawBytes);
 #else
                 /* Write the file out as received... */
                 retval=write(cl->fileTransfer.fd, buffer, length);
@@ -1980,7 +2016,15 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
                           "%s\n", cl->host);
                   cl->enableServerIdentity = TRUE;
                 }
-                break;           
+                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:
 #ifdef LIBVNCSERVER_HAVE_LIBZ
 		if ( enc >= (uint32_t)rfbEncodingCompressLevel0 &&
@@ -2364,6 +2408,28 @@ rfbProcessClientNormalMessage(rfbClientPtr cl)
       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;
@@ -2752,7 +2818,7 @@ rfbSendFramebufferUpdate(rfbClientPtr cl,
        if (!rfbSendServerIdentity(cl))
            goto updateFailed;
    }
-   
+
     if (!sraRgnEmpty(updateCopyRegion)) {
 	if (!rfbSendCopyRegion(cl,updateCopyRegion,dx,dy))
 	        goto updateFailed;
@@ -3199,7 +3265,7 @@ void
 rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen,
                     int sock)
 {
-    if (write(sock, &ptrAcceleration, 1) < 0) {
+  if (write(sock, (char*) &ptrAcceleration, 1) < 0) {
 	rfbLogPerror("rfbNewUDPConnection: write");
     }
 }
diff --git a/ica/x11/libvncserver/rre.c b/ica/x11/libvncserver/rre.c
index b43561a..2103153 100644
--- a/ica/x11/libvncserver/rre.c
+++ b/ica/x11/libvncserver/rre.c
@@ -29,38 +29,18 @@
 #include <rfb/rfb.h>
 
 /*
- * rreBeforeBuf contains pixel data in the client's format.
- * rreAfterBuf contains the RRE encoded version.  If the RRE encoded version is
- * larger than the raw data or if it exceeds rreAfterBufSize then
+ * 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 rreBeforeBufSize = 0;
-static char *rreBeforeBuf = NULL;
-
-static int rreAfterBufSize = 0;
-static char *rreAfterBuf = NULL;
-static int rreAfterBufLen=0;
-
-static int subrectEncode8(uint8_t *data, int w, int h);
-static int subrectEncode16(uint16_t *data, int w, int h);
-static int subrectEncode32(uint32_t *data, int w, int h);
+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);
 
 
-void rfbRRECleanup(rfbScreenInfoPtr screen)
-{
-  if (rreBeforeBufSize) {
-    free(rreBeforeBuf);
-    rreBeforeBufSize=0;
-  }
-  if (rreAfterBufSize) {
-    free(rreAfterBuf);
-    rreAfterBufSize=0;
-  }
-}
-
-
 /*
  * rfbSendRectEncodingRRE - send a given rectangle using RRE encoding.
  */
@@ -82,36 +62,36 @@ rfbSendRectEncodingRRE(rfbClientPtr cl,
     int maxRawSize = (cl->scaledScreen->width * cl->scaledScreen->height
                       * (cl->format.bitsPerPixel / 8));
 
-    if (rreBeforeBufSize < maxRawSize) {
-        rreBeforeBufSize = maxRawSize;
-        if (rreBeforeBuf == NULL)
-            rreBeforeBuf = (char *)malloc(rreBeforeBufSize);
+    if (cl->beforeEncBufSize < maxRawSize) {
+        cl->beforeEncBufSize = maxRawSize;
+        if (cl->beforeEncBuf == NULL)
+            cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize);
         else
-            rreBeforeBuf = (char *)realloc(rreBeforeBuf, rreBeforeBufSize);
+            cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize);
     }
 
-    if (rreAfterBufSize < maxRawSize) {
-        rreAfterBufSize = maxRawSize;
-        if (rreAfterBuf == NULL)
-            rreAfterBuf = (char *)malloc(rreAfterBufSize);
+    if (cl->afterEncBufSize < maxRawSize) {
+        cl->afterEncBufSize = maxRawSize;
+        if (cl->afterEncBuf == NULL)
+            cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize);
         else
-            rreAfterBuf = (char *)realloc(rreAfterBuf, rreAfterBufSize);
+            cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize);
     }
 
     (*cl->translateFn)(cl->translateLookupTable,
 		       &(cl->screen->serverFormat),
-                       &cl->format, fbptr, rreBeforeBuf,
+                       &cl->format, fbptr, cl->beforeEncBuf,
                        cl->scaledScreen->paddedWidthInBytes, w, h);
 
     switch (cl->format.bitsPerPixel) {
     case 8:
-        nSubrects = subrectEncode8((uint8_t *)rreBeforeBuf, w, h);
+        nSubrects = subrectEncode8(cl, (uint8_t *)cl->beforeEncBuf, w, h);
         break;
     case 16:
-        nSubrects = subrectEncode16((uint16_t *)rreBeforeBuf, w, h);
+        nSubrects = subrectEncode16(cl, (uint16_t *)cl->beforeEncBuf, w, h);
         break;
     case 32:
-        nSubrects = subrectEncode32((uint32_t *)rreBeforeBuf, w, h);
+        nSubrects = subrectEncode32(cl, (uint32_t *)cl->beforeEncBuf, w, h);
         break;
     default:
         rfbLog("getBgColour: bpp %d?\n",cl->format.bitsPerPixel);
@@ -126,7 +106,7 @@ rfbSendRectEncodingRRE(rfbClientPtr cl,
     }
 
     rfbStatRecordEncodingSent(cl, rfbEncodingRRE,
-                              sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + rreAfterBufLen,
+                              sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader + cl->afterEncBufLen,
                               sz_rfbFramebufferUpdateRectHeader + w * h * (cl->format.bitsPerPixel / 8));
 
     if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader
@@ -151,15 +131,15 @@ rfbSendRectEncodingRRE(rfbClientPtr cl,
     memcpy(&cl->updateBuf[cl->ublen], (char *)&hdr, sz_rfbRREHeader);
     cl->ublen += sz_rfbRREHeader;
 
-    for (i = 0; i < rreAfterBufLen;) {
+    for (i = 0; i < cl->afterEncBufLen;) {
 
         int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
 
-        if (i + bytesToCopy > rreAfterBufLen) {
-            bytesToCopy = rreAfterBufLen - i;
+        if (i + bytesToCopy > cl->afterEncBufLen) {
+            bytesToCopy = cl->afterEncBufLen - i;
         }
 
-        memcpy(&cl->updateBuf[cl->ublen], &rreAfterBuf[i], bytesToCopy);
+        memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy);
 
         cl->ublen += bytesToCopy;
         i += bytesToCopy;
@@ -179,7 +159,7 @@ rfbSendRectEncodingRRE(rfbClientPtr cl,
  * 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 rreAfterBuf.  The
+ * 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.
@@ -190,7 +170,7 @@ rfbSendRectEncodingRRE(rfbClientPtr cl,
 
 #define DEFINE_SUBRECT_ENCODE(bpp)                                            \
 static int                                                                    \
-subrectEncode##bpp(uint##bpp##_t *data, int w, int h) {                       \
+ subrectEncode##bpp(rfbClientPtr client, uint##bpp##_t *data, int w, int h) { \
     uint##bpp##_t cl;                                                         \
     rfbRectangle subrect;                                                     \
     int x,y;                                                                  \
@@ -205,9 +185,9 @@ subrectEncode##bpp(uint##bpp##_t *data, int w, int h) {                       \
     int newLen;                                                               \
     uint##bpp##_t bg = (uint##bpp##_t)getBgColour((char*)data,w*h,bpp);       \
                                                                               \
-    *((uint##bpp##_t*)rreAfterBuf) = bg;                                      \
+    *((uint##bpp##_t*)client->afterEncBuf) = bg;                                      \
                                                                               \
-    rreAfterBufLen = (bpp/8);                                                 \
+    client->afterEncBufLen = (bpp/8);                                                 \
                                                                               \
     for (y=0; y<h; y++) {                                                     \
       line = data+(y*w);                                                      \
@@ -252,15 +232,15 @@ subrectEncode##bpp(uint##bpp##_t *data, int w, int h) {                       \
           subrect.w = Swap16IfLE(thew);                                       \
           subrect.h = Swap16IfLE(theh);                                       \
                                                                               \
-          newLen = rreAfterBufLen + (bpp/8) + sz_rfbRectangle;                \
-          if ((newLen > (w * h * (bpp/8))) || (newLen > rreAfterBufSize))     \
+          newLen = client->afterEncBufLen + (bpp/8) + sz_rfbRectangle;                \
+          if ((newLen > (w * h * (bpp/8))) || (newLen > client->afterEncBufSize))     \
             return -1;                                                        \
                                                                               \
           numsubs += 1;                                                       \
-          *((uint##bpp##_t*)(rreAfterBuf + rreAfterBufLen)) = cl;             \
-          rreAfterBufLen += (bpp/8);                                          \
-          memcpy(&rreAfterBuf[rreAfterBufLen],&subrect,sz_rfbRectangle);      \
-          rreAfterBufLen += sz_rfbRectangle;                                  \
+          *((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.                                    \
diff --git a/ica/x11/libvncserver/scale.c b/ica/x11/libvncserver/scale.c
index 22f5597..6f91391 100644
--- a/ica/x11/libvncserver/scale.c
+++ b/ica/x11/libvncserver/scale.c
@@ -82,7 +82,7 @@ int ScaleY(rfbScreenInfoPtr from, rfbScreenInfoPtr to, int y)
 /* 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, char *function)
+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);
diff --git a/ica/x11/libvncserver/scale.h b/ica/x11/libvncserver/scale.h
index 13dd942..a030d4b 100644
--- a/ica/x11/libvncserver/scale.h
+++ b/ica/x11/libvncserver/scale.h
@@ -1,7 +1,7 @@
 
 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, char *function);
+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);
diff --git a/ica/x11/libvncserver/sockets.c b/ica/x11/libvncserver/sockets.c
index 01f5642..188a8fd 100644
--- a/ica/x11/libvncserver/sockets.c
+++ b/ica/x11/libvncserver/sockets.c
@@ -218,8 +218,6 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
     struct sockaddr_in addr;
     socklen_t addrlen = sizeof(addr);
     char buf[6];
-    const int one = 1;
-    int sock;
     rfbClientIteratorPtr i;
     rfbClientPtr cl;
     int result = 0;
@@ -260,37 +258,8 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
 
 	if (rfbScreen->listenSock != -1 && FD_ISSET(rfbScreen->listenSock, &fds)) {
 
-	    if ((sock = accept(rfbScreen->listenSock,
-			    (struct sockaddr *)&addr, &addrlen)) < 0) {
-		rfbLogPerror("rfbCheckFds: accept");
-		return -1;
-	    }
-
-            if(!rfbSetNonBlocking(sock)) {
-	        closesocket(sock);
-		return -1;
-	    }
-
-	    if (setsockopt(sock, IPPROTO_TCP, TCP_NODELAY,
-			(char *)&one, sizeof(one)) < 0) {
-		rfbLogPerror("rfbCheckFds: setsockopt");
-		closesocket(sock);
-		return -1;
-	    }
-
-#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 -1;
-	    }
-#endif
-
-	    rfbLog("Got connection from client %s\n", inet_ntoa(addr.sin_addr));
-
-	    rfbNewClient(rfbScreen,sock);
+	    if (!rfbProcessNewConnection(rfbScreen))
+                return -1;
 
 	    FD_CLR(rfbScreen->listenSock, &fds);
 	    if (--nfds == 0)
@@ -352,6 +321,49 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
     return result;
 }
 
+rfbBool
+rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen)
+{
+    const int one = 1;
+    int sock = -1;
+    struct sockaddr_in addr;
+    socklen_t addrlen = sizeof(addr);
+
+    if ((sock = accept(rfbScreen->listenSock,
+		       (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
+
+    rfbLog("Got connection from client %s\n", inet_ntoa(addr.sin_addr));
+
+    rfbNewClient(rfbScreen,sock);
+
+    return TRUE;
+}
+
 
 void
 rfbDisconnectUDPSock(rfbScreenInfoPtr rfbScreen)
@@ -498,7 +510,11 @@ rfbReadExactTimeout(rfbClientPtr cl, char* buf, int len, int timeout)
 
 int rfbReadExact(rfbClientPtr cl,char* buf,int len)
 {
-  return(rfbReadExactTimeout(cl,buf,len,rfbMaxClientWait));
+  /* 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));
 }
 
 /*
@@ -517,6 +533,7 @@ rfbWriteExact(rfbClientPtr cl,
     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
@@ -552,7 +569,7 @@ rfbWriteExact(rfbClientPtr cl,
                 return n;
             }
 
-            /* Retry every 5 seconds until we exceed rfbMaxClientWait.  We
+            /* 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 */
 
@@ -562,6 +579,9 @@ rfbWriteExact(rfbClientPtr cl,
             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");
@@ -570,7 +590,7 @@ rfbWriteExact(rfbClientPtr cl,
             }
             if (n == 0) {
                 totalTimeWaited += 5000;
-                if (totalTimeWaited >= rfbMaxClientWait) {
+                if (totalTimeWaited >= timeout) {
                     errno = ETIMEDOUT;
                     UNLOCK(cl->outputMutex);
                     return -1;
diff --git a/ica/x11/libvncserver/stats.c b/ica/x11/libvncserver/stats.c
index d5d6925..6dab13b 100644
--- a/ica/x11/libvncserver/stats.c
+++ b/ica/x11/libvncserver/stats.c
@@ -51,10 +51,10 @@ char *messageNameServer2Client(uint32_t type, char *buf, int len) {
     case rfbBell:                     snprintf(buf, len, "Bell"); break;
     case rfbServerCutText:            snprintf(buf, len, "ServerCutText"); break;
     case rfbResizeFrameBuffer:        snprintf(buf, len, "ResizeFrameBuffer"); break;
-    case rfbKeyFrameUpdate:           snprintf(buf, len, "KeyFrameUpdate"); 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);
     }
@@ -76,8 +76,8 @@ char *messageNameClient2Server(uint32_t type, char *buf, int len) {
     case rfbSetServerInput:           snprintf(buf, len, "SetServerInput"); break;
     case rfbSetSW:                    snprintf(buf, len, "SetSingleWindow"); break;
     case rfbTextChat:                 snprintf(buf, len, "TextChat"); break;
-    case rfbKeyFrameRequest:          snprintf(buf, len, "KeyFrameRequest"); break;
     case rfbPalmVNCSetScaleFactor:    snprintf(buf, len, "PalmVNCSetScale"); break;
+    case rfbXvp:                      snprintf(buf, len, "XvpClientMessage"); break;
     default:
         snprintf(buf, len, "cli2svr-0x%08X", type);
 
diff --git a/ica/x11/libvncserver/ultra.c b/ica/x11/libvncserver/ultra.c
index a802026..9485591 100644
--- a/ica/x11/libvncserver/ultra.c
+++ b/ica/x11/libvncserver/ultra.c
@@ -11,19 +11,13 @@
 #include "minilzo.h"
 
 /*
- * lzoBeforeBuf contains pixel data in the client's format.
- * lzoAfterBuf contains the lzo (deflated) encoding version.
+ * 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 lzoAfterBufSize then
+ * larger than the raw data or if it exceeds cl->afterEncBufSize then
  * raw encoding is used instead.
  */
 
-static int lzoBeforeBufSize = 0;
-static char *lzoBeforeBuf = NULL;
-
-static int lzoAfterBufSize = 0;
-static char *lzoAfterBuf = NULL;
-static int lzoAfterBufLen = 0;
 
 /*
  * rfbSendOneRectEncodingZlib - send a given rectangle using one Zlib
@@ -32,17 +26,6 @@ static int lzoAfterBufLen = 0;
 
 #define MAX_WRKMEM ((LZO1X_1_MEM_COMPRESS) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t)
 
-void rfbUltraCleanup(rfbScreenInfoPtr screen)
-{
-  if (lzoBeforeBufSize) {
-    free(lzoBeforeBuf);
-    lzoBeforeBufSize=0;
-  }
-  if (lzoAfterBufSize) {
-    free(lzoAfterBuf);
-    lzoAfterBufSize=0;
-  }
-}
 
 void rfbFreeUltraData(rfbClientPtr cl) {
   if (cl->compStreamInitedLZO) {
@@ -67,16 +50,16 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
     	   + (x * (cl->scaledScreen->bitsPerPixel / 8)));
 
     int maxRawSize;
-    int maxCompSize;
+    lzo_uint maxCompSize;
 
     maxRawSize = (w * h * (cl->format.bitsPerPixel / 8));
 
-    if (lzoBeforeBufSize < maxRawSize) {
-	lzoBeforeBufSize = maxRawSize;
-	if (lzoBeforeBuf == NULL)
-	    lzoBeforeBuf = (char *)malloc(lzoBeforeBufSize);
+    if (cl->beforeEncBufSize < maxRawSize) {
+	cl->beforeEncBufSize = maxRawSize;
+	if (cl->beforeEncBuf == NULL)
+	    cl->beforeEncBuf = (char *)malloc(cl->beforeEncBufSize);
 	else
-	    lzoBeforeBuf = (char *)realloc(lzoBeforeBuf, lzoBeforeBufSize);
+	    cl->beforeEncBuf = (char *)realloc(cl->beforeEncBuf, cl->beforeEncBufSize);
     }
 
     /*
@@ -85,19 +68,19 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
      */
     maxCompSize = (maxRawSize + maxRawSize / 16 + 64 + 3);
 
-    if (lzoAfterBufSize < maxCompSize) {
-	lzoAfterBufSize = maxCompSize;
-	if (lzoAfterBuf == NULL)
-	    lzoAfterBuf = (char *)malloc(lzoAfterBufSize);
+    if (cl->afterEncBufSize < (int)maxCompSize) {
+	cl->afterEncBufSize = maxCompSize;
+	if (cl->afterEncBuf == NULL)
+	    cl->afterEncBuf = (char *)malloc(cl->afterEncBufSize);
 	else
-	    lzoAfterBuf = (char *)realloc(lzoAfterBuf, lzoAfterBufSize);
+	    cl->afterEncBuf = (char *)realloc(cl->afterEncBuf, cl->afterEncBufSize);
     }
 
     /* 
      * Convert pixel data to client format.
      */
     (*cl->translateFn)(cl->translateLookupTable, &cl->screen->serverFormat,
-		       &cl->format, fbptr, lzoBeforeBuf,
+		       &cl->format, fbptr, cl->beforeEncBuf,
 		       cl->scaledScreen->paddedWidthInBytes, w, h);
 
     if ( cl->compStreamInitedLZO == FALSE ) {
@@ -109,11 +92,11 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
     }
 
     /* Perform the compression here. */
-    deflateResult = lzo1x_1_compress((unsigned char *)lzoBeforeBuf, (lzo_uint)(w * h * (cl->format.bitsPerPixel / 8)), (unsigned char *)lzoAfterBuf, (lzo_uint *)&maxCompSize, cl->lzoWrkMem);
+    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. */
-    lzoAfterBufLen = maxCompSize;
+    cl->afterEncBufLen = maxCompSize;
 
     if ( deflateResult != LZO_E_OK ) {
         rfbErr("lzo deflation error: %d\n", deflateResult);
@@ -121,7 +104,7 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
     }
 
     /* Update statics */
-    rfbStatRecordEncodingSent(cl, rfbEncodingUltra, sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader + lzoAfterBufLen, maxRawSize);
+    rfbStatRecordEncodingSent(cl, rfbEncodingUltra, sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader + cl->afterEncBufLen, maxRawSize);
 
     if (cl->ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbZlibHeader
 	> UPDATE_BUF_SIZE)
@@ -140,21 +123,21 @@ rfbSendOneRectEncodingUltra(rfbClientPtr cl,
 	   sz_rfbFramebufferUpdateRectHeader);
     cl->ublen += sz_rfbFramebufferUpdateRectHeader;
 
-    hdr.nBytes = Swap32IfLE(lzoAfterBufLen);
+    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 < lzoAfterBufLen;) {
+    for (i = 0; i < cl->afterEncBufLen;) {
 
 	int bytesToCopy = UPDATE_BUF_SIZE - cl->ublen;
 
-	if (i + bytesToCopy > lzoAfterBufLen) {
-	    bytesToCopy = lzoAfterBufLen - i;
+	if (i + bytesToCopy > cl->afterEncBufLen) {
+	    bytesToCopy = cl->afterEncBufLen - i;
 	}
 
-	memcpy(&cl->updateBuf[cl->ublen], &lzoAfterBuf[i], bytesToCopy);
+	memcpy(&cl->updateBuf[cl->ublen], &cl->afterEncBuf[i], bytesToCopy);
 
 	cl->ublen += bytesToCopy;
 	i += bytesToCopy;
diff --git a/ica/x11/libvncserver/vncauth.c b/ica/x11/libvncserver/vncauth.c
deleted file mode 100644
index 0b73531..0000000
--- a/ica/x11/libvncserver/vncauth.c
+++ /dev/null
@@ -1,208 +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
-#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) return NULL;
-
-    for (i = 0; i < 8; i++) {
-	ch = getc(fp);
-	if (ch == EOF) {
-	    fclose(fp);
-	    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/libvncserver/zrle.c b/ica/x11/libvncserver/zrle.c
index e1f1447..80f629c 100644
--- a/ica/x11/libvncserver/zrle.c
+++ b/ica/x11/libvncserver/zrle.c
@@ -96,9 +96,6 @@
  * data.
  */
 
-/* TODO: put into rfbClient struct */
-
-static char zrleBeforeBuf[rfbZRLETileWidth * rfbZRLETileHeight * 4 + 4];
 
 /*
  * rfbSendRectEncodingZRLE - send a given rectangle using ZRLE encoding.
diff --git a/ica/x11/libvncserver/zrleencodetemplate.c b/ica/x11/libvncserver/zrleencodetemplate.c
index 3a6f117..b6de755 100644
--- a/ica/x11/libvncserver/zrleencodetemplate.c
+++ b/ica/x11/libvncserver/zrleencodetemplate.c
@@ -84,8 +84,6 @@ static const int bitsPerPackedPixel[] = {
   0, 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
 };
 
-static zrlePaletteHelper paletteHelper;
-
 #endif /* ZRLE_ONCE */
 
 void ZRLE_ENCODE_TILE (PIXEL_T* data, int w, int h, zrleOutStream* os,
@@ -144,11 +142,7 @@ void ZRLE_ENCODE_TILE(PIXEL_T* data, int w, int h, zrleOutStream* os,
   PIXEL_T* end = ptr + h * w;
   *end = ~*(end-1); /* one past the end is different so the while loop ends */
 
-#if 0
-  ph = &paletteHelper;
-#else
   ph = (zrlePaletteHelper *) paletteHelper;
-#endif
   zrlePaletteHelperInit(ph);
 
   while (ptr < end) {
diff --git a/ica/x11/libvncserver/zywrletemplate.c b/ica/x11/libvncserver/zywrletemplate.c
deleted file mode 100644
index 52b2b0b..0000000
--- a/ica/x11/libvncserver/zywrletemplate.c
+++ /dev/null
@@ -1,824 +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
-#define InlineX inline
-#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/x11vnc.c b/ica/x11/x11vnc.c
index c4debb8..039e311 100644
--- a/ica/x11/x11vnc.c
+++ b/ica/x11/x11vnc.c
@@ -1,17 +1,49 @@
 #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 "libvncclient/cursor.c"
-#include "libvncclient/tls.c"
-#include "libvncclient/listen.c"
-#include "libvncclient/rfbproto.c"
-#include "libvncclient/sockets.c"
-#include "libvncclient/vncviewer.c"
-
 #include "x11vnc/avahi.c"
 #include "x11vnc/pm.c"
 #include "x11vnc/rates.c"
diff --git a/ica/x11/x11vnc/8to24.c b/ica/x11/x11vnc/8to24.c
index 75ab68a..30c3da2 100644
--- a/ica/x11/x11vnc/8to24.c
+++ b/ica/x11/x11vnc/8to24.c
@@ -720,7 +720,7 @@ static int check_depth_win(Window win, Window top, XWindowAttributes *attr) {
 
 	if (store_it) {
 		int i, j = -1, none = -1, nomap = -1;
-		int new = 0;
+		int newc = 0;
 		if (attr->map_state == IsViewable) {
 			/* count the visible ones: */
 			multivis_count++;
@@ -754,7 +754,7 @@ if (db24 > 1) fprintf(stderr, "multivis: 0x%lx %d\n", win, attr->depth);
 			} else if (none >= 0) {
 				/* put it in the first None slot */
 				j = none;
-				new = 1;
+				newc = 1;
 			} else if (nomap >=0) {
 				/* put it in the first unmapped slot */
 				j = nomap;
@@ -791,8 +791,8 @@ if (db24 > 1) fprintf(stderr, "multivis: STORE 0x%lx j: %3d ms: %d dep=%d\n", wi
 			windows_8bpp[j].x = x;
 			windows_8bpp[j].y = y;
 
-			if (new || now_vis) {
-if (db24) fprintf(stderr, "new/now_vis: 0x%lx %d/%d\n", win, new, now_vis);
+			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,
diff --git a/ica/x11/x11vnc/ChangeLog b/ica/x11/x11vnc/ChangeLog
index 8eb44c7..24e33b2 100644
--- a/ica/x11/x11vnc/ChangeLog
+++ b/ica/x11/x11vnc/ChangeLog
@@ -1,3 +1,25 @@
+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
@@ -38,7 +60,7 @@
 	  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
+	  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
@@ -112,7 +134,7 @@
 	  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
+	  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
@@ -146,11 +168,11 @@
 	  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.
+	  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
+	  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
@@ -259,9 +281,9 @@
 
 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
+	  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
+	  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
@@ -285,7 +307,7 @@
 
 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.
+	  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
@@ -367,7 +389,7 @@
 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.
+	  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.
diff --git a/ica/x11/x11vnc/README b/ica/x11/x11vnc/README
index 8666aad..e8457e6 100644
--- a/ica/x11/x11vnc/README
+++ b/ica/x11/x11vnc/README
@@ -2,7 +2,7 @@
 Copyright (C) 2002-2010 Karl J. Runge <runge at karlrunge.com>
 All rights reserved.
 
-x11vnc README file                         Date: Fri Sep 10 12:29:36 EDT 2010
+x11vnc README file                         Date: Mon Dec 27 20:58:57 EST 2010
 
 The following information is taken from these URLs:
 
@@ -241,7 +241,7 @@ to:     http://www.karlrunge.com/x11vnc/faq.html#faq-singleclick
      * 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.23.tar.gz) on the Viewer-side machine.
+       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.
@@ -909,10 +909,53 @@ make
 
 
    Here are some features that will appear in the 0.9.13 release:
-     * Coming Soon!
-
-
-   Here are some features that appeared in the 0.9.12 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
@@ -922,7 +965,7 @@ make
        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 used of Xdefs.h is worked around.
+       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):
@@ -2028,56 +2071,63 @@ http://www.karlrunge.com/x11vnc/faq.html:
    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/Qtopia application
-   running on my handheld or PC using the Linux console framebuffer (i.e.
-   not X11)? 
+   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-116: Now that non-X11 devices can be exported via VNC using x11vnc,
+   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-117: Does x11vnc support Mac OS X Aqua/Quartz displays natively
+   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-118: Can x11vnc be used as a VNC reflector/repeater to improve
+   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-119: Can x11vnc be used during a Linux, Solaris, etc. system
+   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-120: Does the Clipboard/Selection get transferred between the
+   Q-122: Does the Clipboard/Selection get transferred between the
    vncviewer and the X display? 
 
-   Q-121: Can I use x11vnc to record a Shock Wave Flash (or other format)
+   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-122: Can I transfer files back and forth with x11vnc? 
+   Q-124: Can I transfer files back and forth with x11vnc? 
 
-   Q-123: Which UltraVNC extensions are supported? 
+   Q-125: Which UltraVNC extensions are supported? 
 
-   Q-124: Can x11vnc emulate UltraVNC's Single Click helpdesk mode for
+   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-125: Can I (temporarily) mount my local (viewer-side) Windows/Samba
+   Q-127: Can I (temporarily) mount my local (viewer-side) Windows/Samba
    File share on the machine where x11vnc is running? 
 
-   Q-126: Can I redirect CUPS print jobs from the remote desktop where
+   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-127: How can I hear the sound (audio) from the remote applications
+   Q-129: How can I hear the sound (audio) from the remote applications
    on the desktop I am viewing via x11vnc? 
 
-   Q-128: Why don't I hear the "Beeps" in my X session (e.g. when typing
+   Q-130: Why don't I hear the "Beeps" in my X session (e.g. when typing
    tput bel in an xterm)? 
 
-   Q-129: Does x11vnc work with IPv6? 
+   Q-131: Does x11vnc work with IPv6? 
 
-   Q-130: Thanks for your program or for your help! Can I make a
+   Q-132: Thanks for your program or for your help! Can I make a
    donation? 
      _________________________________________________________________
 
@@ -3449,8 +3499,8 @@ 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 -1 | sed -e 's/[\r ]//g' | awk -F: '{print
- $4}'`
+        | grep 'USERID.*UNIX' | head -n 1 | sed -e 's/[\r ]//g' | awk -F: '{pri
+nt $4}'`
 
 for okuser in fred barney wilma betty
 do
@@ -3464,6 +3514,67 @@ exit 1  # reject it
    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
@@ -7884,9 +7995,9 @@ minal #2)
    x11vnc.)
 
 
-   Q-115: Can I connect via VNC to a Qt-embedded/Qtopia application
-   running on my handheld or PC using the Linux console framebuffer (i.e.
-   not X11)?
+   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
@@ -7945,10 +8056,50 @@ minal #2)
    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.
-
-
-   Q-116: Now that non-X11 devices can be exported via VNC using x11vnc,
+   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.
@@ -7962,7 +8113,40 @@ minal #2)
    know what you did.
 
 
-   Q-117: Does x11vnc support Mac OS X Aqua/Quartz displays natively
+   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)
@@ -8071,9 +8255,9 @@ rm -f $tmp
    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 when connecting via ssh to
-start x11vnc.  And, on Mac OS X 10.5.x, the problem can be permanently
-eliminated by doing this:
+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' \
@@ -8085,8 +8269,11 @@ 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-118: Can x11vnc be used as a VNC reflector/repeater to improve
+   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)?
 
@@ -8195,7 +8382,7 @@ need it anyway).
    us know what you did. A really nice thing would be some sort of
    auto-discovery of your repeater, etc...
 
-   Q-119: Can x11vnc be used during a Linux, Solaris, etc. system
+   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
@@ -8288,7 +8475,7 @@ need it anyway).
    [Misc: Clipboard, File Transfer/Sharing, Printing, Sound, Beeps,
    Thanks, etc.]
 
-   Q-120: Does the Clipboard/Selection get transferred between the
+   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)
@@ -8342,7 +8529,7 @@ need it anyway).
    cutbuffers.
 
 
-   Q-121: Can I use x11vnc to record a Shock Wave Flash (or other format)
+   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
@@ -8354,7 +8541,7 @@ need it anyway).
    parameters should be applied to x11vnc to speed up its polling for
    this sort of application, e.g. "-wait 10 -defer 10".
 
-   Q-122: Can I transfer files back and forth with x11vnc?
+   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
@@ -8402,7 +8589,7 @@ need it anyway).
    control you will probably be foiled by the "-rfbversion 3.6" issue.
 
 
-   Q-123: Which UltraVNC extensions are supported?
+   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:
@@ -8432,7 +8619,7 @@ need it anyway).
    ultravnc_repeater.pl
 
 
-   Q-124: Can x11vnc emulate UltraVNC's Single Click helpdesk mode for
+   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.
@@ -8670,7 +8857,7 @@ connect = localhost:5501
    You will find the details here.
 
 
-   Q-125: Can I (temporarily) mount my local (viewer-side) Windows/Samba
+   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.
@@ -8720,7 +8907,7 @@ d,ip=127.0.0.1,port=1139
    Sep 2006 it is there for testing.)
 
 
-   Q-126: Can I redirect CUPS print jobs from the remote desktop where
+   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.
@@ -8812,7 +8999,7 @@ d,ip=127.0.0.1,port=1139
    Sep 2006 it is there for testing.)
 
 
-   Q-127: How can I hear the sound (audio) from the remote applications
+   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.
@@ -8913,7 +9100,7 @@ or:
        provide (as of Sep/2006 it is there for testing.)
 
 
-   Q-128: Why don't I hear the "Beeps" in my X session (e.g. when typing
+   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
@@ -8926,7 +9113,7 @@ or:
    redirector such as esd.
 
 
-   Q-129: Does x11vnc work with IPv6?
+   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
@@ -9025,7 +9212,7 @@ or:
 
     Contributions:
 
-   Q-130: Thanks for your program or for your help! Can I make a
+   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
@@ -12172,7 +12359,7 @@ 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-09-10
+x11vnc: allow VNC connections to real X11 displays. 0.9.13 lastmod: 2010-12-27
 
 x11vnc options:
   -display disp            -auth file               -N                     
@@ -12191,85 +12378,86 @@ x11vnc options:
   -avahi                   -mdns                    -zeroconf              
   -connect string          -connect_or_exit str     -proxy string          
   -vncconnect              -novncconnect            -allow host1[,host2..] 
-  -localhost               -listen6 str             -nolookup              
-  -input string            -grabkbd                 -grabptr               
-  -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              
-  -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              
-
+  -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
@@ -12303,7 +12491,7 @@ libvncserver-tight-extension options:
 
 % x11vnc -help
 
-x11vnc: allow VNC connections to real X11 displays. 0.9.13 lastmod: 2010-09-10
+x11vnc: allow VNC connections to real X11 displays. 0.9.13 lastmod: 2010-12-27
 
 (type "x11vnc -opts" to just list the options.)
 
@@ -13049,6 +13237,20 @@ Options:
                        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)
@@ -13085,6 +13287,12 @@ Options:
                        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
@@ -13094,6 +13302,11 @@ Options:
                        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,
@@ -13639,6 +13852,15 @@ Options:
 
                             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
@@ -13670,6 +13892,11 @@ Options:
                        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.
 
@@ -13703,23 +13930,19 @@ Options:
                        and the user put "geom=1600x1200" in his
                        ~/.x11vnc_create file.
 
-                       To troubleshoot the FINDCREATEDISPLAY mechanism,
-                       set the following env. var. to an output log file,
-                       e.g -env CREATE_DISPLAY_OUTPUT=/tmp/mydebug.txt
-
                        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.
 
-                       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.
+                       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).
@@ -13731,13 +13954,15 @@ Options:
                        process that will not switch, but it is only encoding
                        and decoding the encrypted stream at that point.
 
-                       Automatic Finding of User X Sessions:
+                       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)).
 
-                       The option "-find" is an alias for this mode.
+                       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
@@ -13781,7 +14006,12 @@ Options:
                        X11VNC_SKIP_DISPLAY=all then all display finding fails
                        as if you set X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (below.)
 
-                       Automatic Creation of User X Sessions:
+                       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
@@ -13790,13 +14020,19 @@ Options:
                        for the user.  This is the only time x11vnc tries to
                        actually start up an X server.
 
-                       The option "-create" is an alias for this mode.
+                       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:
 
@@ -13823,6 +14059,10 @@ Options:
                        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
@@ -16302,6 +16542,7 @@ t
 -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
@@ -16749,18 +16990,19 @@ er
                        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.  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.
+                       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
@@ -16800,7 +17042,11 @@ er
                        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.
+                       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
@@ -16831,6 +17077,13 @@ er
                        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.
 
@@ -16893,7 +17146,8 @@ er
 
                        The UINPUT mode currently only does US keyboards (a
                        scan code option may be added), and not all keysyms
-                       are supported.
+                       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.
@@ -16933,16 +17187,6 @@ er
                        cause jerkiness or unexpected behavior with menus, etc.
                        Use reset=0 to disable.
 
-                       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".
-
                        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
@@ -16952,8 +17196,70 @@ er
                        Example:
                            -pipeinput UINPUT:accel=4.0 -cursor none
 
-                       You can also set the env. var X11VNC_UINPUT_DEBUG=1 or
-                       higher to get debugging output for UINPUT mode.
+                       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.
@@ -16976,6 +17282,42 @@ er
                        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.
diff --git a/ica/x11/x11vnc/RELEASE-NOTES b/ica/x11/x11vnc/RELEASE-NOTES
new file mode 100644
index 0000000..0d5c4b9
--- /dev/null
+++ b/ica/x11/x11vnc/RELEASE-NOTES
@@ -0,0 +1,1553 @@
+
+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/appshare.c b/ica/x11/x11vnc/appshare.c
index fc3c29e..71cdf17 100644
--- a/ica/x11/x11vnc/appshare.c
+++ b/ica/x11/x11vnc/appshare.c
@@ -1358,7 +1358,7 @@ static void list_apps(void) {
 
 static int process_control(char *file, int check_clients) {
 	int i, nnew = 0, seen[CMAX];
-	char line[1024], *new[CMAX];
+	char line[1024], *newctl[CMAX];
 	FILE *f;
 
 	f = fopen(file, "r");
@@ -1481,7 +1481,7 @@ static int process_control(char *file, int check_clients) {
 			if (idx >= 0) {
 				seen[idx] = 1;
 			} else {
-				new[nnew++] = strdup(q);
+				newctl[nnew++] = strdup(q);
 			}
 		}
 	}
@@ -1509,8 +1509,8 @@ static int process_control(char *file, int check_clients) {
 				}
 				continue;
 			}
-			clients[free] = new[i];
-			client(new[i], 1);
+			clients[free] = newctl[i];
+			client(newctl[i], 1);
 		}
 	}
 	return 1;
diff --git a/ica/x11/x11vnc/avahi.c b/ica/x11/x11vnc/avahi.c
index 7c646b7..939a34f 100644
--- a/ica/x11/x11vnc/avahi.c
+++ b/ica/x11/x11vnc/avahi.c
@@ -399,7 +399,6 @@ if (db) fprintf(stderr, "out avahi_reset\n");
 }
 
 static void avahi_timeout (int sig) {
-	int i;
 	rfbLog("sig: %d, avahi_cleanup timed out.\n", sig);
 	exit(1);
 }
diff --git a/ica/x11/x11vnc/cleanup.c b/ica/x11/x11vnc/cleanup.c
index 4ecef42..f179089 100644
--- a/ica/x11/x11vnc/cleanup.c
+++ b/ica/x11/x11vnc/cleanup.c
@@ -50,6 +50,7 @@ so, delete this exception statement from your version.
 #include "screen.h"
 #include "xrecord.h"
 #include "xevents.h"
+#include "uinput.h"
 
 /*
  * Exiting and error handling routines
@@ -150,7 +151,8 @@ void clean_up_exit(int ret) {
 	exit_flag = 1;
 
 	if (depth++ > 2) {
-		exit(ret);
+		return;
+		//exit(ret);
 	}
 
 	if (icon_mode) {
@@ -187,6 +189,17 @@ void clean_up_exit(int ret) {
 		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);
@@ -244,7 +257,7 @@ void clean_up_exit(int ret) {
 		fflush(stderr);
 	}
 
-	exit(ret);
+	//exit(ret);
 }
 
 /* X11 error handlers */
diff --git a/ica/x11/x11vnc/connections.c b/ica/x11/x11vnc/connections.c
index abb7a27..9e5fd24 100644
--- a/ica/x11/x11vnc/connections.c
+++ b/ica/x11/x11vnc/connections.c
@@ -93,6 +93,7 @@ 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);
@@ -1769,7 +1770,13 @@ void check_ipv6_listen(long usec) {
 			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;
@@ -1809,7 +1816,13 @@ void check_ipv6_listen(long usec) {
 			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;
@@ -1837,6 +1850,75 @@ void check_ipv6_listen(long usec) {
 	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.
diff --git a/ica/x11/x11vnc/connections.h b/ica/x11/x11vnc/connections.h
index a646bc5..3bdeffb 100644
--- a/ica/x11/x11vnc/connections.h
+++ b/ica/x11/x11vnc/connections.h
@@ -69,6 +69,7 @@ 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);
diff --git a/ica/x11/x11vnc/enc.h b/ica/x11/x11vnc/enc.h
index 55d49bb..9f5a520 100644
--- a/ica/x11/x11vnc/enc.h
+++ b/ica/x11/x11vnc/enc.h
@@ -238,12 +238,13 @@ static char *prog = "ultravnc_dsm_helper";
 #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
diff --git a/ica/x11/x11vnc/gui.c b/ica/x11/x11vnc/gui.c
index e264385..6101adb 100644
--- a/ica/x11/x11vnc/gui.c
+++ b/ica/x11/x11vnc/gui.c
@@ -81,26 +81,26 @@ static Window tweak_tk_window_id(Window win) {
 	return None;
 #else
 	char *name = NULL;
-	Window parent, new;
+	Window parent, new_win;
 
 	if (getenv("NO_TWEAK_TK_WINDOW_ID")) {
 		return win;
 	}
 
 	/* hack for tk, does not report outermost window */
-	new = win;
+	new_win = win;
 	parent = parent_window(win, &name);
 	if (parent && name != NULL) {
 		lowercase(name);
 		if (strstr(name, "wish") || strstr(name, "x11vnc")) {
-			new = parent;
+			new_win = parent;
 			rfbLog("tray_embed: using parent: %s\n", name);
 		}
 	}
 	if (name != NULL) {
 		XFree_wr(name);
 	}
-	return new;
+	return new_win;
 #endif	/* NO_X11 */
 }
 
diff --git a/ica/x11/x11vnc/help.c b/ica/x11/x11vnc/help.c
index 5eb80cc..5cd5c12 100644
--- a/ica/x11/x11vnc/help.c
+++ b/ica/x11/x11vnc/help.c
@@ -810,6 +810,20 @@ void print_help(int mode) {
 "                       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"
@@ -848,6 +862,12 @@ void print_help(int mode) {
 "                       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"
@@ -857,6 +877,11 @@ void print_help(int mode) {
 "                       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"
@@ -1412,6 +1437,15 @@ void print_help(int mode) {
 "\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"
@@ -1443,6 +1477,11 @@ void print_help(int mode) {
 "                       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"
@@ -1476,23 +1515,19 @@ void print_help(int mode) {
 "                       and the user put \"geom=1600x1200\" in his\n"
 "                       ~/.x11vnc_create file.\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"
 "                       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"
-"                       The combination of -display WAIT:cmd=... and -unixpw\n"
-"                       allows automatic pairing of an unix authenticated VNC\n"
-"                       user with his desktop.  This could be very useful on\n"
-"                       SunRays and also any system where multiple users share\n"
-"                       a given machine.  The user does not need to remember\n"
-"                       special ports or passwords set up for his desktop\n"
-"                       and VNC.\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"
@@ -1504,13 +1539,15 @@ void print_help(int mode) {
 "                       process that will not switch, but it is only encoding\n"
 "                       and decoding the encrypted stream at that point.\n"
 "\n"
-"                       Automatic Finding of User X Sessions:\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"
-"                       The option \"-find\" is an alias for this mode.\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"
@@ -1553,7 +1590,12 @@ void print_help(int mode) {
 "                       X11VNC_SKIP_DISPLAY=all then all display finding fails\n"
 "                       as if you set X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (below.)\n"
 "\n"
-"                       Automatic Creation of User X Sessions:\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"
@@ -1562,13 +1604,19 @@ void print_help(int mode) {
 "                       for the user.  This is the only time x11vnc tries to\n"
 "                       actually start up an X server.\n"
 "\n"
-"                       The option \"-create\" is an alias for this mode.\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"
@@ -1595,6 +1643,10 @@ void print_help(int mode) {
 "                       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"
@@ -4075,6 +4127,7 @@ void print_help(int mode) {
 "-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"
@@ -4520,18 +4573,19 @@ void print_help(int mode) {
 "                       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 or\n"
-"                       later and the \"uinput\" module appears to be present\n"
-"                       (modprobe uinput), then the uinput method will be used\n"
-"                       instead of /dev/ttyN.  uinput allows insertion of BOTH\n"
-"                       keystrokes and mouse input and so it preferred when\n"
-"                       accessing graphical (e.g. QT-embedded) linux console\n"
-"                       apps.  See -pipeinput UINPUT below for more information\n"
-"                       on this mode; you will have to use -pipeinput if you\n"
-"                       want to tweak any UINPUT parameters.  You may also want\n"
-"                       to also use the -nodragging and -cursor none options.\n"
-"                       Use \"console0\", etc  or -pipeinput CONSOLE to force\n"
-"                       the /dev/ttyN method.\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"
@@ -4571,7 +4625,11 @@ void print_help(int mode) {
 "                       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.\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"
@@ -4602,6 +4660,13 @@ void print_help(int mode) {
 "                       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"
@@ -4664,7 +4729,8 @@ void print_help(int mode) {
 "\n"
 "                       The UINPUT mode currently only does US keyboards (a\n"
 "                       scan code option may be added), and not all keysyms\n"
-"                       are supported.\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"
@@ -4704,16 +4770,6 @@ void print_help(int mode) {
 "                       cause jerkiness or unexpected behavior with menus, etc.\n"
 "                       Use reset=0 to disable.\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 size\n"
-"                       of the device, use \"abs=WxH\".  Furthermore, if the\n"
-"                       device is a touchscreen (assumed to have an absolute\n"
-"                       pointer) use \"touch\" or \"touch=WxH\".\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"
@@ -4723,8 +4779,70 @@ void print_help(int mode) {
 "                       Example:\n"
 "                           -pipeinput UINPUT:accel=4.0 -cursor none\n"
 "\n"
-"                       You can also set the env. var X11VNC_UINPUT_DEBUG=1 or\n"
-"                       higher to get debugging output for UINPUT mode.\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"
@@ -4747,6 +4865,42 @@ void print_help(int mode) {
 "                       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"
diff --git a/ica/x11/x11vnc/inet.c b/ica/x11/x11vnc/inet.c
index a7410ee..c286d55 100644
--- a/ica/x11/x11vnc/inet.c
+++ b/ica/x11/x11vnc/inet.c
@@ -57,6 +57,8 @@ 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);
 
@@ -652,6 +654,61 @@ int listen6(int port) {
 #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;
diff --git a/ica/x11/x11vnc/inet.h b/ica/x11/x11vnc/inet.h
index f74251e..b76dbb4 100644
--- a/ica/x11/x11vnc/inet.h
+++ b/ica/x11/x11vnc/inet.h
@@ -52,6 +52,8 @@ 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);
 
diff --git a/ica/x11/x11vnc/keyboard.c b/ica/x11/x11vnc/keyboard.c
index 9e9e044..54ff70e 100644
--- a/ica/x11/x11vnc/keyboard.c
+++ b/ica/x11/x11vnc/keyboard.c
@@ -61,7 +61,7 @@ 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);
+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);
@@ -518,7 +518,7 @@ int add_keysym(KeySym keysym) {
 	for (kc = minkey+1; kc <= maxkey; kc++) {
 		int i, j, didmsg = 0, is_empty = 1;
 		char *str;
-		KeySym new[8];
+		KeySym newks[8];
 
 		for (n=0; n < syms_per_keycode; n++) {
 			if (keymap[ (kc-minkey) * syms_per_keycode + n]
@@ -532,19 +532,19 @@ int add_keysym(KeySym keysym) {
 		}
 
 		for (i=0; i<8; i++) {
-			new[i] = NoSymbol;
+			newks[i] = NoSymbol;
 		}
 		if (add_keysyms == 2) {
-			new[0] = keysym;	/* XXX remove me */
+			newks[0] = keysym;	/* XXX remove me */
 		} else {
 			for(i=0; i < syms_per_keycode; i++) {
-				new[i] = keysym;
+				newks[i] = keysym;
 				if (i >= 7) break;
 			}
 		}
 
 		XChangeKeyboardMapping(dpy, kc, syms_per_keycode,
-		    new, 1);
+		    newks, 1);
 
 		if (alltime_num >= alltime_len) {
 			didmsg = 1;	/* something weird */
@@ -584,7 +584,7 @@ static void delete_keycode(KeyCode kc, int bequiet) {
 #else
 	int minkey, maxkey, syms_per_keycode, i;
 	KeySym *keymap;
-	KeySym ksym, new[8];
+	KeySym ksym, newks[8];
 	char *str;
 
 	RAWFB_RET_VOID
@@ -594,10 +594,10 @@ static void delete_keycode(KeyCode kc, int bequiet) {
 	    &syms_per_keycode);
 
 	for (i=0; i<8; i++) {
-		new[i] = NoSymbol;
+		newks[i] = NoSymbol;
 	}
 
-	XChangeKeyboardMapping(dpy, kc, syms_per_keycode, new, 1);
+	XChangeKeyboardMapping(dpy, kc, syms_per_keycode, newks, 1);
 
 	if (! bequiet && ! quiet) {
 		ksym = XKeycodeToKeysym(dpy, kc, 0);
@@ -907,14 +907,14 @@ 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) {
+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) {}
+	if (!key || !down || !keysym || !new_kc) {}
 	return 0;
 #else
 	
@@ -958,7 +958,7 @@ int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new) {
 				    "-> %d/0x%x  (nmods: %d)\n", (int) key,
 				    (int) key, downkey, downkey, nmods_down);
 			}
-			*new = downkey;
+			*new_kc = downkey;
 			return 1;
 		}
 	}
diff --git a/ica/x11/x11vnc/keyboard.h b/ica/x11/x11vnc/keyboard.h
index e6ca90b..39a1a89 100644
--- a/ica/x11/x11vnc/keyboard.h
+++ b/ica/x11/x11vnc/keyboard.h
@@ -48,7 +48,7 @@ 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);
+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);
diff --git a/ica/x11/x11vnc/linuxfb.c b/ica/x11/x11vnc/linuxfb.c
index f65a67d..1831c5f 100644
--- a/ica/x11/x11vnc/linuxfb.c
+++ b/ica/x11/x11vnc/linuxfb.c
@@ -265,6 +265,7 @@ char *console_guess(char *str, int *fd) {
 	} else {
 		sprintf(q, "map:%s@%s", file, atparms);
 	}
+	free(atparms);
 	return q;
 }
 
diff --git a/ica/x11/x11vnc/macosx.c b/ica/x11/x11vnc/macosx.c
index b3cff79..34126f4 100644
--- a/ica/x11/x11vnc/macosx.c
+++ b/ica/x11/x11vnc/macosx.c
@@ -149,8 +149,6 @@ int macosx_checkevent(XEvent *ev) {
 }
 
 
-int dragum(void) {return 1;}
-
 #else 
 
 void macosx_event_loop(void) {
@@ -162,6 +160,12 @@ char *macosx_get_fb_addr(void) {
 	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;
@@ -200,12 +204,22 @@ char *macosx_console_guess(char *str, int *fd) {
 		int w, h, b, bps, dep;
 		unsigned long rm = 0, gm = 0, bm = 0;
 
-		w = macosxCG_CGDisplayPixelsWide();
-		h = macosxCG_CGDisplayPixelsHigh();
-		b = macosxCG_CGDisplayBitsPerPixel();
+		if (macosx_read_opengl) {
+			w = macosx_opengl_get_width();
+			h = macosx_opengl_get_height();
+			b = macosx_opengl_get_bpp();
 
-		bps = macosxCG_CGDisplayBitsPerSample();
-		dep = macosxCG_CGDisplaySamplesPerPixel() * bps;
+			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;
@@ -223,8 +237,7 @@ char *macosx_console_guess(char *str, int *fd) {
 		
 		/* @66666x66666x32:0xffffffff:... */
 		atparms = (char *) malloc(200);
-		sprintf(atparms, "%dx%dx%d:%lx/%lx/%lx",
-		    w, h, b, rm, gm, bm);
+		sprintf(atparms, "%dx%dx%d:%lx/%lx/%lx", w, h, b, rm, gm, bm);
 	}
 	if (atparms) {
 		int gw, gh, gb;
@@ -241,6 +254,7 @@ char *macosx_console_guess(char *str, int *fd) {
 
 	q = (char *) malloc(strlen("map:macosx:") + strlen(file) + 1 + strlen(atparms) + 1);
 	sprintf(q, "map:macosx:%s@%s", file, atparms);
+	free(atparms);
 	return q;
 }
 
@@ -302,7 +316,7 @@ void macosx_pointer_command(int mask, int x, int y, rfbClientPtr client) {
 if (0) fprintf(stderr, "about to get all windows:           %.4f\n", dnowx());
 			for (i=0; i < 2; i++) {
 				macosxCGS_get_all_windows();
-				fprintf(stderr, "!");
+				if (0) fprintf(stderr, "!");
 				if (macosx_checkevent(NULL)) {
 					break;
 				}
@@ -339,7 +353,7 @@ void macosx_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
 	}
 
 	init_key_table();
-	macosxCG_key_inject((int) down, (unsigned int) keysym);
+	macosxCG_keysym_inject((int) down, (unsigned int) keysym);
 }
 
 extern void macosxGCS_poll_pb(void);
diff --git a/ica/x11/x11vnc/macosxCG.c b/ica/x11/x11vnc/macosxCG.c
index 4f1fd0a..12041e0 100644
--- a/ica/x11/x11vnc/macosxCG.c
+++ b/ica/x11/x11vnc/macosxCG.c
@@ -62,7 +62,7 @@ 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_key_inject(int down, unsigned int keysym);
+void macosxCG_keysym_inject(int down, unsigned int keysym);
 void macosxCG_keycode_inject(int down, int keycode);
 
 CGDirectDisplayID displayID = 0;
@@ -81,25 +81,31 @@ static void macosxCG_callback(CGRectCount n, const CGRect *rects, void *dum) {
 	}
 }
 
-int dragum(void) {
 #if 0
-        int x =200, y = 150, dy = 10, i;
-        CGPoint loc;
-
-	CGDirectDisplayID displayID2 = kCGDirectMainDisplay;
-	(void) GetMainDevice();
-
-        for (i=0; i< 50; i++) {
-                usleep(1000*100);
-                loc.x = x;
-                loc.y = y + i*dy;
-                CGPostMouseEvent(loc, TRUE, 1, TRUE);
-        }
-        CGPostMouseEvent(loc, TRUE, 1, FALSE);
-        usleep(4*1000*1000);
+> 
+> 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
-	return 0;
-}
 
 static int callback_set = 0;
 extern int nofb;
@@ -110,7 +116,7 @@ void macosxCG_refresh_callback_on(void) {
 	}
 
 	if (! callback_set) {
-		if (1) macosx_log("macosxCG_callback: register\n");
+		if (1) macosx_log("macosxCG_refresh_callback: register\n");
 		CGRegisterScreenRefreshCallback(macosxCG_callback, NULL);
 	}
 	callback_set = 1;
@@ -118,42 +124,93 @@ void macosxCG_refresh_callback_on(void) {
 
 void macosxCG_refresh_callback_off(void) {
 	if (callback_set) {
-		if (1) macosx_log("macosxCG_callback: unregister\n");
+		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");
-#if 0
-		dragum();
-#endif
 
 		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);
+		}
 
-		CGSetLocalEventsSuppressionInterval(0.0);
-		CGSetLocalEventsFilterDuringSupressionState(
-		    kCGEventFilterMaskPermitAllEvents,
-		    kCGEventSupressionStateSupressionInterval);
-		CGSetLocalEventsFilterDuringSupressionState(
-		    kCGEventFilterMaskPermitAllEvents,
-		    kCGEventSupressionStateRemoteMouseDrag);
+#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();
 	}
 }
@@ -164,6 +221,8 @@ void macosxCG_fini(void) {
 		macosxCGP_screensaver_timer_off();
 	}
 	macosxCG_refresh_callback_off();
+	macosx_opengl_fini();
+	displayID = 0;
 }
 
 extern int dpy_x, dpy_y, bpp, wdpy_x, wdpy_y;
@@ -183,6 +242,7 @@ 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) {
@@ -199,18 +259,22 @@ void macosxCG_event_loop(void) {
 
 	nbpp = macosxCG_CGDisplayBitsPerPixel();
 
+	if (nbpp_save < 0) {
+		nbpp_save = nbpp;
+	}
 		
-	if (nbpp > 0 && nbpp != bpp) {
+	if (nbpp > 0 && nbpp != nbpp_save) {
+		nbpp_save = nbpp;
 		if (macosx_resize) {
 			do_new_fb(1);
 		}
-	} else if (wdpy_x != (int) CGDisplayPixelsWide(displayID)) {
-	    if (wdpy_y != (int) CGDisplayPixelsHigh(displayID)) {
+	} else if (wdpy_x != macosxCG_CGDisplayPixelsWide()) {
+	    if (wdpy_y != macosxCG_CGDisplayPixelsHigh()) {
 		if (macosx_wait_for_switch) {
 			int cnt = 0;
 			while (1) {
-				if(CGDisplayPixelsWide(displayID) > 0) {
-					if(CGDisplayPixelsHigh(displayID) > 0) {
+				if(macosxCG_CGDisplayPixelsWide() > 0) {
+					if(macosxCG_CGDisplayPixelsHigh() > 0) {
 						usleep(500*1000);
 						break;
 					}
@@ -221,8 +285,8 @@ void macosxCG_event_loop(void) {
 				}
 				sleep(1);
 			}
-			if (wdpy_x == (int) CGDisplayPixelsWide(displayID)) {
-				if (wdpy_y == (int) CGDisplayPixelsHigh(displayID)) {
+			if (wdpy_x == macosxCG_CGDisplayPixelsWide()) {
+				if (wdpy_y == macosxCG_CGDisplayPixelsHigh()) {
 					macosx_log("we're back...\n");
 					return;
 				}
@@ -233,32 +297,100 @@ void macosxCG_event_loop(void) {
 		}
 	    }
 	}
+	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) {
-	macosxCG_init();
+	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*);
@@ -354,6 +486,8 @@ int macosxCG_get_cursor(void) {
 		}
 	}
 
+	/* XXX all of these interfaces are undocumented. */
+
 	cursor_seed = CGSCurrentCursorSeed();
 	if (last_idx && cursor_seed == last_cursor_seed) {
 		if (now < last_fetch + 2) {
@@ -372,6 +506,10 @@ int macosxCG_get_cursor(void) {
 
 	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;
@@ -381,6 +519,21 @@ int macosxCG_get_cursor(void) {
 		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);
 
@@ -392,12 +545,137 @@ 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;
@@ -412,17 +690,28 @@ void macosxCG_pointer_inject(int mask, int x, int y) {
 	}
 
 	if ((mask & (1 << s4))) {
-		CGPostScrollWheelEvent(1,  wheel_distance);
+		CGPostScrollWheelEvent_wr(1,  wheel_distance);
 	}
 	if ((mask & (1 << s5))) {
-		CGPostScrollWheelEvent(1, -wheel_distance);
+		CGPostScrollWheelEvent_wr(1, -wheel_distance);
 	}
-	
-	CGPostMouseEvent(loc, TRUE, 3,
-	    (mask & (1 << s1)) ? TRUE : FALSE,
-	    (mask & (1 << s2)) ? TRUE : FALSE,
-	    (mask & (1 << s3)) ? TRUE : FALSE
-	);
+
+	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
@@ -630,14 +919,48 @@ void macosxCG_init_key_table(void) {
 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;
 
-	CGPostKeyboardEvent(keyChar, keyCode, down);
+	if (debug_keyboard) fprintf(stderr, "macosxCG_keycode_inject(down=%d, keycode=%d)\n", down, keycode);
+
+	CGPostKeyboardEvent_wr(keyChar, keyCode, down);
 }
 
-void macosxCG_key_inject(int down, unsigned int keysym) {
+void macosxCG_keysym_inject(int down, unsigned int keysym) {
 	CGKeyCode keyCode = keyTable[(unsigned short)keysym];
 	CGCharCode keyChar = 0;
 #if 0
@@ -647,14 +970,18 @@ void macosxCG_key_inject(int down, unsigned int keysym) {
 
 	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(keyChar, keyCode, down);
+
+	CGPostKeyboardEvent_wr(keyChar, keyCode, down);
 }
 
 #endif	/* __APPLE__ */
diff --git a/ica/x11/x11vnc/macosxCG.h b/ica/x11/x11vnc/macosxCG.h
index 60beab1..fb9e497 100644
--- a/ica/x11/x11vnc/macosxCG.h
+++ b/ica/x11/x11vnc/macosxCG.h
@@ -51,7 +51,7 @@ 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_key_inject(int down, unsigned int keysym);
+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);
diff --git a/ica/x11/x11vnc/macosx_opengl.c b/ica/x11/x11vnc/macosx_opengl.c
new file mode 100644
index 0000000..9788279
--- /dev/null
+++ b/ica/x11/x11vnc/macosx_opengl.c
@@ -0,0 +1,176 @@
+/*
+   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
new file mode 100644
index 0000000..5531a0c
--- /dev/null
+++ b/ica/x11/x11vnc/macosx_opengl.h
@@ -0,0 +1,41 @@
+/*
+   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/options.c b/ica/x11/x11vnc/options.c
index 890a8a4..ab119b6 100644
--- a/ica/x11/x11vnc/options.c
+++ b/ica/x11/x11vnc/options.c
@@ -134,6 +134,8 @@ int no_external_cmds = 1;	/* cannot be turned back on. */
 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;
@@ -217,6 +219,10 @@ 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;
diff --git a/ica/x11/x11vnc/options.h b/ica/x11/x11vnc/options.h
index cfe0cdd..609f4ce 100644
--- a/ica/x11/x11vnc/options.h
+++ b/ica/x11/x11vnc/options.h
@@ -115,6 +115,8 @@ 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;
@@ -184,6 +186,10 @@ 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;
diff --git a/ica/x11/x11vnc/pointer.c b/ica/x11/x11vnc/pointer.c
index c57d2d7..f2995c3 100644
--- a/ica/x11/x11vnc/pointer.c
+++ b/ica/x11/x11vnc/pointer.c
@@ -620,24 +620,24 @@ static void pipe_pointer(int mask, int x, int y, rfbClientPtr client) {
 	if (mask == button_mask) {
 		strcat(hint, "None");
 	} else {
-		int i, old, new, m = 1, cnt = 0;
+		int i, old, newb, m = 1, cnt = 0;
 		for (i=0; i<MAX_BUTTONS; i++) {
 			char s[20];
 
 			old = button_mask & m;
-			new = mask & m;
+			newb = mask & m;
 			m = m << 1;
 
-			if (old == new) {
+			if (old == newb) {
 				continue;
 			}
 			if (hint[0] != '\0') {
 				strcat(hint, ",");
 			}
-			if (new && ! old) {
+			if (newb && ! old) {
 				sprintf(s, "ButtonPress-%d", i+1);
 				cnt++;
-			} else if (! new && old)  {
+			} else if (! newb && old)  {
 				sprintf(s, "ButtonRelease-%d", i+1);
 				cnt++;
 			}
diff --git a/ica/x11/x11vnc/rates.c b/ica/x11/x11vnc/rates.c
index 0af5e42..ee9ca05 100644
--- a/ica/x11/x11vnc/rates.c
+++ b/ica/x11/x11vnc/rates.c
@@ -240,6 +240,13 @@ void initialize_speeds(void) {
 	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);
diff --git a/ica/x11/x11vnc/remote.c b/ica/x11/x11vnc/remote.c
index fef39af..3e9e5f8 100644
--- a/ica/x11/x11vnc/remote.c
+++ b/ica/x11/x11vnc/remote.c
@@ -74,8 +74,8 @@ 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 new);
-static void reset_rfbport(int old, int new) ;
+static void reset_httpport(int old, int newp);
+static void reset_rfbport(int old, int newp) ;
 
 char *query_result = NULL;
 
@@ -563,8 +563,8 @@ void http_connections(int on) {
 	}
 }
 
-static void reset_httpport(int old, int new) {
-	int hp = new;
+static void reset_httpport(int old, int newp) {
+	int hp = newp;
 
 	if (! screen->httpDir) {
 		return;
@@ -619,8 +619,8 @@ static void reset_httpport(int old, int new) {
 	}
 }
 
-static void reset_rfbport(int old, int new)  {
-	int rp = new;
+static void reset_rfbport(int old, int newp)  {
+	int rp = newp;
 
 	if (inetd) {
 		rfbLog("reset_rfbport: cannot set rfbport: %d in inetd.\n", rp);
@@ -2303,7 +2303,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
 		 * safe_remote_only but at least the command names
 		 * are fixed.
 		 */
-		char *new;
+		char *newc;
 		int doit = 1;
 		COLON_CHECK("solid_color:")
 		if (query) {
@@ -2313,19 +2313,19 @@ char *process_remote_cmd(char *cmd, int stringonly) {
 		}
 		p += strlen("solid_color:");
 		if (*p != '\0') {
-			new = strdup(p);
+			newc = strdup(p);
 		} else {
-			new = strdup(solid_default);
+			newc = strdup(solid_default);
 		}
-		rfbLog("remote_cmd: solid %s -> %s\n", NONUL(solid_str), new);
+		rfbLog("remote_cmd: solid %s -> %s\n", NONUL(solid_str), newc);
 
 		if (solid_str) {
-			if (!strcmp(solid_str, new)) {
+			if (!strcmp(solid_str, newc)) {
 				doit = 0;
 			}
 			free(solid_str);
 		}
-		solid_str = new;
+		solid_str = newc;
 		use_solid_bg = 1;
 		if (raw_fb && !macosx_console) set_raw_fb_params(0);
 
@@ -4213,6 +4213,24 @@ char *process_remote_cmd(char *cmd, int stringonly) {
 		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) {
diff --git a/ica/x11/x11vnc/scan.c b/ica/x11/x11vnc/scan.c
index b8fa645..c6666e0 100644
--- a/ica/x11/x11vnc/scan.c
+++ b/ica/x11/x11vnc/scan.c
@@ -450,11 +450,15 @@ void initialize_polling_images(void) {
 	 * (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(1 * 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;
@@ -2961,7 +2965,17 @@ static void nap_check(int tile_cnt) {
 	now = time(NULL);
 
 	if (screen_blank > 0) {
-		int dt_ev, dt_fbu, ms = 2000;
+		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);
diff --git a/ica/x11/x11vnc/screen.c b/ica/x11/x11vnc/screen.c
index 6bada90..5058ee3 100644
--- a/ica/x11/x11vnc/screen.c
+++ b/ica/x11/x11vnc/screen.c
@@ -1028,6 +1028,11 @@ void do_new_fb(int reset_mem) {
 		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);
@@ -1461,7 +1466,19 @@ char *vnc_reflect_guess(char *str, char **raw_fb_addr) {
 	char *str0 = strdup(str);
 
 	if (client == NULL) {
-		client = rfbGetClient(8, 3, 4);
+		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);
@@ -1472,6 +1489,11 @@ char *vnc_reflect_guess(char *str, char **raw_fb_addr) {
 		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;
 
@@ -1599,6 +1621,7 @@ void vnc_reflect_process_client(void) {
 }
 
 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");
@@ -1614,6 +1637,7 @@ void linux_dev_fb_msg(char* q) {
 		rfbLog("and/or /dev/tty*.\n");
 		rfbLog("\n");
 	}
+#endif
 }
 
 #define RAWFB_MMAP 1
@@ -1639,9 +1663,11 @@ XImage *initialize_raw_fb(int reset) {
 		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);
 		}
@@ -1662,6 +1688,7 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
 			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);
@@ -1674,6 +1701,7 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
 				clean_up_exit(1);
 			}
 		}
+#endif
 		return NULL;
 	}
 
@@ -1682,10 +1710,12 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
 		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);
@@ -2086,16 +2116,16 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
 		/* hmmm, not following directions, see if map: applies */
 		struct stat sbuf;
 		if (stat(str, &sbuf) == 0) {
-			char *new;
+			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);
-			new = (char *) malloc(len);
-			strcpy(new, "map:");
-			strcat(new, str);
+			newstr = (char *) malloc(len);
+			strcpy(newstr, "map:");
+			strcat(newstr, str);
 			free(str);
-			str = new;
+			str = newstr;
 		}
 	}
 
@@ -2142,6 +2172,7 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
 
 		last_file = strdup(q);
 
+#ifndef WIN32
 		fd = raw_fb_fd;
 		if (fd < 0 && rawfb_dev_video) {
 			fd = open(q, O_RDWR);
@@ -2157,6 +2188,7 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
 			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;
@@ -3184,6 +3216,9 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
 		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",
diff --git a/ica/x11/x11vnc/sslcmds.c b/ica/x11/x11vnc/sslcmds.c
index 7c4bdc1..52cd231 100644
--- a/ica/x11/x11vnc/sslcmds.c
+++ b/ica/x11/x11vnc/sslcmds.c
@@ -502,7 +502,11 @@ char *get_Cert_dir(char *cdir_in, char **tmp_in) {
 			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;
@@ -521,11 +525,15 @@ char *get_Cert_dir(char *cdir_in, char **tmp_in) {
 		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);
diff --git a/ica/x11/x11vnc/sslhelper.c b/ica/x11/x11vnc/sslhelper.c
index ca5168f..45403fa 100644
--- a/ica/x11/x11vnc/sslhelper.c
+++ b/ica/x11/x11vnc/sslhelper.c
@@ -125,17 +125,17 @@ char *get_saved_pem(char *save, int create) {
 	sprintf(path, "%s/server%s.pem", cdir, s);
 
 	if (stat(path, &sbuf) != 0) {
-		char *new = NULL;
+		char *new_name = NULL;
 		if (create) {
 			if (inetd || opts_bg) {
 				set_env("GENCERT_NOPROMPT", "1");
 			}
-			new = create_tmp_pem(path, prompt);
+			new_name = create_tmp_pem(path, prompt);
 			if (!getenv("X11VNC_SSL_NO_PASSPHRASE") && !inetd && !opts_bg) {
-				sslEncKey(new, 0);
+				sslEncKey(new_name, 0);
 			}
 		}
-		return new;
+		return new_name;
 	}
 
 	if (! quiet) {
@@ -265,9 +265,14 @@ char *create_tmp_pem(char *pathin, int prompt) {
 ;
 
 	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);
@@ -332,9 +337,12 @@ char *create_tmp_pem(char *pathin, int prompt) {
 	sprintf(str, tmpl, C, L, OU, O, CN, EM);
 
 	cnf_fd = mkstemp(cnf);
+	if (cnf_fd < 0) {
+		return NULL;
+	}
 	pem_fd = mkstemp(pem);
-
-	if (cnf_fd < 0 || pem_fd < 0) {
+	if (pem_fd < 0) {
+		close(cnf_fd);
 		return NULL;
 	}
 
diff --git a/ica/x11/x11vnc/ssltools.h b/ica/x11/x11vnc/ssltools.h
index 9c74d5f..b4ad7d0 100644
--- a/ica/x11/x11vnc/ssltools.h
+++ b/ica/x11/x11vnc/ssltools.h
@@ -847,15 +847,18 @@ char find_display[] =
 "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"
-"	if [ \"X$uname\" = \"XLinux\" ]; then\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"
-"		vt=`ps wwwwwaux | grep X | egrep -v 'startx|xinit' | egrep \" $d4 \" | egrep ' vt([789]|[1-9][0-9][0-9]*) ' | grep -v grep | head -n 1`\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"
@@ -865,7 +868,7 @@ char find_display[] =
 "			fi\n"
 "		else\n"
 "			# otherwise look for tty:\n"
-"			vt=`ps wwwwwaux | grep X | egrep \" $d4 \" | egrep ' tty([789]|[1-9][0-9][0-9]*) ' | grep -v grep | head -n 1`\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"
@@ -873,8 +876,12 @@ char find_display[] =
 "				fi\n"
 "			else\n"
 "				# otherwise try lsof:\n"
-"				pvt=`ps wwwwwaux | grep X | egrep -v 'startx|xinit' | egrep \" $d4 \" | head -n 1 | awk '{print $2}'`\n"
-"				if [ \"X$pvt\" != \"X\" ]; then\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"
@@ -902,9 +909,9 @@ char find_display[] =
 "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 wwwaux 2>/dev/null           | grep -wv PID | grep -v grep`\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 wwwaux 2>/dev/null  | grep -wv PID | grep -v grep`\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"
@@ -1003,12 +1010,20 @@ char find_display[] =
 "			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"
@@ -1192,6 +1207,8 @@ char find_display[] =
 "\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"
@@ -1205,7 +1222,7 @@ char find_display[] =
 "	# 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\" | grep \"/tmp/.X11-unix/X$d[  ]*\\$\" > /dev/null; then\n"
+"		if echo \"$nsout_trim\" | grep \"/tmp/.X11-unix/X$d[  ]*\\$\" > /dev/null; then\n"
 "			ok=1\n"
 "		fi\n"
 "	fi\n"
@@ -1473,6 +1490,7 @@ char create_display[] =
 "COLUMNS=256\n"
 "export COLUMNS\n"
 "\n"
+"LC_ALL_save=$LC_ALL\n"
 "LC_ALL=C\n"
 "export LC_ALL\n"
 "\n"
@@ -1491,11 +1509,12 @@ char create_display[] =
 "	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\" | grep \"/tmp/.X11-unix/X${try}[ 	]*\\$\" > /dev/null; 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"
@@ -1513,7 +1532,7 @@ char create_display[] =
 "			fi\n"
 "		fi\n"
 "		if [ ! -f $tlock ]; then\n"
-"			if echo \"$nsout\" | grep \"/tmp/.X11-unix/X${try}[ 	]*\\$\" > /dev/null; then\n"
+"			if echo \"$nsout_trim\" | grep \"/tmp/.X11-unix/X${try}[ 	]*\\$\" > /dev/null; then\n"
 "				:\n"
 "			else\n"
 "				n=$try\n"
@@ -1829,6 +1848,16 @@ char create_display[] =
 "	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"
@@ -1894,6 +1923,7 @@ char create_display[] =
 "	#	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"
@@ -1908,6 +1938,7 @@ char create_display[] =
 "			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"
@@ -1932,6 +1963,7 @@ char create_display[] =
 "			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"
@@ -1947,6 +1979,7 @@ char create_display[] =
 "	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"
@@ -1964,10 +1997,14 @@ char create_display[] =
 "			$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 60; rm -f $rmf)\" 1>&2 &\n"
+"		$have_nohup sh -c \"(sleep 150; rm -f $rmf)\" 1>&2 &\n"
 "	else\n"
-"		$have_nohup sh -c \"(sleep 60; rm -f $rmf $authfile)\" 1>&2 &\n"
+"		$have_nohup sh -c \"(sleep 150; rm -f $rmf $authfile)\" 1>&2 &\n"
 "	fi\n"
 "\n"
 "	t=0\n"
@@ -2373,14 +2410,24 @@ char create_display[] =
 "\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"
diff --git a/ica/x11/x11vnc/uinput.c b/ica/x11/x11vnc/uinput.c
index 2dfb9fe..92bd1d8 100644
--- a/ica/x11/x11vnc/uinput.c
+++ b/ica/x11/x11vnc/uinput.c
@@ -63,6 +63,7 @@ so, delete this exception statement from your version.
 
 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);
@@ -83,20 +84,29 @@ 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 shutdown_uinput(void);
 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 db = 0;
+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[] = {
@@ -106,6 +116,13 @@ static char *devs[] = {
 	NULL
 };
 
+#ifndef O_NDELAY
+#ifdef  O_NONBLOCK
+#define O_NDELAY O_NONBLOCK
+#else
+#define O_NDELAY 0
+#endif
+#endif
 
 /* 
  * User may need to do:
@@ -137,7 +154,7 @@ int check_uinput(void) {
 	fd = -1;
 	i = 0;
 	while (devs[i] != NULL) {
-		if ( (fd = open(devs[i++], O_RDWR)) >= 0) {
+		if ( (fd = open(devs[i++], O_WRONLY | O_NDELAY)) >= 0) {
 			break;
 		}
 	}
@@ -190,39 +207,187 @@ static int key_is_down(void) {
 	return 0;
 }
 
-static void shutdown_uinput(void) {
+void shutdown_uinput(void) {
 #ifdef UINPUT_OK
-	ioctl(fd, UI_DEV_DESTROY);
+	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();
-		close(fd);
-		fd = -1;
 	}
+	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) {
-		fd = open(uinput_dev, O_RDWR);
-		rfbLog("initialize_uinput: using: %s %d\n", uinput_dev, fd);
+		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_RDWR)) >= 0) {
+			if ( (fd = open(devs[i], O_WRONLY | O_NDELAY)) >= 0) {
 				rfbLog("initialize_uinput: using: %s %d\n",
 				    devs[i], fd);
 				break;
@@ -233,15 +398,29 @@ int initialize_uinput(void) {
 	if (fd < 0) {
 		rfbLog("initialize_uinput: could not open an uinput device.\n");
 		rfbLogPerror("open");
-		clean_up_exit(1);
+		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);
 
-	udev.id.bustype = BUS_USB;	/* Matters? */
-	udev.id.version = 4;
+	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);
@@ -249,6 +428,8 @@ int initialize_uinput(void) {
 
 	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);
 	}
@@ -289,6 +470,23 @@ int initialize_uinput(void) {
 		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) {
@@ -408,6 +606,11 @@ void parse_uinput_str(char *in) {
 	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] == '/') {
@@ -415,6 +618,11 @@ void parse_uinput_str(char *in) {
 				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)) {
@@ -435,6 +643,12 @@ void parse_uinput_str(char *in) {
 				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, '=');
@@ -452,7 +666,38 @@ void parse_uinput_str(char *in) {
 				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);
@@ -465,6 +710,7 @@ void parse_uinput_str(char *in) {
 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;
@@ -472,29 +718,45 @@ static void ptr_move(int dx, int dy) {
 
 	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(fd, &ev, sizeof(ev));
+	write(d, &ev, sizeof(ev));
 
 	ev.type = EV_REL;
 	ev.code = REL_X;
 	ev.value = dx;
-	write(fd, &ev, sizeof(ev));
+	write(d, &ev, sizeof(ev));
 
 	ev.type = EV_SYN;
 	ev.code = SYN_REPORT;
 	ev.value = 0;
-	write(fd, &ev, sizeof(ev));
+	write(d, &ev, sizeof(ev));
 #else
 	if (!dx || !dy) {}
 #endif
 }
 
-static void ptr_abs(int x, int y) {
+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;
@@ -502,23 +764,37 @@ static void ptr_abs(int x, int y) {
 
 	memset(&ev, 0, sizeof(ev));
 
-	if (db) fprintf(stderr, "ptr_abs(%d, %d)\n", x, y);
+	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(fd, &ev, sizeof(ev));
+	write(d, &ev, sizeof(ev));
 
 	ev.type = EV_ABS;
 	ev.code = ABS_X;
 	ev.value = x;
-	write(fd, &ev, sizeof(ev));
+	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(fd, &ev, sizeof(ev));
+	write(d, &ev, sizeof(ev));
 #else
 	if (!x || !y) {}
 #endif
@@ -658,7 +934,7 @@ static void ptr_rel(int dx, int dy) {
 			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)};
+if (0) {usleep(100*1000) ;}
 			ptr_move(dxf, dyf);
 		}
 	}
@@ -667,12 +943,13 @@ if (0) {usleep(100*1000)};
 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\n", btn, down ? "down" : "up");
+	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);
@@ -696,12 +973,12 @@ static void button_click(int down, int btn) {
 		return;
 	}
 
-	write(fd, &ev, sizeof(ev));
+	write(d, &ev, sizeof(ev));
 
 	ev.type = EV_SYN;
 	ev.code = SYN_REPORT;
 	ev.value = 0;
-	write(fd, &ev, sizeof(ev));
+	write(d, &ev, sizeof(ev));
 
 	last_button_click = dnow();
 #else
@@ -756,15 +1033,6 @@ void uinput_pointer_command(int mask, int x, int y, rfbClientPtr client) {
 		do_reset = 1;
 	}
 	if (uinput_abs) {
-#if 0
-		/* this is a bad idea... need to do something else */
-		if (do_reset) {
-			ptr_abs(dpy_x, dpy_y);
-			usleep(10*1000);
-			ptr_abs(x, y);
-			usleep(10*1000);
-		}
-#endif
 		do_reset = 0;
 	}
 
@@ -849,7 +1117,7 @@ void uinput_pointer_command(int mask, int x, int y, rfbClientPtr client) {
 			} else {
 				ptr_rel(x, y);
 			}
-			if (1) {usleep(10*1000)};
+			if (1) {usleep(10*1000) ;}
 
 			last_x = x;
 			last_y = y;
@@ -863,8 +1131,10 @@ void uinput_pointer_command(int mask, int x, int y, rfbClientPtr client) {
 
 	if (input.motion) {
 		if (x != last_x || y != last_y) {
-			if (uinput_abs) {
-				ptr_abs(x, y);
+			if (uinput_touchscreen) {
+				;
+			} else if (uinput_abs) {
+				ptr_abs(x, y, -1);
 			} else {
 				ptr_rel(x - last_x, y - last_y);
 			}
@@ -888,7 +1158,46 @@ void uinput_pointer_command(int mask, int x, int y, rfbClientPtr client) {
 		fprintf(stderr, "button_mask: %s\n", bitprint(button_mask, 16));
 	}
 
-	if (mask != last_mask) {
+	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);
@@ -902,6 +1211,9 @@ void uinput_pointer_command(int mask, int x, int y, rfbClientPtr client) {
 			}
 			button_click(down, i);
 		}
+		if (mask && uinput_abs && touch_pressure >= 0) {
+			ptr_abs(last_x, last_y, touch_pressure);
+		}
 		last_mask = mask;
 	}
 	bmask = mask;
@@ -912,6 +1224,7 @@ void uinput_key_command(int down, int keysym, rfbClientPtr client) {
 	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;
@@ -929,7 +1242,7 @@ void uinput_key_command(int down, int keysym, rfbClientPtr client) {
 	if (scancode < 0) {
 		return;
 	}
-	if (db) fprintf(stderr, "uinput_key_command: %d -> %d %s\n", keysym, scancode, down ? "down" : "up");
+	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);
@@ -937,12 +1250,12 @@ void uinput_key_command(int down, int keysym, rfbClientPtr client) {
 	ev.code = (unsigned char) scancode;
 	ev.value = down;
 
-	write(fd, &ev, sizeof(ev));
+	write(d, &ev, sizeof(ev));
 
 	ev.type = EV_SYN;
 	ev.code = SYN_REPORT;
 	ev.value = 0;
-	write(fd, &ev, sizeof(ev));
+	write(d, &ev, sizeof(ev));
 
 	if (0 <= scancode && scancode < 256) {
 		key_pressed[scancode] = down ? 1 : 0;
@@ -952,6 +1265,10 @@ void uinput_key_command(int down, int keysym, rfbClientPtr 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) {
diff --git a/ica/x11/x11vnc/uinput.h b/ica/x11/x11vnc/uinput.h
index 01e8708..346e97c 100644
--- a/ica/x11/x11vnc/uinput.h
+++ b/ica/x11/x11vnc/uinput.h
@@ -37,6 +37,7 @@ so, delete this exception statement from your version.
 
 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);
diff --git a/ica/x11/x11vnc/unixpw.c b/ica/x11/x11vnc/unixpw.c
index b610fa9..ccdb195 100644
--- a/ica/x11/x11vnc/unixpw.c
+++ b/ica/x11/x11vnc/unixpw.c
@@ -565,6 +565,12 @@ char *get_pty_ptmx(int *fd_p) {
 	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;
@@ -1743,7 +1749,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
 		    down ? "down":"up  ", keysym, keystr);
 	}
 
-	if (keysym == XK_Return || keysym == XK_Linefeed) {
+	if (keysym == XK_Return || keysym == XK_Linefeed || keysym == XK_Tab) {
 		/* let "up" pass down below for Return case */
 		if (down) {
 			return;
@@ -1866,7 +1872,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
 			return;
 		}
 
-		if (keysym == XK_Return || keysym == XK_Linefeed) {
+		if (keysym == XK_Return || keysym == XK_Linefeed || keysym == XK_Tab) {
 			char pw[] = "Password: ";
 
 			if (down) {
diff --git a/ica/x11/x11vnc/user.c b/ica/x11/x11vnc/user.c
index e9028ba..971618a 100644
--- a/ica/x11/x11vnc/user.c
+++ b/ica/x11/x11vnc/user.c
@@ -63,6 +63,10 @@ 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);
@@ -1882,6 +1886,7 @@ 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);
@@ -1949,6 +1954,7 @@ char *setup_cmd(char *str, int *vnc_redirect, char **vnc_redirect_host, int *vnc
 		*vnc_redirect = 2;
 		rfbLog("wait_for_client: vnc_redirect: %s:%d\n", *vnc_redirect_host, *vnc_redirect_port);
 	}
+#endif
 	return cmd;
 }
 
@@ -2459,6 +2465,7 @@ static void path_lookup(char *prog) {
 }
 
 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;
@@ -2769,6 +2776,7 @@ if (db) fprintf(stderr, "\n");
 				clean_up_exit(1);
 			}
 			n = fread(line2, 1, 16384, p);
+			pclose(p);
 		}
 		if (tmp_fd >= 0) {
 			unlink(tmp);
@@ -2877,6 +2885,7 @@ fprintf(stderr, "\n");}
 		}
 		unixpw_msg(str, 2);
 	}
+#endif
 	return 1;
 }
 
diff --git a/ica/x11/x11vnc/util.c b/ica/x11/x11vnc/util.c
index 9c8c294..80b1607 100644
--- a/ica/x11/x11vnc/util.c
+++ b/ica/x11/x11vnc/util.c
@@ -594,6 +594,9 @@ int rfbPE(long usec) {
 	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")) {
@@ -713,9 +716,31 @@ char *choose_title(char *display) {
 	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();
diff --git a/ica/x11/x11vnc/util.h b/ica/x11/x11vnc/util.h
index 64c9f76..55585cf 100644
--- a/ica/x11/x11vnc/util.h
+++ b/ica/x11/x11vnc/util.h
@@ -96,8 +96,8 @@ extern struct timeval _mysleep;
   ((KeySym)(keysym) != XK_Caps_Lock) && ((KeySym)(keysym) != XK_Shift_Lock)))
 
 /*
- * Not sure why... but when threaded we have to mutex our X11 calls to
- * avoid XIO crashes.
+ * When threaded we have to mutex our X11 calls to avoid XIO crashes
+ * due to callbacks.
  */
 #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
 extern MUTEX(x11Mutex);
diff --git a/ica/x11/x11vnc/v4l.c b/ica/x11/x11vnc/v4l.c
index 84bfd08..86c33a6 100644
--- a/ica/x11/x11vnc/v4l.c
+++ b/ica/x11/x11vnc/v4l.c
@@ -434,23 +434,23 @@ static void apply_settings(char *dev, char *settings, int *fd) {
 static double dval = 0.05;
 
 static int v4l1_dpct(int old, int d) {
-	int new, max = V4L1_MAX; 
+	int newval, max = V4L1_MAX; 
 	
 	/* -1 and 1 are special cases for "small increments" */
 	if (d == -1) {
-		new = old - (int) (dval * max);
+		newval = old - (int) (dval * max);
 	} else if (d == 1) {
-		new = old + (int) (dval * max);
+		newval = old + (int) (dval * max);
 	} else {
-		new = (d * max)/100;
+		newval = (d * max)/100;
 	}
-	if (new < 0) {
-		new = 0;
+	if (newval < 0) {
+		newval = 0;
 	}
-	if (new > max) {
-		new = max;
+	if (newval > max) {
+		newval = max;
 	}
-	return new;
+	return newval;
 }
 
 static void v4l_requery(void) {
diff --git a/ica/x11/x11vnc/x11vnc.1 b/ica/x11/x11vnc/x11vnc.1
index cfab152..d4dd0a2 100644
--- a/ica/x11/x11vnc/x11vnc.1
+++ b/ica/x11/x11vnc/x11vnc.1
@@ -1,8 +1,8 @@
 .\" This file was automatically generated from x11vnc -help output.
-.TH X11VNC "1" "September 2010" "x11vnc " "User Commands"
+.TH X11VNC "1" "December 2010" "x11vnc " "User Commands"
 .SH NAME
 x11vnc - allow VNC connections to real X11 displays
-         version: 0.9.13, lastmod: 2010-09-10
+         version: 0.9.13, lastmod: 2010-12-27
 .SH SYNOPSIS
 .B x11vnc
 [OPTION]...
@@ -879,6 +879,22 @@ or plan to use remote control: \fB-R\fR connect:host), use
 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
@@ -925,6 +941,11 @@ 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
@@ -940,6 +961,13 @@ 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
@@ -1569,6 +1597,15 @@ 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
@@ -1600,6 +1637,11 @@ 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
@@ -1633,23 +1675,19 @@ prompt.  For example \fB-env\fR FD_USERPREFS=.x11vnc_create
 and the user put "geom=1600x1200" in his
 ~/.x11vnc_create file.
 .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
 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
-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.
+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)
@@ -1662,7 +1700,9 @@ 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
-Automatic Finding of User X Sessions:
+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
@@ -1670,7 +1710,7 @@ DISPLAY variable and xauthority data (see
 .IR who (1)
 ).
 .IP
-The option "\fB-find\fR" is an alias for this mode.
+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
@@ -1715,7 +1755,14 @@ 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
-Automatic Creation of User X Sessions:
+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
@@ -1724,13 +1771,19 @@ 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
-The option "\fB-create\fR" is an alias for this mode.
+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
@@ -1757,6 +1810,10 @@ 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, 
@@ -4614,6 +4671,7 @@ Default: take naps
 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
@@ -5129,18 +5187,19 @@ do not prefer the default 16bpp set RAWFB_VCSA_BPP to
 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.  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.
+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)
@@ -5181,7 +5240,11 @@ 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.
+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
@@ -5212,6 +5275,13 @@ 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
@@ -5278,7 +5348,8 @@ 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.
+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.
@@ -5320,16 +5391,6 @@ 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 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".
-.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
@@ -5339,8 +5400,70 @@ no acceleration is applied.  Use "thresh=+n" |dx| +
 Example:
 \fB-pipeinput\fR UINPUT:accel=4.0 \fB-cursor\fR none
 .IP
-You can also set the env. var X11VNC_UINPUT_DEBUG=1 or
-higher to get debugging output for UINPUT mode.
+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
@@ -5393,6 +5516,48 @@ because they have animated fades, etc.)
 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
diff --git a/ica/x11/x11vnc/x11vnc.c b/ica/x11/x11vnc/x11vnc.c
index 3f965e2..83752bd 100644
--- a/ica/x11/x11vnc/x11vnc.c
+++ b/ica/x11/x11vnc/x11vnc.c
@@ -857,6 +857,7 @@ static void check_redir_services(void) {
 }
 
 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;
@@ -981,6 +982,7 @@ void ssh_remote_tunnel(char *instr, int lport) {
 
 	free(cmd);
 	free(s);
+#endif
 }
 
 /* 
@@ -989,6 +991,7 @@ void ssh_remote_tunnel(char *instr, int lport) {
 static int limit_shm(void) {
 	int limit = 0;
 
+#ifndef WIN32
 	if (UT.sysname == NULL) {
 		return 0;
 	}
@@ -1009,6 +1012,7 @@ static int limit_shm(void) {
 		fprintf(stderr, "reducing shm usage on %s %s (adding "
 		    "-onetile)\n", UT.sysname, UT.release);
 	}
+#endif
 	return limit;
 }
 
@@ -1065,6 +1069,7 @@ static void check_rcfile(int argc, char **argv) {
 		if (! home) {
 			norc = 1;
 		} else {
+			memset(rcfile, 0, sizeof(rcfile));
 			strncpy(rcfile, home, 500);
 			free(home);
 
@@ -1394,6 +1399,7 @@ static void quick_pw(char *str) {
 		if(fgets(tmp, 1024, in) == NULL) {
 			exit(2);
 		}
+		fclose(in);
 		q = strdup(tmp);
 	} else {
 		q = strdup(str+1);
@@ -1722,6 +1728,7 @@ static void check_loop_mode(int argc, char* argv[], int force) {
 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++) {
@@ -1734,9 +1741,11 @@ static void check_appshare_mode(int argc, char* argv[]) {
 			exit(0);
 		}
 	}
+#endif
 }
 
 static void store_homedir_passwd(char *file) {
+#ifndef WIN32
 	char str1[32], str2[32], *p, *h, *f;
 	struct stat sbuf;
 
@@ -1831,6 +1840,7 @@ static void store_homedir_passwd(char *file) {
 	}
 	fprintf(stdout, "Password written to: %s\n", f);
 	exit(0);
+#endif
 }
 
 void ncache_beta_tester_message(void) {
@@ -2024,7 +2034,6 @@ static void check_guess_auth_file(void)  {
 	}
 }
 
-extern int dragum(void);
 extern int is_decimal(char *);
 
 int main(int argc, char* argv[]) {
@@ -2528,9 +2537,17 @@ int main(int argc, char* argv[]) {
 			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;
 		}
@@ -2574,6 +2591,10 @@ int main(int argc, char* argv[]) {
 			grab_ptr = 1;
 			continue;
 		}
+		if (!strcmp(arg, "-ungrabboth")) {
+			ungrab_both = 1;
+			continue;
+		}
 		if (!strcmp(arg, "-grabalways")) {
 			grab_kbd = 1;
 			grab_ptr = 1;
@@ -3925,6 +3946,14 @@ int main(int argc, char* argv[]) {
 			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) {
@@ -4158,8 +4187,10 @@ int main(int argc, char* argv[]) {
 		exit(0);
 	}
 
+#ifndef WIN32
 	/* set OS struct UT */
 	uname(&UT);
+#endif
 
 	orig_use_xdamage = use_xdamage;
 
@@ -4274,7 +4305,7 @@ int main(int argc, char* argv[]) {
 		char *pstr = "%VNCDISPLAY";
 		if (strstr(logfile, pstr)) {
 			char *h = this_host();
-			char *s, *q, *new;
+			char *s, *q, *newlog;
 			int n, p = got_rfbport_val;
 			/* we don't really know the port yet... so guess */
 			if (p < 0) {
@@ -4293,23 +4324,23 @@ int main(int argc, char* argv[]) {
 				n++;
 				q = t+1; 
 			}
-			new = (char *) malloc(strlen(logfile) + n * strlen(pstr));
-			new[0] = '\0';
+			newlog = (char *) malloc(strlen(logfile) + n * strlen(pstr));
+			newlog[0] = '\0';
 
 			q = logfile;
 			while (1) {
 				char *t = strstr(q, pstr);
 				if (!t) {
-					strcat(new, q);
+					strcat(newlog, q);
 					break;
 				}
-				strncat(new, q, t - q);
-				strcat(new, s);
+				strncat(newlog, q, t - q);
+				strcat(newlog, s);
 				q = t + strlen(pstr); 
 			}
-			logfile = new;
+			logfile = newlog;
 			if (!quiet && !got_inetd) {
-				rfbLog("Expanded logfile to '%s'\n", new);
+				rfbLog("Expanded logfile to '%s'\n", newlog);
 				
 			}
 			free(s);
@@ -4317,7 +4348,7 @@ int main(int argc, char* argv[]) {
 		pstr = "%HOME";
 		if (strstr(logfile, pstr)) {
 			char *h = get_home_dir();
-			char *s, *q, *new;
+			char *s, *q, *newlog;
 
 			s = (char *) malloc(strlen(h) + 32);
 			sprintf(s, "%s", h);
@@ -4329,23 +4360,23 @@ int main(int argc, char* argv[]) {
 				n++;
 				q = t+1; 
 			}
-			new = (char *) malloc(strlen(logfile) + n * strlen(pstr));
-			new[0] = '\0';
+			newlog = (char *) malloc(strlen(logfile) + n * strlen(pstr));
+			newlog[0] = '\0';
 
 			q = logfile;
 			while (1) {
 				char *t = strstr(q, pstr);
 				if (!t) {
-					strcat(new, q);
+					strcat(newlog, q);
 					break;
 				}
-				strncat(new, q, t - q);
-				strcat(new, s);
+				strncat(newlog, q, t - q);
+				strcat(newlog, s);
 				q = t + strlen(pstr); 
 			}
-			logfile = new;
+			logfile = newlog;
 			if (!quiet && !got_inetd) {
-				rfbLog("Expanded logfile to '%s'\n", new);
+				rfbLog("Expanded logfile to '%s'\n", newlog);
 			}
 			free(s);
 		}
@@ -5769,7 +5800,7 @@ int main(int argc, char* argv[]) {
 				waitms = 5;
 			}
 			if (!quiet) {
-				rfbLog("fast read: reset wait  ms to: %d\n", waitms);
+				rfbLog("fast read: reset -wait  ms to: %d\n", waitms);
 			}
 		}
 		if (! got_deferupdate && ! got_defer) {
@@ -5782,7 +5813,7 @@ int main(int argc, char* argv[]) {
 				if (screen) {
 					screen->deferUpdateTime = defer_update;
 				}
-				rfbLog("fast read: reset defer ms to: %d\n", defer_update);
+				rfbLog("fast read: reset -defer ms to: %d\n", defer_update);
 			}
 		}
 	}
@@ -5810,6 +5841,20 @@ int main(int argc, char* argv[]) {
 			}
 		}
 	}
+
+#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) {
diff --git a/ica/x11/x11vnc/x11vnc.h b/ica/x11/x11vnc/x11vnc.h
index 8d69543..211f82b 100644
--- a/ica/x11/x11vnc/x11vnc.h
+++ b/ica/x11/x11vnc/x11vnc.h
@@ -49,8 +49,14 @@ so, delete this exception statement from your version.
 /* Standard includes and libvncserver */
 
 #include <unistd.h>
-#include <signal.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>
@@ -133,6 +139,18 @@ so, delete this exception statement from your version.
  * -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
@@ -246,6 +264,30 @@ so, delete this exception statement from your version.
 #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
@@ -305,8 +347,11 @@ extern int xtrap_base_event_type;
 #include <sys/socket.h>
 #endif
 
+#ifndef WIN32
 #include <netdb.h>
-#ifndef _AIX
+#endif
+
+#if !defined(_AIX) && !defined(WIN32)
 extern int h_errno;
 #endif
 
diff --git a/ica/x11/x11vnc/x11vnc_defs.c b/ica/x11/x11vnc/x11vnc_defs.c
index fc6215b..081428d 100644
--- a/ica/x11/x11vnc/x11vnc_defs.c
+++ b/ica/x11/x11vnc/x11vnc_defs.c
@@ -47,7 +47,7 @@ int xtrap_base_event_type = 0;
 int xdamage_base_event_type = 0;
 
 /*               date +'lastmod: %Y-%m-%d' */
-char lastmod[] = "0.9.13 lastmod: 2010-09-10";
+char lastmod[] = "0.9.13 lastmod: 2010-12-27";
 
 /* X display info */
 
@@ -225,6 +225,8 @@ int program_pid = 0;
 char *program_name = NULL;
 char *program_cmdline = NULL;
 
+#ifndef WIN32
 struct utsname UT;
+#endif
 
 
diff --git a/ica/x11/x11vnc/xevents.c b/ica/x11/x11vnc/xevents.c
index 2fc122d..72b6515 100644
--- a/ica/x11/x11vnc/xevents.c
+++ b/ica/x11/x11vnc/xevents.c
@@ -57,6 +57,7 @@ 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;
 
diff --git a/ica/x11/x11vnc/xevents.h b/ica/x11/x11vnc/xevents.h
index dbdddde..5b8bdce 100644
--- a/ica/x11/x11vnc/xevents.h
+++ b/ica/x11/x11vnc/xevents.h
@@ -39,6 +39,7 @@ 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;
 
diff --git a/ica/x11/x11vnc/xrecord.c b/ica/x11/x11vnc/xrecord.c
index 4f79dce..87e15b9 100644
--- a/ica/x11/x11vnc/xrecord.c
+++ b/ica/x11/x11vnc/xrecord.c
@@ -73,7 +73,7 @@ void initialize_xrecord(void);
 void zerodisp_xrecord(void);
 void shutdown_xrecord(void);
 int xrecord_skip_keysym(rfbKeySym keysym);
-int xrecord_skip_button(int new, int old);
+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);
@@ -410,9 +410,9 @@ int xrecord_skip_keysym(rfbKeySym keysym) {
 	return 0;
 }
 
-int xrecord_skip_button(int new, int old) {
+int xrecord_skip_button(int new_button, int old) {
 	/* unused vars warning: */
-	if (new || old) {}
+	if (new_button || old) {}
 
 	return 0;
 }
diff --git a/ica/x11/x11vnc/xrecord.h b/ica/x11/x11vnc/xrecord.h
index cee660d..2c1e2d7 100644
--- a/ica/x11/x11vnc/xrecord.h
+++ b/ica/x11/x11vnc/xrecord.h
@@ -60,7 +60,7 @@ 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 new, int old);
+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);
diff --git a/ica/x11/x11vnc/xwrappers.c b/ica/x11/x11vnc/xwrappers.c
index 667957e..e7158cf 100644
--- a/ica/x11/x11vnc/xwrappers.c
+++ b/ica/x11/x11vnc/xwrappers.c
@@ -347,7 +347,15 @@ XImage *XCreateImage_wr(Display *disp, Visual *visual, unsigned int depth,
 		xi = (XImage *) malloc(sizeof(XImage));
 		memset(xi, 0, sizeof(XImage));
 		xi->depth = depth;
-		xi->bits_per_pixel = (depth == 24) ? 32 : 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;
@@ -673,12 +681,23 @@ static void copy_raw_fb_24_to_32(XImage *dest, int x, int y, unsigned int w,
 	}
 }
 
+#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;
@@ -706,7 +725,7 @@ void copy_raw_fb(XImage *dest, int x, int y, unsigned int w, unsigned int h) {
 		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\n", snap->bytes_per_line, dest->bytes_per_line, w, h, dpy_x, wdpy_x, cdpy_x);
+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);
@@ -725,7 +744,7 @@ if (db) fprintf(stderr, "snap->bytes_per_line: %d, dest->bytes_per_line: %d, w:
 		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\n", bpl, dest->bytes_per_line, w, h, dpy_x, wdpy_x, cdpy_x);
+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);
@@ -878,6 +897,7 @@ void XTRAP_FakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
 void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
     unsigned long delay) {
 	static int first = 1;
+	int regrab = 0;
 
 	RAWFB_RET_VOID
 
@@ -903,11 +923,16 @@ void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
 
 	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 (grab_kbd) {
+		if (regrab) {
 			adjust_grabs(1, 1);
 		}
 		return;
@@ -923,7 +948,7 @@ void XTestFakeKeyEvent_wr(Display* dpy, KeyCode key, Bool down,
 	}
 #if LIBVNCSERVER_HAVE_XTEST
 	XTestFakeKeyEvent(dpy, key, down, delay);
-	if (grab_kbd) {
+	if (regrab) {
 		adjust_grabs(1, 1);
 	}
 	if (debug_keyboard) {
@@ -964,6 +989,7 @@ void XTRAP_FakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
 
 void XTestFakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
     unsigned long delay) {
+	int regrab = 0;
 
 	RAWFB_RET_VOID
 #if NO_X11
@@ -974,11 +1000,16 @@ void XTestFakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
 
 	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 (grab_ptr) {
+		if (regrab) {
 			adjust_grabs(1, 1);
 		}
 		return;
@@ -995,7 +1026,7 @@ void XTestFakeButtonEvent_wr(Display* dpy, unsigned int button, Bool is_press,
 #if LIBVNCSERVER_HAVE_XTEST
     	XTestFakeButtonEvent(dpy, button, is_press, delay);
 #endif
-	if (grab_ptr) {
+	if (regrab) {
 		adjust_grabs(1, 1);
 	}
 #endif	/* NO_X11 */
@@ -1029,6 +1060,7 @@ void XTRAP_FakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
 
 void XTestFakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
     unsigned long delay) {
+	int regrab = 0;
 
 	RAWFB_RET_VOID
 #if NO_X11
@@ -1039,11 +1071,16 @@ void XTestFakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
 
 	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 (grab_ptr) {
+		if (regrab) {
 			adjust_grabs(1, 1);
 		}
 		return;
@@ -1056,7 +1093,7 @@ void XTestFakeMotionEvent_wr(Display* dpy, int screen, int x, int y,
 #if LIBVNCSERVER_HAVE_XTEST
 	XTestFakeMotionEvent(dpy, screen, x, y, delay);
 #endif
-	if (grab_ptr) {
+	if (regrab) {
 		adjust_grabs(1, 1);
 	}
 #endif	/* NO_X11 */
diff --git a/ima/CMakeLists.txt b/ima/CMakeLists.txt
new file mode 100644
index 0000000..06f9b73
--- /dev/null
+++ b/ima/CMakeLists.txt
@@ -0,0 +1,30 @@
+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_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/Makefile.am b/ima/Makefile.am
deleted file mode 100644
index 6318c6a..0000000
--- a/ima/Makefile.am
+++ /dev/null
@@ -1,129 +0,0 @@
-AUTOMAKE_OPTIONS = foreign
-
-INCLUDES = -I$(srcdir)/../lib/include -Isrc
-
-bin_PROGRAMS = italc
-
-%.moc: $(srcdir)/%.h
-	$(MOC) -o $@ $<
-
-%.uic: %.ui
-	$(UIC) -o $@ $<
-
-italc_MOC =	./src/client.moc			\
-		./src/classroom_manager.moc		\
-		./src/cmd_input_dialog.moc		\
-		./src/config_widget.moc			\
-		./src/dialogs.moc			\
-		./src/MainWindow.moc			\
-		./src/overview_widget.moc		\
-		./src/remote_control_widget.moc		\
-		./src/SideBar.moc			\
-		./src/snapshot_list.moc			\
-		./src/MainToolBar.moc			\
-		./src/tool_button.moc
-
-italc_UIC =	./dialogs/client_settings.uic		\
-		./dialogs/MainWindow.uic		\
-		./dialogs/config.uic			\
-		./dialogs/support.uic			\
-		./dialogs/text_message.uic		\
-		./dialogs/remote_logon.uic		\
-		./dialogs/overview.uic			\
-		./dialogs/snapshots.uic			\
-		./dialogs/about.uic
-
-BUILT_SOURCES = $(italc_MOC) $(italc_UIC) ./italc_qrc.cpp
-
-
-
-./italc_qrc.cpp: italc.qrc
-	$(RCC) $< > $@
-
-
-italc_SOURCES = $(srcdir)/src/client.cpp			\
-		$(srcdir)/src/classroom_manager.cpp		\
-		$(srcdir)/src/cmd_input_dialog.cpp		\
-		$(srcdir)/src/config_widget.cpp			\
-		$(srcdir)/src/dialogs.cpp			\
-		$(srcdir)/src/MainToolBar.cpp			\
-		$(srcdir)/src/SideBar.cpp		\
-		$(srcdir)/src/SideBarWidget.cpp		\
-		$(srcdir)/src/MainWindow.cpp			\
-		$(srcdir)/src/local_system_ima.cpp		\
-		$(srcdir)/src/main.cpp				\
-		$(srcdir)/src/overview_widget.cpp		\
-		$(srcdir)/src/remote_control_widget.cpp		\
-		$(srcdir)/src/snapshot_list.cpp			\
-		$(srcdir)/src/tool_button.cpp			\
-		$(srcdir)/src/client.h				\
-		$(srcdir)/src/classroom_manager.h		\
-		$(srcdir)/src/cmd_input_dialog.h		\
-		$(srcdir)/src/config_widget.h 			\
-		$(srcdir)/src/MainToolBar.h 			\
-		$(srcdir)/src/dialogs.h				\
-		$(srcdir)/src/local_system_ima.h		\
-		$(srcdir)/src/MainWindow.h			\
-		$(srcdir)/src/SideBar.h			\
-		$(srcdir)/src/SideBarWidget.h			\
-		$(srcdir)/src/overview_widget.h			\
-		$(srcdir)/src/qplatformdefs.h			\
-		$(srcdir)/src/remote_control_widget.h		\
-		$(srcdir)/src/snapshot_list.h			\
-		$(srcdir)/src/tool_button.h			\
-		$(srcdir)/italc_qrc.cpp				\
-		$(srcdir)/italc.qrc				\
-		$(wildcard $(srcdir)/dialogs/*.ui)		\
-		$(wildcard $(srcdir)/resources/*.png)
-
-
-CLEANFILES = $(italc_MOC) $(italc_UIC) ./italc_qrc.cpp
-
-man_MANS=italc.1
-
-menudir = $(prefix)/share/menu
-menu_DATA = data/italc
-
-applicationsdir = $(prefix)/share/applications
-applications_DATA = data/italc.desktop
-
-pixmapsdir = $(prefix)/share/pixmaps
-pixmaps_DATA = data/italc.xpm
-
-iconsdir = $(prefix)/share/icons
-icons_DATA = data/italc.png
-
-
-
-EXTRA_DIST =	$(man_MANS)				\
-		$(wildcard $(srcdir)/src/3rdparty/*)	\
-		data/italc.desktop.in			\
-		data/italc.in				\
-		$(pixmaps_DATA)				\
-		$(icons_DATA)				\
-		data/italc.ico
-
-if BUILD_WIN32
-italc_win_resources.o: italc.rc
-	$(WINDRES) -o $@ $<
-WIN32_RES_LDADD = italc_win_resources.o
-# QtCore already contains libz
-LIBZ_LDADD =
-else
-LIBZ_LDADD = -lz
-endif
-
-if HAVE_LIBSSL
-LIBSSL_LDADD = -lssl -lcrypto
-endif
-
-if HAVE_LIBEAY32
-LIBSSL_LDADD = -leay32
-endif
-
-
-italc_LDADD = $(QT_LDADD) $(QT_LIB_GUI) $(LIBZ_LDADD) -ljpeg $(LIBSSL_LDADD) $(WIN32_RES_LDADD) -L../lib -litalc_core
-italc_LDFLAGS = $(LDFLAGS) -mwindows -rpath $(pkglibdir)
-
-AM_CXXFLAGS = $(QT_CXXFLAGS)
-
diff --git a/ima/Makefile.in b/ima/Makefile.in
deleted file mode 100644
index 2fc456f..0000000
--- a/ima/Makefile.in
+++ /dev/null
@@ -1,1061 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-bin_PROGRAMS = italc$(EXEEXT)
-subdir = ima
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-	$(srcdir)/italc.rc.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = italc.rc
-CONFIG_CLEAN_VPATH_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
-	"$(DESTDIR)$(applicationsdir)" "$(DESTDIR)$(iconsdir)" \
-	"$(DESTDIR)$(menudir)" "$(DESTDIR)$(pixmapsdir)"
-PROGRAMS = $(bin_PROGRAMS)
-am_italc_OBJECTS = client.$(OBJEXT) classroom_manager.$(OBJEXT) \
-	cmd_input_dialog.$(OBJEXT) config_widget.$(OBJEXT) \
-	dialogs.$(OBJEXT) MainToolBar.$(OBJEXT) SideBar.$(OBJEXT) \
-	SideBarWidget.$(OBJEXT) MainWindow.$(OBJEXT) \
-	local_system_ima.$(OBJEXT) main.$(OBJEXT) \
-	overview_widget.$(OBJEXT) remote_control_widget.$(OBJEXT) \
-	snapshot_list.$(OBJEXT) tool_button.$(OBJEXT) \
-	italc_qrc.$(OBJEXT)
-italc_OBJECTS = $(am_italc_OBJECTS)
-am__DEPENDENCIES_1 =
-italc_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) $(WIN32_RES_LDADD)
-italc_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
-	$(italc_LDFLAGS) $(LDFLAGS) -o $@
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(italc_SOURCES)
-DIST_SOURCES = $(italc_SOURCES)
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-man1dir = $(mandir)/man1
-NROFF = nroff
-MANS = $(man_MANS)
-DATA = $(applications_DATA) $(icons_DATA) $(menu_DATA) $(pixmaps_DATA)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LRELEASE = @LRELEASE@
-LTLIBOBJS = @LTLIBOBJS@
-LUPDATE = @LUPDATE@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-MOC = @MOC@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-QT_CXXFLAGS = @QT_CXXFLAGS@
-QT_LDADD = @QT_LDADD@
-QT_LIB_GUI = @QT_LIB_GUI@
-RANLIB = @RANLIB@
-RCC = @RCC@
-RPMSOURCEDIR = @RPMSOURCEDIR@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-UIC = @UIC@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign
-INCLUDES = -I$(srcdir)/../lib/include -Isrc
-italc_MOC = ./src/client.moc			\
-		./src/classroom_manager.moc		\
-		./src/cmd_input_dialog.moc		\
-		./src/config_widget.moc			\
-		./src/dialogs.moc			\
-		./src/MainWindow.moc			\
-		./src/overview_widget.moc		\
-		./src/remote_control_widget.moc		\
-		./src/SideBar.moc			\
-		./src/snapshot_list.moc			\
-		./src/MainToolBar.moc			\
-		./src/tool_button.moc
-
-italc_UIC = ./dialogs/client_settings.uic		\
-		./dialogs/MainWindow.uic		\
-		./dialogs/config.uic			\
-		./dialogs/support.uic			\
-		./dialogs/text_message.uic		\
-		./dialogs/remote_logon.uic		\
-		./dialogs/overview.uic			\
-		./dialogs/snapshots.uic			\
-		./dialogs/about.uic
-
-BUILT_SOURCES = $(italc_MOC) $(italc_UIC) ./italc_qrc.cpp
-italc_SOURCES = $(srcdir)/src/client.cpp			\
-		$(srcdir)/src/classroom_manager.cpp		\
-		$(srcdir)/src/cmd_input_dialog.cpp		\
-		$(srcdir)/src/config_widget.cpp			\
-		$(srcdir)/src/dialogs.cpp			\
-		$(srcdir)/src/MainToolBar.cpp			\
-		$(srcdir)/src/SideBar.cpp		\
-		$(srcdir)/src/SideBarWidget.cpp		\
-		$(srcdir)/src/MainWindow.cpp			\
-		$(srcdir)/src/local_system_ima.cpp		\
-		$(srcdir)/src/main.cpp				\
-		$(srcdir)/src/overview_widget.cpp		\
-		$(srcdir)/src/remote_control_widget.cpp		\
-		$(srcdir)/src/snapshot_list.cpp			\
-		$(srcdir)/src/tool_button.cpp			\
-		$(srcdir)/src/client.h				\
-		$(srcdir)/src/classroom_manager.h		\
-		$(srcdir)/src/cmd_input_dialog.h		\
-		$(srcdir)/src/config_widget.h 			\
-		$(srcdir)/src/MainToolBar.h 			\
-		$(srcdir)/src/dialogs.h				\
-		$(srcdir)/src/local_system_ima.h		\
-		$(srcdir)/src/MainWindow.h			\
-		$(srcdir)/src/SideBar.h			\
-		$(srcdir)/src/SideBarWidget.h			\
-		$(srcdir)/src/overview_widget.h			\
-		$(srcdir)/src/qplatformdefs.h			\
-		$(srcdir)/src/remote_control_widget.h		\
-		$(srcdir)/src/snapshot_list.h			\
-		$(srcdir)/src/tool_button.h			\
-		$(srcdir)/italc_qrc.cpp				\
-		$(srcdir)/italc.qrc				\
-		$(wildcard $(srcdir)/dialogs/*.ui)		\
-		$(wildcard $(srcdir)/resources/*.png)
-
-CLEANFILES = $(italc_MOC) $(italc_UIC) ./italc_qrc.cpp
-man_MANS = italc.1
-menudir = $(prefix)/share/menu
-menu_DATA = data/italc
-applicationsdir = $(prefix)/share/applications
-applications_DATA = data/italc.desktop
-pixmapsdir = $(prefix)/share/pixmaps
-pixmaps_DATA = data/italc.xpm
-iconsdir = $(prefix)/share/icons
-icons_DATA = data/italc.png
-EXTRA_DIST = $(man_MANS)				\
-		$(wildcard $(srcdir)/src/3rdparty/*)	\
-		data/italc.desktop.in			\
-		data/italc.in				\
-		$(pixmaps_DATA)				\
-		$(icons_DATA)				\
-		data/italc.ico
-
- at BUILD_WIN32_TRUE@WIN32_RES_LDADD = italc_win_resources.o
- at BUILD_WIN32_FALSE@LIBZ_LDADD = -lz
-# QtCore already contains libz
- at BUILD_WIN32_TRUE@LIBZ_LDADD = 
- at HAVE_LIBEAY32_TRUE@LIBSSL_LDADD = -leay32
- at HAVE_LIBSSL_TRUE@LIBSSL_LDADD = -lssl -lcrypto
-italc_LDADD = $(QT_LDADD) $(QT_LIB_GUI) $(LIBZ_LDADD) -ljpeg $(LIBSSL_LDADD) $(WIN32_RES_LDADD) -L../lib -litalc_core
-italc_LDFLAGS = $(LDFLAGS) -mwindows -rpath $(pkglibdir)
-AM_CXXFLAGS = $(QT_CXXFLAGS)
-all: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ima/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign ima/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-italc.rc: $(top_builddir)/config.status $(srcdir)/italc.rc.in
-	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-install-binPROGRAMS: $(bin_PROGRAMS)
-	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	for p in $$list; do echo "$$p $$p"; done | \
-	sed 's/$(EXEEXT)$$//' | \
-	while read p p1; do if test -f $$p || test -f $$p1; \
-	  then echo "$$p"; echo "$$p"; else :; fi; \
-	done | \
-	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
-	sed 'N;N;N;s,\n, ,g' | \
-	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
-	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
-	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
-	    else { print "f", $$3 "/" $$4, $$1; } } \
-	  END { for (d in files) print "f", d, files[d] }' | \
-	while read type dir files; do \
-	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
-	    test -z "$$files" || { \
-	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
-	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
-	    } \
-	; done
-
-uninstall-binPROGRAMS:
-	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
-	files=`for p in $$list; do echo "$$p"; done | \
-	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-	      -e 's/$$/$(EXEEXT)/' `; \
-	test -n "$$list" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-italc$(EXEEXT): $(italc_OBJECTS) $(italc_DEPENDENCIES) 
-	@rm -f italc$(EXEEXT)
-	$(italc_LINK) $(italc_OBJECTS) $(italc_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MainToolBar.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MainWindow.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SideBar.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/SideBarWidget.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/classroom_manager.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/client.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cmd_input_dialog.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/config_widget.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dialogs.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/italc_qrc.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/local_system_ima.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/overview_widget.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/remote_control_widget.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/snapshot_list.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tool_button.Po at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-client.o: $(srcdir)/src/client.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT client.o -MD -MP -MF $(DEPDIR)/client.Tpo -c -o client.o `test -f '$(srcdir)/src/client.cpp' || echo '$(srcdir)/'`$(srcdir)/src/client.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/client.Tpo $(DEPDIR)/client.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/client.cpp' object='client.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o client.o `test -f '$(srcdir)/src/client.cpp' || echo '$(srcdir)/'`$(srcdir)/src/client.cpp
-
-client.obj: $(srcdir)/src/client.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT client.obj -MD -MP -MF $(DEPDIR)/client.Tpo -c -o client.obj `if test -f '$(srcdir)/src/client.cpp'; then $(CYGPATH_W) '$(srcdir)/src/client.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/client.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/client.Tpo $(DEPDIR)/client.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/client.cpp' object='client.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o client.obj `if test -f '$(srcdir)/src/client.cpp'; then $(CYGPATH_W) '$(srcdir)/src/client.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/client.cpp'; fi`
-
-classroom_manager.o: $(srcdir)/src/classroom_manager.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT classroom_manager.o -MD -MP -MF $(DEPDIR)/classroom_manager.Tpo -c -o classroom_manager.o `test -f '$(srcdir)/src/classroom_manager.cpp' || echo '$(srcdir)/'`$(srcdir)/src/classroom_manager.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/classroom_manager.Tpo $(DEPDIR)/classroom_manager.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/classroom_manager.cpp' object='classroom_manager.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o classroom_manager.o `test -f '$(srcdir)/src/classroom_manager.cpp' || echo '$(srcdir)/'`$(srcdir)/src/classroom_manager.cpp
-
-classroom_manager.obj: $(srcdir)/src/classroom_manager.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT classroom_manager.obj -MD -MP -MF $(DEPDIR)/classroom_manager.Tpo -c -o classroom_manager.obj `if test -f '$(srcdir)/src/classroom_manager.cpp'; then $(CYGPATH_W) '$(srcdir)/src/classroom_manager.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/classroom_manager.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/classroom_manager.Tpo $(DEPDIR)/classroom_manager.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/classroom_manager.cpp' object='classroom_manager.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o classroom_manager.obj `if test -f '$(srcdir)/src/classroom_manager.cpp'; then $(CYGPATH_W) '$(srcdir)/src/classroom_manager.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/classroom_manager.cpp'; fi`
-
-cmd_input_dialog.o: $(srcdir)/src/cmd_input_dialog.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cmd_input_dialog.o -MD -MP -MF $(DEPDIR)/cmd_input_dialog.Tpo -c -o cmd_input_dialog.o `test -f '$(srcdir)/src/cmd_input_dialog.cpp' || echo '$(srcdir)/'`$(srcdir)/src/cmd_input_dialog.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/cmd_input_dialog.Tpo $(DEPDIR)/cmd_input_dialog.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/cmd_input_dialog.cpp' object='cmd_input_dialog.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cmd_input_dialog.o `test -f '$(srcdir)/src/cmd_input_dialog.cpp' || echo '$(srcdir)/'`$(srcdir)/src/cmd_input_dialog.cpp
-
-cmd_input_dialog.obj: $(srcdir)/src/cmd_input_dialog.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT cmd_input_dialog.obj -MD -MP -MF $(DEPDIR)/cmd_input_dialog.Tpo -c -o cmd_input_dialog.obj `if test -f '$(srcdir)/src/cmd_input_dialog.cpp'; then $(CYGPATH_W) '$(srcdir)/src/cmd_input_dialog.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/cmd_input_dialog.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/cmd_input_dialog.Tpo $(DEPDIR)/cmd_input_dialog.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/cmd_input_dialog.cpp' object='cmd_input_dialog.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o cmd_input_dialog.obj `if test -f '$(srcdir)/src/cmd_input_dialog.cpp'; then $(CYGPATH_W) '$(srcdir)/src/cmd_input_dialog.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/cmd_input_dialog.cpp'; fi`
-
-config_widget.o: $(srcdir)/src/config_widget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT config_widget.o -MD -MP -MF $(DEPDIR)/config_widget.Tpo -c -o config_widget.o `test -f '$(srcdir)/src/config_widget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/config_widget.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/config_widget.Tpo $(DEPDIR)/config_widget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/config_widget.cpp' object='config_widget.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o config_widget.o `test -f '$(srcdir)/src/config_widget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/config_widget.cpp
-
-config_widget.obj: $(srcdir)/src/config_widget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT config_widget.obj -MD -MP -MF $(DEPDIR)/config_widget.Tpo -c -o config_widget.obj `if test -f '$(srcdir)/src/config_widget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/config_widget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/config_widget.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/config_widget.Tpo $(DEPDIR)/config_widget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/config_widget.cpp' object='config_widget.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o config_widget.obj `if test -f '$(srcdir)/src/config_widget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/config_widget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/config_widget.cpp'; fi`
-
-dialogs.o: $(srcdir)/src/dialogs.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dialogs.o -MD -MP -MF $(DEPDIR)/dialogs.Tpo -c -o dialogs.o `test -f '$(srcdir)/src/dialogs.cpp' || echo '$(srcdir)/'`$(srcdir)/src/dialogs.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dialogs.Tpo $(DEPDIR)/dialogs.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/dialogs.cpp' object='dialogs.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dialogs.o `test -f '$(srcdir)/src/dialogs.cpp' || echo '$(srcdir)/'`$(srcdir)/src/dialogs.cpp
-
-dialogs.obj: $(srcdir)/src/dialogs.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dialogs.obj -MD -MP -MF $(DEPDIR)/dialogs.Tpo -c -o dialogs.obj `if test -f '$(srcdir)/src/dialogs.cpp'; then $(CYGPATH_W) '$(srcdir)/src/dialogs.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/dialogs.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dialogs.Tpo $(DEPDIR)/dialogs.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/dialogs.cpp' object='dialogs.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dialogs.obj `if test -f '$(srcdir)/src/dialogs.cpp'; then $(CYGPATH_W) '$(srcdir)/src/dialogs.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/dialogs.cpp'; fi`
-
-MainToolBar.o: $(srcdir)/src/MainToolBar.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MainToolBar.o -MD -MP -MF $(DEPDIR)/MainToolBar.Tpo -c -o MainToolBar.o `test -f '$(srcdir)/src/MainToolBar.cpp' || echo '$(srcdir)/'`$(srcdir)/src/MainToolBar.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/MainToolBar.Tpo $(DEPDIR)/MainToolBar.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/MainToolBar.cpp' object='MainToolBar.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MainToolBar.o `test -f '$(srcdir)/src/MainToolBar.cpp' || echo '$(srcdir)/'`$(srcdir)/src/MainToolBar.cpp
-
-MainToolBar.obj: $(srcdir)/src/MainToolBar.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MainToolBar.obj -MD -MP -MF $(DEPDIR)/MainToolBar.Tpo -c -o MainToolBar.obj `if test -f '$(srcdir)/src/MainToolBar.cpp'; then $(CYGPATH_W) '$(srcdir)/src/MainToolBar.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/MainToolBar.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/MainToolBar.Tpo $(DEPDIR)/MainToolBar.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/MainToolBar.cpp' object='MainToolBar.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MainToolBar.obj `if test -f '$(srcdir)/src/MainToolBar.cpp'; then $(CYGPATH_W) '$(srcdir)/src/MainToolBar.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/MainToolBar.cpp'; fi`
-
-SideBar.o: $(srcdir)/src/SideBar.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SideBar.o -MD -MP -MF $(DEPDIR)/SideBar.Tpo -c -o SideBar.o `test -f '$(srcdir)/src/SideBar.cpp' || echo '$(srcdir)/'`$(srcdir)/src/SideBar.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/SideBar.Tpo $(DEPDIR)/SideBar.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/SideBar.cpp' object='SideBar.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SideBar.o `test -f '$(srcdir)/src/SideBar.cpp' || echo '$(srcdir)/'`$(srcdir)/src/SideBar.cpp
-
-SideBar.obj: $(srcdir)/src/SideBar.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SideBar.obj -MD -MP -MF $(DEPDIR)/SideBar.Tpo -c -o SideBar.obj `if test -f '$(srcdir)/src/SideBar.cpp'; then $(CYGPATH_W) '$(srcdir)/src/SideBar.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/SideBar.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/SideBar.Tpo $(DEPDIR)/SideBar.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/SideBar.cpp' object='SideBar.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SideBar.obj `if test -f '$(srcdir)/src/SideBar.cpp'; then $(CYGPATH_W) '$(srcdir)/src/SideBar.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/SideBar.cpp'; fi`
-
-SideBarWidget.o: $(srcdir)/src/SideBarWidget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SideBarWidget.o -MD -MP -MF $(DEPDIR)/SideBarWidget.Tpo -c -o SideBarWidget.o `test -f '$(srcdir)/src/SideBarWidget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/SideBarWidget.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/SideBarWidget.Tpo $(DEPDIR)/SideBarWidget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/SideBarWidget.cpp' object='SideBarWidget.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SideBarWidget.o `test -f '$(srcdir)/src/SideBarWidget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/SideBarWidget.cpp
-
-SideBarWidget.obj: $(srcdir)/src/SideBarWidget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SideBarWidget.obj -MD -MP -MF $(DEPDIR)/SideBarWidget.Tpo -c -o SideBarWidget.obj `if test -f '$(srcdir)/src/SideBarWidget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/SideBarWidget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/SideBarWidget.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/SideBarWidget.Tpo $(DEPDIR)/SideBarWidget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/SideBarWidget.cpp' object='SideBarWidget.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SideBarWidget.obj `if test -f '$(srcdir)/src/SideBarWidget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/SideBarWidget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/SideBarWidget.cpp'; fi`
-
-MainWindow.o: $(srcdir)/src/MainWindow.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MainWindow.o -MD -MP -MF $(DEPDIR)/MainWindow.Tpo -c -o MainWindow.o `test -f '$(srcdir)/src/MainWindow.cpp' || echo '$(srcdir)/'`$(srcdir)/src/MainWindow.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/MainWindow.Tpo $(DEPDIR)/MainWindow.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/MainWindow.cpp' object='MainWindow.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MainWindow.o `test -f '$(srcdir)/src/MainWindow.cpp' || echo '$(srcdir)/'`$(srcdir)/src/MainWindow.cpp
-
-MainWindow.obj: $(srcdir)/src/MainWindow.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MainWindow.obj -MD -MP -MF $(DEPDIR)/MainWindow.Tpo -c -o MainWindow.obj `if test -f '$(srcdir)/src/MainWindow.cpp'; then $(CYGPATH_W) '$(srcdir)/src/MainWindow.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/MainWindow.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/MainWindow.Tpo $(DEPDIR)/MainWindow.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/MainWindow.cpp' object='MainWindow.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MainWindow.obj `if test -f '$(srcdir)/src/MainWindow.cpp'; then $(CYGPATH_W) '$(srcdir)/src/MainWindow.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/MainWindow.cpp'; fi`
-
-local_system_ima.o: $(srcdir)/src/local_system_ima.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT local_system_ima.o -MD -MP -MF $(DEPDIR)/local_system_ima.Tpo -c -o local_system_ima.o `test -f '$(srcdir)/src/local_system_ima.cpp' || echo '$(srcdir)/'`$(srcdir)/src/local_system_ima.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/local_system_ima.Tpo $(DEPDIR)/local_system_ima.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/local_system_ima.cpp' object='local_system_ima.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o local_system_ima.o `test -f '$(srcdir)/src/local_system_ima.cpp' || echo '$(srcdir)/'`$(srcdir)/src/local_system_ima.cpp
-
-local_system_ima.obj: $(srcdir)/src/local_system_ima.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT local_system_ima.obj -MD -MP -MF $(DEPDIR)/local_system_ima.Tpo -c -o local_system_ima.obj `if test -f '$(srcdir)/src/local_system_ima.cpp'; then $(CYGPATH_W) '$(srcdir)/src/local_system_ima.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/local_system_ima.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/local_system_ima.Tpo $(DEPDIR)/local_system_ima.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/local_system_ima.cpp' object='local_system_ima.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o local_system_ima.obj `if test -f '$(srcdir)/src/local_system_ima.cpp'; then $(CYGPATH_W) '$(srcdir)/src/local_system_ima.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/local_system_ima.cpp'; fi`
-
-main.o: $(srcdir)/src/main.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT main.o -MD -MP -MF $(DEPDIR)/main.Tpo -c -o main.o `test -f '$(srcdir)/src/main.cpp' || echo '$(srcdir)/'`$(srcdir)/src/main.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/main.Tpo $(DEPDIR)/main.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/main.cpp' object='main.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o main.o `test -f '$(srcdir)/src/main.cpp' || echo '$(srcdir)/'`$(srcdir)/src/main.cpp
-
-main.obj: $(srcdir)/src/main.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT main.obj -MD -MP -MF $(DEPDIR)/main.Tpo -c -o main.obj `if test -f '$(srcdir)/src/main.cpp'; then $(CYGPATH_W) '$(srcdir)/src/main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/main.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/main.Tpo $(DEPDIR)/main.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/main.cpp' object='main.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o main.obj `if test -f '$(srcdir)/src/main.cpp'; then $(CYGPATH_W) '$(srcdir)/src/main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/main.cpp'; fi`
-
-overview_widget.o: $(srcdir)/src/overview_widget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT overview_widget.o -MD -MP -MF $(DEPDIR)/overview_widget.Tpo -c -o overview_widget.o `test -f '$(srcdir)/src/overview_widget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/overview_widget.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/overview_widget.Tpo $(DEPDIR)/overview_widget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/overview_widget.cpp' object='overview_widget.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o overview_widget.o `test -f '$(srcdir)/src/overview_widget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/overview_widget.cpp
-
-overview_widget.obj: $(srcdir)/src/overview_widget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT overview_widget.obj -MD -MP -MF $(DEPDIR)/overview_widget.Tpo -c -o overview_widget.obj `if test -f '$(srcdir)/src/overview_widget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/overview_widget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/overview_widget.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/overview_widget.Tpo $(DEPDIR)/overview_widget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/overview_widget.cpp' object='overview_widget.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o overview_widget.obj `if test -f '$(srcdir)/src/overview_widget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/overview_widget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/overview_widget.cpp'; fi`
-
-remote_control_widget.o: $(srcdir)/src/remote_control_widget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT remote_control_widget.o -MD -MP -MF $(DEPDIR)/remote_control_widget.Tpo -c -o remote_control_widget.o `test -f '$(srcdir)/src/remote_control_widget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/remote_control_widget.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/remote_control_widget.Tpo $(DEPDIR)/remote_control_widget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/remote_control_widget.cpp' object='remote_control_widget.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o remote_control_widget.o `test -f '$(srcdir)/src/remote_control_widget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/remote_control_widget.cpp
-
-remote_control_widget.obj: $(srcdir)/src/remote_control_widget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT remote_control_widget.obj -MD -MP -MF $(DEPDIR)/remote_control_widget.Tpo -c -o remote_control_widget.obj `if test -f '$(srcdir)/src/remote_control_widget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/remote_control_widget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/remote_control_widget.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/remote_control_widget.Tpo $(DEPDIR)/remote_control_widget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/remote_control_widget.cpp' object='remote_control_widget.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o remote_control_widget.obj `if test -f '$(srcdir)/src/remote_control_widget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/remote_control_widget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/remote_control_widget.cpp'; fi`
-
-snapshot_list.o: $(srcdir)/src/snapshot_list.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT snapshot_list.o -MD -MP -MF $(DEPDIR)/snapshot_list.Tpo -c -o snapshot_list.o `test -f '$(srcdir)/src/snapshot_list.cpp' || echo '$(srcdir)/'`$(srcdir)/src/snapshot_list.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/snapshot_list.Tpo $(DEPDIR)/snapshot_list.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/snapshot_list.cpp' object='snapshot_list.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o snapshot_list.o `test -f '$(srcdir)/src/snapshot_list.cpp' || echo '$(srcdir)/'`$(srcdir)/src/snapshot_list.cpp
-
-snapshot_list.obj: $(srcdir)/src/snapshot_list.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT snapshot_list.obj -MD -MP -MF $(DEPDIR)/snapshot_list.Tpo -c -o snapshot_list.obj `if test -f '$(srcdir)/src/snapshot_list.cpp'; then $(CYGPATH_W) '$(srcdir)/src/snapshot_list.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/snapshot_list.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/snapshot_list.Tpo $(DEPDIR)/snapshot_list.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/snapshot_list.cpp' object='snapshot_list.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o snapshot_list.obj `if test -f '$(srcdir)/src/snapshot_list.cpp'; then $(CYGPATH_W) '$(srcdir)/src/snapshot_list.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/snapshot_list.cpp'; fi`
-
-tool_button.o: $(srcdir)/src/tool_button.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tool_button.o -MD -MP -MF $(DEPDIR)/tool_button.Tpo -c -o tool_button.o `test -f '$(srcdir)/src/tool_button.cpp' || echo '$(srcdir)/'`$(srcdir)/src/tool_button.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/tool_button.Tpo $(DEPDIR)/tool_button.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/tool_button.cpp' object='tool_button.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tool_button.o `test -f '$(srcdir)/src/tool_button.cpp' || echo '$(srcdir)/'`$(srcdir)/src/tool_button.cpp
-
-tool_button.obj: $(srcdir)/src/tool_button.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tool_button.obj -MD -MP -MF $(DEPDIR)/tool_button.Tpo -c -o tool_button.obj `if test -f '$(srcdir)/src/tool_button.cpp'; then $(CYGPATH_W) '$(srcdir)/src/tool_button.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/tool_button.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/tool_button.Tpo $(DEPDIR)/tool_button.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/tool_button.cpp' object='tool_button.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tool_button.obj `if test -f '$(srcdir)/src/tool_button.cpp'; then $(CYGPATH_W) '$(srcdir)/src/tool_button.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/tool_button.cpp'; fi`
-
-italc_qrc.o: $(srcdir)/italc_qrc.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT italc_qrc.o -MD -MP -MF $(DEPDIR)/italc_qrc.Tpo -c -o italc_qrc.o `test -f '$(srcdir)/italc_qrc.cpp' || echo '$(srcdir)/'`$(srcdir)/italc_qrc.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/italc_qrc.Tpo $(DEPDIR)/italc_qrc.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/italc_qrc.cpp' object='italc_qrc.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o italc_qrc.o `test -f '$(srcdir)/italc_qrc.cpp' || echo '$(srcdir)/'`$(srcdir)/italc_qrc.cpp
-
-italc_qrc.obj: $(srcdir)/italc_qrc.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT italc_qrc.obj -MD -MP -MF $(DEPDIR)/italc_qrc.Tpo -c -o italc_qrc.obj `if test -f '$(srcdir)/italc_qrc.cpp'; then $(CYGPATH_W) '$(srcdir)/italc_qrc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/italc_qrc.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/italc_qrc.Tpo $(DEPDIR)/italc_qrc.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/italc_qrc.cpp' object='italc_qrc.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o italc_qrc.obj `if test -f '$(srcdir)/italc_qrc.cpp'; then $(CYGPATH_W) '$(srcdir)/italc_qrc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/italc_qrc.cpp'; fi`
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-install-man1: $(man_MANS)
-	@$(NORMAL_INSTALL)
-	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list=''; test -n "$(man1dir)" || exit 0; \
-	{ for i in $$list; do echo "$$i"; done; \
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.1[a-z]*$$/p'; \
-	} | while read p; do \
-	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; echo "$$p"; \
-	done | \
-	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
-	sed 'N;N;s,\n, ,g' | { \
-	list=; while read file base inst; do \
-	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
-	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
-	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
-	  fi; \
-	done; \
-	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
-	while read files; do \
-	  test -z "$$files" || { \
-	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
-	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
-	done; }
-
-uninstall-man1:
-	@$(NORMAL_UNINSTALL)
-	@list=''; test -n "$(man1dir)" || exit 0; \
-	files=`{ for i in $$list; do echo "$$i"; done; \
-	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.1[a-z]*$$/p'; \
-	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
-	test -z "$$files" || { \
-	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
-	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
-install-applicationsDATA: $(applications_DATA)
-	@$(NORMAL_INSTALL)
-	test -z "$(applicationsdir)" || $(MKDIR_P) "$(DESTDIR)$(applicationsdir)"
-	@list='$(applications_DATA)'; test -n "$(applicationsdir)" || list=; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(applicationsdir)'"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(applicationsdir)" || exit $$?; \
-	done
-
-uninstall-applicationsDATA:
-	@$(NORMAL_UNINSTALL)
-	@list='$(applications_DATA)'; test -n "$(applicationsdir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(applicationsdir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(applicationsdir)" && rm -f $$files
-install-iconsDATA: $(icons_DATA)
-	@$(NORMAL_INSTALL)
-	test -z "$(iconsdir)" || $(MKDIR_P) "$(DESTDIR)$(iconsdir)"
-	@list='$(icons_DATA)'; test -n "$(iconsdir)" || list=; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(iconsdir)'"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(iconsdir)" || exit $$?; \
-	done
-
-uninstall-iconsDATA:
-	@$(NORMAL_UNINSTALL)
-	@list='$(icons_DATA)'; test -n "$(iconsdir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(iconsdir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(iconsdir)" && rm -f $$files
-install-menuDATA: $(menu_DATA)
-	@$(NORMAL_INSTALL)
-	test -z "$(menudir)" || $(MKDIR_P) "$(DESTDIR)$(menudir)"
-	@list='$(menu_DATA)'; test -n "$(menudir)" || list=; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(menudir)'"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(menudir)" || exit $$?; \
-	done
-
-uninstall-menuDATA:
-	@$(NORMAL_UNINSTALL)
-	@list='$(menu_DATA)'; test -n "$(menudir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(menudir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(menudir)" && rm -f $$files
-install-pixmapsDATA: $(pixmaps_DATA)
-	@$(NORMAL_INSTALL)
-	test -z "$(pixmapsdir)" || $(MKDIR_P) "$(DESTDIR)$(pixmapsdir)"
-	@list='$(pixmaps_DATA)'; test -n "$(pixmapsdir)" || list=; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(am__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pixmapsdir)'"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pixmapsdir)" || exit $$?; \
-	done
-
-uninstall-pixmapsDATA:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pixmaps_DATA)'; test -n "$(pixmapsdir)" || list=; \
-	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	test -n "$$files" || exit 0; \
-	echo " ( cd '$(DESTDIR)$(pixmapsdir)' && rm -f" $$files ")"; \
-	cd "$(DESTDIR)$(pixmapsdir)" && rm -f $$files
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@list='$(MANS)'; if test -n "$$list"; then \
-	  list=`for p in $$list; do \
-	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
-	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
-	  if test -n "$$list" && \
-	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
-	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
-	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
-	    exit 1; \
-	  else :; fi; \
-	else :; fi
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(PROGRAMS) $(MANS) $(DATA)
-installdirs:
-	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(applicationsdir)" "$(DESTDIR)$(iconsdir)" "$(DESTDIR)$(menudir)" "$(DESTDIR)$(pixmapsdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-applicationsDATA install-iconsDATA \
-	install-man install-menuDATA install-pixmapsDATA
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man1
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-applicationsDATA uninstall-binPROGRAMS \
-	uninstall-iconsDATA uninstall-man uninstall-menuDATA \
-	uninstall-pixmapsDATA
-
-uninstall-man: uninstall-man1
-
-.MAKE: all check install install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic clean-libtool ctags distclean distclean-compile \
-	distclean-generic distclean-libtool distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-applicationsDATA install-binPROGRAMS install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-iconsDATA \
-	install-info install-info-am install-man install-man1 \
-	install-menuDATA install-pdf install-pdf-am \
-	install-pixmapsDATA install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am uninstall-applicationsDATA \
-	uninstall-binPROGRAMS uninstall-iconsDATA uninstall-man \
-	uninstall-man1 uninstall-menuDATA uninstall-pixmapsDATA
-
-
-%.moc: $(srcdir)/%.h
-	$(MOC) -o $@ $<
-
-%.uic: %.ui
-	$(UIC) -o $@ $<
-
-./italc_qrc.cpp: italc.qrc
-	$(RCC) $< > $@
-
- at BUILD_WIN32_TRUE@italc_win_resources.o: italc.rc
- at BUILD_WIN32_TRUE@	$(WINDRES) -o $@ $<
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/ima/dialogs/ClientSettingsDialog.ui b/ima/dialogs/ClientSettingsDialog.ui
new file mode 100644
index 0000000..e941c53
--- /dev/null
+++ b/ima/dialogs/ClientSettingsDialog.ui
@@ -0,0 +1,250 @@
+<?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 specifying an optional port-number)</p></body></html></string>
+       </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></string>
+       </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></html></string>
+       </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
new file mode 100644
index 0000000..e800916
--- /dev/null
+++ b/ima/dialogs/Config.ui
@@ -0,0 +1,572 @@
+<?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 network-traffic and lower CPU-usage on this computer.</p></body></html></string>
+         </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-cursor over toolbar-buttons.</p></body></html></string>
+         </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>
+    </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 changes won't take effect until you restart iTALC.</span></p></body></html></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="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
index bc053c1..b90e157 100644
--- a/ima/dialogs/MainWindow.ui
+++ b/ima/dialogs/MainWindow.ui
@@ -14,8 +14,8 @@
    <string>MainWindow</string>
   </property>
   <property name="windowIcon">
-   <iconset resource="../italc.qrc">
-    <normaloff>:/resources/logo.png</normaloff>:/resources/logo.png</iconset>
+   <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">
@@ -84,6 +84,7 @@
  </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
new file mode 100644
index 0000000..f2c6d46
--- /dev/null
+++ b/ima/dialogs/Overview.ui
@@ -0,0 +1,214 @@
+<?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
new file mode 100644
index 0000000..01bbaf2
--- /dev/null
+++ b/ima/dialogs/RemoteLogonDialog.ui
@@ -0,0 +1,188 @@
+<?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
new file mode 100644
index 0000000..3d8aa97
--- /dev/null
+++ b/ima/dialogs/RunCommandsDialog.ui
@@ -0,0 +1,127 @@
+<?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
new file mode 100644
index 0000000..d0a8d0c
--- /dev/null
+++ b/ima/dialogs/Snapshots.ui
@@ -0,0 +1,156 @@
+<?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
new file mode 100644
index 0000000..52168e4
--- /dev/null
+++ b/ima/dialogs/SupportDialog.ui
@@ -0,0 +1,136 @@
+<?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
new file mode 100644
index 0000000..8e5a617
--- /dev/null
+++ b/ima/dialogs/TextMessageDialog.ui
@@ -0,0 +1,127 @@
+<?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/dialogs/about.ui b/ima/dialogs/about.ui
deleted file mode 100644
index 6f92d66..0000000
--- a/ima/dialogs/about.ui
+++ /dev/null
@@ -1,230 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>about</class>
- <widget class="QDialog" name="about">
-  <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="../italc.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="text">
-        <string/>
-       </property>
-       <property name="pixmap">
-        <pixmap resource="../italc.qrc">:/resources/logo.png</pixmap>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_2">
-       <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:20pt; font-weight:600; font-style:italic;">About iTALC</span></p></body></html></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>
-    <widget class="QTabWidget" name="tabWidget">
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="tab">
-      <attribute name="icon">
-       <iconset resource="../italc.qrc">
-        <normaloff>:/resources/info_22.png</normaloff>:/resources/info_22.png</iconset>
-      </attribute>
-      <attribute name="title">
-       <string>About</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="QLabel" name="label_3">
-         <property name="text">
-          <string>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_2">
-      <attribute name="icon">
-       <iconset resource="../italc.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="QTextBrowser" name="authors"/>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_3">
-      <attribute name="icon">
-       <iconset resource="../italc.qrc">
-        <normaloff>:/resources/locale.png</normaloff>:/resources/locale.png</iconset>
-      </attribute>
-      <attribute name="title">
-       <string>Translation</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="QTextBrowser" name="textBrowser_3">
-         <property name="html">
-          <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></string>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_4">
-      <attribute name="icon">
-       <iconset resource="../italc.qrc">
-        <normaloff>:/resources/license.png</normaloff>:/resources/license.png</iconset>
-      </attribute>
-      <attribute name="title">
-       <string>License</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="QTextBrowser" name="license"/>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </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="sizeHint" stdset="0">
-        <size>
-         <width>131</width>
-         <height>31</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="okButton">
-       <property name="text">
-        <string>OK</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../italc.qrc">
-         <normaloff>:/resources/apply.png</normaloff>:/resources/apply.png</iconset>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>okButton</sender>
-   <signal>clicked()</signal>
-   <receiver>about</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>278</x>
-     <y>253</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>96</x>
-     <y>254</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/ima/dialogs/client_settings.ui b/ima/dialogs/client_settings.ui
deleted file mode 100644
index 1c25e70..0000000
--- a/ima/dialogs/client_settings.ui
+++ /dev/null
@@ -1,609 +0,0 @@
-<ui version="4.0" >
- <author>Tobias Doerffel</author>
- <class>clientSettings</class>
- <widget class="QDialog" name="clientSettings" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>388</width>
-    <height>358</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>Client settings</string>
-  </property>
-  <property name="windowIcon" >
-   <iconset resource="../italc.qrc" >:/resources/client_settings.png</iconset>
-  </property>
-  <property name="modal" >
-   <bool>true</bool>
-  </property>
-  <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>9</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>20</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label" >
-       <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>1</hsizetype>
-         <vsizetype>1</vsizetype>
-         <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="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:20pt; font-weight:600; font-style:italic;">Client settings</span></p></body></html></string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>20</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>370</width>
-       <height>16</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item>
-    <widget class="QTabWidget" name="settingsTabWidget" >
-     <property name="tabShape" >
-      <enum>QTabWidget::Rounded</enum>
-     </property>
-     <property name="currentIndex" >
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="tab" >
-      <attribute name="title" >
-       <string>General</string>
-      </attribute>
-      <attribute name="icon" >
-       <iconset resource="../italc.qrc" >:/resources/config.png</iconset>
-      </attribute>
-      <layout class="QGridLayout" >
-       <property name="margin" >
-        <number>9</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <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="2" >
-        <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>
-       <item row="3" column="2" >
-        <widget class="QComboBox" name="classRoomComboBox" />
-       </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="0" column="1" >
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType" >
-          <enum>QSizePolicy::Fixed</enum>
-         </property>
-         <property name="sizeHint" >
-          <size>
-           <width>16</width>
-           <height>1</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item row="2" column="0" >
-        <widget class="QLabel" name="label_5" >
-         <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>5</hsizetype>
-           <vsizetype>5</vsizetype>
-           <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="0" column="2" >
-        <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 specifying an optional port-number)</p></body></html></string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="0" >
-        <widget class="QLabel" name="label_4" >
-         <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>5</hsizetype>
-           <vsizetype>5</vsizetype>
-           <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="2" column="2" >
-        <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></html></string>
-         </property>
-        </widget>
-       </item>
-       <item row="1" column="0" >
-        <widget class="QLabel" name="label_3" >
-         <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>5</hsizetype>
-           <vsizetype>5</vsizetype>
-           <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="2" >
-        <widget class="QLineEdit" name="nameEdit" >
-         <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>7</hsizetype>
-           <vsizetype>0</vsizetype>
-           <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></string>
-         </property>
-        </widget>
-       </item>
-       <item rowspan="5" row="0" column="3" >
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType" >
-          <enum>QSizePolicy::Preferred</enum>
-         </property>
-         <property name="sizeHint" >
-          <size>
-           <width>20</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_2" >
-      <attribute name="title" >
-       <string>VPN</string>
-      </attribute>
-      <attribute name="icon" >
-       <iconset resource="../italc.qrc" >:/resources/vpn.png</iconset>
-      </attribute>
-      <layout class="QHBoxLayout" >
-       <property name="margin" >
-        <number>9</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
-       </property>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="margin" >
-          <number>0</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
-         <item>
-          <layout class="QHBoxLayout" >
-           <property name="margin" >
-            <number>0</number>
-           </property>
-           <property name="spacing" >
-            <number>6</number>
-           </property>
-           <item>
-            <widget class="QLabel" name="label_6" >
-             <property name="text" >
-              <string>Connection</string>
-             </property>
-             <property name="textFormat" >
-              <enum>Qt::PlainText</enum>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation" >
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeType" >
-              <enum>QSizePolicy::Fixed</enum>
-             </property>
-             <property name="sizeHint" >
-              <size>
-               <width>20</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <widget class="QComboBox" name="connectionComboBox" >
-             <property name="enabled" >
-              <bool>false</bool>
-             </property>
-             <property name="sizePolicy" >
-              <sizepolicy>
-               <hsizetype>5</hsizetype>
-               <vsizetype>0</vsizetype>
-               <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;">connection to hosts on the same level</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;">Here you can specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</p></body></html></string>
-             </property>
-             <property name="iconSize" >
-              <size>
-               <width>22</width>
-               <height>22</height>
-              </size>
-             </property>
-             <item>
-              <property name="text" >
-               <string>Analog</string>
-              </property>
-              <property name="icon" >
-               <iconset resource="../italc.qrc" >:/resources/analog.png</iconset>
-              </property>
-             </item>
-             <item>
-              <property name="text" >
-               <string>ISDN</string>
-              </property>
-              <property name="icon" >
-               <iconset resource="../italc.qrc" >:/resources/isdn.png</iconset>
-              </property>
-             </item>
-             <item>
-              <property name="text" >
-               <string>DSL / 400 KBit/s</string>
-              </property>
-              <property name="icon" >
-               <iconset resource="../italc.qrc" >:/resources/modem.png</iconset>
-              </property>
-             </item>
-             <item>
-              <property name="text" >
-               <string>DSL / 2000 KBit/s</string>
-              </property>
-              <property name="icon" >
-               <iconset resource="../italc.qrc" >:/resources/modem.png</iconset>
-              </property>
-             </item>
-             <item>
-              <property name="text" >
-               <string>100 MBit/s LAN</string>
-              </property>
-              <property name="icon" >
-               <iconset resource="../italc.qrc" >:/resources/lan.png</iconset>
-              </property>
-             </item>
-             <item>
-              <property name="text" >
-               <string>1000 MBit/s LAN</string>
-              </property>
-              <property name="icon" >
-               <iconset resource="../italc.qrc" >:/resources/lan.png</iconset>
-              </property>
-             </item>
-            </widget>
-           </item>
-           <item>
-            <spacer>
-             <property name="orientation" >
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeType" >
-              <enum>QSizePolicy::Expanding</enum>
-             </property>
-             <property name="sizeHint" >
-              <size>
-               <width>20</width>
-               <height>29</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-         <item>
-          <widget class="QCheckBox" name="hostIsGateway" >
-           <property name="enabled" >
-            <bool>false</bool>
-           </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;">Check if the host is the gateway for the subnet.</p></body></html></string>
-           </property>
-           <property name="text" >
-            <string>Host is &gateway for subnet</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QCheckBox" name="actAsDemoReplicator" >
-           <property name="enabled" >
-            <bool>false</bool>
-           </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;">Activate this option for at least one host in a subnet.</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</p></body></html></string>
-           </property>
-           <property name="text" >
-            <string>Act as &demo replicator</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer>
-           <property name="orientation" >
-            <enum>Qt::Vertical</enum>
-           </property>
-           <property name="sizeHint" >
-            <size>
-             <width>286</width>
-             <height>17</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-   <item>
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>21</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>10</width>
-         <height>31</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="okButton" >
-       <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>1</hsizetype>
-         <vsizetype>0</vsizetype>
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="layoutDirection" >
-        <enum>Qt::LeftToRight</enum>
-       </property>
-       <property name="text" >
-        <string>&OK</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../italc.qrc" >:/resources/apply.png</iconset>
-       </property>
-       <property name="autoDefault" >
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="cancelButton" >
-       <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>1</hsizetype>
-         <vsizetype>0</vsizetype>
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text" >
-        <string>C&ancel</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../italc.qrc" >:/resources/cancel.png</iconset>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <tabstops>
-  <tabstop>hostnameEdit</tabstop>
-  <tabstop>nameEdit</tabstop>
-  <tabstop>macEdit</tabstop>
-  <tabstop>classRoomComboBox</tabstop>
-  <tabstop>settingsTabWidget</tabstop>
-  <tabstop>connectionComboBox</tabstop>
-  <tabstop>hostIsGateway</tabstop>
-  <tabstop>actAsDemoReplicator</tabstop>
-  <tabstop>okButton</tabstop>
-  <tabstop>cancelButton</tabstop>
- </tabstops>
- <resources>
-  <include location="../italc.qrc" />
- </resources>
- <connections>
-  <connection>
-   <sender>okButton</sender>
-   <signal>clicked()</signal>
-   <receiver>clientSettings</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>278</x>
-     <y>253</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>96</x>
-     <y>254</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>cancelButton</sender>
-   <signal>clicked()</signal>
-   <receiver>clientSettings</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>369</x>
-     <y>253</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>179</x>
-     <y>282</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/ima/dialogs/config.ui b/ima/dialogs/config.ui
deleted file mode 100644
index bb05679..0000000
--- a/ima/dialogs/config.ui
+++ /dev/null
@@ -1,677 +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="QSpinBox" 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 network-traffic and lower CPU-usage on this computer.</p></body></html></string>
-         </property>
-         <property name="specialValueText">
-          <string>1 second</string>
-         </property>
-         <property name="suffix">
-          <string> seconds</string>
-         </property>
-         <property name="prefix">
-          <string/>
-         </property>
-         <property name="minimum">
-          <number>1</number>
-         </property>
-         <property name="maximum">
-          <number>30</number>
-         </property>
-         <property name="value">
-          <number>2</number>
-         </property>
-        </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_9">
-         <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/demoquality.png</pixmap>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLabel" name="label_14">
-         <property name="text">
-          <string>Quality of demo-mode</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="QComboBox" name="demoQualityCB">
-         <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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</p></body></html></string>
-         </property>
-         <item>
-          <property name="text">
-           <string>Low (15 bit)</string>
-          </property>
-          <property name="icon">
-           <iconset resource="../italc.qrc">
-            <normaloff>:/resources/low.png</normaloff>:/resources/low.png</iconset>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>Medium (18 bit)</string>
-          </property>
-          <property name="icon">
-           <iconset resource="../italc.qrc">
-            <normaloff>:/resources/medium.png</normaloff>:/resources/medium.png</iconset>
-          </property>
-         </item>
-         <item>
-          <property name="text">
-           <string>High (Truecolor)</string>
-          </property>
-          <property name="icon">
-           <iconset resource="../italc.qrc">
-            <normaloff>:/resources/high.png</normaloff>:/resources/high.png</iconset>
-          </property>
-         </item>
-        </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-cursor over toolbar-buttons.</p></body></html></string>
-         </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>
-    </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="../italc.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 changes won't take effect until you restart iTALC.</span></p></body></html></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="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>40</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/ima/dialogs/overview.ui b/ima/dialogs/overview.ui
deleted file mode 100644
index 5bf6f14..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/remote_logon.ui b/ima/dialogs/remote_logon.ui
deleted file mode 100644
index dd78109..0000000
--- a/ima/dialogs/remote_logon.ui
+++ /dev/null
@@ -1,270 +0,0 @@
-<ui version="4.0" >
- <class>remoteLogon</class>
- <widget class="QDialog" name="remoteLogon" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>303</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>Remote Logon</string>
-  </property>
-  <property name="windowIcon" >
-   <iconset resource="../italc.qrc" >:/resources/remotelogon_48.png</iconset>
-  </property>
-  <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>9</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label" >
-       <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="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:20pt; font-weight:600; font-style:italic;">Remote Logon</span></p></body></html></string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QLabel" name="label_3" >
-     <property name="sizePolicy" >
-      <sizepolicy>
-       <hsizetype>5</hsizetype>
-       <vsizetype>3</vsizetype>
-       <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="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item row="0" column="1" >
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeType" >
-        <enum>QSizePolicy::Fixed</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>20</width>
-         <height>1</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item row="0" column="2" >
-      <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="2" >
-      <widget class="QLineEdit" name="domainEdit" />
-     </item>
-     <item row="1" column="2" >
-      <widget class="QLineEdit" name="passwordEdit" >
-       <property name="echoMode" >
-        <enum>QLineEdit::Password</enum>
-       </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" >
-      <size>
-       <width>370</width>
-       <height>16</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item>
-    <widget class="Line" name="line" >
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>131</width>
-         <height>31</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="okButton" >
-       <property name="text" >
-        <string>&OK</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../italc.qrc" >:/resources/apply.png</iconset>
-       </property>
-       <property name="shortcut" >
-        <string>Ctrl+Enter</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="cancelButton" >
-       <property name="text" >
-        <string>Cancel</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../italc.qrc" >:/resources/cancel.png</iconset>
-       </property>
-       <property name="shortcut" >
-        <string>Esc</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <tabstops>
-  <tabstop>userNameEdit</tabstop>
-  <tabstop>passwordEdit</tabstop>
-  <tabstop>domainEdit</tabstop>
-  <tabstop>okButton</tabstop>
-  <tabstop>cancelButton</tabstop>
- </tabstops>
- <resources>
-  <include location="../italc.qrc" />
- </resources>
- <connections>
-  <connection>
-   <sender>cancelButton</sender>
-   <signal>clicked()</signal>
-   <receiver>remoteLogon</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>323</x>
-     <y>266</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>199</x>
-     <y>149</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>okButton</sender>
-   <signal>clicked()</signal>
-   <receiver>remoteLogon</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>258</x>
-     <y>266</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>199</x>
-     <y>149</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/ima/dialogs/snapshots.ui b/ima/dialogs/snapshots.ui
deleted file mode 100644
index a5d1f5d..0000000
--- a/ima/dialogs/snapshots.ui
+++ /dev/null
@@ -1,135 +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">
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <item>
-    <widget class="QListWidget" 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"/>
-   </item>
-   <item>
-    <layout class="QGridLayout">
-     <property name="margin">
-      <number>10</number>
-     </property>
-     <property name="spacing">
-      <number>4</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="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="text">
-        <string>Host:</string>
-       </property>
-      </widget>
-     </item>
-     <item row="1" column="0">
-      <widget class="QLabel" name="dateDescLbl">
-       <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="text">
-        <string>Time:</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QPushButton" name="showBtn">
-     <property name="text">
-      <string>Show snapshot</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 snapshot</string>
-     </property>
-     <property name="icon">
-      <iconset resource="../italc.qrc">
-       <normaloff>:/resources/cancel.png</normaloff>:/resources/cancel.png</iconset>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QPushButton" name="reloadBtn">
-     <property name="text">
-      <string>Reload list</string>
-     </property>
-     <property name="icon">
-      <iconset resource="../italc.qrc">
-       <normaloff>:/resources/reload.png</normaloff>:/resources/reload.png</iconset>
-     </property>
-    </widget>
-   </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>30</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/ima/dialogs/support.ui b/ima/dialogs/support.ui
deleted file mode 100644
index dc5987a..0000000
--- a/ima/dialogs/support.ui
+++ /dev/null
@@ -1,194 +0,0 @@
-<ui version="4.0" >
- <class>support</class>
- <widget class="QDialog" name="support" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>260</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>Support</string>
-  </property>
-  <property name="windowIcon" >
-   <iconset resource="../italc.qrc" >:/resources/remote_control_48.png</iconset>
-  </property>
-  <property name="modal" >
-   <bool>true</bool>
-  </property>
-  <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>15</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label" >
-       <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="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:20pt; font-weight:600; font-style:italic;">Support </span></p></body></html></string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QLabel" name="label_3" >
-     <property name="sizePolicy" >
-      <sizepolicy>
-       <hsizetype>3</hsizetype>
-       <vsizetype>3</vsizetype>
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
-     </property>
-     <property name="text" >
-      <string>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</string>
-     </property>
-     <property name="wordWrap" >
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <widget class="QLineEdit" name="hostEdit" />
-   </item>
-   <item>
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>370</width>
-       <height>16</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item>
-    <widget class="Line" name="line" >
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>131</width>
-         <height>31</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="okButton" >
-       <property name="text" >
-        <string>OK</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../italc.qrc" >:/resources/apply.png</iconset>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="cancelButton" >
-       <property name="text" >
-        <string>Cancel</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../italc.qrc" >:/resources/cancel.png</iconset>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc" />
- </resources>
- <connections>
-  <connection>
-   <sender>okButton</sender>
-   <signal>clicked()</signal>
-   <receiver>support</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>278</x>
-     <y>253</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>96</x>
-     <y>254</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>cancelButton</sender>
-   <signal>clicked()</signal>
-   <receiver>support</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>369</x>
-     <y>253</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>179</x>
-     <y>282</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/ima/dialogs/text_message.ui b/ima/dialogs/text_message.ui
deleted file mode 100644
index 3a7fb52..0000000
--- a/ima/dialogs/text_message.ui
+++ /dev/null
@@ -1,189 +0,0 @@
-<ui version="4.0" >
- <class>textMessage</class>
- <widget class="QDialog" name="textMessage" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>413</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string>Send text message</string>
-  </property>
-  <property name="windowIcon" >
-   <iconset resource="../italc.qrc" >:/resources/text_message_48.png</iconset>
-  </property>
-  <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>15</number>
-   </property>
-   <property name="spacing" >
-    <number>15</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="label" >
-       <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="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:20pt; font-weight:600; font-style:italic;">Send text message</span></p></body></html></string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </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>
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Fixed</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>20</width>
-       <height>10</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item>
-    <widget class="Line" name="line" >
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>131</width>
-         <height>31</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QPushButton" name="okButton" >
-       <property name="text" >
-        <string>&OK</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../italc.qrc" >:/resources/apply.png</iconset>
-       </property>
-       <property name="shortcut" >
-        <string>Ctrl+Enter</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="cancelButton" >
-       <property name="text" >
-        <string>Cancel</string>
-       </property>
-       <property name="icon" >
-        <iconset resource="../italc.qrc" >:/resources/cancel.png</iconset>
-       </property>
-       <property name="shortcut" >
-        <string>Esc</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../italc.qrc" />
- </resources>
- <connections>
-  <connection>
-   <sender>okButton</sender>
-   <signal>clicked()</signal>
-   <receiver>textMessage</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>278</x>
-     <y>253</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>96</x>
-     <y>254</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>cancelButton</sender>
-   <signal>clicked()</signal>
-   <receiver>textMessage</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>369</x>
-     <y>253</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>179</x>
-     <y>282</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/ima/italc.1 b/ima/italc.1
index 215492a..4c2133b 100644
--- a/ima/italc.1
+++ b/ima/italc.1
@@ -14,11 +14,11 @@ is the actual software to control iTALC-clients. Using it's GUI you can remote-c
 .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 (5900).
+Directly remote-control the specified host. You can omit port if the server is running at the default-port (11100).
 .
 .IP "\fB\-isdport\fP \fIport\fP
 .IP
-Set port to which iTALC should connect in order to contact the local iTALC-service-daemon. Default: 5800
+Set port to which iTALC should connect in order to contact the local iTALC-service-daemon. Default: 11200
 .
 .IP "\fB\-isdhost\fP \fIip\fP
 .IP
diff --git a/ima/italc.qrc b/ima/italc.qrc
index 7275c8a..4227448 100644
--- a/ima/italc.qrc
+++ b/ima/italc.qrc
@@ -1,14 +1,9 @@
 <RCC>
     <qresource prefix="/" >
-        <file>../AUTHORS</file>
-        <file>../COPYING</file>
 	<file>resources/no_mouse.png</file>
 	<file>resources/fullscreen.png</file>
 	<file>resources/quit.png</file>
         <file>resources/adjust_size.png</file>
-        <file>resources/analog.png</file>
-        <file>resources/apply.png</file>
-        <file>resources/authors.png</file>
         <file>resources/auto_arrange.png</file>
         <file>resources/back.png</file>
         <file>resources/cancel.png</file>
@@ -28,36 +23,25 @@
         <file>resources/clock.png</file>
         <file>resources/config.png</file>
         <file>resources/config_48.png</file>
-        <file>resources/demoquality.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/high.png</file>
         <file>resources/host_unreachable.png</file>
         <file>resources/info.png</file>
         <file>resources/info_22.png</file>
-        <file>resources/isdn.png</file>
-        <file>resources/lan.png</file>
-        <file>resources/license.png</file>
-        <file>resources/locale.png</file>
         <file>resources/locked.png</file>
         <file>resources/logout.png</file>
-        <file>resources/low.png</file>
-        <file>resources/medium.png</file>
-        <file>resources/modem.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/ok.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/reload.png</file>
         <file>resources/remote_control.png</file>
         <file>resources/remote_control_48.png</file>
         <file>resources/run.png</file>
@@ -75,9 +59,7 @@
         <file>resources/users.png</file>
         <file>resources/users_48.png</file>
         <file>resources/viewmag.png</file>
-        <file>resources/vpn.png</file>
         <file>resources/window_demo.png</file>
-        <file>resources/logo.png</file>
         <file>resources/greenled.png</file>
         <file>resources/toolbar-background.png</file>
     </qresource>
diff --git a/ima/italc.rc b/ima/italc.rc
new file mode 100644
index 0000000..8397877
--- /dev/null
+++ b/ima/italc.rc
@@ -0,0 +1,26 @@
+italcicon ICON data/italc.ico
+#include <windows.h>
+
+VS_VERSION_INFO	VERSIONINFO
+  FILEVERSION	2,0,0,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-2011 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
index 7afe1d1..70e15a7 100644
--- a/ima/italc.rc.in
+++ b/ima/italc.rc.in
@@ -2,7 +2,7 @@ italcicon ICON data/italc.ico
 #include <windows.h>
 
 VS_VERSION_INFO	VERSIONINFO
-  FILEVERSION	1,0,13,0
+  FILEVERSION	2,0,0,0
   FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
   FILEOS	VOS_NT_WINDOWS32
   FILETYPE	VFT_APP
diff --git a/ima/resources/analog.png b/ima/resources/analog.png
deleted file mode 100644
index fef6567..0000000
Binary files a/ima/resources/analog.png and /dev/null differ
diff --git a/ima/resources/apply.png b/ima/resources/apply.png
deleted file mode 100644
index fc14e54..0000000
Binary files a/ima/resources/apply.png and /dev/null differ
diff --git a/ima/resources/demoquality.png b/ima/resources/demoquality.png
deleted file mode 100644
index b9b462b..0000000
Binary files a/ima/resources/demoquality.png and /dev/null differ
diff --git a/ima/resources/high.png b/ima/resources/high.png
deleted file mode 100644
index 797c54e..0000000
Binary files a/ima/resources/high.png and /dev/null differ
diff --git a/ima/resources/isdn.png b/ima/resources/isdn.png
deleted file mode 100644
index 73b3cba..0000000
Binary files a/ima/resources/isdn.png and /dev/null differ
diff --git a/ima/resources/lan.png b/ima/resources/lan.png
deleted file mode 100644
index 6acc774..0000000
Binary files a/ima/resources/lan.png and /dev/null differ
diff --git a/ima/resources/low.png b/ima/resources/low.png
deleted file mode 100644
index 7ed48d4..0000000
Binary files a/ima/resources/low.png and /dev/null differ
diff --git a/ima/resources/medium.png b/ima/resources/medium.png
deleted file mode 100644
index 8aa5683..0000000
Binary files a/ima/resources/medium.png and /dev/null differ
diff --git a/ima/resources/modem.png b/ima/resources/modem.png
deleted file mode 100644
index 4d185c0..0000000
Binary files a/ima/resources/modem.png and /dev/null differ
diff --git a/ima/resources/ok.png b/ima/resources/ok.png
deleted file mode 100644
index 4f75346..0000000
Binary files a/ima/resources/ok.png and /dev/null differ
diff --git a/ima/resources/reload.png b/ima/resources/reload.png
deleted file mode 100644
index 62fc026..0000000
Binary files a/ima/resources/reload.png and /dev/null differ
diff --git a/ima/resources/splash.png b/ima/resources/splash.png
index 644d494..6c2670f 100644
Binary files a/ima/resources/splash.png and b/ima/resources/splash.png differ
diff --git a/ima/resources/vpn.png b/ima/resources/vpn.png
deleted file mode 100644
index a33c613..0000000
Binary files a/ima/resources/vpn.png and /dev/null differ
diff --git a/ima/resources/fullscreen.png b/ima/resources/window.png
similarity index 100%
copy from ima/resources/fullscreen.png
copy to ima/resources/window.png
diff --git a/ima/src/ClassroomManager.cpp b/ima/src/ClassroomManager.cpp
new file mode 100644
index 0000000..2956fa4
--- /dev/null
+++ b/ima/src/ClassroomManager.cpp
@@ -0,0 +1,2187 @@
+/*
+ * 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
new file mode 100644
index 0000000..62f0ccb
--- /dev/null
+++ b/ima/src/ClassroomManager.h
@@ -0,0 +1,347 @@
+/*
+* 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
new file mode 100644
index 0000000..e3303cb
--- /dev/null
+++ b/ima/src/Client.cpp
@@ -0,0 +1,1205 @@
+/*
+ * 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
new file mode 100644
index 0000000..fbaca1b
--- /dev/null
+++ b/ima/src/Client.h
@@ -0,0 +1,337 @@
+/*
+ * Client.h - declaration of class Client which represents a client, shows its
+ *            display and allows controlling it in several ways
+ *
+ * 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 _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
new file mode 100644
index 0000000..9c63814
--- /dev/null
+++ b/ima/src/ConfigWidget.cpp
@@ -0,0 +1,183 @@
+/*
+ * 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
new file mode 100644
index 0000000..9801fc3
--- /dev/null
+++ b/ima/src/ConfigWidget.h
@@ -0,0 +1,51 @@
+/*
+ * 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
new file mode 100644
index 0000000..eb3dca1
--- /dev/null
+++ b/ima/src/Dialogs.cpp
@@ -0,0 +1,244 @@
+/*
+ * Dialogs.cpp - implementation of dialogs
+ *
+ * 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/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, i = 0;
+
+#ifdef ITALC3
+	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
new file mode 100644
index 0000000..da08db9
--- /dev/null
+++ b/ima/src/Dialogs.h
@@ -0,0 +1,152 @@
+/*
+ * Dialogs.h - declaration of dialog classes
+ *
+ * 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 _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
index 625848d..95e084e 100644
--- a/ima/src/MainToolBar.cpp
+++ b/ima/src/MainToolBar.cpp
@@ -27,7 +27,6 @@
 #include <QtGui/QPaintEvent>
 
 #include "MainToolBar.h"
-#include "tool_button.h"
 
 
 
@@ -93,6 +92,3 @@ void MainToolBar::toggleButton( QAction * _a )
 
 
 
-#include "MainToolBar.moc"
-
-
diff --git a/ima/src/MainWindow.cpp b/ima/src/MainWindow.cpp
index 74350dd..77bd667 100644
--- a/ima/src/MainWindow.cpp
+++ b/ima/src/MainWindow.cpp
@@ -1,7 +1,7 @@
 /*
- * MainWindow.cpp - main file for iTALC Master Application
+ * MainWindow.cpp - implementation of MainWindow class
  *
- * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
+ * Copyright (c) 2004-2011 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
  *
  * This file is part of iTALC - http://italc.sourceforge.net
  *
@@ -22,10 +22,7 @@
  *
  */
 
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include <italcconfig.h>
 
 #include <QtCore/QDir>
 #include <QtCore/QDateTime>
@@ -45,39 +42,29 @@
 #include <QtNetwork/QHostAddress>
 
 #include "MainWindow.h"
-#include "classroom_manager.h"
-#include "dialogs.h"
-#include "overview_widget.h"
-#include "snapshot_list.h"
-#include "config_widget.h"
-#include "messagebox.h"
-#include "tool_button.h"
-#include "isd_connection.h"
-#include "local_system.h"
-#include "remote_control_widget.h"
-
-
-QSystemTrayIcon * __systray_icon = NULL;
-
-
-extern int __isd_port;
-extern QString __isd_host;
-
-
-bool MainWindow::ensureConfigPathExists( void )
-{
-	return( localSystem::ensurePathExists(
-					localSystem::personalConfigDir() ) );
-}
+#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"
 
 
-bool MainWindow::s_atExit = FALSE;
-
 
 MainWindow::MainWindow( int _rctrl_screen ) :
 	QMainWindow(/* 0, Qt::FramelessWindowHint*/ ),
+	m_systemTrayIcon( this ),
 	m_openedTabInSideBar( 1 ),
-	m_localISD( NULL ),
+	m_localICA( NULL ),
 	m_rctrlLock(),
 	m_remoteControlWidget( NULL ),
 	m_stopDemo( FALSE ),
@@ -89,19 +76,20 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 {
 	setupUi( this );
 
-	setWindowTitle( tr( "iTALC" ) + " " + VERSION );
+	setWindowTitle( tr( "iTALC" ) + " " + ITALC_VERSION );
 
-	if( MainWindow::ensureConfigPathExists() == FALSE )
+	if( LocalSystem::Path::ensurePathExists(
+						LocalSystem::Path::personalConfigDataPath() ) == false )
 	{
 		if( splashScreen != NULL )
 		{
 			splashScreen->hide();
 		}
-		messageBox::information( tr( "No write-access" ),
+		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::personalConfigDir() ) );
+					LocalSystem::Path::personalConfigDataPath() ) );
 		return;
 	}
 
@@ -114,10 +102,10 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 
 
 	// 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_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();
 
@@ -138,14 +126,14 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 
 
 
-	// configure the MainToolBar
+	// 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(
+	ToolButton * scr = new ToolButton(
 			QPixmap( ":/resources/classroom.png" ),
 			tr( "Classroom" ), QString::null,
 			tr( "Switch classroom" ),
@@ -153,7 +141,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 				"choose the active classroom." ),
 			NULL, NULL, m_toolBar );
 	scr->setMenu( m_classroomManager->quickSwitchMenu() );
-	scr->setPopupMode( toolButton::InstantPopup );
+	scr->setPopupMode( ToolButton::InstantPopup );
 	scr->setWhatsThis( tr( "Click on this button, to switch between "
 							"classrooms." ) );
 
@@ -164,7 +152,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 	a = new QAction( QIcon( ":/resources/overview_mode.png" ),
 						tr( "Overview mode" ), this );
 	m_sysTrayActions << a;
-	toolButton * overview_mode = new toolButton(
+	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 "
@@ -177,7 +165,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 	a = new QAction( QIcon( ":/resources/fullscreen_demo.png" ),
 						tr( "Fullscreen demo" ), this );
 	m_sysTrayActions << a;
-	toolButton * fsdemo_mode = new toolButton(
+	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 "
@@ -188,7 +176,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 	a = new QAction( QIcon( ":/resources/window_demo.png" ),
 						tr( "Window demo" ), this );
 	m_sysTrayActions << a;
-	toolButton * windemo_mode = new toolButton(
+	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 "
@@ -199,7 +187,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 	a = new QAction( QIcon( ":/resources/locked.png" ),
 					tr( "Lock/unlock desktops" ), this );
 	m_sysTrayActions << a;
-	toolButton * lock_mode = new toolButton(
+	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. "
@@ -212,10 +200,10 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 	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 );
+	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 );
 
@@ -224,7 +212,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 	a = new QAction( QIcon( ":/resources/text_message.png" ),
 					tr( "Send text message" ), this );
 //	m_sysTrayActions << a;
-	toolButton * text_msg = new toolButton(
+	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." ),
@@ -234,7 +222,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 	a = new QAction( QIcon( ":/resources/power_on.png" ),
 					tr( "Power on computers" ), this );
 	m_sysTrayActions << a;
-	toolButton * power_on = new toolButton(
+	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 "
@@ -245,7 +233,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 	a = new QAction( QIcon( ":/resources/power_off.png" ),
 					tr( "Power down computers" ), this );
 	m_sysTrayActions << a;
-	toolButton * power_off = new toolButton(
+	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 "
@@ -253,16 +241,16 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 			m_classroomManager,
 					SLOT( powerDownClients() ), m_toolBar );
 
-	toolButton * remotelogon = new toolButton(
+/*	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 );
+			m_classroomManager, SLOT( remoteLogon() ), m_toolBar );*/
 
-	toolButton * directsupport = new toolButton(
+	ToolButton * directsupport = new ToolButton(
 			QPixmap( ":/resources/remote_control.png" ),
 			tr( "Support" ), QString::null,
 			tr( "Direct support" ),
@@ -271,7 +259,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 				"the according hostname or IP afterwards." ),
 			m_classroomManager, SLOT( directSupport() ), m_toolBar );
 
-	toolButton * adjust_size = new toolButton(
+	ToolButton * adjust_size = new ToolButton(
 			QPixmap( ":/resources/adjust_size.png" ),
 			tr( "Adjust/align" ), QString::null,
 			tr( "Adjust windows and their size" ),
@@ -280,7 +268,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 				"Furthermore all windows are aligned." ),
 			m_classroomManager, SLOT( adjustWindows() ), m_toolBar );
 
-	toolButton * auto_arrange = new toolButton(
+	ToolButton * auto_arrange = new ToolButton(
 			QPixmap( ":/resources/auto_arrange.png" ),
 			tr( "Auto view" ), QString::null,
 			tr( "Auto re-arrange windows and their size" ),
@@ -300,7 +288,7 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 	text_msg->addTo( m_toolBar );
 	power_on->addTo( m_toolBar );
 	power_off->addTo( m_toolBar );
-	remotelogon->addTo( m_toolBar );
+	//remotelogon->addTo( m_toolBar );
 	directsupport->addTo( m_toolBar );
 	adjust_size->addTo( m_toolBar );
 	auto_arrange->addTo( m_toolBar );
@@ -325,58 +313,46 @@ MainWindow::MainWindow( int _rctrl_screen ) :
 		}
 	}
 
-	while( 1 )
+	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 ) )
 	{
-		if( isdConnection::initAuthentication() == FALSE )
+		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 )
 		{
-			if( __role != ISD::RoleTeacher )
-			{
-				__role = ISD::RoleTeacher;
-				continue;
-			}
-			if( splashScreen != NULL )
-			{
-				splashScreen->hide();
-			}
-			messageBox::information( tr( "No valid keys found" ),
-			tr( 	"No authentication-keys were found or your "
-				"old ones were broken. Please create a new "
-				"key-pair using ICA (see documentation at "
-		"http://italc.sf.net/wiki/index.php?title=Installation).\n"
-				"Otherwise you won't be able to access "
-						"computers using iTALC." ) );
+			return;
 		}
-		break;
 	}
-	m_localISD = new isdConnection( QHostAddress(
-				__isd_host ).toString() +
-					":" + QString::number( __isd_port ) );
-	if( m_localISD->open() != isdConnection::Connected )
-	{
-		messageBox::information( tr( "iTALC service not running" ),
-			tr( 	"There seems to be no iTALC service running "
-				"on this computer or the authentication-keys "
-				"aren't set up properly. The service is "
-				"required for running iTALC. Contact your "
-				"administrator for solving this problem." ),
-				QPixmap( ":/resources/stop.png" ) );
-		return;
-	}
-
-	m_localISD->demoServerRun( __demo_quality,
-						localSystem::freePort( 5858 ) );
 
+	// update the role under which ICA is running
+	m_localICA->setRole( ItalcCore::role );
+	m_localICA->startDemoServer( ItalcCore::config->coreServerPort(),
+									ItalcCore::config->demoServerPort() );
 
-	m_localISD->hideTrayIcon();
+//	##ITALC2: m_localISD->hideTrayIcon();
 
+	// setup system tray icon
 	QIcon icon( ":/resources/icon16.png" );
 	icon.addFile( ":/resources/icon22.png" );
 	icon.addFile( ":/resources/icon32.png" );
 
-	__systray_icon = new QSystemTrayIcon( icon, this );
-	__systray_icon->setToolTip( tr( "iTALC Master Control" ) );
-	__systray_icon->show();
-	connect( __systray_icon, SIGNAL( activated(
+	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 ) ) );
@@ -394,27 +370,49 @@ MainWindow::~MainWindow()
 {
 	m_classroomManager->doCleanupWork();
 
-#ifdef BUILD_WIN32
-	qApp->processEvents( QEventLoop::AllEvents, 3000 );
-	localSystem::sleep( 3000 );
-#endif
-
 	// also delets clients
 	delete m_workspace;
 
-	m_localISD->gracefulClose();
+	m_localICA->stopDemoServer();
+
+	delete m_localICA;
+	m_localICA = NULL;
+
+	m_systemTrayIcon.hide();
+}
+
+
+
+
+bool MainWindow::initAuthentication()
+{
+	if( ItalcCore::initAuthentication() )
+	{
+		return true;
+	}
 
-	delete m_localISD;
-	m_localISD = NULL;
+	if( ItalcCore::role != ItalcCore::RoleTeacher )
+	{
+		ItalcCore::role = ItalcCore::RoleTeacher;
+		return initAuthentication();
+	}
 
-	__systray_icon->hide();
-	delete __systray_icon;
+	// if we have logon credentials, assume they are fine and continue
+	if( ItalcCore::authenticationCredentials->hasCredentials(
+									AuthenticationCredentials::UserLogon ) )
+	{
+		return true;
+	}
 
-#ifdef BUILD_WIN32
-	qApp->processEvents( QEventLoop::AllEvents, 3000 );
-	localSystem::sleep( 3000 );
-	exit( 0 );
-#endif
+	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;
 }
 
 
@@ -438,24 +436,15 @@ void MainWindow::keyPressEvent( QKeyEvent * _e )
 
 void MainWindow::closeEvent( QCloseEvent * _ce )
 {
-	s_atExit = TRUE;
-
 	m_updateThread->quit();
 	m_updateThread->wait();
 	delete m_updateThread;
 	m_updateThread = NULL;
 
-	QList<client *> clients = m_workspace->findChildren<client *>();
-	foreach( client * c, clients )
-	{
-		c->quit();
-	}
-
 	m_classroomManager->savePersonalConfig();
 	m_classroomManager->saveGlobalClientConfig();
 
 	_ce->accept();
-	deleteLater();
 }
 
 
@@ -471,7 +460,7 @@ void MainWindow::handleSystemTrayEvent( QSystemTrayIcon::ActivationReason _r )
 		case QSystemTrayIcon::Context:
 		{
 			QMenu m( this );
-			m.addAction( __systray_icon->toolTip() )->setEnabled( FALSE );
+			m.addAction( m_systemTrayIcon.toolTip() )->setEnabled( FALSE );
 			foreach( QAction * a, m_sysTrayActions )
 			{
 				m.addAction( a );
@@ -482,7 +471,7 @@ void MainWindow::handleSystemTrayEvent( QSystemTrayIcon::ActivationReason _r )
 			QMenu rcm( this );
 			QAction * rc = m.addAction( tr( "Remote control" ) );
 			rc->setMenu( &rcm );
-			foreach( client * c,
+			foreach( Client * c,
 					m_classroomManager->visibleClients() )
 			{
 				rcm.addAction( c->name() )->
@@ -525,12 +514,11 @@ void MainWindow::remoteControlDisplay( const QString & _hostname,
 						bool _stop_demo_afterwards )
 {
 	QWriteLocker wl( &m_rctrlLock );
-	if( m_remoteControlWidget  )
+	if( m_remoteControlWidget )
 	{
 		return;
 	}
-	m_remoteControlWidget = new remoteControlWidget( _hostname, _view_only,
-									this );
+	m_remoteControlWidget = new RemoteControlWidget( _hostname, _view_only );
 	int x = 0;
 	for( int i = 0; i < m_remoteControlScreen; ++i )
 	{
@@ -553,7 +541,7 @@ void MainWindow::remoteControlWidgetClosed( QObject * )
 	if( m_stopDemo )
 	{
 		m_classroomManager->changeGlobalClientMode(
-							client::Mode_Overview );
+							Client::Mode_Overview );
 		m_stopDemo = FALSE;
 	}
 }
@@ -563,7 +551,7 @@ void MainWindow::remoteControlWidgetClosed( QObject * )
 
 void MainWindow::aboutITALC( void )
 {
-	aboutDialog( this ).exec();
+	AboutDialog( this ).exec();
 }
 
 
@@ -571,13 +559,13 @@ void MainWindow::aboutITALC( void )
 
 void MainWindow::changeGlobalClientMode( int _mode )
 {
-	client::modes new_mode = static_cast<client::modes>( _mode );
+	Client::Modes new_mode = static_cast<Client::Modes>( _mode );
 	if( new_mode == m_classroomManager->globalClientMode()/* &&
-					new_mode != client::Mode_Overview*/ )
+					new_mode != Client::Mode_Overview*/ )
 	{
 		m_classroomManager->changeGlobalClientMode(
-							client::Mode_Overview );
-		m_modeGroup->button( client::Mode_Overview )->setChecked(
+							Client::Mode_Overview );
+		m_modeGroup->button( Client::Mode_Overview )->setChecked(
 									TRUE );
 	}
 	else
@@ -602,16 +590,8 @@ MainWindowUpdateThread::MainWindowUpdateThread( MainWindow * _main_window ) :
 
 
 
-void MainWindowUpdateThread::update( void )
+void MainWindowUpdateThread::update()
 {
-	m_mainWindow->m_localISD->handleServerMessages();
-
-	if( client::reloadSnapshotList() )
-	{
-		m_mainWindow->m_snapshotList->reloadList();
-	}
-	client::resetReloadOfSnapshotList();
-
 	// now do cleanup-work
 	m_mainWindow->getClassroomManager()->doCleanupWork();
 }
@@ -621,7 +601,7 @@ void MainWindowUpdateThread::run( void )
 {
 	QTimer t;
 	connect( &t, SIGNAL( timeout() ), this, SLOT( update() ) );
-	t.start( m_mainWindow->getClassroomManager()->updateInterval() * 1000 );
+	t.start( m_mainWindow->getClassroomManager()->updateInterval() );
 	exec();
 }
 
@@ -661,6 +641,3 @@ void clientWorkspace::contextMenuEvent( QContextMenuEvent * _event )
 
 
 
-
-#include "MainWindow.moc"
-
diff --git a/ima/src/MainWindow.h b/ima/src/MainWindow.h
index f624035..2cf4c3c 100644
--- a/ima/src/MainWindow.h
+++ b/ima/src/MainWindow.h
@@ -32,25 +32,25 @@
 #include <QtGui/QSystemTrayIcon>
 #include <QtGui/QToolButton>
 
-#include "dialogs/MainWindow.uic"
+#include "ui_MainWindow.h"
 
-#include "client.h"
-#include "snapshot_list.h"
+#include "Client.h"
+#include "SnapshotList.h"
 
 
 class QMenu;
 class QScrollArea;
 class QSplashScreen;
 class QSplitter;
-class classroomManager;
-class configWidget;
-class isdConnection;
-class overviewWidget;
-class remoteControlWidget;
-class userList;
+class ClassroomManager;
+class ConfigWidget;
+class OverviewWidget;
+class RemoteControlWidget;
+class UserList;
+class ItalcCoreConnection;
+class ItalcVncConnection;
 
 extern QString __default_domain;
-extern int __demo_quality;
 
 
 class MainWindow;
@@ -102,19 +102,21 @@ public:
 	MainWindow( int _screen );
 	virtual ~MainWindow();
 
-	QWidget * workspace( void )
+	static bool initAuthentication();
+
+	QWidget * workspace()
 	{
-		return( m_workspace );
+		return m_workspace;
 	}
 
-	classroomManager * getClassroomManager( void )
+	ClassroomManager *getClassroomManager()
 	{
-		return( m_classroomManager );
+		return m_classroomManager;
 	}
 
-	isdConnection * localISD( void )
+	ItalcCoreConnection *localICA()
 	{
-		return( m_localISD );
+		return m_localICA;
 	}
 
 	void checkModeButton( int _id )
@@ -137,13 +139,6 @@ public:
 		return m_sideBar;
 	}
 
-	static bool ensureConfigPathExists( void );
-
-	static inline bool atExit( void )
-	{
-		return( s_atExit );
-	}
-
 	void remoteControlDisplay( const QString & _hostname,
 					bool _view_only = FALSE,
 					bool _stop_demo_afterwards = FALSE );
@@ -154,12 +149,6 @@ public:
 		return( m_remoteControlWidget != NULL );
 	}
 
-	inline void reloadSnapshotList( void )
-	{
-		m_snapshotList->reloadList();
-	}
-
-
 protected:
 	void keyPressEvent( QKeyEvent *e );
 
@@ -175,19 +164,19 @@ private slots:
 
 	void mapOverview( void )
 	{
-		changeGlobalClientMode( client::Mode_Overview );
+		changeGlobalClientMode( Client::Mode_Overview );
 	}
 	void mapFullscreenDemo( void )
 	{
-		changeGlobalClientMode( client::Mode_FullscreenDemo );
+		changeGlobalClientMode( Client::Mode_FullscreenDemo );
 	}
 	void mapWindowDemo( void )
 	{
-		changeGlobalClientMode( client::Mode_WindowDemo );
+		changeGlobalClientMode( Client::Mode_WindowDemo );
 	}
 	void mapScreenLock( void )
 	{
-		changeGlobalClientMode( client::Mode_Locked );
+		changeGlobalClientMode( Client::Mode_Locked );
 	}
 
 
@@ -200,30 +189,27 @@ private:
 
 	QButtonGroup * m_modeGroup;
 
+	QSystemTrayIcon m_systemTrayIcon;
 	QList<QAction *> m_sysTrayActions;
 
 	QWidget * m_sideBarWidget;
 	int m_openedTabInSideBar;
 
-
-	isdConnection * m_localISD;
-
+	ItalcCoreConnection * m_localICA;
 
 	QReadWriteLock m_rctrlLock;
-	remoteControlWidget * m_remoteControlWidget;
+	RemoteControlWidget * m_remoteControlWidget;
 	bool m_stopDemo;
 	int m_remoteControlScreen;
 
-	overviewWidget * m_overviewWidget;
-	classroomManager * m_classroomManager;
-	userList * m_userList;
-	snapshotList * m_snapshotList;
-	configWidget * m_configWidget;
-
-	static bool s_atExit;
+	OverviewWidget * m_overviewWidget;
+	ClassroomManager * m_classroomManager;
+	UserList * m_userList;
+	SnapshotList * m_snapshotList;
+	ConfigWidget * m_configWidget;
 
 	friend class MainWindowUpdateThread;
-	friend class classroomManager;
+	friend class ClassroomManager;
 
 } ;
 
diff --git a/ima/src/OverviewWidget.cpp b/ima/src/OverviewWidget.cpp
new file mode 100644
index 0000000..6c68514
--- /dev/null
+++ b/ima/src/OverviewWidget.cpp
@@ -0,0 +1,47 @@
+/*
+ * 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
new file mode 100644
index 0000000..fa1f08e
--- /dev/null
+++ b/ima/src/OverviewWidget.h
@@ -0,0 +1,42 @@
+/*
+ * 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
new file mode 100644
index 0000000..59353ef
--- /dev/null
+++ b/ima/src/RemoteControlWidget.cpp
@@ -0,0 +1,419 @@
+/*
+ *  RemoteControlWidget.cpp - widget containing a VNC-view and controls for it
+ *
+ *  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 "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_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
+	{
+		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
new file mode 100644
index 0000000..dff16a8
--- /dev/null
+++ b/ima/src/RemoteControlWidget.h
@@ -0,0 +1,123 @@
+/*
+ *  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
new file mode 100644
index 0000000..a2c0901
--- /dev/null
+++ b/ima/src/RunCommandsDialog.cpp
@@ -0,0 +1,53 @@
+/*
+ * 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
new file mode 100644
index 0000000..39e9f07
--- /dev/null
+++ b/ima/src/RunCommandsDialog.h
@@ -0,0 +1,48 @@
+/*
+ * 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
index 96710d9..357f0be 100644
--- a/ima/src/SideBar.cpp
+++ b/ima/src/SideBar.cpp
@@ -285,8 +285,3 @@ void SideBar::paintEvent( QPaintEvent * _pe )
 }
 
 
-
-
-
-#include "SideBar.moc"
-
diff --git a/ima/src/SideBarWidget.cpp b/ima/src/SideBarWidget.cpp
index e885987..d1b26d3 100644
--- a/ima/src/SideBarWidget.cpp
+++ b/ima/src/SideBarWidget.cpp
@@ -1,5 +1,5 @@
 /*
- * SideBarWidget.cpp - implementation of base-widget for side-bar
+ * SideBarWidget.cpp - implementation of SideBarWidget
  *
  * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
  *
@@ -31,7 +31,7 @@
 
 
 #include "SideBarWidget.h"
-#include "fast_qimage.h"
+#include "FastQImage.h"
 
 
 
@@ -83,7 +83,7 @@ void SideBarWidget::paintEvent( QPaintEvent * )
 	p.fillRect( rect(), palette().brush( backgroundRole() ) );
 
 	QFont f;
-	f.setBold( TRUE );
+	f.setBold( true );
 	f.setPixelSize( TITLE_FONT_HEIGHT );
 
 	p.setFont( f );
@@ -93,7 +93,7 @@ void SideBarWidget::paintEvent( QPaintEvent * )
 	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 ) );
+	p.drawImage( 2, 2, FastQImage( m_icon ).scaled( 48, 48 ) );
 }
 
 
diff --git a/ima/src/SideBarWidget.h b/ima/src/SideBarWidget.h
index 91d5b5d..a881b20 100644
--- a/ima/src/SideBarWidget.h
+++ b/ima/src/SideBarWidget.h
@@ -42,17 +42,17 @@ public:
 
 	inline const QPixmap & icon( void ) const
 	{
-		return( m_icon );
+		return m_icon;
 	}
 
 	inline const QString & title( void ) const
 	{
-		return( m_title );
+		return m_title;
 	}
 
 	inline const QString & description( void ) const
 	{
-		return( m_description );
+		return m_description;
 	}
 
 
diff --git a/ima/src/SnapshotList.cpp b/ima/src/SnapshotList.cpp
new file mode 100644
index 0000000..ea61401
--- /dev/null
+++ b/ima/src/SnapshotList.cpp
@@ -0,0 +1,135 @@
+/*
+ * 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
new file mode 100644
index 0000000..b448f81
--- /dev/null
+++ b/ima/src/SnapshotList.h
@@ -0,0 +1,61 @@
+/*
+ * SnapshotList.h - declaration of snapshot-list 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 _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
new file mode 100644
index 0000000..e50a9f5
--- /dev/null
+++ b/ima/src/ToolButton.cpp
@@ -0,0 +1,446 @@
+/*
+ * 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
new file mode 100644
index 0000000..d90dd5d
--- /dev/null
+++ b/ima/src/ToolButton.h
@@ -0,0 +1,143 @@
+/*
+ * ToolButton.h - declaration of class ToolButton
+ *
+ * Copyright (c) 2006-2010 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/classroom_manager.cpp b/ima/src/classroom_manager.cpp
deleted file mode 100644
index 154947a..0000000
--- a/ima/src/classroom_manager.cpp
+++ /dev/null
@@ -1,2225 +0,0 @@
-/*
- * classroom_manager.cpp - implementation of classroom-manager
- *
- * 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.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#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/QSplashScreen>
-#include <QtGui/QSplitter>
-#include <QtGui/QPainter>
-#include <QtNetwork/QHostInfo>
-
-
-#include "MainWindow.h"
-#include "classroom_manager.h"
-#include "client.h"
-#include "dialogs.h"
-#include "cmd_input_dialog.h"
-#include "local_system.h"
-#include "tool_button.h"
-#include "MainToolBar.h"
-#include "messagebox.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::personalConfigPath() ),
-	m_globalClientConfiguration( localSystem::globalConfigPath() ),
-	m_quickSwitchMenu( new QMenu( this ) ),
-	m_qsmClassRoomSeparator( m_quickSwitchMenu->addSeparator() ),
-	m_globalClientMode( client::Mode_Overview ),
-	m_clientUpdateInterval( 1 ),
-	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", 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", 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( "demoquality", __demo_quality );
-	globalsettings.setAttribute( "role", __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 );
-	if( MainWindow::ensureConfigPathExists() == FALSE )
-	{
-		qWarning( 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( localSystem::personalConfigDir()
-						).toUtf8().constData() );
-	}
-
-	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();
-			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;
-			}
-
-			__demo_quality = node.toElement().
-					attribute( "demoquality" ).toInt();
-
-			__default_domain = node.toElement().
-						attribute( "defaultdomain" );
-
-			__role = static_cast<ISD::userRoles>(
-				node.toElement().attribute( "role" ).toInt() );
-			if( __role <= ISD::RoleNone ||
-						__role >= ISD::RoleCount )
-			{
-				__role = ISD::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() );
-			// if the attr did not exist, we got zero as value,
-			// which is not acceptable
-			if( m_clientUpdateInterval < 1 )
-			{
-				m_clientUpdateInterval = 2;
-			}
-		}
-		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();
-		}
-		messageBox::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();
-		}
-		messageBox::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();
-		}
-		messageBox::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 * 1000, 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( int _value )
-{
-	m_clientUpdateInterval = _value;
-}
-
-
-
-
-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 settings_dlg( cri->getClient(),
-					mainWindow(),
-						cri->parent()->text( 0 ) );
-			settings_dlg.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 settings_dlg( NULL, mainWindow(),
-							classroom_name );
-	settings_dlg.setWindowTitle( tr( "Add computer" ) );
-	settings_dlg.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 );
-}
-
-
-
-
-bool classRoomItem::operator<( const QTreeWidgetItem & other ) const
-{
-	int column = treeWidget()->sortColumn();
-	const QString str1 = text( column ).toLower();
-	const QString str2 = other.text( column ).toLower();
-	// check for numbered computers and sort them numerically correct (instead
-	// lexically correct) - example:
-	// * PC 1
-	// * PC 2
-	// * ...
-	// * PC 10
-	// * PC 11
-	// -> with lexical sorting, PC 10, PC 11... would appear after PC 1 and
-	// before PC 2, but we want PC 1, PC 2, ..., PC 10, PC 11
-	QRegExp rx1( "^([^\\d]*)(\\d+)$" );
-	QRegExp rx2( "^([^\\d]*)(\\d+)$" );
-	if( rx1.indexIn( str1 ) == 0 && rx2.indexIn( str2 ) == 0 &&
-			rx1.cap( 1 ) == rx2.cap( 1 ) )
-	{
-		return rx1.cap( 2 ).toInt() < rx2.cap( 2 ).toInt();
-	}
-	return str1 < str2;
-}
-
-
-
-#include "classroom_manager.moc"
-
diff --git a/ima/src/classroom_manager.h b/ima/src/classroom_manager.h
deleted file mode 100644
index 7643d97..0000000
--- a/ima/src/classroom_manager.h
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * classroom_manager.h - include file for classroom-manager
- *
- * 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 _CLASSROOM_MANAGER_H
-#define _CLASSROOM_MANAGER_H
-
-#include <QtCore/QString>
-#include <QtCore/QVector>
-#include <QtGui/QSpinBox>
-#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 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( QSpinBox * _update_interval_sb )
-	{
-		m_updateIntervalSpinBox = _update_interval_sb;
-		m_updateIntervalSpinBox->setValue( m_clientUpdateInterval );
-	}
-
-	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( int _value );
-
-	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;
-
-	QSpinBox * 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;
-
-	virtual bool operator<( const QTreeWidgetItem & other ) const;
-
-} ;
-
-
-#endif
diff --git a/ima/src/client.cpp b/ima/src/client.cpp
deleted file mode 100644
index 1c53c66..0000000
--- a/ima/src/client.cpp
+++ /dev/null
@@ -1,1328 +0,0 @@
-/*
- * client.cpp - code for client-windows, which are displayed in several
- *              instances in the main-window of iTALC
- *
- * 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/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 "ivs_connection.h"
-#include "classroom_manager.h"
-#include "cmd_input_dialog.h"
-#include "local_system.h"
-#include "snapshot_list.h"
-#include "dialogs.h"
-#include "messagebox.h"
-#include "remote_control_widget.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;
-
-bool client::s_reloadSnapshotList = FALSE;
-
-
-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 );
-
-				if( tmd.exec() == QDialog::Accepted &&
-					!msg.isEmpty() )
-				{ 
-					foreach( client * cl, _clients )
-					{
-						cl->sendTextMessage( msg );
-					}
-				}
-			}
-
-			break;
-
-		case LogonUser:
-			{
-				remoteLogonDialog mld;
-
-				if( mld.exec() == QDialog::Accepted &&
-					!mld.userName().isEmpty()/* &&
-					!mld.password().isEmpty()*/ )
-				{
-					foreach( client * cl, _clients )
-					{
-						cl->logonUser( mld.userName(),
-							mld.password(), mld.domain() );
-					}
-				}
-
-			}
-			break;
-
-		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;
-				cmdInputDialog cmd_input_dialog( cmds );
-
-				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 * _main_window, int _id ) :
-	QWidget( _main_window->workspace() ),
-	m_mainWindow( _main_window ),
-	m_connection( NULL ),
-	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_makeSnapshot( FALSE ),
-	m_state( State_Unkown ),
-	m_syncMutex(),
-	m_classRoomItem( NULL ),
-	m_updateThread( NULL )
-{
-	new closeButton( this );
-
-	if( _id <= 0 || clientFromID( _id ) != NULL )
-	{
-		_id = freeID();
-	}
-	s_clientIDs[_id] = this;
-
-
-	m_classRoomItem = new classRoomItem( this, _class_room );
-
-	m_connection = new ivsConnection( m_hostname,
-						ivsConnection::QualityLow );
-
-	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 );
-
-	m_updateThread = new updateThread( this );
-}
-
-
-
-
-client::~client()
-{
-	quit();
-
-	m_updateThread->wait(
-#ifdef BUILD_WIN32
-			2000
-#else
-			5000
-#endif
-				);
-	if( !m_updateThread->isFinished() )
-	{
-		localSystem::sleep( 500 );
-		m_updateThread->terminate();
-	}
-
-	delete m_updateThread;
-
-//	m_syncMutex.lock();
-	delete m_connection;
-	m_connection = NULL;
-//	m_syncMutex.unlock();
-
-	delete m_classRoomItem;
-}
-
-
-
-
-void client::quit( void )
-{
-	changeMode( Mode_Overview );
-	m_updateThread->quit();
-}
-
-
-
-
-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 )
-{
-	isdConnection * conn = m_mainWindow->localISD();
-
-	if( _new_mode != m_mode )
-	{
-		//m_syncMutex.lock();
-		switch( m_mode )
-		{
-			case Mode_Overview:
-			case Mode_Unknown:
-				break;
-			case Mode_FullscreenDemo:
-			case Mode_WindowDemo:
-				conn->demoServerDenyClient( m_hostname );
-				m_updateThread->enqueueCommand(
-						updateThread::Cmd_StopDemo );
-				break;
-			case Mode_Locked:
-				m_updateThread->enqueueCommand(
-						updateThread::Cmd_UnlockScreen );
-				break;
-		}
-		switch( m_mode = _new_mode )
-		{
-			case Mode_Overview:
-			case Mode_Unknown:
-				break;
-			case Mode_FullscreenDemo:
-			case Mode_WindowDemo:
-				conn->demoServerAllowClient( m_hostname );
-				m_updateThread->enqueueCommand(
-						updateThread::Cmd_StartDemo,
-	QList<QVariant>() << QString::number( conn->demoServerPort() )
-				<< (int)( m_mode == Mode_FullscreenDemo ) );
-				//m_mode = Mode_FullscreenDemo;
-				break;
-			case Mode_Locked:
-				m_updateThread->enqueueCommand(
-						updateThread::Cmd_LockScreen );
-				break;
-		}
-		//m_syncMutex.unlock();
-	}
-	// 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_updateThread->enqueueCommand( updateThread::Cmd_StopDemo );
-		m_updateThread->enqueueCommand( updateThread::Cmd_UnlockScreen );
-	}
-}
-
-
-
-
-void client::setClassRoom( classRoom * _cr )
-{
-	delete m_classRoomItem;
-
-	m_classRoomItem = new classRoomItem( this, _cr );
-}
-
-
-
-
-void client::resetConnection( void )
-{
-	m_updateThread->enqueueCommand( updateThread::Cmd_ResetConnection,
-								m_hostname );
-}
-
-
-
-
-void client::update( void )
-{
-	// at least set tooltip with user-name if it is not displayed
-	// in title-bar
-	if( m_connection->state() == ivsConnection::Connected &&
-		!m_mainWindow->getClassroomManager()->showUsername() )
-	{
-		if( toolTip() != m_user )
-		{
-			setToolTip( m_user );
-		}
-	}
-	else
-	{
-		setToolTip( QString() );
-	}
-
-	m_state = currentState();
-	QWidget::update();
-}
-
-
-
-
-bool client::userLoggedIn( void )
-{
-	QMutexLocker ml( &m_syncMutex );
-
-	return( m_connection->state() == ivsConnection::Connected ||
-		m_connection->reset( m_hostname ) ==
-						ivsConnection::Connected );
-}
-
-
-
-
-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_connection->state() == ivsConnection::Connected &&
-						m_mode == Mode_Overview )
-	{
-		p.drawImage( CONTENT_OFFSET, m_connection->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 );
-	if( s.width() > 0 && s.height() > 0 )
-	{
-		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_makeSnapshot )
-	{
-		QMutexLocker ml( &m_syncMutex );
-		m_makeSnapshot = FALSE;
-		if( m_connection->takeSnapshot() )
-		{
-			s_reloadSnapshotList = TRUE;
-		}
-	}
-
-}
-
-
-
-
-void client::resizeEvent( QResizeEvent * _re )
-{
-	findChild<closeButton*>()->move( width()-21, 3 );
-	m_connection->setScaledSize( size() - CONTENT_SIZE_SUB );
-	m_connection->rescaleScreen();
-	QWidget::resizeEvent( _re );
-}
-
-
-
-
-
-void client::showEvent( QShowEvent * )
-{
-	if( m_classRoomItem != NULL )
-	{
-		m_classRoomItem->setVisible( TRUE );
-	}
-
-	m_mainWindow->getClassroomManager()->clientVisibleChanged();
-}
-
-
-
-
-void client::reload()
-{
-	if( userLoggedIn() )
-	{
-		m_syncMutex.lock();
-
-		m_connection->sendGetUserInformationRequest();
-		if( m_connection->sendGetUserInformationRequest() )
-		{
-			// only send a framebuffer-update-request if client
-			// is in (over)view-mode
-			m_connection->handleServerMessages(
-						m_mode == Mode_Overview );
-		}
-
-		m_user = m_connection->user();
-		m_syncMutex.unlock();
-	}
-	else
-	{
-		m_user = "";
-	}
-
-	if( m_classRoomItem )
-	{
-		m_classRoomItem->setUser( m_user );
-	}
-}
-
-
-
-
-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_updateThread->enqueueCommand(
-			updateThread::Cmd_SendTextMessage, _msg );
-}
-
-
-
-
-void client::logonUser( const QString & _username, const QString & _password,
-			const QString & _domain )
-{
-	m_updateThread->enqueueCommand( updateThread::Cmd_LogonUser,
-		_username + "*" + _password + "*" + _domain );
-}
-
-
-
-
-void client::logoutUser()
-{
-	m_updateThread->enqueueCommand( updateThread::Cmd_LogoutUser );
-}
-
-
-
-
-void client::snapshot()
-{
-	m_makeSnapshot = TRUE;
-}
-
-
-
-
-
-void client::powerOn()
-{
-	m_mainWindow->localISD()->wakeOtherComputer( m_mac );
-}
-
-
-
-
-void client::reboot()
-{
-	m_updateThread->enqueueCommand( updateThread::Cmd_Reboot );
-}
-
-
-
-
-
-void client::powerDown()
-{
-	m_updateThread->enqueueCommand( updateThread::Cmd_PowerDown );
-}
-
-
-
-
-void client::execCmds( const QString & _cmds )
-{
-	m_updateThread->enqueueCommand( updateThread::Cmd_ExecCmds, _cmds );
-}
-
-
-
-client::states client::currentState( void ) const
-{
-	//QMutexLocker m( &m_syncMutex );
-	switch( m_mode )
-	{
-		case Mode_Overview:
-			if( m_connection->state() == ivsConnection::Connected )
-			{
-				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 );
-}
-
-
-
-
-
-
-
-
-
-
-
-
-updateThread::updateThread( client * _client ) :
-	QThread(),
-	m_client( _client )
-{
-	start( LowPriority );
-}
-
-
-
-
-void updateThread::update( void )
-{
-	m_queueMutex.lock();
-	m_client->m_syncMutex.lock();
-	while( !m_queue.isEmpty() )
-	{
-		const queueItem i = m_queue.dequeue();
-		m_queueMutex.unlock();
-		switch( i.first )
-		{
-			case Cmd_ResetConnection:
-				m_client->m_connection->reset(
-						i.second.toString() );
-				break;
-			case Cmd_StartDemo:
-				m_client->m_connection->startDemo(
-					i.second.toList()[0].toString(),
-					i.second.toList()[1].toInt() );
-				break;
-			case Cmd_StopDemo:
-				m_client->m_connection->stopDemo();
-				break;
-			case Cmd_LockScreen:
-				m_client->m_connection->lockDisplay();
-				break;
-			case Cmd_UnlockScreen:
-				m_client->m_connection->unlockDisplay();
-				break;
-			case Cmd_SendTextMessage:
-				m_client->m_connection->
-					displayTextMessage(
-						i.second.toString() );
-				break;
-			case Cmd_LogonUser:
-			{
-				const QString s = i.second.toString();
-				const int pos = s.indexOf( '*' );
-				const int pos2 = s.lastIndexOf( '*' );
-				m_client->m_connection->logonUser(
-						s.left( pos ),
-						s.mid( pos + 1,
-							pos2-pos-1 ),
-						s.mid( pos2 + 1 ) );
-				break;
-			}
-			case Cmd_LogoutUser:
-				m_client->m_connection->logoutUser();
-				break;
-			case Cmd_Reboot:
-				m_client->m_connection->
-						restartComputer();
-				break;
-			case Cmd_PowerDown:
-				m_client->m_connection->
-						powerDownComputer();
-				break;
-			case Cmd_ExecCmds:
-				m_client->m_connection->execCmds(
-						i.second.toString() );
-				break;
-		}
-		m_queueMutex.lock();
-	}
-	m_client->m_syncMutex.unlock();
-	m_queueMutex.unlock();
-
-	if( m_client->m_classRoomItem->isVisible() )
-	{
-		if( !m_client->m_mainWindow->remoteControlRunning() &&
-						!MainWindow::atExit() )
-		{
-			m_client->reload();
-		}
-	}
-	else if( m_client->m_connection->state() == ivsConnection::Connected
-						&& !MainWindow::atExit() )
-	{
-		m_client->m_connection->close();
-	}
-}
-
-
-
-
-void updateThread::run( void )
-{
-	QTimer t;
-	connect( &t, SIGNAL( timeout() ), this, SLOT( update() ),
-							Qt::DirectConnection );
-	t.start( m_client->m_mainWindow->getClassroomManager()->updateInterval()
-								* 1000 );
-	exec();
-	update();
-	m_client->m_connection->close();
-}
-
-
-
-
-#include "client.moc"
-
diff --git a/ima/src/client.h b/ima/src/client.h
deleted file mode 100644
index 9b7efda..0000000
--- a/ima/src/client.h
+++ /dev/null
@@ -1,411 +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-2008 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
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <QtCore/QHash>
-#include <QtCore/QMutex>
-#include <QtCore/QThread>
-#include <QtCore/QQueue>
-#include <QtCore/QVector>
-#include <QtGui/QWidget>
-#include <QtGui/QImage>
-#include <QtGui/QMenu>
-
-#include "fast_qimage.h"
-
-class classRoom;
-class classRoomItem;
-class client;
-class isdConnection;
-class ivsConnection;
-class MainWindow;
-
-
-typedef void( client:: * execCmd )( const QString & );
-
-const QString CONFIRM_NO = "n";
-const QString CONFIRM_YES = "y";
-
-
-class updateThread : public QThread
-{
-	Q_OBJECT
-public:
-	enum queueableCommands
-	{
-		Cmd_ResetConnection,
-		Cmd_StartDemo,
-		Cmd_StopDemo,
-		Cmd_LockScreen,
-		Cmd_UnlockScreen,
-		Cmd_SendTextMessage,
-		Cmd_LogonUser,
-		Cmd_LogoutUser,
-		Cmd_Reboot,
-		Cmd_PowerDown,
-		Cmd_ExecCmds
-	} ;
-
-	updateThread( client * _client );
-	virtual ~updateThread()
-	{
-	}
-
-	inline void enqueueCommand( queueableCommands _cmd,
-					const QVariant & _data =
-							QVariant() )
-	{
-		m_queueMutex.lock();
-		m_queue.enqueue( qMakePair( _cmd, _data ) );
-		m_queueMutex.unlock();
-	}
-
-
-private slots:
-	void update( void );
-
-
-private:
-	virtual void run( void );
-
-	client * m_client;
-	QMutex m_queueMutex;
-	typedef QPair<queueableCommands, QVariant> queueItem;
-	QQueue<queueItem> m_queue;
-
-	friend class client;
-
-} ;
-
-
-
-
-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();
-
-	void quit( void );
-
-
-	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 );
-	void reload( void );
-
-
-	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 );
-
-	static inline bool reloadSnapshotList( void )
-	{
-		return( s_reloadSnapshotList );
-	}
-
-	static inline void resetReloadOfSnapshotList( void )
-	{
-		s_reloadSnapshotList = FALSE;
-	}
-
-
-	void zoom( void );
-	void zoomBack( void );
-
-
-	float m_rasterX;
-	float m_rasterY;
-
-
-public slots:
-
-
-private slots:
-	void enlarge( void );
-
-
-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;
-	ivsConnection * m_connection;
-	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_makeSnapshot;
-
-	states m_state;
-
-	QMutex m_syncMutex;
-
-	classRoomItem * m_classRoomItem;
-
-	updateThread * m_updateThread;
-
-
-	// static data
-	static bool s_reloadSnapshotList;
-
-	static QHash<int, client *> s_clientIDs;
-
-	// static members
-	static int freeID( void );
-
-
-	friend class updateThread;
-	friend class classRoomItem;
-
-} ;
-
-
-#endif
diff --git a/ima/src/cmd_input_dialog.cpp b/ima/src/cmd_input_dialog.cpp
deleted file mode 100644
index a053b39..0000000
--- a/ima/src/cmd_input_dialog.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * cmd_input_dialog.cpp - implementation of command-input-dialog
- *
- * Copyright (c) 2004-2006 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/QPushButton>
-#include <QtGui/QLabel>
-#include <QtGui/QKeyEvent>
-#include <QtGui/QResizeEvent>
-#include <QtGui/QTextEdit>
-
-#include "cmd_input_dialog.h"
-
-
-
-cmdInputDialog::cmdInputDialog( QString & _cmds_str, QWidget * _parent ) :
-	QDialog( _parent ),
-	m_cmdsStr( _cmds_str )
-{
-	setWindowTitle( tr( "Run commands on client(s)" ) );
-
-	m_iconLbl = new QLabel( this );
-	m_iconLbl->setPixmap( QPixmap( ":/resources/run.png" ) );
-	m_iconLbl->setGeometry( 10, 16, 48, 48 );
-
-	m_appNameLbl = new QLabel( tr( "Enter commands, which should be run "
-						"on client(s):" ), this );
-	m_appNameLbl->setGeometry( 70, 20, 380, 40 );
-
-
-	m_cmdInputTextEdit = new QTextEdit( this );
-	m_cmdInputTextEdit->setReadOnly( FALSE );
-	m_cmdInputTextEdit->setGeometry( 10, 64, 460, 256 );
-	m_cmdInputTextEdit->setWordWrapMode( QTextOption::NoWrap );
-
-	m_okBtn = new QPushButton( QPixmap( ":/resources/apply.png" ),
-							tr( "&Run!" ), this );
-	m_cancelBtn = new QPushButton( QPixmap( ":/resources/cancel.png" ),
-							tr( "Cancel" ), this );
-	connect( m_okBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
-	connect( m_cancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
-
-	resize( 480, 390 );
-}
-
-
-
-
-cmdInputDialog::~cmdInputDialog()
-{
-}
-
-
-
-
-void cmdInputDialog::keyPressEvent( QKeyEvent * _ke )
-{
-	if( _ke->key() == Qt::Key_Escape )
-	{
-		reject();
-	}
-}
-
-
-
-
-void cmdInputDialog::resizeEvent( QResizeEvent * _re )
-{
-	m_cmdInputTextEdit->setGeometry( 10, 90, _re->size().width()-20,
-						_re->size().height()-140 );
-	m_okBtn->setGeometry( _re->size().width()-240,
-					_re->size().height()-40, 110, 30 );
-	m_cancelBtn->setGeometry( _re->size().width()-120, _re->size().height()-40,
-								110, 30 );
-}
-
-
-
-
-void cmdInputDialog::accept( void )
-{
-	m_cmdsStr = m_cmdInputTextEdit->toPlainText();
-	QDialog::accept();
-}
-
-
-#include "cmd_input_dialog.moc"
-
diff --git a/ima/src/cmd_input_dialog.h b/ima/src/cmd_input_dialog.h
deleted file mode 100644
index 4e0aa43..0000000
--- a/ima/src/cmd_input_dialog.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * cmd_input_dialog.h - declaration of class cmdInputDialog
- *
- * Copyright (c) 2004-2006 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 _CMD_INPUT_DIALOG_H
-#define _CMD_INPUT_DIALOG_H
-
-#include <QtGui/QDialog>
-#include <QtGui/QLabel>
-
-
-class QLabel;
-class QPushButton;
-class QTextEdit;
-
-
-class cmdInputDialog : public QDialog
-{
-	Q_OBJECT
-public:
-	cmdInputDialog( QString & _cmds_str, QWidget * _parent = 0 );
-	virtual ~cmdInputDialog();
-
-
-private slots:
-	virtual void accept( void );
-
-
-private:
-	virtual void keyPressEvent( QKeyEvent * _ke );
-	virtual void resizeEvent( QResizeEvent * _re );
-
-	QPushButton * m_cancelBtn;
-	QPushButton * m_okBtn;
-	QLabel * m_iconLbl;
-	QLabel * m_appNameLbl;
-	QTextEdit * m_cmdInputTextEdit;
-
-	QString & m_cmdsStr;
-
-} ;
-
-#endif
diff --git a/ima/src/config_widget.cpp b/ima/src/config_widget.cpp
deleted file mode 100644
index d6e5dc0..0000000
--- a/ima/src/config_widget.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * config_widget.cpp - implementation of 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.
- *
- */
-
-
-#include <QtGui/QLabel>
-#include <QtGui/QLayout>
-#include <QtGui/QCheckBox>
-#include <QtGui/QComboBox>
-#include <QtGui/QMessageBox>
-#include <QtNetwork/QHostInfo>
-
-
-#include "config_widget.h"
-#include "classroom_manager.h"
-#include "MainWindow.h"
-#include "tool_button.h"
-#include "isd_base.h"
-
-
-
-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() );
-
-	connect( updateIntervalSB, SIGNAL( valueChanged( int ) ),
-				mainWindow()->getClassroomManager(),
-					SLOT( updateIntervalChanged( int ) ) );
-	mainWindow()->getClassroomManager()->setUpdateIntervalSpinBox(
-							updateIntervalSB );
-
-
-	demoQualityCB->setCurrentIndex( __demo_quality );
-
-	connect( demoQualityCB, SIGNAL( activated( int ) ), this,
-					SLOT( demoQualitySelected( int ) ) );
-
-
-	roleCB->setCurrentIndex( __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 ) ) );
-}
-
-
-
-
-configWidget::~configWidget()
-{
-}
-
-
-
-
-void configWidget::demoQualitySelected( int _q )
-{
-	__demo_quality = _q;
-}
-
-
-
-
-void configWidget::roleSelected( int _role )
-{
-	__role = static_cast<ISD::userRoles>( _role+1 );
-}
-
-
-
-
-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;
-}
-
-
-
-#include "config_widget.moc"
-
diff --git a/ima/src/config_widget.h b/ima/src/config_widget.h
deleted file mode 100644
index 07dff1f..0000000
--- a/ima/src/config_widget.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * config_widget.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 "dialogs/config.uic"
-
-
-class configWidget : public SideBarWidget, private Ui::config
-{
-	Q_OBJECT
-public:
-	configWidget( MainWindow * _main_window, QWidget * _parent );
-	virtual ~configWidget();
-
-
-protected slots:
-	void demoQualitySelected( int );
-	void roleSelected( int );
-	void toggleToolButtonTips( bool _on );
-	void toggleIconOnlyToolButtons( bool _on );
-	void domainChanged( const QString & _domain );
-
-} ;
-
-
-#endif
diff --git a/ima/src/dialogs.cpp b/ima/src/dialogs.cpp
deleted file mode 100644
index c447d48..0000000
--- a/ima/src/dialogs.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * dialogs.cpp - implementation of dialogs
- *
- * 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 <QtCore/QFile>
-#include <QtCore/QRegExp>
-
-#include "dialogs.h"
-
-
-
-aboutDialog::aboutDialog( QWidget * _parent ) :
-	QDialog( _parent )
-{
-	setupUi( this );
-
-	QFile authors_rc( ":/AUTHORS" );
-	authors_rc.open( QFile::ReadOnly );
-	authors->setPlainText( authors_rc.readAll() );
-
-	QFile license_rc( ":/COPYING" );
-	license_rc.open( QFile::ReadOnly );
-	license->setPlainText( license_rc.readAll() );
-}
-
-
-
-
-
-#include "client.h"
-#include "classroom_manager.h"
-#include "MainWindow.h"
-#include "messagebox.h"
-
-
-clientSettingsDialog::clientSettingsDialog( client * _client,
-						MainWindow * _main_window,
-						const QString & _classroom ) :
-	QDialog( _main_window ),
-	Ui::clientSettings(),
-	m_client( _client ),
-	m_mainWindow( _main_window )
-{
-	setupUi( this );
-
-	hostnameEdit->setFocus();
-	int set_to_classroom = 0;
-
-	classroomManager * cm = m_mainWindow->getClassroomManager();
-	for( int i = 0; i < cm->m_classRooms.size(); ++i )
-	{
-		classRoomComboBox->addItem( cm->m_classRooms[i]->text( 0 ) );
-		if( _classroom == cm->m_classRooms[i]->text( 0 ) )
-		{
-			set_to_classroom = i;
-		}
-	}
-
-	classRoomComboBox->setCurrentIndex( set_to_classroom );
-
-	if( m_client != NULL )
-	{
-		hostnameEdit->setText( m_client->hostname() );
-		macEdit->setText( m_client->mac() );
-		nameEdit->setText( m_client->nickname() );
-		typeComboBox->setCurrentIndex( m_client->type() );
-	}
-}
-
-
-
-
-void clientSettingsDialog::accept( void )
-{
-	if( hostnameEdit->text() == "" )
-	{
-		messageBox::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( macEdit->text() != "" &&
-		QString( macEdit->text().toUpper() + ":" ).indexOf(
-				QRegExp( "^([\\dA-F]{2}:){6}$" ) ) != 0 )
-	{
-		messageBox::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 )
-	{
-		m_client = new client( hostnameEdit->text(),
-					macEdit->text(),
-					nameEdit->text(),
-				(client::types) typeComboBox->currentIndex(),
-m_mainWindow->getClassroomManager()->m_classRooms[classRoomComboBox->currentIndex()],
-					m_mainWindow );
-	}
-	else
-	{
-		m_client->setHostname( hostnameEdit->text() );
-		m_client->setMac( macEdit->text() );
-		m_client->setNickname( nameEdit->text() );
-		m_client->setType( (client::types)
-						typeComboBox->currentIndex() );
-		m_client->setClassRoom(
-m_mainWindow->getClassroomManager()->m_classRooms[classRoomComboBox->currentIndex()] );
-		m_client->resetConnection();
-	}
-
-	QDialog::accept();
-}
-
-
-
-
-
-textMessageDialog::textMessageDialog( QString & _msg_str, QWidget * _parent ) :
-	QDialog( _parent ),
-	Ui::textMessage(),
-	m_msgStr( _msg_str )
-{
-	setupUi( this );
-}
-
-
-
-
-void textMessageDialog::accept( void )
-{
-	m_msgStr = textEdit->toPlainText();
-	QDialog::accept();
-}
-
-
-
-
-remoteLogonDialog::remoteLogonDialog( QWidget * _parent ) :
-	QDialog( _parent ),
-	Ui::remoteLogon()
-{
-	setupUi( this );
-
-	domainEdit->setText( __default_domain );
-
-	connect( userNameEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( userNameChanged( const QString & ) ) );
-	connect( passwordEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( passwordChanged( const QString & ) ) );
-	connect( domainEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( domainChanged( const QString & ) ) );
-}
-
-
-
-
-#include "dialogs.moc"
-
diff --git a/ima/src/dialogs.h b/ima/src/dialogs.h
deleted file mode 100644
index e7a85eb..0000000
--- a/ima/src/dialogs.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * dialogs.h - declaration of dialog-classes
- *
- * 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 _DIALOGS_H
-#define _DIALOGS_H
-
-#include "dialogs/about.uic"
-#include "dialogs/client_settings.uic"
-#include "dialogs/text_message.uic"
-#include "dialogs/support.uic"
-#include "dialogs/remote_logon.uic"
-
-
-class client;
-class MainWindow;
-
-
-
-class aboutDialog : public QDialog, private Ui::about
-{
-public:
-	aboutDialog( QWidget * _parent );
-
-} ;
-
-
-
-class clientSettingsDialog : public QDialog, private Ui::clientSettings
-{
-	Q_OBJECT
-public:
-	clientSettingsDialog( client * _c, MainWindow * _main_window,
-						const QString & _classroom );
-
-private:
-	virtual void accept( void );
-
-	client * m_client;
-	MainWindow * m_mainWindow;
-
-} ;
-
-
-
-
-class supportDialog : public QDialog, private Ui::support
-{
-public:
-	supportDialog( QWidget * _parent ) :
-		QDialog( _parent ? _parent->window() : 0 )
-	{
-		setupUi( this );
-	}
-
-	static QString getHost( QWidget * _parent )
-	{
-		supportDialog sd( _parent );
-		if( sd.exec() == Accepted )
-		
-		{
-			return( sd.hostEdit->text() );
-		}
-		return( "" );
-	}
-
-} ;
-
-
-
-
-class textMessageDialog : public QDialog, private Ui::textMessage
-{
-	Q_OBJECT
-public:
-	textMessageDialog( QString & _msg_str, QWidget * _parent = 0 );
-
-
-private slots:
-	virtual void accept( void );
-
-
-private:
-	QString & m_msgStr;
-
-} ;
-
-
-
-
-class remoteLogonDialog : public QDialog, private Ui::remoteLogon
-{
-	Q_OBJECT
-public:
-	remoteLogonDialog( QWidget * _parent = 0 );
-
-	const QString & userName( void ) const
-	{
-		return( m_userName );
-	}
-
-	const QString & password( void ) const
-	{
-		return( m_password );
-	}
-
-	const QString & domain( void ) 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:
-	QString m_userName;
-	QString m_password;
-	QString m_domain;
-
-} ;
-
-
-#endif
diff --git a/ima/src/local_system_ima.cpp b/ima/src/local_system_ima.cpp
deleted file mode 100644
index 70f7f44..0000000
--- a/ima/src/local_system_ima.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * local_system_ima.cpp - namespace localSystem, providing an interface for
- *                        transparent usage of operating-system-specific
- *                        functions
- *
- * Copyright (c) 2006-2007 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.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "local_system_ima.h"
-
-#include <QtCore/QDir>
-
-
-namespace localSystem
-{
-
-
-void initialize( void )
-{
-	localSystem::initialize( NULL, "italc_master.log" );
-
-#ifdef BUILD_WIN32
-	if( QDir( "C:\\WINDOWS" ).exists() == FALSE )
-	{
-		QDir( "C:\\" ).mkdir( "WINDOWS" );
-	}
-#endif
-}
-
-
-} // end of namespace localSystem
-
diff --git a/ima/src/local_system_ima.h b/ima/src/local_system_ima.h
deleted file mode 100644
index 89c8b37..0000000
--- a/ima/src/local_system_ima.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * local_system_ima.h - misc. platform-specific stuff
- *
- * Copyright (c) 2007 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_IMA_H
-#define _LOCAL_SYSTEM_IMA_H
-
-#include "local_system.h"
-
-namespace localSystem
-{
-	void initialize( void );
-}
-
-#endif
diff --git a/ima/src/main.cpp b/ima/src/main.cpp
index e5a8762..d4c63db 100644
--- a/ima/src/main.cpp
+++ b/ima/src/main.cpp
@@ -1,5 +1,5 @@
 /*
- * main.cpp - main-file for iTALC-Application
+ * main.cpp - main-file for iTALC Master Application
  *
  * Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users/dot/sf/dot/net>
  *
@@ -22,33 +22,41 @@
  *
  */
 
+
 #include <QtCore/QModelIndex>
 #include <QtGui/QApplication>
 #include <QtGui/QSplashScreen>
 
+#ifdef ITALC3
+#include "MasterCore.h"
+#endif
 #include "MainWindow.h"
-#include "ivs_connection.h"
-#include "local_system_ima.h"
-#include "remote_control_widget.h"
+#include "ItalcConfiguration.h"
+#include "ItalcCoreConnection.h"
+#include "LocalSystem.h"
+#include "Logger.h"
+#include "RemoteControlWidget.h"
 
 
 
 QSplashScreen * splashScreen = NULL;
 
+#ifndef ITALC3
 QString __default_domain;
-int __demo_quality = 0;
-
-int __isd_port = PortOffsetISD;
-QString __isd_host = "127.0.0.1";
+#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() ) );
 
-#if QT_VERSION >= 0x040300
 	app.setStyleSheet(
 		"QMenu { border:1px solid black; background-color: white; "
 			"background-image:url(:/resources/tray-menu-bg.png); "
@@ -64,25 +72,13 @@ int main( int argc, char * * argv )
 		"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; }" );
-#endif
 
+	// load translations
 	qRegisterMetaType<QModelIndex>( "QModelIndex" );
 	qRegisterMetaType<quint16>( "quint16" );
 
 
-	localSystem::initialize();
-	if( QLocale::system().language() == QLocale::Hebrew ||
-		QLocale::system().language() == QLocale::Arabic )
-	{
-		QApplication::setLayoutDirection( Qt::RightToLeft );
-	}
-
-
-	__role = ISD::RoleTeacher;
-	if( localSystem::parameter( "isdport" ).toInt() > 0 )
-	{
-		__isd_port = localSystem::parameter( "isdport" ).toInt();
-	}
+	ItalcCore::role = ItalcCore::RoleTeacher;
 
 	// parse arguments
 	QStringListIterator arg_it( QCoreApplication::arguments() );
@@ -93,13 +89,19 @@ int main( int argc, char * * argv )
 		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() );
+						false;
+			new RemoteControlWidget( host, view_only );
+			return app.exec();
 		}
 		else if( a == "-screen" && arg_it.hasNext() )
 		{
@@ -112,15 +114,15 @@ int main( int argc, char * * argv )
 				const QString role = arg_it.next();
 				if( role == "teacher" )
 				{
-					__role = ISD::RoleTeacher;
+					ItalcCore::role = ItalcCore::RoleTeacher;
 				}
 				else if( role == "admin" )
 				{
-					__role = ISD::RoleAdmin;
+					ItalcCore::role = ItalcCore::RoleAdmin;
 				}
 				else if( role == "supporter" )
 				{
-					__role = ISD::RoleSupporter;
+					ItalcCore::role = ItalcCore::RoleSupporter;
 				}
 			}
 			else
@@ -129,39 +131,38 @@ int main( int argc, char * * argv )
 					"	teacher\n"
 					"	admin\n"
 					"	supporter\n\n" );
-				return( -1 );
+				return -1;
 			}
 		}
-		else if( a == "-isdport" && arg_it.hasNext() )
-		{
-			__isd_port = arg_it.next().toInt();
-		}
-		else if( a == "-isdhost" && arg_it.hasNext() )
-		{
-			__isd_host = arg_it.next();
-		}
-
 	}
 
 
+	QSplashScreen splashScreen( QPixmap( ":/resources/splash.png" ) );
+	splashScreen.show();
 
-	splashScreen = new QSplashScreen( QPixmap( ":/resources/splash.png" ) );
-	splashScreen->show();
-
-
+	if( !MainWindow::initAuthentication() )
+	{
+		return -1;
+	}
 	// now create the main-window
-	MainWindow * mainWindow = new MainWindow( screen );
+	MainWindow mainWindow( screen );
 
-	if( !mainWindow->localISD() ||
-		mainWindow->localISD()->state() != isdConnection::Connected )
+	if( !mainWindow.localICA() ||
+		!mainWindow.localICA()->isConnected() )
 	{
-		return -1;
+		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 );
+	splashScreen.finish( &mainWindow );
+
+	mainWindow.show();
 
-	mainWindow->show();
+	ilog( Info, "Exec" );
 
 	// let's rock!!
 	return app.exec();
diff --git a/ima/src/overview_widget.cpp b/ima/src/overview_widget.cpp
deleted file mode 100644
index 0fafa87..0000000
--- a/ima/src/overview_widget.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * overview_widget.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 "overview_widget.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() ) );
-}
-
-
-
-#include "overview_widget.moc"
-
diff --git a/ima/src/overview_widget.h b/ima/src/overview_widget.h
deleted file mode 100644
index 8baaa58..0000000
--- a/ima/src/overview_widget.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * overview_widget.h - declaration of overview widget for sidebar
- *
- * 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 _OVERVIEW_WIDGET_H
-#define _OVERVIEW_WIDGET_H
-
-#include "SideBarWidget.h"
-#include "dialogs/overview.uic"
-
-
-class overviewWidget : public SideBarWidget, private Ui::overview
-{
-	Q_OBJECT
-public:
-	overviewWidget( MainWindow * _main_window, QWidget * _parent );
-
-} ;
-
-
-#endif
diff --git a/ima/src/remote_control_widget.cpp b/ima/src/remote_control_widget.cpp
deleted file mode 100644
index bd93141..0000000
--- a/ima/src/remote_control_widget.cpp
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- *  remote_control_widget.cpp - 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.
- */
-
-
-#include "remote_control_widget.h"
-#include "vncview.h"
-#include "local_system.h"
-#include "tool_button.h"
-#include "MainWindow.h"
-
-#include <math.h>
-
-#include <QtCore/QTimer>
-#include <QtGui/QBitmap>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QLayout>
-#include <QtGui/QPainter>
-#include <QtGui/QPaintEvent>
-
-
-
-// toolbar for remote-control-widget
-remoteControlWidgetToolBar::remoteControlWidgetToolBar(
-			remoteControlWidget * _parent, bool _view_only ) :
-	QWidget( _parent ),
-	m_parent( _parent ),
-	m_disappear( FALSE ),
-	m_connecting( FALSE ),
-	m_icon( fastQImage( QImage( ":/resources/logo.png" ) ).
-					scaled( QSize( 48, 48 ) ) ),
-	m_iconGray( fastQImage( m_icon ).toGray().darken( 50 ) ),
-	m_iconState()
-{
-	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( _view_only );
-	fs_btn->setChecked( TRUE );
-
-	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() ) );
-}
-
-
-
-
-remoteControlWidgetToolBar::~remoteControlWidgetToolBar()
-{
-}
-
-
-
-
-void remoteControlWidgetToolBar::appear( void )
-{
-	m_disappear = FALSE;
-	if( y() <= -height() )
-	{
-		updatePosition();
-	}
-}
-
-
-
-
-void remoteControlWidgetToolBar::disappear( void )
-{
-	if( !m_connecting )
-	{
-		m_disappear = TRUE;
-		if( y() == 0 )
-		{
-			updatePosition();
-		}
-	}
-}
-
-
-
-
-void remoteControlWidgetToolBar::paintEvent( QPaintEvent * _pe )
-{
-	QPainter p( this );
-
-	p.fillRect( _pe->rect(), palette().brush( QPalette::Window ) );
-
-	p.drawImage( 5, 2, m_icon );
-
-	QFont f = p.font();
-	f.setPointSize( 12 );
-	f.setBold( TRUE );
-	p.setFont( f );
-
-	p.setPen( QColor( 255, 212, 0 ) );
-	m_parent->updateWindowTitle();
-	p.drawText( 64, 22, m_parent->windowTitle() );
-
-	p.setPen( QColor( 255, 255, 255 ) );
-	f.setPointSize( 10 );
-	p.setFont( f );
-
-	if( m_connecting )
-	{
-		fastQImage tmp = m_iconGray;
-		tmp.alphaFillMax( (int)( 150 + 90.0 *
-				sin( m_iconState.elapsed()*3.141592/900 ) ) );
-		p.drawImage( 5, 2, tmp );
-
-		QString dots;
-		for( int i = 0; i < ( m_iconState.elapsed() / 400 ) % 6;++i)
-		{
-			dots += ".";
-		}
-		p.drawText( 64, 40, tr( "Connecting %1" ).arg( dots ) );
-		QTimer::singleShot( 50, this, SLOT( update() ) );
-	}
-	else
-	{
-		p.drawText( 64, 40, tr( "Connected." ) );
-	}
-}
-
-
-
-
-void remoteControlWidgetToolBar::updatePosition( void )
-{
-	bool again;
-	if( m_disappear )
-	{
-		move( x(), qMax( -height(), y()-3 ) );
-		again = y() > -height();
-	}
-	else
-	{
-		move( x(), qMin( 0, y()+3 ) );
-		again = y() < 0;
-	}
-
-	update();
-
-	if( again )
-	{
-		QTimer::singleShot( 15, this, SLOT( updatePosition() ) );
-	}
-}
-
-
-
-
-void remoteControlWidgetToolBar::startConnection( void )
-{
-	m_connecting = TRUE;
-	m_iconState.restart();
-	appear();
-	update();
-}
-
-
-
-
-void remoteControlWidgetToolBar::connectionEstablished( void )
-{
-	m_connecting = FALSE;
-	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 _view_only,
-						MainWindow * _main_window ) :
-	QWidget( 0 ),
-	m_vncView( new vncView( _host, this, FALSE ) ),
-	m_toolBar( new remoteControlWidgetToolBar( this, _view_only ) ),
-	m_mainWindow( _main_window ),
-	m_extraStates( Qt::WindowMaximized )
-{
-	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( Q_UINT32, bool ) ),
-				this, SLOT( checkKeyEvent( Q_UINT32, bool ) ) );
-	//showMaximized();
-	showFullScreen();
-	localSystem::activateWindow( this );
-
-	toggleViewOnly( _view_only );
-}
-
-
-
-
-remoteControlWidget::~remoteControlWidget()
-{
-}
-
-
-
-
-QString remoteControlWidget::host( void ) const
-{
-	return( m_vncView->m_connection ? m_vncView->m_connection->host() :
-								QString::null );
-}
-
-
-
-
-void remoteControlWidget::updateWindowTitle( void )
-{
-	const QString s = m_vncView->viewOnly() ?
-			tr( "View live (%1 at host %2)" )
-		:
-			tr( "Remote control (%1 at host %2)" );
-	QString u = m_vncView->m_connection->user();
-	if( u.isEmpty() )
-	{
-		u = tr( "unknown user" );
-	}
-	else
-	{
-		u = u.section( '(', 1 ).section( ')', 0, 0 );
-	}
-	setWindowTitle( s.arg( u ).arg( host() ) );
-}
-
-
-
-
-void remoteControlWidget::resizeEvent( QResizeEvent * resizeEvent )
-{
-	m_vncView->resize( size() );
-	m_toolBar->setFixedSize( width(), 52 );
-	QWidget::resizeEvent( resizeEvent );
-}
-
-
-
-
-void remoteControlWidget::checkKeyEvent( Q_UINT32 _key, bool _pressed )
-{
-	if( _pressed && _key == XK_Escape &&
-		m_vncView->m_connection->state() != ivsConnection::Connected )
-	{
-		close();
-	}
-}
-
-
-
-
-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 );
-		setWindowState( windowState() | m_extraStates );
-		m_extraStates = Qt::WindowNoState;
-	}
-}
-
-
-
-
-void remoteControlWidget::toggleViewOnly( bool _on )
-{
-	m_vncView->setViewOnly( _on );
-	m_toolBar->update();
-}
-
-
-
-
-void remoteControlWidget::takeSnapshot( void )
-{
-	m_vncView->m_connection->takeSnapshot();
-	if( m_mainWindow )
-	{
-		m_mainWindow->reloadSnapshotList();
-	}
-}
-
-
-#include "remote_control_widget.moc"
-
diff --git a/ima/src/remote_control_widget.h b/ima/src/remote_control_widget.h
deleted file mode 100644
index 9d6c0c1..0000000
--- a/ima/src/remote_control_widget.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *  remote_control_widget.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/QTime>
-#include <QtGui/QWidget>
-
-#include "fast_qimage.h"
-
-
-class vncView;
-class remoteControlWidget;
-class MainWindow;
-
-
-
-class remoteControlWidgetToolBar : public QWidget
-{
-	Q_OBJECT
-public:
-	remoteControlWidgetToolBar( remoteControlWidget * _parent,
-							bool _view_only );
-	virtual ~remoteControlWidgetToolBar();
-
-
-public slots:
-	void appear( void );
-	void disappear( void );
-
-
-protected:
-	virtual void leaveEvent( QEvent * _e )
-	{
-		disappear();
-		QWidget::leaveEvent( _e );
-	}
-
-	virtual void paintEvent( QPaintEvent * _pe );
-
-
-private slots:
-	void updatePosition( void );
-	void startConnection( void );
-	void connectionEstablished( void );
-
-
-private:
-	remoteControlWidget * m_parent;
-	bool m_disappear;
-	bool m_connecting;
-	QImage m_icon;
-	fastQImage m_iconGray;
-	QTime m_iconState;
-
-} ;
-
-
-
-
-
-class remoteControlWidget : public QWidget
-{
-	Q_OBJECT
-public:
-	remoteControlWidget( const QString & _host, bool _view_only = FALSE,
-						MainWindow * _main_window = NULL );
-	virtual ~remoteControlWidget();
-
-	QString host( void ) const;
-
-
-public slots:
-	void lockStudent( bool );
-	void toggleFullScreen( bool );
-	void toggleViewOnly( bool );
-	void takeSnapshot( void );
-
-
-protected:
-	void updateWindowTitle( void );
-	virtual void resizeEvent( QResizeEvent * );
-
-
-private slots:
-	void checkKeyEvent( Q_UINT32, bool );
-
-
-private:
-	vncView * m_vncView;
-	remoteControlWidgetToolBar * m_toolBar;
-	MainWindow * m_mainWindow;
-
-	Qt::WindowStates m_extraStates;
-
-	friend class remoteControlWidgetToolBar;
-
-} ;
-
-
-#endif
-
diff --git a/ima/src/snapshot_list.cpp b/ima/src/snapshot_list.cpp
deleted file mode 100644
index 1789925..0000000
--- a/ima/src/snapshot_list.cpp
+++ /dev/null
@@ -1,176 +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/QScrollArea>
-
-
-#include "snapshot_list.h"
-#include "client.h"
-#include "local_system.h"
-
-
-
-snapshotList::snapshotList( MainWindow * _main_window, QWidget * _parent ) :
-	SideBarWidget( QPixmap( ":/resources/snapshot.png" ),
-			tr( "Snapshots" ),
-			tr( "Simply manage the snapshots you made using this "
-				"workspace." ),
-			_main_window, _parent )
-{
-	setupUi( contentParent() );
-
-	connect( list, SIGNAL( currentTextChanged( const QString & ) ), this,
-				SLOT( snapshotSelected( const QString & ) ) );
-	connect( list, SIGNAL( itemActivated( QListWidgetItem * ) ), this,
-			SLOT( snapshotActivated( QListWidgetItem * ) ) );
-
-	previewLbl->setScaledContents( TRUE );
-
-	QFont f = userDescLbl->font();
-	f.setBold( TRUE );
-	f.setItalic( TRUE );
-
-	userDescLbl->setFont( f );
-	dateDescLbl->setFont( f );
-	timeDescLbl->setFont( f );
-	hostDescLbl->setFont( f );
-
-	f.setBold( FALSE );
-	f.setItalic( FALSE );
-
-	connect( showBtn, SIGNAL( clicked() ), this,
-						SLOT( showSnapshot() ) );
-
-	connect( deleteBtn, SIGNAL( clicked() ), this,
-						SLOT( deleteSnapshot() ) );
-	connect( reloadBtn, SIGNAL( clicked() ), this, SLOT( reloadList() ) );
-
-	reloadList();
-}
-
-
-
-
-snapshotList::~snapshotList()
-{
-}
-
-
-
-
-
-void snapshotList::snapshotSelected( const QString & _s )
-{
-	previewLbl->setPixmap( localSystem::snapshotDir() + _s );
-	previewLbl->setFixedHeight( previewLbl->width() * 3 / 4 );
-	userLbl->setText( _s.section( '_', 0, 0 ) );
- 	hostLbl->setText( _s.section( '_', 1, 1 ) );
-	dateLbl->setText( QDate::fromString( _s.section( '_', 2, 2 ),
-				Qt::ISODate ).toString( Qt::LocalDate ) );
-	timeLbl->setText( _s.section( '_', 3, 3 ).section( '.', 0, 0 ).
-							replace( '-', ':' ) );
-}
-
-
-
-
-void snapshotList::snapshotDoubleClicked( const QString & _s )
-{
-	// maybe the user clicked on "show snapshot" and selected no
-	// snapshot...
-	if( _s == "" )
-	{
-		return;
-	}
-
-	QLabel * img_label = new QLabel;
-	img_label->setPixmap( localSystem::snapshotDir() + _s );
-	if( img_label->pixmap() != NULL )
-	{
-		img_label->setFixedSize( img_label->pixmap()->width(),
-					img_label->pixmap()->height() );
-	}
-
-	QScrollArea * sa = new QScrollArea;
-	sa->setAttribute( Qt::WA_DeleteOnClose, TRUE );
-	sa->move( 0, 0 );
-	sa->setWidget( img_label );
-	sa->setWindowTitle( _s );
-	sa->show();
-}
-
-
-
-
-void snapshotList::showSnapshot( void )
-{
-	if( list->currentItem() )
-	{
-		snapshotDoubleClicked( list->currentItem()->text() );
-	}
-}
-
-
-
-
-void snapshotList::deleteSnapshot( void )
-{
-	if( !list->currentItem() )
-	{
-		return;
-	}
-
-	const QString s = list->currentItem()->text();
-
-	// maybe the user clicked on "delete snapshot" and didn't select a
-	// snapshot...
-	if( s.isEmpty() )
-	{
-		return;
-	}
-
-	QFile( localSystem::snapshotDir() + s ).remove();
-
-	reloadList();
-}
-
-
-
-
-void snapshotList::reloadList( void )
-{
-	QDir sdir( localSystem::snapshotDir(), "*.png",
-						QDir::Name | QDir::IgnoreCase,
-						QDir::Files | QDir::Readable );
-
-	list->clear();
-	list->insertItems( 0, sdir.entryList() );
-}
-
-
-
-#include "snapshot_list.moc"
-
diff --git a/ima/src/snapshot_list.h b/ima/src/snapshot_list.h
deleted file mode 100644
index d75995b..0000000
--- a/ima/src/snapshot_list.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * snapshot_list.h - declaration of snapshot-list for side-bar
- *
- * Copyright (c) 2004-2006 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"
-#include "dialogs/snapshots.uic"
-
-
-class QLabel;
-class QPushButton;
-class QListWidget;
-
-
-class snapshotList : public SideBarWidget, private Ui::snapshots
-{
-	Q_OBJECT
-public:
-	snapshotList( MainWindow * _main_window, QWidget * _parent );
-	virtual ~snapshotList();
-
-
-public slots:
-	void reloadList( void );
-
-
-private slots:
-	void snapshotSelected( const QString & _s );
-	void snapshotActivated( QListWidgetItem * _item )
-	{
-		snapshotDoubleClicked( _item->text() );
-	}
-
-	void showSnapshot( void );
-	void deleteSnapshot( void );
-
-
-private:
-	void snapshotDoubleClicked( const QString & _s );
-
-} ;
-
-
-#endif
diff --git a/ima/src/tool_button.cpp b/ima/src/tool_button.cpp
deleted file mode 100644
index 909fc46..0000000
--- a/ima/src/tool_button.cpp
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * tool_button.cpp - implementation of iTALC-tool-button
- *
- * Copyright (c) 2006-2008 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 "tool_button.h"
-#include "fast_qimage.h"
-
-
-
-const int MARGIN = 10;
-const int ROUNDED = 2000;
-
-bool toolButton::s_toolTipsDisabled = FALSE;
-bool toolButton::s_iconOnlyMode = FALSE;
-
-
-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()
-{
-}
-
-
-
-
-void toolButton::setIconOnlyMode( bool _enabled )
-{
-	s_iconOnlyMode = _enabled;
-	QList<toolButton *> tbl = QApplication::activeWindow()->findChildren<toolButton *>();
-	foreach( toolButton * tb, tbl )
-	{
-		tb->updateSize();
-	}
-}
-
-
-
-
-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 );
-}
-
-
-
-
-#include "tool_button.moc"
diff --git a/ima/src/tool_button.h b/ima/src/tool_button.h
deleted file mode 100644
index e1e1004..0000000
--- a/ima/src/tool_button.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * tool_button.h - declaration of class toolButton 
- *
- * Copyright (c) 2006-2010 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 "fast_qimage.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();
-
-
-	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 );
-	}
-
-	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();
-
-
-	static bool s_toolTipsDisabled;
-	static bool s_iconOnlyMode;
-
-	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
-{
-	Q_OBJECT
-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 slots:
-	void updateMask( void );
-
-
-private:
-	QImage m_icon;
-	QString m_title;
-	QString m_description;
-
-	QImage m_bg;
-
-	QWidget * m_toolButton;
-
-} ;
-
-
-
-#endif
-
diff --git a/imc/CMakeLists.txt b/imc/CMakeLists.txt
new file mode 100644
index 0000000..d088587
--- /dev/null
+++ b/imc/CMakeLists.txt
@@ -0,0 +1,31 @@
+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_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
new file mode 100644
index 0000000..b5a4a76
--- /dev/null
+++ b/imc/Forms/KeyFileAssistant.ui
@@ -0,0 +1,973 @@
+<?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
new file mode 100644
index 0000000..1b8f06f
--- /dev/null
+++ b/imc/Forms/LogonGroupEditor.ui
@@ -0,0 +1,214 @@
+<?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
new file mode 100644
index 0000000..bf50f34
--- /dev/null
+++ b/imc/Forms/MainWindow.ui
@@ -0,0 +1,1633 @@
+<?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</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
new file mode 100644
index 0000000..494980e
Binary files /dev/null and b/imc/Resources/Authentication.png differ
diff --git a/imc/Resources/General.png b/imc/Resources/General.png
new file mode 100644
index 0000000..06740ba
Binary files /dev/null and b/imc/Resources/General.png differ
diff --git a/imc/Resources/Paths.png b/imc/Resources/Paths.png
new file mode 100644
index 0000000..3f55aa6
Binary files /dev/null and b/imc/Resources/Paths.png differ
diff --git a/imc/Resources/Vnc.png b/imc/Resources/Vnc.png
new file mode 100644
index 0000000..0ceb476
Binary files /dev/null and b/imc/Resources/Vnc.png differ
diff --git a/imc/Resources/arrow-right.png b/imc/Resources/arrow-right.png
new file mode 100644
index 0000000..0acee70
Binary files /dev/null and b/imc/Resources/arrow-right.png differ
diff --git a/imc/Resources/document-open.png b/imc/Resources/document-open.png
new file mode 100644
index 0000000..b225e9a
Binary files /dev/null and b/imc/Resources/document-open.png differ
diff --git a/imc/Resources/document-save.png b/imc/Resources/document-save.png
new file mode 100644
index 0000000..8072aea
Binary files /dev/null and b/imc/Resources/document-save.png differ
diff --git a/imc/Resources/edit-clear.png b/imc/Resources/edit-clear.png
new file mode 100644
index 0000000..19a1665
Binary files /dev/null and b/imc/Resources/edit-clear.png differ
diff --git a/imc/Resources/go-next.png b/imc/Resources/go-next.png
new file mode 100644
index 0000000..a04c99e
Binary files /dev/null and b/imc/Resources/go-next.png differ
diff --git a/imc/Resources/go-previous.png b/imc/Resources/go-previous.png
new file mode 100644
index 0000000..940797b
Binary files /dev/null and b/imc/Resources/go-previous.png differ
diff --git a/imc/Resources/help-hint.png b/imc/Resources/help-hint.png
new file mode 100644
index 0000000..fac7493
Binary files /dev/null and b/imc/Resources/help-hint.png differ
diff --git a/imc/Resources/imc.ico b/imc/Resources/imc.ico
new file mode 100644
index 0000000..81e633c
Binary files /dev/null and b/imc/Resources/imc.ico differ
diff --git a/imc/Resources/imc.png b/imc/Resources/imc.png
new file mode 100644
index 0000000..fa379d8
Binary files /dev/null and b/imc/Resources/imc.png differ
diff --git a/imc/Resources/kbugbuster.png b/imc/Resources/kbugbuster.png
new file mode 100644
index 0000000..239a43e
Binary files /dev/null and b/imc/Resources/kbugbuster.png differ
diff --git a/imc/Resources/preferences-other.png b/imc/Resources/preferences-other.png
new file mode 100644
index 0000000..13395f0
Binary files /dev/null and b/imc/Resources/preferences-other.png differ
diff --git a/imc/Resources/system-shutdown.png b/imc/Resources/system-shutdown.png
new file mode 100644
index 0000000..201353e
Binary files /dev/null and b/imc/Resources/system-shutdown.png differ
diff --git a/imc/Resources/task-accepted.png b/imc/Resources/task-accepted.png
new file mode 100644
index 0000000..225abbf
Binary files /dev/null and b/imc/Resources/task-accepted.png differ
diff --git a/imc/Resources/tools-wizard.png b/imc/Resources/tools-wizard.png
new file mode 100644
index 0000000..f67fb4c
Binary files /dev/null and b/imc/Resources/tools-wizard.png differ
diff --git a/imc/imc.qrc b/imc/imc.qrc
new file mode 100644
index 0000000..6a98e9c
--- /dev/null
+++ b/imc/imc.qrc
@@ -0,0 +1,21 @@
+<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
new file mode 100644
index 0000000..298716b
--- /dev/null
+++ b/imc/imc.rc
@@ -0,0 +1,26 @@
+imcicon ICON Resources/imc.ico
+#include <windows.h>
+
+VS_VERSION_INFO	VERSIONINFO
+  FILEVERSION	2,0,0,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-2011 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
new file mode 100644
index 0000000..a677cb3
--- /dev/null
+++ b/imc/imc.rc.in
@@ -0,0 +1,26 @@
+imcicon ICON Resources/imc.ico
+#include <windows.h>
+
+VS_VERSION_INFO	VERSIONINFO
+  FILEVERSION	2,0,0,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-2011 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
new file mode 100644
index 0000000..8eaa2ea
--- /dev/null
+++ b/imc/src/FileSystemBrowser.cpp
@@ -0,0 +1,101 @@
+/*
+ * FileSystemBrowser.cpp - 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.
+ *
+ */
+
+#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;
+	}
+
+	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;
+	}
+
+	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
new file mode 100644
index 0000000..e22a2c9
--- /dev/null
+++ b/imc/src/FileSystemBrowser.h
@@ -0,0 +1,74 @@
+/*
+ * 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
new file mode 100644
index 0000000..9088d39
--- /dev/null
+++ b/imc/src/ImcCore.cpp
@@ -0,0 +1,248 @@
+/*
+ * 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;
+
+
+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 &&
+			!QCoreApplication::instance()->arguments().contains( "-quiet" ) )
+	{
+		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 &&
+			!QCoreApplication::instance()->arguments().contains( "-quiet" ) )
+	{
+		QMessageBox::critical( NULL, title, msg );
+	}
+}
+
+
+
+}
+
+
diff --git a/imc/src/ImcCore.h b/imc/src/ImcCore.h
new file mode 100644
index 0000000..ab5f0c1
--- /dev/null
+++ b/imc/src/ImcCore.h
@@ -0,0 +1,57 @@
+/*
+ * ImcCore.h - 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.
+ *
+ */
+
+#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 );
+
+	// UI objects
+	extern MainWindow * mainWindow;
+
+} ;
+
+
+#endif
diff --git a/imc/src/KeyDirectoriesPage.cpp b/imc/src/KeyDirectoriesPage.cpp
new file mode 100644
index 0000000..27eb4d4
--- /dev/null
+++ b/imc/src/KeyDirectoriesPage.cpp
@@ -0,0 +1,96 @@
+/*
+ * 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
new file mode 100644
index 0000000..85d9ef5
--- /dev/null
+++ b/imc/src/KeyDirectoriesPage.h
@@ -0,0 +1,50 @@
+/*
+ * 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
new file mode 100644
index 0000000..a6fecfa
--- /dev/null
+++ b/imc/src/KeyFileAssistant.cpp
@@ -0,0 +1,186 @@
+/*
+ * 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
new file mode 100644
index 0000000..2c4cdef
--- /dev/null
+++ b/imc/src/KeyFileAssistant.h
@@ -0,0 +1,52 @@
+/*
+ * 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
new file mode 100644
index 0000000..09a712b
--- /dev/null
+++ b/imc/src/KeyFileAssistantModePage.cpp
@@ -0,0 +1,54 @@
+/*
+ * 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
new file mode 100644
index 0000000..2967226
--- /dev/null
+++ b/imc/src/KeyFileAssistantModePage.h
@@ -0,0 +1,51 @@
+/*
+ * 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
new file mode 100644
index 0000000..0360871
--- /dev/null
+++ b/imc/src/LogonAclSettings.h
@@ -0,0 +1,109 @@
+/*
+ * 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
new file mode 100644
index 0000000..d24ebfe
--- /dev/null
+++ b/imc/src/LogonGroupEditor.cpp
@@ -0,0 +1,192 @@
+/*
+ * 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
new file mode 100644
index 0000000..38a98d7
--- /dev/null
+++ b/imc/src/LogonGroupEditor.h
@@ -0,0 +1,56 @@
+/*
+ * 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
new file mode 100644
index 0000000..134d515
--- /dev/null
+++ b/imc/src/MainWindow.cpp
@@ -0,0 +1,674 @@
+/*
+ * MainWindow.cpp - implementation of MainWindow class
+ *
+ * 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>
+
+#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";
+#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
new file mode 100644
index 0000000..a935b33
--- /dev/null
+++ b/imc/src/MainWindow.h
@@ -0,0 +1,79 @@
+/*
+ * MainWindow.h - main window of the 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.
+ *
+ */
+
+#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();
+
+
+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 manageACLs();
+	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
new file mode 100644
index 0000000..0f274f7
--- /dev/null
+++ b/imc/src/SystemConfigurationModifier.cpp
@@ -0,0 +1,582 @@
+/*
+ * SystemConfigurationModifier.cpp - class for easy modification of iTALC-related
+ *                                   settings in the operating system
+ *
+ * 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>
+
+#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 ) )
+			{
+				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 ) )
+		{
+			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
new file mode 100644
index 0000000..252439a
--- /dev/null
+++ b/imc/src/SystemConfigurationModifier.h
@@ -0,0 +1,41 @@
+/*
+ * 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
new file mode 100644
index 0000000..5718c76
--- /dev/null
+++ b/imc/src/Win32AclEditor.cpp
@@ -0,0 +1,157 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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
new file mode 100644
index 0000000..f3f81af
--- /dev/null
+++ b/imc/src/Win32AclEditor.h
@@ -0,0 +1,58 @@
+/////////////////////////////////////////////////////////////////////////////
+//  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) {}
+
+	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
new file mode 100644
index 0000000..ed31db4
--- /dev/null
+++ b/imc/src/main.cpp
@@ -0,0 +1,233 @@
+/*
+ * main.cpp - main file for 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 <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();
+
+	// 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( QCoreApplication::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();
+
+	ilog( Info, "App.Exec" );
+
+	int ret = app.exec();
+
+	ItalcCore::destroy();
+
+	return ret;
+}
+
diff --git a/imc/src/netfw.h b/imc/src/netfw.h
new file mode 100644
index 0000000..ea36056
--- /dev/null
+++ b/imc/src/netfw.h
@@ -0,0 +1,4563 @@
+/*** 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/install-sh b/install-sh
deleted file mode 100755
index 6781b98..0000000
--- a/install-sh
+++ /dev/null
@@ -1,520 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2009-04-28.21; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 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 CONNEC-
-# TION 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 deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" ""	$nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
-  test "$posix_glob" != "?" || {
-    if (set -f) 2>/dev/null; then
-      posix_glob=
-    else
-      posix_glob=:
-    fi
-  }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-no_target_directory=
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
-   or: $0 [OPTION]... SRCFILES... DIRECTORY
-   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
-   or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
-     --help     display this help and exit.
-     --version  display version info and exit.
-
-  -c            (ignored)
-  -C            install only if different (preserve the last data modification time)
-  -d            create directories instead of installing files.
-  -g GROUP      $chgrpprog installed files to GROUP.
-  -m MODE       $chmodprog installed files to MODE.
-  -o USER       $chownprog installed files to USER.
-  -s            $stripprog installed files.
-  -t DIRECTORY  install into DIRECTORY.
-  -T            report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
-  RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
-  case $1 in
-    -c) ;;
-
-    -C) copy_on_change=true;;
-
-    -d) dir_arg=true;;
-
-    -g) chgrpcmd="$chgrpprog $2"
-	shift;;
-
-    --help) echo "$usage"; exit $?;;
-
-    -m) mode=$2
-	case $mode in
-	  *' '* | *'	'* | *'
-'*	  | *'*'* | *'?'* | *'['*)
-	    echo "$0: invalid mode: $mode" >&2
-	    exit 1;;
-	esac
-	shift;;
-
-    -o) chowncmd="$chownprog $2"
-	shift;;
-
-    -s) stripcmd=$stripprog;;
-
-    -t) dst_arg=$2
-	shift;;
-
-    -T) no_target_directory=true;;
-
-    --version) echo "$0 $scriptversion"; exit $?;;
-
-    --)	shift
-	break;;
-
-    -*)	echo "$0: invalid option: $1" >&2
-	exit 1;;
-
-    *)  break;;
-  esac
-  shift
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
-  # When -d is used, all remaining arguments are directories to create.
-  # When -t is used, the destination is already specified.
-  # Otherwise, the last argument is the destination.  Remove it from $@.
-  for arg
-  do
-    if test -n "$dst_arg"; then
-      # $@ is not empty: it contains at least $arg.
-      set fnord "$@" "$dst_arg"
-      shift # fnord
-    fi
-    shift # arg
-    dst_arg=$arg
-  done
-fi
-
-if test $# -eq 0; then
-  if test -z "$dir_arg"; then
-    echo "$0: no input file specified." >&2
-    exit 1
-  fi
-  # It's OK to call `install-sh -d' without argument.
-  # This can happen when creating conditional directories.
-  exit 0
-fi
-
-if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
-
-  # Set umask so as not to create temps with too-generous modes.
-  # However, 'strip' requires both read and write access to temps.
-  case $mode in
-    # Optimize common cases.
-    *644) cp_umask=133;;
-    *755) cp_umask=22;;
-
-    *[0-7])
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw='% 200'
-      fi
-      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
-    *)
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw=,u+rw
-      fi
-      cp_umask=$mode$u_plus_rw;;
-  esac
-fi
-
-for src
-do
-  # Protect names starting with `-'.
-  case $src in
-    -*) src=./$src;;
-  esac
-
-  if test -n "$dir_arg"; then
-    dst=$src
-    dstdir=$dst
-    test -d "$dstdir"
-    dstdir_status=$?
-  else
-
-    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
-    # might cause directories to be created, which would be especially bad
-    # if $src (and thus $dsttmp) contains '*'.
-    if test ! -f "$src" && test ! -d "$src"; then
-      echo "$0: $src does not exist." >&2
-      exit 1
-    fi
-
-    if test -z "$dst_arg"; then
-      echo "$0: no destination specified." >&2
-      exit 1
-    fi
-
-    dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
-
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
-    if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-	echo "$0: $dst_arg: Is a directory" >&2
-	exit 1
-      fi
-      dstdir=$dst
-      dst=$dstdir/`basename "$src"`
-      dstdir_status=0
-    else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
-      test -d "$dstdir"
-      dstdir_status=$?
-    fi
-  fi
-
-  obsolete_mkdir_used=false
-
-  if test $dstdir_status != 0; then
-    case $posix_mkdir in
-      '')
-	# Create intermediate dirs using mode 755 as modified by the umask.
-	# This is like FreeBSD 'install' as of 1997-10-28.
-	umask=`umask`
-	case $stripcmd.$umask in
-	  # Optimize common cases.
-	  *[2367][2367]) mkdir_umask=$umask;;
-	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-	  *[0-7])
-	    mkdir_umask=`expr $umask + 22 \
-	      - $umask % 100 % 40 + $umask % 20 \
-	      - $umask % 10 % 4 + $umask % 2
-	    `;;
-	  *) mkdir_umask=$umask,go-w;;
-	esac
-
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, rely on $mkdir_umask.
-	if test -n "$dir_arg"; then
-	  mkdir_mode=-m$mode
-	else
-	  mkdir_mode=
-	fi
-
-	posix_mkdir=false
-	case $umask in
-	  *[123567][0-7][0-7])
-	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
-	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-	    ;;
-	  *)
-	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-	    if (umask $mkdir_umask &&
-		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-	    then
-	      if test -z "$dir_arg" || {
-		   # Check for POSIX incompatibilities with -m.
-		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writeable bit of parent directory when it shouldn't.
-		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-		   case $ls_ld_tmpdir in
-		     d????-?r-*) different_mode=700;;
-		     d????-?--*) different_mode=755;;
-		     *) false;;
-		   esac &&
-		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-		   }
-		 }
-	      then posix_mkdir=:
-	      fi
-	      rmdir "$tmpdir/d" "$tmpdir"
-	    else
-	      # Remove any dirs left behind by ancient mkdir implementations.
-	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-	    fi
-	    trap '' 0;;
-	esac;;
-    esac
-
-    if
-      $posix_mkdir && (
-	umask $mkdir_umask &&
-	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
-      )
-    then :
-    else
-
-      # The umask is ridiculous, or mkdir does not conform to POSIX,
-      # or it failed possibly due to a race condition.  Create the
-      # directory the slow way, step by step, checking for races as we go.
-
-      case $dstdir in
-	/*) prefix='/';;
-	-*) prefix='./';;
-	*)  prefix='';;
-      esac
-
-      eval "$initialize_posix_glob"
-
-      oIFS=$IFS
-      IFS=/
-      $posix_glob set -f
-      set fnord $dstdir
-      shift
-      $posix_glob set +f
-      IFS=$oIFS
-
-      prefixes=
-
-      for d
-      do
-	test -z "$d" && continue
-
-	prefix=$prefix$d
-	if test -d "$prefix"; then
-	  prefixes=
-	else
-	  if $posix_mkdir; then
-	    (umask=$mkdir_umask &&
-	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-	    # Don't fail if two instances are running concurrently.
-	    test -d "$prefix" || exit 1
-	  else
-	    case $prefix in
-	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-	      *) qprefix=$prefix;;
-	    esac
-	    prefixes="$prefixes '$qprefix'"
-	  fi
-	fi
-	prefix=$prefix/
-      done
-
-      if test -n "$prefixes"; then
-	# Don't fail if two instances are running concurrently.
-	(umask $mkdir_umask &&
-	 eval "\$doit_exec \$mkdirprog $prefixes") ||
-	  test -d "$dstdir" || exit 1
-	obsolete_mkdir_used=true
-      fi
-    fi
-  fi
-
-  if test -n "$dir_arg"; then
-    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
-    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
-      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
-  else
-
-    # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
-
-    # Trap to clean up those temp files at exit.
-    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
-    # Copy the file name to the temp name.
-    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
-    # and set any options; do chmod last to preserve setuid bits.
-    #
-    # If any of these fail, we abort the whole thing.  If we want to
-    # ignore errors from any of these, just make sure not to ignore
-    # errors from the above "$doit $cpprog $src $dsttmp" command.
-    #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
-    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
-    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
-    # If -C, don't bother to copy if it wouldn't change the file.
-    if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
-
-       eval "$initialize_posix_glob" &&
-       $posix_glob set -f &&
-       set X $old && old=:$2:$4:$5:$6 &&
-       set X $new && new=:$2:$4:$5:$6 &&
-       $posix_glob set +f &&
-
-       test "$old" = "$new" &&
-       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
-    then
-      rm -f "$dsttmp"
-    else
-      # Rename the file to the real destination.
-      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
-      # The rename failed, perhaps because mv can't rename something else
-      # to itself, or perhaps because mv is so ancient that it does not
-      # support -f.
-      {
-	# Now remove or move aside any old file at destination location.
-	# We try this two ways since rm can't unlink itself on some
-	# systems and the destination file might be busy for other
-	# reasons.  In this case, the final cleanup might fail but the new
-	# file should still install successfully.
-	{
-	  test ! -f "$dst" ||
-	  $doit $rmcmd -f "$dst" 2>/dev/null ||
-	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-	  } ||
-	  { echo "$0: cannot unlink or rename $dst" >&2
-	    (exit 1); exit 1
-	  }
-	} &&
-
-	# Now rename the file to the real destination.
-	$doit $mvcmd "$dsttmp" "$dst"
-      }
-    fi || exit 1
-
-    trap '' 0
-  fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/italcconfig.h.in b/italcconfig.h.in
new file mode 100644
index 0000000..a2fcf86
--- /dev/null
+++ b/italcconfig.h.in
@@ -0,0 +1,106 @@
+#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_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
new file mode 100644
index 0000000..dc31653
--- /dev/null
+++ b/lib/CMakeLists.txt
@@ -0,0 +1,45 @@
+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/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/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
new file mode 100644
index 0000000..defbf46
--- /dev/null
+++ b/lib/ItalcCore.qrc
@@ -0,0 +1,51 @@
+<RCC>
+  <qresource>
+    <file>resources/icon64.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/cs.qm</file>
+    <file>resources/it.qm</file>
+    <file>resources/es.qm</file>
+    <file>resources/fr.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/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/Makefile.am b/lib/Makefile.am
deleted file mode 100644
index bc4cda8..0000000
--- a/lib/Makefile.am
+++ /dev/null
@@ -1,125 +0,0 @@
-AUTOMAKE_OPTIONS = foreign
-
-%.moc: $(srcdir)/%.h
-	$(MOC) -o $@ $<
-
-%.ts: 
-	$(LUPDATE)							\
-		$(srcdir)/src/*.cpp				\
-		$(srcdir)/../ica/src/*.cpp		\
-		$(srcdir)/../ima/src/*.cpp		\
-		$(srcdir)/../ima/dialogs/*.ui	\
-		$(srcdir)/../setup/src/*.cpp	\
-		$(srcdir)/../setup/dialogs/*.ui	\
-		-ts $(srcdir)/resources/$@		\
-		-locations none -no-obsolete
-
-%.qm: %.ts
-	$(LRELEASE) $(srcdir)/resources/$< -qm $(srcdir)/resources/$@
-
-
-
-./italc_core_qrc.cpp: italc_core.qrc
-	$(RCC) $< -name italc_core > $@
-
-
-noinst_LIBRARIES = libitalc_core-static.a
-
-libitalc_core_static_a_MOC =				\
-		include/vncview.moc			\
-		include/system_key_trapper.moc		\
-		include/progress_widget.moc		\
-		include/isd_connection.moc		\
-		include/ivs_connection.moc
-
-CLEANFILES =	include/rfb/rfbconfig.h			\
-		include/rfb/rfbint.h			\
-		$(libitalc_core_static_a_MOC)		\
-		./italc_core_qrc.cpp
-
-BUILT_SOURCES = $(libitalc_core_static_a_MOC) ./italc_core_qrc.cpp shared-lib
-
-libitalc_core_static_a_SOURCES =			\
-		$(srcdir)/src/dsa_key.cpp		\
-		$(srcdir)/src/fast_qimage.cpp		\
-		$(srcdir)/src/inject.cpp		\
-		$(srcdir)/src/isd_base.cpp		\
-		$(srcdir)/src/isd_connection.cpp	\
-		$(srcdir)/src/ivs_connection.cpp	\
-		$(srcdir)/src/local_system.cpp		\
-		$(srcdir)/src/lock_widget.cpp		\
-		$(srcdir)/src/messagebox.cpp		\
-		$(srcdir)/src/minilzo.c			\
-		$(srcdir)/src/progress_widget.cpp	\
-		$(srcdir)/src/system_key_trapper.cpp	\
-		$(srcdir)/src/vncview.cpp		\
-		$(srcdir)/include/debug.h		\
-		$(srcdir)/include/dsa_key.h		\
-		$(srcdir)/include/fast_qimage.h		\
-		$(srcdir)/include/inject.h		\
-		$(srcdir)/include/isd_base.h		\
-		$(srcdir)/include/isd_connection.h	\
-		$(srcdir)/include/italc_rfb_ext.h	\
-		$(srcdir)/include/ivs_connection.h	\
-		$(srcdir)/include/local_system.h	\
-		$(srcdir)/include/lock_widget.h		\
-		$(srcdir)/include/lzoconf.h		\
-		$(srcdir)/include/lzodefs.h		\
-		$(srcdir)/include/messagebox.h		\
-		$(srcdir)/include/minilzo.h		\
-		$(srcdir)/include/progress_widget.h	\
-		$(srcdir)/include/qt_features.h		\
-		$(srcdir)/include/qt_user_events.h	\
-		$(srcdir)/include/types.h		\
-		$(srcdir)/include/system_key_trapper.h	\
-		$(srcdir)/include/vncview.h		\
-		$(srcdir)/include/QuadTree.h		\
-		$(srcdir)/include/rfb/keysym.h		\
-		$(srcdir)/include/rfb/rfb.h		\
-		$(srcdir)/include/rfb/rfbclient.h	\
-		$(srcdir)/include/rfb/rfbproto.h	\
-		$(srcdir)/italc_core_qrc.cpp		\
-		$(srcdir)/italc_core.qrc		\
-		$(wildcard $(srcdir)/resources/*.qm $(srcdir)/resources/*.ts) \
-		$(wildcard $(srcdir)/resources/*.png)
-
-
-inject.o: $(srcdir)/src/inject.cpp
-	$(CXX) -c -o $@ $< -DHAVE_CONFIG_H $(CXXFLAGS) $(QT_CXXFLAGS) $(INCLUDES) $(CPPFLAGS) -O0
-
-if HAVE_LIBSSL
-LIBSSL = -lssl -lcrypto
-endif
-
-if HAVE_LIBEAY32
-LIBSSL = -leay32
-endif
-
-
-if BUILD_WIN32
-shared-lib: italc_core.dll
-
-italc_core.dll: libitalc_core-static.a
-	$(CXX) *.o -shared -Wl,-no-undefined -Wl,-enable-runtime-pseudo-reloc -Wl,-export-all-symbols -Wl,--out-implib,libitalc_core.a -o $@ $(QT_LDADD) $(QT_LIB_GUI) $(LIBSSL) -lz -ljpeg -lpsapi && $(STRIP) italc_core.dll
-
-pkglib_LTLIBRARIES = italc_core.dll
-italc_core_dll_SOURCES =
-
-endif
-
-if BUILD_LINUX
-shared-lib: libitalc_core.so
-
-libitalc_core.so: libitalc_core-static.a
-	$(CXX) *.o -shared -Wl,-no-undefined -Wl,-soname,libitalc_core.so -o $@  $(QT_LDADD) $(QT_LIB_GUI) $(LIBSSL) -lz -ljpeg
-
-pkglib_LTLIBRARIES = libitalc_core.so
-libitalc_core_so_SOURCES =
-
-endif
-
-
-AM_CXXFLAGS = $(QT_CXXFLAGS) -O2 -DBUILD_ICA -DBUILD_LIBRARY $(CXXFLAGS_ADD)
-
-INCLUDES = -I$(srcdir)/include -I$(top_srcdir)
-
diff --git a/lib/Makefile.in b/lib/Makefile.in
deleted file mode 100644
index 3374568..0000000
--- a/lib/Makefile.in
+++ /dev/null
@@ -1,901 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-subdir = lib
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-libitalc_core_static_a_AR = $(AR) $(ARFLAGS)
-libitalc_core_static_a_LIBADD =
-am_libitalc_core_static_a_OBJECTS = dsa_key.$(OBJEXT) \
-	fast_qimage.$(OBJEXT) inject.$(OBJEXT) isd_base.$(OBJEXT) \
-	isd_connection.$(OBJEXT) ivs_connection.$(OBJEXT) \
-	local_system.$(OBJEXT) lock_widget.$(OBJEXT) \
-	messagebox.$(OBJEXT) minilzo.$(OBJEXT) \
-	progress_widget.$(OBJEXT) system_key_trapper.$(OBJEXT) \
-	vncview.$(OBJEXT) italc_core_qrc.$(OBJEXT)
-libitalc_core_static_a_OBJECTS = $(am_libitalc_core_static_a_OBJECTS)
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
-  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo "$$p $$p"; done | \
-  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
-    if (++n[$$2] == $(am__install_max)) \
-      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
-    END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(pkglibdir)"
-LTLIBRARIES = $(pkglib_LTLIBRARIES)
-italc_core_dll_LIBADD =
-am_italc_core_dll_OBJECTS =
-italc_core_dll_OBJECTS = $(am_italc_core_dll_OBJECTS)
- at BUILD_WIN32_TRUE@am_italc_core_dll_rpath = -rpath $(pkglibdir)
-libitalc_core_so_LIBADD =
-am_libitalc_core_so_OBJECTS =
-libitalc_core_so_OBJECTS = $(am_libitalc_core_so_OBJECTS)
- at BUILD_LINUX_TRUE@am_libitalc_core_so_rpath = -rpath $(pkglibdir)
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(libitalc_core_static_a_SOURCES) $(italc_core_dll_SOURCES) \
-	$(libitalc_core_so_SOURCES)
-DIST_SOURCES = $(libitalc_core_static_a_SOURCES) \
-	$(italc_core_dll_SOURCES) $(libitalc_core_so_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LRELEASE = @LRELEASE@
-LTLIBOBJS = @LTLIBOBJS@
-LUPDATE = @LUPDATE@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-MOC = @MOC@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-QT_CXXFLAGS = @QT_CXXFLAGS@
-QT_LDADD = @QT_LDADD@
-QT_LIB_GUI = @QT_LIB_GUI@
-RANLIB = @RANLIB@
-RCC = @RCC@
-RPMSOURCEDIR = @RPMSOURCEDIR@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-UIC = @UIC@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign
-noinst_LIBRARIES = libitalc_core-static.a
-libitalc_core_static_a_MOC = \
-		include/vncview.moc			\
-		include/system_key_trapper.moc		\
-		include/progress_widget.moc		\
-		include/isd_connection.moc		\
-		include/ivs_connection.moc
-
-CLEANFILES = include/rfb/rfbconfig.h			\
-		include/rfb/rfbint.h			\
-		$(libitalc_core_static_a_MOC)		\
-		./italc_core_qrc.cpp
-
-BUILT_SOURCES = $(libitalc_core_static_a_MOC) ./italc_core_qrc.cpp shared-lib
-libitalc_core_static_a_SOURCES = \
-		$(srcdir)/src/dsa_key.cpp		\
-		$(srcdir)/src/fast_qimage.cpp		\
-		$(srcdir)/src/inject.cpp		\
-		$(srcdir)/src/isd_base.cpp		\
-		$(srcdir)/src/isd_connection.cpp	\
-		$(srcdir)/src/ivs_connection.cpp	\
-		$(srcdir)/src/local_system.cpp		\
-		$(srcdir)/src/lock_widget.cpp		\
-		$(srcdir)/src/messagebox.cpp		\
-		$(srcdir)/src/minilzo.c			\
-		$(srcdir)/src/progress_widget.cpp	\
-		$(srcdir)/src/system_key_trapper.cpp	\
-		$(srcdir)/src/vncview.cpp		\
-		$(srcdir)/include/debug.h		\
-		$(srcdir)/include/dsa_key.h		\
-		$(srcdir)/include/fast_qimage.h		\
-		$(srcdir)/include/inject.h		\
-		$(srcdir)/include/isd_base.h		\
-		$(srcdir)/include/isd_connection.h	\
-		$(srcdir)/include/italc_rfb_ext.h	\
-		$(srcdir)/include/ivs_connection.h	\
-		$(srcdir)/include/local_system.h	\
-		$(srcdir)/include/lock_widget.h		\
-		$(srcdir)/include/lzoconf.h		\
-		$(srcdir)/include/lzodefs.h		\
-		$(srcdir)/include/messagebox.h		\
-		$(srcdir)/include/minilzo.h		\
-		$(srcdir)/include/progress_widget.h	\
-		$(srcdir)/include/qt_features.h		\
-		$(srcdir)/include/qt_user_events.h	\
-		$(srcdir)/include/types.h		\
-		$(srcdir)/include/system_key_trapper.h	\
-		$(srcdir)/include/vncview.h		\
-		$(srcdir)/include/QuadTree.h		\
-		$(srcdir)/include/rfb/keysym.h		\
-		$(srcdir)/include/rfb/rfb.h		\
-		$(srcdir)/include/rfb/rfbclient.h	\
-		$(srcdir)/include/rfb/rfbproto.h	\
-		$(srcdir)/italc_core_qrc.cpp		\
-		$(srcdir)/italc_core.qrc		\
-		$(wildcard $(srcdir)/resources/*.qm $(srcdir)/resources/*.ts) \
-		$(wildcard $(srcdir)/resources/*.png)
-
- at HAVE_LIBEAY32_TRUE@LIBSSL = -leay32
- at HAVE_LIBSSL_TRUE@LIBSSL = -lssl -lcrypto
- at BUILD_LINUX_TRUE@pkglib_LTLIBRARIES = libitalc_core.so
- at BUILD_WIN32_TRUE@pkglib_LTLIBRARIES = italc_core.dll
- at BUILD_WIN32_TRUE@italc_core_dll_SOURCES = 
- at BUILD_LINUX_TRUE@libitalc_core_so_SOURCES = 
-AM_CXXFLAGS = $(QT_CXXFLAGS) -O2 -DBUILD_ICA -DBUILD_LIBRARY $(CXXFLAGS_ADD)
-INCLUDES = -I$(srcdir)/include -I$(top_srcdir)
-all: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lib/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign lib/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-clean-noinstLIBRARIES:
-	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libitalc_core-static.a: $(libitalc_core_static_a_OBJECTS) $(libitalc_core_static_a_DEPENDENCIES) 
-	-rm -f libitalc_core-static.a
-	$(libitalc_core_static_a_AR) libitalc_core-static.a $(libitalc_core_static_a_OBJECTS) $(libitalc_core_static_a_LIBADD)
-	$(RANLIB) libitalc_core-static.a
-install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
-	@$(NORMAL_INSTALL)
-	test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	list2=; for p in $$list; do \
-	  if test -f $$p; then \
-	    list2="$$list2 $$p"; \
-	  else :; fi; \
-	done; \
-	test -z "$$list2" || { \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
-	}
-
-uninstall-pkglibLTLIBRARIES:
-	@$(NORMAL_UNINSTALL)
-	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
-	for p in $$list; do \
-	  $(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
-	done
-
-clean-pkglibLTLIBRARIES:
-	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
-	@list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
-	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-	  test "$$dir" != "$$p" || dir=.; \
-	  echo "rm -f \"$${dir}/so_locations\""; \
-	  rm -f "$${dir}/so_locations"; \
-	done
- at BUILD_WIN32_FALSE@italc_core.dll: $(italc_core_dll_OBJECTS) $(italc_core_dll_DEPENDENCIES) 
- at BUILD_WIN32_FALSE@	$(LINK) $(am_italc_core_dll_rpath) $(italc_core_dll_OBJECTS) $(italc_core_dll_LIBADD) $(LIBS)
- at BUILD_LINUX_FALSE@libitalc_core.so: $(libitalc_core_so_OBJECTS) $(libitalc_core_so_DEPENDENCIES) 
- at BUILD_LINUX_FALSE@	$(LINK) $(am_libitalc_core_so_rpath) $(libitalc_core_so_OBJECTS) $(libitalc_core_so_LIBADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dsa_key.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fast_qimage.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/inject.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/isd_base.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/isd_connection.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/italc_core_qrc.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ivs_connection.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/local_system.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lock_widget.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/messagebox.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/minilzo.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/progress_widget.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/system_key_trapper.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vncview.Po at am__quote@
-
-.c.o:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c $<
-
-.c.obj:
- at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
-
-minilzo.o: $(srcdir)/src/minilzo.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minilzo.o -MD -MP -MF $(DEPDIR)/minilzo.Tpo -c -o minilzo.o `test -f '$(srcdir)/src/minilzo.c' || echo '$(srcdir)/'`$(srcdir)/src/minilzo.c
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/minilzo.Tpo $(DEPDIR)/minilzo.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/src/minilzo.c' object='minilzo.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo.o `test -f '$(srcdir)/src/minilzo.c' || echo '$(srcdir)/'`$(srcdir)/src/minilzo.c
-
-minilzo.obj: $(srcdir)/src/minilzo.c
- at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT minilzo.obj -MD -MP -MF $(DEPDIR)/minilzo.Tpo -c -o minilzo.obj `if test -f '$(srcdir)/src/minilzo.c'; then $(CYGPATH_W) '$(srcdir)/src/minilzo.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/minilzo.c'; fi`
- at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/minilzo.Tpo $(DEPDIR)/minilzo.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(srcdir)/src/minilzo.c' object='minilzo.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o minilzo.obj `if test -f '$(srcdir)/src/minilzo.c'; then $(CYGPATH_W) '$(srcdir)/src/minilzo.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/minilzo.c'; fi`
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-dsa_key.o: $(srcdir)/src/dsa_key.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dsa_key.o -MD -MP -MF $(DEPDIR)/dsa_key.Tpo -c -o dsa_key.o `test -f '$(srcdir)/src/dsa_key.cpp' || echo '$(srcdir)/'`$(srcdir)/src/dsa_key.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dsa_key.Tpo $(DEPDIR)/dsa_key.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/dsa_key.cpp' object='dsa_key.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dsa_key.o `test -f '$(srcdir)/src/dsa_key.cpp' || echo '$(srcdir)/'`$(srcdir)/src/dsa_key.cpp
-
-dsa_key.obj: $(srcdir)/src/dsa_key.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dsa_key.obj -MD -MP -MF $(DEPDIR)/dsa_key.Tpo -c -o dsa_key.obj `if test -f '$(srcdir)/src/dsa_key.cpp'; then $(CYGPATH_W) '$(srcdir)/src/dsa_key.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/dsa_key.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dsa_key.Tpo $(DEPDIR)/dsa_key.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/dsa_key.cpp' object='dsa_key.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dsa_key.obj `if test -f '$(srcdir)/src/dsa_key.cpp'; then $(CYGPATH_W) '$(srcdir)/src/dsa_key.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/dsa_key.cpp'; fi`
-
-fast_qimage.o: $(srcdir)/src/fast_qimage.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fast_qimage.o -MD -MP -MF $(DEPDIR)/fast_qimage.Tpo -c -o fast_qimage.o `test -f '$(srcdir)/src/fast_qimage.cpp' || echo '$(srcdir)/'`$(srcdir)/src/fast_qimage.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/fast_qimage.Tpo $(DEPDIR)/fast_qimage.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/fast_qimage.cpp' object='fast_qimage.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fast_qimage.o `test -f '$(srcdir)/src/fast_qimage.cpp' || echo '$(srcdir)/'`$(srcdir)/src/fast_qimage.cpp
-
-fast_qimage.obj: $(srcdir)/src/fast_qimage.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fast_qimage.obj -MD -MP -MF $(DEPDIR)/fast_qimage.Tpo -c -o fast_qimage.obj `if test -f '$(srcdir)/src/fast_qimage.cpp'; then $(CYGPATH_W) '$(srcdir)/src/fast_qimage.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/fast_qimage.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/fast_qimage.Tpo $(DEPDIR)/fast_qimage.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/fast_qimage.cpp' object='fast_qimage.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o fast_qimage.obj `if test -f '$(srcdir)/src/fast_qimage.cpp'; then $(CYGPATH_W) '$(srcdir)/src/fast_qimage.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/fast_qimage.cpp'; fi`
-
-inject.obj: $(srcdir)/src/inject.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT inject.obj -MD -MP -MF $(DEPDIR)/inject.Tpo -c -o inject.obj `if test -f '$(srcdir)/src/inject.cpp'; then $(CYGPATH_W) '$(srcdir)/src/inject.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/inject.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/inject.Tpo $(DEPDIR)/inject.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/inject.cpp' object='inject.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o inject.obj `if test -f '$(srcdir)/src/inject.cpp'; then $(CYGPATH_W) '$(srcdir)/src/inject.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/inject.cpp'; fi`
-
-isd_base.o: $(srcdir)/src/isd_base.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT isd_base.o -MD -MP -MF $(DEPDIR)/isd_base.Tpo -c -o isd_base.o `test -f '$(srcdir)/src/isd_base.cpp' || echo '$(srcdir)/'`$(srcdir)/src/isd_base.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/isd_base.Tpo $(DEPDIR)/isd_base.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/isd_base.cpp' object='isd_base.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o isd_base.o `test -f '$(srcdir)/src/isd_base.cpp' || echo '$(srcdir)/'`$(srcdir)/src/isd_base.cpp
-
-isd_base.obj: $(srcdir)/src/isd_base.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT isd_base.obj -MD -MP -MF $(DEPDIR)/isd_base.Tpo -c -o isd_base.obj `if test -f '$(srcdir)/src/isd_base.cpp'; then $(CYGPATH_W) '$(srcdir)/src/isd_base.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/isd_base.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/isd_base.Tpo $(DEPDIR)/isd_base.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/isd_base.cpp' object='isd_base.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o isd_base.obj `if test -f '$(srcdir)/src/isd_base.cpp'; then $(CYGPATH_W) '$(srcdir)/src/isd_base.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/isd_base.cpp'; fi`
-
-isd_connection.o: $(srcdir)/src/isd_connection.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT isd_connection.o -MD -MP -MF $(DEPDIR)/isd_connection.Tpo -c -o isd_connection.o `test -f '$(srcdir)/src/isd_connection.cpp' || echo '$(srcdir)/'`$(srcdir)/src/isd_connection.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/isd_connection.Tpo $(DEPDIR)/isd_connection.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/isd_connection.cpp' object='isd_connection.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o isd_connection.o `test -f '$(srcdir)/src/isd_connection.cpp' || echo '$(srcdir)/'`$(srcdir)/src/isd_connection.cpp
-
-isd_connection.obj: $(srcdir)/src/isd_connection.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT isd_connection.obj -MD -MP -MF $(DEPDIR)/isd_connection.Tpo -c -o isd_connection.obj `if test -f '$(srcdir)/src/isd_connection.cpp'; then $(CYGPATH_W) '$(srcdir)/src/isd_connection.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/isd_connection.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/isd_connection.Tpo $(DEPDIR)/isd_connection.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/isd_connection.cpp' object='isd_connection.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o isd_connection.obj `if test -f '$(srcdir)/src/isd_connection.cpp'; then $(CYGPATH_W) '$(srcdir)/src/isd_connection.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/isd_connection.cpp'; fi`
-
-ivs_connection.o: $(srcdir)/src/ivs_connection.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ivs_connection.o -MD -MP -MF $(DEPDIR)/ivs_connection.Tpo -c -o ivs_connection.o `test -f '$(srcdir)/src/ivs_connection.cpp' || echo '$(srcdir)/'`$(srcdir)/src/ivs_connection.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/ivs_connection.Tpo $(DEPDIR)/ivs_connection.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/ivs_connection.cpp' object='ivs_connection.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ivs_connection.o `test -f '$(srcdir)/src/ivs_connection.cpp' || echo '$(srcdir)/'`$(srcdir)/src/ivs_connection.cpp
-
-ivs_connection.obj: $(srcdir)/src/ivs_connection.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ivs_connection.obj -MD -MP -MF $(DEPDIR)/ivs_connection.Tpo -c -o ivs_connection.obj `if test -f '$(srcdir)/src/ivs_connection.cpp'; then $(CYGPATH_W) '$(srcdir)/src/ivs_connection.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/ivs_connection.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/ivs_connection.Tpo $(DEPDIR)/ivs_connection.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/ivs_connection.cpp' object='ivs_connection.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o ivs_connection.obj `if test -f '$(srcdir)/src/ivs_connection.cpp'; then $(CYGPATH_W) '$(srcdir)/src/ivs_connection.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/ivs_connection.cpp'; fi`
-
-local_system.o: $(srcdir)/src/local_system.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT local_system.o -MD -MP -MF $(DEPDIR)/local_system.Tpo -c -o local_system.o `test -f '$(srcdir)/src/local_system.cpp' || echo '$(srcdir)/'`$(srcdir)/src/local_system.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/local_system.Tpo $(DEPDIR)/local_system.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/local_system.cpp' object='local_system.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o local_system.o `test -f '$(srcdir)/src/local_system.cpp' || echo '$(srcdir)/'`$(srcdir)/src/local_system.cpp
-
-local_system.obj: $(srcdir)/src/local_system.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT local_system.obj -MD -MP -MF $(DEPDIR)/local_system.Tpo -c -o local_system.obj `if test -f '$(srcdir)/src/local_system.cpp'; then $(CYGPATH_W) '$(srcdir)/src/local_system.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/local_system.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/local_system.Tpo $(DEPDIR)/local_system.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/local_system.cpp' object='local_system.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o local_system.obj `if test -f '$(srcdir)/src/local_system.cpp'; then $(CYGPATH_W) '$(srcdir)/src/local_system.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/local_system.cpp'; fi`
-
-lock_widget.o: $(srcdir)/src/lock_widget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lock_widget.o -MD -MP -MF $(DEPDIR)/lock_widget.Tpo -c -o lock_widget.o `test -f '$(srcdir)/src/lock_widget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/lock_widget.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/lock_widget.Tpo $(DEPDIR)/lock_widget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/lock_widget.cpp' object='lock_widget.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lock_widget.o `test -f '$(srcdir)/src/lock_widget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/lock_widget.cpp
-
-lock_widget.obj: $(srcdir)/src/lock_widget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lock_widget.obj -MD -MP -MF $(DEPDIR)/lock_widget.Tpo -c -o lock_widget.obj `if test -f '$(srcdir)/src/lock_widget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/lock_widget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/lock_widget.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/lock_widget.Tpo $(DEPDIR)/lock_widget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/lock_widget.cpp' object='lock_widget.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lock_widget.obj `if test -f '$(srcdir)/src/lock_widget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/lock_widget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/lock_widget.cpp'; fi`
-
-messagebox.o: $(srcdir)/src/messagebox.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT messagebox.o -MD -MP -MF $(DEPDIR)/messagebox.Tpo -c -o messagebox.o `test -f '$(srcdir)/src/messagebox.cpp' || echo '$(srcdir)/'`$(srcdir)/src/messagebox.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/messagebox.Tpo $(DEPDIR)/messagebox.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/messagebox.cpp' object='messagebox.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o messagebox.o `test -f '$(srcdir)/src/messagebox.cpp' || echo '$(srcdir)/'`$(srcdir)/src/messagebox.cpp
-
-messagebox.obj: $(srcdir)/src/messagebox.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT messagebox.obj -MD -MP -MF $(DEPDIR)/messagebox.Tpo -c -o messagebox.obj `if test -f '$(srcdir)/src/messagebox.cpp'; then $(CYGPATH_W) '$(srcdir)/src/messagebox.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/messagebox.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/messagebox.Tpo $(DEPDIR)/messagebox.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/messagebox.cpp' object='messagebox.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o messagebox.obj `if test -f '$(srcdir)/src/messagebox.cpp'; then $(CYGPATH_W) '$(srcdir)/src/messagebox.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/messagebox.cpp'; fi`
-
-progress_widget.o: $(srcdir)/src/progress_widget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT progress_widget.o -MD -MP -MF $(DEPDIR)/progress_widget.Tpo -c -o progress_widget.o `test -f '$(srcdir)/src/progress_widget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/progress_widget.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/progress_widget.Tpo $(DEPDIR)/progress_widget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/progress_widget.cpp' object='progress_widget.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o progress_widget.o `test -f '$(srcdir)/src/progress_widget.cpp' || echo '$(srcdir)/'`$(srcdir)/src/progress_widget.cpp
-
-progress_widget.obj: $(srcdir)/src/progress_widget.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT progress_widget.obj -MD -MP -MF $(DEPDIR)/progress_widget.Tpo -c -o progress_widget.obj `if test -f '$(srcdir)/src/progress_widget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/progress_widget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/progress_widget.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/progress_widget.Tpo $(DEPDIR)/progress_widget.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/progress_widget.cpp' object='progress_widget.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o progress_widget.obj `if test -f '$(srcdir)/src/progress_widget.cpp'; then $(CYGPATH_W) '$(srcdir)/src/progress_widget.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/progress_widget.cpp'; fi`
-
-system_key_trapper.o: $(srcdir)/src/system_key_trapper.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT system_key_trapper.o -MD -MP -MF $(DEPDIR)/system_key_trapper.Tpo -c -o system_key_trapper.o `test -f '$(srcdir)/src/system_key_trapper.cpp' || echo '$(srcdir)/'`$(srcdir)/src/system_key_trapper.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/system_key_trapper.Tpo $(DEPDIR)/system_key_trapper.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/system_key_trapper.cpp' object='system_key_trapper.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o system_key_trapper.o `test -f '$(srcdir)/src/system_key_trapper.cpp' || echo '$(srcdir)/'`$(srcdir)/src/system_key_trapper.cpp
-
-system_key_trapper.obj: $(srcdir)/src/system_key_trapper.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT system_key_trapper.obj -MD -MP -MF $(DEPDIR)/system_key_trapper.Tpo -c -o system_key_trapper.obj `if test -f '$(srcdir)/src/system_key_trapper.cpp'; then $(CYGPATH_W) '$(srcdir)/src/system_key_trapper.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/system_key_trapper.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/system_key_trapper.Tpo $(DEPDIR)/system_key_trapper.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/system_key_trapper.cpp' object='system_key_trapper.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o system_key_trapper.obj `if test -f '$(srcdir)/src/system_key_trapper.cpp'; then $(CYGPATH_W) '$(srcdir)/src/system_key_trapper.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/system_key_trapper.cpp'; fi`
-
-vncview.o: $(srcdir)/src/vncview.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncview.o -MD -MP -MF $(DEPDIR)/vncview.Tpo -c -o vncview.o `test -f '$(srcdir)/src/vncview.cpp' || echo '$(srcdir)/'`$(srcdir)/src/vncview.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncview.Tpo $(DEPDIR)/vncview.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/vncview.cpp' object='vncview.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncview.o `test -f '$(srcdir)/src/vncview.cpp' || echo '$(srcdir)/'`$(srcdir)/src/vncview.cpp
-
-vncview.obj: $(srcdir)/src/vncview.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vncview.obj -MD -MP -MF $(DEPDIR)/vncview.Tpo -c -o vncview.obj `if test -f '$(srcdir)/src/vncview.cpp'; then $(CYGPATH_W) '$(srcdir)/src/vncview.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/vncview.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/vncview.Tpo $(DEPDIR)/vncview.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/vncview.cpp' object='vncview.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vncview.obj `if test -f '$(srcdir)/src/vncview.cpp'; then $(CYGPATH_W) '$(srcdir)/src/vncview.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/vncview.cpp'; fi`
-
-italc_core_qrc.o: $(srcdir)/italc_core_qrc.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT italc_core_qrc.o -MD -MP -MF $(DEPDIR)/italc_core_qrc.Tpo -c -o italc_core_qrc.o `test -f '$(srcdir)/italc_core_qrc.cpp' || echo '$(srcdir)/'`$(srcdir)/italc_core_qrc.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/italc_core_qrc.Tpo $(DEPDIR)/italc_core_qrc.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/italc_core_qrc.cpp' object='italc_core_qrc.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o italc_core_qrc.o `test -f '$(srcdir)/italc_core_qrc.cpp' || echo '$(srcdir)/'`$(srcdir)/italc_core_qrc.cpp
-
-italc_core_qrc.obj: $(srcdir)/italc_core_qrc.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT italc_core_qrc.obj -MD -MP -MF $(DEPDIR)/italc_core_qrc.Tpo -c -o italc_core_qrc.obj `if test -f '$(srcdir)/italc_core_qrc.cpp'; then $(CYGPATH_W) '$(srcdir)/italc_core_qrc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/italc_core_qrc.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/italc_core_qrc.Tpo $(DEPDIR)/italc_core_qrc.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/italc_core_qrc.cpp' object='italc_core_qrc.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o italc_core_qrc.obj `if test -f '$(srcdir)/italc_core_qrc.cpp'; then $(CYGPATH_W) '$(srcdir)/italc_core_qrc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/italc_core_qrc.cpp'; fi`
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LIBRARIES) $(LTLIBRARIES)
-installdirs:
-	for dir in "$(DESTDIR)$(pkglibdir)"; do \
-	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-	done
-install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
-	clean-pkglibLTLIBRARIES mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-pkglibLTLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkglibLTLIBRARIES
-
-.MAKE: all check install install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-noinstLIBRARIES clean-pkglibLTLIBRARIES \
-	ctags distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-pkglibLTLIBRARIES install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags uninstall uninstall-am \
-	uninstall-pkglibLTLIBRARIES
-
-
-%.moc: $(srcdir)/%.h
-	$(MOC) -o $@ $<
-
-%.ts: 
-	$(LUPDATE)							\
-		$(srcdir)/src/*.cpp				\
-		$(srcdir)/../ica/src/*.cpp		\
-		$(srcdir)/../ima/src/*.cpp		\
-		$(srcdir)/../ima/dialogs/*.ui	\
-		$(srcdir)/../setup/src/*.cpp	\
-		$(srcdir)/../setup/dialogs/*.ui	\
-		-ts $(srcdir)/resources/$@		\
-		-locations none -no-obsolete
-
-%.qm: %.ts
-	$(LRELEASE) $(srcdir)/resources/$< -qm $(srcdir)/resources/$@
-
-./italc_core_qrc.cpp: italc_core.qrc
-	$(RCC) $< -name italc_core > $@
-
-inject.o: $(srcdir)/src/inject.cpp
-	$(CXX) -c -o $@ $< -DHAVE_CONFIG_H $(CXXFLAGS) $(QT_CXXFLAGS) $(INCLUDES) $(CPPFLAGS) -O0
-
- at BUILD_WIN32_TRUE@shared-lib: italc_core.dll
-
- at BUILD_WIN32_TRUE@italc_core.dll: libitalc_core-static.a
- at BUILD_WIN32_TRUE@	$(CXX) *.o -shared -Wl,-no-undefined -Wl,-enable-runtime-pseudo-reloc -Wl,-export-all-symbols -Wl,--out-implib,libitalc_core.a -o $@ $(QT_LDADD) $(QT_LIB_GUI) $(LIBSSL) -lz -ljpeg -lpsapi && $(STRIP) italc_core.dll
-
- at BUILD_LINUX_TRUE@shared-lib: libitalc_core.so
-
- at BUILD_LINUX_TRUE@libitalc_core.so: libitalc_core-static.a
- at BUILD_LINUX_TRUE@	$(CXX) *.o -shared -Wl,-no-undefined -Wl,-soname,libitalc_core.so -o $@  $(QT_LDADD) $(QT_LIB_GUI) $(LIBSSL) -lz -ljpeg
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/lib/dialogs/AboutDialog.ui b/lib/dialogs/AboutDialog.ui
new file mode 100644
index 0000000..671e040
--- /dev/null
+++ b/lib/dialogs/AboutDialog.ui
@@ -0,0 +1,262 @@
+<?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-2011 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
new file mode 100644
index 0000000..679092c
--- /dev/null
+++ b/lib/dialogs/PasswordDialog.ui
@@ -0,0 +1,136 @@
+<?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>340</width>
+    <height>150</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>iTALC Logon</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0" colspan="2">
+    <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="1" column="0">
+    <widget class="QLabel" name="label_2">
+     <property name="text">
+      <string>Username</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QLineEdit" name="username"/>
+   </item>
+   <item row="2" column="0">
+    <widget class="QLabel" name="label_3">
+     <property name="text">
+      <string>Password</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QLineEdit" name="password">
+     <property name="echoMode">
+      <enum>QLineEdit::Password</enum>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="1">
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <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>
+ </connections>
+ <slots>
+  <slot>updateOkButton()</slot>
+ </slots>
+</ui>
diff --git a/lib/include/AboutDialog.h b/lib/include/AboutDialog.h
new file mode 100644
index 0000000..1187919
--- /dev/null
+++ b/lib/include/AboutDialog.h
@@ -0,0 +1,47 @@
+/*
+ * AboutDialog.h - declaration of AboutDialog class
+ *
+ * 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 _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
new file mode 100644
index 0000000..81e1dac
--- /dev/null
+++ b/lib/include/AuthenticationCredentials.h
@@ -0,0 +1,92 @@
+/*
+ * AuthenticationCredentials.h - 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 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
new file mode 100644
index 0000000..de09554
--- /dev/null
+++ b/lib/include/Configuration/LocalStore.h
@@ -0,0 +1,50 @@
+/*
+ * Configuration/LocalStore.h - LocalStore class
+ *
+ * Copyright (c) 2009-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 _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
new file mode 100644
index 0000000..e8d6b55
--- /dev/null
+++ b/lib/include/Configuration/Object.h
@@ -0,0 +1,167 @@
+/*
+ * 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
new file mode 100644
index 0000000..9f3dc9f
--- /dev/null
+++ b/lib/include/Configuration/Store.h
@@ -0,0 +1,100 @@
+/*
+ * Configuration/Store.h - ConfigurationStore 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_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 )
+	{
+	}
+
+	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
new file mode 100644
index 0000000..a558537
--- /dev/null
+++ b/lib/include/Configuration/UiMapping.h
@@ -0,0 +1,78 @@
+/*
+ * Configuration/UiMapping.h - helper macros for connecting config with UI
+ *
+ * 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 _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
new file mode 100644
index 0000000..0257e9a
--- /dev/null
+++ b/lib/include/Configuration/XmlStore.h
@@ -0,0 +1,53 @@
+/*
+ * 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/DecoratedMessageBox.h b/lib/include/DecoratedMessageBox.h
new file mode 100644
index 0000000..3188ff0
--- /dev/null
+++ b/lib/include/DecoratedMessageBox.h
@@ -0,0 +1,55 @@
+/*
+ * 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
new file mode 100644
index 0000000..7853e35
--- /dev/null
+++ b/lib/include/DsaKey.h
@@ -0,0 +1,161 @@
+/*
+ * DsaKey.h - 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.
+ *
+ ****************************************************************************/
+
+#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
new file mode 100644
index 0000000..caa5f22
--- /dev/null
+++ b/lib/include/FastQImage.h
@@ -0,0 +1,222 @@
+/*
+ * FastQImage.h - 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 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 )
+		{
+			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
new file mode 100644
index 0000000..bbb78d1
--- /dev/null
+++ b/lib/include/Inject.h
@@ -0,0 +1,42 @@
+/*
+ * Inject.h - 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.
+ *
+ */
+
+
+#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
new file mode 100644
index 0000000..7437e38
--- /dev/null
+++ b/lib/include/Ipc/Core.h
@@ -0,0 +1,133 @@
+/*
+ * IpcCore.h - 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.
+ *
+ */
+
+#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
new file mode 100644
index 0000000..d739810
--- /dev/null
+++ b/lib/include/Ipc/Master.h
@@ -0,0 +1,108 @@
+/*
+ * IpcMaster.h - class Ipc::Master which manages Ipc::Slaves
+ *
+ * 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 _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
new file mode 100644
index 0000000..e4b4ecf
--- /dev/null
+++ b/lib/include/Ipc/QtSlaveLauncher.h
@@ -0,0 +1,58 @@
+/*
+ * 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
new file mode 100644
index 0000000..540d5c0
--- /dev/null
+++ b/lib/include/Ipc/Slave.h
@@ -0,0 +1,61 @@
+/*
+ * 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
new file mode 100644
index 0000000..1965482
--- /dev/null
+++ b/lib/include/Ipc/SlaveLauncher.h
@@ -0,0 +1,58 @@
+/*
+ * 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/ItalcConfiguration.h b/lib/include/ItalcConfiguration.h
new file mode 100644
index 0000000..49056cb
--- /dev/null
+++ b/lib/include/ItalcConfiguration.h
@@ -0,0 +1,129 @@
+/*
+ * 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
new file mode 100644
index 0000000..72f5ca6
--- /dev/null
+++ b/lib/include/ItalcCore.h
@@ -0,0 +1,169 @@
+/*
+ * 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
new file mode 100644
index 0000000..50bedcd
--- /dev/null
+++ b/lib/include/ItalcCoreConnection.h
@@ -0,0 +1,132 @@
+/*
+ * 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();
+
+
+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
new file mode 100644
index 0000000..f27a81c
--- /dev/null
+++ b/lib/include/ItalcRfbExt.h
@@ -0,0 +1,82 @@
+/*
+ * ItalcRfbExt.h - an extension of the RFB-protocol, used for communication
+ *                 between master and clients
+ *
+ * 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 _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
new file mode 100644
index 0000000..999d844
--- /dev/null
+++ b/lib/include/ItalcVncConnection.h
@@ -0,0 +1,246 @@
+/*
+ * ItalcVncConnection.h - declaration of ItalcVncConnection class
+ *
+ * Copyright (c) 2008-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 _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();
+
+
+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;
+
+
+private slots:
+	void checkOutputErrorMessage();
+
+} ;
+
+#endif
+
diff --git a/lib/include/LocalSystem.h b/lib/include/LocalSystem.h
new file mode 100644
index 0000000..72e3b5a
--- /dev/null
+++ b/lib/include/LocalSystem.h
@@ -0,0 +1,200 @@
+/*
+ * LocalSystem.h - misc. platform-specific stuff
+ *
+ * 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 _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
new file mode 100644
index 0000000..55d04cb
--- /dev/null
+++ b/lib/include/LockWidget.h
@@ -0,0 +1,63 @@
+/*
+ *  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
new file mode 100644
index 0000000..bc0de52
--- /dev/null
+++ b/lib/include/Logger.h
@@ -0,0 +1,128 @@
+/*
+ * Logger.h - 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.
+ *
+ */
+
+#ifndef _LOGGER_H
+#define _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
new file mode 100644
index 0000000..dd53694
--- /dev/null
+++ b/lib/include/LogonAuthentication.h
@@ -0,0 +1,37 @@
+/*
+ * 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
new file mode 100644
index 0000000..28e3547
--- /dev/null
+++ b/lib/include/PasswordDialog.h
@@ -0,0 +1,56 @@
+/*
+ * 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();
+
+
+private:
+	Ui::PasswordDialog *ui;
+
+} ;
+
+#endif
diff --git a/lib/include/ProgressWidget.h b/lib/include/ProgressWidget.h
new file mode 100644
index 0000000..8675b4a
--- /dev/null
+++ b/lib/include/ProgressWidget.h
@@ -0,0 +1,61 @@
+/*
+ *  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/QtUserEvents.h b/lib/include/QtUserEvents.h
new file mode 100644
index 0000000..8af3cf3
--- /dev/null
+++ b/lib/include/QtUserEvents.h
@@ -0,0 +1,55 @@
+/*
+ * QtUserEvents.h - user-defined Qt-events
+ *
+ * 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.
+ *
+ */
+
+
+#ifndef _QT_USER_EVENTS_H
+#define _QT_USER_EVENTS_H
+
+#include <QtCore/QEvent>
+#include <QtGui/QRegion>
+
+
+class RegionChangedEvent : public QEvent
+{
+public:
+	RegionChangedEvent( const QRegion & _r = QRegion() ) :
+		QEvent( static_cast<QEvent::Type>( QEvent::User+385 ) ),
+		m_changedRegion( _r )
+	{
+	}
+
+	const QRegion & changedRegion( void ) const
+	{
+		return m_changedRegion;
+	}
+
+
+private:
+	QRegion m_changedRegion;
+
+} ;
+
+
+#endif
+
diff --git a/lib/include/QuadTree.h b/lib/include/QuadTree.h
index 5e4f8e2..f3c52bf 100644
--- a/lib/include/QuadTree.h
+++ b/lib/include/QuadTree.h
@@ -26,8 +26,12 @@
 #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 ) :
diff --git a/lib/include/Snapshot.h b/lib/include/Snapshot.h
new file mode 100644
index 0000000..c0d30fd
--- /dev/null
+++ b/lib/include/Snapshot.h
@@ -0,0 +1,73 @@
+/*
+ *  Snapshot.h - 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.
+ */
+
+#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
new file mode 100644
index 0000000..b3913ff
--- /dev/null
+++ b/lib/include/SocketDevice.h
@@ -0,0 +1,117 @@
+/*
+ * 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
new file mode 100644
index 0000000..5728ef7
--- /dev/null
+++ b/lib/include/SystemKeyTrapper.h
@@ -0,0 +1,90 @@
+/*
+ * 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
new file mode 100644
index 0000000..95fba41
--- /dev/null
+++ b/lib/include/VncView.h
@@ -0,0 +1,151 @@
+/*
+ * VncView.h - VNC viewer widget
+ *
+ * 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 _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/debug.h b/lib/include/debug.h
deleted file mode 100644
index 8be4e72..0000000
--- a/lib/include/debug.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * debug.h - central header where DEBUG is either defined or not
- *
- * Copyright (c) 2006 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 _DEBUG_H
-#define _DEBUG_H
-
-//#define DEBUG
-
-#ifdef DEBUG
-#define debugpoint printf("file:%s line %d\n",__FILE__,__LINE__);
-#else
-#define debugpoint
-#endif
-
-#endif
-
diff --git a/lib/include/dsa_key.h b/lib/include/dsa_key.h
deleted file mode 100644
index 240a0ad..0000000
--- a/lib/include/dsa_key.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * dsa_key.h - easy to use C++ classes for dealing with DSA-keys, -signatures
- *             etc.
- *
- * Copyright (c) 2006 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>
-
-#include "types.h"
-
-
-class IC_DllExport dsaKey
-{
-public:
-	enum keyType
-	{
-		Public,
-		Private
-	} ;
-
-	// 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 void load( const QString & _file,
-				QString _passphrase = QString::null ) = 0;
-	virtual void 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 IC_DllExport 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 void load( const QString & _file,
-					QString _passphrase = QString::null );
-	virtual void save( const QString & _file,
-				QString _passphrase = QString::null ) const;
-
-} ;
-
-
-
-
-class IC_DllExport 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 void load( const QString & _file,
-					QString _passphrase = QString::null );
-	virtual void save( const QString & _file,
-				QString _passphrase = QString::null ) const;
-
-} ;
-
-
-#endif
diff --git a/lib/include/fast_qimage.h b/lib/include/fast_qimage.h
deleted file mode 100644
index c948598..0000000
--- a/lib/include/fast_qimage.h
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * fast_qimage.h - class fastQImage providing fast inline-QImage-manips
- *
- * Copyright (c) 2006 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 <QtGui/QImage>
-#include <QtGui/QPixmap>
-
-#include "types.h"
-
-
-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 Q_UINT16 rx, const Q_UINT16 ry,
-				const Q_UINT16 rw, const Q_UINT16 rh,
-				const QRgb pix )
-	{
-		const Q_UINT16 img_width = width();
-		QRgb * dst = (QRgb *) scanLine( ry ) + rx;
-		// TODO: is it faster to fill first line and then memcpy()
-		//       this line?
-		for( Q_UINT16 y = 0; y < rh; ++y )
-		{
-			//QRgb * dest = dst_base;
-			for( Q_UINT16 x = 0; x < rw; ++x )
-			{
-				dst[x] = pix;
-			}
-			dst += img_width;
-		}
-	}
-
-
-
-	inline void copyRect( const Q_UINT16 rx, const Q_UINT16 ry,
-				const Q_UINT16 rw, const Q_UINT16 rh,
-				const QRgb * buf )
-	{
-		if( rh > 0 )
-		{
-			const Q_UINT16 img_width = width();
-			QRgb * dst = (QRgb *) scanLine( ry ) + rx;
-			for( Q_UINT16 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 Q_UINT16 src_x,
-					const Q_UINT16 src_y,
-					const Q_UINT16 rw,
-					const Q_UINT16 rh,
-					const Q_UINT16 dest_x,
-					const Q_UINT16 dest_y )
-	{
-		// TODO: check whether we need to handle if dest-rect is inside
-		//       src-rect
-		const Q_UINT16 img_width = width();
-		const QRgb * src = (const QRgb *) scanLine( src_y ) + src_x;
-		QRgb * dst = (QRgb *) scanLine( dest_y ) + dest_x;
-		for( Q_UINT16 y = 0; y < rh; ++y )
-		{
-			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 )
-		{
-			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 )
-	{
-		unsigned char * ptr = bits() + 3;
-		const unsigned int pixels = width() * height();
-		for( unsigned int i = 0; i < pixels; ++i )
-		{
-			*ptr = _alpha;
-			ptr += 4;
-		}
-		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 Q_UINT16 _coeff )
-	{
-		unsigned char * ptr = bits();
-		const unsigned int pixels = width() * height();
-		for( unsigned int i = 0; i < pixels; ++i )
-		{
-			*ptr = ( *ptr * _coeff ) >> 8; ++ptr;
-			*ptr = ( *ptr * _coeff ) >> 8; ++ptr;
-			*ptr = ( *ptr * _coeff ) >> 8; ++ptr;
-			++ptr;
-		}
-		return( *this );
-	}
-
-
-	inline fastQImage & toGray( void )
-	{
-		unsigned char * ptr = bits();
-		const unsigned int pixels = width() * height();
-		for( unsigned int i = 0; i < pixels; ++i )
-		{
-			const unsigned char gray = qGray( *( (QRgb *) ptr ) );
-			*ptr = gray; ++ptr;
-			*ptr = gray; ++ptr;
-			*ptr = gray; ++ptr;
-			++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 9689b3c..0000000
--- a/lib/include/inject.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * inject.h - functions for injecting code into winlogon.exe for disabling
- *            SAS (Alt+Ctrl+Del)
- *           
- * Copyright (c) 2006 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
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef BUILD_WIN32
-
-#include <windows.h>
-
-BOOL Inject( void );
-BOOL Eject( void );
-
-#endif
-
-#endif
-
diff --git a/lib/include/isd_base.h b/lib/include/isd_base.h
deleted file mode 100644
index 98920fd..0000000
--- a/lib/include/isd_base.h
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * isd_base.h - basics concerning ISD (iTALC Service Daemon)
- *
- * Copyright (c) 2006-2008 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 _ISD_BASE_H
-#define _ISD_BASE_H
-
-#include <config.h>
-
-#include <QtCore/QtGlobal>
-#include <QtCore/QIODevice>
-#include <QtCore/QString>
-#include <QtCore/QSysInfo>
-#include <QtCore/QVariant>
-
-#include "types.h"
-#include "italc_rfb_ext.h"
-#include "rfb/rfbproto.h"
-
-
-// isd-server-stuff
-#define isdProtocolVersionFormat "ISD %03d.%03d\n"
-#define isdProtocolMajorVersion 1
-#define isdProtocolMinorVersion 0
-
-#define sz_isdProtocolVersionMsg sz_rfbProtocolVersionMsg
-
-typedef char isdProtocolVersionMsg[sz_isdProtocolVersionMsg+1];
-
-
-// demo-server-stuff
-#define idsProtocolVersionFormat "IDS %03d.%03d\n"
-#define idsProtocolMajorVersion 1
-#define idsProtocolMinorVersion 0
-
-#define sz_idsProtocolVersionMsg sz_rfbProtocolVersionMsg
-
-typedef char idsProtocolVersionMsg[sz_idsProtocolVersionMsg+1];
-
-
-
-inline const uint16_t swap16IfLE( const uint16_t & _val )
-{
-	return( QSysInfo::ByteOrder == QSysInfo::LittleEndian ?
-			( ( _val & 0xff ) << 8 ) |
-			( ( _val >> 8 ) & 0xff )
-			:
-			_val );
-}
-
-
-inline const uint32_t swap32( const uint32_t & _val )
-{
-	return( ( ( _val & 0xff000000 ) >> 24 ) |
-			( ( _val & 0x00ff0000 ) >> 8 ) |
-			( ( _val & 0x0000ff00 ) << 8 ) |
-			( ( _val & 0x000000ff ) << 24 ) );
-}
-
-
-inline const uint32_t swap32IfLE( const uint32_t & _val )
-{
-	return( QSysInfo::ByteOrder == QSysInfo::LittleEndian ?
-						swap32( _val ) : _val );
-}
-
-
-inline const uint32_t swap32IfBE( const uint32_t & _val )
-{
-	return( QSysInfo::ByteOrder == QSysInfo::BigEndian ?
-						swap32( _val ) : _val );
-}
-
-
-
-/* ============================================================================
- * socket dispatching
- * ============================================================================ 
- */
-
-
-typedef enum
-{
-	SocketRead,
-	SocketWrite,
-	SocketGetPeerAddress
-} socketOpCodes;
-
-
-typedef qint64 ( * socketDispatcher )( char * _buffer, const qint64 _bytes,
-						const socketOpCodes _op_code,
-						void * _user );
-
-
-
-class socketDevice : public QIODevice
-{
-public:
-	inline socketDevice( socketDispatcher _sd, void * _user ) :
-		QIODevice(),
-		m_socketDispatcher( _sd ),
-		m_user( _user )
-	{
-		open( ReadWrite | Unbuffered );
-	}
-
-	inline QVariant read( void )
-	{
-		QDataStream d( this );
-		return( d );
-	}
-
-	inline void write( const QVariant & _v )
-	{
-		QDataStream d( this );
-		d << _v;
-	}
-
-	inline socketDispatcher sockDispatcher( void )
-	{
-		return( m_socketDispatcher );
-	}
-
-	inline void * user( void )
-	{
-		return m_user;
-	}
-
-	inline void setUser( void * _user )
-	{
-		m_user = _user;
-	}
-
-	inline qint64 read( char * _buf, qint64 _bytes )
-	{
-		return( readData( _buf, _bytes ) );
-	}
-
-	inline qint64 write( const char * _buf, qint64 _bytes )
-	{
-		return( writeData( _buf, _bytes ) );
-	}
-
-
-protected:
-	inline qint64 readData( char * _buf, qint64 _bytes )
-	{
-		return( m_socketDispatcher( _buf, _bytes, SocketRead,
-								m_user ) );
-	}
-
-	inline 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;
-
-} ;
-
-
-
-qint64 IC_DllExport qtcpsocketDispatcher( char * _buf, const qint64 _len,
-						const socketOpCodes _op_code,
-						void * _user );
-
-
-
-struct ISD
-{
-	enum commands
-	{
-		DummyCmd = rfbItalcServiceRequest + 1,
-		GetUserInformation,
-		UserInformation,
-		StartFullScreenDemo,
-		StartWindowDemo,
-		StopDemo,
-		LockDisplay,
-		UnlockDisplay,
-		LogonUserCmd,
-		LogoutUser,
-		DisplayTextMessage,
-		SendFile,
-		CollectFiles,
-		ExecCmds,
-
-		// system-stuff
-		WakeOtherComputer = 48,
-		PowerDownComputer,
-		RestartComputer,
-		DisableLocalInputs,
-
-		SetRole = 64,
-
-		DemoServer_Run = 80,
-		DemoServer_AllowClient,
-		DemoServer_DenyClient,
-
-		HideTrayIcon = 90
-
-	} ;
-
-
-
-	class msg
-	{
-		commands m_cmd;
-		socketDevice * m_socketDevice;
-
-		typedef QMap<QString, QVariant> argMap;
-		argMap m_argMap;
-
-	public:
-		msg( socketDevice * _sd, const commands _cmd = DummyCmd ) :
-			m_cmd( _cmd ),
-			m_socketDevice( _sd )
-		{
-		}
-
-		msg & addArg( const QString & _name, const QVariant & _content )
-		{
-			m_argMap[_name] = _content;
-			return( *this );
-		}
-
-		QVariant arg( const QString & _name ) const
-		{
-			return( m_argMap[_name] );
-		}
-
-		bool send( void )
-		{
-			QDataStream d( m_socketDevice );
-			d << (Q_UINT8) rfbItalcServiceRequest;
-			d << (Q_UINT8) m_cmd;
-			d << m_argMap;
-			return( TRUE );
-		}
-
-		msg & receive( void )
-		{
-			QDataStream d( m_socketDevice );
-			d >> m_argMap;
-			return( *this );
-		}
-
-
-	} ;
-
-	enum userRoles
-	{
-		RoleNone,
-		RoleTeacher,
-		RoleAdmin,
-		RoleSupporter,
-		RoleOther,
-		RoleCount
-	} ;
-
-
-};
-
-
-extern IC_DllExport ISD::userRoles __role;
-
-
-#endif
diff --git a/lib/include/isd_connection.h b/lib/include/isd_connection.h
deleted file mode 100644
index 2736685..0000000
--- a/lib/include/isd_connection.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * isd_connection.h - declaration of class isdConnection, a client-
- *                    implementation for ISD (iTALC Service Daemon)
- *
- * 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 _ISD_CONNECTION_H
-#define _ISD_CONNECTION_H
-
-#include <QtCore/QThread>
-#include <QtNetwork/QHostAddress>
-#include <QtNetwork/QHostInfo>
-#include <QtNetwork/QTcpSocket>
-
-#include "isd_base.h"
-
-
-class isdConnection : public QObject
-{
-public:
-	enum states
-	{
-		Disconnected,
-		Connecting,
-		Connected,
-		HostUnreachable,
-		ConnectionRefused,
-		ConnectionFailed,
-		InvalidServer,
-		AuthFailed,
-		UnknownError
-	} ;
-
-
-	isdConnection( const QString & _host, QObject * _parent = 0 );
-	virtual ~isdConnection();
-
-	virtual states open( void );
-	virtual void close( void );
-	void gracefulClose( void );
-	states reset( const QString & _host = QString() );
-
-	states state( void ) const
-	{
-		return( m_state );
-	}
-
-	bool hasData( void ) const
-	{
-		return( m_socket != NULL &&
-					m_socket->bytesAvailable() > 0 );
-	}
-
-
-	bool handleServerMessages( bool _send_screen_update );
-
-	inline const QString & user( void )
-	{
-		return( m_user );
-	}
-
-	inline const QString & userHomeDir( void )
-	{
-		return( m_userHomeDir );
-	}
-
-	inline QString host( void ) const
-	{
-		return( m_host );
-	}
-
-	inline int port( void ) const
-	{
-		return( m_port );
-	}
-
-	inline int demoServerPort( void ) const
-	{
-		return( m_demoServerPort );
-	}
-
-
-	bool handleServerMessages( void );
-
-	bool sendGetUserInformationRequest( void );
-	bool execCmds( const QString & _cmd );
-	bool startDemo( const QString & _port, bool _full_screen = FALSE );
-	bool stopDemo( void );
-	bool lockDisplay( void );
-	bool unlockDisplay( void );
-	bool logonUser( const QString & _uname, const QString & _pw,
-						const QString & _domain );
-	bool logoutUser( void );
-	bool displayTextMessage( const QString & _msg );
-	bool sendFile( const QString & _fname );
-	bool collectFiles( const QString & _nfilter );
-
-	bool wakeOtherComputer( const QString & _mac );
-	bool powerDownComputer( void );
-	bool restartComputer( void );
-	bool disableLocalInputs( bool _disabled );
-
-	bool setRole( const ISD::userRoles _role );
-	bool demoServerRun( int _quality, int _port );
-	bool demoServerAllowClient( const QString & _client );
-	bool demoServerDenyClient( const QString & _client );
-
-	bool hideTrayIcon( void );
-
-
-	// read private key and/or create new key-pair if necessary
-	static bool initAuthentication( void );
-
-
-protected:
-	bool readFromServer( char * _out, const unsigned int _n );
-	bool writeToServer( const char * _buf, const unsigned int _n );
-	long readCompactLen( void );
-
-	virtual states protocolInitialization( void );
-
-	virtual states authAgainstServer( const italcAuthTypes _try_auth_type =
-								ItalcAuthNone );
-
-	states & state_ref( void )
-	{
-		return( m_state );
-	}
-
-	bool handleServerMessage( Q_UINT8 _msg );
-
-	socketDevice & socketDev( void )
-	{
-		return( m_socketDev );
-	}
-
-
-private:
-	QTcpSocket * m_socket;
-	states m_state;
-
-	socketDevice m_socketDev;
-
-	QString m_host;
-	int m_port, m_demoServerPort;
-	QString m_user;
-	QString m_userHomeDir;
-
-} ;
-
-
-#endif
diff --git a/lib/include/italc_rfb_ext.h b/lib/include/italc_rfb_ext.h
deleted file mode 100644
index 6ca628b..0000000
--- a/lib/include/italc_rfb_ext.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * italc_rfb_ext.h - an extension of the RFB-protocol, used for communication
- *                   between master and clients
- *
- * Copyright (c) 2004-2006 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 "types.h"
-
-// new rfb-command which tells server or client that an italc-request/response
-// is following
-#define rfbItalcServiceRequest		19
-#define rfbItalcServiceResponse		rfbItalcServiceRequest
-
-
-#define rfbEncodingItalc 19
-#define rfbEncodingItalcCursor 20
-
-#define rfbSecTypeItalc 19
-
-
-enum
-{
-	PortOffsetISD = 5800,
-	PortOffsetIVS = 5900
-} ;
-
-struct italcRectEncodingHeader
-{
-	Q_UINT8 compressed;
-	Q_UINT32 bytesLZO;
-	Q_UINT32 bytesRLE;
-} ;
-
-
-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,
-
-	// almost the same as ItalcAuthDSA - suppresses checks concerning
-	// teacher-role when connecting to local ISD (otherwise a question
-	// would appear for confirming access when starting iTALC as teacher
-	// and ICA is running in teacher-mode as well)
-	ItalcAuthLocalDSA,
-
-	// used for authentication of demo-server against IVS which is done by
-	// simply showing IVS that demo-server runs inside the same application
-	// by sending generated challenge which is a global variable and can be
-	// accessed by demo-server
-	ItalcAuthAppInternalChallenge,
-
-	// similiar to ItalcAuthAppInternalChallenge with the only difference
-	// that authentication is done via a file which is only readable by
-	// owner - only used by Linux/X11-version as IVS is run in separate
-	// process and therefore ItalcAuthAppInternalChallenge won't work
-	ItalcAuthChallengeViaAuthFile,
-} ;
-
-
-enum italcAuthResults
-{
-	ItalcAuthOK,
-	ItalcAuthFailed
-} ;
-
-#endif
diff --git a/lib/include/ivs_connection.h b/lib/include/ivs_connection.h
deleted file mode 100644
index 48e303f..0000000
--- a/lib/include/ivs_connection.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * ivs_connection.h - declaration of class ivsConnection, an implementation of
- *                    the RFB-protocol with iTALC-extensions for Qt
- *
- * Copyright (c) 2004-2008 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 _IVS_CONNECTION_H
-#define _IVS_CONNECTION_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <QtCore/QReadWriteLock>
-#include <QtGui/QImage>
-
-
-#ifdef HAVE_LIBZ
-#include <zlib.h>
-#endif
-
-#ifdef HAVE_LIBJPEG
-namespace jpeglib
-{
-	extern "C"
-	{		// otherwise jpeg-lib doesn't work with C++ source...
-		#include <jpeglib.h>
-	}
-}
-#endif
-
-#include "qt_user_events.h"
-#include "isd_connection.h"
-#include "rfb/rfbproto.h"
-#include "fast_qimage.h"
-
-
-
-class demoServerClient;
-
-
-class IC_DllExport ivsConnection : public isdConnection
-{
-	Q_OBJECT
-public:
-	enum quality
-	{
-		QualityLow,
-		QualityMedium,
-		QualityHigh,
-		QualityDemoLow,
-		QualityDemoMedium,
-		QualityDemoHigh
-	} ;
-
-
-	ivsConnection( const QString & _host, quality _q = QualityLow,
-						bool _use_auth_file = FALSE,
-						QObject * _parent = NULL );
-	virtual ~ivsConnection();
-
-	virtual void close( void );
-
-	QImage scaledScreen( void )
-	{
-		QReadLocker rl( &m_scaledImageLock );
-		return( m_scaledScreen );
-	}
-
-	const QImage & screen( void ) const
-	{
-		//QReadLocker rl( &m_imageLock );
-		return( m_screen );
-	}
-
-	QSize framebufferSize( void ) const
-	{
-		if( m_si.framebufferWidth > 0 && m_si.framebufferHeight > 0 )
-		{
-			return( QSize( m_si.framebufferWidth,
-						m_si.framebufferHeight ) );
-		}
-		return( QSize( 640, 480 ) );
-	}
-
-	void setScaledSize( const QSize & _s )
-	{
-		m_scaledSize = _s;
-		m_scaledScreenNeedsUpdate = TRUE;
-	}
-
-	void rescaleScreen( void );
-
-	bool handleServerMessages( bool _send_screen_update, int _tries = 5 );
-
-	bool softwareCursor( void ) const
-	{
-		return( m_softwareCursor );
-	}
-
-	const QPoint & cursorPos( void ) const
-	{
-		return( m_cursorPos );
-	}
-
-	const QPoint & cursorHotSpot( void ) const
-	{
-		return( m_cursorHotSpot );
-	}
-
-	QImage cursorShape( void ) const
-	{
-		QReadLocker rl( &m_cursorLock );
-		return( m_cursorShape );
-	}
-
-	bool takeSnapshot( void );
-
-
-public slots:
-	bool sendFramebufferUpdateRequest( void );
-	bool sendIncrementalFramebufferUpdateRequest( void );
-	bool sendPointerEvent( Q_UINT16 _x, Q_UINT16 _y, Q_UINT16
-								_button_mask );
-	bool sendKeyEvent( Q_UINT32 _key, bool _down );
-
-
-protected:
-	virtual states protocolInitialization( void );
-
-
-private:
-	bool sendFramebufferUpdateRequest( Q_UINT16 _x, Q_UINT16 _y,
-						Q_UINT16 _w, Q_UINT16 _h,
-						bool _incremental );
-
-	void postRegionChangedEvent( const RectList &rgn );
-
-	bool handleCursorPos( const Q_UINT16 _x, const Q_UINT16 _y );
-	bool handleCursorShape( const Q_UINT16 _xhot, const Q_UINT16 _yhot,
-				const Q_UINT16 _w, const Q_UINT16 _h,
-				const Q_UINT32 _e );
-
-	bool handleRaw( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw, Q_UINT16 rh );
-	bool handleRRE( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw, Q_UINT16 rh );
-
-	bool handleCoRRE( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw, Q_UINT16 rh );
-
-#ifdef HAVE_LIBZ
-	bool handleZlib( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw, Q_UINT16 rh );
-	bool handleTight( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw, Q_UINT16 rh );
-	int initFilterCopy( Q_UINT16 rw, Q_UINT16 rh );
-	int initFilterPalette( Q_UINT16 rw, Q_UINT16 rh );
-	int initFilterGradient( Q_UINT16 rw, Q_UINT16 rh );
-	void filterCopy( Q_UINT16 num_rows, Q_UINT32 * dest_buffer );
-	void filterPalette( Q_UINT16 num_rows, Q_UINT32 * dest_buffer );
-	void filterGradient( Q_UINT16 num_rows, Q_UINT32 * dest_buffer );
-#ifdef HAVE_LIBJPEG
-	bool decompressJpegRect( Q_UINT16 x, Q_UINT16 y, Q_UINT16 w,
-								Q_UINT16 h );
-#endif
-#endif
-	bool handleItalc( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw, Q_UINT16 rh );
-
-	bool m_isDemoServer;
-	bool m_useAuthFile;
-
-	quality m_quality;
-
-
-	rfbServerInitMsg m_si;
-
-	mutable QReadWriteLock m_imageLock;
-	mutable QReadWriteLock m_scaledImageLock;
-	fastQImage m_screen;
-	QImage m_scaledScreen;
-	bool m_scaledScreenNeedsUpdate;
-
-	QSize m_scaledSize;
-
-
-	mutable QReadWriteLock m_cursorLock;
-	bool m_softwareCursor;
-	QPoint m_cursorPos;
-	QPoint m_cursorHotSpot;
-	QImage m_cursorShape;
-
-//	static const rfbPixelFormat s_localDisplayFormat;
-
-	// 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 BUFFER_SIZE (640*480)
-	char m_buffer[BUFFER_SIZE];
-
-	// variables for the zlib-encoding
-#ifdef HAVE_LIBZ
-	int m_rawBufferSize;
-	char * m_rawBuffer;
-	z_stream m_decompStream;
-	bool m_decompStreamInited;
-#endif
-
-	// Variables for the ``tight'' encoding implementation.
-#ifdef HAVE_LIBZ
-
-	// Separate buffer for compressed data.
-	#define ZLIB_BUFFER_SIZE 512
-	char m_zlibBuffer[ZLIB_BUFFER_SIZE];
-
-	// Four independent compression streams for zlib library.
-	z_stream m_zlibStream[4];
-	bool m_zlibStreamActive[4];
-
-	// Filter stuff. Should be initialized by filter initialization code.
-	Q_UINT16 m_rectWidth, m_rectColors;
-	char m_tightPalette[256*4];
-	Q_UINT8 m_tightPrevRow[2048*3*sizeof(Q_UINT16)];
-
-#ifdef HAVE_LIBJPEG
-	// JPEG decoder state.
-	jpeglib::jpeg_source_mgr m_jpegSrcManager;
-#endif
-
-#endif
-
-
-	friend class demoServerClient;
-
-
-signals:
-	void cursorShapeChanged( void );
-	void regionUpdated( const RectList & );
-
-} ;
-
-
-#endif
diff --git a/lib/include/local_system.h b/lib/include/local_system.h
deleted file mode 100644
index 85c9434..0000000
--- a/lib/include/local_system.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * local_system.h - misc. platform-specific stuff
- *
- * Copyright (c) 2006-2008 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 <QtCore/QString>
-
-#include "isd_base.h"
-#include "types.h"
-
-#ifdef BUILD_WIN32
-#include <windef.h>
-#endif
-
-class QWidget;
-
-extern IC_DllExport QByteArray __appInternalChallenge;
-
-
-namespace localSystem
-{
-	extern int IC_DllExport logLevel;
-
-	typedef void (*p_pressKey)( int _key, bool _down );
-
-
-	int IC_DllExport freePort( int _default_port );
-
-	void IC_DllExport initialize( p_pressKey _pk, const QString & _log_file );
-
-	void IC_DllExport sleep( const int _ms );
-
-	void IC_DllExport execInTerminal( const QString & _cmds );
-
-	void IC_DllExport broadcastWOLPacket( const QString & _mac );
-
-	void /*IC_DllExport*/ powerDown( void );
-	void /*IC_DllExport*/ reboot( void );
-
-	void IC_DllExport logonUser( const QString & _uname, const QString & _pw,
-						const QString & _domain );
-	void /*IC_DllExport*/ logoutUser( void );
-
-	QString /*IC_DllExport*/ currentUser( void );
-
-	QString IC_DllExport privateKeyPath( const ISD::userRoles _role,
-						bool _only_path = FALSE );
-	QString IC_DllExport publicKeyPath( const ISD::userRoles _role,
-						bool _only_path = FALSE );
-
-	void IC_DllExport setPrivateKeyPath( const QString & _path,
-						const ISD::userRoles _role );
-	void IC_DllExport setPublicKeyPath( const QString & _path,
-						const ISD::userRoles _role );
-
-	QString IC_DllExport snapshotDir( void );
-	QString IC_DllExport globalConfigPath( void );
-	QString IC_DllExport personalConfigDir( void );
-	QString IC_DllExport personalConfigPath( void );
-
-	QString IC_DllExport globalStartmenuDir( void );
-
-	QString IC_DllExport parameter( const QString & _name );
-
-	bool IC_DllExport ensurePathExists( const QString & _path );
-
-	QString IC_DllExport ip( void );
-
-	QString IC_DllExport userRoleName( const ISD::userRoles _role );
-
-#ifdef BUILD_WIN32
-	BOOL enablePrivilege( LPCTSTR lpszPrivilegeName, BOOL bEnable );
-	QString windowsConfigPath( int _type );
-#endif
-
-	void IC_DllExport activateWindow( QWidget * _window );
-
-}
-
-
-#endif
diff --git a/lib/include/lock_widget.h b/lib/include/lock_widget.h
deleted file mode 100644
index 41a732c..0000000
--- a/lib/include/lock_widget.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * lock_widget.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
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef BUILD_WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
-#include <QtGui/QWidget>
-#include <QtGui/QPixmap>
-
-#include "system_key_trapper.h"
-
-
-class IC_DllExport lockWidget : public QWidget
-{
-public:
-	enum types
-	{
-		DesktopVisible, Black, NoBackground
-	} ;
-
-	lockWidget( types _type = Black );
-	virtual ~lockWidget();
-
-
-private:
-	virtual void paintEvent( QPaintEvent * );
-#ifdef BUILD_LINUX
-	virtual bool x11Event( XEvent * _e );
-#endif
-
-	QPixmap m_background;
-	types m_type;
-	systemKeyTrapper m_sysKeyTrapper;
-
-#ifdef BUILD_WIN32
-	HDESK m_origThreadDesktop;
-	HDESK m_origInputDesktop;
-	HDESK m_newDesktop;
-#endif
-
-} ;
-
-
-#endif
-
diff --git a/lib/include/lzoconf.h b/lib/include/lzoconf.h
deleted file mode 100644
index cc437f1..0000000
--- a/lib/include/lzoconf.h
+++ /dev/null
@@ -1,417 +0,0 @@
-/* lzoconf.h -- configuration for the LZO real-time data compression library
-
-   This file is part of the LZO real-time data compression library.
-
-   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
-
-#define LZO_VERSION             0x2030
-#define LZO_VERSION_STRING      "2.03"
-#define LZO_VERSION_DATE        "Apr 30 2008"
-
-/* 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
-
-/* 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
-#  elif defined(LZO_HAVE_MM_HUGE_PTR)
-#    define __LZO_MMODEL_HUGE   1
-#    define __LZO_MMODEL        __huge
-#  else
-#    define __LZO_MMODEL
-#  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 *
-#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
-#endif
-#if !defined(__LZO_EXPORT2)
-#  define __LZO_EXPORT2
-#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)    /* [not used right now] */
-#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] */
-
-
-#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 _s1, const lzo_voidp _s2, lzo_uint _len);
-LZO_EXTERN(lzo_voidp)
-lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
-LZO_EXTERN(lzo_voidp)
-lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
-LZO_EXTERN(lzo_voidp)
-lzo_memset(lzo_voidp _s, int _c, lzo_uint _len);
-
-/* checksum functions */
-LZO_EXTERN(lzo_uint32)
-lzo_adler32(lzo_uint32 _adler, 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_uint32 u32; 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 _ptr, lzo_uint _size);
-#define LZO_PTR_ALIGN_UP(_ptr,_size) \
-    ((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(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
-#define __LZO_DMODEL
-#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/lib/include/lzodefs.h b/lib/include/lzodefs.h
deleted file mode 100644
index 1805637..0000000
--- a/lib/include/lzodefs.h
+++ /dev/null
@@ -1,1807 +0,0 @@
-/* lzodefs.h -- architecture, OS and compiler specific defines
-
-   This file is part of the LZO real-time data compression library.
-
-   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
-#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 defined(LZO_OS_FREESTANDING)
-#  define LZO_INFO_OS           "freestanding"
-#elif defined(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(__llvm__) && defined(__GNUC__) && defined(__VERSION__)
-#  if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
-#    define LZO_CC_LLVM         (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
-#  else
-#    define LZO_CC_LLVM         (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
-#  endif
-#  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(__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) && !defined(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 defined(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(__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 defined(LZO_ARCH_ARM_THUMB) && !defined(LZO_ARCH_ARM)
-#  error "this should not happen"
-#endif
-#if defined(LZO_ARCH_I086PM) && !defined(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) && !defined(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_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) && defined(LZO_CC_GNUC)
-#  if (LZO_CC_GNUC < 0x020800ul)
-#    undef LZO_SIZEOF_LONG_LONG
-#  endif
-#endif
-#if defined(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 defined(LZO_ABI_NEUTRAL_ENDIAN)
-#  undef LZO_ABI_BIG_ENDIAN
-#  undef LZO_ABI_LITTLE_ENDIAN
-#elif !defined(LZO_ABI_BIG_ENDIAN) && !defined(LZO_ABI_LITTLE_ENDIAN)
-#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP)
-#  define LZO_ABI_BIG_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_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 defined(LZO_ABI_BIG_ENDIAN) && defined(LZO_ABI_LITTLE_ENDIAN)
-#  error "this should not happen"
-#endif
-#if defined(LZO_ABI_BIG_ENDIAN)
-#  define LZO_INFO_ABI_ENDIAN       "be"
-#elif defined(LZO_ABI_LITTLE_ENDIAN)
-#  define LZO_INFO_ABI_ENDIAN       "le"
-#elif defined(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 defined(LZO_LIBC_NAKED)
-#  define LZO_INFO_LIBC         "naked"
-#elif defined(LZO_LIBC_FREESTANDING)
-#  define LZO_INFO_LIBC         "freestanding"
-#elif defined(LZO_LIBC_MOSTLY_FREESTANDING)
-#  define LZO_INFO_LIBC         "mfreestanding"
-#elif defined(LZO_LIBC_ISOC90)
-#  define LZO_INFO_LIBC         "isoc90"
-#elif defined(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_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_gnuc_extension__    __extension__
-#else
-#  define __lzo_gnuc_extension__
-#endif
-#endif
-#if !defined(__lzo_ua_volatile)
-#  define __lzo_ua_volatile     volatile
-#endif
-#if !defined(__lzo_alignof)
-#if (LZO_CC_CILLY || 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)
-#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_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_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_destructor      __attribute__((__destructor__))
-#endif
-#endif
-#if defined(__lzo_destructor)
-#  define __lzo_HAVE_destructor 1
-#endif
-#if defined(__lzo_HAVE_destructor) && !defined(__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_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 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
-#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_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_forceinline     __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
-#  define __lzo_forceinline     __forceinline
-#endif
-#endif
-#if defined(__lzo_forceinline)
-#  define __lzo_HAVE_forceinline 1
-#else
-#  define __lzo_forceinline
-#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_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
-#endif
-#endif
-#if defined(__lzo_noinline)
-#  define __lzo_HAVE_noinline 1
-#else
-#  define __lzo_noinline
-#endif
-#if (defined(__lzo_HAVE_forceinline) || defined(__lzo_HAVE_noinline)) && !defined(__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_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
-#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 >= 800) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_nothrow         __attribute__((__nothrow__))
-#elif (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
-#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_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
-#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_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_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_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_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_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
-#    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
-#endif
-#if !defined(__lzo_cdecl_atexit)
-#  define __lzo_cdecl_atexit
-#endif
-#if !defined(__lzo_cdecl_main)
-#  define __lzo_cdecl_main
-#endif
-#if !defined(__lzo_cdecl_qsort)
-#  define __lzo_cdecl_qsort
-#endif
-#if !defined(__lzo_cdecl_sighandler)
-#  define __lzo_cdecl_sighandler
-#endif
-#if !defined(__lzo_cdecl_va)
-#  define __lzo_cdecl_va                __lzo_cdecl
-#endif
-#if !defined(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 defined(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
-#if !defined(LZO_CFG_NO_INLINE_ASM)
-#if defined(LZO_CC_LLVM)
-#  define LZO_CFG_NO_INLINE_ASM 1
-#endif
-#endif
-#if !defined(LZO_CFG_NO_UNALIGNED)
-#if defined(LZO_ABI_NEUTRAL_ENDIAN) || defined(LZO_ARCH_GENERIC)
-#  define LZO_CFG_NO_UNALIGNED 1
-#endif
-#endif
-#if defined(LZO_CFG_NO_UNALIGNED)
-#  undef LZO_OPT_UNALIGNED16
-#  undef LZO_OPT_UNALIGNED32
-#  undef LZO_OPT_UNALIGNED64
-#endif
-#if defined(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_INTELC || LZO_CC_PATHSCALE))
-#  define LZO_ASM_SYNTAX_GNUC 1
-#elif (LZO_ARCH_AMD64 && (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/lib/include/messagebox.h b/lib/include/messagebox.h
deleted file mode 100644
index 8819d51..0000000
--- a/lib/include/messagebox.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * messagebox.h - simple messagebox
- *
- * Copyright (c) 2006-2007 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 _MESSAGEBOX_H
-#define _MESSAGEBOX_H
-
-#include <QtGui/QDialog>
-#include <QtGui/QPixmap>
-#include "qt_features.h"
-#include "types.h"
-
-#ifdef SYSTEMTRAY_SUPPORT
-#include <QtGui/QSystemTrayIcon>
-#endif
-
-
-class IC_DllExport messageBox : public QDialog
-{
-public:
-	enum MessageIcon
-	{
-		NoIcon,
-		Information,
-		Warning,
-		Critical
-	} ;
-
-	messageBox( 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 );
-} ;
-
-#ifdef SYSTEMTRAY_SUPPORT
-extern IC_DllExport QSystemTrayIcon * __systray_icon;
-#endif
-
-#endif
-
diff --git a/lib/include/minilzo.h b/lib/include/minilzo.h
deleted file mode 100644
index 0aff50e..0000000
--- a/lib/include/minilzo.h
+++ /dev/null
@@ -1,106 +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) 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
-
-#define MINILZO_VERSION         0x2030
-
-#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/lib/include/progress_widget.h b/lib/include/progress_widget.h
deleted file mode 100644
index 6b9efb8..0000000
--- a/lib/include/progress_widget.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *  progress_widget.h - widget with animated progress-indicator
- *
- *  Copyright (c) 2006 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/qt_features.h b/lib/include/qt_features.h
deleted file mode 100644
index 3368713..0000000
--- a/lib/include/qt_features.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * qt_features.h - definition of several macros depending on Qt-version
- *                 and target platform
- *
- * Copyright (c) 2006-2007 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 _QT_FEATURES_H
-#define _QT_FEATURES_H
-
-#include <qglobal.h>
-
-#if QT_VERSION < 0x040200
-
-#error iTALC requires Qt version to be >= 4.2.0
-
-#else
-
-#ifdef BUILD_ICA
-#define SYSTEMTRAY_SUPPORT
-#endif
-
-#ifdef BUILD_LINUX
-#define NATIVE_VIRTUAL_KEY_SUPPORT
-#endif
-
-#endif
-
-
-#endif
-
diff --git a/lib/include/qt_user_events.h b/lib/include/qt_user_events.h
deleted file mode 100644
index 3e41e64..0000000
--- a/lib/include/qt_user_events.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * qt_user_events.h - user-defined Qt-events
- *
- * Copyright (c) 2006-2008 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 _QT_USER_EVENTS_H
-#define _QT_USER_EVENTS_H
-
-#include <QtCore/QEvent>
-#include <QtCore/QList>
-#include <QtCore/QRect>
-
-typedef QList<QRect> RectList;
-
-class regionChangedEvent : public QEvent
-{
-public:
-	regionChangedEvent( const RectList &r = RectList() ) :
-		QEvent( static_cast<QEvent::Type>( QEvent::User+385 ) ),
-		m_changedRegion( r )
-	{
-	}
-
-	const RectList &changedRegion() const
-	{
-		return m_changedRegion;
-	}
-
-
-private:
-	RectList m_changedRegion;
-
-} ;
-
-
-#endif
-
diff --git a/lib/include/rfb/dh.h b/lib/include/rfb/dh.h
new file mode 100644
index 0000000..ed82e51
--- /dev/null
+++ b/lib/include/rfb/dh.h
@@ -0,0 +1,83 @@
+// 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/rfb.h b/lib/include/rfb/rfb.h
index cffd7a2..ed6f5e0 100644
--- a/lib/include/rfb/rfb.h
+++ b/lib/include/rfb/rfb.h
@@ -45,6 +45,7 @@ extern "C"
 
 #ifdef __MINGW32__
 #include <winsock2.h>
+#include <ws2tcpip.h>
 #endif
 
 #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
@@ -138,6 +139,7 @@ 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
@@ -168,7 +170,7 @@ typedef struct {
  */
 
 typedef struct _rfbSecurity {
-	uint8_t type;
+	uint32_t type;
 	void (*handler)(struct _rfbClientRec* cl);
 	struct _rfbSecurity* next;
 } rfbSecurityHandler;
@@ -355,6 +357,8 @@ typedef struct _rfbScreenInfo
 
     /* displayFinishedHook is called just after a frame buffer update */
     rfbDisplayFinishedHookPtr displayFinishedHook;
+    /* xvpHook is called to handle an xvp client message */
+    rfbXvpHookPtr xvpHook;
 } rfbScreenInfo, *rfbScreenInfoPtr;
 
 
@@ -604,6 +608,13 @@ typedef struct _rfbClientRec {
     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;
 } rfbClientRec, *rfbClientPtr;
 
 /*
@@ -684,7 +695,7 @@ 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, char *reason);
+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);
@@ -700,7 +711,7 @@ 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, 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);
 
@@ -983,6 +994,12 @@ extern void rfbSetProtocolVersion(rfbScreenInfoPtr rfbScreen, int major_, int mi
 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)
diff --git a/lib/include/rfb/rfbclient.h b/lib/include/rfb/rfbclient.h
index b38f335..758792a 100644
--- a/lib/include/rfb/rfbclient.h
+++ b/lib/include/rfb/rfbclient.h
@@ -59,7 +59,7 @@
 #define FLASH_PORT_OFFSET 5400
 #define LISTEN_PORT_OFFSET 5500
 #define TUNNEL_PORT_OFFSET 5500
-#define SERVER_PORT_OFFSET 5900
+#define SERVER_PORT_OFFSET 11100
 
 #define DEFAULT_SSH_CMD "/usr/bin/ssh"
 #define DEFAULT_TUNNEL_CMD  \
@@ -136,6 +136,7 @@ typedef union _rfbCredential
 struct _rfbClient;
 
 typedef void (*HandleTextChatProc)(struct _rfbClient* client, int value, char *text);
+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);
@@ -313,6 +314,12 @@ typedef struct _rfbClient {
 	/* 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;
 } rfbClient;
 
 /* cursor.c */
@@ -349,6 +356,7 @@ extern rfbBool TextChatOpen(rfbClient* client);
 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);
 
@@ -388,6 +396,7 @@ 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);
diff --git a/lib/include/rfb/rfbint.h b/lib/include/rfb/rfbint.h
new file mode 100644
index 0000000..1b81a43
--- /dev/null
+++ b/lib/include/rfb/rfbint.h
@@ -0,0 +1,17 @@
+#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
index 2778946..7476151 100644
--- a/lib/include/rfb/rfbproto.h
+++ b/lib/include/rfb/rfbproto.h
@@ -52,7 +52,7 @@
 #define LIBVNCSERVER_WORDS_BIGENDIAN
 #define rfbBool int
 #include <sys/timeb.h>
-#include <winsock2.h>
+#include <winsock.h>
 #undef SOCKET
 #define SOCKET int
 #else
@@ -69,20 +69,29 @@
 #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
@@ -101,7 +110,7 @@ typedef uint32_t in_addr_t;
 #define                INADDR_NONE     ((in_addr_t) 0xffffffff)
 #endif
 
-#define MAX_ENCODINGS 20
+#define MAX_ENCODINGS 32
 
 /*****************************************************************************
  *
@@ -270,6 +279,8 @@ typedef char rfbProtocolVersionMsg[13];	/* allow extra byte for null */
 #define rfbUltra 17
 #define rfbTLS 18
 #define rfbVeNCrypt 19
+#define rfbARD 30
+#define rfbUltraVNC_MsLogonIIAuth 0x71
 #define rfbMSLogon 0xfffffffa
 
 #define rfbVeNCryptPlain 256
@@ -319,8 +330,9 @@ typedef char rfbProtocolVersionMsg[13];	/* allow extra byte for null */
  * access to this client by disconnecting all other clients.
  */
 
-typedef struct {
+typedef union {
     uint8_t shared;
+    uint8_t flags;
 } rfbClientInitMsg;
 
 #define sz_rfbClientInitMsg 1
@@ -374,7 +386,6 @@ typedef struct {
 #define rfbServerCutText 3
 /* Modif sf at 2002 */
 #define rfbResizeFrameBuffer 4
-#define rfbKeyFrameUpdate 5
 #define rfbPalmVNCReSizeFrameBuffer 0xF
 
 /* client -> server */
@@ -397,9 +408,10 @@ typedef struct {
 /* Modif sf at 2002 - TextChat - Bidirectionnal */
 #define rfbTextChat	11
 /* Modif cs at 2005 */
-#define rfbKeyFrameRequest 12
 /* PalmVNC 1.4 & 2.0 SetScale Factor message */
 #define rfbPalmVNCSetScaleFactor 0xF
+/* Xvp message - bidirectional */
+#define rfbXvp 250
 
 
 
@@ -419,6 +431,7 @@ typedef struct {
 #define rfbEncodingTight 7
 #define rfbEncodingZlibHex 8
 #define rfbEncodingUltra 9
+#define rfbEncodingUltra2   10
 #define rfbEncodingZRLE 16
 #define rfbEncodingZYWRLE 17
 
@@ -434,6 +447,9 @@ typedef struct {
 #define rfbEncodingSolMonoZip            0xFFFF0008
 #define rfbEncodingUltraZip              0xFFFF0009
 
+/* Xvp pseudo-encoding */
+#define rfbEncodingXvp 			 0xFFFFFECB
+
 /*
  * Special encoding numbers:
  *   0xFFFFFF00 .. 0xFFFFFF0F -- encoding-specific compression levels;
@@ -473,6 +489,9 @@ typedef struct {
 #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
@@ -506,18 +525,6 @@ typedef struct {
 
 #define sz_rfbFramebufferUpdateMsg 4
 
-/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * KeyFrameUpdate - Acknowledgment of a key frame request, it tells the client
- * that the next update received will be a key frame.
- */
-
-typedef struct {
-    uint8_t type;
-} rfbKeyFrameUpdateMsg;
-
-#define sz_rfbKeyFrameUpdateMsg 1
-
-
 /*
  * 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
@@ -958,6 +965,86 @@ typedef struct {
 #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.
@@ -1056,6 +1143,44 @@ typedef struct _rfbTextChatMsg {
 #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
@@ -1110,6 +1235,7 @@ typedef union {
 	rfbPalmVNCReSizeFrameBufferMsg prsfb; 
 	rfbFileTransferMsg ft;
 	rfbTextChatMsg tc;
+        rfbXvpMsg xvp;
 } rfbServerToClientMsg;
 
 
@@ -1345,6 +1471,7 @@ typedef struct _rfbSetSWMsg {
 #define sz_rfbSetSWMsg 6
 
 
+
 /*-----------------------------------------------------------------------------
  * Union of all client->server messages.
  */
@@ -1364,6 +1491,7 @@ typedef union {
 	rfbFileTransferMsg ft;
 	rfbSetSWMsg sw;
 	rfbTextChatMsg tc;
+        rfbXvpMsg xvp;
 } rfbClientToServerMsg;
 
 /* 
diff --git a/lib/include/system_key_trapper.h b/lib/include/system_key_trapper.h
deleted file mode 100644
index c057c2b..0000000
--- a/lib/include/system_key_trapper.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * system_key_trapper.h - class for trapping system-keys and -key-sequences
- *                        such as Alt+Ctrl+Del, Alt+Tab etc.
- *           
- * Copyright (c) 2006-2007 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
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "italc_rfb_ext.h"
-
-#include <QtCore/QMutex>
-#include <QtCore/QObject>
-
-
-class IC_DllExport systemKeyTrapper : public QObject
-{
-	Q_OBJECT
-public:
-	enum trappedKeys
-	{
-		None,
-		AltCtrlDel,
-		AltTab,
-		AltEsc,
-		AltSpace,
-		AltF4,
-		CtrlEsc,
-		MetaKey
-	} ;
-
-
-	systemKeyTrapper( bool _enable = TRUE );
-	~systemKeyTrapper();
-
-	void setEnabled( bool _on );
-	bool isEnabled( void ) const
-	{
-		return( m_enabled );
-	}
-
-	void disableAllKeys( bool _on );
-
-
-private:
-	static QMutex s_refCntMutex;
-	static int s_refCnt;
-
-	bool m_enabled;
-
-
-private slots:
-	void checkForTrappedKeys( void );
-
-
-signals:
-	void keyEvent( Q_UINT32, bool );
-
-} ;
-
-
-#endif
-
diff --git a/lib/include/types.h b/lib/include/types.h
deleted file mode 100644
index 7951a34..0000000
--- a/lib/include/types.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * types.h - some typedefs
- *
- * Copyright (c) 2006-2008 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 _TYPES_H
-#define _TYPES_H
-
-#include <stdint.h>
-
-typedef signed char             Q_INT8;         /* 8 bit signed */
-typedef unsigned char           Q_UINT8;        /* 8 bit unsigned */
-typedef short                   Q_INT16;        /* 16 bit signed */
-typedef unsigned short          Q_UINT16;       /* 16 bit unsigned */
-typedef int32_t			Q_INT32;        /* 32 bit signed */
-typedef uint32_t 		Q_UINT32;       /* 32 bit unsigned */
-
-
-#ifdef BUILD_WIN32
-
-#ifdef BUILD_LIBRARY
-#define IC_DllExport __declspec(dllexport)
-#else
-#define IC_DllExport __declspec(dllimport)
-#endif
-
-
-#else
-
-#define IC_DllExport
-
-#endif
-
-
-#endif
diff --git a/lib/include/vncview.h b/lib/include/vncview.h
deleted file mode 100644
index 23b675a..0000000
--- a/lib/include/vncview.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * vncview.h - VNC-viewer-widget
- *
- * Copyright (c) 2006-2008 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 _VNCVIEW_H
-#define _VNCVIEW_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <QtCore/QEvent>
-#include <QtCore/QThread>
-#include <QtGui/QWidget>
-
-#include "types.h"
-#include "ivs_connection.h"
-
-
-class progressWidget;
-class remoteControlWidget;
-class systemKeyTrapper;
-class vncWorker;
-
-
-class IC_DllExport vncView : public QWidget
-{
-	Q_OBJECT
-public:
-	vncView( const QString & _host, QWidget * _parent,
-							bool _progress_widget );
-	virtual ~vncView();
-
-	inline bool viewOnly( void ) const
-	{
-		return( m_viewOnly );
-	}
-
-	inline bool scaledView( void ) const
-	{
-		return( m_scaledView );
-	}
-
-	QSize scaledSize( const QSize & _default = QSize() ) const;
-
-
-public slots:
-	void setViewOnly( bool _vo );
-	void setScaledView( bool _sv );
-
-
-signals:
-	void pointerEvent( Q_UINT16 _x, Q_UINT16 _y, Q_UINT16 _button_mask );
-	void keyEvent( Q_UINT32 _key, bool _down );
-	void mouseAtTop( void );
-	void startConnection( void );
-	void connectionEstablished( void );
-
-
-private slots:
-	void framebufferUpdate( void );
-	void updateCursorShape( void );
-
-
-private:
-	virtual void customEvent( QEvent * _user );
-	virtual bool event( QEvent * );
-	virtual void focusInEvent( QFocusEvent * );
-	virtual void focusOutEvent( QFocusEvent * );
-	virtual void mouseMoveEvent( QMouseEvent * );
-	virtual void mousePressEvent( QMouseEvent * );
-	virtual void mouseReleaseEvent( QMouseEvent * );
-	virtual void mouseDoubleClickEvent( QMouseEvent * );
-	virtual void paintEvent( QPaintEvent * );
-	virtual void resizeEvent( QResizeEvent * );
-	virtual void wheelEvent( QWheelEvent * );
-
-	void keyEvent( QKeyEvent * );
-	void mouseEvent( QMouseEvent * );
-	void unpressModifiers( void );
-
-	QPoint mapToFramebuffer( const QPoint & _pos );
-	QRect mapFromFramebuffer( const QRect & _rect );
-
-
-	ivsConnection * m_connection;
-	bool m_viewOnly;
-	bool m_viewOnlyFocus;
-	bool m_scaledView;
-	bool m_running;
-
-	QPoint m_viewOffset;
-
-	int m_buttonMask;
-	QMap<unsigned int, bool> m_mods;
-
-	progressWidget * m_establishingConnection;
-
-	systemKeyTrapper * m_sysKeyTrapper;
-
-
-	friend class remoteControlWidget;
-	friend class vncWorker;
-
-} ;
-
-
-
-
-class vncWorker : public QObject
-{
-	Q_OBJECT
-public:
-	vncWorker( vncView * _vv );
-	~vncWorker();
-
-
-private slots:
-	void framebufferUpdate( void );
-	void sendPointerEvent( Q_UINT16 _x, Q_UINT16 _y,
-							Q_UINT16 _button_mask );
-	void sendKeyEvent( Q_UINT32 _key, bool _down );
-
-
-private:
-	vncView * m_vncView;
-
-} ;
-
-
-
-
-class vncViewThread : public QThread
-{
-	Q_OBJECT
-public:
-	vncViewThread( vncView * _vv );
-	virtual ~vncViewThread()
-	{
-	}
-
-
-private:
-	virtual void run( void );
-
-	vncView * m_vncView;
-
-} ;
-
-
-#endif
-
diff --git a/lib/italc_core.qrc b/lib/italc_core.qrc
deleted file mode 100644
index edfad01..0000000
--- a/lib/italc_core.qrc
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-	<qresource>
-		<file>resources/tr.qm</file>
-		<file>resources/fi.qm</file>
-		<file>resources/qt_pt.qm</file>
-		<file>resources/qt_sv.qm</file>
-		<file>resources/qt_sk.qm</file>
-		<file>resources/he.qm</file>
-		<file>resources/qt_pl.qm</file>
-		<file>resources/sl.qm</file>
-		<file>resources/sr_SR.qm</file>
-		<file>resources/pl.qm</file>
-		<file>resources/qt_sl.qm</file>
-		<file>resources/qt_de.qm</file>
-		<file>resources/qt_ca.qm</file>
-		<file>resources/uk.qm</file>
-		<file>resources/ru.qm</file>
-		<file>resources/qt_iw.qm</file>
-		<file>resources/qt_ru.qm</file>
-		<file>resources/qt_es.qm</file>
-		<file>resources/pt_br.qm</file>
-		<file>resources/qt_zh_CN.qm</file>
-		<file>resources/el.qm</file>
-		<file>resources/de.qm</file>
-		<file>resources/qt_da.qm</file>
-		<file>resources/es.qm</file>
-		<file>resources/qt_ar.qm</file>
-		<file>resources/zh_cn.qm</file>
-		<file>resources/cs.qm</file>
-		<file>resources/qt_fr.qm</file>
-		<file>resources/fr.qm</file>
-		<file>resources/qt_uk.qm</file>
-		<file>resources/qt_ja_JP.qm</file>
-		<file>resources/it.qm</file>
-		<file>resources/ca.qm</file>
-		<file>resources/sv.qm</file>
-		<file>resources/sk.qm</file>
-		<file>resources/qt_zh_TW.qm</file>
-		<file>resources/nn.qm</file>
-		<file>resources/info.png</file>
-		<file>resources/message.png</file>
-		<file>resources/ok.png</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/ima/resources/authors.png b/lib/resources/authors.png
similarity index 100%
rename from ima/resources/authors.png
rename to lib/resources/authors.png
diff --git a/lib/resources/ca.qm b/lib/resources/ca.qm
deleted file mode 100644
index bf15769..0000000
Binary files a/lib/resources/ca.qm and /dev/null differ
diff --git a/lib/resources/ca.ts b/lib/resources/ca.ts
deleted file mode 100644
index 81f0b94..0000000
--- a/lib/resources/ca.ts
+++ /dev/null
@@ -1,1427 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0">
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation type="unfinished">Accions</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>No write-access</source>
-        <translation type="unfinished">Sense premís d'escriptura</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 s'ha pogut llegir/escriure o crear el directori %1! Per executar l'iTALC assegureu-vos que teniu permisos per crear o escriure en aquest directori.</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Clase</translation>
-    </message>
-    <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Canvia de classe</translation>
-    </message>
-    <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Feu clic en aquest botó per obrir un menú on pugueu seleccionar la classe activa.</translation>
-    </message>
-    <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Feu clic en aquest botó per canviar entre classes.</translation>
-    </message>
-    <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Mode de vista general</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">Aquest és el mode per defecte de l'iTALC que us permet tenir una visió general de tots els ordinadors visibles. Feu també clic en aquest botó per desbloquejar estacions de traball o deixar el mode demo.</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Demo a pantalla sencera</translation>
-    </message>
-    <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Demo a pantalla completa</translation>
-    </message>
-    <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Atura 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">En aquest mode la vostra pantalla es visualitza en tots els ordinadors visibles. A més els usuaris no poden fer res més ja que tots els dispositius d'entrada estan bloquejats en aquet mode.</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demo en ventana</translation>
-    </message>
-    <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Demo en 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 type="unfinished">En aquest mode la vostra pantalla es visualitza en un  finestra en tots els ordinadors visibles. Els usuaris es poden canviar a altres finestres i així continuar treballant.</translation>
-    </message>
-    <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Bloqueja/desbloqueja escriptoris</translation>
-    </message>
-    <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Bloqueja tot</translation>
-    </message>
-    <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Desbloqueja tots</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">Per tenir l'atenció completa de tots els usuaris podeu bloquejar els seus escriptoris usant aquest botó. En aquest mode tots els dispositius d'entrada estan bloquejats i la pantalla en negre.</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Text message</source>
-        <translation type="unfinished">Missatge de text</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">Useu aquest botó per enviar un missatge de text a tots els usuaris. Per exemple, per informar-los de noves tasques.</translation>
-    </message>
-    <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Engega els ordinadors</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">Engega</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">Feu clic en aquest botó per engegar tots els ordinadors visibles. D'aquesta manera no heu d'engegar cada ordinador a ma.</translation>
-    </message>
-    <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Apaga els ordinadors</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Apaga</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">Per apagar tots els ordinadors visibles (per exemple, després de finalitzar la lliçó) podeu fer clic en aquest botó.</translation>
-    </message>
-    <message>
-        <source>Logon</source>
-        <translation type="unfinished">Connecta</translation>
-    </message>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Connexió remota</translation>
-    </message>
-    <message>
-        <source>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Després de clicar aquest botó podeu introduir un nom d'usuari i contrasenya per connectar-vos amb aquest nom d'usuari a tots els ordinadors visibles.</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Suport</translation>
-    </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Suport 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 necessiteu donar suport a algú en un determinat ordinador podeu clicar aquest botó i introduir després el nom de l'amfitrió o IP acordat.</translation>
-    </message>
-    <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Ajusta/Alinea</translation>
-    </message>
-    <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Ajusta les finestres i la seva mida</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">En clicar aquest botó la finestra dels clients s'ajusta a la major mida possible. A més totes les finestres s'alinien.</translation>
-    </message>
-    <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Vista automàtica</translation>
-    </message>
-    <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Arranjament automàtic de les finestres i la seva mida</translation>
-    </message>
-    <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">En clicar aquest botó totes les finestres visibles es reorganitzen i s'ajusten.</translation>
-    </message>
-    <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">No s'han trobat claus vàlides</translation>
-    </message>
-    <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">No s'ha trobat cap clau d'autenticació o les velles eren invàlides. Creeu un nou parell de claus usant ICA (mireu la documentació en http://italc.sf.net/wiki/index.php?title=Installation).
-Si no, no podreu accedir als ordinadors usant l'iTALC.</translation>
-    </message>
-    <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">El servei iTALC no està funcionant</translation>
-    </message>
-    <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Sembla que no hi hagi cap servei ITALC funcionant en aquest ordinador o les claus d'autenticació no estan correctament configurades. Es necessita el servei per executar iTALC. Contacteu amb el vostre administrador per resoldre aquest problema.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">Control principal de l'iTALC</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished">Surt</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>Client iTALC %1 en %2:%3</translation>
-    </message>
-</context>
-<context>
-    <name>QObject</name>
-    <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL (Nota pels traductors: Els primers tres caracters d'aquesta cadena són les dreceres (caràcters subratllats) dels tres camps d'entrada en el diàleg de connexió. Guardeu aquesta nota ja que si no, hi han errors estranys respecte a les caracteristiques de connexió)</translation>
-    </message>
-    <message>
-        <source>iTALC-snapshots</source>
-        <translation>Instantànies de l'iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>about</name>
-    <message>
-        <source>About</source>
-        <translation>Quant a</translation>
-    </message>
-    <message>
-        <source>About iTALC</source>
-        <translation>Quant a iTALC</translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation>Autors</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Quant a iTALC</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation>Llicència</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>D'acord</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation>Traducció</translation>
-    </message>
-    <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>classroomManager</name>
-    <message>
-        <source>Actions</source>
-        <translation>Accions</translation>
-    </message>
-    <message>
-        <source>Actions for %1</source>
-        <translation>Accions per a %1</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation>Afegeix una classe</translation>
-    </message>
-    <message>
-        <source>Add computer</source>
-        <translation>Afegeix un ordinador</translation>
-    </message>
-    <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation>Esteu segur que voleu suprimir la classe "%1"?
-Tots els seus ordinadors també es suprimiran!</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>Abans d'afegir ordinadors heu de crear, al menys, una classe.
-Voleu crear una nova classe, ara?</translation>
-    </message>
-    <message>
-        <source>Classroom-Manager</source>
-        <translation>Gestor de classes</translation>
-    </message>
-    <message>
-        <source>Classrooms/computers</source>
-        <translation>Classes/ordinadors</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>No s'ha pogut obrir el fitxer de configuració %1.
-Heu d'afegir almenys una classe i un ordinador usant el gestor de classes que trobareu dins el programa en la barra lateral des costat esquerre.
-</translation>
-    </message>
-    <message>
-        <source>Edit name</source>
-        <translation>Edita el nom</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation>Edita els paràmetres</translation>
-    </message>
-    <message>
-        <source>Error in configuration-file</source>
-        <translation>Hi ha un error en el fitxer de configuració</translation>
-    </message>
-    <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation>S'ha trobat un error analitzant el fitxer de configuració %1.
-Editeu-lo o sinó es recomanable que l'esborreu.
-</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>S'ha trobat un error analitzant el fitxer de configuració %1.
-Editeu-lo o sinó es recomanable que l'esborreu i afegiu totes les classes i ordinadors de nou.
-</translation>
-    </message>
-    <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Amaga tots els ordinadors de la classe</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation>Amaga els ordinadors del professor</translation>
-    </message>
-    <message>
-        <source>IP-address</source>
-        <translation>Adreça IP</translation>
-    </message>
-    <message>
-        <source>Missing classroom</source>
-        <translation>No s'ha trobat la classe</translation>
-    </message>
-    <message>
-        <source>New classroom</source>
-        <translation>Nova classe</translation>
-    </message>
-    <message>
-        <source>New name for classroom</source>
-        <translation>Nou nom per la classe</translation>
-    </message>
-    <message>
-        <source>No configuration-file found</source>
-        <translation>No s'ha trobat el fitxer de configuració</translation>
-    </message>
-    <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Introduiu un nou nom per la classe "%1".</translation>
-    </message>
-    <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Introduiu el nom de la classe que voleu crear.</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation>Suprimeix</translation>
-    </message>
-    <message>
-        <source>Remove classroom</source>
-        <translation>Suprimeix la classe</translation>
-    </message>
-    <message>
-        <source>Show all computers in classroom</source>
-        <translation>Mostra tots els ordinadors de l'aula</translation>
-    </message>
-    <message>
-        <source>Show/hide</source>
-        <translation>Mostra/Amaga</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>Aquí és on es gestionen els ordinadors i les aules. Podeu afegir ordinadors i classes clicant amb el botó dret en aquesta llista.</translation>
-    </message>
-    <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Useu aquest espai per gestionar els vostres ordinadors i classes d'una manera més fàcil.</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation>Noms d'usuari</translation>
-    </message>
-    <message>
-        <source>Show usernames</source>
-        <translation>Mostra els noms d'usuari</translation>
-    </message>
-    <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Useu el menú contextual (botó dret del ratolí) per afegir o suprimir ordinadors i/o classes.</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation>Exporta a fitxer de text</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>Useu aquest botó per exportar aquesta llista d'ordinadors i noms d'usuari en un fitxer de text. Podeu usar aquest fitxer més tard per recollir els fitxers un cop acabat l'examen. Això és necessari alguns cops, ja que alguns usuaris poden haver acabat i sortit de la sessió més aviat i aleshores no podreu recollir llurs fitxers en acabar l'examen.</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation>Selecciona fitxer de sortida</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation>Fitxers de text (*.txt)</translation>
-    </message>
-    <message>
-        <source>Actions for selected</source>
-        <translation>Accions a seleccionar</translation>
-    </message>
-</context>
-<context>
-    <name>client</name>
-    <message>
-        <source>Demo running</source>
-        <translation>Modo demo funcionando</translation>
-    </message>
-    <message>
-        <source>Desktop locked</source>
-        <translation>Escritorio bloqueado</translation>
-    </message>
-    <message>
-        <source>Host unreachable</source>
-        <translation>Equipo no disponible</translation>
-    </message>
-    <message>
-        <source>No user logged in</source>
-        <translation>Usuario no conectado</translation>
-    </message>
-    <message>
-        <source>Unknown state</source>
-        <translation>Estat desconegut</translation>
-    </message>
-</context>
-<context>
-    <name>clientAction</name>
-    <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation>Esteu segur que voleu desconnectar tots els usuaris en tots els ordinadors visibles?</translation>
-    </message>
-    <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Esteu segur que voleu desconnectar tots els usuaris en tots els ordinadors seleccionats?</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Desconnecta l'usuari</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Esteu segur que voleu reiniciar tots els ordinadors visibles?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Esteu segur que voleu reiniciar tots els ordinadors seleccionats?</translation>
-    </message>
-    <message>
-        <source>Reboot computers</source>
-        <translation>Reinicia els ordinadors</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Esteu segur que voleu apagar tots els ordinadors visibles?</translation>
-    </message>
-    <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Esteu segur que voleu apagar tots els ordinadors seleccionats?</translation>
-    </message>
-</context>
-<context>
-    <name>clientMenu</name>
-    <message>
-        <source>Overview</source>
-        <translation>Descripció general</translation>
-    </message>
-    <message>
-        <source>Fullscreen demo</source>
-        <translation>Demo a pantalla sencera</translation>
-    </message>
-    <message>
-        <source>Window demo</source>
-        <translation>Demo en ventana</translation>
-    </message>
-    <message>
-        <source>Locked display</source>
-        <translation>Pantalla bloquejada</translation>
-    </message>
-    <message>
-        <source>View live</source>
-        <translation>Vista en directe</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Control remot</translation>
-    </message>
-    <message>
-        <source>Let student show demo</source>
-        <translation>Permet a l'alumne mostrar la demo</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Envia un missatge de text</translation>
-    </message>
-    <message>
-        <source>Logon user</source>
-        <translation>Connecta l'usuari</translation>
-    </message>
-    <message>
-        <source>Logout user</source>
-        <translation>Desconnecta l'usuari</translation>
-    </message>
-    <message>
-        <source>Take a snapshot</source>
-        <translation>Fes una instantània</translation>
-    </message>
-    <message>
-        <source>Power on</source>
-        <translation>Engega</translation>
-    </message>
-    <message>
-        <source>Reboot</source>
-        <translation>Reinicia</translation>
-    </message>
-    <message>
-        <source>Power down</source>
-        <translation>Apaga</translation>
-    </message>
-    <message>
-        <source>Execute commands</source>
-        <translation>Executa les ordres</translation>
-    </message>
-</context>
-<context>
-    <name>clientSettings</name>
-    <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</translation>
-    </message>
-    <message>
-        <source>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
-    </message>
-    <message>
-        <source>Act as &demo replicator</source>
-        <translation>Actuar como &demo replicador</translation>
-    </message>
-    <message>
-        <source>Analog</source>
-        <translation>Analógico</translation>
-    </message>
-    <message>
-        <source>C&ancel</source>
-        <translation>C&ancelar</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Clase</translation>
-    </message>
-    <message>
-        <source>Client settings</source>
-        <translation>Configuración de los clientes</translation>
-    </message>
-    <message>
-        <source>Connection</source>
-        <translation>Conexión</translation>
-    </message>
-    <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
-    </message>
-    <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
-    </message>
-    <message>
-        <source>General</source>
-        <translation>General</translation>
-    </message>
-    <message>
-        <source>Host is &gateway for subnet</source>
-        <translation>L'amfitrió fa de &passarel·la de la subxarxa</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;">Activate this option for at least one host in a subnet.</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;">Activeu aquesta opció per al menys un amfitrió en una subxarxa.</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 if the host is the gateway for the subnet.</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;">Comproveu si l'amfitrió es la passarel·la per la subxarxa.</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;">connection to hosts on the same level</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;">connexió entre amfitrions del mateix nivell</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;">enter an IP-address or hostname under which iTALC can reach the client (use ':' for specifying an optional port-number)</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;"> introduiu una adreça IP o nom d'equip per a qui iTALC es connecti  al client (useu ':' per especificar un número de port opional)</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;">Hardware/MAC-address of client - only used for powering on client</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;">Adreça MAC del client - usada només per engegar els equips</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;">Here you can specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Aquí podeu especificar como aquest amfitrió es connecta a la xarxa d'iTALC, ex. amfitrions en el mateix nivelll. Els clients normals es connecten amb LAN de 100 MBit/s, però pot haver amfitrions especials com passarel·les a altres xarxes iTALC d'altres escoles o ordinadors d'estudiants des de casa seva.. En aquests casos iTALC prova d'optimitzar la utilització de l'ample de banda.</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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;">Quan es mostra una demo a més d'un amfitrió en una xarxa externa, és important activar aquesta opció en, almenys, un dels amfitrions afectats. D'aquesta manera tota la informació s'envia només un cop al demo replicador, que és qui proveu la informació per tots els altres clients de la xarxa. Especialment en enllaços lents la utilització d'aquesta opció és esenciall. És recomanable que activeu aquesta opció en la passarel·la de la subxarxa (mireu l'opció de més amunt). </p></body></html></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Configuració del client</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>IP/hostname</source>
-        <translation>IP/nom de l'amfitrió</translation>
-    </message>
-    <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
-    </message>
-    <message>
-        <source>MAC-address</source>
-        <translation>Adreça MAC</translation>
-    </message>
-    <message>
-        <source>Name</source>
-        <translation>Nom</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>D'ac&ord</translation>
-    </message>
-    <message>
-        <source>Other/undefined computer</source>
-        <translation>Ordinador indefinit o un altre</translation>
-    </message>
-    <message>
-        <source>Student computer</source>
-        <translation>Ordinador de l'estudiant</translation>
-    </message>
-    <message>
-        <source>Teacher computer</source>
-        <translation>Ordinador del professor</translation>
-    </message>
-    <message>
-        <source>Type</source>
-        <translation>Tipus</translation>
-    </message>
-    <message>
-        <source>VPN</source>
-        <translation>VPN</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></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;">Sobrenom opcional de l'amfitrió que es mostra en l'iTALC</p></body></html></translation>
-    </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
-    <message>
-        <source>Invalid MAC-address</source>
-        <translation>Dirección MAC inválida</translation>
-    </message>
-    <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>No s'ha trobat adreça IP/amfitrió</translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>No heu especificat una adreça IP o amfitrió per l'ordinador!</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>Heu especificat una adreça MAC invàlida. Deixeu el camp en blanc o introduïu una adreça MAC vàlida (useu ":" com a separador).</translation>
-    </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
-    <message>
-        <source>Cancel</source>
-        <translation>Cancel·la</translation>
-    </message>
-    <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Introduiu ordres que s'han d'executar en el/s client/s:</translation>
-    </message>
-    <message>
-        <source>&Run!</source>
-        <translation>&Executar!</translation>
-    </message>
-    <message>
-        <source>Run commands on client(s)</source>
-        <translation>Executa ordres en els clients</translation>
-    </message>
-</context>
-<context>
-    <name>config</name>
-    <message>
-        <source>1 second</source>
-        <translation>1 segon</translation>
-    </message>
-    <message>
-        <source>Administrator</source>
-        <translation>Administrador</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Domini</translation>
-    </message>
-    <message>
-        <source>Double-click action for client-window</source>
-        <translation>Acció de doble clic per a finestra del client</translation>
-    </message>
-    <message>
-        <source>High (Truecolor)</source>
-        <translation>Alt (color vertader)</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 mouse-cursor over 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;">Activeu aquesta opció si us molesta l'aparició de globus d'ajut de la barra quan moieu el cursor del ratolí per sobre la barra de botons.</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;">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;">No mostreu els globus d'ajut per la barra de botons.</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;">Here you can set the interval between updates of clients. Higher values result in lower network-traffic and lower CPU-usage on this computer.</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;">Aquí podeu especificar un interval  entre la actualitzacó dels clients. Valors més alts generen un tràfic de xarxa i un consum de la CPU baix en aquest ordinador.</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;"><span style=" font-size:8pt; font-style:italic;">Please note, that some changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Alguns dels canvis no tindràn efecte fins que reinicieu l'iTALC.</span></p></body></html></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;">Aquí podeu seleccionar el vostre rol. Canvieu això només si sabeu el que esteu fent. D'altra manera no podreu accedir a cap client fins que no recupereu l'antic rol.</p></body></html></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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">Aquí podeu configurar la qualitat de la pantalla que desitjeu en el mode demo. Una qualitat baixa genera un consum de la CPU i un tràfic de xarxa baix, mentre que una qualitat alta alenteix l'ordinador i disminueix les imatges per segon de la demo. És recomanable que experimenteu amb això per una òptima configuració.</p></body></html></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;">Aquí podeu especificar que passa si feu un doble clic sobre la finestra d'un client.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Interval between updates</source>
-        <translation>Intérval entre actualitzacions</translation>
-    </message>
-    <message>
-        <source>Low (15 bit)</source>
-        <translation>Baix (15 bit)</translation>
-    </message>
-    <message>
-        <source>Medium (18 bit)</source>
-        <translation>Mig (18 bit)</translation>
-    </message>
-    <message>
-        <source>No balloon-tooltips</source>
-        <translation>Desactiva ajuts en globus</translation>
-    </message>
-    <message>
-        <source>Other</source>
-        <translation>Un altre</translation>
-    </message>
-    <message>
-        <source>Quality of demo-mode</source>
-        <translation>Qualitat del mode demo</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Control remot</translation>
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation>segons</translation>
-    </message>
-    <message>
-        <source>Settings for multi-logon</source>
-        <translation>Configuració per entrada massiva</translation>
-    </message>
-    <message>
-        <source>Supporter</source>
-        <translation>Suport tècnic</translation>
-    </message>
-    <message>
-        <source>Teacher</source>
-        <translation>Professor</translation>
-    </message>
-    <message>
-        <source>User interface</source>
-        <translation>Interfície d'usuari</translation>
-    </message>
-    <message>
-        <source>View live in fullscreen</source>
-        <translation>Vista en directe de pantalla completa</translation>
-    </message>
-    <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>El vostre rol (es necessiten les claus correctes!)</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;">No mostris text en els botons de la barra d'eines</p></body></html></translation>
-    </message>
-    <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Sense text en els botons de la barra d'eines</translation>
-    </message>
-</context>
-<context>
-    <name>configWidget</name>
-    <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>En aquest espai podeu personalitzar l'iTALC a les vostres necessitats.</translation>
-    </message>
-    <message>
-        <source>Your iTALC-configuration</source>
-        <translation>La vostra configuració de l'iTALC</translation>
-    </message>
-</context>
-<context>
-    <name>demoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Demo</translation>
-    </message>
-</context>
-<context>
-    <name>isdServer</name>
-    <message>
-        <source>Message from teacher</source>
-        <translation>Missatge del professor</translation>
-    </message>
-    <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Algú en l'amfitrió %1 intenta accedir a la vostra pantalla. Voleu premetre-li l'accés?</translation>
-    </message>
-    <message>
-        <source>Never for this session</source>
-        <translation>Mai per aquesta sessió</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation>Sempre per aquesta sessió</translation>
-    </message>
-    <message>
-        <source>Confirm access</source>
-        <translation>Confirmeu l'accés</translation>
-    </message>
-    <message>
-        <source>ISD-server error</source>
-        <translation>Error del servidor ISD</translation>
-    </message>
-    <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>El servidor ISD no s'ha pogut iniciar perquè el port '%1' ja és en us. Assegureu-vos que cap altra aplicació està usant aquest port i proveu-ho de nou.</translation>
-    </message>
-    <message>
-        <source>Authentication error</source>
-        <translation>Error d'autenticació</translation>
-    </message>
-    <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Algú (IP: %1) ha intentat accedir a aquest ordinador, però no s'ha pogut autenticar amb èxit!</translation>
-    </message>
-</context>
-<context>
-    <name>ivsConnection</name>
-    <message>
-        <source>Snapshot</source>
-        <translation>Instantània</translation>
-    </message>
-    <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>No s'ha pogut fer una instantània ja que el directori %1 no esxiteix o no s'ha pogut crear.</translation>
-    </message>
-    <message>
-        <source>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>lockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation>Bloqueja la pantalla</translation>
-    </message>
-</context>
-<context>
-    <name>messageBox</name>
-    <message>
-        <source>OK</source>
-        <translation>D'acord</translation>
-    </message>
-</context>
-<context>
-    <name>overview</name>
-    <message>
-        <source>About iTALC</source>
-        <translation>Acerca de iTALC</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>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><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;">Bienvenido a iTALC!</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>Podeu configurar l'iTALC. Això es fa normalment usant la configuració de l'espai de treball.</translation>
-    </message>
-    <message>
-        <source>The snapshot-workspace is a very useful tool. It let's you manage the snapshots you made.</source>
-        <translation>L'espai de treball d'instantànies és una eina molt útilitzada. Us permet gestionar les instantànies que feu.</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>L'us del gestor de classes us permet gestionar les vostres classes i ordinadors.</translation>
-    </message>
-</context>
-<context>
-    <name>overviewWidget</name>
-    <message>
-        <source>Overview</source>
-        <translation>Vista general</translation>
-    </message>
-    <message>
-        <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Alguna informació bàsica sobre l'iTALC i com usar-lo.</translation>
-    </message>
-</context>
-<context>
-    <name>pageFinished</name>
-    <message>
-        <source>iTALC is now ready to run!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
-    <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>La nova clau de creació o importació s'ha d'instal·lar en algun lloc. Es recomana deixar els directoris suggerits.</translation>
-    </message>
-    <message>
-        <source>Directory to store public key in</source>
-        <translation>Directori on desar la clau pública</translation>
-    </message>
-    <message>
-        <source>Directory to store private key in</source>
-        <translation>Directori on desar la clau privada</translation>
-    </message>
-    <message>
-        <source>Export private key too</source>
-        <translation>Exporta també la clau privada</translation>
-    </message>
-    <message>
-        <source>Key directories</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
-    <message>
-        <source>Import public key of master computer</source>
-        <translation>Importa la clau pública de l'ordinador principal</translation>
-    </message>
-    <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Escolliu una ubicació per la clau pública exportada:</translation>
-    </message>
-    <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Conserva totes les claus (només mentre s'instal·la la actualització)</translation>
-    </message>
-    <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>pageWelcome</name>
-    <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>remoteControlWidget</name>
-    <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Control remot (%1 en amfitrió %2)</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation>usuari desconegut</translation>
-    </message>
-    <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Vista en directe (%1 en amfitrió %2)</translation>
-    </message>
-</context>
-<context>
-    <name>remoteControlWidgetToolBar</name>
-    <message>
-        <source>Connected.</source>
-        <translation>Connectat.</translation>
-    </message>
-    <message>
-        <source>Connecting %1</source>
-        <translation>S'està connectant %1</translation>
-    </message>
-    <message>
-        <source>Fullscreen</source>
-        <translation>Pantalla completa</translation>
-    </message>
-    <message>
-        <source>Lock student</source>
-        <translation>Bloqueja l'estudiant</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Surt</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Control remoto</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Captura</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>Desbloquear</translation>
-    </message>
-    <message>
-        <source>View only</source>
-        <translation>Solo mirar</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation>Ventana</translation>
-    </message>
-</context>
-<context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Cancel</source>
-        <translation>Cancel·la</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Domini</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Connexió remota</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>D'ac&ord</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Contrasenya</translation>
-    </message>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Connexió remota</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Nom d'usuari</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>Useu els camps de sota per introduir el nom d'usuari, contrasenya i, opcionalment el nom de domini. Aquesta informació s'usa per connectar-se a l'ordinador.</translation>
-    </message>
-</context>
-<context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Confirma la sobreescritura</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Voleu sobreescriure %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Cancel·la el programa d'instal·lació</translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Següent</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Finalitza</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Surt</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>File does not exist</source>
-        <translation type="unfinished">El fitxer no existeix</translation>
-    </message>
-    <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
-        <translation type="unfinished">El fitxer %1 no s'ha pogut trobat. Marqueu aquest i proveu-ho de nou.</translation>
-    </message>
-</context>
-<context>
-    <name>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Escolliu el directori de la clau pública</translation>
-    </message>
-    <message>
-        <source>Choose private key directory</source>
-        <translation>Escolliu el directori de la clau privada</translation>
-    </message>
-    <message>
-        <source>Choose public key export directory</source>
-        <translation>Escolliu el directori d'exportació de la clau pública</translation>
-    </message>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
-    <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>snapshotList</name>
-    <message>
-        <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>La utilització d'aquest espai de treball us permet una gestió senzilla de les instantànies que heu fet.</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>Instantànies</translation>
-    </message>
-</context>
-<context>
-    <name>snapshots</name>
-    <message>
-        <source>Date:</source>
-        <translation>Data:</translation>
-    </message>
-    <message>
-        <source>Delete snapshot</source>
-        <translation>Esborra l'instantània</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation>Amfitrió:</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;">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;">Aquí es llisten totes les instantànies que feu. Podeu fer instantànies seleccionant l'opció corresponent en el menú contextual de la finestra del client. Aquestes instantànies es poden gestionar usant els botons de sota. </p></body></html></translation>
-    </message>
-    <message>
-        <source>Reload list</source>
-        <translation>Torna a carregar la llista</translation>
-    </message>
-    <message>
-        <source>Show snapshot</source>
-        <translation>Mostra instantània</translation>
-    </message>
-    <message>
-        <source>Time:</source>
-        <translation>Hora:</translation>
-    </message>
-    <message>
-        <source>User:</source>
-        <translation>Usuari:</translation>
-    </message>
-</context>
-<context>
-    <name>support</name>
-    <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>D'acord</translation>
-    </message>
-    <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Introduiu l'adreça IP o el nom de l'amfitrió a la persona a qui voleu donar suport.</translation>
-    </message>
-    <message>
-        <source>Support</source>
-        <translation>Suport</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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Suport </span></p></body></html></translation>
-    </message>
-</context>
-<context>
-    <name>textMessage</name>
-    <message>
-        <source>Cancel</source>
-        <translation>Cancel·la</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Envia un missatge de text</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>D'ac&ord</translation>
-    </message>
-    <message>
-        <source>Send text message</source>
-        <translation>Envia una missatge de text</translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Useu el camp de sota per escriure el vostre missatge que s'enviarà a tots els usuaris seleccionats.</translation>
-    </message>
-</context>
-<context>
-    <name>vncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>S'està establint la connexió a %1 ...</translation>
-    </message>
-</context>
-<context>
-    <name>wizard</name>
-    <message>
-        <source>Cancel</source>
-        <translation>Cancel·la</translation>
-    </message>
-    <message>
-        <source>Back</source>
-        <translation>Anterior</translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Següent</translation>
-    </message>
-    <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/cs.qm b/lib/resources/cs.qm
index 476780c..7869328 100644
Binary files a/lib/resources/cs.qm and b/lib/resources/cs.qm differ
diff --git a/lib/resources/cs.ts b/lib/resources/cs.ts
index 7dc2655..8b00254 100644
--- a/lib/resources/cs.ts
+++ b/lib/resources/cs.ts
@@ -2,1432 +2,1767 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="cs_CZ">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
     <message>
-        <source>Actions</source>
-        <translation type="unfinished">Akce</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">O iTALC</translation>
     </message>
-</context>
-<context>
-    <name>MainWindow</name>
     <message>
-        <source>MainWindow</source>
+        <source>About</source>
+        <translation type="unfinished">O programu</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>toolBar</source>
+        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>Authors</source>
+        <translation type="unfinished">Autoři</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Bez možnosti zápisu</translation>
+        <source>Translation</source>
+        <translation type="unfinished">Překlad</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>
+        <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>Classroom</source>
-        <translation type="unfinished">Třída</translation>
+        <source>License</source>
+        <translation type="unfinished">Licence</translation>
     </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel / iTALC Solutions</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>AccessDialogSlave</name>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Přepnout třídu</translation>
+        <source>Never for this session</source>
+        <translation type="unfinished">Nikdy pro toto sezení</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>
+        <source>Always for this session</source>
+        <translation type="unfinished">Vždy pro toto sezení</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>
+        <source>Confirm desktop access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Přehledový mód</translation>
+        <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>Overview</source>
-        <translation type="unfinished">Přehled</translation>
+        <source>Classroom-Manager</source>
+        <translation type="unfinished">Správce třídy</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>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished">Celobrazová demonstrace</translation>
+        <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>Fullscreen Demo</source>
-        <translation type="unfinished">Celobrazová demonstrace</translation>
+        <source>Classrooms/computers</source>
+        <translation type="unfinished">Počítače/třídy</translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Ukonči demonstraci</translation>
+        <source>IP-address</source>
+        <translation type="unfinished">IP-adresa</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>
+        <source>Usernames</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demonstrace v oknÄ›</translation>
+        <source>Show usernames</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Demonstrace v oknÄ›</translation>
+        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</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>
+        <source>Export to text-file</source>
+        <translation type="unfinished">Exportovat do textového souboru</translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Zamknout/odemknout počítače</translation>
+        <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>Lock all</source>
-        <translation type="unfinished">Zamknout vše</translation>
+        <source>Hide teacher computers</source>
+        <translation type="unfinished">Skrýt učitelské počítače</translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Odemknout vše</translation>
+        <source>Show/hide</source>
+        <translation type="unfinished">Zobrazit/skrýt</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>
+        <source>Edit settings</source>
+        <translation type="unfinished">Upravit nastavení</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Poslat textovou zprávu</translation>
+        <source>Remove</source>
+        <translation type="unfinished">Odstranit</translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished">Textová zpráva</translation>
+        <source>Show all computers in classroom</source>
+        <translation type="unfinished">Zobrazit všechny počítače ve třídě</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>
+        <source>Hide all computers in classroom</source>
+        <translation type="unfinished">Skrýt všechny počítače ve třídě</translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Zapne počítače</translation>
+        <source>Edit name</source>
+        <translation type="unfinished">Upravit jméno</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Zapnout</translation>
+        <source>Remove classroom</source>
+        <translation type="unfinished">Odstranit třídu</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>
+        <source>Add computer</source>
+        <translation type="unfinished">Přidat počítač</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Vypne počítače</translation>
+        <source>Add classroom</source>
+        <translation type="unfinished">Přidat třídu</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Vypnout</translation>
+        <source>No configuration-file found</source>
+        <translation type="unfinished">Nebyl nalezen žádný konfigurační soubor</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>
+        <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>Logon</source>
-        <translation type="unfinished">Odhlásit</translation>
+        <source>Error in configuration-file</source>
+        <translation type="unfinished">Chyba v konfiguračním souboru</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Vzdálené odhlášení</translation>
+        <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>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Kliknutím na toto tlačítko můžete zadat uživatelské jméno a heslo nutné pro odhlášení daného uživatele nebo dostupných počítačů.</translation>
+        <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>Support</source>
-        <translation type="unfinished">Podpora</translation>
+        <source>Select output-file</source>
+        <translation type="unfinished">Vybrat výstupní soubor</translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Přímá podpora</translation>
+        <source>Text files (*.txt)</source>
+        <translation type="unfinished">Textové soubory (*.txt)</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">Když potřebuješ pomoct někomu u konkrétního počítače, můžeš použít toto tlačítko a vložit jméno stanice nebo IP.</translation>
+        <source>Actions for selected</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Seřadit/uspořádat</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Akce</translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Uspořádá okna a nastaví jejich velikosti</translation>
+        <source>Actions for %1</source>
+        <translation type="unfinished">Akce pro %1</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>
+        <source>New name for classroom</source>
+        <translation type="unfinished">Nové jméno třídy</translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Automatický pohled</translation>
+        <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>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Automaticky přenastaví okna a jejich velikosti</translation>
+        <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>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>
+        <source>Missing classroom</source>
+        <translation type="unfinished">Chybí třída</translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Nebyla nalezena žádná platná tlačítka</translation>
+        <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>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Nebyly nalezeny žádné autentizační klíče nebo jsou vaše klíče poškozeny. Prosím, vytvořte nový pár klíčů pomocí ICA (podívejte se na dokumentaci  http://italc.sf.net/wiki/index.php?title=Installation).
-Jinak nebudete moci přistupovat k počítačům pomocí iTALC.</translation>
+        <source>New classroom</source>
+        <translation type="unfinished">Nová třída</translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">Služba iTALC neběží</translation>
+        <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>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Vypadá to, že služba iTALC běžící na tomto počítači nebo autentizační klíče nejsou nastaveny správně.Tato služba je pro spuštění iTALC vyžadována. Pro vyřešení tohoto problému kontaktujte svého administrátora.</translation>
+        <source>Unknown state</source>
+        <translation type="unfinished">Neznámý stav</translation>
     </message>
     <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">iTALC Master Control</translation>
+        <source>No user logged in</source>
+        <translation type="unfinished">Žádný uživatel není přihlášen</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Vzdálené ovládání</translation>
+        <source>Host unreachable</source>
+        <translation type="unfinished">Počítač není  k dispozici</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished">Ukončit</translation>
+        <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>QApplication</name>
+    <name>ClientAction</name>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Klient iTALC %1 na %2:%3</translation>
+        <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>Unable to register service '%1'.</source>
-        <translation>Nemohu zaregistrovat službu '%1'.</translation>
+        <source>Are you sure want logout all users on all selected computers ?</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>Nemohu kontaktovat Správce služeb (máte potřebná oprávnění?!) - služba '%1' nebyla zaregistrována.</translation>
+        <source>Logout user</source>
+        <translation type="unfinished">Odhlásit uživatele</translation>
     </message>
     <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Služba '%1' je již registrována.</translation>
+        <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>The service '%1' could not be registered.</source>
-        <translation>Nemohu zaregistrovat službu '%1'.</translation>
+        <source>Are you sure want to reboot all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Služba '%1' byla úspěšně registrována.</translation>
+        <source>Reboot computers</source>
+        <translation type="unfinished">Restartovat počítače</translation>
     </message>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Službu '%1' není možno zastavit.</translation>
+        <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>The service '%1' has been unregistered.</source>
-        <translation>Služba '%1' byla odregistrována.</translation>
+        <source>Are you sure want to power down all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>ClientSettingsDialog</name>
     <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>
+        <source>Invalid MAC-address</source>
+        <translation type="unfinished">Neplatná MAC-adresa</translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Službu '%1' nebylo možno odregistrovat.</translation>
+        <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>The service '%1' could not be found.</source>
-        <translation>Službu '%1' nelze najít.</translation>
+        <source>Client settings</source>
+        <translation type="unfinished">Nastavení klienta</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>
+        <source>IP/hostname</source>
+        <translation type="unfinished">IP/jméno</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>
+        <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 ':' for specifying an optional port-number)</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;">zadejte IP-adresu nebo jméno počítače, na kterém běží klient iTALC (pro určení volitelného čísla portu použijte ':')</p></body></html></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL</translation>
+        <source>Name</source>
+        <translation type="unfinished">Jméno</translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>iTALC-snímky</translation>
+        <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></source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation>O iTALC</translation>
+        <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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">O iTALC</span></p></body></html></translation>
+        <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></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;">Hardwarová/MAC-adresa klienta - používá se pouze pro zapínání klientského počítače</p></body></html></translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>O programu</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Třída</translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Autoři</translation>
+        <source>Type</source>
+        <translation type="unfinished">Typ</translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Překlad</translation>
+        <source>Student computer</source>
+        <translation type="unfinished">Studentský počítač</translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Licence</translation>
+        <source>Teacher computer</source>
+        <translation type="unfinished">Učitelský počítač</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Other/undefined computer</source>
+        <translation type="unfinished">Jiný/nedefinovaný počítač</translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
+        <source>Missing IP address/hostname</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
+        <source>You didn't specify an IP address or hostname for the computer!</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>classroomManager</name>
+    <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 network-traffic and lower CPU-usage on this computer.</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;">Zde se zadává interval mezi jednotlivými aktualizacemi klientů. Vyšší hodnoty snižují provoz na síti i zátěž CPU tohoto počítače.</p></body></html></translation>
+    </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></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 mouse-cursor over 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;">Tuto volbu zaškrněte, pokud se vám nelíbí zobrazování nápovědy v panelu nástrojů při ukázání myší na dané tlačítko.</p></body></html></translation>
+    </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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Pamatujte prosím, že některá nastavení nebudou aktivní dokud nerestartujete iTALC.</span></p></body></html></translation>
+    </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>Classroom-Manager</source>
-        <translation>Správce třídy</translation>
+        <source>Only critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>V tomto rozhraní můžete snadno spravovat počítače a třídy.</translation>
+        <source>Errors and critical messages</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>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>
+        <source>Warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Počítače/třídy</translation>
+        <source>Information, warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>IP-adresa</translation>
+        <source>Debug messages and everything else</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Skrýt učitelské počítače</translation>
+        <source>Limit log file size</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Nebyl nalezen žádný konfigurační soubor</translation>
+        <source>MB</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>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>
+        <source>Clear all log files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Chyba v konfiguračním souboru</translation>
+        <source>Desktop capturing</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>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>
+        <source>Enable capturing of layered (semi-transparent) windows</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>Chyba při analýze konfiguračního souboru %1.
-Upravte ho prosím. Jinak byste tento soubor měli smazat.</translation>
+        <source>Poll full screen</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Zobrazit/skrýt</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Upravit nastavení</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Odstranit</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Akce</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Zobrazit všechny počítače ve třídě</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Skrýt všechny počítače ve třídě</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Upravit jméno</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Odstranit třídu</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Akce pro %1</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Přidat počítač</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Přidat třídu</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Snímky</translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Nové jméno třídy</translation>
+        <source>Authentication methods</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Zadejte prosím nové jméno pro třídu "%1".</translation>
+        <source>Access key management</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>Opravdu si přejete odstranit třídu "%1"?
-Všechny počítače ve třídě budou odstraněny též!</translation>
+        <source>Logon settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Chybí třída</translation>
+        <source>&File</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>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>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Nová třída</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Zadejte prosím jméno nové třídy, kterou si přejete vytvořit.</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Uživatelská jména</translation>
+        <source>&Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Zobraz uživ. jména</translation>
+        <source>Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Použij kontextové menu (pravé tlač. myši) pro přídání/odebrání počítačů a/nebo tříd.</translation>
+        <source>Ctrl+S</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Exportovat do textového souboru</translation>
+        <source>L&oad settings from 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>Použij toto tlačítko pro export tohoto seznamu počítačů a uživ. jmen do textového souboru. Tento soubor lze později použít pro sbírání  souborů po ukončení zkoušky. To může být někdy nutné, protože někteří uživatelé mohou skončit a odhlásit se dříve a vy tak nejste schopen získat jejich soubory nakonci zkoušky.</translation>
+        <source>Ctrl+O</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Vybrat výstupní soubor</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">O iTALC</translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Textové soubory (*.txt)</translation>
+        <source>About Qt</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation>Akce pro vybrané</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Neznámý stav</translation>
+        <source>toolBar</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Žádný uživatel není přihlášen</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Počítač není  k dispozici</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Běžící demo</translation>
+        <source>Load settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Desktop zamknut</translation>
+        <source>XML files (*.xml)</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>Opravdu chcete odhlásit uživatele všech zobrazených počítačů?</translation>
+        <source>Save settings to file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Opravdu chcete odhlásit uživatele všech vybraných počítačů?</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Odhlásit uživatele</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Opravdu si přejete restartovat všechny zobrazené počítače?</translation>
+        <source>Configuration not writable</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Opravdu si přejete restartovat všechny vybrané počítače?</translation>
+        <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>Reboot computers</source>
-        <translation>Restartovat počítače</translation>
+        <source>All settings were applied successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Opravdu si přejete vypnout všechny zobrazené počítače?</translation>
+        <source>An error occured while applying settings!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Opravdu si přejete vypnout všechny vybrané počítače?</translation>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation>Přehled</translation>
+        <source>No write access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation>Celobrazová demonstrace</translation>
+        <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>Window demo</source>
-        <translation>Demonstrace v oknÄ›</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Třída</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation>Obrazovka zamknuta</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Přepnout třídu</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation>Zobrazit naživo</translation>
+        <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>Remote control</source>
-        <translation>Vzdálené ovládání</translation>
+        <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>Let student show demo</source>
-        <translation>Zobrazit studentům demo</translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Přehledový mód</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation>Poslat textovou zprávu</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Přehled</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation>Přihlásit uživatele</translation>
+        <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>Logout user</source>
-        <translation>Odhlásit uživatele</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation>Sejmout obrazovku</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation>Zapnout</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation>Restartovat</translation>
+        <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>Power down</source>
-        <translation>Vypnout</translation>
+        <source>Window demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation>Vykonat příkaz</translation>
+        <source>Window Demo</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Nastavení klienta</translation>
+        <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><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:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Nastavení klienta</span></p></body></html></translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">Zamknout/odemknout počítače</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Obecné</translation>
+        <source>Lock all</source>
+        <translation type="unfinished">Zamknout vše</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Typ</translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">Odemknout vše</translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Studentský počítač</translation>
+        <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>Teacher computer</source>
-        <translation>Učitelský počítač</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Poslat textovou zprávu</translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Jiný/nedefinovaný počítač</translation>
+        <source>Text message</source>
+        <translation type="unfinished">Textová zpráva</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation>Třída</translation>
+        <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>MAC-address</source>
-        <translation>MAC-adresa</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">Zapne počítače</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 ':' for specifying an optional port-number)</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;">zadejte IP-adresu nebo jméno počítače, na kterém běží klient iTALC (pro určení volitelného čísla portu použijte ':')</p></body></html></translation>
+        <source>Power on</source>
+        <translation type="unfinished">Zapnout</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>IP/jméno</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></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;">Hardwarová/MAC-adresa klienta - používá se pouze pro zapínání klientského počítače</p></body></html></translation>
+        <source>Power down computers</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Jméno</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Vypnout</translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <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>Connection</source>
-        <translation>Připojení</translation>
+        <source>Support</source>
+        <translation type="unfinished">Podpora</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;">connection to hosts on the same level</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řipojení k počítačům na stejné úrovni</p></body></html></translation>
+        <source>Direct support</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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Zde můžete určit jakým způsobem je počítač připojen k síti iTALC. Běžně bývají klientské počítači připojeny skrz 100Mb síť LAN, ale mohou zde být také speciální počítače jako např. brány do ostatních sítí iTALC na jiných školách nebo na studentských počítačích doma. V takovém případě se iTALC pokusí optimalizovat zatížení sítě.</p></body></html></translation>
+        <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>Analog</source>
-        <translation>Analog</translation>
+        <source>Adjust/align</source>
+        <translation type="unfinished">Seřadit/uspořádat</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Adjust windows and their size</source>
+        <translation type="unfinished">Uspořádá okna a nastaví jejich velikosti</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 kb/s</translation>
+        <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>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 kb/s</translation>
+        <source>Auto view</source>
+        <translation type="unfinished">Automatický pohled</translation>
     </message>
     <message>
-        <source>100 MBit/s LAN</source>
-        <translation>LAN 100 Mb/s</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished">Automaticky přenastaví okna a jejich velikosti</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>LAN 1000 Mb/s</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 if the host is the gateway for the subnet.</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;">Zašrtněte v případě, že je počítač zároveň branou podsítě.</p></body></html></translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host is &gateway for subnet</source>
-        <translation>Počítač je &branou podsítě</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Vzdálené ovládání</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;">Activate this option for at least one host in a subnet.</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;">Tuto volbu vyberte alespoň pro jeden počítač v podsíti.</p></body></html></translation>
+        <source>Could not modify the autostart property for the iTALC Service.</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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ři zobrazování dema pro jeden nebo více počítačů cizí sítě, je vhodné vybrat tuto volbu u alespoň jednoho počítače, kterého se to týká. Tak budou data demonstrace odesílána na replikátor pouze jednou a ten pak poskytne data ostaním počítačům v síti. To se hodí především pro pomalejší linky. Běžně by tato volba měla být povolena na bráně podístě (podívejte se na volbu výše).</p></body></html></translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Fungovat jako &demo replikátor</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>Z&rušit</translation>
+        <source>Enable desktop switching for screen lock (experimental)</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></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;">Volitelná přezdívka hosta zobrazována v iTALC.</p></body></html></translation>
+        <source>Log to standard error output</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Chybí IP-adresa/jméno počítače</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Nezadali jste IP-adresu nebo jméno počítače!</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Neplatná MAC-adresa</translation>
+        <source>VNC reflector</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>Musíte zadat platnou MAC-adresu. Buď zadejte platnou MAC-adresu (oddělovačem je ":"), nebo nechte políčko prázdné.</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Spustit příkazy na klientech</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Zadejte příkazy, které si přejete spustit na klientech:</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Zrušit</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Spustit!</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Interval mezi aktualizacemi</translation>
+        <source>Key file authentication</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 network-traffic and lower CPU-usage on this computer.</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;">Zde se zadává interval mezi jednotlivými aktualizacemi klientů. Vyšší hodnoty snižují provoz na síti i zátěž CPU tohoto počítače.</p></body></html></translation>
+        <source>ACL-based logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 sekunda</translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation>(sp) sekund</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Kvalita demo-módu</translation>
+        <source>Launch key file assistant</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">Zde můžete nastavit kvalitu zobrazování ukázkového módu. Nižší kvalita má za následek nižší zátěž CPU a sítě, zatímco vyšší kvalita může zpomalit váš počítač a snížit snímkovací frekvenci vaší ukázky. Pro optimální nastavení vám nezbyde nic jiného než experimentovat.</p></body></html></translation>
+        <source>Manage permissions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Nízká (15 bitů)</translation>
+        <source>Test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Střední (18 bitů)</translation>
+        <source>Access confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Vysoká (Truecolor)</translation>
+        <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>User interface</source>
-        <translation>Uživatelské rozhraní</translation>
+        <source>Logon authentication</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></translation>
+        <source>Allow same user to access desktop without confirmation</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 mouse-cursor over 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;">Tuto volbu zaškrněte, pokud se vám nelíbí zobrazování nápovědy v panelu nástrojů při ukázání myší na dané tlačítko.</p></body></html></translation>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Bez tipů panelu nástrojů</translation>
+        <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>Your role (needs according keys!)</source>
-        <translation>Vaše role (vyžaduje odpovídající klíče!)</translation>
+        <source>1)</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><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>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Učitel</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Administrátor</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Podpora</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Jiná</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Nastavení pro vícenásobné přihlášení</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Doména</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Dvojklik v oknÄ› klienta</translation>
+        <source>Generate bug report archive</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><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>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Vzdálené ovládání</translation>
+        <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>View live in fullscreen</source>
-        <translation>Zobrazení naživo v celé obrazovce</translation>
+        <source>Restart iTALC Service</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Pamatujte prosím, že některá nastavení nebudou aktivní dokud nerestartujete iTALC.</span></p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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;">Nezobrazuj text na tlačítkách panele nástrojů.</p></body></html></translation>
+        <source>Starting iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Žádný tekt na tlačítkách panele nástrojů</translation>
+        <source>Stopping iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Konfigurace iTALC</translation>
+        <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>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>V tomto praconím prostředí můžete upravit iTALC vašim potřebám.</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>Demo iTALC</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
-        <translation>Chyba serveru ISD</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>Server ISD se nepodařilo spustit, protože se port %1 stále používá. Ujistěte se prosím, že tento port nepoužívá jiná aplikace a zkuste to znovu.</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Potvrďte přístup</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Někdo z počítače %1 se snaží přistupovat k vaší obrazovce. Chcete mu/jí povolit přístup?</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Nikdy pro toto sezení</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Vždy pro toto sezení</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>Zpráva od učitele</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Chyba autentizace</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Někdo (IP: %1) se pokouší přistupovat k tomuto počítači, ale nedaří se ho autentizovat!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Snímek</translation>
+        <source>Could not contact iTALC service</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>Nemohu získat snímek, protože adresář %1 neexistuje a nelze ho vytvořit.</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>zamknutí obrazovky</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Zpráva od učitele</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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">
+        <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>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>
+        <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>Plocha se snímky obrazovky je velmi užitečná. Umožní vám spravovat snímky, které provedete.</translation>
+        <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>Samozřejmě, že můžete nastavovat iTALC. To se obvykle provádí pomocí konfigurační plochy.</translation>
+        <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>O iTALC</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>Používáním správce tříd lze spravovat třídy a počítače. Je také možné vidět, kteří uživatelé jsou přihlášeni.</translation>
+        <translation type="unfinished">O iTALC</translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Přehled</translation>
+        <translation type="unfinished">Přehled</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Některé základní informace o iTALC a použití programu.</translation>
+        <translation type="unfinished">Některé základní informace o iTALC a použití programu.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation type="unfinished">Uživatelské jméno</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation type="unfinished">Heslo</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Nově vytvořené nebo importované klíče je potřeba někam nainstalovat. Doporučuje se nechat navrhované adresáře.</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>Klient iTALC %1 na %2:%3</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Adresář pro uložení veřejných klíčů</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Nemohu zaregistrovat službu '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation>Adresář pro uložení soukromých klíčů</translation>
+        <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>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Služba '%1' je již registrována.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Exportovat také soukromý klíč</translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Nemohu zaregistrovat službu '%1'.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Služba '%1' byla úspěšně registrována.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Službu '%1' není možno zastavit.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Služba '%1' byla odregistrována.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Importovat veřejný klíč hlavního počítače</translation>
+        <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>Choose location of exported public key:</source>
-        <translation>Zvolit umístění exportovaného veřejného klíče:</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Službu '%1' nebylo možno odregistrovat.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Uchovat všechny klíče (pouze pokud aktualizujete stávající instalaci!)</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Službu '%1' nelze najít.</translation>
     </message>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
+        <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>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Zobrazení naživo (%1 na počítači %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Vzdálené ovládání (%1 na počítači %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation>neznámý uživatel</translation>
+        <translation type="unfinished">neznámý uživatel</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation>Pouze prohlížet</translation>
+        <translation type="unfinished">Pouze prohlížet</translation>
     </message>
     <message>
         <source>Remote control</source>
-        <translation>Vzdálené ovládání</translation>
+        <translation type="unfinished">Vzdálené ovládání</translation>
     </message>
     <message>
         <source>Lock student</source>
-        <translation>Zamknout studenta</translation>
+        <translation type="unfinished">Zamknout studenta</translation>
     </message>
     <message>
         <source>Unlock student</source>
-        <translation>Odemknout studenta</translation>
+        <translation type="unfinished">Odemknout studenta</translation>
     </message>
     <message>
         <source>Snapshot</source>
-        <translation>Snímek</translation>
+        <translation type="unfinished">Snímek</translation>
     </message>
     <message>
         <source>Fullscreen</source>
-        <translation>Celá obrazovka</translation>
+        <translation type="unfinished">Celá obrazovka</translation>
     </message>
     <message>
         <source>Window</source>
-        <translation>Okno</translation>
+        <translation type="unfinished">Okno</translation>
     </message>
     <message>
         <source>Quit</source>
-        <translation>Ukončit</translation>
+        <translation type="unfinished">Ukončit</translation>
     </message>
     <message>
         <source>Connecting %1</source>
-        <translation>Připojuji %1</translation>
+        <translation type="unfinished">Připojuji %1</translation>
     </message>
     <message>
         <source>Connected.</source>
-        <translation>Připojeno.</translation>
+        <translation type="unfinished">Připojeno.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
+    <name>RemoteLogonDialog</name>
     <message>
-        <source>Remote Logon</source>
-        <translation>Vzdálené přihlášení</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Vzdálené přihlášení</span></p></body></html></translation>
+        <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>Do níže uvedených políček zadejte uživatelské jméno, heslo a volitelně i jméno domény. Tyto informace budou použity pro přihlášení k počítačům.</translation>
+        <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>Uživatelské jméno</translation>
+        <translation type="unfinished">Uživatelské jméno</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>Heslo</translation>
+        <translation type="unfinished">Heslo</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation>Doména</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Zrušit</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <translation type="unfinished">Doména</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Potvrdit přepsání</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Přejete si přepsat %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Zrušit průvodce</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Další</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Dokončit</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Ukončit</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Zvolte adresář s veřejným klíčem</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Zvolte adresář se soukromým klíčem</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Zvolte adresář pro export veřejného klíče</translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Snímek</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>Snímky</translation>
+        <translation type="unfinished">Snímky</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Jednoduše spravuje vámi provedené snímky ploch.</translation>
+        <translation type="unfinished">Jednoduše spravuje vámi provedené snímky ploch.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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">
+        <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>Uživatel:</translation>
+        <translation type="unfinished">Uživatel:</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation>Počítač:</translation>
+        <translation type="unfinished">Počítač:</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation>Datum:</translation>
+        <translation type="unfinished">Datum:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>ÄŒas:</translation>
-    </message>
-    <message>
-        <source>Show snapshot</source>
-        <translation>Zobrazit snímek</translation>
+        <translation type="unfinished">ÄŒas:</translation>
     </message>
     <message>
-        <source>Delete snapshot</source>
-        <translation>Smazat snímek</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Načíst seznam</translation>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation>Podpora</translation>
+        <translation type="unfinished">Podpora</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Zadejte prosím IP-adresu nebo jméno počítače, kde sedí podpora, kterou si žádáte.</translation>
+        <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>OK</source>
-        <translation>OK</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Poslat textovou zprávu</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Zrušit</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Podpora </span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Připojuji se k %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Poslat textovou zprávu</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Přehled</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Poslat textovou zprávu</span></p></body></html></translation>
+        <source>Fullscreen demo</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>Do políčka níže zadejte vaši zprávu, která bude poslána vybraným uživatelům.</translation>
+        <source>Window demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">Obrazovka zamknuta</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>View live</source>
+        <translation type="unfinished">Zobrazit naživo</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Zrušit</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Vzdálené ovládání</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">Zobrazit studentům demo</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Připojuji se k %1 ...</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Poslat textovou zprávu</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
+        <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>Cancel</source>
-        <translation>Zrušit</translation>
+        <source>Power on</source>
+        <translation type="unfinished">Zapnout</translation>
+    </message>
+    <message>
+        <source>Reboot</source>
+        <translation type="unfinished">Restartovat</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Zpět</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Vypnout</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Další</translation>
+        <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
index bd10b5c..09cac6c 100644
Binary files a/lib/resources/de.qm and b/lib/resources/de.qm differ
diff --git a/lib/resources/de.ts b/lib/resources/de.ts
index d3f0b6d..9ef80e4 100644
--- a/lib/resources/de.ts
+++ b/lib/resources/de.ts
@@ -2,1000 +2,1411 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="de_DE">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
+    <message>
+        <source>About iTALC</source>
+        <translation>Ãœber iTALC</translation>
+    </message>
+    <message>
+        <source>About</source>
+        <translation>Ãœber</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</source>
+        <translation>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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-2011 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 ':' for specifying an optional port-number)</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;">Geben Sie eine IP-Adresse oder den Rechnernamen an, unter dem iTALC den Client erreichen kann (benutzen Sie ':' um eine optionale Portnummer anzugeben)</p></body></html></translation>
+    </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></source>
+        <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></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;">Hardware/MAC-Adresse des Rechners - wird nur zum Anschalten des Rechners benötigt</p></body></html></translation>
+    </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>Actions</source>
-        <translation type="unfinished">Aktionen</translation>
+        <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>MainWindow</name>
+    <name>Config</name>
     <message>
-        <source>MainWindow</source>
+        <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 network-traffic and lower CPU-usage on this computer.</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;">Hier können Sie den Aktualisierungsinterval für die Clients setzen. Höhere Werte resultieren in geringerer Netzlast und geringerer Prozessorbelastung auf diesem Computer.</p></body></html></translation>
+    </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>toolBar</source>
+        <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 mouse-cursor over toolbar-buttons.</p></body></html></source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>No balloon-tooltips</source>
+        <translation>Keine Ballon-Tooltips</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Kein Schreibzugriff</translation>
+        <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>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">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>
+        <source>No texts on toolbar-buttons</source>
+        <translation>Kein Text auf Buttons der Werkzeugleiste</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Klassenraum</translation>
+        <source>Your role (needs according keys!)</source>
+        <translation>Ihre Rolle (entspr. Schlüssel nötig!)</translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Klassenraum wechseln</translation>
+        <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>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Klicken Sie auf diesen Knopf, um ein Menü zu öffnen, in dem sie den aktiven Klassenraum wählen können.</translation>
+        <source>Teacher</source>
+        <translation>Lehrer</translation>
     </message>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Klicken Sie auf diesen Knopf, um zwischen Klassenräumen zu wechseln.</translation>
+        <source>Administrator</source>
+        <translation>Administrator</translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Ãœbersichtsmodus</translation>
+        <source>Supporter</source>
+        <translation>Support-Mitarbeiter</translation>
     </message>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Ãœbersicht</translation>
+        <source>Other</source>
+        <translation>Andere</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">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>
+        <source>Settings for multi-logon</source>
+        <translation>Einstellungen für Mehrfach-Anmeldung</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Vollbild-Demo</translation>
+        <source>Domain</source>
+        <translation>Domäne</translation>
     </message>
     <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Vollbild-Demo</translation>
+        <source>Double-click action for client-window</source>
+        <translation>Doppelklick-Aktion für Client-Fenster</translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Demo beenden</translation>
+        <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>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">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>
+        <source>Remote control</source>
+        <translation>Fernsteuern</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Fenster-Demo</translation>
+        <source>View live in fullscreen</source>
+        <translation>Live im Vollbild anschauen</translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Fenster-Demo</translation>
+        <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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Bitte beachten Sie, dass einige Änderungen erst wirksam werden, wenn Sie iTALC neustarten.</span></p></body></html></translation>
     </message>
+</context>
+<context>
+    <name>ConfigWidget</name>
     <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">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>
+        <source>Your iTALC-configuration</source>
+        <translation>Ihre iTALC-Konfiguration</translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Arbeitsflächen sperren/freigeben</translation>
+        <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>Lock all</source>
-        <translation type="unfinished">Alle sperren</translation>
+        <source>OK</source>
+        <translation>OK</translation>
     </message>
+</context>
+<context>
+    <name>DemoClient</name>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Alle freigeben</translation>
+        <source>iTALC Demo</source>
+        <translation>iTALC Demo</translation>
     </message>
+</context>
+<context>
+    <name>ItalcCoreServer</name>
     <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">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>
+        <source>Authentication error</source>
+        <translation>Authentifizierungsfehler</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Text-Nachricht schicken</translation>
+        <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>Text message</source>
-        <translation type="unfinished">Text-Nachricht</translation>
+        <source>VNC authentication failed because of too many authentication tries.</source>
+        <translation>VNC-Authentifizierung aufgrund zu häufiger Versuche fehlgeschlagen.</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">Nutzen Sie diesen Knopf, um an alle Nutzer eine Text-Nachricht zu schicken, beispielsweise um ihnen neue Aufgaben mitzuteilen.</translation>
+        <source>VNC authentication failed.</source>
+        <translation>VNC-Authentifizierung fehlgeschlagen.</translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Computer anschalten</translation>
+        <source>VNC server closed connection.</source>
+        <translation>VNC-Server hat die Verbindung geschlossen.</translation>
     </message>
+</context>
+<context>
+    <name>KeyFileAssistant</name>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Anschalten</translation>
+        <source>iTALC Access Key Assistant</source>
+        <translation>iTALC-Schlüsselassistent</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">Klicken Sie auf diesen Knopf, um alle angezeigten Computer anzuschalten. Auf diese Weise müssen Sie nicht jeden Computer einzeln per Hand einschalten.</translation>
+        <source>Create/import iTALC access keys</source>
+        <translation>iTALC-Schlüssel erzeugen/importieren</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Computer ausschalten</translation>
+        <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>Power down</source>
-        <translation type="unfinished">Ausschalten</translation>
+        <source>How does it work?</source>
+        <translation>Wie funktioniert'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">Um alle angezeigten Computer herunterzufahren (z.B. nach Stundenende) klicken Sie einfach auf diesen Knopf.</translation>
+        <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>Logon</source>
-        <translation type="unfinished">Anmelden</translation>
+        <source>Assistant mode</source>
+        <translation>Assistentmodus</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Ferngesteuerte Anmeldung</translation>
+        <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>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Nachdem Sie diesen Knopf angeklickt haben, können Sie einen Nutzernamen und ein Passwort eingeben, um alle angezeigten Computer mit dem entsprechenden Nutzer anzumelden.</translation>
+        <source>Create new access keys (master computer)</source>
+        <translation>Neue Schlüssel erzeugen (Master-Computer)</translation>
     </message>
     <message>
-        <source>Support</source>
-        <translation type="unfinished">Unterstützung</translation>
+        <source>assistantModeButtonGroup</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Direkte Unterstützung</translation>
+        <source>Import public key (client computer)</source>
+        <translation>Öffentlichen Schlüssel importieren (Client-Computer)</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">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>
+        <source>Select user role</source>
+        <translation>Nutzerrolle auswählen</translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Ausrichtung</translation>
+        <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>Adjust windows and their size</source>
-        <translation type="unfinished">Fenster und deren Größe ausrichten</translation>
+        <source>Teacher</source>
+        <translation>Lehrer</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">Wenn Sie diesen Knopf anklicken, wird die größt-mögliche Größe für die Fenster eingestellt. Weiterhin werden alle Fenster ausgerichtet.</translation>
+        <source>Administrator</source>
+        <translation>Administrator</translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Anordnung</translation>
+        <source>Support team member</source>
+        <translation>Supportmitarbeiter</translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Automatische Neuanordnung der Fenster und deren Größe</translation>
+        <source>Other</source>
+        <translation>Andere</translation>
     </message>
     <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Wenn Sie diesen Knopf anklicken werden alle sichtbaren Fenster neu angeordnet und ausgerichtet.</translation>
+        <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>No valid keys found</source>
-        <translation type="unfinished">Keine gültigen Schlüssel gefunden</translation>
+        <source>Directories</source>
+        <translation>Verzeichnisse</translation>
     </message>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Es wurden keine Authentifizierungsschlüssel gefunden oder Ihre alten waren fehlerhaft. Bitte erstellen Sie mit Hilfe von ICA ein neues Schlüsselpaar (siehe Dokumentation unter http://italc.sf.net/wiki/index.php?title=De:Installation)
-Andernfalls werden Sie nicht in der Lage sein, mit iTALC auf andere Computer zuzugreifen.</translation>
+        <source>Export public key part (master computer)</source>
+        <translation>Öffentlichen Schlüssel exportieren (Mastercomputer)</translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">iTALC-Dienst läuft nicht</translation>
+        <source>...</source>
+        <translation>...</translation>
     </message>
     <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Auf diese Computer scheint kein iTALC-Dienst zu laufen oder die Authentifizierungsschlüssel sind nicht richtig eingerichtet. Der Dienst wird benötigt, um iTALC auszuführen. Kontaktieren Sie Ihren Administrator, um das Problem zu lösen.</translation>
+        <source>Use custom destination directory for access keys</source>
+        <translation>Benutzerdefiniertes Zielverzeichnis für Zugriffsschlüssel verwenden</translation>
     </message>
     <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">iTALC Master Steuerung</translation>
+        <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>Remote control</source>
-        <translation type="unfinished">Fernsteuern</translation>
+        <source>Summary</source>
+        <translation>Zusammenfassung</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished">Beenden</translation>
+        <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>
-</context>
-<context>
-    <name>QApplication</name>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Der Dienst '%1' konnte nicht registriert werden.</translation>
+        <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>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>
+        <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>The service '%1' is already registered.</source>
-        <translation>Der Dienst '%1' ist bereits registriert.</translation>
+        <source>Key files (*.key.txt)</source>
+        <translation>Schlüsseldateien (*.key.txt)</translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Der Dienst '%1' konnte nicht registriert werden.</translation>
+        <source>Invalid public key</source>
+        <translation>Ungültiger öffentlicher Schlüssel</translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Der Dienst '%1' wurde erfolgreich registriert.</translation>
+        <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>The service '%1' could not be stopped.</source>
-        <translation>Der Dienst '%1' konnte nicht gestoppt werden.</translation>
+        <source>Select destination directory</source>
+        <translation>Zielverzeichnis auswählen</translation>
     </message>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Der Dienst '%1' wurde entfernt.</translation>
+        <source>Access key creation</source>
+        <translation>Erstellung des Zugriffschlüssels</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>
+        <source>Could not remove previously existing file %1.</source>
+        <translation>Konnte bereits existierende Datei %1 nicht löschen.</translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Der Dienst '%1' konnte nicht entfernt werden.</translation>
+        <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>The service '%1' could not be found.</source>
-        <translation>Der Dienst '%1' wurde nicht gefunden.</translation>
+        <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>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>
+        <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>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>
+        <source>Public key import</source>
+        <translation>Import des öffentlichen Schlüssels</translation>
     </message>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC Client %1 auf %2:%3</translation>
+        <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>QObject</name>
+    <name>LockWidget</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>BKA (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</translation>
+        <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>iTALC-snapshots</source>
-        <translation>iTALC-Schnappschuesse</translation>
+        <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>about</name>
+    <name>MainToolBar</name>
     <message>
-        <source>About iTALC</source>
-        <translation>Ãœber iTALC</translation>
+        <source>Actions</source>
+        <translation>Aktionen</translation>
     </message>
+</context>
+<context>
+    <name>MainWindow</name>
     <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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Ãœber iTALC</span></p></body></html></translation>
+        <source>General</source>
+        <translation>Allgemein</translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>Ãœber</translation>
+        <source>Quit</source>
+        <translation>Beenden</translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Autoren</translation>
+        <source>iTALC Management Console</source>
+        <translation>iTALC Management Console</translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Ãœbersetzung</translation>
+        <source>iTALC Server</source>
+        <translation>iTALC-Server</translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Lizenz</translation>
+        <source>Paths</source>
+        <translation>Pfade</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Authentication</source>
+        <translation>Authentifizierung</translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC Service</source>
+        <translation>iTALC-Dienst</translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Hide tray icon</source>
+        <translation>Icon im Systemabschnitt verstecken</translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Klassenraum-Verwaltung</translation>
+        <source>Autostart</source>
+        <translation>Autostart</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>
+        <source>Additional arguments</source>
+        <translation>Zusätzliche Argumente</translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>IP-Adresse</translation>
+        <source>Start service</source>
+        <translation>Dienst starten</translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Keine Konfigurationsdatei gefunden</translation>
+        <source>Stop service</source>
+        <translation>Dienst stoppen</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>
+        <source>State:</source>
+        <translation>Status:</translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Fehler in der Konfigurationsdatei</translation>
+        <source>Stopped</source>
+        <translation>Beendet</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>
+        <source>Logging</source>
+        <translation>Logaufzeichnung</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>
+        <source>Log file directory</source>
+        <translation>Logdateiverzeichnis</translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Zeigen/verstecken</translation>
+        <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>Edit settings</source>
-        <translation>Einstellungen bearbeiten</translation>
+        <source>Clear all log files</source>
+        <translation>Alle Logdateien leeren</translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Entfernen</translation>
+        <source>Desktop capturing</source>
+        <translation>Bildschirmaufzeichnung</translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Aktionen</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation>Halbdurchsichtige Fenster (layered windows) aufzeichnen</translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Zeige alle Computer im Klassenraum</translation>
+        <source>Poll full screen</source>
+        <translation>Vollen Bildschirm abfragen</translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Verstecke alle Computer im Klassenraum</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation>Niedrige Genauigkeit (Turbomodus)</translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Name bearbeiten</translation>
+        <source>Demo server</source>
+        <translation>Demoserver</translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Klassenraum entfernen</translation>
+        <source>Network</source>
+        <translation>Netzwerk</translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Aktionen für %1</translation>
+        <source>Core server port</source>
+        <translation>Core-Server-Port</translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Klassenraum hinzufügen</translation>
+        <source>Demo server port</source>
+        <translation>Demoserver-Port</translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Neuer Name für Klassenraum</translation>
+        <source>Enable firewall exception</source>
+        <translation>Firewall-Ausnahme aktivieren</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>
+        <source>Configuration files</source>
+        <translation>Konfigurationsdateien</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>
+        <source>Global configuration</source>
+        <translation>Globale Konfiguration</translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Fehlender Klassenraum</translation>
+        <source>Personal configuration</source>
+        <translation>Persönliche Konfiguration</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>
+        <source>Data directories</source>
+        <translation>Datenverzeichnisse</translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Neuer Klassenraum</translation>
+        <source>Snapshots</source>
+        <translation>Schnappschüsse</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>
+        <source>Authentication methods</source>
+        <translation>Authentifizierungsmethoden</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>
+        <source>Access key management</source>
+        <translation>Schlüsselverwaltung</translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Klassenräume/Computer</translation>
+        <source>Logon settings</source>
+        <translation>Anmeldeeinstellungen</translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Computer hinzufügen</translation>
+        <source>&File</source>
+        <translation>&Datei</translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Lehrercomputer ausblenden</translation>
+        <source>&Help</source>
+        <translation>&Hilfe</translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>In Text-Datei exportieren</translation>
+        <source>&Quit</source>
+        <translation>&Beenden</translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Ausgabe-Datei wählen</translation>
+        <source>Ctrl+Q</source>
+        <translation>Strg+Q</translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Textdateien (*.txt)</translation>
+        <source>&Save settings into file</source>
+        <translation>Einstellungen in Datei &speichern</translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Nutzernamen</translation>
+        <source>Save settings into file</source>
+        <translation>Einstellungen in Datei speichern</translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Nutzernamen anzeigen</translation>
+        <source>Ctrl+S</source>
+        <translation>Strg+S</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>
+        <source>L&oad settings from file</source>
+        <translation>Einstellungen aus Datei &laden</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>
+        <source>Ctrl+O</source>
+        <translation>Strg+O</translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
+        <source>About iTALC</source>
+        <translation>Ãœber iTALC</translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Unbekannter Zustand</translation>
+        <source>About Qt</source>
+        <translation>Ãœber Qt</translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Kein Benutzer angemeldet</translation>
+        <source>MainWindow</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Rechner nicht erreichbar</translation>
+        <source>toolBar</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Demo läuft</translation>
+        <source>iTALC Management Console %1</source>
+        <translation>iTALC Management Console %1</translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Arbeitsfläche gesperrt</translation>
+        <source>Running</source>
+        <translation>Läuft</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>
+        <source>Load settings from file</source>
+        <translation>Einstellungen aus Datei laden</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>
+        <source>XML files (*.xml)</source>
+        <translation>XML-Dateien (*.xml)</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Nutzer abmelden</translation>
+        <source>Save settings to file</source>
+        <translation>Einstellungen in Datei speichern</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>
+        <source>Unsaved settings</source>
+        <translation>Ungespeicherte Einstellungen</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>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation>Einige Einstellungen sind nicht gespeichert. Trotzdem beenden?</translation>
     </message>
     <message>
-        <source>Reboot computers</source>
-        <translation>Computer neustarten</translation>
+        <source>Configuration not writable</source>
+        <translation>Konfiguration nicht schreibbar</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>
+        <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>Are you sure want to power down all selected computers?</source>
-        <translation>Sind Sie sicher, dass Sie alle gewählten Computer ausschalten wollen?</translation>
+        <source>All settings were applied successfully.</source>
+        <translation>Alle Einstellungen wurden erfolgreich angewendet.</translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation>Ãœbersicht</translation>
+        <source>An error occured while applying settings!</source>
+        <translation>Beim Anwenden der Einstellungen ist ein Fehler aufgetreten!</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation>Vollbild-Demo</translation>
+        <source>iTALC</source>
+        <translation>iTALC</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation>Fenster-Demo</translation>
+        <source>No write access</source>
+        <translation>Kein Schreibzugriff</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation>Bildschirm gesperrt</translation>
+        <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>View live</source>
-        <translation>Live anschauen</translation>
+        <source>Classroom</source>
+        <translation>Klassenraum</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Fernsteuern</translation>
+        <source>Switch classroom</source>
+        <translation>Klassenraum wechseln</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation>Schüler Demo zeigen lassen</translation>
+        <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>Send text message</source>
-        <translation>Text-Nachricht schicken</translation>
+        <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>Logon user</source>
-        <translation>Nutzer anmelden</translation>
+        <source>Overview mode</source>
+        <translation>Ãœbersichtsmodus</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Nutzer abmelden</translation>
+        <source>Overview</source>
+        <translation>Ãœbersicht</translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation>Einen Schnappschuss machen</translation>
+        <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>Power on</source>
-        <translation>Anschalten</translation>
+        <source>Fullscreen demo</source>
+        <translation>Vollbild-Demo</translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation>Neustarten</translation>
+        <source>Fullscreen Demo</source>
+        <translation>Vollbild-Demo</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation>Ausschalten</translation>
+        <source>Stop Demo</source>
+        <translation>Demo beenden</translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation>Befehle ausführen</translation>
+        <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>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Rechner-Einstellungen</translation>
+        <source>Window demo</source>
+        <translation>Fenster-Demo</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Allgemein</translation>
+        <source>Window Demo</source>
+        <translation>Fenster-Demo</translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Name</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></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;">Hardware/MAC-Adresse des Rechners - wird nur zum Anschalten des Rechners benötigt</p></body></html></translation>
+        <source>Lock/unlock desktops</source>
+        <translation>Arbeitsflächen sperren/freigeben</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>IP/Rechnername</translation>
+        <source>Lock all</source>
+        <translation>Alle sperren</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 ':' for specifying an optional port-number)</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;">Geben Sie eine IP-Adresse oder den Rechnernamen an, unter dem iTALC den Client erreichen kann (benutzen Sie ':' um eine optionale Portnummer anzugeben)</p></body></html></translation>
+        <source>Unlock all</source>
+        <translation>Alle freigeben</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>MAC-Adresse</translation>
+        <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>Classroom</source>
-        <translation>Klassenraum</translation>
+        <source>Send text message</source>
+        <translation>Text-Nachricht schicken</translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <source>Text message</source>
+        <translation>Text-Nachricht</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Verbindung</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">connection to hosts on the same level</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;">Verbindung zu Rechnern auf der selben Ebene</p></body></html></translation>
+        <source>Power on computers</source>
+        <translation>Computer anschalten</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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Power on</source>
+        <translation>Anschalten</translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation>Analog</translation>
+        <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>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Power down computers</source>
+        <translation>Computer ausschalten</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <source>Power down</source>
+        <translation>Ausschalten</translation>
     </message>
     <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <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>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
+        <source>Support</source>
+        <translation>Unterstützung</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</translation>
+        <source>Direct support</source>
+        <translation>Direkte Unterstützung</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 if the host is the gateway for the subnet.</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;">Aktivieren, wenn der Rechner Gateway für das Subnetz ist.</p></body></html></translation>
+        <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>Host is &gateway for subnet</source>
-        <translation>Rechner ist &Gateway für Subnetz</translation>
+        <source>Adjust/align</source>
+        <translation>Ausrichtung</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;">Activate this option for at least one host in a subnet.</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;">Aktivieren Sie diese Option für mindestens einen Rechner in einem Subnetz.</p></body></html></translation>
+        <source>Adjust windows and their size</source>
+        <translation>Fenster und deren Größe ausrichten</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <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>Act as &demo replicator</source>
-        <translation>Als &Demo-Replikator agieren</translation>
+        <source>Auto view</source>
+        <translation>Anordnung</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation>Automatische Neuanordnung der Fenster und deren Größe</translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>&Abbrechen</translation>
+        <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><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:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Rechner-Einstellungen</span></p></body></html></translation>
+        <source>iTALC Master Control</source>
+        <translation>iTALC Master Steuerung</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Typ</translation>
+        <source>Remote control</source>
+        <translation>Fernsteuern</translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Schülerrechner</translation>
+        <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>Teacher computer</source>
-        <translation>Lehrercomputer</translation>
+        <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>Other/undefined computer</source>
-        <translation>Anderer/undefinierter Computer</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></source>
-        <translation type="unfinished"></translation>
+        <source>Debugging</source>
+        <translation>Fehlersuche</translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Fehlende IP-Adresse/Rechnername</translation>
+        <source>Enable desktop switching for screen lock (experimental)</source>
+        <translation>Desktopwechsel für Bildschirmsperre aktivieren (experimentell)</translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Sie haben keine IP-Adresse oder Rechnername für den Computer angegeben!</translation>
+        <source>Log to standard error output</source>
+        <translation>Nach Standardfehlerausgabe loggen</translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Ungültige MAC-Adresse</translation>
+        <source>Log to Windows event log</source>
+        <translation>In Windows-Ereignisanzeige loggen</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>
+        <source>Backend</source>
+        <translation>Backend</translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Cancel</source>
-        <translation>Abbrechen</translation>
+        <source>VNC reflector</source>
+        <translation>VNC-Reflektor</translation>
     </message>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Befehle auf Client(s) ausführen</translation>
+        <source>iTALC 1 demo server</source>
+        <translation>iTALC 1 Demoserver</translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Geben Sie die Befehle ein, die auf dem bzw. den Client(s)
-ausgeführt werden sollen:</translation>
+        <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>&Run!</source>
-        <translation>&Los!</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation>HTTP-Server aktivieren, um JavaViewer-Applet bereitzustellen</translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Aktualisierungsintervall</translation>
+        <source>HTTP server port</source>
+        <translation>HTTP-Serverport</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 network-traffic and lower CPU-usage on this computer.</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;">Hier können Sie den Aktualisierungsinterval für die Clients setzen. Höhere Werte resultieren in geringerer Netzlast und geringerer Prozessorbelastung auf diesem Computer.</p></body></html></translation>
+        <source>Allow connections from localhost only</source>
+        <translation>Nur Verbindungen vom lokalen Rechner erlauben</translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 Sekunde</translation>
+        <source>Key file authentication</source>
+        <translation>Schlüsseldatei-Authentifizierung</translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> Sekunden</translation>
+        <source>ACL-based logon authentication</source>
+        <translation>ACL-basierte Anmelde-Authentifizierung</translation>
     </message>
     <message>
-        <source>User interface</source>
-        <translation>Benutzeroberfläche</translation>
+        <source>Public key file base directory</source>
+        <translation>Basisverzeichnis der öffentlichen Schlüsseldatei</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>
+        <source>Private key file base directory</source>
+        <translation>Basisverzeichnis der privaten Schlüsseldatei</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 mouse-cursor over toolbar-buttons.</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Launch key file assistant</source>
+        <translation>Schlüsseldatei-Assistent starten</translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Keine Ballon-Tooltips</translation>
+        <source>Manage permissions</source>
+        <translation>Berechtigungen verwalten</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Bitte beachten Sie, dass einige Änderungen erst wirksam werden, wenn Sie iTALC neustarten.</span></p></body></html></translation>
+        <source>Test</source>
+        <translation>Testen</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Access confirmation</source>
+        <translation>Zugriffsbestätigung</translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Niedrig (15 bit)</translation>
+        <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>Medium (18 bit)</source>
-        <translation>Mittel (18 bit)</translation>
+        <source>Logon authentication</source>
+        <translation>Anmelde-Authentifizierung</translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Hoch (Truecolor)</translation>
+        <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>Your role (needs according keys!)</source>
-        <translation>Ihre Rolle (entspr. Schlüssel nötig!)</translation>
+        <source>Debugging iTALC</source>
+        <translation>iTALC-Fehlersuche</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;">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>
+        <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>Teacher</source>
-        <translation>Lehrer</translation>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation>Löschen Sie die Logdateien im Abschnitt "Allgemein".</translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Administrator</translation>
+        <source>2)</source>
+        <translation>2)</translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Support-Mitarbeiter</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation>Setzen Sie den Logleve  im Abschnitt "Allgemein" auf "Debugmeldungen und alles andere".</translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Andere</translation>
+        <source>3)</source>
+        <translation>3)</translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Demo-Modus-Qualität</translation>
+        <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>Settings for multi-logon</source>
-        <translation>Einstellungen für Mehrfach-Anmeldung</translation>
+        <source>4)</source>
+        <translation>4)</translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Domäne</translation>
+        <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>Double-click action for client-window</source>
-        <translation>Doppelklick-Aktion für Client-Fenster</translation>
+        <source>Generate bug report archive</source>
+        <translation>Fehlerberichtsarchiv erstellen</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>
+        <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>Remote control</source>
-        <translation>Fernsteuern</translation>
+        <source>Restart iTALC Service</source>
+        <translation>iTALC-Dienst neustarten</translation>
     </message>
     <message>
-        <source>View live in fullscreen</source>
-        <translation>Live im Vollbild anschauen</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>Starting iTALC service</source>
+        <translation>Starte iTALC-Dienst</translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Kein Text auf Buttons der Werkzeugleiste</translation>
+        <source>Stopping iTALC service</source>
+        <translation>Stoppe iTALC-Dienst</translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Ihre iTALC-Konfiguration</translation>
+        <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>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>
+        <source>Log files cleared</source>
+        <translation>Logdateien gelösch</translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Demo</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation>Alle Logdateien wurden erfolgreich gelöscht.</translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>Message from teacher</source>
-        <translation>Nachricht vom Lehrer</translation>
+        <source>Error</source>
+        <translation>Fehler</translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Jemand am Rechner %1 versucht auf Ihren Bildschirm zuzugreifen. Möchten Sie ihm/ihr Zugriff gewähren?</translation>
+        <source>Could not remove all log files.</source>
+        <translation>Konnte nicht alle Logdateien entfernen.</translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Nie für diese Sitzung</translation>
+        <source>Logon authentication test</source>
+        <translation>Test der Anmelde-Authentifizierung</translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Immer für diese Sitzung</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation>Die Authentifizierung mit den angegebenen Anmeldedaten war erfolgreich.</translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Zugriff bestätigen</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation>Die Authentifizierung mit den angegebenen Anmeldedaten ist fehlgeschlagen!</translation>
     </message>
     <message>
-        <source>ISD-server error</source>
-        <translation>ISD-Server-Fehler</translation>
+        <source>Save bug report archive</source>
+        <translation>Fehlerberichtsarchiv speichern</translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>Der ISD-Server konnte nicht gestartet werden, da Port %1 bereits verwendet wird. Bitte stellen Sie sicher, dass kein anderes Programm diesen Port benutzt und versuchen es erneut.</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation>iTALC-Fehlerberichtsarchiv (*.ibra.xml)</translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Authentifizierungsfehler</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation>iTALC-Fehlerberichtsarchiv gespeichert</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>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Schnappschuss</translation>
+        <source>Could not contact iTALC service</source>
+        <translation>Kein Kontakt zum iTALC-Dienst</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>
+        <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>unknown</source>
-        <translation type="unfinished"></translation>
+        <source>Authentication impossible</source>
+        <translation>Authentifizierung nicht möglich</translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>Bildschirmsperre</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation>Nachricht vom Lehrer</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <name>Overview</name>
     <message>
         <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
 p, li { white-space: pre-wrap; }
@@ -1011,6 +1422,10 @@ p, li { white-space: pre-wrap; }
         <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>
@@ -1022,13 +1437,9 @@ p, li { white-space: pre-wrap; }
         <source>About iTALC</source>
         <translation>Ãœber iTALC</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>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
         <translation>Ãœbersicht</translation>
@@ -1039,102 +1450,88 @@ p, li { white-space: pre-wrap; }
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
-        <translation>iTALC ist nun einsatzbereit!</translation>
+        <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>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation>iTALC ist jetzt komplett installiert und eingerichtet. Wenn Sie die Masterappilkation installiert haben, können Sie diese nun starten.</translation>
+        <source>Username</source>
+        <translation>Nutzername</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation>Schlüssel-Setup-Einstellungen speichern</translation>
+        <source>Password</source>
+        <translation>Passwort</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
-        <translation>Schlüsselverzeichnisse</translation>
+        <source>iTALC Logon</source>
+        <translation>iTALC-Anmeldung</translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Verzeichnis für öffentlichen Schlüssel</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Der Dienst '%1' konnte nicht registriert werden.</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation>Verzeichnis für privaten Schlüssel</translation>
+        <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>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation>Sie können ein Verzeichnis wählen, in welches der öffentliche Schlüssel exportiert werden soll, z.B. ein USB-Laufwerk oder eine Netzwerkfreigabe.</translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Der Dienst '%1' ist bereits registriert.</translation>
     </message>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Die neu erstellten oder importierten Schlüssel müssen irgendwo installiert werden. Es wird empfohlen, die vorgeschlagenen Verzeichnisse beizubehalten.</translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Der Dienst '%1' konnte nicht registriert werden.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Privaten Schlüssel ebenfalls exportieren</translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Der Dienst '%1' wurde erfolgreich registriert.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Wählen Sie den Ort des exportierten öffentlichen Schlüssels:</translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Der Dienst '%1' konnte nicht gestoppt werden.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Öffentlichen Schlüssel des Master-Computers importieren</translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Der Dienst '%1' wurde entfernt.</translation>
     </message>
     <message>
-        <source>Security options</source>
-        <translation>Sicherheitsoptionen</translation>
+        <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>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation>iTALC hat ein ausgeklügeltes Sicherheitskonzept, um unautorisierten Zugriff auf Computer zu verhindern, auf denen die iTALC-Client-Software installiert ist.
-
-Sie müssen daher entweder ein neues Schlüsselpaar erzeugen oder den öffentlichen Schlüssel einer iTALC-Installation auf dem Master-Computer importieren.</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Der Dienst '%1' konnte nicht entfernt werden.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation>Neues Schlüsselpaar erzeugen (nur auf dem Master-Computer)</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Der Dienst '%1' wurde nicht gefunden.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Alle Schlüssel beibehalten (nur bei Update einer existierenden Installation!)</translation>
+        <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>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation>Willkommen zu iTALC</translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation>Dieses Programm wird Sie bei der Einrichtung der Authentifizierungsschlüssel für Ihre iTALC-Umgebung unterstützen.
-
-Klicken Sie auf "Weiter", um fortzufahren.</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>iTALC Client %1 auf %2:%3</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidget</name>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Live beobachten (%1 am Rechner %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation>Live anschauen (%1 @ %2)</translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Fernsteuerung (%1 am Rechner %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation>Fernsteuerung (%1 @ %2)</translation>
     </message>
     <message>
         <source>unknown user</source>
@@ -1142,64 +1539,57 @@ Klicken Sie auf "Weiter", um fortzufahren.</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
-        <source>Lock student</source>
-        <translation>Schüler sperren</translation>
+        <source>View only</source>
+        <translation>Nur beobachten</translation>
     </message>
     <message>
-        <source>Fullscreen</source>
-        <translation>Vollbild</translation>
+        <source>Remote control</source>
+        <translation>Fernsteuern</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation>Beenden</translation>
+        <source>Lock student</source>
+        <translation>Schüler sperren</translation>
     </message>
     <message>
-        <source>Connecting %1</source>
-        <translation>Verbindung wird hergestellt %1</translation>
+        <source>Unlock student</source>
+        <translation>Schüler freigeben</translation>
     </message>
     <message>
-        <source>Connected.</source>
-        <translation>Verbindung hergestellt.</translation>
+        <source>Snapshot</source>
+        <translation>Schnappschuss</translation>
     </message>
     <message>
-        <source>View only</source>
-        <translation>Nur beobachten</translation>
+        <source>Fullscreen</source>
+        <translation>Vollbild</translation>
     </message>
     <message>
-        <source>Snapshot</source>
-        <translation>Schnappschuss</translation>
+        <source>Window</source>
+        <translation>Fenster</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Fernsteuern</translation>
+        <source>Quit</source>
+        <translation>Beenden</translation>
     </message>
     <message>
-        <source>Unlock student</source>
-        <translation>Schüler freigeben</translation>
+        <source>Connecting %1</source>
+        <translation>Verbindung wird hergestellt %1</translation>
     </message>
     <message>
-        <source>Window</source>
-        <translation>Fenster</translation>
+        <source>Connected.</source>
+        <translation>Verbindung hergestellt.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
+    <name>RemoteLogonDialog</name>
     <message>
-        <source>Remote Logon</source>
+        <source>Remote logon</source>
         <translation>Ferngesteuerte Anmeldung</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Ferngesteuerte Anmeldung</span></p></body></html></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>Nutzen Sie die Eingabefelder unterhalb, um den Nutzername, das zugehörige Passwort sowie den optionalen Domäne-Name einzugeben. Diese Informationen werden für die Anmeldung der Computer genutzt.</translation>
+        <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>
@@ -1213,86 +1603,35 @@ p, li { white-space: pre-wrap; }
         <source>Domain</source>
         <translation>Domäne</translation>
     </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Strg+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Abbrechen</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
-    </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Setup abbrechen</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation>Sind Sie sicher, dass sie das Setup-Programm beenden wollen? iTALC ist noch nicht komplett eingerichtet!</translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Weiter</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Abschließen</translation>
-    </message>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Überschreiben bestätigen</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Möchten Sie die Datei %1 überschreiben?</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Beenden</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
-        <translation>Datei existiert nicht</translation>
+        <source>Run commands</source>
+        <translation>Befehle ausführen</translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
-        <translation>Die Datei %1 konnte nicht gefunden werden. Bitte überprüfen Sie dies und versuchen es erneut.</translation>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Verzeichnis für öffentlichen Schlüssel wählen</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Verzeichnis für privaten Schlüssel wählen</translation>
+        <source>unknown</source>
+        <translation>unbekannt</translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Verzeichnis zum Exportieren des öffentlichen Schlüssels wählen</translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation>Datei für Schlüsselimport wählen</translation>
+        <source>Snapshot</source>
+        <translation>Schnappschuss</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
         <translation>Schnappschüsse</translation>
@@ -1303,7 +1642,7 @@ p, li { white-space: pre-wrap; }
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <name>Snapshots</name>
     <message>
         <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
 p, li { white-space: pre-wrap; }
@@ -1328,96 +1667,100 @@ p, li { white-space: pre-wrap; }
         <translation>Zeit:</translation>
     </message>
     <message>
-        <source>Show snapshot</source>
-        <translation>Schnappschuss zeigen</translation>
-    </message>
-    <message>
-        <source>Delete snapshot</source>
-        <translation>Schnappschuss löschen</translation>
+        <source>Show</source>
+        <translation>Anzeigen</translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Liste neuladen</translation>
+        <source>Delete</source>
+        <translation>Löschen</translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <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 at which the person is sitting, you want to support.</source>
-        <translation>Bitte geben Sie die IP-Adresse oder den Namen des Rechners ein, an dem die Person sitzt, die Sie unterstützen möchten.</translation>
+        <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>OK</source>
-        <translation>OK</translation>
+        <source>Send text message</source>
+        <translation>Text-Nachricht schicken</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Abbrechen</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Unterstützung </span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation>Verbindung zu %1 wird hergestellt ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Text-Nachricht schicken</translation>
+        <source>Overview</source>
+        <translation>Ãœbersicht</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Text-Nachricht schicken</span></p></body></html></translation>
+        <source>Fullscreen demo</source>
+        <translation>Vollbild-Demo</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>
+        <source>Window demo</source>
+        <translation>Fenster-Demo</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Locked display</source>
+        <translation>Bildschirm gesperrt</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Strg+Enter</translation>
+        <source>View live</source>
+        <translation>Live anschauen</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Abbrechen</translation>
+        <source>Remote control</source>
+        <translation>Fernsteuern</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation>Schüler Demo zeigen lassen</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Verbindung zu %1 wird hergestellt ...</translation>
+        <source>Send text message</source>
+        <translation>Text-Nachricht schicken</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation>iTALC-Einrichtungstool</translation>
+        <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>Cancel</source>
-        <translation>Abbrechen</translation>
+        <source>Reboot</source>
+        <translation>Neustarten</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Zurück</translation>
+        <source>Power down</source>
+        <translation>Ausschalten</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Weiter</translation>
+        <source>Execute commands</source>
+        <translation>Befehle ausführen</translation>
     </message>
 </context>
 </TS>
diff --git a/lib/resources/el.qm b/lib/resources/el.qm
index 9d136f2..d91f076 100644
Binary files a/lib/resources/el.qm and b/lib/resources/el.qm differ
diff --git a/lib/resources/el.ts b/lib/resources/el.ts
index f24020f..9f628e8 100644
--- a/lib/resources/el.ts
+++ b/lib/resources/el.ts
@@ -2,1429 +2,1764 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="el_GR">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
+    <message>
+        <source>About iTALC</source>
+        <translation type="unfinished">Σχετικά με την εφαρμογή iTALC</translation>
+    </message>
+    <message>
+        <source>About</source>
+        <translation type="unfinished">Σχετικά</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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-2011 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>MainWindow</name>
+    <name>Client</name>
     <message>
-        <source>MainWindow</source>
+        <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>toolBar</source>
+        <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 ':' for specifying an optional port-number)</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;">εισάγετε μια διεύθυνση IP ή ένα όνομα υπολογιστή με το οποίο θα αναζητηθεί ο μαθητής (πληκτρολογήστε ':' για να ορίσετε πιθανό αριθμό πόρτας)</p></body></html></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></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;">Προαιρετικό ψευδώνυμο του υπολογιστή που εμφανίζεται στο iTALC.</p></body></html></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></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;">Υλικό/MAC-διεύθυνση ενός μαθητή - χρησιμοποιείτε μόνο για εκκίνηση υπολογιστή μαθητή</p></body></html></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 network-traffic and lower CPU-usage on this computer.</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> 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 mouse-cursor over 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>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></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">(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;">Ορίστε την ενέργεια που θα εκτελείται όταν κάνετε διπλό κλικ σε παράθυρο μαθητή.</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Προσοχή: ορισμένες αλλαγές δεν θα ισχύσουν μέχρι να επανεκκινήσετε την εφαρμογή iTALC.</span></p></body></html></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">Εδώ μπορείτε να παραμετροποίησετε την εφαρμογή 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</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>iTALC Demo</source>
+        <translation type="unfinished">iTALC Επίδειξη</translation>
     </message>
+</context>
+<context>
+    <name>ItalcCoreServer</name>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Απαγόρευση εγγραφής</translation>
+        <source>Authentication error</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>
+        <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>Classroom</source>
-        <translation type="unfinished">Τάξη</translation>
+        <source>VNC authentication failed because of too many authentication tries.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Αλλαγη τάξης</translation>
+        <source>VNC authentication failed.</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>
+        <source>VNC server closed connection.</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>KeyFileAssistant</name>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Πατήστε το κουμπί για να μεταβείτε σε άλλες τάξεις.</translation>
+        <source>iTALC Access Key Assistant</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Κατάσταση επισκόπησης</translation>
+        <source>Create/import iTALC access keys</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Εισαγωγή</translation>
+        <source>This assistant will help you to create or import iTALC access keys.</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>
+        <source>How does it work?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Κατάσταση επίδειξης πλήρους οθόνης</translation>
+        <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>Fullscreen Demo</source>
-        <translation type="unfinished">Επίδειξη Πλήρους Οθόνης</translation>
+        <source>Assistant mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Τερματισμός Επίδειξης</translation>
+        <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>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>
+        <source>Create new access keys (master computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Κατάσταση επίδειξης σε παράθυρο</translation>
+        <source>assistantModeButtonGroup</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Επίδειξη Παραθύρου</translation>
+        <source>Import public key (client computer)</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>
+        <source>Select user role</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Κλείδωμα/Ξεκλείδωμα επιφάνειας εργασίας</translation>
+        <source>Please select a user role for which to create or import the access keys:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Κλείδωμα όλων</translation>
+        <source>Teacher</source>
+        <translation type="unfinished">Δάσκαλος</translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Ξεκλείδωμα όλων</translation>
+        <source>Administrator</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>
+        <source>Support team member</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Αποστολή μηνύματος κειμένου</translation>
+        <source>Other</source>
+        <translation type="unfinished">Άλλος</translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished">Μήνυμα κειμένου</translation>
+        <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>Use this button to send a text message to all users e.g. to tell them new tasks etc.</source>
-        <translation type="unfinished">Χρησιμοποιήστε αυτό το κουμπί για να στείλετε ένα μήνυμα κειμένου σε όλους τους χρήστες, π.χ. για να τους ανακοινώσετε μια νέα εργασία κλπ.</translation>
+        <source>Directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Εκκίνηση υπολογιστών</translation>
+        <source>Export public key part (master computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Εκκίνηση</translation>
+        <source>...</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>
+        <source>Use custom destination directory for access keys</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Τερματισμός υπολογιστών</translation>
+        <source>Please specify the location of the public access key to be imported.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Τερματισμός</translation>
+        <source>Summary</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>
+        <source>The following actions will be taken:</source>
+        <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Logon</source>
-        <translation type="unfinished">Σύνδεση</translation>
+    <message utf8="true">
+        <source>• Create new access keys</source>
+        <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
+    <message utf8="true">
+        <source>• Import public access key from</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Πατώντας αυτό το κουμπί και εισάγετε όνομα και κωδικό χρήστη για να συνδεθείτε σε όλους τους ορατούς υπολογιστές.</translation>
+        <source><unknown></source>
+        <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Support</source>
-        <translation type="unfinished">Βοήθεια</translation>
+    <message utf8="true">
+        <source>• Write access key(s) to</source>
+        <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Άμεση βοήθεια</translation>
+    <message utf8="true">
+        <source>• Export public key to</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 utf8="true">
+        <source>• Configure for user role</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Προσαρμογή/Ευθυγράμμιση</translation>
+        <source>Select directory in which to export the public key</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Προσαρμογή παραθύρων και του μεγέθους τους</translation>
+        <source>Key files (*.key.txt)</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>
+        <source>Invalid public key</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Αυτόματη προβολή</translation>
+        <source>The selected file does not contain a valid public iTALC access key!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Αυτόματη αναπροσαρμογή παραθύρων και του μεγέθους τους</translation>
+        <source>Select destination directory</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>
+        <source>Access key creation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Δε βρέθηκαν έγκυρα κλειδιά</translation>
+        <source>Could not remove previously existing file %1.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Δε βρέθηκαν κλειδιά ταυτοποίησης ή τα προηγούμενα έχουν χαλάσει. Παρακαλώ δημιουργήστε ένα νέο ζευγάρι κλειδιών χρησιμοποιώντας την ICA εφαρμογή iTALC μαθητή  (δείτε την τεκμηρίωση στο http://italc.sf.net/wiki/index.php?title=Installation).
-Διαφορετικά δε θα μπορείτε να προσπελάσετε υπολογιστές με την εφαρμογή iTALC.</translation>
+        <source>Failed exporting public access key from %1 to %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">Η υπηρεσία iTALC δεν εκτελείται</translation>
+        <source>Access keys were created and written successfully to %1 and %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Φαίνεται ότι καμμία υπηρεσία iTALC δεν εκτελίται σε αυτόν τον υπολογιστή ή ότι τα κλειδιά ταυτοποίησης δεν έχουν οριστεί σωστά. Η υπηρεσία είναι απαραίτητη για να εκτελεστεί η εφαρμογή iTALC. Επικοινωνήστε με το διαχειριστή για να επιλυθεί το πρόβλημα.</translation>
+        <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>iTALC Master Control</source>
-        <translation type="unfinished">iTALC Πίνακας Ελέγχου</translation>
+        <source>Public key import</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
+        <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>Quit</source>
+        <source>The public key was successfully imported to %1.</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>QApplication</name>
+    <name>LockWidget</name>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Αδυναμία καταχώρισης της υπηρεσίας '%1'.</translation>
+        <source>screen lock</source>
+        <translation type="unfinished">Κλείδωμα οθόνης</translation>
     </message>
+</context>
+<context>
+    <name>LogonGroupEditor</name>
     <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>
+        <source>Logon group editor</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Η υπηρεσία '%1' έχει ήδη καταχωρηθεί.</translation>
+        <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>The service '%1' could not be registered.</source>
-        <translation>Η υπηρεσία '%1' δε μπορεί να καταχωρηθεί.</translation>
+        <source>All groups</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Η υπηρεσία '%1' καταχωρήθηκε επιτυχώς.</translation>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Η υπηρεσία '%1' δε μπορεί να τερματιστεί.</translation>
+        <source>Groups with iTALC privileges</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>MainToolBar</name>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Η υπηρεσία '%1' έχει αποκαταχωρηθεί.</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Ενέργειες</translation>
     </message>
+</context>
+<context>
+    <name>MainWindow</name>
     <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Η υπηρεσία '%1' δεν είναι καταχωρημένη και για αυτό δε μπορεί να αποκαταχωρηθεί.</translation>
+        <source>General</source>
+        <translation type="unfinished">Γενικά</translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Η υπηρεσία '%1' δε μπορεί να αποκαταχωρηθεί.</translation>
+        <source>Quit</source>
+        <translation type="unfinished">Τερματισμός</translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Η υπηρεσία '%1' δε βρέθηκε.</translation>
+        <source>iTALC Management Console</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>Η Διαχείριση Υπηρεσιών (Service Control Manager) δεν ανταποκρίνεται (έχετε τα απαραίτητα δικαιώματα;!) - Η υπηρεσία '%1' δεν αποκαταχωρήθηκε.</translation>
+        <source>iTALC Server</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>Η Διαχείριση Υπηρεσιών (Service Control Manager) δεν ανταποκρίνεται (έχετε τα απαραίτητα δικαιώματα;!) - Η υπηρεσία '%1' δεν τερματίστηκε.</translation>
+        <source>Paths</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC Μαθητής %1:%2:%3</translation>
+        <source>Authentication</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</translation>
+        <source>iTALC Service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>iTALC-στιγμιότυπα</translation>
+        <source>Hide tray icon</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation>Σχετικά με την εφαρμογή iTALC</translation>
+        <source>Autostart</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Σχετικά με την εφαρμογή  iTALC</span></p></body></html></translation>
+        <source>Additional arguments</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>Σχετικά</translation>
+        <source>Start service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Συγγραφείς</translation>
+        <source>Stop service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Μετάφραση</translation>
+        <source>State:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Άδεια</translation>
+        <source>Stopped</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Logging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
+        <source>Log file directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
+        <source>...</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Διαχείριση Τάξης</translation>
+        <source>Log level</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Χρησιμοποιήστε αυτό το χώρο για να διαχειριστείτε εύκολα τους υπολογιστές και τις τάξεις.</translation>
+        <source>Nothing</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>Εδώ διαχειριζόσαστε υπολογιστές και τάξεις. Μπορείτε να προσθέσετε υπολογιστές και τάξεις με δεξί κλικ στη λίστα.</translation>
+        <source>Only critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Τάξεις/υπολογιστές</translation>
+        <source>Errors and critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>Διεύθυνση IP</translation>
+        <source>Warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Δε βρέθηκε αρχείο εγκατάστασης</translation>
+        <source>Information, warnings and errors</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>Αδύνατο το άνοιγμα αρχείου εγκατάστασης %1.
-Πρέπει να προσθέσετε τουλάχιστον μία τάξη και υπολογιστές με τη Διαχείριση Τάξης που θα βρείτε στην αριστερή μπάρα του προγράμματος.</translation>
+        <source>Debug messages and everything else</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Σφάλμα στο αρχείο εγκατάστασης</translation>
+        <source>Limit log file size</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>Σφάλμα κατά την επεξεργασία του αρχείου εγκατάστασης %1.
-Παρακαλώ διορθώστε το. Διαφορετικά, θα πρέπει να διαγράψετε το αρχείο και να προσθέσετε όλες τις τάξεις και υπολογιστές πάλι.</translation>
+        <source>MB</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>Σφάλμα κατά την επεξεργασία του αρχείου εγκατάστασης %1.
-Παρακαλώ διορθώστε το. Διαφορετικά, θα πρέπει να διαγράψετε το αρχείο.</translation>
+        <source>Clear all log files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Εμφάνιση/Απόκρυψη</translation>
+        <source>Desktop capturing</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Επεξεργασία ρυθμίσεων</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Διαγραφή</translation>
+        <source>Poll full screen</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Ενέργειες</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Εμφάνιση όλων των υπολογιστών της τάξης</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Απόκρυψη όλων των υπολογιστών της τάξης</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Επεξεργασία ονόματος</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Διαγραφή τάξης</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Ενέργειες για %1</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Πρόσθεση υπολογιστή</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Πρόσθεση τάξης</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Νέο όνομα για τάξη</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Παρακαλώ εισάγετε νέο όνομα για την τάξη "%1".</translation>
+        <source>Snapshots</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>Είστε σίγουρος/η ότι θέλετε να διαγράψετε την τάξη "%1";
-Προσοχή! Όλοι οι υπολογιστές της τάξης θα διαγραφούν!</translation>
+        <source>Authentication methods</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Κενή τάξη</translation>
+        <source>Access key management</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>Πριν την πρόσθεση υπολογιστών πρέπει να δημιουργήσετε τουλάχιστον μία τάξη.
-Θέλετε να δημιουργήσετε μία νέα τάξη τώρα;</translation>
+        <source>Logon settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Νέα τάξη</translation>
+        <source>&File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Παρακαλώ εισάγετε το όνομα της τάξης που θέλετε να δημιουργήσετε.</translation>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Απόκρυψη υπολογιστών Δάσκαλου</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Ονόματα χρηστών</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Εμφάνιση ονομάτων χρηστών</translation>
+        <source>&Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Χρησιμοποιήστε το context-menu (δεξί κλικ ποντικιού) για να προσθέσετε/διαγράψετε υπολογιστές και/ή τάξεις.</translation>
+        <source>Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Εξαγωγή αρχείου κειμένου</translation>
+        <source>Ctrl+S</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>Πατήστε αυτό το κουμπί για εξαγωγή λίστας υπολογιστών και ονομάτων χρηστών σε ένα αρχείο κειμένου. Μπορείτε να χρησιμοποιήσετε αυτό το αρχείο αργότερα για να συλλέξετε αρχεία μετά τη λήξη μιας εξέτασης. Αυτό είναι αναγκαίο ορισμένες φορές, επειδή κάποιοι χρήστες μπορεί να έχουν τελειώσει και αποσυνδεθεί νωρίτερα και έτσι δε μπορείτε να συλλέξετε τα αρχεία τους στο τέλος της εξέτασης.</translation>
+        <source>L&oad settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Επιλέξτε αρχείο εξόδου</translation>
+        <source>Ctrl+O</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Αρχεία κειμένου (*.txt)</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">Σχετικά με την εφαρμογή iTALC</translation>
     </message>
     <message>
-        <source>Actions for selected</source>
+        <source>About Qt</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Άγνωστη κατάσταση</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Κανείς χρήστης συνδεδεμένος</translation>
+        <source>toolBar</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Υπολογιστής εκτός σύνδεσης</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Επίδειξη σε εκτέλεση</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Επιφάνεια εργασίας κλειδωμένη</translation>
+        <source>Load settings from file</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>
+        <source>XML files (*.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
+        <source>Save settings to file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Αποσύνδεση χρήστη</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Είστε σίγουρος/η ότι θέλετε να επανεκκινήσετε όλους τους ορατούς υπολογιστές;</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
+        <source>Configuration not writable</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Επανεκκίνηση υπολογιστών</translation>
+        <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>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Είστε σίγουρος/η ότι θέλετε να τερματίσουν όλοι οι ορατοί υπολογιστές;</translation>
+        <source>All settings were applied successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
+        <source>An error occured while applying settings!</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Εισαγωγή</translation>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Κατάσταση επίδειξης πλήρους οθόνης</translation>
+        <source>No write access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Κατάσταση επίδειξης σε παράθυρο</translation>
+        <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>Locked display</source>
-        <translation type="unfinished">Κλειδωμένη οθόνη</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Τάξη</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation type="unfinished">Ζωντανή παρακολούθηση</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Αλλαγη τάξης</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
+        <source>Click this button to open a menu where you can choose the active classroom.</source>
+        <translation type="unfinished">Πατήστε αυτό το κουμπί για να επιλέξετε την ενεργή τάξη.</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Επίδειξη οθόνης μαθητή</translation>
+        <source>Click on this button, to switch between classrooms.</source>
+        <translation type="unfinished">Πατήστε το κουμπί για να μεταβείτε σε άλλες τάξεις.</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Αποστολή μηνύματος κειμένου</translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Κατάσταση επισκόπησης</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation type="unfinished">Σύνδεση χρήστη</translation>
+        <source>Overview</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Αποσύνδεση χρήστη</translation>
+        <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>Take a snapshot</source>
-        <translation type="unfinished">Βγάλε ένα στιγμιότυπο</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Εκκίνηση</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished">Επίδειξη Πλήρους Οθόνης</translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Επανεκκίνηση</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished">Τερματισμός Επίδειξης</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Τερματισμός</translation>
+        <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>Execute commands</source>
-        <translation type="unfinished">Εκτέλεση εντολών</translation>
+        <source>Window demo</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Ρυθμίσεις Μαθητή</translation>
+        <source>Window Demo</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Ρυθμίσεις Μαθητή</span></p></body></html></translation>
+        <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>General</source>
-        <translation>Γενικά</translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">Κλείδωμα/Ξεκλείδωμα επιφάνειας εργασίας</translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Όνομα</translation>
+        <source>Lock all</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></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;">Υλικό/MAC-διεύθυνση ενός μαθητή - χρησιμοποιείτε μόνο για εκκίνηση υπολογιστή μαθητή</p></body></html></translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">Ξεκλείδωμα όλων</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>Διεύθυνση IP/Όνομα υπολογιστή</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specifying an optional port-number)</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;">εισάγετε μια διεύθυνση IP ή ένα όνομα υπολογιστή με το οποίο θα αναζητηθεί ο μαθητής (πληκτρολογήστε ':' για να ορίσετε πιθανό αριθμό πόρτας)</p></body></html></translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Αποστολή μηνύματος κειμένου</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>MAC-Διεύθυνση</translation>
+        <source>Text message</source>
+        <translation type="unfinished">Μήνυμα κειμένου</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation>Τάξη</translation>
+        <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>VPN</source>
-        <translation>VPN</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">Εκκίνηση υπολογιστών</translation>
+    </message>
+    <message>
+        <source>Power on</source>
+        <translation type="unfinished">Εκκίνηση</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Σύνδεση</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">connection to hosts on the same level</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>
+        <source>Power down computers</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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Εδώ μπορείτε να ορίσετε πως θα συνδέεται ο υπολογιστής αυτός στο δίκτυο iTALC, για παράδειγμα υπολογιστές στο ίδιο επίπεδο. Κανονικά οι μαθητές συνδέονται μέσω τοπικού δικτύου 100 Mbit/s, αλλά μπορεί να υπάρχουν ειδικοί υπολογιστές όπως πύλες προς άλλα iTALC δίκτυα σε άλλα σχολεία. Σε τέτοιες περιπτώσεις το iTALC δίκτυο προσπαθεί να βελτιστοποιήσει τη χρήση του διαθέσιμου εύρους.</p></body></html></translation>
+        <source>Power down</source>
+        <translation type="unfinished">Τερματισμός</translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation>Αναλογική</translation>
+        <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>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Support</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <source>Direct support</source>
+        <translation type="unfinished">Άμεση βοήθεια</translation>
     </message>
     <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <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>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
+        <source>Adjust/align</source>
+        <translation type="unfinished">Προσαρμογή/Ευθυγράμμιση</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</translation>
+        <source>Adjust windows and their size</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 if the host is the gateway for the subnet.</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>
+        <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>Host is &gateway for subnet</source>
-        <translation>Ο υπολογιστής είναι &πύλη για το δίκτυο</translation>
+        <source>Auto view</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;">Activate this option for at least one host in a subnet.</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>
+        <source>Auto re-arrange windows and their size</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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;">Όταν κάνετε επίδειξη σε περισσότερους από έναν υπολογιστές σε ένα εξωτερικό δίκτυο, είναι λογικό να ενεργοποιήσετε αυτή την επιλογή για ένα τουλάχιστον από τους εμπλεκόμενους υπολογιστές. Με αυτόν τον τρόπο όλα τα δεδομένα στέλνονται μία φορά στον demo-replicator ο οποίος τα διανέμει στους υπόλοιπους μαθητές του δικτύου. Ειδικά σε αργές συνδέσεις αυτή η επιλογή είναι απαραίτητη. Κανονικά μπορείτε να ενεργοποιήσετε αυτήν την επιλογή στο δίκτυο-πύλη (δείτε την επιλογή παραπάνω).</p></body></html></translation>
+        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
+        <translation type="unfinished">Πατώντας αυτό το κουμπί όλα τα παράθυρα των μαθητών αναπροσαρμόζονται στο προεπιλεγμένο μέγεθος και ευθυγραμμίζονται.</translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Λειτουργία ως &demo replicator</translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished">iTALC Πίνακας Ελέγχου</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>&Ακυρο</translation>
+        <source>Could not modify the autostart property for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Τύπος</translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Υπολογιστής Μαθητή</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher computer</source>
-        <translation>Υπολογιστής Δάσκαλου</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Άλλος/απροσδιόριστος υπολογιστής</translation>
+        <source>Enable desktop switching for screen lock (experimental)</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></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;">Προαιρετικό ψευδώνυμο του υπολογιστή που εμφανίζεται στο iTALC.</p></body></html></translation>
+        <source>Log to standard error output</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Κενή διεύθυνση IP/όνομα υπολογιστή</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Δεν ορίσατε μία Διεύθυνση IP ή ένα όνομα για αυτόν τον υπολογιστή!</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Άκυρη MAC-Διεύθυνση</translation>
+        <source>VNC reflector</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>Ορίσατε μια άκυρη MAC-Διεύθυνση. Αφήστε το πεδίο κενό ή εισάγετε μια έγκυρη MAC-Διεύθυνση (χρησιμοποιήστε ":" για διαχωρισμό!)</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Εκτέλεση εντολών σε μαθητή(ες)</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Εισάγετε εντολές που θα εκτελεστούν σε μαθητή(ες):</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Άκυρο</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Eκτέλεση!</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Διάστημα μεταξύ ενημερώσεων</translation>
+        <source>Key file authentication</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 network-traffic and lower CPU-usage on this computer.</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>
+        <source>ACL-based logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 δευτερόλεπτο</translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation>δευτερόλεπτα</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Ποιότητα της κατάστασης επίδειξης</translation>
+        <source>Launch key file assistant</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">Ορίστε την επιθυμητή ποιότητα οθόνης στην κατάσταση επίδειξης. Χαμηλότερη ποιότητα σημαίνει μικρότερη χρήση του επεξεργαστή και μικρότερη κίνηση δικτύου ενώ υψηλότερη ποιότητα είναι πιθανόν να επιβραδύνει τον υπολογιστή και να μειώσει το framerate της επίδειξης. Πειραματιστείτε για να πετύχετε τις βέλτιστες ρυθμίσεις.</p></body></html></translation>
+        <source>Manage permissions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Χαμηλή (15 bit)</translation>
+        <source>Test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Μέτρια (18 bit)</translation>
+        <source>Access confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Υψηλή (Φυσικό χρώμα)</translation>
+        <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>User interface</source>
-        <translation>Διεπαφή χρήστη</translation>
+        <source>Logon authentication</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>Allow same user to access desktop without confirmation</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 mouse-cursor over 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>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Απόκρυψη επεξηγήσεων</translation>
+        <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>Your role (needs according keys!)</source>
-        <translation>Ο ρόλος σας (απαιτεί σχετικά κλειδιά!)</translation>
+        <source>1)</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><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>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Δάσκαλος</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Διαχειριστής</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Βοηθός</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Άλλος</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Ρυθμίσεις για πολλαπλή σύνδεση</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Τομέας</translation>
+        <source>Click the following button and save the file to a known location.</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Προσοχή: ορισμένες αλλαγές δεν θα ισχύσουν μέχρι να επανεκκινήσετε την εφαρμογή iTALC.</span></p></body></html></translation>
+        <source>Generate bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Ενέργεια διπλού κλικ σε παράθυρο μαθητή</translation>
+        <source>5)</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><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;">Ορίστε την ενέργεια που θα εκτελείται όταν κάνετε διπλό κλικ σε παράθυρο μαθητή.</p></body></html></translation>
+        <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>Remote control</source>
-        <translation>Απομακρυσμένος έλεγχος</translation>
+        <source>Restart iTALC Service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>View live in fullscreen</source>
-        <translation>Ζωντανή παρακολούθηση σε πλήρη οθόνη</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>Starting iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Απόκρυψη κειμένου στα κουμπιά γραμμών εργαλείων</translation>
+        <source>Stopping iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Οι Ρυθμίσεις σας</translation>
+        <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>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>Εδώ μπορείτε να παραμετροποίησετε την εφαρμογή iTALC ώστε να ικανοποιεί τις ανάγκες σας.</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Επίδειξη</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>Confirm access</source>
-        <translation>Επιβεβαίωση πρόσβασης</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Ο υπολογιστής %1 προσπαθεί να εισέλθει στην οθόνη σου. Να επιτραπεί η πρόσβαση;</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Πότε για αυτή τη συνεδρία (session)</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Πάντα για αυτή τη συνεδρία (session)</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>Μήνυμα από τον Δάσκαλο</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>ISD-server error</source>
-        <translation>ISD-Server: σφάλμα</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>Ο ISD-Server δε μπορεί να εκκινήσει επειδή η πόρτα %1 χρησιμοποιείται ήδη. Παρακαλώ βεβαιωθείτε ότι καμμιά άλλη εφαρμογή δε χρησιμοποιεί την πόρτα και προσπαθήστε πάλι.</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Σφάλμα ταυτοποίησης</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Κάποιος/α (IP: %1) προσπάθησε να εισέλθει στον υπολογιστή αλλά δεν ταυτοποιήθηκε επιτυχώς!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Στιγμιότυπο</translation>
+        <source>Could not contact iTALC service</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>Αδύνατη η δημιουργία στιγμιοτύπου. Ο φάκελος %1 δεν υπάρχει και δε μπορεί να δημιουργηθεί.</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>Κλείδωμα οθόνης</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Μήνυμα από τον Δάσκαλο</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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">
+        <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>Εδώ φαίνεται η γραμμή εργασίας με αρκετά κουμπιά. Κάθε κουμπί συνδέεται με μια περιοχή εργασίας. Δείτε τις διαθέσιμες περιοχές πατώντας τα αντίστοιχα κουμπιά.</translation>
+        <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>Η περιοχή στιγμιοτύπων είναι ένα πολύ χρήσιμο εργαλείο για τη διαχείριση των φωτογραφιών που δημιουργήσατε.</translation>
+        <translation type="unfinished">Η περιοχή στιγμιοτύπων είναι ένα πολύ χρήσιμο εργαλείο για τη διαχείριση των φωτογραφιών που δημιουργήσατε.</translation>
     </message>
     <message>
         <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>Φυσικά μπορείτε να ρυθμίσετε την εφαρμογή iTALC από την περιοχή ρυθμίσεων.</translation>
+        <translation type="unfinished">Φυσικά μπορείτε να ρυθμίσετε την εφαρμογή iTALC από την περιοχή ρυθμίσεων.</translation>
     </message>
     <message>
         <source>About iTALC</source>
-        <translation>Σχετικά με την εφαρμογή iTALC</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>
+        <translation type="unfinished">Σχετικά με την εφαρμογή iTALC</translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Εισαγωγή</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Βασικές πληροφορίες για την εφαρμογή iTALC και πως να τη χρησιμοποιήσετε.</translation>
+        <translation type="unfinished">Βασικές πληροφορίες για την εφαρμογή iTALC και πως να τη χρησιμοποιήσετε.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation type="unfinished">Όνομα χρήστη</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation type="unfinished">Κωδικός</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Τα νέα κλειδιά που δημιουργήθηκαν ή εισήχθησαν πρέπει να εγκατασταθούν κάπου. Προτείνετε να αφήσετε τους προεπιλεγμένους φακέλους.</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Αδυναμία καταχώρισης της υπηρεσίας '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Φάκελος αποθήκευσης του δημόσιου κλειδιού</translation>
+        <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>Directory to store private key in</source>
-        <translation>Φάκελος αποθήκευσης του ιδιωτικού κλειδιού</translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Η υπηρεσία '%1' έχει ήδη καταχωρηθεί.</translation>
     </message>
     <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Η υπηρεσία '%1' δε μπορεί να καταχωρηθεί.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Εξαγωγή του ιδιωτικού κλειδιού επίσης</translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Η υπηρεσία '%1' καταχωρήθηκε επιτυχώς.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Η υπηρεσία '%1' δε μπορεί να τερματιστεί.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Η υπηρεσία '%1' έχει αποκαταχωρηθεί.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
+        <translation>Η υπηρεσία '%1' δεν είναι καταχωρημένη και για αυτό δε μπορεί να αποκαταχωρηθεί.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Εισαγωγή δημοσίου κλειδιού του κύριου υπολογιστή</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Η υπηρεσία '%1' δε μπορεί να αποκαταχωρηθεί.</translation>
     </message>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Επιλέξτε προορισμό εξαγωγής του δημόσιου κλειδιού:</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Η υπηρεσία '%1' δε βρέθηκε.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Διατηρήστε όλα τα κλειδιά (μόνο όταν ενημερώνετε την υπάρχουσα εγκατάσταση!)</translation>
+        <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>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>iTALC Μαθητής %1:%2:%3</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidget</name>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Ζωντανή παρακολούθηση (%1 στον υπολογιστή %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Απομακρυσμένος έλεγχος (%1 στον υπολογιστή %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation>Άγνωστος χρήστης</translation>
+        <translation type="unfinished">Άγνωστος χρήστης</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
-        <source>Lock student</source>
-        <translation>Κλείδωμα μαθητή</translation>
+        <source>View only</source>
+        <translation type="unfinished">Προβολή μόνο</translation>
     </message>
     <message>
-        <source>Fullscreen</source>
-        <translation>Πλήρης οθόνη</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation>Τερματισμός</translation>
+        <source>Lock student</source>
+        <translation type="unfinished">Κλείδωμα μαθητή</translation>
     </message>
     <message>
-        <source>Connecting %1</source>
-        <translation>Σύνδεση με %1</translation>
+        <source>Unlock student</source>
+        <translation type="unfinished">Ξεκλείδωμα μαθητή</translation>
     </message>
     <message>
-        <source>Connected.</source>
-        <translation>Συνδέθηκε.</translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Στιγμιότυπο</translation>
     </message>
     <message>
-        <source>View only</source>
-        <translation>Προβολή μόνο</translation>
+        <source>Fullscreen</source>
+        <translation type="unfinished">Πλήρης οθόνη</translation>
     </message>
     <message>
-        <source>Snapshot</source>
-        <translation>Στιγμιότυπο</translation>
+        <source>Window</source>
+        <translation type="unfinished">Παράθυρο</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Απομακρυσμένος έλεγχος</translation>
+        <source>Quit</source>
+        <translation type="unfinished">Τερματισμός</translation>
     </message>
     <message>
-        <source>Unlock student</source>
-        <translation>Ξεκλείδωμα μαθητή</translation>
+        <source>Connecting %1</source>
+        <translation type="unfinished">Σύνδεση με %1</translation>
     </message>
     <message>
-        <source>Window</source>
-        <translation>Παράθυρο</translation>
+        <source>Connected.</source>
+        <translation type="unfinished">Συνδέθηκε.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Απομακρυσμένη σύνδεση</translation>
-    </message>
+    <name>RemoteLogonDialog</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:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Απομακρυσμένη σύνδεση...</span></p></body></html></translation>
+        <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>Εισάγετε στα παρακάτω πεδία το όνομα χρήστη, κωδικό και προαιρετικά το όνομα τομέα. Οι πληροφορίες αυτές θα χρησιμοποιηθούν για να συνδεθείτε σε υπολογιστή(ές).</translation>
+        <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>Όνομα χρήστη</translation>
+        <translation type="unfinished">Όνομα χρήστη</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>Κωδικός</translation>
+        <translation type="unfinished">Κωδικός</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation>Τομέας</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Άκυρο</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <translation type="unfinished">Τομέας</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Επιβεβαίωση αντικατάστασης</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Θέλετε να αντικαταστήσετε %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Ακύρωση εγκατάστασης</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>Next</source>
-        <translation>Επόμενο</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Τέλος</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Ακύρωση</translation>
-    </message>
-    <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Επιλέξτε το φάκελο του δημόσιου κλειδιού</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Επιλέξτε το φάκελο του ιδιωτικού κλειδιού</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Επιλέξτε το φάκελο εξαγωγής του δημόσιου κλειδιού</translation>
+        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
+        <translation type="unfinished">Αδύνατη η δημιουργία στιγμιοτύπου. Ο φάκελος %1 δεν υπάρχει και δε μπορεί να δημιουργηθεί.</translation>
     </message>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Στιγμιότυπο</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>Στιγμιότυπα</translation>
+        <translation type="unfinished">Στιγμιότυπα</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Διαχειριστείτε τις φωτογραφίες που δημιουργήσατε σε αυτή την περιοχή εργασίας.</translation>
+        <translation type="unfinished">Διαχειριστείτε τις φωτογραφίες που δημιουργήσατε σε αυτή την περιοχή εργασίας.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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">
+        <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>Χρήστης:</translation>
+        <translation type="unfinished">Χρήστης:</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation>Υπολογιστής:</translation>
+        <translation type="unfinished">Υπολογιστής:</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation>Ημερομηνία:</translation>
+        <translation type="unfinished">Ημερομηνία:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>Ώρα:</translation>
+        <translation type="unfinished">Ώρα:</translation>
     </message>
     <message>
-        <source>Show snapshot</source>
-        <translation>Εμφάνιση στιγμιοτύπου</translation>
-    </message>
-    <message>
-        <source>Delete snapshot</source>
-        <translation>Διαγραφή στιγμιότυπου</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Ανανέωση λίστας</translation>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation>Βοήθεια</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Παρακαλώ εισάγετε την IP διεύθυνση ή το όνομα του υπολογιστή του μαθητή που θέλετε να βοηθήσετε.</translation>
+        <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>OK</source>
-        <translation>OK</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Αποστολή μηνύματος κειμένου</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Άκυρο</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Βοήθεια</span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Σύνδεση με %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Αποστολή μηνύματος κειμένου</translation>
+        <source>Overview</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Αποστολή μυνήματος κειμένου</span></p></body></html></translation>
+        <source>Fullscreen demo</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>Γράψτε το μήνυμά σας στο παρακάτω πεδίο για να το στείλετε στους επιλεγμένους χρήστες.</translation>
+        <source>Window demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">Κλειδωμένη οθόνη</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>View live</source>
+        <translation type="unfinished">Ζωντανή παρακολούθηση</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Άκυρο</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Απομακρυσμένος έλεγχος</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">Επίδειξη οθόνης μαθητή</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Σύνδεση με %1 ...</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Αποστολή μηνύματος κειμένου</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
+        <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>Cancel</source>
-        <translation>Άκυρο</translation>
+        <source>Reboot</source>
+        <translation type="unfinished">Επανεκκίνηση</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Πίσω</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Τερματισμός</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Επόμενο</translation>
+        <source>Execute commands</source>
+        <translation type="unfinished">Εκτέλεση εντολών</translation>
     </message>
 </context>
 </TS>
diff --git a/lib/resources/es.qm b/lib/resources/es.qm
index 0ca84de..f7181d6 100644
Binary files a/lib/resources/es.qm and b/lib/resources/es.qm differ
diff --git a/lib/resources/es.ts b/lib/resources/es.ts
index ba133a3..4dd807d 100644
--- a/lib/resources/es.ts
+++ b/lib/resources/es.ts
@@ -2,1423 +2,1761 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="es_ES">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
     <message>
-        <source>Actions</source>
-        <translation type="unfinished">Acciones</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">Acerca de iTALC</translation>
+    </message>
+    <message>
+        <source>About</source>
+        <translation type="unfinished">Acerca</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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">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-2011 Tobias Doerffel / iTALC Solutions</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>MainWindow</name>
+    <name>AccessDialogSlave</name>
     <message>
-        <source>MainWindow</source>
+        <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>toolBar</source>
+        <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>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>Classroom-Manager</source>
+        <translation type="unfinished">Administrador de Clases</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">No hay permiso de escritura</translation>
+        <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>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 se pudo leer, escribir o crear el directorio %1! Para ejecutar iTALC asegúrese que tiene permisos para crear o escribir en este directorio.</translation>
+        <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>Classroom</source>
-        <translation type="unfinished">Clase</translation>
+        <source>Classrooms/computers</source>
+        <translation type="unfinished">Clases/computadoras</translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Cambiar de clase</translation>
+        <source>IP-address</source>
+        <translation type="unfinished">Dirección IP</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 seleccionar la clase activa.</translation>
+        <source>Usernames</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Haga click en este botón para cambiar de clase.</translation>
+        <source>Show usernames</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Modo ayuda</translation>
+        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Ayuda</translation>
+        <source>Export to text-file</source>
+        <translation type="unfinished">Exportar a archivo de texto</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 en iTALC y le permite tener una visión general de todos los ordenadores visibles. Use también este botón para desbloquear ordenadores bloqueados o salir del modo demo.</translation>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished">Demo en pantalla completa</translation>
+        <source>Hide teacher computers</source>
+        <translation type="unfinished">Ocultar computadora del Profesor</translation>
     </message>
     <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Demo pant. compl.</translation>
+        <source>Show/hide</source>
+        <translation type="unfinished">Mostrar/ocultar</translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Parar demo</translation>
+        <source>Edit settings</source>
+        <translation type="unfinished">Editar configuración</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 su pantalla se verá en todos los ordenadores visibles. Además los usuarios no pueden hacer nada más, ya que se bloquean los dispositivos de entrada.</translation>
+        <source>Remove</source>
+        <translation type="unfinished">Borrar</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demo en ventana</translation>
+        <source>Show all computers in classroom</source>
+        <translation type="unfinished">Mostrar todas las computadoras en el aula</translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Demo en ventana</translation>
+        <source>Hide all computers in classroom</source>
+        <translation type="unfinished">Ocultar todas las computadoras en el aula</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 su pantalla se verá en una ventana en todos los ordenadores visibles. Los usuarios pueden cambiar a otras ventanas y seguir trabajando.</translation>
+        <source>Edit name</source>
+        <translation type="unfinished">Editar nombre</translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Bloquear/desbloquear escritorios</translation>
+        <source>Remove classroom</source>
+        <translation type="unfinished">Borrar clase</translation>
     </message>
     <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Bloquear todos</translation>
+        <source>Add computer</source>
+        <translation type="unfinished">Agregar computadora</translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Desbloquear todos</translation>
+        <source>Add classroom</source>
+        <translation type="unfinished">Añadir clase</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">Para que sus usuarios le presten atención, puede bloquear sus ordenadores usando este botón. En este modo, todos los dispositivos de entrada están bloqueados y se pone la pantalla en negro.</translation>
+        <source>No configuration-file found</source>
+        <translation type="unfinished">No se ha encontrado el archivo de configuración</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Enviar mensaje de texto</translation>
+        <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>Text message</source>
-        <translation type="unfinished">Mensaje de texto</translation>
+        <source>Error in configuration-file</source>
+        <translation type="unfinished">Error en el archivo de configuración</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.</translation>
+        <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>Power on computers</source>
-        <translation type="unfinished">Encender ordenadores</translation>
+        <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>Power on</source>
-        <translation type="unfinished">Encender</translation>
+        <source>Select output-file</source>
+        <translation type="unfinished">Seleccionar archivo de salida</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">Haga click en este botón para encender todos los ordenadores visibles. De esta forma no tiene que encender cada ordenador manualmente.</translation>
+        <source>Text files (*.txt)</source>
+        <translation type="unfinished">Archivos de texto (*.txt)</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Apagar ordenadores</translation>
+        <source>Actions for selected</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Apagar</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Acciones</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 todos los ordenadores visibles (por ejemplo, al terminar la clase).</translation>
+        <source>Actions for %1</source>
+        <translation type="unfinished">Acciones para %1</translation>
     </message>
     <message>
-        <source>Logon</source>
-        <translation type="unfinished">Iniciar sesión</translation>
+        <source>New name for classroom</source>
+        <translation type="unfinished">Nuevo nombre para la clase</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Inicio de sesión remoto</translation>
+        <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>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Al pulsar este botón podrá introducir un usuario y contraseña para iniciar sesión en todos los ordenadores visibles.</translation>
+        <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>Support</source>
-        <translation type="unfinished">Soporte técnico</translation>
+        <source>Missing classroom</source>
+        <translation type="unfinished">Clase no encontrada</translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Soporte directo</translation>
+        <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>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 necesita ayudar a alguien en un ordenador en concreto puede pulsar este botón e introducir el nombre de máquina o IP correspondiente.</translation>
+        <source>New classroom</source>
+        <translation type="unfinished">Nueva clase</translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Ajustar/Alinear</translation>
+        <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>Adjust windows and their size</source>
-        <translation type="unfinished">Ajustar tamaño de ventanas</translation>
+        <source>Unknown state</source>
+        <translation type="unfinished">Estado desconocido</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">Al pulsar este botón, se ajustará el tamaño de las ventanas a su máximo posible.</translation>
+        <source>No user logged in</source>
+        <translation type="unfinished">Usuario no conectado</translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Auto ajuste</translation>
+        <source>Host unreachable</source>
+        <translation type="unfinished">Equipo no disponible</translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Colocación y tamaño de ventanas automático</translation>
+        <source>Demo running</source>
+        <translation type="unfinished">Modo demo funcionando</translation>
     </message>
     <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Al pulsar este botón, todas las ventanas visibles se ajustan y reorganizan automáticamente.</translation>
+        <source>Desktop locked</source>
+        <translation type="unfinished">Escritorio bloqueado</translation>
     </message>
+</context>
+<context>
+    <name>ClientAction</name>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">No se han encontrado claves válidas</translation>
+        <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>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">No se ha encontrado ninguna clave de autentificación o las anteriores no funcionan. Por favor, cree un nuevo par usando ICA (puede mirar la documentación en http://italc.sf.net/wiki/index.php?title=Installation). No podrá acceder a los ordenadores sin un par de claves.</translation>
+        <source>Are you sure want logout all users on all selected computers ?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">El servicio iTALC no se está ejecutando</translation>
+        <source>Logout user</source>
+        <translation type="unfinished">Desconectar usuario</translation>
     </message>
     <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Parece que no se está ejecutando el servicio iTALC en este ordenador o las claves de autentificación no están configuradas correctamente. El servicio se necesita para ejecutar iTALC. Contacte al administrador para solucionar este problema.</translation>
+        <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>iTALC Master Control</source>
-        <translation type="unfinished">Control de iTALC</translation>
+        <source>Are you sure want to reboot all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Control remoto</translation>
+        <source>Reboot computers</source>
+        <translation type="unfinished">Reiniciar computadoras</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished">Salir</translation>
+        <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>QApplication</name>
+    <name>ClientSettingsDialog</name>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>No se pudo registrar el servicio '%1'.</translation>
+        <source>Invalid MAC-address</source>
+        <translation type="unfinished">Dirección MAC inválida</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>No se ha podido acceder al gestor de control de servicios (¿tiene pemisos?) - El servicio '%1' no se ha registrado.</translation>
+        <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>The service '%1' is already registered.</source>
-        <translation>El servicio '%1' ya está registrado.</translation>
+        <source>Client settings</source>
+        <translation type="unfinished">Configuración de los clientes</translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>El servicio '%1' no se pudo registrar.</translation>
+        <source>IP/hostname</source>
+        <translation type="unfinished">IP/nombre de equipo</translation>
     </message>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>El servicio '%1' no se pudo detener.</translation>
+        <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 ':' for specifying an optional port-number)</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;"> introduzca una dirección IP o nombre de equipo para que iTALC se conecte a ese equipo (use ':' para indicar el número de puerto opcional)</p></body></html></translation>
     </message>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>El servicio '%1' se ha eliminado.</translation>
+        <source>Name</source>
+        <translation type="unfinished">Nombre</translation>
     </message>
     <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>El servicio '%1' no está registrado por lo que no se puede eliminar.</translation>
+        <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></source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>El servicio '%1' no se pudo eliminar.</translation>
+        <source>MAC address</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>El servicio '%1' no se ha encontrado.</translation>
+        <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></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;">Dirección MAC - sólo usada para encender los equipos</p></body></html></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>No se ha podido acceder al gestor de control de servicios (¿tiene pemisos?) - El servicio '%1' no se ha eliminado.</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Clase</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>No se ha podido acceder al gestor de control de servicios (¿tiene pemisos?) - El servicio '%1' no se ha parado.</translation>
+        <source>Type</source>
+        <translation type="unfinished">Tipo</translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>El servicio '%1' se ha registrado correctamente.</translation>
+        <source>Student computer</source>
+        <translation type="unfinished">Computadora Estudiante</translation>
     </message>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Cliente iTALC %1 en %2:%3</translation>
+        <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>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>NCT (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</translation>
+        <source>Missing IP address/hostname</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>Capturas iTALC</translation>
+        <source>You didn't specify an IP address or hostname for the computer!</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>about</name>
+    <name>Config</name>
     <message>
-        <source>About</source>
-        <translation>Acerca</translation>
+        <source>Interval between updates</source>
+        <translation type="unfinished">Intervalo entre actualizaciones</translation>
     </message>
     <message>
-        <source>About iTALC</source>
-        <translation>Acerca de iTALC</translation>
+        <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 network-traffic and lower CPU-usage on this computer.</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;">Aquí puede asignar un intervalo entre la actualización de los clientes. Valores más altos dan lugar un tráfico de red bajo y un bajo consumo del CPU de esta computadora.</p></body></html></translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Autores</translation>
+        <source> seconds</source>
+        <translation type="unfinished">segundos</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Acerca de iTALC</span></p></body></html></translation>
+        <source>User interface</source>
+        <translation type="unfinished">Interfaz de usuario</translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Licencia</translation>
+        <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></body></html></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <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 mouse-cursor over 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;">Tilde esta opción si es molestado por la aparición de los globos de ayuda de la barra cuando mueve el cursor del mouse por sobre la barra de botones.</p></body></html></translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Traducción</translation>
+        <source>No balloon-tooltips</source>
+        <translation type="unfinished">Desactivar ayudas en globos</translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
+        <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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+        <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:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
+</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;">Aquí puedes seleccionar tu rol. Unicamente modifique esto si sabe lo que esta haciendo. De otra manera no le será posible acceder a ningun cliente hasta que recupere su antiguo rol.</p></body></html></translation>
+    </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;">Aquí puede configurar que pasaría si hace un doble click sobre la ventana de un cliente.</p></body></html></translation>
+    </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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Favor de tener en cuenta, algunos de los cambios no tendrán efecto hasta luego de reiniciar iTALC.</span></p></body></html></translation>
+    </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>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Actions</source>
-        <translation>Acciones</translation>
+        <source>Only critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Acciones para %1</translation>
+        <source>Errors and critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Añadir clase</translation>
+        <source>Warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Añadir ordenador</translation>
+        <source>Information, warnings and errors</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>¿Seguro que desea eliminar la clase "%1"?
-¡Se eliminarán todos los ordenadores de esta clase!</translation>
+        <source>Debug messages and everything else</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>Antes de agregar ordenadores se debe crear al menos una clase.
-¿Desea crear una clase ahora?</translation>
+        <source>Limit log file size</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Administrador de clases</translation>
+        <source>MB</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Clases/ordenadores</translation>
+        <source>Clear all log files</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>No se ha encontrado el archivo de configuración %1.
-Deberá agregar al menos una clase y un ordenador usando el administrador de clases situado en la barra de herramientas de la izquierda.</translation>
+        <source>Desktop capturing</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Editar nombre</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Editar configuración</translation>
+        <source>Poll full screen</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Error en el archivo de configuración</translation>
+        <source>Low accuracy (turbo mode)</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>Error durante el análisis del archivo de configuración %1.
-Por favor, corrija los errores. En caso contrario, debería borrar el archivo.</translation>
+        <source>Demo server</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>Error durante el análisis del archivo de configuración %1.
-Por favor, corrija los errores. De lo contrario deberá borrar este archivo y tendrá que agregar todas las clases y ordenadores de nuevo.</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Ocultar todos los ordenadores de la clase</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Ocultar ordenadores de profesores</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>Dirección IP</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Clase no encontrada</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Nueva clase</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Nuevo nombre para la clase</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>No se ha encontrado el archivo de configuración</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Por favor introduzca el nuevo nombre para la clase "%1".</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Capturas</translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Por favor introduzca el nombre de la clase que desea crear.</translation>
+        <source>Authentication methods</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Eliminar</translation>
+        <source>Access key management</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Eliminar clase</translation>
+        <source>Logon settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Mostrar todos los ordenadores de la clase</translation>
+        <source>&File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Mostrar/ocultar</translation>
+        <source>&Help</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>Desde aquí se administran los ordenadores y clases. Se pueden agregar ordenadores o clases haciendo click derecho en esta lista.</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Aquí se administran sus ordenadores y clases de una manera fácil.</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Nombres de usuario</translation>
+        <source>&Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Mostrar nombres de usuario</translation>
+        <source>Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Utilice el menú contextural (botón derecho del ratón) para añadir o eliminar ordenadores y/o clases.</translation>
+        <source>Ctrl+S</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Exportar a archivo de texto</translation>
+        <source>L&oad settings from 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>Utilice este botón para exportar esta lista de ordenadores y nombres de usuario a un archivo de texto. Puede usar este archivo más adelante para recoger archivos tras un examen. Esto es necesario en algunas ocasiones, porque algunos usuarios pueden haber terminado y cerrado la sesión y no se podría obtener sus archivos al final del examen.</translation>
+        <source>Ctrl+O</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Seleccionar archivo de salida</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">Acerca de iTALC</translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Archivos de texto (*.txt)</translation>
+        <source>About Qt</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation>Acciones para la selección</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Demo running</source>
-        <translation>Modo demo activado</translation>
+        <source>toolBar</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Escritorio bloqueado</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Equipo no disponible</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Usuario no conectado</translation>
+        <source>Load settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unknown state</source>
-        <translation>Estado desconocido</translation>
+        <source>XML files (*.xml)</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>¿Seguro que desea cerrar la sesión a todos los usuarios de los ordenadores visibles?</translation>
+        <source>Save settings to file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>¿Seguro que desea cerrar la sesión a todos los usuarios de los ordenadores seleccionados?</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Cerrar sesión</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>¿Seguro que desea reiniciar todos los ordenadores visibles?</translation>
+        <source>Configuration not writable</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>¿Seguro que desea reiniciar todos los ordenadores seleccionados?</translation>
+        <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>Reboot computers</source>
-        <translation>Reiniciar ordenadores</translation>
+        <source>All settings were applied successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>¿Seguro que desea apagar todos los ordenadores visibles?</translation>
+        <source>An error occured while applying settings!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>¿Seguro que desea apagar todos los ordenadores seleccionados?</translation>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation>Ayuda</translation>
+        <source>No write access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation>Demo en pantalla completa</translation>
+        <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>Window demo</source>
-        <translation>Demo en ventana</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Clase</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation>Bloquear pantalla</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Cambiar de clase</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation>Ver en vivo</translation>
+        <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>Remote control</source>
-        <translation>Control remoto</translation>
+        <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>Let student show demo</source>
-        <translation>Permitir al alumno mostrar demo</translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Modo ayuda</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation>Enviar mensaje de texto</translation>
+        <source>Overview</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation>Iniciar sesión</translation>
+        <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>Logout user</source>
-        <translation>Cerrar sesión</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation>Hacer captura de pantalla</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation>Encender</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation>Reiniciar</translation>
+        <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>Power down</source>
-        <translation>Apagar</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Demo en ventana</translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation>Ejecutar comandos</translation>
+        <source>Window Demo</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</translation>
+        <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>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">Bloquear y desbloquear escritorios</translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Actuar como repetidor de &demo</translation>
+        <source>Lock all</source>
+        <translation type="unfinished">Bloquear todas</translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation>Analógico</translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">Desbloquear todas</translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>C&ancelar</translation>
+        <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>Classroom</source>
-        <translation>Clase</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Enviar mensaje de texto</translation>
     </message>
     <message>
-        <source>Client settings</source>
-        <translation>Configuración del cliente</translation>
+        <source>Text message</source>
+        <translation type="unfinished">Mensaje</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Conexión</translation>
+        <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>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">Arrancar computadoras</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <source>Power on</source>
+        <translation type="unfinished">Encender</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>General</translation>
+        <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>Host is &gateway for subnet</source>
-        <translation>El host es &puerta de enlace de la subred</translation>
+        <source>Power down computers</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;">Activate this option for at least one host in a subnet.</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;">Activar esta opción para al menos un host en una subred.</p></body></html></translation>
+        <source>Power down</source>
+        <translation type="unfinished">Apagar</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 if the host is the gateway for the subnet.</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;">Comprobar si el host es la puerta de enlace para la subred.</p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">connection to hosts on the same level</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;">conexión entre hosts del mismo nivel</p></body></html></translation>
+        <source>Support</source>
+        <translation type="unfinished">Soporte técnico</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 ':' for specifying an optional port-number)</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;">introduzca una dirección IP o nombre de equipo para que iTALC se conecte a ese equipo (use ':' para indicar el número de puerto opcional)</p></body></html></translation>
+        <source>Direct support</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></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;">Dirección MAC - Se utiliza únicamente para encender los equipos</p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Aquí puede especificar como se conecta este host a la red de iTALC. Los clientes normales se conectan con 100 MBit/s LAN, pero puede haber hosts especiales tales como las puertas de enlace para otras redes iTALC de otras escuelas o de estudiantes que están en sus casas. En estos casos iTALC trata de optimizar la utilización del ancho de banda.</p></body></html></translation>
+        <source>Adjust/align</source>
+        <translation type="unfinished">Ajustar/Alinear</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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;">Cuando mostramos una demo a más de un host en una red externa, es importante activar esta opción en al menos uno de los hosts. De esta manera toda la información es enviada solo una vez al repetidor de la demo, que proveerá la información para todos los demás hosts en la red. Especialmente en enlaces lentos la utilización de esta opción es esencial. Normalmente debe habilitar esta opción en la puerta de enlace de la subred.</p></body></html></translation>
+        <source>Adjust windows and their size</source>
+        <translation type="unfinished">Ajustar tamaño de ventanas</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Configuración del cliente</span></p></body></html></translation>
+        <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>IP/hostname</source>
-        <translation>IP/nombre de equipo</translation>
+        <source>Auto view</source>
+        <translation type="unfinished">Auto juste</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished">Reacomoda ventanas y su tamaño</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>Dirección MAC</translation>
+        <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>Name</source>
-        <translation>Nombre</translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Control remoto</translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Otros/Sin definir</translation>
+        <source>Could not modify the autostart property for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Ordenador de estudiante</translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher computer</source>
-        <translation>Ordenador de profesor</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Tipo</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <source>Enable desktop switching for screen lock (experimental)</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></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;">Nombre opcional del host que se muestra en iTALC.</p></body></html></translation>
+        <source>Log to standard error output</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Dirección MAC no válida</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Dirección IP/nombre de equipo no indicado</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>¡No ha especificado una dirección IP o nombre de equipo para este ordenador!</translation>
+        <source>VNC reflector</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>Ha especificado una dirección MAC no válida. Deje el campo en blanco o introduzca una dirección MAC válida (¡Utilice ":" como separador!).</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Introduzca los comandos que se ejecutarán en el cliente (o los clientes):</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>¡&Ejecutar!</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Ejecutar comandos en cliente(s)</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>1 second</source>
-        <translation>1 segundo</translation>
+        <source>Key file authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Administrador</translation>
+        <source>ACL-based logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Dominio</translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Acción por defecto de doble click</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Alto (color verdadero)</translation>
+        <source>Launch key file assistant</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 mouse-cursor over 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;">Active esta opción si le molestan los globos de ayuda al pasar el cursor por la barra de herramientas.</p></body></html></translation>
+        <source>Manage permissions</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 herramientas.</p></body></html></translation>
+        <source>Test</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 network-traffic and lower CPU-usage on this computer.</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;">Aquí puede asignar un intervalo entre actualizaciones de los clientes. Valores más altos suponen menor tráfico de red y menor uso de CPU en este ordenador.</p></body></html></translation>
+        <source>Access confirmation</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Tenga en cuenta que algunos de los cambios no se realizarán hasta que no reinicie iTALC.</span></p></body></html></translation>
+        <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><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;">Aquí puede seleccionar su rol. Modifique esta opción, únicamente si sabe lo que está haciendo. De lo contrario no le será posible acceder a ningún cliente hasta que recupere su antiguo rol.</p></body></html></translation>
+        <source>Logon authentication</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">Aquí puede configurar la calidad de pantalla que desee en el modo demo. Baja calidad da lugar a bajo consumo de CPU y bajo tráfico de red mientras que alta calidad hará más lento su ordenador y reducirá la tasa de imágenes de la demo. Debe experimentar con esta opción hasta encontrar el ajuste óptimo.</p></body></html></translation>
+        <source>Allow same user to access desktop without confirmation</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><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;">Aquí puede configurar que pasará al hacer doble click sobre la ventana de un cliente.</p></body></html></translation>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Interval between updates</source>
-        <translation>Intervalo entre actualizaciones</translation>
+        <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>Low (15 bit)</source>
-        <translation>Bajo (15 bit)</translation>
+        <source>1)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Medio (18 bit)</translation>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Desactivar globos de ayuda</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Otro</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Calidad del modo demo</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Control remoto</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> segundos</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Configuración para inicio de sesión múltiple</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Soporte técnico</translation>
+        <source>Generate bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Profesor</translation>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User interface</source>
-        <translation>Interfaz de usuario</translation>
+        <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>View live in fullscreen</source>
-        <translation>Visualizar en pantalla completa</translation>
+        <source>Restart iTALC Service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Su rol (¡se necesitan las claves correctas!)</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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;">No mostrar los textos en los botones de las barras de herramientas</p></body></html></translation>
+        <source>Starting iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Sin texto en las barras de herramientas</translation>
+        <source>Stopping iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>En esta zona puede configurar iTALC a su gusto.</translation>
+        <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>Your iTALC-configuration</source>
-        <translation>Su configuración de iTALC</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Demo</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>Message from teacher</source>
-        <translation>Mensaje del profesor</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Alguien en el equipo %1 intenta acceder a su pantalla. ¿Quiere permitir el acceso?</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Nunca para esta sesión</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Siempre para esta sesión</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Confirmar acceso</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>ISD-server error</source>
-        <translation>Error del servidor ISD</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>El servidor ISD no se ha iniciado porque el puerto '%1' ya está en uso. Por favor asegurese que ninguna otra aplicación está usando este puerto e inténtelo de nuevo.</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Error de autentificación</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>¡Alguien (IP: %1) está intentando acceder a este ordenador pero no puede autentificarse correctamente!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Captura</translation>
+        <source>Could not contact iTALC service</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>No se pudo tomar una captura ya que el directorio %1 no existe y no puede ser creado.</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translatorcomment>I don't know where this string is being used so I don't know if it fits the context</translatorcomment>
-        <translation type="unfinished">bloqueo de pantalla</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Mensaje del profesor</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
-    <message>
-        <source>About iTALC</source>
-        <translation>Acerca de iTALC</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>Aquí puede ver la barra de herramientas. Cada botón le lleva a un área de trabajo. Puede acceder a cada una de ellas pulsando su botón correspondiente.</translation>
-    </message>
+    <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">
+        <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>
+<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>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>Por supuesto, puede configurar iTALC. Puede hacerlo pulsando el botón del área de trabajo de configuración.</translation>
+        <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>El área de trabajo de capturas es una herramienta muy útil. Le permite administrar las capturas de pantalla que hace.</translation>
+        <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>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation>Usando el administrador de clases puede configurar sus clases y ordenadores. También puede ver que usuarios han iniciado sesión.</translation>
+        <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>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Ayuda</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Alguna información básica sobre iTALC y como usarlo.</translation>
+        <translation type="unfinished">Alguna información básica sobre iTALC y como usarlo.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
-        <translation>¡iTALC está listo para ser ejecutado!</translation>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation>iTALC está completamente instalado y configurado. Si ha instalado la aplicación maestra, la puede ejecutar ahora mismo.</translation>
+        <source>Username</source>
+        <translation type="unfinished">Nombre de usuario</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation>Guardar configuración de claves</translation>
+        <source>Password</source>
+        <translation type="unfinished">Contraseña</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
-        <translation>Directorios de claves</translation>
+        <source>iTALC Logon</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Las nuevas claves (o las importadas) deben instalarse en algún lugar. Se recomienda dejar los valores por defecto.</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation type="unfinished">No se puede registrar el servicio '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Directorio donde almacenar la clave pública</translation>
+        <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>Directory to store private key in</source>
-        <translation>Directorio donde almacenar la clave privada</translation>
+        <source>The service '%1' is already registered.</source>
+        <translation type="unfinished">El servicio '%1' ya está registrado.</translation>
     </message>
     <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation>Puede elegir donde exportar la clave pública, por ejemplo en una unidad USB o una carpeta compartida.</translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation type="unfinished">El servicio '%1' no se pudo registrar.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Exportar también la clave privada</translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation type="unfinished">El servicio '%1' no se pudo parar.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation>Opciones de seguridad</translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation type="unfinished">El servicio '%1' se ha des-registrado.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation>iTALC tiene un concepto sofisticado de seguridad para prevenir accesos no autorizados a ordenadores con el cliente iTALC instalado.
-
-Por tanto, debes crear un nuevo par de claves o importar la clave pública creada durante la instalación de iTALC en el equipo maestro.</translation>
+        <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>Create a new key pair (only on master computer)</source>
-        <translation>Crear un nuevo par de claves (únicamente en el equipo maestro)</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation type="unfinished">El servicio '%1' no se pudo des-registrar.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Importar clave pública del equipo maestro</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation type="unfinished">El servicio '%1' no se ha encontrado.</translation>
     </message>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Directorio de exportación de la clave pública:</translation>
+        <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>Keep all keys (only when updating existing installation!)</source>
-        <translation>Mantener las claves (¡sólo al actualizar una instalación existente!)</translation>
+        <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>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation>Bienvenido a iTALC</translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation type="unfinished">El servicio '%1' se ha registrado correctamente.</translation>
     </message>
     <message>
-        <source>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation>Esta herramienta le guiará en el proceso de configurar las claves de autentificación de iTALC.
-
-Pulse 'Siguiente' para continuar.</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>Cliente iTALC %1 en %2:%3</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidget</name>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Control Remoto (%1 en host %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>unknown user</source>
-        <translation>usuario desconocido</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Ver en vivo (%1 en host %2)</translation>
+        <source>unknown user</source>
+        <translation type="unfinished">usuario desconocido</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
-    <message>
-        <source>Connected.</source>
-        <translation>Conectado.</translation>
-    </message>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
-        <source>Connecting %1</source>
-        <translation>Conectando %1</translation>
+        <source>View only</source>
+        <translation type="unfinished">Solo mirar</translation>
     </message>
     <message>
-        <source>Fullscreen</source>
-        <translation>Pantalla completa</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Control remoto</translation>
     </message>
     <message>
         <source>Lock student</source>
-        <translation>Bloquear</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Salir</translation>
+        <translation type="unfinished">Bloquear</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Control remoto</translation>
+        <source>Unlock student</source>
+        <translation type="unfinished">Desbloquear</translation>
     </message>
     <message>
         <source>Snapshot</source>
-        <translation>Captura</translation>
+        <translation type="unfinished">Captura</translation>
     </message>
     <message>
-        <source>Unlock student</source>
-        <translation>Desbloquear</translation>
-    </message>
-    <message>
-        <source>View only</source>
-        <translation>Solo mirar</translation>
+        <source>Fullscreen</source>
+        <translation type="unfinished">Pantalla Completa</translation>
     </message>
     <message>
         <source>Window</source>
-        <translation>Ventana</translation>
+        <translation type="unfinished">Ventana</translation>
     </message>
-</context>
-<context>
-    <name>remoteLogon</name>
     <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
+        <source>Quit</source>
+        <translation type="unfinished">Salir</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Intro</translation>
+        <source>Connecting %1</source>
+        <translation type="unfinished">Conectando %1</translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Dominio</translation>
+        <source>Connected.</source>
+        <translation type="unfinished">Conectado.</translation>
     </message>
+</context>
+<context>
+    <name>RemoteLogonDialog</name>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Remote logon</source>
+        <translation type="unfinished">Logueo remoto</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Acceso Remoto</span></p></body></html></translation>
+        <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>&OK</source>
-        <translation>&OK</translation>
+        <source>Username</source>
+        <translation type="unfinished">Nombre de usuario</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>Contraseña</translation>
+        <translation type="unfinished">Contraseña</translation>
     </message>
     <message>
-        <source>Remote Logon</source>
-        <translation>Inicio de sesión remoto</translation>
-    </message>
-    <message>
-        <source>Username</source>
-        <translation>Nombre de usuario</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>Introduzca el nombre de usuario, contraseña y de forma opcional, el nombre de dominio. Esta información se utilizará para iniciar sesión en los equipos.</translation>
+        <source>Domain</source>
+        <translation type="unfinished">Dominio</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Confirmar sobreescritura</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>¿Desea sobreescribir %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Cancelar configuración</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation>¿Seguro que desea salir? ¡iTALC todavía no se ha configurado!</translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Siguiente</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>Finish</source>
-        <translation>Finalizar</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Salir</translation>
-    </message>
-    <message>
-        <source>File does not exist</source>
-        <translation>El archivo no existe</translation>
+        <source>Run commands</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
-        <translation>No se ha podido encontrar el archivo %1. Compruébelo e inténtelo de nuevo.</translation>
+        <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>setupWizardPageKeyDirs</name>
+    <name>Snapshot</name>
     <message>
-        <source>Choose public key directory</source>
-        <translation>Seleccionar directorio de clave pública</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Seleccionar directorio de clave privada</translation>
+        <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>Choose public key export directory</source>
-        <translation>Seleccionar directorio de exportación de clave pública</translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Captura</translation>
     </message>
 </context>
 <context>
-    <name>setupWizardPageSecurityOptions</name>
+    <name>SnapshotList</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation>Seleccione el directorio donde se encuentra la clave</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Capturas</translation>
     </message>
-</context>
-<context>
-    <name>snapshotList</name>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Utilice este área de trabajo para gestionar fácilmente las capturas de pantalla.</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>Capturas</translation>
+        <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>Date:</source>
-        <translation>Fecha:</translation>
-    </message>
-    <message>
-        <source>Delete snapshot</source>
-        <translation>Borrar captura</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation>Equipo:</translation>
-    </message>
+    <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">
+        <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;">Todas las capturas realizadas aparecen aquí. Puede realizar capturas mediante el menú contextual de la ventana del cliente.</p></body></html></translation>
+<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>Reload list</source>
-        <translation>Recargar lista</translation>
+        <source>Host:</source>
+        <translation type="unfinished">Equipo:</translation>
     </message>
     <message>
-        <source>Show snapshot</source>
-        <translation>Mostrar captura</translation>
+        <source>Date:</source>
+        <translation type="unfinished">Fecha:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>Hora:</translation>
+        <translation type="unfinished">Hora:</translation>
     </message>
     <message>
-        <source>User:</source>
-        <translation>Usuario:</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
+        <source>Support</source>
+        <translation type="unfinished">Soporte técnico</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <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>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Por favor, introduzca la dirección IP o el nombre de host donde está la persona a quien desea ayudar.</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Enviar mensaje de texto</translation>
     </message>
     <message>
-        <source>Support</source>
-        <translation>Soporte técnico</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Soporte técnico</span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Estableciendo conexión con %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
+    <message>
+        <source>Overview</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished"></translation>
+    </message>
     <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Demo en ventana</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Intro</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">Bloquear pantalla</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>View live</source>
+        <translation type="unfinished">Ver en vivo</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Enviar mensaje de texto</span></p></body></html></translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Control remoto</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">Permitir al alumno mostrar demo</translation>
     </message>
     <message>
         <source>Send text message</source>
-        <translation>Enviar mensaje de texto</translation>
+        <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>Escriba su mensaje para ser enviado a todos los usuarios seleccionados.</translation>
+        <source>Logout user</source>
+        <translation type="unfinished">Desconectar usuario</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Estableciendo conexión con %1 ...</translation>
+        <source>Take a snapshot</source>
+        <translation type="unfinished">Tomar una Captura</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation>Herramienta de configuración de iTALC</translation>
+        <source>Power on</source>
+        <translation type="unfinished">Encender</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
+        <source>Reboot</source>
+        <translation type="unfinished">Reiniciar</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Atrás</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Apagar</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Siguiente</translation>
+        <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
index cbd18c0..afa2c57 100644
Binary files a/lib/resources/fi.qm and b/lib/resources/fi.qm differ
diff --git a/lib/resources/fi.ts b/lib/resources/fi.ts
index e238a0f..d5078a2 100644
--- a/lib/resources/fi.ts
+++ b/lib/resources/fi.ts
@@ -2,1431 +2,1767 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="fi_FI">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
     <message>
-        <source>Actions</source>
-        <translation type="unfinished">Toiminnot</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>MainWindow</name>
     <message>
-        <source>MainWindow</source>
+        <source>About</source>
+        <translation type="unfinished">Tietoja</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>toolBar</source>
+        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>Authors</source>
+        <translation type="unfinished">Tekijät</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Ei kirjoitusoikeutta</translation>
+        <source>Translation</source>
+        <translation type="unfinished">Käännös</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>
+        <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>Classroom</source>
-        <translation type="unfinished">Luokkahuone</translation>
+        <source>License</source>
+        <translation type="unfinished">Lisenssi</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel / iTALC Solutions</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>AccessDialogSlave</name>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Vaihda luokkahuonetta</translation>
+        <source>Never for this session</source>
+        <translation type="unfinished">Ei koskaan tälle istunnolle</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>
+        <source>Always for this session</source>
+        <translation type="unfinished">Aina tälle istunnolle</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>
+        <source>Confirm desktop access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Yleisnäkymä</translation>
+        <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>Overview</source>
-        <translation type="unfinished">Tietoja</translation>
+        <source>Classroom-Manager</source>
+        <translation type="unfinished">Hallinta</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>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished">Esitys koko näytöllä</translation>
+        <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>Fullscreen Demo</source>
-        <translation type="unfinished">Esitys koko näytöllä</translation>
+        <source>Classrooms/computers</source>
+        <translation type="unfinished">Luokkahuoneet/koneet</translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Lopeta esitys</translation>
+        <source>IP-address</source>
+        <translation type="unfinished">IP-osoite</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>
+        <source>Usernames</source>
+        <translation type="unfinished">Käyttäjänimet</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Esitys ikkunassa</translation>
+        <source>Show usernames</source>
+        <translation type="unfinished">Näytä kayttäjänimet</translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Esitys ikkunassa</translation>
+        <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>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>
+        <source>Export to text-file</source>
+        <translation type="unfinished">Vie tekstitiedostoksi</translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Lukitse/vapauta työtilat</translation>
+        <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>Lock all</source>
-        <translation type="unfinished">Lukitse kaikki</translation>
+        <source>Hide teacher computers</source>
+        <translation type="unfinished">Piilota opettajan koneet</translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Vapauta kaikki</translation>
+        <source>Show/hide</source>
+        <translation type="unfinished">Näytä/piilota</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>
+        <source>Edit settings</source>
+        <translation type="unfinished">Muokkaa asetuksia</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Lähteä viesti</translation>
+        <source>Remove</source>
+        <translation type="unfinished">Poista</translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished">Viesti</translation>
+        <source>Show all computers in classroom</source>
+        <translation type="unfinished">Näytä kaikki luokkahuoneen koneet</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>
+        <source>Hide all computers in classroom</source>
+        <translation type="unfinished">Piilota kaikki luokkahuoneen koneet</translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Käynnistä tietokone</translation>
+        <source>Edit name</source>
+        <translation type="unfinished">Muokkaa nimeä</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Käynnistä</translation>
+        <source>Remove classroom</source>
+        <translation type="unfinished">Poista luokkahuone</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>
+        <source>Add computer</source>
+        <translation type="unfinished">Lisää tietokone</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Sammuta tietokone</translation>
+        <source>Add classroom</source>
+        <translation type="unfinished">Lisää luokkahuone</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Sammuta</translation>
+        <source>No configuration-file found</source>
+        <translation type="unfinished">Asetustiedostoa ei löytynyt</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>
+        <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>Logon</source>
-        <translation type="unfinished">Kirjaudu</translation>
+        <source>Error in configuration-file</source>
+        <translation type="unfinished">Virhe asetustiedostossa</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Kirjaudu</translation>
+        <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>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Painamalla tätä voit antaa käyttäjätunnuksen ja salasanan, jolla kirjaudutaan kaikille näkyville koneille.</translation>
+        <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>Support</source>
-        <translation type="unfinished">Tukitoiminto</translation>
+        <source>Select output-file</source>
+        <translation type="unfinished">Tallenna tiedostoksi</translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Etätuki koneelle</translation>
+        <source>Text files (*.txt)</source>
+        <translation type="unfinished">Tekstitiedostot (*.txt)</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>
+        <source>Actions for selected</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Sovita</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Toiminnot</translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Sovita ikkunat</translation>
+        <source>Actions for %1</source>
+        <translation type="unfinished">Suorita %1:lle</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>
+        <source>New name for classroom</source>
+        <translation type="unfinished">Nimeä luokkahuone</translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Järjestä</translation>
+        <source>Please enter a new name for classroom "%1".</source>
+        <translation type="unfinished">Kirjoita luokkahuoneen "%1" uusi nimi.</translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Järjestä ja sovita ikkunat</translation>
+        <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>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>
+        <source>Missing classroom</source>
+        <translation type="unfinished">Luokkahuone puuttuu</translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Ei oikeaa avainta</translation>
+        <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>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Oikeaa autentikointiavainta ei löytynyt tai se ei ole kelvollinen. Luo uusi avainpari käyttämällä ICA-ohjelmaa (katso ohjeistus http://italc.sf.net/wiki/index.php?title=Installation). Muuten iTALC ei pysty kommunikoimaan muiden koneiden kanssa.</translation>
+        <source>New classroom</source>
+        <translation type="unfinished">Uusi luokkahuone</translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">iTALC palvelu ei ole käynnissä</translation>
+        <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>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">iTALC palvelu (ICA-ohjelma) ei näyttäisi olevan käynnissä tässä tietokoneessa tai autentikointiavaimet eivät ole oikein. Ota yhteyttä ylläpitoon ratkaistaksesi ongelman, tai voit yrittää käynnistää ICA-palvelun itse.</translation>
+        <source>Unknown state</source>
+        <translation type="unfinished">Tuntematon tila</translation>
     </message>
     <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>No user logged in</source>
+        <translation type="unfinished">Ei käyttäjää</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
+        <source>Host unreachable</source>
+        <translation type="unfinished">Ei yhteyttä koneeseen</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished"></translation>
+        <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>QApplication</name>
+    <name>ClientAction</name>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>ICA %1 portissa %2:%3</translation>
+        <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>Unable to register service '%1'.</source>
-        <translation>Rekisteröityminen palveluun '%1' epäonnistui.</translation>
+        <source>Are you sure want logout all users on all selected computers ?</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>Kytkeytyminen Service Control Manageriin epäonnistui (ovatko käyttöoikeutesi riittävät?) - palvelua '%1' ei rekisteröity.</translation>
+        <source>Logout user</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Palvelu '%1' on jo rekisteröity.</translation>
+        <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>The service '%1' could not be registered.</source>
-        <translation>Palvelua '%1' ei voitu rekisteröidä.</translation>
+        <source>Are you sure want to reboot all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Palvelu '%1' rekisteröity onnistuneesti.</translation>
+        <source>Reboot computers</source>
+        <translation type="unfinished">Uudelleenkäynnistä tietokoneet</translation>
     </message>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Palvelua '%1' ei voitu pysäyttää.</translation>
+        <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>The service '%1' has been unregistered.</source>
-        <translation>Palvelu '%1' poistettu.</translation>
+        <source>Are you sure want to power down all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>ClientSettingsDialog</name>
     <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>
+        <source>Invalid MAC-address</source>
+        <translation type="unfinished">Virheellinen MAC-osoite</translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Palvelua '%1' ei voitu poistaa.</translation>
+        <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>The service '%1' could not be found.</source>
-        <translation>Palvelua '%1' ei löydy.</translation>
+        <source>Client settings</source>
+        <translation type="unfinished">Tietokoneen asetukset</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>
+        <source>IP/hostname</source>
+        <translation type="unfinished">IP/verkkonimi</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>
+        <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 ':' for specifying an optional port-number)</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;">Kirjoita koneen verkkonimi tai IP-osoite (käytä ':' jos haluat määrittää erikoisen portin)</p></body></html></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>KST (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</translation>
+        <source>Name</source>
+        <translation type="unfinished">Nimi</translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>iTALC-kuvaruutukopiot</translation>
+        <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></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;">Vaihtoehtoinen nimi koneelle iTALC:ssa.</p></body></html></translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation>Tietoja iTALC-ohjelmistosta</translation>
+        <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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Tietoja iTALC-ohjelmistosta</span></p></body></html></translation>
+        <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></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;">Tietokoneen verkkokortin MAC-osoite - tarvitaan vain koneen etäkäynnistykseen</p></body></html></translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>Tietoja</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Luokkahuone</translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Tekijät</translation>
+        <source>Type</source>
+        <translation type="unfinished">Konetyyppi</translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Käännös</translation>
+        <source>Student computer</source>
+        <translation type="unfinished">Oppilaan kone</translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Lisenssi</translation>
+        <source>Teacher computer</source>
+        <translation type="unfinished">Opettajan kone</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Other/undefined computer</source>
+        <translation type="unfinished">Muu/määrittelemätön kone</translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
+        <source>Missing IP address/hostname</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
+        <source>You didn't specify an IP address or hostname for the computer!</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>classroomManager</name>
+    <name>Config</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Hallinta</translation>
+        <source>Interval between updates</source>
+        <translation type="unfinished">Näytön päivitysväli</translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Käytä tätä näkymää tietokoneiden ja luokkahuoneiden hallintaan.</translation>
+        <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 network-traffic and lower CPU-usage on this computer.</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;">Tällä määrittelet koneiden näyttöjen päivitysvälin. Suurempi arvo vähentää verkkoliikennettä ja vähentää tietokoneen kuormaa.</p></body></html></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>Tällä hallitset tietokoneita ja luokkahuoneita. Voit lisätä uusia koneita tai luokkahuoneita painamalla hiiren oikeaa näppäintä listassa.</translation>
+        <source> seconds</source>
+        <translation type="unfinished"> sekuntia</translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Luokkahuoneet/koneet</translation>
+        <source>User interface</source>
+        <translation type="unfinished">Käyttöliittymä</translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>IP-osoite</translation>
+        <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></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Vie tekstitiedostoksi</translation>
+        <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 mouse-cursor over 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;">Valitse tämä jos opastetekstit häiritsevät hiiren osoittimen osuessa työkalupalkkiin.</p></body></html></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Piilota opettajan koneet</translation>
+        <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></html></translation>
+    </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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Jotkut asetukset eivät vaikuta ennen kuin käynnistät iTALC:n uudestaan.</span></p></body></html></translation>
+    </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>No configuration-file found</source>
-        <translation>Asetustiedostoa ei löytynyt</translation>
+        <source>Desktop capturing</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>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>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Virhe asetustiedostossa</translation>
+        <source>Poll full screen</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>Virhe asetustiedostossa %1.
-Ole hyvä ja korjaa se. Vaihtoehtoisesta voit poistaa tiedoston ja luoda uudestaan luokkahuoneet ja tietokoneet.</translation>
+        <source>Low accuracy (turbo mode)</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>Virhe asetustiedossa %1.
-Ole hyvä ja korjaa se. Vaihtoehtoisesti voit poistaa tiedoston.</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Tallenna tiedostoksi</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Tekstitiedostot (*.txt)</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Toiminnot</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Näytä/piilota</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Muokkaa asetuksia</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Poista</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Suorita %1:lle</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Näytä kaikki luokkahuoneen koneet</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Piilota kaikki luokkahuoneen koneet</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Kuvaruutukopiot</translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Muokkaa nimeä</translation>
+        <source>Authentication methods</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Poista luokkahuone</translation>
+        <source>Access key management</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Lisää tietokone</translation>
+        <source>Logon settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Lisää luokkahuone</translation>
+        <source>&File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Nimeä luokkahuone</translation>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Kirjoita luokkahuoneen "%1" uusi nimi.</translation>
+        <source>&Quit</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>Haluatko varmasti poistaa luokkahuoneen "%1"?
-Samalla poistuvat kaikki luokkahuoneen sisältämät tietokoneet!</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Luokkahuone puuttuu</translation>
+        <source>&Save settings into file</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>Sinun tulee luoda vähintään yksi luokkahuone ennen tietokoneiden lisäämistä.
-Haluatko luoda uuden luokkahuoneen?</translation>
+        <source>Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Uusi luokkahuone</translation>
+        <source>Ctrl+S</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Kirjoita uuden luokkahuoneen nimi.</translation>
+        <source>L&oad settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Käyttäjänimet</translation>
+        <source>Ctrl+O</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Näytä kayttäjänimet</translation>
+        <source>About iTALC</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>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>
+        <source>About Qt</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Käytä ponnahdusvalikkoa (hiiren oikea näppäin) lisätäksesi tai poistaaksesi luokkahuoneita ja tietokoneita.</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for selected</source>
+        <source>toolBar</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Tuntematon tila</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Ei käyttäjää</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Ei yhteyttä koneeseen</translation>
+        <source>Load settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Esitys käynnissä</translation>
+        <source>XML files (*.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Työpöytä lukittu</translation>
+        <source>Save settings to file</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">Haluatko varmasti kirjata käyttäjät ulos kaikilta näkyviltä tietokoneilta?</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
+        <source>There are unsaved settings. Quit anyway?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
+        <source>Configuration not writable</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>
+        <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>Are you sure want to reboot all selected computers?</source>
+        <source>All settings were applied successfully.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Uudelleenkäynnistä tietokoneet</translation>
+        <source>An error occured while applying settings!</source>
+        <translation type="unfinished"></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>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
+        <source>No write access</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Tietoja</translation>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished">Esitys koko näytöllä</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Luokkahuone</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Esitys ikkunassa</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Vaihda luokkahuonetta</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Lukitse</translation>
+        <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>View live</source>
-        <translation type="unfinished">Avaa näkymä</translation>
+        <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>Remote control</source>
-        <translation type="unfinished"></translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Yleisnäkymä</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Oppilaan esitys</translation>
+        <source>Overview</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Lähteä viesti</translation>
+        <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>Logon user</source>
-        <translation type="unfinished">Kirjaudu</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Esitys koko näytöllä</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished"></translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished">Esitys koko näytöllä</translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Ota kuvaruutukopio</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished">Lopeta esitys</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Käynnistä</translation>
+        <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>Reboot</source>
-        <translation type="unfinished">Uudelleenkäynnistä tietokone</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Esitys ikkunassa</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Sammuta</translation>
+        <source>Window Demo</source>
+        <translation type="unfinished">Esitys ikkunassa</translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Suorita komento</translation>
+        <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>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Tietokoneen asetukset</translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">Lukitse/vapauta työtilat</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Tietokoneen asetukset</span></p></body></html></translation>
+        <source>Lock all</source>
+        <translation type="unfinished">Lukitse kaikki</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Yleistä</translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">Vapauta kaikki</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Konetyyppi</translation>
+        <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>Student computer</source>
-        <translation>Oppilaan kone</translation>
+        <source>Send text message</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher computer</source>
-        <translation>Opettajan kone</translation>
+        <source>Text message</source>
+        <translation type="unfinished">Viesti</translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Muu/määrittelemätön kone</translation>
+        <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>Classroom</source>
-        <translation>Luokkahuone</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">Käynnistä tietokone</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>MAC-osoite</translation>
+        <source>Power on</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 ':' for specifying an optional port-number)</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;">Kirjoita koneen verkkonimi tai IP-osoite (käytä ':' jos haluat määrittää erikoisen portin)</p></body></html></translation>
+        <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>IP/hostname</source>
-        <translation>IP/verkkonimi</translation>
+        <source>Power down computers</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></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;">Tietokoneen verkkokortin MAC-osoite - tarvitaan vain koneen etäkäynnistykseen</p></body></html></translation>
+        <source>Power down</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Nimi</translation>
+        <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>VPN</source>
-        <translation>VPN</translation>
+        <source>Support</source>
+        <translation type="unfinished">Tukitoiminto</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Yhteys</translation>
+        <source>Direct support</source>
+        <translation type="unfinished">Etätuki koneelle</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;">connection to hosts on the same level</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Adjust/align</source>
+        <translation type="unfinished">Sovita</translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation>Modeemi</translation>
+        <source>Adjust windows and their size</source>
+        <translation type="unfinished">Sovita ikkunat</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <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>100 MBit/s LAN</source>
-        <translation>100 MBit/s verkko</translation>
+        <source>Auto view</source>
+        <translation type="unfinished">Järjestä</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s verkko</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished">Järjestä ja sovita ikkunat</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 if the host is the gateway for the subnet.</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <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>Host is &gateway for subnet</source>
-        <translation>Kone on &aliverkon yhdyskäytävä</translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished">iTALC</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;">Activate this option for at least one host in a subnet.</p></body></html></source>
+        <source>Remote control</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</p></body></html></source>
+        <source>Could not modify the autostart property for the iTALC Service.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Toimii &kuvaruutujaon toistimena</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>&Kumoa</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <source>Enable desktop switching for screen lock (experimental)</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></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;">Vaihtoehtoinen nimi koneelle iTALC:ssa.</p></body></html></translation>
+        <source>Log to standard error output</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>IP-osoite/verkkonimi puuttuu</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Sinun tulee määrittää tietokoneen verkkonimi tai IP-osoite!</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Virheellinen MAC-osoite</translation>
+        <source>VNC reflector</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>Annoit virheellisen MAC-osoitteen. Jätä kenttä tyhjäksi tai kirjoita oikea MAC-osoite (muotoa 12:34:56:78:9A:BC).</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Suorita komento etänä</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Syötä suoritettava komento:</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Kumoa</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Suorita!</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Näytön päivitysväli</translation>
+        <source>Key file authentication</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 network-traffic and lower CPU-usage on this computer.</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;">Tällä määrittelet koneiden näyttöjen päivitysvälin. Suurempi arvo vähentää verkkoliikennettä ja vähentää tietokoneen kuormaa.</p></body></html></translation>
+        <source>ACL-based logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 sekunti</translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> sekuntia</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Kuvaruudun laatu</translation>
+        <source>Launch key file assistant</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">Tällä voit määritellä käytettävän näytön jaon laadun. Matalampi laatutaso kuluttaa vähemmän koneiden tehoa ja verkkoliikennettä, parempi laatu saattaa hidastaa konettasi ja näyttöjen päivitystä. Sinun tulee kokeilla mikä on sopivin arvo.</p></body></html></translation>
+        <source>Manage permissions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Matala (15 bittiä)</translation>
+        <source>Test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Keski (18 bittiä)</translation>
+        <source>Access confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Korkea (Truecolor)</translation>
+        <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>User interface</source>
-        <translation>Käyttöliittymä</translation>
+        <source>Logon authentication</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></translation>
+        <source>Allow same user to access desktop without confirmation</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 mouse-cursor over 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;">Valitse tämä jos opastetekstit häiritsevät hiiren osoittimen osuessa työkalupalkkiin.</p></body></html></translation>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Ei opastetekstejä</translation>
+        <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>Your role (needs according keys!)</source>
-        <translation>Roolisi (tarvitset kyseisen avaimen!)</translation>
+        <source>1)</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><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>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Opettaja</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Ylläpitäjä</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Tuki</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Muu</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
+        <source>4)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Toimialue</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Ikkunan kaksoispainallus</translation>
+        <source>Generate bug report archive</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><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>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Etähallitse</translation>
+        <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>View live in fullscreen</source>
-        <translation>Avaa näkymä</translation>
+        <source>Restart iTALC Service</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Jotkut asetukset eivät vaikuta ennen kuin käynnistät iTALC:n uudestaan.</span></p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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;">Piilota painikkeiden tekstit työkalupalkissa</p></body></html></translation>
+        <source>Starting iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Piilota työkalupalkin tekstit</translation>
+        <source>Stopping iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>iTALC-asetukset</translation>
+        <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>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>Tässä tilassa voit muokata iTALC:a mieleiseksesi.</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC esitys</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
-        <translation>ISD-palvelimen virhe</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>ISD-palvelinta ei voitu käynnistää koska portti %1 on jo käytössä. Tarkista, ettei mikään muu sovellus käytä porttia ja kokeile uudestaan.</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Salli pääsy</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Joku koneelta %1 yrittää päästä näkemään kuvaruutusi. Haluatko sallia sen?</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Ei koskaan tälle istunnolle</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Aina tälle istunnolle</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>Viesti opettajalta</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Autentikointivirhe</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Joku (IP: %1) yritti päästä näkemään kuvaruutusi, mutta ei onnistunut autentikoimaan itseään!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Kuvaruutukopio</translation>
+        <source>Could not contact iTALC service</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>Kuvaruutukopion ottaminen epäonnistui, koska hakemistoa %1 ei ole olemassa eikä sitä pystytty luomaan.</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>Lukitse</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Viesti opettajalta</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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">
+        <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>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>
+        <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>Luokkahuoneiden hallinnassa kontrolloit eri luokkahuoneita ja tietokoneita. Siinä näet myös käyttäjät, jotka ovat kirjautuneina koneille.</translation>
+        <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>Kuvaruutukopioiden hallinta on hyvin hyödyllinen työkalu. Sillä hallitset ottamiasi kuvaruutukopioita.</translation>
+        <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>Tässä tilassa voit muokata iTALC:a mieleiseksesi.</translation>
+        <translation type="unfinished">Tässä tilassa voit muokata iTALC:a mieleiseksesi.</translation>
     </message>
     <message>
         <source>About iTALC</source>
-        <translation>Tietoja iTALC:sta</translation>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Tietoja</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Perustietoja iTALC:sta ja sen käytöstä.</translation>
+        <translation type="unfinished">Perustietoja iTALC:sta ja sen käytöstä.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation type="unfinished">Käyttäjätunnus</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation type="unfinished">Salasana</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Uudet tai ulkopuolelta tuotavat avaintiedostot tulee asentaa jonnekin. On suositeltavaa käyttää oletushakemistoja.</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>ICA %1 portissa %2:%3</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Hakemisto julkiselle avaimelle</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Rekisteröityminen palveluun '%1' epäonnistui.</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation>Hakemisto salaiselle avaimelle</translation>
+        <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>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Palvelu '%1' on jo rekisteröity.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Vie myös salainen avain</translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Palvelua '%1' ei voitu rekisteröidä.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Palvelu '%1' rekisteröity onnistuneesti.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Palvelua '%1' ei voitu pysäyttää.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Palvelu '%1' poistettu.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Tuo opettajan koneen julkinen avain</translation>
+        <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>Choose location of exported public key:</source>
-        <translation>Valitse mihin julkinen avain viedään:</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Palvelua '%1' ei voitu poistaa.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Säilytä aiemmat avaimet (vain päivityksen yhteydessä!)</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Palvelua '%1' ei löydy.</translation>
     </message>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
+        <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>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Etänäkymä (%1 koneella %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Etähallinta (%1 koneella %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation>tuntematon käyttäjä</translation>
+        <translation type="unfinished">tuntematon käyttäjä</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation>Etänäkymä</translation>
+        <translation type="unfinished">Etänäkymä</translation>
     </message>
     <message>
         <source>Remote control</source>
-        <translation>Etähallinta</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Lock student</source>
-        <translation>Lukitse</translation>
+        <translation type="unfinished">Lukitse</translation>
     </message>
     <message>
         <source>Unlock student</source>
-        <translation>Vapauta</translation>
+        <translation type="unfinished">Vapauta</translation>
     </message>
     <message>
         <source>Snapshot</source>
-        <translation>Ota kuvaruutukopio</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Fullscreen</source>
-        <translation>Koko ruutu</translation>
+        <translation type="unfinished">Koko ruutu</translation>
     </message>
     <message>
         <source>Window</source>
-        <translation>Ikkunoitu</translation>
+        <translation type="unfinished">Ikkunoitu</translation>
     </message>
     <message>
         <source>Quit</source>
-        <translation>Poistu</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Connecting %1</source>
-        <translation>Muodostaa yhteyttä %1</translation>
+        <translation type="unfinished">Muodostaa yhteyttä %1</translation>
     </message>
     <message>
         <source>Connected.</source>
-        <translation>Yhteys muodostettu.</translation>
+        <translation type="unfinished">Yhteys muodostettu.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
+    <name>RemoteLogonDialog</name>
     <message>
-        <source>Remote Logon</source>
-        <translation>Kirjaudu</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Kirjaudu koneelle</span></p></body></html></translation>
+        <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>Täytä käyttäjätunnus ja salasana sekä tarvittaessa toimialue kirjautuksesi valitsemillesi koneille.</translation>
+        <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>Käyttäjätunnus</translation>
+        <translation type="unfinished">Käyttäjätunnus</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>Salasana</translation>
+        <translation type="unfinished">Salasana</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation>Toimialue</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Kumoa</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <translation type="unfinished">Toimialue</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Kirjoita päälle</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Haluatko kirjoittaa tiedoston %1 päälle?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Keskeytä asennus</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Jatka</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Valmis</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Lopeta</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Hakemisto julkiselle avaimelle</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Hakemisto salaiselle avaimelle</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Hakemisto julkisen avaimen vientiin</translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
+        <source>Snapshot</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>Kuvaruutukopiot</translation>
+        <translation type="unfinished">Kuvaruutukopiot</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Hallitse ottamiasi kuvaruutukopioita.</translation>
+        <translation type="unfinished">Hallitse ottamiasi kuvaruutukopioita.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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">
+        <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>Käyttäjä:</translation>
+        <translation type="unfinished">Käyttäjä:</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation>Tietokone:</translation>
+        <translation type="unfinished">Tietokone:</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation>Pvm:</translation>
+        <translation type="unfinished">Pvm:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>Aika:</translation>
-    </message>
-    <message>
-        <source>Show snapshot</source>
-        <translation>Näytä kuva</translation>
+        <translation type="unfinished">Aika:</translation>
     </message>
     <message>
-        <source>Delete snapshot</source>
-        <translation>Tuhoa kuva</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Päivitä luettelo</translation>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation>Tukitoiminto</translation>
+        <translation type="unfinished">Tukitoiminto</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Anna vieraan koneen verkkonimi tai IP-osoite, joka tarvitsee tukeasi.</translation>
+        <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>OK</source>
-        <translation>OK</translation>
+        <source>Send text message</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Kumoa</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Etätuki </span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Luodaan yhteyttä %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Lähteä viesti</translation>
+        <source>Overview</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>Kirjoita viesti alla olevaan kentään. Viesti lähetetään kaikille valituille koneille.</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Esitys koko näytöllä</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Esitys ikkunassa</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">Lukitse</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Kumoa</translation>
+        <source>View live</source>
+        <translation type="unfinished">Avaa näkymä</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Remote control</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Lähetä viesti</span></p></body></html></translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">Oppilaan esitys</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Luodaan yhteyttä %1 ...</translation>
+        <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>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
+        <source>Power on</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Kumoa</translation>
+        <source>Reboot</source>
+        <translation type="unfinished">Uudelleenkäynnistä tietokone</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Edellinen</translation>
+        <source>Power down</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Seuraava</translation>
+        <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
index 263db86..d7b7e72 100644
Binary files a/lib/resources/fr.qm and b/lib/resources/fr.qm differ
diff --git a/lib/resources/fr.ts b/lib/resources/fr.ts
index 92fc493..4486b40 100644
--- a/lib/resources/fr.ts
+++ b/lib/resources/fr.ts
@@ -1,1439 +1,1769 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.0" language="fr_FR">
+<TS version="2.0">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
     <message>
-        <source>Actions</source>
-        <translation type="unfinished">Actions</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">À propos d'iTALC</translation>
+    </message>
+    <message>
+        <source>About</source>
+        <translation type="unfinished">À propos</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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">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-2011 Tobias Doerffel / iTALC Solutions</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>MainWindow</name>
+    <name>AccessDialogSlave</name>
     <message>
-        <source>MainWindow</source>
+        <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>toolBar</source>
+        <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>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>Classroom-Manager</source>
+        <translation type="unfinished">Gestionnaire de salle</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Pas d'accès en écriture</translation>
+        <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>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>
+        <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>Classroom</source>
-        <translation type="unfinished">Salle</translation>
+        <source>Classrooms/computers</source>
+        <translation type="unfinished">Salles/ordinateurs</translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Changer de salle 
-</translation>
+        <source>IP-address</source>
+        <translation type="unfinished">Adresse IP</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>
+        <source>Usernames</source>
+        <translation type="unfinished">Noms</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>
+        <source>Show usernames</source>
+        <translation type="unfinished">Afficher les noms d'utilisateurs</translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Mode aperçu</translation>
+        <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>Overview</source>
-        <translation type="unfinished">Aperçu</translation>
+        <source>Export to text-file</source>
+        <translation type="unfinished">Export�fichier texte</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émonstration.</translation>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished">Démonstration plein écran</translation>
+        <source>Hide teacher computers</source>
+        <translation type="unfinished">Cacher les ordinateurs des professeurs</translation>
     </message>
     <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Démonstration plein écran</translation>
+        <source>Show/hide</source>
+        <translation type="unfinished">Afficher/cacher</translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Arrêter la démonstration</translation>
+        <source>Edit settings</source>
+        <translation type="unfinished">Modifier les réglages</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>
+        <source>Remove</source>
+        <translation type="unfinished">Supprimer</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Démonstration en mode fenêtre</translation>
+        <source>Show all computers in classroom</source>
+        <translation type="unfinished">Afficher tous les ordinateurs de cette salle</translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Démonstration en mode fenêtre</translation>
+        <source>Hide all computers in classroom</source>
+        <translation type="unfinished">Cacher tous les ordinateurs de cette salle</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>
+        <source>Edit name</source>
+        <translation type="unfinished">Modifier le nom </translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">(Dé-)verrouiller les bureaux</translation>
+        <source>Remove classroom</source>
+        <translation type="unfinished">Supprimer la salle </translation>
     </message>
     <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Tout verrouiller</translation>
+        <source>Add computer</source>
+        <translation type="unfinished">Ajouter un ordinateur</translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Tout déverrouiller</translation>
+        <source>Add classroom</source>
+        <translation type="unfinished">Ajouter une salle</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>
+        <source>No configuration-file found</source>
+        <translation type="unfinished">Aucun fichier de configuration trouvé</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Envoyer un message</translation>
+        <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>Text message</source>
-        <translation type="unfinished">Message texte</translation>
+        <source>Error in configuration-file</source>
+        <translation type="unfinished">Erreur dans le fichier de configuration
+</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>
+        <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>Power on computers</source>
-        <translation type="unfinished">Démarrer les ordinateurs</translation>
+        <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>Power on</source>
-        <translation type="unfinished">Allumer</translation>
+        <source>Select output-file</source>
+        <translation type="unfinished">Choisir le fichier de sortie</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>
+        <source>Text files (*.txt)</source>
+        <translation type="unfinished">Fichiers texte (*.txt)</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Éteindre les ordinateurs</translation>
+        <source>Actions for selected</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Éteindre</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Actions</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>
+        <source>Actions for %1</source>
+        <translation type="unfinished">Actions pour %1</translation>
     </message>
     <message>
-        <source>Logon</source>
-        <translation type="unfinished">Connexion</translation>
+        <source>New name for classroom</source>
+        <translation type="unfinished">Nouveau nom pour la salle</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Connexion distante</translation>
+        <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>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Ce bouton vous permet d'entrer un nom d'utilisateur et un mot de passe pour vous connecter sur tous les ordinateurs visibles.</translation>
+        <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>Support</source>
-        <translation type="unfinished">Assistance</translation>
+        <source>Missing classroom</source>
+        <translation type="unfinished">Salle manquante</translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Assistance directe</translation>
+        <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>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>
+        <source>New classroom</source>
+        <translation type="unfinished">Nouvelle salle</translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Ajuster/aligner</translation>
+        <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>Adjust windows and their size</source>
-        <translation type="unfinished">Ajuster les fenêtres et leur taille</translation>
+        <source>Unknown state</source>
+        <translation type="unfinished">État inconnu</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>
+        <source>No user logged in</source>
+        <translation type="unfinished">Aucun utilisateur connecté</translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Auto-vue</translation>
+        <source>Host unreachable</source>
+        <translation type="unfinished">Hôte impossible à atteindre</translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Réordonne automatiquement les fenêtres</translation>
+        <source>Demo running</source>
+        <translation type="unfinished">Démo en cours</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 leur taille est ajustée.</translation>
+        <source>Desktop locked</source>
+        <translation type="unfinished">Bureau verrouillé</translation>
     </message>
+</context>
+<context>
+    <name>ClientAction</name>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Aucune clé valide trouvée</translation>
+        <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>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Aucune clé d'authentification n'a été trouvée, ou bien vos anciennes clés sont cassées. 
-Veuillez créer une nouvelle paire de clés à l'aide d'ICA (documentation à http://italc.sf.net/wiki/index.php?title=Installation), sans quoi vous ne pourrez pas accéder aux ordinateurs utilisant iTALC.
-</translation>
+        <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>iTALC service not running</source>
-        <translation type="unfinished">Le service iTALC ne s'exécute pas</translation>
+        <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>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Il semble qu'aucun service iTALC ne s'exécute sur cet ordinateur, ou bien les clefs d'authentification font défaut. Ce service est nécessaire pour lancer iTALC. Contactez votre administrateur pour régler ce problème.</translation>
+        <source>Are you sure want to reboot all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">Contrôleur Maître d'iTALC</translation>
+        <source>Reboot computers</source>
+        <translation type="unfinished">Redémarrer les ordinateurs</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Contrôle à distance</translation>
+        <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>Quit</source>
-        <translation type="unfinished">Quitter</translation>
+        <source>Are you sure want to power down all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>QApplication</name>
+    <name>ClientSettingsDialog</name>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Impossible d'enregistrer le service '%1'.</translation>
+        <source>Invalid MAC-address</source>
+        <translation type="unfinished">Adresse MAC invalide</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>
+        <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>The service '%1' is already registered.</source>
-        <translation>Le service '%1' est déjà enregistré.</translation>
+        <source>Client settings</source>
+        <translation type="unfinished">Réglages client</translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Le service '%1' n'a pas pu être enregistré.</translation>
+        <source>IP/hostname</source>
+        <translation type="unfinished">IP/nom d'hôte</translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Le service '%1' a bien été enregistré.</translation>
+        <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 ':' for specifying an optional port-number)</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;">Entrez une adresse IP ou un nom d'hôte pour le client (utilisez un : pour préciser un numéro de port optionnel)</p></body></html></translation>
     </message>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Le service '%1' ne peut pas être arrêté.</translation>
+        <source>Name</source>
+        <translation type="unfinished">Nom</translation>
     </message>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Le service '%1' a été désactivé.</translation>
+        <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></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;">Surnom optionnel de l'hôte affiché dans iTALC.</p></body></html></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ésactivé.</translation>
+        <source>MAC address</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Le service '%1' ne peut pas être désactivé.</translation>
+        <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></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;">Adresse MAC du client  - utilisée seulement pour l'arrêt de la machine</p></body></html></translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Le service '%1' est introuvable.</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Salle</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ésactivé.</translation>
+        <source>Type</source>
+        <translation type="unfinished">Type</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>
+        <source>Student computer</source>
+        <translation type="unfinished">Ordinateur étudiant</translation>
     </message>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Client iTALC %1 sur %2:%3</translation>
+        <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>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>NML (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</translation>
+        <source>Missing IP address/hostname</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>Captures iTALC</translation>
+        <source>You didn't specify an IP address or hostname for the computer!</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>about</name>
+    <name>Config</name>
     <message>
-        <source>About iTALC</source>
-        <translation>À propos d'iTALC</translation>
+        <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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">À propos d'iTALC</span></p></body></html></translation>
+        <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 network-traffic and lower CPU-usage on this computer.</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;">Vous réglez ici l'intervalle de temps entre les mises à jour des clients. Plus la valeur est élevée, plus le trafic réseau et l'occupation du processeur sont réduits.</p></body></html></translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>À propos</translation>
+        <source> seconds</source>
+        <translation type="unfinished"> secondes</translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Auteurs</translation>
+        <source>User interface</source>
+        <translation type="unfinished">Interface utilisateur</translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Traduction </translation>
+        <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'outils</p></body></html></translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Licence</translation>
+        <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 mouse-cursor over 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;">Cochez cette option si vous voulez supprimer les infobulles qui apparaissent quand la souris passe sur les boutons de la barre d'outils.</p></body></html></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>No balloon-tooltips</source>
+        <translation type="unfinished">Pas d'infobulles</translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
+        <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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Attention, certains changements ne prendront effet qu'au prochain démarrage d'iTALC.</span></p></body></html></translation>
+    </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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
+        <source>Nothing</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Gestionnaire de salles</translation>
+        <source>Only critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Utilisez cet espace pour gérer facilement vos ordinateurs et vos salles.</translation>
+        <source>Errors and critical messages</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>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>
+        <source>Warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Salles/ordinateurs</translation>
+        <source>Information, warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>Adresse IP</translation>
+        <source>Debug messages and everything else</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Aucun fichier de configuration trouvé</translation>
+        <source>Limit log file size</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>Impossible d'ouvrir le fichier de configuration %1. 
-Vous devez ajouter au moins une salle et un ordinateur, en utilisant le gestionnaire de salles dans la barre latérale gauche.</translation>
+        <source>MB</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Erreur dans le fichier de configuration</translation>
+        <source>Clear all log files</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>Erreur pendant la lecture du fichier de configuration %1. 
-Veuillez le modifier, ou bien supprimer le fichier puis re-créer les salles et les ordinateurs.</translation>
+        <source>Desktop capturing</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>Erreur pendant la lecture du fichier de configuration %1. 
-Veuillez le modifier ou le supprimer.</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Afficher/cacher</translation>
+        <source>Poll full screen</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Modifier les réglages</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Supprimer</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Actions</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Afficher tous les ordinateurs de cette salle</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Cacher tous les ordinateurs de cette salle</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Modifier le nom </translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Supprimer la salle </translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Actions pour %1</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Ajouter un ordinateur</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Ajouter une salle</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Nouveau nom pour la salle</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Captures</translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Veuillez entrer un nouveau nom pour la salle "%1".</translation>
+        <source>Authentication methods</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>Voulez-vous vraiment supprimer la salle "%1" ? 
-Tous les ordinateurs lui appartenant seront supprimés également !</translation>
+        <source>Access key management</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Salle manquante</translation>
+        <source>Logon settings</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>Avant d'ajouter des ordinateurs, vous devez créer au moins une salle. 
-Voulez-vous en créer une maintenant ?</translation>
+        <source>&File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Nouvelle salle</translation>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Veuillez entrer le nom de la salle que vous voulez créer.</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Cacher les ordinateurs des professeurs</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Noms</translation>
+        <source>&Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Afficher les noms d'utilisateur</translation>
+        <source>Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Utilisez le menu contextuel (bouton droit) pour ajouter/enlever des ordinateurs et/ou des salles.</translation>
+        <source>Ctrl+S</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Exporter en fichier texte</translation>
+        <source>L&oad settings from 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>Utilisez ce bouton pour exporter cette liste d'ordinateurs et de noms d'utilisateurs dans un fichier texte. 
-Vous pourrez ensuite utiliser ce fichier pour collecter des fichiers à la fin d'un examen. C'est parfois nécessaire, car certains étudiants peuvent terminer et se déconnecter en avance, ce qui vous empêche de recueillir leurs fichiers.</translation>
+        <source>Ctrl+O</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Choisir le fichier de sortie</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">À propos d'iTALC</translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Fichiers texte (*.txt)</translation>
+        <source>About Qt</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation>Actions sur la sélection</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>État inconnu</translation>
+        <source>toolBar</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Aucun utilisateur connecté</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Hôte impossible à atteindre</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Démonstration en cours</translation>
+        <source>Load settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Bureau verrouillé</translation>
+        <source>XML files (*.xml)</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>Voulez-vous vraiment déconnecter tous les utilisateurs de tous les ordinateurs visibles ?</translation>
+        <source>Save settings to file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Voulez-vous vraiment déconnecter les utilisateurs des ordinateurs sélectionnés ?</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Déconnecter l'utilisateur</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Voulez-vous vraiment redémarrer tous les ordinateurs visibles ?</translation>
+        <source>Configuration not writable</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Voulez-vous vraiment redémarrer tous les ordinateurs sélectionnés ?</translation>
+        <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>Reboot computers</source>
-        <translation>Redémarrer les ordinateurs</translation>
+        <source>All settings were applied successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Voulez-vous vraiment éteindre tous les ordinateurs visibiles ?</translation>
+        <source>An error occured while applying settings!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Voulez-vous vraiment éteindre tous les ordinateurs sélectionnés ?</translation>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation>Aperçu</translation>
+        <source>No write access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation>Démonstration plein écran</translation>
+        <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>Window demo</source>
-        <translation>Démonstration en mode fenêtre</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Salle</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation>Affichage verrouillé</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Changer de salle 
+</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation>Voir en direct</translation>
+        <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>Remote control</source>
-        <translation>Contrôle à distance</translation>
+        <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>Let student show demo</source>
-        <translation>Laisser l'étudiant faire une démonstration</translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Mode aperçu</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation>Envoyer un message</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Aperçu</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation>Connecter l'utilisateur</translation>
+        <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>Logout user</source>
-        <translation>Déconnecter l'utilisateur</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Démo plein écran</translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation>Prendre une capture</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished">Démo plein écran</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation>Allumer</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished">Arrêter la démo</translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation>Redémarrer</translation>
+        <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>Power down</source>
-        <translation>Éteindre</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Démo fenêtre</translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation>Exécuter des commandes</translation>
+        <source>Window Demo</source>
+        <translation type="unfinished">Démo fenêtre</translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Réglages client</translation>
+        <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>General</source>
-        <translation>Général</translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">(Dé-)verrouiller les bureaux</translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Nom</translation>
+        <source>Lock all</source>
+        <translation type="unfinished">Tout verrouiller</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></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;">Adresse MAC du client (utilisée seulement pour l'arrêt de la machine)</p></body></html></translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">Tout déverrouiller</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>IP/nom d'hôte</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specifying an optional port-number)</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;">Entrez une adresse IP ou un nom d'hôte pour le client (utilisez un : pour préciser un numéro de port optionnel)</p></body></html></translation>
+        <source>Send text message</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>Adresse MAC</translation>
+        <source>Text message</source>
+        <translation type="unfinished">Message texte</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation>Salle</translation>
+        <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>VPN</source>
-        <translation>VPN</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">Démarrer les ordinateurs</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Connexion</translation>
+        <source>Power on</source>
+        <translation type="unfinished">Allumer</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;">connection to hosts on the same level</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;">Connexion aux hôtes de même niveau</p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;"> 
-Vous pouvez préciser ici comment cet hôte est connecté au réseau iTALC, c-à-d les hôtes de même niveau. 
-Habituellement, les hôtes sont connectés sur un LAN 100MBits/s, mais il peut y avoir des hôtes spéciaux, comme des passerelles vers d'autres réseaux iTALC ou l'ordinateur personnel d'un utilisateur. Dans ce genre de cas, iTALC essaie d'optimiser la bande passante.</p></body></html></translation>
+        <source>Power down computers</source>
+        <translation type="unfinished">Éteindre les ordinateurs</translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation>Analogique</translation>
+        <source>Power down</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>RNIS</translation>
+        <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>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <source>Support</source>
+        <translation type="unfinished">Assistance</translation>
     </message>
     <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <source>Direct support</source>
+        <translation type="unfinished">Assistance directe</translation>
     </message>
     <message>
-        <source>100 MBit/s LAN</source>
-        <translation>LAN 100 MBit/s</translation>
+        <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>1000 MBit/s LAN</source>
-        <translation>LAN 1000 MBit/s</translation>
+        <source>Adjust/align</source>
+        <translation type="unfinished">Ajuster/aligner</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 if the host is the gateway for the subnet.</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;">Cocher si l'hôte est la passerelle du sous-réseau.</p></body></html></translation>
+        <source>Adjust windows and their size</source>
+        <translation type="unfinished">Ajuster les fenêtres et leurs tailles</translation>
     </message>
     <message>
-        <source>Host is &gateway for subnet</source>
-        <translation>L'hôte est la &passerelle du sous-réseau</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Activate this option for at least one host in a subnet.</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;">Activer cette option pour au moins un hôte dans un sous-réseau.</p></body></html></translation>
+        <source>Auto view</source>
+        <translation type="unfinished">Auto-vue</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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;">Si vous diffusez une démo vers plus d'un hôte sur un même réseau distant, il vaut mieux activer cette option sur au moins l'un des hôtes cibles. Il jouera le rôle de réplicateur, et toutes les données ne seront envoyées qu'une fois, économisant de la bande passante. Sur les liaisons lentes, cette option est indispensable. Normalement, vous devriez l'activer sur la passerelle de sous-réseau (voir l'option ci-dessus).</p></body></html></translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished">Réordonne automatiquement les fenêtres</translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Servir de &réplicateur de démo</translation>
+        <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>&OK</source>
-        <translation>&OK</translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>&Abandonner</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Contrôle à distance</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Réglages client</span></p></body></html></translation>
+        <source>Could not modify the autostart property for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Type</translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Ordinateur étudiant</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher computer</source>
-        <translation>Ordinateur professeur</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Ordinateur autre/indéfini</translation>
+        <source>Enable desktop switching for screen lock (experimental)</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></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;">Surnom optionnel de l'hôte affiché dans iTALC.</p></body></html></translation>
+        <source>Log to standard error output</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Adresse IP ou nom d'hôte manquant</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Vous n'avez donné ni adresse IP ni nom d'hôte pour l'ordinateur !</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Adresse MAC invalide</translation>
+        <source>VNC reflector</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>Vous avez entré une adresse MAC invalide. Laissez le champ vide ou entrez une adresse valide (séparateur = ":").</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Cancel</source>
-        <translation>Abandonner</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Lancer les commandes sur le(s) client(s)</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Entrez les commandes à exécuter sur le(s) client(s) :</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Exécuter !</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Intervalle entre les mises à jour</translation>
+        <source>Key file authentication</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 network-traffic and lower CPU-usage on this computer.</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;">Vous réglez ici l'intervalle de temps entre les mises à jour des clients. Plus la valeur est élevée, plus le trafic réseau et l'occupation du processeur sont réduits.</p></body></html></translation>
+        <source>ACL-based logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 seconde</translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> secondes</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User interface</source>
-        <translation>Interface utilisateur</translation>
+        <source>Launch key file assistant</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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'outils</p></body></html></translation>
+        <source>Manage permissions</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 mouse-cursor over 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;">Cochez cette option si vous voulez supprimer les infobulles qui apparaissent quand la souris passe sur les boutons de la barre d'outils.</p></body></html></translation>
+        <source>Test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Pas d'infobulles</translation>
+        <source>Access confirmation</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Attention, certains changements ne prendront effet qu'au prochain démarrage d'iTALC.</span></p></body></html></translation>
+        <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><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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">Réglez ici la qualité d'affichage en mode démo. Une qualité plus basse réduit la bande passante réseau utilisée, ainsi que la consommation CPU, alors qu'une qualité plus grande peut ralentir votre ordinateur et réduire la vitesse de rafraîchissement de la démo. Vous devez expérimenter pour trouver les réglages optimaux pour votre configuration.</p></body></html></translation>
+        <source>Logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Basse (15 bits)</translation>
+        <source>Allow same user to access desktop without confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Moyenne (18 bits)</translation>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Haute (Truecolor)</translation>
+        <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>Your role (needs according keys!)</source>
-        <translation>Votre rôle (nécessite les clés correspondantes !)</translation>
+        <source>1)</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><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>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Professeur</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Administrateur</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Assistant</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Autre</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Qualité du mode démonstration</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Réglages pour connexion multiple</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Domaine</translation>
+        <source>Generate bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Action double-clic sur fenêtre client</translation>
+        <source>5)</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><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>
+        <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>Remote control</source>
-        <translation>Contrôle à distance</translation>
+        <source>Restart iTALC Service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>View live in fullscreen</source>
-        <translation>Voir en direct en plein écran</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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;">Ne pas montrer le texte des boutons de la barre d'outils</p></body></html></translation>
+        <source>Starting iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Pas de texte sur les boutons de la barre d'outils</translation>
+        <source>Stopping iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Votre configuration iTALC</translation>
+        <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>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>Dans cet espace, vous pouvez paramétrer iTALC en fonction de vos besoins.</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>Démonstration iTALC</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>Message from teacher</source>
-        <translation>Message du professeur</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>L'utilisateur de la machine %1 tente de consulter votre écran. Voulez-vous lui autoriser l'accès ?</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Jamais pour cette session</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Toujours pour cette session</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Confirmer l'accès</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>ISD-server error</source>
-        <translation>erreur serveur ISD</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>Le serveur ISD ne peut pas démarrer car le port %1 est déjà utilisé. Vérifier qu'aucune autre application n'utilise ce port, et recommencez.</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Erreur d'authentification</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Quelqu'un (IP %1) a essayé d'accéder à cet ordinateur, mais n'a pas réussi à s'authentifier !</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Capture</translation>
+        <source>Could not contact iTALC service</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>Impossible de prendre une capture : le répertoire %1 n'existe pas et ne peut être créé.</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>verrouillez l'écran</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Message du professeur</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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">
+        <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>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>
+        <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>L'espace Capture vous permet de gérer toutes les captures d'écran que vous avez effectuées.</translation>
+        <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>Vous pouvez bien sûr configurer iTALC. Cela se fait généralement dans l'espace Configuration.</translation>
+        <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>À propos d'iTALC</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>Avec le gestionnaire de salles, vous pouvez gérer les salles et les ordinateurs, et également voir qui est connecté.</translation>
+        <translation type="unfinished">À propos d'iTALC</translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Aperçu</translation>
+        <translation type="unfinished">Aperçu</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Quelques informations de base sur iTALC et la manière de l'utiliser.</translation>
+        <translation type="unfinished">Quelques informations de base sur iTALC et la manière de l'utiliser.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
-        <translation>iTALC est prêt à être lancé !</translation>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation>iTALC est maintenant entièrement installé et configuré. Si vous avez installé l'application maître, vous pouvez démarrer maintenant.</translation>
+        <source>Username</source>
+        <translation type="unfinished">Nom d'utilisateur</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation>Sauvegarder la configuration des clés</translation>
+        <source>Password</source>
+        <translation type="unfinished">Mot de passe</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
-        <translation>Répertoires des clés</translation>
+        <source>iTALC Logon</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Répertoire qui contiendra la clé publique d'authentification</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Impossible d'enregistrer le service '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation>Répertoire des clés privées</translation>
+        <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>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation>Choisissez un répertoire pour exporter la clé publique, par exemple une clé USB ou un partage réseau.</translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Le service '%1' est déjà enregistré.</translation>
     </message>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Les clés nouvellement créées ou importées doivent être stockées quelque part. Il est recommandé de conserver le répertoire suggéré.</translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Le service '%1' n'a pas pu être enregistré.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Exporter aussi la clé privée</translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Le service '%1' a bien été enregistré.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Choisir l'emplacement d'export de la clé publique :</translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Le service '%1' ne peut pas être arrêté.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Importer la clé publique du poste maître</translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Le service '%1' a été désenregistré.</translation>
     </message>
     <message>
-        <source>Security options</source>
-        <translation>Options de sécurité</translation>
+        <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>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation>iTALC utilise des concepts de sécurité sophistiqués pour prévenir les accès non autorisés aux ordinateurs qui ont un client iTALC installé.
-
-C'est pourquoi vous devrez créer une nouvelle paire de clés ou importer la clé publique créée lors de l'installation sur le poste maitre.</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Le service '%1' ne peut pas être désenregistré.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation>Créer une nouvelle paire de clés (seulement sur  le poste maitre)</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Le service '%1' est introuvable.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Conserver toutes les clés (seulement pour une mise à jour !)</translation>
+        <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>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation>Bienvenue dans iTALC</translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation>Cet outil vous guidera lors du processus de configuration des clés d'authentification pour votre environnement iTALC.
-
-Cliquez sur 'Suivant' pour continuer.</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidget</name>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Voir en direct (%1 sur l'hôte %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Contrôle à distance (%1 sur l'hôte %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation>utilisateur inconnu</translation>
+        <translation type="unfinished">utilisateur inconnu</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation>Voir seulement</translation>
+        <translation type="unfinished">Voir seulement</translation>
     </message>
     <message>
-        <source>Lock student</source>
-        <translation>Verrouiller l'étudiant</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Contrôle à distance</translation>
     </message>
     <message>
-        <source>Fullscreen</source>
-        <translation>Plein écran</translation>
+        <source>Lock student</source>
+        <translation type="unfinished">Verrouiller l'étudiant</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation>Quitter</translation>
+        <source>Unlock student</source>
+        <translation type="unfinished">Déverrouiller l'étudiant</translation>
     </message>
     <message>
-        <source>Connecting %1</source>
-        <translation>En cours de connexion : %1</translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Capture</translation>
     </message>
     <message>
-        <source>Connected.</source>
-        <translation>Connecté.</translation>
+        <source>Fullscreen</source>
+        <translation type="unfinished">Plein écran</translation>
     </message>
     <message>
-        <source>Snapshot</source>
-        <translation>Capture</translation>
+        <source>Window</source>
+        <translation type="unfinished">Fenêtre</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Contrôle à distance</translation>
+        <source>Quit</source>
+        <translation type="unfinished">Quitter</translation>
     </message>
     <message>
-        <source>Unlock student</source>
-        <translation>Déverrouiller l'étudiant</translation>
+        <source>Connecting %1</source>
+        <translation type="unfinished">Connexion à %1...</translation>
     </message>
     <message>
-        <source>Window</source>
-        <translation>Fenêtre</translation>
+        <source>Connected.</source>
+        <translation type="unfinished">Connecté.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Connexion distante</translation>
-    </message>
+    <name>RemoteLogonDialog</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:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Connexion distante</span></p></body></html></translation>
+        <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>Dans les champs ci-dessous, entrez le nom d'utilisateur, le mot de passe et éventuellement le nom de domaine. Ces informations seront utilisées pour la connexion à (aux) ordinateur(s).</translation>
+        <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>Nom d'utilisateur</translation>
+        <translation type="unfinished">Nom d'utilisateur</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>Mot de passe</translation>
+        <translation type="unfinished">Mot de passe</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation>Domaine</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Entrée</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Abandonner</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <translation type="unfinished">Domaine</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Abandonner l'installation</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation>Êtes-vous sûr de vouloir abandonner l'installation ? iTALC n'est pas entièrement installé !</translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Suivant</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Terminer</translation>
-    </message>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Confirmer l'écrasement</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Voulez-vous écraser le fichier %1 ?</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Quitter</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
-        <translation>Le fichier n'existe pas</translation>
+        <source>Run commands</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
-        <translation>Le fichier %1 n'a pu être trouvé. Vérifiez et recommencez.</translation>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Choisir le répertoire des clés publiques</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Choisir le répertoire des clés privées</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Choisir le répertoire d'exportation des clés publiques</translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation>Choisissez un dossier pour l'importation des clés</translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Capture</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>Captures</translation>
+        <translation type="unfinished">Captures</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Cet espace vous permet de gérer les captures que vous avez faites.</translation>
+        <translation type="unfinished">Cet espace vous permet de gérer les captures que vous avez faites.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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;">Toutes les captures que vous avez faites sont listées ci-dessous. Vous pouvez lancer une capture en sélectionnant l'entrée dans le menu contextuel d'une fenêtre cliente. Ces captures peuvent être gérées grâce aux boutons ci-dessous.</p></body></html></translation>
+        <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;">Toutes les captures que vous avez faites sont listées ci-dessous. Vous pouvez lancer une capture en sélectionnant l'entrée dans le menu contextuel d'une fenêtre cliente. Ces captures peuvent être gérées grâce aux boutons ci-dessous.</p></body></html></translation>
     </message>
     <message>
         <source>User:</source>
-        <translation>Utilisateur :</translation>
+        <translation type="unfinished">Utilisateur :</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation>Hôte :</translation>
+        <translation type="unfinished">Hôte :</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation>Date :</translation>
+        <translation type="unfinished">Date :</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>Heure :</translation>
-    </message>
-    <message>
-        <source>Show snapshot</source>
-        <translation>Affiche la capture</translation>
+        <translation type="unfinished">Heure :</translation>
     </message>
     <message>
-        <source>Delete snapshot</source>
-        <translation>Supprime la capture</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Recharge la liste</translation>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation>Assistance</translation>
+        <translation type="unfinished">Assistance</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Veuillez entrez l'adresse IP ou le nom d'hôte utilisé par la personne que vous voulez assister.</translation>
+        <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>OK</source>
-        <translation>OK</translation>
+        <source>Send text message</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Abandonner</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Assistance</span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Établissement de la connexion à %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Envoyer un message</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Aperçu</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Envoyer un message</span></p></body></html></translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Démo plein écran</translation>
     </message>
     <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Tapez votre message dans le champ ci-dessous. Il sera envoyé à tous les utilisateurs sélectionnés.</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Démo fenêtre</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">Affichage verrouillé</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Entrée</translation>
+        <source>View live</source>
+        <translation type="unfinished">Voir en direct</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Abandonner</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Contrôle à distance</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">Laisser l'étudiant faire une démo</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Connexion en cours : %1 ...</translation>
+        <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>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation>Installateur d'iTALC</translation>
+        <source>Power on</source>
+        <translation type="unfinished">Allumer</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Abandonner</translation>
+        <source>Reboot</source>
+        <translation type="unfinished">Redémarrer</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Précédent</translation>
+        <source>Power down</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Suivant</translation>
+        <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 c28bf5d..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 0edbacf..0000000
--- a/lib/resources/he.ts
+++ /dev/null
@@ -1,1463 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="he_IL" sourcelanguage="en">
-<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>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</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>Logon</source>
-        <translation type="unfinished">התחברות</translation>
-    </message>
-    <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">התחברות</translation>
-    </message>
-    <message>
-        <source>After clicking this button you can enter a username and password to log on the according user on all visible computers.</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>No valid keys found</source>
-        <translation type="unfinished">לא נמצאו מפתחות מתאימים</translation>
-    </message>
-    <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">נמצאו מפתחות לא תקינים או לא נמצאו כלל. יש ליצור זוג מפתחות תוך שימוש ב- ICA. - ניתן להיעזר במסמך 
- http://italc.sf.net/wiki/index.php?title=Installation.
-אחרת, לא ניתן יהיה לגשת למחשבים דרך התוכנה</translation>
-    </message>
-    <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">שירות התוכנה אינו פועל</translation>
-    </message>
-    <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</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>
-</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>QObject</name>
-    <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation></translation>
-    </message>
-    <message>
-        <source>iTALC-snapshots</source>
-        <translation>צילומי מסך</translation>
-    </message>
-</context>
-<context>
-    <name>about</name>
-    <message>
-        <source>About iTALC</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">אודות התוכנה</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation>אודות</translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation>יוצרים</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation>Translation</translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation>רישיון</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
-        <translation type="unfinished"></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></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>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>Logon user</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>
-<context>
-    <name>clientSettings</name>
-    <message>
-        <source>Client settings</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">הגדרות עמדת תלמיד</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>General</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>Classroom</source>
-        <translation>כיתה</translation>
-    </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;">enter an IP-address or hostname under which iTALC can reach the client (use ':' for specifying an optional port-number)</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>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;">Hardware/MAC-address of client - only used for powering on client</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;">כתובת ה- MAC - משמשת לצרכי הדלקת מחשב תלמיד בלבד</p></body></html></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></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>VPN</source>
-        <translation>VPN</translation>
-    </message>
-    <message>
-        <source>Connection</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;">connection to hosts on the same level</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;">Here you can specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">באיזור זה ניתן לפרט כיצד מחובר מחשב זה לרשת של התוכנה. בדרך כלל עמדות מחוברות דרך 100 MBit / s LAN, אבל ייתכן שיש עמדות מיוחדות כגון שערים, רשתות אחרות של התוכנה בבתי ספר אחרים או מחשבים הממוקמים בבתי תלמידים. במיקרים אלו התוכנה מבצעת אופטימיזצייה לרוחב הפס</p></body></html></translation>
-    </message>
-    <message>
-        <source>Analog</source>
-        <translation>אנלוגי</translation>
-    </message>
-    <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
-    </message>
-    <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
-    </message>
-    <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
-    </message>
-    <message>
-        <source>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
-    </message>
-    <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</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 if the host is the gateway for the subnet.</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>Host is &gateway for subnet</source>
-        <translation>המחשב הוא &השער לתת הרשת (Gateway)</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;">Activate this option for at least one host in a subnet.</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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;">חשוב להפעיל אופציה זו לפחות לאחד המחשבים כאשר מציגים הדגמה על מספר מחשבים בו זמנית. בדרך זו נשלח המידע רק פעם אחת למשכפל ההדגמה ומשם מועבר לכלל המחשבים ברשת. אופצייה זו חיונית בעיקר ברשתות איטיות. בדרך כלל יש לאפשר אופציה זו על גבי השער של תת-הרשת - Subnet Gateway - (ראה אפשרויות למעלה) </p></body></html></translation>
-    </message>
-    <message>
-        <source>Act as &demo replicator</source>
-        <translation>תפקד כ - &משכפל הדגמה</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>C&ancel</source>
-        <translation>C&ancel</translation>
-    </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
-    <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>לא נמצאו כתובת רשת או שם מחשב</translation>
-    </message>
-    <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>לא צויינו כתובת רשת או שם למחשב זה !</translation>
-    </message>
-    <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>
-</context>
-<context>
-    <name>cmdInputDialog</name>
-    <message>
-        <source>Run commands on client(s)</source>
-        <translation>בצע פקודות על העמדות</translation>
-    </message>
-    <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>הכנסו את הפקודות לביצוע על העמדות : </translation>
-    </message>
-    <message>
-        <source>&Run!</source>
-        <translation>&בצע</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>בטל</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 network-traffic and lower CPU-usage on this computer.</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>1 second</source>
-        <translation>שניה 1</translation>
-    </message>
-    <message>
-        <source> seconds</source>
-        <translation>שניות</translation>
-    </message>
-    <message>
-        <source>Quality of demo-mode</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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>Low (15 bit)</source>
-        <translation>נמוך - 15 ביט</translation>
-    </message>
-    <message>
-        <source>Medium (18 bit)</source>
-        <translation>בינוני - 18 ביט</translation>
-    </message>
-    <message>
-        <source>High (Truecolor)</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 mouse-cursor over 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 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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">שימו לב, הגדרות מסויימות ייכנסו לפעולה רק לאחר אתחול התוכנית</span></p></body></html></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>demoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation>הדגמה</translation>
-    </message>
-</context>
-<context>
-    <name>isdServer</name>
-    <message>
-        <source>ISD-server error</source>
-        <translation>תקלת שרת ISD </translation>
-    </message>
-    <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>לא ניתן להפעיל את שרת ה- ISD מאחר ופורט %1 כבר בשימוש.
-יש לוודא כי אין אפליקצייה אחרת העושה שימוש בפורט זה ולנסות שינית</translation>
-    </message>
-    <message>
-        <source>Confirm access</source>
-        <translation>אשרו גישה</translation>
-    </message>
-    <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>משתמש מ- %1 מנסה לקבל גישה אל המסך שלך. האם להעניק הרשאת גישה ?</translation>
-    </message>
-    <message>
-        <source>Never for this session</source>
-        <translation>לעולם לא בהתחברות זו</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation>תמיד בהתחברות זו</translation>
-    </message>
-    <message>
-        <source>Message from teacher</source>
-        <translation>הודעה מהמורה</translation>
-    </message>
-    <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>משתמש (%1) ניסה לקבל גישה למחשב זה אך כשל בתהליך הזיהוי !</translation>
-    </message>
-</context>
-<context>
-    <name>ivsConnection</name>
-    <message>
-        <source>Snapshot</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>unknown</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-<context>
-    <name>lockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation>נעל מסך</translation>
-    </message>
-</context>
-<context>
-    <name>messageBox</name>
-    <message>
-        <source>OK</source>
-        <translation>OK</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;">ברוכים הבאים !</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>שינוי הגדרות התוכנה יבוצע דרך מנהל ההגדרות</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>קצת מידע בסיסי על התוכנה והשימוש בה</translation>
-    </message>
-</context>
-<context>
-    <name>pageFinished</name>
-    <message>
-        <source>iTALC is now ready to run!</source>
-        <translation>iTALC
-מוכן כעת לפעולה ! </translation>
-    </message>
-    <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation>התוכנה מותקנת ומוגדרת במלואה. אם מותקנת עמדת מנהל, ניתן להפעילה כעת</translation>
-    </message>
-    <message>
-        <source>Save key setup settings</source>
-        <translation>שמור את הגדרות המפתחות</translation>
-    </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
-    <message>
-        <source>Key directories</source>
-        <translation>תיקיות המפתחות</translation>
-    </message>
-    <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>יש לבצע שמירה של המפתח/ות המיובאים/חדשים. מומלץ להשאיר את התיקיות המוצעות</translation>
-    </message>
-    <message>
-        <source>Directory to store public key in</source>
-        <translation>תיקייה לשמירת המפתח הפומבי</translation>
-    </message>
-    <message>
-        <source>Directory to store private key in</source>
-        <translation>תיקייה לשמירת המפתח הפרטי</translation>
-    </message>
-    <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation>יש אפשרות לבחירת תיקייה אליה ניתן לייצא את המפתח הפומבי. כגון, דיסק נייד או תיקיית רשת משותפת</translation>
-    </message>
-    <message>
-        <source>Export private key too</source>
-        <translation>ייצא מפתח פומבי</translation>
-    </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
-    <message>
-        <source>Security options</source>
-        <translation>אפשרויות אבטחה</translation>
-    </message>
-    <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation>התוכנה עושה שימוש בהגדרות בטיחות למניעת התחברות של מחשבים לא מורשים אשר מותקנת עליהם התוכנה . 
-
-אי לכך, יש ליצור זוג מפתחות חדש או לייבא את המפתח הציבורי שנוצר במהלך ההתקנה על גבי המחשב הראשי</translation>
-    </message>
-    <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation>צור זוג מפתחות חדש (ניתן לביצוע רק על המחשב הראשי) </translation>
-    </message>
-    <message>
-        <source>Import public key of master computer</source>
-        <translation>ייבא את המפתח הציבורי מהמחשב הראשי</translation>
-    </message>
-    <message>
-        <source>Choose location of exported public key:</source>
-        <translation>בחרו את המיקום בו נמצא המפתח הציבורי: </translation>
-    </message>
-    <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>שמור את כל המפתחות (רק בעידכון התקנה קיימת!) </translation>
-    </message>
-</context>
-<context>
-    <name>pageWelcome</name>
-    <message>
-        <source>Welcome to iTALC</source>
-        <translation>iTALC
-ברוכים הבאים</translation>
-    </message>
-    <message>
-        <source>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation>כלי זה ידריך אתכם בתהליך הגדרת מפתחות הנידרשים לצורך אימות המשתמשים בסביבת התוכנה
-
-לחצו 'הבא' כדי להמשיך </translation>
-    </message>
-</context>
-<context>
-    <name>remoteControlWidget</name>
-    <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>צפייה ישירה %1 בעמדה %2</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 at host %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>remoteLogon</name>
-    <message>
-        <source>Remote Logon</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">התחברות מרחוק</span></p></body></html></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>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>ביטול</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
-    </message>
-</context>
-<context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>אשרו דריסה</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>%1
-האם לדרוס קובץ זה ?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>בטל התקנה</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation>אתם בטוחים ביציאה מההתקנה? התוכנה אינה מותקנת באופן מלא עדיין ! </translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>הבא</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>סיום</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>יציאה</translation>
-    </message>
-    <message>
-        <source>File does not exist</source>
-        <translation>קובץ אינו קיים</translation>
-    </message>
-    <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
-        <translation>%1
-קובץ זה אינו קיים. נא בידקו ונסו שוב</translation>
-    </message>
-</context>
-<context>
-    <name>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>בחרו את תיקיית המפתח הציבורי</translation>
-    </message>
-    <message>
-        <source>Choose private key directory</source>
-        <translation>בחרו את תיקיית המפתח הפרטי</translation>
-    </message>
-    <message>
-        <source>Choose public key export directory</source>
-        <translation>בחרו את התיקייה לייצוא המפתח הציבורי</translation>
-    </message>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
-    <message>
-        <source>Choose directory for key import</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 snapshot</source>
-        <translation>צילום מסך</translation>
-    </message>
-    <message>
-        <source>Delete snapshot</source>
-        <translation>מחק צילום מסך</translation>
-    </message>
-    <message>
-        <source>Reload list</source>
-        <translation>טען מחדש רשימה</translation>
-    </message>
-</context>
-<context>
-    <name>support</name>
-    <message>
-        <source>Support</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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">תמיכה </span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>נא להכניס שם או כתובת מחשב התלמיד לו אתם מעוניינים לעזור</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>OK</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>ביטול</translation>
-    </message>
-</context>
-<context>
-    <name>textMessage</name>
-    <message>
-        <source>Send text message</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">שלח הודעת טקסט</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>בשדה למטה יש להכניס את תוכן ההודעה שתישלח לרשימת משתמשים ניבחרים</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>ביטול</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
-    </message>
-</context>
-<context>
-    <name>vncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>מבצע התחברות ל
-%1</translation>
-    </message>
-</context>
-<context>
-    <name>wizard</name>
-    <message>
-        <source>iTALC setup tool</source>
-        <translation>אשף התקנת iTALC</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>ביטול</translation>
-    </message>
-    <message>
-        <source>Back</source>
-        <translation>חזרה</translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>הבא</translation>
-    </message>
-</context>
-</TS>
diff --git a/ima/resources/logo.png b/lib/resources/icon64.png
similarity index 100%
rename from ima/resources/logo.png
rename to lib/resources/icon64.png
diff --git a/lib/resources/it.qm b/lib/resources/it.qm
index 32c746d..bc25825 100644
Binary files a/lib/resources/it.qm and b/lib/resources/it.qm differ
diff --git a/lib/resources/it.ts b/lib/resources/it.ts
index 0de0191..e4236f1 100644
--- a/lib/resources/it.ts
+++ b/lib/resources/it.ts
@@ -2,1006 +2,1417 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="it_IT">
 <context>
-    <name>MainToolBar</name>
+    <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-2011 Tobias Doerffel</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 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 type="unfinished">Azioni</translation>
+        <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 ':' for specifying an optional port-number)</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;">inserisci un indirizzo IP o il nome letterale con il quale iTALC può raggiungere il computer (usa ':' per specificare un numero di porta - opzionale)</p></body></html></translation>
+    </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></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;">Nickname facoltativo del computer visualizzato in iTALC.</p></body></html></translation>
+    </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></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;">Indirizzo MAC-address del client - utilizzato solo per accendere il computer gestito</p></body></html></translation>
+    </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>MainWindow</name>
+    <name>Config</name>
     <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
+        <source>Interval between updates</source>
+        <translation>Intervallo tra gli aggiornamenti</translation>
     </message>
     <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
+        <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 network-traffic and lower CPU-usage on this computer.</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;">Qui è possibile indicare l'intervallo di aggiornamento dei computer client. Un valore alto, in una rete lenta, offrirà migliori prestazioni e un minor utilizzo di CPU su questo computer.</p></body></html></translation>
     </message>
     <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source> seconds</source>
+        <translation> secondi</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Nessuna accesso in scrittura</translation>
+        <source>User interface</source>
+        <translation>Interfaccia Utente</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">Non è possibile leggere/scrivere o creare la cartella %1! Per autorizzare iTALC, devi essere sicuro di avere i permessi per modificare questa cartella.</translation>
+        <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></body></html></translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Aula</translation>
+        <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 mouse-cursor over 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;">Seleziona questa opzione se ti infastidiscono i suggerimenti (balloon-tooltips) quando muovi il cursore sui pulsanti della barra degli strumenti.</p></body></html></translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Cambia aula</translation>
+        <source>No balloon-tooltips</source>
+        <translation>Nessun suggerimento (ballon-tooltips)</translation>
     </message>
     <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Puoi usare questo pulsante per cambiare l'aula da gestire.</translation>
+        <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></translation>
     </message>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Clicca su questo pulsante, per cambiare aula.</translation>
+        <source>No texts on toolbar-buttons</source>
+        <translation>Barra strumenti senza testo</translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Panoramica</translation>
+        <source>Your role (needs according keys!)</source>
+        <translation>Il tuo ruolo (necessita di chiavi adeguate!)</translation>
     </message>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
+        <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>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">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>
+        <source>Teacher</source>
+        <translation>Insegnante</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Presenta su schermo intero</translation>
+        <source>Administrator</source>
+        <translation>Amministratore</translation>
     </message>
     <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Presenta</translation>
+        <source>Supporter</source>
+        <translation>Assistente</translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Ferma Presentazione</translation>
+        <source>Other</source>
+        <translation>Altro</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">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>
+        <source>Settings for multi-logon</source>
+        <translation>Impostazioni per il multi-logon</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Presenta in finestra</translation>
+        <source>Domain</source>
+        <translation>Dominio</translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Presenta in finestra</translation>
+        <source>Double-click action for client-window</source>
+        <translation>Azione del doppio-click sulla finestra client</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">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>
+        <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-indent:0px;">Qui puoi decidere cosa dovrà accadere con il doppio click sulla finestra (miniatura) del client.</p></body></html></translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Blocca/Sblocca i desktop</translation>
+        <source>Remote control</source>
+        <translation>Controlla</translation>
     </message>
     <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Blocca tutti</translation>
+        <source>View live in fullscreen</source>
+        <translation>Osserva</translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Sblocca tutti</translation>
+        <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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Attenzione: alcune impostazioni non avranno effetto fino al prossimo riavvio di iTALC.</span></p></body></html></translation>
     </message>
+</context>
+<context>
+    <name>ConfigWidget</name>
     <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">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>
+        <source>Your iTALC-configuration</source>
+        <translation>Opzioni</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Invia un messaggio di testo</translation>
+        <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>Text message</source>
-        <translation type="unfinished">Invia messaggio</translation>
+        <source>OK</source>
+        <translation>OK</translation>
     </message>
+</context>
+<context>
+    <name>DemoClient</name>
     <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">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>
+        <source>iTALC Demo</source>
+        <translation>iTALC Presentazione</translation>
     </message>
+</context>
+<context>
+    <name>ItalcCoreServer</name>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Accendi i computer</translation>
+        <source>Authentication error</source>
+        <translation>Errore di autenticazione</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Accendi</translation>
+        <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>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">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>
+        <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>Power down computers</source>
-        <translation type="unfinished">Spegni i computer</translation>
+        <source>VNC authentication failed.</source>
+        <translation>L'autenticazione di VNC non è riuscita</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Spegni</translation>
+        <source>VNC server closed connection.</source>
+        <translation>Il server VNC ha chiuso la connessione</translation>
     </message>
+</context>
+<context>
+    <name>KeyFileAssistant</name>
     <message>
-        <source>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Puoi usare questo pulsante per spegnere tutti i computer gestiti (ad esempio a lezione terminata) . </translation>
+        <source>iTALC Access Key Assistant</source>
+        <translation>Assistente Chiavi di accesso per iTALC</translation>
     </message>
     <message>
-        <source>Logon</source>
-        <translation type="unfinished">Accedi come</translation>
+        <source>Create/import iTALC access keys</source>
+        <translation>Crea/Importa chiavi di accesso per iTALC</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Accedi come</translation>
+        <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>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Con questo pulsante potrai effettuare l'accesso (logon) su tutti i computer gestiti, indicando username, password e dominio.</translation>
+        <source>How does it work?</source>
+        <translation>Come funziona?</translation>
     </message>
     <message>
-        <source>Support</source>
-        <translation type="unfinished">Assisti/Aiuta</translation>
+        <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>Direct support</source>
-        <translation type="unfinished">Assisti/Aiuta</translation>
+        <source>Assistant mode</source>
+        <translation>Modalità assistente</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">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>
+        <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>Adjust/align</source>
-        <translation type="unfinished">Adatta</translation>
+        <source>Create new access keys (master computer)</source>
+        <translation>Crea una nuova coppia di chiavi (solo sul computer master/docente)</translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Adatta le finestre</translation>
+        <source>assistantModeButtonGroup</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 type="unfinished">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>
+        <source>Import public key (client computer)</source>
+        <translation>Importa la chiave pubblica (computer client/studente)</translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Ordina</translation>
+        <source>Select user role</source>
+        <translation>Scegli il ruolo utente</translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Ordina e adatta finestre</translation>
+        <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>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Utilizzando questo pulsante tutte le finestre visibili saranno ordinate e la loro dimensione ottimizzata per lo spazio disponibile.</translation>
+        <source>Teacher</source>
+        <translation>Insegnante</translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Non sono state trovate chiavi valide</translation>
+        <source>Administrator</source>
+        <translation>Amministratore</translation>
     </message>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Non sono state trovate le chiavi di autenticazione oppure esse sono danneggiate. Si prega di creare una nuova coppia di chiavi utilizzando ICA (consultare la documentazione disponibile presso http://italc.sf.net/wiki/index.php?title=Installazione).
-Altrimenti non sarà possibile accedere ai computer utilizzando iTALC.</translation>
+        <source>Support team member</source>
+        <translation>Assistente</translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">Il servizio iTALC non è in esecuzione</translation>
+        <source>Other</source>
+        <translation>Altro</translation>
     </message>
     <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Sembra che il servizio iTALC non sia in esecuzione, oppure le chiavi di autenticazione non sono impostate correttamente. Il servizio "iTALC Client" è indispensabile per l'esecuzione di iTALC. Contatta il tuo amministratore per risolvere il problema.</translation>
+        <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>iTALC Master Control</source>
-        <translation type="unfinished">Gestione iTALC Master</translation>
+        <source>Directories</source>
+        <translation>Cartelle</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Controlla</translation>
+        <source>Export public key part (master computer)</source>
+        <translation>Cartella in cui esportare la chiave pubblica (del computer master/docente)</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished"></translation>
+        <source>...</source>
+        <translation></translation>
     </message>
-</context>
-<context>
-    <name>QApplication</name>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Non è possibile registrare il servizio '%1'.</translation>
+        <source>Use custom destination directory for access keys</source>
+        <translation>Personalizza le cartelle per le chiavi di accesso</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>
+        <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>The service '%1' is already registered.</source>
-        <translation>Il servizio '%1' è già registrato.</translation>
+        <source>Summary</source>
+        <translation>Riepilogo</translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Il servizio '%1' non può essere registrato.</translation>
+        <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>The service '%1' was successfully registered.</source>
-        <translation>Il servizio '%1' è stato registrato correttamente.</translation>
+        <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>The service '%1' could not be stopped.</source>
-        <translation>Il servizio '%1' non può essere fermato.</translation>
+        <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>The service '%1' has been unregistered.</source>
-        <translation>Il servizio '%1' è stato rimosso.</translation>
+        <source>Key files (*.key.txt)</source>
+        <translation>File Chiavi (*.key.txt)</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>
+        <source>Invalid public key</source>
+        <translation>Chiave pubblica non valida</translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Il servizio '%1' non può essere rimosso.</translation>
+        <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>The service '%1' could not be found.</source>
-        <translation>Il servizio '%1' non è stato trovato.</translation>
+        <source>Select destination directory</source>
+        <translation>Indica la cartela di destinazione</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>
+        <source>Access key creation</source>
+        <translation>Creazione chiavi di accesso</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>
+        <source>Could not remove previously existing file %1.</source>
+        <translation>Non posso rimuovere il file già esistente %1.</translation>
     </message>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC Client su %1:%2:%3</translation>
+        <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>QObject</name>
+    <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>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>NPC (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</translation>
+        <source>...</source>
+        <translation></translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>iTALC-foto</translation>
+        <source>Groups with iTALC privileges</source>
+        <translation>Gruppi con privilegi di accesso per iTALC</translation>
     </message>
 </context>
 <context>
-    <name>about</name>
+    <name>MainToolBar</name>
     <message>
-        <source>About iTALC</source>
-        <translation>Informazioni su iTALC</translation>
+        <source>Actions</source>
+        <translation>Azioni</translation>
     </message>
+</context>
+<context>
+    <name>MainWindow</name>
     <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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Informazioni su  iTALC</span></p></body></html></translation>
+        <source>MainWindow</source>
+        <translation>FinestraPrincipale</translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>Informazioni su</translation>
+        <source>toolBar</source>
+        <translation>BarraStrumenti</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;"><span style=" font-size:11pt;">iTALC - Intelligent Teaching And Learning with Computers</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Copyright (c) 2004-2010 Tobias Doerffel</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>iTALC</source>
+        <translation>iTALC</translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Autori</translation>
+        <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>Translation</source>
-        <translation>Traduzione</translation>
+        <source>Classroom</source>
+        <translation>Aula</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;">Current language not translated yet (or native English).</p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">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!</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;">Rino Andriano &lt;rino/dot/andriano/at/istruzione/dot/it&gt; </p></body></html></translation>
+        <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>License</source>
-        <translation>Licenza</translation>
+        <source>Window Demo</source>
+        <translation>Presenta in finestra</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <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>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Gestione Aule</translation>
+        <source>Lock/unlock desktops</source>
+        <translation>Blocca/Sblocca i desktop</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>
+        <source>Lock all</source>
+        <translation>Blocca tutti</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>
+        <source>Unlock all</source>
+        <translation>Sblocca tutti</translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Aule/computer</translation>
+        <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>IP-address</source>
-        <translation>Indirizzo-IP</translation>
+        <source>Send text message</source>
+        <translation>Invia un messaggio di testo</translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Non è stato trovato un file di configurazione</translation>
+        <source>Text message</source>
+        <translation>Invia messaggio</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>
+        <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>Error in configuration-file</source>
-        <translation>Errore nel file di configurazione</translation>
+        <source>Power on computers</source>
+        <translation>Accendi i computer</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>
+        <source>Power on</source>
+        <translation>Accendi</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>
+        <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>Show/hide</source>
-        <translation>Mostra/nascondi</translation>
+        <source>Power down computers</source>
+        <translation>Spegni i computer</translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Modifica Impostazioni</translation>
+        <source>Power down</source>
+        <translation>Spegni</translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Rimuovi</translation>
+        <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>Actions</source>
-        <translation>Azioni</translation>
+        <source>Support</source>
+        <translation>Assisti/Aiuta</translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Mostra tutti i computer dell'aula</translation>
+        <source>Direct support</source>
+        <translation>Assisti/Aiuta</translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Nascondi tutti i computer dell'aula</translation>
+        <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>Edit name</source>
-        <translation>Modifica nome</translation>
+        <source>Adjust/align</source>
+        <translation>Adatta</translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Rimuovi l'aula</translation>
+        <source>Adjust windows and their size</source>
+        <translation>Adatta le finestre</translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Azioni per %1</translation>
+        <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>Add computer</source>
-        <translation>Aggiungi un computer</translation>
+        <source>Auto view</source>
+        <translation>Ordina</translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Aggiungi un'aula</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation>Ordina e adatta finestre</translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Nuovo nome per l'aula</translation>
+        <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>Please enter a new name for classroom "%1".</source>
-        <translation>Inserisci un nuovo nome per la aula "%1".</translation>
+        <source>iTALC Master Control</source>
+        <translation>Gestione iTALC Master</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>
+        <source>Remote control</source>
+        <translation>Controlla</translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Aula non presente</translation>
+        <source>Quit</source>
+        <translation>Esci</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>
+        <source>iTALC Management Console</source>
+        <translation></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Nuova aula</translation>
+        <source>General</source>
+        <translation>Generale</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>
+        <source>iTALC Server</source>
+        <translation>Servizio ITALC</translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Nascondi i computer di tipo Insegnante</translation>
+        <source>Paths</source>
+        <translation>Percorsi</translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Nomi Utente</translation>
+        <source>Authentication</source>
+        <translation>Autenticazione</translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Mostra nomi utente</translation>
+        <source>Debugging</source>
+        <translation></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>
+        <source>iTALC Service</source>
+        <translation>Servizio iTALC</translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Esporta su file di testo</translation>
+        <source>Hide tray icon</source>
+        <translation>Nascondi l'icona tray</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>
+        <source>Autostart</source>
+        <translation>Avvio automatico</translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Indica il file di output</translation>
+        <source>Additional arguments</source>
+        <translation>Parametri aggiuntivi</translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>File di testo (*.txt)</translation>
+        <source>Start service</source>
+        <translation>Avvia il servizio</translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
+        <source>Stop service</source>
+        <translation>ferma il servizio</translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Stato sconosciuto</translation>
+        <source>State:</source>
+        <translation>Stato:</translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Nessun utente in linea</translation>
+        <source>Stopped</source>
+        <translation>Fermato</translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>PC non raggiungibile</translation>
+        <source>Logging</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Presentazione in corso</translation>
+        <source>Log file directory</source>
+        <translation>Cartella per il Log file</translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Desktop bloccato</translation>
+        <source>...</source>
+        <translation></translation>
     </message>
-</context>
-<context>
-    <name>clientAction</name>
     <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Sei sicuro di voler disconnettere gli utenti su tutti i computer visibili?</translation>
+        <source>Log level</source>
+        <translation>Livello di Log</translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
+        <source>Nothing</source>
+        <translation>Nessun log</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Disconnetti utente</translation>
+        <source>Only critical messages</source>
+        <translation>Solo i messaggi critici</translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Sei sicuro di volere riavviare tutti i computer visibili?</translation>
+        <source>Errors and critical messages</source>
+        <translation>Errori e messaggi critici</translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
+        <source>Warnings and errors</source>
+        <translation>Avvisi (warnings) ed errori</translation>
     </message>
     <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Riavvia i computer</translation>
+        <source>Information, warnings and errors</source>
+        <translation>Informazioni, avvisi e errori</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Sei sicuro di voler spegnere tutti i computer visibili?</translation>
+        <source>Debug messages and everything else</source>
+        <translation>Messaggi di debug e quant'altro</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
+        <source>Limit log file size</source>
+        <translation>Limite per il file di log</translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
+        <source>MB</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Presenta su schermo intero</translation>
+        <source>Log to standard error output</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Presenta in finestra</translation>
+        <source>Log to Windows event log</source>
+        <translation>Log su Gestore eventi di Windows</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Blocca postazione</translation>
+        <source>Clear all log files</source>
+        <translation>Cancella tutti i file di log</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation type="unfinished">Osserva</translation>
+        <source>Desktop capturing</source>
+        <translation>Cattura schermo</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Controlla</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation>Abilita cattura di finestre in livelli (semi-trasparente)</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Mostra studente</translation>
+        <source>Poll full screen</source>
+        <translation>Schermo pieno</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Invia un messaggio di testo</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation>Bassa qualità (modalità turbo)</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation type="unfinished">Accedi come...</translation>
+        <source>Demo server</source>
+        <translation>Server per la modalità Presentazione</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Disconnetti utente</translation>
+        <source>Backend</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Scatta una foto</translation>
+        <source>VNC reflector</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Accendi</translation>
+        <source>iTALC 1 demo server</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Riavvia il PC</translation>
+        <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>Power down</source>
-        <translation type="unfinished">Spegni</translation>
+        <source>Network</source>
+        <translation>Rete</translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Esegui comandi</translation>
+        <source>Core server port</source>
+        <translation>Porta principale del Servizio</translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Impostazioni client</translation>
+        <source>Demo server port</source>
+        <translation>Porta per la modalità Presentazione</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Impostazioni client</span></p></body></html></translation>
+        <source>Enable firewall exception</source>
+        <translation>Abilita le eccezioni del firewall</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Generale</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation>Abilita il server HTTP che fornisce una applet JavaViewer</translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Nome</translation>
+        <source>HTTP server port</source>
+        <translation>Porta del server HTTP</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></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;">Indirizzo MAC-address del client - utilizzato solo per accendere il computer gestito</p></body></html></translation>
+        <source>Configuration files</source>
+        <translation>File di configurazione</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>Indirizzo IP/Nome Computer</translation>
+        <source>Global configuration</source>
+        <translation>Configurazione universale</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 ':' for specifying an optional port-number)</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;">inserisci un indirizzo IP o il nome letterale con il quale iTALC può raggiungere il computer (usa ':' per specificare un numero di porta - opzionale)</p></body></html></translation>
+        <source>Personal configuration</source>
+        <translation>Configurazione personale</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>MAC-address</translation>
+        <source>Data directories</source>
+        <translation>Cartelle dati</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation>Aula</translation>
+        <source>Snapshots</source>
+        <translation>Foto</translation>
+    </message>
+    <message>
+        <source>Authentication methods</source>
+        <translation>Metodi di autenticazione</translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <source>Key file authentication</source>
+        <translation>Autenticazione con File chiave</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Connessione</translation>
+        <source>ACL-based logon authentication</source>
+        <translation>Autenticazione basata sul Logon (Credenziali di accesso)</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;">connection to hosts on the same level</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;">connessione alle macchine sullo stesso livello</p></body></html></translation>
+        <source>Access key management</source>
+        <translation>Gestione chiavi di accesso</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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Qui è possibile specificare come questa macchina è connessa alla rete iTALC, es. macchine sullo stesso livello. Normalmente i computer client sono collegati a mezzo di una rete 100 MBit/s, ma ci potrebbero essere apparati speciali come gateway verso altre reti iTALC situate in altre scuole o presso l'abitazione degli studenti. In questi casi iTALC cerca di ottimizzare la banda utilizzata.</p></body></html></translation>
+        <source>Public key file base directory</source>
+        <translation>Cartella chiave Pubblica</translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation>Analogica</translation>
+        <source>Private key file base directory</source>
+        <translation>Cartella chiave Privata</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Launch key file assistant</source>
+        <translation>Lancia l'Assistente per la gestione delle chiavi</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <source>Logon settings</source>
+        <translation>Impostazioni di Accesso (Logon)</translation>
     </message>
     <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <source>Manage permissions</source>
+        <translation>Gestisci permessi</translation>
     </message>
     <message>
-        <source>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
+        <source>Test</source>
+        <translation></translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</translation>
+        <source>Access confirmation</source>
+        <translation>Conferma accesso</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 if the host is the gateway for the subnet.</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;">Verifica se il computer è il gateway per la subnet.</p></body></html></translation>
+        <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>Host is &gateway for subnet</source>
-        <translation>Il computer è il &gateway per la subnet</translation>
+        <source>Logon authentication</source>
+        <translation>Autenticazione di accesso (Logon)</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;">Activate this option for at least one host in a subnet.</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;">Attiva questa opzione, almeno, per un computer della subnet.</p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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;">Quando si esegue una presentazione verso più computer remoti, situate in una rete esterna, è necessario attivare questa opzione almeno su un computer tra i destinatari. In questo modo le informazioni sono inviate solo al distributore di presentazioni (demo-replicator) che provvederà a distribuirle a tutti i client della rete. Specialmente con collegamenti lenti questa opzione è essenziale. Normalmente bisogna attivare questa opzione sul gateway di subnet (vedi opzione sopra).</p></body></html></translation>
+        <source>Debugging iTALC</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Agisce come &demo/replicator (distributore di presentazioni)</translation>
+        <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>&OK</source>
-        <translation>&OK</translation>
+        <source>1)</source>
+        <translation></translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>&Annulla</translation>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation>Pulisci i file di LOG nella sezione Generale.</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Tipo</translation>
+        <source>2)</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Computer Studente</translation>
+        <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>Teacher computer</source>
-        <translation>Computer Insegnante</translation>
+        <source>3)</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Altro computer/non definito</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></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;">Nickname facoltativo del computer visualizzato in iTALC.</p></body></html></translation>
+        <source>4)</source>
+        <translation></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Manca l'indirizzo IP o il nome (hostname) del computer</translation>
+        <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>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>
+        <source>Generate bug report archive</source>
+        <translation>Genera l'archivio Rapporto Errori</translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Indirizzo MAC-address non valido</translation>
+        <source>5)</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>E' stato specificato un MAC-address non valido. Lasciare il campo vuoto o inserire un indirizzo MAC-address valido (utilizza":" come separatore!)</translation>
+        <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>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Esegui comandi sul/i computer</translation>
+        <source>&File</source>
+        <translation></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Inserisci le istruzioni da eseguire sul/i computer:</translation>
+        <source>&Help</source>
+        <translation>&Aiuto</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Annulla</translation>
+        <source>&Quit</source>
+        <translation>&Esci</translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Esegui!</translation>
+        <source>Ctrl+Q</source>
+        <translation></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Intervallo tra gli aggiornamenti</translation>
+        <source>&Save settings into file</source>
+        <translation>&Salva impostazioni nel file</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 network-traffic and lower CPU-usage on this computer.</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;">Qui è possibile indicare l'intervallo di aggiornamento dei computer client. Un valore alto, in una rete lenta, offrirà migliori prestazioni e un minor utilizzo di CPU su questo computer.</p></body></html></translation>
+        <source>Save settings into file</source>
+        <translation>Salva impostazioni nel file</translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 secondo</translation>
+        <source>Ctrl+S</source>
+        <translation></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> secondi</translation>
+        <source>L&oad settings from file</source>
+        <translation>C&arica impostazioni dal file</translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Qualità della modalita-presentazione</translation>
+        <source>Ctrl+O</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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 la qualità schermo desiderata per la modalità presentazione. Una qualità bassa comporta un minor utilizzo di CPU e un minor traffico di rete. Una qualità alta potrebbe rallentare il tuo computer e peggiorare la visualizzazione della presentazione sui computer client. Prova le diverse opzioni per individuare quella più adatta alle tue esigenze, alle caratteristiche delle macchine e della rete.</p></body></html></translation>
+        <source>About iTALC</source>
+        <translation>Informazioni su iTALC</translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Bassa (15 bit)</translation>
+        <source>About Qt</source>
+        <translation>Informazioni su Qt</translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Media (18 bit)</translation>
+        <source>No write access</source>
+        <translation>Nessun accesso in scrittura</translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Alta (Truecolor)</translation>
+        <source>Could not contact iTALC service</source>
+        <translation>Non riesco a contattare il servizio iTALC</translation>
     </message>
     <message>
-        <source>User interface</source>
-        <translation>Interfaccia Utente</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></body></html></translation>
+        <source>Authentication impossible</source>
+        <translation>Autenticazione impossibile</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 mouse-cursor over 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;">Seleziona questa opzione se ti infastidiscono i suggerimenti (balloon-tooltips) quando muovi il cursore sui pulsanti della barra degli strumenti.</p></body></html></translation>
+        <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>No balloon-tooltips</source>
-        <translation>Nessun suggerimento (ballon-tooltips)</translation>
+        <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>Your role (needs according keys!)</source>
-        <translation>Il tuo ruolo (necessita di chiavi adeguate!)</translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation>Impossibile modificare i parametri del servizio iTALC.</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>
+        <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>Teacher</source>
-        <translation>Insegnante</translation>
+        <source>iTALC Management Console %1</source>
+        <translation>iTALC Management Console %1</translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Amministratore</translation>
+        <source>Restart iTALC Service</source>
+        <translation>Riavvia il servizio iTALC</translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Assistente</translation>
+        <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>Other</source>
-        <translation>Altro</translation>
+        <source>Stopping iTALC service</source>
+        <translation>Sto fermando il servizio iTALC</translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Impostazioni per il multi-logon</translation>
+        <source>Running</source>
+        <translation>In esecuzione</translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Dominio</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Attenzione: alcune impostazioni non avranno effetto fino al prossimo riavvio di iTALC.</span></p></body></html></translation>
+        <source>Log files cleared</source>
+        <translation>File di Log cancellati</translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Azione del doppio-click sulla finestra client</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation>Tutti i file di Log sono stati cancellati.</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-indent:0px;">Qui puoi decidere cosa dovrà accadere con il doppio click sulla finestra (miniatura) del client.</p></body></html></translation>
+        <source>Error</source>
+        <translation>Errore</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Controlla</translation>
+        <source>Could not remove all log files.</source>
+        <translation>Impossibile cancellare tutti i file di Log.</translation>
     </message>
     <message>
-        <source>View live in fullscreen</source>
-        <translation>Osserva</translation>
+        <source>Load settings from file</source>
+        <translation>Carica impostazioni da file</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></translation>
+        <source>XML files (*.xml)</source>
+        <translation></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Barra strumenti senza testo</translation>
+        <source>Save settings to file</source>
+        <translation>Salva impostazioni su file</translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Opzioni</translation>
+        <source>Logon authentication test</source>
+        <translation>Test di autenticazione basato sul Logon</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>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation>L'autenticazione con le credenziali di Logon è riuscita.</translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Presentazione</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation>Non è riuscita l'autenticazione con le credenziali di Logon.</translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>Confirm access</source>
-        <translation>Conferma l'accesso</translation>
+        <source>Save bug report archive</source>
+        <translation>Salva l'archivio Rapporto Errori</translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Qualcuno dalla macchina %1 cerca di accedere al tuo video. Consenti l'accesso?</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation>Archivio Rapporto Errori (*.ibra.xml)</translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Mai per questa sessione</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation>L'archivio Rapporto Errori è stato salvato</translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Sempre per questa sessione</translation>
+        <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>Message from teacher</source>
-        <translation>Messaggio dall'insegnante</translation>
+        <source>Unsaved settings</source>
+        <translation>Impostazioni non salvate</translation>
     </message>
     <message>
-        <source>ISD-server error</source>
-        <translation>Server ISD: errore</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation>Alcune impostazioni non sono state salvate. Esco comunque?</translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>Il server ISD non può essere avviato perché la porta %1 è già in uso. Assicurarsi che non ci siano altre applicazioni che usano questa porta e riprovare.</translation>
+        <source>Configuration not writable</source>
+        <translation>Il file di configurazione non è scrivibile</translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Errore di autenticazione</translation>
+        <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>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>
+        <source>All settings were applied successfully.</source>
+        <translation>Tutte le impostazioni sono state applicate.</translation>
     </message>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Foto</translation>
+        <source>An error occured while applying settings!</source>
+        <translation>Si è verificato un errore nell'applicazioni delle impostazioni!</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>
+        <source>Enable desktop switching for screen lock (experimental)</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>Schermo Bloccato</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation>Messaggio dall'insegnante</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <name>Overview</name>
     <message>
         <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
 p, li { white-space: pre-wrap; }
@@ -1017,6 +1428,10 @@ p, li { white-space: pre-wrap; }
         <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>
@@ -1028,16 +1443,12 @@ p, li { white-space: pre-wrap; }
         <source>About iTALC</source>
         <translation>Informazioni su iTALC</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>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Introduzione</translation>
+        <translation>Panoramica</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
@@ -1045,98 +1456,88 @@ p, li { white-space: pre-wrap; }
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC Logon</source>
+        <translation></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <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>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation>Nome Utente</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation>Password</translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Le chiavi di crittografia create o importate devono essere salvate. E' raccomandabile utilizzare le cartelle predefinite.</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Non è possibile registrare il servizio '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Cartella in cui salvare la chiave pubblica</translation>
+        <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>Directory to store private key in</source>
-        <translation>Cartella in cui salvare la chiave privata</translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Il servizio '%1' è già registrato.</translation>
     </message>
     <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Il servizio '%1' non può essere registrato.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Esporta anche la chiave privata</translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Il servizio '%1' è stato registrato correttamente.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Il servizio '%1' non può essere fermato.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Il servizio '%1' è stato rimosso.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <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>Import public key of master computer</source>
-        <translation>Importa la chiave pubblica del computer master</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Il servizio '%1' non può essere rimosso.</translation>
     </message>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Scegli l'ubicazione della chiave pubblica esportata:</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Il servizio '%1' non è stato trovato.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Mantieni tutte le chiavi (solo quando si aggiorna un'installazione preesistente)</translation>
+        <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>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>iTALC Client su %1:%2:%3</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidget</name>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Osserva (%1 sul computer %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation>Osservato (%1@%2)</translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Controlla (%1 sul computer %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation>Controllo remoto (%1@%2)</translation>
     </message>
     <message>
         <source>unknown user</source>
@@ -1144,66 +1545,56 @@ Click 'Next' to continue.</source>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
-        <source>Lock student</source>
-        <translation>Blocca studente</translation>
+        <source>View only</source>
+        <translation>Osserva solo</translation>
     </message>
     <message>
-        <source>Fullscreen</source>
-        <translation>Schermo intero</translation>
+        <source>Remote control</source>
+        <translation>Controlla</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation>Chiudi</translation>
+        <source>Lock student</source>
+        <translation>Blocca studente</translation>
     </message>
     <message>
-        <source>Connecting %1</source>
-        <translation>Connessione con %1</translation>
+        <source>Unlock student</source>
+        <translation>Sblocca studente</translation>
     </message>
     <message>
-        <source>Connected.</source>
-        <translation>Connesso.</translation>
+        <source>Snapshot</source>
+        <translation>Scatta una foto</translation>
     </message>
     <message>
-        <source>View only</source>
-        <translation>Osserva solo</translation>
+        <source>Fullscreen</source>
+        <translation>Schermo intero</translation>
     </message>
     <message>
-        <source>Snapshot</source>
-        <translation>Scatta una foto</translation>
+        <source>Window</source>
+        <translation>Finestra</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Controlla</translation>
+        <source>Quit</source>
+        <translation>Esci</translation>
     </message>
     <message>
-        <source>Unlock student</source>
-        <translation>Sblocca studente</translation>
+        <source>Connecting %1</source>
+        <translation>Connessione con %1</translation>
     </message>
     <message>
-        <source>Window</source>
-        <translation>Finestra</translation>
+        <source>Connected.</source>
+        <translation>Connesso.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Accesso Remoto</translation>
-    </message>
+    <name>RemoteLogonDialog</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:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Accedi come...</span></p></body></html></translation>
+        <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>
+        <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>
@@ -1218,86 +1609,35 @@ p, li { white-space: pre-wrap; }
         <source>Domain</source>
         <translation>Dominio</translation>
     </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Invio</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Annulla</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
-    </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Conferma sovrascrittura</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Vuoi sovrascrivere %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Annulla installazione</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Avanti</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Fine</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Esci</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
-        <translation type="unfinished"></translation>
+        <source>Run commands</source>
+        <translation>Esegui comandi sul/i computer</translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
-        <translation type="unfinished"></translation>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Scegli la cartella per la chiave pubblica</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Scegli la cartella per la chiave privata</translation>
+        <source>unknown</source>
+        <translation>Stato sconosciuto</translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Scegli la cartella in cui esportare le chiavi</translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshot</source>
+        <translation>Foto</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
         <translation>Foto</translation>
@@ -1308,7 +1648,7 @@ p, li { white-space: pre-wrap; }
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <name>Snapshots</name>
     <message>
         <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
 p, li { white-space: pre-wrap; }
@@ -1336,96 +1676,100 @@ p, li { white-space: pre-wrap; }
         <translation>Ora:</translation>
     </message>
     <message>
-        <source>Show snapshot</source>
-        <translation>Mostra foto</translation>
+        <source>Show</source>
+        <translation>Mostra</translation>
     </message>
     <message>
-        <source>Delete snapshot</source>
-        <translation>Cancella foto</translation>
-    </message>
-    <message>
-        <source>Reload list</source>
-        <translation>Ricarica lista</translation>
+        <source>Delete</source>
+        <translation>Cancella</translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <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 at which the person is sitting, you want to support.</source>
-        <translation>Inserisci l'indirizzo IP o il nome del computer dove è al lavoro la persona che vuoi aiutare.</translation>
+        <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>OK</source>
-        <translation>OK</translation>
+        <source>Send text message</source>
+        <translation>Invia un messaggio di testo</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Annulla</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Assisti/aiuta</span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation>Connessione con %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Invia un messaggio di testo</translation>
+        <source>Overview</source>
+        <translation>Panoramica</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Invia un messaggio di testo</span></p></body></html></translation>
+        <source>Fullscreen demo</source>
+        <translation>Presenta su schermo intero</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>
+        <source>Window demo</source>
+        <translation>Presenta in finestra</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Locked display</source>
+        <translation>Blocca postazione</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Invio</translation>
+        <source>View live</source>
+        <translation>Osserva</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Annulla</translation>
+        <source>Remote control</source>
+        <translation>Controlla</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation>Mostra studente</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Connessione con %1 ...</translation>
+        <source>Send text message</source>
+        <translation>Invia un messaggio di testo</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
+        <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>Cancel</source>
-        <translation>Annulla</translation>
+        <source>Reboot</source>
+        <translation>Riavvia il PC</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Indietro</translation>
+        <source>Power down</source>
+        <translation>Spegni</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Avanti</translation>
+        <source>Execute commands</source>
+        <translation>Esegui comandi</translation>
     </message>
 </context>
 </TS>
diff --git a/ima/resources/license.png b/lib/resources/license.png
similarity index 100%
rename from ima/resources/license.png
rename to lib/resources/license.png
diff --git a/ima/resources/locale.png b/lib/resources/locale.png
similarity index 100%
rename from ima/resources/locale.png
rename to lib/resources/locale.png
diff --git a/lib/resources/nl.qm b/lib/resources/nl.qm
new file mode 100644
index 0000000..be651ee
--- /dev/null
+++ b/lib/resources/nl.qm
@@ -0,0 +1 @@
+<¸dÊÍ!¿`¡½Ý
\ No newline at end of file
diff --git a/lib/resources/nl.ts b/lib/resources/nl.ts
new file mode 100644
index 0000000..a60c5e0
--- /dev/null
+++ b/lib/resources/nl.ts
@@ -0,0 +1,1751 @@
+<?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 utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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-2011 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 ':' for specifying an optional port-number)</p></body></html></source>
+        <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></source>
+        <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></html></source>
+        <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 network-traffic and lower CPU-usage on this computer.</p></body></html></source>
+        <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 mouse-cursor over toolbar-buttons.</p></body></html></source>
+        <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 changes won't take effect until you restart iTALC.</span></p></body></html></source>
+        <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>Poll full screen</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>
+</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>
+</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
index 3f264de..65ea34c 100644
Binary files a/lib/resources/nn.qm and b/lib/resources/nn.qm differ
diff --git a/lib/resources/nn.ts b/lib/resources/nn.ts
index fcd46f9..8c02e7b 100644
--- a/lib/resources/nn.ts
+++ b/lib/resources/nn.ts
@@ -2,1423 +2,1755 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="nn">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
     <message>
-        <source>Actions</source>
-        <translation type="unfinished">Handlingar</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">Om iTALC</translation>
     </message>
-</context>
-<context>
-    <name>MainWindow</name>
     <message>
-        <source>MainWindow</source>
+        <source>About</source>
+        <translation type="unfinished">Om</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>toolBar</source>
+        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>Authors</source>
+        <translation type="unfinished">Forfattarar</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Ingen skrivetilgang</translation>
+        <source>Translation</source>
+        <translation type="unfinished">Omsetjing</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 opprette katalog %1! Kontroller at du har nødvendig tilgang for å opprette eller skrive til denne katalogen før du køyrer iTALC.</translation>
+        <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>Classroom</source>
-        <translation type="unfinished">Klasserom</translation>
+        <source>License</source>
+        <translation type="unfinished">Lisens</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel / iTALC Solutions</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>AccessDialogSlave</name>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Bytt klasserom</translation>
+        <source>Never for this session</source>
+        <translation type="unfinished">Aldri for denne økta</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 for val av aktivt klasserom.</translation>
+        <source>Always for this session</source>
+        <translation type="unfinished">Alltid denne økta</translation>
     </message>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Trykk denne knappen for å byte mellom klasserom.</translation>
+        <source>Confirm desktop access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Oversiktsmodus</translation>
+        <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>Overview</source>
-        <translation type="unfinished">Oversikt</translation>
+        <source>Classroom-Manager</source>
+        <translation type="unfinished">Klasseromshandterar</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">Dette er standardmodus i iTALC. Det gir deg ei oversikt over alle synlege maskiner. Du kan også trykke på denne knappen for å låse opp låste arbeidsstasjonar eller for å gå ut av demonstrasjonsmodus.</translation>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished">Fullskjermdemonstrasjon</translation>
+        <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>Fullscreen Demo</source>
-        <translation type="unfinished">Demonstrasjon i fullskjerm</translation>
+        <source>Classrooms/computers</source>
+        <translation type="unfinished">Klasserom / maskiner</translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Stop demonstrasjon</translation>
+        <source>IP-address</source>
+        <translation type="unfinished">IP-adresse</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">I denne modusen blir skjermen din vist på alle maskiner. Brukerane kan ikkje gjere andre ting samtidig ettersom alle inngåande enheter (mus/tastatus) på klientmaskina blir låst.</translation>
+        <source>Usernames</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demonstrasjon i vindauge</translation>
+        <source>Show usernames</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Demonstrasjon i vindauge</translation>
+        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</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">I denne modusen blir skjermen din vist i eit vindauge på alle maskiner. Brukerane kan byte mellom vidauga og kan dermed jobbe med andre ting samtidig.</translation>
+        <source>Export to text-file</source>
+        <translation type="unfinished">Eksporter til tekstfil</translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Lås/lås opp maskiner</translation>
+        <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>Lock all</source>
-        <translation type="unfinished">LÃ¥s alle</translation>
+        <source>Hide teacher computers</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">LÃ¥s opp alle</translation>
+        <source>Show/hide</source>
+        <translation type="unfinished">Vis / Gøym</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">For å få full oppmerksamheit frå alle brukarane kan du låse skrivebordet deira med denne knappen. I denn modusen er alle inngåande enheter (mus/tastatus) på klientmaskina låst og skjermen er svart.</translation>
+        <source>Edit settings</source>
+        <translation type="unfinished">Endre innstillingar</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Send tekstmelding</translation>
+        <source>Remove</source>
+        <translation type="unfinished">Fjern</translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished">Tekstmelding</translation>
+        <source>Show all computers in classroom</source>
+        <translation type="unfinished">Vis alle maskinane i klasseromet</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>
+        <source>Hide all computers in classroom</source>
+        <translation type="unfinished">Gøym alle maskinane frå klasseromet</translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Skru på maskinar</translation>
+        <source>Edit name</source>
+        <translation type="unfinished">Endre namn</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Skru på</translation>
+        <source>Remove classroom</source>
+        <translation type="unfinished">Fjern klasserom</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 samtidig.</translation>
+        <source>Add computer</source>
+        <translation type="unfinished">Legg til maskin</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Skru av maskiner</translation>
+        <source>Add classroom</source>
+        <translation type="unfinished">Legg til klasserom</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Skru av</translation>
+        <source>No configuration-file found</source>
+        <translation type="unfinished">Klarte ikkje finna oppsettsfila</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>
+        <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>Logon</source>
-        <translation type="unfinished">Logg på</translation>
+        <source>Error in configuration-file</source>
+        <translation type="unfinished">Oppsettsfila inneheld feil</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Fjernstyrt pålogging</translation>
+        <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>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Etter du har trykkt på denne knappen kan du skrive inn brukernamn og passord for å logge på ein angitt brukar på alle synlege maskiner.</translation>
+        <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>Support</source>
-        <translation type="unfinished">Støtte</translation>
+        <source>Select output-file</source>
+        <translation type="unfinished">Vel filnamn</translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Direkte støtte</translation>
+        <source>Text files (*.txt)</source>
+        <translation type="unfinished">Tekstfil (*.txt)</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">Dersom du treng å støtte nokon på ei spesifikk maskin, kan du trykkje på denne knappen og skrive riktig vertsnamn eller IP-adresse.</translation>
+        <source>Actions for selected</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Juster/still opp</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Handlingar</translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Juster vindauga og størrelsen deira</translation>
+        <source>Actions for %1</source>
+        <translation type="unfinished">Handlingar for %1</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">Når du trykkjer på denne knappen blir klientvindauga juster til maks størrelse. I tillegg blir alle vindauga stillt opp.</translation>
+        <source>New name for classroom</source>
+        <translation type="unfinished">Endre namn på klasserom</translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Automatisk oppsett</translation>
+        <source>Please enter a new name for classroom "%1".</source>
+        <translation type="unfinished">Skriv inn nytt namn for klasserom "%1".</translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Automatisk omjustering av vindauga og størrelsen deira</translation>
+        <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>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Når du trykkjer på denne knappen blir alle vindauga omjusterte og stillt opp.</translation>
+        <source>Missing classroom</source>
+        <translation type="unfinished">Mangler klasserom</translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Klarte ikkje finne ein eller fleire gyldige nøklar</translation>
+        <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>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Ingen autentiseringsnøkkel blei funnen eller dei eksisterande nøklane er øydelagde. Ver vennleg å lag eit nytt nøkkelpar ved hjelp av ICA (sjå dokumentasjonen på  http://italc.sf.net/wiki/index.php?title=Installation).
-Ellers vil du ikkje klare å kople deg til maskiner ved hjelp av iTALC.</translation>
+        <source>New classroom</source>
+        <translation type="unfinished">Nytt klasserom</translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">iTALC tenesta køyrar ikkje</translation>
+        <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>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Det ser ut til at inga iTALC teneste køyrer på denne maskina eller at autentiseringsnøkklane ikkje er satt opp korrekt. Tenesta er nødvendig for å køyre iTALC. Kontakt din administrator for å løyse problemet.</translation>
+        <source>Unknown state</source>
+        <translation type="unfinished">Ukjend status</translation>
     </message>
     <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">iTALC Hovedkontrol</translation>
+        <source>No user logged in</source>
+        <translation type="unfinished">Ingen brukarar logga på</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Fjernstyring</translation>
+        <source>Host unreachable</source>
+        <translation type="unfinished">Verten er utilgjengeleg</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished">Avslutt</translation>
+        <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>QApplication</name>
+    <name>ClientAction</name>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Klarte ikkje registrere tenesta '%1'.</translation>
+        <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>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>
+        <source>Are you sure want logout all users on all selected computers ?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Tenesta '%1' er allereie registrert.</translation>
+        <source>Logout user</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Klarte ikkje registrere tenesta '%1'.</translation>
+        <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>The service '%1' was successfully registered.</source>
-        <translation>Tenesta '%1' er no registrert.</translation>
+        <source>Are you sure want to reboot all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Klarte ikkje stoppe tenesta '%1'.</translation>
+        <source>Reboot computers</source>
+        <translation type="unfinished">Start maskinane om at</translation>
     </message>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Tenesta '%1' er fjerna.</translation>
+        <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>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Tenesta '%1' er ikkje registrert og kan difor ikkje fjernast.</translation>
+        <source>Are you sure want to power down all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>ClientSettingsDialog</name>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Klarte ikkje fjerne registreringa av tenesta '%1'.</translation>
+        <source>Invalid MAC-address</source>
+        <translation type="unfinished">Ugyldig MAC-adresse</translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Klarte ikkje finne tenesta '%1'.</translation>
+        <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>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 ?) - Ragistreringa av tenesta '%1' blei ikkje fjerna.</translation>
+        <source>Client settings</source>
+        <translation type="unfinished">Klient oppsett</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>
+        <source>IP/hostname</source>
+        <translation type="unfinished">IP / Vertnamn</translation>
     </message>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC Klient %1 på %2:%3</translation>
+        <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 ':' for specifying an optional port-number)</p></body></html></source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL</translation>
+        <source>Name</source>
+        <translation type="unfinished">Namn</translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>iTALC-Skjermbilete</translation>
+        <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></source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation>Om iTALC</translation>
+        <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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Om iTALC</span></p></body></html></translation>
+        <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></html></source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>Om</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Klasserom</translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Forfattarar</translation>
+        <source>Type</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Omsetjing</translation>
+        <source>Student computer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Lisens</translation>
+        <source>Teacher computer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Other/undefined computer</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
+        <source>Missing IP address/hostname</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
+        <source>You didn't specify an IP address or hostname for the computer!</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>classroomManager</name>
+    <name>Config</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Klasseromshandterar</translation>
+        <source>Interval between updates</source>
+        <translation type="unfinished">Intervall for oppdateringar</translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Bruk dette området til å handtere maskinar og klasserom.</translation>
+        <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 network-traffic and lower CPU-usage on this computer.</p></body></html></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>Her handterar du maskinar og klasserom. Bruk høgre musetast i lista for å legge til maskinar eller klasserom.</translation>
+        <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></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 mouse-cursor over 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;">Kontroller denne instillinga hvis du er plaga av ballongtips som kjem opp medan du beveger muspeikaren over knappar.</p></body></html></translation>
+    </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;">Her vel du kva som skal skje når du dobbeltklikker på ei klient-vindauge.</p></body></html></translation>
+    </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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Nokre endringar trer ikkje i kraft før du startar iTALC om att.</span></p></body></html></translation>
+    </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>Classrooms/computers</source>
-        <translation>Klasserom / maskiner</translation>
+        <source>Warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>IP-adresse</translation>
+        <source>Information, warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Klarte ikkje finna oppsettsfila</translation>
+        <source>Debug messages and everything else</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>Klarte ikkje opne oppsettfila %1. 
-Du må leggje til minst eit klasserom og ein maskin i klasseromshandteraren.</translation>
+        <source>Limit log file size</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Oppsettsfila inneheld feil</translation>
+        <source>MB</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>Feil med gjennomgang av oppsetts-fila %1. 
-Endre den eller slett den og legg til maskinar og klasserom igjen.</translation>
+        <source>Clear all log files</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>Feil med gjennomgang av oppsetts-fila %1. 
-Endre den eller slett.</translation>
+        <source>Desktop capturing</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Vis / Gøym</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Endre innstillingar</translation>
+        <source>Poll full screen</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Fjern</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Handlingar</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Vis alle maskinane i klasseromet</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Gøym alle maskinane frå klasseromet</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Endre namn</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Fjern klasserom</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Handlingar for %1</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Legg til maskin</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Legg til klasserom</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Endre namn på klasserom</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Skriv inn nytt namn for klasserom "%1".</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Skjermskot</translation>
     </message>
     <message>
-        <source>Are you sure want to remove classroom "%1"?
-All computers in it will be removed as well!</source>
-        <translation>Vil du verkeleg slette klasserom "%1"?
-Alle maskiner i klasserom blir også fjerna!</translation>
+        <source>Authentication methods</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Mangler klasserom</translation>
+        <source>Access key management</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>Før du kan leggje til maskiner må du ha minst eit klasserom.
-Vil du lage eit klasserom no?</translation>
+        <source>Logon settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Nytt klasserom</translation>
+        <source>&File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Skriv inn namn på klasserommet du opprettar.</translation>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Skjul lærarmaskiner</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Brukarnamn</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Vis brukarnamn</translation>
+        <source>&Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Bruk oppsprettmenyen (høgre musetast) for å leggje til / fjerne maskiner og/eller klasserom.</translation>
+        <source>Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Eksporter til tekstfil</translation>
+        <source>Ctrl+S</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>Bruk denne knappen for å eksportere ei liste over maskiner og brukarnamn til ei teksfil. Dukan bruke fila seinere for å samle filer etter at f.eks ei prøve er ferdig. Dette kan vere nødvendig fordi noke brukarar kan ha gjordt seg ferdig tidleg og logga av. Då klarar du ikkje å samle inn filene på slutten av prøva.</translation>
+        <source>L&oad settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Vel filnamn</translation>
+        <source>Ctrl+O</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Tekstfil (*.txt)</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">Om iTALC</translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation>Handlingar for valde</translation>
+        <source>About Qt</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Ukjend status</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Ingen brukarar logga på</translation>
+        <source>toolBar</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Verten er utilgjengeleg</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Køyrer demonstrasjon</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Skrivebordet er låst</translation>
+        <source>Load settings from file</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>Er du sikker på at du vil logge av alle brukarane på dei synlege maskinane ?</translation>
+        <source>XML files (*.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Er du sikker på du vil logge ut alle brukarar på dei valde maskinene ?</translation>
+        <source>Save settings to file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Logg av brukar</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Er du sikker på du vil starte alle dei synlege maskinene om at?</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Er du sikker på du vil starte dei valde maskinene om att?</translation>
+        <source>Configuration not writable</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot computers</source>
-        <translation>Start maskinene om at</translation>
+        <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>Are you sure want to power down all visible computers?</source>
-        <translation>Er du sikker på du vil skru av alle dei synlege maskinane?</translation>
+        <source>All settings were applied successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Er du sikker på du vil slå av alle dei valde maskinene?</translation>
+        <source>An error occured while applying settings!</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation>Oversikt</translation>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation>Fullskjermdemonstrasjon</translation>
+        <source>No write access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation>Demonstrasjon i vindauge</translation>
+        <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>Locked display</source>
-        <translation>LÃ¥st skjermbilete</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Klasserom</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation>Sjå i sanntid</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Bytt klasserom</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Fjernstyring</translation>
+        <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>Let student show demo</source>
-        <translation>La elev vise demonstrasjon</translation>
+        <source>Click on this button, to switch between classrooms.</source>
+        <translation type="unfinished">Trykk denne knappen for å byte mellom klasserom.</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation>Send tekstmelding</translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Oversiktsmodus</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation>Logg på brukar</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Oversikt</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Logg av brukar</translation>
+        <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>Take a snapshot</source>
-        <translation>Ta ei skjermbilete</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Fullskjerm demonstrasjon</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation>Skru på</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation>Omstart</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation>Skru av</translation>
+        <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>Execute commands</source>
-        <translation>Køyr kommando</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Demonstrasjon i vindauge</translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Klientinstillingar</translation>
+        <source>Window Demo</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Klientinstillingar</span></p></body></html></translation>
+        <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>General</source>
-        <translation>Generelt</translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Namn</translation>
+        <source>Lock all</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></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;">Maskinvare/MAC-Adressa til klient vert nytta kun til å slå på klienten</p></body></html></translation>
+        <source>Unlock all</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>IP / Vertsnamn</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specifying an optional port-number)</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;">fyll inn ei IP-Adresse eller eit vertsnamn som iTALC kan bruke for å nå klienten (bruk ':' (semikolon) for å spesifisere portnummer)</p></body></html></translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Send tekstmelding</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>MAC-Adresse</translation>
+        <source>Text message</source>
+        <translation type="unfinished">Tekstmelding</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation>Klasserom</translation>
+        <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>VPN</source>
-        <translation>VPN</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">Skru på maskinar</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Tilkopling</translation>
+        <source>Power on</source>
+        <translation type="unfinished">Skru på</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;">connection to hosts on the same level</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;">tilkopling til vert på same nivå</p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Her kan du spesifisere korleis verten er tilbopla iTALC-nettverket, f.eks. vert på same nivå. Normalt sett er klientmaskinene tilkopla via 100 MBit/s LAN, men det kan vere spesielle vertar som er IP-Port(gateway) for andre iTALC nettverk til andre skular eller til ein elev si heimemaskin. I slike tilfelle vil iTALC prøve å optimalisere bruken av bandbreidda.</p></body></html></translation>
+        <source>Power down computers</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation>Modem</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Skru av</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <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>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 Kbit/s</translation>
+        <source>Support</source>
+        <translation type="unfinished">Støtte</translation>
     </message>
     <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <source>Direct support</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
+        <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>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</translation>
+        <source>Adjust/align</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 if the host is the gateway for the subnet.</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;">Hak av dersom verten er IP-port(gateway) for dette nettverket(subnet).</p></body></html></translation>
+        <source>Adjust windows and their size</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host is &gateway for subnet</source>
-        <translation>Tenaren er &IP-port(gateway) for dette nettverket(subnet)</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Activate this option for at least one host in a subnet.</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;">Hak av her dersom det er minst ein tenar i dette nettverket(subnet).</p></body></html></translation>
+        <source>Auto view</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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år ein demo visast til meir enn ein tenar i eit ukjent nettverk, er det lurt å hake av dette valet for minst ein av dei involverte tenarane. På den måten blir all data sendt ein gong til demo-replikatoren som formidlar data vidare til alle andre klientar i nettverket. Spesiellt på 'låg bandbreidde' brukarar er denne funksjonen nyttig. Vanlegvis bør du aktivere denne funksjonen for IP-Porten(gateway) på det nettverket(sjå ovanfor)</p></body></html></translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Funger som &Demo-replikator</translation>
+        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>&Avbryt</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Fjernkontroll</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Type</translation>
+        <source>Could not modify the autostart property for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Elevmaskin</translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher computer</source>
-        <translation>Lærarmaskin</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Anna/Uspesifisert maskin</translation>
+        <source>Debugging</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></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;">Valfritt kallenamn på vertsmaskina, dette blir vist i iTALC.</p></body></html></translation>
+        <source>Enable desktop switching for screen lock (experimental)</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Manglar IP-adresse / vertnamn</translation>
+        <source>Log to standard error output</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Du skreiv ikkje inn IP-adresse eller vertsnamn på maskina!</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Ugyldig MAC-adresse</translation>
+        <source>Backend</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>Du skreiv ikkje inn ei gyldig MAC-adresse. La felte stå tomt eller skriv ei gyldig MAC-adresse (skriv slik:"00:aa:11:bb:22:cc)</translation>
+        <source>VNC reflector</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Køyr kommando på klient(ane)</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Skriv inn kommando som klient(en/ane) skal køyre:</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Avbryt</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>Køy&r!</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Intervall for oppdateringar</translation>
+        <source>Allow connections from localhost only</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 network-traffic and lower CPU-usage on this computer.</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;">Her kan du sette intervallet mellom oppdateringar av klienten. Høgare verdiar resulterar i lågare nettverkstrafikk og lågare CPU-bruk på denne maskina. </p></body></html></translation>
+        <source>Key file authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 sekund</translation>
+        <source>ACL-based logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> sekund</translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Kvalitet på demonstrasjonsmodus</translation>
+        <source>Private key file base directory</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">Her kan du endre kvalieten på skjermbilete i demomodus. Lågare kvalitet resulterar i lågare CPU-bruk og lågare nettverkstrafikk. Høg kvalitet kan gjere maskina di treg og gi ein hakkete oppleving av bilete under demonstrasjonen. Du bør eksperimentere med instillingane for å finne den beste.</p></body></html></translation>
+        <source>Launch key file assistant</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Lav (15 bit)</translation>
+        <source>Manage permissions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Middels (18 bit)</translation>
+        <source>Test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Høg (Truecolor)</translation>
+        <source>Access confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User interface</source>
-        <translation>Brukargrensesnitt</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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;">Ikkje vis ballongtips for arbeidslinjeknappar</p></body></html></translation>
+        <source>Logon authentication</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 mouse-cursor over 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;">Kontroller denne instillinga dersom du er plaga av ballongtips som kjem opp medan du bevegar muspeikaren over knappar.</p></body></html></translation>
+        <source>Allow same user to access desktop without confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Ingen ballongtips</translation>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Di rolle (treng tilsvarande nøklar!)</translation>
+        <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><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;">Her kan du velje di rolle. Gjer kun endringar her dersom du veit kva du gjer. Ellers kan det hende du ikkje får tilgang til klientane før du sett tilbake til d gamle rolle.</p></body></html></translation>
+        <source>1)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Lærar</translation>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Administrator</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Støtte</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Anna</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Oppsett for pålogging av fleire brukarar om gongen</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Domene</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Handling for dobbeltklikk i klientvindauget</translation>
+        <source>Click the following button and save the file to a known location.</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><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;">Her vel du kva som skal skje når du dobbeltklikker i eit klientvindauge.</p></body></html></translation>
+        <source>Generate bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Fjernstyring</translation>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>View live in fullscreen</source>
-        <translation>Vis sanntidsbilete i fullskjerm</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Nokre endringar trer ikkje i kraft før du startar iTALC om att.</span></p></body></html></translation>
+        <source>Restart iTALC Service</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 teksten på verktøylinjeknappane</p></body></html></translation>
+        <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>No texts on toolbar-buttons</source>
-        <translation>Ingen tekst på verktøylinjeknappane</translation>
+        <source>Starting iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>iTALC oppsett</translation>
+        <source>Stopping iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>I dette arbeidsområdet endrar du iTALC etter eige behov.</translation>
+        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Demo</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
-        <translation>ISD-tenarfeil</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>ISD-tenaren kunne ikkje startas fordi port %1 allereie er i bruk. Kontroller at ingen andre program nyttar porten og prøv igjen.</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Bekreft tilgang</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Nokon på verten %1 ynskjer å få tilgang til skjermbilete. Ynskjer du å gje han/ho tilgang?</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Aldri for denne økta</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Alltid for denne økta</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>Beskjed frå lærar</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Autentiseringsfeil</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Nokon (IP: %1) prøvde å få tilgang til denne maskina, men kunne ikkje autentisera seg!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Skjermbilete</translation>
+        <source>Could not contact iTALC service</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>Klarte ikkje lagre skjermbilete då katalogen %1 enten ikkje finst eller kunne opprettast.</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>skjermlås</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Beskjed frå lærar</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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;">Velkommen til iTALC </span></p></body></html></translation>
+        <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;">Velkommen til 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>Dette er dei forskjellege arbeidsområda. Kvar knapp er kopla opp mot eit arbeidsområde. Trykk på knappane for å sjå igjennom dei.</translation>
+        <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>i arbeidsområdet Skjermbilete kan du behandle og sjå skjermbilete du har teke.</translation>
+        <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>Endringar i oppsettet til iTALC blir for det meste gjort i arbeidsområdet for oppsett.</translation>
+        <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>Om iTALC</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>I arbeidsområdet for Klasserom, kan du endre på klasserom og maskiner. Du kan også kva for brukarar som er pålogga.</translation>
+        <translation type="unfinished">Om iTALC</translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Oversikt</translation>
+        <translation type="unfinished">Oversikt</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Grunnleggjande informasjon om iTALC og korleis det kan brukast.</translation>
+        <translation type="unfinished">Grunnleggjande informasjon om iTALC og korleis det kan brukast.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation type="unfinished">Brukarnamn</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation type="unfinished">Passord</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Dei nyleg lagte eller importerte nøklane må lagras ein stad, det er anbefalt å lagra dei i dei forvalte katalogane.</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Klarte ikkje registrere tenesta '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Katalog den offentlege nøkkelen skal lagras i</translation>
+        <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>Directory to store private key in</source>
-        <translation>Katalog den private nøkkelen skal lagras i</translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Tenesta '%1' er allereie registrert.</translation>
     </message>
     <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Klarte ikkje registrere tenesta '%1'.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Eksporter privat nøkkel og</translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Tenesta '%1' er no registrert.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Klarte ikkje stoppe tenesten '%1'.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Tenesta '%1' er fjerna.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <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>Import public key of master computer</source>
-        <translation>Importer offentleg nøkkel frå hovudmaskinen</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Klarte ikkje fjerne tenesta '%1'.</translation>
     </message>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Vel mappe den offentlege nøkkelen skal eksporterast til:</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Klarte ikkje finne tenesta '%1'.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Bevar alle nøklar (Berre når du oppdaterar ein eksisterande installasjon!)</translation>
+        <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>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
+        <source>iTALC Client %1 on %2:%3</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidget</name>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Vis sanntidsbilete (%1 på vert %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Kontroller (%1 på vert %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation>Ukjend brukar</translation>
+        <translation type="unfinished">Ukjent brukar</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation>Berre vis bilete</translation>
+        <translation type="unfinished">Berre vis bilete</translation>
     </message>
     <message>
-        <source>Lock student</source>
-        <translation>LÃ¥s elev/student</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Fjernkontroll</translation>
     </message>
     <message>
-        <source>Snapshot</source>
-        <translation>Skjermbilete</translation>
+        <source>Lock student</source>
+        <translation type="unfinished">LÃ¥s elev/student</translation>
     </message>
     <message>
-        <source>Fullscreen</source>
-        <translation>Fullskjerm</translation>
+        <source>Unlock student</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation>Avslutt</translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Skjermskot</translation>
     </message>
     <message>
-        <source>Connecting %1</source>
-        <translation>Koplar til %1</translation>
+        <source>Fullscreen</source>
+        <translation type="unfinished">Fullskjerm</translation>
     </message>
     <message>
-        <source>Connected.</source>
-        <translation>Tilkopla.</translation>
+        <source>Window</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Fjernstyring</translation>
+        <source>Quit</source>
+        <translation type="unfinished">Avslutt</translation>
     </message>
     <message>
-        <source>Unlock student</source>
-        <translation>LÃ¥s elev/student</translation>
+        <source>Connecting %1</source>
+        <translation type="unfinished">Koplar til %1</translation>
     </message>
     <message>
-        <source>Window</source>
-        <translation>Vindauge</translation>
+        <source>Connected.</source>
+        <translation type="unfinished">Tilkobla.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Fjernstyrt pålogging</translation>
-    </message>
+    <name>RemoteLogonDialog</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:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Fjernstyrt pålogging</span></p></body></html></translation>
+        <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>Bruk felta under til å skrive inn brukarnamn, passord og eventuelt domenenamn. Denne informasjonen vert brukt til å logge på maskinene.</translation>
+        <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>Brukarnamn</translation>
+        <translation type="unfinished">Brukarnamn</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>Passord</translation>
+        <translation type="unfinished">Passord</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation>Domene</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Avbryt</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <translation type="unfinished">Domene</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Bekreft overskriving</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Er du sikker på at du vil skrive over %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Avbryt installasjonen</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>Next</source>
-        <translation>Neste ></translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Fullfør</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Avslutt</translation>
-    </message>
-    <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Vel katalog for offentleg nøkkel</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Vel katalog for privat nøkkel</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Vel katalog offentleg nøkkel skal eksporterast til</translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Skjermskot</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>Skjermbilete</translation>
+        <translation type="unfinished">Skjermskot</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Dette arbeidsområdet er til å handtere skjermbilete.</translation>
+        <translation type="unfinished">Dette arbeidsområdet er til å handtere skjermskot.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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;">Alle skjermskota du har laga er her. Lag fleire skjermskot med oppsprettmenyen på klient-vindauge. Knappane under er til å handtera skjermskota. </p></body></html></translation>
+        <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;">Alle skjermskota du har laga er her. Lag fleire skjermskot med hjelp av oppsprettmenyen på klient-vindauge. Knappane under er til å handtera skjermskota. </p></body></html></translation>
     </message>
     <message>
         <source>User:</source>
-        <translation>Brukar:</translation>
+        <translation type="unfinished">Brukar:</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation>Vert:</translation>
+        <translation type="unfinished">Vert:</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation>Dato:</translation>
+        <translation type="unfinished">Dato:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>Tid:</translation>
+        <translation type="unfinished">Tid:</translation>
     </message>
     <message>
-        <source>Show snapshot</source>
-        <translation>Vis skjermbilete</translation>
-    </message>
-    <message>
-        <source>Delete snapshot</source>
-        <translation>Fjern skjermbilete</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Frisk opp liste</translation>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation>Støtte</translation>
+        <translation type="unfinished">Støtte</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Skriv inn IP-adressa eller namnet på maskina der personen du ynskjer å støtte sitt.</translation>
+        <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>OK</source>
-        <translation>OK</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Send tekstmelding</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Avbryt</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Støtte </span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Kobler til %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Send tekstmelding</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Oversikt</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Send tekstmelding </span></p></body></html></translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Fullskjerm demonstrasjon</translation>
     </message>
     <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Skriv beskjed til alle valte brukarar i feltet under.</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Demonstrasjon i vindauge</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">LÃ¥s skjermbilete</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>View live</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Avbryt</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Fjernkontroll</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">La elev vise demonstrasjon</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Koplar til %1 ...</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Send tekstmelding</translation>
+    </message>
+    <message>
+        <source>Logout user</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
+        <source>Take a snapshot</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Avbryt</translation>
+        <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>Back</source>
-        <translation>< Tilbake</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Skru av</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Neste</translation>
+        <source>Execute commands</source>
+        <translation type="unfinished">Køyr kommando</translation>
     </message>
 </context>
 </TS>
diff --git a/lib/resources/pl.qm b/lib/resources/pl.qm
index 59288e1..3835193 100644
Binary files a/lib/resources/pl.qm and b/lib/resources/pl.qm differ
diff --git a/lib/resources/pl.ts b/lib/resources/pl.ts
index 469f002..2fb67aa 100644
--- a/lib/resources/pl.ts
+++ b/lib/resources/pl.ts
@@ -2,1440 +2,1767 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="pl_PL">
 <context>
-    <name>MainToolBar</name>
+    <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 utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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">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-2011 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 ':' for specifying an optional port-number)</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;">wprowadź adres IP lub nazwę komputera aby podłączyć się do klienta (użyj ':' aby wprowadzić niestadardowy port)</p></body></html></translation>
+    </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></source>
+        <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></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;">Adres MAC komputera  - potrzebny wyłącznie do zdalnego włączenia komputera</p></body></html></translation>
+    </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 network-traffic and lower CPU-usage on this computer.</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;">Tutaj możesz ustawić częstotliwość aktualizacji klientów. Wyższe wartości zmniejszą użycie pasma transmisyjnego oraz zmniejszą obciążenie procesora.</p></body></html></translation>
+    </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></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 mouse-cursor over 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;">Zaznacz tą opcję aby wyłączyć podpowiedzi pojawiające się gdy kursor myszy przesuwa się nad przyciskami paska narzędzi.</p></body></html></translation>
+    </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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Niektóre zmniany zostaną zastosowane dopiero po ponownym uruchomieniu programu iTALC.</span></p></body></html></translation>
+    </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>MainWindow</name>
+    <name>ItalcVncConnection</name>
     <message>
-        <source>MainWindow</source>
+        <source>VNC authentication failed because of too many authentication tries.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>toolBar</source>
+        <source>VNC authentication failed.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>VNC server closed connection.</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>KeyFileAssistant</name>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Brak uprawnień do zapisu</translation>
+        <source>iTALC Access Key Assistant</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>
+        <source>Create/import iTALC access keys</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Pracownia</translation>
+        <source>This assistant will help you to create or import iTALC access keys.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Zmień pracownię</translation>
+        <source>How does it work?</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">Kliknij aby otworzyć menu umożliwiające wybór i zmianę pracowni.</translation>
+        <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>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Kliknij ten przycisk aby zmienić pracownię.</translation>
+        <source>Assistant mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Tryb przeglÄ…du</translation>
+        <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>Overview</source>
-        <translation type="unfinished">PrzeglÄ…d</translation>
+        <source>Create new access keys (master computer)</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">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>
+        <source>assistantModeButtonGroup</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Demo pełnoekranowe</translation>
+        <source>Import public key (client computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Demo</translation>
+        <source>Select user role</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">WYŁĄCZ DEMO</translation>
+        <source>Please select a user role for which to create or import the access keys:</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">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>
+        <source>Teacher</source>
+        <translation type="unfinished">Personel</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demo okienkowe</translation>
+        <source>Administrator</source>
+        <translation type="unfinished">Administrator</translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Demo (okno)</translation>
+        <source>Support team member</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">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>
+        <source>Other</source>
+        <translation type="unfinished">Inna</translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">(Od)Blokuj pulpity</translation>
+        <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>Lock all</source>
-        <translation type="unfinished">Blokuj wszystkie</translation>
+        <source>Directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">ODBLOKUJ</translation>
+        <source>Export public key part (master computer)</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">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>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Send text message</source>
+        <source>Use custom destination directory for access keys</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished">Wiadomość</translation>
+        <source>Please specify the location of the public access key to be imported.</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">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>
+        <source>Summary</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">WÅ‚Ä…cz komputery</translation>
+        <source>The following actions will be taken:</source>
+        <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Power on</source>
-        <translation type="unfinished">WÅ‚Ä…cz</translation>
+    <message utf8="true">
+        <source>• Create new access keys</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 utf8="true">
+        <source>• Import public access key from</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Wyłącz komputery</translation>
+        <source><unknown></source>
+        <translation type="unfinished"></translation>
     </message>
-    <message>
-        <source>Power down</source>
-        <translation type="unfinished">Wyłącz</translation>
+    <message utf8="true">
+        <source>• Write access key(s) to</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">Aby wyłączyć wszystkie widoczne komputery kliknij ten przycisk.</translation>
+    <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>Logon</source>
-        <translation type="unfinished">Logowanie</translation>
+        <source>Select directory in which to export the public key</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Zdalne logowanie</translation>
+        <source>Key files (*.key.txt)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Kliknij aby wprowadzić nazwę użytkownika i hasło do zalogowania na wszystkich widocznych komputerach.</translation>
+        <source>Invalid public key</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Support</source>
-        <translation type="unfinished">Obsługa</translation>
+        <source>The selected file does not contain a valid public iTALC access key!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Pomoc zdalna</translation>
+        <source>Select destination directory</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">Wpisz adres IP lub nazwę komputera, przy którym znajduje się osoba, której chcesz udzielić pomocy.</translation>
+        <source>Access key creation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Dopasuj/rozmieść</translation>
+        <source>Could not remove previously existing file %1.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Dopasuj okna i ich wielkość</translation>
+        <source>Failed exporting public access key from %1 to %2.</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">Kliknięcie tego przycisku ustawi największy możliwy rozmiar okien dla komputerów-klientów. Wszystkie okna zostaną wyrównane.</translation>
+        <source>Access keys were created and written successfully to %1 and %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Widok auto</translation>
+        <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>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Automatycznie rozmieść okna i dopasuj ich wielkość</translation>
+        <source>Public key import</source>
+        <translation type="unfinished"></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>
+        <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>No valid keys found</source>
-        <translation type="unfinished">Brak ważnych kluczy</translation>
+        <source>The public key was successfully imported to %1.</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>LockWidget</name>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Brak ważnych kluczy do autoryzacji lub stare klucze zostały uszkodzone/skasowane. 
-Stwórz nową parę kluczy używając ICA (dokumentacja na http://italc.sf.net/wiki/index.php?title=Installation). Bez tego nie uzyskasz dostępu do komputerów używających iTALC.</translation>
+        <source>screen lock</source>
+        <translation type="unfinished">blokada ekranu</translation>
     </message>
+</context>
+<context>
+    <name>LogonGroupEditor</name>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">Usługa iTALC nie działa</translation>
+        <source>Logon group editor</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Prawdopodobnie usługa iTALC nie działa na tym komputerze lub klucze autoryzacji nie są poprawnie skonfigurowane. Ta usługa jest wymagana aby uruchomić iTALC. Skontaktuj się z administratorem aby naprawić ten problem.</translation>
+        <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>iTALC Master Control</source>
+        <source>All groups</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
+        <source>...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished">Wyjdź</translation>
+        <source>Groups with iTALC privileges</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>
+    <name>MainToolBar</name>
     <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Usługa '%1' jest już zarejestrowana.</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Polecenia</translation>
     </message>
+</context>
+<context>
+    <name>MainWindow</name>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Usługa '%1' nie mogła zostać zarejestrowana.</translation>
+        <source>General</source>
+        <translation type="unfinished">Ogólne</translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Pomyślnie zarejestrowano usługę '%1'.</translation>
+        <source>Quit</source>
+        <translation type="unfinished">Wyjdź</translation>
     </message>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Usługa '%1' nie może zostać zatrzymana.</translation>
+        <source>iTALC Management Console</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Usługa '%1' została wyrejestrowana.</translation>
+        <source>iTALC Server</source>
+        <translation type="unfinished"></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>
+        <source>Paths</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Usługa '%1' nie może zostać wyrejestrowana.</translation>
+        <source>Authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Nie można znaleźć usługi '%1'.</translation>
+        <source>iTALC Service</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>Manager usług nie odpowiada (masz odpowiednie uprawnienia?) - usługa '%1' nie została wyrejestrowana.</translation>
+        <source>Hide tray icon</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>Manager usług nie odpowiada (masz odpowiednie uprawnienia?) - usługa '%1' nie została zatrzymana.</translation>
+        <source>Autostart</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation></translation>
+        <source>Additional arguments</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>Zdjęcia iTALC</translation>
+        <source>Start service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation>Informacje o iTALC</translation>
+        <source>Stop service</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Informacje o iTALC</span></p></body></html></translation>
+        <source>State:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>Informacje o</translation>
+        <source>Stopped</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;"><span style=" font-size:11pt;">iTALC - Intelligent Teaching And Learning with Computers</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Copyright (c) 2004-2010 Tobias Doerffel</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:11pt;">iTALC - Intelligent Teaching And Learning with Computers (Inteligentne nauczanie i uczenie siÄ™ z komputerami)</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Copyright (c) 2004-2007 Tobias Doerffel</p></body></html> {1"?} {9p?} {400;?} {0p?} {0p?} {0p?} {0p?} {0;?} {0p?} {11p?} {0p?} {0p?} {0p?} {0p?} {0;?} {0p?} {11p?} {0p?} {0p?} {0p?} {0p?} {0;?} {0p?} {11p?} {2004-2010 ?}</translation>
+        <source>Logging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Autorzy</translation>
+        <source>Log file directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>TÅ‚umaczenie</translation>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Licencja</translation>
+        <source>Log level</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Nothing</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;">Current language not translated yet (or native English).</p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">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!</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;">Polską wersję opracował Robert Radko.</p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Jeśli chcesz przetłumaczyć iTALC na inny język lub poprawić niniejsze tłumaczenie, skontaktuj się z twórcą iTALC Tobiasem Doerffelem.</p></body></html></translation>
+        <source>Only critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>ZarzÄ…dzanie pracowniÄ…</translation>
+        <source>Errors and critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Z tego miejsca możesz łatwo zarządzać swoimi komputerami i pracowniami.</translation>
+        <source>Warnings and errors</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>To stąd zarządzasz komputerami i pracowniami. Możesz dodać komputery lub pracownie klikając prawym klawiszem na tej liście.</translation>
+        <source>Information, warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Pracownie/komputery</translation>
+        <source>Debug messages and everything else</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>Adres IP</translation>
+        <source>Limit log file size</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Brak pliku konfiguracji</translation>
+        <source>MB</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>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>
+        <source>Clear all log files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>BÅ‚Ä…d w pliku konfiguracji</translation>
+        <source>Desktop capturing</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>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>
+        <source>Enable capturing of layered (semi-transparent) windows</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>BÅ‚Ä…d w czasie przetwarzania pliku konfiguracji %1. 
-Popraw go lub usuń.</translation>
+        <source>Poll full screen</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Pokaż/ukryj</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Edycja</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Usuń</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Polecenia</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Pokaż wszystkie komputery w pracowni</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Ukryj wszystkie komputery w pracowni</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Zmień nazwę</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Usuń pracownię</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Polecenia dla %1</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Dodaj komputer</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Dodaj pracowniÄ™</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Zdjęcia</translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Nowa nazwa dla pracowni</translation>
+        <source>Authentication methods</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Wprowadź nową nazwę dla pracowni "%1".</translation>
+        <source>Access key management</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>Usunąć pracownię "%1" ? 
-Skasujesz również wszystkie komputery w niej!</translation>
+        <source>Logon settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Brak pracowni</translation>
+        <source>&File</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>Aby dodać komputery musisz stworzyć co najmniej jedną pracownię. 
-Chcesz stworzyć pracownię teraz?</translation>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Nowa pracownia</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Wprowadz nazwÄ™ nowej pracowni.</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Ukryj komputery personelu</translation>
+        <source>&Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Użytkownicy</translation>
+        <source>Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Pokaż użytkowników</translation>
+        <source>Ctrl+S</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Użyj menu kontekstowego (prawy przycisk myszy) aby dodać/usunąć pracownie.</translation>
+        <source>L&oad settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Eksport do pliku tekstowego</translation>
+        <source>Ctrl+O</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>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>
+        <source>About iTALC</source>
+        <translation type="unfinished">Informacje o iTALC</translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Wybierz plik wyjściowy</translation>
+        <source>About Qt</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Pliki tekstowe (*.txt)</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for selected</source>
+        <source>toolBar</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Stan nieznany</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Brak zalogowanego użytkownika</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Komputer niedostępny</translation>
+        <source>Load settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Demo w trakcie</translation>
+        <source>XML files (*.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Pulpit zablokowany</translation>
+        <source>Save settings to file</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">Czy chcesz wylogować użytkowników na wszystkich widocznych komputerach?</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
+        <source>There are unsaved settings. Quit anyway?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Wyloguj użytkownika</translation>
+        <source>Configuration not writable</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Czy chcesz usunąć wszystkie widoczne komputery?</translation>
+        <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>Are you sure want to reboot all selected computers?</source>
+        <source>All settings were applied successfully.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Zrestartuj komputery</translation>
+        <source>An error occured while applying settings!</source>
+        <translation type="unfinished"></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>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
+        <source>No write access</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">PrzeglÄ…d</translation>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished">Demo pełnoekranowe</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Pracownia</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demo okienkowe</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Zmień pracownię</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Zablokuj wyświetlanie</translation>
+        <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>View live</source>
-        <translation type="unfinished">Widok na żywo</translation>
+        <source>Click on this button, to switch between classrooms.</source>
+        <translation type="unfinished">Kliknij ten przycisk aby zmienić pracownię.</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished"></translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Tryb przeglÄ…du</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Demo od użytkownika</translation>
+        <source>Overview</source>
+        <translation type="unfinished">PrzeglÄ…d</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
+        <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>Logon user</source>
-        <translation type="unfinished">Zaloguj użytkownika</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Wyloguj użytkownika</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished">Demo</translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Zrób zdjęcie</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished">WYŁĄCZ DEMO</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">WÅ‚Ä…cz</translation>
+        <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>Reboot</source>
-        <translation type="unfinished">Zrestartuj</translation>
+        <source>Window demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Wyłącz</translation>
+        <source>Window Demo</source>
+        <translation type="unfinished">Demo (okno)</translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Wykonaj polecenie</translation>
+        <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>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Edycja klienta</translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">(Od)Blokuj pulpity</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Ogólne</translation>
+        <source>Lock all</source>
+        <translation type="unfinished">Blokuj wszystkie</translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Nazwa</translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">ODBLOKUJ</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></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;">Adres MAC komputera  - potrzebny wyłącznie do zdalnego włączenia komputera</p></body></html></translation>
+        <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>IP/hostname</source>
-        <translation>IP/nazwa komputera</translation>
+        <source>Send text message</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 ':' for specifying an optional port-number)</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;">wprowadź adres IP lub nazwę komputera aby podłączyć się do klienta (użyj ':' aby wprowadzić niestadardowy port)</p></body></html></translation>
+        <source>Text message</source>
+        <translation type="unfinished">Wiadomość</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>Adres MAC</translation>
+        <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>Classroom</source>
-        <translation>Pracownia</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">WÅ‚Ä…cz komputery</translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <source>Power on</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Połączenie</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">connection to hosts on the same level</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;">połączenie do komputerów na tym samym poziomie</p></body></html></translation>
+        <source>Power down computers</source>
+        <translation type="unfinished">Wyłącz komputery</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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Tutaj możesz określić jak jest podłączony ten komputer do sieci iTALC, np. komputer na tym samym poziomie. Z reguły jest to sieć lokalna 100Mb/s, ale mogą być też bramki do innych sieci iTALC w innych placówkach lub komputery domowe. W takich przypadkach iTALC stara się zoptymalizować użycie pasma.</p></body></html></translation>
+        <source>Power down</source>
+        <translation type="unfinished">Wyłącz</translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation>Analogowe</translation>
+        <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>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Support</source>
+        <translation type="unfinished">Obsługa</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <source>Direct support</source>
+        <translation type="unfinished">Pomoc zdalna</translation>
     </message>
     <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <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>100 MBit/s LAN</source>
-        <translation>LAN 100 MBit/s</translation>
+        <source>Adjust/align</source>
+        <translation type="unfinished">Dopasuj/rozmieść</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>LAN 1000 MBit/s</translation>
+        <source>Adjust windows and their size</source>
+        <translation type="unfinished">Dopasuj okna i ich wielkość</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 if the host is the gateway for the subnet.</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;">Sprawdź czy komputer jest bramką dla podsieci.</p></body></html></translation>
+        <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>Host is &gateway for subnet</source>
-        <translation>Komputer jest bramkÄ… &gateway dla podsieci</translation>
+        <source>Auto view</source>
+        <translation type="unfinished">Widok auto</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;">Activate this option for at least one host in a subnet.</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;">Aktywuj tÄ™ opcjÄ™ dla przynajmniej 1 komputera w podsieci.</p></body></html></translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished">Automatycznie rozmieść okna i dopasuj ich wielkość</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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;">Wyświetlając demo dla więcej niż jednego komputera w sieci zdalnej zbawienne okaże się włączenie tej opcji dla przynajmniej jednego kompuera. Dzięki temu wszystkie dane są wysyłane tylko raz do pośrednika (replikatora), który przesyła dane pozostałym komputerom w swojej sieci. Użycie tej opcji na wolnych łączach jest nieodzowne. Z reguły powinieneś uruchomić tą opcję na bramce podsiei (zobacz opcję powyżej).</p></body></html></translation>
+        <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>Act as &demo replicator</source>
-        <translation>Działaj jako pośrednik dla trybu &demo</translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Remote control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>&Anuluj</translation>
+        <source>Could not modify the autostart property for the iTALC Service.</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Edycja klienta</span></p></body></html></translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Typ</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Komputer użytkownika</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher computer</source>
-        <translation>Komputer personelu</translation>
+        <source>Enable desktop switching for screen lock (experimental)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Inny/niezdefiniowany komputer</translation>
+        <source>Log to standard error output</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></source>
+        <source>Log to Windows event log</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Brak adresu IP lub nazwy komputera</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Nie podałeś adresu IP lub nazwy komputera!</translation>
+        <source>VNC reflector</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Błędny adres MAC</translation>
+        <source>iTALC 1 demo server</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>Podałeś niepoprawny adres MAC. Pozostaw puste pole lub wprowadź adres MAC w postaci "0A:1B:2C:3D:4E:5F".</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Cancel</source>
-        <translation>Anuluj</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Uruchom polecenia na kliencie</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Wprowadź polecenia do wykonania na kliencie/klientach:</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Wykonaj!</translation>
+        <source>Key file authentication</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Częstotliwość aktualizacji</translation>
+        <source>ACL-based logon authentication</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 network-traffic and lower CPU-usage on this computer.</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;">Tutaj możesz ustawić częstotliwość aktualizacji klientów. Wyższe wartości zmniejszą użycie pasma transmisyjnego oraz zmniejszą obciążenie procesora.</p></body></html></translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 sekunda</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> second/y</translation>
+        <source>Launch key file assistant</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User interface</source>
-        <translation>Interfejs użytkownika</translation>
+        <source>Manage permissions</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></body></html></translation>
+        <source>Test</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 mouse-cursor over 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;">Zaznacz tą opcję aby wyłączyć podpowiedzi pojawiające się gdy kursor myszy przesuwa się nad przyciskami paska narzędzi.</p></body></html></translation>
+        <source>Access confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Wyłącz podpowiedzi</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Niektóre zmniany zostaną zastosowane dopiero po ponownym uruchomieniu programu iTALC.</span></p></body></html></translation>
+        <source>Logon authentication</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">Tutaj ustawisz pożądaną jakość obrazu w trybie demo. Niższa jakość zmniejsza ociążenie sieci i procesora, wyższa jakość może zwolnić Twój komputer i zmniejszyć częstotliwość wyświetlania klatek na komputerach klientach. Powinieneś sprawdzić kilka ustawień aby wybrać optymalne wartości.</p></body></html></translation>
+        <source>Allow same user to access desktop without confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Niska (15 bit)</translation>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Åšrednia (18 bit)</translation>
+        <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>High (Truecolor)</source>
-        <translation>Wysoka (Truecolor)</translation>
+        <source>1)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Twoja rola (wymaga odpowiednich kluczy)</translation>
+        <source>Clear the logfiles in the "General" section.</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><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>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Personel</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Administrator</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Asystent</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Inna</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Jakość trybu demo</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Ustawienia wielokrotnego logowania</translation>
+        <source>Generate bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Domena</translation>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Polecenie podwójne kliknięcie na okienku klienta</translation>
+        <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><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;">Tutaj ustawisz co ma się stać gdy klikniesz da razy na okienku klienta.</p></body></html></translation>
+        <source>Restart iTALC Service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Zdalna kontrola</translation>
+        <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>View live in fullscreen</source>
-        <translation>Pełnoekranowy podgląd na żywo</translation>
+        <source>Starting iTALC service</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>
+        <source>Stopping iTALC service</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
+        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Twoja konfiguracja iTALC</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>Tutaj dostosujesz iTALC do swoich potrzeb.</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>Demo iTALC</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>Message from teacher</source>
-        <translation>Wiadomość od personelu</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Użytkownik komputera %1 chce otrzymać dostęp do Twojego ekranu. Czy chcesz dać mu dostęp?</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Nigdy w czasie tej sesji</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Zawsze w czasie tej sesji</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Potwierdź dostęp</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>ISD-server error</source>
-        <translation>BÅ‚Ä…d serwera ISD</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>Serwer ISD nie może zostać uruchomiony ponieważ port %1 jest w użyciu. Sprawdź, czy inna aplikacja nie używa tego portu i spróbuj ponownie.</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>BÅ‚Ä…d uwierzytelnienia</translation>
+        <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>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Ktoś (IP %1) próbował uzyskać dostęp do tego komputera, ale nie mógł uwierzytelnić się!</translation>
+        <source>Could not contact iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Zdjęcie</translation>
+        <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>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>Nie można wykonać zdjęcia ponieważ katalog %1 nie istanieje i nie można go stwożyć.</translation>
+        <source>Authentication impossible</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>blokada ekranu</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Wiadomość od personelu</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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">
+        <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>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>
+        <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>Obszar zdjęć jest bardzo użytecznym narzędziem. Pozwala zarządzać ci zdjęciami ekranów, które zrobiłeś.</translation>
+        <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>Oczywiście możesz skonfigurować iTALC. Zasadniczo odbywa się to w obszarze konfiguracyjnym.</translation>
+        <translation type="unfinished">Oczywiście możesz skonfigurować iTALC. Zasadniczo odbywa się to w obszarze konfiguracyjnym.</translation>
     </message>
     <message>
         <source>About iTALC</source>
-        <translation>Informacje o iTALC</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>To stąd zarządzasz komputerami i pracowniami. Możesz też sprawdzić, kto jest zalogowany.</translation>
+        <translation type="unfinished">Informacje o iTALC</translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>PrzeglÄ…d</translation>
+        <translation type="unfinished">PrzeglÄ…d</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Kilka podstawowych onformacji o iTALC i o tym, jak go używać.</translation>
+        <translation type="unfinished">Kilka podstawowych onformacji o iTALC i o tym, jak go używać.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
+        <source>Username</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation type="unfinished">Hasło</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Utworzone lub zaimportowane klucz(e) muszą być gdzieś zainstalowane. Zaleca się użycie domyślnych katalogów.</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>Klient iTALC %1 na %2:%3</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Katalog dla kluczy publicznych</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Nie można zarejestrować usługi '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation>Katalog dla kluczy prywatnych</translation>
+        <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>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Usługa '%1' jest już zarejestrowana.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Wyeksportuj również klucz prywatny</translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Usługa '%1' nie mogła zostać zarejestrowana.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Pomyślnie zarejestrowano usługę '%1'.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Usługa '%1' nie może zostać zatrzymana.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Usługa '%1' została wyrejestrowana.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Importuj klucz publiczny z komputera zarzÄ…dcy</translation>
+        <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>Choose location of exported public key:</source>
-        <translation>Wybierz lokalizacjÄ™ wyeksportowanego klucza publicznego:</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Usługa '%1' nie może zostać wyrejestrowana.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Zachowaj wszystkie klucze (tylko przy aktualizacji istniejÄ…cej instalacji!)</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Nie można znaleźć usługi '%1'.</translation>
     </message>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
+        <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>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Podgląd bezpośredni (%1 na komputerze %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Pulpit zdalny (%1 na komputerze %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation>nieznany użytkownik</translation>
+        <translation type="unfinished">nieznany użytkownik</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation>Tylko podglÄ…d</translation>
+        <translation type="unfinished">Tylko podglÄ…d</translation>
     </message>
     <message>
-        <source>Lock student</source>
-        <translation>Zablokuj użytk</translation>
+        <source>Remote control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen</source>
-        <translation>Pełny ekran</translation>
+        <source>Lock student</source>
+        <translation type="unfinished">Zablokuj użytk</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation>Wyjdź</translation>
+        <source>Unlock student</source>
+        <translation type="unfinished">Odblokuj użytk</translation>
     </message>
     <message>
-        <source>Connecting %1</source>
-        <translation>Łączę z %1</translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Zdjęcie</translation>
     </message>
     <message>
-        <source>Connected.</source>
-        <translation>Połączony.</translation>
+        <source>Fullscreen</source>
+        <translation type="unfinished">Pełny ekran</translation>
     </message>
     <message>
-        <source>Snapshot</source>
-        <translation>Zdjęcie</translation>
+        <source>Window</source>
+        <translation type="unfinished">Okno</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Zdalny pulpit</translation>
+        <source>Quit</source>
+        <translation type="unfinished">Wyjdź</translation>
     </message>
     <message>
-        <source>Unlock student</source>
-        <translation>Odblokuj użytk</translation>
+        <source>Connecting %1</source>
+        <translation type="unfinished">Łączę z %1</translation>
     </message>
     <message>
-        <source>Window</source>
-        <translation>Okno</translation>
+        <source>Connected.</source>
+        <translation type="unfinished">Połączony.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Zdalne logowanie</translation>
-    </message>
+    <name>RemoteLogonDialog</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:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Zdalne logowanie</span></p></body></html></translation>
+        <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>Użyj poniższych pól aby wprowadzić nazwę użytkownika, hasło i opcjonalnie nazwę domeny. Te informacje zostaną użyte do zalogowania komputerów.</translation>
+        <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>Użytkownik</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>Hasło</translation>
+        <translation type="unfinished">Hasło</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation>Domena</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Anuluj</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <translation type="unfinished">Domena</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Potwierdź nadpisanie</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Czy chcesz zastapić %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Przerwij instalacjÄ™</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Dalej</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Zakończ</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Wyjdź</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Wybierz katalog na klucz publiczny</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Wybierz katalog na klucz prywatny</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Wybierz katalog na wyeksportowany klucz publiczny</translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Zdjęcie</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>Zdjęcia</translation>
+        <translation type="unfinished">Zdjęcia</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Ten obszar pozwala zarządzać zdjęciami ekranów użytkowników.</translation>
+        <translation type="unfinished">Ten obszar pozwala zarządzać zdjęciami ekranów użytkowników.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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">
+        <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>Użytkownik :</translation>
+        <translation type="unfinished">Użytkownik :</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation>Komputer :</translation>
+        <translation type="unfinished">Komputer :</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation>Data :</translation>
+        <translation type="unfinished">Data :</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>Godzina :</translation>
-    </message>
-    <message>
-        <source>Show snapshot</source>
-        <translation>Pokaż</translation>
+        <translation type="unfinished">Godzina :</translation>
     </message>
     <message>
-        <source>Delete snapshot</source>
-        <translation>Skasuj</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Odśwież listę</translation>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation>Obsługa</translation>
+        <translation type="unfinished">Obsługa</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Wpisz adres IP lub nazwę komputera, przy którym znajduje się osoba, której chcesz udzielić pomocy.</translation>
+        <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>OK</source>
-        <translation>OK</translation>
+        <source>Send text message</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Anuluj</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Obsługa </span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Ustanawiam połączenie z %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Wyślij wiadomość</translation>
+        <source>Overview</source>
+        <translation type="unfinished">PrzeglÄ…d</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Wyślij wiadomość</span></p></body></html></translation>
+        <source>Fullscreen demo</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>Wprowadź wiadomość, którą chcesz wysłać do wybranych użytkowników.</translation>
+        <source>Window demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">Zablokuj wyświetlanie</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>View live</source>
+        <translation type="unfinished">Widok na żywo</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Anuluj</translation>
+        <source>Remote control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">Demo od użytkownika</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Ustanawiam połączenie z %1 ...</translation>
+        <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>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
+        <source>Power on</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Anuluj</translation>
+        <source>Reboot</source>
+        <translation type="unfinished">Zrestartuj</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Powrót</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Wyłącz</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Dalej</translation>
+        <source>Execute commands</source>
+        <translation type="unfinished">Wykonaj polecenie</translation>
     </message>
 </context>
 </TS>
diff --git a/lib/resources/pt_br.qm b/lib/resources/pt_br.qm
index 14ca8f3..75cf7ec 100644
Binary files a/lib/resources/pt_br.qm and b/lib/resources/pt_br.qm differ
diff --git a/lib/resources/pt_br.ts b/lib/resources/pt_br.ts
index 60f938b..296193a 100644
--- a/lib/resources/pt_br.ts
+++ b/lib/resources/pt_br.ts
@@ -2,1007 +2,1414 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="pt_BR">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
     <message>
-        <source>Actions</source>
-        <translation type="unfinished">Acções</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">Sobre iTALC</translation>
+    </message>
+    <message>
+        <source>About</source>
+        <translation type="unfinished">Sobre</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel / iTALC Solutions</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">Autores</translation>
+    </message>
+    <message>
+        <source>Translation</source>
+        <translation type="unfinished">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 type="unfinished"></translation>
+    </message>
+    <message>
+        <source>License</source>
+        <translation type="unfinished">Licença</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>MainWindow</name>
+    <name>AccessDialogSlave</name>
     <message>
-        <source>MainWindow</source>
+        <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 type="unfinished"></translation>
     </message>
     <message>
-        <source>toolBar</source>
+        <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>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>Classroom-Manager</source>
+        <translation>Gerente de Sala de Aula</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Falta de permissão de gravar</translation>
+        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
+        <translation>Use este espaço para gerenciar os computadores e salas de aula de forma muito simples.</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">Erro ao ler/gravar ou criar o diretório %1! Para executar iTALC corretamente é precisa se permissão de criação e gravação neste diretório.</translation>
+        <source>This is where computers and classrooms are managed. You can add computers or classrooms by clicking right in this list.</source>
+        <translation>Aqui, os computadores e salas de aula são gerenciados. Você pode adicionar computadores e salas de aula clicando nesta lista.</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Sala</translation>
+        <source>Classrooms/computers</source>
+        <translation>Salas de aual/Computadores</translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Mudar de sala</translation>
+        <source>IP-address</source>
+        <translation>Endereço IP</translation>
     </message>
     <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Clique aqui para abrir um menu onde pode escolher a sala ativa.</translation>
+        <source>Usernames</source>
+        <translation>Nomes de usuários</translation>
     </message>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Clique aqui para mudar de sala.</translation>
+        <source>Show usernames</source>
+        <translation>Mostrar nomes de usuários</translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Modo visão geral</translation>
+        <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>Overview</source>
-        <translation type="unfinished">Visão geral</translation>
+        <source>Export to text-file</source>
+        <translation>Exportar para um arquivo texto</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 é o modo padrão do iTALC e permite uma visão geral em todos os computadores visíveis. Também clique aqui para destravar computadores ou sair do modo de demonstração (demo).</translation>
+        <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, pois alguns usuários podem ter terminado o exame mais cedo e ter feito logoff do computador impedindo o professor de recolher seus arquivos no final do exame.</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Demo em tela cheia</translation>
+        <source>Hide teacher computers</source>
+        <translation>Ocultar computadores do professor</translation>
     </message>
     <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished"></translation>
+        <source>Show/hide</source>
+        <translation>Mostrar/Ocultar</translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished"></translation>
+        <source>Edit settings</source>
+        <translation>Editar configurações</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">Neste modo a sua tela está sendo visualizada na tela inteira em todos os computadores. Além disso os usuários são impedidos de fazer algo diferente devido a travação de teclado e mouse.</translation>
+        <source>Remove</source>
+        <translation>Remover</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demo de Janela</translation>
+        <source>Show all computers in classroom</source>
+        <translation>Mostrar todos os computadores da sala de aula</translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished"></translation>
+        <source>Hide all computers in classroom</source>
+        <translation>Ocultarr todos os computadores da sala de aula</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">Neste modo a sua tela está sendo visualizada numa janela em todos os computadores. Os usuários podem mudar de janela e assim continuar o trabalho deles.</translation>
+        <source>Edit name</source>
+        <translation>Editar nome</translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Travar/destravar áreas de trabalho</translation>
+        <source>Remove classroom</source>
+        <translation>Remover sala de aula</translation>
     </message>
     <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Travar tudo</translation>
+        <source>Add computer</source>
+        <translation>Adicionar computador</translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Destravar todos</translation>
+        <source>Add classroom</source>
+        <translation>Adicionar sala de aula</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">Para ter a atenção inteira dos alunos pode travar as telas clicando aqui. Neste modo todos teclados e mouses estão travados e a tela está preta.</translation>
+        <source>No configuration-file found</source>
+        <translation>Arquivo de configuração não encontrado</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Enviar menságem</translation>
+        <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>Text message</source>
-        <translation type="unfinished">Mensagen</translation>
+        <source>Error in configuration-file</source>
+        <translation>Erro no arquivo de configuração</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">Clique aqui para enviar uma mensagen para todos. V. g. para comunicar a nova tarefa etc.</translation>
+        <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>Power on computers</source>
-        <translation type="unfinished">Ligar computadores</translation>
+        <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>Power on</source>
-        <translation type="unfinished">Ligar</translation>
+        <source>Select output-file</source>
+        <translation>Selecionar arquivo de saida</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">clique aqui para ligar todos os computadores visíveis. Assim não precise ligar cada computador manualmente.</translation>
+        <source>Text files (*.txt)</source>
+        <translation>Arquivos de texto (*.txt)</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Desligar computadores</translation>
+        <source>Actions for selected</source>
+        <translation>Ações para selecionados</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Desligar</translation>
+        <source>Actions</source>
+        <translation>Ações</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">Para desligar todos os computadores visíveis (v. g. depois que terminou uma aula) pode clicar aqui.</translation>
+        <source>Actions for %1</source>
+        <translation>Ações para %1</translation>
     </message>
     <message>
-        <source>Logon</source>
-        <translation type="unfinished">Fazer logon</translation>
+        <source>New name for classroom</source>
+        <translation>Novo nome para a sala de aula</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Fazer logon remoto</translation>
+        <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>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Clicando aqui pode inserir um nome de usuário e senha para fazer logon o referido usuário em todos os computadores visíveis.</translation>
+        <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>Support</source>
-        <translation type="unfinished">Suporte</translation>
+        <source>Missing classroom</source>
+        <translation>Sala de aula não encontrada</translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Suporte direto</translation>
+        <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>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">Se quiser ajudar um determinado aluno pode clicar aqui e inserir o nome ou endereço IP do computador dele.</translation>
+        <source>New classroom</source>
+        <translation>Nova sala de aula</translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished"></translation>
+        <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>Adjust windows and their size</source>
-        <translation type="unfinished">Ajustar tamanho de janelas</translation>
+        <source>Unknown state</source>
+        <translation>Estado desconhecido</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>
+        <source>No user logged in</source>
+        <translation>Nenhum usuário logado</translation>
     </message>
     <message>
-        <source>Auto view</source>
+        <source>Host unreachable</source>
+        <translation>Computador inacessível</translation>
+    </message>
+    <message>
+        <source>Demo running</source>
+        <translation>Demo em andamento</translation>
+    </message>
+    <message>
+        <source>Desktop locked</source>
+        <translation>Travar área de trabalho</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 type="unfinished">Configurações do cliente</translation>
+    </message>
+    <message>
+        <source>IP/hostname</source>
+        <translation type="unfinished">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 ':' for specifying an optional port-number)</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;">Digite um endereço IP ou nome do computador em que o iTALC possa acessar o cliente (use ':' para especificar um número de porta opcional)</p></body></html></translation>
+    </message>
+    <message>
+        <source>Name</source>
+        <translation type="unfinished">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></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;">Apelido opcional do computador que é exibido no iTALC.</p></body></html></translation>
+    </message>
+    <message>
+        <source>MAC address</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
+        <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></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;">Endereço de Hardware (MAC) do cliente - somente usado para ligar o computador remotamente</p></body></html></translation>
+    </message>
+    <message>
+        <source>Classroom</source>
+        <translation type="unfinished">Sala de aula</translation>
+    </message>
+    <message>
+        <source>Type</source>
+        <translation type="unfinished">Tipo</translation>
+    </message>
+    <message>
+        <source>Student computer</source>
+        <translation type="unfinished">Computador do estudante</translation>
+    </message>
+    <message>
+        <source>Teacher computer</source>
+        <translation type="unfinished">Computador do professor</translation>
+    </message>
+    <message>
+        <source>Other/undefined computer</source>
+        <translation type="unfinished">Outro computador (indefinido)</translation>
+    </message>
+    <message>
+        <source>Missing IP address/hostname</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
+        <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>Intervalo entre as atualizações</translation>
+    </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Nenhuma chave válida encontrada</translation>
+        <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 network-traffic and lower CPU-usage on this computer.</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;">Aqui, você pode determinar o intervalo entre as atualizações dos computadores. Valores mais altos resultam em menor tráfego de rede e menor uso de CPU neste computador.</p></body></html></translation>
     </message>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</translation>
+        <source> seconds</source>
+        <translation> segundos</translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">Serviço iTALC não iniciado</translation>
+        <source>User interface</source>
+        <translation>Interface do usuário</translation>
     </message>
     <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Aparente mente nenhum serviço iTALC iniciado neste computador ou tem um erro nas chaves de autenticação. A execução do servico é necessário para o funcionamento do iTALC. Favor entrar em contato com o administrador para solucionar este problema.</translation>
+        <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></html></translation>
     </message>
     <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished"></translation>
+        <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 mouse-cursor over 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;">Marque esta opção se você deseja desabilitar as dicas de balão que aparecem ao mover o cursor do mouse sobre os botões da barra de ferramentas.</p></body></html></translation>
+    </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></translation>
+    </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 estaremde 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 funaçã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 cliente.</p></body></html></translation>
     </message>
     <message>
         <source>Remote control</source>
-        <translation type="unfinished">Controle remoto</translation>
+        <translation>Controlar remotamente</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished">Sair</translation>
+        <source>View live in fullscreen</source>
+        <translation>Visualização 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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Por favor, note que algumas modificações não terão efeito até que você reinicie o iTALC.</span></p></body></html></translation>
     </message>
 </context>
 <context>
-    <name>QApplication</name>
+    <name>ConfigWidget</name>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC Cliente %1 no %2:%3</translation>
+        <source>Your iTALC-configuration</source>
+        <translation>Sua configuração do iTALC</translation>
     </message>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Não foi possível registrar o serviço  '%1'.</translation>
+        <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>The Service Control Manager could not be contacted (do you have the neccessary rights?!) - the service '%1' was not registered.</source>
-        <translation>Falha na conexão para gerenciador de controle de servicos (você tem os direitos necessários?!) - o serviço '%1' não foi registrado.</translation>
+        <source>OK</source>
+        <translation>OK</translation>
     </message>
+</context>
+<context>
+    <name>DemoClient</name>
     <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>O serviço '%1' já está sendo registrado.</translation>
+        <source>iTALC Demo</source>
+        <translation>Demonstrar iTALC</translation>
     </message>
+</context>
+<context>
+    <name>ItalcCoreServer</name>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Não foi possível registrar o serviço  '%1'.</translation>
+        <source>Authentication error</source>
+        <translation>Erro na autenticação</translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Serviço  '%1' registrado com sucesso.</translation>
+        <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>The service '%1' could not be stopped.</source>
-        <translation>Não foi possível parar o serviço  '%1'.</translation>
+        <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 type="unfinished">Assistente de Chave de Acesso do iTALC</translation>
+    </message>
+    <message>
+        <source>Create/import iTALC access keys</source>
+        <translation type="unfinished">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 type="unfinished">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 type="unfinished">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 type="unfinished">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 type="unfinished">Modo assistente</translation>
+    </message>
+    <message>
+        <source>Please choose whether to create new access keys or import a public key on a client.</source>
+        <translation type="unfinished">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 type="unfinished">Criar novas chaves de acesso (computador mestre)</translation>
+    </message>
+    <message>
+        <source>assistantModeButtonGroup</source>
+        <translation type="unfinished">assistantModeButtonGroup</translation>
+    </message>
+    <message>
+        <source>Import public key (client computer)</source>
+        <translation type="unfinished">Importar chave pública (computador cliente)</translation>
+    </message>
+    <message>
+        <source>Select user role</source>
+        <translation type="unfinished">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 type="unfinished">Por favor, selecione uma função para o usuário para criar ou importar chaves de acesso:</translation>
+    </message>
+    <message>
+        <source>Teacher</source>
+        <translation type="unfinished">Professor</translation>
+    </message>
+    <message>
+        <source>Administrator</source>
+        <translation type="unfinished">Administrador</translation>
+    </message>
+    <message>
+        <source>Support team member</source>
+        <translation type="unfinished">Ajudar membro da equipe</translation>
+    </message>
+    <message>
+        <source>Other</source>
+        <translation type="unfinished">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 type="unfinished">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 type="unfinished">Diretórios</translation>
+    </message>
+    <message>
+        <source>Export public key part (master computer)</source>
+        <translation type="unfinished">Exportar parte de chave pública (computador mestre)</translation>
+    </message>
+    <message>
+        <source>...</source>
+        <translation type="unfinished">...</translation>
+    </message>
+    <message>
+        <source>Use custom destination directory for access keys</source>
+        <translation type="unfinished">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 type="unfinished">Por favor, especifique a localização da chave pública de acesso para ser importada.</translation>
+    </message>
+    <message>
+        <source>Summary</source>
+        <translation type="unfinished">Resumo</translation>
+    </message>
+    <message>
+        <source>The following actions will be taken:</source>
+        <translation type="unfinished">As seguintes ações serão tomadas:</translation>
+    </message>
+    <message utf8="true">
+        <source>• Create new access keys</source>
+        <translation type="unfinished">• Criar novas chaves de acesso</translation>
+    </message>
+    <message utf8="true">
+        <source>• Import public access key from</source>
+        <translation type="unfinished">• Importar chave pública de</translation>
+    </message>
+    <message>
+        <source><unknown></source>
+        <translation type="unfinished"><desconhecida></translation>
+    </message>
+    <message utf8="true">
+        <source>• Write access key(s) to</source>
+        <translation type="unfinished">• Salvar chave(s) de acesso em</translation>
+    </message>
+    <message utf8="true">
+        <source>• Export public key to</source>
+        <translation type="unfinished">• Exportar chave púlica para</translation>
+    </message>
+    <message utf8="true">
+        <source>• Configure for user role</source>
+        <translation type="unfinished">• Configurar para a função de usuário</translation>
+    </message>
+    <message>
+        <source>Select directory in which to export the public key</source>
+        <translation type="unfinished">Selecionar o diretório para o qual a chave pública será exportada</translation>
+    </message>
+    <message>
+        <source>Key files (*.key.txt)</source>
+        <translation type="unfinished">Chaves de acesso (*.key.txt)</translation>
+    </message>
+    <message>
+        <source>Invalid public key</source>
+        <translation type="unfinished">Chave pública inválida</translation>
+    </message>
+    <message>
+        <source>The selected file does not contain a valid public iTALC access key!</source>
+        <translation type="unfinished">O arquivo selecionado não contém uma chave pública de acesso do iTALC!</translation>
+    </message>
+    <message>
+        <source>Select destination directory</source>
+        <translation type="unfinished">Selecionar diretório de destino</translation>
+    </message>
+    <message>
+        <source>Access key creation</source>
+        <translation type="unfinished">Criação da chave de acesso</translation>
+    </message>
+    <message>
+        <source>Could not remove previously existing file %1.</source>
+        <translation type="unfinished">Não foi possível remove arquivo %1 previamente existente.</translation>
+    </message>
+    <message>
+        <source>Failed exporting public access key from %1 to %2.</source>
+        <translation type="unfinished">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 type="unfinished">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 type="unfinished">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 type="unfinished">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 type="unfinished">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 type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>LockWidget</name>
+    <message>
+        <source>screen lock</source>
+        <translation>travar tela</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">Por favor, adicione os grupos cujos membros devem ser autorizados a acessar os computadores na sua rede iTALC.</translation>
+    </message>
+    <message>
+        <source>All groups</source>
+        <translation type="unfinished">Todos os grupos</translation>
+    </message>
+    <message>
+        <source>...</source>
+        <translation type="unfinished">...</translation>
+    </message>
+    <message>
+        <source>Groups with iTALC privileges</source>
+        <translation type="unfinished">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>The service '%1' has been unregistered.</source>
-        <translation>O serviço  '%1' foi deregistrado.</translation>
+        <source>iTALC Management Console</source>
+        <translation>Console de gerenciamento do iTALC</translation>
     </message>
     <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>O serviço '%1' não está sendo registrado e por isso não pode ser deregistrado.</translation>
+        <source>iTALC Server</source>
+        <translation>Servidor iTALC</translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Não foi possível deregistrar o serviço  '%1'.</translation>
+        <source>Paths</source>
+        <translation>Caminhos</translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Não foi possível encontrar o serviço  '%1'.</translation>
+        <source>Authentication</source>
+        <translation>Autenticação</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>Falha na conexão para gerenciador de controle de servicos (você tem os direitos necessários?!) - o serviço '%1' não foi deregistrado.</translation>
+        <source>iTALC Service</source>
+        <translation>Serviço iTALC</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>Falha na conexão para gerenciador de controle de servicos (você tem os direitos necessários?!) - o serviço '%1' não foi parado.</translation>
+        <source>Hide tray icon</source>
+        <translation>Ocultar ícone da área de notificação</translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</translation>
+        <source>Autostart</source>
+        <translation>Iniciar automaticamente</translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>iTALC-capturas</translation>
+        <source>Additional arguments</source>
+        <translation>Argumentos adicionais</translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Sobre  iTALC</span></p></body></html></translation>
+        <source>Start service</source>
+        <translation>Iniciar serviço</translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>Sobre</translation>
+        <source>Stop service</source>
+        <translation>Parar serviço</translation>
     </message>
     <message>
-        <source>About iTALC</source>
-        <translation>Sobre iTALC</translation>
+        <source>State:</source>
+        <translation>Estado:</translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Autores</translation>
+        <source>Stopped</source>
+        <translation>Parado</translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Licença</translation>
+        <source>Logging</source>
+        <translation>Registrando</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Log file directory</source>
+        <translation>Diretório de arquivo de log</translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Tradução</translation>
+        <source>...</source>
+        <translation>...</translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
-        <translation type="unfinished"></translation>
+        <source>Log level</source>
+        <translation>Nível de log</translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Nothing</source>
+        <translation>Nada</translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Actions</source>
-        <translation>Acções</translation>
+        <source>Only critical messages</source>
+        <translation>Somente mensagens críticas</translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Acções para %1</translation>
+        <source>Errors and critical messages</source>
+        <translation>Mensagens críticas e de erros</translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Adicionar sala</translation>
+        <source>Warnings and errors</source>
+        <translation>Avisos e erros</translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Adicionar computador</translation>
+        <source>Information, warnings and errors</source>
+        <translation>Informações, avisos e erros</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 sala  "%1"?
-Todos os computadores desta sala serão removidos também!</translation>
+        <source>Debug messages and everything else</source>
+        <translation>Mensagens de depuração e tudo o mais</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 tem que criar pelo menos uma sala.
-Quer criar uma nova sala agora?</translation>
+        <source>Limit log file size</source>
+        <translation>Limite do tamanho do arquivo de log</translation>
     </message>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Gerente de sala</translation>
+        <source>MB</source>
+        <translation>MB</translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Salas/Computadores</translation>
+        <source>Clear all log files</source>
+        <translation>Remover todos os arquivos de log</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>Erro na leitura do arquivo %1.
-É necessário adicionar no mínimo uma sala e computadores usando o gerenciador de salas que se encontra no lado esquerdo do programa.</translation>
+        <source>Desktop capturing</source>
+        <translation>Capturando desktop</translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Editar nome</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation>Habilitar captura de janelas em camadas (semi-transparente)</translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Editar configurações</translation>
+        <source>Poll full screen</source>
+        <translation>Pesquisa em tela cheia</translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Erro no arquivo de configuração</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation>Baixa precisão (modo turbo)</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 na análise do arquivo %1.Favor editar o arquivo. Senão deve deltar este arquivo e terá que adicionar todas as salas e computadores novamente.</translation>
+        <source>Demo server</source>
+        <translation>Demonstrar servidor</translation>
     </message>
     <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation>Erro na análise do arquivo %1.
-Favor editar o arquivo. Senão deve deltar este arquivo.</translation>
+        <source>Network</source>
+        <translation>Rede</translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Exportar para arquivo de texto</translation>
+        <source>Core server port</source>
+        <translation>Porta do servidor</translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Esconder todos os computadores da sala</translation>
+        <source>Demo server port</source>
+        <translation>Demonstrar porta do servidor</translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Esconder computadores do professor</translation>
+        <source>Enable firewall exception</source>
+        <translation>Hablitar exceção de firewall</translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>Endereço - IP</translation>
+        <source>Configuration files</source>
+        <translation>Arquivos de configuração</translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Sala não encontrada</translation>
+        <source>Global configuration</source>
+        <translation>Configuração global</translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Nova sala</translation>
+        <source>Personal configuration</source>
+        <translation>Configuração pessoal</translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Novo nome para a sala</translation>
+        <source>Data directories</source>
+        <translation>Diretórios de dados</translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>ARquivo de configuração não encontrado</translation>
+        <source>Snapshots</source>
+        <translation>Capturas</translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Favor digitar um novo nome para a sala "%1".</translation>
+        <source>Authentication methods</source>
+        <translation>Métodos de autenticação</translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Favor digitar o nome da sala que deseja criar.</translation>
+        <source>Access key management</source>
+        <translation>Gerenciamento de chaves de acesso</translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Remover</translation>
+        <source>Logon settings</source>
+        <translation>Configurações de logon</translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Remover sala</translation>
+        <source>&File</source>
+        <translation>&Arquivo</translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Selecionar arquivo de saida</translation>
+        <source>&Help</source>
+        <translation>A&juda</translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Mostrar todos os computadores da sala</translation>
+        <source>&Quit</source>
+        <translation>&Sair</translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Mostrar nomes de usuários</translation>
+        <source>Ctrl+Q</source>
+        <translation>Ctrl+Q</translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Mostrar/Esconder</translation>
+        <source>&Save settings into file</source>
+        <translation>&Salvar as configurações no arquivo</translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Arquivos de texto (*.txt)</translation>
+        <source>Save settings into file</source>
+        <translation>Salvar as configurações no arquivo</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>Aqui computadores e salas são gerenciados. Você pode adicionar computadores e salas clicando nesta lista.</translation>
+        <source>Ctrl+S</source>
+        <translation>Ctrl+S</translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Use u menu de contexto (tecla direita do mouse) para adicionar/remover computadores e/ou salas.</translation>
+        <source>L&oad settings from file</source>
+        <translation>Carregar c&onfigurações do arquivo</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>Pressione este butão para exportar esta lista de computadores e nomes dos usuários para um arquivo de texto. Você pode usar este arquivo para colecionar arquivos dos usuários depois que uma prova terminou. As vézes isto é necessário porque uns usuários terminam a prova mais cedo e fazem logoff do computador impedindo o professor de recolher os arquivos destes usuários.</translation>
+        <source>Ctrl+O</source>
+        <translation>Ctrl+O</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 os computadores e salas de forma muito simples.</translation>
+        <source>About iTALC</source>
+        <translation>Sobre iTALC</translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Nomes de usuários</translation>
+        <source>About Qt</source>
+        <translation>Sobre o QT</translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
+        <source>MainWindow</source>
+        <translation>Janela principal</translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Demo running</source>
-        <translation>Demo em andamento</translation>
+        <source>toolBar</source>
+        <translation>toolBar</translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Travar área de trabalho</translation>
+        <source>iTALC Management Console %1</source>
+        <translation>Console %1 de Gerenciamento do iTALC</translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Host inacessível</translation>
+        <source>Running</source>
+        <translation>Em execução</translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Nenhum usuário logado</translation>
+        <source>Load settings from file</source>
+        <translation>Carregar configurações de um arquivo</translation>
     </message>
     <message>
-        <source>Unknown state</source>
-        <translation>Em estado desconhecido</translation>
+        <source>XML files (*.xml)</source>
+        <translation>Arquivos XML (*.xml)</translation>
     </message>
-</context>
-<context>
-    <name>clientAction</name>
     <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation type="unfinished">Tem certeza que quer fazer logof de todos os usuários visíveis?</translation>
+        <source>Save settings to file</source>
+        <translation>Salvar configurações para arquivo</translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
+        <source>Unsaved settings</source>
+        <translation>Configurações não salva</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Fazer logoff do usuário</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation>Existem configurações não salvas. Sair de qualquer maneira?</translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Tem certeza que quer reiniciar todos os computadores visíveis?</translation>
+        <source>Configuration not writable</source>
+        <translation>Configuração não gravável</translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
+        <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>Reboot computers</source>
-        <translation type="unfinished">Reiniciar computadores</translation>
+        <source>All settings were applied successfully.</source>
+        <translation>Todas as configurações foram aplicadas com sucesso.</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Tem certeza que quer desligar tots os computadores visíveis?</translation>
+        <source>An error occured while applying settings!</source>
+        <translation>Um erro ocorreu ao aplicar as configurações!</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC</source>
+        <translation>iTALC</translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Visão geral</translation>
+        <source>No write access</source>
+        <translation>Sem acesso de escrita</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Demo em tela cheia</translation>
+        <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>Window demo</source>
-        <translation type="unfinished">Demo de Janela</translation>
+        <source>Classroom</source>
+        <translation>Sala de aula</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Travar tela</translation>
+        <source>Switch classroom</source>
+        <translation>Mudar de sala de aula</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation type="unfinished">Visualizar ao vivo</translation>
+        <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>Remote control</source>
-        <translation type="unfinished">Controle remoto</translation>
+        <source>Click on this button, to switch between classrooms.</source>
+        <translation>Clique neste botão, para alternar entre as sala de aula.</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Deixar o aluno mostrar um demo</translation>
+        <source>Overview mode</source>
+        <translation>Modo visão geral</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Enviar menságem</translation>
+        <source>Overview</source>
+        <translation>Visão geral</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation type="unfinished">Fazer logon do usuário</translation>
+        <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>Logout user</source>
-        <translation type="unfinished">Fazer logoff do usuário</translation>
+        <source>Fullscreen demo</source>
+        <translation>Demonstração em tela cheia</translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Capturar tela</translation>
+        <source>Fullscreen Demo</source>
+        <translation>Demonstração em tela cheia</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Ligar</translation>
+        <source>Stop Demo</source>
+        <translation>Parar demonstração</translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Reiniciar</translation>
+        <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>Power down</source>
-        <translation type="unfinished">Desligar</translation>
+        <source>Window demo</source>
+        <translation>Demonstração da janela</translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Executar comandos</translation>
+        <source>Window Demo</source>
+        <translation>Demonstração da janela</translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <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;">Activate this option for at least one host in a subnet.</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;">Selecione esta opção por no mínimo um computador numa subrede.</p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 if the host is the gateway for the subnet.</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;">Verificar se o computador é o gateway para a subrede.</p></body></html></translation>
+        <source>Lock/unlock desktops</source>
+        <translation>Bloquear/desbloquear áreas de trabalho</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;">connection to hosts on the same level</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;">conexão para computadores do mesmo nível</p></body></html></translation>
+        <source>Lock all</source>
+        <translation>Bloquear todos</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 ':' for specifying an optional port-number)</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;">digite um Endereço IP ou hostname com o qual iTALC pode acessar o cliente (use':' para especificar uma porta opcional)</p></body></html></translation>
+        <source>Unlock all</source>
+        <translation>Desbloquear todos</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></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;">Endereço de Harware (MAC) do cliente - somente usado para ligar o cliente remotamente</p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Aqui pode especificar como computadores são conectados na rede iTALC; i. é. computadores do mesmo nível. Normalmente computadores são conectados com 100 MBit/s mas possívelmente existem gateways para outras redes iTALC em outras instituções ou computadores domésticos de alunos. Nestes casos iTALC tenta otimizar o uso da banda</p></body></html></translation>
+        <source>Send text message</source>
+        <translation>Enviar mensagem de texto</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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;">Enquanto fazer um demo para mais de um computador numa rede distante (v. g. outra escola) faz sentido ativar esta opção para no mínimo um computador desta subrede. Assim todos os dados são enviados singularmente para este repetitor de demos que redistribui os dados para os outros computadores desta subrede. Especialmente em links devagares o uso desta opção torna se essencial. Normalmente deve escolher o computador gateway (veja opção acima).</p></body></html></translation>
+        <source>Text message</source>
+        <translation>Mensagen de texto</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Client settings</span></p></body></html></translation>
+        <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 usuaŕios, por exemplo, para comunicar a nova tarefa etc.</translation>
     </message>
     <message>
-        <source>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
+        <source>Power on computers</source>
+        <translation>Ligar computadores</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</translation>
+        <source>Power on</source>
+        <translation>Ligar</translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Funcionamento como repetitor de &demonstrações</translation>
+        <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>Analog</source>
-        <translation>Analógico</translation>
+        <source>Power down computers</source>
+        <translation>Desligar computadores</translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>C&ancelar</translation>
+        <source>Power down</source>
+        <translation>Desligar</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation>Sala</translation>
+        <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>Client settings</source>
-        <translation>Configurações do cliente</translation>
+        <source>Support</source>
+        <translation>Ajuda</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Conexão</translation>
+        <source>Direct support</source>
+        <translation>Ajuda direta</translation>
     </message>
     <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <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>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <source>Adjust/align</source>
+        <translation>Ajustar/alinhar</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Geral</translation>
+        <source>Adjust windows and their size</source>
+        <translation>Ajustar o tamanho da janela</translation>
     </message>
     <message>
-        <source>Host is &gateway for subnet</source>
-        <translation>Computador é &gateway para a subrede</translation>
+        <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>IP/hostname</source>
-        <translation>IP/hostname</translation>
+        <source>Auto view</source>
+        <translation>Visualizar automaticamente</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation>Rearranjar automaticamente o tamanho da janela</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>Endereço MAC</translation>
+        <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>Name</source>
-        <translation>Nome</translation>
+        <source>iTALC Master Control</source>
+        <translation>Controle Mestre do iTALC</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Remote control</source>
+        <translation>Controlar remotamente</translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Outro computador (indefinido)</translation>
+        <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>Student computer</source>
-        <translation>Computador de estudante</translation>
+        <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>Teacher computer</source>
-        <translation>Computador de professor</translation>
+        <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>Type</source>
-        <translation>Tipo</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <source>Enable desktop switching for screen lock (experimental)</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></source>
+        <source>Log to standard error output</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Endereço MAC inválido</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Endereço IP/nome não encontrado</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></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 este computador!</translation>
+        <source>VNC reflector</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>Você especificou um endereço MAC inválido. Deixe este campe em branco ou digite um endereço MAC válido (use ":" como separador!).</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Digite comandos que devem ser executados no(s) computador(es):</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Execute comandos no(s) computador(es)</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Executar!</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source> seconds</source>
-        <translation>segundos</translation>
+        <source>Key file authentication</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Considere que algumas modificações requerem a reinicialização do iTALC para funcionar.</span></p></body></html></translation>
+        <source>ACL-based logon authentication</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 mouse-cursor over 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;">Selecione esta opção para desligar as dicas que aparecem quando move o ponteiro do mouse sobre os itens.</p></body></html></translation>
+        <source>Public key file base directory</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></translation>
+        <source>Private key file base directory</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 network-traffic and lower CPU-usage on this computer.</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;">Aqui pode determinar o intervalo de atualizações dos computadores. Valores mais altos diminuem o trafego da rede e pesa menos na CPU deste computador.</p></body></html></translation>
+        <source>Launch key file assistant</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><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 pode selecionar sua função. Somente modifique consiente em que está fazendo. Senão pode perder o acesso para todos os computadores até restaurar esta função.</p></body></html></translation>
+        <source>Manage permissions</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><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 pode selecionar o que acontece quando efetue um cluque duplo na tela de um computador.</p></body></html></translation>
+        <source>Test</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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 pode determinar a qualidade desejada da tela na demonstração (demo). Qualidade baixa significa menos Uso da CPU e diminue trafego na rede enquanto qualidade alta pode deixar o seu computador lento e baixar a reiteração da tela da demonstração. Você deve experimentar várias configurações para otimizar a visualizaçõ de demos.</p></body></html></translation>
+        <source>Access confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 segundo</translation>
+        <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>Administrator</source>
-        <translation>Administrador</translation>
+        <source>Logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Domínio</translation>
+        <source>Allow same user to access desktop without confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Acção de clique duplo na tela de um computador</translation>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Alta (Truecolor)</translation>
+        <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>Interval between updates</source>
-        <translation>Intervalo de atualização</translation>
+        <source>1)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Baixa (15 bit)</translation>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Média (18 bit)</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Desligar dicas</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Outro</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Qualidade da tela de demonstração</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Controle remoto</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>configurações para logon múltiplo</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Suporte</translation>
+        <source>Generate bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Professor</translation>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User interface</source>
-        <translation>Interface do usuário</translation>
+        <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>View live in fullscreen</source>
-        <translation>Visualização ao vivo com tela cheia</translation>
+        <source>Restart iTALC Service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Sua  função (referidos chaves necessarios!)</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>Starting iTALC service</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
+        <source>Stopping iTALC service</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>Aqui pode costumizar iTALC para atender seu necessidades.</translation>
+        <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>Your iTALC-configuration</source>
-        <translation>Sua configuração de iTALC</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Demo</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
-        <translation>Erro do servidor ISD</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>O servidor ISD não pode ser iniciado proque a porta %1 já está sendo utilizada. Favor conferir que nenhuma outra aplicação usa esta porta e tente novamente.</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Acesso confirmado</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Alguém no computador %1 tenta acessar a sua tela. Deseja permitir este acesso?</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Nunca para esta sessão</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Sempre para esta sessão</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>Menságem do professor</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Erro na autenticação</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Alguem  (IP: %1) tentou acessar este computador mas não se autenticou com sucesso!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Captura</translation>
+        <source>Could not contact iTALC service</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>Erro au executar a captura. O diretório %1 não existe e não pode ser criado.</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>travar tela</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation>Mensagem do professor</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <name>Overview</name>
     <message>
         <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
 p, li { white-space: pre-wrap; }
@@ -1014,302 +1421,231 @@ p, li { white-space: pre-wrap; }
 <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>About iTALC</source>
-        <translation>Sobre iTALC</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>A borda de tarefas tem vários butões. Cada butão está conectado ao uma janela de ferramentas diferente. Pode mudar entre estas janelas clicando nos referentes  butões.</translation>
+        <translation>Aqui, você vê a barra de ferramentas que contém vários butões. Cada botão está conectado a um espaço de trabalho. Basta dar uma olhada nos espaços de trabalho disponíveis, clicando no botão correspondente.</translation>
     </message>
     <message>
-        <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>Para configurar iTALC usa se a tela de configuração.</translation>
+        <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 tela de captura é uma ferramenta muito útil. Aqui pode gerenciar todas as capturas de telas.</translation>
+        <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>Using the classroom-manager you can manage your classrooms and computers. You can also see which users are logged in.</source>
-        <translation>Na tela de salas e computadores pode gerenciar todas as salas e computadores. Tambem pode ver qual usuário é lagado em qual computador.</translation>
+        <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>
+    <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>Alguns informações básicos sobre iTALC e como usá-lo.</translation>
+        <translation>Algumas informações básicas sobre iTALC e como usá-lo.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
-        <translation type="unfinished"></translation>
+        <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 do iTALC.</translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation>Nome de usuário</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation>Senha</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>As chaves novas ou importadas precisam de ser instaladas em algum lugar. É recomendado manter os diretórios padrãos.</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>iTALC Cliente %1 no %2:%3</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Diretório para salvar a chave pública</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Não foi possível registrar o serviço  '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation>Diretório para salvar a chave privada</translation>
+        <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 pôde ser contatado (você tem os direitos necessários?!) - o serviço '%1' não foi registrado.</translation>
     </message>
     <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>O serviço '%1' já está registrado.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Exportar a chave provada também</translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>O serviço '%1' não pôde se registrado.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>O serviço '%1' foi registrado com sucesso.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>O serviço '%1' não pôde ser parado.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>O serviço '%1' não tem sido registrado.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Importar chave público do computador master</translation>
+        <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 pôde ser registrado.</translation>
     </message>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Escolhe o diretório das chaves públicas exportadas:</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>O serviço '%1' não pôde ser registrado.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Manter todas as chaves (somente quando está efetuando um update do iITALC!)</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>O serviço '%1' não pôde ser encontrado.</translation>
     </message>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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 pôde ser contatado (você tem os direitos necessários?!) - o serviço '%1' não foi registrado.</translation>
     </message>
     <message>
-        <source>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
+        <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 pôde ser contatado (você tem os direitos necessários?!) - o serviço '%1' não foi parado.</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidget</name>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Controle remoto (%1 no computador %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation>Visualização ao vivo (%1 @ %2)</translation>
     </message>
     <message>
-        <source>unknown user</source>
-        <translation>usuário desconhecido</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation>Controlar remotamente (%1 @ %2)</translation>
     </message>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Visualização ao vivo (%1 no computador %2)</translation>
+        <source>unknown user</source>
+        <translation>usuário desconhecido</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
-    <message>
-        <source>Connected.</source>
-        <translation>Cnectado.</translation>
-    </message>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
-        <source>Connecting %1</source>
-        <translation>Conectando %1</translation>
+        <source>View only</source>
+        <translation>Visualizar somente</translation>
     </message>
     <message>
-        <source>Fullscreen</source>
-        <translation>Tela inteira</translation>
+        <source>Remote control</source>
+        <translation>Controlar remotamente</translation>
     </message>
     <message>
         <source>Lock student</source>
-        <translation>Travar aluno</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Sair</translation>
+        <translation>Travar estudante</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Controle remoto</translation>
+        <source>Unlock student</source>
+        <translation>Destravar estudante</translation>
     </message>
     <message>
         <source>Snapshot</source>
-        <translation>Capturar tela</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>Destravar aluno</translation>
+        <translation>Captura</translation>
     </message>
     <message>
-        <source>View only</source>
-        <translation>Somente visualizar</translation>
+        <source>Fullscreen</source>
+        <translation>Tela cheia</translation>
     </message>
     <message>
         <source>Window</source>
         <translation>Janela</translation>
     </message>
-</context>
-<context>
-    <name>remoteLogon</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:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Fazer logon remoto</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Domínio</translation>
-    </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Senha</translation>
-    </message>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Fazer logon remoto</translation>
+        <source>Quit</source>
+        <translation>Sair</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 inserir nome do usuário, senha e opcionalmente o nome do domínio. Estas informações são usadas para fazer logon do(s) computador(es).</translation>
+        <source>Connecting %1</source>
+        <translation>Conectando %1</translation>
     </message>
     <message>
-        <source>Username</source>
-        <translation>Nome do usuário</translation>
+        <source>Connected.</source>
+        <translation>Cnectado.</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Confirmar substituição de arquivo</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Deseja substituir o arquivo %1?</translation>
-    </message>
+    <name>RemoteLogonDialog</name>
     <message>
-        <source>Cancel setup</source>
-        <translation>Cancelar setup</translation>
+        <source>Remote logon</source>
+        <translation type="unfinished">Fazer logon remoto</translation>
     </message>
     <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
+        <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>Next</source>
-        <translation>Avancar</translation>
+        <source>Username</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Finish</source>
-        <translation>Terminar</translation>
+        <source>Password</source>
+        <translation type="unfinished">Senha</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation>Sair</translation>
+        <source>Domain</source>
+        <translation type="unfinished">Domínio</translation>
     </message>
+</context>
+<context>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
+    <name>Snapshot</name>
     <message>
-        <source>Choose public key directory</source>
-        <translation>Escolhe diretório da chave pública</translation>
+        <source>unknown</source>
+        <translation>desconhecido</translation>
     </message>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Escolhe diretório da chave privada</translation>
+        <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>Choose public key export directory</source>
-        <translation>Escolhe o diretório das chaves públicas exportadas</translation>
+        <source>Snapshot</source>
+        <translation>Captura</translation>
     </message>
 </context>
 <context>
-    <name>setupWizardPageSecurityOptions</name>
+    <name>SnapshotList</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshots</source>
+        <translation>Capturas</translation>
     </message>
-</context>
-<context>
-    <name>snapshotList</name>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Facil gerenciamento de capturas usando esta tela de ferramentas.</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>Capturas</translation>
+        <translation>Simplesmente gerencie as capturas que você fez usando este espaço de trabalho.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <name>Snapshots</name>
     <message>
         <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
 p, li { white-space: pre-wrap; }
@@ -1318,115 +1654,119 @@ p, li { white-space: pre-wrap; }
         <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 são listadas aqui. Você pode fazer capturas selecionando a referente opção no menu de contexto (tecla direita do mouse) sobre uma tela de um computador. As capturas podem ser gerenciadas usando os butões abaixo.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Date:</source>
-        <translation>Data:</translation>
+<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>Delete snapshot</source>
-        <translation>Deletar captura</translation>
+        <source>User:</source>
+        <translation>Usuário:</translation>
     </message>
     <message>
         <source>Host:</source>
         <translation>Computador:</translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Recarregar lista</translation>
-    </message>
-    <message>
-        <source>Show snapshot</source>
-        <translation>Mostrar captura</translation>
+        <source>Date:</source>
+        <translation>Data:</translation>
     </message>
     <message>
         <source>Time:</source>
         <translation>Hora:</translation>
     </message>
     <message>
-        <source>User:</source>
-        <translation>Usuário:</translation>
+        <source>Show</source>
+        <translation>Mostrar</translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation>Excluir</translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Suporte </span></p></body></html></translation>
+        <source>Support</source>
+        <translation type="unfinished">Ajuda</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
+        <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>OK</source>
-        <translation>OK</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Enviar mensagem de texto</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Favor inserir o endereço IP ou o nome do computador no qual a pessoa está sentada que deseja ajudar.</translation>
+        <source>Use the field below to type your message which will be sent to all selected users.</source>
+        <translation type="unfinished">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>Support</source>
-        <translation>Suporte</translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation>Estabelecendo conexão para %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Menságem</span></p></body></html></translation>
+        <source>Window demo</source>
+        <translation>Demonstrar em uma janela</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
+        <source>Locked display</source>
+        <translation>Travar tela</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>View live</source>
+        <translation>Visualizar ao vivo</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Remote control</source>
+        <translation>Controlar remotamente</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Let student show demo</source>
+        <translation>Deixar o estudante exibir uma demonstração</translation>
     </message>
     <message>
         <source>Send text message</source>
-        <translation>Enviar menságem</translation>
+        <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 menságem que vai ser enviada para todos os usuarios selecionados.</translation>
+        <source>Logout user</source>
+        <translation>Fazer logoff do usuário</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Estabelecendo conexão para %1 ...</translation>
+        <source>Take a snapshot</source>
+        <translation>Capturar uma tela</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
+        <source>Power on</source>
+        <translation>Ligar</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Cancelar</translation>
+        <source>Reboot</source>
+        <translation>Reiniciar</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Voltar</translation>
+        <source>Power down</source>
+        <translation>Desligar</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Avancar</translation>
+        <source>Execute commands</source>
+        <translation>Executar comandos</translation>
     </message>
 </context>
 </TS>
diff --git a/lib/resources/qt_ar.qm b/lib/resources/qt_ar.qm
deleted file mode 100644
index e63292c..0000000
Binary files a/lib/resources/qt_ar.qm and /dev/null differ
diff --git a/lib/resources/qt_ca.qm b/lib/resources/qt_ca.qm
deleted file mode 100644
index 546928b..0000000
Binary files a/lib/resources/qt_ca.qm and /dev/null differ
diff --git a/lib/resources/qt_da.qm b/lib/resources/qt_da.qm
deleted file mode 100644
index 57a0aa7..0000000
Binary files a/lib/resources/qt_da.qm and /dev/null differ
diff --git a/lib/resources/qt_de.qm b/lib/resources/qt_de.qm
deleted file mode 100644
index 2f5270e..0000000
Binary files a/lib/resources/qt_de.qm and /dev/null differ
diff --git a/lib/resources/qt_es.qm b/lib/resources/qt_es.qm
deleted file mode 100644
index 2c5e54f..0000000
Binary files a/lib/resources/qt_es.qm and /dev/null differ
diff --git a/lib/resources/qt_fr.qm b/lib/resources/qt_fr.qm
deleted file mode 100644
index fb29306..0000000
Binary files a/lib/resources/qt_fr.qm and /dev/null differ
diff --git a/lib/resources/qt_iw.qm b/lib/resources/qt_iw.qm
deleted file mode 100644
index 05b4aee..0000000
Binary files a/lib/resources/qt_iw.qm and /dev/null differ
diff --git a/lib/resources/qt_ja_JP.qm b/lib/resources/qt_ja_JP.qm
deleted file mode 100644
index 445ba7c..0000000
Binary files a/lib/resources/qt_ja_JP.qm and /dev/null differ
diff --git a/lib/resources/qt_pl.qm b/lib/resources/qt_pl.qm
deleted file mode 100644
index b09d432..0000000
Binary files a/lib/resources/qt_pl.qm and /dev/null differ
diff --git a/lib/resources/qt_pt.qm b/lib/resources/qt_pt.qm
deleted file mode 100644
index 6b2ef0e..0000000
Binary files a/lib/resources/qt_pt.qm and /dev/null differ
diff --git a/lib/resources/qt_ru.qm b/lib/resources/qt_ru.qm
deleted file mode 100644
index 37b7de3..0000000
Binary files a/lib/resources/qt_ru.qm and /dev/null differ
diff --git a/lib/resources/qt_sk.qm b/lib/resources/qt_sk.qm
deleted file mode 100644
index 2787872..0000000
Binary files a/lib/resources/qt_sk.qm and /dev/null differ
diff --git a/lib/resources/qt_sl.qm b/lib/resources/qt_sl.qm
deleted file mode 100644
index fb85173..0000000
Binary files a/lib/resources/qt_sl.qm and /dev/null differ
diff --git a/lib/resources/qt_sv.qm b/lib/resources/qt_sv.qm
deleted file mode 100644
index b2c5557..0000000
Binary files a/lib/resources/qt_sv.qm and /dev/null differ
diff --git a/lib/resources/qt_uk.qm b/lib/resources/qt_uk.qm
deleted file mode 100644
index 862812c..0000000
Binary files a/lib/resources/qt_uk.qm and /dev/null differ
diff --git a/lib/resources/qt_zh_CN.qm b/lib/resources/qt_zh_CN.qm
deleted file mode 100644
index 4846f33..0000000
Binary files a/lib/resources/qt_zh_CN.qm and /dev/null differ
diff --git a/lib/resources/qt_zh_TW.qm b/lib/resources/qt_zh_TW.qm
deleted file mode 100644
index 09f82f8..0000000
Binary files a/lib/resources/qt_zh_TW.qm and /dev/null differ
diff --git a/lib/resources/ru.qm b/lib/resources/ru.qm
index c966969..a695399 100644
Binary files a/lib/resources/ru.qm and b/lib/resources/ru.qm differ
diff --git a/lib/resources/ru.ts b/lib/resources/ru.ts
index c069b23..503b9dd 100644
--- a/lib/resources/ru.ts
+++ b/lib/resources/ru.ts
@@ -2,1432 +2,1767 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="ru_RU">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
+    <message>
+        <source>About iTALC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>About</source>
+        <translation type="unfinished">О программе</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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-2011 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"></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>MainWindow</name>
+    <name>Client</name>
     <message>
-        <source>MainWindow</source>
+        <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>toolBar</source>
+        <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>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>Reboot computers</source>
+        <translation type="unfinished">Перезагрузить компьютеры</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Нет доступа на запись</translation>
+        <source>Are you sure want to power down all visible computers?</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>
+        <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 ':' for specifying an optional port-number)</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;">Введите IP-адрес или имя компьютера, который iTALC сможет определить как клиента (используйте ':', для задания номера порта - например 192.168.0.10:3567 )</p></body></html></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></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;">Опциональное имя компьютера, которое должно отображаться в iTALC.</p></body></html></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></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;">Аппаратный/MAC-адреса клиента - используются только для включения клиента</p></body></html></translation>
     </message>
     <message>
         <source>Classroom</source>
         <translation type="unfinished">Класс</translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Переключить класс</translation>
+        <source>Type</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>
+        <source>Student computer</source>
+        <translation type="unfinished">Компьютер учащегося</translation>
     </message>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Нажмите эту кнопку для переключения между классами.</translation>
+        <source>Teacher computer</source>
+        <translation type="unfinished">Компьютер учителя</translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Режим обзора</translation>
+        <source>Other/undefined computer</source>
+        <translation type="unfinished">Другой/незаданный компьютер</translation>
     </message>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Обзор</translation>
+        <source>Missing IP address/hostname</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>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished">Полноэкранное демо</translation>
+        <source>Interval between updates</source>
+        <translation type="unfinished">Интервал между обновлениями</translation>
     </message>
     <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Полноэкранное Демо</translation>
+        <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 network-traffic and lower CPU-usage on this computer.</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>Stop Demo</source>
-        <translation type="unfinished">Остановить Демо</translation>
+        <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 mouse-cursor over 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>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></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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Все изменения не будут иметь места до перезапуска iTALC.</span></p></body></html></translation>
+    </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>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>
+        <source>How does it work?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Демо в окне</translation>
+        <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>Window Demo</source>
-        <translation type="unfinished">Демо в окне</translation>
+        <source>Assistant mode</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>
+        <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>Lock/unlock desktops</source>
-        <translation type="unfinished">Блокировать/разблокировать компьютеры</translation>
+        <source>Create new access keys (master computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Заблокировать все</translation>
+        <source>assistantModeButtonGroup</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Разблокировать все</translation>
+        <source>Import public key (client computer)</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>
+        <source>Select user role</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Послать текстовое сообщение</translation>
+        <source>Please select a user role for which to create or import the access keys:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished">Текстовое сообщение</translation>
+        <source>Teacher</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>
+        <source>Administrator</source>
+        <translation type="unfinished">Администратор</translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Включить компьютеры</translation>
+        <source>Support team member</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Включить</translation>
+        <source>Other</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>
+        <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>Power down computers</source>
-        <translation type="unfinished">Выключить компьютеры</translation>
+        <source>Directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Выключить</translation>
+        <source>Export public key part (master computer)</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>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logon</source>
-        <translation type="unfinished">Вход в систему</translation>
+        <source>Use custom destination directory for access keys</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Удаленный вход</translation>
+        <source>Please specify the location of the public access key to be imported.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">После нажатия этой кнопки вы можете ввести имя пользователя и пароль для входа под соответствующим пользователем на всех видимых компьютерах.</translation>
+        <source>Summary</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Support</source>
-        <translation type="unfinished">Поддержка</translation>
+        <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>Direct support</source>
-        <translation type="unfinished">Прямая поддержка</translation>
+        <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>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>
+        <source>Select directory in which to export the public key</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Подогнать/выровнять</translation>
+        <source>Key files (*.key.txt)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Подогнать окно под его размер</translation>
+        <source>Invalid public key</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>
+        <source>The selected file does not contain a valid public iTALC access key!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Авто вид</translation>
+        <source>Select destination directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Автоматическая расстановка окон и подгонка размеров</translation>
+        <source>Access key creation</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>
+        <source>Could not remove previously existing file %1.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Не найдено верных ключей</translation>
+        <source>Failed exporting public access key from %1 to %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Не  найдены ключи авторизации или ваши старые были повреждены. Создайте новую пару ключей, используя ICA (см. документацию на http://italc.sf.net/wiki/index.php?title=Installation). 
-В противном случае вы не сможете получить доступ к компьютерам с помощью iTALC.</translation>
+        <source>Access keys were created and written successfully to %1 and %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">Сервис iTALC не запущен</translation>
+        <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>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Возможно служба iTALC не запущена на этом компьютере or или ключи аутенфикации неправильно настроены. Требуется запустить службу iTALC. Решите данную проблему с вашим администратором .</translation>
+        <source>Public key import</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">Основной Контроль iTALC</translation>
+        <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>Remote control</source>
-        <translation type="unfinished">Удаленное управление</translation>
+        <source>The public key was successfully imported to %1.</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>LockWidget</name>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished">Выход</translation>
+        <source>screen lock</source>
+        <translation type="unfinished">блокировка экрана</translation>
     </message>
 </context>
 <context>
-    <name>QApplication</name>
+    <name>LogonGroupEditor</name>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Клиент iTALC %1 на %2:%3</translation>
+        <source>Logon group editor</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Не удалось зарегистрировать службу '%1'.</translation>
+        <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>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>
+        <source>All groups</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Служба '%1' уже зарегистрирована.</translation>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Служба '%1' невозможно зарегистрировать.</translation>
+        <source>Groups with iTALC privileges</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>MainToolBar</name>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Служба '%1' была успешно зарегистрирована.</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Действия</translation>
     </message>
+</context>
+<context>
+    <name>MainWindow</name>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Службу '%1' невозможно остановить.</translation>
+        <source>General</source>
+        <translation type="unfinished">Главное</translation>
     </message>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Регистрация службы '%1' была отменена.</translation>
+        <source>Quit</source>
+        <translation type="unfinished">Выход</translation>
     </message>
     <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Служба '%1' не была зарегистрирована и поэтому невозможно ее отменить.</translation>
+        <source>iTALC Management Console</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Отмена регистрации службы '%1' невозможна.</translation>
+        <source>iTALC Server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Службу '%1' нельзя найти.</translation>
+        <source>Paths</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>Невозможно связаться с Service Control Manager (может у Вас недостаточно прав?!) - отмена регистрации службы '%1' не выполнена.</translation>
+        <source>Authentication</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>Невозможно связаться с Service Control Manager (может у Вас недостаточно прав?!) - служба '%1' не остановлена.</translation>
+        <source>iTALC Service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL (заметка для переводчиков: первые три символа этой строки являются акселераторами (подчеркнутыми символами) трех полей ввода в диалоговом окне входа - имейте это ввиду, иначе можете получить странные ошибки относительно возможностей входа)</translation>
+        <source>Hide tray icon</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>Снимки экрана iTALC</translation>
+        <source>Autostart</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About</source>
-        <translation>О программе</translation>
+        <source>Additional arguments</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>About iTALC</source>
-        <translation>О программе iTALC</translation>
+        <source>Start service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Авторы</translation>
+        <source>Stop service</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">О программе iTALC</span></p></body></html></translation>
+        <source>State:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Лицензия</translation>
+        <source>Stopped</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>ОК</translation>
+        <source>Logging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Перевод</translation>
+        <source>Log file directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
+        <source>...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
+        <source>Log level</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Actions</source>
-        <translation>Действия</translation>
+        <source>Nothing</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Действия для %1</translation>
+        <source>Only critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Добавить класс</translation>
+        <source>Errors and critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Добавить компьютер</translation>
+        <source>Warnings and errors</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>Вы уверены, что хотите удалить класс "%1"?
-Все компьютеры в нем будут также удалены!</translation>
+        <source>Information, warnings and errors</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>Перед добавление компьютеров вы должны создать хотя бы один класс
-Вы хотите создать класс сейчас?</translation>
+        <source>Debug messages and everything else</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Менеджер Классов</translation>
+        <source>Limit log file size</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Классы/компьютеры</translation>
+        <source>MB</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>Не могу открыть файл конфигурации  %1.
-Вы должны добавить хотя бы один класс и компьютеры используя менеджер классов, который можно найти в программе не панели слева.</translation>
+        <source>Clear all log files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Редактировать имя</translation>
+        <source>Desktop capturing</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Редактировать параметры</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Ошибка в файле конфигурации</translation>
+        <source>Poll full screen</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>Ошибка обработки файла конфигурации %1.
-Отредактируйте его. Иначе вы должны его удалить.</translation>
+        <source>Low accuracy (turbo mode)</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>Ошибка обработки файла конфигурации %1.
-Отредактируйте его. Иначе вы должны его удалить и добавить все классы и компьютеры снова.</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Экспорт в текстовый файл</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Скрыть все компьютеры в классе</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Скрыть компьютер учителя</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>IP-адреса</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Отсутствующий класс</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Новый класс</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Новое имя для класса</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Не найден файл конфигурации</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Пожалуйста введите новое имя для класса "%1".</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Снимки экрана</translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Пожалуйста введите имя класса, который хотите создать.</translation>
+        <source>Authentication methods</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Удалить</translation>
+        <source>Access key management</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Удалить класс</translation>
+        <source>Logon settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Выберите файл для вывода</translation>
+        <source>&File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Показать все компьютеры в классе</translation>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Показать/скрыть</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Показать имена пользователей</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Текстовый файл (*.txt)</translation>
+        <source>&Save settings into file</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>Здесь можно управлять компьютерами и классами. Вы можете добавить компьютеры или классы кликнув правой кнопкой по этому списку.</translation>
+        <source>Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Имена пользователей</translation>
+        <source>Ctrl+S</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Используйте контекстное меню (правая кнопка мышки) для добавления/удаления компьютеров и/или классов.</translation>
+        <source>L&oad settings from 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>Используйте эту кнопку для экспорта этого списока компьютеров и пользователей в текстовый файл. Вы можете использовать этот файл позже для сбора файлов после завершения экзамена. Иногда это необходимо, потому что некоторые пользователи могли завершить работу и выполнить выход раньше и поэтому вы не сможете собрать их файлы в конце экзамена.</translation>
+        <source>Ctrl+O</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Используйте это пространство для управления вашими компьютерами и классами самым простым способом.</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for selected</source>
+        <source>About Qt</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Demo running</source>
-        <translation>Запущенное демо</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Рабочий стол заблокирован</translation>
+        <source>toolBar</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Компьютер недоступен</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Нет начавших работу пользователей</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unknown state</source>
-        <translation>Неизвестное состояние</translation>
+        <source>Load settings from file</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>
+        <source>XML files (*.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
+        <source>Save settings to file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Завершить работу</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">Вы уверены, что хотите перезагрузить все видимые компьютеры?</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
+        <source>Configuration not writable</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">Перезагрузить компьютеры</translation>
+        <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>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">Вы уверены, что хотите выключить все видимые компьютеры?</translation>
+        <source>All settings were applied successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
+        <source>An error occured while applying settings!</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Обзор</translation>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Полноэкранное демо</translation>
+        <source>No write access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Демо в окне</translation>
+        <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>Locked display</source>
-        <translation type="unfinished">Заблокированный дисплей</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Класс</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation type="unfinished">Прямая трансляция</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Переключить класс</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Удаленное управление</translation>
+        <source>Click this button to open a menu where you can choose the active classroom.</source>
+        <translation type="unfinished">Нажмите эту кнопку для открытия меню в котором можно выбрать активную классную комнату.</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Разрешить учащемуся показать демо</translation>
+        <source>Click on this button, to switch between classrooms.</source>
+        <translation type="unfinished">Нажмите эту кнопку для переключения между классами.</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Послать текстовое сообщение</translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Режим обзора</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation type="unfinished">Начать работу</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Обзор</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Завершить работу</translation>
+        <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>Take a snapshot</source>
-        <translation type="unfinished">Сделать снимок экрана</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Полноэкранное демо</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Включить</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished">Полноэкранное Демо</translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Перезагрузить</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished">Остановить Демо</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Выключить</translation>
+        <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>Execute commands</source>
-        <translation type="unfinished">Запустить команду</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Демо в окне</translation>
+    </message>
+    <message>
+        <source>Window Demo</source>
+        <translation type="unfinished">Демо в окне</translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 Мбит/с LAN</translation>
+        <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>100 MBit/s LAN</source>
-        <translation>100 Мбит/с LAN</translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">Блокировать/разблокировать компьютеры</translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Работать как репликатор &демо</translation>
+        <source>Lock all</source>
+        <translation type="unfinished">Заблокировать все</translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation>Аналоговое</translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">Разблокировать все</translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>&Отмена</translation>
+        <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>Classroom</source>
-        <translation>Класс</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Послать текстовое сообщение</translation>
     </message>
     <message>
-        <source>Client settings</source>
-        <translation>Параметры клиента</translation>
+        <source>Text message</source>
+        <translation type="unfinished">Текстовое сообщение</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Соединение</translation>
+        <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>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 Кбит/с</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">Включить компьютеры</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 Кбит/с</translation>
+        <source>Power on</source>
+        <translation type="unfinished">Включить</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Главное</translation>
+        <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>Host is &gateway for subnet</source>
-        <translation>Компьютер - &шлюз в подсеть</translation>
+        <source>Power down computers</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;">Activate this option for at least one host in a subnet.</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>
+        <source>Power down</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 if the host is the gateway for the subnet.</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>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">connection to hosts on the same level</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>
+        <source>Support</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 ':' for specifying an optional port-number)</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;">Введите IP-адрес или имя компьютера, который iTALC сможет определить как клиента (используйте ':', для задания номера порта - например 192.168.0.10:3567 )</p></body></html></translation>
+        <source>Direct support</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></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;">Аппаратный/MAC-адреса клиента - используются только для включения клиента</p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Здесь вы можете задать, как этот компьютер подсоединяется к сети iTALC, то есть компьютеры одного уровня. Обычно компьютеры подключаются по 100 Мбитной локальной сети, но это могут специальные компьютеры, такие как шлюзы в другие сети iTALC в других школах или домашних компьютерах учащихся. В таких случаях iTALC пытается оптимизировать соединение.</p></body></html></translation>
+        <source>Adjust/align</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></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;">Опциональное имя компьютера, которое должно отображаться в iTALC.</p></body></html></translation>
+        <source>Adjust windows and their size</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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>
+        <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><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:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Настройки клиента</span></p></body></html></translation>
+        <source>Auto view</source>
+        <translation type="unfinished">Авто вид</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>IP/имя компьютера</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished">Автоматическая расстановка окон и подгонка размеров</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
+        <translation type="unfinished">При нажатии на эту кнопку все видимые окна будут перераспределены и подогнаны по размеру.</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>MAC-адреса</translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished">Основной Контроль iTALC</translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Имя</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Удаленное управление</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&ОК</translation>
+        <source>Could not modify the autostart property for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Другой/незаданный компьютер</translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Компьютер учащегося</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher computer</source>
-        <translation>Компьютер учителя</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Тип</translation>
+        <source>Enable desktop switching for screen lock (experimental)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <source>Log to standard error output</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Некорректный MAC-адрес</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Отсутствует IP-адрес/имя компьютера</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Вы не задали IP-адрес или имя компьютера!</translation>
+        <source>VNC reflector</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>Вы задали некорректный MAC-адрес. Вы можете оставить это поле пустым или ввести корректный MAC-адрес (используйте ":" как разделитель!).</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Cancel</source>
-        <translation>Отмена</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Введите команду, которую нужно запустить на клиенте(ах):</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Запуск!</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Запустить команду на клиенте(ах)</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>1 second</source>
-        <translation>1 секунда</translation>
+        <source>Key file authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Администратор</translation>
+        <source>ACL-based logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Домен</translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Действие по двойному щелчку в окне клиента</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Высокое (24 бита)</translation>
+        <source>Launch key file assistant</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 mouse-cursor over 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>
+        <source>Manage permissions</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>Test</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>Access confirmation</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 network-traffic and lower CPU-usage on this computer.</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>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Все изменения не будут иметь места до перезапуска iTALC.</span></p></body></html></translation>
+        <source>Logon authentication</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><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>
+        <source>Allow same user to access desktop without confirmation</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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>
+        <source>Debugging iTALC</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><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>
+        <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>Interval between updates</source>
-        <translation>Интервал между обновлениями</translation>
+        <source>1)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Низкое (15 бит)</translation>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Среднее (18 бит)</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Нет всплывающих подсказок</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Нет подписей к кнопкам</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Другой</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Качество демо-режима</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Удаленное управление</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation>секунд</translation>
+        <source>Generate bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Установки для мульти-входа</translation>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Сторонник</translation>
+        <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>Teacher</source>
-        <translation>Учитель</translation>
+        <source>Restart iTALC Service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User interface</source>
-        <translation>Интерфейс пользователя</translation>
+        <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>View live in fullscreen</source>
-        <translation>Показать трансляцию на полном экране</translation>
+        <source>Starting iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Ваша роль (требует соответствующего ключа!)</translation>
+        <source>Stopping iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>В этой области вы можете настроить  iTALC под себя.</translation>
+        <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>Your iTALC-configuration</source>
-        <translation>Ваша конфигурация iTALC</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>Демо iTALC</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
-        <translation>Ошибка сервера ISD</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>Сервер ISD невозможно запустить, поскольку порт %1 уже используется. Пожалуйста убедитесь, что нет других программ, использующих данный порт, и попробуйте снова.</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Подтверждение доступа</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Кто-то за компьютером %1 пытается получить доступ к вашему экрану. Хотите ли вы предоставить ему/ей доступ ?</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Никогда в этом сеансе</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Всегда в этом сеансе</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>Сообщение для учителя</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Ошибка аутенфикации</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Кто-то (IP: %1) пытается получить доступ к этому компьютеру, но не прошел аутенфикацию!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Снимок экрана</translation>
+        <source>Could not contact iTALC service</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>Не возможно сделать снимок, так как директория %1 не существует и не может быть создана.</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>блокировка экрана</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>ОК</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Сообщение для учителя</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
-    <message>
-        <source>About iTALC</source>
-        <translation>О програме iTALC</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>
+    <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">
+        <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>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>Конечно же вы можете настроить iTALC. Это можно сделать в соответствующей области.</translation>
+        <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>Рабочая область снимков очень мощный инструмент. Он позволяет управлять сделанными вами снимками.</translation>
+        <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>С помощью менеджера классов вы можете управлять классами и компьютерами. Вы также можете видеть подключенных пользователей.</translation>
+        <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"></translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Обзор</translation>
+        <translation type="unfinished">Обзор</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Начальная информация о iTALC и его использовании.</translation>
+        <translation type="unfinished">Начальная информация о iTALC и его использовании.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation type="unfinished">Имя пользователя</translation>
+    </message>
+    <message>
+        <source>Password</source>
+        <translation type="unfinished">Пароль</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>pageKeyDirs</name>
+    <name>QApplication</name>
     <message>
-        <source>Key directories</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>Клиент iTALC %1 на %2:%3</translation>
     </message>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Вновь созданные или импортированные ключи нужно установить везде. Рекомпендуется устанавливать в похожие директории.</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Не удалось зарегистрировать службу '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Папка для сохранения публичного ключа</translation>
+        <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>Directory to store private key in</source>
-        <translation>Папка для сохранения частного ключа</translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Служба '%1' уже зарегистрирована.</translation>
     </message>
     <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Служба '%1' невозможно зарегистрировать.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Экспортируйте частный ключ тоже</translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Служба '%1' была успешно зарегистрирована.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Службу '%1' невозможно остановить.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Регистрация службы '%1' была отменена.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <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>Import public key of master computer</source>
-        <translation>Импорт публичного ключа с головного компьютера</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Службу '%1' нельзя найти.</translation>
     </message>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Выберите размещение экспортируемого публичного ключа:</translation>
+        <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>Keep all keys (only when updating existing installation!)</source>
-        <translation>Сохранить все ключи (только при обновлении существующей установки!)</translation>
+        <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>pageWelcome</name>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>Welcome to iTALC</source>
+        <source>View live (%1 @ %2)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
+        <source>Remote control (%1 @ %2)</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>remoteControlWidget</name>
-    <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Удаленное управление (%1 на компьютер %2)</translation>
-    </message>
     <message>
         <source>unknown user</source>
-        <translation>неизвестный пользователь</translation>
-    </message>
-    <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Прямая трансляция (%1 на компьютер %2)</translation>
+        <translation type="unfinished">неизвестный пользователь</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
-    <message>
-        <source>Connected.</source>
-        <translation>Подключен.</translation>
-    </message>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
-        <source>Connecting %1</source>
-        <translation>Соединение с %1</translation>
+        <source>View only</source>
+        <translation type="unfinished">Только обзор</translation>
     </message>
     <message>
-        <source>Fullscreen</source>
-        <translation>На весь экран</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Удаленное управление</translation>
     </message>
     <message>
         <source>Lock student</source>
-        <translation>Заблокировать студента</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Выход</translation>
+        <translation type="unfinished">Заблокировать студента</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Удаленное управление</translation>
+        <source>Unlock student</source>
+        <translation type="unfinished">Разблокировать студента</translation>
     </message>
     <message>
         <source>Snapshot</source>
-        <translation>Снимок экрана</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>Разблокировать студента</translation>
+        <translation type="unfinished">Снимок экрана</translation>
     </message>
     <message>
-        <source>View only</source>
-        <translation>Только обзор</translation>
+        <source>Fullscreen</source>
+        <translation type="unfinished">На весь экран</translation>
     </message>
     <message>
         <source>Window</source>
-        <translation>В окне</translation>
-    </message>
-</context>
-<context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Cancel</source>
-        <translation>Отмена</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Domain</source>
-        <translation>Домен</translation>
+        <translation type="unfinished">В окне</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Удаленный вход</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Password</source>
-        <translation>Пароль</translation>
-    </message>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Удаленный вход</translation>
+        <source>Quit</source>
+        <translation type="unfinished">Выход</translation>
     </message>
     <message>
-        <source>Username</source>
-        <translation>Имя пользователя</translation>
+        <source>Connecting %1</source>
+        <translation type="unfinished">Соединение с %1</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>
+        <source>Connected.</source>
+        <translation type="unfinished">Подключен.</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Подтверждение перезаписи</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Вы хотите перезаписать %1?</translation>
-    </message>
+    <name>RemoteLogonDialog</name>
     <message>
-        <source>Cancel setup</source>
-        <translation>Отмена установки</translation>
+        <source>Remote logon</source>
+        <translation type="unfinished">Удаленный вход</translation>
     </message>
     <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
+        <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>Next</source>
-        <translation>Далее</translation>
+        <source>Username</source>
+        <translation type="unfinished">Имя пользователя</translation>
     </message>
     <message>
-        <source>Finish</source>
-        <translation>Завершить</translation>
+        <source>Password</source>
+        <translation type="unfinished">Пароль</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation>Выход</translation>
+        <source>Domain</source>
+        <translation type="unfinished">Домен</translation>
     </message>
+</context>
+<context>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
+    <name>Snapshot</name>
     <message>
-        <source>Choose public key directory</source>
-        <translation>Виберите папку публичного ключа</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Виберите папку частного ключа</translation>
+        <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>Choose public key export directory</source>
-        <translation>Виберите папку экспорта публичного ключа</translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Снимок экрана</translation>
     </message>
 </context>
 <context>
-    <name>setupWizardPageSecurityOptions</name>
+    <name>SnapshotList</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Снимки экрана</translation>
     </message>
-</context>
-<context>
-    <name>snapshotList</name>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Вы можете легко управлять снимками, используя эту рабочую область.</translation>
-    </message>
-    <message>
-        <source>Snapshots</source>
-        <translation>Снимки экрана</translation>
+        <translation type="unfinished">Вы можете легко управлять снимками, используя эту рабочую область.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
-    <message>
-        <source>Date:</source>
-        <translation>Дата:</translation>
-    </message>
-    <message>
-        <source>Delete snapshot</source>
-        <translation>Удалить снимок</translation>
-    </message>
-    <message>
-        <source>Host:</source>
-        <translation>Компьютер:</translation>
-    </message>
+    <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">
+        <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>Reload list</source>
-        <translation>Перезагрузить список</translation>
+        <source>User:</source>
+        <translation type="unfinished">Пользователь:</translation>
+    </message>
+    <message>
+        <source>Host:</source>
+        <translation type="unfinished">Компьютер:</translation>
     </message>
     <message>
-        <source>Show snapshot</source>
-        <translation>Показать снимок</translation>
+        <source>Date:</source>
+        <translation type="unfinished">Дата:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>Время:</translation>
+        <translation type="unfinished">Время:</translation>
     </message>
     <message>
-        <source>User:</source>
-        <translation>Пользователь:</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
-        <source>Cancel</source>
-        <translation>Отмена</translation>
+        <source>Support</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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Поддержка </span></p></body></html></translation>
+        <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>OK</source>
-        <translation>ОК</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Послать текстовое сообщение</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Введите IP адрес или имя компьютера человека, которому вы хотите помочь.</translation>
+        <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>Support</source>
-        <translation>Поддержка</translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Восстановление соединения с %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
+    <message>
+        <source>Overview</source>
+        <translation type="unfinished">Обзор</translation>
+    </message>
+    <message>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Полноэкранное демо</translation>
+    </message>
     <message>
-        <source>Cancel</source>
-        <translation>Отмена</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Демо в окне</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">Заблокированный дисплей</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>View live</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Послать текстовое сообщение</span></p></body></html></translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Удаленное управление</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&ОК</translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">Разрешить учащемуся показать демо</translation>
     </message>
     <message>
         <source>Send text message</source>
-        <translation>Послать текстовое сообщение</translation>
+        <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>Используйте это поле снизу для набора сообщения, которое хотите послать всем выбранным пользователям.</translation>
+        <source>Logout user</source>
+        <translation type="unfinished">Завершить работу</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Восстановление соединения с %1 ...</translation>
+        <source>Take a snapshot</source>
+        <translation type="unfinished">Сделать снимок экрана</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
+        <source>Power on</source>
+        <translation type="unfinished">Включить</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Отмена</translation>
+        <source>Reboot</source>
+        <translation type="unfinished">Перезагрузить</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Назад</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Выключить</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Далее</translation>
+        <source>Execute commands</source>
+        <translation type="unfinished">Запустить команду</translation>
     </message>
 </context>
 </TS>
diff --git a/lib/resources/sk.qm b/lib/resources/sk.qm
index abd9633..52eb07f 100644
Binary files a/lib/resources/sk.qm and b/lib/resources/sk.qm differ
diff --git a/lib/resources/sk.ts b/lib/resources/sk.ts
index dddccc4..e636592 100644
--- a/lib/resources/sk.ts
+++ b/lib/resources/sk.ts
@@ -2,1432 +2,1767 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="sk_SK">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
     <message>
-        <source>Actions</source>
-        <translation type="unfinished">Akcia</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>About</source>
+        <translation type="unfinished">O programe</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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">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-2011 Tobias Doerffel / iTALC Solutions</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>MainWindow</name>
+    <name>AccessDialogSlave</name>
     <message>
-        <source>MainWindow</source>
+        <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>toolBar</source>
+        <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>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>Classroom-Manager</source>
+        <translation type="unfinished">Správca triedy</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Bez možnosti zápisu</translation>
+        <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>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 sa ujistite, že máte povolenie pre vytvorenie alebo úpravu tohto adresáru.</translation>
+        <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>Classroom</source>
-        <translation type="unfinished">Učebňa</translation>
+        <source>Classrooms/computers</source>
+        <translation type="unfinished">Počítače/triedy</translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Prepnúť učebňu</translation>
+        <source>IP-address</source>
+        <translation type="unfinished">IP-adresa</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 učebňu.</translation>
+        <source>Usernames</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Kliknutím na toto tlačídlo môžte prepínať medzi učebňami.</translation>
+        <source>Show usernames</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Mód prezerania</translation>
+        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Prehľad</translation>
+        <source>Export to text-file</source>
+        <translation type="unfinished">Exportovat do textového súbora</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 štandardný mód iTALC, ktorý vám umožní zobraziť prehľad všetkých dostupných počítačov. Kliknutím na toto tlačidlo odomknete zamknuté počítače alebo opustíte demo mód.</translation>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished">Demo na celú obrazovku</translation>
+        <source>Hide teacher computers</source>
+        <translation type="unfinished">Skryť učiteľské počítače</translation>
     </message>
     <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Demo na celú obrazovku</translation>
+        <source>Show/hide</source>
+        <translation type="unfinished">Zobraziť/skryť</translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Zastaviť demo</translation>
+        <source>Edit settings</source>
+        <translation type="unfinished">Upraviť nastavenie</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 nebudú môcť robiť nič, pretože budú mať uzamknuté vstupné zariadenia.</translation>
+        <source>Remove</source>
+        <translation type="unfinished">Odstraniť</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demo v okne</translation>
+        <source>Show all computers in classroom</source>
+        <translation type="unfinished">Zobraziť všetky počítače v triede</translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Demo v okne</translation>
+        <source>Hide all computers in classroom</source>
+        <translation type="unfinished">Skryť všetky počítače v triede</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 bude vaša obrazovka zobrazená na všetkých dostupných počítačoch. Používatelia budú môcť prepínať medzi oknami, a tak pokračovať v práci.</translation>
+        <source>Edit name</source>
+        <translation type="unfinished">Upraviť meno</translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Zamknúť/odomknúť počítače</translation>
+        <source>Remove classroom</source>
+        <translation type="unfinished">Odstraniť triedu</translation>
     </message>
     <message>
-        <source>Lock all</source>
-        <translation type="unfinished">Zamknúť všetko</translation>
+        <source>Add computer</source>
+        <translation type="unfinished">Pridať počítač</translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Odomknúť všetko</translation>
+        <source>Add classroom</source>
+        <translation type="unfinished">Pridať triedu</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">Ak potrebujete plnú pozornosť používateľov môžte zamknút ich počítače týmto tlačídlom. V tomto móde budú všetky vstupné zariadenia uzamknuté a obrazovky budú čierne.</translation>
+        <source>No configuration-file found</source>
+        <translation type="unfinished">Nebol nájdený žiadny konfiguračný súbor</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Poslať textovú správu</translation>
+        <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>Text message</source>
-        <translation type="unfinished">Textová správa</translation>
+        <source>Error in configuration-file</source>
+        <translation type="unfinished">Chyba v konfiguračnom súbore</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 tohto tlačidla môžete poslať správu všetkým užívateľom, napr. zadať im nové úlohy, atd.</translation>
+        <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>Power on computers</source>
-        <translation type="unfinished">Zapne počítače</translation>
+        <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>Power on</source>
-        <translation type="unfinished">Zapnúť</translation>
+        <source>Select output-file</source>
+        <translation type="unfinished">Vybrať výstupný súbor</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>
+        <source>Text files (*.txt)</source>
+        <translation type="unfinished">Textové súbory (*.txt)</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Vypne počítače</translation>
+        <source>Actions for selected</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Vypnúť</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Akcia</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>
+        <source>Actions for %1</source>
+        <translation type="unfinished">Akcia pre %1</translation>
     </message>
     <message>
-        <source>Logon</source>
-        <translation type="unfinished">Prihlásiť</translation>
+        <source>New name for classroom</source>
+        <translation type="unfinished">Nové meno triedy</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Vzdialené prihlásenie</translation>
+        <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>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Kliknutím na toto tlačidlo môžete zadať užívateľské meno a heslo potrebné pre prihlásenie daného užívateľa na všetkých dostupných počítačoch.</translation>
+        <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>Support</source>
-        <translation type="unfinished">Podpora</translation>
+        <source>Missing classroom</source>
+        <translation type="unfinished">Chýba trieda</translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Priama podpora</translation>
+        <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>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">Ak potrebujete niekomu dať podporu na nejakom počítači, tak kliknite na toto tlačídlo a zadajte dané meno alebo IP adresu počítača.</translation>
+        <source>New classroom</source>
+        <translation type="unfinished">Nová trieda</translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Regulovať/zarovnať</translation>
+        <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>Adjust windows and their size</source>
-        <translation type="unfinished">Reguluje okná a nastaví ich veľkosť</translation>
+        <source>Unknown state</source>
+        <translation type="unfinished">Neznámy stav</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čídlo sa nastaví najväčšia možná velkosť okien klientov. Budú usporiadané aj všetky okná.</translation>
+        <source>No user logged in</source>
+        <translation type="unfinished">Žiadny užívateľ nie je prihlásení</translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Automatický pohľad</translation>
+        <source>Host unreachable</source>
+        <translation type="unfinished">Počítač nie je  k dispozícii</translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Automaticky prispôsobí okná aj ich veľkosť</translation>
+        <source>Demo running</source>
+        <translation type="unfinished">Bežiace predvádzanie</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 sa všetky viditeľné okná usporiadajú a prispôsobia.</translation>
+        <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>No valid keys found</source>
-        <translation type="unfinished">Neboli nájdené žiadne platné tlačidlá</translation>
+        <source>Are you sure want logout all users on all selected computers ?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Neboli nájdené autentifikačné kľúče alebo staré boli poškodené. Prosím vytvorte nový párový-kľúč použitím ICA(pozrite dokumentáciu na http://italc.sf.net/wiki/index.php?title=Installation)
-Inak nebudete môcť pristúpiť k počítačom pomocou iTALC.</translation>
+        <source>Logout user</source>
+        <translation type="unfinished">Odhlásiť užívateľa</translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">Služba iTALC nebeží</translation>
+        <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>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Na tomto počítači zrejme nebeží služba iTALC alebo autentifikačné kľúče niesu nastavené správne. Táto služba je potrebná na fungovanie iTALC. Kontaktujte administrátora pre riešenie tohto problému.</translation>
+        <source>Are you sure want to reboot all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC Master Control</source>
-        <translation type="unfinished">Hlavné ovládanie iTALC</translation>
+        <source>Reboot computers</source>
+        <translation type="unfinished">Reštartovať počítače</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Vzdialené ovládanie</translation>
+        <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>Quit</source>
-        <translation type="unfinished">Ukončiť</translation>
+        <source>Are you sure want to power down all selected computers?</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>QApplication</name>
+    <name>ClientSettingsDialog</name>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Klient iTALC %1 na %2:%3</translation>
+        <source>Invalid MAC-address</source>
+        <translation type="unfinished">Neplatná MAC-adresa</translation>
     </message>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Nemôžem zaregistrovať službu '%1'.</translation>
+        <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>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>
+        <source>Client settings</source>
+        <translation type="unfinished">Nastavenie klienta</translation>
     </message>
     <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Služba '%1' je už registrovaná.</translation>
+        <source>IP/hostname</source>
+        <translation type="unfinished">IP/meno</translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Nemôžem zaregistrovať službu '%1'.</translation>
+        <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 ':' for specifying an optional port-number)</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;">zadejte IP-adresu alebo meno počítača, na ktorom beží klient iTALC (pre určenie voliteľného čísla portu použite ':')</p></body></html></translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Služba '%1' bola úspešne registrovaná.</translation>
+        <source>Name</source>
+        <translation type="unfinished">Jméno</translation>
     </message>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Službu '%1' nie je možné zastaviť.</translation>
+        <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></source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Služba '%1' bola odregistrovaná.</translation>
+        <source>MAC address</source>
+        <translation type="unfinished"></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>
+        <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></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;">Hardwarová/MAC-adresa klienta - používá sa len pre zapnutie klientského počítača</p></body></html></translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Službu '%1' nebolo možné odregistrovať.</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Trieda</translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Služba '%1' sa nedá nájsť.</translation>
+        <source>Type</source>
+        <translation type="unfinished">Typ</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>
+        <source>Student computer</source>
+        <translation type="unfinished">Študentský počítač</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>
+        <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>QObject</name>
+    <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 network-traffic and lower CPU-usage on this computer.</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;">Tu sa zadává interval medzi jednotlivými aktualizáciami klientov. Vyššie hodnoty znižujú prevádzku na sieti a záťaž CPU tohoto počítača.</p></body></html></translation>
+    </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></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 mouse-cursor over 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;">Túto voľbu zaškrtnite, pokiaľ sa vám nepáči zobrazovanie pomoci v panelu nástrojov.</p></body></html></translation>
+    </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>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL</translation>
+        <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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Zapamätajte si prosím, že niektoré nastavenia nebudú aktívne pokiaľ nereštartujete iTALC.</span></p></body></html></translation>
+    </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>iTALC-snapshots</source>
-        <translation>iTALC-záber</translation>
+        <source>Additional arguments</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation>O iTALC</translation>
+        <source>Start service</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">O iTALC</span></p></body></html></translation>
+        <source>Stop service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>O programe</translation>
+        <source>State:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Autori</translation>
+        <source>Stopped</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Preklad</translation>
+        <source>Logging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Licencia</translation>
+        <source>Log file directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
+        <source>Log level</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
+        <source>Nothing</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Správca Učebne</translation>
+        <source>Only critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Pracovný priestor na jednoduchú  správu počítačov a učební.</translation>
+        <source>Errors and critical messages</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>Tu sa spravujú počítače a učebne.Môžete pridať počítač alebo učebňu pravým kliknutím v tomto zozname.</translation>
+        <source>Warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Učebne/Počítače</translation>
+        <source>Information, warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>IP-adresa</translation>
+        <source>Debug messages and everything else</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Skryť učiteľské počítače</translation>
+        <source>Limit log file size</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Nebol nájdený konfiguračný súbor</translation>
+        <source>MB</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>Nie je možné otvoriť konfiguračný súbor %1.
-Budete musieť pridať aspoň jednu učebňu a počítače použitím správcu učebne, ktorý nájdete v programe na lište vpravo.</translation>
+        <source>Clear all log files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Chyba v konfiguračnom súbore</translation>
+        <source>Desktop capturing</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>Chyba pri analýze konfiguračného súboru %1.
-Prosím upravte ho,inak budete musiet tento súbor vymazať a pridať všetky učebne a počítače znova.</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</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>Chyba pri analýze konfiguračného súboru %1.
-Prosím upravte ho inak budete musieť tento súbor vymazať.</translation>
+        <source>Poll full screen</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Zobraziť/skryť</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Zmeniť nastavenie</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Odstraniť</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Akcia</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Zobraziť všetky počítače v triede</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Skryť všetky počítače v triede</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Zmeniť meno</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Odstraniť učebňu</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Akcia pre %1</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Pridať počítač</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Pridať učebňu</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Zábery</translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Nové meno učebne</translation>
+        <source>Authentication methods</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Zadajte prosím nové meno pre učebňu "%1".</translation>
+        <source>Access key management</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>Naozaj si prajete odstrániť učebňu"%1"?
-Všetky počítače v nej budú odstránené!</translation>
+        <source>Logon settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Chýba učebňa</translation>
+        <source>&File</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>Pred pridaním počítačov musíte vytvoriť aspoň jednu učebňu.
-Prajete si vytvoriť novú triedu teraz?</translation>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Nová učebňa</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Prosím zadajte meno učebňe, ktorú chcete vytvoriť.</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Používateľské mená</translation>
+        <source>&Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Zobraziť používateľské mená</translation>
+        <source>Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Použite kontext-menu(pravé tlačítko myši) na pridanie/odstránenie počítačov a/alebo učební.</translation>
+        <source>Ctrl+S</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Exportovat do textového súbora</translation>
+        <source>L&oad settings from 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>Použite tento tlačitko na exportovanie tohto zoznamu počítačov a uživateľských mien do textového súboru.Tento súbor môžte neskôr použiť na zozbieranie súborov po skončení skúšky.Toto je potrebné, pretože niektorí používatelia mohli skončiť a odhlásiť sa skôr a nieje možné zozbierať ich súbory na konci skúšky.</translation>
+        <source>Ctrl+O</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Vybrať výstupný súbor</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Textové súbory (*.txt)</translation>
+        <source>About Qt</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation>Akcie pre vybrané</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Neznámy stav</translation>
+        <source>toolBar</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Žiadny užívateľ nie je prihlásení</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Počítač nie je  k dispozícii</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Beží demo</translation>
+        <source>Load settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Desktop zamknutí</translation>
+        <source>XML files (*.xml)</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>Naozaj chcete odhlásiť všetkých užívateľov na viditeľných počítačoch?</translation>
+        <source>Save settings to file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Naozaj chcete odhlásiť všetkých uživateľov na vybraných počítačoch?</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Odhlásiť užívateľa</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Naozaj chcete znovu naštartovať všetky viditeľné počítače?</translation>
+        <source>Configuration not writable</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Naozaj chcete znovu naštartovať všetky vybrané počítače?</translation>
+        <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>Reboot computers</source>
-        <translation>Reštartovať počítače</translation>
+        <source>All settings were applied successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Naozaj si prajete vypnúť všetky viditeľné počítače?</translation>
+        <source>An error occured while applying settings!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Naozaj si prajete vypnúť všetky vybrané počítače?</translation>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation>Prehľad</translation>
+        <source>No write access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation>Demo na celú obrazovku</translation>
+        <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>Window demo</source>
-        <translation>Demo v okne</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Trieda</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation>Obrazovka zamknutá</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Prepnúť triedu</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation>Zobraziť naživo</translation>
+        <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>Remote control</source>
-        <translation>Vzdialené ovládanie</translation>
+        <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>Let student show demo</source>
-        <translation>Zobraziť študentom demo</translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Mód prezerania</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation>Poslať textovú správu</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Prehľad</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation>Prihlásiť užívateľa</translation>
+        <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>Logout user</source>
-        <translation>Odhlásiť užívateľa</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Predvádzanie cez celú obrazovku</translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation>Zachytiť snímok</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation>Zapnúť</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation>Reštartovať</translation>
+        <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>Power down</source>
-        <translation>Vypnúť</translation>
+        <source>Window demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation>Vykonať príkazy</translation>
+        <source>Window Demo</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Nastavenie klienta</translation>
+        <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><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:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Nastavenie klienta</span></p></body></html></translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">Zamknúť/odomknúť počítače</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Hlavné</translation>
+        <source>Lock all</source>
+        <translation type="unfinished">Zamknúť všetko</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Typ</translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">Odomknúť všetko</translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Študentský počítač</translation>
+        <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>Teacher computer</source>
-        <translation>Učiteľský počítač</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Poslať textovú správu</translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Iný/nedefinovaný počítač</translation>
+        <source>Text message</source>
+        <translation type="unfinished">Textová správa</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation>Učebňa</translation>
+        <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>MAC-address</source>
-        <translation>MAC-adresa</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">Zapne počítače</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 ':' for specifying an optional port-number)</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;">zadejte IP-adresu alebo meno počítača,cez ktorý môže iTALC dosiahnuť klienta (použite ':' pre špecifikovanie voliteľného čísla-portu)</p></body></html></translation>
+        <source>Power on</source>
+        <translation type="unfinished">Zapnúť</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>IP/meno</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></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;">Hardwarová/MAC-adresa klienta - používá sa len pre zapnutie klientského počítača</p></body></html></translation>
+        <source>Power down computers</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Meno</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Vypnúť</translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <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>Connection</source>
-        <translation>Pripojenie</translation>
+        <source>Support</source>
+        <translation type="unfinished">Podpora</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;">connection to hosts on the same level</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;">pripojenie k počítačom na rovnakej úrovni</p></body></html></translation>
+        <source>Direct support</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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Tu môžte špecifikovať ako bude počítač pripojený k sieti iTALC. Bežne su počítače pripojené cez 100MBit/s sieť LAN, ale môže byť špeciálne počítače ako napr. brány do iných sietí iTALC v cudzích školách alebo študentských počítačov doma. V takýchto prípadoch sa snaží iTALC optimalizovať zaťaženosť siete.</p></body></html></translation>
+        <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>Analog</source>
-        <translation>Analog</translation>
+        <source>Adjust/align</source>
+        <translation type="unfinished">Usporiadať/zarovnať</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Adjust windows and their size</source>
+        <translation type="unfinished">Usporiada okná a nastaví ich veľkosť</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400.KBit/s</translation>
+        <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>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <source>Auto view</source>
+        <translation type="unfinished">Automatický pohľad</translation>
     </message>
     <message>
-        <source>100 MBit/s LAN</source>
-        <translation>LAN 100 MBit/s</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished">Automaticky prispôsobí okná aj ich veľkosť</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>LAN 1000 MBit/s</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 if the host is the gateway for the subnet.</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;">Zaškrtnite ak je počítač bránou do podsiete.</p></body></html></translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host is &gateway for subnet</source>
-        <translation>Počítač je &bránou podsiete</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Vzdialené ovládanie</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;">Activate this option for at least one host in a subnet.</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;">Aktivujte túto možnosť pre aspoň jeden počítač v podsieti.</p></body></html></translation>
+        <source>Could not modify the autostart property for the iTALC Service.</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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;">Pri zobrazování dema pre jeden alebo viac počítačov cudzej siete, je vhodné vybrať túto voľbu aspoň u jedného počítača, ktorého sa to týká. Tak budú údaje ukážky odosielané na replikátor len raz a ten potom ponúkne údaje ostaním počítačom v sieti. To sa používa hlavne pre pomalšie linky. Normálne by táto voľba mala byť povolená na bráne podsiete (pozrite sa na voľbu vyššie).</p></body></html></translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Fungovať ako &demo replikátor</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>Z&rušiť</translation>
+        <source>Enable desktop switching for screen lock (experimental)</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></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;">Volitelná prezývka pod ktorou bude počítač zobrazený v iTALC.</p></body></html></translation>
+        <source>Log to standard error output</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Chýba IP-adresa/meno počítača</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Nezadali ste IP-adresu alebo meno počítača!</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Neplatná MAC-adresa</translation>
+        <source>VNC reflector</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>Zadali ste nesprávnu MAC-adresu. Zadajte platnú MAC-adresu (oddelovačom je ":"), alebo nechajte pole prázdne.</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Spustiť príkazy na klientoch</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Zadajte príkazy, ktoré si prajete spustiť na klientoch:</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Zrušiť</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Spustiť!</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Interval medzi aktualizáciami</translation>
+        <source>Key file authentication</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 network-traffic and lower CPU-usage on this computer.</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;">Tu sa zadává interval medzi jednotlivými aktualizáciami klientov. Vyššie hodnoty znižujú prevádzku na sieti a záťaž CPU tohoto počítača.</p></body></html></translation>
+        <source>ACL-based logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 sekunda</translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> sekúnd</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Kvalita demo-módu</translation>
+        <source>Launch key file assistant</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">Tu môžete nastaviť kvalitu zobrazovania demo módu. Nižšia kvalita má za následok nižšiu zátaž CPU a siete, kým vyššia kvalita môže spomaliť váš počítač a znížiť zobrazovaciu frekvenciu vašej ukážky. Pre optimálne nastavenie je potrebné experimentovať.</p></body></html></translation>
+        <source>Manage permissions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Nízka (15 bitů)</translation>
+        <source>Test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Stredná (18 bitů)</translation>
+        <source>Access confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Vysoká (Truecolor)</translation>
+        <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>User interface</source>
-        <translation>Užívateľské rozhranie</translation>
+        <source>Logon authentication</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Nezobrazovať tipy v paneli nástrojov</p></body></html></translation>
+        <source>Allow same user to access desktop without confirmation</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 mouse-cursor over 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;">Túto voľbu zaškrtnite, pokiaľ sa vám nepáči zobrazovanie pomoci ked hýbete myšou ponad tlačídla nad panelom nástrojov.</p></body></html></translation>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Nepoužívať bublinovú pomoc</translation>
+        <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>Your role (needs according keys!)</source>
-        <translation>Vaša rola (vyžaduje odpovedajúce kľúče!)</translation>
+        <source>1)</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><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 si 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 pôvodnú rolu.</p></body></html></translation>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Učiteľ</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Administrátor</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Podpora</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Iná</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Nastavenia pre viacnásobné prihlásenie</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Doména</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Dvojklik v okne klienta</translation>
+        <source>Generate bug report archive</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><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 nastavíte, čo sa stane stlačením dvojkliku na okno klienta.</p></body></html></translation>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Vzdialené ovládanie</translation>
+        <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>View live in fullscreen</source>
-        <translation>Zobrazenie na celej obrazovke</translation>
+        <source>Restart iTALC Service</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Zapamätajte si prosím, že niektoré nastavenia nebudú aktívne pokiaľ nereštartujete iTALC.</span></p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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;">Neukazovať texty na tlačídlach panela nástrojov</p></body></html></translation>
+        <source>Starting iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Žiadne texty na tlačídlach nástrojov</translation>
+        <source>Stopping iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Vaša konfigurácia iTALC</translation>
+        <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>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>V tomto pracovnom prostredí môžete upraviť iTALC vašim potrebám.</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>Predvádzanie iTALC</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
-        <translation>Chyba servera ISD</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>Server ISD sa nepodarilo spustiť, pretože sa port %1 stále používa. Presvedčte sa prosím, že tento port nepoužíva iná aplikácia a skúste to znova.</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Potvrďte prístup</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Niekto s počítača %1 sa snaží pristupovať k vašej obrazovke. Chcete mu povoliť prístup?</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Nikdy pre toto sedenie</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Vždy pre toto sedenie</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>Správa od učiteľa</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Chyba autentifikácie</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Niekto (IP: %1) sa pokúša pristupovať k tomuto počítaču, ale nie je ho možné autentifikovať!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Snímka</translation>
+        <source>Could not contact iTALC service</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>Nemôžem zachytiť snímku, pretože %1 neexistuje alebo nemôže byť vytvorený.</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>uzamknutie obrazovky</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>OK</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Správa od učiteľa</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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">
+        <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>Tu môžte vidieť pracovnú plochu, ktorá obsahuje niekoľko tlačídiel. Každé tlačítko je pripojené k nejakej pracovnej ploche. Kliknutím na odpovedajúce tlačidlo sa pozrite na dostupnú pracovnú plochu.</translation>
+        <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>Plocha zo záberom obrazovky je veľmi užitočná. Umožní vám spravovať snímky, ktoré vytvoríte.</translation>
+        <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>Samozrejme, že môžete nastavovať iTALC. To sa obyčajne robí pomocou konfiguračnej plochy.</translation>
+        <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>O iTALC</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>Používaním manažéra-učebne môzete spravovať vaše učebne a počítače. Môžete taktiež vidieť, ktorý užívateľ je prihlásený.</translation>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Prehľad</translation>
+        <translation type="unfinished">Prehľad</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Niektoré základné informácie o iTALC a ako ho používať.</translation>
+        <translation type="unfinished">Niektoré základné informácie o iTALC a práce s programom.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation type="unfinished">Uživateľské meno</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
+        <source>Password</source>
+        <translation type="unfinished">Heslo</translation>
+    </message>
+    <message>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>pageKeyDirs</name>
-    <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Nové vytvorené alebo importované klúče musia byť niekde nainštalované. Odporúčame nechať pôvodné adresáre.</translation>
-    </message>
+    <name>QApplication</name>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Adresár pre uloženie verejných kľúčov</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>Klient iTALC %1 na %2:%3</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation>Adresár pre uloženie súkromných kľúčov</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Nemôžem zaregistrovať službu '%1'.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Exportovať tiež súkromný kľúč</translation>
+        <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>Key directories</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Služba '%1' je už registrovaná.</translation>
     </message>
     <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Nemôžem zaregistrovať službu '%1'.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Importovat verejný kľúč hlavného počítača</translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Služba '%1' bola úspešne registrovaná.</translation>
     </message>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Zvoliť umiestnenie exportovaného verejného kľúča:</translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Službu '%1' nie je možné zastaviť.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Zachovať všetky kľúče (len ak aktualizujete existujúcu inštaláciu!)</translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Služba '%1' bola odregistrovaná.</translation>
     </message>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <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>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Službu '%1' nebolo možné odregistrovať.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Služba '%1' sa nedá nájsť.</translation>
     </message>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
+        <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>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Zobrazenie naživo (%1 na počítači %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Vzdialené ovládanie (%1 na počítači %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation>neznámý užívateľ</translation>
+        <translation type="unfinished">neznámý užívateľ</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation>Len prezerať</translation>
+        <translation type="unfinished">Len prezerať</translation>
     </message>
     <message>
         <source>Remote control</source>
-        <translation>Vzdialené ovládanie</translation>
+        <translation type="unfinished">Vzdialené ovládanie</translation>
     </message>
     <message>
         <source>Lock student</source>
-        <translation>Zamknúť študenta</translation>
+        <translation type="unfinished">Zamknúť študenta</translation>
     </message>
     <message>
         <source>Unlock student</source>
-        <translation>Odomknúť študenta</translation>
+        <translation type="unfinished">Odomknúť študenta</translation>
     </message>
     <message>
         <source>Snapshot</source>
-        <translation>Snímka</translation>
+        <translation type="unfinished">Záber</translation>
     </message>
     <message>
         <source>Fullscreen</source>
-        <translation>Celá obrazovka</translation>
+        <translation type="unfinished">Celá obrazovka</translation>
     </message>
     <message>
         <source>Window</source>
-        <translation>Okno</translation>
+        <translation type="unfinished">Okno</translation>
     </message>
     <message>
         <source>Quit</source>
-        <translation>Ukončiť</translation>
+        <translation type="unfinished">Ukončiť</translation>
     </message>
     <message>
         <source>Connecting %1</source>
-        <translation>Pripájam %1</translation>
+        <translation type="unfinished">Pripájam %1</translation>
     </message>
     <message>
         <source>Connected.</source>
-        <translation>Pripojené.</translation>
+        <translation type="unfinished">Pripojené.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Vzdialené prihlásenie</translation>
-    </message>
+    <name>RemoteLogonDialog</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:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Vzdialené prihlásenie</span></p></body></html></translation>
+        <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>Do nižšie uvedených polí zadajte užívateľské meno, heslo a voliteľne aj meno domény. Tieto informácie budú použité pre prihlásenie počítaču.</translation>
+        <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>Uživateľské meno</translation>
+        <translation type="unfinished">Uživateľské meno</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>Heslo</translation>
+        <translation type="unfinished">Heslo</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation>Doména</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Zrušiť</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <translation type="unfinished">Doména</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Potvrdiť prepísanie</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Želáte si prepísať %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Zrušiť sprievodcu</translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Ďalší</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Dokončiť</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Ukončiť</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>File does not exist</source>
-        <translation type="unfinished">Súbor neexistuje</translation>
-    </message>
-    <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
-        <translation type="unfinished">Súbor %1 nemôže byť nájdený. Skontrolujte to prosím a skúste to znova.</translation>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Zvoľte adresár s verejným kľúčom</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Zvoľte adresár so súkromným kľúčom</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Zvoľte adresár pre export verejného kľúča</translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Záber</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>Snímky</translation>
+        <translation type="unfinished">Zábery</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Jednoducho spravujte snímky, ktoré ste vytvorili, touto pracovnou plochou.</translation>
+        <translation type="unfinished">Jednoducho spravuje vami vytvorené zábery plôch.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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">
+        <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é snímky sú zobrazené tu. Snímky môžete urobiť výberom odpovedajúcej položky v kontextovej ponuke klientského okna. Tieto snímky je možné spravovať pomocou tlačídiel nižšie.</p></body></html></translation>
+<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>Užívateľ:</translation>
+        <translation type="unfinished">Užívateľ:</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation>Počítač:</translation>
+        <translation type="unfinished">Počítač:</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation>Dátum:</translation>
+        <translation type="unfinished">Dátum:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>ÄŒas:</translation>
+        <translation type="unfinished">ÄŒas:</translation>
     </message>
     <message>
-        <source>Show snapshot</source>
-        <translation>Zobraziť snímku</translation>
-    </message>
-    <message>
-        <source>Delete snapshot</source>
-        <translation>Zmazať snímku</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Načítať zoznam</translation>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation>Podpora</translation>
+        <translation type="unfinished">Podpora</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Zadejte prosím IP-adresu alebo meno počítača, kde sedí osoba, ktorej chcete poskytnút podporu.</translation>
+        <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>OK</source>
-        <translation>OK</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Poslať textovú správu</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Zrušiť</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Podpora </span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Pripájam sa k %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Poslať textovú správu</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Prehľ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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Poslat textovou zprávu</span></p></body></html></translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Predvádzanie cez celú obrazovku</translation>
     </message>
     <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Do pola nižšie napíšte vašu správu, ktorá bude poslaná všetkým vybraním užívateľom.</translation>
+        <source>Window demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&OK</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">Obrazovka zamknutá</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>View live</source>
+        <translation type="unfinished">Zobraziť naživo</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Zrušiť</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Vzdialené ovládanie</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">Zobraziť študentom demo</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Nadväzujem spojenie k %1 ...</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Poslať textovú správu</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>Cancel</source>
-        <translation>Zrušiť</translation>
+        <source>Logout user</source>
+        <translation type="unfinished">Odhlásiť užívateľa</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Späť</translation>
+        <source>Take a snapshot</source>
+        <translation type="unfinished">Zoskenovať obrazovku</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Ďalší</translation>
+        <source>Power on</source>
+        <translation type="unfinished">Zapnúť</translation>
     </message>
     <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
+        <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
index dc1146d..12929e6 100644
Binary files a/lib/resources/sl.qm and b/lib/resources/sl.qm differ
diff --git a/lib/resources/sl.ts b/lib/resources/sl.ts
index 04df7cd..a7d190c 100644
--- a/lib/resources/sl.ts
+++ b/lib/resources/sl.ts
@@ -2,1433 +2,1768 @@
 <!DOCTYPE TS>
 <TS version="2.0">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
+    <message>
+        <source>About iTALC</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>About</source>
+        <translation type="unfinished">O</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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">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-2011 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>
-</context>
-<context>
-    <name>MainWindow</name>
     <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
+        <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 ':' for specifying an optional port-number)</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;">vnesite IP-naslov ali ime gostitelja pod katerim bo iTALC lahko dosegel odjemalca (uporabite ':' za določanje vrat - opcijsko)</p></body></html></translation>
+    </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></source>
+        <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></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;">Strojni/MAC-naslov gostitelja - uporabljeno le pri zagonu odjemalca</p></body></html></translation>
+    </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 network-traffic and lower CPU-usage on this computer.</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;">Tukaj lahko vnesete časovni interval med posodobitvami odjemalcev. Večje vrednosti manj obremenjujejo omrežje in procesor tega računalnika.</p></body></html></translation>
+    </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></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 mouse-cursor over 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;">Označite to možnost, če vas namigi, ki se prikazujejo, ko z miško pokažete na gumb, motijo..</p></body></html></translation>
+    </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>toolBar</source>
+        <source>Remote control</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>View live in fullscreen</source>
+        <translation type="unfinished">Pogled v živo celozaslonsko</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Ni pravic zapisovanja</translation>
+        <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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Nekatere spremembe ne bodo stopile v veljavo, dokler ponovno ne zaženete iTALC.</span></p></body></html></translation>
     </message>
+</context>
+<context>
+    <name>ConfigWidget</name>
     <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>
+        <source>Your iTALC-configuration</source>
+        <translation type="unfinished">Vaše iTALC nastavitve</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Učilnica</translation>
+        <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>Switch classroom</source>
-        <translation type="unfinished">Zamenjaj učilnico</translation>
+        <source>OK</source>
+        <translation type="unfinished">V redu</translation>
     </message>
+</context>
+<context>
+    <name>DemoClient</name>
     <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>
+        <source>iTALC Demo</source>
+        <translation type="unfinished">iTALC Demo</translation>
     </message>
+</context>
+<context>
+    <name>ItalcCoreServer</name>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Kliknite ta gumb za zamenjavo učilnic.</translation>
+        <source>Authentication error</source>
+        <translation type="unfinished">Napaka verodostojnosti</translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Pregledni način</translation>
+        <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>Overview</source>
-        <translation type="unfinished">Pregled</translation>
+        <source>VNC authentication failed because of too many authentication tries.</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">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>
+        <source>VNC authentication failed.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Celozaslonski demo</translation>
+        <source>VNC server closed connection.</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>KeyFileAssistant</name>
     <message>
-        <source>Fullscreen Demo</source>
+        <source>iTALC Access Key Assistant</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Stop Demo</source>
+        <source>Create/import iTALC access keys</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>
+        <source>This assistant will help you to create or import iTALC access keys.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Demo okno</translation>
+        <source>How does it work?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window Demo</source>
+        <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>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>
+        <source>Assistant mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Zakleni/odkleni namizja</translation>
+        <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>Lock all</source>
-        <translation type="unfinished">Zakleni vse</translation>
+        <source>Create new access keys (master computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Odkleni vse</translation>
+        <source>assistantModeButtonGroup</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">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>
+        <source>Import public key (client computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Pošlji besedilno sporočilo</translation>
+        <source>Select user role</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished">Besedilno sporočilo</translation>
+        <source>Please select a user role for which to create or import the access keys:</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">Uporabite ta gumb za pošiljanje besedilnih sporočil vsem uporabnikom, npr. da jim pojasnite nova opravila itd.</translation>
+        <source>Teacher</source>
+        <translation type="unfinished">Učitelj</translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Vključi računalnike</translation>
+        <source>Administrator</source>
+        <translation type="unfinished">Administrator</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Vključi</translation>
+        <source>Support team member</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">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>
+        <source>Other</source>
+        <translation type="unfinished">Drugo</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Izključi računalnike</translation>
+        <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>Power down</source>
-        <translation type="unfinished">Izključi</translation>
+        <source>Directories</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">Za zaustavitev vseh prikazanih računalnikov (npr. ko je ura končana) lahko kliknete ta gumb.</translation>
+        <source>Export public key part (master computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logon</source>
-        <translation type="unfinished">Prijava</translation>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Oddaljena prijava</translation>
+        <source>Use custom destination directory for access keys</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Po kliku tega gumba lahko vpišete uporabniško ime in geslo ustreznega uporabnika, da bi se prijavili na vse vidne računalnike.</translation>
+        <source>Please specify the location of the public access key to be imported.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Support</source>
-        <translation type="unfinished">Podpora</translation>
+        <source>Summary</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Direct support</source>
+        <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>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
+        <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>Adjust/align</source>
-        <translation type="unfinished">Prilagodi/poravnaj</translation>
+        <source>Select directory in which to export the public key</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Poravnaji okna in prilagodi njihovo velikost</translation>
+        <source>Key files (*.key.txt)</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">Po kliku tega gumba bo velikost oken odjemalca nastavljena na največjo mogočo. Vsa okna bodo poravnana.</translation>
+        <source>Invalid public key</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Samodejni pogled</translation>
+        <source>The selected file does not contain a valid public iTALC access key!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Preuredi okna in njihovo velikost</translation>
+        <source>Select destination directory</source>
+        <translation type="unfinished"></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>
+        <source>Access key creation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Ne najdem veljavnih ključev</translation>
+        <source>Could not remove previously existing file %1.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Ne najdem avtorizacijskih ključev ali so stari poškodovani. Prosim, ustvarite nov par ključev z uporabo ICA (glejte dokumentacijo na http://italc.sf.net/wiki/index.php?title=Installation).(new line)
-Sicer z uporabo iTALC ne boste mogli dostopati do računalnikov.</translation>
+        <source>Failed exporting public access key from %1 to %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">iTALC storitev ne teče</translation>
+        <source>Access keys were created and written successfully to %1 and %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Videti je, kot da na tem računalniku ne teče iTALC storitev ali avtorizacijska ključa nista nastavljena pravilno. Ta storitev je za pravilno delovanje iTALC potrebna. Za rešitev problema se posvetujte z administratorjem.</translation>
+        <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>iTALC Master Control</source>
+        <source>Public key import</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Oddaljen nadzor</translation>
+        <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>Quit</source>
+        <source>The public key was successfully imported to %1.</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>QApplication</name>
+    <name>LockWidget</name>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC odjemalec %1 na %2:%3</translation>
+        <source>screen lock</source>
+        <translation type="unfinished">zaklenjeno namizje</translation>
     </message>
+</context>
+<context>
+    <name>LogonGroupEditor</name>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Ne morem registrirati storitve '%1'.</translation>
+        <source>Logon group editor</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>Storitev urejevalnika nadzora ne more biti povezana (imate ustrezne pravice?!) - storitev  '%1'  ni bila registrirana.</translation>
+        <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>The service '%1' is already registered.</source>
-        <translation>Storitev '%1' je že registrirana.</translation>
+        <source>All groups</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Storitev '%1' ne more biti registrirana.</translation>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Storitev '%1' je bila uspešno registrirana.</translation>
+        <source>Groups with iTALC privileges</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>MainToolBar</name>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Storitve '%1' ni možno ustaviti.</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Dejanja</translation>
     </message>
+</context>
+<context>
+    <name>MainWindow</name>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Storitev '%1' je bila neregistrirana.</translation>
+        <source>General</source>
+        <translation type="unfinished">Splošno</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>
+        <source>Quit</source>
+        <translation type="unfinished">Zapusti</translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Storitev '%1' ne more biti neregistrirana.</translation>
+        <source>iTALC Management Console</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Storitve '%1' ni mogoče najti.</translation>
+        <source>iTALC Server</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>Storitev urejevalnika nadzora ne more biti povezana (imate ustrezne pravice?!) - storitevi  '%1'  ni bila neregistrirana.</translation>
+        <source>Paths</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>Storitev urejevalnika nadzora ne more biti povezana (imate ustrezne pravice?!) - storitev  '%1'  ni bila ustavljena..</translation>
+        <source>Authentication</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL (navodilo prevajalcem: prvi trije karakterji tega stringa so pospeševalniki (podčrtani karakterji) od treh vhodnih-polj v prijavnem-dialogu windows-ov - prosim vzemite na znanje)</translation>
+        <source>iTALC Service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation type="unfinished">iTALC - posneteki</translation>
+        <source>Hide tray icon</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation>O iTALC</translation>
+        <source>Autostart</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Ot iTALC</span></p></body></html></translation>
+        <source>Additional arguments</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>O</translation>
+        <source>Start service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Avtorji</translation>
+        <source>Stop service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Prevod</translation>
+        <source>State:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Dovoljenja</translation>
+        <source>Stopped</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>V redu</translation>
+        <source>Logging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
+        <source>Log file directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
+        <source>...</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Upravitelj učilnice</translation>
+        <source>Log level</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Uporabite to mesto za enostavno upravljanje računalnikov in učilnic.</translation>
+        <source>Nothing</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>Tukaj lahko upravljate učilnice in računalnike. S klikom v desnem seznamu lahko dodajate učilnice ali računalnike.</translation>
+        <source>Only critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Učilnice/računalniki</translation>
+        <source>Errors and critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>IP-naslov</translation>
+        <source>Warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Skrij učiteljeve računalnike</translation>
+        <source>Information, warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Ne najdem nastavitvene datoteke</translation>
+        <source>Debug messages and everything else</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>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>
+        <source>Limit log file size</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Napaka v nastavitveni datoteki</translation>
+        <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>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>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>
+        <source>Enable capturing of layered (semi-transparent) windows</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>Napaka pri anlizi nastavitvene datoteke %1.
-Prosim, uredite jo. Sicer bi morali to datoteko izbrisati.</translation>
+        <source>Poll full screen</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Prikaži/skrij</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Uredi nastavitve</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Odstrani</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Dejanja</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Prikaži vse računalnike v učilnici</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Skrij vse računalnike v učilnici</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Uredi ime</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Odstrani učilnico</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Dejanja za %1</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Dodaj računalnik</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Dodaj učilnico</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Posnetki</translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Novo ime učilnice</translation>
+        <source>Authentication methods</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Prosim, vpišite novo ime učilnice "%1".</translation>
+        <source>Access key management</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>Ste prepričani, da želite odstraniti učilnico "%1"?
-
-Z njo bodo odstranjeni tudi vsi računalniki v njej!</translation>
+        <source>Logon settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Manjka učilnica</translation>
+        <source>&File</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>Pred dodajanjem računalnikov morate ustvariti vsaj eno učilnico.
-Jo želite ustvariti zdaj?</translation>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Nova učilnica</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Prosim, vnesite ime učilnice, ki jo želite ustvariti.</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
+        <source>&Save settings into file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
+        <source>Save settings into file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
+        <source>Ctrl+S</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">Izvozi v besedilno datoteko</translation>
+        <source>L&oad settings from 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>
+        <source>Ctrl+O</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">Izberite izhodno datoteko</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">Besedilne datoteke (*.txt)</translation>
+        <source>About Qt</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for selected</source>
+        <source>MainWindow</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Neznano stanje</translation>
+        <source>toolBar</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Noben uporabnik ni prijavljen</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Gostitelj ni dosegljiv</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Demo je zagnan</translation>
+        <source>Load settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Namizje je zaklenjeno</translation>
+        <source>XML files (*.xml)</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">Ste prepričani, da želite odjaviti vse uporabnike na vseh vidnih računalnikih?</translation>
+        <source>Save settings to file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
+        <source>Unsaved settings</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">Odjavi uporabnika</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation type="unfinished"></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>
+        <source>Configuration not writable</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
+        <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>Reboot computers</source>
-        <translation type="unfinished">Ponovno zaženi računalnike</translation>
+        <source>All settings were applied successfully.</source>
+        <translation type="unfinished"></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>
+        <source>An error occured while applying settings!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Pregled</translation>
+        <source>No write access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">Celozaslonski demo</translation>
+        <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>Window demo</source>
-        <translation type="unfinished">Demo okno</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Učilnica</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation type="unfinished">Zaklenjen zaslon</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Zamenjaj učilnico</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation type="unfinished">Pogled v živo</translation>
+        <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>Remote control</source>
-        <translation type="unfinished">Oddaljen nadzor</translation>
+        <source>Click on this button, to switch between classrooms.</source>
+        <translation type="unfinished">Kliknite ta gumb za zamenjavo učilnic.</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">Dovoli učencu vpogled v demo</translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Pregledni način</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">Pošlji besedilno sporočilo</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Pregled</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation type="unfinished">Prijavi uporabnika</translation>
+        <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>Logout user</source>
-        <translation type="unfinished">Odjavi uporabnika</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Celozaslonski demo</translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished">Posnemi trnutno stanje</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Vključi</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation type="unfinished">Ponovno zaženi</translation>
+        <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>Power down</source>
-        <translation type="unfinished">Izključi</translation>
+        <source>Window demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation type="unfinished">Izvedi ukaze</translation>
+        <source>Window Demo</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Nastavitve odjemalca</translation>
+        <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><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:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Nastavitve odjemalca</span></p></body></html></translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">Zakleni/odkleni namizja</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Splošno</translation>
+        <source>Lock all</source>
+        <translation type="unfinished">Zakleni vse</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Tip</translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">Odkleni vse</translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Učenčev računalnik</translation>
+        <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>Teacher computer</source>
-        <translation>Učiteljev računalnik</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Pošlji besedilno sporočilo</translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Drug/nedoločen računalnik</translation>
+        <source>Text message</source>
+        <translation type="unfinished">Besedilno sporočilo</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation>Učilnica</translation>
+        <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>MAC-address</source>
-        <translation>MAC-naslov</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">Vključi računalnike</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 ':' for specifying an optional port-number)</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;">vnesite IP-naslov ali ime gostitelja pod katerim bo iTALC lahko dosegel odjemalca (uporabite ':' za določanje vrat - opcijsko)</p></body></html></translation>
+        <source>Power on</source>
+        <translation type="unfinished">Vključi</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>IP/ime gostitelja</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></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;">Strojni/MAC-naslov gostitelja - uporabljeno le pri zagonu odjemalca</p></body></html></translation>
+        <source>Power down computers</source>
+        <translation type="unfinished">Izključi računalnike</translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Ime</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Izključi</translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN (Navidezno zasebno omrežje)</translation>
+        <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>Connection</source>
-        <translation>Povezava</translation>
+        <source>Support</source>
+        <translation type="unfinished">Podpora</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;">connection to hosts on the same level</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;">povezava do gostiteljev iste ravni</p></body></html></translation>
+        <source>Direct support</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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Tukaj lahko navedete, kako bo ta gostitelj povezan z omrežjem iTALC, t.j. z gostitelji iste ravni. Običajno so odjemalci povezani preko 100Mbit/s LAN, toda obstajajo lahko posebni gostitelji, kot so prehodi do ostalih iTALC mrež v drugih šolah ali učenčev domači računalnik. V takih primerih iTALC poskuša optimizirati pasovno širino.</p></body></html></translation>
+        <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>Analog</source>
-        <translation>Analogna povezava (modem)</translation>
+        <source>Adjust/align</source>
+        <translation type="unfinished">Prilagodi/poravnaj</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Adjust windows and their size</source>
+        <translation type="unfinished">Poravnaji okna in prilagodi njihovo velikost</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <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>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <source>Auto view</source>
+        <translation type="unfinished">Samodejni pogled</translation>
     </message>
     <message>
-        <source>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished">Preuredi okna in njihovo velikost</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 if the host is the gateway for the subnet.</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;">Preveri, če je gostitelj prehod za podomrežje.</p></body></html></translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host is &gateway for subnet</source>
-        <translation>Gostitelj je &prehod za podomrežje</translation>
+        <source>Remote control</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;">Activate this option for at least one host in a subnet.</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;">Aktivirajte to možnost za najmanj enega gostitelja v podomrežju.</p></body></html></translation>
+        <source>Could not modify the autostart property for the iTALC Service.</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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;">Pri prikazovanju demo v več kot enem gosstitelju v tujem omrežju je pomembno aktivirati to možnost za vsaj enega vključenega gostitelja. Tako se demo prikazovalniku vsi podatki pošljejo le enkrat za vse ostale odjemalce v omrežju. Posebno v počasnih povezavah je ta možnost pomembna. Običajno bi morali omogočiti to možnost na prehodu v podomrežje (glejte gornjo možnost)</p></body></html></translation>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Igraj vlogo &demo prikazovalnika</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&V redu</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>P&rekliči</translation>
+        <source>Enable desktop switching for screen lock (experimental)</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></source>
+        <source>Log to standard error output</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Manjka IP-naslov/ime gostitelja</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Niste navedli IP-naslova ali imena gostitelja za računalnik!</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Neveljaven MAC-naslov</translation>
+        <source>VNC reflector</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>Navedli ste neveljaven MAC-naslov. Ali pustite polje prazno ali vnesite veljaven MAC-naslov (uporabite ":" kot ločilo!).</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Zaženi ukaze na odjemalcu(ih)</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Vnesite ukaze, ki naj bodo zagnani na odjemalci(ih):</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Prekliči</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Zaženi!</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>ÄŒasovni interval med posodobitvami</translation>
+        <source>Key file authentication</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 network-traffic and lower CPU-usage on this computer.</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;">Tukaj lahko vnesete časovni interval med posodobitvami odjemalcev. Večje vrednosti manj obremenjujejo omrežje in procesor tega računalnika.</p></body></html></translation>
+        <source>ACL-based logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 sekunda</translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation>(sp)sekund</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Kakovost demo načina</translation>
+        <source>Launch key file assistant</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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-indent:0px;">Tukaj lahko nastavite željeno kakovost prikaza demo načina. Nižja vrednost manj obremenjuje procesor in omrežje, višja vrednost lahko upočasni vaš računalnik in htros prikaza dema. Preizkušati boste morali za optimalne nastavitve.</p></body></html></translation>
+        <source>Manage permissions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Nizka (15 bit)</translation>
+        <source>Test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Srednja (18 bit)</translation>
+        <source>Access confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Visoka (Truecolor)</translation>
+        <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>User interface</source>
-        <translation>Uporabniški vmesnik</translation>
+        <source>Logon authentication</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></html></translation>
+        <source>Allow same user to access desktop without confirmation</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 mouse-cursor over 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;">Označite to možnost, če vas namigi, ki se prikazujejo, ko z miško pokažete na gumb, motijo..</p></body></html></translation>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Brez namigov</translation>
+        <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>Your role (needs according keys!)</source>
-        <translation>Vaša vloga (zahteva ustrezne ključe!)</translation>
+        <source>1)</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><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>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Učitelj</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Administrator</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Pomočnik</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Drugo</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Nastavitve za prijavo na več računalnikov</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Domena</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Dvjno kliknite dejanje za okno odjemalca</translation>
+        <source>Generate bug report archive</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><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>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Oddaljen nadzor</translation>
+        <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>View live in fullscreen</source>
-        <translation>Pogled v živo celozaslonsko</translation>
+        <source>Restart iTALC Service</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Nekatere spremembe ne bodo stopile v veljavo, dokler ponovno ne zaženete iTALC.</span></p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>Starting iTALC service</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
+        <source>Stopping iTALC service</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Vaše iTALC nastavitve</translation>
+        <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>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>Tukaj lahko prilagodite iTALC vašim potrebam.</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Demo</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
-        <translation>ISD - napaka strežnika</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>ISD - strežnika ni mogoče zagnati, ker so vrata %1 v uporabi. Prosim poskrbite, da ta vrata ne bodo uporabljena, in poskusite znova.</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Potrdi dostop</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Nekdo na gostitelju %1 poskuša dostopati do vašega namizja. Ali mu/ji želite j dovoliti dostop?</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Nikoli za to sejo</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Zmeraj za to sejo</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>Sporočilo predavatelja</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Napaka verodostojnosti</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Nekdo iz (IP: %1) poskuša dostopati do tega računalnika, vendar ne more potrditi svoje verodostojnosti!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Posnetek</translation>
+        <source>Could not contact iTALC service</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>Ne morem vzeti posnetka ker mapa %1 ne obstaja in ne more biti ustvarjena.</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>zaklenjeno namizje</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>V redu</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Sporočilo predavatelja</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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">(new line)
+        <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>Tukaj vidite delovno vrstico, ki vsebuje več gumbov. Vsak gumb pripada delovnemu prostoru. Preglejte delovne prostore s kliki na ustrezne gumbe.</translation>
+        <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>Posnetek delovnega prostora je zelo uporabno orodje. Tukaj lahko upravljate s posnetki, ki ste jih naredili.</translation>
+        <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>Seveda lahko nastavite iTALC. To navadno naredite z uporabo nastavitvenega delovnega prostora.</translation>
+        <translation type="unfinished">Seveda lahko nastavite iTALC. To navadno naredite z uporabo nastavitvenega delovnega prostora.</translation>
     </message>
     <message>
         <source>About iTALC</source>
-        <translation>O  iTALC</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>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Pregled</translation>
+        <translation type="unfinished">Pregled</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>Osnovne informacije o iTALC in uporabi.</translation>
+        <translation type="unfinished">Osnovne informacije o iTALC in uporabi.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation type="unfinished">Uporabniško ime</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation type="unfinished">Geslo</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Novo izdelani ali uvoženi ključ(i) mora(jo) biti nekam nameščen(i). Priporočeno je pustiti predlagane mape.</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>iTALC odjemalec %1 na %2:%3</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Mapa za shranjevanje javnega ključa</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Ne morem registrirati storitve '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation>Mapa za shranjevanje privatnega ključa</translation>
+        <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>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Storitev '%1' je že registrirana.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Izvozi privatni ključ v</translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Storitev '%1' ne more biti registrirana.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Storitev '%1' je bila uspešno registrirana.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Storitve '%1' ni možno ustaviti.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Storitev '%1' je bila neregistrirana.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Uvozi javni ključ iz glavnega računalnika</translation>
+        <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>Choose location of exported public key:</source>
-        <translation>Izberi lokacijo izvoženega javnega ključa:</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Storitev '%1' ne more biti neregistrirana.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Obdrži vse ključe (samo pri nadgradnji obstoječe namestitve!)</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Storitve '%1' ni mogoče najti.</translation>
     </message>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
+        <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>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Pogled v živo (%1 na gostitelju %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Oddaljen nadzor (%1 na gostitelju %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation>neznan uporabnik</translation>
+        <translation type="unfinished">neznan uporabnik</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation>Samo pogled</translation>
+        <translation type="unfinished">Samo pogled</translation>
     </message>
     <message>
         <source>Remote control</source>
-        <translation>Oddaljen nadzor</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Lock student</source>
-        <translation>Zakleni učenca</translation>
+        <translation type="unfinished">Zakleni učenca</translation>
     </message>
     <message>
         <source>Unlock student</source>
-        <translation>Odkleni učenca</translation>
+        <translation type="unfinished">Odkleni učenca</translation>
     </message>
     <message>
         <source>Snapshot</source>
-        <translation>Posnetek</translation>
+        <translation type="unfinished">Posnetek</translation>
     </message>
     <message>
         <source>Fullscreen</source>
-        <translation>Celozaslonsko</translation>
+        <translation type="unfinished">Celozaslonsko</translation>
     </message>
     <message>
         <source>Window</source>
-        <translation>Okno</translation>
+        <translation type="unfinished">Okno</translation>
     </message>
     <message>
         <source>Quit</source>
-        <translation>Zapusti</translation>
+        <translation type="unfinished">Zapusti</translation>
     </message>
     <message>
         <source>Connecting %1</source>
-        <translation>Povezujem %1</translation>
+        <translation type="unfinished">Povezujem %1</translation>
     </message>
     <message>
         <source>Connected.</source>
-        <translation>Povezan.</translation>
+        <translation type="unfinished">Povezan.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
+    <name>RemoteLogonDialog</name>
     <message>
-        <source>Remote Logon</source>
-        <translation>Oddaljena prijava</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</span></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-indent:0px;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Oddaljena prijava</span></p></body></html></translation>
+        <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>Uporabite spodnja polja za vnos uporabniškega imena, gesla in (opcijsko) imena domene. Ti podatki bodo uporabljeni za prijavo na računalnik(e).</translation>
+        <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>Uporabniško ime</translation>
+        <translation type="unfinished">Uporabniško ime</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>Geslo</translation>
+        <translation type="unfinished">Geslo</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation>Domena</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&V redu</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Prekliči</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <translation type="unfinished">Domena</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Potrdi prepisovanje</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Ali želite prepisati %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Prekliči namestitev</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Naprej</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Končano</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Izhod</translation>
-    </message>
-    <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Izberite mapo za javni ključ</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Izberite mapo za privatni ključ</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Izberite mapo za izvoz javnega ključa</translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">Posnetek</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>Posnetki</translation>
+        <translation type="unfinished">Posnetki</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Enostavno upravljajte s posnetki, ki ste jih naredili, z uporabo tega prostora.</translation>
+        <translation type="unfinished">Enostavno upravljajte s posnetki, ki ste jih naredili, z uporabo tega prostora.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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">(new line)
+        <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>Uporabnik:</translation>
+        <translation type="unfinished">Uporabnik:</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation>Gostitelj:</translation>
+        <translation type="unfinished">Gostitelj:</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation>Datum:</translation>
+        <translation type="unfinished">Datum:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>Ura:</translation>
-    </message>
-    <message>
-        <source>Show snapshot</source>
-        <translation>Prikaži posnetek</translation>
+        <translation type="unfinished">Ura:</translation>
     </message>
     <message>
-        <source>Delete snapshot</source>
-        <translation>Izbriši posnetek</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Ponovno naloži seznam</translation>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation>Podpora</translation>
+        <translation type="unfinished">Podpora</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Prosim, vpišite IP- naslov ali ime gostitelja, kjer sedi uporabnik, kateremu želite nuditi podporo.</translation>
+        <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>OK</source>
-        <translation>V redu</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Pošlji besedilno sporočilo</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Prekliči</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Vspostavljam povezavo na %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Pošlji besedilno sporočilo</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Pregled</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Pošlji besedilno sporočilo</span></p></body></html></translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Celozaslonski demo</translation>
     </message>
     <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Uporabite spodnje polje za vpis sporočila, ki ga želite poslati vsem izbranim uporabnikom.</translation>
+        <source>Window demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&V redu</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">Zaklenjen zaslon</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>View live</source>
+        <translation type="unfinished">Pogled v živo</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Prekliči</translation>
+        <source>Remote control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">Dovoli učencu vpogled v demo</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Vspostavljam povezavo na %1 ...</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Pošlji besedilno sporočilo</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
+        <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>Cancel</source>
-        <translation>Prekliči</translation>
+        <source>Reboot</source>
+        <translation type="unfinished">Ponovno zaženi</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Nazaj</translation>
+        <source>Power down</source>
+        <translation type="unfinished">Izključi</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Naprej</translation>
+        <source>Execute commands</source>
+        <translation type="unfinished">Izvedi ukaze</translation>
     </message>
 </context>
 </TS>
diff --git a/lib/resources/sr_SR.qm b/lib/resources/sr_SR.qm
deleted file mode 100644
index fcc6509..0000000
Binary files a/lib/resources/sr_SR.qm and /dev/null differ
diff --git a/lib/resources/sr_SR.ts b/lib/resources/sr_SR.ts
deleted file mode 100644
index 98f5c40..0000000
--- a/lib/resources/sr_SR.ts
+++ /dev/null
@@ -1,1431 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="sr_SR">
-<context>
-    <name>MainToolBar</name>
-    <message>
-        <source>Actions</source>
-        <translation>Акције</translation>
-    </message>
-</context>
-<context>
-    <name>MainWindow</name>
-    <message>
-        <source>MainWindow</source>
-        <translation>Главни прозор</translation>
-    </message>
-    <message>
-        <source>toolBar</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>Logon</source>
-        <translation>Пријављивање</translation>
-    </message>
-    <message>
-        <source>Remote logon</source>
-        <translation>Даљинско пријављивање</translation>
-    </message>
-    <message>
-        <source>After clicking this button you can enter a username and password to log on the according user on all visible computers.</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>No valid keys found</source>
-        <translation>Нису пронађени важећи кључеви</translation>
-    </message>
-    <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation>Нису пронађени кључеви за проверу или су ваши стари неисправни. Направите помоћу ICA нови пар кључева (погледајте документацију http://italc.sf.net/wiki/index.php?title=Installation)
-У супротном, нећете моћи да приступите другим рачунарима користећи  iTALC.</translation>
-    </message>
-    <message>
-        <source>iTALC service not running</source>
-        <translation>iTALC сервис не ради</translation>
-    </message>
-    <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation>Изгледа да iTALC сервис не ради на овом рачунару или идентификацаиони тастери нису добро подешени. Потребно је помоћ за покретање iTALC-а. Обратите се руководиоцу за решавање овог проблема.</translation>
-    </message>
-    <message>
-        <source>iTALC Master Control</source>
-        <translation>iTALC-ово главно управљање</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Даљинско управљање</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Излаз</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' je одјављен.</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>QObject</name>
-    <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL (напомена за преводиоце: прва три знака овог низа су убрзивачи (подвучени знаци) три улазна поља за унос при пријављивању на windows – молимо да сачувате све овако јер у супротном се дешавају грешке при пријављивању)</translation>
-    </message>
-    <message>
-        <source>iTALC-snapshots</source>
-        <translation>iTALC-снимци </translation>
-    </message>
-</context>
-<context>
-    <name>about</name>
-    <message>
-        <source>About iTALC</source>
-        <translation>О iTALC-у</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">О iTALC-у </span></p></body></html></translation>
-    </message>
-    <message>
-        <source>About</source>
-        <translation>O програму</translation>
-    </message>
-    <message>
-        <source>Authors</source>
-        <translation>Аутори</translation>
-    </message>
-    <message>
-        <source>Translation</source>
-        <translation>Превод</translation>
-    </message>
-    <message>
-        <source>License</source>
-        <translation>Дозвола</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>У реду</translation>
-    </message>
-    <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
-        <translation> iTALC – Интелигентна настава и учење на рачунарима</translation>
-    </message>
-    <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
-        <translation>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Преводиоци: Иван и Саша.</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Уколико сте заинтересовани за превођење iTALC-а на матерњи језик или да поправите постојећи превод, контактирајте iTALC програмере!</span></p></body></html></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>IP-address</source>
-        <translation>IP-адреса</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>Show/hide</source>
-        <translation>Прикажи/Сакриј</translation>
-    </message>
-    <message>
-        <source>Edit settings</source>
-        <translation>Уреди поставке</translation>
-    </message>
-    <message>
-        <source>Remove</source>
-        <translation>Уклони</translation>
-    </message>
-    <message>
-        <source>Actions</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>Actions for %1</source>
-        <translation>Акција за %1</translation>
-    </message>
-    <message>
-        <source>Add classroom</source>
-        <translation>Додај учионицу</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>
-    <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>Add computer</source>
-        <translation>Додај рачунар</translation>
-    </message>
-    <message>
-        <source>Hide teacher computers</source>
-        <translation>Сакриј раунар наставника</translation>
-    </message>
-    <message>
-        <source>Export to text-file</source>
-        <translation>Извоз у текстуалну датотеку</translation>
-    </message>
-    <message>
-        <source>Select output-file</source>
-        <translation>Изабери излазну датотеку</translation>
-    </message>
-    <message>
-        <source>Text files (*.txt)</source>
-        <translation>Текстуалне датотеке (*.txt)</translation>
-    </message>
-    <message>
-        <source>Usernames</source>
-        <translation>Корисничка имена</translation>
-    </message>
-    <message>
-        <source>Show usernames</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>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Користите изборни оквир (десни клик миша), да додате/уклоните рачунаре и/или учионице.</translation>
-    </message>
-    <message>
-        <source>Actions for selected</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>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>Logon user</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>
-<context>
-    <name>clientSettings</name>
-    <message>
-        <source>Client settings</source>
-        <translation>Поставке корисника</translation>
-    </message>
-    <message>
-        <source>General</source>
-        <translation>Опште</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;">Hardware/MAC-address of client - only used for powering on client</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;">Hardware/MAC-адреса корисника – користи се само за укључивање корисника</p></body></html></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 ':' for specifying an optional port-number)</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;">Унесите IP-адресу или име домаћина под којим iTALC може повезати корисника(користи ':' за прецизирање могућег броја прикључка)</p></body></html></translation>
-    </message>
-    <message>
-        <source>MAC-address</source>
-        <translation>MAC-Адреса</translation>
-    </message>
-    <message>
-        <source>Classroom</source>
-        <translation>Учионица</translation>
-    </message>
-    <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
-    </message>
-    <message>
-        <source>Connection</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;">connection to hosts on the same level</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;">Here you can specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Овде можете да прецизирате како је овај домаћин повезан са iTALC-мрежом, нпр. домаћин на истом нивоу. Уобичајено корисници су повезани преко 100 Мб/с на ЛАН, али можда постоји посебан домаћин, као што су улази ка iTALC-у у другим мрежама у иностранстраним школама или рачунарима у студентским's домовима. У таквим случајевима iTALC покушава да оптимизује коришћење пропусног опсега.</p></body></html></translation>
-    </message>
-    <message>
-        <source>Analog</source>
-        <translation>Аналогно</translation>
-    </message>
-    <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
-    </message>
-    <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
-    </message>
-    <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
-    </message>
-    <message>
-        <source>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
-    </message>
-    <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</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 if the host is the gateway for the subnet.</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>Host is &gateway for subnet</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;">Activate this option for at least one host in a subnet.</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>Act as &demo replicator</source>
-        <translation>Ради као &пробни-пресликач</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&У реду</translation>
-    </message>
-    <message>
-        <source>C&ancel</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Поставке корисника</span></p></body></html></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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></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;">Могући надимак домаћина који је приказан у iTALC-у.</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
-    <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-aдреса</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>cmdInputDialog</name>
-    <message>
-        <source>Cancel</source>
-        <translation>Откажи</translation>
-    </message>
-    <message>
-        <source>Run commands on client(s)</source>
-        <translation>Изврши наредбе на кoриснику</translation>
-    </message>
-    <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Унеси наредбе које треба извршити на кoриснику:</translation>
-    </message>
-    <message>
-        <source>&Run!</source>
-        <translation>&Покрени!</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 network-traffic and lower CPU-usage on this computer.</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>1 second</source>
-        <translation>1 секунда</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>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;"><span style=" font-size:8pt; font-style:italic;">Please note, that some changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Имајте на уму да неке промене неће ступити на снагу док поново не покренете iTALC.</span></p></body></html></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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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>Low (15 bit)</source>
-        <translation>Ниско (15 bit)</translation>
-    </message>
-    <message>
-        <source>Medium (18 bit)</source>
-        <translation>Средње (18 bit)</translation>
-    </message>
-    <message>
-        <source>High (Truecolor)</source>
-        <translation>Високо (Truecolor)</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>Quality of demo-mode</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;">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> seconds</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 mouse-cursor over 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>
-</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>demoClient</name>
-    <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC проба </translation>
-    </message>
-</context>
-<context>
-    <name>isdServer</name>
-    <message>
-        <source>ISD-server error</source>
-        <translation>ISD-грешка послужитеља </translation>
-    </message>
-    <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>ISD-Послужитељ није могао бити покренут јер се прикључак %1 већ користи. Проверите да ли нека друга апликација користи овај прикључак па покушајте поново.</translation>
-    </message>
-    <message>
-        <source>Confirm access</source>
-        <translation>Потврди приступ</translation>
-    </message>
-    <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Неко са места %1 покушава да приступи вашем рачунару. Хоћете ли му дозволити приступ?</translation>
-    </message>
-    <message>
-        <source>Never for this session</source>
-        <translation>Никада за ову сесију</translation>
-    </message>
-    <message>
-        <source>Always for this session</source>
-        <translation>Увек за ову сесију</translation>
-    </message>
-    <message>
-        <source>Message from teacher</source>
-        <translation>Порука од наставника</translation>
-    </message>
-    <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>ivsConnection</name>
-    <message>
-        <source>unknown</source>
-        <translation>Непознат</translation>
-    </message>
-    <message>
-        <source>Snapshot</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>
-</context>
-<context>
-    <name>lockWidget</name>
-    <message>
-        <source>screen lock</source>
-        <translation>закључај екран</translation>
-    </message>
-</context>
-<context>
-    <name>messageBox</name>
-    <message>
-        <source>OK</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>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>O iTALC-у</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>
-</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>pageFinished</name>
-    <message>
-        <source>iTALC is now ready to run!</source>
-        <translation>iTALC је сада спреман за рад!</translation>
-    </message>
-    <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation>iTALC  је сада у потпуности инсталиран и подешен. Ако сте инсталирали главну апликацију, сада је можете покренути.</translation>
-    </message>
-    <message>
-        <source>Save key setup settings</source>
-        <translation>Сачувај поставке кључева</translation>
-    </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
-    <message>
-        <source>Key directories</source>
-        <translation>Фасцикла за кључеве</translation>
-    </message>
-    <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation> Новостворени или увезени кључеви треба да буду негде инсталирани. Препоручује се да напустите предложене фасцикле.</translation>
-    </message>
-    <message>
-        <source>Directory to store public key in</source>
-        <translation>Фасцикла за јавни кључ</translation>
-    </message>
-    <message>
-        <source>Directory to store private key in</source>
-        <translation>Фасцикла за лични кључ</translation>
-    </message>
-    <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation>Можете да изаберете фасциклу у коју да се извезе јавни кључ, нпр. УСБ уређај или дељена мрежа. </translation>
-    </message>
-    <message>
-        <source>Export private key too</source>
-        <translation>Извези такође и лични кључ</translation>
-    </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
-    <message>
-        <source>Security options</source>
-        <translation>Безбедоносне могућности</translation>
-    </message>
-    <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation>iTALC има префињену замисао безбедности за спречавање неовлашћеног приступа рачунарима који имају инсталиран кориснички програм iTALC. Зато морате да направите нови пар кључева или увезете јавни кључ створен током инсталације iTALC-а на главном рачунару.</translation>
-    </message>
-    <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation>Направи нови пар кључева (урадите ово само на главном рачунару)</translation>
-    </message>
-    <message>
-        <source>Import public key of master computer</source>
-        <translation>Увоз јавног кључа главног рачунара</translation>
-    </message>
-    <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Изаберите локацију извоза јавног кључа</translation>
-    </message>
-    <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Чувајте све кључеве (само када је ажурирање постојеће инсталације!)</translation>
-    </message>
-</context>
-<context>
-    <name>pageWelcome</name>
-    <message>
-        <source>Welcome to iTALC</source>
-        <translation>Добродошли у iTALC</translation>
-    </message>
-    <message>
-        <source>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation>Ова алатка ће вас водити кроз процес подешавања проверених тастера за iTALC окружење
- Клик 'Напред' да наставите </translation>
-    </message>
-</context>
-<context>
-    <name>remoteControlWidget</name>
-    <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Приказ уживо (%1 домаћин %2)</translation>
-    </message>
-    <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Даљинско управљање (%1 на домаћину %2)</translation>
-    </message>
-    <message>
-        <source>unknown user</source>
-        <translation>Непознати корисник</translation>
-    </message>
-</context>
-<context>
-    <name>remoteControlWidgetToolBar</name>
-    <message>
-        <source>Lock student</source>
-        <translation>Блокирани ученик</translation>
-    </message>
-    <message>
-        <source>Fullscreen</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>
-    <message>
-        <source>View only</source>
-        <translation>Само прикажи</translation>
-    </message>
-    <message>
-        <source>Snapshot</source>
-        <translation>Снимак</translation>
-    </message>
-    <message>
-        <source>Remote control</source>
-        <translation>Даљинско управљање</translation>
-    </message>
-    <message>
-        <source>Unlock student</source>
-        <translation>Одблокирај ученика</translation>
-    </message>
-    <message>
-        <source>Window</source>
-        <translation>Прозор</translation>
-    </message>
-</context>
-<context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Remote Logon</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Даљинско пријављивање</span></p></body></html></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>
-    <message>
-        <source>&OK</source>
-        <translation>&У реду</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Откажи</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
-    </message>
-</context>
-<context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Потврди замену</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Да ли желите да замените %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Поништи подешавања</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation>Јесте ли сигурни да желите да прекинете инсталацију? iTALC још није инсталиран у потпуности</translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Напред</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Крај</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Излаз</translation>
-    </message>
-    <message>
-        <source>File does not exist</source>
-        <translation>Датотека не постоји</translation>
-    </message>
-    <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
-        <translation>Датотека %1 није пронађена. Проверите ово и покушајте поново</translation>
-    </message>
-</context>
-<context>
-    <name>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Изабери фасциклу за јавни кључ</translation>
-    </message>
-    <message>
-        <source>Choose private key directory</source>
-        <translation>Изабери фасциклу за приватни кључ</translation>
-    </message>
-    <message>
-        <source>Choose public key export directory</source>
-        <translation>Изабери фасциклу за извоз јавног кључа</translation>
-    </message>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
-    <message>
-        <source>Choose directory for key import</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 snapshot</source>
-        <translation>Прикажи снимке</translation>
-    </message>
-    <message>
-        <source>Delete snapshot</source>
-        <translation>Избриши снимке</translation>
-    </message>
-    <message>
-        <source>Reload list</source>
-        <translation>Поново учитај списак</translation>
-    </message>
-</context>
-<context>
-    <name>support</name>
-    <message>
-        <source>Support</source>
-        <translation>Подршка</translation>
-    </message>
-    <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Унесете IP адресу или име домаћина на коме особа седи, а коме  желите да дате подршку.</translation>
-    </message>
-    <message>
-        <source>OK</source>
-        <translation>У реду</translation>
-    </message>
-    <message>
-        <source>Cancel</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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Подршка</span></p></body></html></translation>
-    </message>
-</context>
-<context>
-    <name>textMessage</name>
-    <message>
-        <source>Send text message</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Пошаљи поруку</span></p></body></html></translation>
-    </message>
-    <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Користите поље испод да откуцате поруку која ће бити послата свим изабраним корисницима.</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>&У реду</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter </translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Откажи</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
-    </message>
-</context>
-<context>
-    <name>vncView</name>
-    <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Успостављање везе са %1...</translation>
-    </message>
-</context>
-<context>
-    <name>wizard</name>
-    <message>
-        <source>iTALC setup tool</source>
-        <translation>iTALC алатка за подешавање</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Откажи</translation>
-    </message>
-    <message>
-        <source>Back</source>
-        <translation>Назад</translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Напред</translation>
-    </message>
-</context>
-</TS>
diff --git a/lib/resources/sv.qm b/lib/resources/sv.qm
index fe63078..21d2219 100644
Binary files a/lib/resources/sv.qm and b/lib/resources/sv.qm differ
diff --git a/lib/resources/sv.ts b/lib/resources/sv.ts
index 5ab3678..0418902 100644
--- a/lib/resources/sv.ts
+++ b/lib/resources/sv.ts
@@ -1,1406 +1,1772 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.0" language="sv_SE" sourcelanguage="en_US">
+<TS version="2.0" language="sv">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
     <message>
-        <source>Actions</source>
-        <translation type="unfinished"></translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">Om iTALC</translation>
     </message>
-</context>
-<context>
-    <name>MainWindow</name>
     <message>
-        <source>MainWindow</source>
+        <source>About</source>
+        <translation type="unfinished">Om</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel / iTALC Solutions</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>toolBar</source>
+        <source><a href="http://italc.sourceforge.net">http://italc.sourceforge.net</a></source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC</source>
-        <translation type="unfinished"></translation>
+        <source>Authors</source>
+        <translation type="unfinished">Upphovsmän</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished"></translation>
+        <source>Translation</source>
+        <translation type="unfinished">Översättning</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>
+        <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>Classroom</source>
+        <source>License</source>
+        <translation type="unfinished">Licens</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>AccessDialogSlave</name>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished"></translation>
+        <source>Never for this session</source>
+        <translation>Aldrig för denna session</translation>
     </message>
     <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished"></translation>
+        <source>Always for this session</source>
+        <translation>Alltid för denna session</translation>
     </message>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
+        <source>Confirm desktop access</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview mode</source>
+        <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>Overview</source>
-        <translation type="unfinished"></translation>
+        <source>Classroom-Manager</source>
+        <translation>Klassrumshanterare</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>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
+        <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>Fullscreen Demo</source>
-        <translation type="unfinished"></translation>
+        <source>Classrooms/computers</source>
+        <translation>Klassrum/datorer</translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished"></translation>
+        <source>IP-address</source>
+        <translation>IP-adress</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>
+        <source>Usernames</source>
+        <translation>Användarnamn</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished"></translation>
+        <source>Show usernames</source>
+        <translation>Visa användarnamn</translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished"></translation>
+        <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>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>
+        <source>Export to text-file</source>
+        <translation>Exportera till textfil</translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished"></translation>
+        <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>Lock all</source>
-        <translation type="unfinished"></translation>
+        <source>Hide teacher computers</source>
+        <translation>Dölj lärardatorer</translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished"></translation>
+        <source>Show/hide</source>
+        <translation>Visa/dölj</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>
+        <source>Edit settings</source>
+        <translation>Redigera inställningar</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
+        <source>Remove</source>
+        <translation>Ta bort</translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished"></translation>
+        <source>Show all computers in classroom</source>
+        <translation>Visa alla datorer i klassrummet</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>
+        <source>Hide all computers in classroom</source>
+        <translation>Dölj alla datorer i klassrummet</translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished"></translation>
+        <source>Edit name</source>
+        <translation>Redigera namn</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished"></translation>
+        <source>Remove classroom</source>
+        <translation>Ta bort klassrum</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>
+        <source>Add computer</source>
+        <translation>Lägg till dator</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished"></translation>
+        <source>Add classroom</source>
+        <translation>Lägg till klassrum</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished"></translation>
+        <source>No configuration-file found</source>
+        <translation>Ingen konfigurationsfil hittades</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>
+        <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>Logon</source>
-        <translation type="unfinished"></translation>
+        <source>Error in configuration-file</source>
+        <translation>Fel i konfigurationsfilen</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished"></translation>
+        <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>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished"></translation>
+        <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>Support</source>
-        <translation type="unfinished"></translation>
+        <source>Select output-file</source>
+        <translation>Välj utdatafil</translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished"></translation>
+        <source>Text files (*.txt)</source>
+        <translation>Textfiler (*.txt)</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>
+        <source>Actions for selected</source>
+        <translation>Åtgärder för markerade</translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished"></translation>
+        <source>Actions</source>
+        <translation>Åtgärder</translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished"></translation>
+        <source>Actions for %1</source>
+        <translation>Åtgärder för %1</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>
+        <source>New name for classroom</source>
+        <translation>Nytt namn för klassrum</translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished"></translation>
+        <source>Please enter a new name for classroom "%1".</source>
+        <translation>Ange ett nytt namn för klassrummet "%1".</translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished"></translation>
+        <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>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished"></translation>
+        <source>Missing classroom</source>
+        <translation>Saknar klassrum</translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished"></translation>
+        <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>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished"></translation>
+        <source>New classroom</source>
+        <translation>Nytt klassrum</translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
+        <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 ':' for specifying an optional port-number)</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;">ange en IP-adress eller värdnamn med vilket iTALC kan nå klienten (använd ":" för att ange ett valfritt portnummer)</p></body></html></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></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;">Valfritt smeknamn på värddatorn som kommer att visas i iTALC.</p></body></html></translation>
+    </message>
+    <message>
+        <source>MAC address</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
+        <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></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;">Maskinvaru-/MAC-adress för klienten - används endast för att starta klienten</p></body></html></translation>
+    </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>iTALC Master Control</source>
+        <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 network-traffic and lower CPU-usage on this computer.</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;">Här kan du ställa in intervallet mellan uppdateringar av klienter. Högre värden resulterar i lägre nätverkstrafik och lägre processorbelastning på denna dator.</p></body></html></translation>
+    </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></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 mouse-cursor over 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;">Använd detta alternativ om du blir besvärad av ballongtips som visas när muspekaren rör sig över verktygsradsknapparna.</p></body></html></translation>
+    </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 type="unfinished"></translation>
+        <translation>Fjärrstyrning</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished"></translation>
+        <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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Observera att vissa ändringar inte blir aktiva förrän du startar om iTALC.</span></p></body></html></translation>
     </message>
 </context>
 <context>
-    <name>QApplication</name>
+    <name>ConfigWidget</name>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation type="unfinished"></translation>
+        <source>Your iTALC-configuration</source>
+        <translation>Din iTALC-konfiguration</translation>
     </message>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation type="unfinished"></translation>
+        <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>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>
+        <source>OK</source>
+        <translation>OK</translation>
     </message>
+</context>
+<context>
+    <name>DemoClient</name>
     <message>
-        <source>The service '%1' is already registered.</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC Demo</source>
+        <translation>iTALC-demo</translation>
     </message>
+</context>
+<context>
+    <name>ItalcCoreServer</name>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation type="unfinished"></translation>
+        <source>Authentication error</source>
+        <translation>Autentiseringsfel</translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation type="unfinished"></translation>
+        <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>The service '%1' could not be stopped.</source>
-        <translation type="unfinished"></translation>
+        <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>The service '%1' has been unregistered.</source>
-        <translation type="unfinished"></translation>
+        <source>VNC authentication failed.</source>
+        <translation>VNC-autentisering misslyckades.</translation>
     </message>
     <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
+        <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>The service '%1' could not be unregistered.</source>
+        <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>The service '%1' could not be found.</source>
-        <translation type="unfinished"></translation>
+        <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>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>
+        <source>iTALC Service</source>
+        <translation>iTALC-tjänst</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>
+        <source>Hide tray icon</source>
+        <translation>Dölj aktivitetsikonen</translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>nLo (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</translation>
+        <source>Autostart</source>
+        <translation>Automatisk start</translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation type="unfinished"></translation>
+        <source>Additional arguments</source>
+        <translation>Ytterligare argument</translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation type="unfinished"></translation>
+        <source>Start service</source>
+        <translation>Starta tjänst</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Stop service</source>
+        <translation>Stoppa tjänst</translation>
     </message>
     <message>
-        <source>About</source>
-        <translation type="unfinished"></translation>
+        <source>State:</source>
+        <translation>Tillstånd:</translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
-        <translation type="unfinished"></translation>
+        <source>Stopped</source>
+        <translation>Stoppad</translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation type="unfinished"></translation>
+        <source>Logging</source>
+        <translation>Loggning</translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation type="unfinished"></translation>
+        <source>Log file directory</source>
+        <translation>Loggfilskatalog</translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>...</source>
+        <translation>...</translation>
     </message>
     <message>
-        <source>License</source>
-        <translation type="unfinished"></translation>
+        <source>Log level</source>
+        <translation>Loggnivå</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
+        <source>Nothing</source>
+        <translation>Ingenting</translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation type="unfinished"></translation>
+        <source>Only critical messages</source>
+        <translation>Endast kritiska meddelanden</translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation type="unfinished"></translation>
+        <source>Errors and critical messages</source>
+        <translation>Fel och kritiska meddelanden</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>
+        <source>Warnings and errors</source>
+        <translation>Varningar och fel</translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation type="unfinished"></translation>
+        <source>Information, warnings and errors</source>
+        <translation>Information, varningar och fel</translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation type="unfinished"></translation>
+        <source>Debug messages and everything else</source>
+        <translation>Felsökningsmeddelanden och allting annat</translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation type="unfinished"></translation>
+        <source>Limit log file size</source>
+        <translation>Begränsa storlek på loggfil</translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation type="unfinished"></translation>
+        <source>MB</source>
+        <translation>MB</translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation type="unfinished"></translation>
+        <source>Clear all log files</source>
+        <translation>Töm alla loggfiler</translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished"></translation>
+        <source>Desktop capturing</source>
+        <translation>Skrivbordsfångst</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>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation>Aktivera fångst av flerskiktade fönster (semi-transparant)</translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation type="unfinished"></translation>
+        <source>Poll full screen</source>
+        <translation>Ta helskärm</translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation type="unfinished"></translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation>Låg precision (turboläge)</translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation type="unfinished"></translation>
+        <source>Demo server</source>
+        <translation>Demoserver</translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation type="unfinished"></translation>
+        <source>Network</source>
+        <translation>Nätverk</translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation type="unfinished"></translation>
+        <source>Core server port</source>
+        <translation>Serverport för core</translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation type="unfinished"></translation>
+        <source>Demo server port</source>
+        <translation>Serverport för demo</translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation type="unfinished"></translation>
+        <source>Enable firewall exception</source>
+        <translation>Aktivera brandväggsundantag</translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation type="unfinished"></translation>
+        <source>Configuration files</source>
+        <translation>Konfigurationsfiler</translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation type="unfinished"></translation>
+        <source>Global configuration</source>
+        <translation>Allmän konfiguration</translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation type="unfinished"></translation>
+        <source>Personal configuration</source>
+        <translation>Personlig konfiguration</translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation type="unfinished"></translation>
+        <source>Data directories</source>
+        <translation>Datakataloger</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>
+        <source>Snapshots</source>
+        <translation>Skärmbilder</translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation type="unfinished"></translation>
+        <source>Authentication methods</source>
+        <translation>Autentiseringsmetoder</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>
+        <source>Access key management</source>
+        <translation>Hantering av åtkomstnycklar</translation>
     </message>
     <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation type="unfinished"></translation>
+        <source>Logon settings</source>
+        <translation>Inloggningsinställningar</translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation type="unfinished"></translation>
+        <source>&File</source>
+        <translation>&Arkiv</translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished"></translation>
+        <source>&Help</source>
+        <translation>&Hjälp</translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation type="unfinished"></translation>
+        <source>&Quit</source>
+        <translation>A&vsluta</translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation type="unfinished"></translation>
+        <source>Ctrl+Q</source>
+        <translation>Ctrl+Q</translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation type="unfinished"></translation>
+        <source>&Save settings into file</source>
+        <translation>&Spara inställningar till fil</translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation type="unfinished"></translation>
+        <source>Save settings into file</source>
+        <translation>Spara inställningar till fil</translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation type="unfinished"></translation>
+        <source>Ctrl+S</source>
+        <translation>Ctrl+S</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>
+        <source>L&oad settings from file</source>
+        <translation>&Läs in inställningar från fil</translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation type="unfinished"></translation>
+        <source>Ctrl+O</source>
+        <translation>Ctrl+O</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>
+        <source>About iTALC</source>
+        <translation>Om iTALC</translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation type="unfinished"></translation>
+        <source>About Qt</source>
+        <translation>Om Qt</translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation type="unfinished"></translation>
+        <source>MainWindow</source>
+        <translation>Huvudfönster</translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation type="unfinished"></translation>
+        <source>toolBar</source>
+        <translation>verktygsrad</translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC Management Console %1</source>
+        <translation>Hanteringskonsoll för iTALC %1</translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation type="unfinished"></translation>
+        <source>Running</source>
+        <translation>Kör</translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation type="unfinished"></translation>
+        <source>Load settings from file</source>
+        <translation>Läs in inställningar från fil</translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation type="unfinished"></translation>
+        <source>XML files (*.xml)</source>
+        <translation>XML-filer (*.xml)</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>
+        <source>Save settings to file</source>
+        <translation>Spara inställningar till fil</translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation type="unfinished"></translation>
+        <source>Unsaved settings</source>
+        <translation>Osparade inställningar</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished"></translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation>Det finns osparade inställningar. Avsluta ändå?</translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished"></translation>
+        <source>Configuration not writable</source>
+        <translation>Konfigurationen är inte skrivbar</translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation type="unfinished"></translation>
+        <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>Reboot computers</source>
-        <translation type="unfinished"></translation>
+        <source>All settings were applied successfully.</source>
+        <translation>Alla inställningar verkställdes.</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished"></translation>
+        <source>An error occured while applying settings!</source>
+        <translation>Ett fel inträffade vid verkställandet av inställningar!</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC</source>
+        <translation>iTALC</translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished"></translation>
+        <source>No write access</source>
+        <translation>Ingen skrivåtkomst</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished"></translation>
+        <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>Window demo</source>
-        <translation type="unfinished"></translation>
+        <source>Classroom</source>
+        <translation>Klassrum</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation type="unfinished"></translation>
+        <source>Switch classroom</source>
+        <translation>Växla klassrum</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation type="unfinished"></translation>
+        <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>Remote control</source>
-        <translation type="unfinished"></translation>
+        <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>Let student show demo</source>
-        <translation type="unfinished"></translation>
+        <source>Overview mode</source>
+        <translation>Översiktsläge</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
+        <source>Overview</source>
+        <translation>Översikt</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation type="unfinished"></translation>
+        <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>Logout user</source>
-        <translation type="unfinished"></translation>
+        <source>Fullscreen demo</source>
+        <translation>Helskärmsdemo</translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation type="unfinished"></translation>
+        <source>Fullscreen Demo</source>
+        <translation>Helskärmsdemo</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished"></translation>
+        <source>Stop Demo</source>
+        <translation>Stoppa demo</translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation type="unfinished"></translation>
+        <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>Power down</source>
-        <translation type="unfinished"></translation>
+        <source>Window demo</source>
+        <translation>Fönsterdemo</translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation type="unfinished"></translation>
+        <source>Window Demo</source>
+        <translation>Fönsterdemo</translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation type="unfinished"></translation>
+        <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><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:20pt; font-weight:600; font-style:italic;">Client settings</span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Lock/unlock desktops</source>
+        <translation>Lås/lås upp skrivbord</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation type="unfinished"></translation>
+        <source>Lock all</source>
+        <translation>LÃ¥s alla</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation type="unfinished"></translation>
+        <source>Unlock all</source>
+        <translation>LÃ¥s upp alla</translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation type="unfinished"></translation>
+        <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>Teacher computer</source>
-        <translation type="unfinished"></translation>
+        <source>Send text message</source>
+        <translation>Skicka textmeddelande</translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation type="unfinished"></translation>
+        <source>Text message</source>
+        <translation>Textmeddelande</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation type="unfinished"></translation>
+        <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>MAC-address</source>
-        <translation type="unfinished"></translation>
+        <source>Power on computers</source>
+        <translation>Starta datorer</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 ':' for specifying an optional port-number)</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Power on</source>
+        <translation>Starta</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation type="unfinished"></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></html></source>
-        <translation type="unfinished"></translation>
+        <source>Power down computers</source>
+        <translation>Stäng av datorer</translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation type="unfinished"></translation>
+        <source>Power down</source>
+        <translation>Stäng av</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></source>
-        <translation type="unfinished"></translation>
+        <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>VPN</source>
-        <translation type="unfinished"></translation>
+        <source>Support</source>
+        <translation>Support</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation type="unfinished"></translation>
+        <source>Direct support</source>
+        <translation>Direktsupport</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;">connection to hosts on the same level</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Adjust/align</source>
+        <translation>Justera/rada upp</translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation type="unfinished"></translation>
+        <source>Adjust windows and their size</source>
+        <translation>Justera fönster och deras storlek</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation type="unfinished"></translation>
+        <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>DSL / 400 KBit/s</source>
-        <translation type="unfinished"></translation>
+        <source>Auto view</source>
+        <translation>Automatisk vy</translation>
     </message>
     <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation type="unfinished"></translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation>Arrangera automatiskt om fönster och deras storlek</translation>
     </message>
     <message>
-        <source>100 MBit/s LAN</source>
-        <translation type="unfinished"></translation>
+        <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>1000 MBit/s LAN</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC Master Control</source>
+        <translation>Huvudstyrning - iTALC</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 if the host is the gateway for the subnet.</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Remote control</source>
+        <translation>Fjärrstyrning</translation>
     </message>
     <message>
-        <source>Host is &gateway for subnet</source>
-        <translation type="unfinished"></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Activate this option for at least one host in a subnet.</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <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>Act as &demo replicator</source>
+        <source>Debugging</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
+        <source>Enable desktop switching for screen lock (experimental)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>C&ancel</source>
+        <source>Log to standard error output</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
+        <source>Log to Windows event log</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
+        <source>Backend</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
+        <source>VNC reflector</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>
+        <source>iTALC 1 demo server</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
+        <source>HTTP server port</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
+        <source>Allow connections from localhost only</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
+        <source>Key file authentication</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 network-traffic and lower CPU-usage on this computer.</p></body></html></source>
+        <source>ACL-based logon authentication</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
+        <source>Public key file base directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
+        <source>Private key file base directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
+        <source>Launch key file assistant</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</p></body></html></source>
+        <source>Manage permissions</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
+        <source>Test</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
+        <source>Access confirmation</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
+        <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>User interface</source>
+        <source>Logon authentication</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>
+        <source>Allow same user to access desktop without confirmation</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 mouse-cursor over toolbar-buttons.</p></body></html></source>
+        <source>Debugging iTALC</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>1)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
+        <source>Clear the logfiles in the "General" section.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Your role (needs according keys!)</source>
+        <source>2)</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>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
+        <source>3)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
+        <source>4)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
+        <source>Click the following button and save the file to a known location.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
+        <source>Generate bug report archive</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
+        <source>5)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
+        <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><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>
+        <source>Restart iTALC Service</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
+        <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>View live in fullscreen</source>
+        <source>Starting iTALC service</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 changes won't take effect until you restart iTALC.</span></p></body></html></source>
+        <source>Stopping iTALC service</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
+        <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>In this workspace you can customize iTALC to fit your needs.</source>
+        <source>Log files cleared</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
+        <source>All log files were cleared successfully.</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
+        <source>Error</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
+        <source>Could not remove all log files.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
+        <source>Logon authentication test</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
+        <source>Authentication with provided credentials was successful.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
+        <source>Authentication with provided credentials failed!</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
+        <source>Save bug report archive</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
+        <source>iTALC bug report archive saved</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>unknown</source>
+        <source>Could not contact iTALC service</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Snapshot</source>
+        <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>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
+        <source>Message from teacher</source>
+        <translation>Meddelande från lärare</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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>
+        <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 type="unfinished"></translation>
+        <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 type="unfinished"></translation>
+        <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 type="unfinished"></translation>
+        <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 type="unfinished"></translation>
+        <translation>Du kan så klart även konfigurera iTALC. Detta sker oftast i arbetsytan för konfiguration.</translation>
     </message>
     <message>
         <source>About iTALC</source>
-        <translation type="unfinished"></translation>
+        <translation>Om iTALC</translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation type="unfinished"></translation>
+        <translation>Översikt</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation type="unfinished"></translation>
+        <translation>Grundläggande information om iTALC och hur man använder det.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
-        <translation type="unfinished"></translation>
+        <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>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation>Användarnamn</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation>Lösenord</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation type="unfinished"></translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>Klient iTALC %1 na %2:%3</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation type="unfinished"></translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Nemôžem zaregistrovať službu '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation type="unfinished"></translation>
+        <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>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Služba '%1' je už registrovaná.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Nemôžem zaregistrovať službu '%1'.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Služba '%1' bola úspešne registrovaná.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Službu '%1' nie je možné zastaviť.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Služba '%1' bola odregistrovaná.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation type="unfinished"></translation>
+        <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>Choose location of exported public key:</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Službu '%1' nebolo možné odregistrovať.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Služba '%1' sa nedá nájsť.</translation>
     </message>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
+        <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>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation type="unfinished"></translation>
+        <source>View live (%1 @ %2)</source>
+        <translation>Visa live (%1 @ %2)</translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation type="unfinished"></translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation>Fjärrstyrning (%1 @ %2)</translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation type="unfinished"></translation>
+        <translation>okänd användare</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation type="unfinished"></translation>
+        <translation>Visa endast</translation>
     </message>
     <message>
         <source>Remote control</source>
-        <translation type="unfinished"></translation>
+        <translation>Fjärrstyrning</translation>
     </message>
     <message>
         <source>Lock student</source>
-        <translation type="unfinished"></translation>
+        <translation>LÃ¥s student</translation>
     </message>
     <message>
         <source>Unlock student</source>
-        <translation type="unfinished"></translation>
+        <translation>LÃ¥s upp student</translation>
     </message>
     <message>
         <source>Snapshot</source>
-        <translation type="unfinished"></translation>
+        <translation>Skärmbild</translation>
     </message>
     <message>
         <source>Fullscreen</source>
-        <translation type="unfinished"></translation>
+        <translation>Helskärm</translation>
     </message>
     <message>
         <source>Window</source>
-        <translation type="unfinished"></translation>
+        <translation>Fönster</translation>
     </message>
     <message>
         <source>Quit</source>
-        <translation type="unfinished"></translation>
+        <translation>Avsluta</translation>
     </message>
     <message>
         <source>Connecting %1</source>
-        <translation type="unfinished"></translation>
+        <translation>Ansluter %1</translation>
     </message>
     <message>
         <source>Connected.</source>
-        <translation type="unfinished"></translation>
+        <translation>Ansluten.</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
+    <name>RemoteLogonDialog</name>
     <message>
-        <source>Remote Logon</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <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>
+        <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>
+        <translation type="unfinished">Användarnamn</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation type="unfinished"></translation>
+        <translation type="unfinished">Lösenord</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation type="unfinished"></translation>
+        <translation type="unfinished">Domän</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation type="unfinished"></translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation type="unfinished"></translation>
+        <source>unknown</source>
+        <translation>okänd</translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation type="unfinished"></translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshot</source>
+        <translation>Skärmbild</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation type="unfinished"></translation>
+        <translation>Skärmbilder</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation type="unfinished"></translation>
+        <translation>Hantera enkelt de skärmbilder som du skapat med denna arbetsyta.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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>
+        <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 type="unfinished"></translation>
+        <translation>Användare:</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation type="unfinished"></translation>
+        <translation>Värd:</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation type="unfinished"></translation>
+        <translation>Datum:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Show snapshot</source>
-        <translation type="unfinished"></translation>
+        <translation>Tid:</translation>
     </message>
     <message>
-        <source>Delete snapshot</source>
-        <translation type="unfinished"></translation>
+        <source>Show</source>
+        <translation>Visa</translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation type="unfinished"></translation>
+        <source>Delete</source>
+        <translation>Ta bort</translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation type="unfinished"></translation>
+        <translation type="unfinished">Support</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:20pt; font-weight:600; font-style:italic;">Support </span></p></body></html></source>
+        <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>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation type="unfinished"></translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Skicka textmeddelande</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation type="unfinished"></translation>
+        <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>Cancel</source>
-        <translation type="unfinished"></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation>Etablerar anslutning till %1...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished"></translation>
+        <source>Overview</source>
+        <translation>Översikt</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:20pt; font-weight:600; font-style:italic;">Send text message</span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Fullscreen demo</source>
+        <translation>Demo i helskärm</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>
+        <source>Window demo</source>
+        <translation>Demo i fönster</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation type="unfinished"></translation>
+        <source>Locked display</source>
+        <translation>Låst skärm</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation type="unfinished"></translation>
+        <source>View live</source>
+        <translation>Visa live</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation type="unfinished"></translation>
+        <source>Remote control</source>
+        <translation>Fjärrstyrning</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation type="unfinished"></translation>
+        <source>Let student show demo</source>
+        <translation>LÃ¥t student visa demo</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation type="unfinished"></translation>
+        <source>Send text message</source>
+        <translation>Skicka textmeddelande</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
+        <source>Logout user</source>
+        <translation>Logga ut användare</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation type="unfinished"></translation>
+        <source>Take a snapshot</source>
+        <translation>Ta en skärmbild</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation type="unfinished"></translation>
+        <source>Power on</source>
+        <translation>Starta</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation type="unfinished"></translation>
+        <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
index 940cc07..4fd2868 100644
Binary files a/lib/resources/tr.qm and b/lib/resources/tr.qm differ
diff --git a/lib/resources/tr.ts b/lib/resources/tr.ts
index 21c3680..6241e7e 100644
--- a/lib/resources/tr.ts
+++ b/lib/resources/tr.ts
@@ -2,1423 +2,1764 @@
 <!DOCTYPE TS>
 <TS version="2.0">
 <context>
-    <name>MainToolBar</name>
+    <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 utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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">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-2011 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 ':' for specifying an optional port-number)</p></body></html></source>
+        <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></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;">iTALC de görünen sunucuya verilmiş takma isim</p></body></html></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></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;">Terminallerin fiziksel adresleri sadece sistemi açmak için kullanılır</p></body></html></translation>
+    </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 network-traffic and lower CPU-usage on this computer.</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;">Burada yenileme sıklığı ayarlaması yapılır. Yüksek değerlerin düşük ağ trafiği ve CPU kullanımı anlamına gelir.</p></body></html></translation>
+    </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></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 mouse-cursor over 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 üzerinde gezerken ipucu balonlarının görünmesi için bu seçeneği seçiniz.</p></body></html></translation>
+    </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></html></translation>
+    </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>Actions</source>
-        <translation type="unfinished">Eylemler</translation>
+        <source>Supporter</source>
+        <translation type="unfinished">Destekleyici</translation>
     </message>
-</context>
-<context>
-    <name>MainWindow</name>
     <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
+        <source>Other</source>
+        <translation type="unfinished">DiÄŸer</translation>
     </message>
     <message>
-        <source>toolBar</source>
+        <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>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>Double-click action for client-window</source>
+        <translation type="unfinished">Öğrenci penceresi eylemleri için çift tıklayın</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Yazma eriÅŸimi yok</translation>
+        <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>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>
+        <source>Remote control</source>
+        <translation type="unfinished">Uzaktan Kontrol</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation type="unfinished">Sınıf</translation>
+        <source>View live in fullscreen</source>
+        <translation type="unfinished">Tam ekran modunda canlı bağlantı</translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Sınıf değiştirme</translation>
+        <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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Unutmayınız. Bazı değişikliklerin etkin olması için iTALC programını tekrar başlatmanız gerekebilir.</span></p></body></html></translation>
     </message>
+</context>
+<context>
+    <name>ConfigWidget</name>
     <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>
+        <source>Your iTALC-configuration</source>
+        <translation type="unfinished">iTALC ayarları</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>
+        <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>Overview mode</source>
-        <translation type="unfinished">Genel Bakış modu</translation>
+        <source>OK</source>
+        <translation type="unfinished">TAMAM</translation>
     </message>
+</context>
+<context>
+    <name>DemoClient</name>
     <message>
-        <source>Overview</source>
+        <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>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>
+        <source>VNC authentication failed.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
+        <source>VNC server closed connection.</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>KeyFileAssistant</name>
     <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Tamekran Gösterim</translation>
+        <source>iTALC Access Key Assistant</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Stop Demo</source>
-        <translation type="unfinished">Gösterimi Durdur</translation>
+        <source>Create/import iTALC access keys</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">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>
+        <source>This assistant will help you to create or import iTALC access keys.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
+        <source>How does it work?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window Demo</source>
-        <translation type="unfinished">Pencere Gösterimi</translation>
+        <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>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>
+        <source>Assistant mode</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Masaüstlerini Kilitle/Aç </translation>
+        <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>Lock all</source>
-        <translation type="unfinished">Hepsini kilitle</translation>
+        <source>Create new access keys (master computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Hepsinin kilidini aç</translation>
+        <source>assistantModeButtonGroup</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">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>
+        <source>Import public key (client computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Send text message</source>
+        <source>Select user role</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished">Metin mesajı</translation>
+        <source>Please select a user role for which to create or import the access keys:</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">Bu düğmeyi tüm öğrencilere metin mesajı göndermek için kullanınız.</translation>
+        <source>Teacher</source>
+        <translation type="unfinished">Öğretmen</translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Bilgisayarları aç</translation>
+        <source>Administrator</source>
+        <translation type="unfinished">Yönetici</translation>
     </message>
     <message>
-        <source>Power on</source>
+        <source>Support team member</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">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>
+        <source>Other</source>
+        <translation type="unfinished">DiÄŸer</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Bilgisayarları kapat</translation>
+        <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>Power down</source>
+        <source>Directories</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">Örneğin ders sonunda bilgisayarları kapatmak için bu düğmeyi kullanabilirsiniz</translation>
+        <source>Export public key part (master computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logon</source>
-        <translation type="unfinished">Oturum aç</translation>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Uzaktan oturum aç</translation>
+        <source>Use custom destination directory for access keys</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Görünen bilgisayarlara giriş ypamak için kullanıcı adı ve şifresini girdikten sonra bu düğmeye tıklayınız.</translation>
+        <source>Please specify the location of the public access key to be imported.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Support</source>
-        <translation type="unfinished">Destek</translation>
+        <source>Summary</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">DoÄŸrudan Destek</translation>
+        <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>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>
+        <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>Adjust/align</source>
-        <translation type="unfinished">Düzenleme/ayarlama</translation>
+        <source>Select directory in which to export the public key</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Pencere boyutunu düzenle</translation>
+        <source>Key files (*.key.txt)</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">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>
+        <source>Invalid public key</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Otomatik görüntü</translation>
+        <source>The selected file does not contain a valid public iTALC access key!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Otomatikmen pencerelerin boyutlandırılması</translation>
+        <source>Select destination directory</source>
+        <translation type="unfinished"></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>
+        <source>Access key creation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Geçerli anahtar bulundu</translation>
+        <source>Could not remove previously existing file %1.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Kimlik denetim anahtarı bulunamadı ya da kullandığınız eski anahtar kırıldı. Lütfen ICA (http://italc.sf.net/wiki/index.php?title=Installation adresini ziyaret ediniz.) kullanarak yeni anahtar oluşturunuz. Aksi taktirde iTALC kullanarak bilgisayarlara erişemezsiniz.</translation>
+        <source>Failed exporting public access key from %1 to %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">iTALC servisi çalışmıyor</translation>
+        <source>Access keys were created and written successfully to %1 and %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">iTALC client uygulaması çalışmıyor olabilir ya da program anahtarlara ulaşamıyor. Servisin çalıştığından eminseniz kullanıcı erişim haklarının uygun olduğundan emin olunuz. root yetkilerine sahip değilseniz erişim hakları için root ile iletişim kurunuz.</translation>
+        <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>iTALC Master Control</source>
-        <translation type="unfinished">iTALC Master Kontrol</translation>
+        <source>Public key import</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
+        <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>Quit</source>
+        <source>The public key was successfully imported to %1.</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>QApplication</name>
+    <name>LockWidget</name>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>iTALC Terminal %1 on %2:%3</translation>
+        <source>screen lock</source>
+        <translation type="unfinished">Ekranı kilitle</translation>
     </message>
+</context>
+<context>
+    <name>LogonGroupEditor</name>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>servis çalıştırılamadı</translation>
+        <source>Logon group editor</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>Servis Kontrol Yöneticisi ile bağlantı kurulamadı (Geçerli haklara sahip misiniz?!) - Servis kayıtlı değil.</translation>
+        <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>The service '%1' is already registered.</source>
-        <translation>Servis '%1' zaten kayıtlı.</translation>
+        <source>All groups</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Servis '%1' kaydedilemedi.</translation>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>Servis '%1' sorunsuz bir ÅŸekilde kaydedildi.</translation>
+        <source>Groups with iTALC privileges</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>MainToolBar</name>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Servis '%1' durdurulamadı.</translation>
+        <source>Actions</source>
+        <translation type="unfinished">Eylemler</translation>
     </message>
+</context>
+<context>
+    <name>MainWindow</name>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Servis '%1' kaydı silindi.</translation>
+        <source>General</source>
+        <translation type="unfinished">Genel</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>
+        <source>Quit</source>
+        <translation type="unfinished">Çıkış</translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Servisin '%1' kaydı silinemedi.</translation>
+        <source>iTALC Management Console</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Servis '%1' bulunamadı.</translation>
+        <source>iTALC Server</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>Servis Kontrol Yöneticisi ile bağlantı kurulamadı (Geçerli haklara sahip misiniz?!) - Servis kayıtlı değil.</translation>
+        <source>Paths</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>Servis Kontrol Yöneticisi ile bağlantı kurulamadı (Geçerli haklara sahip misiniz?!) - Servis durdurulamadı.</translation>
+        <source>Authentication</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>iTALC Service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
+        <source>Hide tray icon</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>iTALC-ekran görüntüsü</translation>
+        <source>Autostart</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation>iTALC Hakkında</translation>
+        <source>Additional arguments</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></p></body></html></source>
-        <translation></translation>
+        <source>Start service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>Hakkında</translation>
+        <source>Stop service</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;"><span style=" font-size:11pt;">iTALC - Intelligent Teaching And Learning with Computers</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Copyright (c) 2004-2010 Tobias Doerffel</p></body></html></source>
+        <source>State:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Program GeliÅŸtiricileri</translation>
+        <source>Stopped</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Çeviri</translation>
+        <source>Logging</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;">Current language not translated yet (or native English).</p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">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!</p></body></html></source>
+        <source>Log file directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Lisans</translation>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>TAMAM</translation>
+        <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>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Sınıf Yönetimi</translation>
+        <source>Errors and critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Bu çalışma alanını bilgisayarları ve sınıfınızı kolay yoldan yönetmek için kullanın</translation>
+        <source>Warnings and errors</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>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>
+        <source>Information, warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Sınıflar/Bilgisayarlar</translation>
+        <source>Debug messages and everything else</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>IP Adresleri</translation>
+        <source>Limit log file size</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Kullanıcı Adları</translation>
+        <source>MB</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Kullanıcı adlarını göster</translation>
+        <source>Clear all log files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Bilgisayarları ve/veya sınıfları silmek veya eklemek için bu menüyü kullanın (Farenin sağ tuşu)</translation>
+        <source>Desktop capturing</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Dosyaların dışa aktarımı</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</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>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>
+        <source>Poll full screen</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Öğretmen Bilgisayarını Gizle</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Göster/Gizle</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Ayarları düzenle</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Sil</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Bu sınıftaki tüm bilgisayarları göster</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Bu sınıftaki tüm bilgisayarları gizle</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>İsmi Düzenle</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Sınıfı Sil</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Bilgisayar Ekle</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Sınıf ekle</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Konfigürasyon dosyası bulunamadı</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">Ekran görüntüsünü Yakala</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 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>
+        <source>Authentication methods</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Konfigürasyon dosyasında HATA var</translation>
+        <source>Access key management</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>Düzenleyin ya da bu dosyayı silerek bütün sınıfları ve bilgisayarları tekrar ekleyin.</translation>
+        <source>Logon settings</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>%1 dosyasını incelemede hata var. Lütfen düzenleyin ya da bu dosyayı siliniz.</translation>
+        <source>&File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Çıkış dosyası seçiniz</translation>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Metin Dosyaları (*.txt)</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation>Seçilmiş öğeler için eylemler</translation>
+        <source>Ctrl+Q</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Eylemler</translation>
+        <source>&Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>%1 için Eylemler</translation>
+        <source>Save settings into file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Sınıf için yeni isim</translation>
+        <source>Ctrl+S</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Lütfen sınıf için yeni bir isim giriniz "%1"</translation>
+        <source>L&oad settings from file</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>Sınıf silinecek Emin misiniz "%1"?
-Bu işlem sonucunda bütün bilgisayarlar silinecek</translation>
+        <source>Ctrl+O</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Eksik Sınıf</translation>
+        <source>About iTALC</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>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>
+        <source>About Qt</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Yeni Sınıf</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Oluşturmak istediğiniz sınıf için lütfen bir isim giriniz</translation>
+        <source>toolBar</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Bilinmeyen durum</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Hiçbir kullanıcı giriş yapmadı</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation> Sunucuya EriÅŸilemedi</translation>
+        <source>Load settings from file</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Demo modu</translation>
+        <source>XML files (*.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Masaüstü Kilitlendi</translation>
+        <source>Save settings to file</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>Görünen tüm bilgisayarların oturumları sonlandırılacak. Emin misiniz?</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Seçtiğiniz bilgisayarların oturumları sonlandırılacak. Emin misiniz?</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Kullanıcı oturumunu kapat</translation>
+        <source>Configuration not writable</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Görünen tüm bilgisayarların sistemi yeniden başlatılacak. Emin misiniz?</translation>
+        <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>Are you sure want to reboot all selected computers?</source>
-        <translation>Seçilen tüm bilgisayarların sistemi yeniden başlatılacak. Emin misiniz?</translation>
+        <source>All settings were applied successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot computers</source>
-        <translation>Bilgisayarları yeniden başlat</translation>
+        <source>An error occured while applying settings!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Görünen tüm bilgisayarlar kapatılacak. Emin misiniz?</translation>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Seçilen tüm bilgisayarlar kapatılacak. Emin misiniz? </translation>
+        <source>No write access</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation>Genel Bakış</translation>
+        <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>Fullscreen demo</source>
-        <translation>Tam Ekran Modunda Gösterim</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">Sınıf</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation>Pencere modunda gösterim</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">Sınıf değiştirme</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation>Görüntü kilitlendi</translation>
+        <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>View live</source>
-        <translation>Canlı Bağlantı</translation>
+        <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>Remote control</source>
-        <translation>Uzaktan Kontrol</translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">Genel Bakış modu</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation>Öğrenci Gösterimine izin ver</translation>
+        <source>Overview</source>
+        <translation type="unfinished">Genel Bakış</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation>Metin Mesajı gönder </translation>
+        <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>Logon user</source>
-        <translation>Kullanıcı girişi</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">Tam Ekran Modunda Gösterim</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Kullanıcı çıkışı</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished">Tamekran Gösterim</translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation>Ekran görüntüsü al</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished">Gösterimi Durdur</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation>Sistemi aç</translation>
+        <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>Reboot</source>
-        <translation>Yeniden baÅŸlat</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">Pencere modunda gösterim</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation>Sistemi kapat</translation>
+        <source>Window Demo</source>
+        <translation type="unfinished">Pencere Gösterimi</translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation>Komut çalıştır</translation>
+        <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>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation> Kullanıcı ayarları</translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">Masaüstlerini Kilitle/Aç </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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Lock all</source>
+        <translation type="unfinished">Hepsini kilitle</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Genel</translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">Hepsinin kilidini aç</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Tür</translation>
+        <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>Student computer</source>
-        <translation>Öğrenci bilgisayarı</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Metin Mesajı gönder </translation>
     </message>
     <message>
-        <source>Teacher computer</source>
-        <translation>Öğretmen bilgisayarı</translation>
+        <source>Text message</source>
+        <translation type="unfinished">Metin mesajı</translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Diğer/tanımlanmamış bilgisayar</translation>
+        <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>Classroom</source>
-        <translation>Sınıf</translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">Bilgisayarları aç</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>Fiziksel (MAC) adresleri</translation>
+        <source>Power on</source>
+        <translation type="unfinished">Sistemi aç</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 ':' for specifying an optional port-number)</p></body></html></source>
-        <translation type="unfinished"></translation>
+        <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>IP/hostname</source>
-        <translation>IP/sunucu adı</translation>
+        <source>Power down computers</source>
+        <translation type="unfinished">Bilgisayarları kapat</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></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;">Terminallerin fiziksel adresleri sadece sistemi açmak için kullanılır</p></body></html></translation>
+        <source>Power down</source>
+        <translation type="unfinished">Sistemi kapat</translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Ä°sim</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></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;">iTALC de görünen sunucuya verilmiş takma isim</p></body></html></translation>
+        <source>Support</source>
+        <translation type="unfinished">Destek</translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <source>Direct support</source>
+        <translation type="unfinished">DoÄŸrudan Destek</translation>
     </message>
     <message>
-        <source>Connection</source>
-        <translation>Bağlantı</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">connection to hosts on the same level</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;">aynı sevideki sunuculara erişim</p></body></html></translation>
+        <source>Adjust/align</source>
+        <translation type="unfinished">Düzenleme/ayarlama</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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Burada iTALC-ağına sunucunun nasıl bağlanacağı ayarlanır. Genelde terminaller 100 MBit/s LAN bağlantısı ile bağlanır, fakat iTALC-ağlarına bağlanmak için bazı özel sunucular olabilir. Bu durumda iTALC bantgenişliğini en uygun hale getirir.</p></body></html></translation>
+        <source>Adjust windows and their size</source>
+        <translation type="unfinished">Pencere boyutunu düzenle</translation>
     </message>
     <message>
-        <source>Analog</source>
-        <translation>Analog</translation>
+        <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>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Auto view</source>
+        <translation type="unfinished">Otomatik görüntü</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished">Otomatikmen pencerelerin boyutlandırılması</translation>
     </message>
     <message>
-        <source>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <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>100 MBit/s LAN</source>
-        <translation>100 MBit/s LAN</translation>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished">iTALC Master Kontrol</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s LAN</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">Uzaktan Kontrol</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 if the host is the gateway for the subnet.</p></body></html></source>
+        <source>Could not modify the autostart property for the iTALC Service.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host is &gateway for subnet</source>
-        <translation>Sunucu &alt ağ için ağ geçidi</translation>
+        <source>Could not modify the service arguments for the iTALC Service.</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;">Activate this option for at least one host in a subnet.</p></body></html></source>
+        <source>Could not change the firewall configuration for the iTALC Service.</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</p></body></html></source>
+        <source>Debugging</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Demo tekrarlayıcısı olarak görev yap</translation>
+        <source>Enable desktop switching for screen lock (experimental)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>TAMAM</translation>
+        <source>Log to standard error output</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>Vazgeç</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>IP adresi/Sunucu Adı Kayıp</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Bu bilgisayar için bir IP adresi yada Sunucu adı atayamadınız</translation>
+        <source>VNC reflector</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Geçersiz MAC adresi</translation>
+        <source>iTALC 1 demo server</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>Geçersiz bir MAC adresi girdiniz. Lütfen geçerli bir adres giriniz. (ayraç olarak ":" giriniz.</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Komutları terminal(ler) üzerinde çalıştırınız.</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Terminal(ler) üzerinde çalıştırmak istediğiniz komutu giriniz: </translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>Çalıştır!</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Vazgeç</translation>
+        <source>Key file authentication</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Yenileme Sıklığı</translation>
+        <source>ACL-based logon authentication</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 network-traffic and lower CPU-usage on this computer.</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;">Burada yenileme sıklığı ayarlaması yapılır. Yüksek değerlerin düşük ağ trafiği ve CPU kullanımı anlamına gelir.</p></body></html></translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 Saniye</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> saniye</translation>
+        <source>Launch key file assistant</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Gösterim modunun kalitesi</translation>
+        <source>Manage permissions</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">Burada gösterim modunun ekran kalitesini ayarlayabilirsiniz. Düşük kalite düşük CPU kullanımı ve düşük ağ trafiği anlamına gelir. Yüksek kalitede ise bazı yavaşlamalar görünebilir. Sistemi kullarak kendiniz için en uygun ayarlamayı yapabilirsiniz.</p></body></html></translation>
+        <source>Test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Düşük (15 bit)</translation>
+        <source>Access confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Orta (18 bit)</translation>
+        <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>High (Truecolor)</source>
-        <translation>Yüksek (G-P)</translation>
+        <source>Logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>User interface</source>
-        <translation>Kullanıcı arayüzü</translation>
+        <source>Allow same user to access desktop without confirmation</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></body></html></translation>
+        <source>Debugging iTALC</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 mouse-cursor over 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;">Araç çubuğu ve düğmeler üzerinde gezerken ipucu balonlarının görünmesi için bu seçeneği seçiniz.</p></body></html></translation>
+        <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>No balloon-tooltips</source>
-        <translation>Ä°pucu baloncuÄŸu yok</translation>
+        <source>1)</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></html></translation>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Araç çubuğu ve Butonlarda metin yok</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Your role (needs according keys!)</source>
-        <translation>Rolünüz (uygun anahtarlar gerekir)</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</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><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>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Öğretmen</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Yönetici</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Destekleyici</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>DiÄŸer</translation>
+        <source>Generate bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Çoklu giriş için ayarlar</translation>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Etki alanı</translation>
+        <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>Double-click action for client-window</source>
-        <translation>Öğrenci penceresi eylemleri için çift tıklayın</translation>
+        <source>Restart iTALC Service</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><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>
+        <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>Remote control</source>
-        <translation>Uzaktan kontol</translation>
+        <source>Starting iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>View live in fullscreen</source>
-        <translation>Tam ekran modunda canlı bağlantı</translation>
+        <source>Stopping iTALC service</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Unutmayınız. Bazı değişikliklerin etkin olması için iTALC programını tekrar başlatmanız gerekebilir.</span></p></body></html></translation>
+        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>iTALC ayarları</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>Bu çalışma alanında iTALC programını kendiniz için uygun bir hale getirebilirsiniz</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC Demo</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
-        <translation>ISD-server hatası</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>ISD-server başlatılamadı çünkü %1 portu kullanımda. Lütfen diğer uygulamaların bu portu kullanmadığına emin olarak tekrar deneyin.</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Erişim onayı</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>%1 sunucusunda birileri sizin ekranınza erişmek istiyor. Ona erişim vermek ister misiniz? </translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Bu oturum için asla</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Bu oturum için herzaman</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>Öğretmenden Mesaj Var</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Uygulama Hatası</translation>
+        <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>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>(IP: %1) de birisi bu bilgisayara erişmeye çalıştı fakat gerekli izni düzgün bir şekilde alamadı</translation>
+        <source>Could not contact iTALC service</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Ekran görüntüsü</translation>
+        <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>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>%1 dizin varolmadığından ekran görüntüsü oluşturulamadı</translation>
+        <source>Authentication impossible</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>Ekranı kilitle</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>TAMAM</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">Öğretmenden Mesaj Var</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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">
+        <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>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>
+        <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>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>
+        <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>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>
+        <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>iTALC programının ayarlamalarını yapabilirsiniz. Bu ayarlamalar Ayarlama Penceresi ile yapılabilir.</translation>
+        <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>iTALC hakkında</translation>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>Genel Bakış</translation>
+        <translation type="unfinished">Genel Bakış</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>iTALC programını nasıl kullanacağınıza dair basit bilgiler</translation>
+        <translation type="unfinished">iTALC programını nasıl kullanacağınıza dair basit bilgiler</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation type="unfinished">Kullanıcı adı</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation type="unfinished">Åžifre</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Yeni yada içe aktarılacak anahtar dosyaların kaydedilmesi gerekmekte. Varsayılan dizine kopyalamanız/oluşturmanız önerilir</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>iTALC Terminal %1 on %2:%3</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Anahtarların (public) saklandığı dizin</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>servis çalıştırılamadı</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation>Anahtarların (private) saklandığı dizin</translation>
+        <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>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Servis '%1' zaten kayıtlı.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>(private) Anahtarı da dışa aktarabilirsiniz</translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Servis '%1' kaydedilemedi.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Servis '%1' sorunsuz bir ÅŸekilde kaydedildi.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Servis '%1' durdurulamadı.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Servis '%1' kaydı silindi.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Öğretmen bilgisayarı Anahtarını (public) içe aktar</translation>
+        <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>Choose location of exported public key:</source>
-        <translation>Anahtar (public) dosyasını dışa aktaracağınız kalsörü seçiniz</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Servisin '%1' kaydı silinemedi.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Bütün anahtar dosyaları koru (Sadece güncelleme yaparken)</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Servis '%1' bulunamadı.</translation>
     </message>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation type="unfinished"></translation>
+        <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>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Canlı bağlantı (%1 -> %2 sunucusunda)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Uzaktan kontrol (%1 -> %2 sunucusunda)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation>Bilinmeyen kullanıcı</translation>
+        <translation type="unfinished">Bilinmeyen kullanıcı</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation>Sadece izle</translation>
+        <translation type="unfinished">Sadece izle</translation>
     </message>
     <message>
         <source>Remote control</source>
-        <translation>Uzaktan Kontrol</translation>
+        <translation type="unfinished">Uzaktan Kontrol</translation>
     </message>
     <message>
         <source>Lock student</source>
-        <translation>Öğrenci Ekranını kilitle</translation>
+        <translation type="unfinished">Öğrenci Ekranını kilitle</translation>
     </message>
     <message>
         <source>Unlock student</source>
-        <translation>Öğrenci ekran kilidini aç</translation>
+        <translation type="unfinished">Öğrenci ekran kilidini aç</translation>
     </message>
     <message>
         <source>Snapshot</source>
-        <translation>Ekran Görüntüsünü yakala</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>Fullscreen</source>
-        <translation>Tam ekran</translation>
+        <translation type="unfinished">Tam ekran</translation>
     </message>
     <message>
         <source>Window</source>
-        <translation>Pencere</translation>
+        <translation type="unfinished">Pencere</translation>
     </message>
     <message>
         <source>Quit</source>
-        <translation>Çıkış</translation>
+        <translation type="unfinished">Çıkış</translation>
     </message>
     <message>
         <source>Connecting %1</source>
-        <translation> %1 Bağlanıyor</translation>
+        <translation type="unfinished"> %1 Bağlanıyor</translation>
     </message>
     <message>
         <source>Connected.</source>
-        <translation>Bağlantı kuruldu</translation>
+        <translation type="unfinished">Bağlantı kuruldu</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Uzaktan giriÅŸ</translation>
-    </message>
+    <name>RemoteLogonDialog</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:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Uzaktan giriÅŸ</span></p></body></html></translation>
+        <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>Bu alana kullanıcı adı ve şifreyi girebilirsiniz. isterseniz alan adı da girebilirsiniz. Bu bilgi bilgisayarlara giriş yapabilmek için kullanılacaktır.</translation>
+        <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>Kullanıcı adı</translation>
+        <translation type="unfinished">Kullanıcı adı</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>Åžifre</translation>
+        <translation type="unfinished">Åžifre</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation>Alan</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>TAMAM</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Vazgeç</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Kurulum Sihirbazı</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>%1 Ãœzerine yazmak istediÄŸinize emin misiniz </translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Kurulumdan vazgeç</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Ä°leri</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Bitir</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Çık</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>Anahtar(public) için dizin seçiniz</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>Anahtar (private) için dizin seçiniz</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Anahtarı (public) dışa aktarmak için dizin seçiniz</translation>
+        <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>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
+        <source>Snapshot</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>Ekran görüntüsünü Yakala</translation>
+        <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>Bu alanı kullanarak ekran görüntüsünü yakalama özelliğini kullanabilirsiniz.</translation>
+        <translation type="unfinished">Bu alanı kullanarak ekran görüntüsünü yakalama özelliğini kullanabilirsiniz.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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">
+        <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>Kullanıcı:</translation>
+        <translation type="unfinished">Kullanıcı:</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation>Alan Adı:</translation>
+        <translation type="unfinished">Alan Adı:</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation>Tarih:</translation>
+        <translation type="unfinished">Tarih:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>Zaman</translation>
-    </message>
-    <message>
-        <source>Show snapshot</source>
-        <translation>Ekran Görüntüsünü Göster</translation>
+        <translation type="unfinished">Zaman</translation>
     </message>
     <message>
-        <source>Delete snapshot</source>
-        <translation>Ekran Görüntüsünü sil</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>Listeyi yenile</translation>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation>Destek</translation>
+        <translation type="unfinished">Destek</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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Destek </span></p></body></html></translation>
+        <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>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Destek istiyorsanız, Lütfen IP adresini ya da kullanıcının kullandığı sunucu adını girin.</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">Metin Mesajı gönder </translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>TAMAM</translation>
+        <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>Cancel</source>
-        <translation>Vageç</translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">Bağlantı kuruluyor %1...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Metin mesajı gönder</translation>
+        <source>Overview</source>
+        <translation>Genel Bakış</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Metin mesajı gönder</span></p></body></html></translation>
+        <source>Fullscreen demo</source>
+        <translation>Tam Ekran Modunda Gösterim</translation>
     </message>
     <message>
-        <source>Use the field below to type your message which will be sent to all selected users.</source>
-        <translation>Seçilen kullanıcılara mesaj göndermek için metin kutusuna mesajınızı yazın.</translation>
+        <source>Window demo</source>
+        <translation>Pencere modunda gösterim</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>TAMAM</translation>
+        <source>Locked display</source>
+        <translation>Görüntü kilitlendi</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>View live</source>
+        <translation>Canlı Bağlantı</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Vazgeç</translation>
+        <source>Remote control</source>
+        <translation>Uzaktan Kontrol</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>ESC</translation>
+        <source>Let student show demo</source>
+        <translation>Öğrenci Gösterimine izin ver</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Bağlantı kuruluyor %1...</translation>
+        <source>Send text message</source>
+        <translation>Metin Mesajı gönder </translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
+        <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>Cancel</source>
-        <translation>Vazgeç</translation>
+        <source>Reboot</source>
+        <translation>Yeniden baÅŸlat</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Geri</translation>
+        <source>Power down</source>
+        <translation>Sistemi kapat</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Ä°leri</translation>
+        <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
index 3f7adf6..2677046 100644
Binary files a/lib/resources/uk.qm and b/lib/resources/uk.qm differ
diff --git a/lib/resources/uk.ts b/lib/resources/uk.ts
index df1593a..63ff067 100644
--- a/lib/resources/uk.ts
+++ b/lib/resources/uk.ts
@@ -2,1008 +2,1423 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="uk_UA">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
+    <message>
+        <source>About iTALC</source>
+        <translation>Про програму iTALC</translation>
+    </message>
+    <message>
+        <source>About</source>
+        <translation>Про програму</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</source>
+        <translation>iTALC — інтелектуальне викладання та навчання за допомогою комп’ютерів
+
+© Tobias Doerffel, 2004–2011</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-2011 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 type="unfinished">Дії</translation>
+        <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>MainWindow</name>
+    <name>Client</name>
     <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
+        <source>Unknown state</source>
+        <translation>Стан невідомий</translation>
     </message>
     <message>
-        <source>toolBar</source>
-        <translation type="unfinished"></translation>
+        <source>No user logged in</source>
+        <translation>Жоден користувач не почав роботу</translation>
     </message>
     <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <source>Host unreachable</source>
+        <translation>Комп’ютер недоступний</translation>
     </message>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">Відсутній дозвіл на запис</translation>
+        <source>Demo running</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 type="unfinished">Неможливо провести читання/запис або створити теку %1! Щоб запустити iTALC, переконайтеся, що ви можете створити теку або провести запис до цієї теки.</translation>
+        <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 ':' for specifying an optional port-number)</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;">Введіть IP-адресу або ім’я комп’ютера, за яким iTALC зможе отримати доступ до клієнта (використовуйте ':', щоб додатково задати номер порту)</p></body></html></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></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;">Додатковий псевдонім вузла, який показуватиме 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></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;">Апаратна/MAC-адреса клієнта - використовується лише для вмикання клієнта</p></body></html></translation>
     </message>
     <message>
         <source>Classroom</source>
-        <translation type="unfinished">Клас</translation>
+        <translation>Клас</translation>
     </message>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">Перемкнути клас</translation>
+        <source>Type</source>
+        <translation>Тип</translation>
     </message>
     <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">Натисніть на цю кнопку, щоб відкрити меню, за допомогою якого ви зможете обрати активний клас.</translation>
+        <source>Student computer</source>
+        <translation>Комп’ютер учня</translation>
     </message>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">Натисніть на цю кнопку, щоб перемикатися між класами.</translation>
+        <source>Teacher computer</source>
+        <translation>Комп’ютер вчителя</translation>
     </message>
     <message>
-        <source>Overview mode</source>
-        <translation type="unfinished">Режим перегляду</translation>
+        <source>Other/undefined computer</source>
+        <translation>Інший/Невизначений комп’ютер</translation>
     </message>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">Огляд</translation>
+        <source>Missing IP address/hostname</source>
+        <translation>Не вказано IP-адреси або назви вузла</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>
+        <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>Fullscreen demo</source>
-        <translation type="unfinished">Повноекранне демо</translation>
+        <source>Interval between updates</source>
+        <translation>Період між оновленнями</translation>
     </message>
     <message>
-        <source>Fullscreen Demo</source>
-        <translation type="unfinished">Повноекранне демо</translation>
+        <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 network-traffic and lower CPU-usage on this computer.</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>Stop Demo</source>
-        <translation type="unfinished">Завершити демонстрацію</translation>
+        <source> seconds</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 type="unfinished">У цьому режимі зображення з вашого екрана буде показано на всіх видимих комп’ютерах. Крім того, користувачі не зможуть виконувати інших дій, оскільки у цьому режимі всі пристрої введення буде заблоковано.</translation>
+        <source>User interface</source>
+        <translation>Інтерфейс користувача</translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">Демо у вікні</translation>
+        <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>Window Demo</source>
-        <translation type="unfinished">Демо у вікні</translation>
+        <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 mouse-cursor over 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>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>
+        <source>No balloon-tooltips</source>
+        <translation>Без контекстних підказок</translation>
     </message>
     <message>
-        <source>Lock/unlock desktops</source>
-        <translation type="unfinished">Заблокувати/розблокувати стільниці</translation>
+        <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>Lock all</source>
-        <translation type="unfinished">Заблокувати всі</translation>
+        <source>No texts on toolbar-buttons</source>
+        <translation>Без тексту на кнопках інструментів</translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">Розблокувати всі</translation>
+        <source>Your role (needs according keys!)</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 type="unfinished">Щоб заволодіти увагою учнів, ви можете заблокувати їхні стільниці за допомогою цієї кнопки. У цьому режимі всі пристрої вводу буде заблоковано, а екран стане чорним.</translation>
+        <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>Send text message</source>
-        <translation type="unfinished">Надіслати текстове повідомлення</translation>
+        <source>Teacher</source>
+        <translation>Вчитель</translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished">Текстове повідомлення</translation>
+        <source>Administrator</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 type="unfinished">Використовуйте цю кнопку, щоб надіслати текстове повідомлення для всіх користувачів, наприклад, щоб повідомити їм про нове завдання та інше.</translation>
+        <source>Supporter</source>
+        <translation>Супровідник</translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">Увімкнути комп’ютери</translation>
+        <source>Other</source>
+        <translation>Інша</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">Увімкнути</translation>
+        <source>Settings for multi-logon</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 type="unfinished">Натисніть на цю кнопку, щоб увімкнути всі видимі комп’ютери. Таким чином, вам не потрібно буде вмикати кожен комп’ютер вручну.</translation>
+        <source>Domain</source>
+        <translation>Домен</translation>
     </message>
     <message>
-        <source>Power down computers</source>
-        <translation type="unfinished">Вимкнути комп’ютери</translation>
+        <source>Double-click action for client-window</source>
+        <translation>Дія за подвійним клацанням на вікні клієнта</translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">Вимкнути</translation>
+        <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>To power down all shown computers (e.g. after the lesson has finished) you can click this button.</source>
-        <translation type="unfinished">Щоб вимкнути комп’ютери (наприклад, по завершенню уроку), ви можете натиснути цю кнопку.</translation>
+        <source>Remote control</source>
+        <translation>Віддалене керування</translation>
     </message>
     <message>
-        <source>Logon</source>
-        <translation type="unfinished">Почати роботу</translation>
+        <source>View live in fullscreen</source>
+        <translation>Перегляд наживо на весь екран</translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">Віддалений початок роботи</translation>
+        <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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Будь ласка, зауважте, що деякі зміни не набудуть чинності, доки ви не перезапустите iTALC.</span></p></body></html></translation>
     </message>
+</context>
+<context>
+    <name>ConfigWidget</name>
     <message>
-        <source>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">Після натискання цієї кнопки ви можете ввести ім’я користувача і пароль, щоб почати роботу цього користувача на всіх видимих комп’ютерах.</translation>
+        <source>Your iTALC-configuration</source>
+        <translation>Ваші налаштування iTALC</translation>
     </message>
     <message>
-        <source>Support</source>
-        <translation type="unfinished">Супровід</translation>
+        <source>In this workspace you can customize iTALC to fit your needs.</source>
+        <translation>У цьому робочому просторі ви можете налаштувати iTALC для ваших потреб.</translation>
     </message>
+</context>
+<context>
+    <name>DecoratedMessageBox</name>
     <message>
-        <source>Direct support</source>
-        <translation type="unfinished">Прямий супровід</translation>
+        <source>OK</source>
+        <translation>Гаразд</translation>
     </message>
+</context>
+<context>
+    <name>DemoClient</name>
     <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>
+        <source>iTALC Demo</source>
+        <translation>Демо iTALC</translation>
     </message>
+</context>
+<context>
+    <name>ItalcCoreServer</name>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">Підібрати/вирівняти</translation>
+        <source>Authentication error</source>
+        <translation>Помилка розпізнавання</translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">Підібрати розмір вікон та їх розташування</translation>
+        <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>When clicking this button the biggest possible size for the client-windows is adjusted. Furthermore all windows are aligned.</source>
-        <translation type="unfinished">Якщо ви натиснете на цю кнопку, буде обрано найбільший можливий розмір вікна клієнта. Крім того, всі вікна буде вирівняно.</translation>
+        <source>VNC authentication failed because of too many authentication tries.</source>
+        <translation>Перевищення граничної кількості спроб під час розпізнавання у VNC.</translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">Авто-вигляд</translation>
+        <source>VNC authentication failed.</source>
+        <translation>Помилка під час спроби розпізнавання у VNC.</translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">Автоматично перевпорядкувати вікна та підібрати їх розмір</translation>
+        <source>VNC server closed connection.</source>
+        <translation>З’єднання розірвано сервером VNC.</translation>
     </message>
+</context>
+<context>
+    <name>KeyFileAssistant</name>
     <message>
-        <source>When clicking this button all visible windows are re-arranged and adjusted.</source>
-        <translation type="unfinished">Якщо ви натиснете на цю кнопку, всі видимі вікна буде перевпорядковано з підбиранням розміру.</translation>
+        <source>iTALC Access Key Assistant</source>
+        <translation>Помічник обробки ключів доступу iTALC</translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">Не знайдено коректних ключів</translation>
+        <source>Create/import iTALC access keys</source>
+        <translation>Створення/Імпортування ключів доступу iTALC</translation>
     </message>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">Не знайдено ключів автентифікації або ваші попередні ключі було пошкоджено. Будь ласка, створіть нові пари ключів за допомогою ICA (див. документацію на сайті http://italc.sf.net/wiki/index.php?title=Installation).
-Якщо ви цього не зробите, ви не зможете отримати доступ до комп’ютерів за допомогою iTALC.</translation>
+        <source>This assistant will help you to create or import iTALC access keys.</source>
+        <translation>Ця допоміжна програма полегшує створення та імпортування ключів доступу iTALC.</translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">Службу iTALC не запущено</translation>
+        <source>How does it work?</source>
+        <translation>Як це працює?</translation>
     </message>
     <message>
-        <source>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">Здається, на цьому комп’ютері не запущено службу iTALC або ключі автентифікації встановлено неправильно. Для використання iTALC потрібен запуск служби. Зв’яжіться з вашим адміністратором, щоб розв’язати цю проблему.</translation>
+        <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>iTALC Master Control</source>
-        <translation type="unfinished">Головне керування iTALC</translation>
+        <source>Assistant mode</source>
+        <translation>Режим помічника</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">Віддалене керування</translation>
+        <source>Please choose whether to create new access keys or import a public key on a client.</source>
+        <translation>Будь ласка, вкажіть дію: створити ключі доступу чи імпортувати відкритий ключ на клієнтський комп’ютер.</translation>
     </message>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished">Вийти</translation>
+        <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>QApplication</name>
+    <name>LockWidget</name>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
-        <translation>Клієнт iTALC %1 на %2:%3</translation>
+        <source>screen lock</source>
+        <translation>блокування екрана</translation>
     </message>
+</context>
+<context>
+    <name>LogonGroupEditor</name>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>Не вдалося зареєструвати службу «%1».</translation>
+        <source>Logon group editor</source>
+        <translation>Редактор групового входу</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>
+        <source>Please add the groups whose members should be allowed to access computers in your iTALC network.</source>
+        <translation>Будь ласка, додайте групи, учасникам яких буде дозволено доступ до комп’ютерів у вашій мережі iTALC.</translation>
     </message>
     <message>
-        <source>The service '%1' is already registered.</source>
-        <translation>Службу '%1' вже було зареєстровано.</translation>
+        <source>All groups</source>
+        <translation>Всі групи</translation>
+    </message>
+    <message>
+        <source>...</source>
+        <translation>...</translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>Службу '%1' неможливо зареєструвати.</translation>
+        <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>The service '%1' was successfully registered.</source>
-        <translation>Службу '%1' було успішно зареєстровано.</translation>
+        <source>General</source>
+        <translation>Загальні</translation>
     </message>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>Службу '%1' неможливо зупинити.</translation>
+        <source>Quit</source>
+        <translation>Вийти</translation>
     </message>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>Реєстрацію служби '%1' було скасовано.</translation>
+        <source>iTALC Management Console</source>
+        <translation>Консоль керування iTALC</translation>
     </message>
     <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>Службу '%1' не було зареєстровано і тому її реєстрацію неможливо скасувати.</translation>
+        <source>iTALC Server</source>
+        <translation>Сервер iTALC</translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>Реєстрацію служби '%1' неможливо скасувати.</translation>
+        <source>Paths</source>
+        <translation>Шляхи</translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>Службу '%1' неможливо знайти.</translation>
+        <source>Authentication</source>
+        <translation>Розпізнавання</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>
+        <source>iTALC Service</source>
+        <translation>Служба iTALC</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>
+        <source>Hide tray icon</source>
+        <translation>Сховати піктограму у лотку</translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL (зауваження для перекладачів: перші три літери рядка є гарячими (підкресленими) літерами трьох полів вводу у діалозі початку роботи у windows - будь ласка, майте це на увазі, оскільки у іншому випадку можливі незрозумілі помилки, пов’язані з початком роботи)</translation>
+        <source>Autostart</source>
+        <translation>Автозапуск</translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation>Знімки екранів iTALC</translation>
+        <source>Additional arguments</source>
+        <translation>Додаткові параметри</translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation>Про програму iTALC</translation>
+        <source>Start service</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Про програму iTALC</span></p></body></html></translation>
+        <source>Stop service</source>
+        <translation>Зупинити службу</translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>Про програму</translation>
+        <source>State:</source>
+        <translation>Стан:</translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>Автори</translation>
+        <source>Stopped</source>
+        <translation>Зупинено</translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>Переклад</translation>
+        <source>Logging</source>
+        <translation>Ведення журналу</translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>Ліцензія</translation>
+        <source>Log file directory</source>
+        <translation>Каталог файла журналу</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>Гаразд</translation>
+        <source>...</source>
+        <translation>...</translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
-        <translation type="unfinished"></translation>
+        <source>Log level</source>
+        <translation>Рівень журналювання</translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Nothing</source>
+        <translation>Нічого не записувати</translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>Керування класами</translation>
+        <source>Only critical messages</source>
+        <translation>Лише критичні повідомлення</translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>Використовуйте цей робочий простір для того, щоб керувати вашими комп’ютерами та класами з легкістю.</translation>
+        <source>Errors and critical messages</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>
+        <source>Warnings and errors</source>
+        <translation>Попередження і помилки</translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>Класи/комп’ютери</translation>
+        <source>Information, warnings and errors</source>
+        <translation>Сповіщення, попередження і помилки</translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>IP-адреса</translation>
+        <source>Debug messages and everything else</source>
+        <translation>Діагностичні повідомлення та все інше</translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>Ховати комп’ютери вчителів</translation>
+        <source>Limit log file size</source>
+        <translation>Обмежити розмір файла журналу</translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>Не знайдено файла налаштувань</translation>
+        <source>MB</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>
+        <source>Clear all log files</source>
+        <translation>Спорожнити всі файли журналу</translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>Поимлка у файлі налаштувань</translation>
+        <source>Desktop capturing</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>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation>Увімкнути захоплення шарів (напівпрозорих) вікон</translation>
     </message>
     <message>
-        <source>Error while parsing configuration-file %1.
-Please edit it. Otherwise you should delete this file.</source>
-        <translation>Помилка під час розбору файла налаштувань %1.
-Будь ласка, змініть його. Якщо ви не можете цього зробити, вам слід вилучити цей файл.</translation>
+        <source>Poll full screen</source>
+        <translation>Запит на весь екран</translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>Показати/сховати</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation>Низька точність (турбо-режим)</translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>Змінити параметри</translation>
+        <source>Demo server</source>
+        <translation>Демосервер</translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>Вилучити</translation>
+        <source>Network</source>
+        <translation>Мережа</translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>Дії</translation>
+        <source>Core server port</source>
+        <translation>Основний порт сервера</translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>Показати всі комп’ютери у класі</translation>
+        <source>Demo server port</source>
+        <translation>Порт демосервера</translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>Сховати всі комп’ютери у класі</translation>
+        <source>Enable firewall exception</source>
+        <translation>Увімкнути виключення брандмауера</translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>Змінити назву</translation>
+        <source>Configuration files</source>
+        <translation>Файли налаштувань</translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>Вилучити клас</translation>
+        <source>Global configuration</source>
+        <translation>Загальне налаштування</translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>Дії для %1</translation>
+        <source>Personal configuration</source>
+        <translation>Особисте налаштування</translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>Додати комп’ютер</translation>
+        <source>Data directories</source>
+        <translation>Каталоги даних</translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>Додати клас</translation>
+        <source>Snapshots</source>
+        <translation>Знімки екрана</translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>Нова назва класу</translation>
+        <source>Authentication methods</source>
+        <translation>Способи розпізнавання</translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>Будь ласка, введіть нову назву для класу "%1".</translation>
+        <source>Access key management</source>
+        <translation>Керування ключами доступу</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>
+        <source>Logon settings</source>
+        <translation>Параметри входу</translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>Відсутній клас</translation>
+        <source>&File</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>
+        <source>&Help</source>
+        <translation>&Довідка</translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>Новий клас</translation>
+        <source>&Quit</source>
+        <translation>Ви&йти</translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>Будь ласка, введіть назву класу, який Ви бажаєте створити.</translation>
+        <source>Ctrl+Q</source>
+        <translation>Ctrl+Q</translation>
     </message>
     <message>
-        <source>Usernames</source>
-        <translation>Імена користувачів</translation>
+        <source>&Save settings into file</source>
+        <translation>&Зберегти параметри до файла</translation>
     </message>
     <message>
-        <source>Show usernames</source>
-        <translation>Показати імена користувачів</translation>
+        <source>Save settings into file</source>
+        <translation>Зберегти параметри до файла</translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
-        <translation>Щоб додати або вилучити комп’ютери і/або класи, скористайтеся контекстним меню (клацання правою кнопкою).</translation>
+        <source>Ctrl+S</source>
+        <translation>Ctrl+S</translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation>Експорт до текстового файла</translation>
+        <source>L&oad settings from 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>
+        <source>Ctrl+O</source>
+        <translation>Ctrl+O</translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation>Вибір файла виводу</translation>
+        <source>About iTALC</source>
+        <translation>Про програму iTALC</translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation>Текстові файли (*.txt)</translation>
+        <source>About Qt</source>
+        <translation>Про Qt</translation>
     </message>
     <message>
-        <source>Actions for selected</source>
-        <translation>Дії для вибраних</translation>
+        <source>MainWindow</source>
+        <translation>Головне вікно</translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>Стан невідомий</translation>
+        <source>toolBar</source>
+        <translation>Панель інструментів</translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>Жоден користувач не почав роботу</translation>
+        <source>iTALC Management Console %1</source>
+        <translation>Консоль керування iTALC %1</translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>Комп’ютер недоступний</translation>
+        <source>Running</source>
+        <translation>Запущено</translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>Виконання демо</translation>
+        <source>Load settings from file</source>
+        <translation>Завантажити параметри з файла</translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>Стільницю заблоковано</translation>
+        <source>XML files (*.xml)</source>
+        <translation>Файли XML (*.xml)</translation>
     </message>
-</context>
-<context>
-    <name>clientAction</name>
     <message>
-        <source>Are you sure want logout all users on all visible computers ?</source>
-        <translation>Ви справді бажаєте завершити роботу всіх користувачів на всіх видимих комп’ютерах?</translation>
+        <source>Save settings to file</source>
+        <translation>Зберегти параметри до файла</translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
-        <translation>Ви справді бажаєте завершити роботу всіх користувачів на всіх вибраних комп’ютерах?</translation>
+        <source>Unsaved settings</source>
+        <translation>Незбережені параметри</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation>Завершити роботу користувача</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation>Деякі з параметрів не збережено. Завершити роботу попри це?</translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation>Ви справді бажаєте перезавантажити всі видимі комп’ютери?</translation>
+        <source>Configuration not writable</source>
+        <translation>Не вдалося записати налаштування</translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
-        <translation>Ви справді бажаєте перезавантажити всі вибрані комп’ютери?</translation>
+        <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>Reboot computers</source>
-        <translation>Перезавантажити комп’ютери</translation>
+        <source>All settings were applied successfully.</source>
+        <translation>Всі значення параметрів успішно застосовано.</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all visible computers?</source>
-        <translation>Ви справді бажаєте вимкнути всі видимі комп’ютери?</translation>
+        <source>An error occured while applying settings!</source>
+        <translation>Під час спроби застосування параметрів сталася помилка!</translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
-        <translation>Ви справді бажаєте вимкнути всі вибрані комп’ютери?</translation>
+        <source>iTALC</source>
+        <translation>iTALC</translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation>Огляд</translation>
+        <source>No write access</source>
+        <translation>Немає доступу на запис</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation>Повноекранне демо</translation>
+        <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>Window demo</source>
-        <translation>Демо у вікні</translation>
+        <source>Classroom</source>
+        <translation>Клас</translation>
     </message>
     <message>
-        <source>Locked display</source>
-        <translation>Заблокований дисплей</translation>
+        <source>Switch classroom</source>
+        <translation>Перемкнути клас</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation>Перегляд наживо</translation>
+        <source>Click this button to open a menu where you can choose the active classroom.</source>
+        <translation>Натисніть на цю кнопку, щоб відкрити меню, у якому ви зможете вибрати активний клас.</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Віддалене керування</translation>
+        <source>Click on this button, to switch between classrooms.</source>
+        <translation>Натисніть цю кнопку, щоб перемикатися між класами.</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation>Дозволити учню показати демо</translation>
+        <source>Overview mode</source>
+        <translation>Режим огляду</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation>Надіслати текстове повідомлення</translation>
+        <source>Overview</source>
+        <translation>Огляд</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation>Почати роботу</translation>
+        <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>Logout user</source>
-        <translation>Завершити роботу</translation>
+        <source>Fullscreen demo</source>
+        <translation>Повноекранне демо</translation>
     </message>
     <message>
-        <source>Take a snapshot</source>
-        <translation>Зробити знімок екрана</translation>
+        <source>Fullscreen Demo</source>
+        <translation>Повноекранне демо</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation>Увімкнути</translation>
+        <source>Stop Demo</source>
+        <translation>Завершити демонстрацію</translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation>Перезавантажити</translation>
+        <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>Power down</source>
-        <translation>Вимкнути</translation>
+        <source>Window demo</source>
+        <translation>Демо у вікні</translation>
     </message>
     <message>
-        <source>Execute commands</source>
-        <translation>Виконати команди</translation>
+        <source>Window Demo</source>
+        <translation>Демо у вікні</translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>Параметри клієнта</translation>
+        <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><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:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">Параметри клієнта</span></p></body></html></translation>
+        <source>Lock/unlock desktops</source>
+        <translation>Заблокувати/Розблокувати стільниці</translation>
     </message>
     <message>
-        <source>General</source>
-        <translation>Загальні</translation>
+        <source>Lock all</source>
+        <translation>Заблокувати всі</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>Тип</translation>
+        <source>Unlock all</source>
+        <translation>Розблокувати всі</translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>Комп’ютер учня</translation>
+        <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>Teacher computer</source>
-        <translation>Комп’ютер вчителя</translation>
+        <source>Send text message</source>
+        <translation>Надіслати текстове повідомлення</translation>
     </message>
     <message>
-        <source>Other/undefined computer</source>
-        <translation>Інший/невизначений комп’ютер</translation>
+        <source>Text message</source>
+        <translation>Текстове повідомлення</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation>Клас</translation>
+        <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>MAC-address</source>
-        <translation>MAC-адреса</translation>
+        <source>Power on computers</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;">enter an IP-address or hostname under which iTALC can reach the client (use ':' for specifying an optional port-number)</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;">Введіть IP-адресу або ім’я комп’ютера, за яким iTALC зможе отримати доступ до клієнта (використовуйте ':', щоб додатково задати номер порту)</p></body></html></translation>
+        <source>Power on</source>
+        <translation>Увімкнути</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>IP/ім’я комп’ютера</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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></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;">Апаратна/MAC-адреса клієнта - використовується лише для вмикання клієнта</p></body></html></translation>
+        <source>Power down computers</source>
+        <translation>Вимкнути комп’ютери</translation>
     </message>
     <message>
-        <source>Name</source>
-        <translation>Назва</translation>
+        <source>Power down</source>
+        <translation>Вимкнути</translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <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>Connection</source>
-        <translation>З’єднання</translation>
+        <source>Support</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;">connection to hosts on the same level</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>
+        <source>Direct support</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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">Тут Ви можете задати яким чином цей комп’ютер з’єднано з мережею iTALC, тобто комп’ютерами того ж рівня. Зазвичай клієнти з’єднано за допомогою локальної мережі зі швидкістю 100 Мбіт/с, але можливі випадки коли якийсь з комп’ютерів є шлюзом до інших мереж iTALC у інших школах або домашнім комп’ютером учня. У таких випадках iTALC намагається оптимізувати використання з’єднання.</p></body></html></translation>
+        <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>Analog</source>
-        <translation>Аналогове</translation>
+        <source>Adjust/align</source>
+        <translation>Підібрати/Вирівняти</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Adjust windows and their size</source>
+        <translation>Підібрати розмір вікон та їх розташування</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 Кбіт/с</translation>
+        <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>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 Кбіт/с</translation>
+        <source>Auto view</source>
+        <translation>Автовигляд</translation>
     </message>
     <message>
-        <source>100 MBit/s LAN</source>
-        <translation>100 Мбіт/с LAN</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation>Автоматично перевпорядкувати вікна та підібрати їх розмір</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 Мбіт/с LAN</translation>
+        <source>When clicking this button all visible windows are re-arranged and adjusted.</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 if the host is the gateway for the subnet.</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>
+        <source>iTALC Master Control</source>
+        <translation>Головне керування iTALC</translation>
     </message>
     <message>
-        <source>Host is &gateway for subnet</source>
-        <translation>Комп’ютер-&шлюз для підмережі</translation>
+        <source>Remote control</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;">Activate this option for at least one host in a subnet.</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>
+        <source>Could not modify the autostart property for the iTALC Service.</source>
+        <translation>Не вдалося змінити параметр автоматичного запуску служби iTALC.</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation>Не вдалося змінити параметри служби iTALC.</translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>Працювати у якості відтворювача &демо</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation>Не вдалося змінити налаштування брандмауера для служби iTALC.</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&Гаразд</translation>
+        <source>Debugging</source>
+        <translation>Діагностика</translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>&Скасувати</translation>
+        <source>Enable desktop switching for screen lock (experimental)</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></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;">Додатковий псевдонім вузла, який показуватиме iTALC.</p></body></html></translation>
+        <source>Log to standard error output</source>
+        <translation>Виводити повідомлення до стандартного виводу помилок</translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>Відсутня IP-адреса/ім’я комп’ютера</translation>
+        <source>Log to Windows event log</source>
+        <translation>Вести журнал у журналі подій Windows</translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>Ви не визначили IP-адреси або імені комп’ютера!</translation>
+        <source>Backend</source>
+        <translation>Сервер</translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>Некоректна MAC-адреса</translation>
+        <source>VNC reflector</source>
+        <translation>VNC reflector</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>
+        <source>iTALC 1 demo server</source>
+        <translation>Демосервер iTALC 1</translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>Виконати команди на клієнті(ах)</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation>Обробка у декілька потоків (можна скористатися, якщо використано сервер VNC reflector)</translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>Введіть команди, які слід виконати на клієнті(ах):</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation>Увімкнути HTTP-сервер, який надає доступ до аплету JavaViewer</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Скасувати</translation>
+        <source>HTTP server port</source>
+        <translation>Порт HTTP-сервера</translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>&Виконати!</translation>
+        <source>Allow connections from localhost only</source>
+        <translation>Дозволити з’єднання лише з локального вузла</translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>Період між оновленнями</translation>
+        <source>Key file authentication</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 network-traffic and lower CPU-usage on this computer.</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>
+        <source>ACL-based logon authentication</source>
+        <translation>Розпізнавання під час входу на основі ACL</translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 секунда</translation>
+        <source>Public key file base directory</source>
+        <translation>Основний каталог файлів відкритих ключів</translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> секунд</translation>
+        <source>Private key file base directory</source>
+        <translation>Основний каталог файлів закритих ключів</translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>Якість режиму демо</translation>
+        <source>Launch key file assistant</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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>
+        <source>Manage permissions</source>
+        <translation>Керування правами доступу</translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>Низька (15 бітів)</translation>
+        <source>Test</source>
+        <translation>Перевірити</translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>Середня (18 бітів)</translation>
+        <source>Access confirmation</source>
+        <translation>Підтвердження доступу</translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>Висока (24 біти)</translation>
+        <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>User interface</source>
-        <translation>Інтерфейс користувача</translation>
+        <source>Logon authentication</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>
+        <source>Allow same user to access desktop without confirmation</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 mouse-cursor over 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>
+        <source>Debugging iTALC</source>
+        <translation>Діагностика iTALC</translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>Без виринаючих підказок</translation>
+        <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>Your role (needs according keys!)</source>
-        <translation>Ваша роль (потрібні відповідні ключі!)</translation>
+        <source>1)</source>
+        <translation>1)</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>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation>Спорожніть файли журналів у розділі «Загальні».</translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>Вчитель</translation>
+        <source>2)</source>
+        <translation>2)</translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>Адміністратор</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation>У розділі «Загальні» встановіть рівень ведення журналу у значення «Діагностичні повідомлення та все інше».</translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>Супровідник</translation>
+        <source>3)</source>
+        <translation>3)</translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>Інша</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation>Повторіть послідовність дій, яка призвела до проблеми або некоректної поведінки.</translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>Параметри для одночасного входження</translation>
+        <source>4)</source>
+        <translation>4)</translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>Домен</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation>Натисніть наведену нижче кнопку і збережіть файл до якоїсь з ваших тек.</translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>Дія за подвійним клацанням на вікні клієнта</translation>
+        <source>Generate bug report archive</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>
+        <source>5)</source>
+        <translation>5)</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>Віддалене керування</translation>
+        <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>View live in fullscreen</source>
-        <translation>Перегляд наживо на весь екран</translation>
+        <source>Restart iTALC Service</source>
+        <translation>Перезапуск служби iTALC</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">Будь ласка, зауважте, що деякі зміни не набудуть чинності, доки ви не перезапустите iTALC.</span></p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>Starting iTALC service</source>
+        <translation>Запуск служби iTALC</translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
-        <translation>Без тексту на кнопках інструментів</translation>
+        <source>Stopping iTALC service</source>
+        <translation>Зупиняється служба iTALC</translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>Ваші налаштування iTALC</translation>
+        <source>The iTALC service needs to be stopped temporarily in order to remove the log files. Continue?</source>
+        <translation>З метою вилучення файлів журналу роботу служби iTALC слід тимчасово зупинити. Зробити це?</translation>
     </message>
     <message>
-        <source>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>У цьому робочому просторі ви можете налаштувати iTALC для ваших потреб.</translation>
+        <source>Log files cleared</source>
+        <translation>Файли журналу вилучено</translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>Демо iTALC</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation>Всі файли журналу було успішно вилучено.</translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
-        <translation>Помилка сервера ISD</translation>
+        <source>Error</source>
+        <translation>Помилка</translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>Сервер ISD неможливо запустити, оскільки порт %1 вже використовується. Будь ласка, переконайтеся, що жодна інша програма не використовує цей порт і спробуйте ще раз.</translation>
+        <source>Could not remove all log files.</source>
+        <translation>Не вдалося вилучити всі файли журналу.</translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>Підтвердження доступу</translation>
+        <source>Logon authentication test</source>
+        <translation>Перевірка розпізнавання під час входу</translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>Хтось за комп’ютером %1 намагається отримати доступ до зображення з вашого екрана. Чи бажаєте ви надати йому або їй такий доступ?</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation>Розпізнавання за вказаними реєстраційними даними пройдено.</translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>Ніколи протягом цього сеансу</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation>Не вдалося пройти розпізнавання за вказаними реєстраційними даними!</translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>Завжди протягом цього сеансу</translation>
+        <source>Save bug report archive</source>
+        <translation>Зберегти архів звіту щодо вади</translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>Повідомлення від вчителя</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation>Архів звіту щодо вади iTALC (*.ibra.xml)</translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>Помилка автентифікації</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation>Архів звіту щодо вади iTALC збережено</translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>Хтось (IP: %1) намагався отримати доступ до цього комп’ютера, але не зміг пройти автентифікацію!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>Знімок екрана</translation>
+        <source>Could not contact iTALC service</source>
+        <translation>Не вдалося встановити зв’язок зі службою iTALC</translation>
     </message>
     <message>
-        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
-        <translation>Неможливо зробити знімок екрана, оскільки каталогу %1 не існує або його не вдалося створити.</translation>
+        <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>unknown</source>
-        <translation type="unfinished"></translation>
+        <source>Authentication impossible</source>
+        <translation>Розпізнавання неможливе</translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
-        <translation>блокування екрана</translation>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>Гаразд</translation>
+        <source>Message from teacher</source>
+        <translation>Повідомлення від вчителя</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <name>Overview</name>
     <message>
         <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
 p, li { white-space: pre-wrap; }
@@ -1019,8 +1434,12 @@ p, li { white-space: pre-wrap; }
         <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>
+        <translation>Робочий простір знімків екрана є дуже корисним інструментом. Він надає змогу керувати зробленими вами знімками екрана.</translation>
     </message>
     <message>
         <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
@@ -1030,119 +1449,101 @@ p, li { white-space: pre-wrap; }
         <source>About iTALC</source>
         <translation>Про програму iTALC</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>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <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>
+        <translation>Деякі основна відомості про iTALC і його використання.</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
-        <translation>iTALC готовий до запуску!</translation>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
+        <translation>Будь ласка, вкажіть ваше ім’я користувача та пароль, щоб отримати доступ до клієнтів iTALC.</translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation>Встановлення iTALC повністю завершено, програму налаштовано. Якщо вами було встановлено основну програму, тепер її можна запустити.</translation>
+        <source>Username</source>
+        <translation>Ім’я користувача</translation>
+    </message>
+    <message>
+        <source>Password</source>
+        <translation>Пароль</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation>Зберегти ключові параметри налаштування</translation>
+        <source>iTALC Logon</source>
+        <translation>Вхід до iTALC</translation>
     </message>
 </context>
 <context>
-    <name>pageKeyDirs</name>
-    <message>
-        <source>Key directories</source>
-        <translation>Каталоги ключів</translation>
-    </message>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>Створені або імпортовані ключі слід десь зберігати. Рекомендується залишити запропоновані теки без змін.</translation>
+        <source>iTALC Client %1 on %2:%3</source>
+        <translation>Клієнт iTALC %1 на %2:%3</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>Тека для зберігання публічного ключа</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>Не вдалося зареєструвати службу '%1'.</translation>
     </message>
     <message>
-        <source>Directory to store private key in</source>
-        <translation>Тека для зберігання особистого ключа</translation>
+        <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>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation>Ви можете вибрати каталог, до якого буде експортовано відкритий ключ, наприклад каталог на USB-диску або мережевому ресурсі спільного використання.</translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>Службу '%1' вже було зареєстровано.</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>Експортувати також особистий ключ</translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>Службу '%1' неможливо зареєструвати.</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation>Параметри безпеки</translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>Службу '%1' було успішно зареєстровано.</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation>У iTALC передбачено складну систему запобігання неуповноваженому доступу до комп’ютерів зі встановленою клієнтською частиною iTALC.
-
-Саме тому вам слід або створити нову пару ключів, або імпортувати відкритий ключ, створений на основному комп’ютері iTALC прід час встановлення.</translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>Службу '%1' неможливо зупинити.</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation>Створити нову пару ключів (лише на основному комп’ютері)</translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>Реєстрацію служби '%1' було скасовано.</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>Імпортувати публічний ключ головного комп’ютера</translation>
+        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
+        <translation>Службу '%1' не було зареєстровано і тому її реєстрацію неможливо скасувати.</translation>
     </message>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>Оберіть розташування експортованого публічного ключа:</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>Реєстрацію служби '%1' неможливо скасувати.</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>Зберегти всі ключі (тільки якщо ви оновлюєте програму!)</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>Службу '%1' неможливо знайти.</translation>
     </message>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation>Вітаємо у iTALC</translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
-        <translation>За допомогою цієї програми ви зможете налаштувати ключі розпізнавання для вашого середовища iTALC.
-
-Щоб продовжити роботу, натисніть кнопку «Далі».</translation>
+        <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>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>Перегляд наживо (%1 на комп’ютері %2)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation>Перегляд наживо (%1 @ %2)</translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>Віддалене керування (%1 на комп’ютері %2)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation>Віддалене керування (%1 @ %2)</translation>
     </message>
     <message>
         <source>unknown user</source>
@@ -1150,10 +1551,10 @@ Click 'Next' to continue.</source>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation>Тільки перегляд</translation>
+        <translation>Лише перегляд</translation>
     </message>
     <message>
         <source>Remote control</source>
@@ -1165,7 +1566,7 @@ Click 'Next' to continue.</source>
     </message>
     <message>
         <source>Unlock student</source>
-        <translation>Розблокувати учні</translation>
+        <translation>Розблокувати учня</translation>
     </message>
     <message>
         <source>Snapshot</source>
@@ -1193,24 +1594,14 @@ Click 'Next' to continue.</source>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
-    <message>
-        <source>Remote Logon</source>
-        <translation>Віддалений початок роботи</translation>
-    </message>
+    <name>RemoteLogonDialog</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:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">Віддалений початок роботи</span></p></body></html></translation>
+        <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>
+        <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>
@@ -1224,97 +1615,46 @@ p, li { white-space: pre-wrap; }
         <source>Domain</source>
         <translation>Домен</translation>
     </message>
-    <message>
-        <source>&OK</source>
-        <translation>&Гаразд</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>Скасувати</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
-    </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>Підтвердження перезапису</translation>
-    </message>
-    <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>Ви бажаєте перезаписати %1?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>Скасувати встановлення</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation>Ви справді бажаєте завершити роботу програми налаштування? Налаштування iTALC ще не завершено!</translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>Далі</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>Завершити</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>Вийти</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>File does not exist</source>
-        <translation>Файла не існує</translation>
+        <source>Run commands</source>
+        <translation>Виконання команд</translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
-        <translation>Не вдалося знайти файл %1. Будь ласка, виправте помилку, а потім повторіть спробу.</translation>
+        <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>setupWizardPageKeyDirs</name>
+    <name>Snapshot</name>
     <message>
-        <source>Choose public key directory</source>
-        <translation>Вибір теки публічного ключа</translation>
-    </message>
-    <message>
-        <source>Choose private key directory</source>
-        <translation>Вибір теки особистого ключа</translation>
+        <source>unknown</source>
+        <translation>невідомо</translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>Вибір теки експорту публічного ключа</translation>
+        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
+        <translation>Не вдалося зробити знімок екрана, оскільки теки %1 не існує або її неможливо створити.</translation>
     </message>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation>Виберіть каталог для імпорту ключа</translation>
+        <source>Snapshot</source>
+        <translation>Знімок екрана</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>Знімки екранів</translation>
+        <translation>Знімки екрана</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>Ви можете легко керувати зробленими вами знімками екранів за допомогою цього робочого простору.</translation>
+        <translation>Ви можете легко керувати зробленими вами знімками екрана за допомогою цього робочого простору.</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <name>Snapshots</name>
     <message>
         <source><html><head><meta name="qrichtext" content="1" /><style type="text/css">
 p, li { white-space: pre-wrap; }
@@ -1323,7 +1663,7 @@ p, li { white-space: pre-wrap; }
         <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>
+<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>
@@ -1342,96 +1682,100 @@ p, li { white-space: pre-wrap; }
         <translation>Час:</translation>
     </message>
     <message>
-        <source>Show snapshot</source>
-        <translation>Показати знімок</translation>
+        <source>Show</source>
+        <translation>Показати</translation>
     </message>
     <message>
-        <source>Delete snapshot</source>
-        <translation>Вилучити знімок</translation>
-    </message>
-    <message>
-        <source>Reload list</source>
-        <translation>Перезавантажти список</translation>
+        <source>Delete</source>
+        <translation>Вилучити</translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
         <translation>Супровід</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>Будь ласка, введіть IP-адресу або ім’я комп’ютера, за яким сидить особа, дії якої Ви бажаєте супроводжувати.</translation>
+        <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>OK</source>
-        <translation>Гаразд</translation>
+        <source>Send text message</source>
+        <translation>Надіслати текстове повідомлення</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Скасувати</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Супровід </span></p></body></html></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation>Встановлення зв’язку з %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>Надіслати текстове повідомлення</translation>
+        <source>Overview</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Надіслати текстове повідомлення</span></p></body></html></translation>
+        <source>Fullscreen demo</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>
+        <source>Window demo</source>
+        <translation>Демо у вікні</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>&Гаразд</translation>
+        <source>Locked display</source>
+        <translation>Заблокований дисплей</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>View live</source>
+        <translation>Перегляд наживо</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>Скасувати</translation>
+        <source>Remote control</source>
+        <translation>Віддалене керування</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation>Дозволити учню показати демо</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>Встановлення зв’язку з %1 ...</translation>
+        <source>Send text message</source>
+        <translation>Надіслати текстове повідомлення</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation>Програма налаштування iTALC</translation>
+        <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>Cancel</source>
-        <translation>Скасувати</translation>
+        <source>Reboot</source>
+        <translation>Перезавантажити</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>Назад</translation>
+        <source>Power down</source>
+        <translation>Вимкнути</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>Далі</translation>
+        <source>Execute commands</source>
+        <translation>Виконати команди</translation>
     </message>
 </context>
 </TS>
diff --git a/lib/resources/zh_cn.qm b/lib/resources/zh_cn.qm
index 90fa080..d702f79 100644
Binary files a/lib/resources/zh_cn.qm and b/lib/resources/zh_cn.qm differ
diff --git a/lib/resources/zh_cn.ts b/lib/resources/zh_cn.ts
index 101f402..6c00785 100644
--- a/lib/resources/zh_cn.ts
+++ b/lib/resources/zh_cn.ts
@@ -2,1432 +2,1767 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="zh_CN">
 <context>
-    <name>MainToolBar</name>
+    <name>AboutDialog</name>
+    <message>
+        <source>About iTALC</source>
+        <translation type="unfinished">关于 iTALC</translation>
+    </message>
+    <message>
+        <source>About</source>
+        <translation type="unfinished">关于</translation>
+    </message>
+    <message utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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-2011 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>
-</context>
-<context>
-    <name>MainWindow</name>
     <message>
-        <source>MainWindow</source>
-        <translation type="unfinished"></translation>
+        <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 ':' for specifying an optional port-number)</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;">输入一个 iTALC 可到达客户端的IP地址或主机名(用':'指定可选的端口号)</p></body></html></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></source>
+        <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></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;">客户端的硬件/MAC地址 - 只有在需要远程开机的客户端上使用</p></body></html></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 network-traffic and lower CPU-usage on this computer.</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;">在这你可以设置客户端的更新间隔时间。数值越高网络传输越低,这台计算机的CPU占用越低。</p></body></html></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"><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 mouse-cursor over 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>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>toolBar</source>
-        <translation type="unfinished"></translation>
+        <source>View live in fullscreen</source>
+        <translation type="unfinished">全屏现场直播</translation>
     </message>
     <message>
-        <source>iTALC</source>
-        <translation type="unfinished">iTALC</translation>
+        <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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">请注意,某些改变不能立即生效,需要重启 iTALC 。</span></p></body></html></translation>
     </message>
+</context>
+<context>
+    <name>ConfigWidget</name>
     <message>
-        <source>No write-access</source>
-        <translation type="unfinished">非写访问</translation>
+        <source>Your iTALC-configuration</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 !为了运行 iTALC ,请确认你有创建或写该目录的权限。</translation>
+        <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>Classroom</source>
-        <translation type="unfinished">班级</translation>
+        <source>OK</source>
+        <translation type="unfinished">确定</translation>
     </message>
+</context>
+<context>
+    <name>DemoClient</name>
     <message>
-        <source>Switch classroom</source>
-        <translation type="unfinished">切换班级</translation>
+        <source>iTALC Demo</source>
+        <translation type="unfinished">iTALC 演示</translation>
     </message>
+</context>
+<context>
+    <name>ItalcCoreServer</name>
     <message>
-        <source>Click this button to open a menu where you can choose the active classroom.</source>
-        <translation type="unfinished">点击按钮在菜单中选择要激活的班级。</translation>
+        <source>Authentication error</source>
+        <translation type="unfinished">验证错误</translation>
     </message>
     <message>
-        <source>Click on this button, to switch between classrooms.</source>
-        <translation type="unfinished">点击按钮,切换班级。</translation>
+        <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>Overview mode</source>
-        <translation type="unfinished">概览模式</translation>
+        <source>VNC authentication failed because of too many authentication tries.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">概览</translation>
+        <source>VNC authentication failed.</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>
+        <source>VNC server closed connection.</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>KeyFileAssistant</name>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">全屏演示</translation>
+        <source>iTALC Access Key Assistant</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Fullscreen Demo</source>
+        <source>Create/import iTALC access keys</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Stop Demo</source>
+        <source>This assistant will help you to create or import iTALC access keys.</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>
+        <source>How does it work?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">窗口演示</translation>
+        <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>Window Demo</source>
+        <source>Assistant mode</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>
+        <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>Lock/unlock desktops</source>
-        <translation type="unfinished">锁定/解锁桌面</translation>
+        <source>Create new access keys (master computer)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Lock all</source>
-        <translation type="unfinished">全部锁定</translation>
+        <source>assistantModeButtonGroup</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Unlock all</source>
-        <translation type="unfinished">全部解锁</translation>
+        <source>Import public key (client computer)</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>
+        <source>Select user role</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">发送文字消息</translation>
+        <source>Please select a user role for which to create or import the access keys:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text message</source>
-        <translation type="unfinished">文字消息</translation>
+        <source>Teacher</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>
+        <source>Administrator</source>
+        <translation type="unfinished">管理员</translation>
     </message>
     <message>
-        <source>Power on computers</source>
-        <translation type="unfinished">开启计算机</translation>
+        <source>Support team member</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">开机</translation>
+        <source>Other</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>
+        <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>Power down computers</source>
-        <translation type="unfinished">关闭计算机</translation>
+        <source>Directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">关机</translation>
+        <source>Export public key part (master computer)</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>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logon</source>
-        <translation type="unfinished">登录</translation>
+        <source>Use custom destination directory for access keys</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote logon</source>
-        <translation type="unfinished">远程登录</translation>
+        <source>Please specify the location of the public access key to be imported.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>After clicking this button you can enter a username and password to log on the according user on all visible computers.</source>
-        <translation type="unfinished">点击这个按钮后你可以输入用户名和密码登录所有可见的计算机。</translation>
+        <source>Summary</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Support</source>
-        <translation type="unfinished">协助</translation>
+        <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>Direct support</source>
+        <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>If you need to support someone at a certain computer you can click this button and enter the according hostname or IP afterwards.</source>
+        <source>Select directory in which to export the public key</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust/align</source>
-        <translation type="unfinished">调整/对齐</translation>
+        <source>Key files (*.key.txt)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Adjust windows and their size</source>
-        <translation type="unfinished">调整窗口和它们的大小</translation>
+        <source>Invalid public key</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>
+        <source>The selected file does not contain a valid public iTALC access key!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto view</source>
-        <translation type="unfinished">自动视图</translation>
+        <source>Select destination directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Auto re-arrange windows and their size</source>
-        <translation type="unfinished">自动重新排列窗口和调整大小</translation>
+        <source>Access key creation</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>
+        <source>Could not remove previously existing file %1.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No valid keys found</source>
-        <translation type="unfinished">未找到有效的密钥</translation>
+        <source>Failed exporting public access key from %1 to %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No authentication-keys were found or your old ones were broken. Please create a new key-pair using ICA (see documentation at http://italc.sf.net/wiki/index.php?title=Installation).
-Otherwise you won't be able to access computers using iTALC.</source>
-        <translation type="unfinished">未找到验证密钥或者旧密钥被损坏。请用 ICA 创建一个新的密钥对(查看文档 http://italc.sf.net/wiki/index.php?title=Installation)
-否则,你将不能使用 iTALC 访问计算机。</translation>
+        <source>Access keys were created and written successfully to %1 and %2.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC service not running</source>
-        <translation type="unfinished">iTALC 服务未运行</translation>
+        <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>There seems to be no iTALC service running on this computer or the authentication-keys aren't set up properly. The service is required for running iTALC. Contact your administrator for solving this problem.</source>
-        <translation type="unfinished">似乎在这台计算机上没有运行 iTALC 服务或者验证密钥设置不正确。该服务是运行 iTALC 所必需的。联系你的管理员解决这个问题。</translation>
+        <source>Public key import</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC Master Control</source>
+        <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>Remote control</source>
-        <translation type="unfinished">远程控制</translation>
+        <source>The public key was successfully imported to %1.</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>LockWidget</name>
     <message>
-        <source>Quit</source>
-        <translation type="unfinished">退出</translation>
+        <source>screen lock</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>QApplication</name>
+    <name>LogonGroupEditor</name>
     <message>
-        <source>Unable to register service '%1'.</source>
-        <translation>不能注册服务 '%1'。</translation>
+        <source>Logon group editor</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>无法连接 Service Control Manager(您是否拥有所需的权限?)-服务 '%1' 未被注册。</translation>
+        <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>The service '%1' is already registered.</source>
-        <translation>服务 '%1' 已经注册。</translation>
+        <source>All groups</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be registered.</source>
-        <translation>服务 '%1' 未能注册。</translation>
+        <source>...</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' was successfully registered.</source>
-        <translation>服务 '%1' 注册成功。</translation>
+        <source>Groups with iTALC privileges</source>
+        <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>MainToolBar</name>
     <message>
-        <source>The service '%1' could not be stopped.</source>
-        <translation>服务 '%1' 不能停止。</translation>
+        <source>Actions</source>
+        <translation type="unfinished">动作</translation>
     </message>
+</context>
+<context>
+    <name>MainWindow</name>
     <message>
-        <source>The service '%1' has been unregistered.</source>
-        <translation>服务 '%1' 已取消注册。</translation>
+        <source>General</source>
+        <translation type="unfinished">常规</translation>
     </message>
     <message>
-        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
-        <translation>服务 '%1' 未注册,因此不能被取消注册。</translation>
+        <source>Quit</source>
+        <translation type="unfinished">退出</translation>
     </message>
     <message>
-        <source>The service '%1' could not be unregistered.</source>
-        <translation>服务 '%1' 不能被取消注册。</translation>
+        <source>iTALC Management Console</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The service '%1' could not be found.</source>
-        <translation>服务 '%1' 未发现。</translation>
+        <source>iTALC Server</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>无法连接 Service Control Manager(您是否拥有所需的权限?)-服务 '%1' 未能被取消注册。</translation>
+        <source>Paths</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>无法连接 Service Control Manager(您是否拥有所需的权限?)-服务 '%1' 不能停止。</translation>
+        <source>Authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC Client %1 on %2:%3</source>
+        <source>iTALC Service</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>QObject</name>
     <message>
-        <source>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</source>
-        <translation>UPL (note for translators: the first three characters of this string are the accellerators (underlined characters) of the three input-fields in logon-dialog of windows - please keep this note as otherwise there are strange errors concerning logon-feature)</translation>
+        <source>Hide tray icon</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC-snapshots</source>
-        <translation type="unfinished">iTALC å¿«ç…§</translation>
+        <source>Autostart</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>about</name>
     <message>
-        <source>About iTALC</source>
-        <translation>关于 iTALC</translation>
+        <source>Additional arguments</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:20pt; font-weight:600; font-style:italic;">About iTALC</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">关于 iTALC</span></p></body></html></translation>
+        <source>Start service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>About</source>
-        <translation>关于</translation>
+        <source>Stop service</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authors</source>
-        <translation>作者</translation>
+        <source>State:</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Translation</source>
-        <translation>翻译</translation>
+        <source>Stopped</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>License</source>
-        <translation>许可</translation>
+        <source>Logging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>确定</translation>
+        <source>Log file directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC - Intelligent Teaching And Learning with Computers
-
-Copyright (c) 2004-2010 Tobias Doerffel</source>
+        <source>...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Linux Biolinum O'; font-size:12pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">Current language not translated yet (or native English).</span></p>
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:9pt;">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!</span></p></body></html></source>
+        <source>Log level</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>classroomManager</name>
     <message>
-        <source>Classroom-Manager</source>
-        <translation>班级管理</translation>
+        <source>Nothing</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use this workspace to manage your computers and classrooms in an easy way.</source>
-        <translation>使用这个工作空间简便地管理计算机和班级。</translation>
+        <source>Only critical messages</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>这是管理计算机和班级的地方。你可以通过点击鼠标右键在列表中添加计算机或班级。</translation>
+        <source>Errors and critical messages</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Classrooms/computers</source>
-        <translation>班级/计算机</translation>
+        <source>Warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>IP-address</source>
-        <translation>IP地址</translation>
+        <source>Information, warnings and errors</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide teacher computers</source>
-        <translation>隐藏教师计算机</translation>
+        <source>Debug messages and everything else</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No configuration-file found</source>
-        <translation>配置文件没找到</translation>
+        <source>Limit log file size</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>不能打开配置文件 %1 。
-你必须在班级管理中至少添加一个班级和计算机。班级管理在程序的左侧栏中。</translation>
+        <source>MB</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Error in configuration-file</source>
-        <translation>错误在配置文件中</translation>
+        <source>Clear all log files</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>分析配置文件 %1 时出错。
-请编辑它。否则,你将不得不删除该文件并重新添加所有的班级和计算机。</translation>
+        <source>Desktop capturing</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>分析配置文件 %1 时出错。
-请编辑它。否则,你将不得不删除该文件。</translation>
+        <source>Enable capturing of layered (semi-transparent) windows</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show/hide</source>
-        <translation>显示/隐藏</translation>
+        <source>Poll full screen</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit settings</source>
-        <translation>编辑设置</translation>
+        <source>Low accuracy (turbo mode)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove</source>
-        <translation>删除</translation>
+        <source>Demo server</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions</source>
-        <translation>动作</translation>
+        <source>Network</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show all computers in classroom</source>
-        <translation>显示班级中的全部计算机</translation>
+        <source>Core server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Hide all computers in classroom</source>
-        <translation>隐藏班级中的全部计算机</translation>
+        <source>Demo server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Edit name</source>
-        <translation>编辑名称</translation>
+        <source>Enable firewall exception</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remove classroom</source>
-        <translation>删除班级</translation>
+        <source>Configuration files</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Actions for %1</source>
-        <translation>%1 动作</translation>
+        <source>Global configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add computer</source>
-        <translation>添加计算机</translation>
+        <source>Personal configuration</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Add classroom</source>
-        <translation>添加班级</translation>
+        <source>Data directories</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New name for classroom</source>
-        <translation>班级新名称</translation>
+        <source>Snapshots</source>
+        <translation type="unfinished">å¿«ç…§</translation>
     </message>
     <message>
-        <source>Please enter a new name for classroom "%1".</source>
-        <translation>请为班级 "%1" 输入一个新名称。</translation>
+        <source>Authentication methods</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>你确定要删除班级 "%1" 吗?
-该班级中的所有计算机也将被删除!</translation>
+        <source>Access key management</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Missing classroom</source>
-        <translation>缺少班级</translation>
+        <source>Logon settings</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>在添加计算机之前你必须至少创建一个班级。
-你现在要创建新班级吗?</translation>
+        <source>&File</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>New classroom</source>
-        <translation>新班级</translation>
+        <source>&Help</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Please enter the name of the classroom you want to create.</source>
-        <translation>请输入要创建班级的名称。</translation>
+        <source>&Quit</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Usernames</source>
+        <source>Ctrl+Q</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Show usernames</source>
+        <source>&Save settings into file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Use the context-menu (right mouse-button) to add/remove computers and/or classrooms.</source>
+        <source>Save settings into file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Export to text-file</source>
-        <translation type="unfinished">导出到文本文件</translation>
+        <source>Ctrl+S</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>
+        <source>L&oad settings from file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Select output-file</source>
-        <translation type="unfinished">选择输出文件</translation>
+        <source>Ctrl+O</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Text files (*.txt)</source>
-        <translation type="unfinished">文本文件(*.txt)</translation>
+        <source>About iTALC</source>
+        <translation type="unfinished">关于 iTALC</translation>
     </message>
     <message>
-        <source>Actions for selected</source>
+        <source>About Qt</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>client</name>
     <message>
-        <source>Unknown state</source>
-        <translation>未知状态</translation>
+        <source>MainWindow</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No user logged in</source>
-        <translation>无用户登录</translation>
+        <source>toolBar</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host unreachable</source>
-        <translation>主机不可到达</translation>
+        <source>iTALC Management Console %1</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Demo running</source>
-        <translation>演示进行中</translation>
+        <source>Running</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Desktop locked</source>
-        <translation>桌面锁定</translation>
+        <source>Load settings from file</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>
+        <source>XML files (*.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want logout all users on all selected computers ?</source>
+        <source>Save settings to file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">用户登出</translation>
+        <source>Unsaved settings</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all visible computers?</source>
-        <translation type="unfinished">你确定要重新启动全部可见的计算机吗?</translation>
+        <source>There are unsaved settings. Quit anyway?</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to reboot all selected computers?</source>
+        <source>Configuration not writable</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot computers</source>
-        <translation type="unfinished">重新启动计算机</translation>
+        <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>Are you sure want to power down all visible computers?</source>
-        <translation type="unfinished">你确定要关闭全部可见的计算机吗?</translation>
+        <source>All settings were applied successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Are you sure want to power down all selected computers?</source>
+        <source>An error occured while applying settings!</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientMenu</name>
     <message>
-        <source>Overview</source>
-        <translation type="unfinished">概览</translation>
+        <source>iTALC</source>
+        <translation type="unfinished">iTALC</translation>
     </message>
     <message>
-        <source>Fullscreen demo</source>
-        <translation type="unfinished">全屏演示</translation>
+        <source>No write access</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Window demo</source>
-        <translation type="unfinished">窗口演示</translation>
+        <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>Locked display</source>
-        <translation type="unfinished">锁定显示</translation>
+        <source>Classroom</source>
+        <translation type="unfinished">班级</translation>
     </message>
     <message>
-        <source>View live</source>
-        <translation type="unfinished">现场直播</translation>
+        <source>Switch classroom</source>
+        <translation type="unfinished">切换班级</translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation type="unfinished">远程控制</translation>
+        <source>Click this button to open a menu where you can choose the active classroom.</source>
+        <translation type="unfinished">点击按钮在菜单中选择要激活的班级。</translation>
     </message>
     <message>
-        <source>Let student show demo</source>
-        <translation type="unfinished">展示学生演示</translation>
+        <source>Click on this button, to switch between classrooms.</source>
+        <translation type="unfinished">点击按钮,切换班级。</translation>
     </message>
     <message>
-        <source>Send text message</source>
-        <translation type="unfinished">发送文字消息</translation>
+        <source>Overview mode</source>
+        <translation type="unfinished">概览模式</translation>
     </message>
     <message>
-        <source>Logon user</source>
-        <translation type="unfinished">用户登录</translation>
+        <source>Overview</source>
+        <translation type="unfinished">概览</translation>
     </message>
     <message>
-        <source>Logout user</source>
-        <translation type="unfinished">用户登出</translation>
+        <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>Take a snapshot</source>
-        <translation type="unfinished">拍张快照</translation>
+        <source>Fullscreen demo</source>
+        <translation type="unfinished">全屏演示</translation>
     </message>
     <message>
-        <source>Power on</source>
-        <translation type="unfinished">开机</translation>
+        <source>Fullscreen Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reboot</source>
-        <translation type="unfinished">重启</translation>
+        <source>Stop Demo</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Power down</source>
-        <translation type="unfinished">关机</translation>
+        <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>Execute commands</source>
-        <translation type="unfinished">执行命令</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">窗口演示</translation>
     </message>
-</context>
-<context>
-    <name>clientSettings</name>
     <message>
-        <source>Client settings</source>
-        <translation>客户端设置</translation>
+        <source>Window Demo</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Client settings</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:20pt; font-weight:600; font-style:italic;">客户端设置</span></p></body></html></translation>
+        <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>General</source>
-        <translation>常规</translation>
+        <source>Lock/unlock desktops</source>
+        <translation type="unfinished">锁定/解锁桌面</translation>
     </message>
     <message>
-        <source>Type</source>
-        <translation>类型</translation>
+        <source>Lock all</source>
+        <translation type="unfinished">全部锁定</translation>
     </message>
     <message>
-        <source>Student computer</source>
-        <translation>学生计算机</translation>
+        <source>Unlock all</source>
+        <translation type="unfinished">全部解锁</translation>
     </message>
     <message>
-        <source>Teacher computer</source>
-        <translation>教师计算机</translation>
+        <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>Other/undefined computer</source>
-        <translation>其他/未定义计算机</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">发送文字消息</translation>
     </message>
     <message>
-        <source>Classroom</source>
-        <translation>班级</translation>
+        <source>Text message</source>
+        <translation type="unfinished">文字消息</translation>
     </message>
     <message>
-        <source>MAC-address</source>
-        <translation>MAC地址</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 specifying an optional port-number)</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;">输入一个 iTALC 可到达客户端的IP地址或主机名(用':'指定可选的端口号)</p></body></html></translation>
+        <source>Power on computers</source>
+        <translation type="unfinished">开启计算机</translation>
     </message>
     <message>
-        <source>IP/hostname</source>
-        <translation>IP/主机名</translation>
+        <source>Power on</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></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;">客户端的硬件/MAC地址 - 只有在需要远程开机的客户端上使用</p></body></html></translation>
+        <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>Name</source>
-        <translation>名称</translation>
+        <source>Power down computers</source>
+        <translation type="unfinished">关闭计算机</translation>
     </message>
     <message>
-        <source>VPN</source>
-        <translation>VPN</translation>
+        <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>Connection</source>
-        <translation>连接</translation>
+        <source>Support</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;">connection to hosts on the same level</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>
+        <source>Direct support</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 specify how this host is connected to the iTALC-network, i.e. hosts on the same level. Normally clients are connected via 100 MBit/s LAN, but there might be special hosts such as gateways to other iTALC-networks in foreign schools or a student's home-computer. In such cases iTALC tries to optimize its bandwidth utilization.</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;">在这你可以指定怎样连接主机到 iTALC 网络,主机对等。通常客户端接入100MBit/s局域网,但也许有些特殊的主机通过网关接入其他国外学校的 iTALC 网络或者是学生家中的计算机。在此情况下iTALC尝试去优化带宽利用率。</p></body></html></translation>
+        <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>Analog</source>
-        <translation>模拟电路</translation>
+        <source>Adjust/align</source>
+        <translation type="unfinished">调整/对齐</translation>
     </message>
     <message>
-        <source>ISDN</source>
-        <translation>ISDN</translation>
+        <source>Adjust windows and their size</source>
+        <translation type="unfinished">调整窗口和它们的大小</translation>
     </message>
     <message>
-        <source>DSL / 400 KBit/s</source>
-        <translation>DSL / 400 KBit/s</translation>
+        <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>DSL / 2000 KBit/s</source>
-        <translation>DSL / 2000 KBit/s</translation>
+        <source>Auto view</source>
+        <translation type="unfinished">自动视图</translation>
     </message>
     <message>
-        <source>100 MBit/s LAN</source>
-        <translation>100 MBit/s 局域网</translation>
+        <source>Auto re-arrange windows and their size</source>
+        <translation type="unfinished">自动重新排列窗口和调整大小</translation>
     </message>
     <message>
-        <source>1000 MBit/s LAN</source>
-        <translation>1000 MBit/s 局域网</translation>
+        <source>When clicking this button all visible windows are re-arranged and adjusted.</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 if the host is the gateway for the subnet.</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>
+        <source>iTALC Master Control</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Host is &gateway for subnet</source>
-        <translation>主机是子网的网关&g</translation>
+        <source>Remote control</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;">Activate this option for at least one host in a subnet.</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>
+        <source>Could not modify the autostart property for the iTALC Service.</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;">When showing a demo to more than one host in a foreign network, it's meaningful to activate this option for at least one of the involved hosts. This way all data is only sent once to the demo-replicator which provides the data for all the other clients in the network. Especially on slow links usage of this option is essential. Normally you should enable this option on the subnet-gateway (see option above).</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>
+        <source>Could not modify the service arguments for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Act as &demo replicator</source>
-        <translation>激活 演示中继器&d</translation>
+        <source>Could not change the firewall configuration for the iTALC Service.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>确定&O</translation>
+        <source>Debugging</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>C&ancel</source>
-        <translation>取消&a</translation>
+        <source>Enable desktop switching for screen lock (experimental)</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></source>
+        <source>Log to standard error output</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>clientSettingsDialog</name>
     <message>
-        <source>Missing IP-address/hostname</source>
-        <translation>缺少 IP地址/主机名</translation>
+        <source>Log to Windows event log</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>You didn't specify an IP-address or hostname for the computer!</source>
-        <translation>你没有为该计算机指定 IP地址或主机名!</translation>
+        <source>Backend</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Invalid MAC-address</source>
-        <translation>无效的 MAC地址</translation>
+        <source>VNC reflector</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>你指定的 MAC地址无效。该项放空或者输入有效的MAC地址(用 "." 做分隔符!)。</translation>
+        <source>iTALC 1 demo server</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>cmdInputDialog</name>
     <message>
-        <source>Run commands on client(s)</source>
-        <translation>在客户端运行命令</translation>
+        <source>Multithreading (can be enabled when using the VNC reflector backend)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Enter commands, which should be run on client(s):</source>
-        <translation>输入要在客户端运行的命令:</translation>
+        <source>Enable HTTP server which provides a JavaViewer applet</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>取消</translation>
+        <source>HTTP server port</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>&Run!</source>
-        <translation>运行&R!</translation>
+        <source>Allow connections from localhost only</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>config</name>
     <message>
-        <source>Interval between updates</source>
-        <translation>更新间隔时间</translation>
+        <source>Key file authentication</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 network-traffic and lower CPU-usage on this computer.</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;">在这你可以设置客户端的更新间隔时间。数值越高网络传输越低,这台计算机的CPU占用越低。</p></body></html></translation>
+        <source>ACL-based logon authentication</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>1 second</source>
-        <translation>1 秒</translation>
+        <source>Public key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source> seconds</source>
-        <translation> 秒</translation>
+        <source>Private key file base directory</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Quality of demo-mode</source>
-        <translation>演示模式画质</translation>
+        <source>Launch key file assistant</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 setup the desired screen-quality in demo-mode. Lower quality results in less CPU-usage and lower network-traffic while high quality might slow down your computer and decrease framerate of demo. You should experiment with this for optimal settings.</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;">在这你可以设置在演示模式中想要的画质。低画质意味着低CPU占用和低网络传输,高画质将降低计算机速度并且将减少演示的帧率。你应该通过试验来优化设置。</p></body></html></translation>
+        <source>Manage permissions</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Low (15 bit)</source>
-        <translation>低 (15 bit)</translation>
+        <source>Test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Medium (18 bit)</source>
-        <translation>中 (18 bit)</translation>
+        <source>Access confirmation</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>High (Truecolor)</source>
-        <translation>高 (Truecolor)</translation>
+        <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>User interface</source>
-        <translation>用户界面</translation>
+        <source>Logon authentication</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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>Allow same user to access desktop without confirmation</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 mouse-cursor over 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>
+        <source>Debugging iTALC</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No balloon-tooltips</source>
-        <translation>禁用 冒泡提示</translation>
+        <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>Your role (needs according keys!)</source>
-        <translation>你的角色</translation>
+        <source>1)</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><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>
+        <source>Clear the logfiles in the "General" section.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Teacher</source>
-        <translation>教师</translation>
+        <source>2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Administrator</source>
-        <translation>管理员</translation>
+        <source>In the "General" section set the log level to "Debug messages and everything else".</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Supporter</source>
-        <translation>协助者</translation>
+        <source>3)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Other</source>
-        <translation>其他</translation>
+        <source>Repeat the actions leading to the bug or misbehaviour.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Settings for multi-logon</source>
-        <translation>多用户登录设置</translation>
+        <source>4)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Domain</source>
-        <translation>域</translation>
+        <source>Click the following button and save the file to a known location.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Double-click action for client-window</source>
-        <translation>客户端窗口双击动作</translation>
+        <source>Generate bug report archive</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><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>
+        <source>5)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control</source>
-        <translation>远程控制</translation>
+        <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>View live in fullscreen</source>
-        <translation>全屏现场直播</translation>
+        <source>Restart iTALC Service</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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">请注意,某些改变不能立即生效,需要重启 iTALC 。</span></p></body></html></translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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>
+        <source>Starting iTALC service</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>No texts on toolbar-buttons</source>
+        <source>Stopping iTALC service</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>configWidget</name>
     <message>
-        <source>Your iTALC-configuration</source>
-        <translation>你的 iTALC 配置</translation>
+        <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>In this workspace you can customize iTALC to fit your needs.</source>
-        <translation>在这个工作空间中你可以定制 iTALC 适合你的需要。</translation>
+        <source>Log files cleared</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>demoClient</name>
     <message>
-        <source>iTALC Demo</source>
-        <translation>iTALC 演示</translation>
+        <source>All log files were cleared successfully.</source>
+        <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>isdServer</name>
     <message>
-        <source>ISD-server error</source>
-        <translation>ISD-服务器 错误</translation>
+        <source>Error</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The ISD-server could not be started because port %1 is already in use. Please make sure that no other application is using this port and try again.</source>
-        <translation>ISD-服务器 不能启动,因为端口 %1 已经被占用。请确认没有其他程序在使用该端口并重试。</translation>
+        <source>Could not remove all log files.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Confirm access</source>
-        <translation>访问确认</translation>
+        <source>Logon authentication test</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody at host %1 tries to access your screen. Do you want to grant him/her access?</source>
-        <translation>在主机 %1 上有人试图访问你的屏幕。你同意他/她访问吗?</translation>
+        <source>Authentication with provided credentials was successful.</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Never for this session</source>
-        <translation>从不使用这个会话</translation>
+        <source>Authentication with provided credentials failed!</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Always for this session</source>
-        <translation>一直使用这个会话</translation>
+        <source>Save bug report archive</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Message from teacher</source>
-        <translation>来自教师的消息</translation>
+        <source>iTALC bug report archive (*.ibra.xml)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Authentication error</source>
-        <translation>验证错误</translation>
+        <source>iTALC bug report archive saved</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Somebody (IP: %1) tried to access this computer but could not authenticate itself successfully!</source>
-        <translation>有人(IP: %1 )试图访问这台计算机但未能通过验证!</translation>
+        <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>
-</context>
-<context>
-    <name>ivsConnection</name>
     <message>
-        <source>Snapshot</source>
-        <translation>å¿«ç…§</translation>
+        <source>Could not contact iTALC service</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>不能拍快照,目录 %1 不存在并且不能创建。</translation>
+        <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>unknown</source>
+        <source>Authentication impossible</source>
         <translation type="unfinished"></translation>
     </message>
-</context>
-<context>
-    <name>lockWidget</name>
     <message>
-        <source>screen lock</source>
+        <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>
 </context>
 <context>
-    <name>messageBox</name>
+    <name>MessageBoxSlave</name>
     <message>
-        <source>OK</source>
-        <translation>确定</translation>
+        <source>Message from teacher</source>
+        <translation type="unfinished">来自教师的消息</translation>
     </message>
 </context>
 <context>
-    <name>overview</name>
+    <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">
+        <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>请看这个包含多个按钮的工作栏。每个按钮联结一个工作空间。要使用那个工作空间点击对应的按钮即可。</translation>
+        <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>快照工作空间是一个非常有用的工具。它能让你管理你所拍的快照。</translation>
+        <translation type="unfinished">快照工作空间是一个非常有用的工具。它能让你管理你所拍的快照。</translation>
     </message>
     <message>
         <source>Of course you can configure iTALC. This is usually done using the configuration-workspace.</source>
-        <translation>当然你可以配置 iTALC 。这是个常用的配置工作空间。</translation>
+        <translation type="unfinished">当然你可以配置 iTALC 。这是个常用的配置工作空间。</translation>
     </message>
     <message>
         <source>About iTALC</source>
-        <translation>关于 iTALC</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>
+        <translation type="unfinished">关于 iTALC</translation>
     </message>
 </context>
 <context>
-    <name>overviewWidget</name>
+    <name>OverviewWidget</name>
     <message>
         <source>Overview</source>
-        <translation>概览</translation>
+        <translation type="unfinished">概览</translation>
     </message>
     <message>
         <source>Some basic information on iTALC and how to use it.</source>
-        <translation>一些基本的 iTALC 信息和使用方法。</translation>
+        <translation type="unfinished">一些基本的 iTALC 信息和使用方法。</translation>
     </message>
 </context>
 <context>
-    <name>pageFinished</name>
+    <name>PasswordDialog</name>
     <message>
-        <source>iTALC is now ready to run!</source>
+        <source>Please enter your username and password in order to access iTALC clients.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>iTALC is now completely installed and set up. If you installed the master application you can start it now.</source>
-        <translation type="unfinished"></translation>
+        <source>Username</source>
+        <translation type="unfinished">用户名</translation>
     </message>
     <message>
-        <source>Save key setup settings</source>
-        <translation type="unfinished"></translation>
+        <source>Password</source>
+        <translation type="unfinished">密码</translation>
     </message>
-</context>
-<context>
-    <name>pageKeyDirs</name>
     <message>
-        <source>Key directories</source>
+        <source>iTALC Logon</source>
         <translation type="unfinished"></translation>
     </message>
+</context>
+<context>
+    <name>QApplication</name>
     <message>
-        <source>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</source>
-        <translation>新创建或导入的密钥所需的安装目录。推荐使用建议的目录。</translation>
+        <source>Unable to register service '%1'.</source>
+        <translation>不能注册服务 '%1'。</translation>
     </message>
     <message>
-        <source>Directory to store public key in</source>
-        <translation>存储公共密钥目录</translation>
+        <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>Directory to store private key in</source>
-        <translation>存储私有密钥目录</translation>
+        <source>The service '%1' is already registered.</source>
+        <translation>服务 '%1' 已经注册。</translation>
     </message>
     <message>
-        <source>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be registered.</source>
+        <translation>服务 '%1' 未能注册。</translation>
     </message>
     <message>
-        <source>Export private key too</source>
-        <translation>导出私有密钥</translation>
+        <source>The service '%1' was successfully registered.</source>
+        <translation>服务 '%1' 注册成功。</translation>
     </message>
-</context>
-<context>
-    <name>pageSecurityOptions</name>
     <message>
-        <source>Security options</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' could not be stopped.</source>
+        <translation>服务 '%1' 不能停止。</translation>
     </message>
     <message>
-        <source>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' has been unregistered.</source>
+        <translation>服务 '%1' 已取消注册。</translation>
     </message>
     <message>
-        <source>Create a new key pair (only on master computer)</source>
-        <translation type="unfinished"></translation>
+        <source>The service '%1' isn't registered and therefore can't be unregistered.</source>
+        <translation>服务 '%1' 未注册,因此不能被取消注册。</translation>
     </message>
     <message>
-        <source>Import public key of master computer</source>
-        <translation>导入主计算机的公共密钥</translation>
+        <source>The service '%1' could not be unregistered.</source>
+        <translation>服务 '%1' 不能被取消注册。</translation>
     </message>
     <message>
-        <source>Choose location of exported public key:</source>
-        <translation>选择导出公共密钥的位置:</translation>
+        <source>The service '%1' could not be found.</source>
+        <translation>服务 '%1' 未发现。</translation>
     </message>
     <message>
-        <source>Keep all keys (only when updating existing installation!)</source>
-        <translation>保持全部密钥 (只在升级时使用)</translation>
+        <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>
-</context>
-<context>
-    <name>pageWelcome</name>
     <message>
-        <source>Welcome to iTALC</source>
-        <translation type="unfinished"></translation>
+        <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>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</source>
+        <source>iTALC Client %1 on %2:%3</source>
         <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidget</name>
+    <name>RemoteControlWidget</name>
     <message>
-        <source>View live (%1 at host %2)</source>
-        <translation>现场直播( %1 在主机 %2 上)</translation>
+        <source>View live (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Remote control (%1 at host %2)</source>
-        <translation>远程控制( %1 在主机 %2 上)</translation>
+        <source>Remote control (%1 @ %2)</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <source>unknown user</source>
-        <translation>未知用户</translation>
+        <translation type="unfinished">未知用户</translation>
     </message>
 </context>
 <context>
-    <name>remoteControlWidgetToolBar</name>
+    <name>RemoteControlWidgetToolBar</name>
     <message>
         <source>View only</source>
-        <translation>仅可视</translation>
+        <translation type="unfinished">仅可视</translation>
     </message>
     <message>
         <source>Remote control</source>
-        <translation>远程控制</translation>
+        <translation type="unfinished">远程控制</translation>
     </message>
     <message>
         <source>Lock student</source>
-        <translation>锁定学生</translation>
+        <translation type="unfinished">锁定学生</translation>
     </message>
     <message>
         <source>Unlock student</source>
-        <translation>解锁学生</translation>
+        <translation type="unfinished">解锁学生</translation>
     </message>
     <message>
         <source>Snapshot</source>
-        <translation>å¿«ç…§</translation>
+        <translation type="unfinished">å¿«ç…§</translation>
     </message>
     <message>
         <source>Fullscreen</source>
-        <translation>全屏</translation>
+        <translation type="unfinished">全屏</translation>
     </message>
     <message>
         <source>Window</source>
-        <translation>窗口</translation>
+        <translation type="unfinished">窗口</translation>
     </message>
     <message>
         <source>Quit</source>
-        <translation>退出</translation>
+        <translation type="unfinished">退出</translation>
     </message>
     <message>
         <source>Connecting %1</source>
-        <translation>正在连接 %1</translation>
+        <translation type="unfinished">正在连接 %1</translation>
     </message>
     <message>
         <source>Connected.</source>
-        <translation>已连接。</translation>
+        <translation type="unfinished">已连接。</translation>
     </message>
 </context>
 <context>
-    <name>remoteLogon</name>
+    <name>RemoteLogonDialog</name>
     <message>
-        <source>Remote Logon</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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">Remote Logon</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:20pt; font-weight:600; font-style:italic;">远程登录</span></p></body></html></translation>
+        <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>在以下输入框中输入用户名,密码和可选的域名。这些信息将被用于登录该计算机。</translation>
+        <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>用户名</translation>
+        <translation type="unfinished">用户名</translation>
     </message>
     <message>
         <source>Password</source>
-        <translation>密码</translation>
+        <translation type="unfinished">密码</translation>
     </message>
     <message>
         <source>Domain</source>
-        <translation>域</translation>
-    </message>
-    <message>
-        <source>&OK</source>
-        <translation>确定&O</translation>
-    </message>
-    <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
-    </message>
-    <message>
-        <source>Cancel</source>
-        <translation>取消</translation>
-    </message>
-    <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <translation type="unfinished">域</translation>
     </message>
 </context>
 <context>
-    <name>setupWizard</name>
-    <message>
-        <source>Confirm overwrite</source>
-        <translation>覆盖确认</translation>
-    </message>
+    <name>RunCommandsDialog</name>
     <message>
-        <source>Do you want to overwrite %1?</source>
-        <translation>你确定要覆盖吗?</translation>
-    </message>
-    <message>
-        <source>Cancel setup</source>
-        <translation>取消安装</translation>
-    </message>
-    <message>
-        <source>Are you sure want to quit setup? iTALC is not set up completely yet!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Next</source>
-        <translation>下一步</translation>
-    </message>
-    <message>
-        <source>Finish</source>
-        <translation>完成</translation>
-    </message>
-    <message>
-        <source>Quit</source>
-        <translation>退出</translation>
-    </message>
-    <message>
-        <source>File does not exist</source>
+        <source>Run commands</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>The file %1 could not be found. Please check this and try again.</source>
+        <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>setupWizardPageKeyDirs</name>
-    <message>
-        <source>Choose public key directory</source>
-        <translation>选择公共密钥目录</translation>
-    </message>
+    <name>Snapshot</name>
     <message>
-        <source>Choose private key directory</source>
-        <translation>选择私有密钥目录</translation>
+        <source>unknown</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Choose public key export directory</source>
-        <translation>选择公共密钥导出目录</translation>
+        <source>Could not take a snapshot as directory %1 doesn't exist and couldn't be created.</source>
+        <translation type="unfinished">不能拍快照,目录 %1 不存在并且不能创建。</translation>
     </message>
-</context>
-<context>
-    <name>setupWizardPageSecurityOptions</name>
     <message>
-        <source>Choose directory for key import</source>
-        <translation type="unfinished"></translation>
+        <source>Snapshot</source>
+        <translation type="unfinished">å¿«ç…§</translation>
     </message>
 </context>
 <context>
-    <name>snapshotList</name>
+    <name>SnapshotList</name>
     <message>
         <source>Snapshots</source>
-        <translation>å¿«ç…§</translation>
+        <translation type="unfinished">å¿«ç…§</translation>
     </message>
     <message>
         <source>Simply manage the snapshots you made using this workspace.</source>
-        <translation>使用这个工作空间方便地管理你的快照。</translation>
+        <translation type="unfinished">使用这个工作空间方便地管理你的快照。</translation>
     </message>
 </context>
 <context>
-    <name>snapshots</name>
+    <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">
+        <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>用户:</translation>
+        <translation type="unfinished">用户:</translation>
     </message>
     <message>
         <source>Host:</source>
-        <translation>主机:</translation>
+        <translation type="unfinished">主机:</translation>
     </message>
     <message>
         <source>Date:</source>
-        <translation>日期:</translation>
+        <translation type="unfinished">日期:</translation>
     </message>
     <message>
         <source>Time:</source>
-        <translation>时间:</translation>
-    </message>
-    <message>
-        <source>Show snapshot</source>
-        <translation>显示快照</translation>
+        <translation type="unfinished">时间:</translation>
     </message>
     <message>
-        <source>Delete snapshot</source>
-        <translation>删除快照</translation>
+        <source>Show</source>
+        <translation type="unfinished"></translation>
     </message>
     <message>
-        <source>Reload list</source>
-        <translation>刷新列表</translation>
+        <source>Delete</source>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 <context>
-    <name>support</name>
+    <name>SupportDialog</name>
     <message>
         <source>Support</source>
-        <translation>协助</translation>
+        <translation type="unfinished">协助</translation>
     </message>
     <message>
-        <source>Please enter the IP-address or the name of the host at which the person is sitting, you want to support.</source>
-        <translation>请输入你要协助的人所在的 IP地址或主机名。</translation>
+        <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>OK</source>
-        <translation>确定</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">发送文字消息</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>取消</translation>
+        <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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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:20pt; font-weight:600; font-style:italic;">Support </span></p></body></html></source>
-        <translation type="unfinished"></translation>
+        <source>Establishing connection to %1 ...</source>
+        <translation type="unfinished">正在建立连接到 %1 ...</translation>
     </message>
 </context>
 <context>
-    <name>textMessage</name>
+    <name>clientMenu</name>
     <message>
-        <source>Send text message</source>
-        <translation>发送文字消息</translation>
+        <source>Overview</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:20pt; font-weight:600; font-style:italic;">Send text message</span></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;"><span style=" font-size:20pt; font-weight:600; font-style:italic;">发送文字消息</span></p></body></html></translation>
+        <source>Fullscreen demo</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>在下面的文本框中输入你要发送给所选用户的消息。</translation>
+        <source>Window demo</source>
+        <translation type="unfinished">窗口演示</translation>
     </message>
     <message>
-        <source>&OK</source>
-        <translation>确定&O</translation>
+        <source>Locked display</source>
+        <translation type="unfinished">锁定显示</translation>
     </message>
     <message>
-        <source>Ctrl+Enter</source>
-        <translation>Ctrl+Enter</translation>
+        <source>View live</source>
+        <translation type="unfinished">现场直播</translation>
     </message>
     <message>
-        <source>Cancel</source>
-        <translation>取消</translation>
+        <source>Remote control</source>
+        <translation type="unfinished">远程控制</translation>
     </message>
     <message>
-        <source>Esc</source>
-        <translation>Esc</translation>
+        <source>Let student show demo</source>
+        <translation type="unfinished">展示学生演示</translation>
     </message>
-</context>
-<context>
-    <name>vncView</name>
     <message>
-        <source>Establishing connection to %1 ...</source>
-        <translation>正在建立连接到 %1 ...</translation>
+        <source>Send text message</source>
+        <translation type="unfinished">发送文字消息</translation>
     </message>
-</context>
-<context>
-    <name>wizard</name>
     <message>
-        <source>iTALC setup tool</source>
-        <translation type="unfinished"></translation>
+        <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>Cancel</source>
-        <translation>取消</translation>
+        <source>Reboot</source>
+        <translation type="unfinished">重启</translation>
     </message>
     <message>
-        <source>Back</source>
-        <translation>后退</translation>
+        <source>Power down</source>
+        <translation type="unfinished">关机</translation>
     </message>
     <message>
-        <source>Next</source>
-        <translation>下一步</translation>
+        <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
new file mode 100644
index 0000000..f34ca29
Binary files /dev/null and b/lib/resources/zh_tw.qm differ
diff --git a/lib/resources/zh_tw.ts b/lib/resources/zh_tw.ts
new file mode 100644
index 0000000..9ff07aa
--- /dev/null
+++ b/lib/resources/zh_tw.ts
@@ -0,0 +1,1781 @@
+<?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 utf8="true">
+        <source>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</source>
+        <translation>iTALC - Intelligent Teaching And Learning with Computers
+
+Copyright © 2004-2011 Tobias Doerffel</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-2011 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 ':' for specifying an optional port-number)</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;">輸入讓 iTALC 可以到達客戶端的 IP-位址或主機名稱(使用 ':' 以指定選擇性的連接埠)</p></body></html></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></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;">這個主機在 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></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;">用來讓客戶端開機的客戶端硬體/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 network-traffic and lower CPU-usage on this computer.</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;">您可以在這裡設定客戶端更新的問隔。較高的數值可使這台電腦有較低的網路流量和 CPU 使用率。</p></body></html></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><html><head><meta name="qrichtext" content="1" /></head><body style=" white-space: pre-wrap; font-family:Sans Serif; font-size:9pt; font-weight:400; font-style:normal; 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 mouse-cursor over 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 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 changes won't take effect until you restart iTALC.</span></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;"><span style=" font-size:8pt; font-style:italic;">請注意,有些變更要在您重新啟動 iTALC 後才會生效。</span></p></body></html></translation>
+    </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>Poll full screen</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>
+</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>
+</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
new file mode 100644
index 0000000..4f4b1a4
--- /dev/null
+++ b/lib/src/3rdparty/XEventLog.cpp
@@ -0,0 +1,428 @@
+// 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;
+
+	BOOL bRet = FALSE;
+
+	// open event log
+	if (lpszApp && (lpszApp[0] != _T('\0')))
+		bRet = 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
new file mode 100644
index 0000000..3b3bdd8
--- /dev/null
+++ b/lib/src/3rdparty/XEventLog.h
@@ -0,0 +1,44 @@
+// 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
new file mode 100644
index 0000000..5135898
--- /dev/null
+++ b/lib/src/AboutDialog.cpp
@@ -0,0 +1,48 @@
+/*
+ * AboutDialog.cpp - implementation of AboutDialog
+ *
+ * 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.
+ *
+ */
+
+#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
new file mode 100644
index 0000000..dbb5807
--- /dev/null
+++ b/lib/src/AuthenticationCredentials.cpp
@@ -0,0 +1,107 @@
+/*
+ * 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
new file mode 100644
index 0000000..a6618f6
--- /dev/null
+++ b/lib/src/Configuration/LocalStore.cpp
@@ -0,0 +1,125 @@
+/*
+ * 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
new file mode 100644
index 0000000..ffa097a
--- /dev/null
+++ b/lib/src/Configuration/Object.cpp
@@ -0,0 +1,334 @@
+/*
+ * 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
new file mode 100644
index 0000000..4ab2295
--- /dev/null
+++ b/lib/src/Configuration/XmlStore.cpp
@@ -0,0 +1,185 @@
+/*
+ * 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
new file mode 100644
index 0000000..95ac99e
--- /dev/null
+++ b/lib/src/DecoratedMessageBox.cpp
@@ -0,0 +1,142 @@
+/*
+ * DecoratedMessageBox.cpp - simple message-box
+ *
+ * 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 "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;
+	}
+
+	new DecoratedMessageBox( _title, _msg, p );
+
+}
+
+
diff --git a/lib/src/DsaKey.cpp b/lib/src/DsaKey.cpp
new file mode 100644
index 0000000..2eb84c8
--- /dev/null
+++ b/lib/src/DsaKey.cpp
@@ -0,0 +1,849 @@
+/*
+ * 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
new file mode 100644
index 0000000..0f092c3
--- /dev/null
+++ b/lib/src/FastQImage.cpp
@@ -0,0 +1,864 @@
+/*
+ * 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
new file mode 100644
index 0000000..6884cd8
--- /dev/null
+++ b/lib/src/Inject.cpp
@@ -0,0 +1,655 @@
+/*
+ * 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
new file mode 100644
index 0000000..7d019bf
--- /dev/null
+++ b/lib/src/Ipc/Core.cpp
@@ -0,0 +1,47 @@
+/*
+ * 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
new file mode 100644
index 0000000..19dcaa1
--- /dev/null
+++ b/lib/src/Ipc/Master.cpp
@@ -0,0 +1,316 @@
+/*
+ * 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
new file mode 100644
index 0000000..dce5a78
--- /dev/null
+++ b/lib/src/Ipc/QtSlaveLauncher.cpp
@@ -0,0 +1,123 @@
+/*
+ * QtSlaveLauncher.cpp - class Ipc::QtSlaveLauncher providing mechanisms for
+ *                       launching a slave application via QProcess
+ *
+ * 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 <QtCore/QProcess>
+#include <QtCore/QTime>
+
+#include "Ipc/QtSlaveLauncher.h"
+
+#include "ItalcCore.h"
+#include "ItalcConfiguration.h"
+#include "Logger.h"
+
+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();
+		}
+
+		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
new file mode 100644
index 0000000..d23f78a
--- /dev/null
+++ b/lib/src/Ipc/Slave.cpp
@@ -0,0 +1,126 @@
+/*
+ * 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
new file mode 100644
index 0000000..ea7d28e
--- /dev/null
+++ b/lib/src/Ipc/SlaveLauncher.cpp
@@ -0,0 +1,63 @@
+/*
+ * 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
new file mode 100644
index 0000000..f10e1a7
--- /dev/null
+++ b/lib/src/ItalcConfiguration.cpp
@@ -0,0 +1,125 @@
+/*
+ * 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
new file mode 100644
index 0000000..84a415c
--- /dev/null
+++ b/lib/src/ItalcCore.cpp
@@ -0,0 +1,314 @@
+/*
+ * 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 );
+
+	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
new file mode 100644
index 0000000..f619e0c
--- /dev/null
+++ b/lib/src/ItalcCoreConnection.cpp
@@ -0,0 +1,354 @@
+/*
+ * 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" );
+		}
+		else if( m.cmd() == ItalcCore::ReportSlaveStateFlags )
+		{
+			m_slaveStateFlags = m.arg( "slavestateflags" ).toInt();
+		}
+		// 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
new file mode 100644
index 0000000..363b5ff
--- /dev/null
+++ b/lib/src/ItalcVncConnection.cpp
@@ -0,0 +1,868 @@
+/*
+ * ItalcVncConnection.cpp - implementation of ItalcVncConnection class
+ *
+ * Copyright (c) 2008-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.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 );
+
+
+static QString outputErrorMessageString;
+
+
+
+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( char *text ) :
+		m_text( text )
+	{
+	}
+
+	virtual void fire( rfbClient *cl )
+	{
+		SendClientCutText( cl, m_text, qstrlen( m_text ) );
+	}
+
+private:
+	char * 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 );
+	cursorShape.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( ( 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";
+}
+
+
+
+
+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::checkOutputErrorMessage()
+{
+	if( !outputErrorMessageString.isEmpty() )
+	{
+//		QString errorMessage = outputErrorMessageString;
+		outputErrorMessageString.clear();
+	}
+}
+
+
+
+
+void ItalcVncConnection::stop()
+{
+	if( isRunning() )
+	{
+		m_stopped = true;
+		m_updateIntervalSleeper.wakeAll();
+
+		if( !wait( 1000 ) )
+		{
+			qWarning( "ItalcVncConnection::stop(): terminating thread" );
+			terminate();
+		}
+	}
+}
+
+
+
+
+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;
+	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;
+		if( rfbInitClient( m_cl, &argc, NULL ) )
+		{
+			emit connected();
+
+			m_state = Connected;
+			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;
+			}
+			else if( argc > 0 )
+			{
+				m_state = AuthenticationFailed;
+			}
+			else
+			{
+				// failed for an unknown reason
+				m_state = ConnectionFailed;
+			}
+
+			// 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( i < 0 )
+		{
+			break;
+		}
+		else if( i )
+		{
+			// read and process remaining messages many messages as available
+			bool handledOkay = true;
+			while( WaitForMessage( m_cl, 0 ) && handledOkay )
+			{
+				handledOkay = HandleRFBServerMessage( m_cl );
+			}
+			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;
+}
+
+
+
+
+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( strdup( text.toUtf8() ) ) );
+}
+
+
+
+
+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
new file mode 100644
index 0000000..fd40609
--- /dev/null
+++ b/lib/src/LocalSystem.cpp
@@ -0,0 +1,1179 @@
+/*
+ * LocalSystem.cpp - namespace LocalSystem, providing an interface for
+ *				   transparent usage of operating-system-specific functions
+ *
+ * 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 <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_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
new file mode 100644
index 0000000..fec9f20
--- /dev/null
+++ b/lib/src/LockWidget.cpp
@@ -0,0 +1,157 @@
+/*
+ *  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
new file mode 100644
index 0000000..5c38700
--- /dev/null
+++ b/lib/src/Logger.cpp
@@ -0,0 +1,253 @@
+/*
+ * 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
new file mode 100644
index 0000000..2713ef6
--- /dev/null
+++ b/lib/src/LogonAuthentication.cpp
@@ -0,0 +1,94 @@
+/*
+ * 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
new file mode 100644
index 0000000..e57e3e7
--- /dev/null
+++ b/lib/src/PasswordDialog.cpp
@@ -0,0 +1,100 @@
+/*
+ * 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 <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() );
+}
+
diff --git a/lib/src/ProgressWidget.cpp b/lib/src/ProgressWidget.cpp
new file mode 100644
index 0000000..f7572f4
--- /dev/null
+++ b/lib/src/ProgressWidget.cpp
@@ -0,0 +1,102 @@
+/*
+ *  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
new file mode 100644
index 0000000..acdb64f
--- /dev/null
+++ b/lib/src/Snapshot.cpp
@@ -0,0 +1,160 @@
+/*
+ *  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
new file mode 100644
index 0000000..1e3c4d0
--- /dev/null
+++ b/lib/src/SystemKeyTrapper.cpp
@@ -0,0 +1,380 @@
+/*
+ * SystemKeyTrapper.cpp - 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.
+ *
+ */
+
+
+#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 )
+	{
+		STICKYKEYS sk = settings_sk;
+		TOGGLEKEYS tk = settings_tk;
+		FILTERKEYS fk = settings_fk;
+
+		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 );
+		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
new file mode 100644
index 0000000..c55550a
--- /dev/null
+++ b/lib/src/VncView.cpp
@@ -0,0 +1,819 @@
+/*
+ * VncView.cpp - VNC viewer widget
+ *
+ * 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.
+ *
+ */
+
+#define XK_KOREAN
+#include "rfb/keysym.h"
+
+#include "VncView.h"
+#include "QtUserEvents.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
new file mode 100644
index 0000000..784b9b8
--- /dev/null
+++ b/lib/src/dh.cpp
@@ -0,0 +1,178 @@
+// 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/lib/src/dsa_key.cpp b/lib/src/dsa_key.cpp
deleted file mode 100644
index f5f6c88..0000000
--- a/lib/src/dsa_key.cpp
+++ /dev/null
@@ -1,860 +0,0 @@
-/*
- * dsa_key.cpp - easy to use C++ classes for dealing with DSA-keys, -signatures
- *               etc.
- *
- * Copyright (c) 2006-2008 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.
- *
- ****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// project-headers
-#include "dsa_key.h"
-#include "local_system.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)
-
-
-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( void )
-{
-	BIGNUM * challenge_bn = BN_new();
-
-	if( challenge_bn == NULL )
-	{
-		qCritical( "dsaKey::generateChallenge(): BN_new() failed" );
-		return( QByteArray() );
-	}
-
-	const int DEFAULT_CHALLENGE_SIZE = 64;
-
-	// generate a random challenge
-	BN_rand( challenge_bn, DEFAULT_CHALLENGE_SIZE * 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 );
-}
-
-
-
-
-void 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 %s",
-						_file.toUtf8().constData() );
-		return;
-	}
-	FILE * fp = fdopen( infile.handle(), "r" );
-#else
-	FILE * fp = fopen( _file.toUtf8().constData(), "r" );
-#endif
-	if( fp == NULL )
-	{
-		qCritical( "privateDSAKey::load( ... ): fdopen failed" );
-		return;
-	}
-
-	EVP_PKEY * pk = PEM_read_PrivateKey( fp, NULL, NULL,
-						_passphrase.toUtf8().data() );
-	if( pk == NULL )
-	{
-		qCritical( "PEM_read_PrivateKey failed" );
-	}
-	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 );
-	}
-	fclose( fp );
-	if( pk != NULL )
-	{
-		EVP_PKEY_free( pk );
-	}
-}
-
-
-
-
-void 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;
-	}
-	if( _file.contains( QDir::separator() ) )
-	{
-		localSystem::ensurePathExists( QFileInfo( _file ).filePath() );
-	}
-
-	QFile outfile( _file );
-	if( outfile.exists() )
-	{
-		outfile.setPermissions( QFile::WriteOwner );
-		if( !outfile.remove() )
-		{
-			qWarning( "could not remove %s",
-						_file.toUtf8().constData() );
-		}
-	}
-	// 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( "could not save private key in %s",
-						_file.toUtf8().constData() );
-		return;
-	}
-	FILE * fp = fdopen( outfile.handle(), "w" );
-#else
-	FILE * fp = fopen( _file.toUtf8().constData(), "w" );
-#endif
-	if( fp == NULL )
-	{
-		qCritical( "fdopen failed." );
-		return;
-	}
-
-	const EVP_CIPHER * cipher = _passphrase.isEmpty() ?
-						NULL : EVP_des_ede3_cbc();
-
-	PEM_write_DSAPrivateKey( fp, m_dsa, cipher, _passphrase.isEmpty() ?
-			NULL : (unsigned char *) _passphrase.toUtf8().data(),
-					_passphrase.length(), NULL, NULL );
-	fclose( fp );
-	outfile.close();
-	outfile.setPermissions( QFile::ReadOwner | QFile::ReadUser |
-							QFile::ReadGroup );
-}
-
-
-
-
-
-DSA * createNewDSA( void )
-{
-	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( "key_from_blob: 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);
-	}
-}
-
-
-
-
-void 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( "could not open file %s",
-						_file.toUtf8().constData() );
-		return;
-	}
-
-	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 ).toUtf8() ) );
-			if( m_dsa == NULL )
-			{
-				qCritical( "publicDSAKey::load(): "
-						"keyFromBlob failed" );
-				continue;
-			}
-			return;
-		}
-	}
-
-	qCritical( "error while reading public key!" );
-}
-
-
-
-
-void publicDSAKey::save( const QString & _file, QString ) const
-{
-	if( !isValid() )
-	{
-		qCritical( "publicDSAKey::save(...): key not valid!" );
-		return;
-	}
-
-	if( _file.contains( QDir::separator() ) )
-	{
-		localSystem::ensurePathExists( QFileInfo( _file ).filePath() );
-	}
-
-	QFile outfile( _file );
-	if( outfile.exists() )
-	{
-		outfile.setPermissions( QFile::WriteOwner );
-		if( !outfile.remove() )
-		{
-			qWarning( "could not remove %s",
-						_file.toUtf8().constData() );
-		}
-	}
-	if( !outfile.open( QFile::WriteOnly | QFile::Truncate ) )
-	{
-		qCritical( "could not save public key in %s",
-						_file.toUtf8().constData() );
-		return;
-	}
-
-	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 ts( &outfile );
-	ts << QString( "italc-dss %1" ).arg( QString( QByteArray( p, len ).
-								toBase64() ) );
-	memset( p, 0, len );
-	buffer_free( &b );
-	ts.flush();
-	outfile.close();
-	outfile.setPermissions( QFile::ReadOwner | QFile::ReadUser |
-				QFile::ReadGroup | QFile::ReadOther );
-}
-
-
diff --git a/lib/src/fast_qimage.cpp b/lib/src/fast_qimage.cpp
deleted file mode 100644
index 6929513..0000000
--- a/lib/src/fast_qimage.cpp
+++ /dev/null
@@ -1,865 +0,0 @@
-
-/*
- * fast_qimage.cpp - class fastQImage providing fast inline-QImage-manips
- *
- * Copyright (c) 2006-2008 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 "fast_qimage.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( Q_UINT32 _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(Q_UINT8 *srcpix, Q_UINT8 *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++)
-    {
-        Q_UINT32 accumulate[4] = {0,0,0,0};
-        unsigned int xcounter = xspace;
-        for (unsigned int x = 0; x < srcwidth; x++)
-        {
-            if (xcounter > 0x10000)
-            {
-                accumulate[0] += (Q_UINT32) *srcpix++;
-                accumulate[1] += (Q_UINT32) *srcpix++;
-                accumulate[2] += (Q_UINT32) *srcpix++;
-                accumulate[3] += (Q_UINT32) *srcpix++;
-                xcounter -= 0x10000;
-            }
-            else
-            {
-                /* write out a destination pixel */
-                *dstpix++ = (Q_UINT8) (((accumulate[0] + ((srcpix[0] * xcounter) >> 16)) * xrecip) >> 16);
-                *dstpix++ = (Q_UINT8) (((accumulate[1] + ((srcpix[1] * xcounter) >> 16)) * xrecip) >> 16);
-                *dstpix++ = (Q_UINT8) (((accumulate[2] + ((srcpix[2] * xcounter) >> 16)) * xrecip) >> 16);
-                *dstpix++ = (Q_UINT8) (((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] = (Q_UINT32) ((*srcpix++ * xfrac) >> 16);
-                accumulate[1] = (Q_UINT32) ((*srcpix++ * xfrac) >> 16);
-                accumulate[2] = (Q_UINT32) ((*srcpix++ * xfrac) >> 16);
-                accumulate[3] = (Q_UINT32) ((*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(Q_UINT8 *srcpix, Q_UINT8 *dstpix, unsigned int width, unsigned int srcpitch, unsigned int dstpitch, unsigned int srcheight, unsigned int dstheight)
-{
-    Q_UINT16 *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 = (Q_UINT16 *) 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++)
-    {
-        Q_UINT16 *accumulate = templine;
-        if (ycounter > 0x10000)
-        {
-            for (unsigned int x = 0; x < width; x++)
-            {
-                *accumulate++ += (Q_UINT16) *srcpix++;
-                *accumulate++ += (Q_UINT16) *srcpix++;
-                *accumulate++ += (Q_UINT16) *srcpix++;
-                *accumulate++ += (Q_UINT16) *srcpix++;
-            }
-            ycounter -= 0x10000;
-        }
-        else
-        {
-            /* write out a destination line */
-            for (unsigned int x = 0; x < width; x++)
-            {
-                *dstpix++ = (Q_UINT8) (((*accumulate++ + ((*srcpix++ * ycounter) >> 16)) * yrecip) >> 16);
-                *dstpix++ = (Q_UINT8) (((*accumulate++ + ((*srcpix++ * ycounter) >> 16)) * yrecip) >> 16);
-                *dstpix++ = (Q_UINT8) (((*accumulate++ + ((*srcpix++ * ycounter) >> 16)) * yrecip) >> 16);
-                *dstpix++ = (Q_UINT8) (((*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++ = (Q_UINT16) ((*srcpix++ * yfrac) >> 16);
-                *accumulate++ = (Q_UINT16) ((*srcpix++ * yfrac) >> 16);
-                *accumulate++ = (Q_UINT16) ((*srcpix++ * yfrac) >> 16);
-                *accumulate++ = (Q_UINT16) ((*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(Q_UINT8 *srcpix, Q_UINT8 *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++)
-    {
-        Q_UINT8 *srcrow0 = srcpix + y * srcpitch;
-        for (x = 0; x < dstwidth; x++)
-        {
-            Q_UINT8 *src = srcrow0 + xidx0[x] * 4;
-            int xm0 = xmult0[x];
-            int xm1 = xmult1[x];
-            *dstpix++ = (Q_UINT8) (((src[0] * xm0) + (src[4] * xm1)) >> 16);
-            *dstpix++ = (Q_UINT8) (((src[1] * xm0) + (src[5] * xm1)) >> 16);
-            *dstpix++ = (Q_UINT8) (((src[2] * xm0) + (src[6] * xm1)) >> 16);
-            *dstpix++ = (Q_UINT8) (((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(Q_UINT8 *srcpix, Q_UINT8 *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;
-        Q_UINT8 *srcrow0 = srcpix + yidx0 * srcpitch;
-        Q_UINT8 *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++ = (Q_UINT8) (((*srcrow0++ * ymult0) + (*srcrow1++ * ymult1)) >> 16);
-            *dstpix++ = (Q_UINT8) (((*srcrow0++ * ymult0) + (*srcrow1++ * ymult1)) >> 16);
-            *dstpix++ = (Q_UINT8) (((*srcrow0++ * ymult0) + (*srcrow1++ * ymult1)) >> 16);
-            *dstpix++ = (Q_UINT8) (((*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(Q_UINT8 *srcpix, Q_UINT8 *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(Q_UINT8 *srcpix, Q_UINT8 *dstpix, unsigned int width, unsigned int srcpitch, unsigned int dstpitch, unsigned int srcheight, unsigned int dstheight)
-{
-    Q_UINT16 *templine;
-    int srcdiff = srcpitch - (width * 4);
-    int dstdiff = dstpitch - (width * 4);
-
-    /* allocate and clear a memory area for storing the accumulator line */
-    templine = (Q_UINT16 *) 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(Q_UINT8 *srcpix, Q_UINT8 *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++)
-    {
-        Q_UINT8 *srcrow0 = srcpix + y * srcpitch;
-        Q_UINT8 *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(Q_UINT8 *srcpix, Q_UINT8 *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;
-        Q_UINT8 *srcrow0 = srcpix + yidx0 * srcpitch;
-        Q_UINT8 *srcrow1 = srcrow0 + srcpitch;
-        int ymult1 = 0x0100 * ((y * (srcheight - 1)) % dstheight) / dstheight;
-        int ymult0 = 0x0100 - ymult1;
-        Q_UINT8 *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)(Q_UINT8*, Q_UINT8*, 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
-	Q_UINT8* srcpix = (Q_UINT8*)bits();
-	Q_UINT8* dstpix = (Q_UINT8*)_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
-	Q_UINT8 *temppix = NULL;
-	int tempwidth=0, temppitch=0, tempheight=0;
-	if (srcwidth != dstwidth && srcheight != dstheight)
-	{
-		tempwidth = dstwidth;
-		temppitch = tempwidth << 2;
-		tempheight = srcheight;
-		temppix = (Q_UINT8 *) 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 3325e7b..0000000
--- a/lib/src/inject.cpp
+++ /dev/null
@@ -1,654 +0,0 @@
-/*
- * inject.cpp - functions for injecting code into winlogon.exe for disabling
- *              SAS (Alt+Ctrl+Del)
- *           
- * 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 "inject.h"
-#include "local_system.h"
-
-#ifdef 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_PTR) 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/isd_base.cpp b/lib/src/isd_base.cpp
deleted file mode 100644
index 06db821..0000000
--- a/lib/src/isd_base.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * isd_base.cpp - ISD-basics
- *
- * 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 <QtCore/QTime>
-#include <QtNetwork/QHostAddress>
-#include <QtNetwork/QTcpSocket>
-
-#include "isd_base.h"
-
-
-qint64 qtcpsocketDispatcher( char * _buf, const qint64 _len,
-				const socketOpCodes _op_code, void * _user )
-{
-	QTcpSocket * sock = static_cast<QTcpSocket *>( _user );
-	qint64 ret = 0;
-
-	QTime opStartTime;
-	opStartTime.start();
-
-	switch( _op_code )
-	{
-		case SocketRead:
-			while( ret < _len )
-			{
-				qint64 bytes_read = sock->read( _buf, _len );
-				if( bytes_read < 0 || opStartTime.elapsed() > 5000 )
-				{
-	qDebug( "qtcpsocketDispatcher(...): connection closed while reading" );
-					return( 0 );
-				}
-				else if( bytes_read == 0 )
-				{
-					if( sock->state() !=
-						QTcpSocket::ConnectedState )
-					{
-	qDebug( "qtcpsocketDispatcher(...): connection failed while reading "
-			"state:%d  error:%d", sock->state(), sock->error() );
-						return( 0 );
-					}
-					sock->waitForReadyRead( 10 );
-				}
-				else
-				{
-					ret += bytes_read;
-					opStartTime.restart();
-				}
-			}
-			break;
-		case SocketWrite:
-			while( ret < _len )
-			{
-				qint64 written = sock->write( _buf, _len );
-				if( written < 0 || opStartTime.elapsed() > 5000 )
-				{
-	qDebug( "qtcpsocketDispatcher(...): connection closed while writing" );
-					return( 0 );
-				}
-				else if( written == 0 )
-				{
-					if( sock->state() !=
-						QTcpSocket::ConnectedState )
-					{
-	qDebug( "qtcpsocketDispatcher(...): connection failed while writing  "
-			"state:%d error:%d", sock->state(), sock->error() );
-						return( 0 );
-					}
-				}
-				else
-				{
-					ret += written;
-					opStartTime.restart();
-				}
-			}
-			//sock->flush();
-			sock->waitForBytesWritten( 5000 );
-			break;
-		case SocketGetPeerAddress:
-			strncpy( _buf,
-		sock->peerAddress().toString().toUtf8().constData(), _len );
-			break;
-	}
-	return( ret );
-}
-
-
diff --git a/lib/src/isd_connection.cpp b/lib/src/isd_connection.cpp
deleted file mode 100644
index b8dfeb4..0000000
--- a/lib/src/isd_connection.cpp
+++ /dev/null
@@ -1,1037 +0,0 @@
-/*
- * isd_connection.cpp - client-implementation for ISD (iTALC Service Daemon)
- *
- * 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.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-/*#define NO_QTCPSOCKET_CONNECT*/
-
-
-#ifdef NO_QTCPSOCKET_CONNECT
-
-#include <stdio.h>
-
-#ifdef BUILD_WIN32
-
-#include <io.h>
-#include <winsock.h>
-#define lasterror WSAGetLastError()
-
-#else
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-
-#define lasterror errno
-
-#endif /* BUILD_WIN32 */
-
-#include <sys/types.h>
-
-#endif /* NO_QTCPSOCKET_CONNECT */
-
-
-#include <QtCore/QDir>
-#include <QtCore/QFileInfo>
-
-
-#include "isd_connection.h"
-#include "dsa_key.h"
-#include "local_system.h"
-
-
-static privateDSAKey * privDSAKey = NULL;
-
-ISD::userRoles __role = ISD::RoleOther;
-
-QByteArray __appInternalChallenge;
-
-
-bool isdConnection::initAuthentication( void )
-{
-	if( privDSAKey != NULL )
-	{
-		qWarning( "isdConnection::initAuthentication(): private key "
-							"already initialized" );
-		delete privDSAKey;
-		privDSAKey = NULL;
-	}
-
-	const QString priv_key_file = localSystem::privateKeyPath( __role );
-	if( priv_key_file == "" )
-	{
-		return( FALSE );
-	}
-	privDSAKey = new privateDSAKey( priv_key_file );
-
-	return( privDSAKey->isValid() );
-}
-
-
-
-
-// normal ctor
-isdConnection::isdConnection( const QString & _host, QObject * _parent ) :
-	QObject( _parent ),
-	m_socket( NULL ),
-	m_state( Disconnected ),
-	m_socketDev( qtcpsocketDispatcher, NULL ),
-	m_host( _host ),
-	m_port( PortOffsetISD ),
-	m_demoServerPort( 0 ),
-	m_user( "" )
-{
-	if( m_host.contains( ':' ) )
-	{
-		m_port = m_host.section( ':', 1, 1 ).toInt();
-		m_host = m_host.section( ':', 0, 0 );
-	}
-}
-
-
-
-
-isdConnection::~isdConnection()
-{
-	close();
-}
-
-
-
-
-#ifdef NO_QTCPSOCKET_CONNECT
-
-bool connectToHost( const QString & _host, int _port, QTcpSocket * _sock )
-{
-	static bool initialized = FALSE;
-	if( initialized == FALSE )
-	{
-		initialized = TRUE;
-#ifdef BUILD_WIN32
-		// Initialise WinPoxySockets on Win32
-		WORD wVersionRequested;
-		WSADATA wsaData;
-
-		wVersionRequested = MAKEWORD( 2, 0 );
-		if( WSAStartup( wVersionRequested, &wsaData ) != 0 )
-		{
-			return( FALSE );
-		}
-#else
-		// Disable the nasty read/write failure signals on UNIX
-		signal( SIGPIPE, SIG_IGN );
-#endif
-	}
-	const int one = 1;
-	int sock = socket( AF_INET, SOCK_STREAM, 0 );
-	// Create the socket
-	if( sock < 0 )
-	{
-		return( FALSE );
-	}
-
-	// Set the socket options:
-	if( setsockopt( sock, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
-							sizeof( one ) ) )
-	{
-		return( FALSE );
-	}
-	if( setsockopt( sock, IPPROTO_TCP, TCP_NODELAY, (char *) &one,
-							sizeof( one ) ) )
-	{
-		return FALSE;
-	}
-
-	// Create an address structure and clear it
-	struct sockaddr_in addr;
-	memset(&addr, 0, sizeof(addr));
-
-	// Fill in the address if possible
-	addr.sin_family = AF_INET;
-	addr.sin_addr.s_addr = inet_addr( _host.toUtf8().constData() );
-
-	// Was the string a valid IP address?
-	if( (signed int) addr.sin_addr.s_addr == -1 )
-	{
-		// No, so get the actual IP address of the host name specified
-		struct hostent *pHost;
-		pHost = gethostbyname( _host.toUtf8().constData() );
-		if( pHost != NULL )
-		{
-			if( pHost->h_addr == NULL )
-			{
-				return( FALSE );
-			}
-			addr.sin_addr.s_addr =
-				((struct in_addr *)pHost->h_addr)->s_addr;
-		}
-		else
-		{
-			return( FALSE );
-		}
-	}
-
-	// Put the socket into non-blocking mode
-#ifdef __WIN32__
-	u_long arg = 1;
-	if( ioctlsocket( sock, FIONBIO, &arg ) != 0 )
-	{
-		return( FALSE );
-	}
-#else
-	if( fcntl( sock, F_SETFL, O_NONBLOCK ) != 0 )
-	{
-		return( FALSE );
-	}
-#endif
-
-	// Set the port number in the correct format
-	addr.sin_port = htons( _port );
-
-	// Actually connect the socket
-	int res = connect( sock, (struct sockaddr *) &addr, sizeof( addr ) );
-	if( res < 0 )
-	{
-		if( lasterror ==
-	#ifdef BUILD_WIN32
-				WSAEWOULDBLOCK
-	#else
-				EINPROGRESS
-	#endif
-						)
-		{
-			do
-			{
-				fd_set s;
-				timeval tv;
-				tv.tv_sec = 3;
-				tv.tv_usec = 0;
-				FD_ZERO( &s );
-				FD_SET( sock, &s );
-				res = select( sock+1, NULL, &s, NULL, &tv );
-				if( res < 0 && lasterror != EINTR )
-				{
-					return( FALSE );
-				}
-				else if( res > 0 )
-				{
-					socklen_t lon = sizeof( int );
-					int valopt;
-					if( getsockopt( sock, SOL_SOCKET,
-							SO_ERROR,
-							(char *) &valopt,
-							&lon ) < 0 )
-					{
-						return( FALSE );
-					}
-					if( valopt )
-					{
-						return( FALSE );
-					}
-					break;
-				}
-				else	// timeout
-				{
-					return( FALSE );
-				}
-			} while( 1 );
-		}
-		else
-		{
-			return( FALSE );
-		}
-	}
-
-	_sock->setSocketDescriptor( sock );
-
-	return( TRUE );
-}
-#endif
-
-
-
-isdConnection::states isdConnection::open( void )
-{
-	if( m_state != Disconnected )
-	{
-		close();
-	}
-
-	m_state = Connecting;
-
-	// can use QTcpSocket's only in the same thread, therefore we must not
-	// create it in constructor as it is called by another thread than
-	// the thread actually using isdConnection
-	if( m_socket == NULL )
-	{
-		m_socket = new QTcpSocket;
-		m_socketDev.setUser( m_socket );
-	}
-
-#ifdef NO_QTCPSOCKET_CONNECT
-	if( !connectToHost( m_host, m_port, m_socket ) )
-#else
-	m_socket->connectToHost( m_host, m_port );
-	if( m_socket->error() == QTcpSocket::HostNotFoundError ||
-			m_socket->error() == QTcpSocket::NetworkError )
-#endif
-	{
-#ifdef BUILD_WIN32
-		localSystem::sleep( 2000 );
-#endif
-		return( m_state = HostUnreachable );
-	}
-
-#ifndef NO_QTCPSOCKET_CONNECT
-	m_socket->waitForConnected( 5000 );
-#endif
-
-	if( m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		qDebug( "isdConnection::open(): unable to connect to server "
-                               "on client %s:%i", m_host.toUtf8().constData(),
-								m_port );
-		if( m_socket->error() == QTcpSocket::ConnectionRefusedError )
-		{
-			return( m_state = ConnectionRefused );
-		}
-		return( m_state = HostUnreachable );
-	}
-
-	protocolInitialization();
-
-	if( m_state == Connecting || m_state == Connected )
-	{
-		return( m_state = Connected );
-	}
-
-	// something went wrong during initialization
-	close();
-
-	return( m_state );
-}
-
-
-
-
-void isdConnection::close( void )
-{
-	m_state = Disconnected;
-	if( m_socket != NULL )
-	{
-		//m_socket->disconnectFromHost();
-		m_socket->abort();
-		delete m_socket;
-		m_socket = NULL;
-	}
-
-	m_user = "";
-}
-
-
-
-
-void isdConnection::gracefulClose( void )
-{
-	if( m_socket != NULL )
-	{
-		m_socket->close();
-		delete m_socket;
-		m_socket = NULL;
-	}
-	close();
-}
-
-
-
-
-isdConnection::states isdConnection::reset( const QString & _host )
-{
-	close();
-
-	if( _host != "" )
-	{
-		m_host = _host;
-		if( m_host.contains( ':' ) )
-		{
-			m_port = m_host.section( ':', 1, 1 ).toInt();
-			m_host = m_host.section( ':', 0, 0 );
-		}
-	}
-
-	return open();
-}
-
-
-
-
-bool isdConnection::readFromServer( char * _out, const unsigned int _n )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = ConnectionFailed;
-		return( FALSE );
-	}
-
-	unsigned int bytes_done = 0;
-	int tries = 0;
-
-	while( bytes_done < _n )
-	{
-		int bytes_read = m_socket->read( _out + bytes_done,
-							_n - bytes_done );
-		if( bytes_read < 0 )
-		{
-			qWarning( "isdConnection::readFromServer(): "
-					"server closed connection: %d",
-							m_socket->error() );
-			close();
-			return( FALSE );
-		}
-		else if( bytes_read == 0 )
-		{
-			// could not read data because we're not connected
-			// anymore?
-			if( m_socket->state() != QTcpSocket::ConnectedState ||
-								++tries > 400 )
-			{
-				qWarning( "isdConnection::readFromServer(): "
-						"connection failed: %d",
-							m_socket->state() );
-				m_state = ConnectionFailed;
-				return( FALSE );
-			}
-			m_socket->waitForReadyRead( 50 );
-		}
-		else
-		{
-			bytes_done += bytes_read;
-			tries /= 2;
-		}
-	}
-
-	return( TRUE );
-}
-
-
-
-
-bool isdConnection::writeToServer( const char * _buf, const unsigned int _n )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = ConnectionFailed;
-		return( FALSE );
-	}
-
-	unsigned int bytes_done = 0;
-
-	while( bytes_done < _n )
-	{
-		int bytes_written = m_socket->write( _buf + bytes_done,
-							_n - bytes_done );
-		if( bytes_written < 0 )
-		{
-			qCritical( "isdConnection::writeToServer(...): "
-							"write(..) failed" );
-			close();
-			return( FALSE );
-		}
-		bytes_done += bytes_written;
-	}
-
-	return( m_socket->waitForBytesWritten( 100 ) );
-}
-
-
-
-
-long isdConnection::readCompactLen( void )
-{
-	Q_UINT8 b;
-
-	if( !readFromServer( (char *)&b, sizeof( b ) ) )
-	{
-		return( -1 );
-	}
-
-	long len = (int)b & 0x7F;
-	if( b & 0x80 )
-	{
-		if( !readFromServer( (char *)&b, sizeof( b ) ) )
-		{
-			return( -1 );
-		}
-		len |= ( (int)b & 0x7f ) << 7;
-		if( b & 0x80 )
-		{
-			if( !readFromServer( (char *)&b, 1 ) )
-			{
-				return( -1 );
-			}
-			len |= ( (int)b & 0xff ) << 14;
-		}
-	}
-
-	return( len );
-}
-
-
-
-
-isdConnection::states isdConnection::protocolInitialization( void )
-{
-	isdProtocolVersionMsg protocol_version;
-
-	if( !readFromServer( protocol_version, sz_isdProtocolVersionMsg ) )
-	{
-		return( m_state = ConnectionFailed );
-	}
-
-	protocol_version[sz_isdProtocolVersionMsg] = 0;
-
-	int major, minor;
-	if( sscanf( protocol_version, isdProtocolVersionFormat, &major,
-							&minor ) != 2 )
-	{
-		qCritical( "isdConnection::protocolInitialization(): "
-					"not a valid iTALC Service Daemon" );
-		return( m_state = InvalidServer );
-	}
-
-	if( !writeToServer( protocol_version, sz_isdProtocolVersionMsg ) )
-	{
-		return( m_state = ConnectionFailed );
-	}
-
-	return( authAgainstServer() );
-}
-
-
-
-
-isdConnection::states isdConnection::authAgainstServer(
-					const italcAuthTypes _try_auth_type )
-{
-	Q_UINT8 num_sec_types = 0;
-	if( !readFromServer( (char *)&num_sec_types, 1 )
-							|| num_sec_types < 1 )
-	{
-		return( m_state = ConnectionFailed );
-	}
-
-	bool auth_handled = FALSE;
-	bool italc_auth = FALSE;
-	for( Q_UINT8 i = 0; i < num_sec_types; ++i )
-	{
-		Q_UINT8 auth_type = 0;
-		if( !readFromServer( (char *)&auth_type, 1 ) )
-		{
-			return( m_state = ConnectionFailed );
-		}
-
-		if( auth_handled )
-		{
-			continue;
-		}
-
-		if( auth_type == rfbNoAuth )
-		{
-			qDebug( "no auth" );
-			if( !writeToServer( (char *)&auth_type, 1 ) )
-			{
-				return( m_state = ConnectionFailed );
-			}
-			auth_handled = TRUE;
-			continue;
-		}
-		else if( auth_type == rfbSecTypeItalc )
-		{
-			italc_auth = TRUE;
-			qDebug( "italcauth" );
-			if( !writeToServer( (char *)&auth_type, 1 ) )
-			{
-				return( m_state = ConnectionFailed );
-			}
-			int iat = m_socketDev.read().toInt();
-			if( _try_auth_type == ItalcAuthChallengeViaAuthFile ||
-			_try_auth_type == ItalcAuthAppInternalChallenge )
-			{
-				iat = _try_auth_type;
-			}
-			m_socketDev.write( QVariant( iat ) );
-
-			if( iat == ItalcAuthDSA || iat == ItalcAuthLocalDSA )
-			{
-				QByteArray chall =
-					m_socketDev.read().toByteArray();
-				m_socketDev.write( QVariant( (int) __role ) );
-				if( !privDSAKey )
-				{
-					isdConnection::initAuthentication();
-				}
-				m_socketDev.write( privDSAKey->sign( chall ) );
-			}
-			else if( iat == ItalcAuthAppInternalChallenge )
-			{
-				// wait for signal
-				m_socketDev.read();
-				m_socketDev.write( QVariant(
-					__appInternalChallenge ) );
-			}
-			else if( iat == ItalcAuthChallengeViaAuthFile )
-			{
-				QFile file( m_socketDev.read().toString() );
-				file.open( QFile::ReadOnly );
-				m_socketDev.write( QVariant(
-							file.readAll() ) );
-			}
-			else if( iat == ItalcAuthHostBased )
-			{
-			}
-			else if( iat == ItalcAuthNone )
-			{
-			}
-			else
-			{
-	qCritical( "isdConnection::authAgainstServer(): "
-					"unhandled italc-auth-mechanism!" );
-			}
-			auth_handled = TRUE;
-		}
-		// even last security type not handled?
-		else if( i == num_sec_types - 1 )
-		{
-			qCritical( "isdConnection::authAgainstServer(): "
-					"unknown sec-type for authentication: "
-						"%d", (int) auth_type );
-			m_state = AuthFailed;
-		}
-	}
-
-	if( m_state == Connecting )
-	{
-		if( italc_auth )
-		{
-			const uint res = m_socketDev.read().toUInt();
-			if( res != ItalcAuthOK )
-			{
-				return( m_state = AuthFailed );
-			}
-		}
-		else
-		{
-			uint32_t res = 0;
-			if( !readFromServer( (char *)&res, 4 ) )
-			{
-				return( m_state = ConnectionFailed );
-			}
-			if( res != rfbVncAuthOK )
-			{
-				return( m_state = AuthFailed );
-			}
-			
-		}
-	}
-
-	return( m_state );
-}
-
-
-
-
-bool isdConnection::handleServerMessage( Q_UINT8 _msg )
-{
-	if( _msg == rfbItalcServiceResponse )
-	{
-		Q_UINT8 cmd;
-		if( !readFromServer( (char *) &cmd, sizeof( cmd ) ) )
-		{
-			return( FALSE );
-		}
-		switch( cmd )
-		{
-			case ISD::UserInformation:
-			{
-				ISD::msg m( &m_socketDev );
-				m.receive();
-				m_user = m.arg( "username" ).toString();
-				m_userHomeDir = m.arg( "homedir" ).toString();
-				break;
-			}
-
-/*			case ISD::DemoServer_PortInfo:
-			{
-				ISD::msg m( &m_socketDev );
-				m.receive();
-				m_demoServerPort =
-					m.arg( "demoserverport" ).toInt();
-				break;
-			}*/
-
-			default:
-	qCritical( "isdConnection::handleServerMessage(): unknown server "
-						"response %d", (int) cmd );
-				return( FALSE );
-		}
-	}
-	else
-	{
-		qCritical( "isdConnection::handleServerMessage(): unknown "
-				"message type %d from server. Closing "
-				"connection. Will re-open it later.", _msg );
-		close();
-		return( FALSE );
-	}
-
-	return( TRUE );
-}
-
-
-
-
-bool isdConnection::sendGetUserInformationRequest( void )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::GetUserInformation ).send() );
-}
-
-
-
-
-bool isdConnection::execCmds( const QString & _cmd )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::ExecCmds ).
-					addArg( "cmds", _cmd ).send() );
-}
-
-
-
-
-bool isdConnection::startDemo( const QString & _port, bool _full_screen )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, _full_screen ?
-			ISD::StartFullScreenDemo : ISD::StartWindowDemo ).
-					addArg( "port", _port ).send() );
-}
-
-
-
-
-bool isdConnection::stopDemo( void )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::StopDemo ).send() );
-}
-
-
-
-
-bool isdConnection::lockDisplay( void )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::LockDisplay ).send() );
-}
-
-
-
-
-bool isdConnection::unlockDisplay( void )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::UnlockDisplay ).send() );
-}
-
-
-
-
-bool isdConnection::logonUser( const QString & _uname, const QString & _pw,
-						const QString & _domain )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::LogonUserCmd ).
-				addArg( "uname", _uname ).
-				addArg( "passwd", _pw ).
-				addArg( "domain", _domain ).send() );
-}
-
-
-
-
-bool isdConnection::logoutUser( void )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::LogoutUser ).send() );
-}
-
-
-
-
-bool isdConnection::displayTextMessage( const QString & _msg )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::DisplayTextMessage ).
-					addArg( "msg", _msg ).send() );
-}
-
-
-
-
-bool isdConnection::sendFile( const QString & _fname )
-{
-	return( TRUE );
-}
-
-
-
-
-bool isdConnection::collectFiles( const QString & _nfilter )
-{
-	return( TRUE );
-}
-
-
-
-
-bool isdConnection::wakeOtherComputer( const QString & _mac )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::WakeOtherComputer ).
-					addArg( "mac", _mac ).send() );
-}
-
-
-
-
-bool isdConnection::powerDownComputer( void )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::PowerDownComputer ).send() );
-}
-
-
-
-
-bool isdConnection::restartComputer( void )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::RestartComputer ).send() );
-}
-
-
-
-
-bool isdConnection::disableLocalInputs( bool _disabled )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::DisableLocalInputs ).
-				addArg( "disabled", _disabled ).send() );
-}
-
-
-
-
-bool isdConnection::setRole( const ISD::userRoles _role )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::SetRole ).
-					addArg( "role", _role ).send() );
-}
-
-
-
-
-bool isdConnection::demoServerRun( int _quality, int _port )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	m_demoServerPort = _port;
-	return( ISD::msg( &m_socketDev, ISD::DemoServer_Run ).
-					addArg( "port", _port ).
-					addArg( "quality", _quality ).send() );
-}
-
-
-
-
-bool isdConnection::demoServerAllowClient( const QString & _client )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::DemoServer_AllowClient ).
-					addArg( "client", _client ).send() );
-}
-
-
-
-
-bool isdConnection::demoServerDenyClient( const QString & _client )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::DemoServer_DenyClient ).
-					addArg( "client", _client ).send() );
-}
-
-
-
-
-bool isdConnection::hideTrayIcon( void )
-{
-	if( m_socket == NULL ||
-			m_socket->state() != QTcpSocket::ConnectedState )
-	{
-		m_state = Disconnected;
-		return( FALSE );
-	}
-	return( ISD::msg( &m_socketDev, ISD::HideTrayIcon ).send() );
-}
-
-
-
-
-bool isdConnection::handleServerMessages( void )
-{
-	while( hasData() )
-	{
-
-		rfbServerToClientMsg msg;
-		if( !readFromServer( (char *) &msg, sizeof( Q_UINT8 ) ) )
-		{
-			qCritical( "isdConnection::handleServerMessage(): "
-						"reading message-type failed" );
-			return( FALSE );
-		}
-
-		if( handleServerMessage( msg.type ) == FALSE )
-		{
-			return( FALSE );
-		}
-
-	}
-
-	return( TRUE );
-}
-
-
-
-#include "isd_connection.moc"
-
diff --git a/lib/src/ivs_connection.cpp b/lib/src/ivs_connection.cpp
deleted file mode 100644
index 05cb3f9..0000000
--- a/lib/src/ivs_connection.cpp
+++ /dev/null
@@ -1,1837 +0,0 @@
-/*
- * ivs_connection.cpp - class ivsConnection, an implementation of the 
- *                      RFB-protocol with iTALC-extensions for Qt
- *
- * 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.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <cstring>
-
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDateTime>
-#include <QtGui/QImage>
-#include <QtGui/QPainter>
-
-
-#include "ivs_connection.h"
-#include "QuadTree.h"
-#include "local_system.h"
-#include "messagebox.h"
-
-#include "minilzo.h"
-
-
-static const rfbPixelFormat __localDisplayFormat =
-{
-	32, 		// bit per pixel
-	32,		// depth
-#ifdef WORDS_BIGENDIAN
-	1,		// big endian
-#else
-	0,		// big endian
-#endif
-	1,		// true color
-	255,		// red max
-	255,		// green max
-	255,		// blue max
-	16,		// red shift
-	8,		// green shift
-	0,		// blue shift,
-	0, 0		// only for padding
-} ;
-
-
-
-
-// =============================================================================
-// implementation of IVS-connection
-// =============================================================================
-
-
-// normal ctor
-ivsConnection::ivsConnection( const QString & _host, quality _q,
-							bool _use_auth_file,
-							QObject * _parent ) :
-	isdConnection( ( _host.contains( ':' ) ? _host : _host + ":5900" ),
-								_parent ),
-	m_isDemoServer( FALSE ),
-	m_useAuthFile( _use_auth_file ),
-	m_quality( _q ),
-	m_imageLock(),
-	m_screen(),
-	m_scaledScreen(),
-	m_scaledScreenNeedsUpdate( FALSE ),
-	m_scaledSize(),
-	m_softwareCursor( FALSE ),
-	m_cursorPos( 0, 0 ),
-	m_cursorShape(),
-	m_rawBufferSize( -1 ),
-	m_rawBuffer( NULL ),
-	m_decompStreamInited( FALSE )
-{
-#ifdef HAVE_LIBZ
-	m_zlibStreamActive[0] = m_zlibStreamActive[1] = m_zlibStreamActive[2] =
-						m_zlibStreamActive[3] = FALSE;
-#endif
-
-	qRegisterMetaType<RectList>( "RectList" );
-}
-
-
-
-
-ivsConnection::~ivsConnection()
-{
-	delete[] m_rawBuffer;
-}
-
-
-
-
-ivsConnection::states ivsConnection::protocolInitialization( void )
-{
-	rfbProtocolVersionMsg protocol_version;
-
-	if( !readFromServer( protocol_version, sz_rfbProtocolVersionMsg ) )
-	{
-		return( state_ref() = ConnectionFailed );
-	}
-
-	protocol_version[sz_rfbProtocolVersionMsg] = 0;
-
-	int major, minor;
-	if( sscanf( protocol_version, rfbProtocolVersionFormat, &major,
-							&minor ) != 2 )
-	{
-		// not a standard VNC server - check whether it is an iTALC-
-		// demo-server
-		if( sscanf( protocol_version, idsProtocolVersionFormat, &major,
-							&minor ) != 2 )
-		{
-			qCritical( "not a server I can deal with" );
-			return( state_ref() = InvalidServer );
-		}
-		m_isDemoServer = TRUE;
-	}
-
-	if( !writeToServer( protocol_version, sz_rfbProtocolVersionMsg ) )
-	{
-		return( state_ref() = ConnectionFailed );
-	}
-
-	if( authAgainstServer( m_quality >= QualityDemoLow ?
-				m_useAuthFile ?
-					ItalcAuthChallengeViaAuthFile
-					:
-					ItalcAuthAppInternalChallenge
-				:
-				ItalcAuthNone
-						) != Connecting )
-	{
-		return( state() );
-	}
-
-
-	const rfbClientInitMsg ci = { 1 };
-
-	if( !writeToServer( (const char *) &ci, sizeof( ci ) ) )
-	{
-		return( state_ref() = ConnectionFailed );
-	}
-
-	if( !readFromServer( (char *)&m_si, sizeof( m_si ) ) )
-	{
-		return( state_ref() = ConnectionFailed );
-	}
-
-	m_si.framebufferWidth = swap16IfLE( m_si.framebufferWidth );
-	m_si.framebufferHeight = swap16IfLE( m_si.framebufferHeight );
-	m_si.format.redMax = swap16IfLE( m_si.format.redMax );
-	m_si.format.greenMax = swap16IfLE( m_si.format.greenMax );
-	m_si.format.blueMax = swap16IfLE( m_si.format.blueMax );
-	m_si.nameLength = swap32IfLE( m_si.nameLength );
-
-	char * desktop_name = new char[m_si.nameLength+1];
-
-	if( !readFromServer( desktop_name, m_si.nameLength ) )
-	{
-		delete[] desktop_name;
-		return( state_ref() = ConnectionFailed );
-	}
-
-	//desktop_name[m_si.nameLength] = 0;
-	delete[] desktop_name;
-
-
-	rfbSetPixelFormatMsg spf;
-
-	spf.type = rfbSetPixelFormat;
-	spf.format = __localDisplayFormat;
-	spf.format.redMax = swap16IfLE( spf.format.redMax );
-	spf.format.greenMax = swap16IfLE( spf.format.greenMax );
-	spf.format.blueMax = swap16IfLE( spf.format.blueMax );
-
-	if( !writeToServer( (const char *) &spf, sizeof( spf ) ) )
-	{
-		return( state_ref() = ConnectionFailed );
-	}
-
-
-	char buf[sizeof( rfbSetPixelFormatMsg ) + MAX_ENCODINGS *
-							sizeof( Q_UINT32 )];
-	rfbSetEncodingsMsg * se = (rfbSetEncodingsMsg *) buf;
-	se->type = rfbSetEncodings;
-	se->nEncodings = 0;
-
-	Q_UINT32 * encs = (Q_UINT32 *)( &buf[sizeof(rfbSetEncodingsMsg)] );
-
-	if( m_quality >= QualityDemoLow )
-	{
-		encs[se->nEncodings++] = swap32IfLE( rfbEncodingRaw );
-	}
-	else
-	{
-#ifdef HAVE_LIBZ
-#ifdef HAVE_LIBJPEG
-		encs[se->nEncodings++] = swap32IfLE( rfbEncodingTight );
-#endif
-		encs[se->nEncodings++] = swap32IfLE( rfbEncodingZlib );
-#endif
-		encs[se->nEncodings++] = swap32IfLE( rfbEncodingCoRRE );
-		encs[se->nEncodings++] = swap32IfLE( rfbEncodingCopyRect );
-		encs[se->nEncodings++] = swap32IfLE( rfbEncodingRaw );
-		encs[se->nEncodings++] = swap32IfLE( rfbEncodingRichCursor );
-		//encs[se->nEncodings++] = swap32IfLE( rfbEncodingXCursor );
-		encs[se->nEncodings++] = swap32IfLE( rfbEncodingPointerPos );
-		//encs[se->nEncodings++] = swap32IfLE( rfbEncodingRRE );
-#ifdef HAVE_LIBZ
-#ifdef HAVE_LIBJPEG
-		switch( m_quality )
-		{
-			case QualityLow:
-				encs[se->nEncodings++] = swap32IfLE(
-						rfbEncodingQualityLevel4 );
-				break;
-			case QualityMedium:
-				encs[se->nEncodings++] = swap32IfLE(
-						rfbEncodingQualityLevel9 );
-				break;
-			case QualityHigh:
-				// no JPEG
-				break;
-			default:
-				break;
-		}
-#endif
-		encs[se->nEncodings++] = swap32IfLE(
-						rfbEncodingCompressLevel4 );
-#endif
-	}
-
-	//encs[se->nEncodings++] = swap32IfLE( rfbEncodingLastRect );
-	encs[se->nEncodings++] = swap32IfLE( rfbEncodingItalc );
-	encs[se->nEncodings++] = swap32IfLE( rfbEncodingItalcCursor );
-
-
-	unsigned int len = sizeof( rfbSetEncodingsMsg ) +
-					se->nEncodings * sizeof( Q_UINT32 );
-
-	se->nEncodings = swap16IfLE( se->nEncodings );
-
-	if( !writeToServer( buf, len ) )
-	{
-		return( state_ref() = ConnectionFailed );
-	}
-
-	state_ref() = Connected;
-
-	m_screen = QImage( m_si.framebufferWidth, m_si.framebufferHeight,
-							QImage::Format_RGB32 );
-	m_screen.fill( Qt::black );
-
-	sendFramebufferUpdateRequest();
-	sendGetUserInformationRequest();
-	return( state() );
-}
-
-
-
-
-void ivsConnection::close( void )
-{
-#ifdef HAVE_LIBZ
-	m_zlibStreamActive[0] = m_zlibStreamActive[1] = m_zlibStreamActive[2] =
-						m_zlibStreamActive[3] = FALSE;
-#endif
-	isdConnection::close();
-}
-
-
-
-
-bool ivsConnection::takeSnapshot( void )
-{
-	if( state() != ivsConnection::Connected )
-	{
-		return( FALSE );
-	}
-
-	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 + "@" + host() + " " +
-			QDate( QDate::currentDate() ).toString( Qt::ISODate ) +
-			" " + QTime( QTime::currentTime() ).
-							toString( Qt::ISODate );
-	const QString dir = localSystem::snapshotDir();
-	if( !localSystem::ensurePathExists( dir ) )
-	{
-		messageBox::information( tr( "Snapshot" ),
-			tr( "Could not take a snapshot as directory %1 doesn't "
-				"exist and couldn't be created." ).arg( dir ) );
-		return( FALSE );
-	}
-
-	// construct filename
-	QString file_name =  "_" + host() + "_" + QDate( QDate::currentDate() ).
-						toString( Qt::ISODate ) +
-				"_" + QTime( QTime::currentTime() ).
-					toString( Qt::ISODate ) + ".png";
-	file_name.replace( ':', '-' );
-	file_name = dir + u.section( '(', 1, 1 ).section( ')', 0, 0 ) +
-								file_name;
-	const int FONT_SIZE = 14;
-	const int RECT_MARGIN = 10;
-	const int RECT_INNER_MARGIN = 5;
-
-	QImage img( screen() );
-
-	QPixmap italc_icon( QPixmap(
-			":/resources/client_observed.png" ) );
-
-	QPainter p( &img );
-	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 = img.height() - RECT_MARGIN - 2 * RECT_INNER_MARGIN -
-								FONT_SIZE;
-	const int rw = RECT_MARGIN + 4 * RECT_INNER_MARGIN +
-				fm.size( Qt::TextSingleLine, txt ).width() +
-							italc_icon.width();
-	const int rh = 2 * RECT_INNER_MARGIN + FONT_SIZE;
-	const int ix = rx + RECT_INNER_MARGIN;
-	const int iy = ry + RECT_INNER_MARGIN;
-	const int tx = ix + italc_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, 128 ) );
-	p.drawPixmap( ix, iy, italc_icon );
-	p.drawText( tx, ty, txt );
-	img.save( file_name, "PNG", 50 );
-
-	return( TRUE );
-}
-
-
-
-
-bool ivsConnection::sendFramebufferUpdateRequest( void )
-{
-	return( sendFramebufferUpdateRequest( 0, 0, m_si.framebufferWidth,
-					m_si.framebufferHeight, FALSE ) );
-}
-
-
-
-
-bool ivsConnection::sendIncrementalFramebufferUpdateRequest( void )
-{
-	return( sendFramebufferUpdateRequest( 0, 0, m_si.framebufferWidth,
-					m_si.framebufferHeight, TRUE ) );
-}
-
-
-
-
-bool ivsConnection::sendFramebufferUpdateRequest( Q_UINT16 _x, Q_UINT16 _y,
-				Q_UINT16 _w, Q_UINT16 _h, bool _incremental )
-{
-	if( state() != Connected )
-	{
-		return( FALSE );
-	}
-
-	rfbFramebufferUpdateRequestMsg fur;
-
-	fur.type = rfbFramebufferUpdateRequest;
-	fur.incremental = ( _incremental ) ? 1 : 0;
-	fur.x = swap16IfLE( _x );
-	fur.y = swap16IfLE( _y );
-	fur.w = swap16IfLE( _w );
-	fur.h = swap16IfLE( _h );
-
-	return( writeToServer( (char *) &fur, sizeof( fur ) ) );
-}
-
-
-
-
-bool ivsConnection::sendPointerEvent( Q_UINT16 _x, Q_UINT16 _y,
-							Q_UINT16 _button_mask )
-{
-	if( state() != Connected )
-	{
-		return( FALSE );
-	}
-
-	rfbPointerEventMsg pe;
-
-	pe.type = rfbPointerEvent;
-	pe.buttonMask = _button_mask;
-	//if (_x < 0) _x = 0;
-	//if (_y < 0) _y = 0;
-	pe.x = swap16IfLE( _x );
-	pe.y = swap16IfLE( _y );
-
-	// make sure our own pointer is updated when remote-controlling
-	handleCursorPos( _x, _y );
-
-	return( writeToServer( (char *) &pe, sizeof( pe ) ) );
-}
-
-
-
-
-bool ivsConnection::sendKeyEvent( Q_UINT32 key, bool down )
-{
-	if( state() != Connected )
-	{
-		return( FALSE );
-	}
-
-	rfbKeyEventMsg ke;
-
-	ke.type = rfbKeyEvent;
-	ke.down = ( down )? 1 : 0;
-	ke.key = swap32IfLE( key );
-
-	return( writeToServer( (char *) &ke, sizeof( ke ) ) );
-}
-
-
-
-
-void ivsConnection::postRegionChangedEvent( const RectList &rgn )
-{
-	if( parent() != NULL )
-	{
-		regionChangedEvent * rche = new regionChangedEvent( rgn );
-		QCoreApplication::postEvent( parent(), rche );
-	}
-}
-
-
-
-
-void ivsConnection::rescaleScreen( void )
-{
-	if( m_scaledScreenNeedsUpdate )
-	{
-		QWriteLocker swl( &m_scaledImageLock );
-		if( m_scaledScreen.size() != m_scaledSize )
-		{
-			m_scaledScreen = QImage( m_scaledSize,
-							QImage::Format_RGB32 );
-		}
-		if( m_screen.size().isValid() )
-		{
-			m_screen.scaleTo( m_scaledScreen );
-		}
-		else
-		{
-			m_scaledScreen.fill( Qt::black );
-		}
-		m_scaledScreenNeedsUpdate = FALSE;
-	}
-}
-
-
-
-
-bool ivsConnection::handleServerMessages( bool _send_screen_update, int _tries )
-{
-	while( hasData() && --_tries >= 0 )
-	{
-
-	rfbServerToClientMsg msg;
-	if( !readFromServer( (char *) &msg, sizeof( Q_UINT8 ) ) )
-	{
-		qWarning( "ivsConnection::handleServerMessage(...): "
-						"reading message-type failed" );
-		return( FALSE );
-	}
-	switch( msg.type )
-	{
-		case rfbSetColourMapEntries:
-			qWarning( "ivsConnection::handleServerMessage(...): "
-			"setting colormap entries requested - ignoring" );
-			break;
-
-		case rfbFramebufferUpdate:
-		{
-			QWriteLocker wl( &m_imageLock );
-			if( !readFromServer( ( (char *)&msg.fu ) + 1,
-				sizeof( rfbFramebufferUpdateMsg ) - 1 ) )
-			{
-	qCritical( "ivsConnection::handleServerMessage(...): "
-			"reading framebuffer-update-msg failed" );
-				return( FALSE );
-			}
-
-			msg.fu.nRects = swap16IfLE( msg.fu.nRects );
-
-			RectList updated_region;
-
-			rfbFramebufferUpdateRectHeader rect;
-			for( int i = 0; i < msg.fu.nRects; i++ )
-			{
-				if( !readFromServer( (char *)&rect,
-							sizeof( rect ) ) )
-				{
-					return( FALSE );
-				}
-
-				rect.r.x = swap16IfLE( rect.r.x );
-				rect.r.y = swap16IfLE( rect.r.y );
-				rect.r.w = swap16IfLE( rect.r.w );
-				rect.r.h = swap16IfLE( rect.r.h );
-
-				rect.encoding = swap32IfLE( rect.encoding );
-				if( rect.encoding == rfbEncodingLastRect )
-				{
-					break;
-				}
-
-				if( ( rect.r.x + rect.r.w >
-						m_si.framebufferWidth ) ||
-				    ( rect.r.y + rect.r.h >
-						m_si.framebufferHeight ) )
-				{
-	qWarning( "ivsConnection::handleServerMessage(...): "
-			"rect too large: %dx%d at (%d, %d) (encoding: %d)",
-			rect.r.w, rect.r.h, rect.r.x, rect.r.y, rect.encoding );
-					return( FALSE );
-				}
-
-				if ( rect.encoding != rfbEncodingPointerPos &&
-				rect.encoding != rfbEncodingXCursor &&
-				rect.encoding != rfbEncodingRichCursor )
-				{
-					if( ( rect.r.h * rect.r.w ) == 0 )
-					{
-	qWarning( "ivsConnection::handleServerMessage(...): zero size rect - "
-								"ignoring" );
-						continue;
-					}
-					updated_region += QRect( rect.r.x,
-								rect.r.y,
-								rect.r.w,
-								rect.r.h );
-				}
-				else
-				{
-					m_softwareCursor = TRUE;
-				}
-
-				switch( rect.encoding )
-				{
-					case rfbEncodingRaw:
-		if( !handleRaw( rect.r.x, rect.r.y, rect.r.w, rect.r.h ) )
-		{
-			return( FALSE );
-		}
-		break;
-
-					case rfbEncodingCopyRect:
-					{
-		rfbCopyRect cr;
-		if( !readFromServer( (char *) &cr, sizeof( cr ) ) )
-		{
-			return( FALSE );
-		}
-		cr.srcX = swap16IfLE( cr.srcX );
-		cr.srcY = swap16IfLE( cr.srcY );
-
-		m_screen.copyExistingRect( cr.srcX, cr.srcY, rect.r.w,
-						rect.r.h, rect.r.x, rect.r.y );
-		break;
-					}
-
-					case rfbEncodingRRE:
-		if( !handleRRE( rect.r.x, rect.r.y, rect.r.w, rect.r.h ) )
-		{
-			return( FALSE );
-		}
-		break;
-
-					case rfbEncodingCoRRE:
-		if( !handleCoRRE( rect.r.x, rect.r.y, rect.r.w, rect.r.h ) )
-		{
-			return( FALSE );
-		}
-		break;
-#ifdef HAVE_LIBZ
-					case rfbEncodingZlib:
-		if( !handleZlib( rect.r.x, rect.r.y, rect.r.w, rect.r.h ) )
-		{
-				return( FALSE );
-		}
-		break;
-					case rfbEncodingTight:
-		if( !handleTight( rect.r.x, rect.r.y, rect.r.w, rect.r.h ) )
-		{
-				return( FALSE );
-		}
-		break;
-#endif
-					case rfbEncodingPointerPos:
-		if( !handleCursorPos( rect.r.x, rect.r.y ) )
-		{
-				return( FALSE );
-		}
-		break;
-
-					case rfbEncodingRichCursor:
-					case rfbEncodingXCursor:
-		if( !handleCursorShape( rect.r.x, rect.r.y, rect.r.w,
-						rect.r.h, rect.encoding ) )
-		{
-				return( FALSE );
-		}
-		break;
-
-					case rfbEncodingItalc:
-		if( !handleItalc( rect.r.x, rect.r.y, rect.r.w, rect.r.h ) )
-		{
-			return( FALSE );
-		}
-		break;
-
-					case rfbEncodingItalcCursor:
-	{
-		RectList ch_reg;
-		ch_reg += QRect( m_cursorPos - m_cursorHotSpot,
-							m_cursorShape.size() );
-		m_cursorLock.lockForWrite();
-		//m_cursorShape = socketDev().read().value<QImage>();
-		QDataStream ds( static_cast<QTcpSocket *>(
-							socketDev().user() ) );
-		ds >> m_cursorShape;
-		m_cursorLock.unlock();
-		m_cursorHotSpot = QPoint( rect.r.x, rect.r.y );
-
-
-		ch_reg += QRect( m_cursorPos - m_cursorHotSpot,
-							m_cursorShape.size() );
-
-		// make sure, area around old cursor is updated and new cursor
-		// is painted
-		postRegionChangedEvent( ch_reg );
-		break;
-	}
-
-					default:
-		qCritical( "ivsConnection::handleServerMessage(...): "
-				"unknown rect encoding %d",
-							(int) rect.encoding );
-		close();
-		return( FALSE );
-				}
-			}
-
-			if( updated_region.isEmpty() )
-			{
-				wl.unlock();
-				break;
-			}
-
-			m_scaledScreenNeedsUpdate = TRUE;
-
-			if( m_quality >= QualityDemoLow &&
-						m_quality != QualityDemoHigh )
-			{
-	const QRgb and_value = ( m_quality == QualityDemoLow ) ?
-							0xf8f8f8 : 0xfcfcfc;
-				// if we're providing data for demo-purposes,
-				// we perform a simple color-reduction for
-				// better compression-results
-	QuadTree q( 0, 0, m_screen.width()-1, m_screen.height()-1, 4 );
-	q.addRects( updated_region );
-	const QVector<QuadTreeRect> rects = q.rects();
-	for( QVector<QuadTreeRect>::const_iterator it = rects.begin();
-					it != rects.end(); ++it )
-	{
-		for( int y = it->y1(); y <= it->y2(); ++y )
-		{
-			QRgb * data = ( (QRgb *) m_screen.scanLine( y ) );
-			for( Q_UINT16 x = it->x1(); x <= it->x2(); ++x )
-			{
-				data[x] &= and_value;
-			}
-		}
-	}
-			}
-			postRegionChangedEvent( updated_region );
-
-			wl.unlock();
-			emit regionUpdated( updated_region );
-
-			break;
-		}
-
-		case rfbBell:
-			// FIXME: bell-action
-			break;
-
-		case rfbServerCutText:
-		{
-			if( !readFromServer( ( (char *) &msg ) + 1,
-					sizeof( rfbServerCutTextMsg ) - 1 ) )
-			{
-				return( FALSE );
-			}
-			msg.sct.length = swap32IfLE( msg.sct.length );
-			char * server_cut_text = new char[msg.sct.length+1];
-			if( !readFromServer( server_cut_text, msg.sct.length ) )
-			{
-				delete[] server_cut_text;
-				return( FALSE );
-			}
-			delete[] server_cut_text;
-			break;
-    		}
-
-		default:
-			if( !isdConnection::handleServerMessage( msg.type ) )
-			{
-				return( FALSE );
-			}
-	}
-
-	}	// end while( ... )
-
-	if( !m_scaledSize.isEmpty() )
-	{
-		rescaleScreen();
-	}
-
-	if( _send_screen_update )
-	{
-		return( sendIncrementalFramebufferUpdateRequest() );
-	}
-
-	return( TRUE );
-}
-
-
-
-
-
-// =============================================================================
-// functions for decoding rects
-// =============================================================================
-
-
-bool ivsConnection::handleRaw( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw,
-								Q_UINT16 rh )
-{
-	const int bytes_per_line = rw * sizeof( QRgb );
-	Q_UINT16 lines_to_read = BUFFER_SIZE / bytes_per_line;
-	const Q_UINT16 img_width = m_screen.width();
-	while( rh > 0 )
-	{
-		if( lines_to_read > rh )
-		{
-			lines_to_read = rh;
-		}
-		if( !readFromServer( m_buffer, bytes_per_line *
-							lines_to_read ) )
-		{
-			return( FALSE );
-		}
-		const QRgb * src = (const QRgb *) m_buffer;
-		QRgb * dst = (QRgb *) m_screen.scanLine( ry ) + rx;
-		for( Q_UINT16 y = 0; y < lines_to_read; ++y )
-		{
-			memcpy( dst, src, rw * sizeof( QRgb ) );
-			src += rw;
-			dst += img_width;
-		}
-		rh -= lines_to_read;
-		ry += lines_to_read;
-	}
-	return( TRUE );
-}
-
-
-
-
-bool ivsConnection::handleCoRRE( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw,
-								Q_UINT16 rh )
-{
-	rfbRREHeader hdr;
-
-	if( !readFromServer( (char *) &hdr, sizeof( hdr ) ) )
-	{
-		return( FALSE );
-	}
-
-	hdr.nSubrects = swap32IfLE( hdr.nSubrects );
-
-	QRgb pix;
-	if( !readFromServer( (char *) &pix, sizeof( pix ) ) )
-	{
-		return( FALSE );
-	}
-
-	m_screen.fillRect( rx, ry, rw, rh, pix );
-
-	if( !readFromServer( m_buffer, hdr.nSubrects *
-				( sizeof( rfbCoRRERectangle) +
-						sizeof( Q_UINT32 ) ) ) )
-	{
-		return( FALSE );
-	}
-
-	Q_UINT8 * ptr = (Q_UINT8 *) m_buffer;
-
-	for( Q_UINT32 i = 0; i < hdr.nSubrects; i++ )
-	{
-		pix = *(QRgb *) ptr;
-		ptr += sizeof( pix );
-		Q_UINT8 x = *ptr++;
-		Q_UINT8 y = *ptr++;
-		Q_UINT8 w = *ptr++;
-		Q_UINT8 h = *ptr++;
-		m_screen.fillRect( rx+x, ry+y, w, h, pix );
-	}
-
-	return( TRUE );
-}
-
-
-
-bool ivsConnection::handleRRE( Q_UINT16, Q_UINT16, Q_UINT16, Q_UINT16 )
-{
-	qCritical( "ivsConnection:handleRRE(...): got RRE-encoded rect. "
-							"Can't decode." );
-	return( TRUE );
-}
-
-
-#define RGB_TO_PIXEL(r,g,b)						\
-  (((Q_UINT32)(r) & __localDisplayFormat.redMax ) <<			\
-				__localDisplayFormat.redShift |		\
-   ((Q_UINT32)(g) & __localDisplayFormat.greenMax ) << 			\
-				__localDisplayFormat.greenShift |	\
-   ((Q_UINT32)(b) & __localDisplayFormat.blueMax ) <<			\
-				__localDisplayFormat.blueShift )
-
-
-#define RGB24_TO_PIXEL(r,g,b)                                       	\
-   ((((uint32_t)(r) & 0xFF) * __localDisplayFormat.redMax + 127) / 255             \
-    << __localDisplayFormat.redShift |                                              \
-    (((uint32_t)(g) & 0xFF) * __localDisplayFormat.greenMax + 127) / 255           \
-    << __localDisplayFormat.greenShift |                                            \
-    (((uint32_t)(b) & 0xFF) * __localDisplayFormat.blueMax + 127) / 255            \
-    << __localDisplayFormat.blueShift)
-
-#ifdef HAVE_LIBZ
-
-
-bool ivsConnection::handleZlib( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw,
-								Q_UINT16 rh )
-{
-	/* 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( m_rawBufferSize <  (int) rw * rh * 4 )
-	{
-		delete[] m_rawBuffer;
-		m_rawBufferSize = (int) rw * rh * 4;
-		m_rawBuffer = new char[m_rawBufferSize];
-	}
-
-	rfbZlibHeader hdr;
-	if( !readFromServer( (char *) &hdr, sz_rfbZlibHeader ) )
-	{
-		return( FALSE );
-	}
-
-	int remaining = swap32IfLE( hdr.nBytes );
-
-	// Need to initialize the decompressor state
-	m_decompStream.next_in   = ( Bytef * ) m_buffer;
-	m_decompStream.avail_in  = 0;
-	m_decompStream.next_out  = ( Bytef * ) m_rawBuffer;
-	m_decompStream.avail_out = m_rawBufferSize;
-	m_decompStream.data_type = Z_BINARY;
-
-	int inflateResult;
-	// Initialize the decompression stream structures on the first
-	// invocation.
-	if( !m_decompStreamInited )
-	{
-		inflateResult = inflateInit( &m_decompStream );
-
-		if ( inflateResult != Z_OK )
-		{
-			qCritical( "inflateInit returned error: %d, msg: %s",
-					inflateResult, m_decompStream.msg );
-			return( FALSE );
-		}
-		m_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 )
-	{
-		int toRead;
-		if( remaining > BUFFER_SIZE )
-		{
-			toRead = BUFFER_SIZE;
-		}
-		else
-		{
-			toRead = remaining;
-		}
-
-		// Fill the buffer, obtaining data from the server.
-		if( !readFromServer( m_buffer, toRead ) )
-		{
-			return( FALSE );
-		}
-
-		m_decompStream.next_in  = ( Bytef * ) m_buffer;
-		m_decompStream.avail_in = toRead;
-
-		// Need to uncompress buffer full.
-		inflateResult = inflate( &m_decompStream, Z_SYNC_FLUSH );
-
-		// We never supply a dictionary for compression. */
-		if( inflateResult == Z_NEED_DICT )
-		{
-			qCritical( "ivsConnection::handleZlib(...): "
-					"zlib inflate needs a dictionary!" );
-			return( FALSE );
-		}
-		if ( inflateResult < 0 )
-		{
-			qCritical( "ivsConnection::handleZlib(...): "
-				"zlib inflate returned error: %d, msg: %s",
-					inflateResult, m_decompStream.msg );
-			return( FALSE );
-		}
-
-		// Result buffer allocated to be at least large enough.
-		// We should never run out of space!
-		if( m_decompStream.avail_in > 0 &&
-						m_decompStream.avail_out <= 0 )
-		{
-			qCritical( "ivsConnection::handleZlib(...): "
-					"zlib inflate ran out of space!" );
-			return( FALSE );
-		}
-
-		remaining -= toRead;
-
-	} // while ( remaining > 0 )
-
-	if( inflateResult == Z_OK )
-	{
-		m_screen.copyRect( rx, ry, rw, rh, (QRgb *) m_rawBuffer );
-	}
-	else
-	{
-		qCritical( "ivsConnection::handleZlib(...): "
-				"zlib inflate returned error: %d, msg: %s",
-					inflateResult, m_decompStream.msg );
-		return( FALSE );
-	}
-
-	return( TRUE );
-}
-
-
-
-#define TIGHT_MIN_TO_COMPRESS 12
-
-
-
-// type declarations
-
-typedef void( ivsConnection:: *filterPtr )( Q_UINT16, Q_UINT32 * );
-
-
-
-// Definitions
-
-bool ivsConnection::handleTight( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw,
-								Q_UINT16 rh )
-{
-	QRgb fill_color;
-	Q_UINT8 comp_ctl;
-
-	if( !readFromServer( (char *) &comp_ctl, 1 ) )
-	{
-		return( FALSE );
-	}
-
-	// Flush zlib streams if we are told by the server to do so.
-	for( Q_UINT8 stream_id = 0; stream_id < 4; stream_id++ )
-	{
-		if( ( comp_ctl & 1 ) && m_zlibStreamActive[stream_id] )
-		{
-			if( inflateEnd( &m_zlibStream[stream_id] ) != Z_OK &&
-					m_zlibStream[stream_id].msg != NULL )
-			{
-				qCritical( "inflateEnd: %s",
-						m_zlibStream[stream_id].msg );
-			}
-			m_zlibStreamActive[stream_id] = FALSE;
-		}
-		comp_ctl >>= 1;
-	}
-
-	// Handle solid rectangles.
-	if( comp_ctl == rfbTightFill )
-	{
-		if( !readFromServer( (char*)&fill_color,
-							sizeof( fill_color ) ) )
-		{
-			return( FALSE );
-		}
-		m_screen.fillRect( rx, ry, rw, rh, fill_color );
-		return( TRUE );
-	}
-
-	if( comp_ctl == rfbTightJpeg )
-	{
-#ifdef HAVE_LIBJPEG
-		return( decompressJpegRect( rx, ry, rw, rh ) );
-#else
-		return ( -1 );
-#endif
-	}
-
-
-	// Quit on unsupported subencoding value.
-	if( comp_ctl > rfbTightMaxSubencoding)
-	{
-		qCritical( "tight encoding: bad subencoding value received." );
-		return( FALSE );
-	}
-
-	// Here primary compression mode handling begins.
-	// Data was processed with optional filter + zlib compression.
-	filterPtr filter_function;
-	Q_UINT8 bits_pixel;
-
-	// First, we should identify a filter to use.
-	if( ( comp_ctl & rfbTightExplicitFilter ) != 0 )
-	{
-		Q_UINT8 filter_id;
-		if( !readFromServer( (char*) &filter_id, 1 ) )
-		{
-			return( FALSE );
-		}
-
-		switch( filter_id )
-		{
-			case rfbTightFilterCopy:
-				filter_function = &ivsConnection::filterCopy;
-				bits_pixel = initFilterCopy( rw, rh );
-				break;
-			case rfbTightFilterPalette:
-				filter_function = &ivsConnection::filterPalette;
-				bits_pixel = initFilterPalette( rw, rh );
-				break;
-			case rfbTightFilterGradient:
-				filter_function =
-						&ivsConnection::filterGradient;
-				bits_pixel = initFilterGradient( rw, rh );
-				break;
-			default:
-				qCritical( "Tight encoding: unknown filter "
-							"code received." );
-				return( FALSE );
-		}
-	}
-	else
-	{
-		filter_function = &ivsConnection::filterCopy;
-		bits_pixel = initFilterCopy( rw, rh );
-	}
-
-	if( bits_pixel == 0 )
-	{
-		qCritical( "Tight encoding: error receiving palette." );
-		return( FALSE );
-	}
-
-
-	// Determine if the data should be decompressed or just copied.
-	Q_UINT16 row_size = ( (int) rw * bits_pixel + 7 ) / 8;
-	if( rh * row_size < TIGHT_MIN_TO_COMPRESS )
-	{
-		if( !readFromServer( (char*)m_buffer, rh * row_size ) )
-		{
-			return( FALSE );
-		}
-
-		QRgb * buffer2 = (QRgb *) &m_buffer[TIGHT_MIN_TO_COMPRESS * 4];
-		( this->*( filter_function ) )( rh, (Q_UINT32 *)buffer2 );
-		m_screen.copyRect( rx, ry, rw, rh, buffer2 );
-		return( TRUE );
-	}
-
-	// Read the length (1..3 bytes) of compressed data following.
-	int compressed_len = (int)readCompactLen();
-	if( compressed_len <= 0 )
-	{
-		qCritical( "Incorrect data received from the server." );
-		return( FALSE );
-	}
-
-
-	// Now let's initialize compression stream if needed.
-	Q_UINT8 stream_id = comp_ctl & 0x03;
-	z_streamp zs = &m_zlibStream[stream_id];
-	if( !m_zlibStreamActive[stream_id] )
-	{
-		zs->zalloc = Z_NULL;
-		zs->zfree = Z_NULL;
-		zs->opaque = Z_NULL;
-		int err = inflateInit( zs );
-		if( err != Z_OK )
-		{
-			if( zs->msg != NULL )
-			{
-				qCritical( "InflateInit error: %s", zs->msg );
-			}
-			return( FALSE );
-		}
-		m_zlibStreamActive[stream_id] = TRUE;
-	}
-
-
-	// Read, decode and draw actual pixel data in a loop.
-	int buffer_size = BUFFER_SIZE * bits_pixel / ( bits_pixel+32 ) &
-								0xfffffffc;
-	if( row_size > buffer_size )
-	{
-		// Should be impossible when BUFFER_SIZE >= 16384
-		qCritical( "Internal error: incorrect buffer size." );
-		return( FALSE );
-	}
-	QRgb * buffer2 = (QRgb *) &m_buffer[buffer_size];
-
-
-	Q_UINT16 rows_processed = 0;
-	int extra_bytes = 0;
-	int portion_len;
-
-	while( compressed_len > 0 )
-	{
-		if( compressed_len > ZLIB_BUFFER_SIZE )	
-		{
-			portion_len = ZLIB_BUFFER_SIZE;
-		}
-		else
-		{
-			portion_len = compressed_len;
-		}
-
-		if( !readFromServer( (char*)m_zlibBuffer, portion_len ) )
-		{
-			return( FALSE );
-		}
-
-		compressed_len -= portion_len;
-
-		zs->next_in = (Bytef *)m_zlibBuffer;
-		zs->avail_in = portion_len;
-
-		do
-		{
-			zs->next_out = (Bytef *) &m_buffer[extra_bytes];
-			zs->avail_out = buffer_size - extra_bytes;
-
-			int 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 )
-				{
-					qCritical( "Inflate error: %s",
-								zs->msg );
-				}
-				else
-				{
-					qCritical( "Inflate error: %d", err );
-				}
-				return( FALSE );
-			}
-
-			const Q_UINT16 num_rows = (Q_UINT16)( ( buffer_size -
-							zs->avail_out ) /
-								(int)row_size );
-
-			( this->*( filter_function ) )( num_rows,
-							(Q_UINT32 *)buffer2 );
-			extra_bytes = buffer_size - zs->avail_out - num_rows *
-								row_size;
-			if( extra_bytes > 0 )
-			{
-				memcpy( m_buffer,
-						&m_buffer[num_rows * row_size],
-								extra_bytes );
-			}
-			if( num_rows > 0 )
-			{
-				m_screen.copyRect( rx, ry+rows_processed, rw,
-							num_rows, buffer2 );
-			}
-			rows_processed += num_rows;
-		}
-		while( zs->avail_out == 0 );
-	}
-
-	if( rows_processed != rh )
-	{
-		qCritical( "Incorrect number of scan lines after "
-							"decompression" );
-		return( FALSE );
-	}
-
-	return( TRUE );
-}
-
-
-
-/*----------------------------------------------------------------------------
- *
- * Filter stuff.
- *
- */
-
-int ivsConnection::initFilterCopy( Q_UINT16 rw, Q_UINT16/* rh*/ )
-{
-	m_rectWidth = rw;
-
-	return( 32 );
-}
-
-
-
-
-void ivsConnection::filterCopy( Q_UINT16 num_rows, Q_UINT32 * dst )
-{
-	memcpy( dst, m_buffer, num_rows * m_rectWidth * 4 );
-}
-
-
-
-
-int ivsConnection::initFilterGradient( Q_UINT16 rw, Q_UINT16/* rh*/ )
-{
-	const int bits = initFilterCopy( rw, 0 );
-	memset( m_tightPrevRow, 0, rw * 3 * sizeof( uint16_t ) );
-	return( bits );
-}
-
-
-
-
-void ivsConnection::filterGradient( Q_UINT16 num_rows, Q_UINT32 * dst )
-{
-	Q_UINT32 * src = (Q_UINT32 *) m_buffer;
-	Q_UINT16 * that_row = (Q_UINT16 *) m_tightPrevRow;
-	Q_UINT16 this_row[2048*3];
-	Q_UINT16 pix[3];
-	const Q_UINT16 max[3] =
-	{
-		__localDisplayFormat.redMax,
-		__localDisplayFormat.greenMax,
-		__localDisplayFormat.blueMax
-	} ;
-	const int shift[3] =
-	{
-		__localDisplayFormat.redShift,
-		__localDisplayFormat.greenShift,
-		__localDisplayFormat.blueShift
-	} ;
-	int est[3];
-
-
-	for( Q_UINT16 y = 0; y < num_rows; ++y )
-	{
-		// First pixel in a row
-		for( Q_UINT8 c = 0; c < 3; ++c )
-		{
-			pix[c] = (Q_UINT16)(((src[y*m_rectWidth] >> shift[c]) +
-							that_row[c]) & max[c]);
-			this_row[c] = pix[c];
-		}
-		dst[y*m_rectWidth] = RGB_TO_PIXEL( pix[0], pix[1], pix[2] );
-		// Remaining pixels of a row 
-		for( Q_UINT16 x = 1; x < m_rectWidth; ++x )
-		{
-			for( Q_UINT8 c = 0; c < 3; ++c )
-			{
-				est[c] = (int)that_row[x*3+c] +
-						(int)pix[c] -
-						(int)that_row[(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] = (Q_UINT16)(((src[y*m_rectWidth+x] >>
-						shift[c]) + est[c]) & max[c]);
-				this_row[x*3+c] = pix[c];
-			}
-			dst[y*m_rectWidth+x] = RGB_TO_PIXEL( pix[0], pix[1],
-								pix[2] );
-		}
-		memcpy( that_row, this_row, m_rectWidth * 3 *
-							sizeof( Q_UINT16 ) );
-	}
-}
-
-
-
-
-int ivsConnection::initFilterPalette( Q_UINT16 rw, Q_UINT16/* rh*/ )
-{
-	Q_UINT8 num_colors;
-
-	m_rectWidth = rw;
-
-	if( !readFromServer( (char*)&num_colors, 1 ) )
-	{
-		return( 0 );
-	}
-
-	m_rectColors = (Q_UINT16) num_colors;
-	if( ++m_rectColors < 2 )
-	{
-		return( 0 );
-	}
-
-	if( !readFromServer( (char*)&m_tightPalette, m_rectColors *
-							sizeof( Q_UINT32 ) ) )
-	{
-		return( 0 );
-	}
-
-	return( ( m_rectColors == 2 ) ? 1 : 8 );
-}
-
-
-
-
-void ivsConnection::filterPalette( Q_UINT16 num_rows, Q_UINT32 * dst )
-{
-	Q_UINT8 * src = (Q_UINT8 *)m_buffer;
-	Q_UINT32 * palette = (Q_UINT32 *) m_tightPalette;
-
-	if( m_rectColors == 2 )
-	{
-		const Q_UINT16 w = (m_rectWidth + 7) / 8;
-		for( Q_UINT16 y = 0; y < num_rows; ++y )
-		{
-			int x;
-			for( x = 0; x < m_rectWidth/8; x++ )
-			{
-				for( int b = 7; b >= 0; b-- )
-				{
-					dst[y*m_rectWidth+x*8+7-b] =
-						palette[src[y*w+x] >> b & 1];
-				}
-			}
-			for( int b = 7; b >= 8 - m_rectWidth % 8; b-- )
-			{
-				dst[y*m_rectWidth+x*8+7-b] =
-						palette[src[y*w+x] >> b & 1];
-			}
-		}
-	}
-	else
-	{
-		for( Q_UINT16 y = 0; y < num_rows; y++ )
-		{
-			for( Q_UINT16 x = 0; x < m_rectWidth; x++ )
-			{
-				dst[y*m_rectWidth+x] =
-					palette[(int)src[y*m_rectWidth+x]];
-			}
-		}
-	}
-}
-
-
-#ifdef HAVE_LIBJPEG
-/*----------------------------------------------------------------------------
- *
- * JPEG decompression.
- *
- */
-
-
-void jpegInitSource( jpeglib::j_decompress_ptr )
-{
-}
-
-
-
-
-jpeglib::boolean jpegFillInputBuffer( jpeglib::j_decompress_ptr )
-{
-	qWarning( "jpegFillInputBuffer(...) called (not implemented, "
-					"because it should not be needed" );
-	return( 0 );
-}
-
-
-
-
-void jpegSkipInputData( jpeglib::j_decompress_ptr, long )
-{
-	qWarning( "jpegSkipInputData(...) called (not implemented, "
-					"because it should not be needed" );
-}
-
-
-
-
-void jpegTermSource( jpeglib::j_decompress_ptr )
-{
-}
-
-
-
-using jpeglib::jpeg_decompress_struct;
-
-bool ivsConnection::decompressJpegRect( Q_UINT16 x, Q_UINT16 y, Q_UINT16 w,
-								Q_UINT16 h )
-{
-	int compressed_len = (int) readCompactLen();
-	if( compressed_len <= 0 )
-	{
-		qCritical( "ivsConnection::decompressJpegRect(...): "
-				"Incorrect data received from the server." );
-		return( FALSE );
-	}
-
-	Q_UINT8 * compressed_data = new Q_UINT8[compressed_len];
-
-	if( !readFromServer( (char*)compressed_data, compressed_len ) )
-	{
-		delete[] compressed_data;
-		return( FALSE );
-	}
-
-	struct jpeglib::jpeg_error_mgr jerr;
-	struct jpeglib::jpeg_decompress_struct cinfo;
-	cinfo.err = jpeglib::jpeg_std_error( &jerr );
-	jpeglib::jpeg_create_decompress( &cinfo );
-
-	//jpegSetSrcManager (&cinfo, compressed_data, compressed_len);
-	m_jpegSrcManager.init_source = jpegInitSource;
-	m_jpegSrcManager.fill_input_buffer = jpegFillInputBuffer;
-	m_jpegSrcManager.skip_input_data = jpegSkipInputData;
-	m_jpegSrcManager.resync_to_restart = jpeglib::jpeg_resync_to_restart;
-	m_jpegSrcManager.term_source = jpegTermSource;
-	m_jpegSrcManager.next_input_byte = (jpeglib::JOCTET *) compressed_data;
-	m_jpegSrcManager.bytes_in_buffer = (size_t) compressed_len;
-
-	cinfo.src = &m_jpegSrcManager;
-
-
-	jpeglib::jpeg_read_header( &cinfo, TRUE );
-	cinfo.out_color_space = jpeglib::JCS_RGB;
-
-	jpeglib::jpeg_start_decompress( &cinfo );
-	if( cinfo.output_width != w || cinfo.output_height != h ||
-						cinfo.output_components != 3 )
-	{
-		qCritical( "Tight Encoding: Wrong JPEG data received." );
-		delete[] compressed_data;
-		jpeglib::jpeg_destroy_decompress( &cinfo );
-		return( FALSE );
-	}
-
-	jpeglib::JSAMPROW row_pointer[1];
-	row_pointer[0] = (jpeglib::JSAMPROW) m_buffer;
-	int dy = 0;
-	while( cinfo.output_scanline < cinfo.output_height )
-	{
-		jpeglib::jpeg_read_scanlines( &cinfo, row_pointer, 1 );
-		Q_UINT32 * pixel_ptr = (Q_UINT32 *) &m_buffer[BUFFER_SIZE / 2];
-		for( Q_UINT16 dx = 0; dx < w; dx++ )
-		{
-			*pixel_ptr++ = RGB_TO_PIXEL( m_buffer[dx*3],
-							m_buffer[dx*3+1],
-							m_buffer[dx*3+2] );
-		}
-		m_screen.copyRect( x, y+dy, w, 1, (QRgb *)
-						&m_buffer[BUFFER_SIZE / 2] );
-		dy++;
-	}
-
-	jpeglib::jpeg_finish_decompress( &cinfo );
-
-	jpeglib::jpeg_destroy_decompress( &cinfo );
-
-	delete[] compressed_data;
-
-	return( TRUE );
-}
-
-#endif	/* LIBJPEG */
-
-#endif	/* LIBZ */
-
-
-
-
-bool ivsConnection::handleCursorPos( const Q_UINT16 _x, const Q_UINT16 _y )
-{
-	// move cursor and update appropriate region
-	RectList ch_reg;
-	ch_reg += QRect( m_cursorPos - m_cursorHotSpot,
-							m_cursorShape.size() );
-	m_cursorPos = QPoint( _x, _y );
-	ch_reg += QRect( m_cursorPos - m_cursorHotSpot, m_cursorShape.size() );
-
-	postRegionChangedEvent( ch_reg );
-
-	if( m_quality < QualityDemoLow )
-	{
-		emit regionUpdated( ch_reg );
-	}
-
-	return( TRUE );
-}
-
-
-
-
-bool ivsConnection::handleCursorShape( const Q_UINT16 _xhot,
-					const Q_UINT16 _yhot,
-					const Q_UINT16 _width,
-					const Q_UINT16 _height,
-					const Q_UINT32 _enc )
-{
-	const int bytesPerPixel = __localDisplayFormat.bitsPerPixel / 8;
-	const int bytesPerRow = ( _width + 7 ) / 8;
-	const int bytesMaskData = bytesPerRow * _height;
-	if( _width * _height == 0 )
-	{
-		return( TRUE );
-	}
-
-	// Allocate memory for pixel data and temporary mask data.
-
-	Q_UINT8 * rcSource = new Q_UINT8[_width * _height * bytesPerPixel];
-	if( rcSource == NULL )
-	{
-		return( FALSE );
-	}
-
-	Q_UINT8 * rcMask = new Q_UINT8[bytesMaskData];
-	if( rcMask == NULL )
-	{
-		delete[] rcSource;
-		return( FALSE );
-	}
-
-	// Read and decode cursor pixel data, depending on the encoding type.
-
-	if( _enc == rfbEncodingXCursor )
-	{
-		rfbXCursorColors rgb;
-		// Read and convert background and foreground colors.
-		if( !readFromServer( (char *) &rgb, sz_rfbXCursorColors ) )
-		{
-			delete[] rcSource;
-			delete[] rcMask;
-			return( FALSE );
-		}
-    		const Q_UINT32 colors[2] = {
-	RGB24_TO_PIXEL( rgb.backRed, rgb.backGreen, rgb.backBlue ),
-	RGB24_TO_PIXEL( rgb.foreRed, rgb.foreGreen, rgb.foreBlue )
-					} ;
-
-		// Read 1bpp pixel data into a temporary buffer.
-		if( !readFromServer( (char*) rcMask, bytesMaskData ) )
-		{
-			delete[] rcSource;
-			delete[] rcMask;
-			return( FALSE );
-		}
-
-		// Convert 1bpp data to byte-wide color indices.
-		Q_UINT8 * ptr = rcSource;
-		for( int y = 0; y < _height; ++y )
-		{
-			int x = 0;
-			for( ; x < _width / 8; ++x )
-			{
-				for( int b = 7; b >= 0; --b )
-				{
-					*ptr = rcMask[y * bytesPerRow + x]
-								>> b & 1;
-					ptr += bytesPerPixel;
-				}
-			}
-			for( int b = 7; b > 7 - _width % 8; --b )
-			{
-				*ptr = rcMask[y * bytesPerRow + x] >> b & 1;
-				ptr += bytesPerPixel;
-			}
-		}
-
-		// Convert indices into the actual pixel values.
-		switch( bytesPerPixel )
-		{
-			case 1:
-			{
-				for( int x = 0; x < _width * _height; ++x )
-				{
-					rcSource[x] = (Q_UINT8)
-							colors[rcSource[x]];
-				}
-				break;
-			}
-			case 2:
-			{
-				for( int x = 0; x < _width * _height; ++x )
-				{
-					((Q_UINT16*) rcSource)[x] =
-						(Q_UINT16)colors[rcSource[x*2]];
-				}
-				break;
-			}
-			case 4:
-			{
-				for( int x = 0; x < _width * _height; ++x )
-				{
-					((Q_UINT32 *) rcSource)[x] =
-							colors[rcSource[x*4]];
-					break;
-				}
-			}
-		}
-	}
-	else	// rich-cursor encoding
-	{
-		if( !readFromServer((char *) rcSource, _width * _height *
-							bytesPerPixel ) )
-		{
-			delete[] rcSource;
-			delete[] rcMask;
-			return( FALSE );
-		}
-	}
-
-	// Read mask data.
-
-	if( !readFromServer( (char*) rcMask, bytesMaskData ) )
-	{
-		delete[] rcSource;
-		delete[] rcMask;
-		return( FALSE );
-	}
-
-	QImage alpha( _width, _height, QImage::Format_Mono );
-	// make data 32-bit-aligned for making it usable with QImage
-	for( Q_UINT16 y = 0; y < _height; ++y )
-	{
-		memcpy( alpha.scanLine( y ), rcMask + bytesPerRow*y,
-								bytesPerRow );
-	}
-
-
-	RectList ch_reg;
-	ch_reg += QRect( m_cursorPos - m_cursorHotSpot,
-							m_cursorShape.size() );
-	m_cursorLock.lockForWrite();
-	m_cursorShape = QImage( rcSource, _width, _height,
-							QImage::Format_RGB32 ).
-				convertToFormat( QImage::Format_ARGB32 );
-	m_cursorShape.setAlphaChannel( alpha );
-	m_cursorLock.unlock();
-
-	m_cursorHotSpot = QPoint( _xhot, _yhot );
-
-
-	ch_reg += QRect( m_cursorPos - m_cursorHotSpot, m_cursorShape.size() );
-
-	// make sure, area around old cursor is updated and new cursor is
-	// painted
-	postRegionChangedEvent( ch_reg );
-
-	emit cursorShapeChanged();
-	if( m_quality < QualityDemoLow )
-	{
-		emit regionUpdated( ch_reg );
-	}
-
-	delete[] rcSource;
-	delete[] rcMask;
-
-
-	return( TRUE );
-}
-
-
-
-bool ivsConnection::handleItalc( Q_UINT16 rx, Q_UINT16 ry, Q_UINT16 rw,
-								Q_UINT16 rh )
-{
-	italcRectEncodingHeader hdr;
-	if( !readFromServer( (char *) &hdr, sizeof( hdr ) ) )
-	{
-		return( FALSE );
-	}
-
-	if( !hdr.compressed )
-	{
-		return( handleRaw( rx, ry, rw, rh ) );
-	}
-
-	hdr.bytesLZO = swap32IfLE( hdr.bytesLZO );
-	hdr.bytesRLE = swap32IfLE( hdr.bytesRLE );
-
-	Q_UINT8 * lzo_data = new Q_UINT8[hdr.bytesLZO];
-
-	if( !readFromServer( (char *) lzo_data, hdr.bytesLZO ) )
-	{
-		delete[] lzo_data;
-		return( FALSE );
-	}
-
-	Q_UINT8 * rle_data = new Q_UINT8[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( "ivsConnection::handleItalc(...): expected and real "
-				"size of decompressed data do not match!" );
-		return( FALSE );
-	}
-
-	QRgb * dst = (QRgb *) m_screen.scanLine( ry ) + rx;
-	Q_UINT16 dx = 0;
-	bool done = FALSE;
-	const Q_UINT16 sh = m_screen.height();
-	for( Q_UINT32 i = 0; i < hdr.bytesRLE && done == FALSE; i+=4 )
-	{
-		const QRgb val = swap32IfBE( *( (QRgb*)( rle_data + i ) ) ) &
-								0xffffff;
-		for( Q_UINT16 j = 0; j <= rle_data[i+3]; ++j )
-		{
-			*dst = val;//[i+1];
-			if( ++dx >= rw )
-			{
-				dx = 0;
-				if( ry+1 < sh )
-				{
-					dst = (QRgb *)
-						m_screen.scanLine( ++ry ) + rx;
-				}
-				else
-				{
-					done = TRUE;
-					break;
-				}
-			}
-			else
-			{
-				++dst;
-			}
-		}
-	}
-
-	if( dx != 0 )
-	{
-		qWarning( "ivsConnection::handleItalc(...): dx(%d) != 0", dx );
-	}
-
-	delete[] lzo_data;
-	delete[] rle_data;
-
-	return( TRUE );
-}
-
-
-
-#include "ivs_connection.moc"
-
diff --git a/lib/src/local_system.cpp b/lib/src/local_system.cpp
deleted file mode 100644
index c019a33..0000000
--- a/lib/src/local_system.cpp
+++ /dev/null
@@ -1,858 +0,0 @@
-/*
- * local_system.cpp - namespace localSystem, providing an interface for
- *                    transparent usage of operating-system-specific functions
- *
- * 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.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef BUILD_WIN32
-#define _WIN32_WINNT 0x0501
-#endif
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDateTime>
-#include <QtCore/QDir>
-#include <QtCore/QLocale>
-#include <QtCore/QMutex>
-#include <QtCore/QProcess>
-#include <QtCore/QSettings>
-#include <QtCore/QTranslator>
-#include <QtGui/QWidget>
-#include <QtNetwork/QTcpServer>
-
-
-#ifdef BUILD_WIN32
-
-#include <QtCore/QLibrary>
-
-static const char * tr_accels = QT_TRANSLATE_NOOP(
-		"QObject",
-		"UPL (note for translators: the first three characters of "
-		"this string are the accellerators (underlined characters) "
-		"of the three input-fields in logon-dialog of windows - "
-		"please keep this note as otherwise there are strange errors "
-					"concerning logon-feature)" );
-
-#include <windows.h>
-#include <shlobj.h>
-#include <psapi.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 );
-}
-
-void killWisPtis()
-{
-	DWORD aProcesses[1024], cbNeeded;
-	if( !EnumProcesses( aProcesses, sizeof( aProcesses ), &cbNeeded ) )
-	{
-		return;
-	}
-
-	DWORD cProcesses = cbNeeded / sizeof(DWORD);
-
-	for( DWORD i = 0; i < cProcesses; i++ )
-	{
-		HANDLE hProcess = OpenProcess(
-							PROCESS_QUERY_INFORMATION | PROCESS_TERMINATE|
-								PROCESS_VM_READ,
-							false, aProcesses[i] );
-		HMODULE hMod;
-		if( hProcess == NULL ||
-			!EnumProcessModules( hProcess, &hMod, sizeof( hMod ),
-								&cbNeeded ) )
-		{
-			continue;
-		}
-		TCHAR szProcessName[MAX_PATH];
-		GetModuleBaseName( hProcess, hMod, szProcessName,
-							sizeof(szProcessName)/sizeof(TCHAR) );
-		for( TCHAR * ptr = szProcessName; *ptr; ++ptr )
-		{
-			*ptr = tolower( *ptr );
-		}
-		if( strcmp( szProcessName, "wisptis.exe" ) == 0 )
-		{
-			TerminateProcess( hProcess, 0 );
-		}
-	}
-}
-
-}
-
-#endif
-
-
-#ifdef HAVE_PWD_H
-#include <pwd.h>
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#include "local_system.h"
-#include "minilzo.h"
-
-
-
-static localSystem::p_pressKey __pressKey;
-static QString __log_file;
-static QFile * __debug_out = NULL;
-
-
-
-static QString properLineEnding( QString _out )
-{
-	if( _out.right( 1 ) != "\012" )
-	{
-		_out += "\012";
-	}
-#ifdef BUILD_WIN32
-	if( _out.right( 1 ) != "\015" )
-	{
-		_out.replace( QString( "\012" ), QString( "\015\012" ) );
-	}
-#elif BUILD_LINUX
-#else
-	if( _out.right( 1 ) != "\015" ) // MAC
-	{
-		_out.replace( QString( "\012" ), QString( "\015" ) );
-	}
-#endif
-	return( _out );
-}
-
-
-
-void msgHandler( QtMsgType _type, const char * _msg )
-{
-	if( localSystem::logLevel == 0 )
-	{
-		return ;
-	}
-#ifdef BUILD_WIN32
-	if( QString( _msg ).contains( "timers cannot be stopped",
-							Qt::CaseInsensitive ) )
-	{
-		exit( 0 );
-	}
-#endif
-	if( __debug_out == NULL )
-	{
-		QString tmp_path = QDir::rootPath() +
-#ifdef BUILD_WIN32
-						"temp"
-#else
-						"tmp"
-#endif
-				;
-		foreach( const QString s, QProcess::systemEnvironment() )
-		{
-			if( s.toLower().left( 5 ) == "temp=" )
-			{
-				tmp_path = s.toLower().mid( 5 );
-				break;
-			}
-			else if( s.toLower().left( 4 ) == "tmp=" )
-			{
-				tmp_path = s.toLower().mid( 4 );
-				break;
-			}
-		}
-		if( !QDir( tmp_path ).exists() )
-		{
-			if( QDir( QDir::rootPath() ).mkdir( tmp_path ) )
-			{
-				QFile::setPermissions( tmp_path,
-						QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner |
-						QFile::ReadUser | QFile::WriteUser | QFile::ExeUser |
-						QFile::ReadGroup | QFile::WriteGroup | QFile::ExeGroup |
-						QFile::ReadOther | QFile::WriteOther | QFile::ExeOther );
-			}
-		}
-		const QString log_path = tmp_path + QDir::separator();
-		__debug_out = new QFile( log_path + __log_file );
-		__debug_out->open( QFile::WriteOnly | QFile::Append |
-							QFile::Unbuffered );
-	}
-
-	QString out;
-	switch( _type )
-	{
-		case QtDebugMsg:
-			if( localSystem::logLevel > 8)
-			{
-				out = QDateTime::currentDateTime().toString() + QString( ": [debug] %1" ).arg( _msg ) + "\n";
-			}
-			break;
-		case QtWarningMsg:
-			if( localSystem::logLevel > 5 )
-			{
-				out = QDateTime::currentDateTime().toString() + QString( ": [warning] %1" ).arg( _msg ) + "\n";
-			}
-			break;
-		case QtCriticalMsg:
-			if( localSystem::logLevel > 3 )
-			{
-				out = QDateTime::currentDateTime().toString() + QString( ": [critical] %1" ).arg( _msg ) + "\n";
-			}
-			break;
-		case QtFatalMsg:
-			if( localSystem::logLevel > 1 )
-			{
-				out = QDateTime::currentDateTime().toString() + QString( ": [fatal] %1" ).arg( _msg ) + "\n";
-			}
-		default:
-			out = QDateTime::currentDateTime().toString() + QString( ": [unknown] %1" ).arg( _msg ) + "\n";
-			break;
-	}
-	if( out.trimmed().size() )
-	{
-		out = properLineEnding( out );
-		__debug_out->write( out.toUtf8() );
-		printf( "%s", out.toUtf8().constData() );
-	}
-}
-
-
-namespace localSystem
-{
-
-int IC_DllExport logLevel = 6;
-
-
-void initialize( p_pressKey _pk, const QString & _log_file )
-{
-#ifdef BUILD_WIN32
-	killWisPtis();
-#endif
-	__pressKey = _pk;
-	__log_file = _log_file;
-
-	lzo_init();
-
-	QCoreApplication::setOrganizationName( "iTALC Solutions" );
-	QCoreApplication::setOrganizationDomain( "italcsolutions.org" );
-	QCoreApplication::setApplicationName( "iTALC" );
-
-	QSettings settings( QSettings::SystemScope, "iTALC Solutions", "iTALC" );
-
-	if( settings.contains( "settings/LogLevel" ) )
-	{
-		logLevel = settings.value( "settings/LogLevel" ).toInt();
-	}
-
-	qInstallMsgHandler( msgHandler );
-
-	// load translations
-	QString loc = QLocale::system().name().left( 2 );
-	if( loc.left( 2 ) == loc.right( 2 ) )
-	{
-		loc = loc.left( 2 );
-	}
-
-	static QTranslator appTr;
-	appTr.load( ":/resources/" + loc + ".qm" );
-	QCoreApplication::installTranslator( &appTr );
-
-	static QTranslator qtTr;
-	qtTr.load( ":/resources/qt_" + loc + ".qm" );
-	QCoreApplication::installTranslator( &qtTr );
-
-}
-
-
-
-
-int freePort( int _default_port )
-{
-	QTcpServer t;
-	if( t.listen( QHostAddress::LocalHost, _default_port ) )
-	{
-		return( _default_port );
-	}
-	t.listen( QHostAddress::LocalHost );
-	return( t.serverPort() );
-}
-
-
-
-
-void sleep( const int _ms )
-{
-#ifdef BUILD_WIN32
-	Sleep( static_cast<unsigned int>( _ms ) );
-#else
-	struct timespec ts = { _ms / 1000, ( _ms % 1000 ) * 1000 * 1000 } ;
-	nanosleep( &ts, NULL );
-#endif
-}
-
-
-
-
-void execInTerminal( const QString & _cmds )
-{
-	QProcess::startDetached(
-#ifdef BUILD_WIN32
-			"cmd " +
-#else
-			"xterm -e " +
-#endif
-			_cmds );
-}
-
-
-
-
-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.toUtf8().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 BUILD_WIN32
-	WSADATA info;
-	if( WSAStartup( MAKEWORD( 1, 1 ), &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 BUILD_WIN32
-	closesocket( sock );
-	WSACleanup();
-#else
-	close( sock );
-#endif
-
-
-#if 0
-#ifdef BUILD_LINUX
-	QProcess::startDetached( "etherwake " + _mac );
-#endif
-#endif
-}
-
-
-
-static inline void pressAndReleaseKey( int _key )
-{
-	__pressKey( _key, TRUE );
-	__pressKey( _key, FALSE );
-}
-
-
-void logonUser( const QString & _uname, const QString & _passwd,
-						const QString & _domain )
-{
-#ifdef BUILD_WIN32
-
-	// first check for process "explorer.exe" - if we find it, a user
-	// is logged in and we do not send our key-sequences as it probably
-	// disturbes user
-	DWORD aProcesses[1024], cbNeeded;
-
-	if( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
-	{
-		return;
-	}
-
-	DWORD cProcesses = cbNeeded / sizeof(DWORD);
-
-	bool user_logged_on = FALSE;
-	for( DWORD i = 0; i < cProcesses; i++ )
-	{
-		HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
-								PROCESS_VM_READ,
-							FALSE, aProcesses[i] );
-		HMODULE hMod;
-		if( hProcess == NULL ||
-			!EnumProcessModules( hProcess, &hMod, sizeof( hMod ),
-								&cbNeeded ) )
-		{
-			continue;
-		}
-		TCHAR szProcessName[MAX_PATH];
-		GetModuleBaseName( hProcess, hMod, szProcessName,
-							sizeof(szProcessName)/sizeof(TCHAR) );
-		for( TCHAR * ptr = szProcessName; *ptr; ++ptr )
-		{
-			*ptr = tolower( *ptr );
-		}
-		if( strcmp( szProcessName, "explorer.exe" ) == 0 )
-		{
-			user_logged_on = TRUE;
-			break;
-		}
-	}
-
-	if( user_logged_on )
-	{
-		return;
-	}
-/*
- 	// does not work :(
-	enablePrivilege( SE_TCB_NAME, TRUE );
-	HANDLE hToken;
-	if( !LogonUser(
-		(CHAR *)_uname.toUtf8().constData(),
-		(CHAR*)(_domain.isEmpty() ? "." : _domain.toUtf8().constData()),
-		(CHAR *)_passwd.toUtf8().constData(),
-		LOGON32_LOGON_INTERACTIVE,
-		LOGON32_PROVIDER_DEFAULT,
-		&hToken ) )
-	{
-		CloseHandle( hToken );
-	}
-	enablePrivilege( SE_TCB_NAME, FALSE );*/
-
-	// disable caps lock
-	if( GetKeyState( VK_CAPITAL ) & 1 )
-	{
-		INPUT input[2];
-		ZeroMemory( input, sizeof( input ) );
-		input[0].type = input[1].type = INPUT_KEYBOARD;
-		input[0].ki.wVk = input[1].ki.wVk = VK_CAPITAL;
-		input[1].ki.dwFlags = KEYEVENTF_KEYUP;
-		SendInput( 2, input, sizeof( INPUT ) );
-	}
-
-	pressAndReleaseKey( XK_Escape );
-	pressAndReleaseKey( XK_Escape );
-
-	// send Secure Attention Sequence (SAS) for making sure we can enter
-	// username and password
-	__pressKey( XK_Alt_L, TRUE );
-	__pressKey( XK_Control_L, TRUE );
-	pressAndReleaseKey( XK_Delete );
-	__pressKey( XK_Control_L, FALSE );
-	__pressKey( XK_Alt_L, FALSE );
-
-	const ushort * accels = QObject::tr( tr_accels ).utf16();
-
-	/* Need to handle 2 cases here; if an interactive login message is
-         * defined in policy, this window will be displayed with an "OK" button;
-         * if not the login window will be displayed. Sending a space will
-         * dismiss the message, but will also add a space to the currently
-         * selected field if the login windows is active. The solution is:
-         *  1. send the "username" field accelerator (which won't do anything
-         *     to the message window, but will select the "username" field of
-         *     the login window if it is active)
-         *  2. Send a space keypress to dismiss the message. (adds a space
-         *     to username field of login window if active)
-         *  3. Send the "username" field accelerator again; which will select
-         *     the username field for the case where the message was displayed
-         *  4. Send a backspace keypress to remove any space that was added to
-         *     the username field if there is no message.
-         */
-	__pressKey( XK_Alt_L, TRUE );
-	pressAndReleaseKey( accels[0] );
-	__pressKey( XK_Alt_L, FALSE );
-
-	pressAndReleaseKey( XK_space );
-
-	__pressKey( XK_Alt_L, TRUE );
-	pressAndReleaseKey( accels[0] );
-	__pressKey( XK_Alt_L, FALSE );
-
-	pressAndReleaseKey( XK_BackSpace );
-#endif
-
-	for( int i = 0; i < _uname.size(); ++i )
-	{
-		pressAndReleaseKey( _uname.utf16()[i] );
-	}
-
-#ifdef BUILD_WIN32
-	__pressKey( XK_Alt_L, TRUE );
-	pressAndReleaseKey( accels[1] );
-	__pressKey( XK_Alt_L, FALSE );
-#else
-	pressAndReleaseKey( XK_Tab );
-#endif
-
-	for( int i = 0; i < _passwd.size(); ++i )
-	{
-		pressAndReleaseKey( _passwd.utf16()[i] );
-	}
-
-#ifdef BUILD_WIN32
-	if( !_domain.isEmpty() )
-	{
-		__pressKey( XK_Alt_L, TRUE );
-		pressAndReleaseKey( accels[2] );
-		__pressKey( XK_Alt_L, FALSE );
-		for( int i = 0; i < _domain.size(); ++i )
-		{
-			pressAndReleaseKey( _domain.utf16()[i] );
-		}
-	}
-#endif
-
-	pressAndReleaseKey( XK_Return );
-}
-
-
-
-
-static const QString userRoleNames[] =
-{
-	"none",
-	"teacher",
-	"admin",
-	"supporter",
-	"other"
-} ;
-
-
-QString userRoleName( const ISD::userRoles _role )
-{
-	return( userRoleNames[_role] );
-}
-
-
-inline QString keyPath( const ISD::userRoles _role, const QString _group,
-							bool _only_path )
-{
-	QSettings settings( QSettings::SystemScope, "iTALC Solutions",
-								"iTALC" );
-	if( _role <= ISD::RoleNone || _role >= ISD::RoleCount )
-	{
-		qWarning( "invalid role" );
-		return( "" );
-	}
-	const QString fallback_dir =
-#ifdef BUILD_LINUX
-		"/etc/italc/keys/"
-#elif BUILD_WIN32
-		"c:\\italc\\keys\\"
-#endif
-		+ _group + QDir::separator() + userRoleNames[_role] +
-						QDir::separator() +
-						( _only_path ? "" : "key" );
-	const QString val = settings.value( "keypaths" + _group + "/" +
-					userRoleNames[_role] ).toString();
-	if( val.isEmpty() )
-	{
-		settings.setValue( "keypaths" + _group + "/" +
-					userRoleNames[_role], fallback_dir );
-		return( fallback_dir );
-	}
-	else
-	{
-		if( _only_path && val.right( 4 ) == "\\key" )
-		{
-			return( val.left( val.size() - 4 ) );
-		}
-	}
-	return( val );
-}
-
-
-QString privateKeyPath( const ISD::userRoles _role, bool _only_path )
-{
-	return( keyPath( _role, "private", _only_path ) );
-}
-
-
-QString publicKeyPath( const ISD::userRoles _role, bool _only_path )
-{
-	return( keyPath( _role, "public", _only_path ) );
-}
-
-
-
-
-void setKeyPath( QString _path, const ISD::userRoles _role,
-							const QString _group )
-{
-	_path = _path.left( 1 ) + _path.mid( 1 ).
-		replace( QString( QDir::separator() ) + QDir::separator(),
-							QDir::separator() );
-
-	QSettings settings( QSettings::SystemScope, "iTALC Solutions",
-								"iTALC" );
-	if( _role <= ISD::RoleNone || _role >= ISD::RoleCount )
-	{
-		qWarning( "invalid role" );
-		return;
-	}
-	settings.setValue( "keypaths" + _group + "/" +
-						userRoleNames[_role], _path );
-}
-
-
-void setPrivateKeyPath( const QString & _path, const ISD::userRoles _role )
-{
-	setKeyPath( _path, _role, "private" );
-}
-
-
-
-
-void setPublicKeyPath( const QString & _path, const ISD::userRoles _role )
-{
-	setKeyPath( _path, _role, "public" );
-}
-
-
-
-
-QString snapshotDir( void )
-{
-	QSettings settings;
-	return( settings.value( "paths/snapshots",
-#ifdef BUILD_WIN32
-				windowsConfigPath( CSIDL_PERSONAL ) +
-					QDir::separator() +
-					QObject::tr( "iTALC-snapshots" )
-#else
-				personalConfigDir() + "snapshots"
-#endif
-					).toString() + QDir::separator() );
-}
-
-
-
-
-QString globalConfigPath( void )
-{
-	QSettings settings;
-	return( settings.value( "paths/globalconfig", personalConfigDir() +
-					"globalconfig.xml" ).toString() );
-}
-
-
-
-
-QString personalConfigDir( void )
-{
-	QSettings settings;
-	const QString d = settings.value( "paths/personalconfigdir" ).toString();
-	return( d.isEmpty() ?
-#ifdef BUILD_WIN32
-				windowsConfigPath( CSIDL_APPDATA ) +
-						QDir::separator() + "iTALC"
-#else
-				QDir::homePath() + QDir::separator() +
-								".italc"
-#endif
-				+ QDir::separator()
-		:
-				d + QDir::separator() );
-}
-
-
-
-
-QString personalConfigPath( void )
-{
-	QSettings settings;
-	const QString d = settings.value( "paths/personalconfig" ).toString();
-	return( d.isEmpty() ?
-				personalConfigDir() + "personalconfig.xml"
-			:
-				d );
-}
-
-
-
-
-QString globalStartmenuDir( void )
-{
-#ifdef BUILD_WIN32
-	return( windowsConfigPath( CSIDL_COMMON_STARTMENU ) +
-							QDir::separator() );
-#else
-	return( "/usr/share/applnk/Applications/" );
-#endif
-}
-
-
-
-
-QString parameter( const QString & _name )
-{
-	return( QSettings().value( "parameters/" + _name ).toString() );
-}
-
-
-
-
-bool ensurePathExists( const QString & _path )
-{
-	if( _path.isEmpty() || QDir( _path ).exists() )
-	{
-		return( TRUE );
-	}
-
-	QString p = QDir( _path ).absolutePath();
-	if( !QFileInfo( _path ).isDir() )
-	{
-		p = QFileInfo( _path ).absolutePath();
-	}
-	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 );
-}
-
-
-
-#ifdef 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 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/lock_widget.cpp b/lib/src/lock_widget.cpp
deleted file mode 100644
index 2fdee15..0000000
--- a/lib/src/lock_widget.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *  lock_widget.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 <config.h>
-
-#ifdef BUILD_WIN32
-#include <windows.h>
-#endif
-
-#include "lock_widget.h"
-#include "local_system.h"
-
-#include <QtGui/QApplication>
-#include <QtGui/QDesktopWidget>
-#include <QtGui/QIcon>
-#include <QtGui/QPainter>
-
-
-#ifdef BUILD_LINUX
-
-#include <X11/Xlib.h>
-
-#elif BUILD_WIN32
-
-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( types _type ) :
-	QWidget( 0, Qt::X11BypassWindowManagerHint ),
-	m_background(
-		_type == Black ?
-			QPixmap( ":/resources/locked_bg.png" )
-		:
-			_type == DesktopVisible ?
-				QPixmap::grabWindow( qApp->desktop()->winId() )
-			:
-				QPixmap() ),
-	m_type( _type ),
-	m_sysKeyTrapper()
-{
-	m_sysKeyTrapper.disableAllKeys( TRUE );
-	setWindowTitle( tr( "screen lock" ) );
-	setWindowIcon( QIcon( ":/resources/icon32.png" ) );
-	setCursor( Qt::BlankCursor );
-	showFullScreen();
-	move( 0, 0 );
-	setFixedSize( QApplication::desktop()->screenGeometry( this ).size() );
-	localSystem::activateWindow( this );
-	//setFixedSize( qApp->desktop()->size() );
-	setFocusPolicy( Qt::StrongFocus );
-	setFocus();
-	grabMouse();
-	grabKeyboard();
-	setCursor( Qt::BlankCursor );
-
-#ifdef 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 BUILD_WIN32
-	// revert screensaver-settings
-	for( int x = 0; x < 3; ++x )
-	{
-		SystemParametersInfo( __ss_set_list[x], __ss_val[x], NULL, 0 );
-	}
-#endif
-}
-
-
-
-
-void lockWidget::paintEvent( QPaintEvent * )
-{
-	QPainter p( this );
-	switch( m_type )
-	{
-		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 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/messagebox.cpp b/lib/src/messagebox.cpp
deleted file mode 100644
index 20c2ddb..0000000
--- a/lib/src/messagebox.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * messagebox.cpp - simple message-box
- *
- * Copyright (c) 2006-2007 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 "messagebox.h"
-#include "local_system.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>
-
-#ifdef SYSTEMTRAY_SUPPORT
-QSystemTrayIcon * __systray_icon = NULL;
-#endif
-
-
-messageBox::messageBox( 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 messageBox::information( const QString & _title, const QString & _msg,
-						const QPixmap & _pixmap )
-{
-	messageBox * m = new messageBox( _title, _msg, _pixmap );
-	m->exec();
-}
-
-
-
-void messageBox::trySysTrayMessage( const QString & _title,
-					const QString & _msg,
-					MessageIcon _msg_icon )
-{
-	qWarning( "%s", _msg.toUtf8().constData() );
-	if( QThread::currentThreadId() !=
-		QCoreApplication::instance()->thread()->currentThreadId() )
-	{
-		return;
-	}
-#ifdef SYSTEMTRAY_SUPPORT
-	// OS X does not support messages
-	if( QSystemTrayIcon::supportsMessages() && __systray_icon )
-	{
-		__systray_icon->showMessage( _title, _msg,
-				(QSystemTrayIcon::MessageIcon) _msg_icon, -1 );
-		return;
-	}
-#else
-	QPixmap p;
-	switch( _msg_icon )
-	{
-		case Information:
-		case Warning:
-			p = QPixmap( ":/resources/info.png" );
-			break;
-		case Critical:
-			p = QPixmap( ":/resources/stop.png" );
-			break;
-	}
-	new messageBox( _title, _msg, p );
-#endif
-}
-
-
diff --git a/lib/src/minilzo.c b/lib/src/minilzo.c
deleted file mode 100644
index 6a62b31..0000000
--- a/lib/src/minilzo.c
+++ /dev/null
@@ -1,4112 +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) 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
-#define LZO_BUILD
-
-#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
-#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 defined(LZO_OS_FREESTANDING)
-#  define LZO_INFO_OS           "freestanding"
-#elif defined(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(__llvm__) && defined(__GNUC__) && defined(__VERSION__)
-#  if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
-#    define LZO_CC_LLVM         (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
-#  else
-#    define LZO_CC_LLVM         (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
-#  endif
-#  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(__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) && !defined(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 defined(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(__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 defined(LZO_ARCH_ARM_THUMB) && !defined(LZO_ARCH_ARM)
-#  error "this should not happen"
-#endif
-#if defined(LZO_ARCH_I086PM) && !defined(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) && !defined(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_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) && defined(LZO_CC_GNUC)
-#  if (LZO_CC_GNUC < 0x020800ul)
-#    undef LZO_SIZEOF_LONG_LONG
-#  endif
-#endif
-#if defined(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 defined(LZO_ABI_NEUTRAL_ENDIAN)
-#  undef LZO_ABI_BIG_ENDIAN
-#  undef LZO_ABI_LITTLE_ENDIAN
-#elif !defined(LZO_ABI_BIG_ENDIAN) && !defined(LZO_ABI_LITTLE_ENDIAN)
-#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP)
-#  define LZO_ABI_BIG_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_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 defined(LZO_ABI_BIG_ENDIAN) && defined(LZO_ABI_LITTLE_ENDIAN)
-#  error "this should not happen"
-#endif
-#if defined(LZO_ABI_BIG_ENDIAN)
-#  define LZO_INFO_ABI_ENDIAN       "be"
-#elif defined(LZO_ABI_LITTLE_ENDIAN)
-#  define LZO_INFO_ABI_ENDIAN       "le"
-#elif defined(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 defined(LZO_LIBC_NAKED)
-#  define LZO_INFO_LIBC         "naked"
-#elif defined(LZO_LIBC_FREESTANDING)
-#  define LZO_INFO_LIBC         "freestanding"
-#elif defined(LZO_LIBC_MOSTLY_FREESTANDING)
-#  define LZO_INFO_LIBC         "mfreestanding"
-#elif defined(LZO_LIBC_ISOC90)
-#  define LZO_INFO_LIBC         "isoc90"
-#elif defined(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_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_gnuc_extension__    __extension__
-#else
-#  define __lzo_gnuc_extension__
-#endif
-#endif
-#if !defined(__lzo_ua_volatile)
-#  define __lzo_ua_volatile     volatile
-#endif
-#if !defined(__lzo_alignof)
-#if (LZO_CC_CILLY || 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)
-#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_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_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_destructor      __attribute__((__destructor__))
-#endif
-#endif
-#if defined(__lzo_destructor)
-#  define __lzo_HAVE_destructor 1
-#endif
-#if defined(__lzo_HAVE_destructor) && !defined(__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_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 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
-#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_LLVM || LZO_CC_PATHSCALE)
-#  define __lzo_forceinline     __inline__ __attribute__((__always_inline__))
-#elif (LZO_CC_MSC && (_MSC_VER >= 1200))
-#  define __lzo_forceinline     __forceinline
-#endif
-#endif
-#if defined(__lzo_forceinline)
-#  define __lzo_HAVE_forceinline 1
-#else
-#  define __lzo_forceinline
-#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_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
-#endif
-#endif
-#if defined(__lzo_noinline)
-#  define __lzo_HAVE_noinline 1
-#else
-#  define __lzo_noinline
-#endif
-#if (defined(__lzo_HAVE_forceinline) || defined(__lzo_HAVE_noinline)) && !defined(__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_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
-#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 >= 800) && LZO_CC_SYNTAX_GNUC)
-#  define __lzo_nothrow         __attribute__((__nothrow__))
-#elif (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
-#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_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
-#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_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_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_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_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_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
-#    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
-#endif
-#if !defined(__lzo_cdecl_atexit)
-#  define __lzo_cdecl_atexit
-#endif
-#if !defined(__lzo_cdecl_main)
-#  define __lzo_cdecl_main
-#endif
-#if !defined(__lzo_cdecl_qsort)
-#  define __lzo_cdecl_qsort
-#endif
-#if !defined(__lzo_cdecl_sighandler)
-#  define __lzo_cdecl_sighandler
-#endif
-#if !defined(__lzo_cdecl_va)
-#  define __lzo_cdecl_va                __lzo_cdecl
-#endif
-#if !defined(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 defined(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
-#if !defined(LZO_CFG_NO_INLINE_ASM)
-#if defined(LZO_CC_LLVM)
-#  define LZO_CFG_NO_INLINE_ASM 1
-#endif
-#endif
-#if !defined(LZO_CFG_NO_UNALIGNED)
-#if defined(LZO_ABI_NEUTRAL_ENDIAN) || defined(LZO_ARCH_GENERIC)
-#  define LZO_CFG_NO_UNALIGNED 1
-#endif
-#endif
-#if defined(LZO_CFG_NO_UNALIGNED)
-#  undef LZO_OPT_UNALIGNED16
-#  undef LZO_OPT_UNALIGNED32
-#  undef LZO_OPT_UNALIGNED64
-#endif
-#if defined(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_INTELC || LZO_CC_PATHSCALE))
-#  define LZO_ASM_SYNTAX_GNUC 1
-#elif (LZO_ARCH_AMD64 && (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 != 0x2030)
-#  error "version mismatch in miniLZO source files"
-#endif
-
-#ifdef MINILZO_HAVE_CONFIG_H
-#  define LZO_HAVE_CONFIG_H
-#endif
-
-#ifndef __LZO_CONF_H
-#define __LZO_CONF_H
-
-#if !defined(__LZO_IN_MINILZO)
-#if defined(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 defined(LZO_CFG_NO_UNALIGNED)
-#  define ACC_CFG_NO_UNALIGNED 1
-#endif
-#if defined(LZO_ARCH_GENERIC)
-#  define ACC_ARCH_GENERIC 1
-#endif
-#if defined(LZO_ABI_NEUTRAL_ENDIAN)
-#  define ACC_ABI_NEUTRAL_ENDIAN 1
-#endif
-#if defined(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)
-#  pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED)
-#  pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP)
-#endif
-
-#if defined(__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 defined(LZO_CFG_FREESTANDING)
-#  undef HAVE_MEMCMP
-#  undef HAVE_MEMCPY
-#  undef HAVE_MEMMOVE
-#  undef HAVE_MEMSET
-#endif
-
-#if !defined(HAVE_MEMCMP)
-#  undef memcmp
-#  define memcmp(a,b,c)         lzo_memcmp(a,b,c)
-#elif !defined(__LZO_MMODEL_HUGE)
-#  define lzo_memcmp(a,b,c)     memcmp(a,b,c)
-#endif
-#if !defined(HAVE_MEMCPY)
-#  undef memcpy
-#  define memcpy(a,b,c)         lzo_memcpy(a,b,c)
-#elif !defined(__LZO_MMODEL_HUGE)
-#  define lzo_memcpy(a,b,c)     memcpy(a,b,c)
-#endif
-#if !defined(HAVE_MEMMOVE)
-#  undef memmove
-#  define memmove(a,b,c)        lzo_memmove(a,b,c)
-#elif !defined(__LZO_MMODEL_HUGE)
-#  define lzo_memmove(a,b,c)    memmove(a,b,c)
-#endif
-#if !defined(HAVE_MEMSET)
-#  undef memset
-#  define memset(a,b,c)         lzo_memset(a,b,c)
-#elif !defined(__LZO_MMODEL_HUGE)
-#  define lzo_memset(a,b,c)     memset(a,b,c)
-#endif
-
-#undef NDEBUG
-#if defined(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
-#endif
-#if !defined(__lzo_forceinline)
-#  define __lzo_forceinline
-#endif
-#if !defined(__lzo_noinline)
-#  define __lzo_noinline
-#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 && !defined(LZO_CFG_NO_UNALIGNED)
-#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386)
-#  if (LZO_SIZEOF_SHORT == 2)
-#    define LZO_UNALIGNED_OK_2
-#  endif
-#  if (LZO_SIZEOF_INT == 4)
-#    define LZO_UNALIGNED_OK_4
-#  endif
-#endif
-#endif
-
-#if defined(LZO_UNALIGNED_OK_2)
-  LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(short) == 2)
-#endif
-#if defined(LZO_UNALIGNED_OK_4)
-  LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
-#elif defined(LZO_ALIGNED_OK_4)
-  LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4)
-#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_C int __lzo_init_done;
-__LZO_EXTERN_C const char __lzo_copyright[];
-LZO_EXTERN(const lzo_bytep) lzo_copyright(void);
-
-#ifndef __LZO_PTR_H
-#define __LZO_PTR_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if !defined(lzo_uintptr_t)
-#  if defined(__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;
-    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
-
-#define LZO_DETERMINISTIC
-
-#define LZO_DICT_USE_PTR
-#if 0 && (LZO_ARCH_I086)
-#  undef LZO_DICT_USE_PTR
-#endif
-
-#if defined(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 you use the LZO library in a product, I would appreciate that you
- * keep this copyright string in the executable of your product.
- */
-
-const char __lzo_copyright[] =
-#if !defined(__LZO_IN_MINLZO)
-    LZO_VERSION_STRING;
-#else
-    "\r\n\n"
-    "LZO data compression library.\n"
-    "$Copyright: LZO (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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"
-    "$Built: " __DATE__ " " __TIME__ " $\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
-
-#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) || !defined(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) || !defined(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) || !defined(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) || !defined(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(__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_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
-
-LZO_PUBLIC(int)
-_lzo_config_check(void)
-{
-    lzo_bool r = 1;
-    union { unsigned char c[2*sizeof(lzo_xint)]; lzo_xint l[2]; } u;
-    lzo_uintptr_t p;
-
-#if !defined(LZO_CFG_NO_CONFIG_CHECK)
-#if defined(LZO_ABI_BIG_ENDIAN)
-    u.l[0] = u.l[1] = 0; u.c[sizeof(lzo_xint) - 1] = 128;
-    r &= (u.l[0] == 128);
-#endif
-#if defined(LZO_ABI_LITTLE_ENDIAN)
-    u.l[0] = u.l[1] = 0; u.c[0] = 128;
-    r &= (u.l[0] == 128);
-#endif
-#if defined(LZO_UNALIGNED_OK_2)
-    p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0];
-    u.l[0] = u.l[1] = 0;
-    r &= ((* (const lzo_ushortp) (p+1)) == 0);
-#endif
-#if defined(LZO_UNALIGNED_OK_4)
-    p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0];
-    u.l[0] = u.l[1] = 0;
-    r &= ((* (const lzo_uint32p) (p+1)) == 0);
-#endif
-#endif
-
-    LZO_UNUSED(u); LZO_UNUSED(p);
-    return r == 1 ? LZO_E_OK : LZO_E_ERROR;
-}
-
-int __lzo_init_done = 0;
-
-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
-
-    __lzo_init_done = 1;
-
-    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
-
-#define do_compress         _lzo1x_1_do_compress
-
-#if !defined(MINILZO_CFG_SKIP_LZO1X_1_COMPRESS)
-
-#define LZO_NEED_DICT_H
-#define D_BITS          14
-#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)
-
-#ifndef __LZO_CONFIG1X_H
-#define __LZO_CONFIG1X_H
-
-#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z)
-#  define LZO1X
-#endif
-
-#if !defined(__LZO_IN_MINILZO)
-#include "lzo/lzo1x.h"
-#endif
-
-#define LZO_EOF_CODE
-#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
-
-#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 < 8 || D_BITS > 18)
-#  error "invalid D_BITS"
-#endif
-#if (DL_BITS < 8 || 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
-#  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
-#  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
-#  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)
-static void 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 defined(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_uint) ((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 defined(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 defined(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 DO_COMPRESS     lzo1x_1_compress
-
-static __lzo_noinline lzo_uint
-do_compress ( const lzo_bytep in , lzo_uint  in_len,
-                    lzo_bytep out, lzo_uintp out_len,
-                    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 - M2_MAX_LEN - 5;
-    const lzo_bytep ii;
-    lzo_dict_p const dict = (lzo_dict_p) wrkmem;
-
-    op = out;
-    ip = in;
-    ii = ip;
-
-    ip += 4;
-    for (;;)
-    {
-        register const lzo_bytep m_pos;
-        lzo_uint m_off;
-        lzo_uint m_len;
-        lzo_uint dindex;
-
-        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 1 && defined(LZO_UNALIGNED_OK_2)
-        if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip)
-#else
-        if (m_pos[0] != ip[0] || m_pos[1] != ip[1])
-#endif
-        {
-        }
-        else
-        {
-            if __lzo_likely(m_pos[2] == ip[2])
-            {
-#if 0
-                if (m_off <= M2_MAX_OFFSET)
-                    goto match;
-                if (lit <= 3)
-                    goto match;
-                if (lit == 3)
-                {
-                    assert(op - 2 > out); op[-2] |= LZO_BYTE(3);
-                    *op++ = *ii++; *op++ = *ii++; *op++ = *ii++;
-                    goto code_match;
-                }
-                if (m_pos[3] == ip[3])
-#endif
-                    goto match;
-            }
-            else
-            {
-#if 0
-#if 0
-                if (m_off <= M1_MAX_OFFSET && lit > 0 && lit <= 3)
-#else
-                if (m_off <= M1_MAX_OFFSET && lit == 3)
-#endif
-                {
-                    register lzo_uint t;
-
-                    t = lit;
-                    assert(op - 2 > out); op[-2] |= LZO_BYTE(t);
-                    do *op++ = *ii++; while (--t > 0);
-                    assert(ii == ip);
-                    m_off -= 1;
-                    *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2));
-                    *op++ = LZO_BYTE(m_off >> 2);
-                    ip += 2;
-                    goto match_done;
-                }
-#endif
-            }
-        }
-
-literal:
-        UPDATE_I(dict,0,dindex,ip,in);
-        ++ip;
-        if __lzo_unlikely(ip >= ip_end)
-            break;
-        continue;
-
-match:
-        UPDATE_I(dict,0,dindex,ip,in);
-        if (pd(ip,ii) > 0)
-        {
-            register lzo_uint t = pd(ip,ii);
-
-            if (t <= 3)
-            {
-                assert(op - 2 > out);
-                op[-2] |= LZO_BYTE(t);
-            }
-            else if (t <= 18)
-                *op++ = LZO_BYTE(t - 3);
-            else
-            {
-                register lzo_uint tt = t - 18;
-
-                *op++ = 0;
-                while (tt > 255)
-                {
-                    tt -= 255;
-                    *op++ = 0;
-                }
-                assert(tt > 0);
-                *op++ = LZO_BYTE(tt);
-            }
-            do *op++ = *ii++; while (--t > 0);
-        }
-
-        assert(ii == ip);
-        ip += 3;
-        if (m_pos[3] != *ip++ || m_pos[4] != *ip++ || m_pos[5] != *ip++ ||
-            m_pos[6] != *ip++ || m_pos[7] != *ip++ || m_pos[8] != *ip++
-#ifdef LZO1Y
-            || m_pos[ 9] != *ip++ || m_pos[10] != *ip++ || m_pos[11] != *ip++
-            || m_pos[12] != *ip++ || m_pos[13] != *ip++ || m_pos[14] != *ip++
-#endif
-           )
-        {
-            --ip;
-            m_len = pd(ip, ii);
-            assert(m_len >= 3); assert(m_len <= M2_MAX_LEN);
-
-            if (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;
-                *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
-                goto m3_m4_offset;
-            }
-            else
-#if defined(LZO1X)
-            {
-                m_off -= 0x4000;
-                assert(m_off > 0); assert(m_off <= 0x7fff);
-                *op++ = LZO_BYTE(M4_MARKER |
-                                 ((m_off & 0x4000) >> 11) | (m_len - 2));
-                goto m3_m4_offset;
-            }
-#elif defined(LZO1Y)
-                goto m4_match;
-#endif
-        }
-        else
-        {
-            {
-                const lzo_bytep end = in_end;
-                const lzo_bytep m = m_pos + M2_MAX_LEN + 1;
-                while (ip < end && *m == *ip)
-                    m++, ip++;
-                m_len = pd(ip, ii);
-            }
-            assert(m_len > M2_MAX_LEN);
-
-            if (m_off <= M3_MAX_OFFSET)
-            {
-                m_off -= 1;
-                if (m_len <= 33)
-                    *op++ = LZO_BYTE(M3_MARKER | (m_len - 2));
-                else
-                {
-                    m_len -= 33;
-                    *op++ = M3_MARKER | 0;
-                    goto m3_m4_len;
-                }
-            }
-            else
-            {
-#if defined(LZO1Y)
-m4_match:
-#endif
-                m_off -= 0x4000;
-                assert(m_off > 0); assert(m_off <= 0x7fff);
-                if (m_len <= M4_MAX_LEN)
-                    *op++ = LZO_BYTE(M4_MARKER |
-                                     ((m_off & 0x4000) >> 11) | (m_len - 2));
-                else
-                {
-                    m_len -= M4_MAX_LEN;
-                    *op++ = LZO_BYTE(M4_MARKER | ((m_off & 0x4000) >> 11));
-m3_m4_len:
-                    while (m_len > 255)
-                    {
-                        m_len -= 255;
-                        *op++ = 0;
-                    }
-                    assert(m_len > 0);
-                    *op++ = LZO_BYTE(m_len);
-                }
-            }
-
-m3_m4_offset:
-            *op++ = LZO_BYTE((m_off & 63) << 2);
-            *op++ = LZO_BYTE(m_off >> 6);
-        }
-
-#if 0
-match_done:
-#endif
-        ii = ip;
-        if __lzo_unlikely(ip >= ip_end)
-            break;
-    }
-
-    *out_len = pd(op, out);
-    return pd(in_end,ii);
-}
-
-LZO_PUBLIC(int)
-DO_COMPRESS      ( const lzo_bytep in , lzo_uint  in_len,
-                         lzo_bytep out, lzo_uintp out_len,
-                         lzo_voidp wrkmem )
-{
-    lzo_bytep op = out;
-    lzo_uint t;
-
-    if __lzo_unlikely(in_len <= M2_MAX_LEN + 5)
-        t = in_len;
-    else
-    {
-        t = do_compress(in,in_len,op,out_len,wrkmem);
-        op += *out_len;
-    }
-
-    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;
-                *op++ = 0;
-            }
-            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
-#  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
-#else
-#  define TEST_IP               1
-#endif
-#if defined(TEST_OP)
-#  define HAVE_TEST_OP
-#else
-#  define TEST_OP               1
-#endif
-
-#if defined(NEED_IP)
-#  define HAVE_NEED_IP
-#else
-#  define NEED_IP(x)            ((void) 0)
-#endif
-#if defined(NEED_OP)
-#  define HAVE_NEED_OP
-#else
-#  define NEED_OP(x)            ((void) 0)
-#endif
-
-#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
-#  define HAVE_ANY_IP
-#endif
-#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
-#  define HAVE_ANY_OP
-#endif
-
-#undef __COPY4
-#define __COPY4(dst,src)    * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
-
-#undef COPY4
-#if defined(LZO_UNALIGNED_OK_4)
-#  define COPY4(dst,src)    __COPY4(dst,src)
-#elif defined(LZO_ALIGNED_OK_4)
-#  define COPY4(dst,src)    __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src))
-#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_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
-        if (PTR_ALIGNED2_4(op,ip))
-        {
-#endif
-        COPY4(op,ip);
-        op += 4; ip += 4;
-        if (--t > 0)
-        {
-            if (t >= 4)
-            {
-                do {
-                    COPY4(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)
-        {
-            *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 -= (* (const lzo_ushortp) 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 -= (* (const lzo_ushortp) 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_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
-                COPY4(op,m_pos);
-                op += 4; m_pos += 4; t -= 4 - (3 - 1);
-                do {
-                    COPY4(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
-#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
-#  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
-#else
-#  define TEST_IP               1
-#endif
-#if defined(TEST_OP)
-#  define HAVE_TEST_OP
-#else
-#  define TEST_OP               1
-#endif
-
-#if defined(NEED_IP)
-#  define HAVE_NEED_IP
-#else
-#  define NEED_IP(x)            ((void) 0)
-#endif
-#if defined(NEED_OP)
-#  define HAVE_NEED_OP
-#else
-#  define NEED_OP(x)            ((void) 0)
-#endif
-
-#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP)
-#  define HAVE_ANY_IP
-#endif
-#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP)
-#  define HAVE_ANY_OP
-#endif
-
-#undef __COPY4
-#define __COPY4(dst,src)    * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src)
-
-#undef COPY4
-#if defined(LZO_UNALIGNED_OK_4)
-#  define COPY4(dst,src)    __COPY4(dst,src)
-#elif defined(LZO_ALIGNED_OK_4)
-#  define COPY4(dst,src)    __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src))
-#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_4) || defined(LZO_ALIGNED_OK_4)
-#if !defined(LZO_UNALIGNED_OK_4)
-        if (PTR_ALIGNED2_4(op,ip))
-        {
-#endif
-        COPY4(op,ip);
-        op += 4; ip += 4;
-        if (--t > 0)
-        {
-            if (t >= 4)
-            {
-                do {
-                    COPY4(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)
-        {
-            *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 -= (* (const lzo_ushortp) 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 -= (* (const lzo_ushortp) 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_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
-                COPY4(op,m_pos);
-                op += 4; m_pos += 4; t -= 4 - (3 - 1);
-                do {
-                    COPY4(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/lib/src/progress_widget.cpp b/lib/src/progress_widget.cpp
deleted file mode 100644
index dc179c5..0000000
--- a/lib/src/progress_widget.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * progress_widget.cpp - 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.
- */
-
-
-#include "progress_widget.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( void )
-{
-	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 = palette().color( QPalette::Active, QPalette::Window ).
-								light( 130 );
-	//g1.setAlpha( 204 );
-	QColor g2 = palette().color( QPalette::Active, QPalette::Window ).
-								light( 70 );
-	//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::darkGray );
-	p.drawText( 15 + m_pixmaps[m_curFrame].width(), 25, m_txt );
-	p.setPen( Qt::black );
-	p.drawText( 14 + m_pixmaps[m_curFrame].width(), 24, m_txt );
-}
-
-
-
-
-#include "progress_widget.moc"
-
diff --git a/lib/src/system_key_trapper.cpp b/lib/src/system_key_trapper.cpp
deleted file mode 100644
index 0dc1bd9..0000000
--- a/lib/src/system_key_trapper.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * system_key_trapper.cpp - class for trapping system-keys and -key-sequences
- *                          such as Alt+Ctrl+Del, Alt+Tab etc.
- *
- * Copyright (c) 2006-2007 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.
- *
- */
-
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-
-#ifdef BUILD_WIN32
-
-#define _WIN32_WINNT 0x0500 // for KBDLLHOOKSTRUCT
-
-#include <windows.h>
-
-#include "inject.h"
-
-#endif
-
-
-#define XK_KOREAN
-#include "rfb/keysym.h"
-#include "system_key_trapper.h"
-
-#include <QtCore/QList>
-#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 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 )
-		{
-			key = systemKeyTrapper::MetaKey;
-		}
-		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 )
-	{
-		STICKYKEYS sk = settings_sk;
-		TOGGLEKEYS tk = settings_tk;
-		FILTERKEYS fk = settings_fk;
-
-		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 )
-{
-	setEnabled( _enabled );
-}
-
-
-
-
-systemKeyTrapper::~systemKeyTrapper()
-{
-	setEnabled( FALSE );
-}
-
-
-
-
-void systemKeyTrapper::setEnabled( bool _on )
-{
-	if( _on == m_enabled )
-	{
-		return;
-	}
-
-	s_refCntMutex.lock();
-	m_enabled = _on;
-	if( _on )
-	{
-#if 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 );
-
-			EnableWindow( FindWindow( "Shell_traywnd", NULL ),
-									FALSE );
-			ShowWindow( FindWindow( "Shell_traywnd", NULL ), SW_HIDE );
-
-			Inject();
-		}
-
-		QTimer * t = new QTimer( this );
-		connect( t, SIGNAL( timeout() ),
-					this, SLOT( checkForTrappedKeys() ) );
-		t->start( 10 );
-#endif
-		++s_refCnt;
-	}
-	else
-	{
-		--s_refCnt;
-#if BUILD_WIN32
-		if( !s_refCnt )
-		{
-			UnhookWindowsHookEx( g_hHookKbdLL );
-			g_hHookKbdLL = NULL;
-
-			enableStickyKeys( TRUE );
-			EnableWindow( FindWindow( "Shell_traywnd", NULL ),
-									TRUE );
-
-			ShowWindow( FindWindow( "Shell_traywnd", NULL ), SW_NORMAL );
-			Eject();
-		}
-#endif
-	}
-	s_refCntMutex.unlock();
-}
-
-
-
-
-void systemKeyTrapper::disableAllKeys( bool _on )
-{
-	__disable_all_keys = _on;
-}
-
-
-
-
-void systemKeyTrapper::checkForTrappedKeys( void )
-{
-	QMutexLocker m( &__trapped_keys_mutex );
-
-	while( !__trapped_keys.isEmpty() )
-	{
-		int key = 0;
-		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 MetaKey: key = XK_Meta_L; break;
-		}
-
-		if( key )
-		{
-			emit keyEvent( key, TRUE );
-			emit keyEvent( key, FALSE );
-		}
-
-		__trapped_keys.removeFirst();
-
-	}
-}
-
-
-#include "system_key_trapper.moc"
-
diff --git a/lib/src/vncview.cpp b/lib/src/vncview.cpp
deleted file mode 100644
index cd50949..0000000
--- a/lib/src/vncview.cpp
+++ /dev/null
@@ -1,846 +0,0 @@
-/*
- * vncview.cpp - VNC-viewer-widget
- *
- * Copyright (c) 2006-2008 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 "ivs_connection.h"
-#include "messagebox.h"
-#include "qt_user_events.h"
-#include "progress_widget.h"
-#include "system_key_trapper.h"
-#include "qt_features.h"
-#include "lock_widget.h"
-
-#include <QtCore/QTimer>
-#include <QtGui/QApplication>
-#include <QtGui/QMouseEvent>
-#include <QtGui/QPainter>
-
-
-
-vncView::vncView( const QString & _host, QWidget * _parent,
-						bool _progress_widget ) :
-	QWidget( _parent ),
-	m_connection( NULL ),
-	m_viewOnly( TRUE ),
-	m_viewOnlyFocus( TRUE ),
-	m_scaledView( TRUE ),
-	m_running( FALSE ),
-	m_viewOffset( QPoint( 0, 0 ) ),
-	m_buttonMask( 0 ),
-	m_establishingConnection( NULL ),
-	m_sysKeyTrapper( new systemKeyTrapper( FALSE ) )
-{
-	if( _progress_widget )
-	{
-		m_establishingConnection = new progressWidget(
-			tr( "Establishing connection to %1 ..." ).arg( _host ),
-					":/resources/watch%1.png", 16, this );
-	}
-
-	m_connection = new ivsConnection( _host, ivsConnection::QualityMedium,
-								FALSE, this );
-	connect( m_connection, SIGNAL( cursorShapeChanged() ),
-					this, SLOT( updateCursorShape() ) );
-	setMouseTracking( TRUE );
-	//setWidgetAttribute( Qt::WA_OpaquePaintEvent );
-	setAttribute( Qt::WA_NoSystemBackground, true );
-	setAttribute( Qt::WA_DeleteOnClose, true );
-	showMaximized();
-
-	QSize parent_size = size();
-	if( parentWidget() != NULL )
-	{
-		parent_size = parentWidget()->size();
-	}
-	resize( parent_size );
-
-	setFocusPolicy( Qt::StrongFocus );
-	setFocus();
-
-	new vncViewThread( this );
-
-	framebufferUpdate();
-}
-
-
-
-
-vncView::~vncView()
-{
-	unpressModifiers();
-	findChild<vncViewThread *>()->quit();
-	findChild<vncViewThread *>()->wait();
-	delete m_connection;
-	delete m_sysKeyTrapper;
-}
-
-
-
-
-QSize vncView::scaledSize( const QSize & _default ) const
-{
-	const QSize s = size();
-	QSize fbs = m_connection->framebufferSize();
-	if( ( s.width() >= fbs.width() && s.height() >= fbs.height() ) ||
-							m_scaledView == FALSE )
-	{
-		return( _default );
-	}
-	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
-	{
-#ifdef BUILD_LINUX
-		// for some reason we have to grab mouse and then release
-		// again to make complete keyboard-grabbing working ... ??
-		grabMouse();
-		releaseMouse();
-#endif
-		grabKeyboard();
-		m_sysKeyTrapper->setEnabled( TRUE );
-		updateCursorShape();
-	}
-}
-
-
-
-
-void vncView::setScaledView( bool _sv )
-{
-	m_scaledView = _sv;
-	if( m_connection != NULL )
-	{
-		m_connection->setScaledSize( scaledSize() );
-	}
-	update();
-}
-
-
-
-
-void vncView::framebufferUpdate( void )
-{
-	if( m_connection == NULL )
-	{
-		QTimer::singleShot( 40, this, SLOT( framebufferUpdate() ) );
-		return;
-	}
-
-	const QPoint mp = mapFromGlobal( QCursor::pos() );
-	// not yet connected or connection lost while handling messages?
-	if( m_connection->state() != ivsConnection::Connected && m_running )
-	{
-		m_running = FALSE;
-		if( m_establishingConnection )
-		{
-			m_establishingConnection->show();
-		}
-		emit startConnection();
-		QTimer::singleShot( 40, this, SLOT( framebufferUpdate() ) );
-		if( mp.y() < 2 )
-		{
-			// special signal for allowing parent-widgets to
-			// show a toolbar etc.
-			emit mouseAtTop();
-		}
-		return;
-	}
-
-	if( m_connection->state() == ivsConnection::Connected && !m_running )
-	{
-		if( m_establishingConnection )
-		{
-			m_establishingConnection->hide();
-		}
-		m_running = TRUE;
-		emit connectionEstablished();
-
-		m_connection->setScaledSize( scaledSize() );
-
-		if( parentWidget() )
-		{
-			// if we have a parent it's likely remoteControlWidget
-			// which needs resize-events for updating its toolbar
-			// properly
-			parentWidget()->resize( parentWidget()->size() );
-		}
-	}
-
-	if( m_scaledView == FALSE )
-	{
-		// check whether to scroll because mouse-cursor is at an egde which
-		// doesn't correspond to the framebuffer's edge
-		const QPoint old_vo = m_viewOffset;
-		const int MAGIC_MARGIN = 15;
-		if( mp.x() <= MAGIC_MARGIN && m_viewOffset.x() > 0 )
-		{
-			m_viewOffset.setX( qMax( 0, m_viewOffset.x() -
-						( MAGIC_MARGIN - mp.x() ) ) );
-		}
-		else if( mp.x() > width() - MAGIC_MARGIN && m_viewOffset.x() <=
-				m_connection->framebufferSize().width() -
-								width() )
-		{
-			m_viewOffset.setX( qMin( m_viewOffset.x() +
-					( MAGIC_MARGIN + mp.x() - width() ),
-				m_connection->framebufferSize().width() -
-								width() ) );
-		}
-
-		if( mp.y() <= MAGIC_MARGIN )
-		{
-			if( m_viewOffset.y() > 0 )
-			{
-				m_viewOffset.setY( qMax( 0, m_viewOffset.y() -
-						( MAGIC_MARGIN - mp.y() ) ) );
-			}
-			else if( mp.y() < 2 )
-			{
-				// special signal for allowing parent-widgets to
-				// show a toolbar etc.
-				emit mouseAtTop();
-			}
-		}
-		else if( mp.y() > height() - MAGIC_MARGIN && m_viewOffset.y() <=
-				m_connection->framebufferSize().height() -
-								height() )
-		{
-			m_viewOffset.setY( qMin( m_viewOffset.y() +
-					( MAGIC_MARGIN + mp.y() - height() ),
-				m_connection->framebufferSize().height() -
-								height() ) );
-		}
-
-		if( old_vo != m_viewOffset )
-		{
-			update();
-		}
-	}
-	else if( mp.y() <= 2 )
-	{
-		emit mouseAtTop();
-	}
-
-	QTimer::singleShot( 40, this, SLOT( framebufferUpdate() ) );
-}
-
-
-
-
-void vncView::updateCursorShape( void )
-{
-	if( !viewOnly() && !m_connection->cursorShape().isNull() )
-	{
-		setCursor( QCursor( QPixmap::fromImage(
-						m_connection->cursorShape() ),
-			m_connection->cursorHotSpot().x(),
-			m_connection->cursorHotSpot().y() ) );
-	}
-}
-
-
-
-
-// we have to filter key-events as QWidget's event()-implementation filters out
-// Tab and Shift-Tab for changing focus but as we need Tab, we have to do
-// key-event-dispatching on our own
-bool vncView::event( QEvent * e )
-{
-	if( !m_viewOnly )
-	{
-		switch( e->type() )
-		{
-			case QEvent::KeyPress:
-			case QEvent::KeyRelease:
-				keyEvent( (QKeyEvent *)( e ) );
-				return( e->isAccepted() );
-			default:
-				break;
-		}
-	}
-	return( QWidget::event( e ) );
-}
-
-
-
-
-void vncView::focusInEvent( QFocusEvent * _e )
-{
-	if( !m_viewOnlyFocus )
-	{
-		setViewOnly( FALSE );
-	}
-	QWidget::focusInEvent( _e );
-}
-
-
-
-
-void vncView::focusOutEvent( QFocusEvent * _e )
-{
-	m_viewOnlyFocus = viewOnly();
-	if( !viewOnly() )
-	{
-		setViewOnly( TRUE );
-	}
-	QWidget::focusOutEvent( _e );
-}
-
-
-
-
-// our builtin keyboard-handler
-void vncView::keyEvent( QKeyEvent * _ke )
-{
-	bool pressed = _ke->type() == QEvent::KeyPress;
-
-#ifdef NATIVE_VIRTUAL_KEY_SUPPORT
-	// the Trolls seem to love us! With Qt 4.2 they introduced this cute
-	// 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 VNC-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
-	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();
-		emit keyEvent( XK_ISO_Level3_Shift, TRUE );
-	}
-#endif
-
-	// handle modifiers
-	if( key == XK_Shift_L || key == XK_Control_L || key == XK_Meta_L ||
-							key == XK_Alt_L )
-	{
-		if( pressed )
-		{
-			m_mods[key] = true;
-		}
-		else if( m_mods.contains( key ) )
-		{
-			m_mods.remove( key );
-		}
-		else
-		{
-			unpressModifiers();
-		}
-	}
-
-	if( key )
-	{
-		emit keyEvent( key, pressed );
-		_ke->accept();
-	}
-}
-
-
-
-
-void vncView::unpressModifiers( void )
-{
-	QList<unsigned int> keys = m_mods.keys();
-	QList<unsigned int>::const_iterator it = keys.begin();
-	while( it != keys.end() )
-	{
-		emit keyEvent( *it, FALSE );
-		it++;
-	}
-	m_mods.clear();
-}
-
-
-
-
-QPoint vncView::mapToFramebuffer( const QPoint & _pos )
-{
-	const QSize fbs = m_connection ? m_connection->framebufferSize() :
-									QSize();
-	const int x = m_scaledView && fbs.isValid() ?
-			_pos.x() * fbs.width() / scaledSize( fbs ).width()
-		:
-			_pos.x() + m_viewOffset.x();
-	const int y = m_scaledView && m_connection ?
-			_pos.y() * fbs.height() / scaledSize( fbs ).height()
-		:
-			_pos.y() + m_viewOffset.y();
-	return( QPoint( x, y ) );
-}
-
-
-
-
-QRect vncView::mapFromFramebuffer( const QRect & _r )
-{
-	if( m_scaledView && m_connection )
-	{
-		const float dx = width() / (float)
-				m_connection->framebufferSize().width();
-		const float dy = height() / (float)
-				m_connection->framebufferSize().height();
-		return( QRect( (int)(_r.x()*dx), (int)(_r.y()*dy),
-					(int)(_r.width()*dx), (int)(_r.height()*dy) ) );
-	}
-	return( _r.translated( -m_viewOffset ) );
-}
-
-
-
-
-void vncView::mouseMoveEvent( QMouseEvent * _me )
-{
-	mouseEvent( _me );
-	_me->ignore();
-}
-
-
-
-
-void vncView::mousePressEvent( QMouseEvent * _me )
-{
-	mouseEvent( _me );
-	_me->accept();
-}
-
-
-
-
-void vncView::mouseReleaseEvent( QMouseEvent * _me )
-{
-	mouseEvent( _me );
-	_me->accept();
-}
-
-
-
-
-void vncView::mouseDoubleClickEvent( QMouseEvent * _me )
-{
-	mouseEvent( _me );
-	_me->accept();
-}
-
-
-
-
-
-void vncView::paintEvent( QPaintEvent * _pe )
-{
-	QPainter p( this );
-
-	// avoid nasty through-shining-window-effect when not connected yet
-	if( m_connection->screen().isNull() )
-	{
-		p.fillRect( _pe->rect(), Qt::black );
-		return;
-	}
-
-	const QSize ss = scaledSize();
-
-	// only paint requested region of image
-	p.drawImage( _pe->rect().topLeft(),
-			ss.isValid() ?
-				m_connection->scaledScreen() :
-						m_connection->screen(),
-			_pe->rect().translated( m_viewOffset ),
-			Qt::ThresholdDither );
-
-	if( viewOnly() && !m_connection->cursorShape().isNull() )
-	{
-		const QImage & cursor = m_connection->cursorShape();
-		const QRect cursor_rect = mapFromFramebuffer(
-			QRect( m_connection->cursorPos() -
-						m_connection->cursorHotSpot(),
-							cursor.size() ) );
-		// parts of cursor within updated region?
-		if( _pe->rect().intersects( cursor_rect ) )
-		{
-			// then repaint it
-			p.drawImage( cursor_rect.topLeft(), cursor );
-		}
-	}
-
-	// draw black borders if neccessary
-	const int fbw = ss.isValid() ? ss.width() :
-				m_connection->framebufferSize().width();
-	if( fbw < width() )
-	{
-		p.fillRect( fbw, 0, width() - fbw, height(), Qt::black );
-	}
-	const int fbh = ss.isValid() ? ss.height() :
-				m_connection->framebufferSize().height();
-	if( fbh < height() )
-	{
-		p.fillRect( 0, fbh, fbw, height() - fbh, Qt::black );
-	}
-}
-
-
-
-
-void vncView::resizeEvent( QResizeEvent * _re )
-{
-	m_connection->setScaledSize( scaledSize() );
-	const int max_x = m_connection->framebufferSize().width() - width();
-	const int max_y = m_connection->framebufferSize().height() - height();
-	if( m_viewOffset.x() > max_x || m_viewOffset.y() > max_y )
-	{
-		m_viewOffset = QPoint(
-				qMax( 0, qMin( m_viewOffset.x(), max_x ) ),
-				qMax( 0, qMin( m_viewOffset.y(), max_y ) ) );
-		update();
-	}
-
-	if( m_establishingConnection )
-	{
-		m_establishingConnection->move( 10, 10 );
-	}
-
-	QWidget::resizeEvent( _re );
-}
-
-
-
-
-void vncView::wheelEvent( QWheelEvent * _we )
-{
-	const QPoint p = mapToFramebuffer( _we->pos() );
-	emit pointerEvent( p.x(), p.y(), m_buttonMask |
-		( ( _we->delta() < 0 ) ? rfbButton5Mask : rfbButton4Mask ) );
-	emit pointerEvent( p.x(), p.y(), m_buttonMask );
-	
-	_we->accept();
-}
-
-
-
-
-void vncView::customEvent( QEvent * _e )
-{
-	if( _e->type() == regionChangedEvent().type() )
-	{
-		update();
-		_e->accept();
-	}
-	else
-	{
-		QWidget::customEvent( _e );
-	}
-}
-
-
-
-
-void vncView::mouseEvent( 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( Q_UINT8 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;
-				}
-			}
-		}
-	}
-
-	const QPoint p = mapToFramebuffer( _me->pos() );
-	emit pointerEvent( p.x(), p.y(), m_buttonMask );
-}
-
-
-
-
-
-
-
-
-vncViewThread::vncViewThread( vncView * _vv ) :
-	QThread( _vv ),
-	m_vncView( _vv )
-{
-	start( QThread::HighPriority );
-}
-
-
-
-
-void vncViewThread::run( void )
-{
-	vncWorker vw( m_vncView );
-	exec();
-}
-
-
-
-
-
-
-vncWorker::vncWorker( vncView * _vv ) :
-	QObject(),
-	m_vncView( _vv )
-{
-	qRegisterMetaType<Q_UINT16>( "Q_UINT16" );
-	qRegisterMetaType<Q_UINT32>( "Q_UINT32" );
-	connect( m_vncView->m_sysKeyTrapper,
-				SIGNAL( keyEvent( Q_UINT32, bool ) ),
-				this, SLOT( sendKeyEvent( Q_UINT32, bool ) ) );
-
-	connect( m_vncView,
-		SIGNAL( pointerEvent( Q_UINT16, Q_UINT16, Q_UINT16 ) ),
-		this, SLOT( sendPointerEvent( Q_UINT16, Q_UINT16,
-								Q_UINT16 ) ) );
-	connect( m_vncView, SIGNAL( keyEvent( Q_UINT32, bool ) ),
-				this, SLOT( sendKeyEvent( Q_UINT32, bool ) ) );
-
-
-	ivsConnection * conn = m_vncView->m_connection;
-	QTimer * t = new QTimer( this );
-	connect( t, SIGNAL( timeout() ), conn,
-			SLOT( sendIncrementalFramebufferUpdateRequest() ),
-							Qt::DirectConnection );
-	t->start( 50 );
-
-	t = new QTimer( this );
-	connect( t, SIGNAL( timeout() ), this,
-			SLOT( framebufferUpdate() ) );
-	t->start( 25 );
-}
-
-
-
-
-vncWorker::~vncWorker()
-{
-	// have to close the connection here for destroying/closing everything
-	// within the same thread - otherwise Qt might complain or even let us
-	// crash...
-	m_vncView->m_connection->close();
-}
-
-
-
-
-void vncWorker::framebufferUpdate( void )
-{
-	ivsConnection * conn = m_vncView->m_connection;
-	if( conn->state() != ivsConnection::Connected ||
-				!conn->handleServerMessages( FALSE, 3 ) )
-	{
-		conn->open();
-	}
-}
-
-
-
-
-void vncWorker::sendPointerEvent( Q_UINT16 _x, Q_UINT16 _y,
-							Q_UINT16 _button_mask )
-{
-	if( !m_vncView->viewOnly() )
-	{
-		m_vncView->m_connection->sendPointerEvent( _x, _y,
-								_button_mask );
-	}
-}
-
-
-
-
-void vncWorker::sendKeyEvent( Q_UINT32 _key, bool _down )
-{
-	if( !m_vncView->viewOnly() )
-	{
-		m_vncView->m_connection->sendKeyEvent( _key, _down );
-	}
-}
-
-
-
-
-#include "vncview.moc"
-
diff --git a/ltmain.sh b/ltmain.sh
deleted file mode 100755
index 7ed280b..0000000
--- a/ltmain.sh
+++ /dev/null
@@ -1,8413 +0,0 @@
-# Generated from ltmain.m4sh.
-
-# ltmain.sh (GNU libtool) 2.2.6b
-# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 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.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-#     --config             show all configuration variables
-#     --debug              enable verbose shell tracing
-# -n, --dry-run            display commands without modifying any files
-#     --features           display basic configuration information and exit
-#     --mode=MODE          use operation mode MODE
-#     --preserve-dup-deps  don't remove duplicate dependency libraries
-#     --quiet, --silent    don't print informational messages
-#     --tag=TAG            use configuration variables from tag TAG
-# -v, --verbose            print informational messages (default)
-#     --version            print version information
-# -h, --help               print short or long help message
-#
-# MODE must be one of the following:
-#
-#       clean              remove files from the build directory
-#       compile            compile a source file into a libtool object
-#       execute            automatically set library path, then run a program
-#       finish             complete the installation of libtool libraries
-#       install            install libraries or executables
-#       link               create a library or an executable
-#       uninstall          remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-#       host-triplet:	$host
-#       shell:		$SHELL
-#       compiler:		$LTCC
-#       compiler flags:		$LTCFLAGS
-#       linker:		$LD (gnu? $with_gnu_ld)
-#       $progname:		(GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1
-#       automake:		$automake_version
-#       autoconf:		$autoconf_version
-#
-# Report bugs to <bug-libtool at gnu.org>.
-
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION="2.2.6b Debian-2.2.6b-2ubuntu1"
-TIMESTAMP=""
-package_revision=1.3017
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# NLS nuisances: We save the old values to restore during execute mode.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
-  eval "if test \"\${$lt_var+set}\" = set; then
-          save_$lt_var=\$$lt_var
-          $lt_var=C
-	  export $lt_var
-	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
-	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
-	fi"
-done
-
-$lt_unset CDPATH
-
-
-
-
-
-: ${CP="cp -f"}
-: ${ECHO="echo"}
-: ${EGREP="/bin/grep -E"}
-: ${FGREP="/bin/grep -F"}
-: ${GREP="/bin/grep"}
-: ${LN_S="ln -s"}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SED="/bin/sed"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
-
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
-
-# Generated shell functions inserted here.
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-# The name of this program:
-# In the unlikely event $progname began with a '-', it would play havoc with
-# func_echo (imagine progname=-n), so we prepend ./ in that case:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
-case $progname in
-  -*) progname=./$progname ;;
-esac
-
-# Make sure we have an absolute path for reexecution:
-case $progpath in
-  [\\/]*|[A-Za-z]:\\*) ;;
-  *[\\/]*)
-     progdir=$func_dirname_result
-     progdir=`cd "$progdir" && pwd`
-     progpath="$progdir/$progname"
-     ;;
-  *)
-     save_IFS="$IFS"
-     IFS=:
-     for progdir in $PATH; do
-       IFS="$save_IFS"
-       test -x "$progdir/$progname" && break
-     done
-     IFS="$save_IFS"
-     test -n "$progdir" || progdir=`pwd`
-     progpath="$progdir/$progname"
-     ;;
-esac
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
-  s/$bs4/&\\
-/g
-  s/^$bs2$dollar/$bs&/
-  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
-  s/\n//g"
-
-# Standard options:
-opt_dry_run=false
-opt_help=false
-opt_quiet=false
-opt_verbose=false
-opt_warning=:
-
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
-    $ECHO "$progname${mode+: }$mode: $*"
-}
-
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && func_echo ${1+"$@"}
-
-    # A bug in bash halts the script if the last line of a function
-    # fails when set -e is in force, so we need another command to
-    # work around that:
-    :
-}
-
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
-}
-
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
-    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
-
-    # bash bug again:
-    :
-}
-
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
-
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    func_error ${1+"$@"}
-    func_fatal_error "$help"
-}
-help="Try \`$progname --help' for more information."  ## default
-
-
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
-    $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_mkdir_p directory-path
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
-    my_directory_path="$1"
-    my_dir_list=
-
-    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
-
-      # Protect directory names starting with `-'
-      case $my_directory_path in
-        -*) my_directory_path="./$my_directory_path" ;;
-      esac
-
-      # While some portion of DIR does not yet exist...
-      while test ! -d "$my_directory_path"; do
-        # ...make a list in topmost first order.  Use a colon delimited
-	# list incase some portion of path contains whitespace.
-        my_dir_list="$my_directory_path:$my_dir_list"
-
-        # If the last portion added has no slash in it, the list is done
-        case $my_directory_path in */*) ;; *) break ;; esac
-
-        # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
-      done
-      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
-
-      save_mkdir_p_IFS="$IFS"; IFS=':'
-      for my_dir in $my_dir_list; do
-	IFS="$save_mkdir_p_IFS"
-        # mkdir can fail with a `File exist' error if two processes
-        # try to create one of the directories concurrently.  Don't
-        # stop in that case!
-        $MKDIR "$my_dir" 2>/dev/null || :
-      done
-      IFS="$save_mkdir_p_IFS"
-
-      # Bail out if we (or some other process) failed to create a directory.
-      test -d "$my_directory_path" || \
-        func_fatal_error "Failed to create \`$1'"
-    fi
-}
-
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible.  If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
-
-    if test "$opt_dry_run" = ":"; then
-      # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
-    else
-
-      # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
-      if test ! -d "$my_tmpdir"; then
-        # Failing that, at least try and use $RANDOM to avoid a race
-        my_tmpdir="${my_template}-${RANDOM-0}$$"
-
-        save_mktempdir_umask=`umask`
-        umask 0077
-        $MKDIR "$my_tmpdir"
-        umask $save_mktempdir_umask
-      fi
-
-      # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || \
-        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
-    fi
-
-    $ECHO "X$my_tmpdir" | $Xsed
-}
-
-
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
-{
-    case $1 in
-      *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
-      *)
-        func_quote_for_eval_unquoted_result="$1" ;;
-    esac
-
-    case $func_quote_for_eval_unquoted_result in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting, command substitution and and variable
-      # expansion for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
-        ;;
-      *)
-        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
-    esac
-}
-
-
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
-    case $1 in
-      *[\\\`\"]*)
-	my_arg=`$ECHO "X$1" | $Xsed \
-	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        my_arg="$1" ;;
-    esac
-
-    case $my_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        my_arg="\"$my_arg\""
-        ;;
-    esac
-
-    func_quote_for_expand_result="$my_arg"
-}
-
-
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
-
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
-
-    if ${opt_dry_run-false}; then :; else
-      eval "$my_cmd"
-      my_status=$?
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
-}
-
-
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.  Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
-
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
-
-    if ${opt_dry_run-false}; then :; else
-      eval "$lt_user_locale
-	    $my_cmd"
-      my_status=$?
-      eval "$lt_safe_locale"
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
-}
-
-
-
-
-
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
-    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //
-	s/^# *$//
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
-        p
-     }' < "$progpath"
-     exit $?
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
-    $SED -n '/^# Usage:/,/# -h/ {
-        s/^# //
-	s/^# *$//
-	s/\$progname/'$progname'/
-	p
-    }' < "$progpath"
-    $ECHO
-    $ECHO "run \`$progname --help | more' for full usage"
-    exit $?
-}
-
-# func_help
-# Echo long help message to standard output and exit.
-func_help ()
-{
-    $SED -n '/^# Usage:/,/# Report bugs to/ {
-        s/^# //
-	s/^# *$//
-	s*\$progname*'$progname'*
-	s*\$host*'"$host"'*
-	s*\$SHELL*'"$SHELL"'*
-	s*\$LTCC*'"$LTCC"'*
-	s*\$LTCFLAGS*'"$LTCFLAGS"'*
-	s*\$LD*'"$LD"'*
-	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
-	p
-     }' < "$progpath"
-    exit $?
-}
-
-# func_missing_arg argname
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
-    func_error "missing argument for $1"
-    exit_cmd=exit
-}
-
-exit_cmd=:
-
-
-
-
-
-# Check that we have a working $ECHO.
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
-  # Yippee, $ECHO works!
-  :
-else
-  # Restart under the correct shell, and then maybe $ECHO will work.
-  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit $EXIT_SUCCESS
-fi
-
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
-
-# Global variables.
-# $mode is unset
-nonopt=
-execute_dlfiles=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
-
-opt_dry_run=false
-opt_duplicate_deps=false
-opt_silent=false
-opt_debug=:
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-# func_fatal_configuration arg...
-# Echo program name prefixed message to standard error, followed by
-# a configuration failure hint, and exit.
-func_fatal_configuration ()
-{
-    func_error ${1+"$@"}
-    func_error "See the $PACKAGE documentation for more information."
-    func_fatal_error "Fatal configuration error."
-}
-
-
-# func_config
-# Display the configuration for all the tags in this script.
-func_config ()
-{
-    re_begincf='^# ### BEGIN LIBTOOL'
-    re_endcf='^# ### END LIBTOOL'
-
-    # Default configuration.
-    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
-    # Now print the configurations for the tags.
-    for tagname in $taglist; do
-      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
-    done
-
-    exit $?
-}
-
-# func_features
-# Display the features supported by this script.
-func_features ()
-{
-    $ECHO "host: $host"
-    if test "$build_libtool_libs" = yes; then
-      $ECHO "enable shared libraries"
-    else
-      $ECHO "disable shared libraries"
-    fi
-    if test "$build_old_libs" = yes; then
-      $ECHO "enable static libraries"
-    else
-      $ECHO "disable static libraries"
-    fi
-
-    exit $?
-}
-
-# func_enable_tag tagname
-# Verify that TAGNAME is valid, and either flag an error and exit, or
-# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
-# variable here.
-func_enable_tag ()
-{
-  # Global variable:
-  tagname="$1"
-
-  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-  sed_extractcf="/$re_begincf/,/$re_endcf/p"
-
-  # Validate tagname.
-  case $tagname in
-    *[!-_A-Za-z0-9,/]*)
-      func_fatal_error "invalid tag name: $tagname"
-      ;;
-  esac
-
-  # Don't test for the "default" C tag, as we know it's
-  # there but not specially marked.
-  case $tagname in
-    CC) ;;
-    *)
-      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	taglist="$taglist $tagname"
-
-	# Evaluate the configuration.  Be careful to quote the path
-	# and the sed script, to avoid splitting on whitespace, but
-	# also don't use non-portable quotes within backquotes within
-	# quotes we have to do it in 2 steps:
-	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	eval "$extractedcf"
-      else
-	func_error "ignoring unknown tag $tagname"
-      fi
-      ;;
-  esac
-}
-
-# Parse options once, thoroughly.  This comes as soon as possible in
-# the script to make things like `libtool --version' happen quickly.
-{
-
-  # Shorthand for --mode=foo, only valid as the first argument
-  case $1 in
-  clean|clea|cle|cl)
-    shift; set dummy --mode clean ${1+"$@"}; shift
-    ;;
-  compile|compil|compi|comp|com|co|c)
-    shift; set dummy --mode compile ${1+"$@"}; shift
-    ;;
-  execute|execut|execu|exec|exe|ex|e)
-    shift; set dummy --mode execute ${1+"$@"}; shift
-    ;;
-  finish|finis|fini|fin|fi|f)
-    shift; set dummy --mode finish ${1+"$@"}; shift
-    ;;
-  install|instal|insta|inst|ins|in|i)
-    shift; set dummy --mode install ${1+"$@"}; shift
-    ;;
-  link|lin|li|l)
-    shift; set dummy --mode link ${1+"$@"}; shift
-    ;;
-  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-    shift; set dummy --mode uninstall ${1+"$@"}; shift
-    ;;
-  esac
-
-  # Parse non-mode specific arguments:
-  while test "$#" -gt 0; do
-    opt="$1"
-    shift
-
-    case $opt in
-      --config)		func_config					;;
-
-      --debug)		preserve_args="$preserve_args $opt"
-			func_echo "enabling shell trace mode"
-			opt_debug='set -x'
-			$opt_debug
-			;;
-
-      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-			execute_dlfiles="$execute_dlfiles $1"
-			shift
-			;;
-
-      --dry-run | -n)	opt_dry_run=:					;;
-      --features)       func_features					;;
-      --finish)		mode="finish"					;;
-
-      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-			case $1 in
-			  # Valid mode arguments:
-			  clean)	;;
-			  compile)	;;
-			  execute)	;;
-			  finish)	;;
-			  install)	;;
-			  link)		;;
-			  relink)	;;
-			  uninstall)	;;
-
-			  # Catch anything else as an error
-			  *) func_error "invalid argument for $opt"
-			     exit_cmd=exit
-			     break
-			     ;;
-		        esac
-
-			mode="$1"
-			shift
-			;;
-
-      --preserve-dup-deps)
-			opt_duplicate_deps=:				;;
-
-      --quiet|--silent)	preserve_args="$preserve_args $opt"
-			opt_silent=:
-			;;
-
-      --verbose| -v)	preserve_args="$preserve_args $opt"
-			opt_silent=false
-			;;
-
-      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-			preserve_args="$preserve_args $opt $1"
-			func_enable_tag "$1"	# tagname is set here
-			shift
-			;;
-
-      # Separate optargs to long options:
-      -dlopen=*|--mode=*|--tag=*)
-			func_opt_split "$opt"
-			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
-			shift
-			;;
-
-      -\?|-h)		func_usage					;;
-      --help)		opt_help=:					;;
-      --version)	func_version					;;
-
-      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
-
-      *)		nonopt="$opt"
-			break
-			;;
-    esac
-  done
-
-
-  case $host in
-    *cygwin* | *mingw* | *pw32* | *cegcc*)
-      # don't eliminate duplications in $postdeps and $predeps
-      opt_duplicate_compiler_generated_deps=:
-      ;;
-    *)
-      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
-      ;;
-  esac
-
-  # Having warned about all mis-specified options, bail out if
-  # anything was wrong.
-  $exit_cmd $EXIT_FAILURE
-}
-
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-      else
-        cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
-$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
-    fi
-
-    exit $EXIT_MISMATCH
-  fi
-}
-
-
-## ----------- ##
-##    Main.    ##
-## ----------- ##
-
-$opt_help || {
-  # Sanity checks first:
-  func_check_version_match
-
-  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-    func_fatal_configuration "not configured to build any kind of library"
-  fi
-
-  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
-
-
-  # Darwin sucks
-  eval std_shrext=\"$shrext_cmds\"
-
-
-  # Only execute mode is allowed to have -dlopen flags.
-  if test -n "$execute_dlfiles" && test "$mode" != execute; then
-    func_error "unrecognized option \`-dlopen'"
-    $ECHO "$help" 1>&2
-    exit $EXIT_FAILURE
-  fi
-
-  # Change the help message to a mode-specific one.
-  generic_help="$help"
-  help="Try \`$progname --help --mode=$mode' for more information."
-}
-
-
-# func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_lalib_p ()
-{
-    test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null \
-        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
-# func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function implements the same check as func_lalib_p without
-# resorting to external programs.  To this end, it redirects stdin and
-# closes it afterwards, without saving the original file descriptor.
-# As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if `file' does not exist.
-func_lalib_unsafe_p ()
-{
-    lalib_p=no
-    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
-	for lalib_p_l in 1 2 3 4
-	do
-	    read lalib_p_line
-	    case "$lalib_p_line" in
-		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
-	    esac
-	done
-	exec 0<&5 5<&-
-    fi
-    test "$lalib_p" = yes
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
-    func_lalib_p "$1"
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
-    func_ltwrapper_exec_suffix=
-    case $1 in
-    *.exe) ;;
-    *) func_ltwrapper_exec_suffix=.exe ;;
-    esac
-    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-func_ltwrapper_scriptname ()
-{
-    func_ltwrapper_scriptname_result=""
-    if func_ltwrapper_executable_p "$1"; then
-	func_dirname_and_basename "$1" "" "."
-	func_stripname '' '.exe' "$func_basename_result"
-	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
-    fi
-}
-
-# func_ltwrapper_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
-    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
-    $opt_debug
-    save_ifs=$IFS; IFS='~'
-    for cmd in $1; do
-      IFS=$save_ifs
-      eval cmd=\"$cmd\"
-      func_show_eval "$cmd" "${2-:}"
-    done
-    IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# Note that it is not necessary on cygwin/mingw to append a dot to
-# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
-# behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
-func_source ()
-{
-    $opt_debug
-    case $1 in
-    */* | *\\*)	. "$1" ;;
-    *)		. "./$1" ;;
-    esac
-}
-
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
-    $opt_debug
-    if test -n "$available_tags" && test -z "$tagname"; then
-      CC_quoted=
-      for arg in $CC; do
-        func_quote_for_eval "$arg"
-	CC_quoted="$CC_quoted $func_quote_for_eval_result"
-      done
-      case $@ in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
-      *)
-	for z in $available_tags; do
-	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
-	    CC_quoted=
-	    for arg in $CC; do
-	      # Double-quote args containing other shell metacharacters.
-	      func_quote_for_eval "$arg"
-	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
-	    done
-	    case "$@ " in
-	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with \`--tag'"
-#	else
-#	  func_verbose "using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
-}
-
-
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# but don't create it if we're doing a dry run.
-func_write_libtool_object ()
-{
-    write_libobj=${1}
-    if test "$build_libtool_libs" = yes; then
-      write_lobj=\'${2}\'
-    else
-      write_lobj=none
-    fi
-
-    if test "$build_old_libs" = yes; then
-      write_oldobj=\'${3}\'
-    else
-      write_oldobj=none
-    fi
-
-    $opt_dry_run || {
-      cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
-      $MV "${write_libobj}T" "${write_libobj}"
-    }
-}
-
-# func_mode_compile arg...
-func_mode_compile ()
-{
-    $opt_debug
-    # Get the compilation command and the source file.
-    base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
-    suppress_opt=yes
-    suppress_output=
-    arg_mode=normal
-    libobj=
-    later=
-    pie_flag=
-
-    for arg
-    do
-      case $arg_mode in
-      arg  )
-	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
-	arg_mode=normal
-	;;
-
-      target )
-	libobj="$arg"
-	arg_mode=normal
-	continue
-	;;
-
-      normal )
-	# Accept any command-line options.
-	case $arg in
-	-o)
-	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify \`-o' more than once"
-	  arg_mode=target
-	  continue
-	  ;;
-
-	-pie | -fpie | -fPIE)
-          pie_flag="$pie_flag $arg"
-	  continue
-	  ;;
-
-	-shared | -static | -prefer-pic | -prefer-non-pic)
-	  later="$later $arg"
-	  continue
-	  ;;
-
-	-no-suppress)
-	  suppress_opt=no
-	  continue
-	  ;;
-
-	-Xcompiler)
-	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
-	  continue      #  The current "srcfile" will either be retained or
-	  ;;            #  replaced later.  I would guess that would be a bug.
-
-	-Wc,*)
-	  func_stripname '-Wc,' '' "$arg"
-	  args=$func_stripname_result
-	  lastarg=
-	  save_ifs="$IFS"; IFS=','
-	  for arg in $args; do
-	    IFS="$save_ifs"
-	    func_quote_for_eval "$arg"
-	    lastarg="$lastarg $func_quote_for_eval_result"
-	  done
-	  IFS="$save_ifs"
-	  func_stripname ' ' '' "$lastarg"
-	  lastarg=$func_stripname_result
-
-	  # Add the arguments to base_compile.
-	  base_compile="$base_compile $lastarg"
-	  continue
-	  ;;
-
-	*)
-	  # Accept the current argument as the source file.
-	  # The previous "srcfile" becomes the current argument.
-	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
-	  ;;
-	esac  #  case $arg
-	;;
-      esac    #  case $arg_mode
-
-      # Aesthetically quote the previous argument.
-      func_quote_for_eval "$lastarg"
-      base_compile="$base_compile $func_quote_for_eval_result"
-    done # for arg
-
-    case $arg_mode in
-    arg)
-      func_fatal_error "you must specify an argument for -Xcompile"
-      ;;
-    target)
-      func_fatal_error "you must specify a target with \`-o'"
-      ;;
-    *)
-      # Get the name of the library object.
-      test -z "$libobj" && {
-	func_basename "$srcfile"
-	libobj="$func_basename_result"
-      }
-      ;;
-    esac
-
-    # Recognize several different file suffixes.
-    # If the user specifies -o file.o, it is replaced with file.lo
-    case $libobj in
-    *.[cCFSifmso] | \
-    *.ada | *.adb | *.ads | *.asm | \
-    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
-    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
-      func_xform "$libobj"
-      libobj=$func_xform_result
-      ;;
-    esac
-
-    case $libobj in
-    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
-    *)
-      func_fatal_error "cannot determine name of library object from \`$libobj'"
-      ;;
-    esac
-
-    func_infer_tag $base_compile
-
-    for arg in $later; do
-      case $arg in
-      -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
-	build_old_libs=no
-	continue
-	;;
-
-      -static)
-	build_libtool_libs=no
-	build_old_libs=yes
-	continue
-	;;
-
-      -prefer-pic)
-	pic_mode=yes
-	continue
-	;;
-
-      -prefer-non-pic)
-	pic_mode=no
-	continue
-	;;
-      esac
-    done
-
-    func_quote_for_eval "$libobj"
-    test "X$libobj" != "X$func_quote_for_eval_result" \
-      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name \`$libobj' may not contain shell special characters."
-    func_dirname_and_basename "$obj" "/" ""
-    objname="$func_basename_result"
-    xdir="$func_dirname_result"
-    lobj=${xdir}$objdir/$objname
-
-    test -z "$base_compile" && \
-      func_fatal_help "you must specify a compilation command"
-
-    # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
-      removelist="$obj $lobj $libobj ${libobj}T"
-    else
-      removelist="$lobj $libobj ${libobj}T"
-    fi
-
-    # On Cygwin there's no "real" PIC flag so we must build both object types
-    case $host_os in
-    cygwin* | mingw* | pw32* | os2* | cegcc*)
-      pic_mode=default
-      ;;
-    esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
-      # non-PIC code in shared libraries is not supported
-      pic_mode=default
-    fi
-
-    # Calculate the filename of the output object if compiler does
-    # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
-    else
-      output_obj=
-      need_locks=no
-      lockfile=
-    fi
-
-    # Lock this critical section if it is needed
-    # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
-      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
-	func_echo "Waiting for $lockfile to be removed"
-	sleep 2
-      done
-    elif test "$need_locks" = warn; then
-      if test -f "$lockfile"; then
-	$ECHO "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-      removelist="$removelist $output_obj"
-      $ECHO "$srcfile" > "$lockfile"
-    fi
-
-    $opt_dry_run || $RM $removelist
-    removelist="$removelist $lockfile"
-    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
-
-    if test -n "$fix_srcfile_path"; then
-      eval srcfile=\"$fix_srcfile_path\"
-    fi
-    func_quote_for_eval "$srcfile"
-    qsrcfile=$func_quote_for_eval_result
-
-    # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
-      # Without this assignment, base_compile gets emptied.
-      fbsd_hideous_sh_bug=$base_compile
-
-      if test "$pic_mode" != no; then
-	command="$base_compile $qsrcfile $pic_flag"
-      else
-	# Don't build PIC code
-	command="$base_compile $qsrcfile"
-      fi
-
-      func_mkdir_p "$xdir$objdir"
-
-      if test -z "$output_obj"; then
-	# Place PIC objects in $objdir
-	command="$command -o $lobj"
-      fi
-
-      func_show_eval_locale "$command"	\
-          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
-
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed, then go on to compile the next one
-      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
-	func_show_eval '$MV "$output_obj" "$lobj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-
-      # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
-	suppress_output=' >/dev/null 2>&1'
-      fi
-    fi
-
-    # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
-	# Don't build PIC code
-	command="$base_compile $qsrcfile$pie_flag"
-      else
-	command="$base_compile $qsrcfile $pic_flag"
-      fi
-      if test "$compiler_c_o" = yes; then
-	command="$command -o $obj"
-      fi
-
-      # Suppress compiler output if we already did a PIC compilation.
-      command="$command$suppress_output"
-      func_show_eval_locale "$command" \
-        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
-
-      if test "$need_locks" = warn &&
-	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
-	$opt_dry_run || $RM $removelist
-	exit $EXIT_FAILURE
-      fi
-
-      # Just move the object if needed
-      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
-	func_show_eval '$MV "$output_obj" "$obj"' \
-	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
-      fi
-    fi
-
-    $opt_dry_run || {
-      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
-      # Unlock the critical section if it was locked
-      if test "$need_locks" != no; then
-	removelist=$lockfile
-        $RM "$lockfile"
-      fi
-    }
-
-    exit $EXIT_SUCCESS
-}
-
-$opt_help || {
-test "$mode" = compile && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
-    # We need to display help for each of the modes.
-    case $mode in
-      "")
-        # Generic help is extracted from the usage comments
-        # at the start of this file.
-        func_help
-        ;;
-
-      clean)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      compile)
-      $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
-  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-  -no-suppress      do not suppress compiler output for multiple passes
-  -prefer-pic       try to building PIC objects only
-  -prefer-non-pic   try to building non-PIC objects only
-  -shared           do not build a \`.o' file suitable for static linking
-  -static           only build a \`.o' file suitable for static linking
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
-        ;;
-
-      execute)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
-  -dlopen FILE      add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-        ;;
-
-      finish)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
-        ;;
-
-      install)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
-  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-        ;;
-
-      link)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -avoid-version    do not add a version suffix if possible
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
-  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-  -export-symbols SYMFILE
-                    try to export only the symbols listed in SYMFILE
-  -export-symbols-regex REGEX
-                    try to export only the symbols matching REGEX
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -module           build a library that can dlopened
-  -no-fast-install  disable the fast-install mode
-  -no-install       link a not-installable executable
-  -no-undefined     declare that a library does not refer to external symbols
-  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
-  -precious-files-regex REGEX
-                    don't remove output files matching REGEX
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -shared           only do dynamic linking of libtool libraries
-  -shrext SUFFIX    override the standard shared library file extension
-  -static           do not do any dynamic linking of uninstalled libtool libraries
-  -static-libtool-libs
-                    do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-                    specify library version info [each variable defaults to 0]
-  -weak LIBNAME     declare that the target provides the LIBNAME interface
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename.  Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
-        ;;
-
-      uninstall)
-        $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-        ;;
-
-      *)
-        func_fatal_help "invalid operation mode \`$mode'"
-        ;;
-    esac
-
-    $ECHO
-    $ECHO "Try \`$progname --help' for more information about other modes."
-
-    exit $?
-}
-
-  # Now that we've collected a possible --mode arg, show help if necessary
-  $opt_help && func_mode_help
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
-    $opt_debug
-    # The first argument is the command name.
-    cmd="$nonopt"
-    test -z "$cmd" && \
-      func_fatal_help "you must specify a COMMAND"
-
-    # Handle -dlopen flags immediately.
-    for file in $execute_dlfiles; do
-      test -f "$file" \
-	|| func_fatal_help "\`$file' is not a file"
-
-      dir=
-      case $file in
-      *.la)
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$lib' is not a valid libtool archive"
-
-	# Read the libtool library.
-	dlname=
-	library_names=
-	func_source "$file"
-
-	# Skip this library if it cannot be dlopened.
-	if test -z "$dlname"; then
-	  # Warn if it was a shared library.
-	  test -n "$library_names" && \
-	    func_warning "\`$file' was not linked with \`-export-dynamic'"
-	  continue
-	fi
-
-	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
-
-	if test -f "$dir/$objdir/$dlname"; then
-	  dir="$dir/$objdir"
-	else
-	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
-	  fi
-	fi
-	;;
-
-      *.lo)
-	# Just add the directory containing the .lo file.
-	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
-	;;
-
-      *)
-	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
-	continue
-	;;
-      esac
-
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-	eval "$shlibpath_var=\"\$dir\""
-      else
-	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic="$magic"
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -*) ;;
-      *)
-	# Do a test to see if this is really a libtool program.
-	if func_ltwrapper_script_p "$file"; then
-	  func_source "$file"
-	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
-	elif func_ltwrapper_executable_p "$file"; then
-	  func_ltwrapper_scriptname "$file"
-	  func_source "$func_ltwrapper_scriptname_result"
-	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
-	fi
-	;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      func_quote_for_eval "$file"
-      args="$args $func_quote_for_eval_result"
-    done
-
-    if test "X$opt_dry_run" = Xfalse; then
-      if test -n "$shlibpath_var"; then
-	# Export the shlibpath_var.
-	eval "export $shlibpath_var"
-      fi
-
-      # Restore saved environment variables
-      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-      do
-	eval "if test \"\${save_$lt_var+set}\" = set; then
-                $lt_var=\$save_$lt_var; export $lt_var
-	      else
-		$lt_unset $lt_var
-	      fi"
-      done
-
-      # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	$ECHO "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
-    fi
-}
-
-test "$mode" = execute && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
-    $opt_debug
-    libdirs="$nonopt"
-    admincmds=
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for dir
-      do
-	libdirs="$libdirs $dir"
-      done
-
-      for libdir in $libdirs; do
-	if test -n "$finish_cmds"; then
-	  # Do each command in the finish commands.
-	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
-	fi
-	if test -n "$finish_eval"; then
-	  # Do the single finish_eval.
-	  eval cmds=\"$finish_eval\"
-	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
-       $cmds"
-	fi
-      done
-    fi
-
-    # Exit here if they wanted silent mode.
-    $opt_silent && exit $EXIT_SUCCESS
-
-    $ECHO "X----------------------------------------------------------------------" | $Xsed
-    $ECHO "Libraries have been installed in:"
-    for libdir in $libdirs; do
-      $ECHO "   $libdir"
-    done
-    $ECHO
-    $ECHO "If you ever happen to want to link against installed libraries"
-    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
-    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
-    $ECHO "flag during linking and do at least one of the following:"
-    if test -n "$shlibpath_var"; then
-      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-      $ECHO "     during execution"
-    fi
-    if test -n "$runpath_var"; then
-      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
-      $ECHO "     during linking"
-    fi
-    if test -n "$hardcode_libdir_flag_spec"; then
-      libdir=LIBDIR
-      eval flag=\"$hardcode_libdir_flag_spec\"
-
-      $ECHO "   - use the \`$flag' linker flag"
-    fi
-    if test -n "$admincmds"; then
-      $ECHO "   - have your system administrator run these commands:$admincmds"
-    fi
-    if test -f /etc/ld.so.conf; then
-      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-    fi
-    $ECHO
-
-    $ECHO "See any operating system documentation about shared libraries for"
-    case $host in
-      solaris2.[6789]|solaris2.1[0-9])
-        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
-	$ECHO "pages."
-	;;
-      *)
-        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
-        ;;
-    esac
-    $ECHO "X----------------------------------------------------------------------" | $Xsed
-    exit $EXIT_SUCCESS
-}
-
-test "$mode" = finish && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
-    $opt_debug
-    # There may be an optional sh(1) argument at the beginning of
-    # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
-       # Allow the use of GNU shtool's install command.
-       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
-      # Aesthetically quote it.
-      func_quote_for_eval "$nonopt"
-      install_prog="$func_quote_for_eval_result "
-      arg=$1
-      shift
-    else
-      install_prog=
-      arg=$nonopt
-    fi
-
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    func_quote_for_eval "$arg"
-    install_prog="$install_prog$func_quote_for_eval_result"
-
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=no
-    stripme=
-    for arg
-    do
-      if test -n "$dest"; then
-	files="$files $dest"
-	dest=$arg
-	continue
-      fi
-
-      case $arg in
-      -d) isdir=yes ;;
-      -f)
-	case " $install_prog " in
-	*[\\\ /]cp\ *) ;;
-	*) prev=$arg ;;
-	esac
-	;;
-      -g | -m | -o)
-	prev=$arg
-	;;
-      -s)
-	stripme=" -s"
-	continue
-	;;
-      -*)
-	;;
-      *)
-	# If the previous option needed an argument, then skip it.
-	if test -n "$prev"; then
-	  prev=
-	else
-	  dest=$arg
-	  continue
-	fi
-	;;
-      esac
-
-      # Aesthetically quote the argument.
-      func_quote_for_eval "$arg"
-      install_prog="$install_prog $func_quote_for_eval_result"
-    done
-
-    test -z "$install_prog" && \
-      func_fatal_help "you must specify an install program"
-
-    test -n "$prev" && \
-      func_fatal_help "the \`$prev' option requires an argument"
-
-    if test -z "$files"; then
-      if test -z "$dest"; then
-	func_fatal_help "no file or destination specified"
-      else
-	func_fatal_help "you must specify a destination"
-      fi
-    fi
-
-    # Strip any trailing slash from the destination.
-    func_stripname '' '/' "$dest"
-    dest=$func_stripname_result
-
-    # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
-      destname=
-    else
-      func_dirname_and_basename "$dest" "" "."
-      destdir="$func_dirname_result"
-      destname="$func_basename_result"
-
-      # Not a directory, so check to see that there is only one file specified.
-      set dummy $files; shift
-      test "$#" -gt 1 && \
-	func_fatal_help "\`$dest' is not a directory"
-    fi
-    case $destdir in
-    [\\/]* | [A-Za-z]:[\\/]*) ;;
-    *)
-      for file in $files; do
-	case $file in
-	*.lo) ;;
-	*)
-	  func_fatal_help "\`$destdir' must be an absolute directory name"
-	  ;;
-	esac
-      done
-      ;;
-    esac
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
-
-      # Do each installation.
-      case $file in
-      *.$libext)
-	# Do the static libraries later.
-	staticlibs="$staticlibs $file"
-	;;
-
-      *.la)
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$file' is not a valid libtool archive"
-
-	library_names=
-	old_library=
-	relink_command=
-	func_source "$file"
-
-	# Add the libdir to current_libdirs if it is the destination.
-	if test "X$destdir" = "X$libdir"; then
-	  case "$current_libdirs " in
-	  *" $libdir "*) ;;
-	  *) current_libdirs="$current_libdirs $libdir" ;;
-	  esac
-	else
-	  # Note the libdir as a future libdir.
-	  case "$future_libdirs " in
-	  *" $libdir "*) ;;
-	  *) future_libdirs="$future_libdirs $libdir" ;;
-	  esac
-	fi
-
-	func_dirname "$file" "/" ""
-	dir="$func_dirname_result"
-	dir="$dir$objdir"
-
-	if test -n "$relink_command"; then
-	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
-
-	  # Don't allow the user to place us outside of our expected
-	  # location b/c this prevents finding dependent libraries that
-	  # are installed to the same prefix.
-	  # At present, this check doesn't affect windows .dll's that
-	  # are installed into $libdir/../bin (currently, that works fine)
-	  # but it's something to keep an eye on.
-	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
-
-	  if test -n "$inst_prefix_dir"; then
-	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
-	  else
-	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
-	  fi
-
-	  func_warning "relinking \`$file'"
-	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
-	fi
-
-	# See the names of the shared library.
-	set dummy $library_names; shift
-	if test -n "$1"; then
-	  realname="$1"
-	  shift
-
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
-
-	  # Install the shared library and build the symlinks.
-	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
-	      'exit $?'
-	  tstripme="$stripme"
-	  case $host_os in
-	  cygwin* | mingw* | pw32* | cegcc*)
-	    case $realname in
-	    *.dll.a)
-	      tstripme=""
-	      ;;
-	    esac
-	    ;;
-	  esac
-	  if test -n "$tstripme" && test -n "$striplib"; then
-	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
-	  fi
-
-	  if test "$#" -gt 0; then
-	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
-	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
-	    # so we also need to try rm && ln -s.
-	    for linkname
-	    do
-	      test "$linkname" != "$realname" \
-		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
-	    done
-	  fi
-
-	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
-	  func_execute_cmds "$postinstall_cmds" 'exit $?'
-	fi
-
-	# Install the pseudo-library for information purposes.
-	func_basename "$file"
-	name="$func_basename_result"
-	instname="$dir/$name"i
-	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
-	# Maybe install the static library, too.
-	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
-	;;
-
-      *.lo)
-	# Install (i.e. copy) a libtool object.
-
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
-	fi
-
-	# Deduce the name of the destination old-style object file.
-	case $destfile in
-	*.lo)
-	  func_lo2o "$destfile"
-	  staticdest=$func_lo2o_result
-	  ;;
-	*.$objext)
-	  staticdest="$destfile"
-	  destfile=
-	  ;;
-	*)
-	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
-	  ;;
-	esac
-
-	# Install the libtool object if requested.
-	test -n "$destfile" && \
-	  func_show_eval "$install_prog $file $destfile" 'exit $?'
-
-	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
-	  # Deduce the name of the old-style object file.
-	  func_lo2o "$file"
-	  staticobj=$func_lo2o_result
-	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
-	fi
-	exit $EXIT_SUCCESS
-	;;
-
-      *)
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
-	fi
-
-	# If the file is missing, and there is a .exe on the end, strip it
-	# because it is most likely a libtool script we actually want to
-	# install
-	stripped_ext=""
-	case $file in
-	  *.exe)
-	    if test ! -f "$file"; then
-	      func_stripname '' '.exe' "$file"
-	      file=$func_stripname_result
-	      stripped_ext=".exe"
-	    fi
-	    ;;
-	esac
-
-	# Do a test to see if this is really a libtool program.
-	case $host in
-	*cygwin* | *mingw*)
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      wrapper=$func_ltwrapper_scriptname_result
-	    else
-	      func_stripname '' '.exe' "$file"
-	      wrapper=$func_stripname_result
-	    fi
-	    ;;
-	*)
-	    wrapper=$file
-	    ;;
-	esac
-	if func_ltwrapper_script_p "$wrapper"; then
-	  notinst_deplibs=
-	  relink_command=
-
-	  func_source "$wrapper"
-
-	  # Check the variables that should have been set.
-	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
-
-	  finalize=yes
-	  for lib in $notinst_deplibs; do
-	    # Check to see that each library is installed.
-	    libdir=
-	    if test -f "$lib"; then
-	      func_source "$lib"
-	    fi
-	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "\`$lib' has not been installed in \`$libdir'"
-	      finalize=no
-	    fi
-	  done
-
-	  relink_command=
-	  func_source "$wrapper"
-
-	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
-	    $opt_dry_run || {
-	      if test "$finalize" = yes; then
-	        tmpdir=`func_mktempdir`
-		func_basename "$file$stripped_ext"
-		file="$func_basename_result"
-	        outputname="$tmpdir/$file"
-	        # Replace the output file specification.
-	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
-
-	        $opt_silent || {
-	          func_quote_for_expand "$relink_command"
-		  eval "func_echo $func_quote_for_expand_result"
-	        }
-	        if eval "$relink_command"; then :
-	          else
-		  func_error "error: relink \`$file' with the above command before installing it"
-		  $opt_dry_run || ${RM}r "$tmpdir"
-		  continue
-	        fi
-	        file="$outputname"
-	      else
-	        func_warning "cannot relink \`$file'"
-	      fi
-	    }
-	  else
-	    # Install the binary that we compiled earlier.
-	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
-	  fi
-	fi
-
-	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyway
-	case $install_prog,$host in
-	*/usr/bin/install*,*cygwin*)
-	  case $file:$destfile in
-	  *.exe:*.exe)
-	    # this is ok
-	    ;;
-	  *.exe:*)
-	    destfile=$destfile.exe
-	    ;;
-	  *:*.exe)
-	    func_stripname '' '.exe' "$destfile"
-	    destfile=$func_stripname_result
-	    ;;
-	  esac
-	  ;;
-	esac
-	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
-	$opt_dry_run || if test -n "$outputname"; then
-	  ${RM}r "$tmpdir"
-	fi
-	;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      func_basename "$file"
-      name="$func_basename_result"
-
-      # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
-
-      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
-      if test -n "$stripme" && test -n "$old_striplib"; then
-	func_show_eval "$old_striplib $oldlib" 'exit $?'
-      fi
-
-      # Do each command in the postinstall commands.
-      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
-    done
-
-    test -n "$future_libdirs" && \
-      func_warning "remember to run \`$progname --finish$future_libdirs'"
-
-    if test -n "$current_libdirs"; then
-      # Maybe just do a dry run.
-      $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
-    else
-      exit $EXIT_SUCCESS
-    fi
-}
-
-test "$mode" = install && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# a dlpreopen symbol table.
-func_generate_dlsyms ()
-{
-    $opt_debug
-    my_outputname="$1"
-    my_originator="$2"
-    my_pic_p="${3-no}"
-    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
-    my_dlsyms=
-
-    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-      if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms="${my_outputname}S.c"
-      else
-	func_error "not configured to extract global symbols from dlpreopened files"
-      fi
-    fi
-
-    if test -n "$my_dlsyms"; then
-      case $my_dlsyms in
-      "") ;;
-      *.c)
-	# Discover the nlist of each of the dlfiles.
-	nlist="$output_objdir/${my_outputname}.nm"
-
-	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
-	# Parse the name list into a source file.
-	func_verbose "creating $output_objdir/$my_dlsyms"
-
-	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-/* External symbol declarations for the compiler. */\
-"
-
-	if test "$dlself" = yes; then
-	  func_verbose "generating symbol list for \`$output'"
-
-	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
-	  # Add our own program objects to the symbol list.
-	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	  for progfile in $progfiles; do
-	    func_verbose "extracting global C symbols from \`$progfile'"
-	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
-	  done
-
-	  if test -n "$exclude_expsyms"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  if test -n "$export_symbols_regex"; then
-	    $opt_dry_run || {
-	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	    }
-	  fi
-
-	  # Prepare the list of exported symbols
-	  if test -z "$export_symbols"; then
-	    export_symbols="$output_objdir/$outputname.exp"
-	    $opt_dry_run || {
-	      $RM $export_symbols
-	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-	      case $host in
-	      *cygwin* | *mingw* | *cegcc* )
-                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-	        ;;
-	      esac
-	    }
-	  else
-	    $opt_dry_run || {
-	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-	      eval '$MV "$nlist"T "$nlist"'
-	      case $host in
-	        *cygwin | *mingw* | *cegcc* )
-	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-	          ;;
-	      esac
-	    }
-	  fi
-	fi
-
-	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from \`$dlprefile'"
-	  func_basename "$dlprefile"
-	  name="$func_basename_result"
-	  $opt_dry_run || {
-	    eval '$ECHO ": $name " >> "$nlist"'
-	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-	  }
-	done
-
-	$opt_dry_run || {
-	  # Make sure we have at least an empty file.
-	  test -f "$nlist" || : > "$nlist"
-
-	  if test -n "$exclude_expsyms"; then
-	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-	    $MV "$nlist"T "$nlist"
-	  fi
-
-	  # Try sorting and uniquifying the output.
-	  if $GREP -v "^: " < "$nlist" |
-	      if sort -k 3 </dev/null >/dev/null 2>&1; then
-		sort -k 3
-	      else
-		sort +2
-	      fi |
-	      uniq > "$nlist"S; then
-	    :
-	  else
-	    $GREP -v "^: " < "$nlist" > "$nlist"S
-	  fi
-
-	  if test -f "$nlist"S; then
-	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
-	  else
-	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
-	  fi
-
-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols.  */
-typedef struct {
-  const char *name;
-  void *address;
-} lt_dlsymlist;
-"
-	  case $host in
-	  *cygwin* | *mingw* | *cegcc* )
-	    $ECHO >> "$output_objdir/$my_dlsyms" "\
-/* DATA imports from DLLs on WIN32 con't be const, because
-   runtime relocations are performed -- see ld's documentation
-   on pseudo-relocs.  */"
-	    lt_dlsym_const= ;;
-	  *osf5*)
-	    echo >> "$output_objdir/$my_dlsyms" "\
-/* This system does not cope well with relocations in const data */"
-	    lt_dlsym_const= ;;
-	  *)
-	    lt_dlsym_const=const ;;
-	  esac
-
-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-extern $lt_dlsym_const lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
-$lt_dlsym_const lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
-  { \"$my_originator\", (void *) 0 },"
-
-	  case $need_lib_prefix in
-	  no)
-	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  *)
-	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
-	    ;;
-	  esac
-	  $ECHO >> "$output_objdir/$my_dlsyms" "\
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
-	} # !$opt_dry_run
-
-	pic_flag_for_symtable=
-	case "$compile_command " in
-	*" -static "*) ;;
-	*)
-	  case $host in
-	  # compiling the symbol table file with pic_flag works around
-	  # a FreeBSD bug that causes programs to crash when -lm is
-	  # linked before any other PIC object.  But we must not use
-	  # pic_flag when linking with -static.  The problem exists in
-	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
-	  *-*-hpux*)
-	    pic_flag_for_symtable=" $pic_flag"  ;;
-	  *)
-	    if test "X$my_pic_p" != Xno; then
-	      pic_flag_for_symtable=" $pic_flag"
-	    fi
-	    ;;
-	  esac
-	  ;;
-	esac
-	symtab_cflags=
-	for arg in $LTCFLAGS; do
-	  case $arg in
-	  -pie | -fpie | -fPIE) ;;
-	  *) symtab_cflags="$symtab_cflags $arg" ;;
-	  esac
-	done
-
-	# Now compile the dynamic symbol file.
-	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
-	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
-
-	# Transform the symbol file into the correct name.
-	symfileobj="$output_objdir/${my_outputname}S.$objext"
-	case $host in
-	*cygwin* | *mingw* | *cegcc* )
-	  if test -f "$output_objdir/$my_outputname.def"; then
-	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
-	  else
-	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-	  fi
-	  ;;
-	*)
-	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
-	  ;;
-	esac
-	;;
-      *)
-	func_fatal_error "unknown suffix for \`$my_dlsyms'"
-	;;
-      esac
-    else
-      # We keep going just in case the user didn't refer to
-      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-      # really was required.
-
-      # Nullify the symbol file.
-      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
-      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
-    fi
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-func_win32_libid ()
-{
-  $opt_debug
-  win32_libid_type="unknown"
-  win32_fileres=`file -L $1 2>/dev/null`
-  case $win32_fileres in
-  *ar\ archive\ import\ library*) # definitely import
-    win32_libid_type="x86 archive import"
-    ;;
-  *ar\ archive*) # could be an import, or static
-    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
-      win32_nmres=`eval $NM -f posix -A $1 |
-	$SED -n -e '
-	    1,100{
-		/ I /{
-		    s,.*,import,
-		    p
-		    q
-		}
-	    }'`
-      case $win32_nmres in
-      import*)  win32_libid_type="x86 archive import";;
-      *)        win32_libid_type="x86 archive static";;
-      esac
-    fi
-    ;;
-  *DLL*)
-    win32_libid_type="x86 DLL"
-    ;;
-  *executable*) # but shell scripts are "executable" too...
-    case $win32_fileres in
-    *MS\ Windows\ PE\ Intel*)
-      win32_libid_type="x86 DLL"
-      ;;
-    esac
-    ;;
-  esac
-  $ECHO "$win32_libid_type"
-}
-
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
-    $opt_debug
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
-    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
-    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-     :
-    else
-      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
-    fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
-    $opt_debug
-    my_gentop="$1"; shift
-    my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
-
-    for my_xlib in $my_oldlibs; do
-      # Extract the objects.
-      case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
-	*) my_xabs=`pwd`"/$my_xlib" ;;
-      esac
-      func_basename "$my_xlib"
-      my_xlib="$func_basename_result"
-      my_xlib_u=$my_xlib
-      while :; do
-        case " $extracted_archives " in
-	*" $my_xlib_u "*)
-	  func_arith $extracted_serial + 1
-	  extracted_serial=$func_arith_result
-	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
-	*) break ;;
-	esac
-      done
-      extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
-
-      func_mkdir_p "$my_xdir"
-
-      case $host in
-      *-darwin*)
-	func_verbose "Extracting $my_xabs"
-	# Do not bother doing anything if just a dry run
-	$opt_dry_run || {
-	  darwin_orig_dir=`pwd`
-	  cd $my_xdir || exit $?
-	  darwin_archive=$my_xabs
-	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename "$darwin_archive"`
-	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
-	  if test -n "$darwin_arches"; then
-	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
-	    darwin_arch=
-	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
-	      cd "$darwin_curdir"
-	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
-	    done # $darwin_arches
-            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
-	    darwin_file=
-	    darwin_files=
-	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
-	      $LIPO -create -output "$darwin_file" $darwin_files
-	    done # $darwin_filelist
-	    $RM -rf unfat-$$
-	    cd "$darwin_orig_dir"
-	  else
-	    cd $darwin_orig_dir
-	    func_extract_an_archive "$my_xdir" "$my_xabs"
-	  fi # $darwin_arches
-	} # !$opt_dry_run
-	;;
-      *)
-        func_extract_an_archive "$my_xdir" "$my_xabs"
-	;;
-      esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-    done
-
-    func_extract_archives_result="$my_oldobjs"
-}
-
-
-
-# func_emit_wrapper_part1 [arg=no]
-#
-# Emit the first part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part1 ()
-{
-	func_emit_wrapper_part1_arg1=no
-	if test -n "$1" ; then
-	  func_emit_wrapper_part1_arg1=$1
-	fi
-
-	$ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variables:
-  generated_by_libtool_version='$macro_version'
-  notinst_deplibs='$notinst_deplibs'
-else
-  # When we are sourced in execute mode, \$file and \$ECHO are already set.
-  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    ECHO=\"$qecho\"
-    file=\"\$0\"
-    # Make sure echo works.
-    if test \"X\$1\" = X--no-reexec; then
-      # Discard the --no-reexec flag, and continue.
-      shift
-    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
-      # Yippee, \$ECHO works!
-      :
-    else
-      # Restart under the correct shell, and then maybe \$ECHO will work.
-      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
-    fi
-  fi\
-"
-	$ECHO "\
-
-  # Find the directory that this script lives in.
-  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
-
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
-
-    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
-  done
-"
-}
-# end: func_emit_wrapper_part1
-
-# func_emit_wrapper_part2 [arg=no]
-#
-# Emit the second part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part2 ()
-{
-	func_emit_wrapper_part2_arg1=no
-	if test -n "$1" ; then
-	  func_emit_wrapper_part2_arg1=$1
-	fi
-
-	$ECHO "\
-
-  # Usually 'no', except on cygwin/mingw when embedded into
-  # the cwrapper.
-  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
-  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
-    # special case for '.'
-    if test \"\$thisdir\" = \".\"; then
-      thisdir=\`pwd\`
-    fi
-    # remove .libs from thisdir
-    case \"\$thisdir\" in
-    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
-    $objdir )   thisdir=. ;;
-    esac
-  fi
-
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
-	if test "$fast_install" = yes; then
-	  $ECHO "\
-  program=lt-'$outputname'$exeext
-  progdir=\"\$thisdir/$objdir\"
-
-  if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
-       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
-    file=\"\$\$-\$program\"
-
-    if test ! -d \"\$progdir\"; then
-      $MKDIR \"\$progdir\"
-    else
-      $RM \"\$progdir/\$file\"
-    fi"
-
-	  $ECHO "\
-
-    # relink executable if necessary
-    if test -n \"\$relink_command\"; then
-      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-      else
-	$ECHO \"\$relink_command_output\" >&2
-	$RM \"\$progdir/\$file\"
-	exit 1
-      fi
-    fi
-
-    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
-    { $RM \"\$progdir/\$program\";
-      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
-    $RM \"\$progdir/\$file\"
-  fi"
-	else
-	  $ECHO "\
-  program='$outputname'
-  progdir=\"\$thisdir/$objdir\"
-"
-	fi
-
-	$ECHO "\
-
-  if test -f \"\$progdir/\$program\"; then"
-
-	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-	  $ECHO "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
-
-    export $shlibpath_var
-"
-	fi
-
-	# fixup the dll searchpath if we need to.
-	if test -n "$dllsearchpath"; then
-	  $ECHO "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
-
-	$ECHO "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-"
-	case $host in
-	# Backslashes separate directories on plain windows
-	*-*-mingw | *-*-os2* | *-cegcc*)
-	  $ECHO "\
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-	  ;;
-
-	*)
-	  $ECHO "\
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-	  ;;
-	esac
-	$ECHO "\
-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-      exit 1
-    fi
-  else
-    # The program doesn't exist.
-    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
-    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
-    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit 1
-  fi
-fi\
-"
-}
-# end: func_emit_wrapper_part2
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable.  Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory.  This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
-	func_emit_wrapper_arg1=no
-	if test -n "$1" ; then
-	  func_emit_wrapper_arg1=$1
-	fi
-
-	# split this up so that func_emit_cwrapperexe_src
-	# can call each part independently.
-	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
-	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
-}
-
-
-# func_to_host_path arg
-#
-# Convert paths to host format when used with build tools.
-# Intended for use with "native" mingw (where libtool itself
-# is running under the msys shell), or in the following cross-
-# build environments:
-#    $build          $host
-#    mingw (msys)    mingw  [e.g. native]
-#    cygwin          mingw
-#    *nix + wine     mingw
-# where wine is equipped with the `winepath' executable.
-# In the native mingw case, the (msys) shell automatically
-# converts paths for any non-msys applications it launches,
-# but that facility isn't available from inside the cwrapper.
-# Similar accommodations are necessary for $host mingw and
-# $build cygwin.  Calling this function does no harm for other
-# $host/$build combinations not listed above.
-#
-# ARG is the path (on $build) that should be converted to
-# the proper representation for $host. The result is stored
-# in $func_to_host_path_result.
-func_to_host_path ()
-{
-  func_to_host_path_result="$1"
-  if test -n "$1" ; then
-    case $host in
-      *mingw* )
-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-        case $build in
-          *mingw* ) # actually, msys
-            # awkward: cmd appends spaces to result
-            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
-              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
-            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          *cygwin* )
-            func_to_host_path_tmp1=`cygpath -w "$1"`
-            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          * )
-            # Unfortunately, winepath does not exit with a non-zero
-            # error code, so we are forced to check the contents of
-            # stdout. On the other hand, if the command is not
-            # found, the shell will set an exit code of 127 and print
-            # *an error message* to stdout. So we must check for both
-            # error code of zero AND non-empty stdout, which explains
-            # the odd construction:
-            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
-            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
-              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-                $SED -e "$lt_sed_naive_backslashify"`
-            else
-              # Allow warning below.
-              func_to_host_path_result=""
-            fi
-            ;;
-        esac
-        if test -z "$func_to_host_path_result" ; then
-          func_error "Could not determine host path corresponding to"
-          func_error "  '$1'"
-          func_error "Continuing, but uninstalled executables may not work."
-          # Fallback:
-          func_to_host_path_result="$1"
-        fi
-        ;;
-    esac
-  fi
-}
-# end: func_to_host_path
-
-# func_to_host_pathlist arg
-#
-# Convert pathlists to host format when used with build tools.
-# See func_to_host_path(), above. This function supports the
-# following $build/$host combinations (but does no harm for
-# combinations not listed here):
-#    $build          $host
-#    mingw (msys)    mingw  [e.g. native]
-#    cygwin          mingw
-#    *nix + wine     mingw
-#
-# Path separators are also converted from $build format to
-# $host format. If ARG begins or ends with a path separator
-# character, it is preserved (but converted to $host format)
-# on output.
-#
-# ARG is a pathlist (on $build) that should be converted to
-# the proper representation on $host. The result is stored
-# in $func_to_host_pathlist_result.
-func_to_host_pathlist ()
-{
-  func_to_host_pathlist_result="$1"
-  if test -n "$1" ; then
-    case $host in
-      *mingw* )
-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-        # Remove leading and trailing path separator characters from
-        # ARG. msys behavior is inconsistent here, cygpath turns them
-        # into '.;' and ';.', and winepath ignores them completely.
-        func_to_host_pathlist_tmp2="$1"
-        # Once set for this call, this variable should not be
-        # reassigned. It is used in tha fallback case.
-        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
-          $SED -e 's|^:*||' -e 's|:*$||'`
-        case $build in
-          *mingw* ) # Actually, msys.
-            # Awkward: cmd appends spaces to result.
-            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
-              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
-            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          *cygwin* )
-            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
-            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
-              $SED -e "$lt_sed_naive_backslashify"`
-            ;;
-          * )
-            # unfortunately, winepath doesn't convert pathlists
-            func_to_host_pathlist_result=""
-            func_to_host_pathlist_oldIFS=$IFS
-            IFS=:
-            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
-              IFS=$func_to_host_pathlist_oldIFS
-              if test -n "$func_to_host_pathlist_f" ; then
-                func_to_host_path "$func_to_host_pathlist_f"
-                if test -n "$func_to_host_path_result" ; then
-                  if test -z "$func_to_host_pathlist_result" ; then
-                    func_to_host_pathlist_result="$func_to_host_path_result"
-                  else
-                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
-                  fi
-                fi
-              fi
-              IFS=:
-            done
-            IFS=$func_to_host_pathlist_oldIFS
-            ;;
-        esac
-        if test -z "$func_to_host_pathlist_result" ; then
-          func_error "Could not determine the host path(s) corresponding to"
-          func_error "  '$1'"
-          func_error "Continuing, but uninstalled executables may not work."
-          # Fallback. This may break if $1 contains DOS-style drive
-          # specifications. The fix is not to complicate the expression
-          # below, but for the user to provide a working wine installation
-          # with winepath so that path translation in the cross-to-mingw
-          # case works properly.
-          lt_replace_pathsep_nix_to_dos="s|:|;|g"
-          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
-            $SED -e "$lt_replace_pathsep_nix_to_dos"`
-        fi
-        # Now, add the leading and trailing path separators back
-        case "$1" in
-          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
-            ;;
-        esac
-        case "$1" in
-          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
-            ;;
-        esac
-        ;;
-    esac
-  fi
-}
-# end: func_to_host_pathlist
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
-	cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-
-   The $output program cannot be directly executed until all the libtool
-   libraries that it depends on are installed.
-
-   This wrapper executable should never be moved out of the build directory.
-   If it is, it will not operate correctly.
-
-   Currently, it simply execs the wrapper *script* "$SHELL $output",
-   but could eventually absorb all of the scripts functionality and
-   exec $objdir/$outputname directly.
-*/
-EOF
-	    cat <<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-# define setmode _setmode
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-#  include <io.h>
-#  define HAVE_SETENV
-#  ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-#  endif
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-#ifdef _MSC_VER
-# define S_IXUSR _S_IEXEC
-# define stat _stat
-# ifndef _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-#  define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-#  define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifdef __CYGWIN__
-# define FOPEN_WB "wb"
-#endif
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-#undef LTWRAPPER_DEBUGPRINTF
-#if defined DEBUGWRAPPER
-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
-static void
-ltwrapper_debugprintf (const char *fmt, ...)
-{
-    va_list args;
-    va_start (args, fmt);
-    (void) vfprintf (stderr, fmt, args);
-    va_end (args);
-}
-#else
-# define LTWRAPPER_DEBUGPRINTF(args)
-#endif
-
-const char *program_name = NULL;
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_fatal (const char *message, ...);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_opt_process_env_set (const char *arg);
-void lt_opt_process_env_prepend (const char *arg);
-void lt_opt_process_env_append (const char *arg);
-int lt_split_name_value (const char *arg, char** name, char** value);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-
-static const char *script_text_part1 =
-EOF
-
-	    func_emit_wrapper_part1 yes |
-	        $SED -e 's/\([\\"]\)/\\\1/g' \
-	             -e 's/^/  "/' -e 's/$/\\n"/'
-	    echo ";"
-	    cat <<EOF
-
-static const char *script_text_part2 =
-EOF
-	    func_emit_wrapper_part2 yes |
-	        $SED -e 's/\([\\"]\)/\\\1/g' \
-	             -e 's/^/  "/' -e 's/$/\\n"/'
-	    echo ";"
-
-	    cat <<EOF
-const char * MAGIC_EXE = "$magic_exe";
-const char * LIB_PATH_VARNAME = "$shlibpath_var";
-EOF
-
-	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-              func_to_host_pathlist "$temp_rpath"
-	      cat <<EOF
-const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * LIB_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test -n "$dllsearchpath"; then
-              func_to_host_pathlist "$dllsearchpath:"
-	      cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
-EOF
-	    else
-	      cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE   = "";
-EOF
-	    fi
-
-	    if test "$fast_install" = yes; then
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
-	    else
-	      cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
-	    fi
-
-
-	    cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX         "--lt-"
-#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
-
-static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-
-static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
-
-static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
-static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
-  /* argument is putenv-style "foo=bar", value of foo is set to bar */
-
-static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
-static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
-  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
-
-static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
-static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
-  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
-
-int
-main (int argc, char *argv[])
-{
-  char **newargz;
-  int  newargc;
-  char *tmp_pathspec;
-  char *actual_cwrapper_path;
-  char *actual_cwrapper_name;
-  char *target_name;
-  char *lt_argv_zero;
-  intptr_t rval = 127;
-
-  int i;
-
-  program_name = (char *) xstrdup (base_name (argv[0]));
-  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
-  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
-
-  /* very simple arg parsing; don't want to rely on getopt */
-  for (i = 1; i < argc; i++)
-    {
-      if (strcmp (argv[i], dumpscript_opt) == 0)
-	{
-EOF
-	    case "$host" in
-	      *mingw* | *cygwin* )
-		# make stdout use "unix" line endings
-		echo "          setmode(1,_O_BINARY);"
-		;;
-	      esac
-
-	    cat <<"EOF"
-	  printf ("%s", script_text_part1);
-	  printf ("%s", script_text_part2);
-	  return 0;
-	}
-    }
-
-  newargz = XMALLOC (char *, argc + 1);
-  tmp_pathspec = find_executable (argv[0]);
-  if (tmp_pathspec == NULL)
-    lt_fatal ("Couldn't find %s", argv[0]);
-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
-			  tmp_pathspec));
-
-  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
-			  actual_cwrapper_path));
-  XFREE (tmp_pathspec);
-
-  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
-  strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
-  /* wrapper name transforms */
-  strendzap (actual_cwrapper_name, ".exe");
-  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
-  XFREE (actual_cwrapper_name);
-  actual_cwrapper_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  /* target_name transforms -- use actual target program name; might have lt- prefix */
-  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
-  strendzap (target_name, ".exe");
-  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
-  XFREE (target_name);
-  target_name = tmp_pathspec;
-  tmp_pathspec = 0;
-
-  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
-			  target_name));
-EOF
-
-	    cat <<EOF
-  newargz[0] =
-    XMALLOC (char, (strlen (actual_cwrapper_path) +
-		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
-  strcpy (newargz[0], actual_cwrapper_path);
-  strcat (newargz[0], "$objdir");
-  strcat (newargz[0], "/");
-EOF
-
-	    cat <<"EOF"
-  /* stop here, and copy so we don't have to do this twice */
-  tmp_pathspec = xstrdup (newargz[0]);
-
-  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
-  strcat (newargz[0], actual_cwrapper_name);
-
-  /* DO want the lt- prefix here if it exists, so use target_name */
-  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
-  XFREE (tmp_pathspec);
-  tmp_pathspec = NULL;
-EOF
-
-	    case $host_os in
-	      mingw*)
-	    cat <<"EOF"
-  {
-    char* p;
-    while ((p = strchr (newargz[0], '\\')) != NULL)
-      {
-	*p = '/';
-      }
-    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
-      {
-	*p = '/';
-      }
-  }
-EOF
-	    ;;
-	    esac
-
-	    cat <<"EOF"
-  XFREE (target_name);
-  XFREE (actual_cwrapper_path);
-  XFREE (actual_cwrapper_name);
-
-  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
-  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
-  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
-
-  newargc=0;
-  for (i = 1; i < argc; i++)
-    {
-      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
-        {
-          if (argv[i][env_set_opt_len] == '=')
-            {
-              const char *p = argv[i] + env_set_opt_len + 1;
-              lt_opt_process_env_set (p);
-            }
-          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
-            {
-              lt_opt_process_env_set (argv[++i]); /* don't copy */
-            }
-          else
-            lt_fatal ("%s missing required argument", env_set_opt);
-          continue;
-        }
-      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
-        {
-          if (argv[i][env_prepend_opt_len] == '=')
-            {
-              const char *p = argv[i] + env_prepend_opt_len + 1;
-              lt_opt_process_env_prepend (p);
-            }
-          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
-            {
-              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
-            }
-          else
-            lt_fatal ("%s missing required argument", env_prepend_opt);
-          continue;
-        }
-      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
-        {
-          if (argv[i][env_append_opt_len] == '=')
-            {
-              const char *p = argv[i] + env_append_opt_len + 1;
-              lt_opt_process_env_append (p);
-            }
-          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
-            {
-              lt_opt_process_env_append (argv[++i]); /* don't copy */
-            }
-          else
-            lt_fatal ("%s missing required argument", env_append_opt);
-          continue;
-        }
-      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
-        {
-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-             namespace, but it is not one of the ones we know about and
-             have already dealt with, above (inluding dump-script), then
-             report an error. Otherwise, targets might begin to believe
-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-             namespace. The first time any user complains about this, we'll
-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-             or a configure.ac-settable value.
-           */
-          lt_fatal ("Unrecognized option in %s namespace: '%s'",
-                    ltwrapper_option_prefix, argv[i]);
-        }
-      /* otherwise ... */
-      newargz[++newargc] = xstrdup (argv[i]);
-    }
-  newargz[++newargc] = NULL;
-
-  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
-  for (i = 0; i < newargc; i++)
-    {
-      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
-    }
-
-EOF
-
-	    case $host_os in
-	      mingw*)
-		cat <<"EOF"
-  /* execv doesn't actually work on mingw as expected on unix */
-  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
-  if (rval == -1)
-    {
-      /* failed to start process */
-      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
-      return 127;
-    }
-  return rval;
-EOF
-		;;
-	      *)
-		cat <<"EOF"
-  execv (lt_argv_zero, newargz);
-  return rval; /* =127, but avoids unused variable warning */
-EOF
-		;;
-	    esac
-
-	    cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
-  void *p = (void *) malloc (num);
-  if (!p)
-    lt_fatal ("Memory exhausted");
-
-  return p;
-}
-
-char *
-xstrdup (const char *string)
-{
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
-			  string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
-  const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
-    name += 2;
-#endif
-
-  for (base = name; *name; name++)
-    if (IS_DIR_SEPARATOR (*name))
-      base = name + 1;
-  return base;
-}
-
-int
-check_executable (const char *path)
-{
-  struct stat st;
-
-  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
-  if ((!path) || (!*path))
-    return 0;
-
-  if ((stat (path, &st) >= 0)
-      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
-    return 1;
-  else
-    return 0;
-}
-
-int
-make_executable (const char *path)
-{
-  int rval = 0;
-  struct stat st;
-
-  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
-  if ((!path) || (!*path))
-    return 0;
-
-  if (stat (path, &st) >= 0)
-    {
-      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
-    }
-  return rval;
-}
-
-/* Searches for the full path of the wrapper.  Returns
-   newly allocated full path name if found, NULL otherwise
-   Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
-  int has_slash = 0;
-  const char *p;
-  const char *p_next;
-  /* static buffer for getcwd */
-  char tmp[LT_PATHMAX + 1];
-  int tmp_len;
-  char *concat_name;
-
-  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
-			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
-
-  if ((wrapper == NULL) || (*wrapper == '\0'))
-    return NULL;
-
-  /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
-    {
-      concat_name = xstrdup (wrapper);
-      if (check_executable (concat_name))
-	return concat_name;
-      XFREE (concat_name);
-    }
-  else
-    {
-#endif
-      if (IS_DIR_SEPARATOR (wrapper[0]))
-	{
-	  concat_name = xstrdup (wrapper);
-	  if (check_executable (concat_name))
-	    return concat_name;
-	  XFREE (concat_name);
-	}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-    }
-#endif
-
-  for (p = wrapper; *p; p++)
-    if (*p == '/')
-      {
-	has_slash = 1;
-	break;
-      }
-  if (!has_slash)
-    {
-      /* no slashes; search PATH */
-      const char *path = getenv ("PATH");
-      if (path != NULL)
-	{
-	  for (p = path; *p; p = p_next)
-	    {
-	      const char *q;
-	      size_t p_len;
-	      for (q = p; *q; q++)
-		if (IS_PATH_SEPARATOR (*q))
-		  break;
-	      p_len = q - p;
-	      p_next = (*q == '\0' ? q : q + 1);
-	      if (p_len == 0)
-		{
-		  /* empty path: current directory */
-		  if (getcwd (tmp, LT_PATHMAX) == NULL)
-		    lt_fatal ("getcwd failed");
-		  tmp_len = strlen (tmp);
-		  concat_name =
-		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, tmp, tmp_len);
-		  concat_name[tmp_len] = '/';
-		  strcpy (concat_name + tmp_len + 1, wrapper);
-		}
-	      else
-		{
-		  concat_name =
-		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
-		  memcpy (concat_name, p, p_len);
-		  concat_name[p_len] = '/';
-		  strcpy (concat_name + p_len + 1, wrapper);
-		}
-	      if (check_executable (concat_name))
-		return concat_name;
-	      XFREE (concat_name);
-	    }
-	}
-      /* not found in PATH; assume curdir */
-    }
-  /* Relative path | not found in path: prepend cwd */
-  if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal ("getcwd failed");
-  tmp_len = strlen (tmp);
-  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
-  memcpy (concat_name, tmp, tmp_len);
-  concat_name[tmp_len] = '/';
-  strcpy (concat_name + tmp_len + 1, wrapper);
-
-  if (check_executable (concat_name))
-    return concat_name;
-  XFREE (concat_name);
-  return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
-  return xstrdup (pathspec);
-#else
-  char buf[LT_PATHMAX];
-  struct stat s;
-  char *tmp_pathspec = xstrdup (pathspec);
-  char *p;
-  int has_symlinks = 0;
-  while (strlen (tmp_pathspec) && !has_symlinks)
-    {
-      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
-			      tmp_pathspec));
-      if (lstat (tmp_pathspec, &s) == 0)
-	{
-	  if (S_ISLNK (s.st_mode) != 0)
-	    {
-	      has_symlinks = 1;
-	      break;
-	    }
-
-	  /* search backwards for last DIR_SEPARATOR */
-	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
-	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    p--;
-	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
-	    {
-	      /* no more DIR_SEPARATORS left */
-	      break;
-	    }
-	  *p = '\0';
-	}
-      else
-	{
-	  char *errstr = strerror (errno);
-	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
-	}
-    }
-  XFREE (tmp_pathspec);
-
-  if (!has_symlinks)
-    {
-      return xstrdup (pathspec);
-    }
-
-  tmp_pathspec = realpath (pathspec, buf);
-  if (tmp_pathspec == 0)
-    {
-      lt_fatal ("Could not follow symlinks for %s", pathspec);
-    }
-  return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
-  size_t len, patlen;
-
-  assert (str != NULL);
-  assert (pat != NULL);
-
-  len = strlen (str);
-  patlen = strlen (pat);
-
-  if (patlen <= len)
-    {
-      str += len - patlen;
-      if (strcmp (str, pat) == 0)
-	*str = '\0';
-    }
-  return str;
-}
-
-static void
-lt_error_core (int exit_status, const char *mode,
-	       const char *message, va_list ap)
-{
-  fprintf (stderr, "%s: %s: ", program_name, mode);
-  vfprintf (stderr, message, ap);
-  fprintf (stderr, ".\n");
-
-  if (exit_status >= 0)
-    exit (exit_status);
-}
-
-void
-lt_fatal (const char *message, ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
-  va_end (ap);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
-  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
-  {
-#ifdef HAVE_SETENV
-    /* always make a copy, for consistency with !HAVE_SETENV */
-    char *str = xstrdup (value);
-    setenv (name, str, 1);
-#else
-    int len = strlen (name) + 1 + strlen (value) + 1;
-    char *str = XMALLOC (char, len);
-    sprintf (str, "%s=%s", name, value);
-    if (putenv (str) != EXIT_SUCCESS)
-      {
-        XFREE (str);
-      }
-#endif
-  }
-}
-
-char *
-lt_extend_str (const char *orig_value, const char *add, int to_end)
-{
-  char *new_value;
-  if (orig_value && *orig_value)
-    {
-      int orig_value_len = strlen (orig_value);
-      int add_len = strlen (add);
-      new_value = XMALLOC (char, add_len + orig_value_len + 1);
-      if (to_end)
-        {
-          strcpy (new_value, orig_value);
-          strcpy (new_value + orig_value_len, add);
-        }
-      else
-        {
-          strcpy (new_value, add);
-          strcpy (new_value + add_len, orig_value);
-        }
-    }
-  else
-    {
-      new_value = xstrdup (add);
-    }
-  return new_value;
-}
-
-int
-lt_split_name_value (const char *arg, char** name, char** value)
-{
-  const char *p;
-  int len;
-  if (!arg || !*arg)
-    return 1;
-
-  p = strchr (arg, (int)'=');
-
-  if (!p)
-    return 1;
-
-  *value = xstrdup (++p);
-
-  len = strlen (arg) - strlen (*value);
-  *name = XMALLOC (char, len);
-  strncpy (*name, arg, len-1);
-  (*name)[len - 1] = '\0';
-
-  return 0;
-}
-
-void
-lt_opt_process_env_set (const char *arg)
-{
-  char *name = NULL;
-  char *value = NULL;
-
-  if (lt_split_name_value (arg, &name, &value) != 0)
-    {
-      XFREE (name);
-      XFREE (value);
-      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
-    }
-
-  lt_setenv (name, value);
-  XFREE (name);
-  XFREE (value);
-}
-
-void
-lt_opt_process_env_prepend (const char *arg)
-{
-  char *name = NULL;
-  char *value = NULL;
-  char *new_value = NULL;
-
-  if (lt_split_name_value (arg, &name, &value) != 0)
-    {
-      XFREE (name);
-      XFREE (value);
-      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
-    }
-
-  new_value = lt_extend_str (getenv (name), value, 0);
-  lt_setenv (name, new_value);
-  XFREE (new_value);
-  XFREE (name);
-  XFREE (value);
-}
-
-void
-lt_opt_process_env_append (const char *arg)
-{
-  char *name = NULL;
-  char *value = NULL;
-  char *new_value = NULL;
-
-  if (lt_split_name_value (arg, &name, &value) != 0)
-    {
-      XFREE (name);
-      XFREE (value);
-      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
-    }
-
-  new_value = lt_extend_str (getenv (name), value, 1);
-  lt_setenv (name, new_value);
-  XFREE (new_value);
-  XFREE (name);
-  XFREE (value);
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
-  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      /* some systems can't cope with a ':'-terminated path #' */
-      int len = strlen (new_value);
-      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
-        {
-          new_value[len-1] = '\0';
-        }
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
-  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
-
-  if (name && *name && value && *value)
-    {
-      char *new_value = lt_extend_str (getenv (name), value, 0);
-      lt_setenv (name, new_value);
-      XFREE (new_value);
-    }
-}
-
-
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_mode_link arg...
-func_mode_link ()
-{
-    $opt_debug
-    case $host in
-    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-      # It is impossible to link a dll without this setting, and
-      # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
-      # flag for every libtool invocation.
-      # allow_undefined=no
-
-      # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
-      # even a static library is built.  For now, we need to specify
-      # -no-undefined on the libtool link line when we can be certain
-      # that all symbols are satisfied, otherwise we get a static library.
-      allow_undefined=yes
-      ;;
-    *)
-      allow_undefined=yes
-      ;;
-    esac
-    libtool_args=$nonopt
-    base_compile="$nonopt $@"
-    compile_command=$nonopt
-    finalize_command=$nonopt
-
-    compile_rpath=
-    finalize_rpath=
-    compile_shlibpath=
-    finalize_shlibpath=
-    convenience=
-    old_convenience=
-    deplibs=
-    old_deplibs=
-    compiler_flags=
-    linker_flags=
-    dllsearchpath=
-    lib_search_path=`pwd`
-    inst_prefix_dir=
-    new_inherited_linker_flags=
-
-    avoid_version=no
-    dlfiles=
-    dlprefiles=
-    dlself=no
-    export_dynamic=no
-    export_symbols=
-    export_symbols_regex=
-    generated=
-    libobjs=
-    ltlibs=
-    module=no
-    no_install=no
-    objs=
-    non_pic_objects=
-    precious_files_regex=
-    prefer_static_libs=no
-    preload=no
-    prev=
-    prevarg=
-    release=
-    rpath=
-    xrpath=
-    perm_rpath=
-    temp_rpath=
-    thread_safe=no
-    vinfo=
-    vinfo_number=no
-    weak_libs=
-    single_module="${wl}-single_module"
-    func_infer_tag $base_compile
-
-    # We need to know -static, to get the right output filenames.
-    for arg
-    do
-      case $arg in
-      -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
-	build_old_libs=no
-	break
-	;;
-      -all-static | -static | -static-libtool-libs)
-	case $arg in
-	-all-static)
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
-	    func_warning "complete static linking is impossible in this configuration"
-	  fi
-	  if test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	-static)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=built
-	  ;;
-	-static-libtool-libs)
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	  prefer_static_libs=yes
-	  ;;
-	esac
-	build_libtool_libs=no
-	build_old_libs=yes
-	break
-	;;
-      esac
-    done
-
-    # See if our shared archives depend on static archives.
-    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
-    # Go through the arguments, transforming them on the way.
-    while test "$#" -gt 0; do
-      arg="$1"
-      shift
-      func_quote_for_eval "$arg"
-      qarg=$func_quote_for_eval_unquoted_result
-      func_append libtool_args " $func_quote_for_eval_result"
-
-      # If the previous option needs an argument, assign it.
-      if test -n "$prev"; then
-	case $prev in
-	output)
-	  func_append compile_command " @OUTPUT@"
-	  func_append finalize_command " @OUTPUT@"
-	  ;;
-	esac
-
-	case $prev in
-	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
-	    # Add the symbol object into the linking commands.
-	    func_append compile_command " @SYMFILE@"
-	    func_append finalize_command " @SYMFILE@"
-	    preload=yes
-	  fi
-	  case $arg in
-	  *.la | *.lo) ;;  # We handle these cases below.
-	  force)
-	    if test "$dlself" = no; then
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  self)
-	    if test "$prev" = dlprefiles; then
-	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
-	      dlself=yes
-	    else
-	      dlself=needless
-	      export_dynamic=yes
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  *)
-	    if test "$prev" = dlfiles; then
-	      dlfiles="$dlfiles $arg"
-	    else
-	      dlprefiles="$dlprefiles $arg"
-	    fi
-	    prev=
-	    continue
-	    ;;
-	  esac
-	  ;;
-	expsyms)
-	  export_symbols="$arg"
-	  test -f "$arg" \
-	    || func_fatal_error "symbol file \`$arg' does not exist"
-	  prev=
-	  continue
-	  ;;
-	expsyms_regex)
-	  export_symbols_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	framework)
-	  case $host in
-	    *-*-darwin*)
-	      case "$deplibs " in
-		*" $qarg.ltframework "*) ;;
-		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
-		   ;;
-	      esac
-	      ;;
-	  esac
-	  prev=
-	  continue
-	  ;;
-	inst_prefix)
-	  inst_prefix_dir="$arg"
-	  prev=
-	  continue
-	  ;;
-	objectlist)
-	  if test -f "$arg"; then
-	    save_arg=$arg
-	    moreargs=
-	    for fil in `cat "$save_arg"`
-	    do
-#	      moreargs="$moreargs $fil"
-	      arg=$fil
-	      # A libtool-controlled object.
-
-	      # Check to see that this really is a libtool object.
-	      if func_lalib_unsafe_p "$arg"; then
-		pic_object=
-		non_pic_object=
-
-		# Read the .lo file
-		func_source "$arg"
-
-		if test -z "$pic_object" ||
-		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none &&
-		   test "$non_pic_object" = none; then
-		  func_fatal_error "cannot find name of object for \`$arg'"
-		fi
-
-		# Extract subdirectory from the argument.
-		func_dirname "$arg" "/" ""
-		xdir="$func_dirname_result"
-
-		if test "$pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
-
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		      dlfiles="$dlfiles $pic_object"
-		      prev=
-		      continue
-		    else
-		      # If libtool objects are unsupported, then we need to preload.
-		      prev=dlprefiles
-		    fi
-		  fi
-
-		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
-		    # Preload the old-style object.
-		    dlprefiles="$dlprefiles $pic_object"
-		    prev=
-		  fi
-
-		  # A PIC object.
-		  func_append libobjs " $pic_object"
-		  arg="$pic_object"
-		fi
-
-		# Non-PIC object.
-		if test "$non_pic_object" != none; then
-		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
-
-		  # A standard non-PIC object
-		  func_append non_pic_objects " $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
-		  fi
-		else
-		  # If the PIC object exists, use it instead.
-		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
-		  func_append non_pic_objects " $non_pic_object"
-		fi
-	      else
-		# Only an error if not doing a dry-run.
-		if $opt_dry_run; then
-		  # Extract subdirectory from the argument.
-		  func_dirname "$arg" "/" ""
-		  xdir="$func_dirname_result"
-
-		  func_lo2o "$arg"
-		  pic_object=$xdir$objdir/$func_lo2o_result
-		  non_pic_object=$xdir$func_lo2o_result
-		  func_append libobjs " $pic_object"
-		  func_append non_pic_objects " $non_pic_object"
-	        else
-		  func_fatal_error "\`$arg' is not a valid libtool object"
-		fi
-	      fi
-	    done
-	  else
-	    func_fatal_error "link input file \`$arg' does not exist"
-	  fi
-	  arg=$save_arg
-	  prev=
-	  continue
-	  ;;
-	precious_regex)
-	  precious_files_regex="$arg"
-	  prev=
-	  continue
-	  ;;
-	release)
-	  release="-$arg"
-	  prev=
-	  continue
-	  ;;
-	rpath | xrpath)
-	  # We need an absolute path.
-	  case $arg in
-	  [\\/]* | [A-Za-z]:[\\/]*) ;;
-	  *)
-	    func_fatal_error "only absolute run-paths are allowed"
-	    ;;
-	  esac
-	  if test "$prev" = rpath; then
-	    case "$rpath " in
-	    *" $arg "*) ;;
-	    *) rpath="$rpath $arg" ;;
-	    esac
-	  else
-	    case "$xrpath " in
-	    *" $arg "*) ;;
-	    *) xrpath="$xrpath $arg" ;;
-	    esac
-	  fi
-	  prev=
-	  continue
-	  ;;
-	shrext)
-	  shrext_cmds="$arg"
-	  prev=
-	  continue
-	  ;;
-	weak)
-	  weak_libs="$weak_libs $arg"
-	  prev=
-	  continue
-	  ;;
-	xcclinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $qarg"
-	  prev=
-	  func_append compile_command " $qarg"
-	  func_append finalize_command " $qarg"
-	  continue
-	  ;;
-	xcompiler)
-	  compiler_flags="$compiler_flags $qarg"
-	  prev=
-	  func_append compile_command " $qarg"
-	  func_append finalize_command " $qarg"
-	  continue
-	  ;;
-	xlinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $wl$qarg"
-	  prev=
-	  func_append compile_command " $wl$qarg"
-	  func_append finalize_command " $wl$qarg"
-	  continue
-	  ;;
-	*)
-	  eval "$prev=\"\$arg\""
-	  prev=
-	  continue
-	  ;;
-	esac
-      fi # test -n "$prev"
-
-      prevarg="$arg"
-
-      case $arg in
-      -all-static)
-	if test -n "$link_static_flag"; then
-	  # See comment for -static flag below, for more details.
-	  func_append compile_command " $link_static_flag"
-	  func_append finalize_command " $link_static_flag"
-	fi
-	continue
-	;;
-
-      -allow-undefined)
-	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
-	;;
-
-      -avoid-version)
-	avoid_version=yes
-	continue
-	;;
-
-      -dlopen)
-	prev=dlfiles
-	continue
-	;;
-
-      -dlpreopen)
-	prev=dlprefiles
-	continue
-	;;
-
-      -export-dynamic)
-	export_dynamic=yes
-	continue
-	;;
-
-      -export-symbols | -export-symbols-regex)
-	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	  func_fatal_error "more than one -exported-symbols argument is not allowed"
-	fi
-	if test "X$arg" = "X-export-symbols"; then
-	  prev=expsyms
-	else
-	  prev=expsyms_regex
-	fi
-	continue
-	;;
-
-      -framework)
-	prev=framework
-	continue
-	;;
-
-      -inst-prefix-dir)
-	prev=inst_prefix
-	continue
-	;;
-
-      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
-      # so, if we see these flags be careful not to treat them like -L
-      -L[A-Z][A-Z]*:*)
-	case $with_gcc/$host in
-	no/*-*-irix* | /*-*-irix*)
-	  func_append compile_command " $arg"
-	  func_append finalize_command " $arg"
-	  ;;
-	esac
-	continue
-	;;
-
-      -L*)
-	func_stripname '-L' '' "$arg"
-	dir=$func_stripname_result
-	if test -z "$dir"; then
-	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between \`-L' and \`$1'"
-	  else
-	    func_fatal_error "need path for \`-L' option"
-	  fi
-	fi
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  absdir=`cd "$dir" && pwd`
-	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
-	  dir="$absdir"
-	  ;;
-	esac
-	case "$deplibs " in
-	*" -L$dir "*) ;;
-	*)
-	  deplibs="$deplibs -L$dir"
-	  lib_search_path="$lib_search_path $dir"
-	  ;;
-	esac
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$dir:"*) ;;
-	  ::) dllsearchpath=$dir;;
-	  *) dllsearchpath="$dllsearchpath:$dir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
-	  esac
-	  ;;
-	esac
-	continue
-	;;
-
-      -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
-	    # These systems don't actually have a C or math library (as such)
-	    continue
-	    ;;
-	  *-*-os2*)
-	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C and math libraries are in the System framework
-	    deplibs="$deplibs System.ltframework"
-	    continue
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
-	    ;;
-	  esac
-	elif test "X$arg" = "X-lc_r"; then
-	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	   # Do not include libc_r directly, use -pthread flag.
-	   continue
-	   ;;
-	 esac
-	fi
-	deplibs="$deplibs $arg"
-	continue
-	;;
-
-      -module)
-	module=yes
-	continue
-	;;
-
-      # Tru64 UNIX uses -model [arg] to determine the layout of C++
-      # classes, name mangling, and exception handling.
-      # Darwin uses the -arch flag to determine output architecture.
-      -model|-arch|-isysroot)
-	compiler_flags="$compiler_flags $arg"
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-	prev=xcompiler
-	continue
-	;;
-
-      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
-	compiler_flags="$compiler_flags $arg"
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-	case "$new_inherited_linker_flags " in
-	    *" $arg "*) ;;
-	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
-	esac
-	continue
-	;;
-
-      -multi_module)
-	single_module="${wl}-multi_module"
-	continue
-	;;
-
-      -no-fast-install)
-	fast_install=no
-	continue
-	;;
-
-      -no-install)
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
-	  # The PATH hackery in wrapper scripts is required on Windows
-	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "\`-no-install' is ignored for $host"
-	  func_warning "assuming \`-no-fast-install' instead"
-	  fast_install=no
-	  ;;
-	*) no_install=yes ;;
-	esac
-	continue
-	;;
-
-      -no-undefined)
-	allow_undefined=no
-	continue
-	;;
-
-      -objectlist)
-	prev=objectlist
-	continue
-	;;
-
-      -o) prev=output ;;
-
-      -precious-files-regex)
-	prev=precious_regex
-	continue
-	;;
-
-      -release)
-	prev=release
-	continue
-	;;
-
-      -rpath)
-	prev=rpath
-	continue
-	;;
-
-      -R)
-	prev=xrpath
-	continue
-	;;
-
-      -R*)
-	func_stripname '-R' '' "$arg"
-	dir=$func_stripname_result
-	# We need an absolute path.
-	case $dir in
-	[\\/]* | [A-Za-z]:[\\/]*) ;;
-	*)
-	  func_fatal_error "only absolute run-paths are allowed"
-	  ;;
-	esac
-	case "$xrpath " in
-	*" $dir "*) ;;
-	*) xrpath="$xrpath $dir" ;;
-	esac
-	continue
-	;;
-
-      -shared)
-	# The effects of -shared are defined in a previous loop.
-	continue
-	;;
-
-      -shrext)
-	prev=shrext
-	continue
-	;;
-
-      -static | -static-libtool-libs)
-	# The effects of -static are defined in a previous loop.
-	# We used to do the same as -all-static on platforms that
-	# didn't have a PIC flag, but the assumption that the effects
-	# would be equivalent was wrong.  It would break on at least
-	# Digital Unix and AIX.
-	continue
-	;;
-
-      -thread-safe)
-	thread_safe=yes
-	continue
-	;;
-
-      -version-info)
-	prev=vinfo
-	continue
-	;;
-
-      -version-number)
-	prev=vinfo
-	vinfo_number=yes
-	continue
-	;;
-
-      -weak)
-        prev=weak
-	continue
-	;;
-
-      -Wc,*)
-	func_stripname '-Wc,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  IFS="$save_ifs"
-          func_quote_for_eval "$flag"
-	  arg="$arg $wl$func_quote_for_eval_result"
-	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
-	done
-	IFS="$save_ifs"
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Wl,*)
-	func_stripname '-Wl,' '' "$arg"
-	args=$func_stripname_result
-	arg=
-	save_ifs="$IFS"; IFS=','
-	for flag in $args; do
-	  IFS="$save_ifs"
-          func_quote_for_eval "$flag"
-	  arg="$arg $wl$func_quote_for_eval_result"
-	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
-	  linker_flags="$linker_flags $func_quote_for_eval_result"
-	done
-	IFS="$save_ifs"
-	func_stripname ' ' '' "$arg"
-	arg=$func_stripname_result
-	;;
-
-      -Xcompiler)
-	prev=xcompiler
-	continue
-	;;
-
-      -Xlinker)
-	prev=xlinker
-	continue
-	;;
-
-      -XCClinker)
-	prev=xcclinker
-	continue
-	;;
-
-      # -msg_* for osf cc
-      -msg_*)
-	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-
-      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
-      # -r[0-9][0-9]* specifies the processor on the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
-      # +DA*, +DD* enable 64-bit mode on the HP compiler
-      # -q* pass through compiler args for the IBM compiler
-      # -m*, -t[45]*, -txscale* pass through architecture-specific
-      # compiler args for GCC
-      # -F/path gives path to uninstalled frameworks, gcc on darwin
-      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
-      # @file GCC response files
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
-        func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-        func_append compile_command " $arg"
-        func_append finalize_command " $arg"
-        compiler_flags="$compiler_flags $arg"
-        continue
-        ;;
-
-      # Some other compiler flag.
-      -* | +*)
-        func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-
-      *.$objext)
-	# A standard object.
-	objs="$objs $arg"
-	;;
-
-      *.lo)
-	# A libtool-controlled object.
-
-	# Check to see that this really is a libtool object.
-	if func_lalib_unsafe_p "$arg"; then
-	  pic_object=
-	  non_pic_object=
-
-	  # Read the .lo file
-	  func_source "$arg"
-
-	  if test -z "$pic_object" ||
-	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none &&
-	     test "$non_pic_object" = none; then
-	    func_fatal_error "cannot find name of object for \`$arg'"
-	  fi
-
-	  # Extract subdirectory from the argument.
-	  func_dirname "$arg" "/" ""
-	  xdir="$func_dirname_result"
-
-	  if test "$pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
-
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
-		dlfiles="$dlfiles $pic_object"
-		prev=
-		continue
-	      else
-		# If libtool objects are unsupported, then we need to preload.
-		prev=dlprefiles
-	      fi
-	    fi
-
-	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
-	      # Preload the old-style object.
-	      dlprefiles="$dlprefiles $pic_object"
-	      prev=
-	    fi
-
-	    # A PIC object.
-	    func_append libobjs " $pic_object"
-	    arg="$pic_object"
-	  fi
-
-	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
-	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
-
-	    # A standard non-PIC object
-	    func_append non_pic_objects " $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
-	    fi
-	  else
-	    # If the PIC object exists, use it instead.
-	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
-	    func_append non_pic_objects " $non_pic_object"
-	  fi
-	else
-	  # Only an error if not doing a dry-run.
-	  if $opt_dry_run; then
-	    # Extract subdirectory from the argument.
-	    func_dirname "$arg" "/" ""
-	    xdir="$func_dirname_result"
-
-	    func_lo2o "$arg"
-	    pic_object=$xdir$objdir/$func_lo2o_result
-	    non_pic_object=$xdir$func_lo2o_result
-	    func_append libobjs " $pic_object"
-	    func_append non_pic_objects " $non_pic_object"
-	  else
-	    func_fatal_error "\`$arg' is not a valid libtool object"
-	  fi
-	fi
-	;;
-
-      *.$libext)
-	# An archive.
-	deplibs="$deplibs $arg"
-	old_deplibs="$old_deplibs $arg"
-	continue
-	;;
-
-      *.la)
-	# A libtool-controlled library.
-
-	if test "$prev" = dlfiles; then
-	  # This library was specified with -dlopen.
-	  dlfiles="$dlfiles $arg"
-	  prev=
-	elif test "$prev" = dlprefiles; then
-	  # The library was specified with -dlpreopen.
-	  dlprefiles="$dlprefiles $arg"
-	  prev=
-	else
-	  deplibs="$deplibs $arg"
-	fi
-	continue
-	;;
-
-      # Some other compiler argument.
-      *)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
-	;;
-      esac # arg
-
-      # Now actually substitute the argument into the commands.
-      if test -n "$arg"; then
-	func_append compile_command " $arg"
-	func_append finalize_command " $arg"
-      fi
-    done # argument parsing loop
-
-    test -n "$prev" && \
-      func_fatal_help "the \`$prevarg' option requires an argument"
-
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
-      eval arg=\"$export_dynamic_flag_spec\"
-      func_append compile_command " $arg"
-      func_append finalize_command " $arg"
-    fi
-
-    oldlibs=
-    # calculate the name of the file, without its directory
-    func_basename "$output"
-    outputname="$func_basename_result"
-    libobjs_save="$libobjs"
-
-    if test -n "$shlibpath_var"; then
-      # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
-    else
-      shlib_search_path=
-    fi
-    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
-    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
-    func_dirname "$output" "/" ""
-    output_objdir="$func_dirname_result$objdir"
-    # Create the object directory.
-    func_mkdir_p "$output_objdir"
-
-    # Determine the type of output
-    case $output in
-    "")
-      func_fatal_help "you must specify an output file"
-      ;;
-    *.$libext) linkmode=oldlib ;;
-    *.lo | *.$objext) linkmode=obj ;;
-    *.la) linkmode=lib ;;
-    *) linkmode=prog ;; # Anything else should be a program.
-    esac
-
-    specialdeplibs=
-
-    libs=
-    # Find all interdependent deplibs by searching for libraries
-    # that are linked more than once (e.g. -la -lb -la)
-    for deplib in $deplibs; do
-      if $opt_duplicate_deps ; then
-	case "$libs " in
-	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	esac
-      fi
-      libs="$libs $deplib"
-    done
-
-    if test "$linkmode" = lib; then
-      libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
-      # Compute libraries that are listed more than once in $predeps
-      # $postdeps and mark them as special (i.e., whose duplicates are
-      # not to be eliminated).
-      pre_post_deps=
-      if $opt_duplicate_compiler_generated_deps; then
-	for pre_post_dep in $predeps $postdeps; do
-	  case "$pre_post_deps " in
-	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
-	  esac
-	  pre_post_deps="$pre_post_deps $pre_post_dep"
-	done
-      fi
-      pre_post_deps=
-    fi
-
-    deplibs=
-    newdependency_libs=
-    newlib_search_path=
-    need_relink=no # whether we're linking any uninstalled libtool libraries
-    notinst_deplibs= # not-installed libtool libraries
-    notinst_path= # paths that contain not-installed libtool libraries
-
-    case $linkmode in
-    lib)
-	passes="conv dlpreopen link"
-	for file in $dlfiles $dlprefiles; do
-	  case $file in
-	  *.la) ;;
-	  *)
-	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
-	    ;;
-	  esac
-	done
-	;;
-    prog)
-	compile_deplibs=
-	finalize_deplibs=
-	alldeplibs=no
-	newdlfiles=
-	newdlprefiles=
-	passes="conv scan dlopen dlpreopen link"
-	;;
-    *)  passes="conv"
-	;;
-    esac
-
-    for pass in $passes; do
-      # The preopen pass in lib mode reverses $deplibs; put it back here
-      # so that -L comes before libs that need it for instance...
-      if test "$linkmode,$pass" = "lib,link"; then
-	## FIXME: Find the place where the list is rebuilt in the wrong
-	##        order, and fix it there properly
-        tmp_deplibs=
-	for deplib in $deplibs; do
-	  tmp_deplibs="$deplib $tmp_deplibs"
-	done
-	deplibs="$tmp_deplibs"
-      fi
-
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
-	deplibs=
-      fi
-      if test "$linkmode" = prog; then
-	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
-	link)
-	  libs="$deplibs %DEPLIBS%"
-	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
-	  ;;
-	esac
-      fi
-      if test "$linkmode,$pass" = "lib,dlpreopen"; then
-	# Collect and forward deplibs of preopened libtool libs
-	for lib in $dlprefiles; do
-	  # Ignore non-libtool-libs
-	  dependency_libs=
-	  case $lib in
-	  *.la)	func_source "$lib" ;;
-	  esac
-
-	  # Collect preopened libtool deplibs, except any this library
-	  # has declared as weak libs
-	  for deplib in $dependency_libs; do
-            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
-	    case " $weak_libs " in
-	    *" $deplib_base "*) ;;
-	    *) deplibs="$deplibs $deplib" ;;
-	    esac
-	  done
-	done
-	libs="$dlprefiles"
-      fi
-      if test "$pass" = dlopen; then
-	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
-	deplibs=
-      fi
-
-      for deplib in $libs; do
-	lib=
-	found=no
-	case $deplib in
-	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
-	  if test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    compiler_flags="$compiler_flags $deplib"
-	    if test "$linkmode" = lib ; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    func_warning "\`-l' is ignored for archives/objects"
-	    continue
-	  fi
-	  func_stripname '-l' '' "$deplib"
-	  name=$func_stripname_result
-	  if test "$linkmode" = lib; then
-	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
-	  else
-	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
-	  fi
-	  for searchdir in $searchdirs; do
-	    for search_ext in .la $std_shrext .so .a; do
-	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
-	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
-		else
-		  found=no
-		fi
-		break 2
-	      fi
-	    done
-	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
-	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
-	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	      case " $predeps $postdeps " in
-	      *" $deplib "*)
-		if func_lalib_p "$lib"; then
-		  library_names=
-		  old_library=
-		  func_source "$lib"
-		  for l in $old_library $library_names; do
-		    ll="$l"
-		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
-		    func_dirname "$lib" "" "."
-		    ladir="$func_dirname_result"
-		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
-		      compile_deplibs="$deplib $compile_deplibs"
-		      finalize_deplibs="$deplib $finalize_deplibs"
-		    else
-		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-		    fi
-		    continue
-		  fi
-		fi
-		;;
-	      *) ;;
-	      esac
-	    fi
-	  fi
-	  ;; # -l
-	*.ltframework)
-	  if test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$deplib $compile_deplibs"
-	    finalize_deplibs="$deplib $finalize_deplibs"
-	  else
-	    deplibs="$deplib $deplibs"
-	    if test "$linkmode" = lib ; then
-		case "$new_inherited_linker_flags " in
-		    *" $deplib "*) ;;
-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
-		esac
-	    fi
-	  fi
-	  continue
-	  ;;
-	-L*)
-	  case $linkmode in
-	  lib)
-	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
-	    newdependency_libs="$deplib $newdependency_libs"
-	    func_stripname '-L' '' "$deplib"
-	    newlib_search_path="$newlib_search_path $func_stripname_result"
-	    ;;
-	  prog)
-	    if test "$pass" = conv; then
-	      deplibs="$deplib $deplibs"
-	      continue
-	    fi
-	    if test "$pass" = scan; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    func_stripname '-L' '' "$deplib"
-	    newlib_search_path="$newlib_search_path $func_stripname_result"
-	    ;;
-	  *)
-	    func_warning "\`-L' is ignored for archives/objects"
-	    ;;
-	  esac # linkmode
-	  continue
-	  ;; # -L
-	-R*)
-	  if test "$pass" = link; then
-	    func_stripname '-R' '' "$deplib"
-	    dir=$func_stripname_result
-	    # Make sure the xrpath contains only unique directories.
-	    case "$xrpath " in
-	    *" $dir "*) ;;
-	    *) xrpath="$xrpath $dir" ;;
-	    esac
-	  fi
-	  deplibs="$deplib $deplibs"
-	  continue
-	  ;;
-	*.la) lib="$deplib" ;;
-	*.$libext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	    continue
-	  fi
-	  case $linkmode in
-	  lib)
-	    # Linking convenience modules into shared libraries is allowed,
-	    # but linking other static libraries is non-portable.
-	    case " $dlpreconveniencelibs " in
-	    *" $deplib "*) ;;
-	    *)
-	      valid_a_lib=no
-	      case $deplibs_check_method in
-		match_pattern*)
-		  set dummy $deplibs_check_method; shift
-		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
-		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=yes
-		  fi
-		;;
-		pass_all)
-		  valid_a_lib=yes
-		;;
-	      esac
-	      if test "$valid_a_lib" != yes; then
-		$ECHO
-		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
-		$ECHO "*** I have the capability to make that library automatically link in when"
-		$ECHO "*** you link to this library.  But I can only do this if you have a"
-		$ECHO "*** shared version of the library, which you do not appear to have"
-		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
-		$ECHO "*** that it is just a static archive that I should not use here."
-	      else
-		$ECHO
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
-	      fi
-	      ;;
-	    esac
-	    continue
-	    ;;
-	  prog)
-	    if test "$pass" != link; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    fi
-	    continue
-	    ;;
-	  esac # linkmode
-	  ;; # *.$libext
-	*.lo | *.$objext)
-	  if test "$pass" = conv; then
-	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
-	      # If there is no dlopen support or we're linking statically,
-	      # we need to preload.
-	      newdlprefiles="$newdlprefiles $deplib"
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      newdlfiles="$newdlfiles $deplib"
-	    fi
-	  fi
-	  continue
-	  ;;
-	%DEPLIBS%)
-	  alldeplibs=yes
-	  continue
-	  ;;
-	esac # case $deplib
-
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
-	fi
-
-	# Check to see that this really is a libtool archive.
-	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "\`$lib' is not a valid libtool archive"
-
-	func_dirname "$lib" "" "."
-	ladir="$func_dirname_result"
-
-	dlname=
-	dlopen=
-	dlpreopen=
-	libdir=
-	library_names=
-	old_library=
-	inherited_linker_flags=
-	# If the library was installed with an old release of libtool,
-	# it will not redefine variables installed, or shouldnotlink
-	installed=yes
-	shouldnotlink=no
-	avoidtemprpath=
-
-
-	# Read the .la file
-	func_source "$lib"
-
-	# Convert "-framework foo" to "foo.ltframework"
-	if test -n "$inherited_linker_flags"; then
-	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
-	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
-	    case " $new_inherited_linker_flags " in
-	      *" $tmp_inherited_linker_flag "*) ;;
-	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
-	    esac
-	  done
-	fi
-	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
-	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
-	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
-	fi
-
-	if test "$pass" = conv; then
-	  # Only check for convenience libraries
-	  deplibs="$lib $deplibs"
-	  if test -z "$libdir"; then
-	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for \`$lib'"
-	    fi
-	    # It is a libtool convenience library, so add in its objects.
-	    convenience="$convenience $ladir/$objdir/$old_library"
-	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
-	    tmp_libs=
-	    for deplib in $dependency_libs; do
-	      deplibs="$deplib $deplibs"
-	      if $opt_duplicate_deps ; then
-		case "$tmp_libs " in
-		*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-		esac
-	      fi
-	      tmp_libs="$tmp_libs $deplib"
-	    done
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    func_fatal_error "\`$lib' is not a convenience library"
-	  fi
-	  continue
-	fi # $pass = conv
-
-
-	# Get the name of the library we link against.
-	linklib=
-	for l in $old_library $library_names; do
-	  linklib="$l"
-	done
-	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for \`$lib'"
-	fi
-
-	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
-	  fi
-	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
-	    # If there is no dlname, no dlopen support or we're linking
-	    # statically, we need to preload.  We also need to preload any
-	    # dependent libraries so libltdl's deplib preloader doesn't
-	    # bomb out in the load deplibs phase.
-	    dlprefiles="$dlprefiles $lib $dependency_libs"
-	  else
-	    newdlfiles="$newdlfiles $lib"
-	  fi
-	  continue
-	fi # $pass = dlopen
-
-	# We need an absolute path.
-	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
-	*)
-	  abs_ladir=`cd "$ladir" && pwd`
-	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of \`$ladir'"
-	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir="$ladir"
-	  fi
-	  ;;
-	esac
-	func_basename "$lib"
-	laname="$func_basename_result"
-
-	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
-	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library \`$lib' was moved."
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
-	  else
-	    dir="$libdir"
-	    absdir="$libdir"
-	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
-	else
-	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    # Remove this search path later
-	    notinst_path="$notinst_path $abs_ladir"
-	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
-	    # Remove this search path later
-	    notinst_path="$notinst_path $abs_ladir"
-	  fi
-	fi # $installed = yes
-	func_stripname 'lib' '.la' "$laname"
-	name=$func_stripname_result
-
-	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir" && test "$linkmode" = prog; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
-	  fi
-	  # Prefer using a static library (so that no silly _DYNAMIC symbols
-	  # are required to link).
-	  if test -n "$old_library"; then
-	    newdlprefiles="$newdlprefiles $dir/$old_library"
-	    # Keep a list of preopened convenience libraries to check
-	    # that they are being used correctly in the link pass.
-	    test -z "$libdir" && \
-		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
-	  # Otherwise, use the dlname, so that lt_dlopen finds it.
-	  elif test -n "$dlname"; then
-	    newdlprefiles="$newdlprefiles $dir/$dlname"
-	  else
-	    newdlprefiles="$newdlprefiles $dir/$linklib"
-	  fi
-	fi # $pass = dlpreopen
-
-	if test -z "$libdir"; then
-	  # Link the convenience library
-	  if test "$linkmode" = lib; then
-	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
-	    compile_deplibs="$dir/$old_library $compile_deplibs"
-	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
-	  else
-	    deplibs="$lib $deplibs" # used for prog,scan pass
-	  fi
-	  continue
-	fi
-
-
-	if test "$linkmode" = prog && test "$pass" != link; then
-	  newlib_search_path="$newlib_search_path $ladir"
-	  deplibs="$lib $deplibs"
-
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
-	  fi
-
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    case $deplib in
-	    -L*) func_stripname '-L' '' "$deplib"
-	         newlib_search_path="$newlib_search_path $func_stripname_result"
-		 ;;
-	    esac
-	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
-	      deplibs="$deplib $deplibs"
-	    else
-	      # Need to hardcode shared library paths
-	      # or/and link against static libraries
-	      newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    if $opt_duplicate_deps ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	      esac
-	    fi
-	    tmp_libs="$tmp_libs $deplib"
-	  done # for deplib
-	  continue
-	fi # $linkmode = prog...
-
-	if test "$linkmode,$pass" = "prog,link"; then
-	  if test -n "$library_names" &&
-	     { { test "$prefer_static_libs" = no ||
-	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
-	       test -z "$old_library"; }; then
-	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
-	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath:" in
-	      *"$absdir:"*) ;;
-	      *) temp_rpath="$temp_rpath$absdir:" ;;
-	      esac
-	    fi
-
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) compile_rpath="$compile_rpath $absdir"
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) finalize_rpath="$finalize_rpath $libdir"
-	      esac
-	      ;;
-	    esac
-	  fi # $linkmode,$pass = prog,link...
-
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
-		 test -n "$library_names"; }; }; then
-	    # We only need to search for static libraries
-	    continue
-	  fi
-	fi
-
-	link_static=no # Whether the deplib will be linked statically
-	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes; then
-	  use_static_libs=no
-	fi
-	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
-	  case $host in
-	  *cygwin* | *mingw* | *cegcc*)
-	      # No point in relinking DLLs because paths are not encoded
-	      notinst_deplibs="$notinst_deplibs $lib"
-	      need_relink=no
-	    ;;
-	  *)
-	    if test "$installed" = no; then
-	      notinst_deplibs="$notinst_deplibs $lib"
-	      need_relink=yes
-	    fi
-	    ;;
-	  esac
-	  # This is a shared library
-
-	  # Warn about portability, can't link against -module's on some
-	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=""
-	  for dlpremoduletest in $dlprefiles; do
-	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule="$dlpremoduletest"
-	      break
-	    fi
-	  done
-	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
-	    $ECHO
-	    if test "$linkmode" = prog; then
-	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
-	    else
-	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
-	    fi
-	    $ECHO "*** $linklib is not portable!"
-	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
-	    # Hardcode the library path.
-	    # Skip directories that are in the system default run-time
-	    # search path.
-	    case " $sys_lib_dlsearch_path " in
-	    *" $absdir "*) ;;
-	    *)
-	      case "$compile_rpath " in
-	      *" $absdir "*) ;;
-	      *) compile_rpath="$compile_rpath $absdir"
-	      esac
-	      ;;
-	    esac
-	    case " $sys_lib_dlsearch_path " in
-	    *" $libdir "*) ;;
-	    *)
-	      case "$finalize_rpath " in
-	      *" $libdir "*) ;;
-	      *) finalize_rpath="$finalize_rpath $libdir"
-	      esac
-	      ;;
-	    esac
-	  fi
-
-	  if test -n "$old_archive_from_expsyms_cmds"; then
-	    # figure out the soname
-	    set dummy $library_names
-	    shift
-	    realname="$1"
-	    shift
-	    libname=`eval "\\$ECHO \"$libname_spec\""`
-	    # use dlname if we got it. it's perfectly good, no?
-	    if test -n "$dlname"; then
-	      soname="$dlname"
-	    elif test -n "$soname_spec"; then
-	      # bleh windows
-	      case $host in
-	      *cygwin* | mingw* | *cegcc*)
-	        func_arith $current - $age
-		major=$func_arith_result
-		versuffix="-$major"
-		;;
-	      esac
-	      eval soname=\"$soname_spec\"
-	    else
-	      soname="$realname"
-	    fi
-
-	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
-	    func_basename "$soroot"
-	    soname="$func_basename_result"
-	    func_stripname 'lib' '.dll' "$soname"
-	    newlib=libimp-$func_stripname_result.a
-
-	    # If the library has no export list, then create one now
-	    if test -f "$output_objdir/$soname-def"; then :
-	    else
-	      func_verbose "extracting exported symbol list from \`$soname'"
-	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
-	    fi
-
-	    # Create $newlib
-	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for \`$soname'"
-	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
-	    fi
-	    # make sure the library variables are pointing to the new library
-	    dir=$output_objdir
-	    linklib=$newlib
-	  fi # test -n "$old_archive_from_expsyms_cmds"
-
-	  if test "$linkmode" = prog || test "$mode" != relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    lib_linked=yes
-	    case $hardcode_action in
-	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
-		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
-		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
-		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we can not
-		    # link against it, someone is ignoring the earlier warnings
-		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null ; then
-		      if test "X$dlopenmodule" != "X$lib"; then
-			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library" ; then
-			  $ECHO
-			  $ECHO "*** And there doesn't seem to be a static archive available"
-			  $ECHO "*** The link will probably fail, sorry"
-			else
-			  add="$dir/$old_library"
-			fi
-		      elif test -n "$old_library"; then
-			add="$dir/$old_library"
-		      fi
-		    fi
-		esac
-	      elif test "$hardcode_minus_L" = no; then
-		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
-		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    relink)
-	      if test "$hardcode_direct" = yes &&
-	         test "$hardcode_direct_absolute" = no; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$dir"
-		# Try looking first in the location we're being installed to.
-		if test -n "$inst_prefix_dir"; then
-		  case $libdir in
-		    [\\/]*)
-		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
-		      ;;
-		  esac
-		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
-	      else
-		lib_linked=no
-	      fi
-	      ;;
-	    *) lib_linked=no ;;
-	    esac
-
-	    if test "$lib_linked" != yes; then
-	      func_fatal_configuration "unsupported hardcode properties"
-	    fi
-
-	    if test -n "$add_shlibpath"; then
-	      case :$compile_shlibpath: in
-	      *":$add_shlibpath:"*) ;;
-	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
-	      esac
-	    fi
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
-	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes &&
-		 test "$hardcode_minus_L" != yes &&
-		 test "$hardcode_shlibpath_var" = yes; then
-		case :$finalize_shlibpath: in
-		*":$libdir:"*) ;;
-		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
-		esac
-	      fi
-	    fi
-	  fi
-
-	  if test "$linkmode" = prog || test "$mode" = relink; then
-	    add_shlibpath=
-	    add_dir=
-	    add=
-	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes &&
-	       test "$hardcode_direct_absolute" = no; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
-	      case :$finalize_shlibpath: in
-	      *":$libdir:"*) ;;
-	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
-	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
-	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-		add="$inst_prefix_dir$libdir/$linklib"
-	      else
-		add="$libdir/$linklib"
-	      fi
-	    else
-	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
-	      # Try looking first in the location we're being installed to.
-	      if test -n "$inst_prefix_dir"; then
-		case $libdir in
-		  [\\/]*)
-		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
-		    ;;
-		esac
-	      fi
-	      add="-l$name"
-	    fi
-
-	    if test "$linkmode" = prog; then
-	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
-	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
-	    else
-	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
-	      test -n "$add" && deplibs="$add $deplibs"
-	    fi
-	  fi
-	elif test "$linkmode" = prog; then
-	  # Here we assume that one of hardcode_direct or hardcode_minus_L
-	  # is not unsupported.  This is valid on all known static and
-	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
-	    compile_deplibs="$dir/$linklib $compile_deplibs"
-	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
-	  else
-	    compile_deplibs="-l$name -L$dir $compile_deplibs"
-	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
-	  fi
-	elif test "$build_libtool_libs" = yes; then
-	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
-	    # We're trying link a shared library against a static one
-	    # but the system doesn't support it.
-
-	    # Just print a warning and add the library to dependency_libs so
-	    # that the program can be linked against the static library.
-	    $ECHO
-	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
-	    $ECHO "*** I have the capability to make that library automatically link in when"
-	    $ECHO "*** you link to this library.  But I can only do this if you have a"
-	    $ECHO "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
-	      $ECHO "*** But as you try to build a module library, libtool will still create "
-	      $ECHO "*** a static module, that should work as long as the dlopening application"
-	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
-	      if test -z "$global_symbol_pipe"; then
-		$ECHO
-		$ECHO "*** However, this would only work if libtool was able to extract symbol"
-		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
-		$ECHO "*** not find such a program.  So, this module is probably useless."
-		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
-	      fi
-	      if test "$build_old_libs" = no; then
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  else
-	    deplibs="$dir/$old_library $deplibs"
-	    link_static=yes
-	  fi
-	fi # link shared/static library?
-
-	if test "$linkmode" = lib; then
-	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
-	    # Extract -R from dependency_libs
-	    temp_deplibs=
-	    for libdir in $dependency_libs; do
-	      case $libdir in
-	      -R*) func_stripname '-R' '' "$libdir"
-	           temp_xrpath=$func_stripname_result
-		   case " $xrpath " in
-		   *" $temp_xrpath "*) ;;
-		   *) xrpath="$xrpath $temp_xrpath";;
-		   esac;;
-	      *) temp_deplibs="$temp_deplibs $libdir";;
-	      esac
-	    done
-	    dependency_libs="$temp_deplibs"
-	  fi
-
-	  newlib_search_path="$newlib_search_path $absdir"
-	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
-	  # ... and its dependency_libs
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    newdependency_libs="$deplib $newdependency_libs"
-	    if $opt_duplicate_deps ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	      esac
-	    fi
-	    tmp_libs="$tmp_libs $deplib"
-	  done
-
-	  if test "$link_all_deplibs" != no; then
-	    # Add the search paths of all dependency libraries
-	    for deplib in $dependency_libs; do
-	      path=
-	      case $deplib in
-	      -L*) path="$deplib" ;;
-	      *.la)
-	        func_dirname "$deplib" "" "."
-		dir="$func_dirname_result"
-		# We need an absolute path.
-		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
-		*)
-		  absdir=`cd "$dir" && pwd`
-		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of \`$dir'"
-		    absdir="$dir"
-		  fi
-		  ;;
-		esac
-		if $GREP "^installed=no" $deplib > /dev/null; then
-		case $host in
-		*-*-darwin*)
-		  depdepl=
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
-		      depdepl=$tmp
-		    done
-		    if test -f "$absdir/$objdir/$depdepl" ; then
-		      depdepl="$absdir/$objdir/$depdepl"
-		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
-                      if test -z "$darwin_install_name"; then
-                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
-                      fi
-		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
-		      path=
-		    fi
-		  fi
-		  ;;
-		*)
-		  path="-L$absdir/$objdir"
-		  ;;
-		esac
-		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		  test -z "$libdir" && \
-		    func_fatal_error "\`$deplib' is not a valid libtool archive"
-		  test "$absdir" != "$libdir" && \
-		    func_warning "\`$deplib' seems to be moved"
-
-		  path="-L$absdir"
-		fi
-		;;
-	      esac
-	      case " $deplibs " in
-	      *" $path "*) ;;
-	      *) deplibs="$path $deplibs" ;;
-	      esac
-	    done
-	  fi # link_all_deplibs != no
-	fi # linkmode = lib
-      done # for deplib in $libs
-      if test "$pass" = link; then
-	if test "$linkmode" = "prog"; then
-	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
-	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
-	else
-	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	fi
-      fi
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
-	# Link the dlpreopened libraries before other libraries
-	for deplib in $save_deplibs; do
-	  deplibs="$deplib $deplibs"
-	done
-      fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
-	  # Make sure lib_search_path contains only unique directories.
-	  lib_search_path=
-	  for dir in $newlib_search_path; do
-	    case "$lib_search_path " in
-	    *" $dir "*) ;;
-	    *) lib_search_path="$lib_search_path $dir" ;;
-	    esac
-	  done
-	  newlib_search_path=
-	fi
-
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
-	  vars="compile_deplibs finalize_deplibs"
-	fi
-	for var in $vars dependency_libs; do
-	  # Add libraries to $var in reverse order
-	  eval tmp_libs=\"\$$var\"
-	  new_libs=
-	  for deplib in $tmp_libs; do
-	    # FIXME: Pedantically, this is the right thing to do, so
-	    #        that some nasty dependency loop isn't accidentally
-	    #        broken:
-	    #new_libs="$deplib $new_libs"
-	    # Pragmatically, this seems to cause very few problems in
-	    # practice:
-	    case $deplib in
-	    -L*) new_libs="$deplib $new_libs" ;;
-	    -R*) ;;
-	    *)
-	      # And here is the reason: when a library appears more
-	      # than once as an explicit dependence of a library, or
-	      # is implicitly linked in more than once by the
-	      # compiler, it is considered special, and multiple
-	      # occurrences thereof are not removed.  Compare this
-	      # with having the same library being listed as a
-	      # dependency of multiple other libraries: in this case,
-	      # we know (pedantically, we assume) the library does not
-	      # need to be listed more than once, so we keep only the
-	      # last copy.  This is not always right, but it is rare
-	      # enough that we require users that really mean to play
-	      # such unportable linking tricks to link the library
-	      # using -Wl,-lname, so that libtool does not consider it
-	      # for duplicate removal.
-	      case " $specialdeplibs " in
-	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
-	      *)
-		case " $new_libs " in
-		*" $deplib "*) ;;
-		*) new_libs="$deplib $new_libs" ;;
-		esac
-		;;
-	      esac
-	      ;;
-	    esac
-	  done
-	  tmp_libs=
-	  for deplib in $new_libs; do
-	    case $deplib in
-	    -L*)
-	      case " $tmp_libs " in
-	      *" $deplib "*) ;;
-	      *) tmp_libs="$tmp_libs $deplib" ;;
-	      esac
-	      ;;
-	    *) tmp_libs="$tmp_libs $deplib" ;;
-	    esac
-	  done
-	  eval $var=\"$tmp_libs\"
-	done # for var
-      fi
-      # Last step: remove runtime libs from dependency_libs
-      # (they stay in deplibs)
-      tmp_libs=
-      for i in $dependency_libs ; do
-	case " $predeps $postdeps $compiler_lib_search_path " in
-	*" $i "*)
-	  i=""
-	  ;;
-	esac
-	if test -n "$i" ; then
-	  tmp_libs="$tmp_libs $i"
-	fi
-      done
-      dependency_libs=$tmp_libs
-    done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
-    fi
-    if test "$linkmode" = prog || test "$linkmode" = lib; then
-      dlprefiles="$newdlprefiles"
-    fi
-
-    case $linkmode in
-    oldlib)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for archives"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for archives" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for archives"
-
-      test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for archives"
-
-      test -n "$vinfo" && \
-	func_warning "\`-version-info/-version-number' is ignored for archives"
-
-      test -n "$release" && \
-	func_warning "\`-release' is ignored for archives"
-
-      test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "\`-export-symbols' is ignored for archives"
-
-      # Now set the variables for building old libraries.
-      build_libtool_libs=no
-      oldlibs="$output"
-      objs="$objs$old_deplibs"
-      ;;
-
-    lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
-      case $outputname in
-      lib*)
-	func_stripname 'lib' '.la' "$outputname"
-	name=$func_stripname_result
-	eval shared_ext=\"$shrext_cmds\"
-	eval libname=\"$libname_spec\"
-	;;
-      *)
-	test "$module" = no && \
-	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
-
-	if test "$need_lib_prefix" != no; then
-	  # Add the "lib" prefix for modules if required
-	  func_stripname '' '.la' "$outputname"
-	  name=$func_stripname_result
-	  eval shared_ext=\"$shrext_cmds\"
-	  eval libname=\"$libname_spec\"
-	else
-	  func_stripname '' '.la' "$outputname"
-	  libname=$func_stripname_result
-	fi
-	;;
-      esac
-
-      if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
-	else
-	  $ECHO
-	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
-	  $ECHO "*** objects $objs is not portable!"
-	  libobjs="$libobjs $objs"
-	fi
-      fi
-
-      test "$dlself" != no && \
-	func_warning "\`-dlopen self' is ignored for libtool libraries"
-
-      set dummy $rpath
-      shift
-      test "$#" -gt 1 && \
-	func_warning "ignoring multiple \`-rpath's for a libtool library"
-
-      install_libdir="$1"
-
-      oldlibs=
-      if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
-	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
-	  # convenience libraries should have the same extension an
-	  # archive normally would.
-	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
-	  build_libtool_libs=convenience
-	  build_old_libs=yes
-	fi
-
-	test -n "$vinfo" && \
-	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
-
-	test -n "$release" && \
-	  func_warning "\`-release' is ignored for convenience libraries"
-      else
-
-	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
-	set dummy $vinfo 0 0 0
-	shift
-	IFS="$save_ifs"
-
-	test -n "$7" && \
-	  func_fatal_help "too many parameters to \`-version-info'"
-
-	# convert absolute version numbers to libtool ages
-	# this retains compatibility with .la files and attempts
-	# to make the code below a bit more comprehensible
-
-	case $vinfo_number in
-	yes)
-	  number_major="$1"
-	  number_minor="$2"
-	  number_revision="$3"
-	  #
-	  # There are really only two kinds -- those that
-	  # use the current revision as the major version
-	  # and those that subtract age and use age as
-	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
-	  #
-	  case $version_type in
-	  darwin|linux|osf|windows|none)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_revision"
-	    ;;
-	  freebsd-aout|freebsd-elf|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
-	    ;;
-	  irix|nonstopux)
-	    func_arith $number_major + $number_minor
-	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_minor"
-	    lt_irix_increment=no
-	    ;;
-	  *)
-	    func_fatal_configuration "$modename: unknown library version type \`$version_type'"
-	    ;;
-	  esac
-	  ;;
-	no)
-	  current="$1"
-	  revision="$2"
-	  age="$3"
-	  ;;
-	esac
-
-	# Check that each of the things are valid numbers.
-	case $current in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "CURRENT \`$current' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	case $revision in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "REVISION \`$revision' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	case $age in
-	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
-	*)
-	  func_error "AGE \`$age' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	  ;;
-	esac
-
-	if test "$age" -gt "$current"; then
-	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
-	  func_fatal_error "\`$vinfo' is not valid version information"
-	fi
-
-	# Calculate the version variables.
-	major=
-	versuffix=
-	verstring=
-	case $version_type in
-	none) ;;
-
-	darwin)
-	  # Like Linux, but with the current version available in
-	  # verstring for coding it into the library header
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
-	  # Darwin ld doesn't like 0 for these options...
-	  func_arith $current + 1
-	  minor_current=$func_arith_result
-	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
-	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-	  ;;
-
-	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
-	  ;;
-
-	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current"
-	  ;;
-
-	irix | nonstopux)
-	  if test "X$lt_irix_increment" = "Xno"; then
-	    func_arith $current - $age
-	  else
-	    func_arith $current - $age + 1
-	  fi
-	  major=$func_arith_result
-
-	  case $version_type in
-	    nonstopux) verstring_prefix=nonstopux ;;
-	    *)         verstring_prefix=sgi ;;
-	  esac
-	  verstring="$verstring_prefix$major.$revision"
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$revision
-	  while test "$loop" -ne 0; do
-	    func_arith $revision - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring="$verstring_prefix$major.$iface:$verstring"
-	  done
-
-	  # Before this point, $major must not contain `.'.
-	  major=.$major
-	  versuffix="$major.$revision"
-	  ;;
-
-	linux)
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
-	  ;;
-
-	osf)
-	  func_arith $current - $age
-	  major=.$func_arith_result
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
-
-	  # Add in all the interfaces that we are compatible with.
-	  loop=$age
-	  while test "$loop" -ne 0; do
-	    func_arith $current - $loop
-	    iface=$func_arith_result
-	    func_arith $loop - 1
-	    loop=$func_arith_result
-	    verstring="$verstring:${iface}.0"
-	  done
-
-	  # Make executables depend on our current version.
-	  verstring="$verstring:${current}.0"
-	  ;;
-
-	qnx)
-	  major=".$current"
-	  versuffix=".$current"
-	  ;;
-
-	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
-	  ;;
-
-	windows)
-	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
-	  func_arith $current - $age
-	  major=$func_arith_result
-	  versuffix="-$major"
-	  ;;
-
-	*)
-	  func_fatal_configuration "unknown library version type \`$version_type'"
-	  ;;
-	esac
-
-	# Clear the version info if we defaulted, and they specified a release.
-	if test -z "$vinfo" && test -n "$release"; then
-	  major=
-	  case $version_type in
-	  darwin)
-	    # we can't check for "0.0" in archive_cmds due to quoting
-	    # problems, so we reset it completely
-	    verstring=
-	    ;;
-	  *)
-	    verstring="0.0"
-	    ;;
-	  esac
-	  if test "$need_version" = no; then
-	    versuffix=
-	  else
-	    versuffix=".0.0"
-	  fi
-	fi
-
-	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
-	  major=
-	  versuffix=
-	  verstring=""
-	fi
-
-	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    func_warning "undefined symbols not allowed in $host shared libraries"
-	    build_libtool_libs=no
-	    build_old_libs=yes
-	  fi
-	else
-	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
-	fi
-
-      fi
-
-      func_generate_dlsyms "$libname" "$libname" "yes"
-      libobjs="$libobjs $symfileobj"
-      test "X$libobjs" = "X " && libobjs=
-
-      if test "$mode" != relink; then
-	# Remove our outputs, but don't remove object files since they
-	# may have been created when compiling PIC objects.
-	removelist=
-	tempremovelist=`$ECHO "$output_objdir/*"`
-	for p in $tempremovelist; do
-	  case $p in
-	    *.$objext | *.gcno)
-	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
-		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-		 then
-		   continue
-		 fi
-	       fi
-	       removelist="$removelist $p"
-	       ;;
-	    *) ;;
-	  esac
-	done
-	test -n "$removelist" && \
-	  func_show_eval "${RM}r \$removelist"
-      fi
-
-      # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
-	oldlibs="$oldlibs $output_objdir/$libname.$libext"
-
-	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
-      fi
-
-      # Eliminate all temporary directories.
-      #for path in $notinst_path; do
-      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
-      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
-      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
-      #done
-
-      if test -n "$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	temp_xrpath=
-	for libdir in $xrpath; do
-	  temp_xrpath="$temp_xrpath -R$libdir"
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
-	  esac
-	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
-	  dependency_libs="$temp_xrpath $dependency_libs"
-	fi
-      fi
-
-      # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
-      dlfiles=
-      for lib in $old_dlfiles; do
-	case " $dlprefiles $dlfiles " in
-	*" $lib "*) ;;
-	*) dlfiles="$dlfiles $lib" ;;
-	esac
-      done
-
-      # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
-      dlprefiles=
-      for lib in $old_dlprefiles; do
-	case "$dlprefiles " in
-	*" $lib "*) ;;
-	*) dlprefiles="$dlprefiles $lib" ;;
-	esac
-      done
-
-      if test "$build_libtool_libs" = yes; then
-	if test -n "$rpath"; then
-	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
-	    # these systems don't actually have a c library (as such)!
-	    ;;
-	  *-*-rhapsody* | *-*-darwin1.[012])
-	    # Rhapsody C library is in the System framework
-	    deplibs="$deplibs System.ltframework"
-	    ;;
-	  *-*-netbsd*)
-	    # Don't link with libc until the a.out ld.so is fixed.
-	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
-	    # Do not include libc due to us having libc/libc_r.
-	    ;;
-	  *-*-sco3.2v5* | *-*-sco5v6*)
-	    # Causes problems with __ctype
-	    ;;
-	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
-	    # Compiler inserts libc in the correct place for threads to work
-	    ;;
-	  *)
-	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
-	      deplibs="$deplibs -lc"
-	    fi
-	    ;;
-	  esac
-	fi
-
-	# Transform deplibs into only deplibs that can be linked in shared.
-	name_save=$name
-	libname_save=$libname
-	release_save=$release
-	versuffix_save=$versuffix
-	major_save=$major
-	# I'm not sure if I'm treating the release correctly.  I think
-	# release should show up in the -l (ie -lgmp5) so we don't want to
-	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
-	newdeplibs=
-	droppeddeps=no
-	case $deplibs_check_method in
-	pass_all)
-	  # Don't check for shared/static.  Everything works.
-	  # This might be a little naive.  We might want to check
-	  # whether the library exists or not.  But this is on
-	  # osf3 & osf4 and I'm not really sure... Just
-	  # implementing what was already the behavior.
-	  newdeplibs=$deplibs
-	  ;;
-	test_compile)
-	  # This code stresses the "libraries are programs" paradigm to its
-	  # limits. Maybe even breaks it.  We compile a program, linking it
-	  # against the deplibs as a proxy for the library.  Then we can check
-	  # whether they linked in statically or dynamically with ldd.
-	  $opt_dry_run || $RM conftest.c
-	  cat > conftest.c <<EOF
-	  int main() { return 0; }
-EOF
-	  $opt_dry_run || $RM conftest
-	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
-	    ldd_output=`ldd conftest`
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		  case " $predeps $postdeps " in
-		  *" $i "*)
-		    newdeplibs="$newdeplibs $i"
-		    i=""
-		    ;;
-		  esac
-		fi
-		if test -n "$i" ; then
-		  libname=`eval "\\$ECHO \"$libname_spec\""`
-		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
-		  set dummy $deplib_matches; shift
-		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		    newdeplibs="$newdeplibs $i"
-		  else
-		    droppeddeps=yes
-		    $ECHO
-		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		    $ECHO "*** I have the capability to make that library automatically link in when"
-		    $ECHO "*** you link to this library.  But I can only do this if you have a"
-		    $ECHO "*** shared version of the library, which I believe you do not have"
-		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
-		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
-		  fi
-		fi
-		;;
-	      *)
-		newdeplibs="$newdeplibs $i"
-		;;
-	      esac
-	    done
-	  else
-	    # Error occurred in the first compile.  Let's try to salvage
-	    # the situation: Compile a separate program for each library.
-	    for i in $deplibs; do
-	      case $i in
-	      -l*)
-		func_stripname -l '' "$i"
-		name=$func_stripname_result
-		$opt_dry_run || $RM conftest
-		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
-		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		    case " $predeps $postdeps " in
-		    *" $i "*)
-		      newdeplibs="$newdeplibs $i"
-		      i=""
-		      ;;
-		    esac
-		  fi
-		  if test -n "$i" ; then
-		    libname=`eval "\\$ECHO \"$libname_spec\""`
-		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
-		    set dummy $deplib_matches; shift
-		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
-		      newdeplibs="$newdeplibs $i"
-		    else
-		      droppeddeps=yes
-		      $ECHO
-		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
-		      $ECHO "*** I have the capability to make that library automatically link in when"
-		      $ECHO "*** you link to this library.  But I can only do this if you have a"
-		      $ECHO "*** shared version of the library, which you do not appear to have"
-		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
-		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
-		    fi
-		  fi
-		else
-		  droppeddeps=yes
-		  $ECHO
-		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
-		  $ECHO "*** make it link in!  You will probably need to install it or some"
-		  $ECHO "*** library that it depends on before this library will be fully"
-		  $ECHO "*** functional.  Installing it before continuing would be even better."
-		fi
-		;;
-	      *)
-		newdeplibs="$newdeplibs $i"
-		;;
-	      esac
-	    done
-	  fi
-	  ;;
-	file_magic*)
-	  set dummy $deplibs_check_method; shift
-	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  newdeplibs="$newdeplibs $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib" ; then
-		libname=`eval "\\$ECHO \"$libname_spec\""`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-		  for potent_lib in $potential_libs; do
-		      # Follow soft links.
-		      if ls -lLd "$potent_lib" 2>/dev/null |
-			 $GREP " -> " >/dev/null; then
-			continue
-		      fi
-		      # The statement above tries to avoid entering an
-		      # endless loop below, in case of cyclic links.
-		      # We might still enter an endless loop, since a link
-		      # loop can be closed while we follow links,
-		      # but so what?
-		      potlib="$potent_lib"
-		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
-			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
-			esac
-		      done
-		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
-			 $SED -e 10q |
-			 $EGREP "$file_magic_regex" > /dev/null; then
-			newdeplibs="$newdeplibs $a_deplib"
-			a_deplib=""
-			break 2
-		      fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		$ECHO
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		$ECHO "*** I have the capability to make that library automatically link in when"
-		$ECHO "*** you link to this library.  But I can only do this if you have a"
-		$ECHO "*** shared version of the library, which you do not appear to have"
-		$ECHO "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
-		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
-		else
-		  $ECHO "*** with $libname and none of the candidates passed a file format test"
-		  $ECHO "*** using a file magic. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      newdeplibs="$newdeplibs $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	match_pattern*)
-	  set dummy $deplibs_check_method; shift
-	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
-	  for a_deplib in $deplibs; do
-	    case $a_deplib in
-	    -l*)
-	      func_stripname -l '' "$a_deplib"
-	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-		case " $predeps $postdeps " in
-		*" $a_deplib "*)
-		  newdeplibs="$newdeplibs $a_deplib"
-		  a_deplib=""
-		  ;;
-		esac
-	      fi
-	      if test -n "$a_deplib" ; then
-		libname=`eval "\\$ECHO \"$libname_spec\""`
-		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
-		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
-		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
-		       $EGREP "$match_pattern_regex" > /dev/null; then
-		      newdeplibs="$newdeplibs $a_deplib"
-		      a_deplib=""
-		      break 2
-		    fi
-		  done
-		done
-	      fi
-	      if test -n "$a_deplib" ; then
-		droppeddeps=yes
-		$ECHO
-		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
-		$ECHO "*** I have the capability to make that library automatically link in when"
-		$ECHO "*** you link to this library.  But I can only do this if you have a"
-		$ECHO "*** shared version of the library, which you do not appear to have"
-		$ECHO "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
-		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
-		else
-		  $ECHO "*** with $libname and none of the candidates passed a file format test"
-		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
-		fi
-	      fi
-	      ;;
-	    *)
-	      # Add a -L argument.
-	      newdeplibs="$newdeplibs $a_deplib"
-	      ;;
-	    esac
-	  done # Gone through all deplibs.
-	  ;;
-	none | unknown | *)
-	  newdeplibs=""
-	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
-	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
-	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
-	    done
-	  fi
-	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
-	     $GREP . >/dev/null; then
-	    $ECHO
-	    if test "X$deplibs_check_method" = "Xnone"; then
-	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
-	    else
-	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
-	    fi
-	    $ECHO "*** All declared inter-library dependencies are being dropped."
-	    droppeddeps=yes
-	  fi
-	  ;;
-	esac
-	versuffix=$versuffix_save
-	major=$major_save
-	release=$release_save
-	libname=$libname_save
-	name=$name_save
-
-	case $host in
-	*-*-rhapsody* | *-*-darwin1.[012])
-	  # On Rhapsody replace the C library with the System framework
-	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
-	  ;;
-	esac
-
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
-	    $ECHO
-	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
-	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
-	    $ECHO "*** a static module, that should work as long as the dlopening"
-	    $ECHO "*** application is linked with the -dlopen flag."
-	    if test -z "$global_symbol_pipe"; then
-	      $ECHO
-	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
-	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
-	      $ECHO "*** not find such a program.  So, this module is probably useless."
-	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
-	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
-	      build_libtool_libs=module
-	      build_old_libs=yes
-	    else
-	      build_libtool_libs=no
-	    fi
-	  else
-	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
-	    $ECHO "*** automatically added whenever a program is linked with this library"
-	    $ECHO "*** or is declared to -dlopen it."
-
-	    if test "$allow_undefined" = no; then
-	      $ECHO
-	      $ECHO "*** Since this library must not contain undefined symbols,"
-	      $ECHO "*** because either the platform does not support them or"
-	      $ECHO "*** it was explicitly requested with -no-undefined,"
-	      $ECHO "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
-		build_libtool_libs=module
-		build_old_libs=yes
-	      else
-		build_libtool_libs=no
-	      fi
-	    fi
-	  fi
-	fi
-	# Done checking deplibs!
-	deplibs=$newdeplibs
-      fi
-      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
-      case $host in
-	*-*-darwin*)
-	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	  ;;
-      esac
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $deplibs " in
-	  *" -L$path/$objdir "*)
-	    new_libs="$new_libs -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) new_libs="$new_libs $deplib" ;;
-	  esac
-	  ;;
-	*) new_libs="$new_libs $deplib" ;;
-	esac
-      done
-      deplibs="$new_libs"
-
-      # All the library-specific variables (install_libdir is set above).
-      library_names=
-      old_library=
-      dlname=
-
-      # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	if test "$hardcode_into_libs" = yes; then
-	  # Hardcode the library paths
-	  hardcode_libdirs=
-	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$mode" != relink && rpath="$compile_rpath$rpath"
-	  for libdir in $rpath; do
-	    if test -n "$hardcode_libdir_flag_spec"; then
-	      if test -n "$hardcode_libdir_separator"; then
-		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
-		else
-		  # Just accumulate the unique libdirs.
-		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		    ;;
-		  *)
-		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-		    ;;
-		  esac
-		fi
-	      else
-		eval flag=\"$hardcode_libdir_flag_spec\"
-		dep_rpath="$dep_rpath $flag"
-	      fi
-	    elif test -n "$runpath_var"; then
-	      case "$perm_rpath " in
-	      *" $libdir "*) ;;
-	      *) perm_rpath="$perm_rpath $libdir" ;;
-	      esac
-	    fi
-	  done
-	  # Substitute the hardcoded libdirs into the rpath.
-	  if test -n "$hardcode_libdir_separator" &&
-	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
-	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
-	    else
-	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
-	    fi
-	  fi
-	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
-	    # We should set the runpath_var.
-	    rpath=
-	    for dir in $perm_rpath; do
-	      rpath="$rpath$dir:"
-	    done
-	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
-	  fi
-	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
-	fi
-
-	shlibpath="$finalize_shlibpath"
-	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
-	if test -n "$shlibpath"; then
-	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
-	fi
-
-	# Get the real and link names of the library.
-	eval shared_ext=\"$shrext_cmds\"
-	eval library_names=\"$library_names_spec\"
-	set dummy $library_names
-	shift
-	realname="$1"
-	shift
-
-	if test -n "$soname_spec"; then
-	  eval soname=\"$soname_spec\"
-	else
-	  soname="$realname"
-	fi
-	if test -z "$dlname"; then
-	  dlname=$soname
-	fi
-
-	lib="$output_objdir/$realname"
-	linknames=
-	for link
-	do
-	  linknames="$linknames $link"
-	done
-
-	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	test "X$libobjs" = "X " && libobjs=
-
-	delfiles=
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols="$output_objdir/$libname.uexp"
-	  delfiles="$delfiles $export_symbols"
-	fi
-
-	orig_export_symbols=
-	case $host_os in
-	cygwin* | mingw* | cegcc*)
-	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
-	    # exporting using user supplied symfile
-	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
-	      # and it's NOT already a .def file. Must figure out
-	      # which of the given symbols are data symbols and tag
-	      # them as such. So, trigger use of export_symbols_cmds.
-	      # export_symbols gets reassigned inside the "prepare
-	      # the list of exported symbols" if statement, so the
-	      # include_expsyms logic still works.
-	      orig_export_symbols="$export_symbols"
-	      export_symbols=
-	      always_export_symbols=yes
-	    fi
-	  fi
-	  ;;
-	esac
-
-	# Prepare the list of exported symbols
-	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
-	    $opt_dry_run || $RM $export_symbols
-	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
-	    for cmd in $cmds; do
-	      IFS="$save_ifs"
-	      eval cmd=\"$cmd\"
-	      func_len " $cmd"
-	      len=$func_len_result
-	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-		func_show_eval "$cmd" 'exit $?'
-		skipped_export=false
-	      else
-		# The command line is too long to execute in one step.
-		func_verbose "using reloadable object file for export list..."
-		skipped_export=:
-		# Break out early, otherwise skipped_export may be
-		# set to false by a later but shorter cmd.
-		break
-	      fi
-	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-	fi
-
-	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols="$export_symbols"
-	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
-	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
-	fi
-
-	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
-	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
-	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands which not all seds can handle. GNU sed should be fine
-	  # though. Also, the filter scales superlinearly with the number of
-	  # global variables. join(1) would be nice here, but unfortunately
-	  # isn't a blessed tool.
-	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
-	  export_symbols=$output_objdir/$libname.def
-	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
-	fi
-
-	tmp_deplibs=
-	for test_deplib in $deplibs; do
-	  case " $convenience " in
-	  *" $test_deplib "*) ;;
-	  *)
-	    tmp_deplibs="$tmp_deplibs $test_deplib"
-	    ;;
-	  esac
-	done
-	deplibs="$tmp_deplibs"
-
-	if test -n "$convenience"; then
-	  if test -n "$whole_archive_flag_spec" &&
-	    test "$compiler_needs_object" = yes &&
-	    test -z "$libobjs"; then
-	    # extract the archives, so we have objects to list.
-	    # TODO: could optimize this to just extract one archive.
-	    whole_archive_flag_spec=
-	  fi
-	  if test -n "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  else
-	    gentop="$output_objdir/${outputname}x"
-	    generated="$generated $gentop"
-
-	    func_extract_archives $gentop $convenience
-	    libobjs="$libobjs $func_extract_archives_result"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	fi
-
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
-	  eval flag=\"$thread_safe_flag_spec\"
-	  linker_flags="$linker_flags $flag"
-	fi
-
-	# Make a backup of the uninstalled library when relinking
-	if test "$mode" = relink; then
-	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
-	fi
-
-	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
-	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	    eval test_cmds=\"$module_expsym_cmds\"
-	    cmds=$module_expsym_cmds
-	  else
-	    eval test_cmds=\"$module_cmds\"
-	    cmds=$module_cmds
-	  fi
-	else
-	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	    eval test_cmds=\"$archive_expsym_cmds\"
-	    cmds=$archive_expsym_cmds
-	  else
-	    eval test_cmds=\"$archive_cmds\"
-	    cmds=$archive_cmds
-	  fi
-	fi
-
-	if test "X$skipped_export" != "X:" &&
-	   func_len " $test_cmds" &&
-	   len=$func_len_result &&
-	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  :
-	else
-	  # The command line is too long to link in one step, link piecewise
-	  # or, if using GNU ld and skipped_export is not :, use a linker
-	  # script.
-
-	  # Save the value of $output and $libobjs because we want to
-	  # use them later.  If we have whole_archive_flag_spec, we
-	  # want to use save_libobjs as it was before
-	  # whole_archive_flag_spec was expanded, because we can't
-	  # assume the linker understands whole_archive_flag_spec.
-	  # This may have to be revisited, in case too many
-	  # convenience libraries get linked in and end up exceeding
-	  # the spec.
-	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
-	    save_libobjs=$libobjs
-	  fi
-	  save_output=$output
-	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
-
-	  # Clear the reloadable object creation command queue and
-	  # initialize k to one.
-	  test_cmds=
-	  concat_cmds=
-	  objlist=
-	  last_robj=
-	  k=1
-
-	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
-	    output=${output_objdir}/${output_la}.lnkscript
-	    func_verbose "creating GNU ld script: $output"
-	    $ECHO 'INPUT (' > $output
-	    for obj in $save_libobjs
-	    do
-	      $ECHO "$obj" >> $output
-	    done
-	    $ECHO ')' >> $output
-	    delfiles="$delfiles $output"
-	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
-	    output=${output_objdir}/${output_la}.lnk
-	    func_verbose "creating linker input file list: $output"
-	    : > $output
-	    set x $save_libobjs
-	    shift
-	    firstobj=
-	    if test "$compiler_needs_object" = yes; then
-	      firstobj="$1 "
-	      shift
-	    fi
-	    for obj
-	    do
-	      $ECHO "$obj" >> $output
-	    done
-	    delfiles="$delfiles $output"
-	    output=$firstobj\"$file_list_spec$output\"
-	  else
-	    if test -n "$save_libobjs"; then
-	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-${k}.$objext
-	      eval test_cmds=\"$reload_cmds\"
-	      func_len " $test_cmds"
-	      len0=$func_len_result
-	      len=$len0
-
-	      # Loop over the list of objects to be linked.
-	      for obj in $save_libobjs
-	      do
-		func_len " $obj"
-		func_arith $len + $func_len_result
-		len=$func_arith_result
-		if test "X$objlist" = X ||
-		   test "$len" -lt "$max_cmd_len"; then
-		  func_append objlist " $obj"
-		else
-		  # The command $test_cmds is almost too long, add a
-		  # command to the queue.
-		  if test "$k" -eq 1 ; then
-		    # The first file doesn't have a previous command to add.
-		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
-		  else
-		    # All subsequent reloadable object files will link in
-		    # the last one created.
-		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
-		  fi
-		  last_robj=$output_objdir/$output_la-${k}.$objext
-		  func_arith $k + 1
-		  k=$func_arith_result
-		  output=$output_objdir/$output_la-${k}.$objext
-		  objlist=$obj
-		  func_len " $last_robj"
-		  func_arith $len0 + $func_len_result
-		  len=$func_arith_result
-		fi
-	      done
-	      # Handle the remaining objects by creating one last
-	      # reloadable object file.  All subsequent reloadable object
-	      # files will link in the last one created.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
-	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
-	      fi
-	      delfiles="$delfiles $output"
-
-	    else
-	      output=
-	    fi
-
-	    if ${skipped_export-false}; then
-	      func_verbose "generating symbol list for \`$libname.la'"
-	      export_symbols="$output_objdir/$libname.exp"
-	      $opt_dry_run || $RM $export_symbols
-	      libobjs=$output
-	      # Append the command to create the export file.
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
-	      if test -n "$last_robj"; then
-		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
-	      fi
-	    fi
-
-	    test -n "$save_libobjs" &&
-	      func_verbose "creating a temporary reloadable object file: $output"
-
-	    # Loop through the commands generated above and execute them.
-	    save_ifs="$IFS"; IFS='~'
-	    for cmd in $concat_cmds; do
-	      IFS="$save_ifs"
-	      $opt_silent || {
-		  func_quote_for_expand "$cmd"
-		  eval "func_echo $func_quote_for_expand_result"
-	      }
-	      $opt_dry_run || eval "$cmd" || {
-		lt_exit=$?
-
-		# Restore the uninstalled library and exit
-		if test "$mode" = relink; then
-		  ( cd "$output_objdir" && \
-		    $RM "${realname}T" && \
-		    $MV "${realname}U" "$realname" )
-		fi
-
-		exit $lt_exit
-	      }
-	    done
-	    IFS="$save_ifs"
-
-	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
-	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
-	    fi
-	  fi
-
-          if ${skipped_export-false}; then
-	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols="$export_symbols"
-	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
-	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
-	    fi
-
-	    if test -n "$orig_export_symbols"; then
-	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
-	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands which not all seds can handle. GNU sed should be fine
-	      # though. Also, the filter scales superlinearly with the number of
-	      # global variables. join(1) would be nice here, but unfortunately
-	      # isn't a blessed tool.
-	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
-	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
-	      export_symbols=$output_objdir/$libname.def
-	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
-	    fi
-	  fi
-
-	  libobjs=$output
-	  # Restore the value of output.
-	  output=$save_output
-
-	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
-	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
-	    test "X$libobjs" = "X " && libobjs=
-	  fi
-	  # Expand the library linking commands again to reset the
-	  # value of $libobjs for piecewise linking.
-
-	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
-	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
-	      cmds=$module_expsym_cmds
-	    else
-	      cmds=$module_cmds
-	    fi
-	  else
-	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	      cmds=$archive_expsym_cmds
-	    else
-	      cmds=$archive_cmds
-	    fi
-	  fi
-	fi
-
-	if test -n "$delfiles"; then
-	  # Append the command to remove temporary files to $cmds.
-	  eval cmds=\"\$cmds~\$RM $delfiles\"
-	fi
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
-	  generated="$generated $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  libobjs="$libobjs $func_extract_archives_result"
-	  test "X$libobjs" = "X " && libobjs=
-	fi
-
-	save_ifs="$IFS"; IFS='~'
-	for cmd in $cmds; do
-	  IFS="$save_ifs"
-	  eval cmd=\"$cmd\"
-	  $opt_silent || {
-	    func_quote_for_expand "$cmd"
-	    eval "func_echo $func_quote_for_expand_result"
-	  }
-	  $opt_dry_run || eval "$cmd" || {
-	    lt_exit=$?
-
-	    # Restore the uninstalled library and exit
-	    if test "$mode" = relink; then
-	      ( cd "$output_objdir" && \
-	        $RM "${realname}T" && \
-		$MV "${realname}U" "$realname" )
-	    fi
-
-	    exit $lt_exit
-	  }
-	done
-	IFS="$save_ifs"
-
-	# Restore the uninstalled library and exit
-	if test "$mode" = relink; then
-	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
-
-	  if test -n "$convenience"; then
-	    if test -z "$whole_archive_flag_spec"; then
-	      func_show_eval '${RM}r "$gentop"'
-	    fi
-	  fi
-
-	  exit $EXIT_SUCCESS
-	fi
-
-	# Create links to the real library.
-	for linkname in $linknames; do
-	  if test "$realname" != "$linkname"; then
-	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
-	  fi
-	done
-
-	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
-	  # On all known operating systems, these are identical.
-	  dlname="$soname"
-	fi
-      fi
-      ;;
-
-    obj)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for objects"
-      fi
-
-      case " $deplibs" in
-      *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for objects" ;;
-      esac
-
-      test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for objects"
-
-      test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for objects"
-
-      test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for objects"
-
-      test -n "$release" && \
-	func_warning "\`-release' is ignored for objects"
-
-      case $output in
-      *.lo)
-	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
-
-	libobj=$output
-	func_lo2o "$libobj"
-	obj=$func_lo2o_result
-	;;
-      *)
-	libobj=
-	obj="$output"
-	;;
-      esac
-
-      # Delete the old objects.
-      $opt_dry_run || $RM $obj $libobj
-
-      # Objects from convenience libraries.  This assumes
-      # single-version convenience libraries.  Whenever we create
-      # different ones for PIC/non-PIC, this we'll have to duplicate
-      # the extraction.
-      reload_conv_objs=
-      gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec and hope we can get by with
-      # turning comma into space..
-      wl=
-
-      if test -n "$convenience"; then
-	if test -n "$whole_archive_flag_spec"; then
-	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
-	else
-	  gentop="$output_objdir/${obj}x"
-	  generated="$generated $gentop"
-
-	  func_extract_archives $gentop $convenience
-	  reload_conv_objs="$reload_objs $func_extract_archives_result"
-	fi
-      fi
-
-      # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
-      output="$obj"
-      func_execute_cmds "$reload_cmds" 'exit $?'
-
-      # Exit if we aren't doing a library object file.
-      if test -z "$libobj"; then
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	exit $EXIT_SUCCESS
-      fi
-
-      if test "$build_libtool_libs" != yes; then
-	if test -n "$gentop"; then
-	  func_show_eval '${RM}r "$gentop"'
-	fi
-
-	# Create an invalid libtool object if no PIC, so that we don't
-	# accidentally link it into a program.
-	# $show "echo timestamp > $libobj"
-	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
-	exit $EXIT_SUCCESS
-      fi
-
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
-	# Only do commands if we really have different PIC objects.
-	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
-	func_execute_cmds "$reload_cmds" 'exit $?'
-      fi
-
-      if test -n "$gentop"; then
-	func_show_eval '${RM}r "$gentop"'
-      fi
-
-      exit $EXIT_SUCCESS
-      ;;
-
-    prog)
-      case $host in
-	*cygwin*) func_stripname '' '.exe' "$output"
-	          output=$func_stripname_result.exe;;
-      esac
-      test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for programs"
-
-      test -n "$release" && \
-	func_warning "\`-release' is ignored for programs"
-
-      test "$preload" = yes \
-        && test "$dlopen_support" = unknown \
-	&& test "$dlopen_self" = unknown \
-	&& test "$dlopen_self_static" = unknown && \
-	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
-
-      case $host in
-      *-*-rhapsody* | *-*-darwin1.[012])
-	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
-	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
-	;;
-      esac
-
-      case $host in
-      *-*-darwin*)
-	# Don't allow lazy linking, it breaks C++ global constructors
-	# But is supposedly fixed on 10.4 or later (yay!).
-	if test "$tagname" = CXX ; then
-	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
-	    10.[0123])
-	      compile_command="$compile_command ${wl}-bind_at_load"
-	      finalize_command="$finalize_command ${wl}-bind_at_load"
-	    ;;
-	  esac
-	fi
-	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
-	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
-	;;
-      esac
-
-
-      # move library search paths that coincide with paths to not yet
-      # installed libraries to the beginning of the library search list
-      new_libs=
-      for path in $notinst_path; do
-	case " $new_libs " in
-	*" -L$path/$objdir "*) ;;
-	*)
-	  case " $compile_deplibs " in
-	  *" -L$path/$objdir "*)
-	    new_libs="$new_libs -L$path/$objdir" ;;
-	  esac
-	  ;;
-	esac
-      done
-      for deplib in $compile_deplibs; do
-	case $deplib in
-	-L*)
-	  case " $new_libs " in
-	  *" $deplib "*) ;;
-	  *) new_libs="$new_libs $deplib" ;;
-	  esac
-	  ;;
-	*) new_libs="$new_libs $deplib" ;;
-	esac
-      done
-      compile_deplibs="$new_libs"
-
-
-      compile_command="$compile_command $compile_deplibs"
-      finalize_command="$finalize_command $finalize_deplibs"
-
-      if test -n "$rpath$xrpath"; then
-	# If the user specified any rpath flags, then add them.
-	for libdir in $rpath $xrpath; do
-	  # This is the magic to use -rpath.
-	  case "$finalize_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
-	  esac
-	done
-      fi
-
-      # Now hardcode the library paths
-      rpath=
-      hardcode_libdirs=
-      for libdir in $compile_rpath $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath="$rpath $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) perm_rpath="$perm_rpath $libdir" ;;
-	  esac
-	fi
-	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
-	  case :$dllsearchpath: in
-	  *":$libdir:"*) ;;
-	  ::) dllsearchpath=$libdir;;
-	  *) dllsearchpath="$dllsearchpath:$libdir";;
-	  esac
-	  case :$dllsearchpath: in
-	  *":$testbindir:"*) ;;
-	  ::) dllsearchpath=$testbindir;;
-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
-	  esac
-	  ;;
-	esac
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      compile_rpath="$rpath"
-
-      rpath=
-      hardcode_libdirs=
-      for libdir in $finalize_rpath; do
-	if test -n "$hardcode_libdir_flag_spec"; then
-	  if test -n "$hardcode_libdir_separator"; then
-	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
-	    else
-	      # Just accumulate the unique libdirs.
-	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
-	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
-		;;
-	      *)
-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
-		;;
-	      esac
-	    fi
-	  else
-	    eval flag=\"$hardcode_libdir_flag_spec\"
-	    rpath="$rpath $flag"
-	  fi
-	elif test -n "$runpath_var"; then
-	  case "$finalize_perm_rpath " in
-	  *" $libdir "*) ;;
-	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
-	  esac
-	fi
-      done
-      # Substitute the hardcoded libdirs into the rpath.
-      if test -n "$hardcode_libdir_separator" &&
-	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
-	eval rpath=\" $hardcode_libdir_flag_spec\"
-      fi
-      finalize_rpath="$rpath"
-
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
-	# Transform all the library objects into standard objects.
-	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-      fi
-
-      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
-
-      # template prelinking step
-      if test -n "$prelink_cmds"; then
-	func_execute_cmds "$prelink_cmds" 'exit $?'
-      fi
-
-      wrappers_required=yes
-      case $host in
-      *cygwin* | *mingw* )
-        if test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
-        ;;
-      *cegcc)
-        # Disable wrappers for cegcc, we are cross compiling anyway.
-        wrappers_required=no
-        ;;
-      *)
-        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
-        ;;
-      esac
-      if test "$wrappers_required" = no; then
-	# Replace the output file specification.
-	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
-
-	# We have no uninstalled library dependencies, so finalize right now.
-	exit_status=0
-	func_show_eval "$link_command" 'exit_status=$?'
-
-	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.${objext}"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
-	fi
-
-	exit $exit_status
-      fi
-
-      if test -n "$compile_shlibpath$finalize_shlibpath"; then
-	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
-      fi
-      if test -n "$finalize_shlibpath"; then
-	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
-      fi
-
-      compile_var=
-      finalize_var=
-      if test -n "$runpath_var"; then
-	if test -n "$perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $perm_rpath; do
-	    rpath="$rpath$dir:"
-	  done
-	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-	if test -n "$finalize_perm_rpath"; then
-	  # We should set the runpath_var.
-	  rpath=
-	  for dir in $finalize_perm_rpath; do
-	    rpath="$rpath$dir:"
-	  done
-	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
-	fi
-      fi
-
-      if test "$no_install" = yes; then
-	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
-	# Replace the output file specification.
-	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
-	# Delete the old output file.
-	$opt_dry_run || $RM $output
-	# Link the executable and exit
-	func_show_eval "$link_command" 'exit $?'
-	exit $EXIT_SUCCESS
-      fi
-
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
-
-	func_warning "this platform does not like uninstalled shared libraries"
-	func_warning "\`$output' will be relinked during installation"
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-	fi
-      fi
-
-      # Replace the output file specification.
-      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
-      # Delete the old output files.
-      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
-      func_show_eval "$link_command" 'exit $?'
-
-      # Now create the wrapper script.
-      func_verbose "creating $output"
-
-      # Quote the relink command for shipping.
-      if test -n "$relink_command"; then
-	# Preserve any variables that may affect compiler behavior
-	for var in $variables_saved_for_relink; do
-	  if eval test -z \"\${$var+set}\"; then
-	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	  elif eval var_value=\$$var; test -z "$var_value"; then
-	    relink_command="$var=; export $var; $relink_command"
-	  else
-	    func_quote_for_eval "$var_value"
-	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	  fi
-	done
-	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
-      fi
-
-      # Quote $ECHO for shipping.
-      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
-	case $progpath in
-	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
-	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
-	esac
-	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
-      else
-	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
-      fi
-
-      # Only actually do things if not in dry run mode.
-      $opt_dry_run || {
-	# win32 will think the script is a binary if it has
-	# a .exe suffix, so we strip it off here.
-	case $output in
-	  *.exe) func_stripname '' '.exe' "$output"
-	         output=$func_stripname_result ;;
-	esac
-	# test for cygwin because mv fails w/o .exe extensions
-	case $host in
-	  *cygwin*)
-	    exeext=.exe
-	    func_stripname '' '.exe' "$outputname"
-	    outputname=$func_stripname_result ;;
-	  *) exeext= ;;
-	esac
-	case $host in
-	  *cygwin* | *mingw* )
-	    func_dirname_and_basename "$output" "" "."
-	    output_name=$func_basename_result
-	    output_path=$func_dirname_result
-	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
-	    cwrapper="$output_path/$output_name.exe"
-	    $RM $cwrappersource $cwrapper
-	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_cwrapperexe_src > $cwrappersource
-
-	    # The wrapper executable is built using the $host compiler,
-	    # because it contains $host paths and files. If cross-
-	    # compiling, it, like the target executable, must be
-	    # executed on the $host or under an emulation environment.
-	    $opt_dry_run || {
-	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
-	      $STRIP $cwrapper
-	    }
-
-	    # Now, create the wrapper script for func_source use:
-	    func_ltwrapper_scriptname $cwrapper
-	    $RM $func_ltwrapper_scriptname_result
-	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
-	    $opt_dry_run || {
-	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host" ; then
-		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
-	      else
-		func_emit_wrapper no > $func_ltwrapper_scriptname_result
-	      fi
-	    }
-	  ;;
-	  * )
-	    $RM $output
-	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
-	    func_emit_wrapper no > $output
-	    chmod +x $output
-	  ;;
-	esac
-      }
-      exit $EXIT_SUCCESS
-      ;;
-    esac
-
-    # See if we need to build an old-fashioned archive.
-    for oldlib in $oldlibs; do
-
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save $symfileobj"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
-	  build_libtool_libs=no
-	else
-	  oldobjs="$old_deplibs $non_pic_objects"
-	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    oldobjs="$oldobjs $symfileobj"
-	  fi
-	fi
-	addlibs="$old_convenience"
-      fi
-
-      if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
-	generated="$generated $gentop"
-
-	func_extract_archives $gentop $addlibs
-	oldobjs="$oldobjs $func_extract_archives_result"
-      fi
-
-      # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
-	cmds=$old_archive_from_new_cmds
-      else
-
-	# Add any objects from preloaded convenience libraries
-	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
-	  generated="$generated $gentop"
-
-	  func_extract_archives $gentop $dlprefiles
-	  oldobjs="$oldobjs $func_extract_archives_result"
-	fi
-
-	# POSIX demands no paths to be encoded in archives.  We have
-	# to avoid creating archives with duplicate basenames if we
-	# might have to extract them afterwards, e.g., when creating a
-	# static archive out of a convenience library, or when linking
-	# the entirety of a libtool archive into another (currently
-	# not supported by libtool).
-	if (for obj in $oldobjs
-	    do
-	      func_basename "$obj"
-	      $ECHO "$func_basename_result"
-	    done | sort | sort -uc >/dev/null 2>&1); then
-	  :
-	else
-	  $ECHO "copying selected object files to avoid basename conflicts..."
-	  gentop="$output_objdir/${outputname}x"
-	  generated="$generated $gentop"
-	  func_mkdir_p "$gentop"
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  counter=1
-	  for obj in $save_oldobjs
-	  do
-	    func_basename "$obj"
-	    objbase="$func_basename_result"
-	    case " $oldobjs " in
-	    " ") oldobjs=$obj ;;
-	    *[\ /]"$objbase "*)
-	      while :; do
-		# Make sure we don't pick an alternate name that also
-		# overlaps.
-		newobj=lt$counter-$objbase
-		func_arith $counter + 1
-		counter=$func_arith_result
-		case " $oldobjs " in
-		*[\ /]"$newobj "*) ;;
-		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
-		esac
-	      done
-	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      oldobjs="$oldobjs $gentop/$newobj"
-	      ;;
-	    *) oldobjs="$oldobjs $obj" ;;
-	    esac
-	  done
-	fi
-	eval cmds=\"$old_archive_cmds\"
-
-	func_len " $cmds"
-	len=$func_len_result
-	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	  cmds=$old_archive_cmds
-	else
-	  # the command line is too long to link in one step, link in parts
-	  func_verbose "using piecewise archive linking..."
-	  save_RANLIB=$RANLIB
-	  RANLIB=:
-	  objlist=
-	  concat_cmds=
-	  save_oldobjs=$oldobjs
-	  oldobjs=
-	  # Is there a better way of finding the last object in the list?
-	  for obj in $save_oldobjs
-	  do
-	    last_oldobj=$obj
-	  done
-	  eval test_cmds=\"$old_archive_cmds\"
-	  func_len " $test_cmds"
-	  len0=$func_len_result
-	  len=$len0
-	  for obj in $save_oldobjs
-	  do
-	    func_len " $obj"
-	    func_arith $len + $func_len_result
-	    len=$func_arith_result
-	    func_append objlist " $obj"
-	    if test "$len" -lt "$max_cmd_len"; then
-	      :
-	    else
-	      # the above command should be used before it gets too long
-	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
-		RANLIB=$save_RANLIB
-	      fi
-	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
-	      objlist=
-	      len=$len0
-	    fi
-	  done
-	  RANLIB=$save_RANLIB
-	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
-	    eval cmds=\"\$concat_cmds\"
-	  else
-	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
-	  fi
-	fi
-      fi
-      func_execute_cmds "$cmds" 'exit $?'
-    done
-
-    test -n "$generated" && \
-      func_show_eval "${RM}r$generated"
-
-    # Now create the libtool archive.
-    case $output in
-    *.la)
-      old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
-      func_verbose "creating $output"
-
-      # Preserve any variables that may affect compiler behavior
-      for var in $variables_saved_for_relink; do
-	if eval test -z \"\${$var+set}\"; then
-	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
-	elif eval var_value=\$$var; test -z "$var_value"; then
-	  relink_command="$var=; export $var; $relink_command"
-	else
-	  func_quote_for_eval "$var_value"
-	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
-	fi
-      done
-      # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; then
-	relink_command=
-      fi
-
-      # Only create the output if not a dry run.
-      $opt_dry_run || {
-	for installed in no yes; do
-	  if test "$installed" = yes; then
-	    if test -z "$install_libdir"; then
-	      break
-	    fi
-	    output="$output_objdir/$outputname"i
-	    # Replace all uninstalled libtool libraries with the installed ones
-	    newdependency_libs=
-	    for deplib in $dependency_libs; do
-	      case $deplib in
-	      *.la)
-		func_basename "$deplib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		test -z "$libdir" && \
-		  func_fatal_error "\`$deplib' is not a valid libtool archive"
-		newdependency_libs="$newdependency_libs $libdir/$name"
-		;;
-	      *) newdependency_libs="$newdependency_libs $deplib" ;;
-	      esac
-	    done
-	    dependency_libs="$newdependency_libs"
-	    newdlfiles=
-
-	    for lib in $dlfiles; do
-	      case $lib in
-	      *.la)
-	        func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		newdlfiles="$newdlfiles $libdir/$name"
-		;;
-	      *) newdlfiles="$newdlfiles $lib" ;;
-	      esac
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-	      *.la)
-		# Only pass preopened files to the pseudo-archive (for
-		# eventual linking with the app. that links it) if we
-		# didn't already link the preopened objects directly into
-		# the library:
-		func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
-		newdlprefiles="$newdlprefiles $libdir/$name"
-		;;
-	      esac
-	    done
-	    dlprefiles="$newdlprefiles"
-	  else
-	    newdlfiles=
-	    for lib in $dlfiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      newdlfiles="$newdlfiles $abs"
-	    done
-	    dlfiles="$newdlfiles"
-	    newdlprefiles=
-	    for lib in $dlprefiles; do
-	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
-		*) abs=`pwd`"/$lib" ;;
-	      esac
-	      newdlprefiles="$newdlprefiles $abs"
-	    done
-	    dlprefiles="$newdlprefiles"
-	  fi
-	  $RM $output
-	  # place dlname in correct position for cygwin
-	  tdlname=$dlname
-	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
-	  esac
-	  $ECHO > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Linker flags that can not go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
-	    $ECHO >> $output "\
-relink_command=\"$relink_command\""
-	  fi
-	done
-      }
-
-      # Do a symbolic link so that the libtool archive can be found in
-      # LD_LIBRARY_PATH before the program is installed.
-      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
-      ;;
-    esac
-    exit $EXIT_SUCCESS
-}
-
-{ test "$mode" = link || test "$mode" = relink; } &&
-    func_mode_link ${1+"$@"}
-
-
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
-    $opt_debug
-    RM="$nonopt"
-    files=
-    rmforce=
-    exit_status=0
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    for arg
-    do
-      case $arg in
-      -f) RM="$RM $arg"; rmforce=yes ;;
-      -*) RM="$RM $arg" ;;
-      *) files="$files $arg" ;;
-      esac
-    done
-
-    test -z "$RM" && \
-      func_fatal_help "you must specify an RM program"
-
-    rmdirs=
-
-    origobjdir="$objdir"
-    for file in $files; do
-      func_dirname "$file" "" "."
-      dir="$func_dirname_result"
-      if test "X$dir" = X.; then
-	objdir="$origobjdir"
-      else
-	objdir="$dir/$origobjdir"
-      fi
-      func_basename "$file"
-      name="$func_basename_result"
-      test "$mode" = uninstall && objdir="$dir"
-
-      # Remember objdir for removal later, being careful to avoid duplicates
-      if test "$mode" = clean; then
-	case " $rmdirs " in
-	  *" $objdir "*) ;;
-	  *) rmdirs="$rmdirs $objdir" ;;
-	esac
-      fi
-
-      # Don't error if the file doesn't exist and rm -f was used.
-      if { test -L "$file"; } >/dev/null 2>&1 ||
-	 { test -h "$file"; } >/dev/null 2>&1 ||
-	 test -f "$file"; then
-	:
-      elif test -d "$file"; then
-	exit_status=1
-	continue
-      elif test "$rmforce" = yes; then
-	continue
-      fi
-
-      rmfiles="$file"
-
-      case $name in
-      *.la)
-	# Possibly a libtool archive, so verify it.
-	if func_lalib_p "$file"; then
-	  func_source $dir/$name
-
-	  # Delete the libtool libraries and symlinks.
-	  for n in $library_names; do
-	    rmfiles="$rmfiles $objdir/$n"
-	  done
-	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-
-	  case "$mode" in
-	  clean)
-	    case "  $library_names " in
-	    # "  " in the beginning catches empty $dlname
-	    *" $dlname "*) ;;
-	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
-	    esac
-	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
-	    ;;
-	  uninstall)
-	    if test -n "$library_names"; then
-	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
-	    fi
-
-	    if test -n "$old_library"; then
-	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
-	    fi
-	    # FIXME: should reinstall the best remaining shared library.
-	    ;;
-	  esac
-	fi
-	;;
-
-      *.lo)
-	# Possibly a libtool object, so verify it.
-	if func_lalib_p "$file"; then
-
-	  # Read the .lo file
-	  func_source $dir/$name
-
-	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" &&
-	     test "$pic_object" != none; then
-	    rmfiles="$rmfiles $dir/$pic_object"
-	  fi
-
-	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" &&
-	     test "$non_pic_object" != none; then
-	    rmfiles="$rmfiles $dir/$non_pic_object"
-	  fi
-	fi
-	;;
-
-      *)
-	if test "$mode" = clean ; then
-	  noexename=$name
-	  case $file in
-	  *.exe)
-	    func_stripname '' '.exe' "$file"
-	    file=$func_stripname_result
-	    func_stripname '' '.exe' "$name"
-	    noexename=$func_stripname_result
-	    # $file with .exe has already been added to rmfiles,
-	    # add $file without .exe
-	    rmfiles="$rmfiles $file"
-	    ;;
-	  esac
-	  # Do a test to see if this is a libtool program.
-	  if func_ltwrapper_p "$file"; then
-	    if func_ltwrapper_executable_p "$file"; then
-	      func_ltwrapper_scriptname "$file"
-	      relink_command=
-	      func_source $func_ltwrapper_scriptname_result
-	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
-	    else
-	      relink_command=
-	      func_source $dir/$noexename
-	    fi
-
-	    # note $name still contains .exe if it was in $file originally
-	    # as does the version of $file that was added into $rmfiles
-	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
-	    if test "$fast_install" = yes && test -n "$relink_command"; then
-	      rmfiles="$rmfiles $objdir/lt-$name"
-	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
-	    fi
-	  fi
-	fi
-	;;
-      esac
-      func_show_eval "$RM $rmfiles" 'exit_status=1'
-    done
-    objdir="$origobjdir"
-
-    # Try to remove the ${objdir}s in the directories where we deleted files
-    for dir in $rmdirs; do
-      if test -d "$dir"; then
-	func_show_eval "rmdir $dir >/dev/null 2>&1"
-      fi
-    done
-
-    exit $exit_status
-}
-
-{ test "$mode" = uninstall || test "$mode" = clean; } &&
-    func_mode_uninstall ${1+"$@"}
-
-test -z "$mode" && {
-  help="$generic_help"
-  func_fatal_help "you must specify a MODE"
-}
-
-test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$mode'"
-
-if test -n "$exec_cmd"; then
-  eval exec "$exec_cmd"
-  exit $EXIT_FAILURE
-fi
-
-exit $exit_status
-
-
-# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries.  Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them.  This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration.  But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
-# vi:sw=2
-
diff --git a/m4/libtool.m4 b/m4/libtool.m4
deleted file mode 100644
index a3fee53..0000000
--- a/m4/libtool.m4
+++ /dev/null
@@ -1,7377 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-m4_define([_LT_COPYING], [dnl
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008 Free Software Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 56 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
-       [m4_default([$3],
-		   [m4_fatal([Libtool version $1 or higher is required],
-		             63)])],
-       [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
-  *\ * | *\	*)
-    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
-   setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-_LT_PROG_ECHO_BACKSLASH
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    _LT_PATH_MAGIC
-  fi
-  ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from `configure', and `config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
-])# _LT_PROG_LTMAIN
-
-
-## ------------------------------------- ##
-## Accumulate code for creating libtool. ##
-## ------------------------------------- ##
-
-# So that we can recreate a full libtool script including additional
-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
-# label.
-
-
-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
-# ----------------------------------------
-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL_INIT],
-[m4_ifval([$1],
-          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
-                     [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
-
-
-# _LT_CONFIG_LIBTOOL([COMMANDS])
-# ------------------------------
-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL],
-[m4_ifval([$1],
-          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
-                     [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
-
-
-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
-# -----------------------------------------------------
-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
-[_LT_CONFIG_LIBTOOL([$1])
-_LT_CONFIG_LIBTOOL_INIT([$2])
-])
-
-
-# _LT_FORMAT_COMMENT([COMMENT])
-# -----------------------------
-# Add leading comment marks to the start of each line, and a trailing
-# full-stop to the whole comment if one is not present already.
-m4_define([_LT_FORMAT_COMMENT],
-[m4_ifval([$1], [
-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
-              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
-)])
-
-
-
-## ------------------------ ##
-## FIXME: Eliminate VARNAME ##
-## ------------------------ ##
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME.  Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
-    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
-	[m4_ifval([$1], [$1], [$2])])
-    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
-    m4_ifval([$4],
-	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
-    lt_dict_add_subkey([lt_decl_dict], [$2],
-	[tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
-  [0], [m4_fatal([$0: too few arguments: $#])],
-  [1], [m4_fatal([$0: too few arguments: $#: $1])],
-  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
-  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
-  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
-    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
-    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
-     m4_if([$2], [],
-	   m4_quote(lt_decl_varnames),
-	m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
-			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'.  VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly.  In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
-    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-#    # Some comment about what VAR is for.
-#    visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
-					   [description])))[]dnl
-m4_pushdef([_libtool_name],
-    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
-    [0], [_libtool_name=[$]$1],
-    [1], [_libtool_name=$lt_[]$1],
-    [2], [_libtool_name=$lt_[]$1],
-    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
-# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
-    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
-    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'.  Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
-	dnl If the libtool generation code has been placed in $CONFIG_LT,
-	dnl instead of duplicating it all over again into config.status,
-	dnl then we will have config.status run $CONFIG_LT later, so it
-	dnl needs to know what name is stored there:
-        [AC_CONFIG_COMMANDS([libtool],
-            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
-    dnl If the libtool generation code is destined for config.status,
-    dnl expand the accumulated commands and init code now:
-    [AC_CONFIG_COMMANDS([libtool],
-        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
-    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
-    *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
-      ;;
-    *)
-      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
-      ;;
-    esac
-done
-
-# Fix-up fallback echo if it was mangled by the above quoting rules.
-case \$lt_ECHO in
-*'\\\[$]0 --fallback-echo"')dnl "
-  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
-  ;;
-esac
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-cat >"$CONFIG_LT" <<_LTEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate a libtool stub with the current configuration.
-
-lt_cl_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AS_SHELL_SANITIZE
-_AS_PREPARE
-
-exec AS_MESSAGE_FD>&1
-exec AS_MESSAGE_LOG_FD>>config.log
-{
-  echo
-  AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
-  -h, --help      print this help, then exit
-  -V, --version   print version number, then exit
-  -q, --quiet     do not print progress messages
-  -d, --debug     don't remove temporary files
-
-Report bugs to <bug-libtool at gnu.org>."
-
-lt_cl_version="\
-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING.
-
-Copyright (C) 2008 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test $[#] != 0
-do
-  case $[1] in
-    --version | --v* | -V )
-      echo "$lt_cl_version"; exit 0 ;;
-    --help | --h* | -h )
-      echo "$lt_cl_help"; exit 0 ;;
-    --debug | --d* | -d )
-      debug=: ;;
-    --quiet | --q* | --silent | --s* | -q )
-      lt_cl_silent=: ;;
-
-    -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
-
-    *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
-  esac
-  shift
-done
-
-if $lt_cl_silent; then
-  exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure.  Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-if test "$no_create" != yes; then
-  lt_cl_success=:
-  test "$silent" = yes &&
-    lt_config_lt_args="$lt_config_lt_args --quiet"
-  exec AS_MESSAGE_LOG_FD>/dev/null
-  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-  exec AS_MESSAGE_LOG_FD>>config.log
-  $lt_cl_success || AS_EXIT(1)
-fi
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars.  Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
-  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
-  m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options which allow our
-    # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
-      setopt NO_GLOB_SUBST
-    fi
-
-    cfgfile="${ofile}T"
-    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
-    $RM "$cfgfile"
-
-    cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
-  case $host_os in
-  aix3*)
-    cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-_LT_EOF
-    ;;
-  esac
-
-  _LT_PROG_LTMAIN
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  _LT_PROG_XSI_SHELLFNS
-
-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
-    || (rm -f "$cfgfile"; exit 1)
-
-  mv -f "$cfgfile" "$ofile" ||
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
-    PACKAGE='$PACKAGE'
-    VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
-    RM='$RM'
-    ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
-  [C],			[_LT_LANG(C)],
-  [C++],		[_LT_LANG(CXX)],
-  [Java],		[_LT_LANG(GCJ)],
-  [Fortran 77],		[_LT_LANG(F77)],
-  [Fortran],		[_LT_LANG(FC)],
-  [Windows Resource],	[_LT_LANG(RC)],
-  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
-    [_LT_LANG($1)],
-    [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
-  [LT_SUPPORTED_TAG([$1])dnl
-  m4_append([_LT_TAGS], [$1 ])dnl
-  m4_define([_LT_LANG_]$1[_enabled], [])dnl
-  _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
-  [LT_LANG(CXX)],
-  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
-  [LT_LANG(F77)],
-  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
-  [LT_LANG(FC)],
-  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-  [LT_LANG(GCJ)],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-    [LT_LANG(GCJ)],
-    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
-      [LT_LANG(GCJ)],
-      [m4_ifdef([AC_PROG_GCJ],
-	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([A][M_PROG_GCJ],
-	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
-       m4_ifdef([LT_PROG_GCJ],
-	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
-  [LT_LANG(RC)],
-  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
-  case $host_os in
-    rhapsody* | darwin*)
-    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
-    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
-    AC_CHECK_TOOL([LIPO], [lipo], [:])
-    AC_CHECK_TOOL([OTOOL], [otool], [:])
-    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
-    _LT_DECL([], [DSYMUTIL], [1],
-      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
-    _LT_DECL([], [NMEDIT], [1],
-      [Tool to change global to local symbols on Mac OS X])
-    _LT_DECL([], [LIPO], [1],
-      [Tool to manipulate fat objects and archives on Mac OS X])
-    _LT_DECL([], [OTOOL], [1],
-      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
-    _LT_DECL([], [OTOOL64], [1],
-      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
-    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
-      [lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-	# By default we will add the -single_module flag. You can override
-	# by either setting the environment variable LT_MULTI_MODULE
-	# non-empty at configure time, or by adding -multi_module to the
-	# link flags.
-	rm -rf libconftest.dylib*
-	echo "int foo(void){return 1;}" > conftest.c
-	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
-	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
-        _lt_result=$?
-	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
-	  lt_cv_apple_cc_single_mod=yes
-	else
-	  cat conftest.err >&AS_MESSAGE_LOG_FD
-	fi
-	rm -rf libconftest.dylib*
-	rm -f conftest.*
-      fi])
-    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
-      [lt_cv_ld_exported_symbols_list],
-      [lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-	[lt_cv_ld_exported_symbols_list=yes],
-	[lt_cv_ld_exported_symbols_list=no])
-	LDFLAGS="$save_LDFLAGS"
-    ])
-    case $host_os in
-    rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*) # darwin 5.x on
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[[012]]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    fi
-    if test "$DSYMUTIL" != ":"; then
-      _lt_dsymutil='~$DSYMUTIL $lib || :'
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
-  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_automatic, $1)=yes
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
-  _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
-  case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
-     *) _lt_dar_can_shared=$GCC ;;
-  esac
-  if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=echo
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    m4_if([$1], [CXX],
-[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-    fi
-],[])
-  else
-  _LT_TAGVAR(ld_shlibs, $1)=no
-  fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX
-# -----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
-	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-	 [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_SHELL_INIT
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[_LT_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$lt_ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
-
-ECHO=${lt_ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $ECHO works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<_LT_EOF
-[$]*
-_LT_EOF
-  exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$lt_ECHO"; then
-  if test "X${echo_test_string+set}" != Xset; then
-    # find a string as large as possible, as long as the shell can cope with it
-    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
-	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
-      then
-        break
-      fi
-    done
-  fi
-
-  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-     test "X$echo_testing_string" = "X$echo_test_string"; then
-    :
-  else
-    # The Solaris, AIX, and Digital Unix default echo programs unquote
-    # backslashes.  This makes it impossible to quote backslashes using
-    #   echo "$something" | sed 's/\\/\\\\/g'
-    #
-    # So, first we look for a working echo in the user's PATH.
-
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for dir in $PATH /usr/ucb; do
-      IFS="$lt_save_ifs"
-      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        ECHO="$dir/echo"
-        break
-      fi
-    done
-    IFS="$lt_save_ifs"
-
-    if test "X$ECHO" = Xecho; then
-      # We didn't find a better echo, so look for alternatives.
-      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
-         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
-         test "X$echo_testing_string" = "X$echo_test_string"; then
-        # This shell has a builtin print -r that does the trick.
-        ECHO='print -r'
-      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
-	   test "X$CONFIG_SHELL" != X/bin/ksh; then
-        # If we have ksh, try running configure again with it.
-        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-        export ORIGINAL_CONFIG_SHELL
-        CONFIG_SHELL=/bin/ksh
-        export CONFIG_SHELL
-        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-      else
-        # Try using printf.
-        ECHO='printf %s\n'
-        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
-	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	  # Cool, printf works
-	  :
-        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	  export CONFIG_SHELL
-	  SHELL="$CONFIG_SHELL"
-	  export SHELL
-	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
-        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	     test "X$echo_testing_string" = 'X\t' &&
-	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	     test "X$echo_testing_string" = "X$echo_test_string"; then
-	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
-        else
-	  # maybe with a smaller string...
-	  prev=:
-
-	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
-	    then
-	      break
-	    fi
-	    prev="$cmd"
-	  done
-
-	  if test "$prev" != 'sed 50q "[$]0"'; then
-	    echo_test_string=`eval $prev`
-	    export echo_test_string
-	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-	  else
-	    # Oops.  We lost completely, so just stick with echo.
-	    ECHO=echo
-	  fi
-        fi
-      fi
-    fi
-  fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-lt_ECHO=$ECHO
-if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(lt_ECHO)
-])
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1],
-    [An echo program that does not interpret backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-  [AS_HELP_STRING([--disable-libtool-lock],
-    [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-      *ELF-32*)
-	HPUX_IA64_MODE="32"
-	;;
-      *ELF-64*)
-	HPUX_IA64_MODE="64"
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -melf32bsmip"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -melf32bmipn32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -melf64bmip"
-	;;
-      esac
-    else
-      case `/usr/bin/file conftest.$ac_objext` in
-	*32-bit*)
-	  LD="${LD-ld} -32"
-	  ;;
-	*N32*)
-	  LD="${LD-ld} -n32"
-	  ;;
-	*64-bit*)
-	  LD="${LD-ld} -64"
-	  ;;
-      esac
-    fi
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-      *32-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_i386_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
-	    ;;
-	  ppc64-*linux*|powerpc64-*linux*)
-	    LD="${LD-ld} -m elf32ppclinux"
-	    ;;
-	  s390x-*linux*)
-	    LD="${LD-ld} -m elf_s390"
-	    ;;
-	  sparc64-*linux*)
-	    LD="${LD-ld} -m elf32_sparc"
-	    ;;
-	esac
-	;;
-      *64-bit*)
-	case $host in
-	  x86_64-*kfreebsd*-gnu)
-	    LD="${LD-ld} -m elf_x86_64_fbsd"
-	    ;;
-	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_x86_64"
-	    ;;
-	  ppc*-*linux*|powerpc*-*linux*)
-	    LD="${LD-ld} -m elf64ppc"
-	    ;;
-	  s390*-*linux*|s390*-*tpf*)
-	    LD="${LD-ld} -m elf64_s390"
-	    ;;
-	  sparc*-*linux*)
-	    LD="${LD-ld} -m elf64_sparc"
-	    ;;
-	esac
-	;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_PUSH(C)
-     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-sparc*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
-      *)
-	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-	  LD="${LD-ld} -64"
-	fi
-	;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-esac
-
-need_locks="$enable_libtool_lock"
-])# _LT_ENABLE_LOCK
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[AC_CHECK_TOOL(AR, ar, false)
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1])
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
-    [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
-    [Commands used to build an old-style archive])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $RM conftest*
-])
-
-if test x"[$]$2" = xyes; then
-    m4_if([$5], , :, [$5])
-else
-    m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                  [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $3"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
-    m4_if([$4], , :, [$4])
-else
-    m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
-  i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw* | cegcc*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
-	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
-  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
-  AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
-    [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-  return status;
-}]
-_LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_dlunknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-    ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-    ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ])
-    ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
-	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen="dlopen"],
-	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
-	      ])
-	    ])
-	  ])
-	])
-      ])
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-	  lt_cv_dlopen_self, [dnl
-	  _LT_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-	  lt_cv_dlopen_self_static, [dnl
-	  _LT_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
-	 [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
-	 [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
-	 [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $RM -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-     fi
-   fi
-   chmod u+w . 2>&AS_MESSAGE_LOG_FD
-   $RM conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
-   $RM out/* && rmdir out
-   cd ..
-   $RM -r conftest
-   $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
-	[Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $RM conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
-         [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
-  [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
-   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
-   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
-    [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP" ; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      AC_MSG_RESULT([yes])
-    else
-      AC_MSG_RESULT([no])
-    fi
-    ;;
-  *)
-    AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
-	[], [
-if test "$GCC" = yes; then
-  case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
-      test -d "$lt_sys_path" && \
-	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
-  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
-  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[[4-9]]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  case $host_cpu in
-  powerpc)
-    # Since July 2007 AmigaOS4 officially supports .so libraries.
-    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    ;;
-  m68k)
-    library_names_spec='$libname.ixlibrary $libname.a'
-    # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-    ;;
-  esac
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[[45]]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname~
-      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
-        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
-      fi'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw* | cegcc*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[[123]]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
-  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  hppa*64*)
-    shrext_cmds='.sl'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-  *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix[[3-9]]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # Some binutils ld are patched to set DT_RUNPATH
-  save_LDFLAGS=$LDFLAGS
-  save_libdir=$libdir
-  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
-       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
-  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
-       [shlibpath_overrides_runpath=yes])])
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsdelf*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='NetBSD ld.elf_so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-*nto* | *qnx*)
-  version_type=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
-    [Variables whose values should be saved in libtool wrapper scripts and
-    restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
-    [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
-    [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
-    [[List of archive names.  First name is the real one, the rest are links.
-    The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
-    [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [postinstall_cmds], [2],
-    [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
-    [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
-    [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
-    [[As "finish_cmds", except a single script fragment to be evaled but
-    not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
-    [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
-    [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
-    [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program which can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="m4_if([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-_LT_EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
-else
-  AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
-	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program which can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-
-AC_ARG_WITH([gnu-ld],
-    [AS_HELP_STRING([--with-gnu-ld],
-	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
-    [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
-  lt_cv_ld_reload_flag,
-  [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_DECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[[45]]*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  ;;
-
-cegcc)
-  # use the weaker test based on 'objdump'. See mingw*.
-  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[[3-9]]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd* | netbsdelf*-gnu)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
-    [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
-    [Command to use when deplibs_check_method == "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi])
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
-  AC_SUBST([DUMPBIN])
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
-  fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
-  [lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
-  cat conftest.out >&AS_MESSAGE_LOG_FD
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
-  # These system don't have libm, or don't need it
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
-  ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
-  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
-  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
-    lt_cv_prog_compiler_rtti_exceptions,
-    [-fno-rtti -fno-exceptions], [],
-    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
-	[Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32* | cegcc*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDEGRST]]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
-  ;;
-solaris*)
-  symcode='[[BDRT]]'
-  ;;
-sco3.2v5*)
-  symcode='[[DT]]'
-  ;;
-sysv4.2uw2*)
-  symcode='[[DT]]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[[ABDT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK ['"\
-"     {last_section=section; section=\$ 3};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx]"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-	mv -f "$nlist"T "$nlist"
-      else
-	rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
-	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<_LT_EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
-	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
-	  cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols.  */
-const struct {
-  const char *name;
-  void       *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
-  { "@PROGRAM@", (void *) 0 },
-_LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
-	  cat <<\_LT_EOF >> conftest.$ac_ext
-  {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
-	  # Now try linking the two files.
-	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
-	  LIBS="conftstm.$ac_objext"
-	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
-	    pipe_works=yes
-	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
-	else
-	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
-	fi
-      else
-	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
-    fi
-  else
-    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
-    [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
-    [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_c_name_address],
-    [lt_cv_sys_global_symbol_to_c_name_address], [1],
-    [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
-    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
-    [Transform the output of nm in a C name address pair when lib prefix is needed])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
-m4_if([$1], [CXX], [
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-      ;;
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-    *qnx* | *nto*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[[4-9]]*)
-	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
-	  # AIX 5 now supports IA64 processor
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	else
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-	fi
-	;;
-      chorus*)
-	case $cc_basename in
-	cxch68*)
-	  # Green Hills C++ Compiler
-	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-	  ;;
-	esac
-	;;
-      dgux*)
-	case $cc_basename in
-	  ec++*)
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  ghcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      freebsd* | dragonfly*)
-	# FreeBSD uses GNU C++
-	;;
-      hpux9* | hpux10* | hpux11*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	    fi
-	    ;;
-	  aCC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    case $host_cpu in
-	    hppa*64*|ia64*)
-	      # +Z the default
-	      ;;
-	    *)
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	      ;;
-	    esac
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      interix*)
-	# This is c89, which is MS Visual C++ (no shared libs)
-	# Anyone wants to do a port?
-	;;
-      irix5* | irix6* | nonstopux*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    # CC pic flag -KPIC is the default.
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-	case $cc_basename in
-	  KCC*)
-	    # KAI C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    ;;
-	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	    ;;
-	  icpc* )
-	    # Intel C++, used to be incompatible with GCC.
-	    # ICC 10 doesn't accept -KPIC any more.
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	    ;;
-	  pgCC* | pgcpp*)
-	    # Portland Group C++ compiler
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  cxx*)
-	    # Compaq C++
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  xlc* | xlC*)
-	    # IBM XL 8.0 on PPC
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-      lynxos*)
-	;;
-      m88k*)
-	;;
-      mvs*)
-	case $cc_basename in
-	  cxx*)
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      netbsd* | netbsdelf*-gnu)
-	;;
-      *qnx* | *nto*)
-        # QNX uses GNU C++, but need to define -shared option too, otherwise
-        # it will coredump.
-        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-        ;;
-      osf3* | osf4* | osf5*)
-	case $cc_basename in
-	  KCC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    ;;
-	  RCC*)
-	    # Rational C++ 2.4.1
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  cxx*)
-	    # Digital/Compaq C++
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      psos*)
-	;;
-      solaris*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	    ;;
-	  gcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sunos4*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.x
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  lcc*)
-	    # Lucid
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	esac
-	;;
-      tandem*)
-	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
-	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      vxworks*)
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-	;;
-    esac
-  fi
-],
-[
-  if test "$GCC" = yes; then
-    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-        ;;
-      m68k)
-            # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
-            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-        ;;
-      esac
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-
-    hpux*)
-      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
-      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
-      # sets the default TLS model and affects inlining.
-      case $host_cpu in
-      hppa*64*)
-	# +Z the default
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      m4_if([$1], [GCJ], [],
-	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
-      case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
-      ecc*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # icc used to be incompatible with GCC.
-      # ICC 10 doesn't accept -KPIC any more.
-      icc* | ifort*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      # Lahey Fortran 8.1.
-      lf95*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
-	;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      xl*)
-	# IBM XL C 8.0/Fortran 10.1 on PPC
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C 5.9
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *nto* | *qnx*)
-      # QNX uses GNU C++, but need to define -shared option too, otherwise
-      # it will coredump.
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
-      ;;
-
-    osf3* | osf4* | osf5*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    rdos*)
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    unicos*)
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *)
-      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
-])
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
-    ;;
-esac
-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
-	[How to pass a linker flag through the compiler])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
-    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
-    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
-	[Additional compiler flags for building library objects])
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
-  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
-  $lt_tmp_static_flag,
-  [],
-  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
-	[Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix[[4-9]]*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-  ;;
-  cygwin* | mingw* | cegcc*)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  linux* | k*bsd*-gnu)
-    _LT_TAGVAR(link_all_deplibs, $1)=no
-  ;;
-  *)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-], [
-  runpath_var=
-  _LT_TAGVAR(allow_undefined_flag, $1)=
-  _LT_TAGVAR(always_export_symbols, $1)=no
-  _LT_TAGVAR(archive_cmds, $1)=
-  _LT_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_TAGVAR(compiler_needs_object, $1)=no
-  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  _LT_TAGVAR(hardcode_automatic, $1)=no
-  _LT_TAGVAR(hardcode_direct, $1)=no
-  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
-  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-  _LT_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_TAGVAR(inherit_rpath, $1)=no
-  _LT_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_TAGVAR(module_cmds, $1)=
-  _LT_TAGVAR(module_expsym_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
-  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_TAGVAR(whole_archive_flag_spec, $1)=
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_TAGVAR(include_expsyms, $1)=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
-  extract_expsyms_cmds=
-
-  case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  linux* | k*bsd*-gnu)
-    _LT_TAGVAR(link_all_deplibs, $1)=no
-    ;;
-  esac
-
-  _LT_TAGVAR(ld_shlibs, $1)=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>&1` in
-      *GNU\ gold*) supports_anon_versioning=yes ;;
-      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[[3-9]]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-_LT_EOF
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-      # as there is no search path for DLLs.
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=no
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    interix[[3-9]]*)
-      _LT_TAGVAR(hardcode_direct, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
-      tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
-	case $cc_basename in
-	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
-	esac
-      fi
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
-      then
-	tmp_addflag=
-	tmp_sharedflag='-shared'
-	case $cc_basename,$host_cpu in
-        pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	lf95*)				# Lahey Fortran 8.1
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
-	  tmp_sharedflag='--shared' ;;
-	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
-	  tmp_sharedflag='-qmkshrobj'
-	  tmp_addflag= ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	  _LT_TAGVAR(compiler_needs_object, $1)=yes
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	esac
-	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-        if test "x$supports_anon_versioning" = xyes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-        fi
-
-	case $cc_basename in
-	xlf*)
-	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
-	  fi
-	  ;;
-	esac
-      else
-        _LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    netbsd* | netbsdelf*-gnu)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  # For security reasons, it is highly recommended that you always
-	  # use absolute paths for naming shared libraries, and exclude the
-	  # DT_RUNPATH tag from executables and libraries.  But doing so
-	  # requires that you compile everything twice, which is a pain.
-	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  else
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-
-    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
-      runpath_var=
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	_LT_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
-
-    aix[[4-9]]*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-	else
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-	    aix_use_runtimelinking=yes
-	    break
-	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      _LT_TAGVAR(archive_cmds, $1)=''
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[[012]]|aix4.[[012]].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	  # We have reworked collect2
-	  :
-	  else
-	  # We have old collect2
-	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-	_LT_TAGVAR(link_all_deplibs, $1)=no
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-        # Determine the default libpath from the value encoded in an
-        # empty executable.
-        _LT_SYS_MODULE_PATH_AIX
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-      else
-	if test "$host_cpu" = ia64; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an
-	 # empty executable.
-	 _LT_SYS_MODULE_PATH_AIX
-	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      case $host_cpu in
-      powerpc)
-            # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-            _LT_TAGVAR(archive_expsym_cmds, $1)=''
-        ;;
-      m68k)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes
-        ;;
-      esac
-      ;;
-
-    bsdi[[45]]*)
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32* | cegcc*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-      # FIXME: Should let the user specify the lib program.
-      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      ;;
-
-    darwin* | rhapsody*)
-      _LT_DARWIN_LINKER_FEATURES($1)
-      ;;
-
-    dgux*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    freebsd1*)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
-	_LT_TAGVAR(hardcode_direct, $1)=yes
-	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	_LT_TAGVAR(hardcode_minus_L, $1)=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  _LT_TAGVAR(hardcode_direct, $1)=no
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	  ;;
-	*)
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	# Try to use the -exported_symbol ld option, if it does not
-	# work, assume that -exports_file does not work either and
-	# implicitly export all symbols.
-        save_LDFLAGS="$LDFLAGS"
-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
-        AC_LINK_IFELSE(int foo(void) {},
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-        )
-        LDFLAGS="$save_LDFLAGS"
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(inherit_rpath, $1)=yes
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    netbsd* | netbsdelf*-gnu)
-      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    newsos6)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *nto* | *qnx*)
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-	_LT_TAGVAR(hardcode_direct, $1)=yes
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	else
-	  case $host_os in
-	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	     ;;
-	   *)
-	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	     ;;
-	  esac
-	fi
-      else
-	_LT_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    os2*)
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      else
-	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    solaris*)
-      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-      else
-	case `$CC -V 2>&1` in
-	*"Compilers 5.0"*)
-	  wlarc=''
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
-	  ;;
-	*)
-	  wlarc='${wl}'
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
-	  ;;
-	esac
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
-	# but is careful enough not to reorder.
-	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	else
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-	  _LT_TAGVAR(hardcode_direct, $1)=no
-        ;;
-	motorola)
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4.3*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	_LT_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
-      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      _LT_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-
-    if test x$host_vendor = xsni; then
-      case $host in
-      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
-	;;
-      esac
-    fi
-  fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
-    [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_TAGVAR(archive_cmds, $1) in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-      $RM conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
-	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
-        _LT_TAGVAR(allow_undefined_flag, $1)=
-        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
-        then
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-        else
-	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-        fi
-        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $RM conftest*
-      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
-    [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
-    [enable_shared_with_static_runtimes], [0],
-    [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
-    [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
-    [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
-    [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
-    [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
-    [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
-    [Commands used to build a loadable module if different from building
-    a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
-    [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
-    [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
-    [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
-    [Flag to hardcode $libdir into a binary during linking.
-    This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
-    [[If ld is used when linking, flag to hardcode $libdir into a binary
-    during linking.  This must work even if $libdir does not exist]])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
-    [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-    DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
-    DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
-    library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
-    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
-    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-    into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
-    [Set to "yes" if building a shared library automatically hardcodes DIR
-    into the library and all subsequent libraries and executables linked
-    against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
-    [Set to yes if linker adds runtime paths of dependent libraries
-    to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
-    [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [fix_srcfile_path], [1],
-    [Fix the shell variable $srcfile for the compiler])
-_LT_TAGDECL([], [always_export_symbols], [0],
-    [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
-    [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
-    [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
-    [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
-    [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [file_list_spec], [1],
-    [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl    [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_SYS_DYNAMIC_LINKER($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-  LT_SYS_DLOPEN_SELF
-  _LT_CMD_STRIPLIB
-
-  # Report which library types will actually be built
-  AC_MSG_CHECKING([if libtool supports shared libraries])
-  AC_MSG_RESULT([$can_build_shared])
-
-  AC_MSG_CHECKING([whether to build shared libraries])
-  test "$can_build_shared" = "no" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test "$enable_shared" = yes && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[[4-9]]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
-    fi
-    ;;
-  esac
-  AC_MSG_RESULT([$enable_shared])
-
-  AC_MSG_CHECKING([whether to build static libraries])
-  # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
-  AC_MSG_RESULT([$enable_static])
-
-  _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC="$lt_save_CC"
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_PROG_CXX
-# ------------
-# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
-# compiler, we have our own version here.
-m4_defun([_LT_PROG_CXX],
-[
-pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
-AC_PROG_CXX
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-else
-  _lt_caught_CXX_error=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_CXX
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_CXX], [])
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[AC_REQUIRE([_LT_PROG_CXX])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="int some_variable = 0;"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC=$CC
-  lt_save_LD=$LD
-  lt_save_GCC=$GCC
-  GCC=$GXX
-  lt_save_with_gnu_ld=$with_gnu_ld
-  lt_save_path_LD=$lt_cv_path_LD
-  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-  else
-    $as_unset lt_cv_prog_gnu_ld
-  fi
-  if test -n "${lt_cv_path_LDCXX+set}"; then
-    lt_cv_path_LD=$lt_cv_path_LDCXX
-  else
-    $as_unset lt_cv_path_LD
-  fi
-  test -z "${LDCXX+set}" || LD=$LDCXX
-  CC=${CXX-"c++"}
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    # We don't want -fno-exception when compiling C++ code, so set the
-    # no_builtin_flag separately
-    if test "$GXX" = yes; then
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-    else
-      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-    fi
-
-    if test "$GXX" = yes; then
-      # Set up default GNU C++ configuration
-
-      LT_PATH_LD
-
-      # Check if GNU C++ uses GNU ld as the underlying linker, since the
-      # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-        # If archive_cmds runs LD, not CC, wlarc should be empty
-        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-        #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
-
-        # ancient GNU ld didn't support --whole-archive et. al.
-        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
-	  $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-        else
-          _LT_TAGVAR(whole_archive_flag_spec, $1)=
-        fi
-      else
-        with_gnu_ld=no
-        wlarc=
-
-        # A generic and very simple default shared library creation
-        # command for GNU C++ for the case where it uses the native
-        # linker, instead of GNU ld.  If possible, this setting should
-        # overridden to take advantage of the native linker features on
-        # the platform it is being used on.
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      fi
-
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-
-    else
-      GXX=no
-      with_gnu_ld=no
-      wlarc=
-    fi
-
-    # PORTME: fill in a description of your system's C++ link characteristics
-    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-    _LT_TAGVAR(ld_shlibs, $1)=yes
-    case $host_os in
-      aix3*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-      aix[[4-9]]*)
-        if test "$host_cpu" = ia64; then
-          # On IA64, the linker does run time linking by default, so we don't
-          # have to do anything special.
-          aix_use_runtimelinking=no
-          exp_sym_flag='-Bexport'
-          no_entry_flag=""
-        else
-          aix_use_runtimelinking=no
-
-          # Test if we are trying to use run time linking or normal
-          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
-          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	    for ld_flag in $LDFLAGS; do
-	      case $ld_flag in
-	      *-brtl*)
-	        aix_use_runtimelinking=yes
-	        break
-	        ;;
-	      esac
-	    done
-	    ;;
-          esac
-
-          exp_sym_flag='-bexport'
-          no_entry_flag='-bnoentry'
-        fi
-
-        # When large executables or shared objects are built, AIX ld can
-        # have problems creating the table of contents.  If linking a library
-        # or program results in "error TOC overflow" add -mminimal-toc to
-        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-        _LT_TAGVAR(archive_cmds, $1)=''
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
-        if test "$GXX" = yes; then
-          case $host_os in aix4.[[012]]|aix4.[[012]].*)
-          # We only want to do this on AIX 4.2 and lower, the check
-          # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" &&
-	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
-	  then
-	    # We have reworked collect2
-	    :
-	  else
-	    # We have old collect2
-	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
-	    # It fails to find uninstalled libraries when the uninstalled
-	    # path is not listed in the libpath.  Setting hardcode_minus_L
-	    # to unsupported forces relinking
-	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
-	  fi
-          esac
-          shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
-	  fi
-        else
-          # not using gcc
-          if test "$host_cpu" = ia64; then
-	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	  # chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-          else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
-	    else
-	      shared_flag='${wl}-bM:SRE'
-	    fi
-          fi
-        fi
-
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
-        # It seems that -bexpall does not export symbols beginning with
-        # underscore (_), so it is better to generate a list of symbols to
-	# export.
-        _LT_TAGVAR(always_export_symbols, $1)=yes
-        if test "$aix_use_runtimelinking" = yes; then
-          # Warning - without using the other runtime loading flags (-brtl),
-          # -berok will link without error, but may produce a broken library.
-          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
-          # Determine the default libpath from the value encoded in an empty
-          # executable.
-          _LT_SYS_MODULE_PATH_AIX
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-        else
-          if test "$host_cpu" = ia64; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-          else
-	    # Determine the default libpath from the value encoded in an
-	    # empty executable.
-	    _LT_SYS_MODULE_PATH_AIX
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	    # Warning - without using the other run time loading flags,
-	    # -berok will link without error, but may produce a broken library.
-	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	    # Exported symbols can be pulled into shared objects from archives
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	    # This is similar to how AIX traditionally builds its shared
-	    # libraries.
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-          fi
-        fi
-        ;;
-
-      beos*)
-	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	  # support --undefined.  This deserves some investigation.  FIXME
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	else
-	  _LT_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-
-      chorus*)
-        case $cc_basename in
-          *)
-	  # FIXME: insert proper C++ library support
-	  _LT_TAGVAR(ld_shlibs, $1)=no
-	  ;;
-        esac
-        ;;
-
-      cygwin* | mingw* | pw32* | cegcc*)
-        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-        # as there is no search path for DLLs.
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-        _LT_TAGVAR(always_export_symbols, $1)=no
-        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-          # If the export-symbols file already is a .def file (1st line
-          # is EXPORTS), use it as is; otherwise, prepend...
-          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    cp $export_symbols $output_objdir/$soname.def;
-          else
-	    echo EXPORTS > $output_objdir/$soname.def;
-	    cat $export_symbols >> $output_objdir/$soname.def;
-          fi~
-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-        else
-          _LT_TAGVAR(ld_shlibs, $1)=no
-        fi
-        ;;
-      darwin* | rhapsody*)
-        _LT_DARWIN_LINKER_FEATURES($1)
-	;;
-
-      dgux*)
-        case $cc_basename in
-          ec++*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          ghcx*)
-	    # Green Hills C++ Compiler
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      freebsd[[12]]*)
-        # C++ shared libraries reported to be fairly broken before
-	# switch to ELF
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      freebsd-elf*)
-        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-        ;;
-
-      freebsd* | dragonfly*)
-        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-        # conventions
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-        ;;
-
-      gnu*)
-        ;;
-
-      hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        _LT_TAGVAR(hardcode_direct, $1)=yes
-        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-				             # but as the default
-				             # location of the library.
-
-        case $cc_basename in
-          CC*)
-            # FIXME: insert proper C++ library support
-            _LT_TAGVAR(ld_shlibs, $1)=no
-            ;;
-          aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            # Commands to make compiler produce verbose output that lists
-            # what "hidden" libraries, object files and flags are used when
-            # linking a shared library.
-            #
-            # There doesn't appear to be a way to prevent this compiler from
-            # explicitly linking system object files so we need to strip them
-            # from the output so that they don't get included in the library
-            # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-            ;;
-          *)
-            if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-            else
-              # FIXME: insert proper C++ library support
-              _LT_TAGVAR(ld_shlibs, $1)=no
-            fi
-            ;;
-        esac
-        ;;
-
-      hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-          case $host_cpu in
-            hppa*64*|ia64*)
-              ;;
-            *)
-	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-              ;;
-          esac
-        fi
-        case $host_cpu in
-          hppa*64*|ia64*)
-            _LT_TAGVAR(hardcode_direct, $1)=no
-            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-            ;;
-          *)
-            _LT_TAGVAR(hardcode_direct, $1)=yes
-            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-					         # but as the default
-					         # location of the library.
-            ;;
-        esac
-
-        case $cc_basename in
-          CC*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          aCC*)
-	    case $host_cpu in
-	      hppa*64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      ia64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	      *)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	        ;;
-	    esac
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-	    ;;
-          *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
-	        case $host_cpu in
-	          hppa*64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	            ;;
-	        esac
-	      fi
-	    else
-	      # FIXME: insert proper C++ library support
-	      _LT_TAGVAR(ld_shlibs, $1)=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      interix[[3-9]]*)
-	_LT_TAGVAR(hardcode_direct, $1)=no
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-	# Instead, shared libraries are loaded at an image base (0x10000000 by
-	# default) and relocated if they conflict, which is a slow very memory
-	# consuming and fragmenting process.  To avoid this, we pick a random,
-	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	;;
-      irix5* | irix6*)
-        case $cc_basename in
-          CC*)
-	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
-	      fi
-	    fi
-	    _LT_TAGVAR(link_all_deplibs, $1)=yes
-	    ;;
-        esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(inherit_rpath, $1)=yes
-        ;;
-
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-	    ;;
-	  icpc* | ecpc* )
-	    # Intel C++
-	    with_gnu_ld=yes
-	    # version 8.0 and above of icpc choke on multiply defined symbols
-	    # if we add $predep_objects and $postdep_objects, however 7.1 and
-	    # earlier do not add the objects themselves.
-	    case `$CC -V 2>&1` in
-	      *"Version 7."*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	      *)  # Version 8.0 or newer
-	        tmp_idyn=
-	        case $host_cpu in
-		  ia64*) tmp_idyn=' -i_dynamic';;
-		esac
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-		;;
-	    esac
-	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	    ;;
-          pgCC* | pgcpp*)
-            # Portland Group C++ compiler
-	    case `$CC -V` in
-	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
-	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
-	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
-		$RANLIB $oldlib'
-	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-	      ;;
-	    *) # Version 6 will use weak symbols
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-	      ;;
-	    esac
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-            ;;
-	  cxx*)
-	    # Compaq C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-	    runpath_var=LD_RUN_PATH
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-	    ;;
-	  xl*)
-	    # IBM XL 8.0 on PPC, with GNU ld
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	    fi
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
-	      _LT_TAGVAR(compiler_needs_object, $1)=yes
-
-	      # Not sure whether something based on
-	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-	      # would be better.
-	      output_verbose_link_cmd='echo'
-
-	      # Archives containing C++ object files must be created using
-	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	      # necessary to make sure instantiated templates are included
-	      # in the archive.
-	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-
-      lynxos*)
-        # FIXME: insert proper C++ library support
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      m88k*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      mvs*)
-        case $cc_basename in
-          cxx*)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-	  *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-	esac
-	;;
-
-      netbsd*)
-        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-	  wlarc=
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	fi
-	# Workaround some broken pre-1.5 toolchains
-	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-	;;
-
-      *nto* | *qnx*)
-        _LT_TAGVAR(ld_shlibs, $1)=yes
-	;;
-
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      openbsd*)
-	if test -f /usr/libexec/ld.so; then
-	  _LT_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-	  fi
-	  output_verbose_link_cmd=echo
-	else
-	  _LT_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-
-      osf3* | osf4* | osf5*)
-        case $cc_basename in
-          KCC*)
-	    # Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	    # KCC will only create a shared library if the output file
-	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
-	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Archives containing C++ object files must be created using
-	    # the KAI C++ compiler.
-	    case $host in
-	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
-	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
-	    esac
-	    ;;
-          RCC*)
-	    # Rational C++ 2.4.1
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          cxx*)
-	    case $host in
-	      osf3*)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-		;;
-	      *)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-		;;
-	    esac
-
-	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    #
-	    # There doesn't appear to be a way to prevent this compiler from
-	    # explicitly linking system object files so we need to strip them
-	    # from the output so that they don't get included in the library
-	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-	    ;;
-	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	      case $host in
-	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-		  ;;
-	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-		  ;;
-	      esac
-
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	      # Commands to make compiler produce verbose output that lists
-	      # what "hidden" libraries, object files and flags are used when
-	      # linking a shared library.
-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-
-	    else
-	      # FIXME: insert proper C++ library support
-	      _LT_TAGVAR(ld_shlibs, $1)=no
-	    fi
-	    ;;
-        esac
-        ;;
-
-      psos*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      sunos4*)
-        case $cc_basename in
-          CC*)
-	    # Sun C++ 4.x
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          lcc*)
-	    # Lucid
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      solaris*)
-        case $cc_basename in
-          CC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
-	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	    case $host_os in
-	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-	      *)
-		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
-	        # Supported since Solaris 2.6 (maybe 2.5.1?)
-		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	        ;;
-	    esac
-	    _LT_TAGVAR(link_all_deplibs, $1)=yes
-
-	    output_verbose_link_cmd='echo'
-
-	    # Archives containing C++ object files must be created using
-	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	    # necessary to make sure instantiated templates are included
-	    # in the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	    ;;
-          gcx*)
-	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-	    # The C++ compiler must be used to create the archive.
-	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	    ;;
-          *)
-	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	        # platform.
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
-	        # Commands to make compiler produce verbose output that lists
-	        # what "hidden" libraries, object files and flags are used when
-	        # linking a shared library.
-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-	      fi
-
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-	      case $host_os in
-		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-		*)
-		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-		  ;;
-	      esac
-	    fi
-	    ;;
-        esac
-        ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      case $cc_basename in
-        CC*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-      esac
-      ;;
-
-      sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
-	# link with -lc, and that would cause any symbols used from libc to
-	# always be unresolved, which means just about no library would
-	# ever link correctly.  If we're not using GNU ld we use -z text
-	# though, which does catch some bad symbols but isn't as heavy-handed
-	# as -z defs.
-	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
-	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
-	_LT_TAGVAR(link_all_deplibs, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-	runpath_var='LD_RUN_PATH'
-
-	case $cc_basename in
-          CC*)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    ;;
-	  *)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    ;;
-	esac
-      ;;
-
-      tandem*)
-        case $cc_basename in
-          NCC*)
-	    # NonStop-UX NCC 3.20
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-          *)
-	    # FIXME: insert proper C++ library support
-	    _LT_TAGVAR(ld_shlibs, $1)=no
-	    ;;
-        esac
-        ;;
-
-      vxworks*)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-
-      *)
-        # FIXME: insert proper C++ library support
-        _LT_TAGVAR(ld_shlibs, $1)=no
-        ;;
-    esac
-
-    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-    _LT_TAGVAR(GCC, $1)="$GXX"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  CC=$lt_save_CC
-  LDCXX=$LD
-  LD=$lt_save_LD
-  GCC=$lt_save_GCC
-  with_gnu_ld=$lt_save_with_gnu_ld
-  lt_cv_path_LDCXX=$lt_cv_path_LD
-  lt_cv_path_LD=$lt_save_path_LD
-  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library.  It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
-      subroutine foo
-      implicit none
-      integer a
-      a=0
-      return
-      end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-_LT_EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  for p in `eval "$output_verbose_link_cmd"`; do
-    case $p in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
-	 prev=$p
-	 continue
-       else
-	 prev=
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-	   else
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
-	 else
-	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
-	 fi
-       fi
-       ;;
-
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-	   _LT_TAGVAR(predep_objects, $1)="$p"
-	 else
-	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
-	 fi
-       else
-	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-	   _LT_TAGVAR(postdep_objects, $1)="$p"
-	 else
-	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
-	 fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  _LT_TAGVAR(predep_objects,$1)=
-  _LT_TAGVAR(postdep_objects,$1)=
-  _LT_TAGVAR(postdeps,$1)=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
-    [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
-    [Dependencies to place before and after the objects being linked to
-    create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
-    [The library search path used internally by the compiler when linking
-    a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_PROG_F77
-# ------------
-# Since AC_PROG_F77 is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_F77],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
-AC_PROG_F77
-if test -z "$F77" || test "X$F77" = "Xno"; then
-  _lt_disable_F77=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_F77
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_F77], [])
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_REQUIRE([_LT_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
-  lt_save_GCC=$GCC
-  CC=${F77-"f77"}
-  compiler=$CC
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-  GCC=$G77
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test "$enable_shared" = yes && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
-	fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)="$G77"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-fi # test "$_lt_disable_F77" != yes
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_PROG_FC
-# -----------
-# Since AC_PROG_FC is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_FC],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
-AC_PROG_FC
-if test -z "$FC" || test "X$FC" = "Xno"; then
-  _lt_disable_FC=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_FC
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_FC], [])
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_REQUIRE([_LT_PROG_FC])dnl
-AC_LANG_PUSH(Fortran)
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working.  Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
-  # Code to be used in simple compile tests
-  lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-  # Code to be used in simple link tests
-  lt_simple_link_test_code="\
-      program t
-      end
-"
-
-  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-  _LT_TAG_COMPILER
-
-  # save warnings/boilerplate of simple test code
-  _LT_COMPILER_BOILERPLATE
-  _LT_LINKER_BOILERPLATE
-
-  # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
-  lt_save_GCC=$GCC
-  CC=${FC-"f95"}
-  compiler=$CC
-  GCC=$ac_cv_fc_compiler_gnu
-
-  _LT_TAGVAR(compiler, $1)=$CC
-  _LT_CC_BASENAME([$compiler])
-
-  if test -n "$compiler"; then
-    AC_MSG_CHECKING([if libtool supports shared libraries])
-    AC_MSG_RESULT([$can_build_shared])
-
-    AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
-
-    # On AIX, shared libraries and static libraries use the same namespace, and
-    # are all built from PIC.
-    case $host_os in
-      aix3*)
-        test "$enable_shared" = yes && enable_static=no
-        if test -n "$RANLIB"; then
-          archive_cmds="$archive_cmds~\$RANLIB \$lib"
-          postinstall_cmds='$RANLIB $lib'
-        fi
-        ;;
-      aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
-	fi
-        ;;
-    esac
-    AC_MSG_RESULT([$enable_shared])
-
-    AC_MSG_CHECKING([whether to build static libraries])
-    # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
-    AC_MSG_RESULT([$enable_static])
-
-    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
-    _LT_TAGVAR(LD, $1)="$LD"
-
-    ## CAVEAT EMPTOR:
-    ## There is no encapsulation within the following macros, do not change
-    ## the running order or otherwise move them around unless you know exactly
-    ## what you are doing...
-    _LT_SYS_HIDDEN_LIBDEPS($1)
-    _LT_COMPILER_PIC($1)
-    _LT_COMPILER_C_O($1)
-    _LT_COMPILER_FILE_LOCKS($1)
-    _LT_LINKER_SHLIBS($1)
-    _LT_SYS_DYNAMIC_LINKER($1)
-    _LT_LINKER_HARDCODE_LIBPATH($1)
-
-    _LT_CONFIG($1)
-  fi # test -n "$compiler"
-
-  GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-fi # test "$_lt_disable_FC" != yes
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-  _LT_COMPILER_NO_RTTI($1)
-  _LT_COMPILER_PIC($1)
-  _LT_COMPILER_C_O($1)
-  _LT_COMPILER_FILE_LOCKS($1)
-  _LT_LINKER_SHLIBS($1)
-  _LT_LINKER_HARDCODE_LIBPATH($1)
-
-  _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC="$lt_save_CC"
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
-  :
-  _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
-  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
-    [AC_CHECK_TOOL(GCJ, gcj,)
-      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-      AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
-    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
-    done
-  done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
-  fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PROG_XSI_SHELLFNS
-# ---------------------
-# Bourne and XSI compatible variants of some useful shell functions.
-m4_defun([_LT_PROG_XSI_SHELLFNS],
-[case $xsi_shell in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-  case ${1} in
-    */*) func_dirname_result="${1%/*}${2}" ;;
-    *  ) func_dirname_result="${3}" ;;
-  esac
-  func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-  # positional parameters, so assign one to ordinary parameter first.
-  func_stripname_result=${3}
-  func_stripname_result=${func_stripname_result#"${1}"}
-  func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=${1%%=*}
-  func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  case ${1} in
-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-    *)    func_lo2o_result=${1} ;;
-  esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=$(( $[*] ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=${#1}
-}
-
-_LT_EOF
-    ;;
-  *) # Bourne compatible functions.
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-  # Extract subdirectory from the argument.
-  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
-  if test "X$func_dirname_result" = "X${1}"; then
-    func_dirname_result="${3}"
-  else
-    func_dirname_result="$func_dirname_result${2}"
-  fi
-}
-
-# func_basename file
-func_basename ()
-{
-  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
-
-dnl func_dirname_and_basename
-dnl A portable version of this function is already defined in general.m4sh
-dnl so there is no need for it here.
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-  case ${2} in
-    .*) func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
-    *)  func_stripname_result=`$ECHO "X${3}" \
-           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
-  esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[[^=]]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
-  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
-  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
-  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
-  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
-  func_arith_result=`expr "$[@]"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
-  yes)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$[1]+=\$[2]"
-}
-_LT_EOF
-    ;;
-  *)
-    cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
-  eval "$[1]=\$$[1]\$[2]"
-}
-
-_LT_EOF
-    ;;
-  esac
-])
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
deleted file mode 100644
index 34151a3..0000000
--- a/m4/ltoptions.m4
+++ /dev/null
@@ -1,368 +0,0 @@
-# Helper functions for option handling.                    -*- Autoconf -*-
-#
-#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-#   Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
-        _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
-		      [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME.  If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
-    [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
-  dnl
-  dnl Simply set some default values (i.e off) if boolean options were not
-  dnl specified:
-  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
-  ])
-  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
-  ])
-  dnl
-  dnl If no reference was made to various pairs of opposing options, then
-  dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
-  dnl archives by default:
-  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
-  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
-  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-  		   [_LT_ENABLE_FAST_INSTALL])
-  ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## Macros to handle LT_INIT options. ##
-## --------------------------------- ##
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS],      [0], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
-    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
-    _LT_DECL([build_libtool_libs], [enable_shared], [0],
-	[Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
-    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
-    _LT_DECL([build_old_libs], [enable_static], [0],
-	[Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
-    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
-	 [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
-    [AS_HELP_STRING([--with-pic],
-	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-## ----------------- ##
-## LTDL_INIT Options ##
-## ----------------- ##
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
-		 [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
-		 [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
-		 [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
-		 [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
-		 [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
deleted file mode 100644
index 9000a05..0000000
--- a/m4/ltsugar.m4
+++ /dev/null
@@ -1,123 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
-       [$#], [2], [[$2]],
-       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
-       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
-       [$#], 1, [],
-       [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
-	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
-       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
-	     [m4_foreach([_Lt_suffix],
-		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
-	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
-	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
-		 [lt_append([$1], [$2], [$3])$4],
-		 [$5])],
-	  [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
-	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
-    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
-	[$5],
-    [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
-  [lt_join(m4_quote(m4_default([$4], [[, ]])),
-           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
-		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
deleted file mode 100644
index f3c5309..0000000
--- a/m4/ltversion.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers			-*- Autoconf -*-
-#
-#   Copyright (C) 2004 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# Generated from ltversion.in.
-
-# serial 3017 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.2.6b])
-m4_define([LT_PACKAGE_REVISION], [1.3017])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.6b'
-macro_revision='1.3017'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
deleted file mode 100644
index 637bb20..0000000
--- a/m4/lt~obsolete.m4
+++ /dev/null
@@ -1,92 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
-#
-#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
-#   Written by Scott James Remnant, 2004.
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-
-# serial 4 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else.  This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
diff --git a/missing b/missing
deleted file mode 100755
index 28055d2..0000000
--- a/missing
+++ /dev/null
@@ -1,376 +0,0 @@
-#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
-
-scriptversion=2009-04-28.21; # UTC
-
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
-
-# 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, 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, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
-  echo 1>&2 "Try \`$0 --help' for more information"
-  exit 1
-fi
-
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
-  configure_ac=configure.ac
-else
-  configure_ac=configure.in
-fi
-
-msg="missing on your system"
-
-case $1 in
---run)
-  # Try to run requested program, and just exit if it succeeds.
-  run=
-  shift
-  "$@" && exit 0
-  # Exit code 63 means version mismatch.  This often happens
-  # when the user try to use an ancient version of a tool on
-  # a file that requires a minimum version.  In this case we
-  # we should proceed has if the program had been absent, or
-  # if --run hadn't been passed.
-  if test $? = 63; then
-    run=:
-    msg="probably too old"
-  fi
-  ;;
-
-  -h|--h|--he|--hel|--help)
-    echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
-  -h, --help      display this help and exit
-  -v, --version   output version information and exit
-  --run           try to run the given command, and emulate it if it fails
-
-Supported PROGRAM values:
-  aclocal      touch file \`aclocal.m4'
-  autoconf     touch file \`configure'
-  autoheader   touch file \`config.h.in'
-  autom4te     touch the output file, or create a stub one
-  automake     touch all \`Makefile.in' files
-  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
-  flex         create \`lex.yy.c', if possible, from existing .c
-  help2man     touch the output file
-  lex          create \`lex.yy.c', if possible, from existing .c
-  makeinfo     touch the output file
-  tar          try tar, gnutar, gtar, then tar without non-portable flags
-  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
-
-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
-\`g' are ignored when checking the name.
-
-Send bug reports to <bug-automake at gnu.org>."
-    exit $?
-    ;;
-
-  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
-    echo "missing $scriptversion (GNU Automake)"
-    exit $?
-    ;;
-
-  -*)
-    echo 1>&2 "$0: Unknown \`$1' option"
-    echo 1>&2 "Try \`$0 --help' for more information"
-    exit 1
-    ;;
-
-esac
-
-# normalize program name to check for.
-program=`echo "$1" | sed '
-  s/^gnu-//; t
-  s/^gnu//; t
-  s/^g//; t'`
-
-# Now exit if we have it, but it failed.  Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).  This is about non-GNU programs, so use $1 not
-# $program.
-case $1 in
-  lex*|yacc*)
-    # Not GNU programs, they don't have --version.
-    ;;
-
-  tar*)
-    if test -n "$run"; then
-       echo 1>&2 "ERROR: \`tar' requires --run"
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       exit 1
-    fi
-    ;;
-
-  *)
-    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
-       # We have it, but it failed.
-       exit 1
-    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
-       # Could not run --version or --help.  This is probably someone
-       # running `$TOOL --version' or `$TOOL --help' to check whether
-       # $TOOL exists and not knowing $TOOL uses missing.
-       exit 1
-    fi
-    ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $program in
-  aclocal*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
-         to install the \`Automake' and \`Perl' packages.  Grab them from
-         any GNU archive site."
-    touch aclocal.m4
-    ;;
-
-  autoconf*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`${configure_ac}'.  You might want to install the
-         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
-         archive site."
-    touch configure
-    ;;
-
-  autoheader*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
-         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
-         from any GNU archive site."
-    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
-    test -z "$files" && files="config.h"
-    touch_files=
-    for f in $files; do
-      case $f in
-      *:*) touch_files="$touch_files "`echo "$f" |
-				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
-      *) touch_files="$touch_files $f.in";;
-      esac
-    done
-    touch $touch_files
-    ;;
-
-  automake*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
-         You might want to install the \`Automake' and \`Perl' packages.
-         Grab them from any GNU archive site."
-    find . -type f -name Makefile.am -print |
-	   sed 's/\.am$/.in/' |
-	   while read f; do touch "$f"; done
-    ;;
-
-  autom4te*)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.
-         You can get \`$1' as part of \`Autoconf' from any GNU
-         archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-	touch $file
-    else
-	test -z "$file" || exec >$file
-	echo "#! /bin/sh"
-	echo "# Created by GNU Automake missing as a replacement of"
-	echo "#  $ $@"
-	echo "exit 0"
-	chmod +x $file
-	exit 1
-    fi
-    ;;
-
-  bison*|yacc*)
-    echo 1>&2 "\
-WARNING: \`$1' $msg.  You should only need it if
-         you modified a \`.y' file.  You may need the \`Bison' package
-         in order for those modifications to take effect.  You can get
-         \`Bison' from any GNU archive site."
-    rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
-        eval LASTARG="\${$#}"
-	case $LASTARG in
-	*.y)
-	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" y.tab.c
-	    fi
-	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" y.tab.h
-	    fi
-	  ;;
-	esac
-    fi
-    if test ! -f y.tab.h; then
-	echo >y.tab.h
-    fi
-    if test ! -f y.tab.c; then
-	echo 'main() { return 0; }' >y.tab.c
-    fi
-    ;;
-
-  lex*|flex*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.l' file.  You may need the \`Flex' package
-         in order for those modifications to take effect.  You can get
-         \`Flex' from any GNU archive site."
-    rm -f lex.yy.c
-    if test $# -ne 1; then
-        eval LASTARG="\${$#}"
-	case $LASTARG in
-	*.l)
-	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if test -f "$SRCFILE"; then
-	         cp "$SRCFILE" lex.yy.c
-	    fi
-	  ;;
-	esac
-    fi
-    if test ! -f lex.yy.c; then
-	echo 'main() { return 0; }' >lex.yy.c
-    fi
-    ;;
-
-  help2man*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-	 you modified a dependency of a manual page.  You may need the
-	 \`Help2man' package in order for those modifications to take
-	 effect.  You can get \`Help2man' from any GNU archive site."
-
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
-	touch $file
-    else
-	test -z "$file" || exec >$file
-	echo ".ab help2man is required to generate this page"
-	exit $?
-    fi
-    ;;
-
-  makeinfo*)
-    echo 1>&2 "\
-WARNING: \`$1' is $msg.  You should only need it if
-         you modified a \`.texi' or \`.texinfo' file, or any other file
-         indirectly affecting the aspect of the manual.  The spurious
-         call might also be the consequence of using a buggy \`make' (AIX,
-         DU, IRIX).  You might want to install the \`Texinfo' package or
-         the \`GNU make' package.  Grab either from any GNU archive site."
-    # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -z "$file"; then
-      # ... or it is the one specified with @setfilename ...
-      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-	/^@setfilename/{
-	  s/.* \([^ ]*\) *$/\1/
-	  p
-	  q
-	}' $infile`
-      # ... or it is derived from the source name (dir/f.texi becomes f.info)
-      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
-    fi
-    # If the file does not exist, the user really needs makeinfo;
-    # let's fail without touching anything.
-    test -f $file || exit 1
-    touch $file
-    ;;
-
-  tar*)
-    shift
-
-    # We have already tried tar in the generic part.
-    # Look for gnutar/gtar before invocation to avoid ugly error
-    # messages.
-    if (gnutar --version > /dev/null 2>&1); then
-       gnutar "$@" && exit 0
-    fi
-    if (gtar --version > /dev/null 2>&1); then
-       gtar "$@" && exit 0
-    fi
-    firstarg="$1"
-    if shift; then
-	case $firstarg in
-	*o*)
-	    firstarg=`echo "$firstarg" | sed s/o//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-	case $firstarg in
-	*h*)
-	    firstarg=`echo "$firstarg" | sed s/h//`
-	    tar "$firstarg" "$@" && exit 0
-	    ;;
-	esac
-    fi
-
-    echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
-         You may want to install GNU tar or Free paxutils, or check the
-         command line arguments."
-    exit 1
-    ;;
-
-  *)
-    echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
-         You might have modified some files without having the
-         proper tools for further handling them.  Check the \`README' file,
-         it often tells you about the needed prerequisites for installing
-         this package.  You may also peek at any GNU archive site, in case
-         some other package would contain this missing \`$1' program."
-    exit 1
-    ;;
-esac
-
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/nsis/header.bmp b/nsis/header.bmp
new file mode 100644
index 0000000..b59a2b7
Binary files /dev/null and b/nsis/header.bmp differ
diff --git a/nsis/welcome-page.bmp b/nsis/welcome-page.bmp
new file mode 100644
index 0000000..f00c14e
Binary files /dev/null and b/nsis/welcome-page.bmp differ
diff --git a/setup/Makefile.am b/setup/Makefile.am
deleted file mode 100644
index 589e1a2..0000000
--- a/setup/Makefile.am
+++ /dev/null
@@ -1,60 +0,0 @@
-AUTOMAKE_OPTIONS = foreign
-
-INCLUDES = -I$(srcdir)/../lib/include -Isrc
-
-noinst_PROGRAMS = setup
-
-
-%.moc: $(srcdir)/%.h
-	$(MOC) -o $@ $<
-
-%.uic: %.ui
-	$(UIC) -o $@ $<
-
-setup_MOC =	./src/dialogs.moc
-setup_UIC =	./dialogs/wizard.uic			\
-		./dialogs/page_welcome.uic		\
-		./dialogs/page_security_options.uic	\
-		./dialogs/page_setup_finished.uic	\
-		./dialogs/page_key_dirs.uic
-
-BUILT_SOURCES = $(setup_MOC) $(setup_UIC) ./setup_qrc.cpp
-
-
-
-./setup_qrc.cpp: setup.qrc
-	$(RCC) $< > $@
-
-
-setup_SOURCES = $(srcdir)/src/main.cpp				\
-		$(srcdir)/src/dialogs.cpp			\
-		$(srcdir)/src/dialogs.h				\
-		$(srcdir)/setup_qrc.cpp				\
-		$(srcdir)/setup.qrc				\
-		$(wildcard $(srcdir)/dialogs/*.ui)		\
-		$(wildcard $(srcdir)/resources/*.png)
-
-EXTRA_DIST =	setup.ico
-
-CLEANFILES = $(setup_MOC) $(setup_UIC) ./setup_qrc.cpp
-
-
-if HAVE_LIBSSL
-LIBSSL_LDADD = -lssl -lcrypto
-endif
-
-if HAVE_LIBEAY32
-LIBSSL_LDADD = -leay32
-endif
-
-if BUILD_WIN32
-setup_win_resources.o: setup.rc
-	$(WINDRES) -o $@ $<
-PLATFORM_LDADD = setup_win_resources.o
-endif
-
-setup_LDADD = $(PLATFORM_LDADD) -L../lib/ -litalc_core $(QT_LDADD) $(QT_LIB_GUI) $(LIBSSL_LDADD) -ljpeg
-setup_LDFLAGS = $(LDFLAGS) -mwindows
-
-AM_CXXFLAGS = $(QT_CXXFLAGS)
-
diff --git a/setup/Makefile.in b/setup/Makefile.in
deleted file mode 100644
index fac04ff..0000000
--- a/setup/Makefile.in
+++ /dev/null
@@ -1,593 +0,0 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
-# Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
- at SET_MAKE@
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-noinst_PROGRAMS = setup$(EXEEXT)
-subdir = setup
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-	$(srcdir)/setup.rc.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
-	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
-	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
-	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
-	$(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = setup.rc
-CONFIG_CLEAN_VPATH_FILES =
-PROGRAMS = $(noinst_PROGRAMS)
-am_setup_OBJECTS = main.$(OBJEXT) dialogs.$(OBJEXT) \
-	setup_qrc.$(OBJEXT)
-setup_OBJECTS = $(am_setup_OBJECTS)
-am__DEPENDENCIES_1 =
-setup_DEPENDENCIES = $(PLATFORM_LDADD) $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-setup_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
-	$(setup_LDFLAGS) $(LDFLAGS) -o $@
-DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-CXXLD = $(CXX)
-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
-	$(LDFLAGS) -o $@
-SOURCES = $(setup_SOURCES)
-DIST_SOURCES = $(setup_SOURCES)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LRELEASE = @LRELEASE@
-LTLIBOBJS = @LTLIBOBJS@
-LUPDATE = @LUPDATE@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-MOC = @MOC@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-QT_CXXFLAGS = @QT_CXXFLAGS@
-QT_LDADD = @QT_LDADD@
-QT_LIB_GUI = @QT_LIB_GUI@
-RANLIB = @RANLIB@
-RCC = @RCC@
-RPMSOURCEDIR = @RPMSOURCEDIR@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-UIC = @UIC@
-VERSION = @VERSION@
-WINDRES = @WINDRES@
-XMKMF = @XMKMF@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign
-INCLUDES = -I$(srcdir)/../lib/include -Isrc
-setup_MOC = ./src/dialogs.moc
-setup_UIC = ./dialogs/wizard.uic			\
-		./dialogs/page_welcome.uic		\
-		./dialogs/page_security_options.uic	\
-		./dialogs/page_setup_finished.uic	\
-		./dialogs/page_key_dirs.uic
-
-BUILT_SOURCES = $(setup_MOC) $(setup_UIC) ./setup_qrc.cpp
-setup_SOURCES = $(srcdir)/src/main.cpp				\
-		$(srcdir)/src/dialogs.cpp			\
-		$(srcdir)/src/dialogs.h				\
-		$(srcdir)/setup_qrc.cpp				\
-		$(srcdir)/setup.qrc				\
-		$(wildcard $(srcdir)/dialogs/*.ui)		\
-		$(wildcard $(srcdir)/resources/*.png)
-
-EXTRA_DIST = setup.ico
-CLEANFILES = $(setup_MOC) $(setup_UIC) ./setup_qrc.cpp
- at HAVE_LIBEAY32_TRUE@LIBSSL_LDADD = -leay32
- at HAVE_LIBSSL_TRUE@LIBSSL_LDADD = -lssl -lcrypto
- at BUILD_WIN32_TRUE@PLATFORM_LDADD = setup_win_resources.o
-setup_LDADD = $(PLATFORM_LDADD) -L../lib/ -litalc_core $(QT_LDADD) $(QT_LIB_GUI) $(LIBSSL_LDADD) -ljpeg
-setup_LDFLAGS = $(LDFLAGS) -mwindows
-AM_CXXFLAGS = $(QT_CXXFLAGS)
-all: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) all-am
-
-.SUFFIXES:
-.SUFFIXES: .cpp .lo .o .obj
-$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
-	@for dep in $?; do \
-	  case '$(am__configure_deps)' in \
-	    *$$dep*) \
-	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
-	        && { if test -f $@; then exit 0; else break; fi; }; \
-	      exit 1;; \
-	  esac; \
-	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign setup/Makefile'; \
-	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign setup/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-setup.rc: $(top_builddir)/config.status $(srcdir)/setup.rc.in
-	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-
-clean-noinstPROGRAMS:
-	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
-	echo " rm -f" $$list; \
-	rm -f $$list || exit $$?; \
-	test -n "$(EXEEXT)" || exit 0; \
-	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
-	echo " rm -f" $$list; \
-	rm -f $$list
-setup$(EXEEXT): $(setup_OBJECTS) $(setup_DEPENDENCIES) 
-	@rm -f setup$(EXEEXT)
-	$(setup_LINK) $(setup_OBJECTS) $(setup_LDADD) $(LIBS)
-
-mostlyclean-compile:
-	-rm -f *.$(OBJEXT)
-
-distclean-compile:
-	-rm -f *.tab.c
-
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dialogs.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/setup_qrc.Po at am__quote@
-
-.cpp.o:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
-
-.cpp.obj:
- at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cpp.lo:
- at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
-
-main.o: $(srcdir)/src/main.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT main.o -MD -MP -MF $(DEPDIR)/main.Tpo -c -o main.o `test -f '$(srcdir)/src/main.cpp' || echo '$(srcdir)/'`$(srcdir)/src/main.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/main.Tpo $(DEPDIR)/main.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/main.cpp' object='main.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o main.o `test -f '$(srcdir)/src/main.cpp' || echo '$(srcdir)/'`$(srcdir)/src/main.cpp
-
-main.obj: $(srcdir)/src/main.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT main.obj -MD -MP -MF $(DEPDIR)/main.Tpo -c -o main.obj `if test -f '$(srcdir)/src/main.cpp'; then $(CYGPATH_W) '$(srcdir)/src/main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/main.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/main.Tpo $(DEPDIR)/main.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/main.cpp' object='main.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o main.obj `if test -f '$(srcdir)/src/main.cpp'; then $(CYGPATH_W) '$(srcdir)/src/main.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/main.cpp'; fi`
-
-dialogs.o: $(srcdir)/src/dialogs.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dialogs.o -MD -MP -MF $(DEPDIR)/dialogs.Tpo -c -o dialogs.o `test -f '$(srcdir)/src/dialogs.cpp' || echo '$(srcdir)/'`$(srcdir)/src/dialogs.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dialogs.Tpo $(DEPDIR)/dialogs.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/dialogs.cpp' object='dialogs.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dialogs.o `test -f '$(srcdir)/src/dialogs.cpp' || echo '$(srcdir)/'`$(srcdir)/src/dialogs.cpp
-
-dialogs.obj: $(srcdir)/src/dialogs.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dialogs.obj -MD -MP -MF $(DEPDIR)/dialogs.Tpo -c -o dialogs.obj `if test -f '$(srcdir)/src/dialogs.cpp'; then $(CYGPATH_W) '$(srcdir)/src/dialogs.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/dialogs.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/dialogs.Tpo $(DEPDIR)/dialogs.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/src/dialogs.cpp' object='dialogs.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dialogs.obj `if test -f '$(srcdir)/src/dialogs.cpp'; then $(CYGPATH_W) '$(srcdir)/src/dialogs.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/src/dialogs.cpp'; fi`
-
-setup_qrc.o: $(srcdir)/setup_qrc.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT setup_qrc.o -MD -MP -MF $(DEPDIR)/setup_qrc.Tpo -c -o setup_qrc.o `test -f '$(srcdir)/setup_qrc.cpp' || echo '$(srcdir)/'`$(srcdir)/setup_qrc.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/setup_qrc.Tpo $(DEPDIR)/setup_qrc.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/setup_qrc.cpp' object='setup_qrc.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o setup_qrc.o `test -f '$(srcdir)/setup_qrc.cpp' || echo '$(srcdir)/'`$(srcdir)/setup_qrc.cpp
-
-setup_qrc.obj: $(srcdir)/setup_qrc.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT setup_qrc.obj -MD -MP -MF $(DEPDIR)/setup_qrc.Tpo -c -o setup_qrc.obj `if test -f '$(srcdir)/setup_qrc.cpp'; then $(CYGPATH_W) '$(srcdir)/setup_qrc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/setup_qrc.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/setup_qrc.Tpo $(DEPDIR)/setup_qrc.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(srcdir)/setup_qrc.cpp' object='setup_qrc.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o setup_qrc.obj `if test -f '$(srcdir)/setup_qrc.cpp'; then $(CYGPATH_W) '$(srcdir)/setup_qrc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/setup_qrc.cpp'; fi`
-
-mostlyclean-libtool:
-	-rm -f *.lo
-
-clean-libtool:
-	-rm -rf .libs _libs
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	mkid -fID $$unique
-tags: TAGS
-
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	set x; \
-	here=`pwd`; \
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	shift; \
-	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
-	  test -n "$$unique" || unique=$$empty_fix; \
-	  if test $$# -gt 0; then \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      "$$@" $$unique; \
-	  else \
-	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	      $$unique; \
-	  fi; \
-	fi
-ctags: CTAGS
-CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
-		$(TAGS_FILES) $(LISP)
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
-	unique=`for i in $$list; do \
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
-	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
-	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$unique" \
-	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$unique
-
-GTAGS:
-	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && $(am__cd) $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) "$$here"
-
-distclean-tags:
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
-	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
-	list='$(DISTFILES)'; \
-	  dist_files=`for file in $$list; do echo $$file; done | \
-	  sed -e "s|^$$srcdirstrip/||;t" \
-	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
-	case $$dist_files in \
-	  */*) $(MKDIR_P) `echo "$$dist_files" | \
-			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
-			   sort -u` ;; \
-	esac; \
-	for file in $$dist_files; do \
-	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
-	  if test -d $$d/$$file; then \
-	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
-	    if test -d "$(distdir)/$$file"; then \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
-	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
-	    fi; \
-	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
-	  else \
-	    test -f "$(distdir)/$$file" \
-	    || cp -p $$d/$$file "$(distdir)/$$file" \
-	    || exit 1; \
-	  fi; \
-	done
-check-am: all-am
-check: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(PROGRAMS)
-installdirs:
-install: $(BUILT_SOURCES)
-	$(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
-	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
-	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	  `test -z '$(STRIP)' || \
-	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
-	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
-	@echo "This command is intended for maintainers to use"
-	@echo "it deletes files that may require special tools to rebuild."
-	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
-	mostlyclean-am
-
-distclean: distclean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
-	distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-	-rm -rf ./$(DEPDIR)
-	-rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
-	mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: all check install install-am install-strip
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-libtool clean-noinstPROGRAMS ctags distclean \
-	distclean-compile distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
-	pdf pdf-am ps ps-am tags uninstall uninstall-am
-
-
-%.moc: $(srcdir)/%.h
-	$(MOC) -o $@ $<
-
-%.uic: %.ui
-	$(UIC) -o $@ $<
-
-./setup_qrc.cpp: setup.qrc
-	$(RCC) $< > $@
-
- at BUILD_WIN32_TRUE@setup_win_resources.o: setup.rc
- at BUILD_WIN32_TRUE@	$(WINDRES) -o $@ $<
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/setup/dialogs/page_key_dirs.ui b/setup/dialogs/page_key_dirs.ui
deleted file mode 100644
index 070ffb0..0000000
--- a/setup/dialogs/page_key_dirs.ui
+++ /dev/null
@@ -1,359 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>pageKeyDirs</class>
- <widget class="QWidget" name="pageKeyDirs">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>595</width>
-    <height>403</height>
-   </rect>
-  </property>
-  <layout class="QHBoxLayout" name="_2">
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QLabel" name="label">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>252</red>
-           <green>252</green>
-           <blue>252</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
-     <property name="pixmap">
-      <pixmap resource="../setup.qrc">:/resources/page_security_options.png</pixmap>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QVBoxLayout">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <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>Key directories</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_3">
-       <property name="text">
-        <string>The newly created or imported key(s) need to be installed somewhere. It's recommended to leave the suggested directories.</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </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>387</width>
-         <height>16</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_5">
-       <property name="text">
-        <string>Directory to store public key in</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <layout class="QHBoxLayout">
-       <property name="spacing">
-        <number>6</number>
-       </property>
-       <property name="margin">
-        <number>4</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>40</width>
-           <height>21</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QLineEdit" name="pubKeyDirLineEdit"/>
-       </item>
-       <item>
-        <widget class="QPushButton" name="openPubKeyDirButton">
-         <property name="icon">
-          <iconset resource="../setup.qrc">
-           <normaloff>:/resources/fileopen.png</normaloff>:/resources/fileopen.png</iconset>
-         </property>
-         <property name="iconSize">
-          <size>
-           <width>22</width>
-           <height>22</height>
-          </size>
-         </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>387</width>
-         <height>16</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QWidget" name="newKeyDirWidgets" native="true">
-       <layout class="QVBoxLayout">
-        <property name="spacing">
-         <number>6</number>
-        </property>
-        <property name="margin">
-         <number>0</number>
-        </property>
-        <item>
-         <widget class="QLabel" name="label_8">
-          <property name="text">
-           <string>Directory to store private key in</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <layout class="QHBoxLayout">
-          <property name="spacing">
-           <number>6</number>
-          </property>
-          <property name="margin">
-           <number>4</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>40</width>
-              <height>21</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-          <item>
-           <widget class="QLineEdit" name="privKeyDirLineEdit"/>
-          </item>
-          <item>
-           <widget class="QPushButton" name="openPrivKeyDirButton">
-            <property name="icon">
-             <iconset resource="../setup.qrc">
-              <normaloff>:/resources/fileopen.png</normaloff>:/resources/fileopen.png</iconset>
-            </property>
-            <property name="iconSize">
-             <size>
-              <width>22</width>
-              <height>22</height>
-             </size>
-            </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>387</width>
-            <height>16</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-        <item>
-         <widget class="QLabel" name="label_9">
-          <property name="text">
-           <string>You can choose a directory in which to export the public key, e.g. an USB drive or a network share.</string>
-          </property>
-          <property name="wordWrap">
-           <bool>true</bool>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <layout class="QHBoxLayout">
-          <property name="spacing">
-           <number>6</number>
-          </property>
-          <property name="margin">
-           <number>5</number>
-          </property>
-          <item>
-           <widget class="QLabel" name="label_4">
-            <property name="pixmap">
-             <pixmap resource="../setup.qrc">:/resources/usbdrive.png</pixmap>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QLineEdit" name="keyExportDirLineEdit"/>
-          </item>
-          <item>
-           <widget class="QPushButton" name="openExportKeyDirButton">
-            <property name="icon">
-             <iconset resource="../setup.qrc">
-              <normaloff>:/resources/fileopen.png</normaloff>:/resources/fileopen.png</iconset>
-            </property>
-            <property name="iconSize">
-             <size>
-              <width>22</width>
-              <height>22</height>
-             </size>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </item>
-       </layout>
-      </widget>
-     </item>
-     <item>
-      <widget class="QCheckBox" name="checkBox">
-       <property name="text">
-        <string>Export private key too</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer>
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>387</width>
-         <height>16</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../setup.qrc"/>
-  <include location="../../../../../.designer/setup.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/setup/dialogs/page_security_options.ui b/setup/dialogs/page_security_options.ui
deleted file mode 100644
index a5499d0..0000000
--- a/setup/dialogs/page_security_options.ui
+++ /dev/null
@@ -1,286 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>pageSecurityOptions</class>
- <widget class="QWidget" name="pageSecurityOptions">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>604</width>
-    <height>383</height>
-   </rect>
-  </property>
-  <layout class="QHBoxLayout" name="_2">
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QLabel" name="label">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>252</red>
-           <green>252</green>
-           <blue>252</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
-     <property name="pixmap">
-      <pixmap resource="../setup.qrc">:/resources/page_security_options.png</pixmap>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Minimum</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>300</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item>
-    <layout class="QVBoxLayout" name="_3">
-     <property name="spacing">
-      <number>16</number>
-     </property>
-     <property name="margin">
-      <number>0</number>
-     </property>
-     <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>Security options</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_3">
-       <property name="text">
-        <string>iTALC has a sophisticated security-concept for preventing unauthorized access to computers having the iTALC client software installed.
-
-Therefore you either have to create a new key pair or import the public key created during the iTALC installation on the master computer.</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QRadioButton" name="createKeysRadioButton">
-       <property name="text">
-        <string>Create a new key pair (only on master computer)</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QRadioButton" name="importKeysRadioButton">
-       <property name="text">
-        <string>Import public key of master computer</string>
-       </property>
-       <property name="checked">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QWidget" name="widget" native="true">
-       <layout class="QHBoxLayout">
-        <property name="spacing">
-         <number>6</number>
-        </property>
-        <property name="margin">
-         <number>9</number>
-        </property>
-        <item>
-         <widget class="QLabel" name="usbPenLabel">
-          <property name="pixmap">
-           <pixmap resource="../setup.qrc">:/resources/usbdrive.png</pixmap>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <layout class="QVBoxLayout">
-          <property name="spacing">
-           <number>6</number>
-          </property>
-          <property name="margin">
-           <number>0</number>
-          </property>
-          <item>
-           <widget class="QLabel" name="pubKeyDirLabel">
-            <property name="text">
-             <string>Choose location of exported public key:</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <layout class="QHBoxLayout">
-            <property name="spacing">
-             <number>6</number>
-            </property>
-            <property name="margin">
-             <number>0</number>
-            </property>
-            <item>
-             <widget class="QLineEdit" name="keyImportDirLineEdit"/>
-            </item>
-            <item>
-             <widget class="QPushButton" name="openDirButton">
-              <property name="icon">
-               <iconset resource="../setup.qrc">
-                <normaloff>:/resources/fileopen.png</normaloff>:/resources/fileopen.png</iconset>
-              </property>
-              <property name="iconSize">
-               <size>
-                <width>22</width>
-                <height>22</height>
-               </size>
-              </property>
-             </widget>
-            </item>
-           </layout>
-          </item>
-         </layout>
-        </item>
-       </layout>
-      </widget>
-     </item>
-     <item>
-      <widget class="QRadioButton" name="keepKeysRadioButton">
-       <property name="text">
-        <string>Keep all keys (only when updating existing installation!)</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer>
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>0</width>
-         <height>0</height>
-        </size>
-       </property>
-      </spacer>
-     </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>0</width>
-         <height>0</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../setup.qrc"/>
-  <include location="../../../../../.designer/setup.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>importKeysRadioButton</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>widget</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>403</x>
-     <y>219</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>281</x>
-     <y>49</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/setup/dialogs/page_setup_finished.ui b/setup/dialogs/page_setup_finished.ui
deleted file mode 100644
index f85918f..0000000
--- a/setup/dialogs/page_setup_finished.ui
+++ /dev/null
@@ -1,166 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>pageFinished</class>
- <widget class="QWidget" name="pageFinished">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>550</width>
-    <height>430</height>
-   </rect>
-  </property>
-  <layout class="QHBoxLayout">
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QLabel" name="label">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>252</red>
-           <green>252</green>
-           <blue>252</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
-     <property name="frameShape">
-      <enum>QFrame::NoFrame</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Plain</enum>
-     </property>
-     <property name="pixmap">
-      <pixmap resource="../setup.qrc">:/resources/page_setup_finished.png</pixmap>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QVBoxLayout" name="_2">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <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>iTALC is now ready to run!</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_3">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string>iTALC is now completely installed and set up. If you installed the master application you can start it now.</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QCheckBox" name="saveInstallSettings">
-       <property name="text">
-        <string>Save key setup settings</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="spacer">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeType">
-        <enum>QSizePolicy::Expanding</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>0</width>
-         <height>0</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../setup.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/setup/dialogs/page_welcome.ui b/setup/dialogs/page_welcome.ui
deleted file mode 100644
index 792650a..0000000
--- a/setup/dialogs/page_welcome.ui
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>pageWelcome</class>
- <widget class="QWidget" name="pageWelcome">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>670</width>
-    <height>250</height>
-   </rect>
-  </property>
-  <layout class="QHBoxLayout" name="_2">
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <property name="margin">
-    <number>0</number>
-   </property>
-   <item>
-    <widget class="QLabel" name="label">
-     <property name="palette">
-      <palette>
-       <active>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </active>
-       <inactive>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>252</red>
-           <green>252</green>
-           <blue>252</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </inactive>
-       <disabled>
-        <colorrole role="Base">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-        <colorrole role="Window">
-         <brush brushstyle="SolidPattern">
-          <color alpha="255">
-           <red>255</red>
-           <green>255</green>
-           <blue>255</blue>
-          </color>
-         </brush>
-        </colorrole>
-       </disabled>
-      </palette>
-     </property>
-     <property name="autoFillBackground">
-      <bool>true</bool>
-     </property>
-     <property name="frameShape">
-      <enum>QFrame::NoFrame</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Plain</enum>
-     </property>
-     <property name="pixmap">
-      <pixmap resource="../setup.qrc">:/resources/page_artwork_welcome.png</pixmap>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QVBoxLayout" name="_3">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <property name="leftMargin">
-      <number>0</number>
-     </property>
-     <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>Welcome to iTALC</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLabel" name="label_3">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text">
-        <string>This tool will guide you through the process of setting up authentication keys for your iTALC environment.
-
-Click 'Next' to continue.</string>
-       </property>
-       <property name="wordWrap">
-        <bool>true</bool>
-       </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>0</width>
-         <height>0</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../setup.qrc"/>
-  <include location="../../../../../.designer/setup.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/setup/dialogs/wizard.ui b/setup/dialogs/wizard.ui
deleted file mode 100644
index c99aa80..0000000
--- a/setup/dialogs/wizard.ui
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>wizard</class>
- <widget class="QDialog" name="wizard">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>400</width>
-    <height>300</height>
-   </rect>
-  </property>
-  <property name="sizePolicy">
-   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-    <horstretch>0</horstretch>
-    <verstretch>0</verstretch>
-   </sizepolicy>
-  </property>
-  <property name="windowTitle">
-   <string>iTALC setup tool</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../setup.qrc">
-    <normaloff>:/resources/setup.png</normaloff>:/resources/setup.png</iconset>
-  </property>
-  <layout class="QVBoxLayout" name="_2">
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <item>
-    <widget class="QWidget" name="contentWidget" native="true"/>
-   </item>
-   <item>
-    <widget class="Line" name="line">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-    </widget>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" name="_3">
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <item>
-      <spacer>
-       <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>
-      <widget class="QPushButton" name="cancelButton">
-       <property name="text">
-        <string>Cancel</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../setup.qrc">
-         <normaloff>:/resources/cancel.png</normaloff>:/resources/cancel.png</iconset>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="backButton">
-       <property name="text">
-        <string>Back</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../setup.qrc">
-         <normaloff>:/resources/back.png</normaloff>:/resources/back.png</iconset>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QPushButton" name="nextButton">
-       <property name="text">
-        <string>Next</string>
-       </property>
-       <property name="icon">
-        <iconset resource="../setup.qrc">
-         <normaloff>:/resources/next.png</normaloff>:/resources/next.png</iconset>
-       </property>
-       <property name="default">
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="../setup.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>cancelButton</sender>
-   <signal>clicked()</signal>
-   <receiver>wizard</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>308</x>
-     <y>274</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>298</x>
-     <y>169</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/setup/resources/back.png b/setup/resources/back.png
deleted file mode 100644
index b04d922..0000000
Binary files a/setup/resources/back.png and /dev/null differ
diff --git a/setup/resources/cancel.png b/setup/resources/cancel.png
deleted file mode 100644
index e9920bf..0000000
Binary files a/setup/resources/cancel.png and /dev/null differ
diff --git a/setup/resources/fileopen.png b/setup/resources/fileopen.png
deleted file mode 100644
index a79982e..0000000
Binary files a/setup/resources/fileopen.png and /dev/null differ
diff --git a/setup/resources/next.png b/setup/resources/next.png
deleted file mode 100644
index df6f06b..0000000
Binary files a/setup/resources/next.png and /dev/null differ
diff --git a/setup/resources/page_artwork_welcome.png b/setup/resources/page_artwork_welcome.png
deleted file mode 100644
index 87f474e..0000000
Binary files a/setup/resources/page_artwork_welcome.png and /dev/null differ
diff --git a/setup/resources/page_security_options.png b/setup/resources/page_security_options.png
deleted file mode 100644
index 0e12e8f..0000000
Binary files a/setup/resources/page_security_options.png and /dev/null differ
diff --git a/setup/resources/page_setup_finished.png b/setup/resources/page_setup_finished.png
deleted file mode 100644
index 44ce558..0000000
Binary files a/setup/resources/page_setup_finished.png and /dev/null differ
diff --git a/setup/resources/setup.png b/setup/resources/setup.png
deleted file mode 100644
index 7bf52b5..0000000
Binary files a/setup/resources/setup.png and /dev/null differ
diff --git a/setup/resources/usbdrive.png b/setup/resources/usbdrive.png
deleted file mode 100644
index bb92e41..0000000
Binary files a/setup/resources/usbdrive.png and /dev/null differ
diff --git a/setup/setup.ico b/setup/setup.ico
deleted file mode 100644
index 03c11d2..0000000
Binary files a/setup/setup.ico and /dev/null differ
diff --git a/setup/setup.qrc b/setup/setup.qrc
deleted file mode 100644
index c71a245..0000000
--- a/setup/setup.qrc
+++ /dev/null
@@ -1,14 +0,0 @@
-<RCC>
-    <qresource prefix="/" >
-        <file>../COPYING</file>
-        <file>resources/back.png</file>
-        <file>resources/cancel.png</file>
-        <file>resources/fileopen.png</file>
-        <file>resources/next.png</file>
-        <file>resources/page_artwork_welcome.png</file>
-        <file>resources/page_security_options.png</file>
-        <file>resources/page_setup_finished.png</file>
-        <file>resources/setup.png</file>
-        <file>resources/usbdrive.png</file>
-    </qresource>
-</RCC>
diff --git a/setup/setup.rc.in b/setup/setup.rc.in
deleted file mode 100644
index 30075dd..0000000
--- a/setup/setup.rc.in
+++ /dev/null
@@ -1,26 +0,0 @@
-setupicon ICON setup.ico
-#include <windows.h>
-
-VS_VERSION_INFO	VERSIONINFO
-  FILEVERSION	1,0,13,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 Setup\0"
-      VALUE "FileVersion",	"@PACKAGE_VERSION@\0"
-      VALUE "LegalCopyright",	"Copyright (c) 2004-2011 Tobias Doerffel\0"
-      VALUE "OriginalFilename",	"setup.exe\0"
-      VALUE "ProductName",	"iTALC\0"
-      VALUE "ProductVersion",	"@PACKAGE_VERSION@\0"
-    END
-  END
-END
diff --git a/setup/src/dialogs.cpp b/setup/src/dialogs.cpp
deleted file mode 100644
index 51bb511..0000000
--- a/setup/src/dialogs.cpp
+++ /dev/null
@@ -1,616 +0,0 @@
-/*
- * dialogs.cpp - implementation of dialogs
- *
- * 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.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <QtCore/QProcess>
-#include <QtGui/QCloseEvent>
-#include <QtGui/QCompleter>
-#include <QtGui/QDirModel>
-#include <QtGui/QFileDialog>
-#include <QtGui/QLayout>
-#include <QtGui/QMessageBox>
-#include <QtXml/QtXml>
-
-#ifdef BUILD_WIN32
-#include <windows.h>
-#include <shlobj.h>
-#endif
-
-#include "dialogs.h"
-#include "local_system.h"
-#include "dsa_key.h"
-
-
-
-const QString PUBLIC_KEY_FILE_NAME = "italc_dsa_key.pub";
-const QString KEEP_SETTINGS = ":keep-settings:";
-const QString DEFAULT_INSTALL_DIR =
-#ifdef BUILD_WIN32
-									"c:\\italc"
-#else
-									"/opt/italc"
-#endif
-												;
-
-
-setupWizard::setupWizard( const QString & installDir ) :
-	QDialog(),
-	Ui::wizard(),
-	m_installDir( installDir ),
-	m_keyImportDir( QDir::homePath().replace( "/", QDir::separator() ) +
-							QDir::separator() ),
-	m_keyExportDir( m_keyImportDir ),
-	m_pubKeyDir( localSystem::publicKeyPath( ISD::RoleTeacher, TRUE ) ),
-	m_privKeyDir( localSystem::privateKeyPath( ISD::RoleTeacher, TRUE ) ),
-	m_saveInstallSettings( FALSE ),
-	m_widgetStack(),
-	m_idx( 0 ),
-	m_closeOk( FALSE )
-{
-	setupUi( this );
-
-	connect( backButton, SIGNAL( clicked() ), this, SLOT( back() ) );
-	connect( nextButton, SIGNAL( clicked() ), this, SLOT( next() ) );
-
-	nextButton->setFocus();
-
-
-	QHBoxLayout * hboxLayout = new QHBoxLayout( contentWidget );
-	hboxLayout->setMargin( 0 );
-	hboxLayout->setSpacing( 0 );
-
-	m_widgetStack << new setupWizardPageWelcome( this );
-	m_widgetStack << new setupWizardPageSecurityOptions( this );
-	m_widgetStack << new setupWizardPageKeyDirs( this );
-	m_widgetStack << new setupWizardPageFinished( this );
-
-	QSize max = m_widgetStack.front()->sizeHint();
-
-	foreach( QWidget * w, m_widgetStack )
-	{
-		max = QSize( qMax( max.width(), w->sizeHint().width() ),
-				qMax( max.height(), w->sizeHint().height() ) );
-		w->hide();
-	}
-	contentWidget->setMinimumSize( max );
-	m_widgetStack[m_idx]->show();
-}
-
-
-
-
-void setupWizard::setNextPageDisabled( bool _disabled )
-{
-	nextButton->setEnabled( !_disabled );
-}
-
-
-
-
-void setupWizard::loadSettings( const QString & _install_settings )
-{
-	QFile in( _install_settings );
-	in.open( QFile::ReadOnly );
-	QDomDocument doc;
-	doc.setContent( in.readAll() );
-	QDomElement root = doc.documentElement();
-	m_installDir = root.attribute( "installdir" );
-	m_keyImportDir = root.attribute( "keyimportdir" );
-	m_keyExportDir = root.attribute( "keyexportdir" );
-	m_pubKeyDir = root.attribute( "pubkeydir" );
-	m_privKeyDir = root.attribute( "privkeydir" );
-}
-
-
-
-
-int setupWizard::askOverwrite( const QString & _file, bool _all )
-{
-	return QMessageBox::question( window(), tr( "Confirm overwrite" ),
-			tr( "Do you want to overwrite %1?" ).arg( _file ),
-			QMessageBox::Yes | QMessageBox::No |
-			( _all ?
-				( QMessageBox::YesToAll | QMessageBox::NoToAll )
-						: QMessageBox::NoButton )
-							, QMessageBox::Yes );
-}
-
-
-
-
-#ifdef BUILD_WIN32
-static const QString _exe_ext = ".exe";
-#else
-static const QString _exe_ext = "";
-#endif
-
-void setupWizard::doInstallation( bool _quiet )
-{
-	const QString & d = m_installDir + QDir::separator();
-	QStringList quiet_opt;
-	if( _quiet )
-	{
-		quiet_opt << "-quiet";
-	}
-
-	QSettings settings( QSettings::SystemScope, "iTALC Solutions", "iTALC" );
-	settings.setValue( "settings/LogLevel", 6 );
-	
-#ifdef BUILD_WIN32
-	// disable firewall for ICA-process
-	HKEY hKey; 
-	const QString val = d + "ica.exe:*:Enabled:iTALC Client Application (ICA)";
-	RegOpenKeyEx( HKEY_LOCAL_MACHINE,
-			"SYSTEM\\CurrentControlSet\\Services\\SharedAccess\\"
-				"Parameters\\FirewallPolicy\\DomainProfile\\"
-				"AuthorizedApplications\\List",
-                    NULL, KEY_SET_VALUE, &hKey );
-
-	RegSetValueEx( hKey, QString( d + "ica.exe" ).toUtf8().constData(),
-			0, REG_SZ,
-			(LPBYTE) QString( val ).toUtf8().constData(),
-			val.size()+1 );
-	RegCloseKey( hKey );
-	RegOpenKeyEx( HKEY_LOCAL_MACHINE,
-			"SYSTEM\\CurrentControlSet\\Services\\SharedAccess\\"
-				"Parameters\\FirewallPolicy\\StandardProfile\\"
-				"AuthorizedApplications\\List",
-                    NULL, KEY_SET_VALUE, &hKey );
-
-	RegSetValueEx( hKey, QString( d + "ica.exe" ).toUtf8().constData(),
-			0, REG_SZ,
-			(LPBYTE) QString( val ).toUtf8().constData(),
-			val.size()+1 );
-	RegCloseKey( hKey );
-#endif
-
-	const QString add = QDir::separator() + QString( "key" );
-	const QString add2 = QDir::separator() + PUBLIC_KEY_FILE_NAME;
-	localSystem::setPrivateKeyPath( m_privKeyDir + add,
-						ISD::RoleTeacher );
-	localSystem::setPublicKeyPath( m_pubKeyDir + add,
-						ISD::RoleTeacher );
-	if( m_keyImportDir.isEmpty() )
-	{
-		QProcess::execute( d + "ica",
-					QStringList() << "-createkeypair"
-						<< ( m_privKeyDir + add )
-						<< ( m_pubKeyDir + add ) );
-		if( !_quiet || !QFileInfo( m_keyExportDir+add2 ).exists() ||
-			askOverwrite( m_keyExportDir+add2 ) ==
-							QMessageBox::Yes )
-		{
-			QFile( m_keyExportDir+add2 ).setPermissions( QFile::WriteOwner );
-			QFile( m_keyExportDir+add2 ).remove();
-			QFile( m_pubKeyDir+add ).copy( m_keyExportDir + add2 );
-		}
-	}
-	else if( m_keyImportDir != KEEP_SETTINGS )
-	{
-		publicDSAKey( m_keyImportDir + add2 ).
-					save( m_pubKeyDir + add );
-	}
-
-	// make public key read-only
-	QFile::setPermissions( m_pubKeyDir + add,
-				QFile::ReadOwner | QFile::ReadUser |
-				QFile::ReadGroup | QFile::ReadOther );
-}
-
-
-
-
-void setupWizard::reject()
-{
-	if( QMessageBox::question( window(),
-			tr( "Cancel setup" ),
-			tr( "Are you sure want to quit setup? iTALC is not "
-				"set up completely yet!" ),
-			QMessageBox::Yes | QMessageBox::No,
-						QMessageBox::Yes )
-			==
-						QMessageBox::Yes )
-	{
-		m_closeOk = TRUE;
-		QDialog::reject();
-	}
-}
-
-
-
-
-void setupWizard::back()
-{
-	if( m_idx > 0 )
-	{
-		m_widgetStack[m_idx]->hide();
-		m_widgetStack[--m_idx]->show();
-		setNextPageDisabled( m_widgetStack[m_idx]->nextPageDisabled() );
-		nextButton->setText( tr( "Next" ) );
-		nextButton->setFocus();
-	}
-}
-
-
-
-
-void setupWizard::next()
-{
-	if( !m_widgetStack[m_idx]->nextPage() )
-	{
-		return;
-	}
-	if( m_idx+3 == m_widgetStack.size() && m_keyImportDir == KEEP_SETTINGS )
-	{
-		// skip key-directory-page when user chose to keep keys
-		doInstallation();
-		m_widgetStack[m_idx]->hide();
-		++m_idx;
-	}
-	else if( m_idx+2 == m_widgetStack.size() )
-	{
-		doInstallation();
-	}
-	else if( m_idx+1 == m_widgetStack.size() )
-	{
-		if( m_saveInstallSettings )
-		{
-			QDomDocument doc( "italc-installation-settings" );
-			QDomElement root = doc.createElement( "settings" );
-			root.setAttribute( "installdir", m_installDir );
-			root.setAttribute( "keyimportdir", m_keyImportDir );
-			root.setAttribute( "keyexportdir", m_keyExportDir );
-			root.setAttribute( "pubkeydir", m_pubKeyDir );
-			root.setAttribute( "privkeydir", m_privKeyDir );
-			doc.appendChild( root );
-			QFile out( "installsettings.xml" );
-			out.open( QIODevice::WriteOnly | QIODevice::Truncate );
-			QString xml = "<?xml version=\"1.0\"?>\n" +
-							doc.toString( 4 );
-			out.write( xml.toUtf8().constData(), xml.length() );
-		}
-		accept();
-		return;
-	}
-
-	m_widgetStack[m_idx]->hide();
-	m_widgetStack[++m_idx]->show();
-	if( m_widgetStack[m_idx]->nextPageDisabled() )
-	{
-		setNextPageDisabled( TRUE );
-	}
-	if( m_idx+2 == m_widgetStack.size() )
-	{
-		nextButton->setText( tr( "Finish" ) );
-	}
-	else if( m_idx+1 == m_widgetStack.size() )
-	{
-		cancelButton->setDisabled( TRUE );
-		backButton->setDisabled( TRUE );
-		nextButton->setText( tr( "Quit" ) );
-	}
-	nextButton->setFocus();
-}
-
-
-
-
-void setupWizard::closeEvent( QCloseEvent * _ev )
-{
-	if( m_closeOk )
-	{
-		QDialog::closeEvent( _ev );
-	}
-	else
-	{
-		reject();
-		if( !m_closeOk )
-		{
-			_ev->ignore();
-		}
-	}
-}
-
-
-
-
-
-setupWizardPage::setupWizardPage( setupWizard * _wiz ) :
-	QWidget( _wiz->contentWidget ),
-	m_setupWizard( _wiz )
-{
-	parentWidget()->layout()->addWidget( this );
-}
-
-
-
-
-setupWizardPageWelcome::setupWizardPageWelcome( setupWizard * _wiz ) :
-	setupWizardPage( _wiz ),
-	Ui::pageWelcome()
-{
-	setupUi( this );
-}
-
-
-
-
-
-// setupWizardPageSecurityOptions
-setupWizardPageSecurityOptions::setupWizardPageSecurityOptions(
-							setupWizard * _wiz ) :
-	setupWizardPage( _wiz ),
-	Ui::pageSecurityOptions()
-{
-	setupUi( this );
-
-	keyImportDirLineEdit->setText( m_setupWizard->m_keyImportDir );
-
-	QCompleter * completer = new QCompleter( this );
-	completer->setModel( new QDirModel( completer ) );
- 	keyImportDirLineEdit->setCompleter( completer );
-
-
-	connect( openDirButton, SIGNAL( clicked() ), this,
-						SLOT( openKeyImportDir() ) );
-	connect( keyImportDirLineEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( setKeyImportDir( const QString & ) ) );
-	connect( createKeysRadioButton, SIGNAL( toggled( bool ) ),
-			this, SLOT( createKeysRadioButtonToggled( bool ) ) );
-	connect( keepKeysRadioButton, SIGNAL( toggled( bool ) ),
-			this, SLOT( keepKeysRadioButtonToggled( bool ) ) );
-}
-
-
-
-
-bool setupWizardPageSecurityOptions::nextPageDisabled()
-{
-	if( createKeysRadioButton->isChecked() )
-	{
-		m_setupWizard->m_keyImportDir.clear();
-		return FALSE;
-	}
-	if( keepKeysRadioButton->isChecked() )
-	{
-		m_setupWizard->m_keyImportDir = KEEP_SETTINGS;
-		return FALSE;
-	}
-	m_setupWizard->m_keyImportDir = keyImportDirLineEdit->text();
-	if( m_setupWizard->m_keyImportDir.isEmpty() )
-	{
-		return TRUE;
-	}
-	return !publicDSAKey( m_setupWizard->m_keyImportDir +
-					QDir::separator() +
-					PUBLIC_KEY_FILE_NAME ).isValid();
-}
-
-
-
-
-void setupWizardPageSecurityOptions::openKeyImportDir()
-{
-	QString dir = QFileDialog::getExistingDirectory( window(),
-					tr( "Choose directory for key import" ),
-					m_setupWizard->m_keyImportDir );
-	if( !dir.isEmpty() )
-	{
-		setKeyImportDir( dir );
-	}
-}
-
-
-
-
-void setupWizardPageSecurityOptions::setKeyImportDir( const QString & _dir )
-{
-	m_setupWizard->m_keyImportDir= _dir;
-	if( keyImportDirLineEdit->text() != _dir )
-	{
-		keyImportDirLineEdit->setText( _dir );
-	}
-	m_setupWizard->setNextPageDisabled( nextPageDisabled() );
-}
-
-
-
-
-void setupWizardPageSecurityOptions::createKeysRadioButtonToggled( bool )
-{
-	m_setupWizard->setNextPageDisabled( nextPageDisabled() );
-}
-
-
-
-
-void setupWizardPageSecurityOptions::keepKeysRadioButtonToggled( bool )
-{
-	m_setupWizard->setNextPageDisabled( nextPageDisabled() );
-}
-
-
-
-
-
-
-
-// setupWizardPageKeyDirs
-setupWizardPageKeyDirs::setupWizardPageKeyDirs( setupWizard * _wiz ) :
-	setupWizardPage( _wiz ),
-	Ui::pageKeyDirs()
-{
-	setupUi( this );
-
-	pubKeyDirLineEdit->setText( m_setupWizard->m_pubKeyDir );
-	privKeyDirLineEdit->setText( m_setupWizard->m_privKeyDir );
-	keyExportDirLineEdit->setText( m_setupWizard->m_keyExportDir );
-
-	QCompleter * completer = new QCompleter( this );
-	completer->setModel( new QDirModel( completer ) );
- 	pubKeyDirLineEdit->setCompleter( completer );
-	completer = new QCompleter( this );
-	completer->setModel( new QDirModel( completer ) );
- 	privKeyDirLineEdit->setCompleter( completer );
-	completer = new QCompleter( this );
-	completer->setModel( new QDirModel( completer ) );
- 	keyExportDirLineEdit->setCompleter( completer );
-
-
-	connect( openPubKeyDirButton, SIGNAL( clicked() ),
-					this, SLOT( openPubKeyDir() ) );
-	connect( openPrivKeyDirButton, SIGNAL( clicked() ),
-					this, SLOT( openPrivKeyDir() ) );
-	connect( openExportKeyDirButton, SIGNAL( clicked() ),
-					this, SLOT( openKeyExportDir() ) );
-	connect( pubKeyDirLineEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( setPubKeyDir( const QString & ) ) );
-	connect( privKeyDirLineEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( setPrivKeyDir( const QString & ) ) );
-	connect( keyExportDirLineEdit, SIGNAL( textChanged( const QString & ) ),
-			this, SLOT( setKeyExportDir( const QString & ) ) );
-}
-
-
-
-
-bool setupWizardPageKeyDirs::nextPageDisabled()
-{
-	newKeyDirWidgets->setVisible( m_setupWizard->m_keyImportDir.isEmpty() );
-	setPubKeyDir( m_setupWizard->m_pubKeyDir.replace( DEFAULT_INSTALL_DIR,
-						m_setupWizard->m_installDir ) );
-	setPrivKeyDir( m_setupWizard->m_privKeyDir.replace( DEFAULT_INSTALL_DIR,
-						m_setupWizard->m_installDir ) );
-	return FALSE;
-}
-
-
-
-
-void setupWizardPageKeyDirs::openPubKeyDir()
-{
-	QString dir = QFileDialog::getExistingDirectory( window(),
-					tr( "Choose public key directory" ),
-					m_setupWizard->m_pubKeyDir );
-	if( !dir.isEmpty() )
-	{
-		setPubKeyDir( dir );
-	}
-}
-
-
-
-
-void setupWizardPageKeyDirs::openPrivKeyDir()
-{
-	QString dir = QFileDialog::getExistingDirectory( window(),
-					tr( "Choose private key directory" ),
-					m_setupWizard->m_privKeyDir );
-	if( !dir.isEmpty() )
-	{
-		setPrivKeyDir( dir );
-	}
-}
-
-
-
-
-void setupWizardPageKeyDirs::openKeyExportDir()
-{
-	QString dir = QFileDialog::getExistingDirectory( window(),
-				tr( "Choose public key export directory" ),
-					m_setupWizard->m_keyExportDir );
-	if( !dir.isEmpty() )
-	{
-		setKeyExportDir( dir );
-	}
-}
-
-
-
-
-void setupWizardPageKeyDirs::setPubKeyDir( const QString & _dir )
-{
-	m_setupWizard->m_pubKeyDir = _dir;
-	if( pubKeyDirLineEdit->text() != _dir )
-	{
-		pubKeyDirLineEdit->setText( _dir );
-	}
-}
-
-
-
-
-void setupWizardPageKeyDirs::setPrivKeyDir( const QString & _dir )
-{
-	m_setupWizard->m_privKeyDir = _dir;
-	if( privKeyDirLineEdit->text() != _dir )
-	{
-		privKeyDirLineEdit->setText( _dir );
-	}
-}
-
-
-
-
-void setupWizardPageKeyDirs::setKeyExportDir( const QString & _dir )
-{
-	m_setupWizard->m_keyExportDir = _dir;
-	if( keyExportDirLineEdit->text() != _dir )
-	{
-		keyExportDirLineEdit->setText( _dir );
-	}
-}
-
-
-
-
-
-setupWizardPageFinished::setupWizardPageFinished( setupWizard * _wiz ) :
-	setupWizardPage( _wiz ),
-	Ui::pageFinished()
-{
-	setupUi( this );
-	connect( saveInstallSettings, SIGNAL( toggled( bool ) ),
-			this, SLOT( toggleSaveInstallSettings( bool ) ) );
-}
-
-
-
-
-void setupWizardPageFinished::toggleSaveInstallSettings( bool _on )
-{
-	m_setupWizard->m_saveInstallSettings = _on;
-}
-
-
-
-
-
-
-#include "dialogs.moc"
-
diff --git a/setup/src/dialogs.h b/setup/src/dialogs.h
deleted file mode 100644
index 90af382..0000000
--- a/setup/src/dialogs.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * dialogs.h - declaration of dialog-classes
- *
- * 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 _DIALOGS_H
-#define _DIALOGS_H
-
-#include <QtCore/QList>
-
-#include "dialogs/wizard.uic"
-#include "dialogs/page_welcome.uic"
-#include "dialogs/page_security_options.uic"
-#include "dialogs/page_key_dirs.uic"
-#include "dialogs/page_setup_finished.uic"
-
-
-class setupWizardPage;
-
-
-class setupWizard : public QDialog, private Ui::wizard
-{
-	Q_OBJECT
-public:
-	setupWizard( const QString & installDir );
-
-	QString m_installDir;
-	QString m_keyImportDir;
-	QString m_keyExportDir;
-	QString m_pubKeyDir;
-	QString m_privKeyDir;
-
-	bool m_saveInstallSettings;
-
-	void setNextPageDisabled( bool );
-
-	void loadSettings( const QString & _install_settings );
-	void doInstallation( bool _quiet = FALSE);
-
-	int askOverwrite( const QString & _file, bool _all = FALSE );
-
-
-private slots:
-	virtual void reject();
-	void back();
-	void next();
-
-
-private:
-	virtual void closeEvent( QCloseEvent * _ev );
-
-	QList<setupWizardPage *> m_widgetStack;
-	int m_idx;
-	bool m_closeOk;
-
-
-	friend class setupWizardPage;
-
-} ;
-
-
-
-class setupWizardPage : public QWidget
-{
-public:
-	setupWizardPage( setupWizard * _wiz );
-
-	virtual bool nextPage()
-	{
-		return( !nextPageDisabled() );
-	}
-
-	virtual bool nextPageDisabled()
-	{
-		return( FALSE );
-	}
-
-
-protected:
-	setupWizard * m_setupWizard;
-
-} ;
-
-
-
-
-class setupWizardPageWelcome : public setupWizardPage, public Ui::pageWelcome
-{
-public:
-	setupWizardPageWelcome( setupWizard * _wiz );
-
-} ;
-
-
-
-
-class setupWizardPageSecurityOptions : public setupWizardPage,
-						public Ui::pageSecurityOptions
-{
-	Q_OBJECT
-public:
-	setupWizardPageSecurityOptions( setupWizard * _wiz );
-
-	virtual bool nextPageDisabled();
-
-
-private slots:
-	void openKeyImportDir();
-	void setKeyImportDir( const QString & _dir );
-	void createKeysRadioButtonToggled( bool );
-	void keepKeysRadioButtonToggled( bool );
-
-
-} ;
-
-
-
-
-class setupWizardPageKeyDirs : public setupWizardPage, public Ui::pageKeyDirs
-{
-	Q_OBJECT
-public:
-	setupWizardPageKeyDirs( setupWizard * _wiz );
-
-	virtual bool nextPageDisabled();
-
-
-private slots:
-	void openPubKeyDir();
-	void openPrivKeyDir();
-	void openKeyExportDir();
-	void setPubKeyDir( const QString & _dir );
-	void setPrivKeyDir( const QString & _dir );
-	void setKeyExportDir( const QString & _dir );
-
-} ;
-
-
-
-class setupWizardPageFinished : public setupWizardPage, public Ui::pageFinished
-{
-	Q_OBJECT
-public:
-	setupWizardPageFinished( setupWizard * _wiz );
-
-private slots:
-	void toggleSaveInstallSettings( bool );
-
-} ;
-
-
-
-
-
-#endif
diff --git a/setup/src/main.cpp b/setup/src/main.cpp
deleted file mode 100644
index c1e3644..0000000
--- a/setup/src/main.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * main.cpp - main file for iTALC setup tool
- *
- * 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 <QtCore/QFileInfo>
-#include <QtCore/QDir>
-#include <QtGui/QApplication>
-#include <QtGui/QMessageBox>
-
-#include "dialogs.h"
-#include "local_system.h"
-
-
-
-// good old main-function... initializes qt-app and starts iTALC
-int main( int argc, char * * argv )
-{
-	QApplication app( argc, argv );
-
-	app.connect( &app, SIGNAL( lastWindowClosed() ), SLOT( quit() ) );
-
-	localSystem::initialize( NULL, "italc_setup.log" );
-
-	QString installDir = QCoreApplication::applicationDirPath();
-	if( app.arguments().size() > 1 && QFileInfo( app.arguments()[1] ).isDir() )
-	{
-		installDir = app.arguments()[1];
-	}
-	setupWizard sw( installDir );
-
-	if( app.arguments().size() > 1 )
-	{
-		QString arg = app.arguments()[1];
-		if( QFileInfo( arg ).exists() )
-		{
-#ifdef BUILD_WIN32
-			// UNC-paths on windows need some special handling
-			// as QFile does not relocate relative file-paths
-			// while current-dir of application is a UNC-path
-			if( !QFileInfo( arg ).isAbsolute() &&
-				QDir::currentPath().left( 2 ) == "//" )
-			{
-				arg = QDir::currentPath()+"/"+arg;
-			}
-#endif
-			sw.loadSettings( arg );
-			sw.doInstallation( TRUE );
-			return( 0 );
-		}
-		else
-		{
-			QMessageBox::information( NULL,
-					setupWizard::tr( "File does not exist" ),
-					setupWizard::tr( "The file %1 could not be "
-						"found. Please check this and "
-						"try again." ).
-						arg( app.arguments()[1] ) );
-		}
-	}
-	else
-	{
-		sw.show();
-	}
-
-	return app.exec();
-}
-
diff --git a/tightvnc4win_integrate b/tightvnc4win_integrate
deleted file mode 100755
index 2409d99..0000000
--- a/tightvnc4win_integrate
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/bash
-#
-# integrate all needed source-files from a TightVNC4Win-source-tree and
-# patch them for make them working with GCC and fit iTALC's purposes
-#
-# Copyright (c) 2006 Tobias Doerffel
-#
-
-if [ -z $1 ] ; then
-	echo "Usage:	tightvnc4win_integrate <path-to-tightvnc4win-sources>"
-	exit
-fi
-
-tightvnc4winsrc=$1
-
-if [ ! -e $tightvnc4winsrc/WinVNC.cpp ] ; then
-	tightvnc4winsrc=$1/winvnc
-	if [ ! -e $tightvnc4winsrc/WinVNC.cpp ] ; then
-		echo "Could not find a valid source-tree of TightVNC for Windows in $1"
-		exit
-	fi
-fi
-
-# prepare destination dir
-destdir=ica/win32/src
-mkdir -p $destdir
-rm -rf $destdir/*
-
-# copy files
-cp $tightvnc4winsrc/VNCHooks/VNCHooks.h $destdir
-cp $tightvnc4winsrc/VNCHooks/VNCHooks.cpp $destdir
-cp $tightvnc4winsrc/omnithread/nt.cpp $destdir
-cp $tightvnc4winsrc/omnithread/nt.h $destdir
-cp $tightvnc4winsrc/omnithread/omnithread.h $destdir
-cp $tightvnc4winsrc/VSocket.h $destdir
-cp $tightvnc4winsrc/vncEncodeCoRRE.cpp $destdir
-cp $tightvnc4winsrc/vncEncodeHexT.cpp $destdir
-cp $tightvnc4winsrc/stdhdrs.h $destdir
-cp $tightvnc4winsrc/vncBuffer.h $destdir
-cp $tightvnc4winsrc/Log.h $destdir
-cp $tightvnc4winsrc/vncTimedMsgBox.h $destdir
-cp $tightvnc4winsrc/resource.h $destdir
-cp $tightvnc4winsrc/rfb.h $destdir
-cp $tightvnc4winsrc/vncServer.h $destdir
-cp $tightvnc4winsrc/vncDesktop.h $destdir
-cp $tightvnc4winsrc/vncKeymap.cpp $destdir
-cp $tightvnc4winsrc/VSocket.cpp $destdir
-cp $tightvnc4winsrc/WinVNC.cpp $destdir
-cp $tightvnc4winsrc/MinMax.h $destdir
-cp $tightvnc4winsrc/vncService.cpp $destdir
-cp $tightvnc4winsrc/vncEncodeTight.h $destdir
-cp $tightvnc4winsrc/vncauth.c $destdir/vncauth_w32.c
-cp $tightvnc4winsrc/VideoDriver.cpp $destdir
-cp $tightvnc4winsrc/d3des.c $destdir/d3des_w32.c
-cp $tightvnc4winsrc/vncEncodeHexT.h $destdir
-cp $tightvnc4winsrc/WinVNC.h $destdir
-cp $tightvnc4winsrc/vncInstHandler.cpp $destdir
-cp $tightvnc4winsrc/vncKeymap.h $destdir
-cp $tightvnc4winsrc/d3des.h $destdir
-cp $tightvnc4winsrc/vncClient.h $destdir
-cp $tightvnc4winsrc/vncRegion.h $destdir
-cp $tightvnc4winsrc/vncServer.cpp $destdir
-cp $tightvnc4winsrc/vncInstHandler.h $destdir
-cp $tightvnc4winsrc/tableinittctemplate.cpp $destdir
-cp $tightvnc4winsrc/vncClient.cpp $destdir
-cp $tightvnc4winsrc/RectList.h $destdir
-cp $tightvnc4winsrc/vncEncodeZlib.h $destdir
-cp $tightvnc4winsrc/stdhdrs.cpp $destdir
-cp $tightvnc4winsrc/tableinitcmtemplate.cpp $destdir
-cp $tightvnc4winsrc/vncEncodeRRE.cpp $destdir
-cp $tightvnc4winsrc/vncEncodeTight.cpp $destdir
-cp $tightvnc4winsrc/vncSockConnect.h $destdir
-cp $tightvnc4winsrc/RectList.cpp $destdir
-cp $tightvnc4winsrc/MinMax.cpp $destdir
-cp $tightvnc4winsrc/translate.cpp $destdir
-cp $tightvnc4winsrc/Log.cpp $destdir
-cp $tightvnc4winsrc/vncEncodeRRE.h $destdir
-cp $tightvnc4winsrc/vncEncoder.cpp $destdir
-cp $tightvnc4winsrc/vncBuffer.cpp $destdir
-cp $tightvnc4winsrc/vncEncodeZlib.cpp $destdir
-cp $tightvnc4winsrc/vncRegion.cpp $destdir
-cp $tightvnc4winsrc/vncService.h $destdir
-cp $tightvnc4winsrc/translate.h $destdir
-cp $tightvnc4winsrc/vncPasswd.h $destdir
-cp $tightvnc4winsrc/VideoDriver.h $destdir
-cp $tightvnc4winsrc/vncEncoder.h $destdir
-cp $tightvnc4winsrc/vncEncodeCoRRE.h $destdir
-cp $tightvnc4winsrc/vncSockConnect.cpp $destdir
-cp $tightvnc4winsrc/VTypes.h $destdir
-cp $tightvnc4winsrc/vncauth.h $destdir
-cp $tightvnc4winsrc/tabletranstemplate.cpp $destdir
-cp $tightvnc4winsrc/vncDesktop.cpp $destdir
-
-# patch files
-curdir=`pwd`
-cd $destdir
-patch -p1 < $curdir/tightvnc4win_italc.diff
diff --git a/tightvnc4win_italc.diff b/tightvnc4win_italc.diff
deleted file mode 100644
index 80addc9..0000000
--- a/tightvnc4win_italc.diff
+++ /dev/null
@@ -1,800 +0,0 @@
-diff -upr src.unpatched/d3des_w32.c src/d3des_w32.c
---- src.unpatched/d3des_w32.c	2006-06-11 17:40:26.000000000 +0200
-+++ src/d3des_w32.c	2006-05-01 12:58:41.000000000 +0200
-@@ -161,8 +161,8 @@ unsigned char *inblock, *outblock;
- 	}
- 
- static void scrunch(outof, into)
--register unsigned char *outof;
--register unsigned long *into;
-+unsigned char *outof;
-+unsigned long *into;
- {
- 	*into	 = (*outof++ & 0xffL) << 24;
- 	*into	|= (*outof++ & 0xffL) << 16;
-diff -upr src.unpatched/SharedData.cpp src/SharedData.cpp
---- src.unpatched/SharedData.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/SharedData.cpp	2006-05-01 12:58:41.000000000 +0200
-@@ -44,3 +44,5 @@ HHOOK hLLKeyboardPrHook = NULL;						// 
- HHOOK hLLMousePrHook = NULL;						// Handle to LowLevel mouse hook for local event priority
- HHOOK hKeyboardHook = NULL;							// Handle to kbd hook
- HHOOK hMouseHook = NULL;							// Handle to mouse hook
-+HWND hKeyboardPriorityWindow = NULL;
-+HWND hMousePriorityWindow = NULL;
-diff -upr src.unpatched/SharedData.h src/SharedData.h
---- src.unpatched/SharedData.h	2006-06-11 17:40:26.000000000 +0200
-+++ src/SharedData.h	2006-05-01 12:58:41.000000000 +0200
-@@ -37,3 +37,5 @@ extern HHOOK hLLKeyboardPrHook;
- extern HHOOK hLLMousePrHook;
- extern HHOOK hKeyboardHook;
- extern HHOOK hMouseHook;
-+extern HWND hKeyboardPriorityWindow;
-+extern HWND hMousePriorityWindow;
-diff -upr src.unpatched/VideoDriver.cpp src/VideoDriver.cpp
---- src.unpatched/VideoDriver.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/VideoDriver.cpp	2006-05-01 13:22:53.000000000 +0200
-@@ -74,13 +74,12 @@ vncVideoDriver::Activate_video_driver()
-     HDESK   hdeskCurrent;
- 	HINSTANCE  hInstUser32;
-  
--    int j=0;
- 	pEnumDisplayDevices pd;
- 	DEVMODE devmode;
-     FillMemory(&devmode, sizeof(DEVMODE), 0);
-     devmode.dmSize = sizeof(DEVMODE);
-     devmode.dmDriverExtra = 0;
--    BOOL change = EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&devmode);
-+    EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&devmode);
- 	devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
- 
- 	hInstUser32 = LoadLibrary("User32.DLL");
-@@ -161,13 +160,12 @@ vncVideoDriver::DesActivate_video_driver
- 	HDESK   hdeskCurrent;
- 	HINSTANCE  hInstUser32;
-  
--    int j=0;
- 	pEnumDisplayDevices pd;
- 	DEVMODE devmode;
-     FillMemory(&devmode, sizeof(DEVMODE), 0);
-     devmode.dmSize = sizeof(DEVMODE);
-     devmode.dmDriverExtra = 0;
--    BOOL change = EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&devmode);
-+    (void) EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&devmode);
-     devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
- 	pd = (pEnumDisplayDevices)GetProcAddress( LoadLibrary("USER32"), "EnumDisplayDevicesA");
-    	hInstUser32 = LoadLibrary("User32.DLL");
-diff -upr src.unpatched/VideoDriver.h src/VideoDriver.h
---- src.unpatched/VideoDriver.h	2006-06-11 17:40:26.000000000 +0200
-+++ src/VideoDriver.h	2006-05-01 12:58:41.000000000 +0200
-@@ -42,6 +42,7 @@
- #define TEXTOUT 18
- #define MOUSEPTR 48
- 
-+#ifndef __MINGW32__
- #define CDS_UPDATEREGISTRY  0x00000001
- #define CDS_TEST            0x00000002
- #define CDS_FULLSCREEN      0x00000004
-@@ -50,6 +51,7 @@
- #define CDS_RESET           0x40000000
- #define CDS_SETRECT         0x20000000
- #define CDS_NORESET         0x10000000
-+#endif
- 
- typedef BOOL (WINAPI* pEnumDisplayDevices)(PVOID,DWORD,PVOID,DWORD);
- 
-diff -upr src.unpatched/vncauth.h src/vncauth.h
---- src.unpatched/vncauth.h	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncauth.h	2006-05-01 12:58:41.000000000 +0200
-@@ -1,3 +1,4 @@
-+/*
- //  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
- //
- //  This file is part of the VNC system.
-@@ -22,6 +23,7 @@
- // If the source code for the VNC system is not available from the place 
- // whence you received this file, check http://www.uk.research.att.com/vnc or contact
- // the authors on vnc at uk.research.att.com for information on obtaining it.
-+*/
- 
- 
- /* 
-diff -upr src.unpatched/vncauth_w32.c src/vncauth_w32.c
---- src.unpatched/vncauth_w32.c	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncauth_w32.c	2006-05-01 12:58:41.000000000 +0200
-@@ -1,3 +1,4 @@
-+/*
- //  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
- //
- //  This file is part of the VNC system.
-@@ -22,6 +23,7 @@
- // If the source code for the VNC system is not available from the place 
- // whence you received this file, check http://www.uk.research.att.com/vnc or contact
- // the authors on vnc at uk.research.att.com for information on obtaining it.
-+*/
- 
- 
- /*
-diff -upr src.unpatched/vncBuffer.cpp src/vncBuffer.cpp
---- src.unpatched/vncBuffer.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncBuffer.cpp	2006-05-01 12:58:41.000000000 +0200
-@@ -367,6 +367,7 @@ vncBuffer::SetEncoding(CARD32 encoding)
- 		tight_encoder_in_use = true;
- 		break;
- 
-+#if 0
- 	case rfbEncodingZlibHex:
- 
- 		vnclog.Print(LL_INTINFO, VNCLOG("ZlibHex encoder requested\n"));
-@@ -386,6 +387,7 @@ vncBuffer::SetEncoding(CARD32 encoding)
- 			return FALSE;
- 		zlibhex_encoder_in_use = true;
- 		break;
-+#endif
- 
- 	default:
- 		// An unknown encoding was specified
-diff -upr src.unpatched/vncClient.cpp src/vncClient.cpp
---- src.unpatched/vncClient.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncClient.cpp	2006-05-21 15:18:53.000000000 +0200
-@@ -208,15 +208,21 @@ vncClientThread::InitAuthenticate()
- 		return FALSE;
- 
- 	if (m_client->m_protocol_minor_version >= 7) {
--		CARD8 list[3];
--		list[0] = (CARD8)2;					// number of security types
--		list[1] = (CARD8)secType;			// primary security type
--		list[2] = (CARD8)rfbSecTypeTight;	// support for TightVNC extensions
-+		CARD8 list[2];
-+		list[0] = (CARD8)1;					// number of security types
-+		list[1] = (CARD8)rfbSecTypeItalc;			// primary security type
- 		if (!m_socket->SendExact((char *)&list, sizeof(list)))
- 			return FALSE;
- 		CARD8 type;
- 		if (!m_socket->ReadExact((char *)&type, sizeof(type)))
- 			return FALSE;
-+		if( type == rfbSecTypeItalc )
-+		{
-+			return( authSecTypeItalc( vsocketDispatcher,
-+							m_socket,
-+							ItalcAuthDSA ) );
-+		}
-+		return( FALSE );
- 		if (type == rfbSecTypeTight) {
- 			vnclog.Print(LL_INTINFO, VNCLOG("enabling TightVNC protocol extensions\n"));
- 			m_client->m_protocol_tightvnc = TRUE;
-@@ -306,7 +312,9 @@ vncClientThread::GetAuthenticationType()
- 	}
- 
- 	// If necessary, query the connection with a timed dialog
-+	verified = vncServer::aqrAccept;
- 	BOOL skip_auth = FALSE;
-+#if 0
- 	if (verified == vncServer::aqrQuery) {
- 		vncAcceptDialog *acceptDlg =
- 			new vncAcceptDialog(m_server->QueryTimeout(),
-@@ -331,6 +339,7 @@ vncClientThread::GetAuthenticationType()
- 			delete acceptDlg;
- 		}
- 	}
-+#endif
- 
- 	// The connection should be rejected, either due to AuthHosts settings,
- 	// or because of the "Reject" action performed in the query dialog
-@@ -628,10 +637,12 @@ vncClientThread::SendInteractionCaps()
- 	i = 0;
- 
- 	if (m_server->FileTransfersEnabled() && m_client->IsInputEnabled()) {
-+#if 0
- 		SetCapInfo(&smsg_list[i++], rfbFileListData,       rfbTightVncVendor);
- 		SetCapInfo(&smsg_list[i++], rfbFileDownloadData,   rfbTightVncVendor);
- 		SetCapInfo(&smsg_list[i++], rfbFileUploadCancel,   rfbTightVncVendor);
- 		SetCapInfo(&smsg_list[i++], rfbFileDownloadFailed, rfbTightVncVendor);
-+#endif
- 	}
- 
- 	int nServerMsgs = i;
-@@ -646,12 +657,14 @@ vncClientThread::SendInteractionCaps()
- 	i = 0;
- 
- 	if (m_server->FileTransfersEnabled() && m_client->IsInputEnabled()) {
-+#if 0
- 		SetCapInfo(&cmsg_list[i++], rfbFileListRequest,    rfbTightVncVendor);
- 		SetCapInfo(&cmsg_list[i++], rfbFileDownloadRequest,rfbTightVncVendor);
- 		SetCapInfo(&cmsg_list[i++], rfbFileUploadRequest,  rfbTightVncVendor);
- 		SetCapInfo(&cmsg_list[i++], rfbFileUploadData,     rfbTightVncVendor);
- 		SetCapInfo(&cmsg_list[i++], rfbFileDownloadCancel, rfbTightVncVendor);
- 		SetCapInfo(&cmsg_list[i++], rfbFileUploadFailed,   rfbTightVncVendor);
-+#endif
- 	}
- 
- 	int nClientMsgs = i;
-@@ -1264,6 +1277,7 @@ vncClientThread::run(void *arg)
- 			}
- 			break;
- 
-+#if 0
- 		case rfbFileListRequest:
- 			if (!m_server->FileTransfersEnabled() || !m_client->IsInputEnabled()) {
- 				connected = FALSE;
-@@ -1574,6 +1588,13 @@ vncClientThread::run(void *arg)
- 			}
- 
- 			break;
-+#endif
-+		case rfbItalcServiceRequest:
-+			if( !processItalcClient( vsocketDispatcher, m_socket ) )
-+			{
-+				connected = FALSE;
-+			}
-+			break;
- 
- 		default:
- 			// Unknown message, so fail!
-@@ -2357,6 +2378,7 @@ vncClientThread::ConvertPath(char *path)
- void 
- vncClient::SendFileUploadCancel(unsigned short reasonLen, char *reason)
- {
-+#if 0
- 	omni_mutex_lock l(m_sendUpdateLock);
- 
- 	int msgLen = sz_rfbFileUploadCancelMsg + reasonLen;
-@@ -2368,19 +2390,23 @@ vncClient::SendFileUploadCancel(unsigned
- 	memcpy(pFollow, reason, reasonLen);
- 	m_socket->SendExact(pAllFUCMessage, msgLen);
- 	delete [] pAllFUCMessage;
-+#endif
- }
- 
- void 
- vncClient::Time70ToFiletime(unsigned int mTime, FILETIME *pFiletime)
- {
-+#if 0
- 	LONGLONG ll = Int32x32To64(mTime, 10000000) + 116444736000000000;
- 	pFiletime->dwLowDateTime = (DWORD) ll;
- 	pFiletime->dwHighDateTime = ll >> 32;
-+#endif
- }
- 
- void 
- vncClient::SendFileDownloadFailed(unsigned short reasonLen, char *reason)
- {
-+#if 0
- 	omni_mutex_lock l(m_sendUpdateLock);
- 
- 	int msgLen = sz_rfbFileDownloadFailedMsg + reasonLen;
-@@ -2392,11 +2418,13 @@ vncClient::SendFileDownloadFailed(unsign
- 	memcpy(pFollow, reason, reasonLen);
- 	m_socket->SendExact(pAllFDFMessage, msgLen);
- 	delete [] pAllFDFMessage;
-+#endif
- }
- 
- void 
- vncClient::SendFileDownloadData(unsigned int mTime)
- {
-+#if 0
- 	omni_mutex_lock l(m_sendUpdateLock);
- 
- 	int msgLen = sz_rfbFileDownloadDataMsg + sizeof(unsigned int);
-@@ -2410,11 +2438,13 @@ vncClient::SendFileDownloadData(unsigned
- 	memcpy(pFollow, &mTime, sizeof(unsigned int));
- 	m_socket->SendExact(pAllFDDMessage, msgLen);
- 	delete [] pAllFDDMessage;
-+#endif
- }
- 
- void
- vncClient::SendFileDownloadPortion()
- {
-+#if 0
- 	if (!m_bDownloadStarted) return;
- 	DWORD dwNumberOfBytesRead = 0;
- 	m_rfbBlockSize = 8192;
-@@ -2431,11 +2461,13 @@ vncClient::SendFileDownloadPortion()
- 	SendFileDownloadData(dwNumberOfBytesRead, pBuff);
- 	delete [] pBuff;
- 	PostToWinVNC(fileTransferDownloadMessage, (WPARAM) this, (LPARAM) 0);
-+#endif
- }
- 
- void 
- vncClient::SendFileDownloadData(unsigned short sizeFile, char *pFile)
- {
-+#if 0
- 	omni_mutex_lock l(m_sendUpdateLock);
- 
- 	int msgLen = sz_rfbFileDownloadDataMsg + sizeFile;
-@@ -2449,17 +2481,20 @@ vncClient::SendFileDownloadData(unsigned
- 	memcpy(pFollow, pFile, sizeFile);
- 	m_socket->SendExact(pAllFDDMessage, msgLen);
- 	delete [] pAllFDDMessage;
-+#endif
- 
- }
- 
- unsigned int 
- vncClient::FiletimeToTime70(FILETIME filetime)
- {
-+#if 0
- 	LARGE_INTEGER uli;
- 	uli.LowPart = filetime.dwLowDateTime;
- 	uli.HighPart = filetime.dwHighDateTime;
- 	uli.QuadPart = (uli.QuadPart - 116444736000000000) / 10000000;
- 	return uli.LowPart;
-+#endif
- }
- 
- void
-diff -upr src.unpatched/vncClient.h src/vncClient.h
---- src.unpatched/vncClient.h	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncClient.h	2006-05-01 13:10:24.000000000 +0200
-@@ -64,7 +64,7 @@ class vncClient
- public:
- 	// Constructor/destructor
- 	vncClient();
--	~vncClient();
-+	virtual ~vncClient();
- 
- 	// Allow the client thread to see inside the client object
- 	friend class vncClientThread;
-diff -upr src.unpatched/vncDesktop.cpp src/vncDesktop.cpp
---- src.unpatched/vncDesktop.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncDesktop.cpp	2006-05-01 13:22:31.000000000 +0200
-@@ -33,14 +33,14 @@
- 
- // Custom headers
- #include "WinVNC.h"
--#include "VNCHooks\VNCHooks.h"
-+#include "VNCHooks.h"
- #include "vncServer.h"
- #include "vncRegion.h"
- #include "rectlist.h"
- #include "vncDesktop.h"
- #include "vncService.h"
- #include "WallpaperUtils.h"
--#include <fstream.h>
-+#include <fstream>
- 
- // Constants
- const UINT RFB_SCREEN_UPDATE = RegisterWindowMessage("WinVNC.Update.DrawRect");
-@@ -53,8 +53,10 @@ const UINT RFB_LOCAL_MOUSE = RegisterWin
- const char szDesktopSink[] = "WinVNC desktop sink";
- 
- // Atoms
-+#if 0
- const char *VNC_WINDOWPOS_ATOMNAME = "VNCHooks.CopyRect.WindowPos";
- ATOM VNC_WINDOWPOS_ATOM = NULL;
-+#endif
- 
- // Static members to use with new polling algorithm
- const int vncDesktop::m_pollingOrder[32] = {
-@@ -153,9 +155,11 @@ vncDesktopThread::run_undetached(void *a
- 	// Succeeded to initialise ok
- 	ReturnVal(TRUE);
- 
-+#if 0
- 	WallpaperUtils wputils;
- 	if (m_server->RemoveWallpaperEnabled())
- 		wputils.KillWallpaper();
-+#endif
- 
- 	// START PROCESSING DESKTOP MESSAGES
- 
-@@ -287,7 +291,9 @@ vncDesktopThread::run_undetached(void *a
- 		}
- 	}
- 
-+#if 0
- 	wputils.RestoreWallpaper();
-+#endif
- 
- 	m_desktop->SetClipboardActive(FALSE);
- 	
-@@ -652,7 +658,6 @@ vncDesktop::KillScreenSaver()
- void vncDesktop::ChangeResNow()
- {
- 	BOOL settingsUpdated = false;
--	int i = 0;
- 	lpDevMode = new DEVMODE; // *** create an instance of DEVMODE - Jeremy Peaks
- 
- 	// *** WBB - Obtain the current display settings.
-@@ -1213,7 +1218,7 @@ vncDesktop::FillDisplayInfo(rfbServerIni
- // Function to capture an area of the screen immediately prior to sending
- // an update.
- void
--vncDesktop::CaptureScreen(RECT &rect, BYTE *scrBuff)
-+vncDesktop::CaptureScreen(const RECT &rect, BYTE *scrBuff)
- {
- 	
- 	// Protect the memory bitmap
-@@ -1476,7 +1481,7 @@ vncDesktop::MaskToMaxAndShift(DWORD mask
- 
- // Copy data from the memory bitmap into a buffer
- void
--vncDesktop::CopyToBuffer(RECT &rect, BYTE *destbuff)
-+vncDesktop::CopyToBuffer(const RECT &rect, BYTE *destbuff)
- {
- 	// Are we being asked to blit from the DIBsection to itself?
- 	if (destbuff == m_DIBbits) {
-diff -upr src.unpatched/vncDesktop.h src/vncDesktop.h
---- src.unpatched/vncDesktop.h	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncDesktop.h	2006-05-01 12:58:41.000000000 +0200
-@@ -86,7 +86,7 @@ public:
- 	void FillDisplayInfo(rfbServerInitMsg *scrInfo);
- 	void SetLocalInputDisableHook(BOOL enable);
- 	void SetLocalInputPriorityHook(BOOL enable);
--	void CaptureScreen(RECT &UpdateArea, BYTE *scrBuff);
-+	void CaptureScreen(const RECT &UpdateArea, BYTE *scrBuff);
- 	int ScreenBuffSize();
- 	HWND Window() { return m_hwnd; }
- 
-@@ -133,7 +133,7 @@ protected:
- 	BOOL InitHooks();
- 	BOOL SetPalette();
- 
--	void CopyToBuffer(RECT &rect, BYTE *scrBuff);
-+	void CopyToBuffer(const RECT &rect, BYTE *scrBuff);
- 	void CopyRectToBuffer(RECT &dest, POINT &source);
- 	void CalcCopyRects();
- 	
-@@ -164,10 +164,11 @@ protected:
- 	void BlankScreen(BOOL set);
- 
- 	// Timer identifiers (the third one is not used in any real timer)
--	enum TimerID {
-+	struct TimerID { enum {
- 		POLL = 1,
- 		BLANK_SCREEN = 2,
- 		RESTORE_SCREEN = 3
-+		} ;
- 	};
- 
- 	// Video driver stuff
-diff -upr src.unpatched/vncEncoder.cpp src/vncEncoder.cpp
---- src.unpatched/vncEncoder.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncEncoder.cpp	2006-05-01 12:58:41.000000000 +0200
-@@ -140,8 +140,8 @@ inline UINT
- vncEncoder::EncodeRect(BYTE *source, BYTE *dest, const RECT &rect, int offsetx, int offsety)
- {
- 
--	const rectW = rect.right - rect.left;
--	const rectH = rect.bottom - rect.top;
-+	const int rectW = rect.right - rect.left;
-+	const int rectH = rect.bottom - rect.top;
- 
- 
- 	// Create the header for the update in the destination area
-diff -upr src.unpatched/vncEncodeTight.cpp src/vncEncodeTight.cpp
---- src.unpatched/vncEncodeTight.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncEncodeTight.cpp	2006-05-27 14:23:47.000000000 +0200
-@@ -1455,7 +1455,7 @@ vncEncodeTight::SendJpegRect(BYTE *dst, 
- 	jpeg_set_defaults(&cinfo);
- 	jpeg_set_quality(&cinfo, quality, TRUE);
- 
--	JpegSetDstManager (&cinfo, dst, w * h * (m_localformat.bitsPerPixel / 8));
-+	JpegSetDstManager (&cinfo, (JOCTET*)dst, w * h * (m_localformat.bitsPerPixel / 8));
- 
- 	jpeg_start_compress(&cinfo, TRUE);
- 
-diff -upr src.unpatched/vncEncodeTight.h src/vncEncodeTight.h
---- src.unpatched/vncEncodeTight.h	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncEncodeTight.h	2006-05-29 23:09:11.000000000 +0200
-@@ -38,6 +38,7 @@ class vncEncodeTight;
- 
- #include "zlib/zlib.h"
- extern "C" {
-+#define XMD_H
- #include "libjpeg/jpeglib.h"
- }
- 
-diff -upr src.unpatched/vncEncodeZlib.cpp src/vncEncodeZlib.cpp
---- src.unpatched/vncEncodeZlib.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncEncodeZlib.cpp	2006-05-01 12:58:41.000000000 +0200
-@@ -86,8 +86,8 @@ vncEncodeZlib::NumCodedRects(RECT &rect)
- 	return 1;
- ******************************************************************/
- 
--	const rectW = rect.right - rect.left;
--	const rectH = rect.bottom - rect.top;
-+	const int rectW = rect.right - rect.left;
-+	const int rectH = rect.bottom - rect.top;
- 
- 	// Return the number of rectangles needed to encode the given
- 	// update.  ( ZLIB_MAX_SIZE(rectW) / rectW ) is the number of lines in 
-@@ -114,8 +114,8 @@ vncEncodeZlib::EncodeRect(BYTE *source, 
- 	offsety = offy;
- 	RECT partialRect;
- 
--	const rectW = rect.right - rect.left;
--	const rectH = rect.bottom - rect.top;
-+	const int rectW = rect.right - rect.left;
-+	const int rectH = rect.bottom - rect.top;
- 
- 	partialRect.right = rect.right;
- 	partialRect.left = rect.left;
-@@ -172,10 +172,10 @@ vncEncodeZlib::EncodeOneRect(BYTE *sourc
- 	int previousTotalOut;
- 	int deflateResult;
- 
--	const rectW = rect.right - rect.left;
--	const rectH = rect.bottom - rect.top;
--	const rawDataSize = (rectW*rectH*m_remoteformat.bitsPerPixel / 8);
--	const maxCompSize = (rawDataSize + (rawDataSize/100) + 8);
-+	const int rectW = rect.right - rect.left;
-+	const int rectH = rect.bottom - rect.top;
-+	const int rawDataSize = (rectW*rectH*m_remoteformat.bitsPerPixel / 8);
-+	const int maxCompSize = (rawDataSize + (rawDataSize/100) + 8);
- 
- 	// Send as raw if the update is too small to compress.
- 	if (rawDataSize < VNC_ENCODE_ZLIB_MIN_COMP_SIZE)
-diff -upr src.unpatched/vncKeymap.cpp src/vncKeymap.cpp
---- src.unpatched/vncKeymap.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncKeymap.cpp	2006-05-01 13:12:57.000000000 +0200
-@@ -183,8 +183,8 @@ inline void doKeyboardEvent(BYTE vkCode,
- class KeyStateModifier {
- public:
-   KeyStateModifier(int vkCode_, vncServer *server_, int flags_=0)
--    : vkCode(vkCode_), flags(flags_), server(server_),
--      pressed(false), released(false)
-+    : vkCode(vkCode_), flags(flags_),
-+      pressed(false), released(false), server(server_)
-   {}
-   void press() {
-     if (!(GetAsyncKeyState(vkCode) & 0x8000)) {
-diff -upr src.unpatched/vncRegion.cpp src/vncRegion.cpp
---- src.unpatched/vncRegion.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncRegion.cpp	2006-05-01 12:58:41.000000000 +0200
-@@ -46,7 +46,7 @@ vncRegion::~vncRegion()
- 	Clear();
- }
- 
--void vncRegion::AddRect(RECT &new_rect)
-+void vncRegion::AddRect(const RECT &new_rect)
- {
- 	HRGN newregion;
- 
-diff -upr src.unpatched/vncRegion.h src/vncRegion.h
---- src.unpatched/vncRegion.h	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncRegion.h	2006-05-01 12:58:41.000000000 +0200
-@@ -52,7 +52,7 @@ public:
- 	vncRegion();
- 	~vncRegion();
- 
--	void AddRect(RECT &rect);				// Add another rectangle to the regions
-+	void AddRect(const RECT &rect);				// Add another rectangle to the regions
- 	void SubtractRect(RECT &rect);			// Subtract a rectangle from the regions
- 	void Clear();							// Clear the current set of rectangles
- 	inline BOOL IsEmpty() {					// Is the region empty?
-diff -upr src.unpatched/vncServer.cpp src/vncServer.cpp
---- src.unpatched/vncServer.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncServer.cpp	2006-05-01 13:15:30.000000000 +0200
-@@ -87,7 +87,7 @@ vncServer::vncServer()
- 	// General options
- 	m_loopbackOnly = FALSE;
- 	m_disableTrayIcon = FALSE;
--	m_loopback_allowed = FALSE;
-+	m_loopback_allowed = TRUE;
- 	m_httpd_enabled = TRUE;
- 	m_httpd_params_enabled = FALSE;
- 	m_lock_on_exit = 0;
-@@ -146,6 +146,7 @@ vncServer::~vncServer()
- 		m_socketConn = NULL;
- 	}
- 
-+#if 0
- 	if (m_corbaConn != NULL)
- 	{
- 		delete m_corbaConn;
-@@ -157,6 +158,7 @@ vncServer::~vncServer()
- 		delete m_httpConn;
- 		m_httpConn = NULL;
- 	}
-+#endif
- 
- 	// Remove any active clients!
- 	KillAuthClients();
-@@ -991,6 +993,7 @@ vncServer::SockConnect(BOOL On)
- 				}
- 			}
- 
-+#if 0
- 			// Now let's start the HTTP connection stuff
- 			if (m_port_http == m_port) {
- 				vnclog.Print(LL_INTERR, VNCLOG("cannot start both RFB and HTTP servers "
-@@ -1008,6 +1011,7 @@ vncServer::SockConnect(BOOL On)
- 					}
- 				}
- 			}
-+#endif
- 		}
- 	}
- 	else
-@@ -1020,6 +1024,7 @@ vncServer::SockConnect(BOOL On)
- 		WaitUntilUnauthEmpty();
- #endif
- 
-+#if 0
- 		// Is there a listening socket?
- 		if (m_socketConn != NULL)
- 		{
-@@ -1035,6 +1040,7 @@ vncServer::SockConnect(BOOL On)
- 			delete m_httpConn;
- 			m_httpConn = NULL;
- 		}
-+#endif
- 	}
- 
- 	return TRUE;
-@@ -1049,6 +1055,7 @@ vncServer::SockConnected()
- BOOL
- vncServer::SetHttpdEnabled(BOOL enable_httpd, BOOL enable_params)
- {
-+#if 0
- 	if (enable_httpd != m_httpd_enabled) {
- 		m_httpd_enabled = enable_httpd;
- 		m_httpd_params_enabled = enable_params;
-@@ -1064,6 +1071,7 @@ vncServer::SetHttpdEnabled(BOOL enable_h
- 			}
- 		}
- 	}
-+#endif
- 	return TRUE;
- }
- 
-@@ -1106,6 +1114,7 @@ vncServer::GetDisableTrayIcon()
- BOOL
- vncServer::CORBAConnect(BOOL On)
- {
-+#if 0
- 	// Are we being asked to switch CORBA connects on or off?
- 	if (On)
- 	{
-@@ -1134,6 +1143,7 @@ vncServer::CORBAConnect(BOOL On)
- 		}
- 	}
- 
-+#endif
- 	return TRUE;
- }
- 
-diff -upr src.unpatched/vncServer.h src/vncServer.h
---- src.unpatched/vncServer.h	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncServer.h	2006-05-01 13:11:48.000000000 +0200
-@@ -68,7 +68,7 @@ class vncServer
- public:
- 	// Constructor/destructor
- 	vncServer();
--	~vncServer();
-+	virtual ~vncServer();
- 
- 	// Client handling functions
- 	virtual void DisableClients(BOOL state);
-diff -upr src.unpatched/vncService.cpp src/vncService.cpp
---- src.unpatched/vncService.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncService.cpp	2006-05-01 13:13:52.000000000 +0200
-@@ -223,6 +223,7 @@ vncService::VersionMinor()
- BOOL
- PostToWinVNC(UINT message, WPARAM wParam, LPARAM lParam)
- {
-+#if 0
- 	// Locate the hidden WinVNC menu window
- 	HWND hservwnd = FindWindow(MENU_CLASS_NAME, NULL);
- 	if (hservwnd == NULL)
-@@ -230,6 +231,7 @@ PostToWinVNC(UINT message, WPARAM wParam
- 
- 	// Post the message to WinVNC
- 	PostMessage(hservwnd, message, wParam, lParam);
-+#endif
- 	return TRUE;
- }
- 
-@@ -655,6 +657,7 @@ vncService::RunningAsService()
- BOOL
- vncService::KillRunningCopy()
- {
-+#if 0
- 	// Locate the hidden WinVNC menu window
- 	HWND hservwnd;
- 
-@@ -665,6 +668,7 @@ vncService::KillRunningCopy()
- 
- 		omni_thread::sleep(1);
- 	}
-+#endif
- 
- 	return TRUE;
- }
-@@ -863,7 +867,7 @@ void WINAPI ServiceMain(DWORD argc, char
- 	}
- 
- 	// Now start the service for real
--    omni_thread *workthread = omni_thread::create(ServiceWorkThread);
-+    omni_thread::create(ServiceWorkThread);
-     return;
- }
- 
-diff -upr src.unpatched/vncSockConnect.h src/vncSockConnect.h
---- src.unpatched/vncSockConnect.h	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncSockConnect.h	2006-05-01 13:11:27.000000000 +0200
-@@ -49,7 +49,7 @@ class vncSockConnect
- public:
- 	// Constructor/destructor
- 	vncSockConnect();
--	~vncSockConnect();
-+	virtual ~vncSockConnect();
- 
- 	// Init
- 	virtual VBool Init(vncServer *server, UINT port);
-diff -upr src.unpatched/vncTimedMsgBox.h src/vncTimedMsgBox.h
---- src.unpatched/vncTimedMsgBox.h	2006-06-11 17:40:26.000000000 +0200
-+++ src/vncTimedMsgBox.h	2006-05-01 12:58:41.000000000 +0200
-@@ -37,7 +37,7 @@ class vncTimedMsgBox
- {
- public:
- 	// Bring up a message box, wait for two seconds, then return
--	static void Do(const char *caption, const char *title, UINT type);
-+	static inline void Do(const char *, const char *, UINT ) { }
- };
- 
- #endif
-diff -upr src.unpatched/VSocket.cpp src/VSocket.cpp
---- src.unpatched/VSocket.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/VSocket.cpp	2006-05-01 13:10:57.000000000 +0200
-@@ -36,7 +36,7 @@ class VSocket;
- // System includes
- 
- #include "stdhdrs.h"
--#include <iostream.h>
-+#include <iostream>
- 
- #include <stdio.h>
- #ifdef __WIN32__
-diff -upr src.unpatched/WinVNC.cpp src/WinVNC.cpp
---- src.unpatched/WinVNC.cpp	2006-06-11 17:40:26.000000000 +0200
-+++ src/WinVNC.cpp	2006-05-01 12:58:41.000000000 +0200
-@@ -50,6 +50,7 @@ const char	*szAppName = "WinVNC";
- 
- DWORD		mainthreadId;
- 
-+#if 0
- // WinMain parses the command line and either calls the main App
- // routine or, under NT, the main service routine.
- int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
-@@ -309,6 +310,7 @@ int WINAPI WinMain(HINSTANCE hInstance, 
- 
- 	return 0;
- }
-+#endif
- 
- // This is the main routine for WinVNC when running as an application
- // (under Windows 95 or Windows NT)
-@@ -334,8 +336,10 @@ int WinVNCAppMain()
- 
- 	// Set the name and port number
- 	server.SetName(szAppName);
-+	server.SockConnect( TRUE );
- 	vnclog.Print(LL_STATE, VNCLOG("server created ok\n"));
- 
-+#if 0
- 	// Create tray icon & menu if we're running as an app
- 	vncMenu *menu = new vncMenu(&server);
- 	if (menu == NULL)
-@@ -343,6 +347,7 @@ int WinVNCAppMain()
- 		vnclog.Print(LL_INTERR, VNCLOG("failed to create tray menu\n"));
- 		PostQuitMessage(0);
- 	}
-+#endif
- 
- 	// Now enter the message handling loop until told to quit!
- 	MSG msg;
-@@ -354,8 +359,10 @@ int WinVNCAppMain()
- 
- 	vnclog.Print(LL_STATE, VNCLOG("shutting down server\n"));
- 
-+#if 0
- 	if (menu != NULL)
- 		delete menu;
-+#endif
- 
- 	return msg.wParam;
- }


hooks/post-receive
-- 
italc.git (Debian package italc)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "italc.git" (Debian package italc).




More information about the debian-edu-commits mailing list