[X2Go-Commits] nx-libs.git - build-main (branch) updated: nxproxy/3.0.0-4

X2Go dev team git-admin at x2go.org
Fri Aug 30 16:22:20 CEST 2013


The branch, build-main has been updated
  discards  bf85c6e696693ef5a277c0334c01493dedf4fadd (commit)
  discards  c70adf725d3fea94eabdde467b8b8b106a796c0a (commit)
  discards  2208f4f9ecf967579a364021f0847b3ad1d7777c (commit)
  discards  3d8e85c4749ee9e55601f6e540311008bf8f77af (commit)
  discards  3b4404668c6794f9d0665905f4e22c1a0fafac21 (commit)
  discards  9f7021392b921ad44163024ed8ca538195d3ac9c (commit)
  discards  c7dc0c3cdec2e0f2fa2d52f8d446d0e83623a8a0 (commit)
  discards  8fa612d1a931096ff57c9b90df0f13e6cd638da8 (commit)
       via  35472e34809a80b228f2763ef33d58acdb88dcce (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (bf85c6e696693ef5a277c0334c01493dedf4fadd)
            \
             N -- N -- N (35472e34809a80b228f2763ef33d58acdb88dcce)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 nxcompshad/CHANGELOG                               |  404 -----
 nxcompshad/Core.cpp                                |  614 --------
 nxcompshad/Core.h                                  |  204 ---
 nxcompshad/Input.cpp                               |  167 ---
 nxcompshad/Input.h                                 |   91 --
 nxcompshad/LICENSE                                 |   22 -
 nxcompshad/Logger.cpp                              |  116 --
 nxcompshad/Logger.h                                |  159 --
 nxcompshad/Makefile.in                             |  192 ---
 nxcompshad/Manager.cpp                             |  252 ----
 nxcompshad/Manager.h                               |  115 --
 nxcompshad/Poller.h                                |   31 -
 nxcompshad/Regions.h                               |   35 -
 nxcompshad/Shadow.cpp                              |  470 ------
 nxcompshad/Shadow.h                                |  101 --
 nxcompshad/Updater.cpp                             |  383 -----
 nxcompshad/Updater.h                               |   95 --
 nxcompshad/VERSION                                 |    1 -
 nxcompshad/Win.cpp                                 | 1137 --------------
 nxcompshad/Win.h                                   |  224 ---
 nxcompshad/X11.cpp                                 | 1586 --------------------
 nxcompshad/X11.h                                   |  131 --
 nxproxy/CHANGELOG                                  |  180 +++
 {nxcompshad => nxproxy}/COPYING                    |    0
 nxproxy/LICENSE                                    |   36 +
 nxcompshad/Misc.h => nxproxy/Main.c                |   67 +-
 nxproxy/Makefile.in                                |  101 ++
 nxproxy/README                                     |   14 +
 nxproxy/README-IPAQ                                |   27 +
 nxproxy/README-VALGRIND                            |   39 +
 nxproxy/VERSION                                    |    1 +
 .../configure => nxproxy/autom4te.cache/output.0   |  368 ++---
 nxproxy/autom4te.cache/requests                    |  115 ++
 nxproxy/autom4te.cache/traces.0                    |  134 ++
 {nxcompshad => nxproxy}/configure                  |  244 +--
 {nxcompshad => nxproxy}/configure.in               |  156 +-
 {nxcompshad => nxproxy}/install-sh                 |    0
 nxproxy/mkinstalldirs                              |   34 +
 38 files changed, 917 insertions(+), 7129 deletions(-)
 delete mode 100644 nxcompshad/CHANGELOG
 delete mode 100644 nxcompshad/Core.cpp
 delete mode 100644 nxcompshad/Core.h
 delete mode 100644 nxcompshad/Input.cpp
 delete mode 100644 nxcompshad/Input.h
 delete mode 100644 nxcompshad/LICENSE
 delete mode 100644 nxcompshad/Logger.cpp
 delete mode 100644 nxcompshad/Logger.h
 delete mode 100644 nxcompshad/Makefile.in
 delete mode 100644 nxcompshad/Manager.cpp
 delete mode 100644 nxcompshad/Manager.h
 delete mode 100644 nxcompshad/Poller.h
 delete mode 100644 nxcompshad/Regions.h
 delete mode 100644 nxcompshad/Shadow.cpp
 delete mode 100644 nxcompshad/Shadow.h
 delete mode 100644 nxcompshad/Updater.cpp
 delete mode 100644 nxcompshad/Updater.h
 delete mode 100644 nxcompshad/VERSION
 delete mode 100644 nxcompshad/Win.cpp
 delete mode 100644 nxcompshad/Win.h
 delete mode 100644 nxcompshad/X11.cpp
 delete mode 100644 nxcompshad/X11.h
 create mode 100644 nxproxy/CHANGELOG
 rename {nxcompshad => nxproxy}/COPYING (100%)
 create mode 100644 nxproxy/LICENSE
 rename nxcompshad/Misc.h => nxproxy/Main.c (52%)
 create mode 100644 nxproxy/Makefile.in
 create mode 100644 nxproxy/README
 create mode 100644 nxproxy/README-IPAQ
 create mode 100644 nxproxy/README-VALGRIND
 create mode 100644 nxproxy/VERSION
 copy nxcompshad/configure => nxproxy/autom4te.cache/output.0 (96%)
 mode change 100755 => 100644
 create mode 100644 nxproxy/autom4te.cache/requests
 create mode 100644 nxproxy/autom4te.cache/traces.0
 rename {nxcompshad => nxproxy}/configure (97%)
 rename {nxcompshad => nxproxy}/configure.in (57%)
 rename {nxcompshad => nxproxy}/install-sh (100%)
 create mode 100755 nxproxy/mkinstalldirs

The diff of changes is:
diff --git a/nxcompshad/CHANGELOG b/nxcompshad/CHANGELOG
deleted file mode 100644
index 3472a4a..0000000
--- a/nxcompshad/CHANGELOG
+++ /dev/null
@@ -1,404 +0,0 @@
-ChangeLog:
-
-nxcompshad-3.5.0-2
-
-- Fixed TR03G02189. Now key combinations involving the Shift keys
-  are recognized correctly.
-
-nxcompshad-3.5.0-1
-
-- Opened the 3.5.0 branch based on nxcompshad-3.4.0-3.
-
-- Updated copyright to year 2011.
-
-nxcompshad-3.4.0-3
-
-- Updated copyright to year 2010.
-
-nxcompshad-3.4.0-2
-
-- Fixed TR08G02256. Now the Shadow session is shown correctly with
-  MIT-SHM extension disabled.
-
-- Improved updateShadowFrameBuffer() and ~Poller() functions.
-
-- Avoided memory leak.
-
-nxcompshad-3.4.0-1
-
-- Opened the 3.4.0 branch based on nxcompshad-3.3.0-3.
-
-- Updated version number.
-
-- Updated copyright to year 2009.
-
-- Improved error messages logging in case of initialization failures.
-
-nxcompshad-3.3.0-3
-
-- Fixed TR01G02158. Keymap initialization could be incorrect because
-  of a type mismatch on 64 bit platforms.
-
-nxcompshad-3.3.0-2
-
-- Updated VERSION.
-
-nxcompshad-3.3.0-1
-
-- Opened the 3.3.0 branch based on nxcompshad-3.2.0-3.
-
-nxcompshad-3.2.0-3
-
-- Improved keycode translation.
-
-nxcompshad-3.2.0-2
-
-- Solved a problem when sending fake modifier events.
-
-- Added support for keyboard events handling for the web player.
-
-- Changed keycodes translation for Solaris keyboard.
-
-- Corrected a problem for keycodes translation from Solaris keyboard.
-
-- Fixed TR02F02001. In shadow session the shadower's keyboard layout
-  could be wrong. Now keycodes are correctly translated if master and
-  shadow keyboards have different layouts.
-
-- Added NXShadowGetScreenSize() and NXShadowSetScreenSize() functions,
-  so that the shadow session can handle correctly the resize of the
-  master session window.
-
-- Solved a compilation problem on GCC 4.3.
-
-nxcompshad-3.2.0-1
-
-- Opened the 3.2.0 branch based on nxcompshad-3.1.0-2.
-
-nxcompshad-3.1.0-2
-
-- Updated file VERSION to match the current release version.
-
-nxcompshad-3.1.0-1
-
-- Opened the 3.1.0 branch based on nxcompshad-3.0.0-19.
-
-nxcompshad-3.0.0-19
-
-- Skip initialization of damage extension if it was already disabled.
-
-nxcompshad-3.0.0-18
-
-- The poller destructor checks if the damage extension is in use.
-
-- Small changes to the function getting the screen content in the case
-  damage is not in use.
-
-nxcompshad-3.0.0-17
-
-- Cleanup of some log messages.
-
-nxcompshad-3.0.0-16
-
-- Disabled some log message in the functions initializing the poller.
-
-nxcompshad-3.0.0-15
-
-- Before calling XTest functions, it is checked if the connection to
-  master X server has been initialized.
-
-nxcompshad-3.0.0-14
-
-- After the shm segment is created, its mode is changed and it is
-  marked for destroying. A check on the number of attaches is done.
-
-nxcompshad-3.0.0-13
-
-- Creating the shm segment even if the uid of master X server can't be
-  retrieved.
-
-- Fixed reallocation of update region.
-
-- Checking if the master X server provides XTest extension.
-
-nxcompshad-3.0.0-12
-
-- Fixed a compiler warning on AMD64 platform.
-
-- Changed configure script to add -fPIC option.
-
-- Fixed a mismatch in UpdateManager destructor.
-
-nxcompshad-3.0.0-11
-
-- Fixed the function setting the uid of shm segment.
-
-- Sync with the master X server before marking the shm segment to be
-  destroyed.
-
-nxcompshad-3.0.0-10
-
-- Setting the shm segments as readable only by the master X server
-  process.
-
-- Mark shm segments to be destroyed when the last process detach.
-
-- Enabled keycode translation in order to allow keyboards of different
-  models to work.
-
-nxcompshad-3.0.0-9
-
-- Changed the LICENSE file to state that the software is only made
-  available under the version 2 of the GPL.
-
-- Added file COPYING.
-
-- Changes to translate keycodes between different keyboard types. The
-  keycodes are translated through the keysym.
-
-- Changes to convert a Mode_switch key to ISO_Level3_Shift if it is
-  needed.
-
-nxcompshad-3.0.0-8
-
-- Added interface function NXShadowDisableShm disabling the use of
-  MIT-SHM extension.
-
-- Added interface function NXShadowDisableDamage disabling the use of
-  DAMAGE extension.
-
-- Added interface function NXShadowSetDisplayUid setting the uid of
-  shadowed X server
-
-- Changed the owner of shared memory segments to the uid of the sha-
-  dowed X server.
-
-- Fixed logWarning method.
-
-- Moved the code initializing the use of shared memory to shmInit
-  method of X11 Poller.
-
-nxcompshad-3.0.0-7
-
-- Removed the class qualifier in the declaration of destroyUpdate-
-  ManagerRegion().
-
-nxcompshad-3.0.0-6
-
-- Fixed build errors on 64 bit platforms.
-
-- Called XTestGrabControl to override possible grabs of the X server.
-
-nxcompshad-3.0.0-5
-
-- Added some stub members to the Poller class. These are intended to
-  handle keyboard state.
-
-- Changes in the default polling algorithm to disable the line pri-
-  ority persistence.
-
-nxcompshad-3.0.0-4
-
-- If a low layer handling of screen changes is available (DAMAGE in
-  case of X11), polling routine uses it and returns immediately.
-
-- Creating a Damage notify object if the extension is supported.
-
-- DamageNotify events are saved in the update region. After all avail-
-  able events have been handled, the content of screen is retrieved
-  by ShnGetImage requests.
-
-- XDamageSubtract and XSync are done before any event handling.
-
-- Damages are requested as raw rectangles.
-
-- Added Xdamage and Xrandr to required libraries.
-
-- Fixed a problem with some lines not refreshed in shadowing mode.
-
-nxcompshad-3.0.0-3
-
-- Added destroyUpdateManagerRegion() method to UpdateManager class.
-
-- Turned off some log messages.
-
-- Changed configure.in to remove warnings related to deprecated header
-  files and options.
-
-- Changed Makefile.in to remove autom4te.cache dir if the target is
-  'distclean'.
-
-- Removed multi-word file names.
-
-nxcompshad-3.0.0-2
-
-- Changes to get the screen of original display by a ShmGetImage.
-
-- Exit the polling loop if more than 50 ms have elapsed.
-
-nxcompshad-3.0.0-1
-
-- Created nxcompshad based on nxshadow-3.0.0-7.
-
-nxshadow-3.0.0-7
-
-- Deleted files KeyCursorTmp.cpp, scancodes.h, constant.h.
-
-- Renamed NXshadow.h to Shadow.h.
-
-- Merged NXshadowEvent.h with Shadow.h.
-
-- Fixed configure.in, changed Makefile.in to build Xcompshad library,
-  rebuilt configure script.
-
-nxshadow-3.0.0-6
-
-- Implemented a callback mechanism to ask the caller program if screen
-  polling have to be suspended.
-
-nxshadow-3.0.0-5
-
-- Changes to comply with the library name.
-
-- Fixed a bug in CorePoller that could prevent the update of the last
-  line of a rectangle.
-
-nxshadow-3.0.0-4
-
-- Removed some parameters of the NXShadowAddUpdaterDisplay() function.
-
-nxshadow-3.0.0-3
-
-- Updated copyright notices to the current year.
-
-- Code cleanup in KeysCursorTmp.c file.
-
-nxshadow-3.0.0-2
-
-- If master agent uses shared memory extension, the GetImage is rea-
-  lized by XShmGetImage() function.
-
-- Added new parameters to NXShadowAddUpdaterDisplay() function, the
-  depth and bit mask color of the master display.
-
-nxshadow-3.0.0-1
-
-- Opened the nxshadow-3.0.0 branch based on the nxaccess-3.0.0-13.
-
-- Renamed NXaccess.h NXaccessEvent.h and RegionM.h files as NXshadow.h
-  NXshadowEvent.h and Regions.h.
-
-- Modified the Makefile.in file and configure scripts in order to
-  compile the component.
-
-nxaccess-3.0.0-13
-
-- Fixed X11Poller.cpp pre-processing.
-
-nxaccess-3.0.0-12
-
-- Fixed build problems on Solaris.
-
-nxaccess-3.0.0-11
-
-- Added NXShadowUpdateBuffer() function. This function creates the
-  buffer for the polling.
-
-- If the scaline fails, the polling will suspend for 50 ms.
-
-- Added some functions in order to access data member class.
-
-nxaccess-3.0.0-10
-
-- Used XTEST extension to make the shared display create input events.
-
-nxaccess-3.0.0-9
-
-- Added the mouse events.
-
-- Now, it's possible to connect to X server display or agent display,
-  the display's content is captured by GetImage and sent to another
-  display by PutImage.
-
-nxaccess-3.0.0-8
-
-- Added KeysCursorTmp.cpp file.
-
-- Solved a problem with the keys, when the window lost focus the Key-
-  Release events weren't propagated.
-
-nxaccess-3.0.0-7
-
-- Added functions in order to remove issues with some keys combina-
-  tion.
-
-nxaccess-3.0.0-6
-
-- Added functions to simulate keys Ctrl + Alt + Del in order to run
-  the Task Manager application.
-
-- Now nxaccess is able to manage all switches between desktops.
-
-nxaccess-3.0.0-5
-
-- Solved a problem with the cursor shape. After a while, the cursor
-  shape are no more updated.
-
-- Now the cursor is updated only when it changes its shape.
-
-- Removed a dirty lines after screen updates.
-
-- Removed the unused file Keyboard.cpp.
-
-- Added the colorCorrect() macro in NXaccess.h.
-
-- Removed the colorCorrect() function in Updater.cpp.
-
-nxaccess-3.0.0-4
-
-- Renamed some source files and functions conforming them to the name
-  of component.
-
-nxaccess-3.0.0-3
-
-- Removed the parameter of type Display in all methods of the class
-  Poller.
-
-- Print, Break and Pause keys are enabled.
-
-nxaccess-3.0.0-2
-
-- Modified the Makefile.in in order to avoid compiling the executive
-  file.
-
-- Removed the unused file Main.cpp.
-
-- The Windows keys are enabled.
-
-- Synchronized local and remote states of Num_Lock, Caps_Lock and
-  Scroll_Lock.
-
-- Updated the NoMachine copyright notices.
-
-nxaccess-3.0.0-1
-
-- Opened the 3.0.0 branch based on the nxmirror-2.0.0-3.
-
-nxmirror-2.0.0-3
-
-- Added the keyboard events for all layouts.
-
-- The mouse wheel button is enabled.
-
-nxmirror-2.0.0-2
-
-- Completed implementation of the keyboard events only for italian
-  layout.
-
-- Added the mouse events and shape cursor.
-
-nxmirror-2.0.0-1
-
-- Opened the 2.0.0 branch based on the 1.5.0-60.
-
-- Added CHANGELOG.
diff --git a/nxcompshad/Core.cpp b/nxcompshad/Core.cpp
deleted file mode 100644
index 6f94493..0000000
--- a/nxcompshad/Core.cpp
+++ /dev/null
@@ -1,614 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#include <string.h>
-#include <sys/time.h>
-
-#define PANIC
-#define WARNING
-#undef  TEST
-#undef  DEBUG
-
-#include "Core.h"
-#include "Logger.h"
-
-const int CorePoller::maxSliceHeight_ = 20;
-const int CorePoller::minSliceHeight_ = 3;
-
-const char CorePoller::interlace_[] =
-{
-  0, 16,
-  8, 24,
-  4, 20, 12, 28,
-  2, 18, 10, 26, 6, 22, 14, 30,
-  1, 17,
-  9, 25,
-  5, 21, 13, 29,
-  3, 19, 11, 27, 7, 23, 15, 31
-};
-
-CorePoller::CorePoller(Input *input, Display *display) : input_(input)
-{
-  logTrace("CorePoller::CorePoller");
-
-  buffer_ = NULL;
-  lastUpdatedRegion_ = NULL;
-  lineStatus_ = NULL;
-  linePriority_ = NULL;
-  lefts_ = NULL;
-  rights_ = NULL;
-}
-
-CorePoller::~CorePoller()
-{
-  logTrace("CorePoller::~CorePoller");
-
-  if (buffer_ != NULL)
-  {
-    delete [] buffer_;
-
-    buffer_ = NULL;
-  }
-
-  if (lastUpdatedRegion_ != NULL)
-  {
-    XDestroyRegion(lastUpdatedRegion_);
-
-    lastUpdatedRegion_ = NULL;
-  }
-
-  if (lineStatus_ != NULL)
-  {
-    delete [] lineStatus_;
-
-    lineStatus_ = NULL;
-  }
-
-  if (linePriority_ != NULL)
-  {
-    delete [] linePriority_;
-
-    linePriority_ = NULL;
-  }
-
-  if (lefts_ != NULL)
-  {
-    delete [] lefts_;
-
-    lefts_ = NULL;
-  }
-
-  if (rights_ != NULL)
-  {
-    delete [] rights_;
-
-    rights_ = NULL;
-  }
-}
-
-int CorePoller::init()
-{
-  logTrace("CorePoller::init");
-
-  createFrameBuffer();
-
-  if (buffer_ == NULL)
-  {
-    logError("CorePoller::init", ESET(ENOMEM));
-
-    return -1;
-  }
-
-  logTest("CorePoller::init", "Allocated frame buffer at [%p] for [%d] bytes.",
-            buffer_, bpl_ * height_);
-
-  if (lastUpdatedRegion_ != NULL)
-  {
-    XDestroyRegion(lastUpdatedRegion_);
-
-    lastUpdatedRegion_ = NULL;
-  }
-
-  lastUpdatedRegion_ = XCreateRegion();
-
-  if (lineStatus_ != NULL)
-  {
-    delete[] lineStatus_;
-  }
-
-  lineStatus_ = new LineStatus[height_ + 1];
-
-  if (lineStatus_ == NULL)
-  {
-    logError("CorePoller::init", ESET(ENOMEM));
-
-    return -1;
-  }
-
-  //
-  // We need this boundary element to
-  // speed up the algo.
-  //
-
-  if (linePriority_ != NULL)
-  {
-    delete[] linePriority_;
-  }
-
-  linePriority_ = new int [height_ + 1];
-
-  if (linePriority_ == NULL)
-  {
-    logError("CorePoller::init", ESET(ENOMEM));
-
-    return -1;
-  }
-
-  for (unsigned int i = 0; i < height_; i++)
-  {
-    linePriority_[i] = HIGHEST_PRIORITY;
-  }
-
-  if (lefts_ != NULL)
-  {
-    delete[] lefts_;
-  }
-
-  lefts_ = new int [height_];
-
-  if (rights_ != NULL)
-  {
-    delete[] rights_;
-  }
-
-  rights_ = new int [height_];
-
-  for (unsigned int i = 0; i < height_; i++)
-  {
-    rights_[i] = lefts_[i] = 0;
-  }
-
-  return 1;
-}
-
-int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *suspended)
-{
-  logTrace("CorePoller::isChanged");
-
-#if defined(__CYGWIN32__) || defined(WIN32)
-
-  checkDesktop();
-
-#endif
-
-#if !defined(__CYGWIN32__) && !defined(WIN32)
-
-  if (mirror_ == 1)
-  {
-    int result = mirrorChanges_;
-
-    mirrorChanges_ = 0;
-
-    return result;
-  }
-
-#endif
-
-  logDebug("CorePoller:isChanged", "Going to use default polling algorithm.\n");
-
-  //
-  // In order to allow this function to
-  // be suspended and resumed later, we
-  // need to save these two status vars.
-  // 
-
-  static int idxIlace = 0;
-  static int curLine = 0;
-
-
-  const long timeout = 50;
-  long oldTime;
-  long newTime;
-  struct timeval ts;
-
-  gettimeofday(&ts, NULL);
-
-  oldTime = ts.tv_sec * 1000 + ts.tv_usec / 1000;
-
-  if (curLine == 0) // && idxIlace == 0 ?
-  {
-    for (unsigned int i = 0; i < height_; i++)
-    {
-      lineStatus_[i] = LINE_NOT_CHECKED;
-    }
-  }
-
-  int foundChanges = 0;
-
-  foundChanges = 0;
-
-  int curIlace = interlace_[idxIlace];
-
-  bool moveBackward = false;
-
-  logDebug("CorePoller::isChanged", "Interlace index [%d] interlace [%d].", idxIlace, curIlace);
-
-  for (; curLine < (int) height_; curLine++)
-  {
-    logDebug("CorePoller::isChanged", "Analizing line [%d] move backward [%d] status [%d] priority [%d].",
-                curLine, moveBackward, lineStatus_[curIlace], linePriority_[curLine]);
-
-    //
-    // Ask the caller if the polling have to be suspended.
-    //
-
-    if ((*checkIfInputCallback)(arg) == 1)
-    {
-      *suspended = 1;
-
-      break;
-    }
-
-    //
-    // Suspend if too much time is elapsed.
-    //
-
-    gettimeofday(&ts, NULL);
-
-    newTime = ts.tv_sec * 1000 + ts.tv_usec / 1000;
-
-    if (newTime - oldTime >= timeout)
-    {
-      *suspended = 1;
-
-      break;
-    }
-
-    oldTime = newTime;
-
-    if (lineStatus_[curLine] != LINE_NOT_CHECKED)
-    {
-      continue;
-    }
-
-    if (moveBackward)
-    {
-      moveBackward = false;
-    }
-    else
-    {
-      switch (linePriority_[curLine])
-      {
-        case 1:
-        case 29:
-        {
-          //
-          // It was a priority,
-          // but now it may not be.
-          //
-        }
-        case 31:
-        {
-          //
-          // Not a priority, still isn't.
-          //
-
-          linePriority_[curLine] = NOT_PRIORITY;
-
-          break;
-        }
-        case 0:
-        {
-          //
-          // Make it a priority.
-          //
-
-          linePriority_[curLine] = PRIORITY;
-
-          break;
-        }
-        default:
-        {
-          linePriority_[curLine]--;
-
-          break;
-        }
-      }
-
-      if ((linePriority_[curLine] > PRIORITY) && ((curLine & 31) != curIlace))
-      {
-        continue;
-      }
-    }
-
-    XRectangle rect = {0, curLine, width_, 1};
-
-    char *buffer;
-
-    logDebug("CorePoller::isChanged", "Checking line [%d].", curLine);
-
-    if ((buffer = getRect(rect)) == NULL)
-    {
-      logDebug("CorePoller::isChanged", "Failed to retrieve line [%d].", curLine);
-
-      return -1;
-    }
-
-    if (memcmp(buffer, buffer_ + curLine * bpl_, bpl_) == 0 || differ(buffer, rect) == 0)
-    {
-      logDebug("CorePoller::isChanged", "Data buffer didn't change.");
-
-      lineStatus_[curLine] = LINE_NOT_CHANGED;
-
-      continue;
-    }
-
-    rect.x = lefts_[rect.y];
-    rect.width = rights_[rect.y] - lefts_[rect.y] + 1;
-
-    update(buffer + rect.x * bpp_, rect);
-
-    foundChanges = 1;
-
-    lineStatus_[curLine] = LINE_HAS_CHANGED;
-
-    //
-    // Wake up the next line.
-    //
-
-    if (linePriority_[curLine + 1] > PRIORITY)
-    {
-      linePriority_[curLine + 1] = HIGHEST_PRIORITY;
-    }
-
-    //
-    // Give this line priority.
-    //
-
-    linePriority_[curLine] = HIGHEST_PRIORITY;
-
-    //
-    // Wake up previous line.
-    //
-
-    if (curLine > 0 && lineStatus_[curLine - 1] == LINE_NOT_CHECKED)
-    {
-      moveBackward = true;
-      curLine -= 2;
-    }
-  }
-
-  //
-  // Execution reached the end of loop.
-  //
-
-  if (curLine == (int) height_)
-  {
-    idxIlace = (idxIlace + 1) % 32;
-
-    curLine = 0;
-  }
-
-  //
-  // Create the region of changed pixels.
-  //
-
-  if (foundChanges)
-  {
-    int start, last, curLine, left, right;
-
-    for (curLine = 0; curLine < (int) height_; curLine++)
-    {
-      if (lineStatus_[curLine] == LINE_HAS_CHANGED)
-      {
-        break;
-      }
-    }
-
-    start = curLine;
-    last = curLine;
-
-    left = lefts_[curLine];
-    right = rights_[curLine];
-    curLine++;
-
-    while (1)
-    {
-      for (; curLine < (int) height_; curLine++)
-      {
-        if (lineStatus_[curLine] == LINE_HAS_CHANGED)
-        {
-          break;
-        }
-      }
-
-      if (curLine == (int) height_)
-      {
-        break;
-      }
-
-      if ((curLine - last > minSliceHeight_) || (last - start > maxSliceHeight_))
-      {
-        XRectangle rect = {left, start, right - left + 1, last - start + 1};
-
-        XUnionRectWithRegion(&rect, lastUpdatedRegion_, lastUpdatedRegion_);
-
-        start = curLine;
-        left = lefts_[curLine];
-        right = rights_[curLine];
-      }
-      else
-      {
-        if (lefts_[curLine] < left)
-        {
-          left = lefts_[curLine];
-        }
-
-        if (rights_[curLine] > right)
-        {
-          right = rights_[curLine];
-        }
-      }
-
-      last = curLine;
-
-      curLine++;
-    }
-
-    //
-    // Send last block.
-    //
-
-    if (last >= start)
-    {
-      XRectangle rect = {left, start, right - left + 1, last - start + 1};
-
-      XUnionRectWithRegion(&rect, lastUpdatedRegion_, lastUpdatedRegion_);
-    }
-  }
-
-  return foundChanges;
-}
-
-int CorePoller::differ(char *buffer, XRectangle r)
-{
-  logTrace("CorePoller::differ");
-
-  int bpl = bpp_ * r.width;
-  int i;
-  char *pBuf;
-  char *pFb;
-
-  pBuf = (buffer);
-  pFb = (buffer_ + r.x + r.y * bpl_);
-
-  for (i = 0; i < bpl; i++)
-  {
-    if (*pFb++ != *pBuf++)
-    {
-      lefts_[r.y] = i / bpp_;
-
-      break;
-    }
-  }
-
-  if (i == bpl)
-  {
-    return 0;
-  }
-
-  pBuf = (buffer) + bpl - 1;
-  pFb = (buffer_ + r.x + r.y * bpl_) + bpl - 1;
-
-  int j = i - 1;
-
-  for (i = bpl - 1; i > j; i--)
-  {
-    if (*pFb-- != *pBuf--)
-    {
-      rights_[r.y] = i / bpp_;
-
-      break;
-    }
-  }
-
-  return 1;
-}
-
-void CorePoller::update(char *src, XRectangle r)
-{
-  logTrace("CorePoller::update");
-
-  char *dst = buffer_ + r.x * bpp_ + r.y * bpl_;
-  int bpl = bpp_ * r.width;
-
-  for (unsigned int i = 0; i < r.height; i++)
-  {
-    if(((r.x * bpp_ + r.y * bpl_) + bpl) > (bpl_ * height_))
-    {
-      //
-      // Out of bounds. Maybe a resize is going on.
-      //
-
-      continue;
-    }
-
-    memcpy(dst, src, bpl);
-
-    src += bpl;
-
-    dst += bpl_;
-  }
-}
-
-void CorePoller::handleEvent(Display *display, XEvent *event)
-{
-  logTrace("CorePoller::handleEvent");
-
-  switch (event -> type)
-  {
-    case KeyPress:
-    case KeyRelease:
-    {
-      handleKeyboardEvent(display, event);
-      break;
-    }
-    case ButtonPress:
-    case ButtonRelease:
-    case MotionNotify:
-    {
-      handleMouseEvent(display, event);
-      break;
-    }
-    default:
-    {
-      logTest("CorePoller::handleEvent", "Handling unexpected event [%d] from display [%p].",
-                  event -> type, display);
-      break;
-    }
-  }
-}
-
-void CorePoller::handleWebKeyEvent(KeySym keysym, Bool isKeyPress)
-{
-  logTrace("CorePoller::handleWebKeyEvent");
-
-  handleWebKeyboardEvent(keysym, isKeyPress);
-}
-
-void CorePoller::handleInput()
-{
-  while (input_ -> checkIfEvent())
-  {
-    Display *display = input_ -> currentDisplay();
-    XEvent *event = input_ -> popEvent();
-
-    handleEvent(display, event);
-
-    delete event;
-  }
-}
-
-void CorePoller::createFrameBuffer()
-{
-  logTrace("CorePoller::createFrameBuffer");
-
-  if (buffer_ == NULL)
-  {
-    buffer_ = new char[bpl_ * height_];
-  }
-}
diff --git a/nxcompshad/Core.h b/nxcompshad/Core.h
deleted file mode 100644
index 9bc8a64..0000000
--- a/nxcompshad/Core.h
+++ /dev/null
@@ -1,204 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#ifndef CorePoller_H
-#define CorePoller_H
-
-#include <stdio.h>
-
-#include "Logger.h"
-#include "Regions.h"
-#include "Input.h"
-
-typedef enum{
-  LINE_HAS_CHANGED,
-  LINE_NOT_CHECKED,
-  LINE_NOT_CHANGED
-} LineStatus;
-
-typedef enum{
-  HIGHEST_PRIORITY = 0,
-  PRIORITY = 30,
-  NOT_PRIORITY = 90
-} LinePriority;
-
-class CorePoller
-{
-  public:
-
-  CorePoller(Input*, Display*);
-
-  virtual ~CorePoller();
-
-  virtual int init();
-
-  unsigned int width() const;
-
-  unsigned int height() const;
-
-  unsigned char depth() const;
-
-  int isChanged(int (*)(void*), void *, int *);
-
-  char *getFrameBuffer() const;
-
-  void destroyFrameBuffer();
-
-  void createFrameBuffer();
-
-  Region lastUpdatedRegion();
-
-  Region getLastUpdatedRegion();
-
-  void handleInput();
-
-  void handleEvent(Display *, XEvent *);
-
-  void handleWebKeyEvent(KeySym keysym, Bool isKeyPress);
-
-  Display *getShadowDisplay();
-
-  void setShadowDisplay(Display *shadowDisplay);
-
-  protected:
-
-  unsigned int bpp_;
-
-  unsigned int bpl_;
-
-  unsigned int width_;
-
-  unsigned int height_;
-
-  int depth_;
-
-  char *buffer_;
-
-  unsigned long redMask_;
-  unsigned long greenMask_;
-  unsigned long blueMask_;
-  unsigned long colorMask_[3];
-
-  char mirror_;
-
-  char mirrorChanges_;
-
-  virtual int updateShadowFrameBuffer(void) = 0;
-
-  virtual char *getRect(XRectangle r) = 0;
-
-  int imageByteOrder_;
-
-  #ifdef __CYGWIN32__
-  virtual char checkDesktop(void) = 0;
-  #endif
-
-  Display *shadowDisplay_;
-
-  void update(char *src, XRectangle r);
-
-  Region lastUpdatedRegion_;
-
-  private:
-
-  virtual void handleKeyboardEvent(Display *, XEvent *) = 0;
-
-  virtual void handleWebKeyboardEvent(KeySym keysym, Bool isKeyPress) = 0;
-
-  virtual void handleMouseEvent(Display *, XEvent *) = 0;
-
-  Input *input_;
-
-  static const int maxSliceHeight_;
-  static const int minSliceHeight_;
-
-  LineStatus *lineStatus_;
-  int *linePriority_;
-
-  static const char interlace_[];
-
-  int *lefts_;
-  int *rights_;
-
-  // FIXME: Make them friend.
-
-  int differ(char *src, XRectangle r);
-};
-
-inline unsigned int CorePoller::width() const
-{
-  return width_;
-}
-
-inline unsigned int CorePoller::height() const
-{
-  return height_;
-}
-
-inline unsigned char CorePoller::depth() const
-{
-  return depth_;
-}
-
-inline char *CorePoller::getFrameBuffer() const
-{
-  return buffer_;
-}
-
-inline void CorePoller::destroyFrameBuffer()
-{
-  if (buffer_ != NULL)
-  {
-    delete[] buffer_;
-    buffer_ = NULL;
-  }
-}
-
-inline Region CorePoller::lastUpdatedRegion()
-{
-  Region region = lastUpdatedRegion_;
-
-  lastUpdatedRegion_ = XCreateRegion();
-
-  if (lastUpdatedRegion_ == NULL)
-  {
-    logError("CorePoller::lastUpdatedRegion", ESET(ENOMEM));
-
-    lastUpdatedRegion_ = region;
-
-    return NULL;
-  }
-
-  return region;
-}
-
-inline Region CorePoller::getLastUpdatedRegion()
-{
-  return lastUpdatedRegion_;
-}
-
-inline Display *CorePoller::getShadowDisplay()
-{
-  return shadowDisplay_ ;
-}
-
-inline void CorePoller::setShadowDisplay(Display *shadowDisplay)
-{
-  shadowDisplay_ = shadowDisplay;
-}
-
-#endif /* CorePoller_H */
diff --git a/nxcompshad/Input.cpp b/nxcompshad/Input.cpp
deleted file mode 100644
index f9bf181..0000000
--- a/nxcompshad/Input.cpp
+++ /dev/null
@@ -1,167 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#include <string.h>
-
-#define PANIC
-#define WARNING
-#undef  TEST
-#undef  DEBUG
-
-#include "Input.h"
-#include "Logger.h"
-
-Input::Input()
-{
-  logTrace("Input::Input");
-
-  eventsHead_ = NULL;
-  eventsTail_ = NULL;
-  keymap_ = NULL;
-}
-
-Input::~Input()
-{
-  logTrace("Input::~Input");
-
-  Event *head = eventsHead_;
-
-  while (head)
-  {
-    Event *next = head -> next;
-
-    delete head -> event;
-    delete head;
-
-    head = next;
-  }
-
-  if (keymap_ != NULL)
-  {
-    logDebug("Input::~Input", "Delete keymap_ [%p].", keymap_);
-
-    delete [] keymap_;
-  }
-}
-
-void Input::pushEvent(Display *display, XEvent *event)
-{
-  Event *tail = new Event;
-
-  if (tail == NULL)
-  {
-    logError("Input::pushEvent", ESET(ENOMEM));
-
-    return;
-  }
-
-  tail -> next = NULL;
-  tail -> display = display;
-  tail -> event = event;
-
-  if (eventsHead_ == NULL)
-  {
-    eventsHead_ = tail;
-  }
-  else
-  {
-    eventsTail_ -> next = tail;
-  }
-
-  eventsTail_ = tail;
-}
-
-XEvent *Input::popEvent()
-{
-  Event *head = eventsHead_;
-
-  if (head == NULL)
-  {
-    return 0;
-  }
-
-  XEvent *event = head -> event;
-
-  eventsHead_ = head -> next;
-
-  delete head;
-
-  if (eventsHead_ == NULL)
-  {
-    eventsTail_ = NULL;
-  }
-
-  return event;
-}
-
-int Input::removeAllEvents(Display *display)
-{
-  logTrace("Input::removeAllEvents");
-
-  int nRemoved = 0;
-
-  Event *current = eventsHead_;
-
-  while (current)
-  {
-    if (display == current -> display)
-    {
-      //
-      // Update head of list.
-      //
-
-      if (current == eventsHead_)
-      {
-        eventsHead_ = current -> next;
-      }
-
-      //
-      // Update tail of list.
-      //
-
-      if (current == eventsTail_)
-      {
-        eventsTail_ = eventsHead_;
-
-        while (eventsTail_ && eventsTail_ -> next)
-        {
-          eventsTail_ = eventsTail_ -> next;
-        }
-      }
-
-      //
-      // Remove event.
-      //
-
-      Event *next = current -> next;
-
-      delete current -> event;
-      delete current;
-
-      current = next;
-
-      nRemoved++;
-    }
-    else
-    {
-      current = current -> next;
-    }
-  }
-
-  return nRemoved;
-}
-
diff --git a/nxcompshad/Input.h b/nxcompshad/Input.h
deleted file mode 100644
index 6250e79..0000000
--- a/nxcompshad/Input.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#ifndef Input_H
-#define Input_H
-
-#include <X11/Xlib.h>
-
-typedef struct Event
-{
-  struct Event *next;
-  Display *display;
-  XEvent *event;
-} Event;
-
-class Input
-{
-  public:
-
-  Input();
-
-  ~Input();
-
-  int checkIfEvent();
-
-  void pushEvent(Display *, XEvent *);
-
-  XEvent *popEvent();
-  Display *currentDisplay();
-
-  int removeAllEvents(Display *);
-
-  void setKeymap(char *keymap);
-  char *getKeymap();
-
-  void setShadowDisplayName(char *shadowDisplayName);
-  char *getShadowDisplayName();
-
-  private:
-
-  Event *eventsHead_;
-  Event *eventsTail_;
-  char *keymap_;
-  char *shadowDisplayName_;
-};
-
-inline Display *Input::currentDisplay()
-{
-  return eventsHead_ ? eventsHead_ -> display : NULL;
-}
-
-inline int Input::checkIfEvent()
-{
-  return (eventsHead_ != NULL);
-}
-
-inline void Input::setKeymap(char *keymap)
-{
-  keymap_ = keymap;
-}
-
-inline char *Input::getKeymap()
-{
-  return keymap_;
-}
-
-inline void Input::setShadowDisplayName(char *shadowDisplayName)
-{
-  shadowDisplayName_ = shadowDisplayName;
-}
-
-inline char *Input::getShadowDisplayName()
-{
-  return shadowDisplayName_;
-}
-
-#endif /* Input_H */
diff --git a/nxcompshad/LICENSE b/nxcompshad/LICENSE
deleted file mode 100644
index 2c7f95a..0000000
--- a/nxcompshad/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2001, 2011 NoMachine - http://www.nomachine.com/.
-
-NXCOMPSHAD and NX extensions to X are copyright of NoMachine.
-
-Redistribution and use of this software is allowed according to the
-following terms:
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License Version 2, and
-not any other version, as published by the Free Software Foundation.
-
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTA-
-BILITY or FITNESS FOR A PARTICULAR PURPOSE.  See 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, you can request a copy to NoMachine
-or write to the Free Software Foundation, Inc., 59 Temple Place,
-Suite 330, Boston, MA  02111-1307 USA
-
-All rights reserved.
diff --git a/nxcompshad/Logger.cpp b/nxcompshad/Logger.cpp
deleted file mode 100644
index c367c5d..0000000
--- a/nxcompshad/Logger.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMP, NX protocol compression and NX extensions to this software     */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#include <stdio.h>
-#include <ctype.h>
-#include <unistd.h>
-
-#define PANIC
-#define WARNING
-#undef  TEST
-#define DEBUG
-
-#include "Misc.h"
-#include "Logger.h"
-
-Logger logger;
-
-void Logger::user(const char *format, va_list arguments)
-{
-  char string[1024];
-
-  vsnprintf(string, 1024, format, arguments);
-
-  fprintf(stderr, "%s\n", string);
-}
-
-void Logger::error(const char *name, int error)
-{
-  fprintf(stderr, "PANIC! %s: Failed with code %d: %s\n",
-               name, error, strerror(error));
-}
-
-void Logger::warning(const char *name, const char *format, va_list arguments)
-{
-  char string[1024];
-
-  vsnprintf(string, 1024, format, arguments);
-
-  fprintf(stderr, "%s: WARNING! %s\n", name, string);
-}
-
-void Logger::test(const char *name, const char *format, va_list arguments)
-{
-  char string[1024];
-
-  vsnprintf(string, 1024, format, arguments);
-
-  fprintf(stderr, "%s: %s\n", name, string);
-}
-
-void Logger::trace(const char *name)
-{
-  fprintf(stderr, "%s\n", name);
-}
-
-void Logger::debug(const char *name, const char *format, va_list arguments)
-{
-  char string[1024];
-
-  vsnprintf(string, 1024, format, arguments);
-
-  fprintf(stderr, "%s: %s\n", name, string);
-}
-
-void Logger::dump(const char *name, const char *data, int size)
-{
-  fprintf(stderr, "%s: Dumping %d bytes of data at %p\n",
-              name, size, data);
-
-  for (int i = 0; i < size;)
-  {
-    fprintf(stderr, "[%d]\t", i);
-
-    int t = i;
-
-    for (unsigned int ii = 0; i < size && ii < 8; i++, ii++)
-    {
-      fprintf(stderr, "%02x/%d\t", data[i] & 0xff, data[i]);
-    }
-
-    for (unsigned int ii = i % 8; ii > 0 && ii < 8; ii++)
-    {
-      fprintf(stderr, "\t");
-    }
-
-    i = t;
-
-    for (unsigned int ii = 0; i < size && ii < 8; i++, ii++)
-    {
-      if (isprint(data[i]))
-      {
-        fprintf(stderr, "%c", data[i]);
-      }
-      else
-      {
-        fprintf(stderr, ".");
-      }
-    }
-
-    fprintf(stderr, "\n");
-  }
-}
diff --git a/nxcompshad/Logger.h b/nxcompshad/Logger.h
deleted file mode 100644
index 94e4da8..0000000
--- a/nxcompshad/Logger.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMP, NX protocol compression and NX extensions to this software     */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#ifndef Logger_H
-#define Logger_H
-
-#include <errno.h>
-#include <stdarg.h>
-
-//
-// Error handling macros.
-//
-
-#define ESET(e)  (errno = (e))
-#define EGET()   (errno)
-#define ESTR()   strerror(errno)
-
-extern class Logger logger;
-
-class Logger
-{
-  public:
-
-  void user(const char *format, va_list arguments);
-
-  void error(const char *name, int error);
-
-  void warning(const char *name, const char *format, va_list arguments);
-
-  void test(const char *name, const char *format, va_list arguments);
-
-  void trace(const char *name);
-
-  void debug(const char *name, const char *format, va_list arguments);
-
-  void dump(const char *name, const char *data, int size);
-};
-
-static inline void logUser(const char *format, ...) \
-    __attribute__((format(printf, 1, 2))) __attribute__((__unused__));
-
-static inline void logError(const char *name, int error) \
-    __attribute__((__unused__));
-
-static inline void logWarning(const char *name, const char *format, ...) \
-    __attribute__((__unused__));
-
-static inline void logTest(const char *name, const char *format, ...) \
-    __attribute__((format(printf, 2, 3))) __attribute__((__unused__));
-
-static inline void logTrace(const char *name) \
-    __attribute__((__unused__));
-
-static inline void logDebug(const char *name, const char *format, ...) \
-    __attribute__((format(printf, 2, 3))) __attribute__((__unused__));
-
-static inline void logDump(const char *name, const char *data, int size) \
-    __attribute__((__unused__));
-
-static inline void logUser(const char *format, ...)
-{
-  va_list arguments;
-
-  va_start(arguments, format);
-
-  logger.user(format, arguments);
-
-  va_end(arguments);
-}
-
-static inline void logError(const char *name, int error)
-{
-  #if defined(DEBUG) || defined(TEST) || \
-          defined(WARNING) || defined(PANIC)
-
-  logger.error(name, error);
-
-  #endif
-}
-
-static inline void logWarning(const char *name, const char *format, ...)
-{
-  #if defined(DEBUG) || defined(TEST) || \
-          defined(WARNING)
-
-  va_list arguments;
-
-  va_start(arguments, format);
-
-  logger.warning(name, format, arguments);
-
-  va_end(arguments);
-
-  #endif
-}
-
-static inline void logTest(const char *name, const char *format, ...)
-{
-  #if defined(TEST)
-
-  va_list arguments;
-
-  va_start(arguments, format);
-
-  logger.test(name, format, arguments);
-
-  va_end(arguments);
-
-  #endif
-}
-
-static inline void logTrace(const char *name)
-{
-  #if defined(DEBUG)
-
-  logger.trace(name);
-
-  #endif
-}
-
-static inline void logDebug(const char *name, const char *format, ...)
-{
-  #if defined(DEBUG)
-
-  va_list arguments;
-
-  va_start(arguments, format);
-
-  logger.debug(name, format, arguments);
-
-  va_end(arguments);
-
-  #endif
-}
-
-static inline void logDump(const char *name, const char *data, int size)
-{
-  #if defined(TEST)
-
-  logger.dump(name, data, size);
-
-  #endif
-}
-
-#endif /* Logger_H */
diff --git a/nxcompshad/Makefile.in b/nxcompshad/Makefile.in
deleted file mode 100644
index 1580a35..0000000
--- a/nxcompshad/Makefile.in
+++ /dev/null
@@ -1,192 +0,0 @@
-############################################################################
-#                                                                          #
-#  Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.          #
-#                                                                          #
-#  NXCOMP, NX protocol compression and NX extensions to this software      #
-#  are copyright of NoMachine. Redistribution and use of the present       #
-#  software is allowed according to terms specified in the file LICENSE    #
-#  which comes in the source distribution.                                 #
-#                                                                          #
-#  Check http://www.nomachine.com/licensing.html for applicability.        #
-#                                                                          #
-#  NX and NoMachine are trademarks of Medialogic S.p.A.                    #
-#                                                                          #
-#  All rights reserved.                                                    #
-#                                                                          #
-############################################################################
-
-#
-# Get values from configure script.
-#
-
-VERSION=@VERSION@
-LIBVERSION=@LIBVERSION@
-
-#
-# We would really like to enable all warnings, -Wredundant-decls,
-# though, gives a warning caused by pthread.h and unistd.h and
-# GCC 3.4 was changed in a way that it now complains about some
-# of the -W directives we used before (-Wmissing-declarations,
-# -Wnested-externs, -Wstrict-prototypes and -Wmissing-prototypes).
-#
-
-CXX         = @CXX@
-CXXFLAGS    = @CXXFLAGS@ @X_CFLAGS@ @DEFS@ \
-              -Wall -Wpointer-arith
-CXXINCLUDES =
-CXXDEFINES  =
-
-#
-# C programs don't share the C++ flags. They should
-# have their own @CCFLAGS at .
-#
-
-CC          = @CC@
-CCFLAGS     = @X_CFLAGS@ @DEFS@ \
-              -Wall -Wpointer-arith
-CCINCLUDES  =
-CCDEFINES   =
-
-LDFLAGS     = @LDFLAGS@
-LIBS        = @LIBS@ -L/usr/X11R6/lib -lX11
-
-#
-# Only if THREADS is defined.
-#
-# LIBS = $(LIBS) -lpthread
-#
-
-#
-# Only if you want ElectricFence.
-#
-# LIBS = $(LIBS) -lefence
-#
-
-#
-# Only if you want mpatrol.
-#
-# LIBS = $(LIBS) -lmpatrol -lbfd -liberty
-#
-
-srcdir      = @srcdir@
-prefix      = @prefix@
-exec_prefix = @exec_prefix@
-bindir      = @bindir@
-man1dir     = @mandir@/man1
-VPATH       = @srcdir@
-
-INSTALL         = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA    = @INSTALL_DATA@
-
-#
-# This should be autodetected.
-#
-
-MAKEDEPEND     = @MAKEDEPEND@
-DEPENDINCLUDES = -I/usr/include/g++ -I/usr/include/g++-3
-
-.SUFFIXES: .cpp.c
-
-.cpp.o:
-	$(CXX) -c $(CXXFLAGS) $(CXXINCLUDES) $(CXXDEFINES) $<
-.c.o:
-	$(CC) -c $(CCFLAGS) $(CCINCLUDES) $(CCDEFINES) $<
-
-LIBRARY = Xcompshad
-
-LIBNAME    = lib$(LIBRARY)
-LIBFULL    = lib$(LIBRARY).so.$(VERSION)
-LIBLOAD    = lib$(LIBRARY).so.$(LIBVERSION)
-LIBSHARED  = lib$(LIBRARY).so
-LIBARCHIVE = lib$(LIBRARY).a
-
-MSRC   = Main.c
-
-CSRC   =
-
-CXXSRC = Core.cpp \
-	 Input.cpp \
-	 Logger.cpp \
-	 Shadow.cpp \
-	 X11.cpp \
-	 Win.cpp \
-	 Updater.cpp \
-	 Manager.cpp
-
-MOBJ   = $(MSRC:.c.cpp=.o)
-COBJ   = $(CSRC:.c=.o)
-CXXOBJ = $(CXXSRC:.cpp=.o)
-
-MLIBS  = -L. -lXShadow
-
-ifeq ($(findstring -lgdi32,$(LIBS)),-lgdi32)
-
-# We need a smarter way to detect windows
-# platform.
-
-LIBDLL       = cyg$(LIBRARY).dll
-LIBDLLSTATIC = lib${LIBRARY}.dll.a
-
-all: depend $(LIBARCHIVE) $(LIBDLL)
-
-else
-
-EXTRALIBS = -lXtst -lXrandr -lXdamage
-
-all: depend $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE)
-
-endif
-
-$(LIBFULL):	$(CXXOBJ) $(COBJ)
-		$(CXX) -o $@ $(LDFLAGS) $(CXXOBJ) $(COBJ) $(LIBS) $(EXTRALIBS)
-
-$(LIBLOAD):	$(LIBFULL)
-		rm -f $(LIBLOAD)
-		ln -s $(LIBFULL) $(LIBLOAD)
-
-$(LIBSHARED):	$(LIBFULL)
-		rm -f $(LIBSHARED)
-		ln -s $(LIBFULL) $(LIBSHARED)
-
-$(LIBARCHIVE):	$(CXXOBJ) $(COBJ)
-		rm -f  $(LIBARCHIVE)
-		ar clq $(LIBARCHIVE) $(CXXOBJ) $(COBJ)
-		ranlib $(LIBARCHIVE)
-
-$(LIBDLL): $(LIBARCHIVE)
-		$(CC) -o $@ \
-		-shared \
-		-Wl,--out-implib=$(LIBDLLSTATIC) \
-		-Wl,--export-all-symbols \
-		-Wl,--enable-auto-import \
-		-Wl,--whole-archive ${LIBARCHIVE} \
-		-Wl,--no-whole-archive \
-		${LIBS} -L/usr/X11R6/lib
-
-$(PROGRAM):	$(MOBJ) $(COBJ) $(CXXOBJ) $(LIBDLL)
-#		$(CC) $(CCFLAGS) -o $@ $(MOBJ) $(MLIBS)
-
-depends:	depend.status
-
-depend:		depend.status
-
-depend.status:	
-		if [ -x $(MAKEDEPEND) ] ; then \
-			$(MAKEDEPEND) $(CXXINCLUDES) $(CCINCLUDES) \
-                        $(DEPENDINCLUDES) -f Makefile $(MSRC) $(CSRC) $(CXXSRC) 2>/dev/null; \
-		fi
-		touch depend.status
-
-install:	install.bin install.man
-
-install.bin:
-
-install.man:
-
-clean:
-		-rm -f *~ *.o *.bak st?????? core core.* *.out.* *.exe.stackdump \
-		$(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) $(LIBDLL) $(LIBDLLSTATIC) $(PROGRAM) $(PROGRAM).exe
-
-distclean:	clean
-		-rm -rf config.status config.log config.cache depend.status Makefile tags autom4te.cache
diff --git a/nxcompshad/Manager.cpp b/nxcompshad/Manager.cpp
deleted file mode 100644
index ba9260a..0000000
--- a/nxcompshad/Manager.cpp
+++ /dev/null
@@ -1,252 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/keysym.h>
-#include <string.h>
-
-#define PANIC
-#define WARNING
-#undef  TEST
-#undef  DEBUG
-
-#include "Manager.h"
-#include "Logger.h"
-
-UpdateManager::UpdateManager(int w, int h, char *f, Input *i)
-  : width_(w), height_(h), frameBuffer_(f), input_(i)
-{
-  logTrace("UpdateManager::UpdateManager");
-
-  nUpdater = 0;
-  updaterVector = NULL;
-  updateManagerRegion_ = NULL;
-}
-
-UpdateManager::~UpdateManager()
-{
-  logTrace("UpdateManager::~UpdateManager");
-
-  for (int i = 0; i < nUpdater; i++)
-  {
-    delete updaterVector[i];
-  }
-
-  delete [] updaterVector;
-}
-
-Updater *UpdateManager::createUpdater(char *displayName, Display *display)
-{
-  Updater *updater = new Updater(displayName, display);
-
-  if (updater == NULL)
-  {
-    logError("UpdateManager::createUpdater", ESET(ENOMEM));
-
-    return NULL;
-  }
-
-  if (updater -> init(width_, height_, frameBuffer_, input_) == -1)
-  {
-    logError("UpdateManager::createUpdater", EGET());
-
-    delete updater;
-
-    return NULL;
-  }
-
-  return updater;
-}
-
-UpdaterHandle UpdateManager::addUpdater(char *displayName, Display *display)
-{
-  Updater *newUpdater = createUpdater(displayName, display);
-
-  if (newUpdater == NULL)
-  {
-    logError("UpdateManager::addUpdater", EGET());
-
-    return NULL;
-  }
-
-  Updater **newUpdaterVector = new Updater*[nUpdater + 1];
-
-  if (newUpdaterVector == NULL)
-  {
-    logError("UpdateManager::addUpdater", ESET(ENOMEM));
-
-    delete newUpdater;
-
-    return NULL;
-  }
-
-  for (int i = 0; i < nUpdater; i++)
-  {
-    newUpdaterVector[i] = updaterVector[i];
-  }
-
-  newUpdaterVector[nUpdater] = newUpdater;
-
-  delete [] updaterVector;
-
-  updaterVector = newUpdaterVector;
-
-  nUpdater++;
-
-  logTest("UpdateManager::AddUpdater", "Number of updaters [%d].", nUpdater);
-
-  return reinterpret_cast<UpdaterHandle>(newUpdater);
-}
-
-int UpdateManager::removeAllUpdaters()
-{
-  logTest("UpdateManager::removeAllUpdaters", "Number of updaters [%d].", nUpdater);
-
-  int nullUpdaters = 0;
-
-  for (int i = nUpdater; i > 0; i--)
-  {
-    if (removeUpdater(reinterpret_cast<UpdaterHandle>(updaterVector[i - 1])) == 0)
-    {
-      nullUpdaters++;
-    }
-  }
-
-  if (nUpdater == 0)
-  {
-    return 1;
-  }
-
-  if (nUpdater == nullUpdaters)
-  {
-    logTest("UpdateManager::removeAllUpdaters", "Ignored null records in Updater vector.");
-
-    return 0;
-  }
-
-  logTest("UpdateManager::removeAllUpdaters", "Failed to remove some updaters.");
-
-  return -1;
-}
-
-int UpdateManager::removeUpdater(UpdaterHandle handle)
-{
-  Updater * const updater = (Updater*) handle;
-
-  logTest("UpdateManager::removeUpdater", "Removing Updater [%p].", updater);
-
-  if (updater == NULL)
-  {
-    return 0;
-  }
-
-  for (int i = 0; i < nUpdater; i++)
-  {
-    if (updater == updaterVector[i])
-    {
-      updaterVector[i] = updaterVector[nUpdater - 1];
-
-      nUpdater--;
-
-      delete updater;
-
-      return 1;
-    }
-  }
-
-  logTest("UpdateManager::removeUpdater", "Couldn't find Updater [%p].", updater);
-
-  return -1;
-}
-
-void UpdateManager::addRegion(Region region)
-{
-  logTrace("UpdateManager::addRegion");
-
-  for (int i = 0; i < nUpdater; i++)
-  {
-    updaterVector[i] -> addRegion(region);
-  }
-
-  XDestroyRegion(region);
-}
-
-void UpdateManager::update()
-{
-  logTrace("UpdateManager::update");
-
-  for (int i = 0; i < nUpdater; i++)
-  {
-    /*updaterVector[i] -> update();*/
-    if (updaterVector[i] -> getUpdateRegion())
-    {
-      logDebug("UpdateManager::update", "pRegion [%p] rect[%ld].",
-                   updaterVector[i] -> getUpdateRegion(), (updaterVector[i] -> getUpdateRegion()) -> numRects);
-
-      updateManagerRegion_ = updaterVector[i] -> getUpdateRegion();
-      //
-      // FIXME: Remove me.
-      //
-      for (int j = 0; j < updateManagerRegion_ -> numRects; j++)
-      {
-        int x = updateManagerRegion_ -> rects[j].x1;
-        int y = updateManagerRegion_ -> rects[j].y1;
-        unsigned int width = updateManagerRegion_ -> rects[j].x2 - updateManagerRegion_ -> rects[j].x1;
-        unsigned int height = updateManagerRegion_ -> rects[j].y2 - updateManagerRegion_ -> rects[j].y1;
-        logDebug("UpdateManager::update", "x[%d]y[%d]width[%u]height[%u], updateManagerRegion_[%p]",
-                  x, y, width, height, updateManagerRegion_);
-      }
-    }
-  }
-}
-
-void UpdateManager::handleInput()
-{
-  logTrace("UpdateManager::handleInput");
-
-  for (int i = 0; i < nUpdater; i++)
-  {
-    try
-    {
-      updaterVector[i] -> handleInput();
-    }
-    catch (UpdaterClosing u)
-    {
-      logTest("UpdateManager::handleInput", "Catched exception UpdaterClosing().");
-
-      removeUpdater((UpdaterHandle)updaterVector[i]);
-
-      //
-      // Now the i-element of the updaterVector
-      // is changed. We don't want to skip it.
-      //
-
-      i--;
-    }
-  }
-}
-
-void UpdateManager::newRegion()
-{
-  logTrace("UpdateManager::newRegion");
-
-  for (int i = 0; i < nUpdater; i++)
-  {
-    updaterVector[i] -> newRegion();
-  }
-}
diff --git a/nxcompshad/Manager.h b/nxcompshad/Manager.h
deleted file mode 100644
index 2677549..0000000
--- a/nxcompshad/Manager.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#ifndef UpdateManager_H
-#define UpdateManager_H
-
-#include <X11/Xlib.h>
-
-#include "Updater.h"
-#include "Regions.h"
-#include "Input.h"
-
-typedef char* UpdaterHandle;
-
-class UpdateManager
-{
-  public:
-
-  UpdateManager(int, int, char *, Input *);
-
-  ~UpdateManager();
-
-  void handleInput();
-
-  void addRegion(Region);
-
-  void update();
-
-  UpdaterHandle addUpdater(char *displayName, Display *display);
-
-  int removeUpdater(UpdaterHandle);
-
-  int removeAllUpdaters();
-
-  int numberOfUpdaters();
-
-  int getWidth();
-
-  int getHeight();
-
-  char *getBuffer();
-
-  Region getUpdateManagerRegion();
-
-  void destroyUpdateManagerRegion();
-
-  void newRegion();
-
-  private:
-
-  Updater *createUpdater(char *displayName, Display *display);
-
-  int width_;
-  int height_;
-  char *frameBuffer_;
-  Input *input_;
-
-  int nUpdater;
-
-  Updater **updaterVector;
-
-  Region updateManagerRegion_;
-
-};
-
-inline int UpdateManager::numberOfUpdaters()
-{
-  return nUpdater;
-}
-
-inline int UpdateManager::getWidth()
-{
-  return width_;
-}
-
-inline int UpdateManager::getHeight()
-{
-  return height_;
-}
-
-inline char *UpdateManager::getBuffer()
-{
-  return frameBuffer_;
-}
-
-inline Region UpdateManager::getUpdateManagerRegion()
-{
-  return updateManagerRegion_;
-}
-
-inline void UpdateManager::destroyUpdateManagerRegion()
-{
-  if (updateManagerRegion_ != NULL)
-  {
-    XDestroyRegion(updateManagerRegion_);
-
-    updateManagerRegion_ = NULL;
-  }
-}
-
-#endif /* UpdateManager_H */
diff --git a/nxcompshad/Poller.h b/nxcompshad/Poller.h
deleted file mode 100644
index 4435b5b..0000000
--- a/nxcompshad/Poller.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#ifndef Poller_H
-#define Poller_H
-
-#if defined(__CYGWIN32__) || defined(WIN32)
-
-#include "Win.h"
-
-#else
-
-#include "X11.h"
-
-#endif
-
-#endif /* Poller_H */
diff --git a/nxcompshad/Regions.h b/nxcompshad/Regions.h
deleted file mode 100644
index b9303dc..0000000
--- a/nxcompshad/Regions.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#ifndef Region_H
-#define Region_H
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-typedef struct {
-    short x1, x2, y1, y2;
-} Box, BOX, BoxRec, *BoxPtr;
-
-typedef struct _XRegion {
-    long size;
-    long numRects;
-    BOX *rects;
-    BOX extents;
-};
-
-#endif /* Region_H */
diff --git a/nxcompshad/Shadow.cpp b/nxcompshad/Shadow.cpp
deleted file mode 100644
index f9525ad..0000000
--- a/nxcompshad/Shadow.cpp
+++ /dev/null
@@ -1,470 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#include <signal.h>
-#include <string.h>
-
-#define PANIC
-#define WARNING
-#undef  TEST
-#undef  DEBUG
-
-#include "Logger.h"
-#include "Shadow.h"
-#include "Poller.h"
-#include "Manager.h"
-
-typedef struct {
-    KeySym  *map;
-    KeyCode minKeyCode,
-            maxKeyCode;
-    int     mapWidth;
-} KeySymsRec, *KeySymsPtr;
-
-KeySymsPtr NXShadowKeymap = NULL;
-
-ShadowOptions NXShadowOptions = {1, 1, -1};
-
-static int mirrorException = 0;
-
-static UpdateManager *updateManager;
-static Poller *poller;
-static Input *input;
-
-int NXShadowRemoveAllUpdaters();
-
-inline bool NXShadowNotInitialized()
-{
-  //
-  // updateManager depends on input and poller.
-  // So this test seem redundant.
-  //
-  // return (input == NULL) || (poller == NULL) || (updateManager == NULL);
-  //
-
-  return (updateManager == NULL);
-}
-
-#ifdef NEED_SIGNAL_HANDLER
-static void NXSignalHandler(int signal)
-{
-  logTest("NXSignalHandler", "Got signal [%d]", signal);
-
-  if (signal == SIGINT)
-  {
-    mirrorException = 1;
-  }
-  else if (signal == SIGTERM)
-  {
-    mirrorException = 1;
-  }
-}
-
-static int NXInitSignal()
-{
-  logTrace("NXInitSignal");
-
-  struct sigaction sa;
-
-  sa.sa_handler = NXSignalHandler;
-  sigfillset(&sa.sa_mask);
-  sa.sa_flags = 0;
-
-  int res;
-
-  while ((res = sigaction(SIGINT, &sa, NULL)) == -1 &&
-             errno == EINTR);
-
-  if (res == -1)
-  {
-    logError("NXInitSignal", EGET());
-
-    return -1;
-  }
-
-  return 1;
-}
-#endif
-
-static void NXHandleException()
-{
-  if (mirrorException)
-  {
-    mirrorException = 0;
-
-    NXShadowRemoveAllUpdaters();
-  }
-}
-
-static int NXCreateInput(char *keymap, char *shadowDisplayName)
-{
-  logTrace("NXCreateInput");
-
-  input = new Input;
-
-  if (input == NULL)
-  {
-    logError("NXCreateInput", ESET(ENOMEM));
-
-    return -1;
-  }
-
-  input -> setKeymap(keymap);
-
-  input -> setShadowDisplayName(shadowDisplayName);
-
-  return 1;
-}
-
-static int NXCreatePoller(Display *display, Display **shadowDisplay)
-{
-  logTrace("NXCreatePoller");
-
-  if (input == NULL)
-  {
-    logError("NXCreatePoller", ESET(EBADFD));
-
-    return -1;
-  }
-
-  poller = new Poller(input,display);
-
-  if (poller == NULL)
-  {
-    logError("NXCreatePoller", ESET(ENOMEM));
-
-    return -1;
-  }
-
-  if (poller -> init() == -1)
-  {
-    logWarning("NXCreatePoller", "Failed to initialize poller.");
-
-    return -1;
-  }
-
-  *shadowDisplay = poller -> getShadowDisplay();
-
-  logTest("NXCreatePoller", "Poller geometry [%d, %d], ShadowDisplay[%p].", poller -> width(),
-              poller -> height(), (Display *) *shadowDisplay);
-
-  return 1;
-}
-
-static int NXCreateUpdateManager()
-{
-  logTrace("NXCreateUpdateManager");
-
-  if (input == NULL || poller == NULL)
-  {
-    logError("NXCreateUpdateManager", ESET(EBADFD));
-
-    return -1;
-  }
-
-  updateManager = new UpdateManager(poller -> width(), poller -> height(),
-                                        poller -> getFrameBuffer(), input);
-
-  if (updateManager == NULL)
-  {
-    logError("NXCreateUpdateManager", ESET(ENOMEM));
-
-    return -1;
-  }
-
-  return 1;
-}
-
-void  NXShadowResetOptions()
-{
-  NXShadowOptions.optionShmExtension = 1;
-  NXShadowOptions.optionDamageExtension = 1;
-}
-
-//
-// Exported functions.
-//
-
-int NXShadowHasUpdaters()
-{
-  logTrace("NXShadowHasUpdaters");
-
-  return (updateManager && updateManager -> numberOfUpdaters()) ? 1 : 0;
-}
-
-int NXShadowRemoveAllUpdaters()
-{
-  logTrace("NXShadowRemoveAllUpdaters");
-
-  return updateManager ? updateManager -> removeAllUpdaters() : 0;
-}
-
-int NXShadowRemoveUpdater(UpdaterHandle handle)
-{
-  logTrace("NXShadowRemoveUpdater");
-
-  return updateManager ? updateManager -> removeUpdater(handle) : 0;
-}
-
-UpdaterHandle NXShadowAddUpdater(char *displayName)
-{
-  logTrace("NXShadowAddUpdater");
-
-  return updateManager ? updateManager -> addUpdater(displayName, NULL) : NULL;
-}
-
-int NXShadowAddUpdaterDisplay(void *dpy, int *w, int *h, unsigned char *d)
-{
-  Display *display = reinterpret_cast<Display*>(dpy);
-
-  logTrace("NXShadowAddUpdaterDisplay");
-
-  if ((updateManager ? updateManager -> addUpdater(NULL, display) : NULL) == NULL)
-  {
-    logTest("NXShadowAddUpdaterDisplay", "Error");
-
-    return 0;
-  }
-
-  *w = updateManager -> getWidth();
-  *h = updateManager -> getHeight();
-  *d = poller -> depth();
-
-  return 1;
-}
-
-int NXShadowCreate(void *dpy, char *keymap, char* shadowDisplayName, void **shadowDpy)
-{
-  logTrace("NXShadowCreate");
-
-  Display *display = reinterpret_cast<Display*>(dpy);
-  Display **shadowDisplay = reinterpret_cast<Display**>(shadowDpy);
-
-/*  if (NXInitSignal() != 1)
-  {
-    logError("NXShadowCreate", EGET());
-
-    return -1;
-  }*/
-
-  if (NXCreateInput(keymap, shadowDisplayName) != 1)
-  {
-    logError("NXShadowCreate", EGET());
-
-    return -1;
-  }
-
-  if (NXCreatePoller(display, shadowDisplay) != 1)
-  {
-    logWarning("NXShadowCreate", "NXCreatePoller failed.");
-
-    return -1;
-  }
-
-  if (NXCreateUpdateManager() != 1)
-  {
-    logError("NXShadowCreate", EGET());
-
-    return -1;
-  }
-
-  return 1;
-}
-
-#if !defined(__CYGWIN32__) && !defined(WIN32)
-
-void NXShadowSetDisplayUid(int uid)
-{
-  NXShadowOptions.optionShadowDisplayUid = uid;
-}
-
-void NXShadowDisableShm(void)
-{
-  logUser("NXShadowDisableShm: Disabling SHM.\n");
-
-  NXShadowOptions.optionShmExtension = 0;
-}
-
-void NXShadowDisableDamage(void)
-{
-  NXShadowOptions.optionDamageExtension = 0;
-}
-
-void NXShadowGetScreenSize(int *w, int *h)
-{
-  poller -> getScreenSize(w, h);
-}
-
-void NXShadowSetScreenSize(int *w, int *h)
-{
-  poller -> setScreenSize(w, h);
-}
-
-#endif
-
-void NXShadowDestroy()
-{
-  if (poller)
-  {
-    delete poller;
-
-    poller = NULL;
-  }
-
-  if (updateManager)
-  {
-    delete updateManager;
-
-    updateManager = NULL;
-  }
-
-  if (input)
-  {
-    delete input;
-
-    input = NULL;
-  }
-}
-
-void NXShadowHandleInput()
-{
-  logTrace("NXShadowHandleInput");
-
-  if (NXShadowNotInitialized())
-  {
-    logError("NXShadowHandleInput - NXShadow not properly initialized.", ESET(EBADFD));
-
-    return;
-  }
-
-  NXHandleException();
-
-  updateManager -> handleInput();
-
-  poller -> handleInput();
-}
-
-int NXShadowHasChanged(int (*callback)(void *), void *arg, int *suspended)
-{
-  int result;
-
-  logTrace("NXShadowHasChanged");
-
-  if (NXShadowNotInitialized())
-  {
-    logError("NXShadowHasChanged - NXShadow not properly initialized.", ESET(EBADFD));
-
-    return -1;
-  }
-
-  //
-  // FIXME
-  //updateManager -> destroyUpdateManagerRegion();
-  //
-
-  updateManager -> newRegion();
-
-#if !defined(__CYGWIN32__) && !defined(WIN32)
-  poller -> getEvents();
-#endif
-
-  result = poller -> isChanged(callback, arg, suspended);
-
-  if (result == 1)
-  {
-    updateManager -> addRegion(poller -> lastUpdatedRegion());
-
-    return 1;
-  }
-  else if (result == -1)
-  {
-    logTest("NXShadowHasChanged", "Scanline error.");
-    return -1;
-  }
-
-  return 0;
-}
-
-void NXShadowExportChanges(long *numRects, char **pBox)
-{
-  Region pReg;
-
-  logTrace("NXShadowExportChanges");
-
-  if (NXShadowNotInitialized())
-  {
-    logError("NXShadowExportChanges - NXShadow not properly initialized.", ESET(EBADFD));
-  }
-
-  updateManager -> update();
-  pReg = updateManager -> getUpdateManagerRegion();
-  *numRects = pReg -> numRects;
-  *pBox = (char *)pReg -> rects;
-
-  logTest("NXShadowExportChanges", "numRects [%ld] pBox[%p], pReg->numRects[%ld], rects[%p], size[%lu]",
-              *numRects, *pBox, pReg -> numRects, &(pReg -> rects -> x2),
-                  (unsigned long) sizeof(pReg -> rects -> x2));
-}
-
-void NXShadowEvent(Display *display, XEvent event)
-{
-  poller -> handleEvent(display, &event);
-}
-
-void NXShadowWebKeyEvent(KeySym keysym, Bool isKeyPress)
-{
-  poller -> handleWebKeyEvent(keysym, isKeyPress);
-}
-
-#ifdef __CYGWIN32__
-
-int NXShadowCaptureCursor(unsigned int wnd, void *vis)
-{
-  Window window = (Window)wnd;
-  Visual *visual = reinterpret_cast<Visual*>(vis);
-
-  logTrace("NXShadowCaptureCursor");
-
-  logTest("NXShadowCaptureCursor","Init");
-
-  return poller -> updateCursor(window, visual);
-}
-
-#endif
-
-void NXShadowUpdateBuffer(void **buffer)
-{
-  char **fBuffer = reinterpret_cast<char **>(buffer);
-
-  if (*fBuffer != NULL)
-  {
-    poller -> destroyFrameBuffer();
-
-    poller -> init();
-  }
-
-  *fBuffer = poller -> getFrameBuffer();
-
-  logTest("NXShadowUpdateBuffer","New frame buffer [0x%p]", (void *)*fBuffer);
-}
-
-void NXShadowInitKeymap(void *keysyms)
-{
-  NXShadowKeymap = (KeySymsPtr) keysyms;
-
-  logTest("NXShadowInitKeymap","KeySyms pointer [0x%p]", (void *)NXShadowKeymap);
-}
diff --git a/nxcompshad/Shadow.h b/nxcompshad/Shadow.h
deleted file mode 100644
index e1eddb9..0000000
--- a/nxcompshad/Shadow.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#ifndef Shadow_H
-#define Shadow_H
-
-#include <X11/Xlib.h>
-
-#define NXShadowCorrectColor(length, buffer) \
-\
-{ \
-  unsigned short a; \
-  unsigned short b; \
-  unsigned short *shorts; \
-  int i; \
-\
-  length >>= 1; \
-  shorts = (unsigned short *)buffer; \
-  for (i = 0; i < length ; i++) \
-  { \
-    a = shorts[i]; \
-\
-    b = a & 63; \
-    a <<= 1; \
-    a = (a & ~127) | b; \
-\
-    shorts[i] = a; \
-  } \
-}
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef char* UpdaterHandle;
-
-typedef struct _ShadowOptions
-{
-  char  optionShmExtension;
-  char  optionDamageExtension;
-  int   optionShadowDisplayUid;
-} ShadowOptions;
-
-extern ShadowOptions NXShadowOptions;
-
-extern int           NXShadowCreate(void *, char *, char *, void **);
-extern void          NXShadowDestroy(void);
-
-/*
- * Use an already opened Display connection.
- * We use <void *> instead of <Display *> to avoid
- * useless dependences from Xlib headers.
- */
-
-extern int NXShadowAddUpdaterDisplay(void *display, int *width, int *height,
-                                         unsigned char *depth);
-extern UpdaterHandle NXShadowAddUpdater(char *displayName);
-extern int           NXShadowRemoveUpdater(UpdaterHandle handle);
-extern int           NXShadowRemoveAllUpdaters(void);
-
-extern void          NXShadowHandleInput(void);
-extern int           NXShadowHasChanged(int (*)(void *), void *, int *);
-extern void          NXShadowExportChanges(long *, char **);
-extern int           NXShadowHasUpdaters(void);
-extern int           NXShadowCaptureCursor(unsigned int wnd, void *vis);
-extern void          NXShadowColorCorrect(int, int, unsigned int, unsigned int, char *);
-extern void          NXShadowUpdateBuffer(void **);
-
-extern void          NXShadowEvent(Display *, XEvent);
-extern void          NXShadowWebKeyEvent(KeySym keysym, Bool isKeyPress);
-
-extern void          NXShadowSetDisplayUid(int uid);
-
-extern void          NXShadowDisableShm(void);
-extern void          NXShadowDisableDamage(void);
-
-extern void          NXShadowGetScreenSize(int *width, int *height);
-extern void          NXShadowSetScreenSize(int *width, int *height);
-
-extern void          NXShadowInitKeymap(void *keysyms);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* Shadow_H */
-
diff --git a/nxcompshad/Updater.cpp b/nxcompshad/Updater.cpp
deleted file mode 100644
index 245c6ce..0000000
--- a/nxcompshad/Updater.cpp
+++ /dev/null
@@ -1,383 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/keysym.h>
-#include <string.h>
-
-#define PANIC
-#define WARNING
-#undef  TEST
-#undef  DEBUG
-//
-#include <stdio.h>
-//
-#include "Updater.h"
-#include "Logger.h"
-
-Updater::Updater(char *displayName, Display *display)
-{
-  logTrace("Updater::Updater");
-
-  displayName_ = displayName;
-  display_ = display;
-  closeDisplay_ = false;
-  image_ = NULL;
-  updateRegion_ = NULL;
-  buffer_ = NULL;
-}
-
-Updater::~Updater()
-{
-  logTrace("Updater::~Updater");
-
-  if (input_)
-  {
-    int removedEvents = input_ -> removeAllEvents(display_);
-
-    logTest("Updater::~Updater", "Removed events in input queue is [%d].", removedEvents);
-  }
-
-  if (display_)
-  {
-    XDestroyWindow(display_, window_);
-    XFreePixmap(display_, pixmap_);
-
-    if (closeDisplay_)
-    {
-      XCloseDisplay(display_);
-    }
-  }
-
-  if (image_)
-  {
-    image_ -> data = NULL;
-
-    XDestroyImage(image_);
-  }
-
-  if (updateRegion_)
-  {
-    XDestroyRegion(updateRegion_);
-  }
-}
-
-int Updater::init(int width, int height, char *fb, Input *input)
-{
-  logTrace("Updater::init");
-
-  if (fb == NULL || input == NULL || width <= 0 || height <= 0)
-  {
-    logError("Updater::init", ESET(EINVAL));
-
-    return -1;
-  }
-
-  width_ = width;
-  height_ = height;
-  buffer_ = fb;
-  input_ = input;
-/*
-  if (display_ == NULL)
-  {
-    display_ = XOpenDisplay(displayName_);
-
-    closeDisplay_ = true;
-
-    if (display_ == NULL)
-    {
-      logError("Updater::init", ESET(ENOMSG));
-
-      return -1;
-    }
-  }
-*/
-  depth_ = DefaultDepth(display_, DefaultScreen(display_));
-
-  if (depth_ == 8) bpl_ = width_;
-  else if (depth_ == 16) bpl_ = width_ * 2;
-  else bpl_ = width_ * 4;
-
-  logTest("Updater::init", "Server geometry [%d, %d] depth [%d] bpl [%d].", width_, height_, depth_, bpl_);
-
-/*  int bitmap_pad = 8;
-
-  image_ = XCreateImage(display_, DefaultVisual(display_, DefaultScreen(display_)), depth_, ZPixmap, 0,
-                            buffer_, width_, height_, bitmap_pad, 0);
-
-  if (image_ == NULL)
-  {
-    logError("Updater::init", ESET(ENOMSG));
-
-    logTest("Updater::init", "Failed to create default image.");
-
-    return -1;
-  }
-
-  pixmap_ = XCreatePixmap(display_, DefaultRootWindow(display_), width_, height_, depth_);
-
-  unsigned int mask = CWBackPixmap | CWBorderPixel | CWEventMask;
-
-  XSetWindowAttributes attributes;
-
-  attributes.background_pixmap = pixmap_;
-  attributes.border_pixel = WhitePixel(display_, DefaultScreen(display_));
-  attributes.event_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask;
-
-  window_ = XCreateWindow(display_, DefaultRootWindow(display_),
-                              0, 0, width_, height_, 0, depth_, InputOutput,
-                                  DefaultVisual(display_, DefaultScreen(display_)), mask, &attributes);
-
-  if (window_ == None)
-  {
-    logError("Updater::init", ESET(ENOMSG));
-
-    return -1;
-  }
-
-  XSizeHints *size_hints;
-
-  if ((size_hints = XAllocSizeHints()) == NULL)
-  {
-    logError("Updater::init", ESET(ENOMEM));
-
-    return -1;
-  }
-
-  size_hints -> flags = PMinSize | PMaxSize;
-  size_hints -> min_width = width_;
-  size_hints -> max_width = width_;
-  size_hints -> min_height = height_;
-  size_hints -> max_height = height_;
-
-  XSetWMNormalHints(display_, window_, size_hints);
-
-  XFree(size_hints);
-
-  Atom deleteWMatom = XInternAtom(display_, "WM_DELETE_WINDOW", 1);
-
-  XSetWMProtocols(display_, window_, &deleteWMatom, 1);
-
-  XMapWindow(display_, window_);*/
-
-  updateRegion_ = XCreateRegion();
-
-  logTest("Updater::init", "updateRegion_[%p]", updateRegion_);
-  return 1;
-}
-
-void Updater::addRegion(Region region)
-{
-  //
-  // FIXME: Is this too paranoid ?
-  //
-
-  if (updateRegion_ == NULL)
-  {
-    logError("Updater::addRegion", ESET(EINVAL));
-
-    return;
-  }
-
-  XUnionRegion(region, updateRegion_, updateRegion_);
-}
-
-void Updater::update()
-{
-  logTrace("Updater::update");
-
-  if (updateRegion_ == NULL)
-  {
-    logError("Updater::update", ESET(EINVAL));
-
-    return;
-  }
-
-  logTest("Updater::update", "Number of rectangles [%ld].", updateRegion_ -> numRects);
-
-/*  for (; updateRegion_ -> numRects > 0; updateRegion_ -> numRects--)
-  {
-    int n = updateRegion_ -> numRects - 1;
-
-    int x = updateRegion_ -> rects[n].x1;
-    int y = updateRegion_ -> rects[n].y1;
-    unsigned int width = updateRegion_ -> rects[n].x2 - updateRegion_ -> rects[n].x1;
-    unsigned int height = updateRegion_ -> rects[n].y2 - updateRegion_ -> rects[n].y1;
-
-    logDebug("Updater::update", "Sending rectangle: [%d, %d, %d, %d].", x, y, width, height);
-
-    //
-    // We need to update the extents.
-    //
-
-    int bitmap_pad;
-
-    if (depth_ == 32 || depth_ == 24)
-    {
-      bitmap_pad = 32;
-    }
-    else if (depth_ == 16)
-    {
-      if ((width & 1) == 0)
-      {
-        bitmap_pad = 32;
-      }
-      else
-      {
-        bitmap_pad = 16;
-      }
-    }
-    else if ((width & 3) == 0)
-    {
-      bitmap_pad = 32;
-    }
-    else if ((width & 1) == 0)
-    {
-      bitmap_pad = 16;
-    }
-    else
-    {
-      bitmap_pad = 8;
-    }*/
-
-/*    image_ -> bitmap_pad = bitmap_pad;*/
-
-   /* NXShadowCorrectColor(x, y, width, height);*/
-
-/*    XPutImage(display_, pixmap_, DefaultGC(display_, DefaultScreen(display_)),
-                  image_, x, y, x, y, width, height);
-
-    XClearArea(display_, window_, x, y, width, height, 0);
-  }*/
-
-  //
-  // Should we reduces the box vector ?
-  //
-  // BOX *box = Xrealloc(updateRegion_ -> rects,
-  //                         updateRegion_ -> numRects == 0 ? sizeof(BOX) :
-  //                             updateRegion_ -> numRects * sizeof(BOX));
-  //
-  // if (box)
-  // {
-  //   updateRegion_ -> rects = box;
-  //   updateRegion_ -> size = 1;
-  // }
-  //
-
-  if (updateRegion_ -> numRects == 0)
-  {
-    updateRegion_ -> extents.x1 = 0;
-    updateRegion_ -> extents.y1 = 0;
-    updateRegion_ -> extents.x2 = 0;
-    updateRegion_ -> extents.y2 = 0;
-  }
-  else
-  {
-    //
-    // FIXME: We have to update the region extents.
-    //
-
-    logTest("Updater::update", "Region extents has not been updated.");
-  }
-}
-
-void Updater::handleInput()
-{
-  logTrace("Updater::handleInput");
-
-  XEvent *event = new XEvent;
-
-  if (event == NULL)
-  {
-    logError("Updater::handleInput", ESET(ENOMEM));
-
-    return;
-  }
-
-  while (XCheckIfEvent(display_, event, anyEventPredicate, NULL))
-  {
-    switch (event -> type)
-    {
-     /* case ClientMessage:
-      {
-        Atom wmProtocols = XInternAtom(display_, "WM_PROTOCOLS", 0);
-        Atom wmDeleteWindow = XInternAtom(display_, "WM_DELETE_WINDOW", 0);
-
-        if (event -> xclient.message_type == wmProtocols &&
-                (Atom)event -> xclient.data.l[0] == wmDeleteWindow)
-        {
-          logTest("Updater::handleInput", "Got client message of type WM_PROTOCOLS and value WM_DELETE_WINDOW,"
-                      " throwing exception UpdaterClosing.");
-
-          delete event;
-
-          throw UpdaterClosing();
-        }
-        else
-        {
-          logTest("Updater::handleInput", "Unexpected client message type [%ld] format [%d] first value [%ld]",
-                      event -> xclient.message_type, event -> xclient.format, event -> xclient.data.l[0]);
-        }
-
-        break;
-      }*/
-      case KeyPress:
-      case KeyRelease:
-      case ButtonPress:
-      case ButtonRelease:
-      case MotionNotify:
-      {
-        input_ -> pushEvent(display_, event);
-
-        event = new XEvent;
-
-        if (event == NULL)
-        {
-          logError("Updater::handleInput", ESET(ENOMEM));
-
-          return;
-        }
-
-        break;
-      }
-      default:
-      {
-        logTest("Updater::handleInput", "Handling unexpected event [%d].", event -> type);
-
-        break;
-      }
-    }
-  }
-
-  delete event;
-}
-
-void Updater::newRegion()
-{
-  if (updateRegion_ != NULL)
-  {
-    XDestroyRegion(updateRegion_);
-  }
-
-  updateRegion_ = XCreateRegion();
-
-  logTest("Updater::newRegion", "updateRegion_ [%p].", updateRegion_);
-}
-//
-// Private functions.
-//
diff --git a/nxcompshad/Updater.h b/nxcompshad/Updater.h
deleted file mode 100644
index daa26c1..0000000
--- a/nxcompshad/Updater.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#ifndef Updater_H
-#define Updater_H
-
-#include <X11/Xlib.h>
-
-#include "Regions.h"
-#include "Input.h"
-
-class UpdaterClosing {};
-
-class Updater
-{
-  public:
-
-  Updater(char *displayName, Display *display);
-
-  ~Updater();
-
-  int init(int, int, char *, Input*);
-
-  void addRegion(Region r);
-
-  void update();
-
-  void handleInput();
-
-  XImage *getImage();
-
-  Region getUpdateRegion();
-
-  void newRegion();
-
-  private:
-
-  Input *input_;
-
-  static inline Bool anyEventPredicate(Display*, XEvent*, XPointer);
-
-  void handleKeyboardEvent(XEvent &event);
-
-  char *displayName_;
-
-  char *buffer_;
-
-  bool closeDisplay_;
-
-  Display *display_;
-
-  int depth_;
-
-  int width_;
-  int height_;
-
-  int bpl_;
-
-  Window window_;
-  XImage *image_;
-
-  Pixmap pixmap_;
-
-  Region updateRegion_;
-
-};
-
-Bool Updater::anyEventPredicate(Display*, XEvent*, XPointer)
-{
-  return true;
-}
-
-inline XImage* Updater::getImage()
-{
-  return image_;
-}
-inline Region Updater::getUpdateRegion()
-{
-  return updateRegion_;
-}
-#endif /* Updater_H */
diff --git a/nxcompshad/VERSION b/nxcompshad/VERSION
deleted file mode 100644
index 1545d96..0000000
--- a/nxcompshad/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-3.5.0
diff --git a/nxcompshad/Win.cpp b/nxcompshad/Win.cpp
deleted file mode 100644
index 481cbca..0000000
--- a/nxcompshad/Win.cpp
+++ /dev/null
@@ -1,1137 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#if defined(__CYGWIN32__) || defined(WIN32)
-
-#include <X11/keysym.h>
-
-#define PANIC
-#define WARNING
-#undef  TEST
-#undef  DEBUG
-
-#include "Poller.h"
-#include "Logger.h"
-
-Poller::Poller(Input *input, Display *display, int depth) : CorePoller(input, display)
-{
-  logTrace("Poller::Poller");
-
-  screenDC_ = NULL;
-  screenBmp_ = NULL;
-  memoryDC_ = NULL;
-  pDIBbits_ = NULL;
-  DIBBuffer_ = NULL;
-  pKey_ = NULL;
-  pMouse_ = NULL;
-  path_ = NULL;
-  keymapName_ = input -> getKeymap();
-  keymap_ = NULL;
-  toggleButtonState_ = 0;
-  serverModifierState_ = 0;
-  display_ = display;
-  depth_ = DefaultDepth(display_, DefaultScreen(display_));
-  oldCursor_ = 0;
-  xCursor_ = 0;
-}
-
-Poller::~Poller()
-{
-  logTrace("Poller::~Poller");
-
-  if (screenDC_)
-  {
-    BOOL result = ReleaseDC(NULL, screenDC_);
-
-    logTest("Poller::~Poller", "ReleaseDC returned [%d].", result);
-
-    screenDC_ = NULL;
-  }
-
-  if (memoryDC_)
-  {
-    BOOL result = DeleteDC(memoryDC_);
-
-    logTest("Poller::~Poller", "DeleteDC returned [%d].", result);
-
-    memoryDC_ = NULL;
-  }
-
-  if (screenBmp_)
-  {
-    BOOL result = DeleteObject(screenBmp_);
-
-    logTest("Poller::~Poller", "DeleteObject returned [%d].", result);
-
-    screenBmp_ = NULL;
-  }
-
-  if (DIBBuffer_)
-  {
-    logDebug("Poller::~Poller", "Delete DIBBuffer_ [%p].", DIBBuffer_);
-
-    delete [] DIBBuffer_;
-  }
-
-  if (pKey_)
-  {
-    logDebug("Poller::~Poller", " pKey_[%p].", pKey_);
-
-    delete [] pKey_;
-  }
-
-  if (pMouse_)
-  {
-    logDebug("Poller::~Poller", " pMouse_[%p].", pMouse_);
-
-    delete [] pMouse_;
-  }
-
-  if (keymap_)
-  {
-    logDebug("Poller::~Poller", " keymap_[%p].", keymap_);
-
-    delete [] keymap_;
-  }
-}
-
-int Poller::init()
-{
-  logTrace("Poller::init");
-
-  int maxLengthArrayINPUT = 6;
-
-  platformOS();
-
-  pKey_ = new INPUT [maxLengthArrayINPUT];
-
-  if (pKey_ == NULL)
-  {
-    logError("Poller::init", ESET(ENOMEM));
-
-    return -1;
-  }
-
-  for (int i = 0; i < maxLengthArrayINPUT; i++)
-  {
-    pKey_[i].type = INPUT_KEYBOARD;
-    pKey_[i].ki.wVk = (WORD) 0;
-    pKey_[i].ki.time = (DWORD) 0;
-    pKey_[i].ki.dwExtraInfo = (DWORD) 0;
-  }
-
-  pMouse_ = new INPUT;
-
-  if (pMouse_ == NULL)
-  {
-    logError("Poller::init", ESET(ENOMEM));
-
-    return -1;
-  }
-
-  pMouse_ -> type = INPUT_MOUSE;
-
-  pMouse_ -> mi.dx = 0;
-  pMouse_ -> mi.dy = 0;
-  pMouse_ -> mi.mouseData = (DWORD) 0;
-  pMouse_ -> mi.time = 0;
-  pMouse_ -> mi.dwExtraInfo = (ULONG_PTR) NULL;
-
-  screenDC_ = GetDC(NULL);
-
-  if (screenDC_ == NULL)
-  {
-    logError("Poller::init", ESET(ENOMSG));
-
-    return -1;
-  }
-
-  switch(depth_)
-  {
-    case 8:
-    {
-      depth_ = 16;
-      break;
-    }
-    case 16:
-    {
-      depth_ = 16;
-      break;
-    }
-    case 24:
-    {
-      depth_ = 32;
-      break;
-    }
-    default:
-    {
-      logError("Poller::init", ESET(EINVAL));
-
-      return -1;
-    }
-  }
-
-  width_ = GetDeviceCaps(screenDC_, HORZRES);
-  height_ = GetDeviceCaps(screenDC_, VERTRES);
-
-  bpl_ = width_ * (depth_ >> 3);
-  bpp_ = (depth_ >> 3);
-
-  logTest("Poller::init", "Screen geometry is [%d, %d] depth is [%d] bpl [%d] bpp [%d].",
-              width_, height_, depth_, bpl_, bpp_);
-
-  logTest("Poller::init", "Got device context at [%p] screen size is (%d,%d).",
-            screenDC_, width_, height_);
-
-  memoryDC_ = CreateCompatibleDC(screenDC_);
-
-  if (memoryDC_ == NULL)
-  {
-    logError("Poller::init", ESET(ENOMSG));
-
-    return -1;
-  }
-
-  //
-  // Delete the old bitmap for the memory device.
-  //
-
-  HBITMAP bitmap = (HBITMAP) GetCurrentObject(memoryDC_, OBJ_BITMAP);
-
-  if (bitmap && DeleteObject(bitmap) == 0)
-  {
-    logError("Poller::init", ESET(ENOMSG));
-  }
-
-  //
-  // Bitmap header describing the bitmap we want to get from GetDIBits.
-  //
-
-  bmi_.bmiHeader.biSize          = sizeof(BITMAPINFOHEADER);
-  bmi_.bmiHeader.biWidth         = width_;
-  bmi_.bmiHeader.biHeight        = -height_;
-  bmi_.bmiHeader.biPlanes        = 1;
-  bmi_.bmiHeader.biBitCount      = depth_;
-  bmi_.bmiHeader.biCompression   = BI_RGB;
-  bmi_.bmiHeader.biSizeImage     = 0;
-  bmi_.bmiHeader.biXPelsPerMeter = 0;
-  bmi_.bmiHeader.biYPelsPerMeter = 0;
-  bmi_.bmiHeader.biClrUsed       = 0;
-  bmi_.bmiHeader.biClrImportant  = 0;
-
-  screenBmp_ = CreateDIBSection(memoryDC_, &bmi_, DIB_RGB_COLORS, &pDIBbits_, NULL, 0);
-  ReleaseDC(NULL,memoryDC_);
-
-  if (screenBmp_ == NULL)
-  {
-    logTest ("Poller::init", "This video device is not supporting DIB section");
-
-    pDIBbits_ = NULL;
-
-    screenBmp_ = CreateCompatibleBitmap(screenDC_, width_, height_);
-
-    if (screenBmp_ == NULL)
-    {
-      logError("Poller::init", ESET(ENOMSG));
-
-      return -1;
-    }
-
-    if (SelectObject(memoryDC_, screenBmp_) == NULL)
-    {
-      logError("Poller::init", ESET(ENOMSG));
-
-      return -1;
-    }
-  }
-  else
-  {
-    logTest ("Poller::init", "Enabled the DIB section");
-
-    if (SelectObject(memoryDC_, screenBmp_) == NULL)
-    {
-      logError("Poller::init", ESET(ENOMSG));
-
-      return -1;
-    }
-  }
-
-  //
-  // Check if the screen device raster capabilities
-  // support the bitmap transfer.
-  //
-
-  if ((GetDeviceCaps(screenDC_, RASTERCAPS) & RC_BITBLT) == 0)
-  {
-    logTest("Poller::init", "This video device is not supporting the bitmap transfer.");
-
-    logError("Poller::init", ESET(ENOMSG));
-
-    return -1;
-  }
-
-  //
-  // Check if the memory device raster capabilities
-  // support the GetDIBits and SetDIBits functions.
-  //
-
-  if ((GetDeviceCaps(memoryDC_, RASTERCAPS) & RC_DI_BITMAP) == 0)
-  {
-    logTest("Poller::init", "This memory device is not supporting the GetDIBits and SetDIBits "
-               "function.");
-
-    logError("Poller::init", ESET(ENOMSG));
-
-    return -1;
-  }
-
-  if (GetDeviceCaps(screenDC_, PLANES) != 1)
-  {
-    logTest("Poller::init", "This video device has more than 1 color plane.");
-
-    logError("Poller::init", ESET(ENOMSG));
-
-    return -1;
-  }
-
-  return CorePoller::init();
-}
-
-//
-// FIXME: Remove me.
-//
-
-void ErrorExit(LPTSTR lpszFunction)
-{
-    LPVOID lpMsgBuf;
-    DWORD dw = GetLastError();
-
-    FormatMessage(
-        FORMAT_MESSAGE_ALLOCATE_BUFFER |
-        FORMAT_MESSAGE_FROM_SYSTEM,
-        NULL,
-        dw,
-        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-        (LPTSTR) &lpMsgBuf,
-        0, NULL );
-
-    logTest(lpszFunction, " Failed with error [%ld]: %s", dw, (char*)lpMsgBuf);
-
-    LocalFree(lpMsgBuf);
-    ExitProcess(dw);
-}
-
-//
-// FIXME: End.
-//
-
-char *Poller::getRect(XRectangle r)
-{
-  logTrace("Poller::getRect");
-
-  logDebug("Poller::getRect", "Going to retrive rectangle [%d, %d, %d, %d].",
-              r.x, r.y, r.width, r.height);
-
-  //
-  // The CAPTUREBLT operation could be a very
-  // cpu-consuming task. We should make some
-  // test to see how much it is expensive.
-  // Anyway we get tooltip windows and any
-  // other special effect not included with
-  // only the SRCCOPY operation.
-  //
-
-  if (BitBlt(memoryDC_, r.x, r.y, r.width, r.height,
-                 screenDC_, r.x, r.y, SRCCOPY | CAPTUREBLT) == 0)
-  {
-    logError("Poller::getRect", ESET(ENOMSG));
-
-    logTest("Poller::getRect", "Failed to perform a bit-block transfer.");
-    logTest("Poller::getRect", "bit-block error=%lu", GetLastError());
-
-    return NULL;
-  }
-
-  // bmi_.bmiHeader.biWidth = r.width;
-  // bmi_.bmiHeader.biHeight = -r.height;
-
-  if (pDIBbits_ == NULL)
-  {
-    static long nPixel = 0;
-
-    if (nPixel < r.width * r.height)
-    {
-
-      if (DIBBuffer_)
-      {
-        delete [] DIBBuffer_;
-      }
-
-      nPixel = r.width * r.height;
-
-      DIBBuffer_ = new char [nPixel * bpp_];
-
-      if (DIBBuffer_ == NULL)
-      {
-        logError("Poller::getRect", ESET(ENOMEM));
-
-        nPixel = 0;
-
-        return NULL;
-      }
-    }
-
-    if (GetDIBits(memoryDC_, screenBmp_, height_ - r.height - r.y, r.height,
-                      DIBBuffer_, &bmi_, DIB_RGB_COLORS) == 0)
-    {
-      logError("Poller::getRect", ESET(ENOMSG));
-
-      logTest("Poller::getRect", "Failed to retrieve the screen bitmap.");
-
-      return NULL;
-    }
-
-    return DIBBuffer_;
-  }
-  else
-  {
-    return (char *) pDIBbits_ + r.y * bpl_ + r.x * bpp_;
-  }
-}
-
-void Poller::handleKeyboardEvent(Display *display, XEvent *event)
-{
-  KeySym keysym;
-  char *keyname = new char [31];
-  keyTranslation tr = {0, 0};
-  unsigned char scancode = 0;
-  int lengthArrayINPUT = 0;
-
-  if (XLookupString((XKeyEvent *) event, keyname, 30, &keysym, NULL) > 0)
-  {
-    logTest("Poller::handleKeyboardEvent", "keyname %s, keysym [%x]", keyname, (unsigned int)keysym);
-  }
-
-  if (specialKeys(keysym, event -> xkey.state, event -> type) == 1)
-  {
-    delete[] keyname;
-    return;
-  }
-
-  tr = xkeymapTranslateKey(keysym, event -> xkey.keycode, event -> xkey.state);
-  scancode = tr.scancode;
-
-  logTest("Poller::handleKeyboardEvent", "keyname [%s] scancode [0x%x], keycode[0x%x], keysym [%x]", keyname,
-              tr.scancode, event ->xkey.keycode, (unsigned int)keysym);
-
-  if (scancode == 0)
-  {
-    delete[] keyname;
-    return;
-  }
-
-  if (event -> type == KeyPress)
-  {
-    int test1 = MapVirtualKey(scancode, MAPVK_VSC_TO_VK_EX);
-    int test2 = MapVirtualKey(0x24, MAPVK_VSC_TO_VK_EX);
-
-    if (test1 == test2)
-    {
-      simulateCtrlAltDel();
-    }
-
-    if (isModifier(scancode) == 0)
-    {
-      savedServerModifierState_ = serverModifierState_;
-    }
-
-    ensureServerModifiers(tr, &lengthArrayINPUT);
-    if (sendInput(scancode, 1, &lengthArrayINPUT) == 0)
-    {
-      logTest("Poller::handleKeyboardEvent", "lengthArrayINPUT [%d].", lengthArrayINPUT);
-    }
-    restoreServerModifiers(scancode);
-  }
-  else if (event -> type == KeyRelease)
-  {
-    if (sendInput(scancode, 0, &lengthArrayINPUT) == 0)
-    {
-      logTest("Poller::handleKeyboardEvent", "lengthArrayINPUT [%d].", lengthArrayINPUT);
-    }
-  }
-
-  updateModifierState(scancode, (event -> type == KeyPress));
-
-  delete[] keyname;
-}
-
-void Poller::handleWebKeyboardEvent(KeySym keysym, Bool isKeyPress)
-{
-/*
-FIXME
-*/
-}
-
-void Poller::handleMouseEvent(Display *display, XEvent *event)
-{
-  DWORD flg = 0;
-  DWORD whl = 0;
-
-  if (event -> type == ButtonPress)
-  {
-    logTest("Poller::handleMouseEvent", "ButtonPress.\n");
-    switch (event -> xbutton.button)
-    {
-      case Button1:
-      {
-        flg = MOUSEEVENTF_LEFTDOWN;
-        break;
-      }
-      case Button2:
-      {
-        flg = MOUSEEVENTF_MIDDLEDOWN;
-        break;
-      }
-      case Button3:
-      {
-        flg = MOUSEEVENTF_RIGHTDOWN;
-        break;
-      }
-      case Button4:
-      {
-        flg = MOUSEEVENTF_WHEEL;
-        whl = WHEEL_DELTA;
-        pMouse_ -> mi.mouseData = whl;
-        break;
-      }
-      case Button5:
-      {
-        flg = MOUSEEVENTF_WHEEL;
-        whl = (DWORD) (-WHEEL_DELTA);
-        pMouse_ -> mi.mouseData = whl;
-        break;
-      }
-    }
-  }
-  else if (event -> type == ButtonRelease)
-  {
-    switch (event -> xbutton.button)
-    {
-      case Button1:
-      {
-        flg = MOUSEEVENTF_LEFTUP;
-        break;
-      }
-      case Button2:
-      {
-        flg = MOUSEEVENTF_MIDDLEUP;
-        break;
-      }
-      case Button3:
-      {
-        flg = MOUSEEVENTF_RIGHTUP;
-        break;
-      }
-      case Button4:
-      {
-        flg = MOUSEEVENTF_WHEEL;
-        whl = 0;
-        pMouse_ -> mi.mouseData = whl;
-        break;
-      }
-      case Button5:
-      {
-        flg = MOUSEEVENTF_WHEEL;
-        whl = 0;
-        pMouse_ -> mi.mouseData = whl;
-        break;
-      }
-    }
-  }
-  else if (event -> type == MotionNotify)
-  {
-    logTest("Poller::handleMouseEvent", "SetCursor - MotionNotify");
-
-    SetCursorPos(event -> xmotion.x, event -> xmotion.y);
-  }
-
-  if (flg > 0)
-  {
-  //  logTest("Poller::handleMouseEvent", "SetCursor - flg > 0");
-    //
-    // FIXME: move the cursor to the pace the event occurred
-    //
-
-    SetCursorPos(event -> xbutton.x, event -> xbutton.y);
-
-    //
-    // FIXME: Remove me: send the click/release event
-    // mouse_event(flg, 0, 0, whl, (ULONG_PTR)NULL);
-    //
-
-    pMouse_ -> mi.dwFlags = flg;
-
-    if (SendInput(1, pMouse_, sizeof(INPUT)) == 0)
-    {
-      logTest("Poller::handleMouseEvent", "Failed SendInput");
-    }
-  }
-}
-
-int Poller::updateCursor(Window wnd, Visual* vis)
-{
-  BYTE *mBits, *andBits, *xorBits;
-
-  logTrace("Poller::Cursor");
-
-  //
-  // Retrieve mouse cursor handle.
-  //
-
-  CURSORINFO cursorInfo;
-  cursorInfo.cbSize = sizeof(CURSORINFO);
-
-  if (GetCursorInfo(&cursorInfo) == 0)
-  {
-    logTest("Poller::Cursor", "GetCursorInfo() failed [%u].\n", (unsigned int)GetLastError());
-    LocalFree(&cursorInfo);
-    return -1;
-  }
-
-  HCURSOR hCursor = cursorInfo.hCursor;
-
-  if (hCursor == 0)
-  {
-    logTest("Poller::Cursor","Cursor Handle is NULL. Error[%u].\n", (unsigned int)GetLastError());
-    return 1;
-  }
-
-  if (hCursor == oldCursor_)
-  {
-    LocalFree(&cursorInfo);
-    return 1;
-  }
-  else
-  {
-    oldCursor_ = hCursor;
-  }
-
-  //
-  // Get cursor info.
-  //
-
-  //  logTest("Poller::Cursor","hCursor [%xH] GetCursor [%xH].\n", hCursor, GetCursor());
-
-  ICONINFO iconInfo;
-  if (GetIconInfo(hCursor, &iconInfo) == 0)
-  {
-    logTest("Poller::Cursor","GetIconInfo() failed. Error[%d].", (unsigned int)GetLastError());
-    LocalFree(&iconInfo);
-    //    return -1;
-  }
-
-  BOOL isColorCursor = FALSE;
-  if (iconInfo.hbmColor != NULL)
-  {
-    isColorCursor = TRUE;
-  }
-
-  if (iconInfo.hbmMask == NULL)
-  {
-    logTest("Poller::Cursor","Cursor bitmap handle is NULL.\n");
-    return -1;
-  }
-
-  //
-  // Check bitmap info for the cursor
-  //
-
-  BITMAP bmMask;
-  if (!GetObject(iconInfo.hbmMask, sizeof(BITMAP), (LPVOID)&bmMask))
-  {
-    logTest("Poller::Cursor","GetObject() for bitmap failed.\n");
-    DeleteObject(iconInfo.hbmMask);
-    LocalFree(&bmMask);
-    return -1;
-  }
-
-  if (bmMask.bmPlanes != 1 || bmMask.bmBitsPixel != 1)
-  {
-    logTest("Poller::Cursor","Incorrect data in cursor bitmap.\n");
-    LocalFree(&bmMask);
-    DeleteObject(iconInfo.hbmMask);
-    return -1;
-  }
-
-  // Get monochrome bitmap data for cursor
-  // NOTE: they say we should use GetDIBits() instead of GetBitmapBits().
-  mBits = new BYTE[bmMask.bmWidthBytes * bmMask.bmHeight];
-
-  if (mBits == NULL)//Data bitmap
-  {
-    DeleteObject(iconInfo.hbmMask);
-    DestroyCursor(cursorInfo.hCursor);
-    LocalFree(&iconInfo);
-    LocalFree(&bmMask);
-    delete[] mBits;
-    return -1;
-  }
-
-  BOOL success = GetBitmapBits(iconInfo.hbmMask, bmMask.bmWidthBytes * bmMask.bmHeight, mBits);
-
-  if (!success)
-  {
-    logTest("Poller::Cursor","GetBitmapBits() failed.\n");
-    delete[] mBits;
-    return -1;
-  }
-
-  andBits = mBits;
-
-  long width = bmMask.bmWidth;
-  long height = (isColorCursor) ? bmMask.bmHeight : bmMask.bmHeight/2;
-
-  //
-  // The bitmask is formatted so that the upper half is
-  // the icon AND bitmask and the lower half is the icon XOR bitmask.
-  //
-
-  if (!isColorCursor)
-  {
-    xorBits = andBits + bmMask.bmWidthBytes * height;
-
-/*    logTest("Poller::Cursor","no color widthB[%ld] width[%ld] height[%ld] totByte[%ld] mbits[%ld].\n",
-                 bmMask.bmWidthBytes,width,height,success,bmMask.bmHeight * bmMask.bmWidthBytes);*/
-
-    if (xCursor_ > 0)
-    {
-      XFreeCursor(display_, xCursor_);
-    }
-
-    xCursor_ = createCursor(wnd, vis, (unsigned int)iconInfo.xHotspot, (unsigned int)iconInfo.yHotspot,
-                    width, height, (unsigned char *)xorBits, (unsigned char *)andBits);
-
-    XDefineCursor(display_, wnd, xCursor_);
-  }
-
-  delete []mBits;
-  DeleteObject(iconInfo.hbmMask);
-  LocalFree(&bmMask);
-  DestroyCursor(cursorInfo.hCursor);
-  LocalFree(&iconInfo);
-
-  return success;
-}
-
-unsigned char Poller::specialKeys(unsigned int keysym, unsigned int state, int pressed)
-{
-  return 0;
-}
-
-void Poller::ensureServerModifiers(keyTranslation tr, int *lengthArrayINPUT)
-{
-  return;
-}
-
-void Poller::restoreServerModifiers(UINT scancode)
-{
-  keyTranslation dummy;
-  int lengthArrayINPUT = 0;
-
-  if (isModifier(scancode) == 1)
-  {
-    return;
-  }
-
-  dummy.scancode = 0;
-  dummy.modifiers = savedServerModifierState_;
-  ensureServerModifiers(dummy, &lengthArrayINPUT);
-  if (sendInput(0, 0, &lengthArrayINPUT) == 0)
-  {
-    logTest("Poller::restoreServerModifiers", "lengthArrayINPUT [%d]", lengthArrayINPUT);
-  }
-}
-
-int Poller::updateShadowFrameBuffer(void)
-{
-  return 1;
-}
-
-void Poller::addToKeymap(char *keyname, unsigned char scancode, unsigned short modifiers, char *mapname)
-{
-  return;
-}
-
-FILE *Poller::xkeymapOpen(char *filename)
-{
-  return NULL;
-}
-
-int Poller::xkeymapRead(char *mapname)
-{
-  return 1;
-}
-
-void Poller::xkeymapInit(char *keyMapName)
-{
-  return;
-}
-
-keyTranslation Poller::xkeymapTranslateKey(unsigned int keysym, unsigned int keycode,
-                                               unsigned int state)
-{
-  keyTranslation tr = { 0, 0 };
-
-  return tr;
-}
-
-unsigned char Poller::getKeyState(unsigned int state, unsigned int keysym)
-{
-  return 0;
-}
-
-char *Poller::getKsname(unsigned int keysym)
-{
-        char *ksname = NULL;
-
-        return ksname;
-}
-
-//
-// Routine used to fool Winlogon into thinking CtrlAltDel was pressed
-//
-char Poller::simulateCtrlAltDel(void)
-{
-  HDESK oldDesktop = GetThreadDesktop(GetCurrentThreadId());
-
-  //
-  // Switch into the Winlogon desktop.
-  //
-  if (selectDesktopByName("Winlogon") == 0)
-  {
-    logTest("SimulateCtrlAltDelThreadFn","Failed to select logon desktop.");
-    return 0;
-  }
-
-  logTest("SimulateCtrlAltDelThreadFn","Generating ctrl-alt-del.");
-
-  //
-  // 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 (oldDesktop != NULL)
-  {
-    selectDesktop(oldDesktop);
-  }
-
-  return 1;
-}
-
-// Switches the current thread into a different desktop by desktop handle
-// This call takes care of all the evil memory management involved
-char Poller::selectDesktop(HDESK newDesktop)
-{
-  //
-  // Only on NT.
-  //
-  if (isWinNT())
-  {
-    HDESK oldDesktop = GetThreadDesktop(GetCurrentThreadId());
-
-    DWORD dummy;
-    char newName[256];
-
-    if (GetUserObjectInformation(newDesktop, UOI_NAME, &newName, 256, &dummy) == 0)
-    {
-      logDebug("Poller::selectDesktop","GetUserObjectInformation() failed. Error[%lu].", GetLastError());
-      return 0;
-    }
-
-    logTest("Poller::selectDesktop","New Desktop to [%s] (%x) from (%x).",
-                 newName, (unsigned int)newDesktop, (unsigned int)oldDesktop);
-
-    //
-    // Switch the desktop.
-    //
-    if(SetThreadDesktop(newDesktop) == 0)
-    {
-      logDebug("Poller::SelectDesktop","Unable to SetThreadDesktop(), Error=%lu.", GetLastError());
-      return 0;
-    }
-
-    //
-    // Switched successfully - destroy the old desktop.
-    //
-    if (CloseDesktop(oldDesktop) == 0)
-    {
-      logDebug("Poller::selectHdesk","Failed to close old desktop (%x), Error=%lu.",
-                   (unsigned int)oldDesktop, GetLastError());
-      return 0;
-    }
-  }
-
-  return 1;
-}
-
-//
-// 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.
-//
-
-char Poller::selectDesktopByName(char *name)
-{
-  //
-  // Only 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
-    {
-      //
-      // Open the input desktop.
-      //
-      desktop = OpenInputDesktop(0, FALSE,
-                                     DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW |
-                                     DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL |
-                                     DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS |
-                                     DESKTOP_SWITCHDESKTOP | GENERIC_WRITE);
-    }
-
-    if (desktop == NULL)
-    {
-      logDebug("Poller::selectDesktopByName","Unable to open desktop, Error=%lu.", GetLastError());
-      return 0;
-    }
-
-    //
-    // Switch to the new desktop
-    //
-    if (selectDesktop(desktop) == 0)
-    {
-      //
-      // Failed to enter the new desktop, so free it!
-      //
-      logDebug("Poller::selectDesktopByName","Failed to select desktop.");
-
-      if (CloseDesktop(desktop) == 0)
-      {
-        logDebug("Poller::selectDesktopByName","Failed to close desktop, Error=%lu.", GetLastError());
-        return 0;
-      }
-    }
-
-    return 1;
-  }
-
-  return (name == NULL);
-}
-
-void Poller::platformOS()
-{
-    OSVERSIONINFO osversioninfo;
-    osversioninfo.dwOSVersionInfoSize = sizeof(osversioninfo);
-
-    //
-    // Get the current OS version.
-    //
-    if (GetVersionEx(&osversioninfo) == 0)
-    {
-      platformID_ = 0;
-    }
-    platformID_ = osversioninfo.dwPlatformId;
-
-//
-//    versionMajor = osversioninfo.dwMajorVersion;
-//    versionMinor = osversioninfo.dwMinorVersion;
-//
-}
-
-char Poller::checkDesktop()
-{
-  //
-  // Only on NT.
-  //
-  if (isWinNT())
-  {
-    //
-    // Get the input and thread desktops.
-    //
-    HDESK desktop = 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)
-    {
-      return 0;
-    }
-
-    DWORD dummy;
-    char desktopName[256];
-    char inputName[256];
-
-    if (GetUserObjectInformation(desktop, UOI_NAME, &desktopName, 256, &dummy) == 0)
-    {
-      if (CloseDesktop(inputDesktop) == 0)
-      {
-        logDebug("Poller::checkDesktop", "Failed to close desktop, Error[%d].", (unsigned int)GetLastError());
-        return 0;
-      }
-    }
-
-    if (GetUserObjectInformation(inputDesktop, UOI_NAME, &inputName, 256, &dummy) == 0)
-    {
-      if (CloseDesktop(inputDesktop) == 0)
-      {
-        logDebug("Poller::checkDesktop", "Failed to close input desktop, Error[%d].", (unsigned int)GetLastError());
-        return 0;
-      }
-    }
-
-    if (strcmp(desktopName, inputName) != 0)
-    {
-      //
-      // Switch to new desktop.
-      //
-      selectDesktop(inputDesktop);
-    }
-
-    if (CloseDesktop(desktop) == 0)
-    {
-      logDebug("Poller::checkDesktop", "Failed to close input desktop, Error[%d].", (unsigned int)GetLastError());
-      return 0;
-    }
-
-    if (CloseDesktop(inputDesktop) == 0)
-    {
-      logDebug("Poller::checkDesktop", "Failed to close input desktop, Error[%d].", (unsigned int)GetLastError());
-      return 0;
-    }
-  }
-
-  return 1;
-}
-
-unsigned char Poller::isModifier(UINT scancode)
-{
-  return 0;
-}
-
-void Poller::updateModifierState(UINT scancode, unsigned char pressed)
-{
-  return;
-}
-
-Cursor Poller::createCursor(Window wnd, Visual *vis,unsigned int x, unsigned int y,
-                                int width, int height, unsigned char *xormask, unsigned char *andmask)
-{
-  Pixmap maskglyph, cursorglyph;
-  XColor bg, fg;
-  Cursor xcursor;
-  unsigned char *cursor;
-  unsigned char *mask, *pmask, *pcursor, tmp;
-  int scanline, offset;
-
-  scanline = (width + 7) / 8;
-  offset = scanline * height;
-
-  pmask = andmask;
-  pcursor = xormask;
-  for (int i = 0; i < offset; i++)
-  {
-    //
-    // The pixel is black if both the bit of andmask and xormask is one.
-    //
-
-    tmp = *pcursor & *pmask;
-    *pcursor ^= tmp;
-    *pmask ^= tmp;
-
-    *pmask = ~(*pmask);
-
-    pmask++;
-    pcursor++;
-  }
-
-  cursor = new unsigned char[offset];
-  memcpy(cursor, xormask, offset);
-
-  mask = new unsigned char[offset];
-  memcpy(mask, andmask, offset);
-
-  fg.red = fg.blue = fg.green = 0xffff;
-  bg.red = bg.blue = bg.green = 0x0000;
-  fg.flags = bg.flags = DoRed | DoBlue | DoGreen;
-
-  cursorglyph = createGlyph(wnd, vis, width, height, cursor);
-  maskglyph = createGlyph(wnd, vis, width, height, mask);
-
-  xcursor = XCreatePixmapCursor(display_, cursorglyph, maskglyph, &fg, &bg, x, y);
-
-  XFreePixmap(display_, maskglyph);
-  XFreePixmap(display_, cursorglyph);
-  delete[]mask;
-  delete[]cursor;
-
-  return xcursor;
-}
-
-Pixmap Poller::createGlyph(Window wnd, Visual *visual, int width, int height, unsigned char *data)
-{
-  XImage *image;
-  Pixmap bitmap;
-  int scanline;
-  GC glyphGC;
-
-  scanline = (width + 7) / 8;
-
-  bitmap = XCreatePixmap(display_, wnd, width, height, 1);
-  glyphGC = XCreateGC(display_, bitmap, 0, NULL);
-
-  image = XCreateImage(display_, visual, 1, ZPixmap, 0, (char *)data, width, height, 8, scanline);
-  image->byte_order = 1; // MSBFirst -- LSBFirst = 0
-  image->bitmap_bit_order = 1;
-  XInitImage(image);
-
-/*  logTest("Poller::createGlyph","XPutImage on pixmap %d,%d,%d,%d.\n",
-              0, 0, width, height);*/
-  XPutImage(display_, bitmap, glyphGC, image, 0, 0, 0, 0, width, height);
-  XFree(image);
-
-  return bitmap;
-}
-#endif /* defined(__CYGWIN32__) || defined(WIN32) */
diff --git a/nxcompshad/Win.h b/nxcompshad/Win.h
deleted file mode 100644
index fe591ff..0000000
--- a/nxcompshad/Win.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#ifdef __CYGWIN32__
-
-#ifndef Win32Poller_H
-#define Win32Poller_H
-
-//#include <X11/X.h>
-
-#include <Windows.h>
-#include <wingdi.h>
-#include <winable.h>
-#include <winuser.h>
-
-#define CAPTUREBLT 0x40000000
-
-#define KEYEVENTF_SCANCODE 0x00000008
-#define MAPVK_VSC_TO_VK_EX 3
-//
-// The CAPTUREBLT is a raster operation used
-// in bit blit transfer.
-//
-// Using this operation includes any windows
-// that are layered on top of your window in
-// the resulting image. By default, the image
-// only contains your window.
-//
-
-#include "Core.h"
-
-typedef struct _keyTranslation
-{
- unsigned char scancode;
- unsigned short modifiers;
-
-}keyTranslation;
-
-class Poller : public CorePoller
-{
-  public:
-
-  Display *display_;
-  keyTranslation *keymap_;
-  unsigned char keymapLoaded_;
-  int minKeycode_;
-
-  Poller(Input *, Display *display, int = 16);
-
-  ~Poller();
-
-  int init();
-
-  int updateCursor(Window, Visual*);
-
-  private:
-
-  
-  int Poller::updateShadowFrameBuffer(void);
-  void handleKeyboardEvent(Display *, XEvent *);
-  void handleWebKeyboardEvent(KeySym keysym, Bool isKeyPress);
-  void addToKeymap(char *keyname, unsigned char scancode, unsigned short modifiers, char *mapname);
-  int xkeymapRead(char *mapname);
-  FILE *xkeymapOpen(char *filename);
-  void xkeymapInit(char *keyMapName);
-  keyTranslation xkeymapTranslateKey(unsigned int keysym, unsigned int keycode, unsigned int state);
-  unsigned char getKeyState(unsigned int state, unsigned int keysym);
-  char *getKsname(unsigned int keysym);
-  unsigned char specialKeys(unsigned int keysym, unsigned int state, int pressed);
-
-  unsigned char toggleSwitch(unsigned char ToggleStateClient, unsigned char ToggleStateServer, UINT scancode,
-                                 int *lengthArrayINPUT);
-
-  void updateModifierState(UINT, unsigned char);
-
-  unsigned char toggleServerState(UINT scancode);
-  unsigned char keyState(UINT scancode, UINT mapType);
-  unsigned char keyStateAsync(UINT scancode);
-
-  void handleMouseEvent(Display *, XEvent *);
-
-  Cursor createCursor(Window wnd, Visual *vis, unsigned int x, unsigned int y, int width,
-                           int height, unsigned char *xormask, unsigned char *andmask);
-
-  Pixmap createGlyph(Window wnd, Visual *visual, int width, int height, unsigned char *data);
-
-  char isWinNT();
-  char selectDesktop(HDESK new_desktop);
-  char selectDesktopByName(char *name);
-  void platformOS();
-  char simulateCtrlAltDel(void);
-  DWORD platformID_;
-
-  INPUT *pKey_, *pMouse_;
-
-  char *keymapName_;
-  char *path_;
-
-  unsigned char toggleButtonState_;
-  unsigned short serverModifierState_;
-  unsigned short savedServerModifierState_;
-
-  void ensureServerModifiers(keyTranslation tr, int *lenghtArrayINPUT);
-  void restoreServerModifiers(UINT scancode);
-  unsigned char isModifier(UINT scancode);
-
-  char sendInput(unsigned char scancode, unsigned char pressed, int *lengthArrayINPUT);
-
-  char *getRect(XRectangle);
-  char checkDesktop();
-
-  char *DIBBuffer_;
-
-  HCURSOR oldCursor_;
-
-  VOID *pDIBbits_;
-  HDC screenDC_;
-  HDC memoryDC_;
-  BITMAPINFO bmi_;
-  HBITMAP screenBmp_;
-
-  Cursor xCursor_;
-
-};
-
-#undef TEST
-
-inline unsigned char Poller::toggleSwitch(unsigned char ToggleStateClient, unsigned char ToggleStateServer,
-                                              UINT scancode, int *lengthArrayINPUT)
-{
-  return 1;
-}
-
-inline unsigned char Poller::toggleServerState(UINT scancode)
-{
-  return (GetKeyState(MapVirtualKeyEx(scancode, 3, GetKeyboardLayout((DWORD)NULL))) & 0x1);
-}
-
-inline unsigned char Poller::keyStateAsync(UINT vKeycode)
-{
-  return GetAsyncKeyState(vKeycode);
-}
-
-inline unsigned char Poller::keyState(UINT code, UINT mapType)
-{
-  if (mapType == 0)
-  {
-    //
-    // Virtual Keycode
-    //
-    return ((GetKeyState(code) & 0x80) == 0x80);
-  }
-  else
-  {
-    //
-    // scancode
-    //
-    return ((GetKeyState(MapVirtualKeyEx(code, 3, GetKeyboardLayout((DWORD)NULL))) & 0x80) == 0x80);
-  }
-}
-
-inline char Poller::isWinNT()
-{
-  return (platformID_ == VER_PLATFORM_WIN32_NT);
-}
-
-inline char Poller::sendInput(unsigned char scancode, unsigned char pressed, int *lengthArrayINPUT)
-{
-  DWORD keyEvent = 0;
-  DWORD extended = 0;
-
-  if (scancode > 0)
-  {
-    if (pressed == 0)
-    {
-      keyEvent = KEYEVENTF_KEYUP;
-    }
-
-    if (scancode & 0x80)
-    {
-      scancode &= ~0x80;
-      extended = KEYEVENTF_EXTENDEDKEY;
-    }
-
-    pKey_[*lengthArrayINPUT].ki.wScan = (WORD) scancode;
-    pKey_[*lengthArrayINPUT].ki.dwFlags = (DWORD) (keyEvent | KEYEVENTF_SCANCODE | extended);
-    (*lengthArrayINPUT)++;
-  }
-
-
-  if (*lengthArrayINPUT > 0)                                                                                                   {
-    // FIXME: Remove me.
-    logTest("Poller::sendInput", "length Input [%d] event: %s", *lengthArrayINPUT,
-              pressed == 1 ? "KeyPress": "KeyRelease");
-
-    if (SendInput(*lengthArrayINPUT, pKey_, sizeof(INPUT)) == 0)
-    {
-      logTest("Poller::sendInput", "Failed SendInput, event: %s", pressed == 1 ? "KeyPress": "KeyRelease");
-      *lengthArrayINPUT = 0;
-      return 0;
-    }
-
-    *lengthArrayINPUT = 0;
-  }
-
-  return 1;
-}
-#endif /* Win32Poller_H */
-
-#endif /* __CYGWIN32__ */
diff --git a/nxcompshad/X11.cpp b/nxcompshad/X11.cpp
deleted file mode 100644
index 2d1140f..0000000
--- a/nxcompshad/X11.cpp
+++ /dev/null
@@ -1,1586 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#if !defined(__CYGWIN32__) && !defined(WIN32)
-
-#define PANIC
-#define WARNING
-#undef  TEST
-#undef  DEBUG
-
-#include <X11/Xlibint.h>
-#include <X11/Xproto.h>
-#include <X11/extensions/XTest.h>
-#include <X11/keysym.h>
-#include <string.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
-#include "Poller.h"
-#include "Logger.h"
-#include "Shadow.h"
-
-#define ROUNDUP(nbytes, pad) ((((nbytes) + ((pad)-1)) / (pad)) * ((pad)>>3))
-
-#undef  TRANSLATE_KEYCODES
-#define TRANSLATE_ALWAYS
-
-typedef struct {
-    KeySym  *map;
-    KeyCode minKeyCode,
-            maxKeyCode;
-    int     mapWidth;
-} KeySymsRec, *KeySymsPtr;
-
-extern KeySymsPtr NXShadowKeymap;
-
-typedef struct _KeyPressed
-{
-  KeyCode keyRcvd;
-  KeyCode keySent;
-  struct _KeyPressed *next;
-} KeyPressedRec;
-
-static KeyPressedRec *shadowKeyPressedPtr = NULL;
-
-static KeySym *shadowKeysyms = NULL;
-static KeySym *masterKeysyms = NULL;
-
-static KeySym *shadowKeymap = NULL;
-
-static int shadowMinKey, shadowMaxKey, shadowMapWidth;
-static int masterMinKey, masterMaxKey, masterMapWidth;
-
-static int leftShiftOn = 0;
-static int rightShiftOn = 0;
-static int modeSwitchOn = 0;
-static int level3ShiftOn = 0;
-static int altROn = 0;
-
-static int sentFakeLShiftPress = 0;
-static int sentFakeLShiftRelease = 0;
-static int sentFakeRShiftRelease = 0;
-static int sentFakeModeSwitchPress = 0;
-static int sentFakeModeSwitchRelease = 0;
-static int sentFakeLevel3ShiftPress = 0;
-static int sentFakeLevel3ShiftRelease = 0;
-static int sentFakeAltRRelease = 0;
-
-static int shmInitTrap = 0;
-
-Poller::Poller(Input *input, Display *display, int depth) : CorePoller(input, display)
-{
-  logTrace("Poller::Poller");
-
-  display_ = NULL;
-  shadowDisplayName_ = input -> getShadowDisplayName();
-
-  tmpBuffer_ = NULL;
-
-  xtestExtension_  = -1;
-  shmExtension_    = -1;
-  randrExtension_  = -1;
-  damageExtension_ = -1;
-
-  shadowDisplayUid_ = -1;
-
-  image_ = NULL;
-
-  shminfo_ = NULL;
-}
-
-Poller::~Poller()
-{
-  logTrace("Poller::~Poller");
-
-  if (shmExtension_ == 1)
-  {
-    XShmDetach(display_, shminfo_);
-    XDestroyImage(image_);
-    shmdt(shminfo_ -> shmaddr);
-    shmctl(shminfo_ -> shmid, IPC_RMID, 0);
-  }
-
-  if (shminfo_ != NULL)
-  {
-    delete shminfo_;
-
-    shminfo_ = NULL;
-  }
-
-  if (display_ != NULL)
-  {
-    XCloseDisplay(display_);
-  }
-
-  if (tmpBuffer_ != NULL && shmExtension_ != -1 && damageExtension_ == 1)
-  {
-    XFree(tmpBuffer_);
-
-    tmpBuffer_ = NULL;
-  }
-}
-
-int Poller::init()
-{
-  logTrace("Poller::init");
-
-  if (display_ == NULL)
-  {
-    display_ = XOpenDisplay(shadowDisplayName_);
-
-    setShadowDisplay(display_);
-  }
-
-  logTest("Poller::init:" ,"Shadow display [%p] name [%s].", (Display *) display_, shadowDisplayName_);
-
-  if (display_ == NULL)
-  {
-    logTest("Poller::init", "Failed to connect to display [%s].", shadowDisplayName_ ? shadowDisplayName_ : "");
-
-    return -1;
-  }
-
-  setRootSize();
-
-  logTest("Poller::init", "Screen geometry is [%d, %d] depth is [%d] bpl [%d] bpp [%d].",
-              width_, height_, depth_, bpl_, bpp_);
-
-  xtestInit();
-
-  shmInit();
-
-  randrInit();
-
-  damageInit();
-
-  return CorePoller::init();
-}
-
-int Poller::updateShadowFrameBuffer(void)
-{
-  if (shmExtension_ == 1)
-  {
-    if (XShmGetImage(display_, DefaultRootWindow(display_), image_, 0, 0, AllPlanes) == 0)
-    {
-      logDebug("Poller::updateShadowFrameBuffer", "XShmGetImage failed!");
-
-      return -1;
-    }
-  }
-  else
-  {
-    image_ = XGetImage(display_, DefaultRootWindow(display_), 0, 0, width_,
-                           height_, AllPlanes, ZPixmap);
-
-    if (image_ == NULL)
-    {
-      logDebug("Poller::updateShadowFrameBuffer", "XGetImage failed!");
-
-      return -1;
-    }
-  }
-
-  return 1;
-}
-
-char *Poller::getRect(XRectangle r)
-{
-  logTrace("Poller::getRect");
-
-  logDebug("Poller::getRect", "Going to retrive rectangle [%d, %d, %d, %d].",
-              r.x, r.y, r.width, r.height);
-
-  if (shmExtension_ == 1)
-  {
-    if (damageExtension_ == 1)
-    {
-      image_ -> width = r.width;
-      image_ -> height = r.height;
-
-      image_ -> bytes_per_line = ROUNDUP((image_ -> bits_per_pixel * image_ -> width), image_ -> bitmap_pad);
-
-      if (XShmGetImage(display_, DefaultRootWindow(display_), image_, r.x, r.y, AllPlanes) == 0)
-      {
-        logDebug("Poller::getRect", "XShmGetImage failed!");
-
-        return NULL;
-      }
-
-      tmpBuffer_ = image_ -> data;
-    }
-    else
-    {
-      image_ -> width  = r.width;
-      image_ -> height = r.height; 
-
-      image_ -> bytes_per_line = ROUNDUP((image_ -> bits_per_pixel * image_ -> width), image_ -> bitmap_pad);
-
-      if (XShmGetImage(display_, DefaultRootWindow(display_), image_, r.x, r.y, AllPlanes) == 0)
-      {
-        logDebug("Poller::getRect", "XShmGetImage failed!");
-      }
-
-      tmpBuffer_ = image_ -> data;
-    }
-  }
-  else
-  {
-    if (tmpBuffer_)
-    {
-      XFree(tmpBuffer_);
-      tmpBuffer_ = NULL;
-    }
-
-    image_ = XGetImage(display_, DefaultRootWindow(display_), r.x, r.y, r.width, r.height, AllPlanes, ZPixmap);
-
-    if (image_ == NULL)
-    {
-      logError("Poller::getRect", ESET(ENOMSG));
-
-      return NULL;
-    }
-
-    tmpBuffer_ = image_ -> data;
-
-    if (image_ -> obdata)
-    {
-      XFree(image_ -> obdata);
-    }
-
-    XFree(image_);
-
-    image_ = NULL;
-  }
-
-  return tmpBuffer_;
-}
-
-void Poller::shmInit(void)
-{
-  int major, minor;
-  int pixmaps;
-
-  logTest("Poller::shmInit", "Added shmExtension_ [%d].", shmExtension_);
-
-  if (shmExtension_ >= 0)
-  {
-    logDebug("Poller::shmInit", "Called with shared memory already initialized.");
-
-    if (shmInitTrap == 0)
-    {
-      return;
-    }
-  }
-
-  if (shmExtension_ < 0 && NXShadowOptions.optionShmExtension == 0)
-  {
-    shmExtension_ = 0;
-
-    logUser("Poller::shmInit: Disabling use of MIT-SHM extension.\n");
-
-    return;
-  }
-
-  if (XShmQueryVersion(display_, &major, &minor, &pixmaps) == 0)
-  {
-    logDebug("Poller::shmInit", "MIT_SHM: Shared memory extension not available.");
-
-    shmExtension_ = 0;
-  }
-  else
-  {
-    logDebug("Poller::shmInit", "MIT_SHM: Shared memory extension available.");
-
-    if (shminfo_ != NULL)
-    {
-      destroyShmImage();
-    }
-
-    shminfo_ = (XShmSegmentInfo* ) new XShmSegmentInfo;
-
-    if (shminfo_ == NULL)
-    {
-      logError("Poller::shmInit", ESET(ENOMEM));
-
-      shmExtension_ = 0;
-
-      return;
-    }
-
-    image_ = (XImage *)XShmCreateImage(display_, display_ -> screens[0].root_visual, depth_, ZPixmap,
-                                           NULL,  shminfo_, width_, height_);
-
-    if (image_ == NULL)
-    {
-      logError("Poller::shmInit", ESET(ENOMSG));
-
-      shmExtension_ = 0;
-
-      return;
-    }
-
-    shadowDisplayUid_ = NXShadowOptions.optionShadowDisplayUid;
-
-    logDebug("Poller::shmInit", "Master X server uid [%d].", NXShadowOptions.optionShadowDisplayUid);
-
-    shminfo_ -> shmid = shmget(IPC_PRIVATE, image_ -> bytes_per_line * image_ -> height, IPC_CREAT | 0666);
-
-    if (shminfo_ -> shmid < 0)
-    {
-      logDebug("Poller::shmInit", "kernel id error.");
-
-      shmExtension_ = 0;
-
-      return;
-    }
-
-    logDebug("Poller::shmInit", "Created shm segment with shmid [%d].", shminfo_ -> shmid);
-
-    shminfo_ -> shmaddr = (char *)shmat(shminfo_ -> shmid, 0, 0);
-
-    if (shminfo_ -> shmaddr < 0)
-    {
-      logWarning("Poller::shmInit", "Couldn't attach to shm segment.");
-    }
-
-    logDebug("Poller::shmInit", "shminfo_ -> shmaddr [%p].", shminfo_ -> shmaddr);
-
-    image_ -> data = shminfo_ -> shmaddr;
-
-    shminfo_ -> readOnly = 0;
-
-    if (XShmAttach(display_, shminfo_) == 0)
-    {
-      logDebug("Poller::shmInit", "XShmAttach failed.");
-
-      shmExtension_ = 0;
-
-      return;
-    }
-
-    //
-    // Mark the shm segment to be destroyed after
-    // the last process detach. Let the X server
-    // complete the X_ShmAttach request, before.
-    //
-
-    XSync(display_, 0);
-
-    struct shmid_ds ds;
-
-    shmctl(shminfo_ -> shmid, IPC_STAT, &ds);
-
-    if (shadowDisplayUid_ != -1)
-    {
-      ds.shm_perm.uid = (ushort) shadowDisplayUid_;
-    }
-    else
-    {
-      logWarning("Poller::shmInit", "Couldn't set uid for shm segment.");
-    }
-
-    ds.shm_perm.mode = 0600;
-
-    shmctl(shminfo_ -> shmid, IPC_SET, &ds);
-
-    shmctl(shminfo_ -> shmid, IPC_STAT, &ds);
-
-    shmctl(shminfo_ -> shmid, IPC_RMID, 0);
-
-    logDebug("Poller::shmInit", "Number of attaches to shm segment [%d] are [%d].\n",
-                 shminfo_ -> shmid, (int) ds.shm_nattch);
-
-    if (ds.shm_nattch > 2)
-    {
-      logWarning("Poller::shmInit", "More than two attaches to the shm segment.");
-
-      destroyShmImage();
-
-      shmExtension_ = 0;
-
-      return;
-    }
-
-    shmExtension_ = 1;
-  }
-}
-
-void Poller::keymapShadowInit(Display *display)
-{
-  int i, len;
-  CARD32 *map;
-
-  if (NXShadowKeymap != NULL)
-  {
-    shadowMinKey   = NXShadowKeymap -> minKeyCode;
-    shadowMaxKey   = NXShadowKeymap -> maxKeyCode;
-    shadowMapWidth = NXShadowKeymap -> mapWidth;
-
-    len = (shadowMaxKey - shadowMinKey + 1) * shadowMapWidth;
-
-    map = (CARD32 *) NXShadowKeymap -> map;
-
-    if (shadowKeymap != NULL)
-    {
-      free(shadowKeymap);
-    }
-
-    shadowKeymap = (KeySym *) malloc(len * sizeof(KeySym));
-
-    if (shadowKeymap != NULL)
-    {
-      for (i = 0; i < len; i++)
-      {
-        shadowKeymap[i] = map[i];
-      }
-
-      shadowKeysyms = shadowKeymap;
-    }
-  }
-
-  if (shadowKeysyms == NULL)
-  {
-    XDisplayKeycodes(display, &shadowMinKey, &shadowMaxKey);
-
-    shadowKeysyms = XGetKeyboardMapping(display, shadowMinKey, shadowMaxKey - shadowMinKey + 1,
-                                            &shadowMapWidth);
-  }
-
-  #ifdef DEBUG
-  if (shadowKeysyms != NULL)
-  {
-    for (i = 0; i < (shadowMaxKey - shadowMinKey + 1) * shadowMapWidth; i++)
-    {
-      if (i % shadowMapWidth == 0)
-      {
-        logDebug("Poller::keymapShadowInit", "keycode [%d]", (int) (i / shadowMapWidth));
-      }
-
-      logDebug("\tkeysym", " [%x] [%s]", (unsigned int) shadowKeysyms[i], XKeysymToString(shadowKeysyms[i]));
-    }
-  }
-  #endif
-}
-
-void Poller::keymapMasterInit()
-{
-  XDisplayKeycodes(display_, &masterMinKey, &masterMaxKey);
-
-  masterKeysyms = XGetKeyboardMapping(display_, masterMinKey, masterMaxKey - masterMinKey + 1,
-                                          &masterMapWidth);
-
-  #ifdef DEBUG
-  if (masterKeysyms != NULL)
-  {
-    for (int i = 0; i < (masterMaxKey - masterMinKey + 1) * masterMapWidth; i++)
-    {
-      if (i % masterMapWidth == 0)
-      {
-        logDebug("Poller::keymapMasterInit", "keycode [%d]", (int) (i / masterMapWidth));
-      }
-
-      logDebug("\tkeysym", " [%x] [%s]", (unsigned int) masterKeysyms[i], XKeysymToString(masterKeysyms[i]));
-    }
-  }
-  #endif
-}
-
-KeySym Poller::keymapKeycodeToKeysym(KeyCode keycode, KeySym *keysyms,
-                                         int minKey, int mapWidth, int col)
-{
-  int index = ((keycode - minKey) * mapWidth) + col;
-  return keysyms[index];
-}
-
-KeyCode Poller::keymapKeysymToKeycode(KeySym keysym, KeySym *keysyms,
-                                          int minKey, int maxKey, int mapWidth, int *col)
-{
-  for (int i = 0; i < (maxKey - minKey + 1) * mapWidth; i++)
-  {
-    if (keysyms[i] == keysym)
-    {
-      *col = i % mapWidth;
-      return i / mapWidth + minKey;
-    }
-  }
-  return 0;
-}
-
-KeyCode Poller::translateKeysymToKeycode(KeySym keysym, int *col)
-{
-  KeyCode keycode;
-
-  keycode = keymapKeysymToKeycode(keysym, masterKeysyms, masterMinKey,
-                                      masterMaxKey, masterMapWidth, col);
-
-  if (keycode == 0)
-  {
-    if (((keysym >> 8) == 0) && (keysym >= XK_a) && (keysym <= XK_z))
-    {
-      /*
-       * The master session has a Solaris keyboard.
-       */
-
-      keysym -= XK_a - XK_A;
-
-      keycode = keymapKeysymToKeycode(keysym, masterKeysyms, masterMinKey,
-                                          masterMaxKey, masterMapWidth, col);
-    }
-    else if (keysym == XK_Shift_R)
-    {
-      keysym = XK_Shift_L;
-
-      keycode = keymapKeysymToKeycode(keysym, masterKeysyms, masterMinKey,
-                                          masterMaxKey, masterMapWidth, col);
-    }
-    else if (keysym == XK_Shift_L)
-    {
-      keysym = XK_Shift_R;
-
-      keycode = keymapKeysymToKeycode(keysym, masterKeysyms, masterMinKey,
-                                          masterMaxKey, masterMapWidth, col);
-    }
-    else if (keysym == XK_ISO_Level3_Shift)
-    {
-      keysym = XK_Mode_switch;
-
-      if ((keycode = keymapKeysymToKeycode(keysym, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, col)) == 0)
-      {
-        keysym = XK_Alt_R;
-
-        keycode = keymapKeysymToKeycode(keysym, masterKeysyms, masterMinKey,
-                                            masterMaxKey, masterMapWidth, col);
-      }
-    }
-    else if (keysym == XK_Alt_R)
-    {
-      keysym = XK_ISO_Level3_Shift;
-
-      if ((keycode = keymapKeysymToKeycode(keysym, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, col)) == 0)
-      {
-        keysym = XK_Mode_switch;
-
-        keycode = keymapKeysymToKeycode(keysym, masterKeysyms, masterMinKey,
-                                            masterMaxKey, masterMapWidth, col);
-      }
-    }
-  }
-  return keycode;
-}
-
-Bool Poller::checkModifierKeys(KeySym keysym, Bool isKeyPress)
-{
-  switch (keysym)
-  {
-    case XK_Shift_L:
-      leftShiftOn = isKeyPress;
-      return True;
-    case XK_Shift_R:
-      rightShiftOn = isKeyPress;
-      return True;
-    case XK_Mode_switch:
-      modeSwitchOn = isKeyPress;
-      return True;
-    case XK_ISO_Level3_Shift:
-      level3ShiftOn = isKeyPress;
-      return True;
-    case XK_Alt_R:
-      altROn = isKeyPress;
-      return True;
-    default:
-      return False;
-  }
-}
-
-void Poller::sendFakeModifierEvents(int pos, Bool skip)
-{
-  KeySym fakeKeysym;
-  int col;
-
-  if ((!leftShiftOn && !rightShiftOn) &&
-          (!modeSwitchOn && !level3ShiftOn && !altROn))
-  {
-    if (pos == 1 || pos == 3)
-    {
-      fakeKeysym = keymapKeysymToKeycode(XK_Shift_L, masterKeysyms, masterMinKey,
-                                             masterMaxKey, masterMapWidth, &col);
-      XTestFakeKeyEvent(display_, fakeKeysym, 1, 0);
-      sentFakeLShiftPress = 1;
-    }
-    if (pos == 2 || pos == 3)
-    {
-      fakeKeysym = keymapKeysymToKeycode(XK_ISO_Level3_Shift, masterKeysyms, masterMinKey,
-                                             masterMaxKey, masterMapWidth, &col);
-
-      if (fakeKeysym == 0)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_Mode_switch, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        sentFakeModeSwitchPress = 1;
-      }
-      else
-      {
-        sentFakeLevel3ShiftPress = 1;
-      }
-
-      XTestFakeKeyEvent(display_, fakeKeysym, 1, 0);
-    }
-  }
-
-  else if ((leftShiftOn || rightShiftOn) &&
-               (!modeSwitchOn && !level3ShiftOn && !altROn))
-  {
-    if ((pos == 0 && !skip) || pos == 2)
-    {
-      if (leftShiftOn)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_Shift_L, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-        sentFakeLShiftRelease = 1;
-      }
-      if (rightShiftOn)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_Shift_R, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-        sentFakeRShiftRelease = 1;
-      }
-    }
-    if (pos == 2 || pos ==3)
-    {
-      fakeKeysym = keymapKeysymToKeycode(XK_ISO_Level3_Shift, masterKeysyms, masterMinKey,
-                                             masterMaxKey, masterMapWidth, &col);
-
-      if (fakeKeysym == 0)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_Mode_switch, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        sentFakeModeSwitchPress = 1;
-      }
-      else
-      {
-        sentFakeLevel3ShiftPress = 1;
-      }
-
-      XTestFakeKeyEvent(display_, fakeKeysym, 1, 0);
-    }
-  }
-
-  else if ((!leftShiftOn && !rightShiftOn) &&
-               (modeSwitchOn || level3ShiftOn || altROn))
-  {
-    if (pos == 1 || pos == 3)
-    {
-      fakeKeysym = keymapKeysymToKeycode(XK_Shift_L, masterKeysyms, masterMinKey,
-                                             masterMaxKey, masterMapWidth, &col);
-      XTestFakeKeyEvent(display_, fakeKeysym, 1, 0);
-      sentFakeLShiftPress = 1;
-    }
-    if (pos == 0 || pos == 1)
-    {
-      if (modeSwitchOn)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_Mode_switch, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-        sentFakeModeSwitchRelease = 1;
-      }
-      if (level3ShiftOn)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_ISO_Level3_Shift, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-        sentFakeLevel3ShiftRelease = 1;
-      }
-      if (altROn)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_Alt_R, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-        sentFakeAltRRelease = 1;
-      }
-    }
-  }
-
-  else if ((leftShiftOn || rightShiftOn) &&
-               (modeSwitchOn || level3ShiftOn || altROn))
-  {
-    if (pos == 0 || pos == 2)
-    {
-      if (leftShiftOn)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_Shift_L, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-        sentFakeLShiftRelease = 1;
-      }
-      if (rightShiftOn)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_Shift_R, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-        sentFakeRShiftRelease = 1;
-      }
-    }
-    if (pos == 0 || pos == 1)
-    {
-      if (modeSwitchOn)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_Mode_switch, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-        sentFakeModeSwitchRelease = 1;
-      }
-      if (level3ShiftOn)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_ISO_Level3_Shift, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-        sentFakeLevel3ShiftRelease = 1;
-      }
-      if (altROn)
-      {
-        fakeKeysym = keymapKeysymToKeycode(XK_Alt_R, masterKeysyms, masterMinKey,
-                                               masterMaxKey, masterMapWidth, &col);
-        XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-        sentFakeAltRRelease = 1;
-      }
-    }
-  }
-}
-
-void Poller::cancelFakeModifierEvents()
-{
-  KeySym fakeKeysym;
-  int col;
-
-  if (sentFakeLShiftPress)
-  {
-    logTest("Poller::handleKeyboardEvent", "Fake Shift_L key press event has been sent");
-    logTest("Poller::handleKeyboardEvent", "Sending fake Shift_L key release event");
-
-    fakeKeysym = keymapKeysymToKeycode(XK_Shift_L, masterKeysyms, masterMinKey,
-                                           masterMaxKey, masterMapWidth, &col);
-    XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-
-    sentFakeLShiftPress = 0;
-  }
-
-  if (sentFakeLShiftRelease)
-  {
-    logTest("Poller::handleKeyboardEvent", "Fake Shift_L key release event has been sent");
-    logTest("Poller::handleKeyboardEvent", "Sending fake Shift_L key press event");
-
-    fakeKeysym = keymapKeysymToKeycode(XK_Shift_L, masterKeysyms, masterMinKey,
-                                           masterMaxKey, masterMapWidth, &col);
-    XTestFakeKeyEvent(display_, fakeKeysym, 1, 0);
-
-    sentFakeLShiftRelease = 0;
-  }
-
-  if (sentFakeRShiftRelease)
-  {
-    logTest("Poller::handleKeyboardEvent", "Fake Shift_R key release event has been sent");
-    logTest("Poller::handleKeyboardEvent", "Sending fake Shift_R key press event");
-
-    fakeKeysym = keymapKeysymToKeycode(XK_Shift_R, masterKeysyms, masterMinKey,
-                                           masterMaxKey, masterMapWidth, &col);
-    XTestFakeKeyEvent(display_, fakeKeysym, 1, 0);
-
-    sentFakeRShiftRelease = 0;
-  }
-
-  if (sentFakeModeSwitchPress)
-  {
-    logTest("Poller::handleKeyboardEvent", "Fake Mode_switch key press event has been sent");
-    logTest("Poller::handleKeyboardEvent", "Sending fake Mode_switch key release event");
-
-    fakeKeysym = keymapKeysymToKeycode(XK_Mode_switch, masterKeysyms, masterMinKey,
-                                           masterMaxKey, masterMapWidth, &col);
-    XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-
-    sentFakeModeSwitchPress = 0;
-  }
-
-  if (sentFakeModeSwitchRelease)
-  {
-    logTest("Poller::handleKeyboardEvent", "Fake Mode_switch key release event has been sent");
-    logTest("Poller::handleKeyboardEvent", "Sending Mode_switch key press event");
-
-    fakeKeysym = keymapKeysymToKeycode(XK_Mode_switch, masterKeysyms, masterMinKey,
-                                           masterMaxKey, masterMapWidth, &col);
-    XTestFakeKeyEvent(display_, fakeKeysym, 1, 0);
-
-    sentFakeModeSwitchRelease = 0;
-  }
-
-  if (sentFakeLevel3ShiftPress)
-  {
-    logTest("Poller::handleKeyboardEvent", "Fake ISO_Level3_Shift key press event has been sent");
-    logTest("Poller::handleKeyboardEvent", "Sending fake ISO_Level3_Shift key release event");
-
-    fakeKeysym = keymapKeysymToKeycode(XK_ISO_Level3_Shift, masterKeysyms, masterMinKey,
-                                           masterMaxKey, masterMapWidth, &col);
-    XTestFakeKeyEvent(display_, fakeKeysym, 0, 0);
-
-    sentFakeLevel3ShiftPress = 0;
-  }
-
-  if (sentFakeLevel3ShiftRelease)
-  {
-    logTest("Poller::handleKeyboardEvent", "Fake ISO_Level3_Shift key release event has been sent");
-    logTest("Poller::handleKeyboardEvent", "Sending fake ISO_Level3_Shift key press event");
-
-    fakeKeysym = keymapKeysymToKeycode(XK_ISO_Level3_Shift, masterKeysyms, masterMinKey,
-                                           masterMaxKey, masterMapWidth, &col);
-    XTestFakeKeyEvent(display_, fakeKeysym, 1, 0);
-
-    sentFakeLevel3ShiftRelease = 0;
-  }
-
-  if (sentFakeAltRRelease)
-  {
-    logTest("Poller::handleKeyboardEvent", "Fake XK_Alt_R key release event has been sent");
-    logTest("Poller::handleKeyboardEvent", "Sending fake XK_Alt_R key press event");
-
-    fakeKeysym = keymapKeysymToKeycode(XK_Alt_R, masterKeysyms, masterMinKey,
-                                           masterMaxKey, masterMapWidth, &col);
-    XTestFakeKeyEvent(display_, fakeKeysym, 1, 0);
-
-    sentFakeAltRRelease = 0;
-  }
-}
-
-Bool Poller::keyIsDown(KeyCode keycode)
-{
-  KeyPressedRec *downKey;
-
-  downKey = shadowKeyPressedPtr;
-
-  while (downKey)
-  {
-    if (downKey -> keyRcvd == keycode)
-    {
-      return True;
-    }
-    downKey = downKey -> next;
-  }
-
-  return False;
-}
-
-void Poller::addKeyPressed(KeyCode received, KeyCode sent)
-{
-  KeyPressedRec *downKey;
-
-  if (!keyIsDown(received))
-  {
-    if (shadowKeyPressedPtr == NULL)
-    {
-      shadowKeyPressedPtr = (KeyPressedRec *) malloc(sizeof(KeyPressedRec));
-
-      shadowKeyPressedPtr -> keyRcvd = received;
-      shadowKeyPressedPtr -> keySent = sent;
-      shadowKeyPressedPtr -> next = NULL;
-    }
-    else
-    {
-      downKey = shadowKeyPressedPtr;
-
-      while (downKey -> next != NULL)
-      {
-        downKey = downKey -> next;
-      }
-
-      downKey -> next = (KeyPressedRec *) malloc(sizeof(KeyPressedRec));
-
-      downKey -> next -> keyRcvd = received;
-      downKey -> next -> keySent = sent;
-      downKey -> next -> next = NULL;
-    }
-  }
-}
-
-KeyCode Poller::getKeyPressed(KeyCode received)
-{
-  KeyCode sent;
-  KeyPressedRec *downKey;
-  KeyPressedRec *tempKey;
-
-  if (shadowKeyPressedPtr != NULL)
-  {
-    if (shadowKeyPressedPtr -> keyRcvd == received)
-    {
-      sent = shadowKeyPressedPtr -> keySent;
-
-      tempKey = shadowKeyPressedPtr;
-      shadowKeyPressedPtr = shadowKeyPressedPtr -> next;
-      free(tempKey);
-
-      return sent;
-    }
-    else
-    {
-      downKey = shadowKeyPressedPtr;
-
-      while (downKey -> next != NULL)
-      {
-        if (downKey -> next -> keyRcvd == received)
-        {
-          sent = downKey -> next -> keySent;
-
-          tempKey = downKey -> next;
-          downKey -> next = downKey -> next -> next;
-          free(tempKey);
-
-          return sent;
-        }
-        else
-        {
-          downKey = downKey -> next;
-        }
-      }
-    }
-  }
-  return 0;
-}
-
-void Poller::handleKeyboardEvent(Display *display, XEvent *event)
-{
-  if (xtestExtension_ == 0 || display_ == 0)
-  {
-    return;
-  }
-
-  logTest("Poller::handleKeyboardEvent", "Handling event at [%p]", event);
-
-#ifdef TRANSLATE_ALWAYS
-
-  KeyCode keycode;
-  KeySym keysym;
-
-  int col = 0;
-
-  Bool isKeyPress = False;
-  Bool isModifier = False;
-  Bool isShiftComb = False;
-  Bool skip = False;
-
-  if (event -> type == KeyPress)
-  {
-    isKeyPress = True;
-  }
-
-  if (shadowKeysyms == NULL)
-  {
-    keymapShadowInit(event -> xkey.display);
-  }
-
-  if (masterKeysyms == NULL)
-  {
-    keymapMasterInit();
-  }
-
-  if (shadowKeysyms == NULL || masterKeysyms == NULL)
-  {
-    logTest("Poller::handleKeyboardEvent", "Unable to initialize keymaps. Do not translate");
-
-    keycode = event -> xkey.keycode;
-
-    goto SendKeycode;
-  }
-
-  keysym = keymapKeycodeToKeysym(event -> xkey.keycode, shadowKeysyms,
-                                   shadowMinKey, shadowMapWidth, 0);
-
-  isModifier = checkModifierKeys(keysym, isKeyPress);
-
-  if (event -> type == KeyRelease)
-  {
-    KeyCode keycodeToSend;
-
-    keycodeToSend = getKeyPressed(event -> xkey.keycode);
-
-    if (keycodeToSend)
-    {
-      keycode = keycodeToSend;
-
-      goto SendKeycode;
-    }
-  }
-
-  /*
-   * Convert case for Solaris keyboard.
-   */
-
-  if (((keysym >> 8) == 0) && (keysym >= XK_A) && (keysym <= XK_Z))
-  {
-    if (!leftShiftOn && !rightShiftOn)
-    {
-      keysym += XK_a - XK_A;
-    }
-    else
-    {
-      skip = True;
-    }
-  }
-
-  if (!isModifier)
-  {
-    if ((leftShiftOn || rightShiftOn) &&
-            (!modeSwitchOn && !level3ShiftOn && !altROn) &&
-                !skip)
-    {
-      KeySym tempKeysym = keymapKeycodeToKeysym(event -> xkey.keycode, shadowKeysyms,
-                                                    shadowMinKey, shadowMapWidth, 1);
-
-      if (tempKeysym == 0)
-      {
-        isShiftComb = True;
-      }
-      else
-      {
-        keysym = tempKeysym;
-      }
-    }
-    else if ((!leftShiftOn && !rightShiftOn) &&
-                 (modeSwitchOn || level3ShiftOn || altROn))
-    {
-      keysym = keymapKeycodeToKeysym(event -> xkey.keycode, shadowKeysyms,
-                                         shadowMinKey, shadowMapWidth, 2);
-    }
-    else if ((leftShiftOn || rightShiftOn) &&
-                 (modeSwitchOn || level3ShiftOn || altROn))
-    {
-      keysym = keymapKeycodeToKeysym(event -> xkey.keycode, shadowKeysyms,
-                                       shadowMinKey, shadowMapWidth, 3);
-    }
-  }
-
-  if (keysym == 0)
-  {
-    logTest("Poller::handleKeyboardEvent", "Null keysym. Return");
-
-    return;
-  }
-
-  logTest("Poller::handleKeyboardEvent", "keysym [%x] [%s]",
-              (unsigned int)keysym, XKeysymToString(keysym));
-
-  if (keysym == XK_Mode_switch)
-  {
-    keysym = XK_ISO_Level3_Shift;
-  }
-
-  keycode = translateKeysymToKeycode(keysym, &col);
-
-  if (keycode == 0)
-  {
-    logTest("Poller::handleKeyboardEvent", "No keycode found for keysym [%x] [%s]. Return",
-                (unsigned int)keysym, XKeysymToString(keysym));
-    return;
-  }
-
-  logTest("Poller::handleKeyboardEvent", "keycode [%d] translated into keycode [%d]",
-              (int)event -> xkey.keycode, (unsigned int)keycode);
-
-  if (event -> type == KeyPress)
-  {
-    addKeyPressed(event -> xkey.keycode, keycode);
-  }
-
-  /*
-   * Send fake modifier events.
-   */
-
-  if (!isModifier && isShiftComb == False)
-  {
-    sendFakeModifierEvents(col, ((keysym >> 8) == 0) && (keysym >= XK_A) && (keysym <= XK_Z));
-  }
-
-SendKeycode:
-
-  /*
-   * Send the event.
-   */
-
-  XTestFakeKeyEvent(display_, keycode, isKeyPress, 0);
-
-  /*
-   * Check if fake modifier events have been sent.
-   */
-
-  cancelFakeModifierEvents();
-
-#else // TRANSLATE_ALWAYS
-
-  //
-  // Use keysyms to translate keycodes across different
-  // keyboard models. Unuseful when both keyboards have
-  // same keycodes (e.g. both are pc keyboards).
-  //
-
-  #ifdef TRANSLATE_KEYCODES
-
-  KeyCode keycode = XKeysymToKeycode(display_, XK_A);
-
-  if (XKeysymToKeycode(event -> xkey.display, XK_A) != keycode)
-  {
-    KeySym keysym = XKeycodeToKeysym(event -> xkey.display, event -> xkey.keycode, 0);
-  
-    if (keysym == XK_Mode_switch || keysym == XK_ISO_Level3_Shift)
-    {
-      logUser("Poller::handleKeyboardEvent: keysym [%x].\n", (unsigned int)keysym);
-  
-      if (XKeycodeToKeysym(display_, 113, 0) == XK_ISO_Level3_Shift ||
-             (XKeycodeToKeysym(display_, 124, 0) == XK_ISO_Level3_Shift))
-      {
-        event -> xkey.keycode = 113;
-      }
-      else
-      {
-        event -> xkey.keycode = XKeysymToKeycode(display_, XK_Mode_switch);
-      }
-  
-      logUser("Poller::handleKeyboardEvent: keycode translated to [%x].\n", (unsigned int)event -> xkey.keycode);
-    }
-    else
-    {
-      event -> xkey.keycode = XKeysymToKeycode(display_, keysym);
-    }
-  }
-
-  #endif // TRANSLATE_KEYCODES
-
-  if (event -> type == KeyPress)
-  {
-    XTestFakeKeyEvent(display_, event -> xkey.keycode, 1, 0);
-  }
-  else if (event -> type == KeyRelease)
-  {
-    XTestFakeKeyEvent(display_, event -> xkey.keycode, 0, 0);
-  }
-
-#endif // TRANSLATE_ALWAYS
-}
-
-void Poller::handleWebKeyboardEvent(KeySym keysym, Bool isKeyPress)
-{
-  KeyCode keycode;
-  int col;
-
-  if (masterKeysyms == NULL)
-  {
-    keymapMasterInit();
-  }
-
-  if (masterKeysyms == NULL)
-  {
-    logTest("Poller::handleWebKeyboardEvent", "Unable to initialize keymap");
-
-    return;
-  }
-
-  keycode = translateKeysymToKeycode(keysym, &col);
-
-  if (keycode == 0)
-  {
-    logTest("Poller::handleKeyboardEvent", "No keycode found for keysym [%x] [%s]. Return",
-                (unsigned int)keysym, XKeysymToString(keysym));
-    return;
-  }
-
-  logTest("Poller::handleKeyboardEvent", "keysym [%x] [%s] translated into keycode [%x]",
-              (unsigned int)keysym, XKeysymToString(keysym), (unsigned int)keycode);
-
-  /*
-   * Send fake modifier events.
-   */
-
-  if (!checkModifierKeys(keysym, isKeyPress))
-  {
-    sendFakeModifierEvents(col, False);
-  }
-
-  /*
-   * Send the event.
-   */
-
-  XTestFakeKeyEvent(display_, keycode, isKeyPress, 0);
-
-  /*
-   * Check if fake modifier events have been sent.
-   */
-
-  cancelFakeModifierEvents();
-
-}
-
-void Poller::handleMouseEvent(Display *display, XEvent *event)
-{
-  if (xtestExtension_ == 0 || display_ == 0)
-  {
-    return;
-  }
-
-  if (event -> type == MotionNotify)
-  {
-    XTestFakeMotionEvent(display_, 0, event -> xmotion.x, event -> xmotion.y, 0);
-  }
-  else if (event -> type == ButtonPress)
-  {
-    XTestFakeButtonEvent(display_, event -> xbutton.button, True, 0);
-  }
-  else if (event -> type == ButtonRelease)
-  {
-    XTestFakeButtonEvent(display_, event -> xbutton.button, False, 0);
-  }
-
-  XFlush(display_);
-}
-
-void Poller::setRootSize(void)
-{
-  width_ = WidthOfScreen(DefaultScreenOfDisplay(display_));
-  height_ = HeightOfScreen(DefaultScreenOfDisplay(display_));
-  depth_ = DefaultDepth(display_, DefaultScreen(display_));
-
-  if (depth_ == 8) bpp_ = 1;
-  else if (depth_ == 16) bpp_ = 2;
-  else bpp_ = 4;
-
-  bpl_ = width_ * bpp_;
-}
-
-void Poller::destroyShmImage(void)
-{
-    XShmDetach(display_, shminfo_);
-    XDestroyImage(image_);
-    image_ = NULL;
-
-    shmdt(shminfo_ -> shmaddr);
-    shmctl(shminfo_ -> shmid, IPC_RMID, 0);
-
-    delete shminfo_;
-    shminfo_ = NULL;
-}
-
-void Poller::xtestInit(void)
-{
-  int eventBase;
-  int errorBase;
-  int versionMajor;
-  int versionMinor;
-  int result;
-
-  xtestExtension_ = 0;
-
-  result = XTestQueryExtension(display_, &eventBase, &errorBase, &versionMajor, &versionMinor);
-
-  if (result == 0)
-  {
-    xtestExtension_ = 0;
-
-    logWarning("Poller::xtestInit", "Failed while querying for XTEST extension.");
-  }
-  else
-  {
-    logDebug("Poller::xtestInit", "XTEST version %d.%d.", versionMajor, versionMinor);
-
-    xtestExtension_ = 1;
-  }
-
-  //
-  // Make this client impervious to grabs.
-  //
-
-  if (xtestExtension_ == 1)
-  {
-    XTestGrabControl(display_, 1);
-  }
-}
-
-void Poller::randrInit(void)
-{
-  int randrEventBase;
-  int randrErrorBase;
-
-  if (XRRQueryExtension(display_, &randrEventBase, &randrErrorBase) == 0)
-  {
-    logWarning("Poller::randrInit", "Randr extension not supported on this "
-                   "display.");
-
-    randrExtension_ = 0;
-
-    return;
-  }
-
-  XRRSelectInput(display_, DefaultRootWindow(display_),
-                     RRScreenChangeNotifyMask);
-
-  randrEventBase_ = randrEventBase;
-
-  randrExtension_ = 1;
-
-  return;
-}
-
-void Poller::damageInit(void)
-{
-  int damageMajorVersion = 0;
-  int damageMinorVersion = 0;
-
-  int damageEventBase = 0;
-  int damageErrorBase = 0;
-
-  if (damageExtension_ >= 0)
-  {
-    logDebug("Poller::damageInit", "Called with damage already initialized.");
-  }
-
-  if (damageExtension_ == 0)
-  {
-    logDebug("Poller::damageInit", "Damage disabled. Skip initialization.");
-
-    return;
-  }
-
-  if (damageExtension_ < 0 && NXShadowOptions.optionDamageExtension == 0)
-  {
-    damageExtension_ = 0;
-
-    logUser("Poller::damageInit: Disabling use of DAMAGE extension.\n");
-
-    return;
-  }
-
-  damageExtension_ = 0;
-
-  mirrorChanges_ = 0;
-
-  if (XDamageQueryExtension(display_, &damageEventBase, &damageErrorBase) == 0)
-  {
-    logUser("Poller::damageInit: DAMAGE not supported.\n");
-
-    return;
-  }
-  #ifdef DEBUG
-  else
-  {
-    fprintf(stderr, "Poller::damageInit: DAMAGE supported. "
-                "Event base [%d] error base [%d].\n", damageEventBase, damageErrorBase);
-  }
-  #endif
-
-  damageEventBase_ = damageEventBase;
-
-  if (XDamageQueryVersion(display_, &damageMajorVersion, &damageMinorVersion) == 0)
-  {
-    logWarning("Poller::damageInit", "Error on querying DAMAGE version.\n");
-
-    damageExtension_ = 0;
-
-    return;
-  }
-  #ifdef DEBUG
-  else
-  {
-    fprintf(stderr, "Poller::damageInit: DAMAGE version %d.%d.\n",
-                damageMajorVersion, damageMinorVersion);
-  }
-  #endif
-
-  damage_ = XDamageCreate(display_, DefaultRootWindow(display_), XDamageReportRawRectangles);
-
-  damageExtension_= 1;
-
-  mirror_ = 1;
-
-  return;
-}
-
-void Poller::getEvents(void)
-{
-  XEvent X;
-
-  if (damageExtension_ == 1)
-  {
-    XDamageSubtract(display_, damage_, None, None);
-  }
-
-  XSync(display_, 0);
-
-  while (XCheckIfEvent(display_, &X, anyEventPredicate, NULL) == 1)
-  {
-    if (randrExtension_ == 1 && (X.type == randrEventBase_ + RRScreenChangeNotify || X.type == ConfigureNotify))
-    {
-      XRRUpdateConfiguration(&X);
-
-      handleRRScreenChangeNotify(&X);
-
-      continue;
-    }
-
-    if (damageExtension_ == 1 && X.type == damageEventBase_ + XDamageNotify)
-    {
-      handleDamageNotify(&X);
-    }
-  }
-
-  if (damageExtension_ == 1)
-  {
-    updateDamagedAreas();
-  }
-
-  XFlush(display_);
-}
-
-void Poller::handleRRScreenChangeNotify(XEvent *X)
-{
-  return;
-}
-
-void Poller::handleDamageNotify(XEvent *X)
-{
-  XDamageNotifyEvent *e = (XDamageNotifyEvent *) X;
-
-  //
-  //  e->drawable is the window ID of the damaged window
-  //  e->geometry is the geometry of the damaged window
-  //  e->area     is the bounding rect for the damaged area
-  //  e->damage   is the damage handle returned by XDamageCreate()
-  //
-
-  #ifdef DEBUG
-  fprintf(stderr, "handleDamageNotify: drawable [%d] damage [%d] geometry [%d][%d][%d][%d] area [%d][%d][%d][%d].\n",
-              (int) e -> drawable, (int) e -> damage, e -> geometry.x, e -> geometry.y,
-                  e -> geometry.width, e -> geometry.height, e -> area.x, e -> area.y,
-                      e -> area.width, e -> area.height);
-  #endif
-
-  XRectangle rectangle = {e -> area.x, e -> area.y, e -> area.width, e -> area.height};
-
-  XUnionRectWithRegion(&rectangle, lastUpdatedRegion_, lastUpdatedRegion_);
-
-  mirrorChanges_ = 1;
-
-  return;
-}
-
-void Poller::updateDamagedAreas(void)
-{
-  BOX *boxPtr;
-
-  XRectangle rectangle;
-
-  int i;
-  int y;
-  
-  for (i = 0; i < lastUpdatedRegion_ -> numRects; i++)
-  {
-    boxPtr = lastUpdatedRegion_ -> rects + i;
-
-    if (shmExtension_ == 1)
-    {
-      image_ -> width  = boxPtr -> x2 - boxPtr -> x1;
-      image_ -> height = boxPtr -> y2 - boxPtr -> y1;
-      image_ -> bytes_per_line =
-          ROUNDUP((image_ -> bits_per_pixel * image_ -> width),
-                      image_ -> bitmap_pad);
-      
-      if (XShmGetImage(display_, DefaultRootWindow(display_), image_,
-                           boxPtr -> x1, boxPtr -> y1, AllPlanes) == 0)
-      {
-        logDebug("Poller::updateDamagedAreas", "XShmGetImage failed!");
-
-        return;
-      }
-    }
-    else if (shmExtension_ == 0)
-    {
-      image_ = XGetImage(display_, DefaultRootWindow(display_), boxPtr -> x1,
-                             boxPtr -> y1, boxPtr -> x2 - boxPtr -> x1,
-                                 boxPtr -> y2 - boxPtr -> y1, AllPlanes,
-                                     ZPixmap);
-
-      if (image_ == NULL)
-      {
-        logDebug("Poller::updateDamagedAreas", "XGetImage failed!");
-
-        return;
-      }
-
-      image_ -> width  = boxPtr -> x2 - boxPtr -> x1;
-      image_ -> height = boxPtr -> y2 - boxPtr -> y1;
-      image_ -> bytes_per_line =
-          ROUNDUP((image_ -> bits_per_pixel * image_ -> width),
-                      image_ -> bitmap_pad);
-    }
-
-    rectangle.height = 1;
-    rectangle.width = image_ -> width;
-    rectangle.x = boxPtr -> x1;
-    rectangle.y = boxPtr -> y1;
-
-    for (y = 0; y < image_ -> height; y++)
-    {
-      update(image_ -> data + y * image_ -> bytes_per_line, rectangle);
-
-      rectangle.y++; 
-    }
-
-    if (shmExtension_ != 1)
-    {
-       XDestroyImage(image_);
-
-      image_ = NULL;
-    }
-  }
-
-  return;
-}
-
-void Poller::getScreenSize(int *w, int *h)
-{
-  *w = WidthOfScreen(DefaultScreenOfDisplay(display_));
-  *h = HeightOfScreen(DefaultScreenOfDisplay(display_));
-}
-
-void Poller::setScreenSize(int *w, int *h)
-{
-  setRootSize();
-
-  shmInitTrap = 1;
-  shmInit();
-  shmInitTrap = 0;
-
-  *w = width_;
-  *h = height_;
-
-  logDebug("Poller::setScreenSize", "New size of screen [%d, %d]", width_, height_);
-}
-
-int anyEventPredicate(Display *display, XEvent *event, XPointer parameter)
-{
-  return 1;
-}
-
-#endif /* !defined(__CYGWIN32__) && !defined(WIN32) */
diff --git a/nxcompshad/X11.h b/nxcompshad/X11.h
deleted file mode 100644
index 2127542..0000000
--- a/nxcompshad/X11.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/**************************************************************************/
-/*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
-/*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
-/* are copyright of NoMachine. Redistribution and use of the present      */
-/* software is allowed according to terms specified in the file LICENSE   */
-/* which comes in the source distribution.                                */
-/*                                                                        */
-/* Check http://www.nomachine.com/licensing.html for applicability.       */
-/*                                                                        */
-/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
-/*                                                                        */
-/* All rights reserved.                                                   */
-/*                                                                        */
-/**************************************************************************/
-
-#ifndef X11Poller_H
-#define X11Poller_H
-
-#include <X11/Xlib.h>
-#include <X11/extensions/XShm.h>
-#include <X11/extensions/Xdamage.h>
-#include <X11/extensions/Xrandr.h>
-
-#include "Core.h"
-
-class Poller : public CorePoller
-{
-  public:
-
-  Poller(Input *, Display *display, int = 0);
-
-  ~Poller();
-
-  int init();
-
-  void setRootSize();
-
-  void destroyShmImage();
-
-  void getEvents(void);
-
-  void getScreenSize(int *width, int *height);
-
-  void setScreenSize(int *width, int *height);
-
-  private:
-
-  Display *display_;
-
-  char *shadowDisplayName_;
-
-  int shadowDisplayUid_;
-
-  char *tmpBuffer_;
-
-  char xtestExtension_;
-
-  char shmExtension_;
-
-  char randrExtension_;
-
-  int randrEventBase_;
-
-  char damageExtension_;
-
-  int damageEventBase_;
-
-  Damage damage_;
-
-  Region repair_;
-
-  char damageChanges_;
-
-  XShmSegmentInfo *shminfo_;
-
-  XImage *image_;
-
-  int updateShadowFrameBuffer(void);
-
-  char *getRect(XRectangle);
-
-  void keymapShadowInit(Display *display);
-
-  void keymapMasterInit();
-
-  KeySym keymapKeycodeToKeysym(KeyCode keycode, KeySym *keysyms,
-                                   int minKey, int per, int col);
-
-  KeyCode keymapKeysymToKeycode(KeySym keysym, KeySym *keysyms,
-                                    int minKey, int maxKey, int per, int *col);
-
-  KeyCode translateKeysymToKeycode(KeySym keysym, int *col);
-
-  Bool checkModifierKeys(KeySym keysym, Bool isKeyPress);
-
-  void sendFakeModifierEvents(int pos, Bool skip);
-
-  void cancelFakeModifierEvents();
-
-  Bool keyIsDown(KeyCode keycode);
-
-  void addKeyPressed(KeyCode received, KeyCode sent);
-
-  KeyCode getKeyPressed(KeyCode received);
-
-  void handleKeyboardEvent(Display *display, XEvent *);
-
-  void handleWebKeyboardEvent(KeySym keysym, Bool isKeyPress);
-
-  void handleMouseEvent(Display *, XEvent *);
-
-  void xtestInit(void);
-
-  void shmInit(void);
-
-  void randrInit(void);
-
-  void damageInit(void);
-
-  void handleRRScreenChangeNotify(XEvent *);
-
-  void handleDamageNotify(XEvent *);
-
-  void updateDamagedAreas(void);
-};
-
-int anyEventPredicate(Display *display, XEvent *event, XPointer parameter);
-
-#endif /* X11Poller_H */
diff --git a/nxproxy/CHANGELOG b/nxproxy/CHANGELOG
new file mode 100644
index 0000000..f24de41
--- /dev/null
+++ b/nxproxy/CHANGELOG
@@ -0,0 +1,180 @@
+ChangeLog:
+
+nxproxy-3.0.0-4
+
+- Added file COPYING.
+
+- Changed the LICENSE file to state that the software is only made
+  available under the version 2 of the GPL.
+
+nxproxy-3.0.0-3
+
+- Updated the copyright notices to year 2007.
+
+nxproxy-3.0.0-2
+
+- Updated the file VERSION.
+
+nxproxy-3.0.0-1
+
+- Opened the 3.0.0 branch based on nxproxy-2.0.0-2.
+
+nxproxy-2.0.0-2
+
+- Updated copyright to year 2006.
+
+nxproxy-2.0.0-1
+
+- Opened the 2.0.0 branch based on nxproxy-1.5.0-10.
+
+nxproxy-1.5.0-10
+
+- Added the JPEG, PNG and Z libraries to the linker when compiling
+  on Cygwin. GCC 3.3.x requires that these libraries are explicitly
+  given while this is not required since GCC 3.4.x.
+
+- Created a new configure using autoconf 2.59.
+
+nxproxy-1.5.0-9
+
+- Removed provision for dynamically loading a different version of
+  the nxcomp library.
+
+nxproxy-1.5.0-8
+
+- Updated to reflect the new naming of the NX transport interfaces.
+
+nxproxy-1.5.0-7
+
+- Modified the Makefile.in to remove the *.out.* files generated by
+  Valgrind when running a 'make clean'.
+
+- Modified the README files and removed files that were outdated.
+
+nxproxy-1.5.0-6
+
+- Removed the NX_FORCE_IDLE_PROXY stubs.
+
+nxproxy-1.5.0-5
+
+- This version has NX_FORCE_IDLE_PROXY undefined, so it should work
+  in a way that is compatible with the old nxproxy.
+
+nxproxy-1.5.0-4
+
+- This software is crafted by default to test the new integration
+  between nxcomp and nxssh. The process will stay idle and will
+  let nxssh create the proxy. Note that the session log will go to
+  'sshlog', not to 'session'. This will have to be fixed in nxcomp
+  in future versions.
+
+- Removed the references to the "bind" functionality that is not
+  used in the current software.
+
+nxproxy-1.5.0-3
+
+- Added a NX_FORCE_IDLE_PROXY. If set, nxproxy will stay idle and
+  will not try to create a nxcomp proxy. This is used for testing
+  the new in-process nxcomp functionalities with the development
+  versions of nxclient and nxssh software.
+
+nxproxy-1.5.0-2
+
+- Small changes to this file.
+
+nxproxy-1.5.0-1
+
+- Opened the 1.5.0 branch.
+
+nxproxy-1.4.1-1
+
+- Opened the 1.4.1 branch.
+
+nxproxy-1.4.0-3
+
+- We were lucky. We found a machine where nxproxy failed exactly
+  in the same way described by multiple users in their reports.
+  The error was the same ('dlopen: win32 line 126') and neither
+  rebasing the Cygwin DLLs or removing all the other Cygwin li-
+  braries worked. So the problem had necessarily to be in a bug-
+  gy Cygwin dlopen() implementation. To solve this I had to make
+  changes to the nxproxy code on Windows, so it links to nxcomp
+  at compile time in the way specified below. As far as I can
+  tell, any other way fails. This seems to be another Cygwin bug:
+  the linker says that everything is OK but then the executable
+  can't be run. Both the Cygwin's bash and the command.com say
+  'Permission denied'.
+
+  LIBS = -L../nxcomp -lstdc++ -Wl,-e,_mainCRTStartup -lXcomp \
+         -lcygipc -static -lpng -static -ljpeg -lz
+
+nxproxy-1.4.0-2
+
+- Added a Binder class invoked when calling proxy with -B option.
+  It would serve as a replacement of the modifications I'm doing
+  in nxssh. The class is just a framework and the implementation
+  is unfinished.
+
+- Solved a potential problem in Main.c with NXExit() being called
+  after the dlclose(). This was unlikely to happen as proxy never
+  returns.
+
+nxproxy-1.4.0-1
+
+- Opened the 1.4.0 branch.
+
+nxproxy-1.3.2-1
+
+- Opened the 1.3.2 branch.
+
+nxproxy-1.3.1-2
+
+- Removed the underline characters and added a colon in the
+  title of this ChangeLog to fully comply with format used in
+  the release notices.
+
+nxproxy-1.3.1-1
+
+- Opened the 1.3.1 branch.
+
+nxproxy-1.3.0-7
+
+- Added a check on the OS version when running on MacOS/X.
+  Versions 10.2 and 10.3 differ in the way names are mangled.
+
+- Fixed error detection on dlsym(). The previous code was not
+  able to correctly identify missing symbols.
+
+nxproxy-1.3.0-6
+
+- Modified configure.in to compile under FreeBSD.
+
+nxproxy-1.3.0-5
+
+- Fixed a (further) compilation problem under Cygwin.
+
+nxproxy-1.3.0-4
+
+- New nxproxy is able to load libXcomp by dlopen() under
+  Cygwin. This simplifies both code in Main.c and the
+  configure.in script.
+
+- Changed configure.in to not link with -mwindows under
+  Cygwin. Linking with -mwindows prevented stderr to be
+  correctly output when running nxproxy on a console.
+
+nxproxy-1.3.0-3
+
+- Changed configure.in to first check for nx-X11 includes
+  and libraries. Added "/usr/openwin/bin/makedepend" to
+  path searched for the executable.
+
+nxproxy-1.3.0-2
+
+- Small cleanup in configure.in. A new configure script has
+  been generated using autoconf-2.57-3.
+
+nxproxy-1.3.0-1
+
+- Updated internal version, so this release tries to load
+  libXcomp version 1.3.0.
diff --git a/nxcompshad/COPYING b/nxproxy/COPYING
similarity index 100%
rename from nxcompshad/COPYING
rename to nxproxy/COPYING
diff --git a/nxproxy/LICENSE b/nxproxy/LICENSE
new file mode 100644
index 0000000..000fb98
--- /dev/null
+++ b/nxproxy/LICENSE
@@ -0,0 +1,36 @@
+Copyright (C) 2001, 2007 NoMachine - http://www.nomachine.com/.
+
+NXPROXY and NX extensions to this software are copyright of NoMachine.
+Redistribution and use of this software is allowed according to the
+following terms:
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License Version 2, and
+not any other version, as published by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See 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
+
+Parts of this software are derived from DXPC project. These copyright
+notices apply to original DXPC code:
+
+Redistribution and use in source and binary forms are permitted provided
+that the above copyright notice and this paragraph are duplicated in all
+such forms.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+Copyright (c) 1995,1996 Brian Pane
+Copyright (c) 1996,1997 Zachary Vonler and Brian Pane
+Copyright (c) 1999 Kevin Vigor and Brian Pane
+Copyright (c) 2000,2001 Gian Filippo Pinzari and Brian Pane
+
+All rights reserved.
diff --git a/nxcompshad/Misc.h b/nxproxy/Main.c
similarity index 52%
rename from nxcompshad/Misc.h
rename to nxproxy/Main.c
index 6dc8635..a5ce262 100644
--- a/nxcompshad/Misc.h
+++ b/nxproxy/Main.c
@@ -1,8 +1,8 @@
 /**************************************************************************/
 /*                                                                        */
-/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
+/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/.         */
 /*                                                                        */
-/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */
+/* NXPROXY, NX protocol compression and NX extensions to this software    */
 /* are copyright of NoMachine. Redistribution and use of the present      */
 /* software is allowed according to terms specified in the file LICENSE   */
 /* which comes in the source distribution.                                */
@@ -11,32 +11,59 @@
 /*                                                                        */
 /* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
 /*                                                                        */
-/* All rights reserved.                                                   */
+/* All rigths reserved.                                                   */
 /*                                                                        */
 /**************************************************************************/
 
-#ifndef Misc_H
-#define Misc_H
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
-#include <iostream>
+#include "NX.h"
 
-#include <errno.h>
-#include <string.h>
+#define PANIC
+#define WARNING
+#undef  TEST
+#undef  DEBUG
+
+/*
+ * Entry point when running nxproxy stand-alone.
+ */
+
+int main(int argc, const char **argv)
+{
+  int result = -1;
+
+  char *options = NULL;
+
+  options = getenv("NX_DISPLAY");
+
+  if (NXTransParseCommandLine(argc, argv) < 0)
+  {
+    NXTransCleanup();
+  }
+
+  if (NXTransParseEnvironment(options, 0) < 0)
+  {
+    NXTransCleanup();
+  }
 
-using namespace std;
+  /*
+   * This should not return...
+   */
 
-//
-// Error handling macros.
-//
+  #ifdef TEST
+  fprintf(stderr, "Main: Yielding control to NX entry point.\n");
+  #endif
 
-#define ESET(e)  (errno = (e))
-#define EGET()   (errno)
-#define ESTR()   strerror(errno)
+  result = NXTransProxy(NX_FD_ANY, NX_MODE_ANY, NX_DISPLAY_ANY);
 
-//
-// Log file.
-//
+  /*
+   * ...So these should not be called.
+   */
 
-extern ostream *logofs;
+  NXTransExit(result);
 
-#endif /* Misc_H */
+  return 0;
+}
diff --git a/nxproxy/Makefile.in b/nxproxy/Makefile.in
new file mode 100644
index 0000000..928e0d3
--- /dev/null
+++ b/nxproxy/Makefile.in
@@ -0,0 +1,101 @@
+#
+# Get values from configure script.
+#
+VERSION=@VERSION@
+LIBVERSION=@LIBVERSION@
+
+#
+# Enable really all warnings. This, though, gives
+# a warning due to pthread.h and unistd.h.
+#
+# -Wredundant-decls
+#
+CXX      = @CXX@
+CXXFLAGS = @CXXFLAGS@ @X_CFLAGS@ @DEFS@ \
+           -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+           -Wmissing-declarations -Wnested-externs
+
+CXXINCLUDES = -I. -I../nxcomp
+
+CC         = @CC@
+CCFLAGS    = $(CXXFLAGS)
+CCINCLUDES = -I. -I../nxcomp
+CCDEFINES  =
+
+LDFLAGS = @LDFLAGS@
+LIBS    = @LIBS@
+
+#
+# Only if THREADS is defined.
+#
+# LIBS = $(LIBS) -lpthread
+#
+
+srcdir      = @srcdir@
+prefix      = @prefix@
+exec_prefix = @exec_prefix@
+bindir      = @bindir@
+man1dir     = @mandir@/man1
+VPATH       = @srcdir@
+
+INSTALL         = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA    = @INSTALL_DATA@
+
+#
+# This should be autodetected.
+#
+
+MAKEDEPEND     = @MAKEDEPEND@
+DEPENDINCLUDES = -I/usr/include/g++ -I/usr/include/g++-3 
+
+.SUFFIXES: .cpp.c
+
+.cpp.o:
+	$(CXX) -c $(CXXFLAGS) $(CXXINCLUDES) $(CXXDEFINES) $<
+.c.o:
+	$(CC) -c $(CCFLAGS) $(CCINCLUDES) $(CCDEFINES) $<
+
+PROGRAM = nxproxy
+
+all: depend $(PROGRAM)
+
+MSRC   = Main.c
+
+CSRC   =
+
+CXXSRC =
+
+MOBJ   = $(MSRC:.c=.o)
+COBJ   = $(CSRC:.c=.o)
+CXXOBJ = $(CXXSRC:.cpp=.o)
+
+$(PROGRAM):	$(MOBJ) $(COBJ) $(CXXOBJ)
+		$(CXX) $(CXXFLAGS) -o $@ $(MOBJ) $(LDFLAGS) $(LIBS)
+
+depends:	depend.status
+
+depend:		depend.status
+
+depend.status:	
+		if [ -x $(MAKEDEPEND) ] ; then \
+			$(MAKEDEPEND) $(CXXINCLUDES) $(CCINCLUDES) \
+                        $(DEPENDINCLUDES) -f Makefile $(MSRC) $(CSRC) $(CXXSRC) 2>/dev/null; \
+		fi
+		touch depend.status
+
+install:	install.bin install.man
+
+install.bin:	$(PROGRAM)
+		$(srcdir)/mkinstalldirs $(bindir)
+		$(INSTALL) $(PROGRAM) $(bindir)/$(PROGRAM)
+
+install.man:
+		$(srcdir)/mkinstalldirs $(man1dir)
+
+clean:
+		-rm -f *~ *.o *.bak st?????? core core.* *.out.* \
+		$(PROGRAM) $(PROGRAM).exe $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE)
+
+distclean:	clean
+		-rm -f config.status config.log config.cache depend.status Makefile tags
diff --git a/nxproxy/README b/nxproxy/README
new file mode 100644
index 0000000..8f95d9f
--- /dev/null
+++ b/nxproxy/README
@@ -0,0 +1,14 @@
+README
+------
+
+1. To compile:
+
+   > tar zxvf nxproxy-X.Y.Z-N.tar.gz
+   > cd nxproxy
+   > ./configure
+   > make
+
+   You'll have to run gmake under Solaris.
+
+2. The 'make install' target is not currently supported
+   in the Makefile, but it should be simple to fix.
diff --git a/nxproxy/README-IPAQ b/nxproxy/README-IPAQ
new file mode 100644
index 0000000..7a8a8a9
--- /dev/null
+++ b/nxproxy/README-IPAQ
@@ -0,0 +1,27 @@
+README-IPAQ
+-----------
+
+1. Install a cross-compiler for ARM. You can find detailed
+   informations at:
+
+   http://www.ailis.de/~k/knowledge/crosscompiling/toolchain.php
+
+   There are also binaries needed to install the cross-compiler.
+
+2. Configure and compile nxproxy using:
+
+   $ ./configure --with-ipaq
+   $ make
+
+   After compilation type:
+
+   $ arm-linux-strip nxproxy
+
+3. You need libXcomp.so to run nxproxy. Be sure you include the
+   library in your LD_LIBRARY_PATH. For example, you can run:
+
+   > export LD_LIBRARY_PATH $HOME/NX/nxcomp
+   > nxproxy -S localhost:8
+
+4. The package nxscripts contains many examples of NX usage that
+   you can modify to suit your needs.
diff --git a/nxproxy/README-VALGRIND b/nxproxy/README-VALGRIND
new file mode 100644
index 0000000..ce4d513
--- /dev/null
+++ b/nxproxy/README-VALGRIND
@@ -0,0 +1,39 @@
+README-VALGRIND
+---------------
+
+You can run nxproxy (and nxcomp) under the supervision of valgrind
+(a very good memory debugger) by wrapping nxproxy in the following
+script:
+
+<snip>
+#!/bin/bash
+
+# Enable core dumps.
+
+ulimit -c unlimited
+
+# Set this to directory where nxproxy is located.
+
+NXPROXY_DIR=~/NX/nxproxy
+
+# Set this to directory where valgrind is located.
+
+VALGRIND_DIR=/usr/local/bin
+
+exec ${VALGRIND_DIR}/valgrind -v --leak-check=yes --leak-resolution=high \
+                              --show-reachable=yes --show-reachable=yes \
+                              --suppressions=${NXPROXY_DIR}/nxproxy.supp \
+                              --num-callers=16 --logfile-fd=2 \
+\
+${NXPROXY_DIR}/nxproxy $1 $2 $3 $4 $5 $6 $7 $8 $9
+<snip>
+
+Run the following commands on your shell, right in the place where
+the nxproxy executable is to be placed in your setup:
+
+$ cat >nxproxy
+<copy paste the previous lines here>
+$ chmod a+x nxproxy
+
+Output of valgrind will go on stderr, that is in session file, if
+run in NX environment.
diff --git a/nxproxy/VERSION b/nxproxy/VERSION
new file mode 100644
index 0000000..4a36342
--- /dev/null
+++ b/nxproxy/VERSION
@@ -0,0 +1 @@
+3.0.0
diff --git a/nxcompshad/configure b/nxproxy/autom4te.cache/output.0
old mode 100755
new mode 100644
similarity index 96%
copy from nxcompshad/configure
copy to nxproxy/autom4te.cache/output.0
index d5b4228..133967c
--- a/nxcompshad/configure
+++ b/nxproxy/autom4te.cache/output.0
@@ -1,10 +1,10 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59.
-#
-# Copyright (C) 2003 Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
+@%:@! /bin/sh
+@%:@ Guess values for system-dependent variables and create Makefiles.
+@%:@ Generated by GNU Autoconf 2.59.
+@%:@ 
+@%:@ Copyright (C) 2003 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.  ##
 ## --------------------- ##
@@ -271,8 +271,8 @@ PACKAGE_VERSION=
 PACKAGE_STRING=
 PACKAGE_BUGREPORT=
 
-ac_unique_file="Shadow.h"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS armcxx armcc CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CXXCPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LIBVERSION VERSION MAKEDEPEND LIBOBJS LTLIBOBJS'
+ac_unique_file="Main.c"
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS armcxx armcc CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CXXCPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LIBVERSION VERSION MAKEDEPEND LIB@&t at OBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -946,9 +946,9 @@ generated by GNU Autoconf 2.59.  Invocation command line was
 _ACEOF
 {
 cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
+@%:@@%:@ --------- @%:@@%:@
+@%:@@%:@ Platform. @%:@@%:@
+@%:@@%:@ --------- @%:@@%:@
 
 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
 uname -m = `(uname -m) 2>/dev/null || echo unknown`
@@ -982,9 +982,9 @@ done
 cat >&5 <<_ACEOF
 
 
-## ----------- ##
-## Core tests. ##
-## ----------- ##
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ Core tests. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
 
 _ACEOF
 
@@ -1051,9 +1051,9 @@ trap 'exit_status=$?
     echo
 
     cat <<\_ASBOX
-## ---------------- ##
-## Cache variables. ##
-## ---------------- ##
+@%:@@%:@ ---------------- @%:@@%:@
+@%:@@%:@ Cache variables. @%:@@%:@
+@%:@@%:@ ---------------- @%:@@%:@
 _ASBOX
     echo
     # The following way of writing the cache mishandles newlines in values,
@@ -1074,9 +1074,9 @@ _ASBOX
     echo
 
     cat <<\_ASBOX
-## ----------------- ##
-## Output variables. ##
-## ----------------- ##
+@%:@@%:@ ----------------- @%:@@%:@
+@%:@@%:@ Output variables. @%:@@%:@
+@%:@@%:@ ----------------- @%:@@%:@
 _ASBOX
     echo
     for ac_var in $ac_subst_vars
@@ -1088,9 +1088,9 @@ _ASBOX
 
     if test -n "$ac_subst_files"; then
       cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+@%:@@%:@ ------------- @%:@@%:@
+@%:@@%:@ Output files. @%:@@%:@
+@%:@@%:@ ------------- @%:@@%:@
 _ASBOX
       echo
       for ac_var in $ac_subst_files
@@ -1103,9 +1103,9 @@ _ASBOX
 
     if test -s confdefs.h; then
       cat <<\_ASBOX
-## ----------- ##
-## confdefs.h. ##
-## ----------- ##
+@%:@@%:@ ----------- @%:@@%:@
+@%:@@%:@ confdefs.h. @%:@@%:@
+@%:@@%:@ ----------- @%:@@%:@
 _ASBOX
       echo
       sed "/^$/d" confdefs.h | sort
@@ -1132,27 +1132,27 @@ echo >confdefs.h
 # Predefined preprocessor variables.
 
 cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
+@%:@define PACKAGE_NAME "$PACKAGE_NAME"
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
+@%:@define PACKAGE_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
+@%:@define PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 _ACEOF
 
 
@@ -1273,10 +1273,6 @@ CXXFLAGS="-O3"
 CPPFLAGS="-O3"
 
 
-LIBSTATIC=""
-LIBSHARED=""
-
-
 if test -d "../nx-X11/exports/include" ; then
     CXXFLAGS="$CXXFLAGS -I../nx-X11/exports/include"
     LIBS="$LIBS -L../nx-X11/exports/lib"
@@ -1284,7 +1280,7 @@ fi
 
 
 if test "${with_ipaq}" = yes; then
-  echo -e "enabling IPAQ configuration"
+  echo -e "enabling ipaq configuration"
   CXX="arm-linux-c++"
   CC="arm-linux-gcc"
   unset ac_cv_prog_armcxx
@@ -1374,7 +1370,7 @@ else
   unset ac_cv_prog_CXX
   unset ac_cv_prog_CC
   unset ac_cv_prog_CXXCPP
-fi
+fi  
 
 
 ac_ext=cc
@@ -1836,7 +1832,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_declaration
-#include <stdlib.h>
+@%:@include <stdlib.h>
 int
 main ()
 {
@@ -2132,7 +2128,7 @@ 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
+  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.
@@ -2496,7 +2492,7 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
-rm -f conftest.err conftest.$ac_objext
+rm -f conftest.err conftest.$ac_objext 
 done
 rm -f conftest.$ac_ext conftest.$ac_objext
 CC=$ac_save_CC
@@ -2518,9 +2514,9 @@ esac
 # for both compiling C and C++ we need to have the C++ compiler decide
 # the declaration of exit, since it's the most demanding environment.
 cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
+@%:@ifndef __cplusplus
   choke me
-#endif
+@%:@endif
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -2559,7 +2555,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_declaration
-#include <stdlib.h>
+@%:@include <stdlib.h>
 int
 main ()
 {
@@ -2670,41 +2666,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 
-echo "$as_me:$LINENO: checking whether compiler needs -Wno-deprecated" >&5
-echo $ECHO_N "checking whether compiler needs -Wno-deprecated... $ECHO_C" >&6
-gcc_version=`${CC} --version | grep 'gcc (GCC) [3-4].' | head -n 1`
-case "${gcc_version}" in
-     gcc*)
-        echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-        CXXFLAGS="$CXXFLAGS -Wno-deprecated"
-        CPPFLAGS="$CPPFLAGS -Wno-deprecated"
-        ;;
-
-     *)
-        echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-        ;;
-esac
-
-echo "$as_me:$LINENO: checking whether compiler accepts -Wmissing-declarations and -Wnested-externs" >&5
-echo $ECHO_N "checking whether compiler accepts -Wmissing-declarations and -Wnested-externs... $ECHO_C" >&6
-gcc_version=`${CC} --version | grep 'gcc (GCC) [3-4].' | head -n 1`
-case "${gcc_version}" in
-     gcc*)
-        echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-        ;;
-
-     *)
-        echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-        CXXFLAGS="$CXXFLAGS -Wmissing-declarations -Wnested-externs"
-        CPPFLAGS="$CPPFLAGS -Wmissing-declarations -Wnested-externs"
-        ;;
-esac
-
-
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
@@ -2841,11 +2802,11 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
 		     Syntax error
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
@@ -2884,7 +2845,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <ac_nonexistent.h>
+@%:@include <ac_nonexistent.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -2925,7 +2886,7 @@ fi
 
     done
     ac_cv_prog_CXXCPP=$CXXCPP
-
+  
 fi
   CXXCPP=$ac_cv_prog_CXXCPP
 else
@@ -2948,11 +2909,11 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+@%:@ifdef __STDC__
+@%:@ include <limits.h>
+@%:@else
+@%:@ include <assert.h>
+@%:@endif
 		     Syntax error
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
@@ -2991,7 +2952,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <ac_nonexistent.h>
+@%:@include <ac_nonexistent.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -3050,8 +3011,8 @@ echo $ECHO_N "checking for X... $ECHO_C" >&6
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
   withval="$with_x"
-
-fi;
+  
+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.
@@ -3146,7 +3107,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <X11/Intrinsic.h>
+@%:@include <X11/Intrinsic.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -3194,7 +3155,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <X11/Intrinsic.h>
+@%:@include <X11/Intrinsic.h>
 int
 main ()
 {
@@ -3279,9 +3240,9 @@ fi
 
 if test "$no_x" = yes; then
   # Not all programs may use this symbol, but it does not hurt to define it.
-
+  
 cat >>confdefs.h <<\_ACEOF
-#define X_DISPLAY_MISSING 1
+@%:@define X_DISPLAY_MISSING 1
 _ACEOF
 
   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
@@ -4437,16 +4398,14 @@ ac_help="$ac_help
   --with-symbols          give -g flag to compiler to produce debug symbols
   --with-info             define INFO at compile time to get basic log output
   --with-valgrind         clean up allocated buffers to avoid valgrind warnings
-  --with-version          use this version for produced libraries
+  --with-version          use this version for produced libraries"
 
-  --with-static-jpeg      enable static linking of JPEG library
-  --with-static-z         enable static linking of Z library"
 
 
 
-echo "$as_me:$LINENO: checking for Cygwin32 environment" >&5
-echo $ECHO_N "checking for Cygwin32 environment... $ECHO_C" >&6
-if test "${nxconf_cv_cygwin32+set}" = set; then
+echo "$as_me:$LINENO: checking for FreeBSD environment" >&5
+echo $ECHO_N "checking for FreeBSD environment... $ECHO_C" >&6
+if test "${nxconf_cv_freebsd+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4459,7 +4418,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return __CYGWIN32__;
+return __FreeBSD__;
   ;
   return 0;
 }
@@ -4486,31 +4445,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  nxconf_cv_cygwin32=yes
+  nxconf_cv_freebsd=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-nxconf_cv_cygwin32=no
+nxconf_cv_freebsd=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $nxconf_cv_cygwin32" >&5
-echo "${ECHO_T}$nxconf_cv_cygwin32" >&6
-CYGWIN32=
-test "$nxconf_cv_cygwin32" = yes && CYGWIN32=yes
-
-
-if test "$CYGWIN32" = yes; then
-    LIBS="$LIBS -lstdc++ -lcygipc -lgdi32"
-fi
+echo "$as_me:$LINENO: result: $nxconf_cv_freebsd" >&5
+echo "${ECHO_T}$nxconf_cv_freebsd" >&6
+FreeBSD=
+test "$nxconf_cv_freebsd" = yes && FreeBSD=yes
 
 
 
-echo "$as_me:$LINENO: checking for Darwin environment" >&5
-echo $ECHO_N "checking for Darwin environment... $ECHO_C" >&6
-if test "${nxconf_cv_darwin+set}" = set; then
+echo "$as_me:$LINENO: checking for Cygwin32 environment" >&5
+echo $ECHO_N "checking for Cygwin32 environment... $ECHO_C" >&6
+if test "${nxconf_cv_cygwin32+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4523,7 +4477,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return __APPLE__;
+return __CYGWIN32__;
   ;
   return 0;
 }
@@ -4550,26 +4504,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  nxconf_cv_darwin=yes
+  nxconf_cv_cygwin32=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-nxconf_cv_darwin=no
+nxconf_cv_cygwin32=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $nxconf_cv_darwin" >&5
-echo "${ECHO_T}$nxconf_cv_darwin" >&6
-DARWIN=
-test "$nxconf_cv_darwin" = yes && DARWIN=yes
+echo "$as_me:$LINENO: result: $nxconf_cv_cygwin32" >&5
+echo "${ECHO_T}$nxconf_cv_cygwin32" >&6
+CYGWIN32=
+test "$nxconf_cv_cygwin32" = yes && CYGWIN32=yes
 
 
 
-echo "$as_me:$LINENO: checking for Solaris environment" >&5
-echo $ECHO_N "checking for Solaris environment... $ECHO_C" >&6
-if test "${nxconf_cv_sun+set}" = set; then
+echo "$as_me:$LINENO: checking for Darwin environment" >&5
+echo $ECHO_N "checking for Darwin environment... $ECHO_C" >&6
+if test "${nxconf_cv_darwin+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4582,7 +4536,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return __sun;
+return __APPLE__;
   ;
   return 0;
 }
@@ -4609,26 +4563,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  nxconf_cv_sun=yes
+  nxconf_cv_darwin=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-nxconf_cv_sun=no
+nxconf_cv_darwin=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $nxconf_cv_sun" >&5
-echo "${ECHO_T}$nxconf_cv_sun" >&6
-SUN=
-test "$nxconf_cv_sun" = yes && SUN=yes
+echo "$as_me:$LINENO: result: $nxconf_cv_darwin" >&5
+echo "${ECHO_T}$nxconf_cv_darwin" >&6
+DARWIN=
+test "$nxconf_cv_darwin" = yes && DARWIN=yes
 
 
 
-echo "$as_me:$LINENO: checking for FreeBSD environment" >&5
-echo $ECHO_N "checking for FreeBSD environment... $ECHO_C" >&6
-if test "${nxconf_cv_freebsd+set}" = set; then
+echo "$as_me:$LINENO: checking for SunOS environment" >&5
+echo $ECHO_N "checking for SunOS environment... $ECHO_C" >&6
+if test "${nxconf_cv_sun+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4641,93 +4595,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return __FreeBSD__;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  nxconf_cv_freebsd=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-nxconf_cv_freebsd=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-rm -f conftest*
-fi
-echo "$as_me:$LINENO: result: $nxconf_cv_freebsd" >&5
-echo "${ECHO_T}$nxconf_cv_freebsd" >&6
-FreeBSD=
-test "$nxconf_cv_freebsd" = yes && FreeBSD=yes
-
-
-if test "$CYGWIN32" != yes -a "$DARWIN" != yes; then
-  CXXFLAGS="$CXXFLAGS -fPIC"
-  CFLAGS="$CFLAGS -fPIC"
-fi
-
-
-if test "$SUN" = yes; then
-  LIBS="$LIBS  -L/usr/sfw/lib -lsocket "
-  CXXFLAGS="$CXXFLAGS -I/usr/sfw/include"
-fi
-
-
-if test "$FreeBSD" = yes; then
-  LIBS="$LIBS  -L/usr/local/lib"
-  CXXFLAGS="$CXXFLAGS -I/usr/local/include"
-fi
-
-
-if test "$DARWIN" = yes; then
-  LDFLAGS="$LDFLAGS -bundle"
-elif test "$SUN" = yes; then
-  LDFLAGS="$LDFLAGS -G -h \$(LIBLOAD)"
-else
-  LDFLAGS="$LDFLAGS -Wl,-soname,\$(LIBLOAD)"
-fi
-
-
-
-echo "$as_me:$LINENO: checking for in_addr_t" >&5
-echo $ECHO_N "checking for in_addr_t... $ECHO_C" >&6
-if test "${nxconf_cv_inaddrt+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <netinet/in.h>
-int
-main ()
-{
-in_addr_t t; t = 1; return t;
+return __sun;
   ;
   return 0;
 }
@@ -4754,30 +4622,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  nxconf_cv_inaddrt=yes
+  nxconf_cv_sun=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-nxconf_cv_inaddrt=no
+nxconf_cv_sun=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $nxconf_cv_inaddrt" >&5
-echo "${ECHO_T}$nxconf_cv_inaddrt" >&6
-INADDRT=
-test "$nxconf_cv_inaddrt" = yes && INADDRT=yes
-
-
-if test "$INADDRT" != yes ; then
-  echo -e "using unsigned int for type in_addr_t"
-  CXXFLAGS="$CXXFLAGS -DIN_ADDR_T=unsigned"
-  CPPFLAGS="$CPPFLAGS -DIN_ADDR_T=unsigned"
-else
-  CXXFLAGS="$CXXFLAGS -DIN_ADDR_T=in_addr_t"
-  CPPFLAGS="$CPPFLAGS -DIN_ADDR_T=in_addr_t"
-fi
+echo "$as_me:$LINENO: result: $nxconf_cv_sun" >&5
+echo "${ECHO_T}$nxconf_cv_sun" >&6
+SUN=
+test "$nxconf_cv_sun" = yes && SUN=yes
 
 
 
@@ -4795,15 +4653,6 @@ CXXFLAGS="$CXXFLAGS -DVERSION=\\\"${VERSION}\\\""
 CPPFLAGS="$CPPFLAGS -DVERSION=\\\"${VERSION}\\\""
 
 
-if test "$DARWIN" = yes ; then
-  LIBS="$LIBS $LIBSTATIC $LIBSHARED"
-elif test "$SUN" = yes ; then
-  LIBS="$LIBS $LIBSTATIC $LIBSHARED"
-else
-  LIBS="$LIBS $LIBSTATIC -shared $LIBSHARED"
-fi
-
-
 if test "${with_symbols}" = yes; then
   echo -e "enabling production of debug symbols"
   CXXFLAGS="-g $CXXFLAGS"
@@ -4831,6 +4680,13 @@ else
 fi
 
 
+if test "$CYGWIN32" = yes; then
+    LIBS="$LIBS -L../nxcomp -lXcomp -lstdc++ -Wl,-e,_mainCRTStartup -ljpeg -lpng -lz"
+else
+    LIBS="$LIBS -L../nxcomp -lXcomp"
+fi
+
+
 
 
 if test -x "../nx-X11/config/makedepend/makedepend" ; then
@@ -4957,7 +4813,7 @@ rm -f confdef2opt.sed
 
 ac_libobjs=
 ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+for ac_i in : $LIB@&t at OBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_i=`echo "$ac_i" |
 	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
@@ -4965,7 +4821,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
   ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
 done
-LIBOBJS=$ac_libobjs
+LIB@&t at OBJS=$ac_libobjs
 
 LTLIBOBJS=$ac_ltlibobjs
 
@@ -5235,8 +5091,8 @@ exec 6>&1
 exec 5>>config.log
 {
   echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
+  sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX
+@%:@@%:@ Running $as_me. @%:@@%:@
 _ASBOX
 } >&5
 cat >&5 <<_CSEOF
@@ -5506,7 +5362,7 @@ s, at X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
 s, at LIBVERSION@,$LIBVERSION,;t t
 s, at VERSION@,$VERSION,;t t
 s, at MAKEDEPEND@,$MAKEDEPEND,;t t
-s, at LIBOBJS@,$LIBOBJS,;t t
+s, at LIB@&t at OBJS@,$LIB@&t at OBJS,;t t
 s, at LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
 
diff --git a/nxproxy/autom4te.cache/requests b/nxproxy/autom4te.cache/requests
new file mode 100644
index 0000000..6e49674
--- /dev/null
+++ b/nxproxy/autom4te.cache/requests
@@ -0,0 +1,115 @@
+# This file was generated.
+# It contains the lists of macros which have been traced.
+# It can be safely removed.
+
+ at request = (
+             bless( [
+                      '0',
+                      1,
+                      [
+                        '/usr/share/autoconf'
+                      ],
+                      [
+                        '/usr/share/autoconf/autoconf/autoconf.m4f',
+                        'configure.in'
+                      ],
+                      {
+                        'm4_pattern_forbid' => 1,
+                        'AC_CONFIG_LIBOBJ_DIR' => 1,
+                        'AC_TYPE_OFF_T' => 1,
+                        'AC_C_VOLATILE' => 1,
+                        'AC_FUNC_CLOSEDIR_VOID' => 1,
+                        'AC_REPLACE_FNMATCH' => 1,
+                        'AC_PROG_LIBTOOL' => 1,
+                        'AC_FUNC_STAT' => 1,
+                        'AC_HEADER_TIME' => 1,
+                        'AC_FUNC_WAIT3' => 1,
+                        'AM_AUTOMAKE_VERSION' => 1,
+                        'AC_STRUCT_TM' => 1,
+                        'AC_FUNC_LSTAT' => 1,
+                        'AC_TYPE_MODE_T' => 1,
+                        'AC_FUNC_GETMNTENT' => 1,
+                        'AC_FUNC_STRTOD' => 1,
+                        'AC_CHECK_HEADERS' => 1,
+                        'AC_FUNC_STRNLEN' => 1,
+                        'm4_sinclude' => 1,
+                        'AC_PROG_CXX' => 1,
+                        'AC_PATH_X' => 1,
+                        'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1,
+                        'AC_PROG_AWK' => 1,
+                        '_m4_warn' => 1,
+                        'AC_HEADER_STDC' => 1,
+                        'AC_HEADER_MAJOR' => 1,
+                        'AC_FUNC_ERROR_AT_LINE' => 1,
+                        'AC_PROG_GCC_TRADITIONAL' => 1,
+                        'AC_LIBSOURCE' => 1,
+                        'AC_FUNC_MBRTOWC' => 1,
+                        'AC_STRUCT_ST_BLOCKS' => 1,
+                        'AC_TYPE_SIGNAL' => 1,
+                        'AC_TYPE_UID_T' => 1,
+                        'AC_CONFIG_AUX_DIR' => 1,
+                        'AC_PROG_MAKE_SET' => 1,
+                        'sinclude' => 1,
+                        'm4_pattern_allow' => 1,
+                        'AC_DEFINE_TRACE_LITERAL' => 1,
+                        'AC_FUNC_STRERROR_R' => 1,
+                        'AC_PROG_CC' => 1,
+                        'AC_FUNC_FORK' => 1,
+                        'AC_DECL_SYS_SIGLIST' => 1,
+                        'AC_FUNC_VPRINTF' => 1,
+                        'AC_FUNC_STRCOLL' => 1,
+                        'AC_PROG_YACC' => 1,
+                        'AC_INIT' => 1,
+                        'AC_STRUCT_TIMEZONE' => 1,
+                        'AC_FUNC_CHOWN' => 1,
+                        'AC_SUBST' => 1,
+                        'AC_FUNC_ALLOCA' => 1,
+                        'AC_CANONICAL_HOST' => 1,
+                        'AC_FUNC_GETPGRP' => 1,
+                        'AC_PROG_RANLIB' => 1,
+                        'AM_INIT_AUTOMAKE' => 1,
+                        'AC_FUNC_SETPGRP' => 1,
+                        'AC_CONFIG_SUBDIRS' => 1,
+                        'AC_FUNC_MMAP' => 1,
+                        'AC_FUNC_REALLOC' => 1,
+                        'AC_TYPE_SIZE_T' => 1,
+                        'AC_CONFIG_LINKS' => 1,
+                        'AC_CHECK_TYPES' => 1,
+                        'AC_CHECK_MEMBERS' => 1,
+                        'AM_MAINTAINER_MODE' => 1,
+                        'AC_FUNC_UTIME_NULL' => 1,
+                        'AC_FUNC_SELECT_ARGTYPES' => 1,
+                        'AC_FUNC_STRFTIME' => 1,
+                        'AC_HEADER_STAT' => 1,
+                        'AC_C_INLINE' => 1,
+                        'AC_PROG_CPP' => 1,
+                        'AC_TYPE_PID_T' => 1,
+                        'AC_C_CONST' => 1,
+                        'AC_PROG_LEX' => 1,
+                        'AC_CONFIG_FILES' => 1,
+                        'include' => 1,
+                        'AC_FUNC_SETVBUF_REVERSED' => 1,
+                        'AC_PROG_INSTALL' => 1,
+                        'AM_GNU_GETTEXT' => 1,
+                        'AC_FUNC_OBSTACK' => 1,
+                        'AC_CHECK_LIB' => 1,
+                        'AC_FUNC_MALLOC' => 1,
+                        'AC_FUNC_GETGROUPS' => 1,
+                        'AC_FUNC_GETLOADAVG' => 1,
+                        'AH_OUTPUT' => 1,
+                        'AC_FUNC_FSEEKO' => 1,
+                        'AM_PROG_CC_C_O' => 1,
+                        'AM_CONDITIONAL' => 1,
+                        'AC_CANONICAL_SYSTEM' => 1,
+                        'AC_FUNC_MKTIME' => 1,
+                        'AC_CONFIG_HEADERS' => 1,
+                        'AC_HEADER_SYS_WAIT' => 1,
+                        'AC_FUNC_MEMCMP' => 1,
+                        'AC_PROG_LN_S' => 1,
+                        'm4_include' => 1,
+                        'AC_HEADER_DIRENT' => 1,
+                        'AC_CHECK_FUNCS' => 1
+                      }
+                    ], 'Autom4te::Request' )
+           );
+
diff --git a/nxproxy/autom4te.cache/traces.0 b/nxproxy/autom4te.cache/traces.0
new file mode 100644
index 0000000..282fc56
--- /dev/null
+++ b/nxproxy/autom4te.cache/traces.0
@@ -0,0 +1,134 @@
+m4trace:configure.in:5: -1- AC_INIT([Main.c])
+m4trace:configure.in:5: -1- m4_pattern_forbid([^_?A[CHUM]_])
+m4trace:configure.in:5: -1- m4_pattern_forbid([_AC_])
+m4trace:configure.in:5: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
+m4trace:configure.in:5: -1- m4_pattern_allow([^AS_FLAGS$])
+m4trace:configure.in:5: -1- m4_pattern_forbid([^_?m4_])
+m4trace:configure.in:5: -1- m4_pattern_forbid([^dnl$])
+m4trace:configure.in:5: -1- m4_pattern_forbid([^_?AS_])
+m4trace:configure.in:5: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])
+m4trace:configure.in:5: -1- AC_SUBST([PATH_SEPARATOR])
+m4trace:configure.in:5: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME],      ['AC_PACKAGE_NAME'])])
+m4trace:configure.in:5: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME],   ['AC_PACKAGE_TARNAME'])])
+m4trace:configure.in:5: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION],   ['AC_PACKAGE_VERSION'])])
+m4trace:configure.in:5: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING],    ['AC_PACKAGE_STRING'])])
+m4trace:configure.in:5: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
+m4trace:configure.in:5: -1- AC_SUBST([exec_prefix], [NONE])
+m4trace:configure.in:5: -1- AC_SUBST([prefix], [NONE])
+m4trace:configure.in:5: -1- AC_SUBST([program_transform_name], [s,x,x,])
+m4trace:configure.in:5: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
+m4trace:configure.in:5: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
+m4trace:configure.in:5: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
+m4trace:configure.in:5: -1- AC_SUBST([datadir], ['${prefix}/share'])
+m4trace:configure.in:5: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
+m4trace:configure.in:5: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
+m4trace:configure.in:5: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
+m4trace:configure.in:5: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
+m4trace:configure.in:5: -1- AC_SUBST([includedir], ['${prefix}/include'])
+m4trace:configure.in:5: -1- AC_SUBST([oldincludedir], ['/usr/include'])
+m4trace:configure.in:5: -1- AC_SUBST([infodir], ['${prefix}/info'])
+m4trace:configure.in:5: -1- AC_SUBST([mandir], ['${prefix}/man'])
+m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
+m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
+#undef PACKAGE_NAME])
+m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
+m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME])
+m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
+m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
+#undef PACKAGE_VERSION])
+m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
+m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING])
+m4trace:configure.in:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
+m4trace:configure.in:5: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT])
+m4trace:configure.in:5: -1- AC_SUBST([build_alias])
+m4trace:configure.in:5: -1- AC_SUBST([host_alias])
+m4trace:configure.in:5: -1- AC_SUBST([target_alias])
+m4trace:configure.in:5: -1- AC_SUBST([DEFS])
+m4trace:configure.in:5: -1- AC_SUBST([ECHO_C])
+m4trace:configure.in:5: -1- AC_SUBST([ECHO_N])
+m4trace:configure.in:5: -1- AC_SUBST([ECHO_T])
+m4trace:configure.in:5: -1- AC_SUBST([LIBS])
+m4trace:configure.in:29: -1- AC_SUBST([armcxx])
+m4trace:configure.in:30: -1- AC_SUBST([armcc])
+m4trace:configure.in:45: -1- AC_PROG_CXX
+m4trace:configure.in:45: -1- AC_SUBST([CXX])
+m4trace:configure.in:45: -1- AC_SUBST([CXXFLAGS])
+m4trace:configure.in:45: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:45: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:45: -1- AC_SUBST([CXX])
+m4trace:configure.in:45: -1- AC_SUBST([ac_ct_CXX])
+m4trace:configure.in:45: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
+m4trace:configure.in:45: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
+m4trace:configure.in:46: -1- AC_PROG_CC
+m4trace:configure.in:46: -1- AC_SUBST([CC])
+m4trace:configure.in:46: -1- AC_SUBST([CFLAGS])
+m4trace:configure.in:46: -1- AC_SUBST([LDFLAGS])
+m4trace:configure.in:46: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:46: -1- AC_SUBST([CC])
+m4trace:configure.in:46: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:46: -1- AC_SUBST([CC])
+m4trace:configure.in:46: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:46: -1- AC_SUBST([CC])
+m4trace:configure.in:46: -1- AC_SUBST([CC])
+m4trace:configure.in:46: -1- AC_SUBST([ac_ct_CC])
+m4trace:configure.in:47: -1- _m4_warn([obsolete], [The macro `AC_LANG_CPLUSPLUS' is obsolete.
+You should run autoupdate.], [autoconf/c.m4:103: AC_LANG_CPLUSPLUS is expanded from...
+configure.in:47: the top level])
+m4trace:configure.in:51: -1- AC_PROG_INSTALL
+m4trace:configure.in:51: -1- AC_SUBST([INSTALL_PROGRAM])
+m4trace:configure.in:51: -1- AC_SUBST([INSTALL_SCRIPT])
+m4trace:configure.in:51: -1- AC_SUBST([INSTALL_DATA])
+m4trace:configure.in:55: -1- AC_PATH_X
+m4trace:configure.in:55: -1- AC_SUBST([CXXCPP])
+m4trace:configure.in:55: -1- AC_SUBST([CPPFLAGS])
+m4trace:configure.in:55: -1- AC_SUBST([CXXCPP])
+m4trace:configure.in:55: -1- AC_DEFINE_TRACE_LITERAL([X_DISPLAY_MISSING])
+m4trace:configure.in:55: -1- AH_OUTPUT([X_DISPLAY_MISSING], [/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING])
+m4trace:configure.in:55: -1- AC_CHECK_LIB([dnet], [dnet_ntoa], [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+m4trace:configure.in:55: -1- AC_CHECK_LIB([dnet_stub], [dnet_ntoa], [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+m4trace:configure.in:55: -1- AC_CHECK_LIB([nsl], [gethostbyname], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"])
+m4trace:configure.in:55: -1- AC_CHECK_LIB([bsd], [gethostbyname], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"])
+m4trace:configure.in:55: -1- AC_CHECK_LIB([socket], [connect], [X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"], [], [$X_EXTRA_LIBS])
+m4trace:configure.in:55: -1- AC_CHECK_LIB([posix], [remove], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"])
+m4trace:configure.in:55: -1- AC_CHECK_LIB([ipc], [shmat], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"])
+m4trace:configure.in:55: -1- AC_CHECK_LIB([ICE], [IceConnectionNumber], [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"], [], [$X_EXTRA_LIBS])
+m4trace:configure.in:55: -1- AC_SUBST([X_CFLAGS])
+m4trace:configure.in:55: -1- AC_SUBST([X_PRE_LIBS])
+m4trace:configure.in:55: -1- AC_SUBST([X_LIBS])
+m4trace:configure.in:55: -1- AC_SUBST([X_EXTRA_LIBS])
+m4trace:configure.in:76: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2180: AC_TRY_COMPILE is expanded from...
+autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
+autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
+configure.in:75: nxconf_FreeBSD is expanded from...
+configure.in:76: the top level])
+m4trace:configure.in:86: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2180: AC_TRY_COMPILE is expanded from...
+autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
+autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
+configure.in:85: nxconf_CYGWIN32 is expanded from...
+configure.in:86: the top level])
+m4trace:configure.in:97: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2180: AC_TRY_COMPILE is expanded from...
+autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
+autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
+configure.in:96: nxconf_DARWIN is expanded from...
+configure.in:97: the top level])
+m4trace:configure.in:108: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
+You should run autoupdate.], [autoconf/general.m4:2180: AC_TRY_COMPILE is expanded from...
+autoconf/general.m4:1799: AC_CACHE_VAL is expanded from...
+autoconf/general.m4:1808: AC_CACHE_CHECK is expanded from...
+configure.in:107: nxconf_SUN is expanded from...
+configure.in:108: the top level])
+m4trace:configure.in:112: -1- AC_SUBST([LIBVERSION])
+m4trace:configure.in:113: -1- AC_SUBST([VERSION])
+m4trace:configure.in:169: -1- AC_SUBST([MAKEDEPEND])
+m4trace:configure.in:185: -1- AC_CONFIG_FILES([Makefile])
+m4trace:configure.in:185: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
+You should run autoupdate.], [])
+m4trace:configure.in:185: -1- AC_SUBST([LIB@&t at OBJS], [$ac_libobjs])
+m4trace:configure.in:185: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
diff --git a/nxcompshad/configure b/nxproxy/configure
similarity index 97%
rename from nxcompshad/configure
rename to nxproxy/configure
index d5b4228..9d9f08c 100755
--- a/nxcompshad/configure
+++ b/nxproxy/configure
@@ -271,7 +271,7 @@ PACKAGE_VERSION=
 PACKAGE_STRING=
 PACKAGE_BUGREPORT=
 
-ac_unique_file="Shadow.h"
+ac_unique_file="Main.c"
 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS armcxx armcc CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CXXCPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LIBVERSION VERSION MAKEDEPEND LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
@@ -1273,10 +1273,6 @@ CXXFLAGS="-O3"
 CPPFLAGS="-O3"
 
 
-LIBSTATIC=""
-LIBSHARED=""
-
-
 if test -d "../nx-X11/exports/include" ; then
     CXXFLAGS="$CXXFLAGS -I../nx-X11/exports/include"
     LIBS="$LIBS -L../nx-X11/exports/lib"
@@ -1284,7 +1280,7 @@ fi
 
 
 if test "${with_ipaq}" = yes; then
-  echo -e "enabling IPAQ configuration"
+  echo -e "enabling ipaq configuration"
   CXX="arm-linux-c++"
   CC="arm-linux-gcc"
   unset ac_cv_prog_armcxx
@@ -2670,41 +2666,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 
-echo "$as_me:$LINENO: checking whether compiler needs -Wno-deprecated" >&5
-echo $ECHO_N "checking whether compiler needs -Wno-deprecated... $ECHO_C" >&6
-gcc_version=`${CC} --version | grep 'gcc (GCC) [3-4].' | head -n 1`
-case "${gcc_version}" in
-     gcc*)
-        echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-        CXXFLAGS="$CXXFLAGS -Wno-deprecated"
-        CPPFLAGS="$CPPFLAGS -Wno-deprecated"
-        ;;
-
-     *)
-        echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-        ;;
-esac
-
-echo "$as_me:$LINENO: checking whether compiler accepts -Wmissing-declarations and -Wnested-externs" >&5
-echo $ECHO_N "checking whether compiler accepts -Wmissing-declarations and -Wnested-externs... $ECHO_C" >&6
-gcc_version=`${CC} --version | grep 'gcc (GCC) [3-4].' | head -n 1`
-case "${gcc_version}" in
-     gcc*)
-        echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-        ;;
-
-     *)
-        echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-        CXXFLAGS="$CXXFLAGS -Wmissing-declarations -Wnested-externs"
-        CPPFLAGS="$CPPFLAGS -Wmissing-declarations -Wnested-externs"
-        ;;
-esac
-
-
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
@@ -4437,16 +4398,14 @@ ac_help="$ac_help
   --with-symbols          give -g flag to compiler to produce debug symbols
   --with-info             define INFO at compile time to get basic log output
   --with-valgrind         clean up allocated buffers to avoid valgrind warnings
-  --with-version          use this version for produced libraries
+  --with-version          use this version for produced libraries"
 
-  --with-static-jpeg      enable static linking of JPEG library
-  --with-static-z         enable static linking of Z library"
 
 
 
-echo "$as_me:$LINENO: checking for Cygwin32 environment" >&5
-echo $ECHO_N "checking for Cygwin32 environment... $ECHO_C" >&6
-if test "${nxconf_cv_cygwin32+set}" = set; then
+echo "$as_me:$LINENO: checking for FreeBSD environment" >&5
+echo $ECHO_N "checking for FreeBSD environment... $ECHO_C" >&6
+if test "${nxconf_cv_freebsd+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4459,7 +4418,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return __CYGWIN32__;
+return __FreeBSD__;
   ;
   return 0;
 }
@@ -4486,31 +4445,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  nxconf_cv_cygwin32=yes
+  nxconf_cv_freebsd=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-nxconf_cv_cygwin32=no
+nxconf_cv_freebsd=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $nxconf_cv_cygwin32" >&5
-echo "${ECHO_T}$nxconf_cv_cygwin32" >&6
-CYGWIN32=
-test "$nxconf_cv_cygwin32" = yes && CYGWIN32=yes
-
-
-if test "$CYGWIN32" = yes; then
-    LIBS="$LIBS -lstdc++ -lcygipc -lgdi32"
-fi
+echo "$as_me:$LINENO: result: $nxconf_cv_freebsd" >&5
+echo "${ECHO_T}$nxconf_cv_freebsd" >&6
+FreeBSD=
+test "$nxconf_cv_freebsd" = yes && FreeBSD=yes
 
 
 
-echo "$as_me:$LINENO: checking for Darwin environment" >&5
-echo $ECHO_N "checking for Darwin environment... $ECHO_C" >&6
-if test "${nxconf_cv_darwin+set}" = set; then
+echo "$as_me:$LINENO: checking for Cygwin32 environment" >&5
+echo $ECHO_N "checking for Cygwin32 environment... $ECHO_C" >&6
+if test "${nxconf_cv_cygwin32+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4523,7 +4477,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return __APPLE__;
+return __CYGWIN32__;
   ;
   return 0;
 }
@@ -4550,26 +4504,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  nxconf_cv_darwin=yes
+  nxconf_cv_cygwin32=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-nxconf_cv_darwin=no
+nxconf_cv_cygwin32=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $nxconf_cv_darwin" >&5
-echo "${ECHO_T}$nxconf_cv_darwin" >&6
-DARWIN=
-test "$nxconf_cv_darwin" = yes && DARWIN=yes
+echo "$as_me:$LINENO: result: $nxconf_cv_cygwin32" >&5
+echo "${ECHO_T}$nxconf_cv_cygwin32" >&6
+CYGWIN32=
+test "$nxconf_cv_cygwin32" = yes && CYGWIN32=yes
 
 
 
-echo "$as_me:$LINENO: checking for Solaris environment" >&5
-echo $ECHO_N "checking for Solaris environment... $ECHO_C" >&6
-if test "${nxconf_cv_sun+set}" = set; then
+echo "$as_me:$LINENO: checking for Darwin environment" >&5
+echo $ECHO_N "checking for Darwin environment... $ECHO_C" >&6
+if test "${nxconf_cv_darwin+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4582,7 +4536,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return __sun;
+return __APPLE__;
   ;
   return 0;
 }
@@ -4609,26 +4563,26 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  nxconf_cv_sun=yes
+  nxconf_cv_darwin=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-nxconf_cv_sun=no
+nxconf_cv_darwin=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $nxconf_cv_sun" >&5
-echo "${ECHO_T}$nxconf_cv_sun" >&6
-SUN=
-test "$nxconf_cv_sun" = yes && SUN=yes
+echo "$as_me:$LINENO: result: $nxconf_cv_darwin" >&5
+echo "${ECHO_T}$nxconf_cv_darwin" >&6
+DARWIN=
+test "$nxconf_cv_darwin" = yes && DARWIN=yes
 
 
 
-echo "$as_me:$LINENO: checking for FreeBSD environment" >&5
-echo $ECHO_N "checking for FreeBSD environment... $ECHO_C" >&6
-if test "${nxconf_cv_freebsd+set}" = set; then
+echo "$as_me:$LINENO: checking for SunOS environment" >&5
+echo $ECHO_N "checking for SunOS environment... $ECHO_C" >&6
+if test "${nxconf_cv_sun+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -4641,93 +4595,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return __FreeBSD__;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  nxconf_cv_freebsd=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-nxconf_cv_freebsd=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-rm -f conftest*
-fi
-echo "$as_me:$LINENO: result: $nxconf_cv_freebsd" >&5
-echo "${ECHO_T}$nxconf_cv_freebsd" >&6
-FreeBSD=
-test "$nxconf_cv_freebsd" = yes && FreeBSD=yes
-
-
-if test "$CYGWIN32" != yes -a "$DARWIN" != yes; then
-  CXXFLAGS="$CXXFLAGS -fPIC"
-  CFLAGS="$CFLAGS -fPIC"
-fi
-
-
-if test "$SUN" = yes; then
-  LIBS="$LIBS  -L/usr/sfw/lib -lsocket "
-  CXXFLAGS="$CXXFLAGS -I/usr/sfw/include"
-fi
-
-
-if test "$FreeBSD" = yes; then
-  LIBS="$LIBS  -L/usr/local/lib"
-  CXXFLAGS="$CXXFLAGS -I/usr/local/include"
-fi
-
-
-if test "$DARWIN" = yes; then
-  LDFLAGS="$LDFLAGS -bundle"
-elif test "$SUN" = yes; then
-  LDFLAGS="$LDFLAGS -G -h \$(LIBLOAD)"
-else
-  LDFLAGS="$LDFLAGS -Wl,-soname,\$(LIBLOAD)"
-fi
-
-
-
-echo "$as_me:$LINENO: checking for in_addr_t" >&5
-echo $ECHO_N "checking for in_addr_t... $ECHO_C" >&6
-if test "${nxconf_cv_inaddrt+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <netinet/in.h>
-int
-main ()
-{
-in_addr_t t; t = 1; return t;
+return __sun;
   ;
   return 0;
 }
@@ -4754,30 +4622,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  nxconf_cv_inaddrt=yes
+  nxconf_cv_sun=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-nxconf_cv_inaddrt=no
+nxconf_cv_sun=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $nxconf_cv_inaddrt" >&5
-echo "${ECHO_T}$nxconf_cv_inaddrt" >&6
-INADDRT=
-test "$nxconf_cv_inaddrt" = yes && INADDRT=yes
-
-
-if test "$INADDRT" != yes ; then
-  echo -e "using unsigned int for type in_addr_t"
-  CXXFLAGS="$CXXFLAGS -DIN_ADDR_T=unsigned"
-  CPPFLAGS="$CPPFLAGS -DIN_ADDR_T=unsigned"
-else
-  CXXFLAGS="$CXXFLAGS -DIN_ADDR_T=in_addr_t"
-  CPPFLAGS="$CPPFLAGS -DIN_ADDR_T=in_addr_t"
-fi
+echo "$as_me:$LINENO: result: $nxconf_cv_sun" >&5
+echo "${ECHO_T}$nxconf_cv_sun" >&6
+SUN=
+test "$nxconf_cv_sun" = yes && SUN=yes
 
 
 
@@ -4795,15 +4653,6 @@ CXXFLAGS="$CXXFLAGS -DVERSION=\\\"${VERSION}\\\""
 CPPFLAGS="$CPPFLAGS -DVERSION=\\\"${VERSION}\\\""
 
 
-if test "$DARWIN" = yes ; then
-  LIBS="$LIBS $LIBSTATIC $LIBSHARED"
-elif test "$SUN" = yes ; then
-  LIBS="$LIBS $LIBSTATIC $LIBSHARED"
-else
-  LIBS="$LIBS $LIBSTATIC -shared $LIBSHARED"
-fi
-
-
 if test "${with_symbols}" = yes; then
   echo -e "enabling production of debug symbols"
   CXXFLAGS="-g $CXXFLAGS"
@@ -4831,6 +4680,13 @@ else
 fi
 
 
+if test "$CYGWIN32" = yes; then
+    LIBS="$LIBS -L../nxcomp -lXcomp -lstdc++ -Wl,-e,_mainCRTStartup -ljpeg -lpng -lz"
+else
+    LIBS="$LIBS -L../nxcomp -lXcomp"
+fi
+
+
 
 
 if test -x "../nx-X11/config/makedepend/makedepend" ; then
diff --git a/nxcompshad/configure.in b/nxproxy/configure.in
similarity index 57%
rename from nxcompshad/configure.in
rename to nxproxy/configure.in
index 3f16ee9..bd930f1 100644
--- a/nxcompshad/configure.in
+++ b/nxproxy/configure.in
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
 
 dnl Prolog
 
-AC_INIT(Shadow.h)
+AC_INIT(Main.c)
 AC_PREREQ(2.13)
 
 dnl Reset default compilation flags.
@@ -10,12 +10,7 @@ dnl Reset default compilation flags.
 CXXFLAGS="-O3"
 CPPFLAGS="-O3"
 
-dnl Reset default linking directives.
-
-LIBSTATIC=""
-LIBSHARED=""
-
-dnl Prefer headers and libraries from nx-X11, if present.
+dnl Prefer headers and libraries from nx-X11 if present.
 
 if test -d "../nx-X11/exports/include" ; then
     CXXFLAGS="$CXXFLAGS -I../nx-X11/exports/include"
@@ -25,7 +20,7 @@ fi
 dnl Check whether --with-ipaq was given.
 
 if test "${with_ipaq}" = yes; then
-  echo -e "enabling IPAQ configuration"
+  echo -e "enabling ipaq configuration"
   CXX="arm-linux-c++"
   CC="arm-linux-gcc"
   unset ac_cv_prog_armcxx
@@ -51,37 +46,6 @@ AC_PROG_CXX
 AC_PROG_CC
 AC_LANG_CPLUSPLUS
 
-dnl Check whether option -Wno-deprecated
-dnl is needed by GCC compiler.
-
-AC_MSG_CHECKING([whether compiler needs -Wno-deprecated])
-gcc_version=`${CC} --version | grep 'gcc (GCC) [[3-4]].' | head -n 1`
-case "${gcc_version}" in
-     gcc*)
-        AC_MSG_RESULT([yes])
-        CXXFLAGS="$CXXFLAGS -Wno-deprecated"
-        CPPFLAGS="$CPPFLAGS -Wno-deprecated"
-        ;;
-
-     *)
-        AC_MSG_RESULT([no])
-        ;;
-esac
-
-AC_MSG_CHECKING([whether compiler accepts -Wmissing-declarations and -Wnested-externs])
-gcc_version=`${CC} --version | grep 'gcc (GCC) [[3-4]].' | head -n 1`
-case "${gcc_version}" in
-     gcc*)
-        AC_MSG_RESULT([no])
-        ;;
-
-     *)
-        AC_MSG_RESULT([yes])
-        CXXFLAGS="$CXXFLAGS -Wmissing-declarations -Wnested-externs"
-        CPPFLAGS="$CPPFLAGS -Wmissing-declarations -Wnested-externs"
-        ;;
-esac
-
 dnl Check for BSD compatible install.
 
 AC_PROG_INSTALL
@@ -96,13 +60,22 @@ ac_help="$ac_help
   --with-symbols          give -g flag to compiler to produce debug symbols
   --with-info             define INFO at compile time to get basic log output
   --with-valgrind         clean up allocated buffers to avoid valgrind warnings
-  --with-version          use this version for produced libraries
-
-  --with-static-jpeg      enable static linking of JPEG library
-  --with-static-z         enable static linking of Z library"
+  --with-version          use this version for produced libraries"
 
 dnl Check to see if we're running under Cygwin32.
 
+
+dnl Check to see if we're running under FreeBSD.
+AC_DEFUN(nxconf_FreeBSD,
+[AC_CACHE_CHECK(for FreeBSD environment, nxconf_cv_freebsd,
+[AC_TRY_COMPILE(,[return __FreeBSD__;],
+nxconf_cv_freebsd=yes, nxconf_cv_freebsd=no)
+rm -f conftest*])
+FreeBSD=
+test "$nxconf_cv_freebsd" = yes && FreeBSD=yes])
+nxconf_FreeBSD
+
+
 AC_DEFUN(nxconf_CYGWIN32,
 [AC_CACHE_CHECK(for Cygwin32 environment, nxconf_cv_cygwin32,
 [AC_TRY_COMPILE(,[return __CYGWIN32__;],
@@ -112,12 +85,6 @@ CYGWIN32=
 test "$nxconf_cv_cygwin32" = yes && CYGWIN32=yes])
 nxconf_CYGWIN32
 
-dnl Cygwin32 requires the stdc++ library explicitly linked.
-
-if test "$CYGWIN32" = yes; then
-    LIBS="$LIBS -lstdc++ -lcygipc -lgdi32"
-fi
-
 dnl Check for Darwin environment.
 
 AC_DEFUN(nxconf_DARWIN,
@@ -132,7 +99,7 @@ nxconf_DARWIN
 dnl Check to see if we're running under Solaris.
 
 AC_DEFUN(nxconf_SUN,
-[AC_CACHE_CHECK(for Solaris environment, nxconf_cv_sun,
+[AC_CACHE_CHECK(for SunOS environment, nxconf_cv_sun,
 [AC_TRY_COMPILE(,[return __sun;],
 nxconf_cv_sun=yes, nxconf_cv_sun=no)
 rm -f conftest*])
@@ -140,75 +107,6 @@ SUN=
 test "$nxconf_cv_sun" = yes && SUN=yes])
 nxconf_SUN
 
-dnl Check to see if we're running under FreeBSD.
-
-AC_DEFUN(nxconf_FreeBSD,
-[AC_CACHE_CHECK(for FreeBSD environment, nxconf_cv_freebsd,
-[AC_TRY_COMPILE(,[return __FreeBSD__;],
-nxconf_cv_freebsd=yes, nxconf_cv_freebsd=no)
-rm -f conftest*])
-FreeBSD=
-test "$nxconf_cv_freebsd" = yes && FreeBSD=yes])
-nxconf_FreeBSD
-
-dnl Build PIC libraries.
-
-if test "$CYGWIN32" != yes -a "$DARWIN" != yes; then
-  CXXFLAGS="$CXXFLAGS -fPIC"
-  CFLAGS="$CFLAGS -fPIC"
-fi
-
-dnl Solaris requires the socket and gcc_s libs explicitly linked.
-dnl Note also that headers from default /usr/openwin/include/X11
-dnl cause a warning due to pragma in Xmd.h.
-
-if test "$SUN" = yes; then
-  LIBS="$LIBS  -L/usr/sfw/lib -lsocket "
-  CXXFLAGS="$CXXFLAGS -I/usr/sfw/include"
-fi
-
-dnl On FreeBSD search libraries and includes under /usr/local.
-
-if test "$FreeBSD" = yes; then
-  LIBS="$LIBS  -L/usr/local/lib"
-  CXXFLAGS="$CXXFLAGS -I/usr/local/include"
-fi
-
-dnl Under Darwin we don't have support for -soname option and
-dnl we need the -bundle flag. Under Solaris, instead, we need
-dnl the options -G -h.
-
-if test "$DARWIN" = yes; then
-  LDFLAGS="$LDFLAGS -bundle"
-elif test "$SUN" = yes; then
-  LDFLAGS="$LDFLAGS -G -h \$(LIBLOAD)"
-else
-  LDFLAGS="$LDFLAGS -Wl,-soname,\$(LIBLOAD)"
-fi
-
-dnl Check to see if in_addr_t is defined.
-dnl Could use a specific configure test.
-
-AC_DEFUN(nxconf_INADDRT,
-[AC_CACHE_CHECK(for in_addr_t, nxconf_cv_inaddrt,
-[AC_TRY_COMPILE([#include <netinet/in.h>],[in_addr_t t; t = 1; return t;],
-nxconf_cv_inaddrt=yes, nxconf_cv_inaddrt=no)
-rm -f conftest*])
-INADDRT=
-test "$nxconf_cv_inaddrt" = yes && INADDRT=yes])
-nxconf_INADDRT
-
-dnl If in_addr_t is not defined use unsigned int.
-
-if test "$INADDRT" != yes ; then
-  echo -e "using unsigned int for type in_addr_t"
-  CXXFLAGS="$CXXFLAGS -DIN_ADDR_T=unsigned"
-  CPPFLAGS="$CPPFLAGS -DIN_ADDR_T=unsigned"
-else
-  CXXFLAGS="$CXXFLAGS -DIN_ADDR_T=in_addr_t"
-  CPPFLAGS="$CPPFLAGS -DIN_ADDR_T=in_addr_t"
-fi
-
 dnl Check whether --with-version was given.
 
 AC_SUBST(LIBVERSION)
@@ -225,16 +123,6 @@ LIBVERSION=`echo ${VERSION} | cut -d '.' -f 1`
 CXXFLAGS="$CXXFLAGS -DVERSION=\\\"${VERSION}\\\""
 CPPFLAGS="$CPPFLAGS -DVERSION=\\\"${VERSION}\\\""
 
-dnl Finally compose the LIB variable.
-
-if test "$DARWIN" = yes ; then
-  LIBS="$LIBS $LIBSTATIC $LIBSHARED"
-elif test "$SUN" = yes ; then
-  LIBS="$LIBS $LIBSTATIC $LIBSHARED"
-else
-  LIBS="$LIBS $LIBSTATIC -shared $LIBSHARED"
-fi
-
 dnl Check whether --with-symbols or --without-symbols was
 dnl given and set the required optimization level.
 
@@ -266,6 +154,16 @@ else
   echo -e "disabling valgrind memory checker workarounds"
 fi
 
+dnl Cygwin requires that the stdc++ library is linked explicitly.
+dnl GCC 3.3.x requires also the z, png and jpeg libraries. This is
+dnl not true anymore since GCC 3.4.x.
+
+if test "$CYGWIN32" = yes; then
+    LIBS="$LIBS -L../nxcomp -lXcomp -lstdc++ -Wl,-e,_mainCRTStartup -ljpeg -lpng -lz"
+else
+    LIBS="$LIBS -L../nxcomp -lXcomp"
+fi
+
 dnl Find makedepend somewhere.
 
 AC_SUBST(MAKEDEPEND)
diff --git a/nxcompshad/install-sh b/nxproxy/install-sh
similarity index 100%
rename from nxcompshad/install-sh
rename to nxproxy/install-sh
diff --git a/nxproxy/mkinstalldirs b/nxproxy/mkinstalldirs
new file mode 100755
index 0000000..936cf34
--- /dev/null
+++ b/nxproxy/mkinstalldirs
@@ -0,0 +1,34 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman at prep.ai.mit.edu>
+# Created: 1993-05-16
+# Last modified: 1995-03-05
+# Public domain
+
+errstatus=0
+
+for file in ${1+"$@"} ; do
+   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+   shift
+
+   pathcomp=
+   for d in ${1+"$@"} ; do
+     pathcomp="$pathcomp$d"
+     case "$pathcomp" in
+       -* ) pathcomp=./$pathcomp ;;
+     esac
+
+     if test ! -d "$pathcomp"; then
+        echo "mkdir $pathcomp" 1>&2
+        mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+     fi
+
+     if test ! -d "$pathcomp"; then
+	errstatus=$lasterr
+     fi
+
+     pathcomp="$pathcomp/"
+   done
+done
+
+exit $errstatus


hooks/post-receive
-- 
nx-libs.git (NX (redistributed))

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 "nx-libs.git" (NX (redistributed)).




More information about the x2go-commits mailing list