From 593e15ca1c93c83ae5629de450c2c92f7ca3ab56 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 22 Jun 2016 10:09:17 +0200 Subject: debian/*: Drop non-multi-arch support (i.e. Debian squeeze, Ubuntu 10.04 and earlier). --- debian/libxcompshad-dev.install | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 debian/libxcompshad-dev.install (limited to 'debian/libxcompshad-dev.install') diff --git a/debian/libxcompshad-dev.install b/debian/libxcompshad-dev.install new file mode 100644 index 000000000..2010f5950 --- /dev/null +++ b/debian/libxcompshad-dev.install @@ -0,0 +1,3 @@ +usr/lib/*/libXcompshad.so +usr/include/*/nx/Shadow.h +usr/lib/*/pkgconfig/nxcompshad.pc -- cgit v1.2.3 From 76b48676844bc7aa0511b8371ef6347b2e8ad545 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 25 Apr 2017 15:27:17 +0200 Subject: nxcompshad: Switch to autoreconf. --- Makefile | 2 +- debian/copyright | 50 +- debian/libxcompshad-dev.install | 1 + debian/rules | 2 +- nx-X11/lib/X11/Imakefile | 2 +- nx-X11/programs/Xserver/Imakefile | 12 +- nxcompshad/.gitignore | 23 +- nxcompshad/Core.cpp | 622 --------- nxcompshad/Core.h | 212 --- nxcompshad/Input.cpp | 175 --- nxcompshad/Input.h | 99 -- nxcompshad/Logger.cpp | 124 -- nxcompshad/Logger.h | 167 --- nxcompshad/Makefile.am | 21 + nxcompshad/Makefile.in | 251 ---- nxcompshad/Manager.cpp | 260 ---- nxcompshad/Manager.h | 123 -- nxcompshad/Misc.h | 50 - nxcompshad/Poller.h | 39 - nxcompshad/Regions.h | 43 - nxcompshad/Shadow.cpp | 478 ------- nxcompshad/Shadow.h | 109 -- nxcompshad/Updater.cpp | 391 ------ nxcompshad/Updater.h | 103 -- nxcompshad/Win.cpp | 1145 ---------------- nxcompshad/Win.h | 232 ---- nxcompshad/X11.cpp | 1594 ---------------------- nxcompshad/X11.h | 139 -- nxcompshad/X11/include/XTest_nxcompshad.h | 71 - nxcompshad/X11/include/Xdamage_nxcompshad.h | 92 -- nxcompshad/X11/include/Xrandr_nxcompshad.h | 80 -- nxcompshad/configure.ac | 53 + nxcompshad/configure.in | 307 ----- nxcompshad/include/Shadow.h | 109 ++ nxcompshad/install-sh | 238 ---- nxcompshad/m4/nx-macros.m4 | 1 + nxcompshad/nxcompshad.pc.in | 2 +- nxcompshad/src/Core.cpp | 626 +++++++++ nxcompshad/src/Core.h | 212 +++ nxcompshad/src/Input.cpp | 179 +++ nxcompshad/src/Input.h | 99 ++ nxcompshad/src/Logger.cpp | 128 ++ nxcompshad/src/Logger.h | 167 +++ nxcompshad/src/Makefile.am | 45 + nxcompshad/src/Manager.cpp | 264 ++++ nxcompshad/src/Manager.h | 123 ++ nxcompshad/src/Misc.h | 50 + nxcompshad/src/Poller.h | 39 + nxcompshad/src/Regions.h | 43 + nxcompshad/src/Shadow.cpp | 482 +++++++ nxcompshad/src/Updater.cpp | 395 ++++++ nxcompshad/src/Updater.h | 103 ++ nxcompshad/src/Win.cpp | 1149 ++++++++++++++++ nxcompshad/src/Win.h | 232 ++++ nxcompshad/src/X11.cpp | 1598 +++++++++++++++++++++++ nxcompshad/src/X11.h | 139 ++ nxcompshad/src/X11/include/XTest_nxcompshad.h | 71 + nxcompshad/src/X11/include/Xdamage_nxcompshad.h | 92 ++ nxcompshad/src/X11/include/Xrandr_nxcompshad.h | 80 ++ 59 files changed, 6558 insertions(+), 7180 deletions(-) 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/Logger.cpp delete mode 100644 nxcompshad/Logger.h create mode 100644 nxcompshad/Makefile.am delete mode 100644 nxcompshad/Makefile.in delete mode 100644 nxcompshad/Manager.cpp delete mode 100644 nxcompshad/Manager.h delete mode 100644 nxcompshad/Misc.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/Win.cpp delete mode 100644 nxcompshad/Win.h delete mode 100644 nxcompshad/X11.cpp delete mode 100644 nxcompshad/X11.h delete mode 100644 nxcompshad/X11/include/XTest_nxcompshad.h delete mode 100644 nxcompshad/X11/include/Xdamage_nxcompshad.h delete mode 100644 nxcompshad/X11/include/Xrandr_nxcompshad.h create mode 100644 nxcompshad/configure.ac delete mode 100644 nxcompshad/configure.in create mode 100644 nxcompshad/include/Shadow.h delete mode 100755 nxcompshad/install-sh create mode 120000 nxcompshad/m4/nx-macros.m4 create mode 100644 nxcompshad/src/Core.cpp create mode 100644 nxcompshad/src/Core.h create mode 100644 nxcompshad/src/Input.cpp create mode 100644 nxcompshad/src/Input.h create mode 100644 nxcompshad/src/Logger.cpp create mode 100644 nxcompshad/src/Logger.h create mode 100644 nxcompshad/src/Makefile.am create mode 100644 nxcompshad/src/Manager.cpp create mode 100644 nxcompshad/src/Manager.h create mode 100644 nxcompshad/src/Misc.h create mode 100644 nxcompshad/src/Poller.h create mode 100644 nxcompshad/src/Regions.h create mode 100644 nxcompshad/src/Shadow.cpp create mode 100644 nxcompshad/src/Updater.cpp create mode 100644 nxcompshad/src/Updater.h create mode 100644 nxcompshad/src/Win.cpp create mode 100644 nxcompshad/src/Win.h create mode 100644 nxcompshad/src/X11.cpp create mode 100644 nxcompshad/src/X11.h create mode 100644 nxcompshad/src/X11/include/XTest_nxcompshad.h create mode 100644 nxcompshad/src/X11/include/Xdamage_nxcompshad.h create mode 100644 nxcompshad/src/X11/include/Xrandr_nxcompshad.h (limited to 'debian/libxcompshad-dev.install') diff --git a/Makefile b/Makefile index 6fb11333c..d38015a00 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ build-full: # nxcomp{ext,shad}. cd nx-X11/lib && make - cd nxcompshad && autoconf && (${CONFIGURE}) && ${MAKE} + cd nxcompshad && autoreconf -vfsi && (${CONFIGURE}) && ${MAKE} ./mesa-quilt push -a diff --git a/debian/copyright b/debian/copyright index b08ec0335..d9ef896b0 100644 --- a/debian/copyright +++ b/debian/copyright @@ -80,25 +80,25 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h nx-X11/programs/Xserver/hw/nxagent/compext/Rle.h nx-X11/programs/Xserver/hw/nxagent/compext/Z.c nx-X11/programs/Xserver/hw/nxagent/compext/Z.h - nxcompshad/Core.cpp - nxcompshad/Core.h - nxcompshad/Input.cpp - nxcompshad/Input.h - nxcompshad/Logger.cpp - nxcompshad/Logger.h - nxcompshad/Manager.cpp - nxcompshad/Manager.h - nxcompshad/Misc.h - nxcompshad/Poller.h - nxcompshad/Regions.h - nxcompshad/Shadow.cpp - nxcompshad/Shadow.h - nxcompshad/Updater.cpp - nxcompshad/Updater.h - nxcompshad/Win.cpp - nxcompshad/Win.h - nxcompshad/X11.cpp - nxcompshad/X11.h + nxcompshad/include/Shadow.h + nxcompshad/src/Core.cpp + nxcompshad/src/Core.h + nxcompshad/src/Input.cpp + nxcompshad/src/Input.h + nxcompshad/src/Logger.cpp + nxcompshad/src/Logger.h + nxcompshad/src/Manager.cpp + nxcompshad/src/Manager.h + nxcompshad/src/Misc.h + nxcompshad/src/Poller.h + nxcompshad/src/Regions.h + nxcompshad/src/Shadow.cpp + nxcompshad/src/Updater.cpp + nxcompshad/src/Updater.h + nxcompshad/src/Win.cpp + nxcompshad/src/Win.h + nxcompshad/src/X11.cpp + nxcompshad/src/X11.h Copyright: 2001, 2011, NoMachine (http://www.nomachine.com) 2008-2014, Oleksandr Shneyder 2011-2016, Mike Gabriel */ @@ -1001,7 +1001,7 @@ Files: nx-X11/include/XWDFile.h nx-X11/programs/Xserver/record/record.c nx-X11/programs/Xserver/record/set.c nx-X11/programs/Xserver/record/set.h - nxcompshad/X11/include/XTest_nxcompshad.h + nxcompshad/src/X11/include/XTest_nxcompshad.h Copyright: 1985, 1987, 1990, 1998, The Open Group 1985, 1987, 1994, 1998, The Open Group 1985, 1987, 1998, The Open Group @@ -1452,7 +1452,7 @@ Files: nx-X11/include/extensions/composite.h nx-X11/programs/Xserver/xfixes/xfixes.h nx-X11/programs/Xserver/xfixes/xfixesint.h nx-X11/programs/Xserver/Xext/shmint.h - nxcompshad/X11/include/Xdamage_nxcompshad.h + nxcompshad/src/X11/include/Xdamage_nxcompshad.h Copyright: 1998, Keith Packard 1999, Keith Packard 2002, Keith Packard @@ -2310,7 +2310,7 @@ Copyright: 2000, Compaq Computer Corporation License: MIT~X11 Files: nx-X11/programs/Xserver/hw/nxagent/X11/include/Xrandr_nxagent.h - nxcompshad/X11/include/Xrandr_nxcompshad.h + nxcompshad/src/X11/include/Xrandr_nxcompshad.h Copyright: 2000, Compaq Computer Corporation, Inc 2002, Hewlett-Packard Company, Inc 2006, Intel Corporation @@ -2908,10 +2908,11 @@ Files: ChangeLog nxcomp/VERSION nxcomp/configure.in nxcomp/nxcomp.pc.in - nxcompshad/Makefile.in + nxcompshad/Makefile.am nxcompshad/VERSION - nxcompshad/configure.in + nxcompshad/configure.ac nxcompshad/nxcompshad.pc.in + nxcompshad/src/Makefile.am nxproxy/VERSION nxproxy/man/nxproxy.1 nxproxy/Makefile.am @@ -2951,7 +2952,6 @@ Copyright: *No copyright* License: public-domain Files: nxcomp/install-sh - nxcompshad/install-sh Copyright: 1994, X Consortium License: Expat~NoAdvert Comment: diff --git a/debian/libxcompshad-dev.install b/debian/libxcompshad-dev.install index 2010f5950..68318ee03 100644 --- a/debian/libxcompshad-dev.install +++ b/debian/libxcompshad-dev.install @@ -1,3 +1,4 @@ usr/lib/*/libXcompshad.so +usr/lib/*/libXcompshad.a usr/include/*/nx/Shadow.h usr/lib/*/pkgconfig/nxcompshad.pc diff --git a/debian/rules b/debian/rules index adfc34e5e..b59ba83a5 100755 --- a/debian/rules +++ b/debian/rules @@ -25,7 +25,7 @@ override_dh_install: # remove static libs rm debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/libXcomp.a - rm debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/libXcompshad.a + rm debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/libXcompshad.la # remove extras, GL, and other unneeded headers rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/GL/ diff --git a/nx-X11/lib/X11/Imakefile b/nx-X11/lib/X11/Imakefile index 055cbec33..5b289fae8 100644 --- a/nx-X11/lib/X11/Imakefile +++ b/nx-X11/lib/X11/Imakefile @@ -87,7 +87,7 @@ NX_XCOMPLIBTARGET = $(NX_XCOMPLIBDIR)/$(NX_XCOMPLIBNAME) NX_REQUIREDLIBS = -L$(NX_XCOMPLIBDIR) -l$(NX_XCOMPLIBLINK) NX_XCOMPCONFIGTARGET = $(NX_XCOMPLIBDIR)/config.status -NX_XCOMPEXTLIBDIR = $(XTOP)/../nxcompext +NX_XCOMPEXTLIBDIR = $(XTOP)/../nxcompext/src/.libs NX_XCOMPEXTLIBTARGET = $(NX_XCOMPEXTLIBDIR)/$(NX_XCOMPEXTLIBNAME) NX_XCOMPEXTCONFIGTARGET = $(NX_XCOMPEXTLIBDIR)/config.status diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index c5bbbeb75..ed49313ee 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -221,8 +221,8 @@ NX_XCOMP_HEADERS = \ ../../../nxcomp/NXvars.h \ $(NULL) -NX_XCOMPSHAD_HEADERS = \ - ../../../nxcompshad/Shadow.h \ +NX_XCOMPSHAD_HEADERS = \ + ../../../nxcompshad/include/Shadow.h \ $(NULL) NX_HEADERS = \ @@ -316,7 +316,7 @@ $(NXAGENTOBJS) $(NXAGENTLIBS) $(NXAGENTSYSLIBS):: $(NXAGENTDIRS) #if defined(SunArchitecture) NXAGENTNXLIBS = -L/usr/sfw/lib \ -L../../../nxcomp \ - -L../../../nxcompshad \ + -L../../../nxcompshad/src/.libs \ -lrt \ -lXcomp \ -lXcompshad \ @@ -331,7 +331,7 @@ NXAGENTNXLIBS = -L/usr/sfw/lib \ $(NULL) #elif defined(cygwinArchitecture) NXAGENTNXLIBS = -L../../../nxcomp \ - -L../../../nxcompshad \ + -L../../../nxcompshad/src/.libs \ -lXcomp \ -lXcompshad \ -lXrender \ @@ -345,7 +345,7 @@ NXAGENTNXLIBS = -L../../../nxcomp \ #elif defined(OpenBSDArchitecture) NXAGENTNXLIBS = -L../../../nxcomp \ -L../../../nx-X11/exports/lib \ - -L../../../nxcompshad \ + -L../../../nxcompshad/src/.libs \ -lkvm \ -lXcomp \ -lXcompshad \ @@ -360,7 +360,7 @@ NXAGENTNXLIBS = -L../../../nxcomp \ $(NULL) #else NXAGENTNXLIBS = -L../../../nxcomp \ - -L../../../nxcompshad \ + -L../../../nxcompshad/src/.libs \ -lXcomp \ -lXcompshad \ -lXrender \ diff --git a/nxcompshad/.gitignore b/nxcompshad/.gitignore index f083c6b27..1eefcb7bf 100644 --- a/nxcompshad/.gitignore +++ b/nxcompshad/.gitignore @@ -1,2 +1,23 @@ -nxcompshad.pc Makefile +Makefile.in +aclocal.m4 +build-aux/compile +build-aux/config.guess +build-aux/config.sub +build-aux/depcomp +build-aux/install-sh +build-aux/ltmain.sh +build-aux/missing +config.h +config.h.in +libtool +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 +m4/lt~obsolete.m4 +nxcompshad.pc +src/.deps/ +src/Makefile +src/Makefile.in +stamp-h1 diff --git a/nxcompshad/Core.cpp b/nxcompshad/Core.cpp deleted file mode 100644 index 1682d343f..000000000 --- a/nxcompshad/Core.cpp +++ /dev/null @@ -1,622 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#include -#include - -#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 91f3f1e22..000000000 --- a/nxcompshad/Core.h +++ /dev/null @@ -1,212 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#ifndef CorePoller_H -#define CorePoller_H - -#include - -#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 a79b30459..000000000 --- a/nxcompshad/Input.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#include - -#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 cbba029a9..000000000 --- a/nxcompshad/Input.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#ifndef Input_H -#define Input_H - -#include - -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/Logger.cpp b/nxcompshad/Logger.cpp deleted file mode 100644 index f27c97c19..000000000 --- a/nxcompshad/Logger.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#include -#include -#include - -#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 eba81f642..000000000 --- a/nxcompshad/Logger.h +++ /dev/null @@ -1,167 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#ifndef Logger_H -#define Logger_H - -#include -#include - -// -// 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.am b/nxcompshad/Makefile.am new file mode 100644 index 000000000..f3666a08a --- /dev/null +++ b/nxcompshad/Makefile.am @@ -0,0 +1,21 @@ +SUBDIRS = src + +pkgconfig_DATA = nxcompshad.pc + +MAINTAINERCLEANFILES = \ + $(srcdir)/autom4te.cache/* \ + $(srcdir)/build-aux/* \ + $(srcdir)/Makefile.in \ + $(srcdir)/src/Makefile.in \ + $(srcdir)/aclocal.m4 \ + $(srcdir)/config.h.in \ + $(srcdir)/config.h.in~ \ + $(srcdir)/configure \ + $(srcdir)/m4/libtool.m4 \ + $(srcdir)/m4/lt~obsolete.m4 \ + $(srcdir)/m4/ltoptions.m4 \ + $(srcdir)/m4/ltsugar.m4 \ + $(srcdir)/m4/ltversion.m4 \ + $(NULL) + +DISTCLEANFILES=$(MAINTAINERCLEANFILES) diff --git a/nxcompshad/Makefile.in b/nxcompshad/Makefile.in deleted file mode 100644 index 34b785d25..000000000 --- a/nxcompshad/Makefile.in +++ /dev/null @@ -1,251 +0,0 @@ -#/**************************************************************************/ -#/* */ -#/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -#/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -#/* Copyright (c) 2014-2016 Ulrich Sibiller */ -#/* Copyright (c) 2014-2016 Mihai Moldovan */ -#/* Copyright (c) 2011-2016 Mike Gabriel */ -#/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -#/* */ -#/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -#/* are copyright of the aforementioned persons and companies. */ -#/* */ -#/* Redistribution and use of the present software is allowed according */ -#/* to terms specified in the file LICENSE which comes in the source */ -#/* distribution. */ -#/* */ -#/* All rights reserved. */ -#/* */ -#/* NOTE: This software has received contributions from various other */ -#/* contributors, only the core maintainers and supporters are listed as */ -#/* copyright holders. Please contact us, if you feel you should be listed */ -#/* as copyright holder, as well. */ -#/* */ -#/**************************************************************************/ - -# -# 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 = - -CPPFLAGS = @CPPFLAGS@ - -# -# C programs don't share the C++ flags. They should -# have their own @CCFLAGS@. -# - -CC = @CC@ -CCFLAGS = @X_CFLAGS@ @DEFS@ \ - -Wall -Wpointer-arith -CCINCLUDES = -CCDEFINES = - -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -lNX_X11 - -# -# 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@ -datarootdir = @datarootdir@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -man1dir = @mandir@/man1 -VPATH = @srcdir@ -libdir = @libdir@ -includedir = @includedir@ -pkgconfigdir = @pkgconfigdir@ - -INSTALL = @INSTALL@ -INSTALL_DIR = $(INSTALL) -d -m 0755 -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_LINK = cp -av -DESTDIR = -RM_FILE = rm -f -RM_DIR = rmdir -p --ignore-fail-on-non-empty - -# -# This should be autodetected. -# - -MAKEDEPEND = @MAKEDEPEND@ -DEPENDINCLUDES = -I/usr/include/g++ -I/usr/include/g++-3 - -.SUFFIXES: .cpp.c - -.cpp.o: - $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CXXINCLUDES) $(CXXDEFINES) $< -.c.o: - $(CC) -c $(CPPFLAGS) $(CCFLAGS) $(CCINCLUDES) $(CCDEFINES) $< - -LIBRARY = Xcompshad - -LIBNAME = lib$(LIBRARY) -ifeq ($(shell uname),Darwin) -LIBFULL = lib$(LIBRARY).$(VERSION).dylib -LIBLOAD = lib$(LIBRARY).$(LIBVERSION).dylib -LIBSHARED = lib$(LIBRARY).dylib -COMP_VER = $(shell echo '$(VERSION)' | cut -d '.' -f 1-3) -LIBFLAGS = -install_name $(libdir)/$(LIBLOAD) -compatibility_version $(LIBVERSION) -current_version $(COMP_VER) -else -LIBFULL = lib$(LIBRARY).so.$(VERSION) -LIBLOAD = lib$(LIBRARY).so.$(LIBVERSION) -LIBSHARED = lib$(LIBRARY).so -LIBFLAGS = -endif -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 = -lXext -lXtst -lXrandr -lXdamage - -all: depend $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) - -endif - -$(LIBFULL): $(CXXOBJ) $(COBJ) - $(CXX) -o $@ $(LDFLAGS) $(LIBFLAGS) $(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} - -$(PROGRAM): $(MOBJ) $(COBJ) $(CXXOBJ) $(LIBDLL) -# $(CC) $(CCFLAGS) -o $@ $(MOBJ) $(MLIBS) - -depends: depend.status - -depend: depend.status - -depend.status: - if [ -n "$(MAKEDEPEND)" ] && [ -x "$(MAKEDEPEND)" ] ; then \ - $(MAKEDEPEND) $(CXXINCLUDES) $(CCINCLUDES) \ - $(DEPENDINCLUDES) -f Makefile $(MSRC) $(CSRC) $(CXXSRC) 2>/dev/null; \ - fi - touch depend.status - -install: install.bin install.lib install.man - -install.bin: - -install.lib: all - $(INSTALL_DIR) $(DESTDIR)${libdir} - $(INSTALL_DIR) $(DESTDIR)${pkgconfigdir} - $(INSTALL_DIR) $(DESTDIR)${includedir}/nx - $(INSTALL_DIR) $(DESTDIR)${pkgconfigdir} - $(INSTALL_DATA) $(LIBFULL) $(DESTDIR)${libdir} - $(INSTALL_LINK) $(LIBLOAD) $(DESTDIR)${libdir} - $(INSTALL_LINK) $(LIBSHARED) $(DESTDIR)${libdir} - $(INSTALL_DATA) $(LIBARCHIVE) $(DESTDIR)${libdir} - $(INSTALL_DATA) Shadow.h $(DESTDIR)${includedir}/nx - $(INSTALL_DATA) nxcompshad.pc $(DESTDIR)${pkgconfigdir} - echo "Running ldconfig tool, this may take a while..." && ldconfig || true - -install.man: - -uninstall: uninstall.bin uninstall.lib uninstall.man - -uninstall.bin: - -uninstall.lib: - $(RM_FILE) $(DESTDIR)${libdir}/$(LIBFULL) - $(RM_FILE) $(DESTDIR)${libdir}/$(LIBLOAD) - $(RM_FILE) $(DESTDIR)${libdir}/$(LIBSHARED) - $(RM_FILE) $(DESTDIR)${libdir}/$(LIBARCHIVE) - for header in *.h; do $(RM_FILE) $(DESTDIR)${includedir}/nx/$$header; done - $(RM_DIR) $(DESTDIR)${libdir}/nx/ - $(RM_DIR) $(DESTDIR)${includedir}/nx/ - $(RM_FILE) $(DESTDIR)${pkgconfigdir}/nxcompshad.pc - echo "Running ldconfig tool, this may take a while..." && ldconfig || true - -uninstall.man: - -clean: - -rm -f *~ *.o *.gch *.bak st?????? core core.* *.out.* *.exe.stackdump *.pc \ - $(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 configure diff --git a/nxcompshad/Manager.cpp b/nxcompshad/Manager.cpp deleted file mode 100644 index 3bb36c13f..000000000 --- a/nxcompshad/Manager.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#include -#include -#include -#include - -#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(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(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 92a82cd32..000000000 --- a/nxcompshad/Manager.h +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#ifndef UpdateManager_H -#define UpdateManager_H - -#include - -#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/Misc.h b/nxcompshad/Misc.h deleted file mode 100644 index 9386dc080..000000000 --- a/nxcompshad/Misc.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#ifndef Misc_H -#define Misc_H - -#include - -#include -#include - -using namespace std; - -// -// Error handling macros. -// - -#define ESET(e) (errno = (e)) -#define EGET() (errno) -#define ESTR() strerror(errno) - -// -// Log file. -// - -extern ostream *logofs; - -#endif /* Misc_H */ diff --git a/nxcompshad/Poller.h b/nxcompshad/Poller.h deleted file mode 100644 index 6236f872f..000000000 --- a/nxcompshad/Poller.h +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#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 59fdcb46c..000000000 --- a/nxcompshad/Regions.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#ifndef Region_H -#define Region_H - -#include -#include - -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 643a5a807..000000000 --- a/nxcompshad/Shadow.cpp +++ /dev/null @@ -1,478 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#include -#include - -#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(EBADF)); - - 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(EBADF)); - - 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(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(dpy); - Display **shadowDisplay = reinterpret_cast(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(EBADF)); - - 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(EBADF)); - - 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(EBADF)); - } - - 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(vis); - - logTrace("NXShadowCaptureCursor"); - - logTest("NXShadowCaptureCursor","Init"); - - return poller -> updateCursor(window, visual); -} - -#endif - -void NXShadowUpdateBuffer(void **buffer) -{ - char **fBuffer = reinterpret_cast(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 e1c57c432..000000000 --- a/nxcompshad/Shadow.h +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#ifndef Shadow_H -#define Shadow_H - -#include - -#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 instead of 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 67f4f9628..000000000 --- a/nxcompshad/Updater.cpp +++ /dev/null @@ -1,391 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#include -#include -#include -#include - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG -// -#include -// -#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 10d75c0d6..000000000 --- a/nxcompshad/Updater.h +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#ifndef Updater_H -#define Updater_H - -#include - -#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/Win.cpp b/nxcompshad/Win.cpp deleted file mode 100644 index b3a06f415..000000000 --- a/nxcompshad/Win.cpp +++ /dev/null @@ -1,1145 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#if defined(__CYGWIN32__) || defined(WIN32) - -#include - -#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 615f9a5f5..000000000 --- a/nxcompshad/Win.h +++ /dev/null @@ -1,232 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#ifdef __CYGWIN32__ - -#ifndef Win32Poller_H -#define Win32Poller_H - -//#include - -#include -#include -#include -#include - -#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 d1af82281..000000000 --- a/nxcompshad/X11.cpp +++ /dev/null @@ -1,1594 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#if !defined(__CYGWIN32__) && !defined(WIN32) - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -#include -#include -#include -#include "X11/include/XTest_nxcompshad.h" -#include -#include -#include - -#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 87dd31fea..000000000 --- a/nxcompshad/X11.h +++ /dev/null @@ -1,139 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -#ifndef X11Poller_H -#define X11Poller_H - -#include -#include -#include "X11/include/Xdamage_nxcompshad.h" -#include "X11/include/Xrandr_nxcompshad.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/nxcompshad/X11/include/XTest_nxcompshad.h b/nxcompshad/X11/include/XTest_nxcompshad.h deleted file mode 100644 index 91a2ba40b..000000000 --- a/nxcompshad/X11/include/XTest_nxcompshad.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - -Copyright 1992, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -*/ - -#ifndef _XTEST_H_ -#define _XTEST_H_ - -#include - -_XFUNCPROTOBEGIN - -Bool XTestQueryExtension( - Display* /* dpy */, - int* /* event_basep */, - int* /* error_basep */, - int* /* majorp */, - int* /* minorp */ -); - -extern int XTestFakeKeyEvent( - Display* /* dpy */, - unsigned int /* keycode */, - Bool /* is_press */, - unsigned long /* delay */ -); - -extern int XTestFakeButtonEvent( - Display* /* dpy */, - unsigned int /* button */, - Bool /* is_press */, - unsigned long /* delay */ -); - -extern int XTestFakeMotionEvent( - Display* /* dpy */, - int /* screen */, - int /* x */, - int /* y */, - unsigned long /* delay */ -); - -extern int XTestGrabControl( - Display* /* dpy */, - Bool /* impervious */ -); - -_XFUNCPROTOEND - -#endif diff --git a/nxcompshad/X11/include/Xdamage_nxcompshad.h b/nxcompshad/X11/include/Xdamage_nxcompshad.h deleted file mode 100644 index cae3e1c67..000000000 --- a/nxcompshad/X11/include/Xdamage_nxcompshad.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright © 2003 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file is a reduced version of the header file of - * - * - * This copy of code has been introduced to allow a clear namespace - * separation between and header files. - * - * This version of the Xdamage library header file only contains symbols - * required by nxcompshad and strictly avoids indirectly including - * from an X11 library that is also shipped in nx-X11/lib/. - * - * When using instead for inclusion in - * nxcompshad, it will attempt pulling in the - * header which in turn will include . However, the headers of - * the same name from should be used instead. - * - * FIXME: Once the nxagent Xserver starts using libX11 from X.Org, this - * hack can be removed. - * - * 2015/06/26, Mike Gabriel - */ - - -#ifndef _XDAMAGE_H_ -#define _XDAMAGE_H_ - -#include -#include - -/* from */ -typedef XID XserverRegion; - -#define XDAMAGE_1_1_INTERFACE - -typedef XID Damage; - -typedef struct { - int type; /* event base */ - unsigned long serial; - Bool send_event; - Display *display; - Drawable drawable; - Damage damage; - int level; - Bool more; /* more events will be delivered immediately */ - Time timestamp; - XRectangle area; - XRectangle geometry; -} XDamageNotifyEvent; - -_XFUNCPROTOBEGIN - -Bool XDamageQueryExtension (Display *dpy, - int *event_base_return, - int *error_base_return); - -Status XDamageQueryVersion (Display *dpy, - int *major_version_return, - int *minor_version_return); - -Damage -XDamageCreate (Display *dpy, Drawable drawable, int level); - -void -XDamageSubtract (Display *dpy, Damage damage, - XserverRegion repair, XserverRegion parts); - -_XFUNCPROTOEND - -#endif /* _XDAMAGE_H_ */ diff --git a/nxcompshad/X11/include/Xrandr_nxcompshad.h b/nxcompshad/X11/include/Xrandr_nxcompshad.h deleted file mode 100644 index 4feb01685..000000000 --- a/nxcompshad/X11/include/Xrandr_nxcompshad.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright © 2000 Compaq Computer Corporation, Inc. - * Copyright © 2002 Hewlett-Packard Company, Inc. - * Copyright © 2006 Intel Corporation - * Copyright © 2008 Red Hat, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting documentation, and - * that the name of the copyright holders not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. The copyright holders make no representations - * about the suitability of this software for any purpose. It is provided "as - * is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE - * OF THIS SOFTWARE. - * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. - * Keith Packard, Intel Corporation - */ - -/* - * This file is a reduced version of the header file of - * - * - * This copy of code has been introduced to allow a clear namespace - * separation between and header files. - * - * This version of the Xrandr library header file only contains symbols - * required by nxcompshad and strictly avoids indirectly including - * from an X11 library that is also shipped in nx-X11/lib/. - * - * When using instead for inclusion in - * nxcompshad, it will attempt pulling in the - * header which in turn will include . However, the headers of - * the same name from should be used instead. - * - * FIXME: Once the nxagent Xserver starts using libXrender from X.Org, this - * hack can be removed. - * - * 2015/06/26, Mike Gabriel - */ - -#ifndef _XRANDR_H_ -#define _XRANDR_H_ - -/* from */ -#define RRScreenChangeNotify 0 -#define RRScreenChangeNotifyMask (1L << 0) - -#include - -_XFUNCPROTOBEGIN - -/* internal representation is private to the library */ -typedef struct _XRRScreenConfiguration XRRScreenConfiguration; - -Bool XRRQueryExtension (Display *dpy, - int *event_base_return, - int *error_base_return); - -void XRRSelectInput(Display *dpy, Window window, int mask); - - -/* - * intended to take RRScreenChangeNotify, or - * ConfigureNotify (on the root window) - * returns 1 if it is an event type it understands, 0 if not - */ -int XRRUpdateConfiguration(XEvent *event); -_XFUNCPROTOEND - -#endif /* _XRANDR_H_ */ diff --git a/nxcompshad/configure.ac b/nxcompshad/configure.ac new file mode 100644 index 000000000..b3abf0efb --- /dev/null +++ b/nxcompshad/configure.ac @@ -0,0 +1,53 @@ +dnl *************************************************************************** +dnl *** configure.ac for nxcompshad *** +dnl *************************************************************************** + +m4_define([nxcompshad_version], m4_esyscmd([tr -d '\n' < VERSION])) + +# Initialize Autoconf +AC_PREREQ(2.60) + +AC_INIT([libXcompshad], [nxcompshad_version], [https://github.com/ArcticaProject/nx-libs/issues]) +AC_PROG_CXX +AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_AUX_DIR([build-aux]) + +AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz]) + +# Initialize libtool +AC_PROG_LIBTOOL + +COMPSHAD_VERSION=nxcompshad_version +AC_SUBST([COMPSHAD_VERSION]) + +LT_COMPSHAD_VERSION=[`echo $COMPSHAD_VERSION | sed -r -e 's/^([0-9]+\.[0-9]+\.[0-9]+).*$/\1/' -e 's/\./:/g'`] +AC_SUBST([LT_COMPSHAD_VERSION]) + +PKG_CHECK_MODULES(Xext, xext) +PKG_CHECK_MODULES(Xdamage, xdamage) +PKG_CHECK_MODULES(Xrandr, xrandr) +PKG_CHECK_MODULES(Xtst, xtst) + +# Upstream's pkg.m4 (since 0.27) offers this now, but define our own +# compatible version in case the local version of pkgconfig isn't new enough. +# https://bugs.freedesktop.org/show_bug.cgi?id=48743 +m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], + [AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], + [install directory for nxcompshad.pc pkg-config file])], + [],[with_pkgconfigdir='$(libdir)/pkgconfig']) + AC_SUBST([pkgconfigdir], [${with_pkgconfigdir}])]) + +AC_LANG([C++]) +NX_COMPILER_BRAND +NX_COMPILER_FLAGS + +AC_CONFIG_FILES([ +Makefile +src/Makefile +nxcompshad.pc +]) + +AC_OUTPUT diff --git a/nxcompshad/configure.in b/nxcompshad/configure.in deleted file mode 100644 index bb9286e3d..000000000 --- a/nxcompshad/configure.in +++ /dev/null @@ -1,307 +0,0 @@ -dnl /**************************************************************************/ -dnl /* */ -dnl /* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -dnl /* Copyright (c) 2008-2014 Oleksandr Shneyder */ -dnl /* Copyright (c) 2014-2016 Ulrich Sibiller */ -dnl /* Copyright (c) 2014-2016 Mihai Moldovan */ -dnl /* Copyright (c) 2011-2016 Mike Gabriel */ -dnl /* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -dnl /* */ -dnl /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -dnl /* are copyright of the aforementioned persons and companies. */ -dnl /* */ -dnl /* Redistribution and use of the present software is allowed according */ -dnl /* to terms specified in the file LICENSE which comes in the source */ -dnl /* distribution. */ -dnl /* */ -dnl /* All rights reserved. */ -dnl /* */ -dnl /* NOTE: This software has received contributions from various other */ -dnl /* contributors, only the core maintainers and supporters are listed as */ -dnl /* copyright holders. Please contact us, if you feel you should be listed */ -dnl /* as copyright holder, as well. */ -dnl /* */ -dnl /**************************************************************************/ - - -dnl Process this file with autoconf to produce a configure script. - -dnl Prolog - -AC_INIT(Shadow.h) -AC_PREREQ(2.13) - -pkgconfigdir=${libdir}/pkgconfig -AC_SUBST(pkgconfigdir) - -dnl Reset default compilation flags. - -if test "x$CXXFLAGS" == "x"; then - CXXFLAGS="-O3" -fi -if test "x$CPPFLAGS" == "x"; then - CPPFLAGS="-O3" -fi - -dnl Reset default linking directives. - -LIBSTATIC="" -LIBSHARED="" - -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" - LIBS="-L../nx-X11/exports/lib" -fi - -dnl Check whether --with-ipaq was given. - -if test "${with_ipaq}" = yes; then - echo -e "enabling IPAQ configuration" - CXX="arm-linux-c++" - CC="arm-linux-gcc" - unset ac_cv_prog_armcxx - unset ac_cv_prog_armcc - unset ac_cv_prog_CXXCPP - AC_CHECK_PROG([armcxx],["$CXX"],[yes],[no],[$PATH]) - AC_CHECK_PROG([armcc],["$CC"],[yes],[no],[$PATH]) - if test $armcxx = "yes" && test $armcc = "yes" ; then - ac_cv_prog_CXX="$CXX" - ac_cv_prog_CC="$CC" - else - AC_MSG_ERROR(installation or configuration problem: I cannot find compiler for arm-linux) - fi -else - unset ac_cv_prog_CXX - unset ac_cv_prog_CC - unset ac_cv_prog_CXXCPP -fi - -dnl Check for programs. - -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" - CPPFLAGS="$CPPFLAGS -Wmissing-declarations" - ;; -esac - -dnl Check for BSD compatible install. - -AC_PROG_INSTALL - -dnl Check for extra header files. - -AC_PATH_XTRA - -dnl Custom addition. - -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" - -dnl Check to see if we're running under Cygwin32. - -AC_DEFUN(nxconf_CYGWIN32, -[AC_CACHE_CHECK(for Cygwin32 environment, nxconf_cv_cygwin32, -[AC_TRY_COMPILE(,[return __CYGWIN32__;], -nxconf_cv_cygwin32=yes, nxconf_cv_cygwin32=no) -rm -f conftest*]) -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, -[AC_CACHE_CHECK(for Darwin environment, nxconf_cv_darwin, -[AC_TRY_COMPILE(,[return __APPLE__;], -nxconf_cv_darwin=yes, nxconf_cv_darwin=no) -rm -f conftest*]) -DARWIN= -test "$nxconf_cv_darwin" = yes && DARWIN=yes]) -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_TRY_COMPILE(,[return __sun;], -nxconf_cv_sun=yes, nxconf_cv_sun=no) -rm -f conftest*]) -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 -dynamiclib flag. Under Solaris, instead, we need -dnl the options -G -h. - -if test "$DARWIN" = yes; then - LDFLAGS="$LDFLAGS -dynamiclib" -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 ],[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) -AC_SUBST(VERSION) -if test "${with_version}" = yes; then - VERSION=${ac_option} -else - VERSION=`cat VERSION` -fi -echo -e "compiling version ${VERSION}" - -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. - -if test "${with_symbols}" = yes; then - echo -e "enabling production of debug symbols" - CXXFLAGS="-g $CXXFLAGS" - CPPFLAGS="-g $CPPFLAGS" -else - echo -e "disabling production of debug symbols" -fi - -dnl Check whether --with-info or --without-info was given. - -if test "${with_info}" = yes; then - echo -e "enabling info output in the log file" - CXXFLAGS="$CXXFLAGS -DINFO" - CPPFLAGS="$CPPFLAGS -DINFO" -else - echo -e "disabling info output in the log file" -fi - -dnl Check whether --with-valgrind or --without-valgrind was given. - -if test "${with_valgrind}" = yes; then - echo -e "enabling valgrind memory checker workarounds" - CXXFLAGS="$CXXFLAGS -DVALGRIND" - CPPFLAGS="$CPPFLAGS -DVALGRIND" -else - echo -e "disabling valgrind memory checker workarounds" -fi - -dnl Find makedepend somewhere. - -AC_SUBST(MAKEDEPEND) -MAKEDEPEND="$(which makedepend)" - -AC_OUTPUT(Makefile nxcompshad.pc) diff --git a/nxcompshad/include/Shadow.h b/nxcompshad/include/Shadow.h new file mode 100644 index 000000000..e1c57c432 --- /dev/null +++ b/nxcompshad/include/Shadow.h @@ -0,0 +1,109 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifndef Shadow_H +#define Shadow_H + +#include + +#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 instead of 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/install-sh b/nxcompshad/install-sh deleted file mode 100755 index 58719246f..000000000 --- a/nxcompshad/install-sh +++ /dev/null @@ -1,238 +0,0 @@ -#! /bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/nxcompshad/m4/nx-macros.m4 b/nxcompshad/m4/nx-macros.m4 new file mode 120000 index 000000000..813e9b041 --- /dev/null +++ b/nxcompshad/m4/nx-macros.m4 @@ -0,0 +1 @@ +../../m4/nx-macros.m4 \ No newline at end of file diff --git a/nxcompshad/nxcompshad.pc.in b/nxcompshad/nxcompshad.pc.in index 80b75e3f5..b12ca3e12 100644 --- a/nxcompshad/nxcompshad.pc.in +++ b/nxcompshad/nxcompshad.pc.in @@ -5,7 +5,7 @@ includedir=@includedir@ Name: nxcompshad Description: Shadow Session Support for NX Compression Library -Version: @VERSION@ +Version: @COMPSHAD_VERSION@ Requires: nxcomp Requires.private: x11 Cflags: -I${includedir} diff --git a/nxcompshad/src/Core.cpp b/nxcompshad/src/Core.cpp new file mode 100644 index 000000000..de5f9a897 --- /dev/null +++ b/nxcompshad/src/Core.cpp @@ -0,0 +1,626 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#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/src/Core.h b/nxcompshad/src/Core.h new file mode 100644 index 000000000..91f3f1e22 --- /dev/null +++ b/nxcompshad/src/Core.h @@ -0,0 +1,212 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifndef CorePoller_H +#define CorePoller_H + +#include + +#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/src/Input.cpp b/nxcompshad/src/Input.cpp new file mode 100644 index 000000000..8de74c3c3 --- /dev/null +++ b/nxcompshad/src/Input.cpp @@ -0,0 +1,179 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#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/src/Input.h b/nxcompshad/src/Input.h new file mode 100644 index 000000000..cbba029a9 --- /dev/null +++ b/nxcompshad/src/Input.h @@ -0,0 +1,99 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifndef Input_H +#define Input_H + +#include + +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/src/Logger.cpp b/nxcompshad/src/Logger.cpp new file mode 100644 index 000000000..9648509b8 --- /dev/null +++ b/nxcompshad/src/Logger.cpp @@ -0,0 +1,128 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include + +#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/src/Logger.h b/nxcompshad/src/Logger.h new file mode 100644 index 000000000..eba81f642 --- /dev/null +++ b/nxcompshad/src/Logger.h @@ -0,0 +1,167 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifndef Logger_H +#define Logger_H + +#include +#include + +// +// 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/src/Makefile.am b/nxcompshad/src/Makefile.am new file mode 100644 index 000000000..c7f45ba27 --- /dev/null +++ b/nxcompshad/src/Makefile.am @@ -0,0 +1,45 @@ +NULL = + +lib_LTLIBRARIES = libXcompshad.la + +libXcompshad_la_SOURCES = \ + Core.cpp \ + Input.cpp \ + Logger.cpp \ + Manager.cpp \ + Shadow.cpp \ + Updater.cpp \ + Win.cpp \ + X11.cpp \ + $(NULL) + +libXcompshad_la_LIBADD = \ + @Xext_LIBS@ \ + @Xdamage_LIBS@ \ + @Xrandr_LIBS@ \ + @Xtst_LIBS@ \ + -L$(top_srcdir)/../nx-X11/exports/lib -lNX_X11 \ + $(NULL) + +AM_CFLAGS = \ + $(Xext_CFLAGS) \ + $(Xdamage_CFLAGS) \ + $(Xrandr_CFLAGS) \ + $(Xtst_CFLAGS) \ + $(NULL) + +AM_CXXFLAGS = \ + $(BASE_CXXFLAGS) \ + $(NULL) + +AM_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/../nx-X11/exports/include \ + $(NULL) + +libXcompshad_la_LDFLAGS = -version-number @LT_COMPSHAD_VERSION@ -no-undefined + +libXcompshadincludedir = $(includedir)/nx +libXcompshadinclude_HEADERS = \ + $(top_srcdir)/include/Shadow.h \ + $(NULL) diff --git a/nxcompshad/src/Manager.cpp b/nxcompshad/src/Manager.cpp new file mode 100644 index 000000000..6e3f6b1b0 --- /dev/null +++ b/nxcompshad/src/Manager.cpp @@ -0,0 +1,264 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#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(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(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/src/Manager.h b/nxcompshad/src/Manager.h new file mode 100644 index 000000000..92a82cd32 --- /dev/null +++ b/nxcompshad/src/Manager.h @@ -0,0 +1,123 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifndef UpdateManager_H +#define UpdateManager_H + +#include + +#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/src/Misc.h b/nxcompshad/src/Misc.h new file mode 100644 index 000000000..9386dc080 --- /dev/null +++ b/nxcompshad/src/Misc.h @@ -0,0 +1,50 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifndef Misc_H +#define Misc_H + +#include + +#include +#include + +using namespace std; + +// +// Error handling macros. +// + +#define ESET(e) (errno = (e)) +#define EGET() (errno) +#define ESTR() strerror(errno) + +// +// Log file. +// + +extern ostream *logofs; + +#endif /* Misc_H */ diff --git a/nxcompshad/src/Poller.h b/nxcompshad/src/Poller.h new file mode 100644 index 000000000..6236f872f --- /dev/null +++ b/nxcompshad/src/Poller.h @@ -0,0 +1,39 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#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/src/Regions.h b/nxcompshad/src/Regions.h new file mode 100644 index 000000000..59fdcb46c --- /dev/null +++ b/nxcompshad/src/Regions.h @@ -0,0 +1,43 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifndef Region_H +#define Region_H + +#include +#include + +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/src/Shadow.cpp b/nxcompshad/src/Shadow.cpp new file mode 100644 index 000000000..3db5039ce --- /dev/null +++ b/nxcompshad/src/Shadow.cpp @@ -0,0 +1,482 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#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(EBADF)); + + 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(EBADF)); + + 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(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(dpy); + Display **shadowDisplay = reinterpret_cast(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(EBADF)); + + 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(EBADF)); + + 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(EBADF)); + } + + 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(vis); + + logTrace("NXShadowCaptureCursor"); + + logTest("NXShadowCaptureCursor","Init"); + + return poller -> updateCursor(window, visual); +} + +#endif + +void NXShadowUpdateBuffer(void **buffer) +{ + char **fBuffer = reinterpret_cast(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/src/Updater.cpp b/nxcompshad/src/Updater.cpp new file mode 100644 index 000000000..4b677a78c --- /dev/null +++ b/nxcompshad/src/Updater.cpp @@ -0,0 +1,395 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#define PANIC +#define WARNING +#undef TEST +#undef DEBUG +// +#include +// +#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/src/Updater.h b/nxcompshad/src/Updater.h new file mode 100644 index 000000000..10d75c0d6 --- /dev/null +++ b/nxcompshad/src/Updater.h @@ -0,0 +1,103 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifndef Updater_H +#define Updater_H + +#include + +#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/src/Win.cpp b/nxcompshad/src/Win.cpp new file mode 100644 index 000000000..6033f2c1b --- /dev/null +++ b/nxcompshad/src/Win.cpp @@ -0,0 +1,1149 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#if defined(__CYGWIN32__) || defined(WIN32) + +#include + +#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/src/Win.h b/nxcompshad/src/Win.h new file mode 100644 index 000000000..615f9a5f5 --- /dev/null +++ b/nxcompshad/src/Win.h @@ -0,0 +1,232 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifdef __CYGWIN32__ + +#ifndef Win32Poller_H +#define Win32Poller_H + +//#include + +#include +#include +#include +#include + +#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/src/X11.cpp b/nxcompshad/src/X11.cpp new file mode 100644 index 000000000..3643df731 --- /dev/null +++ b/nxcompshad/src/X11.cpp @@ -0,0 +1,1598 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#if !defined(__CYGWIN32__) && !defined(WIN32) + +#define PANIC +#define WARNING +#undef TEST +#undef DEBUG + +#include +#include +#include +#include "X11/include/XTest_nxcompshad.h" +#include +#include +#include + +#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/src/X11.h b/nxcompshad/src/X11.h new file mode 100644 index 000000000..87dd31fea --- /dev/null +++ b/nxcompshad/src/X11.h @@ -0,0 +1,139 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder */ +/* Copyright (c) 2014-2016 Ulrich Sibiller */ +/* Copyright (c) 2014-2016 Mihai Moldovan */ +/* Copyright (c) 2011-2016 Mike Gabriel */ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ +/* */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ +/* */ +/* Redistribution and use of the present software is allowed according */ +/* to terms specified in the file LICENSE which comes in the source */ +/* distribution. */ +/* */ +/* All rights reserved. */ +/* */ +/* NOTE: This software has received contributions from various other */ +/* contributors, only the core maintainers and supporters are listed as */ +/* copyright holders. Please contact us, if you feel you should be listed */ +/* as copyright holder, as well. */ +/* */ +/**************************************************************************/ + +#ifndef X11Poller_H +#define X11Poller_H + +#include +#include +#include "X11/include/Xdamage_nxcompshad.h" +#include "X11/include/Xrandr_nxcompshad.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/nxcompshad/src/X11/include/XTest_nxcompshad.h b/nxcompshad/src/X11/include/XTest_nxcompshad.h new file mode 100644 index 000000000..91a2ba40b --- /dev/null +++ b/nxcompshad/src/X11/include/XTest_nxcompshad.h @@ -0,0 +1,71 @@ +/* + +Copyright 1992, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +#ifndef _XTEST_H_ +#define _XTEST_H_ + +#include + +_XFUNCPROTOBEGIN + +Bool XTestQueryExtension( + Display* /* dpy */, + int* /* event_basep */, + int* /* error_basep */, + int* /* majorp */, + int* /* minorp */ +); + +extern int XTestFakeKeyEvent( + Display* /* dpy */, + unsigned int /* keycode */, + Bool /* is_press */, + unsigned long /* delay */ +); + +extern int XTestFakeButtonEvent( + Display* /* dpy */, + unsigned int /* button */, + Bool /* is_press */, + unsigned long /* delay */ +); + +extern int XTestFakeMotionEvent( + Display* /* dpy */, + int /* screen */, + int /* x */, + int /* y */, + unsigned long /* delay */ +); + +extern int XTestGrabControl( + Display* /* dpy */, + Bool /* impervious */ +); + +_XFUNCPROTOEND + +#endif diff --git a/nxcompshad/src/X11/include/Xdamage_nxcompshad.h b/nxcompshad/src/X11/include/Xdamage_nxcompshad.h new file mode 100644 index 000000000..cae3e1c67 --- /dev/null +++ b/nxcompshad/src/X11/include/Xdamage_nxcompshad.h @@ -0,0 +1,92 @@ +/* + * Copyright © 2003 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* + * This file is a reduced version of the header file of + * + * + * This copy of code has been introduced to allow a clear namespace + * separation between and header files. + * + * This version of the Xdamage library header file only contains symbols + * required by nxcompshad and strictly avoids indirectly including + * from an X11 library that is also shipped in nx-X11/lib/. + * + * When using instead for inclusion in + * nxcompshad, it will attempt pulling in the + * header which in turn will include . However, the headers of + * the same name from should be used instead. + * + * FIXME: Once the nxagent Xserver starts using libX11 from X.Org, this + * hack can be removed. + * + * 2015/06/26, Mike Gabriel + */ + + +#ifndef _XDAMAGE_H_ +#define _XDAMAGE_H_ + +#include +#include + +/* from */ +typedef XID XserverRegion; + +#define XDAMAGE_1_1_INTERFACE + +typedef XID Damage; + +typedef struct { + int type; /* event base */ + unsigned long serial; + Bool send_event; + Display *display; + Drawable drawable; + Damage damage; + int level; + Bool more; /* more events will be delivered immediately */ + Time timestamp; + XRectangle area; + XRectangle geometry; +} XDamageNotifyEvent; + +_XFUNCPROTOBEGIN + +Bool XDamageQueryExtension (Display *dpy, + int *event_base_return, + int *error_base_return); + +Status XDamageQueryVersion (Display *dpy, + int *major_version_return, + int *minor_version_return); + +Damage +XDamageCreate (Display *dpy, Drawable drawable, int level); + +void +XDamageSubtract (Display *dpy, Damage damage, + XserverRegion repair, XserverRegion parts); + +_XFUNCPROTOEND + +#endif /* _XDAMAGE_H_ */ diff --git a/nxcompshad/src/X11/include/Xrandr_nxcompshad.h b/nxcompshad/src/X11/include/Xrandr_nxcompshad.h new file mode 100644 index 000000000..4feb01685 --- /dev/null +++ b/nxcompshad/src/X11/include/Xrandr_nxcompshad.h @@ -0,0 +1,80 @@ +/* + * Copyright © 2000 Compaq Computer Corporation, Inc. + * Copyright © 2002 Hewlett-Packard Company, Inc. + * Copyright © 2006 Intel Corporation + * Copyright © 2008 Red Hat, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + * + * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. + * Keith Packard, Intel Corporation + */ + +/* + * This file is a reduced version of the header file of + * + * + * This copy of code has been introduced to allow a clear namespace + * separation between and header files. + * + * This version of the Xrandr library header file only contains symbols + * required by nxcompshad and strictly avoids indirectly including + * from an X11 library that is also shipped in nx-X11/lib/. + * + * When using instead for inclusion in + * nxcompshad, it will attempt pulling in the + * header which in turn will include . However, the headers of + * the same name from should be used instead. + * + * FIXME: Once the nxagent Xserver starts using libXrender from X.Org, this + * hack can be removed. + * + * 2015/06/26, Mike Gabriel + */ + +#ifndef _XRANDR_H_ +#define _XRANDR_H_ + +/* from */ +#define RRScreenChangeNotify 0 +#define RRScreenChangeNotifyMask (1L << 0) + +#include + +_XFUNCPROTOBEGIN + +/* internal representation is private to the library */ +typedef struct _XRRScreenConfiguration XRRScreenConfiguration; + +Bool XRRQueryExtension (Display *dpy, + int *event_base_return, + int *error_base_return); + +void XRRSelectInput(Display *dpy, Window window, int mask); + + +/* + * intended to take RRScreenChangeNotify, or + * ConfigureNotify (on the root window) + * returns 1 if it is an event type it understands, 0 if not + */ +int XRRUpdateConfiguration(XEvent *event); +_XFUNCPROTOEND + +#endif /* _XRANDR_H_ */ -- cgit v1.2.3 From 7610c0f19e01f2815966b1e333d65c8ab748bd1f Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Wed, 13 Dec 2017 23:43:41 +0100 Subject: debian/*: Adopt from official Debian package where appropriate. --- debian/control | 2 +- debian/copyright | 717 ++--- debian/copyright.in | 3157 +++++++++----------- debian/libnx-x11-6.symbols | 40 +- debian/libnx-x11-dev.install | 6 +- debian/libxcomp-dev.install | 8 +- debian/libxcomp3.docs | 2 +- debian/libxcompshad-dev.install | 4 +- debian/libxcompshad-dev.links | 1 - debian/nx-x11proto-composite-dev.install | 2 +- debian/nx-x11proto-damage-dev.install | 2 +- debian/nx-x11proto-render-dev.install | 1 - debian/nx-x11proto-scrnsaver-dev.install | 2 +- debian/nx-x11proto-xext-dev.install | 6 +- debian/nx-x11proto-xfixes-dev.install | 3 +- debian/nxagent.install | 8 +- .../016_nx-X11_install-location.debian.patch | 45 - ...erver-xext_set-securitypolicy-path.debian.patch | 19 - ...sts-and-genericevent-extensions.full+lite.patch | 1870 ------------ debian/patches/series | 5 +- debian/rules | 47 + debian/watch | 4 +- 22 files changed, 1921 insertions(+), 4030 deletions(-) delete mode 100644 debian/patches/016_nx-X11_install-location.debian.patch delete mode 100644 debian/patches/102_xserver-xext_set-securitypolicy-path.debian.patch delete mode 100644 debian/patches/401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch (limited to 'debian/libxcompshad-dev.install') diff --git a/debian/control b/debian/control index e8b9fd906..0ab6dffe3 100644 --- a/debian/control +++ b/debian/control @@ -69,10 +69,10 @@ Package: libnx-x11-6 Architecture: any Multi-Arch: same Depends: + libx11-data, libxcomp3 (= ${binary:Version}), nx-x11-common (<< ${source:Version}.1), nx-x11-common (>= ${source:Version}), - libx11-data, ${misc:Depends}, ${shlibs:Depends} Breaks: diff --git a/debian/copyright b/debian/copyright index f6206283f..a8a0acdbb 100644 --- a/debian/copyright +++ b/debian/copyright @@ -399,304 +399,304 @@ Comment: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Files: nx-X11/extras/Mesa_6.4.2/include/GL/gl.h - nx-X11/extras/Mesa_6.4.2/include/GL/osmesa.h - nx-X11/extras/Mesa_6.4.2/include/GL/xmesa.h - nx-X11/extras/Mesa_6.4.2/src/mesa/array_cache/ac_context.c - nx-X11/extras/Mesa_6.4.2/src/mesa/array_cache/ac_context.h - nx-X11/extras/Mesa_6.4.2/src/mesa/array_cache/ac_import.c - nx-X11/extras/Mesa_6.4.2/src/mesa/array_cache/acache.h - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/common/driverfuncs.c - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/common/driverfuncs.h - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/x11/glxheader.h - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/x11/xm_api.c - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/x11/xm_buffer.c - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/x11/xm_dd.c - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/x11/xm_line.c - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/x11/xm_span.c - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/x11/xm_tri.c - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/x11/xmesaP.h - nx-X11/extras/Mesa_6.4.2/src/mesa/glapi/glapi.c - nx-X11/extras/Mesa_6.4.2/src/mesa/glapi/glapi.h - nx-X11/extras/Mesa_6.4.2/src/mesa/glapi/glthread.c - nx-X11/extras/Mesa_6.4.2/src/mesa/glapi/glthread.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/accum.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/accum.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/api_arrayelt.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/api_arrayelt.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/api_eval.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/api_loopback.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/api_loopback.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/api_noop.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/api_noop.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/api_validate.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/api_validate.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/attrib.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/attrib.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/blend.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/blend.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/bufferobj.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/bufferobj.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/buffers.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/buffers.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/clip.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/clip.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/colormac.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/colortab.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/colortab.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/config.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/context.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/context.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/convolve.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/convolve.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/dd.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/debug.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/debug.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/depth.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/depth.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/dispatch.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/dlist.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/dlist.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/drawpix.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/drawpix.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/enable.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/enable.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/enums.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/enums.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/eval.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/eval.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/execmem.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/extensions.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/extensions.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/fbobject.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/fbobject.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/feedback.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/feedback.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/fog.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/fog.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/framebuffer.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/framebuffer.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/get.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/getstring.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/glheader.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/hash.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/hash.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/hint.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/hint.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/histogram.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/histogram.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/image.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/image.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/imports.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/imports.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/light.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/light.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/lines.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/lines.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/macros.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/matrix.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/matrix.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/mtypes.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/occlude.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/occlude.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/pixel.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/pixel.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/points.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/points.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/polygon.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/polygon.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/rastpos.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/rastpos.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/renderbuffer.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/renderbuffer.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/state.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/state.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/stencil.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/stencil.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texcompress.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texcompress.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texcompress_fxt1.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texcompress_s3tc.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texenvprogram.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texformat.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texformat.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texformat_tmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/teximage.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/teximage.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texobj.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texobj.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texstate.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texstate.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texstore.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texstore.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/varray.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/varray.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/version.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/vtxfmt.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/vtxfmt.h - nx-X11/extras/Mesa_6.4.2/src/mesa/main/vtxfmt_tmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_clip_tmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_copy_tmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_debug.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_debug_clip.c - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_debug_norm.c - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_debug_util.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_debug_xform.c - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_dotprod_tmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_eval.c - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_eval.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_matrix.c - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_matrix.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_norm_tmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_trans_tmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_translate.c - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_translate.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_vector.c - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_vector.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_xform.c - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_xform.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/m_xform_tmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/math/mathmod.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/arbfragparse.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/arbfragparse.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/arbprogparse.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/arbprogparse.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/arbprogram.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/arbprogram.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/arbvertparse.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/arbvertparse.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/grammar/grammar.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/grammar/grammar.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/grammar/grammar_mesa.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/grammar/grammar_mesa.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/nvfragparse.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/nvfragparse.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/nvfragprog.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/nvprogram.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/nvprogram.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/nvvertexec.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/nvvertexec.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/nvvertparse.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/nvvertparse.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/nvvertprog.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/program.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/program.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/shaderobjects.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/shaderobjects.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/shaderobjects_3dlabs.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/shaderobjects_3dlabs.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_assemble.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_assemble.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_assemble_assignment.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_assemble_assignment.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_assemble_conditional.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_assemble_conditional.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_assemble_constructor.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_assemble_constructor.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_assemble_typeinfo.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_assemble_typeinfo.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_compile.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_compile.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_execute.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_execute.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_preprocess.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_preprocess.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_storage.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_storage.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_utility.c - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/slang_utility.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/traverse_wrap.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_aaline.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_aaline.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_aalinetemp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_aatriangle.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_aatriangle.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_aatritemp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_accum.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_accum.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_alpha.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_alpha.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_bitmap.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_blend.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_blend.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_buffers.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_context.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_context.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_copypix.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_depth.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_depth.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_drawpix.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_drawpix.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_feedback.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_feedback.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_fog.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_fog.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_imaging.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_lines.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_lines.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_linetemp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_logic.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_logic.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_masking.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_masking.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_nvfragprog.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_nvfragprog.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_pixeltex.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_pixeltex.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_points.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_points.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_pointtemp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_readpix.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_span.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_span.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_spantemp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_stencil.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_stencil.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_texstore.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_texture.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_texture.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_triangle.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_triangle.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_trispan.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_tritemp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_zoom.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_zoom.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/swrast.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast_setup/ss_context.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast_setup/ss_context.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast_setup/ss_triangle.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast_setup/ss_triangle.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast_setup/ss_tritmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast_setup/swrast_setup.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_array_api.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_array_api.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_array_import.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_array_import.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_context.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_context.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_pipeline.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_pipeline.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_save_loopback.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_save_playback.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_arbprogram.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_arbprogram.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_arbprogram_sse.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_cliptmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_cull.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_fog.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_light.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_lighttmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_normals.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_points.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_program.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_render.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_rendertmp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_texgen.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_texmat.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vb_vertex.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vtx_eval.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vtx_exec.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/tnl.h +Files: nx-X11/extras/Mesa/include/GL/gl.h + nx-X11/extras/Mesa/include/GL/osmesa.h + nx-X11/extras/Mesa/include/GL/xmesa.h + nx-X11/extras/Mesa/src/mesa/array_cache/ac_context.c + nx-X11/extras/Mesa/src/mesa/array_cache/ac_context.h + nx-X11/extras/Mesa/src/mesa/array_cache/ac_import.c + nx-X11/extras/Mesa/src/mesa/array_cache/acache.h + nx-X11/extras/Mesa/src/mesa/drivers/common/driverfuncs.c + nx-X11/extras/Mesa/src/mesa/drivers/common/driverfuncs.h + nx-X11/extras/Mesa/src/mesa/drivers/x11/glxheader.h + nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_api.c + nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_buffer.c + nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_dd.c + nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_line.c + nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_span.c + nx-X11/extras/Mesa/src/mesa/drivers/x11/xm_tri.c + nx-X11/extras/Mesa/src/mesa/drivers/x11/xmesaP.h + nx-X11/extras/Mesa/src/mesa/glapi/glapi.c + nx-X11/extras/Mesa/src/mesa/glapi/glapi.h + nx-X11/extras/Mesa/src/mesa/glapi/glthread.c + nx-X11/extras/Mesa/src/mesa/glapi/glthread.h + nx-X11/extras/Mesa/src/mesa/main/accum.c + nx-X11/extras/Mesa/src/mesa/main/accum.h + nx-X11/extras/Mesa/src/mesa/main/api_arrayelt.c + nx-X11/extras/Mesa/src/mesa/main/api_arrayelt.h + nx-X11/extras/Mesa/src/mesa/main/api_eval.h + nx-X11/extras/Mesa/src/mesa/main/api_loopback.c + nx-X11/extras/Mesa/src/mesa/main/api_loopback.h + nx-X11/extras/Mesa/src/mesa/main/api_noop.c + nx-X11/extras/Mesa/src/mesa/main/api_noop.h + nx-X11/extras/Mesa/src/mesa/main/api_validate.c + nx-X11/extras/Mesa/src/mesa/main/api_validate.h + nx-X11/extras/Mesa/src/mesa/main/attrib.c + nx-X11/extras/Mesa/src/mesa/main/attrib.h + nx-X11/extras/Mesa/src/mesa/main/blend.c + nx-X11/extras/Mesa/src/mesa/main/blend.h + nx-X11/extras/Mesa/src/mesa/main/bufferobj.c + nx-X11/extras/Mesa/src/mesa/main/bufferobj.h + nx-X11/extras/Mesa/src/mesa/main/buffers.c + nx-X11/extras/Mesa/src/mesa/main/buffers.h + nx-X11/extras/Mesa/src/mesa/main/clip.c + nx-X11/extras/Mesa/src/mesa/main/clip.h + nx-X11/extras/Mesa/src/mesa/main/colormac.h + nx-X11/extras/Mesa/src/mesa/main/colortab.c + nx-X11/extras/Mesa/src/mesa/main/colortab.h + nx-X11/extras/Mesa/src/mesa/main/config.h + nx-X11/extras/Mesa/src/mesa/main/context.c + nx-X11/extras/Mesa/src/mesa/main/context.h + nx-X11/extras/Mesa/src/mesa/main/convolve.c + nx-X11/extras/Mesa/src/mesa/main/convolve.h + nx-X11/extras/Mesa/src/mesa/main/dd.h + nx-X11/extras/Mesa/src/mesa/main/debug.c + nx-X11/extras/Mesa/src/mesa/main/debug.h + nx-X11/extras/Mesa/src/mesa/main/depth.c + nx-X11/extras/Mesa/src/mesa/main/depth.h + nx-X11/extras/Mesa/src/mesa/main/dispatch.c + nx-X11/extras/Mesa/src/mesa/main/dlist.c + nx-X11/extras/Mesa/src/mesa/main/dlist.h + nx-X11/extras/Mesa/src/mesa/main/drawpix.c + nx-X11/extras/Mesa/src/mesa/main/drawpix.h + nx-X11/extras/Mesa/src/mesa/main/enable.c + nx-X11/extras/Mesa/src/mesa/main/enable.h + nx-X11/extras/Mesa/src/mesa/main/enums.c + nx-X11/extras/Mesa/src/mesa/main/enums.h + nx-X11/extras/Mesa/src/mesa/main/eval.c + nx-X11/extras/Mesa/src/mesa/main/eval.h + nx-X11/extras/Mesa/src/mesa/main/execmem.c + nx-X11/extras/Mesa/src/mesa/main/extensions.c + nx-X11/extras/Mesa/src/mesa/main/extensions.h + nx-X11/extras/Mesa/src/mesa/main/fbobject.c + nx-X11/extras/Mesa/src/mesa/main/fbobject.h + nx-X11/extras/Mesa/src/mesa/main/feedback.c + nx-X11/extras/Mesa/src/mesa/main/feedback.h + nx-X11/extras/Mesa/src/mesa/main/fog.c + nx-X11/extras/Mesa/src/mesa/main/fog.h + nx-X11/extras/Mesa/src/mesa/main/framebuffer.c + nx-X11/extras/Mesa/src/mesa/main/framebuffer.h + nx-X11/extras/Mesa/src/mesa/main/get.h + nx-X11/extras/Mesa/src/mesa/main/getstring.c + nx-X11/extras/Mesa/src/mesa/main/glheader.h + nx-X11/extras/Mesa/src/mesa/main/hash.c + nx-X11/extras/Mesa/src/mesa/main/hash.h + nx-X11/extras/Mesa/src/mesa/main/hint.c + nx-X11/extras/Mesa/src/mesa/main/hint.h + nx-X11/extras/Mesa/src/mesa/main/histogram.c + nx-X11/extras/Mesa/src/mesa/main/histogram.h + nx-X11/extras/Mesa/src/mesa/main/image.c + nx-X11/extras/Mesa/src/mesa/main/image.h + nx-X11/extras/Mesa/src/mesa/main/imports.c + nx-X11/extras/Mesa/src/mesa/main/imports.h + nx-X11/extras/Mesa/src/mesa/main/light.c + nx-X11/extras/Mesa/src/mesa/main/light.h + nx-X11/extras/Mesa/src/mesa/main/lines.c + nx-X11/extras/Mesa/src/mesa/main/lines.h + nx-X11/extras/Mesa/src/mesa/main/macros.h + nx-X11/extras/Mesa/src/mesa/main/matrix.c + nx-X11/extras/Mesa/src/mesa/main/matrix.h + nx-X11/extras/Mesa/src/mesa/main/mtypes.h + nx-X11/extras/Mesa/src/mesa/main/occlude.c + nx-X11/extras/Mesa/src/mesa/main/occlude.h + nx-X11/extras/Mesa/src/mesa/main/pixel.c + nx-X11/extras/Mesa/src/mesa/main/pixel.h + nx-X11/extras/Mesa/src/mesa/main/points.c + nx-X11/extras/Mesa/src/mesa/main/points.h + nx-X11/extras/Mesa/src/mesa/main/polygon.c + nx-X11/extras/Mesa/src/mesa/main/polygon.h + nx-X11/extras/Mesa/src/mesa/main/rastpos.c + nx-X11/extras/Mesa/src/mesa/main/rastpos.h + nx-X11/extras/Mesa/src/mesa/main/renderbuffer.c + nx-X11/extras/Mesa/src/mesa/main/renderbuffer.h + nx-X11/extras/Mesa/src/mesa/main/state.c + nx-X11/extras/Mesa/src/mesa/main/state.h + nx-X11/extras/Mesa/src/mesa/main/stencil.c + nx-X11/extras/Mesa/src/mesa/main/stencil.h + nx-X11/extras/Mesa/src/mesa/main/texcompress.c + nx-X11/extras/Mesa/src/mesa/main/texcompress.h + nx-X11/extras/Mesa/src/mesa/main/texcompress_fxt1.c + nx-X11/extras/Mesa/src/mesa/main/texcompress_s3tc.c + nx-X11/extras/Mesa/src/mesa/main/texenvprogram.h + nx-X11/extras/Mesa/src/mesa/main/texformat.c + nx-X11/extras/Mesa/src/mesa/main/texformat.h + nx-X11/extras/Mesa/src/mesa/main/texformat_tmp.h + nx-X11/extras/Mesa/src/mesa/main/teximage.c + nx-X11/extras/Mesa/src/mesa/main/teximage.h + nx-X11/extras/Mesa/src/mesa/main/texobj.c + nx-X11/extras/Mesa/src/mesa/main/texobj.h + nx-X11/extras/Mesa/src/mesa/main/texstate.c + nx-X11/extras/Mesa/src/mesa/main/texstate.h + nx-X11/extras/Mesa/src/mesa/main/texstore.c + nx-X11/extras/Mesa/src/mesa/main/texstore.h + nx-X11/extras/Mesa/src/mesa/main/varray.c + nx-X11/extras/Mesa/src/mesa/main/varray.h + nx-X11/extras/Mesa/src/mesa/main/version.h + nx-X11/extras/Mesa/src/mesa/main/vtxfmt.c + nx-X11/extras/Mesa/src/mesa/main/vtxfmt.h + nx-X11/extras/Mesa/src/mesa/main/vtxfmt_tmp.h + nx-X11/extras/Mesa/src/mesa/math/m_clip_tmp.h + nx-X11/extras/Mesa/src/mesa/math/m_copy_tmp.h + nx-X11/extras/Mesa/src/mesa/math/m_debug.h + nx-X11/extras/Mesa/src/mesa/math/m_debug_clip.c + nx-X11/extras/Mesa/src/mesa/math/m_debug_norm.c + nx-X11/extras/Mesa/src/mesa/math/m_debug_util.h + nx-X11/extras/Mesa/src/mesa/math/m_debug_xform.c + nx-X11/extras/Mesa/src/mesa/math/m_dotprod_tmp.h + nx-X11/extras/Mesa/src/mesa/math/m_eval.c + nx-X11/extras/Mesa/src/mesa/math/m_eval.h + nx-X11/extras/Mesa/src/mesa/math/m_matrix.c + nx-X11/extras/Mesa/src/mesa/math/m_matrix.h + nx-X11/extras/Mesa/src/mesa/math/m_norm_tmp.h + nx-X11/extras/Mesa/src/mesa/math/m_trans_tmp.h + nx-X11/extras/Mesa/src/mesa/math/m_translate.c + nx-X11/extras/Mesa/src/mesa/math/m_translate.h + nx-X11/extras/Mesa/src/mesa/math/m_vector.c + nx-X11/extras/Mesa/src/mesa/math/m_vector.h + nx-X11/extras/Mesa/src/mesa/math/m_xform.c + nx-X11/extras/Mesa/src/mesa/math/m_xform.h + nx-X11/extras/Mesa/src/mesa/math/m_xform_tmp.h + nx-X11/extras/Mesa/src/mesa/math/mathmod.h + nx-X11/extras/Mesa/src/mesa/shader/arbfragparse.c + nx-X11/extras/Mesa/src/mesa/shader/arbfragparse.h + nx-X11/extras/Mesa/src/mesa/shader/arbprogparse.c + nx-X11/extras/Mesa/src/mesa/shader/arbprogparse.h + nx-X11/extras/Mesa/src/mesa/shader/arbprogram.c + nx-X11/extras/Mesa/src/mesa/shader/arbprogram.h + nx-X11/extras/Mesa/src/mesa/shader/arbvertparse.c + nx-X11/extras/Mesa/src/mesa/shader/arbvertparse.h + nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar.c + nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar.h + nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_mesa.c + nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_mesa.h + nx-X11/extras/Mesa/src/mesa/shader/nvfragparse.c + nx-X11/extras/Mesa/src/mesa/shader/nvfragparse.h + nx-X11/extras/Mesa/src/mesa/shader/nvfragprog.h + nx-X11/extras/Mesa/src/mesa/shader/nvprogram.c + nx-X11/extras/Mesa/src/mesa/shader/nvprogram.h + nx-X11/extras/Mesa/src/mesa/shader/nvvertexec.c + nx-X11/extras/Mesa/src/mesa/shader/nvvertexec.h + nx-X11/extras/Mesa/src/mesa/shader/nvvertparse.c + nx-X11/extras/Mesa/src/mesa/shader/nvvertparse.h + nx-X11/extras/Mesa/src/mesa/shader/nvvertprog.h + nx-X11/extras/Mesa/src/mesa/shader/program.c + nx-X11/extras/Mesa/src/mesa/shader/program.h + nx-X11/extras/Mesa/src/mesa/shader/shaderobjects.c + nx-X11/extras/Mesa/src/mesa/shader/shaderobjects.h + nx-X11/extras/Mesa/src/mesa/shader/shaderobjects_3dlabs.c + nx-X11/extras/Mesa/src/mesa/shader/shaderobjects_3dlabs.h + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_assemble.c + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_assemble.h + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_assemble_assignment.c + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_assemble_assignment.h + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_assemble_conditional.c + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_assemble_conditional.h + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_assemble_constructor.c + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_assemble_constructor.h + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_assemble_typeinfo.c + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_assemble_typeinfo.h + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_compile.c + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_compile.h + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_execute.c + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_execute.h + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_preprocess.c + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_preprocess.h + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_storage.c + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_storage.h + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_utility.c + nx-X11/extras/Mesa/src/mesa/shader/slang/slang_utility.h + nx-X11/extras/Mesa/src/mesa/shader/slang/traverse_wrap.h + nx-X11/extras/Mesa/src/mesa/swrast/s_aaline.c + nx-X11/extras/Mesa/src/mesa/swrast/s_aaline.h + nx-X11/extras/Mesa/src/mesa/swrast/s_aalinetemp.h + nx-X11/extras/Mesa/src/mesa/swrast/s_aatriangle.c + nx-X11/extras/Mesa/src/mesa/swrast/s_aatriangle.h + nx-X11/extras/Mesa/src/mesa/swrast/s_aatritemp.h + nx-X11/extras/Mesa/src/mesa/swrast/s_accum.c + nx-X11/extras/Mesa/src/mesa/swrast/s_accum.h + nx-X11/extras/Mesa/src/mesa/swrast/s_alpha.c + nx-X11/extras/Mesa/src/mesa/swrast/s_alpha.h + nx-X11/extras/Mesa/src/mesa/swrast/s_bitmap.c + nx-X11/extras/Mesa/src/mesa/swrast/s_blend.c + nx-X11/extras/Mesa/src/mesa/swrast/s_blend.h + nx-X11/extras/Mesa/src/mesa/swrast/s_buffers.c + nx-X11/extras/Mesa/src/mesa/swrast/s_context.c + nx-X11/extras/Mesa/src/mesa/swrast/s_context.h + nx-X11/extras/Mesa/src/mesa/swrast/s_copypix.c + nx-X11/extras/Mesa/src/mesa/swrast/s_depth.c + nx-X11/extras/Mesa/src/mesa/swrast/s_depth.h + nx-X11/extras/Mesa/src/mesa/swrast/s_drawpix.c + nx-X11/extras/Mesa/src/mesa/swrast/s_drawpix.h + nx-X11/extras/Mesa/src/mesa/swrast/s_feedback.c + nx-X11/extras/Mesa/src/mesa/swrast/s_feedback.h + nx-X11/extras/Mesa/src/mesa/swrast/s_fog.c + nx-X11/extras/Mesa/src/mesa/swrast/s_fog.h + nx-X11/extras/Mesa/src/mesa/swrast/s_imaging.c + nx-X11/extras/Mesa/src/mesa/swrast/s_lines.c + nx-X11/extras/Mesa/src/mesa/swrast/s_lines.h + nx-X11/extras/Mesa/src/mesa/swrast/s_linetemp.h + nx-X11/extras/Mesa/src/mesa/swrast/s_logic.c + nx-X11/extras/Mesa/src/mesa/swrast/s_logic.h + nx-X11/extras/Mesa/src/mesa/swrast/s_masking.c + nx-X11/extras/Mesa/src/mesa/swrast/s_masking.h + nx-X11/extras/Mesa/src/mesa/swrast/s_nvfragprog.c + nx-X11/extras/Mesa/src/mesa/swrast/s_nvfragprog.h + nx-X11/extras/Mesa/src/mesa/swrast/s_pixeltex.c + nx-X11/extras/Mesa/src/mesa/swrast/s_pixeltex.h + nx-X11/extras/Mesa/src/mesa/swrast/s_points.c + nx-X11/extras/Mesa/src/mesa/swrast/s_points.h + nx-X11/extras/Mesa/src/mesa/swrast/s_pointtemp.h + nx-X11/extras/Mesa/src/mesa/swrast/s_readpix.c + nx-X11/extras/Mesa/src/mesa/swrast/s_span.c + nx-X11/extras/Mesa/src/mesa/swrast/s_span.h + nx-X11/extras/Mesa/src/mesa/swrast/s_spantemp.h + nx-X11/extras/Mesa/src/mesa/swrast/s_stencil.c + nx-X11/extras/Mesa/src/mesa/swrast/s_stencil.h + nx-X11/extras/Mesa/src/mesa/swrast/s_texstore.c + nx-X11/extras/Mesa/src/mesa/swrast/s_texture.c + nx-X11/extras/Mesa/src/mesa/swrast/s_texture.h + nx-X11/extras/Mesa/src/mesa/swrast/s_triangle.c + nx-X11/extras/Mesa/src/mesa/swrast/s_triangle.h + nx-X11/extras/Mesa/src/mesa/swrast/s_trispan.h + nx-X11/extras/Mesa/src/mesa/swrast/s_tritemp.h + nx-X11/extras/Mesa/src/mesa/swrast/s_zoom.c + nx-X11/extras/Mesa/src/mesa/swrast/s_zoom.h + nx-X11/extras/Mesa/src/mesa/swrast/swrast.h + nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_context.c + nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_context.h + nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_triangle.c + nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_triangle.h + nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_tritmp.h + nx-X11/extras/Mesa/src/mesa/swrast_setup/swrast_setup.h + nx-X11/extras/Mesa/src/mesa/tnl/t_array_api.c + nx-X11/extras/Mesa/src/mesa/tnl/t_array_api.h + nx-X11/extras/Mesa/src/mesa/tnl/t_array_import.c + nx-X11/extras/Mesa/src/mesa/tnl/t_array_import.h + nx-X11/extras/Mesa/src/mesa/tnl/t_context.c + nx-X11/extras/Mesa/src/mesa/tnl/t_context.h + nx-X11/extras/Mesa/src/mesa/tnl/t_pipeline.c + nx-X11/extras/Mesa/src/mesa/tnl/t_pipeline.h + nx-X11/extras/Mesa/src/mesa/tnl/t_save_loopback.c + nx-X11/extras/Mesa/src/mesa/tnl/t_save_playback.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_arbprogram.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_arbprogram.h + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_arbprogram_sse.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_cliptmp.h + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_cull.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_fog.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_light.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_lighttmp.h + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_normals.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_points.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_program.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_render.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_rendertmp.h + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_texgen.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_texmat.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vb_vertex.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_eval.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_exec.c + nx-X11/extras/Mesa/src/mesa/tnl/tnl.h Copyright: 1999-2001, Brian Paul 1999-2002, Brian Paul 1999-2003, Brian Paul @@ -1040,8 +1040,7 @@ Copyright: 2012, Mike Gabriel 2016, Mike Gabriel License: GPL-2+ -Files: nx-X11/extras/README.Mesa.patches - nx-X11/programs/Xserver/GL/include/GL/xf86glx.h +Files: nx-X11/programs/Xserver/GL/include/GL/xf86glx.h nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h nx-X11/lib/nx-x11.pc.in Copyright: @@ -1056,22 +1055,23 @@ Files: replace.sh Copyright: 2013, Jan Engelhardt License: GPL-2+ -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/main/get.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texrender.c - nx-X11/extras/Mesa_6.4.2/src/mesa/main/texrender.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/arbprogram_syn.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/grammar/grammar_syn.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/library/slang_common_builtin_gc.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/library/slang_common_builtin_gc_bin.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/library/slang_core_gc.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/library/slang_core_gc_bin.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/library/slang_fragment_builtin_gc_bin.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/library/slang_shader_syn.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/library/slang_version_syn.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h - nx-X11/extras/Mesa_6.4.2/src/mesa/shader/slang/library/slang_vertex_builtin_gc_bin.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vtx_x86_gcc.S +Files: nx-X11/extras/Mesa/src/mesa/main/get.c + nx-X11/extras/Mesa/src/mesa/main/texrender.c + nx-X11/extras/Mesa/src/mesa/main/texrender.h + nx-X11/extras/Mesa/src/mesa/shader/arbprogram_syn.h + nx-X11/extras/Mesa/src/mesa/shader/grammar/grammar_syn.h + nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_common_builtin_gc.h + nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_common_builtin_gc_bin.h + nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_core_gc.h + nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_core_gc_bin.h + nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h + nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_fragment_builtin_gc_bin.h + nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_shader_syn.h + nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_version_syn.h + nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h + nx-X11/extras/Mesa/src/mesa/shader/slang/library/slang_vertex_builtin_gc_bin.h + nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_x86_gcc.S + nx-X11/extras/Mesa/src/mesa/main/KNOWN_BUGS Copyright: *No copyright* License: Expat Comment: @@ -1617,10 +1617,10 @@ Files: nx-X11/lib/src/xcms/HVC.c Copyright: 1990, 1991, Tektronix, Inc License: MIT~Tektronix~3-clause -Files: nx-X11/extras/Mesa_6.4.2/include/GL/glext.h - nx-X11/extras/Mesa_6.4.2/include/GL/glxext.h - nx-X11/extras/Mesa_6.4.2/include/GL/internal/glcore.h - nx-X11/extras/Mesa_6.4.2/src/glx/x11/compsize.c +Files: nx-X11/extras/Mesa/include/GL/glext.h + nx-X11/extras/Mesa/include/GL/glxext.h + nx-X11/extras/Mesa/include/GL/internal/glcore.h + nx-X11/extras/Mesa/src/glx/x11/compsize.c nx-X11/include/GL/glx.h nx-X11/include/GL/glxmd.h nx-X11/include/GL/glxproto.h @@ -2064,7 +2064,7 @@ Files: nx-X11/include/extensions/Xdbeproto.h Copyright: 1994-1995, Hewlett-Packard Company License: Expat~NoAdvert -Files: nx-X11/extras/Mesa_6.4.2/include/GL/xmesa_xf86.h +Files: nx-X11/extras/Mesa/include/GL/xmesa_xf86.h nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h @@ -2072,12 +2072,12 @@ Files: nx-X11/extras/Mesa_6.4.2/include/GL/xmesa_xf86.h Copyright: 1998-1999, Precision Insight, Inc., Cedar Park, Texas License: Expat -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_save_api.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_save_api.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vtx_api.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vtx_api.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vtx_generic.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vtx_x86.c +Files: nx-X11/extras/Mesa/src/mesa/tnl/t_save_api.c + nx-X11/extras/Mesa/src/mesa/tnl/t_save_api.h + nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_api.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_api.h + nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_generic.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_x86.c Copyright: 2002, Tungsten Graphics Inc., Cedar Park, Texas 2004, Tungsten Graphics Inc., Cedar Park, Texas License: Expat @@ -2126,10 +2126,10 @@ Copyright: 1991-1994, FUJITSU LIMITED 1993, Digital Equipment Corporation License: MIT~X11 -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vertex.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vertex.h - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vertex_generic.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vertex_sse.c +Files: nx-X11/extras/Mesa/src/mesa/tnl/t_vertex.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vertex.h + nx-X11/extras/Mesa/src/mesa/tnl/t_vertex_generic.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vertex_sse.c Copyright: 2003, Tungsten Graphics, inc License: Expat @@ -2147,17 +2147,17 @@ Files: nx-X11/programs/Xserver/miext/cw/cw.c Copyright: 2004, Eric Anholt License: MIT~X11 -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/glapi/glapitable.h - nx-X11/extras/Mesa_6.4.2/src/mesa/glapi/glapitemp.h - nx-X11/extras/Mesa_6.4.2/src/mesa/glapi/glprocs.h +Files: nx-X11/extras/Mesa/src/mesa/glapi/glapitable.h + nx-X11/extras/Mesa/src/mesa/glapi/glapitemp.h + nx-X11/extras/Mesa/src/mesa/glapi/glprocs.h Copyright: 1999-2001, Brian Paul 1999-2003, Brian Paul IBM Corporation 2004 License: Expat -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/shader/atifragshader.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_atifragshader.c - nx-X11/extras/Mesa_6.4.2/src/mesa/swrast/s_atifragshader.h +Files: nx-X11/extras/Mesa/src/mesa/shader/atifragshader.c + nx-X11/extras/Mesa/src/mesa/swrast/s_atifragshader.c + nx-X11/extras/Mesa/src/mesa/swrast/s_atifragshader.h Copyright: 1999-2003, David Airlie 2004, David Airlie License: Expat @@ -2270,10 +2270,10 @@ Comment: as Expat. Later contributions by FUJITSU LIMITED and Sony Corporation have been licensed under MIT~X11. -Files: nx-X11/extras/Mesa_6.4.2/src/glx/x11/indirect_size.c - nx-X11/extras/Mesa_6.4.2/src/glx/x11/indirect_size.h - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/dri/common/glcontextmodes.c - nx-X11/extras/Mesa_6.4.2/src/mesa/drivers/dri/common/glcontextmodes.h +Files: nx-X11/extras/Mesa/src/glx/x11/indirect_size.c + nx-X11/extras/Mesa/src/glx/x11/indirect_size.h + nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c + nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.h Copyright: 2003, IBM Corporation IBM Corporation 2004 License: Expat @@ -2294,8 +2294,8 @@ Copyright: 2000, The XFree86 Project, Inc. 2001, The XFree86 Project, Inc. License: Expat~NoAdvert -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vp_build.c - nx-X11/extras/Mesa_6.4.2/src/mesa/tnl/t_vp_build.h +Files: nx-X11/extras/Mesa/src/mesa/tnl/t_vp_build.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vp_build.h Copyright: 2005, Tungsten Graphics License: Expat @@ -2447,12 +2447,12 @@ Files: nx-X11/programs/Xserver/os/xprintf.c Copyright: 2004, Alexander Gottwald License: Expat -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/glapi/glapioffsets.h +Files: nx-X11/extras/Mesa/src/mesa/glapi/glapioffsets.h Copyright: 1999-2001, Brian Paul IBM Corporation 2004, License: Expat -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/main/simple_list.h +Files: nx-X11/extras/Mesa/src/mesa/main/simple_list.h Copyright: 1997, Keith Whitwell 1999-2001, Brian Paul License: Expat @@ -2492,7 +2492,7 @@ Files: nx-X11/programs/Xserver/hw/nxagent/X11/include/xpm_nxagent.h Copyright: 1989-1995, GROUPE BULL License: Expat~NoAdvert -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/glapi/dispatch.h +Files: nx-X11/extras/Mesa/src/mesa/glapi/dispatch.h Copyright: 2005, IBM Corporation License: Expat @@ -2507,7 +2507,7 @@ Comment: Later contributions by Oracle and/or its affiliates and Red Hat, Inc. have been licensed under Expat. -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/main/mm.h +Files: nx-X11/extras/Mesa/src/mesa/main/mm.h Copyright: 1999, Keith Whitwell License: Expat @@ -2552,11 +2552,11 @@ Files: nx-X11/programs/Xserver/composite/compositeext.h Copyright: 2009, NVIDIA Corporation License: Expat -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/main/texenvprogram.c +Files: nx-X11/extras/Mesa/src/mesa/main/texenvprogram.c Copyright: 2003, Tungsten Graphics, Inc., Cedar Park, Texas License: Expat -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/main/mm.c +Files: nx-X11/extras/Mesa/src/mesa/main/mm.c Copyright: 1999, Wittawat Yamwong License: Expat @@ -2639,7 +2639,7 @@ Comment: Contributions by Data General Corporation and OMRON Corporation have been licnsed under MIT~X11. -Files: nx-X11/extras/Mesa_6.4.2/src/mesa/shader/atifragshader.h +Files: nx-X11/extras/Mesa/src/mesa/shader/atifragshader.h Copyright: 2004, David Airlie License: Expat Comment: @@ -2885,18 +2885,26 @@ Copyright: Mike Gabriel License: GPL-3+ Files: m4/nx-macros.m4 + nx-X11/lib/m4/nx-macros.m4 + nxcomp/m4/nx-macros.m4 + nxcompshad/m4/nx-macros.m4 + nxproxy/m4/nx-macros.m4 Copyright: 2005, 2006, Oracle and/or its affiliates 2017, Mike Gabriel License: Expat Files: m4/nx-xtrans.m4 + nx-X11/lib/m4/nx-xtrans.m4 Copyright: 2005, 2006, Oracle and/or its affiliates License: Expat Files: ChangeLog Makefile - README.md + doc/README.NX-development VERSION + nxcomp/VERSION + nxcompshad/VERSION + nxproxy/VERSION doc/libNX_X11/symbols/libNX_X11::symbol-usage_internally.txt doc/libNX_X11/symbols/libNX_X11::symbol-usage_nxagent.txt doc/libNX_X11/symbols/libNX_X11::symbol-usage_nxcompext.txt @@ -2957,7 +2965,7 @@ Comment: . Contributions by Daniel Stone have been licensed under MIT~X11. -Files: nx-X11/extras/Mesa.patches_6.4.2/* +Files: nx-X11/extras/Mesa.patches/* Copyright: 2017, Mike Gabriel */ 2017, Mihai Moldovan 2017, Ulrich Sibiller @@ -3003,11 +3011,6 @@ Copyright: 2011-2016, Mike Gabriel 2015-2016, Mihai Moldovan License: GPL-2 or GPL-2+ or GPL-3+ or Expat or Expat~NoAdvert or MIT~OpenGroup or MIT~X11 or MIT~Tektronix or MIT~Tektronix~3-clause or MIT~OldStyle or MIT~Adobe or MIT~VeryOldStyle~UniOfCalifornia or MIT~VeryOldStyle~NCD or MIT~ISC or SGI-1.1 or GLX-1.0 or Zlib or XFree86 or BSD-1-clause -Files: nx-libs.spec -Copyright: 2011-2017, Mike Gabriel - 2015-2017, Mihai Moldovan -License: GPL-2 or GPL-2+ or GPL-3+ or Expat or Expat~NoAdvert or MIT~OpenGroup or MIT~X11 or MIT~Tektronix or MIT~Tektronix~3-clause or MIT~OldStyle or MIT~Adobe or MIT~VeryOldStyle~UniOfCalifornia or MIT~VeryOldStyle~NCD or MIT~ISC or SGI-1.1 or GLX-1.0 or Zlib or XFree86 or BSD-1-clause - License: GPL-2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free diff --git a/debian/copyright.in b/debian/copyright.in index 98dfbdc9b..e4237628d 100644 --- a/debian/copyright.in +++ b/debian/copyright.in @@ -4,13 +4,506 @@ Upstream-Contact: FIXME Source: FIXME Disclaimer: Autogenerated by CDBS +Files: nx-X11/include/DECkeysym.h + nx-X11/include/HPkeysym.h + nx-X11/include/X.h + nx-X11/include/XWDFile.h + nx-X11/include/Xalloca.h + nx-X11/include/Xauth.h + nx-X11/include/Xfuncproto.h + nx-X11/include/Xfuncs.h + nx-X11/include/Xmd.h + nx-X11/include/Xos.h + nx-X11/include/Xos_r.h + nx-X11/include/Xosdefs.h + nx-X11/include/Xproto.h + nx-X11/include/Xprotostr.h + nx-X11/include/Xthreads.h + nx-X11/include/Xwindows.h + nx-X11/include/Xwinsock.h + nx-X11/include/extensions/XI.h + nx-X11/include/extensions/XIproto.h + nx-X11/include/extensions/bigreqstr.h + nx-X11/include/extensions/security.h + nx-X11/include/extensions/securstr.h + nx-X11/include/extensions/sync.h + nx-X11/include/extensions/syncstr.h + nx-X11/include/extensions/xcmiscstr.h + nx-X11/include/extensions/xtestconst.h + nx-X11/include/extensions/xteststr.h + nx-X11/include/keysym.h + nx-X11/include/keysymdef.h + nx-X11/lib/include/X11/Xlib.h + nx-X11/lib/include/X11/Xlocale.h + nx-X11/lib/include/X11/Xregion.h + nx-X11/lib/include/X11/Xresource.h + nx-X11/lib/include/X11/Xutil.h + nx-X11/lib/include/X11/cursorfont.h + nx-X11/lib/modules/im/ximcp/imThaiFlt.c + nx-X11/lib/src/AllCells.c + nx-X11/lib/src/AllPlanes.c + nx-X11/lib/src/AllowEv.c + nx-X11/lib/src/AuDispose.c + nx-X11/lib/src/AuFileName.c + nx-X11/lib/src/AuGetBest.c + nx-X11/lib/src/AuRead.c + nx-X11/lib/src/AutoRep.c + nx-X11/lib/src/Backgnd.c + nx-X11/lib/src/BdrWidth.c + nx-X11/lib/src/Bell.c + nx-X11/lib/src/Border.c + nx-X11/lib/src/ChAccCon.c + nx-X11/lib/src/ChActPGb.c + nx-X11/lib/src/ChClMode.c + nx-X11/lib/src/ChCmap.c + nx-X11/lib/src/ChGC.c + nx-X11/lib/src/ChKeyCon.c + nx-X11/lib/src/ChPntCon.c + nx-X11/lib/src/ChProp.c + nx-X11/lib/src/ChSaveSet.c + nx-X11/lib/src/ChWAttrs.c + nx-X11/lib/src/ChWindow.c + nx-X11/lib/src/ChkIfEv.c + nx-X11/lib/src/ChkMaskEv.c + nx-X11/lib/src/ChkTypEv.c + nx-X11/lib/src/ChkTypWEv.c + nx-X11/lib/src/ChkWinEv.c + nx-X11/lib/src/CirWin.c + nx-X11/lib/src/CirWinDn.c + nx-X11/lib/src/CirWinUp.c + nx-X11/lib/src/ClDisplay.c + nx-X11/lib/src/Clear.c + nx-X11/lib/src/ClearArea.c + nx-X11/lib/src/ConfWind.c + nx-X11/lib/src/ConvSel.c + nx-X11/lib/src/CopyArea.c + nx-X11/lib/src/CopyCmap.c + nx-X11/lib/src/CopyGC.c + nx-X11/lib/src/CopyPlane.c + nx-X11/lib/src/CrBFData.c + nx-X11/lib/src/CrCmap.c + nx-X11/lib/src/CrCursor.c + nx-X11/lib/src/CrGC.c + nx-X11/lib/src/CrGlCur.c + nx-X11/lib/src/CrPFBData.c + nx-X11/lib/src/CrPixmap.c + nx-X11/lib/src/CrWindow.c + nx-X11/lib/src/Cursor.c + nx-X11/lib/src/DefCursor.c + nx-X11/lib/src/DelProp.c + nx-X11/lib/src/Depths.c + nx-X11/lib/src/DestSubs.c + nx-X11/lib/src/DestWind.c + nx-X11/lib/src/DisName.c + nx-X11/lib/src/DrArc.c + nx-X11/lib/src/DrArcs.c + nx-X11/lib/src/DrLine.c + nx-X11/lib/src/DrLines.c + nx-X11/lib/src/DrPoint.c + nx-X11/lib/src/DrPoints.c + nx-X11/lib/src/DrRect.c + nx-X11/lib/src/DrRects.c + nx-X11/lib/src/DrSegs.c + nx-X11/lib/src/ErrDes.c + nx-X11/lib/src/ErrHndlr.c + nx-X11/lib/src/EvToWire.c + nx-X11/lib/src/FSSaver.c + nx-X11/lib/src/FetchName.c + nx-X11/lib/src/FillArc.c + nx-X11/lib/src/FillArcs.c + nx-X11/lib/src/FillPoly.c + nx-X11/lib/src/FillRct.c + nx-X11/lib/src/FillRcts.c + nx-X11/lib/src/Flush.c + nx-X11/lib/src/FontInfo.c + nx-X11/lib/src/FontNames.c + nx-X11/lib/src/FreeCmap.c + nx-X11/lib/src/FreeCols.c + nx-X11/lib/src/FreeCurs.c + nx-X11/lib/src/FreeEData.c + nx-X11/lib/src/FreeGC.c + nx-X11/lib/src/FreePix.c + nx-X11/lib/src/GCMisc.c + nx-X11/lib/src/Geom.c + nx-X11/lib/src/GetAtomNm.c + nx-X11/lib/src/GetColor.c + nx-X11/lib/src/GetDflt.c + nx-X11/lib/src/GetFPath.c + nx-X11/lib/src/GetFProp.c + nx-X11/lib/src/GetGCVals.c + nx-X11/lib/src/GetGeom.c + nx-X11/lib/src/GetHColor.c + nx-X11/lib/src/GetHints.c + nx-X11/lib/src/GetIFocus.c + nx-X11/lib/src/GetImage.c + nx-X11/lib/src/GetKCnt.c + nx-X11/lib/src/GetMoEv.c + nx-X11/lib/src/GetPCnt.c + nx-X11/lib/src/GetPntMap.c + nx-X11/lib/src/GetProp.c + nx-X11/lib/src/GetRGBCMap.c + nx-X11/lib/src/GetSOwner.c + nx-X11/lib/src/GetSSaver.c + nx-X11/lib/src/GetStCmap.c + nx-X11/lib/src/GetWAttrs.c + nx-X11/lib/src/GetWMCMapW.c + nx-X11/lib/src/GetWMProto.c + nx-X11/lib/src/GrButton.c + nx-X11/lib/src/GrKey.c + nx-X11/lib/src/GrKeybd.c + nx-X11/lib/src/GrPointer.c + nx-X11/lib/src/GrServer.c + nx-X11/lib/src/IfEvent.c + nx-X11/lib/src/ImText.c + nx-X11/lib/src/ImText16.c + nx-X11/lib/src/ImUtil.c + nx-X11/lib/src/InitExt.c + nx-X11/lib/src/InsCmap.c + nx-X11/lib/src/IntAtom.c + nx-X11/lib/src/KeyBind.c + nx-X11/lib/src/KeysymStr.c + nx-X11/lib/src/KillCl.c + nx-X11/lib/src/LiICmaps.c + nx-X11/lib/src/LiProps.c + nx-X11/lib/src/ListExt.c + nx-X11/lib/src/LoadFont.c + nx-X11/lib/src/LockDis.c + nx-X11/lib/src/LookupCol.c + nx-X11/lib/src/LowerWin.c + nx-X11/lib/src/Macros.c + nx-X11/lib/src/MapRaised.c + nx-X11/lib/src/MapSubs.c + nx-X11/lib/src/MapWindow.c + nx-X11/lib/src/MaskEvent.c + nx-X11/lib/src/Misc.c + nx-X11/lib/src/ModMap.c + nx-X11/lib/src/MoveWin.c + nx-X11/lib/src/NextEvent.c + nx-X11/lib/src/ParseCmd.c + nx-X11/lib/src/ParseCol.c + nx-X11/lib/src/ParseGeom.c + nx-X11/lib/src/PeekEvent.c + nx-X11/lib/src/PeekIfEv.c + nx-X11/lib/src/Pending.c + nx-X11/lib/src/PixFormats.c + nx-X11/lib/src/PmapBgnd.c + nx-X11/lib/src/PmapBord.c + nx-X11/lib/src/PolyReg.c + nx-X11/lib/src/PolyTxt.c + nx-X11/lib/src/PolyTxt16.c + nx-X11/lib/src/PropAlloc.c + nx-X11/lib/src/PutBEvent.c + nx-X11/lib/src/PutImage.c + nx-X11/lib/src/QuBest.c + nx-X11/lib/src/QuColor.c + nx-X11/lib/src/QuColors.c + nx-X11/lib/src/QuCurShp.c + nx-X11/lib/src/QuExt.c + nx-X11/lib/src/QuKeybd.c + nx-X11/lib/src/QuPntr.c + nx-X11/lib/src/QuStipShp.c + nx-X11/lib/src/QuTextE16.c + nx-X11/lib/src/QuTextExt.c + nx-X11/lib/src/QuTileShp.c + nx-X11/lib/src/QuTree.c + nx-X11/lib/src/RaiseWin.c + nx-X11/lib/src/RdBitF.c + nx-X11/lib/src/RecolorC.c + nx-X11/lib/src/ReconfWM.c + nx-X11/lib/src/ReconfWin.c + nx-X11/lib/src/Region.c + nx-X11/lib/src/RepWindow.c + nx-X11/lib/src/RestackWs.c + nx-X11/lib/src/RotProp.c + nx-X11/lib/src/ScrResStr.c + nx-X11/lib/src/SelInput.c + nx-X11/lib/src/SendEvent.c + nx-X11/lib/src/SetBack.c + nx-X11/lib/src/SetCRects.c + nx-X11/lib/src/SetClMask.c + nx-X11/lib/src/SetClOrig.c + nx-X11/lib/src/SetDashes.c + nx-X11/lib/src/SetFPath.c + nx-X11/lib/src/SetFont.c + nx-X11/lib/src/SetFore.c + nx-X11/lib/src/SetFunc.c + nx-X11/lib/src/SetHints.c + nx-X11/lib/src/SetIFocus.c + nx-X11/lib/src/SetLStyle.c + nx-X11/lib/src/SetPMask.c + nx-X11/lib/src/SetPntMap.c + nx-X11/lib/src/SetRGBCMap.c + nx-X11/lib/src/SetSOwner.c + nx-X11/lib/src/SetSSaver.c + nx-X11/lib/src/SetStCmap.c + nx-X11/lib/src/SetState.c + nx-X11/lib/src/SetStip.c + nx-X11/lib/src/SetTSOrig.c + nx-X11/lib/src/SetTile.c + nx-X11/lib/src/SetWMCMapW.c + nx-X11/lib/src/SetWMProto.c + nx-X11/lib/src/StBytes.c + nx-X11/lib/src/StColor.c + nx-X11/lib/src/StColors.c + nx-X11/lib/src/StNColor.c + nx-X11/lib/src/StName.c + nx-X11/lib/src/StrKeysym.c + nx-X11/lib/src/StrToText.c + nx-X11/lib/src/Sync.c + nx-X11/lib/src/Synchro.c + nx-X11/lib/src/Text.c + nx-X11/lib/src/Text16.c + nx-X11/lib/src/TextExt.c + nx-X11/lib/src/TextExt16.c + nx-X11/lib/src/TextToStr.c + nx-X11/lib/src/TrCoords.c + nx-X11/lib/src/UndefCurs.c + nx-X11/lib/src/UngrabBut.c + nx-X11/lib/src/UngrabKbd.c + nx-X11/lib/src/UngrabKey.c + nx-X11/lib/src/UngrabPtr.c + nx-X11/lib/src/UngrabSvr.c + nx-X11/lib/src/UninsCmap.c + nx-X11/lib/src/UnldFont.c + nx-X11/lib/src/UnmapSubs.c + nx-X11/lib/src/UnmapWin.c + nx-X11/lib/src/VisUtil.c + nx-X11/lib/src/WMGeom.c + nx-X11/lib/src/WMProps.c + nx-X11/lib/src/WarpPtr.c + nx-X11/lib/src/WinEvent.c + nx-X11/lib/src/Window.c + nx-X11/lib/src/WrBitF.c + nx-X11/lib/src/XErrorDB + nx-X11/lib/src/Xatomtype.h + nx-X11/lib/src/evtomask.c + nx-X11/lib/src/globals.c + nx-X11/lib/src/locking.c + nx-X11/lib/src/locking.h + nx-X11/lib/src/pathmax.h + nx-X11/lib/src/poly.h + nx-X11/lib/src/util/makekeys.c + nx-X11/lib/src/xcms/cmsMath.c + nx-X11/lib/src/xkb/XKBBind.c + nx-X11/lib/src/xkb/XKBCvt.c + nx-X11/lib/src/xlibi18n/XimThai.h + nx-X11/lib/src/xlibi18n/mbWMProps.c + nx-X11/programs/Xserver/Xext/bigreq.c + nx-X11/programs/Xserver/Xext/shape.c + nx-X11/programs/Xserver/Xext/shm.c + nx-X11/programs/Xserver/Xext/sleepuntil.c + nx-X11/programs/Xserver/Xext/xcmisc.c + nx-X11/programs/Xserver/Xext/xtest.c + nx-X11/programs/Xserver/Xi/allowev.c + nx-X11/programs/Xserver/Xi/chgdctl.c + nx-X11/programs/Xserver/Xi/chgfctl.c + nx-X11/programs/Xserver/Xi/chgkbd.c + nx-X11/programs/Xserver/Xi/chgkmap.c + nx-X11/programs/Xserver/Xi/chgprop.c + nx-X11/programs/Xserver/Xi/chgptr.c + nx-X11/programs/Xserver/Xi/closedev.c + nx-X11/programs/Xserver/Xi/devbell.c + nx-X11/programs/Xserver/Xi/exevents.c + nx-X11/programs/Xserver/Xi/extinit.c + nx-X11/programs/Xserver/Xi/getbmap.c + nx-X11/programs/Xserver/Xi/getdctl.c + nx-X11/programs/Xserver/Xi/getfctl.c + nx-X11/programs/Xserver/Xi/getfocus.c + nx-X11/programs/Xserver/Xi/getkmap.c + nx-X11/programs/Xserver/Xi/getmmap.c + nx-X11/programs/Xserver/Xi/getprop.c + nx-X11/programs/Xserver/Xi/getselev.c + nx-X11/programs/Xserver/Xi/getvers.c + nx-X11/programs/Xserver/Xi/grabdev.c + nx-X11/programs/Xserver/Xi/grabdevb.c + nx-X11/programs/Xserver/Xi/grabdevk.c + nx-X11/programs/Xserver/Xi/gtmotion.c + nx-X11/programs/Xserver/Xi/listdev.c + nx-X11/programs/Xserver/Xi/opendev.c + nx-X11/programs/Xserver/Xi/queryst.c + nx-X11/programs/Xserver/Xi/selectev.c + nx-X11/programs/Xserver/Xi/sendexev.c + nx-X11/programs/Xserver/Xi/setbmap.c + nx-X11/programs/Xserver/Xi/setdval.c + nx-X11/programs/Xserver/Xi/setfocus.c + nx-X11/programs/Xserver/Xi/setmmap.c + nx-X11/programs/Xserver/Xi/setmode.c + nx-X11/programs/Xserver/Xi/stubs.c + nx-X11/programs/Xserver/Xi/ungrdev.c + nx-X11/programs/Xserver/Xi/ungrdevb.c + nx-X11/programs/Xserver/Xi/ungrdevk.c + nx-X11/programs/Xserver/dix/atom.c + nx-X11/programs/Xserver/dix/colormap.c + nx-X11/programs/Xserver/dix/cursor.c + nx-X11/programs/Xserver/dix/devices.c + nx-X11/programs/Xserver/dix/dispatch.c + nx-X11/programs/Xserver/dix/dixutils.c + nx-X11/programs/Xserver/dix/events.c + nx-X11/programs/Xserver/dix/extension.c + nx-X11/programs/Xserver/dix/ffs.c + nx-X11/programs/Xserver/dix/gc.c + nx-X11/programs/Xserver/dix/globals.c + nx-X11/programs/Xserver/dix/glyphcurs.c + nx-X11/programs/Xserver/dix/grabs.c + nx-X11/programs/Xserver/dix/main.c + nx-X11/programs/Xserver/dix/pixmap.c + nx-X11/programs/Xserver/dix/privates.c + nx-X11/programs/Xserver/dix/property.c + nx-X11/programs/Xserver/dix/region.c + nx-X11/programs/Xserver/dix/resource.c + nx-X11/programs/Xserver/dix/swaprep.c + nx-X11/programs/Xserver/dix/swapreq.c + nx-X11/programs/Xserver/dix/tables.c + nx-X11/programs/Xserver/dix/window.c + nx-X11/programs/Xserver/dix/xpstubs.c + nx-X11/programs/Xserver/hw/nxagent/BitmapUtils.c + nx-X11/programs/Xserver/hw/nxagent/X11/include/Xinerama_nxagent.h + nx-X11/programs/Xserver/include/closestr.h + nx-X11/programs/Xserver/include/closure.h + nx-X11/programs/Xserver/include/colormap.h + nx-X11/programs/Xserver/include/colormapst.h + nx-X11/programs/Xserver/include/cursor.h + nx-X11/programs/Xserver/include/cursorstr.h + nx-X11/programs/Xserver/include/dix.h + nx-X11/programs/Xserver/include/extension.h + nx-X11/programs/Xserver/include/extnsionst.h + nx-X11/programs/Xserver/include/gc.h + nx-X11/programs/Xserver/include/gcstruct.h + nx-X11/programs/Xserver/include/input.h + nx-X11/programs/Xserver/include/inputstr.h + nx-X11/programs/Xserver/include/miscstruct.h + nx-X11/programs/Xserver/include/opaque.h + nx-X11/programs/Xserver/include/os.h + nx-X11/programs/Xserver/include/pixmap.h + nx-X11/programs/Xserver/include/pixmapstr.h + nx-X11/programs/Xserver/include/property.h + nx-X11/programs/Xserver/include/propertyst.h + nx-X11/programs/Xserver/include/region.h + nx-X11/programs/Xserver/include/regionstr.h + nx-X11/programs/Xserver/include/resource.h + nx-X11/programs/Xserver/include/rgb.h + nx-X11/programs/Xserver/include/screenint.h + nx-X11/programs/Xserver/include/scrnintstr.h + nx-X11/programs/Xserver/include/selection.h + nx-X11/programs/Xserver/include/servermd.h + nx-X11/programs/Xserver/include/site.h + nx-X11/programs/Xserver/include/validate.h + nx-X11/programs/Xserver/include/window.h + nx-X11/programs/Xserver/include/windowstr.h + nx-X11/programs/Xserver/mi/cbrt.c + nx-X11/programs/Xserver/mi/mi.h + nx-X11/programs/Xserver/mi/miarc.c + nx-X11/programs/Xserver/mi/mibitblt.c + nx-X11/programs/Xserver/mi/mibstorest.h + nx-X11/programs/Xserver/mi/miclipn.c + nx-X11/programs/Xserver/mi/micursor.c + nx-X11/programs/Xserver/mi/midash.c + nx-X11/programs/Xserver/mi/midispcur.c + nx-X11/programs/Xserver/mi/mieq.c + nx-X11/programs/Xserver/mi/miexpose.c + nx-X11/programs/Xserver/mi/mifillarc.c + nx-X11/programs/Xserver/mi/mifillarc.h + nx-X11/programs/Xserver/mi/mifillrct.c + nx-X11/programs/Xserver/mi/mifpoly.h + nx-X11/programs/Xserver/mi/mifpolycon.c + nx-X11/programs/Xserver/mi/migc.c + nx-X11/programs/Xserver/mi/migc.h + nx-X11/programs/Xserver/mi/miglblt.c + nx-X11/programs/Xserver/mi/miinitext.c + nx-X11/programs/Xserver/mi/miline.h + nx-X11/programs/Xserver/mi/mipointer.c + nx-X11/programs/Xserver/mi/mipointer.h + nx-X11/programs/Xserver/mi/mipointrst.h + nx-X11/programs/Xserver/mi/mipoly.c + nx-X11/programs/Xserver/mi/mipoly.h + nx-X11/programs/Xserver/mi/mipolycon.c + nx-X11/programs/Xserver/mi/mipolygen.c + nx-X11/programs/Xserver/mi/mipolypnt.c + nx-X11/programs/Xserver/mi/mipolyrect.c + nx-X11/programs/Xserver/mi/mipolyseg.c + nx-X11/programs/Xserver/mi/mipolytext.c + nx-X11/programs/Xserver/mi/mipolyutil.c + nx-X11/programs/Xserver/mi/mipushpxl.c + nx-X11/programs/Xserver/mi/miscanfill.h + nx-X11/programs/Xserver/mi/miscrinit.c + nx-X11/programs/Xserver/mi/mispans.c + nx-X11/programs/Xserver/mi/mispans.h + nx-X11/programs/Xserver/mi/misprite.c + nx-X11/programs/Xserver/mi/misprite.h + nx-X11/programs/Xserver/mi/mispritest.h + nx-X11/programs/Xserver/mi/mistruct.h + nx-X11/programs/Xserver/mi/mivalidate.h + nx-X11/programs/Xserver/mi/mivaltree.c + nx-X11/programs/Xserver/mi/miwideline.c + nx-X11/programs/Xserver/mi/miwideline.h + nx-X11/programs/Xserver/mi/miwindow.c + nx-X11/programs/Xserver/mi/mizerarc.c + nx-X11/programs/Xserver/mi/mizerarc.h + nx-X11/programs/Xserver/mi/mizerclip.c + nx-X11/programs/Xserver/mi/mizerline.c + nx-X11/programs/Xserver/os/connection.c + nx-X11/programs/Xserver/os/io.c + nx-X11/programs/Xserver/os/mitauth.c + nx-X11/programs/Xserver/os/oscolor.c + nx-X11/programs/Xserver/os/osdep.h + nx-X11/programs/Xserver/os/osinit.c + nx-X11/programs/Xserver/os/rpcauth.c + nx-X11/programs/Xserver/os/secauth.c + nx-X11/programs/Xserver/os/xdmauth.c + nx-X11/programs/Xserver/record/record.c + nx-X11/programs/Xserver/record/set.c + nx-X11/programs/Xserver/record/set.h + nxcompshad/src/X11/include/XTest_nxcompshad.h +Copyright: 1985, 1987, 1990, 1998, The Open Group + 1985, 1987, 1994, 1998, The Open Group + 1985, 1987, 1998, The Open Group + 1985, 1990, 1998, The Open Group + 1985, 1998, The Open Group + 1985-1986, 1998, The Open Group + 1985-1987, 1991, 1998, The Open Group + 1985-1987, 1998, The Open Group + 1986, 1990, 1998, The Open Group + 1986, 1998, The Open Group + 1986-1987, 1998, The Open Group + 1987, 1989, 1998, The Open Group + 1987, 1994, 1998, The Open Group + 1987, 1998, The Open Group + 1987-1988, 1993, 1998, The Open Group + 1987-1988, 1998, The Open Group + 1987-1989, 1998, The Open Group + 1988, 1998, The Open Group + 1988-1989, 1998, The Open Group + 1989, 1991, 1998, The Open Group + 1989, 1998, The Open Group + 1990, 1994, 1998, The Open Group + 1990, 1998, The Open Group + 1991, 1993-1994, 1998, The Open Group + 1991, 1998, The Open Group + 1992, 1998, The Open Group + 1993, 1995, 1998, The Open Group + 1993, 1998, The Open Group + 1993-1994, 1998, The Open Group + 1994, 1998, The Open Group + 1995, 1998, The Open Group + 1996, 1998, The Open Group + 1998, The Open Group + 2003, The Open Group +License: UNKNOWN + FIXME + Files: nx-X11/Imakefile nx-X11/config/cf/host.def - nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h - nx-X11/lib/X11/Imakefile + nx-X11/lib/include/X11/Xlibint.h + nx-X11/lib/include/xtrans/Xtranssock.c + nx-X11/lib/src/ConnDis.c + nx-X11/lib/src/OpenDis.c + nx-X11/lib/src/XlibAsync.c + nx-X11/lib/src/XlibInt.c nx-X11/programs/Imakefile + nx-X11/programs/Xserver/GL/mesa/main/WSDrawBuffer.h nx-X11/programs/Xserver/Imakefile nx-X11/programs/Xserver/Xext/Imakefile + nx-X11/programs/Xserver/Xext/security.c nx-X11/programs/Xserver/hw/nxagent/Atoms.c nx-X11/programs/Xserver/hw/nxagent/Atoms.h nx-X11/programs/Xserver/hw/nxagent/Binder.c @@ -43,6 +536,18 @@ Files: nx-X11/Imakefile nx-X11/programs/Xserver/hw/nxagent/Literals.h nx-X11/programs/Xserver/hw/nxagent/Millis.c nx-X11/programs/Xserver/hw/nxagent/Millis.h + nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c + nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c + nx-X11/programs/Xserver/hw/nxagent/NXevents.c + nx-X11/programs/Xserver/hw/nxagent/NXextension.c + nx-X11/programs/Xserver/hw/nxagent/NXglxext.c + nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c + nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c + nx-X11/programs/Xserver/hw/nxagent/NXproperty.c + nx-X11/programs/Xserver/hw/nxagent/NXresource.c + nx-X11/programs/Xserver/hw/nxagent/NXshm.c + nx-X11/programs/Xserver/hw/nxagent/NXwindow.c + nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c nx-X11/programs/Xserver/hw/nxagent/Options.c nx-X11/programs/Xserver/hw/nxagent/Options.h nx-X11/programs/Xserver/hw/nxagent/Pixels.c @@ -54,7 +559,6 @@ Files: nx-X11/Imakefile nx-X11/programs/Xserver/hw/nxagent/Render.c nx-X11/programs/Xserver/hw/nxagent/Render.h nx-X11/programs/Xserver/hw/nxagent/Rootless.c - nx-X11/programs/Xserver/hw/nxagent/Rootless.h nx-X11/programs/Xserver/hw/nxagent/Splash.c nx-X11/programs/Xserver/hw/nxagent/Splash.h nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -90,266 +594,263 @@ Files: nx-X11/Imakefile nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm nx-X11/programs/Xserver/hw/nxagent/screensaver nx-X11/programs/Xserver/mi/Imakefile - nx-X11/programs/Xserver/os/Imakefile + nx-X11/programs/Xserver/os/WaitFor.c + nx-X11/programs/Xserver/os/auth.c + nx-X11/programs/Xserver/os/log.c + nx-X11/programs/Xserver/os/utils.c nx-X11/programs/Xserver/randr/Imakefile - nxcomp/ActionCache.cpp - nxcomp/ActionCache.h - nxcomp/Agent.cpp - nxcomp/Agent.h - nxcomp/Alpha.cpp - nxcomp/Alpha.h - nxcomp/Auth.cpp - nxcomp/Auth.h - nxcomp/Bitmap.cpp - nxcomp/Bitmap.h - nxcomp/BlockCache.cpp - nxcomp/BlockCache.h - nxcomp/BlockCacheSet.cpp - nxcomp/BlockCacheSet.h - nxcomp/ChangeGC.cpp - nxcomp/ChangeGC.h - nxcomp/ChangeProperty.cpp - nxcomp/ChangeProperty.h - nxcomp/Channel.cpp - nxcomp/Channel.h - nxcomp/ChannelCache.cpp - nxcomp/ChannelCache.h - nxcomp/ChannelEndPoint.cpp - nxcomp/ChannelEndPoint.h - nxcomp/ChannelStore.h - nxcomp/CharCache.cpp - nxcomp/CharCache.h - nxcomp/Children.cpp - nxcomp/ClearArea.cpp - nxcomp/ClearArea.h - nxcomp/ClientCache.cpp - nxcomp/ClientCache.h - nxcomp/ClientChannel.cpp - nxcomp/ClientChannel.h - nxcomp/ClientProxy.cpp - nxcomp/ClientProxy.h - nxcomp/ClientReadBuffer.cpp - nxcomp/ClientReadBuffer.h - nxcomp/ClientStore.cpp - nxcomp/ClientStore.h - nxcomp/Colormap.cpp - nxcomp/Colormap.h - nxcomp/ConfigureWindow.cpp - nxcomp/ConfigureWindow.h - nxcomp/Control.cpp - nxcomp/Control.h - nxcomp/CopyArea.cpp - nxcomp/CopyArea.h - nxcomp/CreateGC.cpp - nxcomp/CreateGC.h - nxcomp/CreatePixmap.cpp - nxcomp/CreatePixmap.h - nxcomp/DecodeBuffer.cpp - nxcomp/DecodeBuffer.h - nxcomp/EncodeBuffer.cpp - nxcomp/EncodeBuffer.h - nxcomp/FillPoly.cpp - nxcomp/FillPoly.h - nxcomp/Fork.cpp - nxcomp/Fork.h - nxcomp/FreeCache.h - nxcomp/GenericChannel.cpp - nxcomp/GenericChannel.h - nxcomp/GenericReadBuffer.cpp - nxcomp/GenericReadBuffer.h - nxcomp/GenericReply.cpp - nxcomp/GenericReply.h - nxcomp/GenericRequest.cpp - nxcomp/GenericRequest.h - nxcomp/GetImage.cpp - nxcomp/GetImage.h - nxcomp/GetImageReply.cpp - nxcomp/GetImageReply.h - nxcomp/GetProperty.cpp - nxcomp/GetProperty.h - nxcomp/GetPropertyReply.cpp - nxcomp/GetPropertyReply.h - nxcomp/ImageText16.cpp - nxcomp/ImageText16.h - nxcomp/ImageText8.cpp - nxcomp/ImageText8.h - nxcomp/IntCache.cpp - nxcomp/IntCache.h - nxcomp/InternAtom.cpp - nxcomp/InternAtom.h - nxcomp/Jpeg.cpp - nxcomp/Jpeg.h - nxcomp/Keeper.cpp - nxcomp/Keeper.h - nxcomp/List.cpp - nxcomp/List.h - nxcomp/ListFontsReply.cpp - nxcomp/ListFontsReply.h - nxcomp/Loop.cpp - nxcomp/Makefile.in - nxcomp/Message.cpp - nxcomp/Message.h - nxcomp/Misc.cpp - nxcomp/Misc.h - nxcomp/NX.h - nxcomp/NXalert.h - nxcomp/NXmitshm.h - nxcomp/NXpack.h - nxcomp/NXproto.h - nxcomp/NXrender.h - nxcomp/NXvars.h - nxcomp/OpcodeCache.h - nxcomp/OpcodeStore.cpp - nxcomp/OpcodeStore.h - nxcomp/Pack.c - nxcomp/Pgn.cpp - nxcomp/Pgn.h - nxcomp/Pipe.cpp - nxcomp/Pipe.h - nxcomp/PolyArc.cpp - nxcomp/PolyArc.h - nxcomp/PolyFillArc.cpp - nxcomp/PolyFillArc.h - nxcomp/PolyFillRectangle.cpp - nxcomp/PolyFillRectangle.h - nxcomp/PolyLine.cpp - nxcomp/PolyLine.h - nxcomp/PolyPoint.cpp - nxcomp/PolyPoint.h - nxcomp/PolySegment.cpp - nxcomp/PolySegment.h - nxcomp/PolyText16.cpp - nxcomp/PolyText16.h - nxcomp/PolyText8.cpp - nxcomp/PolyText8.h - nxcomp/Proxy.cpp - nxcomp/Proxy.h - nxcomp/ProxyReadBuffer.cpp - nxcomp/ProxyReadBuffer.h - nxcomp/PutImage.cpp - nxcomp/PutImage.h - nxcomp/PutPackedImage.cpp - nxcomp/PutPackedImage.h - nxcomp/QueryFontReply.cpp - nxcomp/QueryFontReply.h - nxcomp/ReadBuffer.cpp - nxcomp/ReadBuffer.h - nxcomp/RenderAddGlyphs.cpp - nxcomp/RenderAddGlyphs.h - nxcomp/RenderChangePicture.cpp - nxcomp/RenderChangePicture.h - nxcomp/RenderComposite.cpp - nxcomp/RenderComposite.h - nxcomp/RenderCompositeGlyphs.cpp - nxcomp/RenderCompositeGlyphs.h - nxcomp/RenderCreateGlyphSet.cpp - nxcomp/RenderCreateGlyphSet.h - nxcomp/RenderCreatePicture.cpp - nxcomp/RenderCreatePicture.h - nxcomp/RenderExtension.cpp - nxcomp/RenderExtension.h - nxcomp/RenderFillRectangles.cpp - nxcomp/RenderFillRectangles.h - nxcomp/RenderFreeGlyphSet.cpp - nxcomp/RenderFreeGlyphSet.h - nxcomp/RenderFreePicture.cpp - nxcomp/RenderFreePicture.h - nxcomp/RenderGenericRequest.cpp - nxcomp/RenderGenericRequest.h - nxcomp/RenderMinorExtensionHeaders.h - nxcomp/RenderMinorExtensionMethods.h - nxcomp/RenderMinorExtensionTags.h - nxcomp/RenderPictureClip.cpp - nxcomp/RenderPictureClip.h - nxcomp/RenderPictureFilter.cpp - nxcomp/RenderPictureFilter.h - nxcomp/RenderPictureTransform.cpp - nxcomp/RenderPictureTransform.h - nxcomp/RenderTrapezoids.cpp - nxcomp/RenderTrapezoids.h - nxcomp/RenderTriangles.cpp - nxcomp/RenderTriangles.h - nxcomp/Rgb.cpp - nxcomp/Rgb.h - nxcomp/Rle.cpp - nxcomp/Rle.h - nxcomp/SendEvent.cpp - nxcomp/SendEvent.h - nxcomp/SequenceQueue.cpp - nxcomp/SequenceQueue.h - nxcomp/ServerCache.cpp - nxcomp/ServerCache.h - nxcomp/ServerChannel.cpp - nxcomp/ServerChannel.h - nxcomp/ServerProxy.cpp - nxcomp/ServerProxy.h - nxcomp/ServerReadBuffer.cpp - nxcomp/ServerReadBuffer.h - nxcomp/ServerStore.cpp - nxcomp/ServerStore.h - nxcomp/SetClipRectangles.cpp - nxcomp/SetClipRectangles.h - nxcomp/SetUnpackAlpha.cpp - nxcomp/SetUnpackAlpha.h - nxcomp/SetUnpackColormap.cpp - nxcomp/SetUnpackColormap.h - nxcomp/SetUnpackGeometry.cpp - nxcomp/SetUnpackGeometry.h - nxcomp/ShapeExtension.cpp - nxcomp/ShapeExtension.h - nxcomp/Socket.cpp - nxcomp/Socket.h - nxcomp/Split.cpp - nxcomp/Split.h - nxcomp/StaticCompressor.cpp - nxcomp/StaticCompressor.h - nxcomp/Statistics.cpp - nxcomp/Statistics.h - nxcomp/Timestamp.cpp - nxcomp/Timestamp.h - nxcomp/TranslateCoords.cpp - nxcomp/TranslateCoords.h - nxcomp/Transport.cpp - nxcomp/Transport.h - nxcomp/Types.h - nxcomp/Unpack.cpp - nxcomp/Unpack.h - nxcomp/Vars.c - nxcomp/WriteBuffer.cpp - nxcomp/WriteBuffer.h - nxcomp/XidCache.cpp - nxcomp/XidCache.h - nxcomp/Z.cpp - nxcomp/Z.h - nxcomp/configure.in - nxcompshad/Core.cpp - nxcompshad/Core.h - nxcompshad/Input.cpp - nxcompshad/Input.h - nxcompshad/Logger.cpp - nxcompshad/Logger.h - nxcompshad/Makefile.in - nxcompshad/Manager.cpp - nxcompshad/Manager.h - nxcompshad/Misc.h - nxcompshad/Poller.h - nxcompshad/Regions.h - nxcompshad/Shadow.cpp - nxcompshad/Shadow.h - nxcompshad/Updater.cpp - nxcompshad/Updater.h - nxcompshad/Win.cpp - nxcompshad/Win.h - nxcompshad/X11.cpp - nxcompshad/X11.h - nxcompshad/configure.in -Copyright: 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ + nxcomp/include/NX.h + nxcomp/include/NXalert.h + nxcomp/include/NXpack.h + nxcomp/include/NXproto.h + nxcomp/include/NXvars.h + nxcomp/src/ActionCache.cpp + nxcomp/src/ActionCache.h + nxcomp/src/Agent.cpp + nxcomp/src/Agent.h + nxcomp/src/Alpha.cpp + nxcomp/src/Alpha.h + nxcomp/src/Auth.cpp + nxcomp/src/Auth.h + nxcomp/src/Bitmap.cpp + nxcomp/src/Bitmap.h + nxcomp/src/BlockCache.cpp + nxcomp/src/BlockCache.h + nxcomp/src/BlockCacheSet.cpp + nxcomp/src/BlockCacheSet.h + nxcomp/src/ChangeGC.cpp + nxcomp/src/ChangeGC.h + nxcomp/src/ChangeProperty.cpp + nxcomp/src/ChangeProperty.h + nxcomp/src/Channel.cpp + nxcomp/src/Channel.h + nxcomp/src/ChannelCache.cpp + nxcomp/src/ChannelCache.h + nxcomp/src/ChannelEndPoint.cpp + nxcomp/src/ChannelEndPoint.h + nxcomp/src/ChannelStore.h + nxcomp/src/CharCache.cpp + nxcomp/src/CharCache.h + nxcomp/src/Children.cpp + nxcomp/src/ClearArea.cpp + nxcomp/src/ClearArea.h + nxcomp/src/ClientCache.cpp + nxcomp/src/ClientCache.h + nxcomp/src/ClientChannel.cpp + nxcomp/src/ClientChannel.h + nxcomp/src/ClientProxy.cpp + nxcomp/src/ClientProxy.h + nxcomp/src/ClientReadBuffer.cpp + nxcomp/src/ClientReadBuffer.h + nxcomp/src/ClientStore.cpp + nxcomp/src/ClientStore.h + nxcomp/src/Colormap.cpp + nxcomp/src/Colormap.h + nxcomp/src/ConfigureWindow.cpp + nxcomp/src/ConfigureWindow.h + nxcomp/src/Control.cpp + nxcomp/src/Control.h + nxcomp/src/CopyArea.cpp + nxcomp/src/CopyArea.h + nxcomp/src/CreateGC.cpp + nxcomp/src/CreateGC.h + nxcomp/src/CreatePixmap.cpp + nxcomp/src/CreatePixmap.h + nxcomp/src/DecodeBuffer.cpp + nxcomp/src/DecodeBuffer.h + nxcomp/src/EncodeBuffer.cpp + nxcomp/src/EncodeBuffer.h + nxcomp/src/FillPoly.cpp + nxcomp/src/FillPoly.h + nxcomp/src/Fork.cpp + nxcomp/src/Fork.h + nxcomp/src/FreeCache.h + nxcomp/src/GenericChannel.cpp + nxcomp/src/GenericChannel.h + nxcomp/src/GenericReadBuffer.cpp + nxcomp/src/GenericReadBuffer.h + nxcomp/src/GenericReply.cpp + nxcomp/src/GenericReply.h + nxcomp/src/GenericRequest.cpp + nxcomp/src/GenericRequest.h + nxcomp/src/GetImage.cpp + nxcomp/src/GetImage.h + nxcomp/src/GetImageReply.cpp + nxcomp/src/GetImageReply.h + nxcomp/src/GetProperty.cpp + nxcomp/src/GetProperty.h + nxcomp/src/GetPropertyReply.cpp + nxcomp/src/GetPropertyReply.h + nxcomp/src/ImageText16.cpp + nxcomp/src/ImageText16.h + nxcomp/src/ImageText8.cpp + nxcomp/src/ImageText8.h + nxcomp/src/IntCache.cpp + nxcomp/src/IntCache.h + nxcomp/src/InternAtom.cpp + nxcomp/src/InternAtom.h + nxcomp/src/Jpeg.cpp + nxcomp/src/Jpeg.h + nxcomp/src/Keeper.cpp + nxcomp/src/Keeper.h + nxcomp/src/List.cpp + nxcomp/src/List.h + nxcomp/src/ListFontsReply.cpp + nxcomp/src/ListFontsReply.h + nxcomp/src/Loop.cpp + nxcomp/src/Message.cpp + nxcomp/src/Message.h + nxcomp/src/Misc.cpp + nxcomp/src/Misc.h + nxcomp/src/NXmitshm.h + nxcomp/src/NXrender.h + nxcomp/src/OpcodeCache.h + nxcomp/src/OpcodeStore.cpp + nxcomp/src/OpcodeStore.h + nxcomp/src/Pack.c + nxcomp/src/Pgn.cpp + nxcomp/src/Pgn.h + nxcomp/src/Pipe.cpp + nxcomp/src/Pipe.h + nxcomp/src/PolyArc.cpp + nxcomp/src/PolyArc.h + nxcomp/src/PolyFillArc.cpp + nxcomp/src/PolyFillArc.h + nxcomp/src/PolyFillRectangle.cpp + nxcomp/src/PolyFillRectangle.h + nxcomp/src/PolyLine.cpp + nxcomp/src/PolyLine.h + nxcomp/src/PolyPoint.cpp + nxcomp/src/PolyPoint.h + nxcomp/src/PolySegment.cpp + nxcomp/src/PolySegment.h + nxcomp/src/PolyText16.cpp + nxcomp/src/PolyText16.h + nxcomp/src/PolyText8.cpp + nxcomp/src/PolyText8.h + nxcomp/src/Proxy.cpp + nxcomp/src/Proxy.h + nxcomp/src/ProxyReadBuffer.cpp + nxcomp/src/ProxyReadBuffer.h + nxcomp/src/PutImage.cpp + nxcomp/src/PutImage.h + nxcomp/src/PutPackedImage.cpp + nxcomp/src/PutPackedImage.h + nxcomp/src/QueryFontReply.cpp + nxcomp/src/QueryFontReply.h + nxcomp/src/ReadBuffer.cpp + nxcomp/src/ReadBuffer.h + nxcomp/src/RenderAddGlyphs.cpp + nxcomp/src/RenderAddGlyphs.h + nxcomp/src/RenderChangePicture.cpp + nxcomp/src/RenderChangePicture.h + nxcomp/src/RenderComposite.cpp + nxcomp/src/RenderComposite.h + nxcomp/src/RenderCompositeGlyphs.cpp + nxcomp/src/RenderCompositeGlyphs.h + nxcomp/src/RenderCreateGlyphSet.cpp + nxcomp/src/RenderCreateGlyphSet.h + nxcomp/src/RenderCreatePicture.cpp + nxcomp/src/RenderCreatePicture.h + nxcomp/src/RenderExtension.cpp + nxcomp/src/RenderExtension.h + nxcomp/src/RenderFillRectangles.cpp + nxcomp/src/RenderFillRectangles.h + nxcomp/src/RenderFreeGlyphSet.cpp + nxcomp/src/RenderFreeGlyphSet.h + nxcomp/src/RenderFreePicture.cpp + nxcomp/src/RenderFreePicture.h + nxcomp/src/RenderGenericRequest.cpp + nxcomp/src/RenderGenericRequest.h + nxcomp/src/RenderMinorExtensionHeaders.h + nxcomp/src/RenderMinorExtensionMethods.h + nxcomp/src/RenderMinorExtensionTags.h + nxcomp/src/RenderPictureClip.cpp + nxcomp/src/RenderPictureClip.h + nxcomp/src/RenderPictureFilter.cpp + nxcomp/src/RenderPictureFilter.h + nxcomp/src/RenderPictureTransform.cpp + nxcomp/src/RenderPictureTransform.h + nxcomp/src/RenderTrapezoids.cpp + nxcomp/src/RenderTrapezoids.h + nxcomp/src/RenderTriangles.cpp + nxcomp/src/RenderTriangles.h + nxcomp/src/Rgb.cpp + nxcomp/src/Rgb.h + nxcomp/src/Rle.cpp + nxcomp/src/Rle.h + nxcomp/src/SendEvent.cpp + nxcomp/src/SendEvent.h + nxcomp/src/SequenceQueue.cpp + nxcomp/src/SequenceQueue.h + nxcomp/src/ServerCache.cpp + nxcomp/src/ServerCache.h + nxcomp/src/ServerChannel.cpp + nxcomp/src/ServerChannel.h + nxcomp/src/ServerProxy.cpp + nxcomp/src/ServerProxy.h + nxcomp/src/ServerReadBuffer.cpp + nxcomp/src/ServerReadBuffer.h + nxcomp/src/ServerStore.cpp + nxcomp/src/ServerStore.h + nxcomp/src/SetClipRectangles.cpp + nxcomp/src/SetClipRectangles.h + nxcomp/src/SetUnpackAlpha.cpp + nxcomp/src/SetUnpackAlpha.h + nxcomp/src/SetUnpackColormap.cpp + nxcomp/src/SetUnpackColormap.h + nxcomp/src/SetUnpackGeometry.cpp + nxcomp/src/SetUnpackGeometry.h + nxcomp/src/ShapeExtension.cpp + nxcomp/src/ShapeExtension.h + nxcomp/src/Socket.cpp + nxcomp/src/Socket.h + nxcomp/src/Split.cpp + nxcomp/src/Split.h + nxcomp/src/StaticCompressor.cpp + nxcomp/src/StaticCompressor.h + nxcomp/src/Statistics.cpp + nxcomp/src/Statistics.h + nxcomp/src/Timestamp.cpp + nxcomp/src/Timestamp.h + nxcomp/src/TranslateCoords.cpp + nxcomp/src/TranslateCoords.h + nxcomp/src/Transport.cpp + nxcomp/src/Transport.h + nxcomp/src/Types.h + nxcomp/src/Unpack.cpp + nxcomp/src/Unpack.h + nxcomp/src/Vars.c + nxcomp/src/WriteBuffer.cpp + nxcomp/src/WriteBuffer.h + nxcomp/src/XidCache.cpp + nxcomp/src/XidCache.h + nxcomp/src/Z.cpp + nxcomp/src/Z.h + nxcompshad/include/Shadow.h + nxcompshad/src/Core.cpp + nxcompshad/src/Core.h + nxcompshad/src/Input.cpp + nxcompshad/src/Input.h + nxcompshad/src/Logger.cpp + nxcompshad/src/Logger.h + nxcompshad/src/Manager.cpp + nxcompshad/src/Manager.h + nxcompshad/src/Misc.h + nxcompshad/src/Poller.h + nxcompshad/src/Regions.h + nxcompshad/src/Shadow.cpp + nxcompshad/src/Updater.cpp + nxcompshad/src/Updater.h + nxcompshad/src/X11.cpp + nxcompshad/src/X11.h +Copyright: 2001, 2011, NoMachine (http:www.nomachine.com) + 2008-2014, Oleksandr Shneyder + 2011-2016, Mike Gabriel + 2014-2016, Mihai Moldovan + 2014-2016, Ulrich Sibiller + 2015-2016, Qindel Group (http:www.qindel.com) + of the aforementioned persons and companies. License: UNKNOWN FIXME @@ -415,7 +916,6 @@ Files: nx-X11/extras/Mesa/include/GL/gl.h nx-X11/extras/Mesa/src/mesa/main/drawpix.h nx-X11/extras/Mesa/src/mesa/main/enable.c nx-X11/extras/Mesa/src/mesa/main/enable.h - nx-X11/extras/Mesa/src/mesa/main/enums.c nx-X11/extras/Mesa/src/mesa/main/enums.h nx-X11/extras/Mesa/src/mesa/main/eval.c nx-X11/extras/Mesa/src/mesa/main/eval.h @@ -656,348 +1156,18 @@ Copyright: 1999-2001, Brian Paul 1999-2003, Brian Paul 1999-2004, Brian Paul 1999-2005, Brian Paul + 1999-2006, Brian Paul 2004-2005, Brian Paul 2005, Brian Paul -License: Expat +License: MIT/X11 (BSD like) FIXME -Files: nx-X11/include/XWDFile.h - nx-X11/include/Xalloca.h - nx-X11/include/Xauth.h - nx-X11/include/Xfuncproto.h - nx-X11/include/Xfuncs.h - nx-X11/include/Xos.h - nx-X11/include/Xos_r.h - nx-X11/include/Xosdefs.h - nx-X11/include/Xthreads.h - nx-X11/include/Xwindows.h - nx-X11/include/Xwinsock.h - nx-X11/include/extensions/bigreqstr.h - nx-X11/include/extensions/security.h - nx-X11/include/extensions/securstr.h - nx-X11/include/extensions/xcmiscstr.h - nx-X11/include/extensions/xtestconst.h - nx-X11/include/extensions/xteststr.h - nx-X11/lib/X11/AllCells.c - nx-X11/lib/X11/AllPlanes.c - nx-X11/lib/X11/AllowEv.c - nx-X11/lib/X11/AuDispose.c - nx-X11/lib/X11/AuFileName.c - nx-X11/lib/X11/AuGetBest.c - nx-X11/lib/X11/AuRead.c - nx-X11/lib/X11/AutoRep.c - nx-X11/lib/X11/Backgnd.c - nx-X11/lib/X11/BdrWidth.c - nx-X11/lib/X11/Bell.c - nx-X11/lib/X11/Border.c - nx-X11/lib/X11/ChAccCon.c - nx-X11/lib/X11/ChActPGb.c - nx-X11/lib/X11/ChClMode.c - nx-X11/lib/X11/ChCmap.c - nx-X11/lib/X11/ChGC.c - nx-X11/lib/X11/ChKeyCon.c - nx-X11/lib/X11/ChPntCon.c - nx-X11/lib/X11/ChProp.c - nx-X11/lib/X11/ChSaveSet.c - nx-X11/lib/X11/ChWAttrs.c - nx-X11/lib/X11/ChWindow.c - nx-X11/lib/X11/ChkIfEv.c - nx-X11/lib/X11/ChkMaskEv.c - nx-X11/lib/X11/ChkTypEv.c - nx-X11/lib/X11/ChkTypWEv.c - nx-X11/lib/X11/ChkWinEv.c - nx-X11/lib/X11/CirWin.c - nx-X11/lib/X11/CirWinDn.c - nx-X11/lib/X11/CirWinUp.c - nx-X11/lib/X11/ClDisplay.c - nx-X11/lib/X11/Clear.c - nx-X11/lib/X11/ClearArea.c - nx-X11/lib/X11/ConfWind.c - nx-X11/lib/X11/ConvSel.c - nx-X11/lib/X11/CopyArea.c - nx-X11/lib/X11/CopyCmap.c - nx-X11/lib/X11/CopyGC.c - nx-X11/lib/X11/CopyPlane.c - nx-X11/lib/X11/CrBFData.c - nx-X11/lib/X11/CrCmap.c - nx-X11/lib/X11/CrCursor.c - nx-X11/lib/X11/CrGC.c - nx-X11/lib/X11/CrGlCur.c - nx-X11/lib/X11/CrPFBData.c - nx-X11/lib/X11/CrPixmap.c - nx-X11/lib/X11/CrWindow.c - nx-X11/lib/X11/Cursor.c - nx-X11/lib/X11/DefCursor.c - nx-X11/lib/X11/DelProp.c - nx-X11/lib/X11/Depths.c - nx-X11/lib/X11/DestSubs.c - nx-X11/lib/X11/DestWind.c - nx-X11/lib/X11/DisName.c - nx-X11/lib/X11/DrArc.c - nx-X11/lib/X11/DrArcs.c - nx-X11/lib/X11/DrLine.c - nx-X11/lib/X11/DrLines.c - nx-X11/lib/X11/DrPoint.c - nx-X11/lib/X11/DrPoints.c - nx-X11/lib/X11/DrRect.c - nx-X11/lib/X11/DrRects.c - nx-X11/lib/X11/DrSegs.c - nx-X11/lib/X11/ErrHndlr.c - nx-X11/lib/X11/EvToWire.c - nx-X11/lib/X11/FSSaver.c - nx-X11/lib/X11/FetchName.c - nx-X11/lib/X11/FillArc.c - nx-X11/lib/X11/FillArcs.c - nx-X11/lib/X11/FillPoly.c - nx-X11/lib/X11/FillRct.c - nx-X11/lib/X11/FillRcts.c - nx-X11/lib/X11/Flush.c - nx-X11/lib/X11/FontInfo.c - nx-X11/lib/X11/FontNames.c - nx-X11/lib/X11/FreeCmap.c - nx-X11/lib/X11/FreeCols.c - nx-X11/lib/X11/FreeCurs.c - nx-X11/lib/X11/FreeEData.c - nx-X11/lib/X11/FreeGC.c - nx-X11/lib/X11/FreePix.c - nx-X11/lib/X11/GCMisc.c - nx-X11/lib/X11/Geom.c - nx-X11/lib/X11/GetAtomNm.c - nx-X11/lib/X11/GetColor.c - nx-X11/lib/X11/GetFPath.c - nx-X11/lib/X11/GetFProp.c - nx-X11/lib/X11/GetGCVals.c - nx-X11/lib/X11/GetGeom.c - nx-X11/lib/X11/GetHColor.c - nx-X11/lib/X11/GetIFocus.c - nx-X11/lib/X11/GetImage.c - nx-X11/lib/X11/GetKCnt.c - nx-X11/lib/X11/GetMoEv.c - nx-X11/lib/X11/GetPCnt.c - nx-X11/lib/X11/GetPntMap.c - nx-X11/lib/X11/GetProp.c - nx-X11/lib/X11/GetRGBCMap.c - nx-X11/lib/X11/GetSOwner.c - nx-X11/lib/X11/GetSSaver.c - nx-X11/lib/X11/GetWAttrs.c - nx-X11/lib/X11/GrButton.c - nx-X11/lib/X11/GrKey.c - nx-X11/lib/X11/GrKeybd.c - nx-X11/lib/X11/GrPointer.c - nx-X11/lib/X11/GrServer.c - nx-X11/lib/X11/IfEvent.c - nx-X11/lib/X11/ImText.c - nx-X11/lib/X11/ImText16.c - nx-X11/lib/X11/ImUtil.c - nx-X11/lib/X11/InitExt.c - nx-X11/lib/X11/InsCmap.c - nx-X11/lib/X11/IntAtom.c - nx-X11/lib/X11/KeyBind.c - nx-X11/lib/X11/KeysymStr.c - nx-X11/lib/X11/KillCl.c - nx-X11/lib/X11/LiICmaps.c - nx-X11/lib/X11/LiProps.c - nx-X11/lib/X11/ListExt.c - nx-X11/lib/X11/LoadFont.c - nx-X11/lib/X11/LockDis.c - nx-X11/lib/X11/LookupCol.c - nx-X11/lib/X11/LowerWin.c - nx-X11/lib/X11/Macros.c - nx-X11/lib/X11/MapRaised.c - nx-X11/lib/X11/MapSubs.c - nx-X11/lib/X11/MapWindow.c - nx-X11/lib/X11/MaskEvent.c - nx-X11/lib/X11/Misc.c - nx-X11/lib/X11/ModMap.c - nx-X11/lib/X11/MoveWin.c - nx-X11/lib/X11/NextEvent.c - nx-X11/lib/X11/ParseCol.c - nx-X11/lib/X11/ParseGeom.c - nx-X11/lib/X11/PeekEvent.c - nx-X11/lib/X11/PeekIfEv.c - nx-X11/lib/X11/Pending.c - nx-X11/lib/X11/PixFormats.c - nx-X11/lib/X11/PmapBgnd.c - nx-X11/lib/X11/PmapBord.c - nx-X11/lib/X11/PolyTxt.c - nx-X11/lib/X11/PolyTxt16.c - nx-X11/lib/X11/PropAlloc.c - nx-X11/lib/X11/PutBEvent.c - nx-X11/lib/X11/PutImage.c - nx-X11/lib/X11/QuBest.c - nx-X11/lib/X11/QuColor.c - nx-X11/lib/X11/QuColors.c - nx-X11/lib/X11/QuCurShp.c - nx-X11/lib/X11/QuExt.c - nx-X11/lib/X11/QuKeybd.c - nx-X11/lib/X11/QuPntr.c - nx-X11/lib/X11/QuStipShp.c - nx-X11/lib/X11/QuTextE16.c - nx-X11/lib/X11/QuTextExt.c - nx-X11/lib/X11/QuTileShp.c - nx-X11/lib/X11/QuTree.c - nx-X11/lib/X11/RaiseWin.c - nx-X11/lib/X11/RdBitF.c - nx-X11/lib/X11/RecolorC.c - nx-X11/lib/X11/ReconfWM.c - nx-X11/lib/X11/ReconfWin.c - nx-X11/lib/X11/RepWindow.c - nx-X11/lib/X11/RestackWs.c - nx-X11/lib/X11/RotProp.c - nx-X11/lib/X11/ScrResStr.c - nx-X11/lib/X11/SelInput.c - nx-X11/lib/X11/SendEvent.c - nx-X11/lib/X11/SetBack.c - nx-X11/lib/X11/SetCRects.c - nx-X11/lib/X11/SetClMask.c - nx-X11/lib/X11/SetClOrig.c - nx-X11/lib/X11/SetDashes.c - nx-X11/lib/X11/SetFPath.c - nx-X11/lib/X11/SetFont.c - nx-X11/lib/X11/SetFore.c - nx-X11/lib/X11/SetFunc.c - nx-X11/lib/X11/SetIFocus.c - nx-X11/lib/X11/SetLStyle.c - nx-X11/lib/X11/SetPMask.c - nx-X11/lib/X11/SetPntMap.c - nx-X11/lib/X11/SetRGBCMap.c - nx-X11/lib/X11/SetSOwner.c - nx-X11/lib/X11/SetSSaver.c - nx-X11/lib/X11/SetState.c - nx-X11/lib/X11/SetStip.c - nx-X11/lib/X11/SetTSOrig.c - nx-X11/lib/X11/SetTile.c - nx-X11/lib/X11/StBytes.c - nx-X11/lib/X11/StColor.c - nx-X11/lib/X11/StColors.c - nx-X11/lib/X11/StNColor.c - nx-X11/lib/X11/StName.c - nx-X11/lib/X11/StrKeysym.c - nx-X11/lib/X11/StrToText.c - nx-X11/lib/X11/Sync.c - nx-X11/lib/X11/Synchro.c - nx-X11/lib/X11/Text.c - nx-X11/lib/X11/Text16.c - nx-X11/lib/X11/TextToStr.c - nx-X11/lib/X11/TrCoords.c - nx-X11/lib/X11/UndefCurs.c - nx-X11/lib/X11/UngrabBut.c - nx-X11/lib/X11/UngrabKbd.c - nx-X11/lib/X11/UngrabKey.c - nx-X11/lib/X11/UngrabPtr.c - nx-X11/lib/X11/UngrabSvr.c - nx-X11/lib/X11/UninsCmap.c - nx-X11/lib/X11/UnldFont.c - nx-X11/lib/X11/UnmapSubs.c - nx-X11/lib/X11/UnmapWin.c - nx-X11/lib/X11/VisUtil.c - nx-X11/lib/X11/WMGeom.c - nx-X11/lib/X11/WarpPtr.c - nx-X11/lib/X11/WinEvent.c - nx-X11/lib/X11/Window.c - nx-X11/lib/X11/WrBitF.c - nx-X11/lib/X11/XErrorDB - nx-X11/lib/X11/XKBBind.c - nx-X11/lib/X11/XKBCvt.c - nx-X11/lib/X11/Xlib.h - nx-X11/lib/X11/Xlocale.h - nx-X11/lib/X11/cmsMath.c - nx-X11/lib/X11/cursorfont.h - nx-X11/lib/X11/evtomask.c - nx-X11/lib/X11/globals.c - nx-X11/lib/X11/locking.c - nx-X11/lib/X11/locking.h - nx-X11/lib/X11/mbWMProps.c - nx-X11/lib/X11/util/makekeys.c - nx-X11/programs/Xserver/Xext/bigreq.c - nx-X11/programs/Xserver/Xext/shape.c - nx-X11/programs/Xserver/Xext/shm.c - nx-X11/programs/Xserver/Xext/sleepuntil.c - nx-X11/programs/Xserver/Xext/xcmisc.c - nx-X11/programs/Xserver/Xext/xtest.c - nx-X11/programs/Xserver/Xi/queryst.c - nx-X11/programs/Xserver/dix/ffs.c - nx-X11/programs/Xserver/dix/pixmap.c - nx-X11/programs/Xserver/dix/privates.c - nx-X11/programs/Xserver/dix/xpstubs.c - nx-X11/programs/Xserver/hw/nxagent/BitmapUtils.c - nx-X11/programs/Xserver/hw/nxagent/X11/include/Xinerama_nxagent.h - nx-X11/programs/Xserver/include/closestr.h - nx-X11/programs/Xserver/include/opaque.h - nx-X11/programs/Xserver/include/validate.h - nx-X11/programs/Xserver/mi/cbrt.c - nx-X11/programs/Xserver/mi/mibstorest.h - nx-X11/programs/Xserver/mi/miclipn.c - nx-X11/programs/Xserver/mi/midispcur.c - nx-X11/programs/Xserver/mi/mieq.c - nx-X11/programs/Xserver/mi/mifillarc.c - nx-X11/programs/Xserver/mi/mifillarc.h - nx-X11/programs/Xserver/mi/migc.c - nx-X11/programs/Xserver/mi/migc.h - nx-X11/programs/Xserver/mi/miline.h - nx-X11/programs/Xserver/mi/mipointer.c - nx-X11/programs/Xserver/mi/mipointer.h - nx-X11/programs/Xserver/mi/mipointrst.h - nx-X11/programs/Xserver/mi/mipoly.h - nx-X11/programs/Xserver/mi/miscanfill.h - nx-X11/programs/Xserver/mi/miscrinit.c - nx-X11/programs/Xserver/mi/misprite.c - nx-X11/programs/Xserver/mi/misprite.h - nx-X11/programs/Xserver/mi/mispritest.h - nx-X11/programs/Xserver/mi/mivalidate.h - nx-X11/programs/Xserver/mi/miwideline.c - nx-X11/programs/Xserver/mi/miwideline.h - nx-X11/programs/Xserver/mi/mizerarc.c - nx-X11/programs/Xserver/mi/mizerarc.h - nx-X11/programs/Xserver/os/mitauth.c - nx-X11/programs/Xserver/os/rpcauth.c - nx-X11/programs/Xserver/os/secauth.c - nx-X11/programs/Xserver/os/xdmauth.c - nx-X11/programs/Xserver/record/record.c - nx-X11/programs/Xserver/record/set.c - nx-X11/programs/Xserver/record/set.h - nxcompshad/X11/include/XTest_nxcompshad.h -Copyright: 1985, 1987, 1990, 1998 The Open Group - 1985, 1987, 1994, 1998 The Open Group - 1985, 1987, 1998, The Open Group - 1985, 1990, 1998, The Open Group - 1985, 1998 The Open Group - 1985-1986, 1998 The Open Group - 1985-1987, 1991, 1998, The Open Group - 1985-1987, 1998 The Open Group - 1985-1987,1998, The Open Group - 1986, 1990, 1998, The Open Group - 1986, 1998 The Open Group - 1986,1998, The Open Group - 1986-1987, 1998 The Open Group - 1987, 1998 The Open Group - 1988, 1998 The Open Group - 1988-1989, 1998 The Open Group - 1989, 1991, 1998, The Open Group - 1989, 1998 The Open Group - 1990, 1994, 1998, The Open Group - 1990, 1998 The Open Group - 1991, 1998 The Open Group - 1992, 1998 The Open Group - 1993, 1995, 1998, The Open Group - 1993, 1998 The Open Group - 1993-1994, 1998 The Open Group - 1994, 1998 The Open Group - 1995, 1998 The Open Group - 1996, 1998 The Open Group - 1998, 1998 The Open Group - 2003, The Open Group -License: UNKNOWN - FIXME - -Files: ChangeLog - Makefile +Files: Makefile VERSION debian/README.source debian/compat debian/control - debian/copyright - debian/copyright.in + debian/files debian/libnx-x11-6.install debian/libnx-x11-6.symbols debian/libnx-x11-6.triggers @@ -1018,6 +1188,7 @@ Files: ChangeLog debian/nx-x11proto-damage-dev.install debian/nx-x11proto-randr-dev.install debian/nx-x11proto-render-dev.install + debian/nx-x11proto-scrnsaver-dev.install debian/nx-x11proto-xext-dev.install debian/nx-x11proto-xfixes-dev.install debian/nx-x11proto-xinerama-dev.install @@ -1039,7 +1210,6 @@ Files: ChangeLog debian/watch doc/README.NX-development doc/libNX_X11/lcUniConv/8bit_tab_to_h.c - doc/libNX_X11/lcUniConv/README doc/libNX_X11/lcUniConv/cjk_tab_to_h.c doc/nxagent/README.keystrokes doc/nxagent/README.keystrokes.debug @@ -1049,8 +1219,6 @@ Files: ChangeLog nx-X11/Makefile nx-X11/config/Imakefile nx-X11/config/cf/Imake.cf - nx-X11/config/cf/Imake.rules - nx-X11/config/cf/Imake.tmpl nx-X11/config/cf/Imakefile nx-X11/config/cf/Library.tmpl nx-X11/config/cf/README @@ -1058,9 +1226,11 @@ Files: ChangeLog nx-X11/config/cf/ServerLib.tmpl nx-X11/config/cf/Threads.tmpl nx-X11/config/cf/X11.rules - nx-X11/config/cf/X11.tmpl nx-X11/config/cf/cross.def nx-X11/config/cf/cross.rules + nx-X11/config/cf/gnu.cf + nx-X11/config/cf/gnuLib.rules + nx-X11/config/cf/gnuLib.tmpl nx-X11/config/cf/linux.cf nx-X11/config/cf/lnxLib.rules nx-X11/config/cf/lnxLib.tmpl @@ -1072,9 +1242,13 @@ Files: ChangeLog nx-X11/config/cf/xorg.tmpl nx-X11/config/cf/xorgsite.def nx-X11/config/cf/xorgversion.def - nx-X11/extras/Mesa.patches/4001_CreatePixmap-AllocationHints.patch + nx-X11/extras/Mesa.patches/4001_Fix-non-working-GLX-in-64bit-Xorg-7.0.patch + nx-X11/extras/Mesa.patches/4002_no-special-glx-memfunctions.patch + nx-X11/extras/Mesa.patches/4003_CreatePixmap-AllocationHints.patch + nx-X11/extras/Mesa.patches/4004_define-USE_IEEE-macro-for-more-platforms.patch + nx-X11/extras/Mesa.patches/5001_nasty-typo-fixes.patch nx-X11/extras/Mesa.patches/series - nx-X11/extras/Mesa/src/mesa/main/get.c + nx-X11/extras/Mesa/src/mesa/main/KNOWN_BUGS nx-X11/extras/Mesa/src/mesa/main/texrender.c nx-X11/extras/Mesa/src/mesa/main/texrender.h nx-X11/extras/Mesa/src/mesa/shader/arbprogram_syn.h @@ -1092,67 +1266,83 @@ Files: ChangeLog nx-X11/include/GL/Imakefile nx-X11/include/Imakefile nx-X11/include/XF86keysym.h - nx-X11/include/Xatom.h nx-X11/include/Xw32defs.h nx-X11/include/extensions/Imakefile nx-X11/include/extensions/XvMC.h nx-X11/include/extensions/XvMCproto.h - nx-X11/lib/Imakefile - nx-X11/lib/X11/Cmap.h - nx-X11/lib/X11/Cr.h - nx-X11/lib/X11/Cv.h - nx-X11/lib/X11/ImUtil.h - nx-X11/lib/X11/Key.h - nx-X11/lib/X11/Xintatom.h - nx-X11/lib/X11/Xintconn.h - nx-X11/lib/X11/XlibConf.h - nx-X11/lib/X11/Xresinternal.h - nx-X11/lib/X11/imKStoUCS.c - nx-X11/lib/X11/lcUniConv/armscii_8.h - nx-X11/lib/X11/lcUniConv/big5.h - nx-X11/lib/X11/lcUniConv/big5_emacs.h - nx-X11/lib/X11/lcUniConv/big5hkscs.h - nx-X11/lib/X11/lcUniConv/cp1133.h - nx-X11/lib/X11/lcUniConv/cp1251.h - nx-X11/lib/X11/lcUniConv/cp1255.h - nx-X11/lib/X11/lcUniConv/cp1256.h - nx-X11/lib/X11/lcUniConv/gb2312.h - nx-X11/lib/X11/lcUniConv/gbk.h - nx-X11/lib/X11/lcUniConv/georgian_academy.h - nx-X11/lib/X11/lcUniConv/georgian_ps.h - nx-X11/lib/X11/lcUniConv/iso8859_1.h - nx-X11/lib/X11/lcUniConv/iso8859_10.h - nx-X11/lib/X11/lcUniConv/iso8859_11.h - nx-X11/lib/X11/lcUniConv/iso8859_13.h - nx-X11/lib/X11/lcUniConv/iso8859_14.h - nx-X11/lib/X11/lcUniConv/iso8859_15.h - nx-X11/lib/X11/lcUniConv/iso8859_16.h - nx-X11/lib/X11/lcUniConv/iso8859_2.h - nx-X11/lib/X11/lcUniConv/iso8859_3.h - nx-X11/lib/X11/lcUniConv/iso8859_4.h - nx-X11/lib/X11/lcUniConv/iso8859_5.h - nx-X11/lib/X11/lcUniConv/iso8859_6.h - nx-X11/lib/X11/lcUniConv/iso8859_7.h - nx-X11/lib/X11/lcUniConv/iso8859_8.h - nx-X11/lib/X11/lcUniConv/iso8859_9.h - nx-X11/lib/X11/lcUniConv/iso8859_9e.h - nx-X11/lib/X11/lcUniConv/jisx0201.h - nx-X11/lib/X11/lcUniConv/jisx0208.h - nx-X11/lib/X11/lcUniConv/jisx0212.h - nx-X11/lib/X11/lcUniConv/koi8_c.h - nx-X11/lib/X11/lcUniConv/koi8_r.h - nx-X11/lib/X11/lcUniConv/koi8_u.h - nx-X11/lib/X11/lcUniConv/ksc5601.h - nx-X11/lib/X11/lcUniConv/mulelao.h - nx-X11/lib/X11/lcUniConv/tatar_cyr.h - nx-X11/lib/X11/lcUniConv/tcvn.h - nx-X11/lib/X11/lcUniConv/tis620.h - nx-X11/lib/X11/lcUniConv/ucs2be.h - nx-X11/lib/X11/lcUniConv/utf8.h - nx-X11/lib/X11/lcUniConv/viscii.h - nx-X11/lib/xtrans/Imakefile + nx-X11/lib/Makefile.am + nx-X11/lib/configure.ac + nx-X11/lib/include/Makefile.am + nx-X11/lib/include/X11/ImUtil.h + nx-X11/lib/modules/Makefile.am + nx-X11/lib/modules/im/Makefile.am + nx-X11/lib/modules/im/ximcp/Makefile.am + nx-X11/lib/modules/lc/Makefile.am + nx-X11/lib/modules/lc/Utf8/Makefile.am + nx-X11/lib/modules/lc/def/Makefile.am + nx-X11/lib/modules/lc/gen/Makefile.am + nx-X11/lib/modules/om/Makefile.am + nx-X11/lib/modules/om/generic/Makefile.am + nx-X11/lib/nx-x11.pc.in + nx-X11/lib/src/Cmap.h + nx-X11/lib/src/Cr.h + nx-X11/lib/src/Key.h + nx-X11/lib/src/Makefile.am + nx-X11/lib/src/Xintatom.h + nx-X11/lib/src/Xintconn.h + nx-X11/lib/src/Xresinternal.h + nx-X11/lib/src/util/Makefile.am + nx-X11/lib/src/xcms/Cv.h + nx-X11/lib/src/xcms/Makefile.am + nx-X11/lib/src/xkb/Makefile.am + nx-X11/lib/src/xlibi18n/Makefile.am + nx-X11/lib/src/xlibi18n/imKStoUCS.c + nx-X11/lib/src/xlibi18n/lcUniConv/armscii_8.h + nx-X11/lib/src/xlibi18n/lcUniConv/big5.h + nx-X11/lib/src/xlibi18n/lcUniConv/big5_emacs.h + nx-X11/lib/src/xlibi18n/lcUniConv/big5hkscs.h + nx-X11/lib/src/xlibi18n/lcUniConv/cp1133.h + nx-X11/lib/src/xlibi18n/lcUniConv/cp1251.h + nx-X11/lib/src/xlibi18n/lcUniConv/cp1255.h + nx-X11/lib/src/xlibi18n/lcUniConv/cp1256.h + nx-X11/lib/src/xlibi18n/lcUniConv/gb2312.h + nx-X11/lib/src/xlibi18n/lcUniConv/gbk.h + nx-X11/lib/src/xlibi18n/lcUniConv/georgian_academy.h + nx-X11/lib/src/xlibi18n/lcUniConv/georgian_ps.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_1.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_10.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_11.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_13.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_14.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_15.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_16.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_2.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_3.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_4.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_5.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_6.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_7.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_8.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_9.h + nx-X11/lib/src/xlibi18n/lcUniConv/iso8859_9e.h + nx-X11/lib/src/xlibi18n/lcUniConv/jisx0201.h + nx-X11/lib/src/xlibi18n/lcUniConv/jisx0208.h + nx-X11/lib/src/xlibi18n/lcUniConv/jisx0212.h + nx-X11/lib/src/xlibi18n/lcUniConv/koi8_c.h + nx-X11/lib/src/xlibi18n/lcUniConv/koi8_r.h + nx-X11/lib/src/xlibi18n/lcUniConv/koi8_u.h + nx-X11/lib/src/xlibi18n/lcUniConv/ksc5601.h + nx-X11/lib/src/xlibi18n/lcUniConv/mulelao.h + nx-X11/lib/src/xlibi18n/lcUniConv/tatar_cyr.h + nx-X11/lib/src/xlibi18n/lcUniConv/tcvn.h + nx-X11/lib/src/xlibi18n/lcUniConv/tis620.h + nx-X11/lib/src/xlibi18n/lcUniConv/ucs2be.h + nx-X11/lib/src/xlibi18n/lcUniConv/utf8.h + nx-X11/lib/src/xlibi18n/lcUniConv/viscii.h nx-X11/programs/Xserver/GL/Imakefile nx-X11/programs/Xserver/GL/glx/Imakefile + nx-X11/programs/Xserver/GL/include/GL/glx_ansic.h + nx-X11/programs/Xserver/GL/include/GL/xf86glx.h nx-X11/programs/Xserver/GL/mesa/GLcore/Imakefile nx-X11/programs/Xserver/GL/mesa/Imakefile nx-X11/programs/Xserver/GL/mesa/Imakefile.inc @@ -1190,8 +1380,6 @@ Files: ChangeLog nx-X11/programs/Xserver/damageext/Imakefile nx-X11/programs/Xserver/dbe/Imakefile nx-X11/programs/Xserver/dix/Imakefile - nx-X11/programs/Xserver/dix/buildatoms - nx-X11/programs/Xserver/dix/initatoms.c nx-X11/programs/Xserver/fb/Imakefile nx-X11/programs/Xserver/fix-miregion nx-X11/programs/Xserver/fix-miregion-private @@ -1212,147 +1400,25 @@ Files: ChangeLog nx-X11/programs/Xserver/xkb/Imakefile nx-X11/programs/Xserver/xkb/ddxPrivate.c nx-X11/programs/Xserver/xkb/xkb.h - nx-X11/programs/Xserver/xkb/xkbDflts.h nx-X11/x-indent-all.sh nx-X11/x-indent.sh + nxcomp/Makefile.am nxcomp/VERSION - nxcomp/install-sh - nxcomp/mkinstalldirs + nxcomp/configure.ac nxcomp/nxcomp.pc.in + nxcomp/src/Makefile.am + nxcompshad/Makefile.am nxcompshad/VERSION - nxcompshad/install-sh + nxcompshad/configure.ac nxcompshad/nxcompshad.pc.in - nxproxy/Makefile.in + nxcompshad/src/Makefile.am + nxproxy/Makefile.am nxproxy/VERSION - nxproxy/configure.in - nxproxy/install-sh + nxproxy/configure.ac + nxproxy/man/Makefile.am nxproxy/man/nxproxy.1 - nxproxy/mkinstalldirs -Copyright: *No copyright* -License: UNKNOWN - FIXME - -Files: nx-X11/include/DECkeysym.h - nx-X11/include/HPkeysym.h - nx-X11/include/X.h - nx-X11/include/Xmd.h - nx-X11/include/Xproto.h - nx-X11/include/Xprotostr.h - nx-X11/include/extensions/sync.h - nx-X11/include/extensions/syncstr.h - nx-X11/include/keysym.h - nx-X11/include/keysymdef.h - nx-X11/lib/X11/ErrDes.c - nx-X11/lib/X11/GetDflt.c - nx-X11/lib/X11/GetHints.c - nx-X11/lib/X11/GetStCmap.c - nx-X11/lib/X11/GetWMCMapW.c - nx-X11/lib/X11/GetWMProto.c - nx-X11/lib/X11/ParseCmd.c - nx-X11/lib/X11/PolyReg.c - nx-X11/lib/X11/Region.c - nx-X11/lib/X11/SetHints.c - nx-X11/lib/X11/SetStCmap.c - nx-X11/lib/X11/SetWMCMapW.c - nx-X11/lib/X11/SetWMProto.c - nx-X11/lib/X11/Xatomtype.h - nx-X11/lib/X11/XimThai.h - nx-X11/lib/X11/Xregion.h - nx-X11/lib/X11/Xresource.h - nx-X11/lib/X11/Xutil.h - nx-X11/lib/X11/imThaiFlt.c - nx-X11/lib/X11/pathmax.h - nx-X11/lib/X11/poly.h - nx-X11/programs/Xserver/Xext/sync.c - nx-X11/programs/Xserver/dix/atom.c - nx-X11/programs/Xserver/dix/colormap.c - nx-X11/programs/Xserver/dix/cursor.c - nx-X11/programs/Xserver/dix/devices.c - nx-X11/programs/Xserver/dix/extension.c - nx-X11/programs/Xserver/dix/gc.c - nx-X11/programs/Xserver/dix/globals.c - nx-X11/programs/Xserver/dix/glyphcurs.c - nx-X11/programs/Xserver/dix/grabs.c - nx-X11/programs/Xserver/dix/property.c - nx-X11/programs/Xserver/dix/swaprep.c - nx-X11/programs/Xserver/dix/swapreq.c - nx-X11/programs/Xserver/dix/tables.c - nx-X11/programs/Xserver/include/closure.h - nx-X11/programs/Xserver/include/colormap.h - nx-X11/programs/Xserver/include/colormapst.h - nx-X11/programs/Xserver/include/cursor.h - nx-X11/programs/Xserver/include/cursorstr.h - nx-X11/programs/Xserver/include/dix.h - nx-X11/programs/Xserver/include/extension.h - nx-X11/programs/Xserver/include/extnsionst.h - nx-X11/programs/Xserver/include/gc.h - nx-X11/programs/Xserver/include/gcstruct.h - nx-X11/programs/Xserver/include/input.h - nx-X11/programs/Xserver/include/inputstr.h - nx-X11/programs/Xserver/include/miscstruct.h - nx-X11/programs/Xserver/include/os.h - nx-X11/programs/Xserver/include/pixmap.h - nx-X11/programs/Xserver/include/pixmapstr.h - nx-X11/programs/Xserver/include/property.h - nx-X11/programs/Xserver/include/propertyst.h - nx-X11/programs/Xserver/include/region.h - nx-X11/programs/Xserver/include/regionstr.h - nx-X11/programs/Xserver/include/resource.h - nx-X11/programs/Xserver/include/rgb.h - nx-X11/programs/Xserver/include/screenint.h - nx-X11/programs/Xserver/include/scrnintstr.h - nx-X11/programs/Xserver/include/selection.h - nx-X11/programs/Xserver/include/servermd.h - nx-X11/programs/Xserver/include/site.h - nx-X11/programs/Xserver/include/window.h - nx-X11/programs/Xserver/include/windowstr.h - nx-X11/programs/Xserver/mi/mi.h - nx-X11/programs/Xserver/mi/miarc.c - nx-X11/programs/Xserver/mi/mibitblt.c - nx-X11/programs/Xserver/mi/micursor.c - nx-X11/programs/Xserver/mi/midash.c - nx-X11/programs/Xserver/mi/mifillrct.c - nx-X11/programs/Xserver/mi/mifpoly.h - nx-X11/programs/Xserver/mi/mifpolycon.c - nx-X11/programs/Xserver/mi/miglblt.c - nx-X11/programs/Xserver/mi/miinitext.c - nx-X11/programs/Xserver/mi/mipoly.c - nx-X11/programs/Xserver/mi/mipolycon.c - nx-X11/programs/Xserver/mi/mipolygen.c - nx-X11/programs/Xserver/mi/mipolypnt.c - nx-X11/programs/Xserver/mi/mipolyrect.c - nx-X11/programs/Xserver/mi/mipolyseg.c - nx-X11/programs/Xserver/mi/mipolytext.c - nx-X11/programs/Xserver/mi/mipolyutil.c - nx-X11/programs/Xserver/mi/mipushpxl.c - nx-X11/programs/Xserver/mi/mispans.c - nx-X11/programs/Xserver/mi/mispans.h - nx-X11/programs/Xserver/mi/mistruct.h - nx-X11/programs/Xserver/mi/miwindow.c - nx-X11/programs/Xserver/mi/mizerclip.c - nx-X11/programs/Xserver/mi/mizerline.c - nx-X11/programs/Xserver/os/connection.c - nx-X11/programs/Xserver/os/io.c - nx-X11/programs/Xserver/os/oscolor.c - nx-X11/programs/Xserver/os/osdep.h - nx-X11/programs/Xserver/os/osinit.c -Copyright: 1987, 1989 Digital Equipment Corporation, Maynard, Massachusetts - 1987, 1989, 1998, The Open Group - 1987, 1994, 1998, The Open Group - 1987, 1998 The Open Group - 1987, Digital Equipment Corporation, Maynard, Massachusetts - 1987-1988, 1998 The Open Group - 1987-1988, Digital Equipment Corporation, Maynard, Massachusetts - 1988, 1998 The Open Group - 1988, Digital Equipment Corporation, Maynard, Massachusetts - 1989, 1998 The Open Group - 1989, Digital Equipment Corporation, Maynard, Massachusetts - 1991, 1993 Digital Equipment Corporation, Maynard, Massachusetts - 1991, 1993, 1998, The Open Group - 1991, 1993-1994, 1998 The Open Group - 1991,1993, Digital Equipment Corporation, Maynard, Massachusetts - 1993, 1998 The Open Group - 1993, Digital Equipment Corporation, Maynard, Massachusetts + nxproxy/src/Makefile.am +Copyright: NONE License: UNKNOWN FIXME @@ -1360,8 +1426,9 @@ Files: nx-X11/include/extensions/composite.h nx-X11/include/extensions/compositeproto.h nx-X11/include/extensions/damageproto.h nx-X11/include/extensions/damagewire.h - nx-X11/lib/X11/x11_trans.c - nx-X11/lib/X11/xim_trans.c + nx-X11/lib/include/X11/XlibConf.h.in + nx-X11/lib/src/x11_trans.c + nx-X11/lib/src/xlibi18n/xim_trans.c nx-X11/programs/Xserver/Xext/shmint.h nx-X11/programs/Xserver/composite/compalloc.c nx-X11/programs/Xserver/composite/compext.c @@ -1427,16 +1494,17 @@ Files: nx-X11/include/extensions/composite.h nx-X11/programs/Xserver/xfixes/xfixes.c nx-X11/programs/Xserver/xfixes/xfixes.h nx-X11/programs/Xserver/xfixes/xfixesint.h - nxcompshad/X11/include/Xdamage_nxcompshad.h + nxcompshad/src/X11/include/Xdamage_nxcompshad.h Copyright: 1998, Keith Packard 1999, Keith Packard 2002, Keith Packard 2003, Keith Packard 2004, Keith Packard + 2005, Keith Packard 2006, Keith Packard 2007, Keith Packard 2014, Keith Packard -License: UNKNOWN +License: NTP (legal disclaimer) FIXME Files: nx-X11/include/extensions/XKB.h @@ -1449,27 +1517,27 @@ Files: nx-X11/include/extensions/XKB.h nx-X11/include/extensions/XKBstr.h nx-X11/include/extensions/XKM.h nx-X11/include/extensions/XKMformat.h - nx-X11/lib/X11/XKB.c - nx-X11/lib/X11/XKBAlloc.c - nx-X11/lib/X11/XKBBell.c - nx-X11/lib/X11/XKBCompat.c - nx-X11/lib/X11/XKBCtrls.c - nx-X11/lib/X11/XKBExtDev.c - nx-X11/lib/X11/XKBGAlloc.c - nx-X11/lib/X11/XKBGeom.c - nx-X11/lib/X11/XKBGetByName.c - nx-X11/lib/X11/XKBGetMap.c - nx-X11/lib/X11/XKBList.c - nx-X11/lib/X11/XKBMAlloc.c - nx-X11/lib/X11/XKBMisc.c - nx-X11/lib/X11/XKBNames.c - nx-X11/lib/X11/XKBRdBuf.c - nx-X11/lib/X11/XKBSetGeom.c - nx-X11/lib/X11/XKBSetMap.c - nx-X11/lib/X11/XKBUse.c - nx-X11/lib/X11/XKBleds.c - nx-X11/lib/X11/XKBlib.h - nx-X11/lib/X11/XKBlibint.h + nx-X11/lib/include/X11/XKBlib.h + nx-X11/lib/src/xkb/XKB.c + nx-X11/lib/src/xkb/XKBAlloc.c + nx-X11/lib/src/xkb/XKBBell.c + nx-X11/lib/src/xkb/XKBCompat.c + nx-X11/lib/src/xkb/XKBCtrls.c + nx-X11/lib/src/xkb/XKBExtDev.c + nx-X11/lib/src/xkb/XKBGAlloc.c + nx-X11/lib/src/xkb/XKBGeom.c + nx-X11/lib/src/xkb/XKBGetByName.c + nx-X11/lib/src/xkb/XKBGetMap.c + nx-X11/lib/src/xkb/XKBList.c + nx-X11/lib/src/xkb/XKBMAlloc.c + nx-X11/lib/src/xkb/XKBMisc.c + nx-X11/lib/src/xkb/XKBNames.c + nx-X11/lib/src/xkb/XKBRdBuf.c + nx-X11/lib/src/xkb/XKBSetGeom.c + nx-X11/lib/src/xkb/XKBSetMap.c + nx-X11/lib/src/xkb/XKBUse.c + nx-X11/lib/src/xkb/XKBleds.c + nx-X11/lib/src/xkb/XKBlibint.h nx-X11/programs/Xserver/include/xkbfile.h nx-X11/programs/Xserver/include/xkbrules.h nx-X11/programs/Xserver/include/xkbsrv.h @@ -1509,77 +1577,78 @@ Files: nx-X11/include/extensions/XKB.h nx-X11/programs/Xserver/xkb/xkbout.c nx-X11/programs/Xserver/xkb/xkbtext.c nx-X11/programs/Xserver/xkb/xkmread.c -Copyright: 1993, Silicon Graphics Computer Systems, Inc - 1994, Silicon Graphics Computer Systems, Inc - 1995, Silicon Graphics Computer Systems, Inc - 1996, Silicon Graphics Computer Systems, Inc -License: UNKNOWN - FIXME - -Files: nx-X11/lib/X11/AddDIC.c - nx-X11/lib/X11/AddSF.c - nx-X11/lib/X11/CvColW.c - nx-X11/lib/X11/CvCols.c - nx-X11/lib/X11/HVC.c - nx-X11/lib/X11/HVCGcC.c - nx-X11/lib/X11/HVCGcV.c - nx-X11/lib/X11/HVCGcVC.c - nx-X11/lib/X11/HVCMnV.c - nx-X11/lib/X11/HVCMxC.c - nx-X11/lib/X11/HVCMxV.c - nx-X11/lib/X11/HVCMxVC.c - nx-X11/lib/X11/HVCMxVs.c - nx-X11/lib/X11/HVCWpAj.c - nx-X11/lib/X11/IdOfPr.c - nx-X11/lib/X11/LRGB.c - nx-X11/lib/X11/Lab.c - nx-X11/lib/X11/LabGcC.c - nx-X11/lib/X11/LabGcL.c - nx-X11/lib/X11/LabGcLC.c - nx-X11/lib/X11/LabMnL.c - nx-X11/lib/X11/LabMxC.c - nx-X11/lib/X11/LabMxL.c - nx-X11/lib/X11/LabMxLC.c - nx-X11/lib/X11/LabWpAj.c - nx-X11/lib/X11/Luv.c - nx-X11/lib/X11/LuvGcC.c - nx-X11/lib/X11/LuvGcL.c - nx-X11/lib/X11/LuvGcLC.c - nx-X11/lib/X11/LuvMnL.c - nx-X11/lib/X11/LuvMxC.c - nx-X11/lib/X11/LuvMxL.c - nx-X11/lib/X11/LuvMxLC.c - nx-X11/lib/X11/LuvWpAj.c - nx-X11/lib/X11/OfCCC.c - nx-X11/lib/X11/PrOfId.c - nx-X11/lib/X11/QBlack.c - nx-X11/lib/X11/QBlue.c - nx-X11/lib/X11/QGreen.c - nx-X11/lib/X11/QRed.c - nx-X11/lib/X11/QWhite.c - nx-X11/lib/X11/QuCol.c - nx-X11/lib/X11/QuCols.c - nx-X11/lib/X11/SetCCC.c - nx-X11/lib/X11/SetGetCols.c - nx-X11/lib/X11/StCol.c - nx-X11/lib/X11/StCols.c - nx-X11/lib/X11/UNDEFINED.c - nx-X11/lib/X11/XRGB.c - nx-X11/lib/X11/XYZ.c - nx-X11/lib/X11/Xcms.h - nx-X11/lib/X11/Xcmsint.h - nx-X11/lib/X11/cmsAllCol.c - nx-X11/lib/X11/cmsAllNCol.c - nx-X11/lib/X11/cmsCmap.c - nx-X11/lib/X11/cmsColNm.c - nx-X11/lib/X11/cmsGlobls.c - nx-X11/lib/X11/cmsInt.c - nx-X11/lib/X11/cmsLkCol.c - nx-X11/lib/X11/cmsProp.c - nx-X11/lib/X11/cmsTrig.c - nx-X11/lib/X11/uvY.c - nx-X11/lib/X11/xyY.c -Copyright: 1990, 1991 Tektronix, Inc +Copyright: 1993, Silicon Graphics Computer Systems, Inc. + 1994, Silicon Graphics Computer Systems, Inc. + 1995, Silicon Graphics Computer Systems, Inc. + 1996, Silicon Graphics Computer Systems, Inc. +License: UNKNOWN + FIXME + +Files: nx-X11/lib/include/X11/Xcms.h + nx-X11/lib/src/xcms/AddDIC.c + nx-X11/lib/src/xcms/AddSF.c + nx-X11/lib/src/xcms/CCC.c + nx-X11/lib/src/xcms/CvColW.c + nx-X11/lib/src/xcms/CvCols.c + nx-X11/lib/src/xcms/HVC.c + nx-X11/lib/src/xcms/HVCGcC.c + nx-X11/lib/src/xcms/HVCGcV.c + nx-X11/lib/src/xcms/HVCGcVC.c + nx-X11/lib/src/xcms/HVCMnV.c + nx-X11/lib/src/xcms/HVCMxC.c + nx-X11/lib/src/xcms/HVCMxV.c + nx-X11/lib/src/xcms/HVCMxVC.c + nx-X11/lib/src/xcms/HVCMxVs.c + nx-X11/lib/src/xcms/HVCWpAj.c + nx-X11/lib/src/xcms/IdOfPr.c + nx-X11/lib/src/xcms/LRGB.c + nx-X11/lib/src/xcms/Lab.c + nx-X11/lib/src/xcms/LabGcC.c + nx-X11/lib/src/xcms/LabGcL.c + nx-X11/lib/src/xcms/LabGcLC.c + nx-X11/lib/src/xcms/LabMnL.c + nx-X11/lib/src/xcms/LabMxC.c + nx-X11/lib/src/xcms/LabMxL.c + nx-X11/lib/src/xcms/LabMxLC.c + nx-X11/lib/src/xcms/LabWpAj.c + nx-X11/lib/src/xcms/Luv.c + nx-X11/lib/src/xcms/LuvGcC.c + nx-X11/lib/src/xcms/LuvGcL.c + nx-X11/lib/src/xcms/LuvGcLC.c + nx-X11/lib/src/xcms/LuvMnL.c + nx-X11/lib/src/xcms/LuvMxC.c + nx-X11/lib/src/xcms/LuvMxL.c + nx-X11/lib/src/xcms/LuvMxLC.c + nx-X11/lib/src/xcms/LuvWpAj.c + nx-X11/lib/src/xcms/OfCCC.c + nx-X11/lib/src/xcms/PrOfId.c + nx-X11/lib/src/xcms/QBlack.c + nx-X11/lib/src/xcms/QBlue.c + nx-X11/lib/src/xcms/QGreen.c + nx-X11/lib/src/xcms/QRed.c + nx-X11/lib/src/xcms/QWhite.c + nx-X11/lib/src/xcms/QuCol.c + nx-X11/lib/src/xcms/QuCols.c + nx-X11/lib/src/xcms/SetCCC.c + nx-X11/lib/src/xcms/SetGetCols.c + nx-X11/lib/src/xcms/StCol.c + nx-X11/lib/src/xcms/StCols.c + nx-X11/lib/src/xcms/UNDEFINED.c + nx-X11/lib/src/xcms/XRGB.c + nx-X11/lib/src/xcms/XYZ.c + nx-X11/lib/src/xcms/Xcmsint.h + nx-X11/lib/src/xcms/cmsAllCol.c + nx-X11/lib/src/xcms/cmsAllNCol.c + nx-X11/lib/src/xcms/cmsCmap.c + nx-X11/lib/src/xcms/cmsColNm.c + nx-X11/lib/src/xcms/cmsGlobls.c + nx-X11/lib/src/xcms/cmsInt.c + nx-X11/lib/src/xcms/cmsLkCol.c + nx-X11/lib/src/xcms/cmsProp.c + nx-X11/lib/src/xcms/cmsTrig.c + nx-X11/lib/src/xcms/uvY.c + nx-X11/lib/src/xcms/xyY.c +Copyright: 1990-1991, Tektronix, Inc. License: UNKNOWN FIXME @@ -1591,11 +1660,6 @@ Files: nx-X11/extras/Mesa/include/GL/glext.h nx-X11/include/GL/glxmd.h nx-X11/include/GL/glxproto.h nx-X11/include/GL/glxtokens.h - nx-X11/programs/Xserver/GL/glx/g_disptab.c - nx-X11/programs/Xserver/GL/glx/g_disptab.h - nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c - nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h - nx-X11/programs/Xserver/GL/glx/g_render.c nx-X11/programs/Xserver/GL/glx/g_renderswap.c nx-X11/programs/Xserver/GL/glx/g_single.c nx-X11/programs/Xserver/GL/glx/g_singleswap.c @@ -1636,9 +1700,9 @@ Files: nx-X11/extras/Mesa/include/GL/glext.h nx-X11/programs/Xserver/GL/glx/singlesize.h nx-X11/programs/Xserver/GL/glx/unpack.h nx-X11/programs/Xserver/GL/glx/xfont.c -Copyright: 1991-2000, Silicon Graphics, Inc - 1991-2004, Silicon Graphics, Inc -License: UNKNOWN +Copyright: 1991-2000, Silicon Graphics, Inc. + 1991-2004, Silicon Graphics, Inc. +License: SGI Free Software License B (v1.1) FIXME Files: nx-X11/programs/Xserver/Xext/xtest1dd.h @@ -1690,51 +1754,39 @@ Copyright: 1996, Thomas E. Dickey License: UNKNOWN FIXME -Files: nx-X11/include/extensions/XI.h - nx-X11/include/extensions/XIproto.h - nx-X11/programs/Xserver/Xi/allowev.c - nx-X11/programs/Xserver/Xi/chgdctl.c - nx-X11/programs/Xserver/Xi/chgfctl.c - nx-X11/programs/Xserver/Xi/chgkbd.c - nx-X11/programs/Xserver/Xi/chgkmap.c - nx-X11/programs/Xserver/Xi/chgprop.c - nx-X11/programs/Xserver/Xi/chgptr.c - nx-X11/programs/Xserver/Xi/closedev.c - nx-X11/programs/Xserver/Xi/devbell.c - nx-X11/programs/Xserver/Xi/exevents.c - nx-X11/programs/Xserver/Xi/extinit.c - nx-X11/programs/Xserver/Xi/getbmap.c - nx-X11/programs/Xserver/Xi/getdctl.c - nx-X11/programs/Xserver/Xi/getfctl.c - nx-X11/programs/Xserver/Xi/getfocus.c - nx-X11/programs/Xserver/Xi/getkmap.c - nx-X11/programs/Xserver/Xi/getmmap.c - nx-X11/programs/Xserver/Xi/getprop.c - nx-X11/programs/Xserver/Xi/getselev.c - nx-X11/programs/Xserver/Xi/getvers.c - nx-X11/programs/Xserver/Xi/grabdev.c - nx-X11/programs/Xserver/Xi/grabdevb.c - nx-X11/programs/Xserver/Xi/grabdevk.c - nx-X11/programs/Xserver/Xi/gtmotion.c - nx-X11/programs/Xserver/Xi/listdev.c - nx-X11/programs/Xserver/Xi/opendev.c - nx-X11/programs/Xserver/Xi/selectev.c - nx-X11/programs/Xserver/Xi/sendexev.c - nx-X11/programs/Xserver/Xi/setbmap.c - nx-X11/programs/Xserver/Xi/setdval.c - nx-X11/programs/Xserver/Xi/setfocus.c - nx-X11/programs/Xserver/Xi/setmmap.c - nx-X11/programs/Xserver/Xi/setmode.c - nx-X11/programs/Xserver/Xi/stubs.c - nx-X11/programs/Xserver/Xi/ungrdev.c - nx-X11/programs/Xserver/Xi/ungrdevb.c - nx-X11/programs/Xserver/Xi/ungrdevk.c -Copyright: 1989, 1998 The Open Group - 1989, Hewlett-Packard Company, Palo Alto, California -License: UNKNOWN +Files: nx-X11/lib/modules/lc/def/lcDefConv.c + nx-X11/lib/modules/lc/gen/lcGenConv.c + nx-X11/lib/modules/om/generic/omDefault.c + nx-X11/lib/modules/om/generic/omGeneric.c + nx-X11/lib/modules/om/generic/omImText.c + nx-X11/lib/modules/om/generic/omText.c + nx-X11/lib/modules/om/generic/omTextEsc.c + nx-X11/lib/modules/om/generic/omTextExt.c + nx-X11/lib/modules/om/generic/omTextPer.c + nx-X11/lib/modules/om/generic/omXChar.c + nx-X11/lib/src/OCWrap.c + nx-X11/lib/src/OMWrap.c + nx-X11/lib/src/XomGeneric.h + nx-X11/lib/src/xlibi18n/XlcGeneric.h + nx-X11/lib/src/xlibi18n/XlcPubI.h + nx-X11/lib/src/xlibi18n/XlcPublic.h + nx-X11/lib/src/xlibi18n/lcCT.c + nx-X11/lib/src/xlibi18n/lcCharSet.c + nx-X11/lib/src/xlibi18n/lcConv.c + nx-X11/lib/src/xlibi18n/lcGeneric.c + nx-X11/lib/src/xlibi18n/lcPrTxt.c + nx-X11/lib/src/xlibi18n/lcPubWrap.c + nx-X11/lib/src/xlibi18n/lcPublic.c + nx-X11/lib/src/xlibi18n/lcRM.c + nx-X11/lib/src/xlibi18n/lcStd.c + nx-X11/lib/src/xlibi18n/lcTxtPr.c + nx-X11/lib/src/xlibi18n/lcUtil.c +Copyright: 1992-1993, TOSHIBA Corp. +License: NTP (legal disclaimer) FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/Args.c +Files: nx-X11/include/Xpoll.h.in + nx-X11/programs/Xserver/hw/nxagent/Args.c nx-X11/programs/Xserver/hw/nxagent/Args.h nx-X11/programs/Xserver/hw/nxagent/Colormap.c nx-X11/programs/Xserver/hw/nxagent/Colormap.h @@ -1758,36 +1810,14 @@ Files: nx-X11/programs/Xserver/hw/nxagent/Args.c nx-X11/programs/Xserver/hw/nxagent/Screen.h nx-X11/programs/Xserver/hw/nxagent/TestExt.c nx-X11/programs/Xserver/hw/nxagent/Visual.c - nx-X11/programs/Xserver/hw/nxagent/Visual.h -Copyright: 1993, Davor Matic - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN - FIXME - -Files: nx-X11/lib/X11/OCWrap.c - nx-X11/lib/X11/OMWrap.c - nx-X11/lib/X11/XlcPubI.h - nx-X11/lib/X11/lcCharSet.c - nx-X11/lib/X11/lcConv.c - nx-X11/lib/X11/lcDefConv.c - nx-X11/lib/X11/lcPrTxt.c - nx-X11/lib/X11/lcPubWrap.c - nx-X11/lib/X11/lcPublic.c - nx-X11/lib/X11/lcRM.c - nx-X11/lib/X11/lcStd.c - nx-X11/lib/X11/lcTxtPr.c - nx-X11/lib/X11/lcUtil.c - nx-X11/lib/X11/omImText.c - nx-X11/lib/X11/omTextExt.c - nx-X11/lib/X11/omTextPer.c -Copyright: 1992-1993, TOSHIBA Corp -License: UNKNOWN +Copyright: 2001, 2011, NoMachine (http:www.nomachine.com) + 2008-2014, Oleksandr Shneyder + 2011-2016, Mike Gabriel + 2014-2016, Mihai Moldovan + 2014-2016, Ulrich Sibiller + 2015-2016, Qindel Group (http:www.qindel.com) + of the aforementioned persons and companies. +License: NTP FIXME Files: nx-X11/include/extensions/render.h @@ -1805,8 +1835,8 @@ Files: nx-X11/include/extensions/render.h nx-X11/programs/Xserver/render/picture.h nx-X11/programs/Xserver/render/picturestr.h nx-X11/programs/Xserver/render/render.c -Copyright: 2000, SuSE, Inc -License: UNKNOWN +Copyright: 2000, SuSE, Inc. +License: NTP (legal disclaimer) FIXME Files: nx-X11/include/extensions/dpms.h @@ -1820,83 +1850,106 @@ Files: nx-X11/include/extensions/dpms.h nx-X11/programs/Xserver/Xext/panoramiXSwap.c nx-X11/programs/Xserver/Xext/panoramiXprocs.c nx-X11/programs/Xserver/dix/dixfonts.c + nx-X11/programs/Xserver/include/dixfont.h + nx-X11/programs/Xserver/include/dixfontstr.h + nx-X11/programs/Xserver/include/dixstruct.h nx-X11/programs/Xserver/randr/panoramiXproto.h -Copyright: 1987, Digital Equipment Corporation, Maynard, Massachusetts - 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts - 1996, Digital Equipment Corporation, Maynard, Massachusetts -License: Expat - FIXME - -Files: nx-X11/lib/X11/XimImSw.h - nx-X11/lib/X11/XimProto.h - nx-X11/lib/X11/imDefFlt.c - nx-X11/lib/X11/imDefLkup.c - nx-X11/lib/X11/imDispch.c - nx-X11/lib/X11/imExten.c - nx-X11/lib/X11/imInt.c - nx-X11/lib/X11/imLcGIc.c - nx-X11/lib/X11/imLcIc.c - nx-X11/lib/X11/imLcSIc.c - nx-X11/lib/X11/imRmAttr.c +Copyright: 1987, Digital Equipment Corporation, Maynard, Massachusetts. + 1991, 1997, Digital Equipment Corporation, Maynard, Massachusetts. + 1996, Digital Equipment Corporation, Maynard, Massachusetts. +License: UNKNOWN + FIXME + +Files: nx-X11/lib/include/xtrans/Xtrans.c + nx-X11/lib/include/xtrans/Xtrans.h + nx-X11/lib/include/xtrans/Xtransint.h + nx-X11/lib/include/xtrans/Xtranslcl.c + nx-X11/lib/include/xtrans/Xtransutil.c + nx-X11/lib/include/xtrans/transport.c + nx-X11/lib/src/xlibi18n/Xlcint.h + nx-X11/lib/src/xlibi18n/lcWrap.c + nx-X11/lib/src/xlibi18n/mbWrap.c + nx-X11/lib/src/xlibi18n/utf8WMProps.c + nx-X11/lib/src/xlibi18n/utf8Wrap.c + nx-X11/lib/src/xlibi18n/wcWrap.c + nx-X11/programs/Xserver/Xext/sync.c + nx-X11/programs/Xserver/include/misc.h +Copyright: 1987, 1998, The Open Group + 1991, 1993, 1998, The Open Group + 1991, 1998, The Open Group + 1993-1994, 1998, The Open Group +License: NTP (legal disclaimer) + FIXME + +Files: nx-X11/programs/Xserver/hw/nxagent/NXdamage.c + nx-X11/programs/Xserver/hw/nxagent/NXglyph.c + nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphRef.h + nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphSet.h + nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c + nx-X11/programs/Xserver/hw/nxagent/NXpicture.c + nx-X11/programs/Xserver/hw/nxagent/NXpicturestr_PictSolidFill.h + nx-X11/programs/Xserver/hw/nxagent/NXrender.c + nx-X11/programs/Xserver/randr/randr.c + nx-X11/programs/Xserver/randr/rrcrtc.c + nx-X11/programs/Xserver/randr/rrmode.c + nx-X11/programs/Xserver/randr/rrscreen.c + nx-X11/programs/Xserver/randr/rrxinerama.c +Copyright: 2001, 2011, NoMachine (http:www.nomachine.com) + 2008-2014, Oleksandr Shneyder + 2011-2016, Mike Gabriel + 2014-2016, Mihai Moldovan + 2014-2016, Ulrich Sibiller + 2015-2016, Qindel Group (http:www.qindel.com) + of the aforementioned persons and companies. +License: NTP (legal disclaimer) + FIXME + +Files: nx-X11/lib/modules/im/ximcp/imDefFlt.c + nx-X11/lib/modules/im/ximcp/imDefLkup.c + nx-X11/lib/modules/im/ximcp/imDispch.c + nx-X11/lib/modules/im/ximcp/imExten.c + nx-X11/lib/modules/im/ximcp/imInt.c + nx-X11/lib/modules/im/ximcp/imLcGIc.c + nx-X11/lib/modules/im/ximcp/imLcIc.c + nx-X11/lib/modules/im/ximcp/imLcSIc.c + nx-X11/lib/modules/im/ximcp/imRmAttr.c + nx-X11/lib/src/xlibi18n/XimImSw.h + nx-X11/lib/src/xlibi18n/XimProto.h Copyright: 1990-1994, FUJITSU LIMITED 1992-1993, FUJITSU LIMITED 1992-1994, FUJITSU LIMITED 1993-1994, FUJITSU LIMITED -License: UNKNOWN - FIXME - -Files: nx-X11/lib/X11/XlcGeneric.h - nx-X11/lib/X11/XlcPublic.h - nx-X11/lib/X11/XomGeneric.h - nx-X11/lib/X11/lcCT.c - nx-X11/lib/X11/lcGenConv.c - nx-X11/lib/X11/lcGeneric.c - nx-X11/lib/X11/omDefault.c - nx-X11/lib/X11/omGeneric.c - nx-X11/lib/X11/omText.c - nx-X11/lib/X11/omTextEsc.c - nx-X11/lib/X11/omXChar.c -Copyright: 1992-1993, TOSHIBA Corp - 1995, FUJITSU LIMITED -License: UNKNOWN - FIXME - -Files: nx-X11/include/extensions/Xv.h - nx-X11/include/extensions/Xvproto.h - nx-X11/lib/X11/imEvToWire.c - nx-X11/programs/Xserver/Xext/xvdisp.c - nx-X11/programs/Xserver/Xext/xvdix.h - nx-X11/programs/Xserver/Xext/xvmain.c - nx-X11/programs/Xserver/include/dixfont.h - nx-X11/programs/Xserver/include/dixfontstr.h - nx-X11/programs/Xserver/include/dixstruct.h -Copyright: 1987, Digital Equipment Corporation, Maynard, Massachusetts - 1991, Digital Equipment Corporation, Maynard, Massachusetts - 1993, Digital Equipment Corporation, Maynard, Massachusetts -License: UNKNOWN +License: NTP (legal disclaimer) FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c - nx-X11/programs/Xserver/hw/nxagent/NXevents.c - nx-X11/programs/Xserver/hw/nxagent/NXextension.c - nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c - nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c - nx-X11/programs/Xserver/hw/nxagent/NXproperty.c - nx-X11/programs/Xserver/hw/nxagent/NXresource.c - nx-X11/programs/Xserver/hw/nxagent/NXwindow.c - nx-X11/programs/Xserver/os/WaitFor.c -Copyright: 1987, 1989 Digital Equipment Corporation, Maynard, Massachusetts - 1987, 1989, 1998, The Open Group - 1987, 1998 The Open Group - 1987, Digital Equipment Corporation, Maynard, Massachusetts - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: doc/libNX_X11/lcUniConv/README + nx-X11/config/cf/Imake.rules + nx-X11/config/cf/Imake.tmpl + nx-X11/config/cf/X11.tmpl + nx-X11/extras/Mesa/src/mesa/main/get.c + nx-X11/include/Xatom.h + nx-X11/lib/src/util/mkks.sh + nx-X11/programs/Xserver/dix/buildatoms + nx-X11/programs/Xserver/dix/initatoms.c + nx-X11/programs/Xserver/xkb/xkbDflts.h +Copyright: NONE +License: GENERATED FILE + FIXME + +Files: nx-X11/lib/modules/im/ximcp/imDefIc.c + nx-X11/lib/modules/im/ximcp/imTrX.c + nx-X11/lib/modules/im/ximcp/imTrans.c + nx-X11/lib/modules/im/ximcp/imTransR.c + nx-X11/lib/src/xlibi18n/XimTrInt.h + nx-X11/lib/src/xlibi18n/XimTrX.h + nx-X11/lib/src/xlibi18n/XimTrans.h + nx-X11/lib/src/xlibi18n/XimintP.h + nx-X11/programs/Xserver/composite/compoverlay.c + nx-X11/programs/Xserver/hw/nxagent/X11/include/Xcomposite_nxagent.h +Copyright: 1991-1992, Oracle and/or its affiliates. + 1992, Oracle and/or its affiliates. + 2006, Oracle and/or its affiliates. +License: NTP (legal disclaimer) FIXME Files: nx-X11/include/extensions/xfixesproto.h @@ -1908,35 +1961,10 @@ Files: nx-X11/include/extensions/xfixesproto.h nx-X11/programs/Xserver/render/mirect.c nx-X11/programs/Xserver/render/mitrap.c nx-X11/programs/Xserver/render/mitri.c -Copyright: 2000, Keith Packard, member of The XFree86 Project, Inc - 2001, Keith Packard, member of The XFree86 Project, Inc - 2002, Keith Packard, member of The XFree86 Project, Inc -License: UNKNOWN - FIXME - -Files: nx-X11/lib/X11/ConnDis.c - nx-X11/lib/X11/OpenDis.c - nx-X11/lib/X11/XlibAsync.c - nx-X11/lib/X11/XlibInt.c - nx-X11/lib/X11/Xlibint.h - nx-X11/programs/Xserver/Xext/security.c - nx-X11/programs/Xserver/hw/nxagent/NXshm.c - nx-X11/programs/Xserver/os/auth.c -Copyright: 1984-1985, 1987, 1989, 1998 The Open Group - 1985-1986, 1998 The Open Group - 1985-1987, 1998 The Open Group - 1988, 1998 The Open Group - 1989, 1998 The Open Group - 1992, 1998 The Open Group - 1996, 1998 The Open Group - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Copyright: 2000, Keith Packard, member of The XFree86 Project, Inc. + 2001, Keith Packard, member of The XFree86 Project, Inc. + 2002, Keith Packard, member of The XFree86 Project, Inc. +License: NTP (legal disclaimer) FIXME Files: @@ -1946,24 +1974,10 @@ Files: -Copyright: +Copyright: NONE License: FIXME -Files: nx-X11/lib/X11/XimTrInt.h - nx-X11/lib/X11/XimTrX.h - nx-X11/lib/X11/XimTrans.h - nx-X11/lib/X11/imDefIc.c - nx-X11/lib/X11/imTrX.c - nx-X11/lib/X11/imTrans.c - nx-X11/lib/X11/imTransR.c -Copyright: 1991-1992, Oracle and/or its affiliates. - 1992, Oracle and/or its affiliates. - 1992-1994, FUJITSU LIMITED - 1993-1994, FUJITSU LIMITED -License: Expat - FIXME - Files: nx-X11/extras/Mesa/src/mesa/tnl/t_save_api.c nx-X11/extras/Mesa/src/mesa/tnl/t_save_api.h nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_api.c @@ -1971,23 +1985,9 @@ Files: nx-X11/extras/Mesa/src/mesa/tnl/t_save_api.c nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_generic.c nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_x86.c nx-X11/extras/Mesa/src/mesa/tnl/t_vtx_x86_gcc.S -Copyright: 2002, Tungsten Graphics Inc., Cedar Park, Texas - 2004, Tungsten Graphics Inc., Cedar Park, Texas -License: Expat - FIXME - -Files: nx-X11/programs/Xserver/dix/dispatch.c - nx-X11/programs/Xserver/dix/events.c - nx-X11/programs/Xserver/dix/main.c - nx-X11/programs/Xserver/dix/resource.c - nx-X11/programs/Xserver/dix/window.c - nx-X11/programs/Xserver/mi/miexpose.c -Copyright: 1987, 1989 Digital Equipment Corporation, Maynard, Massachusetts - 1987, 1989, 1998, The Open Group - 1987, 1998 The Open Group - 1987, Digital Equipment Corporation, Maynard, Massachusetts - 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts -License: Expat +Copyright: 2002, Tungsten Graphics Inc., Cedar Park, Texas. + 2004, Tungsten Graphics Inc., Cedar Park, Texas. +License: UNKNOWN FIXME Files: nx-X11/include/extensions/Xdbeproto.h @@ -1997,55 +1997,49 @@ Files: nx-X11/include/extensions/Xdbeproto.h nx-X11/programs/Xserver/dbe/midbe.h nx-X11/programs/Xserver/dbe/midbestr.h Copyright: 1994-1995, Hewlett-Packard Company -License: Expat +License: MIT/X11 (BSD like) FIXME -Files: nx-X11/lib/xtrans/Xtrans.c - nx-X11/lib/xtrans/Xtrans.h - nx-X11/lib/xtrans/Xtransint.h - nx-X11/lib/xtrans/Xtranslcl.c - nx-X11/lib/xtrans/Xtransutil.c - nx-X11/lib/xtrans/transport.c -Copyright: 1993-1994, 1998 The Open Group - 1993-1994, NCR Corporation - Dayton, Ohio, USA +Files: nx-X11/include/extensions/Xv.h + nx-X11/include/extensions/Xvproto.h + nx-X11/lib/modules/im/ximcp/imEvToWire.c + nx-X11/programs/Xserver/Xext/xvdisp.c + nx-X11/programs/Xserver/Xext/xvdix.h + nx-X11/programs/Xserver/Xext/xvmain.c +Copyright: 1991, Digital Equipment Corporation, Maynard, Massachusetts, + 1993, Digital Equipment Corporation, Maynard, Massachusetts, License: UNKNOWN FIXME -Files: nx-X11/extras/Mesa/include/GL/xmesa_xf86.h - nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c - nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c - nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h - nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h -Copyright: 1998-1999, Precision Insight, Inc., Cedar Park, Texas -License: Expat +Files: m4/nx-macros.m4 + nx-X11/lib/m4/nx-macros.m4 + nxcomp/m4/nx-macros.m4 + nxcompshad/m4/nx-macros.m4 + nxproxy/m4/nx-macros.m4 +Copyright: 2005-2006, Oracle and/or its affiliates. + 2017, Mike Gabriel +License: GENERATED FILE FIXME -Files: nx-X11/lib/X11/XimintL.h - nx-X11/lib/X11/imImSw.c - nx-X11/lib/X11/imLcIm.c - nx-X11/lib/X11/imThaiIc.c - nx-X11/lib/X11/imThaiIm.c +Files: nx-X11/lib/modules/im/ximcp/imImSw.c + nx-X11/lib/modules/im/ximcp/imLcIm.c + nx-X11/lib/modules/im/ximcp/imThaiIc.c + nx-X11/lib/modules/im/ximcp/imThaiIm.c + nx-X11/lib/src/xlibi18n/XimintL.h Copyright: 1991-1994, FUJITSU LIMITED 1992-1993, FUJITSU LIMITED 1992-1994, FUJITSU LIMITED 1993, Digital Equipment Corporation -License: UNKNOWN +License: NTP (legal disclaimer) FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/NXglyph.c - nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphRef.h - nx-X11/programs/Xserver/hw/nxagent/NXglyphstr_GlyphSet.h - nx-X11/programs/Xserver/hw/nxagent/NXpicture.c - nx-X11/programs/Xserver/hw/nxagent/NXrender.c -Copyright: 2000, SuSE, Inc - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: nx-X11/programs/Xserver/GL/glx/g_disptab.c + nx-X11/programs/Xserver/GL/glx/g_disptab.h + nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c + nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h + nx-X11/programs/Xserver/GL/glx/g_render.c +Copyright: 1991-2000, Silicon Graphics, Inc. +License: SGI Free Software License B (v1.1) GENERATED FILE FIXME Files: testscripts/run-nxproxy2nxagent-on-localhost @@ -2053,31 +2047,29 @@ Files: testscripts/run-nxproxy2nxagent-on-localhost testscripts/run-nxproxy2nxagent-over-sockets testscripts/run-nxproxy2nxproxy testscripts/run-nxproxy2nxproxy-over-sockets -Copyright: 2001, 2011 NoMachine, http://www.nomachine.com/. */ - 2015-2016, Mike Gabriel */ - of the aforementioned persons and companies. */ +Copyright: 2001, 2011, NoMachine, http:www.nomachine.com/. + 2015-2016, Mike Gabriel + of the aforementioned persons and companies. License: UNKNOWN FIXME -Files: nx-X11/include/Sunkeysym.h - nx-X11/lib/X11/Host.c - nx-X11/lib/X11/LiHosts.c - nx-X11/lib/X11/lcInit.c -Copyright: 1985-1987, 1991, 1998, The Open Group - 1986, 1998 The Open Group - 1991, 1998 The Open Group - 1991, Oracle and/or its affiliates. - 2000, Oracle and/or its affiliates. - 2004, Oracle and/or its affiliates. -License: Expat +Files: nx-X11/extras/Mesa/include/GL/xmesa_xf86.h + nx-X11/programs/Xserver/GL/mesa/X/xf86glx.c + nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.c + nx-X11/programs/Xserver/GL/mesa/X/xf86glx_util.h + nx-X11/programs/Xserver/GL/mesa/X/xf86glxint.h +Copyright: 1998-1999, Precision Insight, Inc., Cedar Park, Texas. +License: UNKNOWN FIXME -Files: nx-X11/extras/Mesa/src/mesa/tnl/t_vertex.c - nx-X11/extras/Mesa/src/mesa/tnl/t_vertex.h - nx-X11/extras/Mesa/src/mesa/tnl/t_vertex_generic.c - nx-X11/extras/Mesa/src/mesa/tnl/t_vertex_sse.c -Copyright: 2003, Tungsten Graphics, inc -License: Expat +Files: nx-X11/extras/Mesa/src/mesa/glapi/glapioffsets.h + nx-X11/extras/Mesa/src/mesa/glapi/glapitable.h + nx-X11/extras/Mesa/src/mesa/glapi/glapitemp.h + nx-X11/extras/Mesa/src/mesa/glapi/glprocs.h +Copyright: 1999-2001, Brian Paul + 1999-2003, Brian Paul + IBM Corporation 2004 +License: GENERATED FILE FIXME Files: nx-X11/include/extensions/saver.h @@ -2085,7 +2077,16 @@ Files: nx-X11/include/extensions/saver.h nx-X11/include/extensions/scrnsaver.h nx-X11/programs/Xserver/Xext/saver.c Copyright: 1992, X Consortium -License: Expat +License: MIT/X11 (BSD like) + FIXME + +Files: nx-X11/include/extensions/xtestext1.h + nx-X11/programs/Xserver/Xext/xtest1dd.c + nx-X11/programs/Xserver/Xext/xtest1di.c + nx-X11/programs/Xserver/mi/mibstore.c +Copyright: 1986-1988, 1998, The Open Group + 1987, 1998, The Open Group +License: NTP FIXME Files: nx-X11/programs/Xserver/miext/cw/cw.c @@ -2093,22 +2094,25 @@ Files: nx-X11/programs/Xserver/miext/cw/cw.c nx-X11/programs/Xserver/miext/cw/cw_ops.c nx-X11/programs/Xserver/miext/cw/cw_render.c Copyright: 2004, Eric Anholt -License: UNKNOWN +License: NTP (legal disclaimer) FIXME -Files: nx-X11/extras/Mesa/src/mesa/shader/atifragshader.c - nx-X11/extras/Mesa/src/mesa/swrast/s_atifragshader.c - nx-X11/extras/Mesa/src/mesa/swrast/s_atifragshader.h -Copyright: 1999-2003, David Airlie - 2004, David Airlie -License: Expat +Files: m4/nx-xtrans.m4 + nx-X11/include/Sunkeysym.h + nx-X11/lib/m4/nx-xtrans.m4 + nx-X11/lib/modules/im/ximcp/imDefIm.c +Copyright: 1990-1992, Oracle and/or its affiliates. + 1991, Oracle and/or its affiliates. + 2005, Oracle and/or its affiliates. +License: UNKNOWN FIXME -Files: nx-X11/lib/X11/FreeEventData.c - nx-X11/lib/X11/GetEventData.c - nx-X11/programs/Xserver/include/protocol-versions.h -Copyright: 2009, Red Hat, Inc -License: Expat +Files: nx-X11/extras/Mesa/src/mesa/tnl/t_vertex.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vertex.h + nx-X11/extras/Mesa/src/mesa/tnl/t_vertex_generic.c + nx-X11/extras/Mesa/src/mesa/tnl/t_vertex_sse.c +Copyright: 2003, Tungsten Graphics, inc. +License: UNKNOWN FIXME Files: bin/nxagent.in @@ -2116,137 +2120,100 @@ Files: bin/nxagent.in mesa-quilt Copyright: 2012, Mike Gabriel 2017, Mike Gabriel -License: GPL-3+ - FIXME - -Files: nx-X11/include/extensions/xf86bigfont.h - nx-X11/include/extensions/xf86bigfproto.h - nx-X11/programs/Xserver/Xext/xf86bigfont.c -Copyright: 1999-2000, Bruno Haible - 1999-2000, The XFree86 Project, Inc -License: UNKNOWN - FIXME - -Files: nx-X11/lib/X11/Context.c - nx-X11/lib/X11/Quarks.c - nx-X11/lib/X11/Xrm.c -Copyright: 1987-1988, 1990 Digital Equipment Corporation, Maynard - 1987-1988, 1990, 1994, 1998 The Open Group - 1987-1988, 1990, 1998, The Open Group -License: UNKNOWN - FIXME - -Files: nx-X11/include/extensions/xtestext1.h - nx-X11/programs/Xserver/Xext/xtest1dd.c - nx-X11/programs/Xserver/Xext/xtest1di.c -Copyright: 1986-1988, 1998 The Open Group - 1986-1988, Hewlett-Packard Corporation -License: UNKNOWN +License: GPL (v3 or later) FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/NXdamage.c - nx-X11/programs/Xserver/randr/rrmode.c - nx-X11/programs/Xserver/randr/rrscreen.c -Copyright: 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2003, Keith Packard - 2006, Keith Packard - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: nx-X11/extras/Mesa/src/mesa/shader/atifragshader.c + nx-X11/extras/Mesa/src/mesa/swrast/s_atifragshader.c + nx-X11/extras/Mesa/src/mesa/swrast/s_atifragshader.h +Copyright: 1999-2003, David Airlie + 2004, David Airlie +License: MIT/X11 (BSD like) FIXME Files: nx-X11/programs/Xserver/include/bstore.h nx-X11/programs/Xserver/include/bstorestr.h nx-X11/programs/Xserver/mi/mibstore.h Copyright: 1987, the Regents of the University of California +License: NTP + FIXME + +Files: nx-X11/include/extensions/xf86bigfont.h + nx-X11/include/extensions/xf86bigfproto.h + nx-X11/programs/Xserver/Xext/xf86bigfont.c +Copyright: 1999-2000, Bruno Haible + 1999-2000, The XFree86 Project, Inc. License: UNKNOWN FIXME -Files: nx-X11/extras/Mesa/src/mesa/glapi/glapioffsets.h - nx-X11/extras/Mesa/src/mesa/glapi/glprocs.h -Copyright: 1999-2001, Brian Paul - IBM Corporation 2004 -License: Expat +Files: nx-X11/lib/src/FreeEventData.c + nx-X11/lib/src/GetEventData.c + nx-X11/programs/Xserver/include/protocol-versions.h +Copyright: 2009, Red Hat, Inc. +License: UNKNOWN FIXME -Files: nx-X11/extras/Mesa/src/mesa/glapi/glapitable.h - nx-X11/extras/Mesa/src/mesa/glapi/glapitemp.h -Copyright: 1999-2001, Brian Paul - 1999-2003, Brian Paul - IBM Corporation 2004, -License: Expat +Files: nx-X11/programs/Xserver/hw/nxagent/Rootless.h + nx-X11/programs/Xserver/os/Imakefile +Copyright: 2001, 2011, NoMachine (http:www.nomachine.com) + 2008-2014, Oleksandr Shneyder + 2011-2016, Mike Gabriel + 2014-2016, Mihai Moldovan + 2014-2016, Ulrich Sibiller + 2015-2016, Qindel Group (http:www.qindel.com) + of the aforementioned persons and companies. +License: GENERATED FILE FIXME -Files: nx-X11/programs/Xserver/dix/region.c - nx-X11/programs/Xserver/mi/mivaltree.c -Copyright: 1987-1989, 1998 The Open Group - 1987-1989, by - 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts -License: Expat +Files: nx-X11/extras/Mesa/src/glx/x11/indirect_size.c + nx-X11/extras/Mesa/src/glx/x11/indirect_size.h +Copyright: IBM Corporation 2004 +License: GENERATED FILE FIXME -Files: nx-X11/lib/X11/XimintP.h - nx-X11/lib/X11/imDefIm.c -Copyright: 1990-1992, Oracle and/or its affiliates. - 1991-1992, Oracle and/or its affiliates. - 1992-1994, FUJITSU LIMITED - 1993-1994, Sony Corporation -License: Expat +Files: make-changelog.sh + regenerate-symbol-docs.sh +Copyright: 2016, Mike Gabriel +License: GPL (v2 or later) FIXME -Files: nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c - nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.h -Copyright: IBM Corporation 2003 -License: Expat +Files: nx-X11/lib/src/Host.c + nx-X11/lib/src/LiHosts.c +Copyright: 1986, 1998, The Open Group +License: ICU FIXME -Files: nx-X11/extras/Mesa/src/glx/x11/indirect_size.c - nx-X11/extras/Mesa/src/glx/x11/indirect_size.h -Copyright: IBM Corporation 2004 -License: Expat +Files: nx-X11/programs/Xserver/os/strlcat.c + nx-X11/programs/Xserver/os/strlcpy.c +Copyright: 1998, Todd C. Miller +License: ISC FIXME -Files: nx-X11/programs/Xserver/composite/compoverlay.c - nx-X11/programs/Xserver/hw/nxagent/X11/include/Xcomposite_nxagent.h -Copyright: 2003, Keith Packard - 2006, Oracle and/or its affiliates. -License: Expat +Files: nx-X11/extras/Mesa/src/mesa/main/mm.h + nx-X11/extras/Mesa/src/mesa/main/simple_list.h +Copyright: 1997, Keith Whitwell + 1999, Keith Whitwell +License: MIT/X11 (BSD like) FIXME Files: nx-X11/programs/Xserver/Xext/sleepuntil.h nx-X11/programs/Xserver/mi/micoord.h Copyright: 2000, The XFree86 Project, Inc. 2001, The XFree86 Project, Inc. -License: Expat +License: MIT/X11 (BSD like) FIXME Files: nx-X11/extras/Mesa/src/mesa/tnl/t_vp_build.c nx-X11/extras/Mesa/src/mesa/tnl/t_vp_build.h Copyright: 2005, Tungsten Graphics -License: Expat +License: MIT/X11 (BSD like) FIXME -Files: make-changelog.sh - regenerate-symbol-docs.sh -Copyright: 2016, Mike Gabriel -License: GPL-2+ - FIXME - -Files: nx-X11/programs/Xserver/os/strlcat.c - nx-X11/programs/Xserver/os/strlcpy.c -Copyright: 1998, Todd C. Miller -License: ISC - FIXME - -Files: nx-X11/lib/X11/lcUTF8.c - nx-X11/lib/X11/lcUTF8Load.c -Copyright: 1993, SunSoft, Inc +Files: nx-X11/lib/modules/lc/Utf8/lcUTF8Load.c + nx-X11/lib/src/xlibi18n/lcUTF8.c +Copyright: 1993, SunSoft, Inc. 1999-2000, Bruno Haible -License: UNKNOWN +License: NTP (legal disclaimer) FIXME Files: nx-X11/include/extensions/randrproto.h @@ -2254,62 +2221,57 @@ Files: nx-X11/include/extensions/randrproto.h Copyright: 2000, Compaq Computer Corporation 2002, Hewlett-Packard Company 2006, Intel Corporation - 2008, Red Hat, Inc -License: UNKNOWN + 2008, Red Hat, Inc. +License: NTP (legal disclaimer) FIXME Files: nx-X11/programs/Xserver/hw/nxagent/X11/include/Xrandr_nxagent.h - nxcompshad/X11/include/Xrandr_nxcompshad.h -Copyright: 2000, Compaq Computer Corporation, Inc - 2002, Hewlett-Packard Company, Inc + nxcompshad/src/X11/include/Xrandr_nxcompshad.h +Copyright: 2000, Compaq Computer Corporation, Inc. + 2002, Hewlett-Packard Company, Inc. 2006, Intel Corporation - 2008, Red Hat, Inc -License: UNKNOWN + 2008, Red Hat, Inc. +License: NTP (legal disclaimer) FIXME -Files: nx-X11/programs/Xserver/os/log.c - nx-X11/programs/Xserver/os/utils.c -Copyright: 1987, 1998 The Open Group - 1987, Digital Equipment Corporation, Maynard, Massachusetts - 1994, Quarterdeck Office Systems - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: nx-X11/lib/modules/im/ximcp/imLcFlt.c + nx-X11/lib/modules/im/ximcp/imLcLkup.c +Copyright: 1992, 1994, FUJITSU LIMITED + 1992, Fuji Xerox Co., Ltd. +License: NTP (legal disclaimer) FIXME -Files: nx-X11/lib/X11/GetNrmHint.c - nx-X11/lib/X11/SetNrmHint.c -Copyright: 1987, Digital Equipment Corporation, Maynard, Massachusetts - 1987-1988, 1998 The Open Group - 1988, Wyse Technology, Inc., San Jose, Ca -License: UNKNOWN +Files: nx-X11/lib/modules/im/ximcp/imRm.c + nx-X11/lib/src/xlibi18n/Ximint.h +Copyright: 1990-1994, FUJITSU LIMITED + 1992-1994, FUJITSU LIMITED + 1993-1994, Sony Corporation + 1994, Sony Corporation +License: NTP (legal disclaimer) FIXME -Files: nx-X11/lib/X11/imLcFlt.c - nx-X11/lib/X11/imLcLkup.c -Copyright: 1992, 1994 FUJITSU LIMITED - 1992, Fuji Xerox Co., Ltd +Files: nx-X11/lib/src/FilterEv.c + nx-X11/lib/src/RegstFlt.c +Copyright: 1990-1991, OMRON Corporation +License: NTP (legal disclaimer) + FIXME + +Files: nx-X11/include/GL/glxint.h + nx-X11/programs/Xserver/GL/glx/glxext.c +Copyright: 1991, -9 Silicon Graphics, Inc. License: UNKNOWN FIXME -Files: nx-X11/lib/X11/Ximint.h - nx-X11/lib/X11/imRm.c -Copyright: 1990-1994, FUJITSU LIMITED - 1992-1994, FUJITSU LIMITED - 1993-1994, Sony Corporation - 1994, Sony Corporation +Files: nx-X11/lib/src/Context.c + nx-X11/lib/src/Quarks.c +Copyright: 1987-1988, 1990, Digital Equipment Corporation, Maynard, License: UNKNOWN FIXME -Files: nx-X11/lib/X11/TextExt.c - nx-X11/lib/X11/TextExt16.c -Copyright: 1989, 1998 The Open Group - 1995, FUJITSU LIMITED +Files: nx-X11/lib/src/GetNrmHint.c + nx-X11/lib/src/SetNrmHint.c +Copyright: 1987, Digital Equipment Corporation, Maynard, Massachusetts, + 1988, Wyse Technology, Inc., San Jose, Ca, License: UNKNOWN FIXME @@ -2319,60 +2281,28 @@ Copyright: 1995, Network Computing Devices License: UNKNOWN FIXME -Files: nx-X11/lib/X11/FilterEv.c - nx-X11/lib/X11/RegstFlt.c -Copyright: 1990-1991, 1998 The Open Group - 1990-1991, OMRON Corporation - 1991, 1998 The Open Group -License: UNKNOWN - FIXME - Files: testscripts/slave-agent testscripts/slave-client -Copyright: 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN - FIXME - -Files: nx-X11/include/GL/glxint.h - nx-X11/programs/Xserver/GL/glx/glxext.c -Copyright: 1991-9 Silicon Graphics, Inc. +Copyright: 2015-2016, Qindel Group (http:www.qindel.com) + of the aforementioned persons and companies. License: UNKNOWN FIXME Files: nx-X11/programs/Xserver/fb/fbcmap.c nx-X11/programs/Xserver/mi/micmap.c -Copyright: 1987, Sun Microsystems, Inc. Mountain View, CA - no- -License: UNKNOWN - FIXME - -Files: nx-X11/lib/X11/Iconify.c - nx-X11/lib/X11/SetTxtProp.c -Copyright: 1988, 1998 The Open Group - 1988, Wyse Technology, Inc., San Jose, Ca -License: UNKNOWN - FIXME - -Files: nx-X11/lib/X11/GetTxtProp.c - nx-X11/lib/X11/Withdraw.c -Copyright: 1988, 1998 The Open Group - 1988, Wyse Technology, Inc., San Jose, Ca. +Copyright: 1987, Sun Microsystems, Inc. Mountain View, CA. License: UNKNOWN FIXME -Files: nx-X11/lib/X11/mbWrap.c - nx-X11/lib/X11/wcWrap.c -Copyright: 1991, 1998 The Open Group - 1991, the Open Software Foundation +Files: nx-X11/lib/src/Iconify.c + nx-X11/lib/src/SetTxtProp.c +Copyright: 1988, Wyse Technology, Inc., San Jose, Ca. License: UNKNOWN FIXME -Files: nx-X11/lib/X11/FSWrap.c - nx-X11/lib/X11/lcWrap.c -Copyright: 1991, 1998 The Open Group - 1991, the Open Software Foundation - 1993, the TOSHIBA Corp +Files: nx-X11/lib/src/GetTxtProp.c + nx-X11/lib/src/Withdraw.c +Copyright: 1988, Wyse Technology, Inc., San Jose, Ca., License: UNKNOWN FIXME @@ -2382,189 +2312,112 @@ Copyright: 2002, XFree86 Inc License: UNKNOWN FIXME -Files: nxcomp/MD5.c - nxcomp/MD5.h -Copyright: 1999, 2002 Aladdin Enterprises. - 1999-2000, 2002 Aladdin Enterprises. -License: Zlib - FIXME - -Files: nx-X11/lib/X11/utlist.h -Copyright: 2007-2009, Troy D. Hanson -License: BSD-2-clause - FIXME - -Files: nx-X11/programs/Xserver/os/xprintf.c -Copyright: 2004, Alexander Gottwald -License: Expat +Files: nx-X11/lib/src/xlibi18n/lcDB.c + nx-X11/lib/src/xlibi18n/lcFile.c +Copyright: IBM Corporation 1993 +License: UNKNOWN FIXME -Files: nx-X11/extras/Mesa/src/mesa/main/simple_list.h -Copyright: 1997, Keith Whitwell - 1999-2001, Brian Paul -License: Expat +Files: nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.c + nx-X11/extras/Mesa/src/mesa/drivers/dri/common/glcontextmodes.h +Copyright: IBM Corporation 2003 +License: UNKNOWN FIXME -Files: nx-X11/lib/X11/UIThrStubs.c -Copyright: 1995, David E. Wexelblat. -License: Expat +Files: doc/nxcomp/DXPC_re-licensed_debug_784565.mbox + doc/nxcomp/README.on-retroactive-DXPC-license +Copyright: states: +License: UNKNOWN FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c -Copyright: 1987, Digital Equipment Corporation, Maynard, Massachusetts - 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: Expat +Files: nxcomp/include/MD5.h + nxcomp/src/MD5.c +Copyright: 1999, 2002, Aladdin Enterprises. + 1999-2000, 2002, Aladdin Enterprises. +License: zlib/libpng FIXME -Files: nx-X11/programs/Xserver/os/access.c -Copyright: 1987, 1998 The Open Group - 1987, Digital Equipment Corporation, Maynard, Massachusetts - 2004, Sun Microsystems, Inc -License: Expat +Files: nx-X11/lib/src/utlist.h +Copyright: 2007-2009, Troy D. Hanson +License: BSD (unspecified) FIXME -Files: nx-X11/programs/Xserver/include/list.h -Copyright: 2010, Francisco Jerez - 2010, Intel Corporation -License: Expat +Files: nx-X11/lib/m4/ax_define_dir.m4 +Copyright: 2008, Alexandre Oliva + 2008, Andreas Schwab + 2008, Guido U. Draheim + 2008, Stepan Kasal +License: FSF All Permissive FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/X11/include/xpm_nxagent.h -Copyright: 1989-95 GROUPE BULL -License: Expat +Files: nx-X11/extras/Mesa/src/mesa/main/enums.c +Copyright: 1999-2005, Brian Paul +License: GENERATED FILE FIXME Files: nx-X11/extras/Mesa/src/mesa/glapi/dispatch.h Copyright: IBM Corporation 2005 -License: Expat - FIXME - -Files: fix-patch-whitespace -Copyright: 2010, Keith Packard -License: Expat - FIXME - -Files: nx-X11/programs/Xserver/hw/nxagent/X11/include/Xfixes_nxagent.h -Copyright: 2002, Keith Packard, member of The XFree86 Project, Inc - 2006, Oracle and/or its affiliates. - 2011, Red Hat, Inc -License: Expat - FIXME - -Files: nx-X11/extras/Mesa/src/mesa/main/mm.h -Copyright: 1999, Keith Whitwell -License: Expat - FIXME - -Files: nx-X11/lib/xtrans/Xtranssock.c -Copyright: 1993-1994, 1998 The Open Group - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2002, Oracle and/or its affiliates. - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: Expat - FIXME - -Files: nx-X11/programs/Xserver/hw/nxagent/Agent.h -Copyright: 1995, X Consortium - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: Expat - FIXME - -Files: nx-X11/programs/Xserver/composite/compositeext.h -Copyright: 2009, NVIDIA Corporation -License: Expat - FIXME - -Files: nx-X11/programs/Xserver/include/client.h -Copyright: 2010, Nokia Corporation and/or its subsidiary(-ies). All -License: Expat +License: GENERATED FILE FIXME -Files: nx-X11/programs/Xserver/os/client.c -Copyright: 1993, 2010, Oracle and/or its affiliates. - 2010, Nokia Corporation and/or its subsidiary(-ies). All -License: Expat +Files: debian/changelog +Copyright: attributions. +License: GENERATED FILE FIXME -Files: nx-X11/extras/Mesa/src/mesa/main/texenvprogram.c -Copyright: 2003, Tungsten Graphics, Inc., Cedar Park, Texas -License: Expat +Files: replace.sh +Copyright: 2013, Jan Engelhardt +License: GPL (v2 or later) FIXME -Files: nx-X11/extras/Mesa/src/mesa/main/mm.c -Copyright: 1999, Wittawat Yamwong -License: Expat +Files: version.sh +Copyright: 2015, Mihai Moldovan + 2015, Mike Gabriel +License: GPL (v2 or later) FIXME Files: LICENSE.nxcomp -Copyright: 1995-1996,2000,2006, Brian Pane - 1996-1997, Zachary Vonler and Brian Pane - 1999, Kevin Vigor and Brian Pane - 2000,2003, Gian Filippo Pinzari - 2000,2006, Gian Filippo Pinzari and Brian Pane - 2001,2010, NoMachine (http://www.nomachine.com) +Copyright: 2000, 2003, Gian Filippo Pinzari + 2001, 2010, NoMachine (http:www.nomachine.com) 2008-2014, Oleksandr Shneyder 2011-2016, Mike Gabriel 2014-2016, Mihai Moldovan 2014-2016, Ulrich Sibiller - 2015-2016, Qindel Group (http://www.qindel.com) + 2015-2016, Qindel Group (http:www.qindel.com) of the aforementioned -License: GPL +License: GPL (v2) FIXME Files: LICENSE -Copyright: 2001, 2011 NoMachine (http://www.nomachine.com) +Copyright: 2001, 2011, NoMachine (http:www.nomachine.com) 2008-2014, Oleksandr Shneyder 2011-2016, Mike Gabriel 2014-2016, Mihai Moldovan 2014-2016, Ulrich Sibiller - 2015-2016, Qindel Group (http://www.qindel.com) - of the aforementioned holders -License: GPL - FIXME - -Files: nxcomp/Version.c -Copyright: 2015, Qindel Formacion y Servicios SL. */ -License: GPL-2 - FIXME - -Files: replace.sh -Copyright: 2013, Jan Engelhardt -License: GPL-2+ + 2015-2016, Qindel Group (http:www.qindel.com) + of the aforementioned copyright holders. +License: GPL (v2) FIXME -Files: version.sh -Copyright: 2015, Mihai Moldovan - 2015, Mike Gabriel -License: GPL-2+ +Files: nxcomp/src/Version.c +Copyright: 2015, Qindel Formacion y Servicios SL. +License: GPL (v2) FIXME Files: roll-tarballs.sh Copyright: 2011-2016, Mike Gabriel 2012, Reinhard Tartler -License: GPL-3+ +License: GPL (v3 or later) + FIXME + +Files: nx-X11/programs/Xserver/os/access.c +Copyright: 1987, 1998, The Open Group + 2004, Sun Microsystems, Inc. +License: ICU FIXME Files: nx-X11/programs/Xserver/os/timingsafe_memcmp.c -Copyright: 2014, Google Inc +Copyright: 2014, Google Inc. License: ISC FIXME @@ -2573,308 +2426,234 @@ Copyright: 2008, Otto Moerbeek License: ISC FIXME -Files: doc/nxcomp/nxcomp-3.6-drops-compat-code-3.4.x-testing.pdf -Copyright: +œ7óY9Ø»¢TŽ÷x²ÛÐ`>+‡ºUNcf / -License: UNKNOWN - FIXME - -Files: nx-X11/programs/Xserver/dix/dixutils.c -Copyright: 1987, 1998 The Open Group - 1987, Digital Equipment Corporation, Maynard, Massachusetts - 1988,1991, Adobe Systems Incorporated. -License: UNKNOWN - FIXME - -Files: doc/nxcomp/README.on-retroactive-DXPC-license -Copyright: 1995-1996, Brian Pane - 1996-1997, Zachary Vonler and Brian Pane - 1999, Kevin Vigor and Brian Pane - 2000-2001, Gian Filippo Pinzari and Brian Pane - states: -License: UNKNOWN +Files: nx-X11/programs/Xserver/hw/nxagent/X11/include/xpm_nxagent.h +Copyright: 1989, -95 GROUPE BULL +License: MIT/X11 (BSD like) FIXME -Files: nx-X11/lib/X11/utf8WMProps.c -Copyright: 1991, 1998 The Open Group - 2000, Bruno Haible -License: UNKNOWN +Files: nx-X11/programs/Xserver/os/xprintf.c +Copyright: 2004, Alexander Gottwald +License: MIT/X11 (BSD like) FIXME -Files: nx-X11/lib/X11/utf8Wrap.c -Copyright: 1991, 1998 The Open Group - 1991, the Open Software Foundation - 2000, Bruno Haible -License: UNKNOWN +Files: nx-X11/lib/src/UIThrStubs.c +Copyright: 1995, David E. Wexelblat. +License: MIT/X11 (BSD like) FIXME -Files: nx-X11/include/extensions/randr.h -Copyright: 2000, Compaq Computer Corporation - 2002, Hewlett Packard Company - 2006, Intel Corporation - 2008, Red Hat, Inc -License: UNKNOWN +Files: nx-X11/programs/Xserver/hw/nxagent/Agent.h +Copyright: 2001, 2011, NoMachine (http:www.nomachine.com) + 2008-2014, Oleksandr Shneyder + 2011-2016, Mike Gabriel + 2014-2016, Mihai Moldovan + 2014-2016, Ulrich Sibiller + 2015-2016, Qindel Group (http:www.qindel.com) + of the aforementioned persons and companies. +License: MIT/X11 (BSD like) FIXME -Files: nx-X11/programs/Xserver/randr/randr.c -Copyright: 2000, Compaq Computer Corporation - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2002, Hewlett-Packard Company - 2006, Intel Corporation - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: nx-X11/programs/Xserver/include/client.h +Copyright: 2010, Nokia Corporation and/or its subsidiary(-ies). All +License: MIT/X11 (BSD like) FIXME -Files: nx-X11/include/Xpoll.h.in -Copyright: 1994, 1998 The Open Group - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2005, Daniel Stone - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: nx-X11/programs/Xserver/os/client.c +Copyright: 1993, 2010, Oracle and/or its affiliates. + 2010, Nokia Corporation and/or its subsidiary(-ies). All +License: MIT/X11 (BSD like) FIXME -Files: nx-X11/programs/Xserver/include/misc.h -Copyright: 1987, 1998 The Open Group - 1987, Digital Equipment Corporation, Maynard, Massachusetts - 1992-1993, Data General Corporation; - 1992-1993, OMRON Corporation -License: UNKNOWN +Files: nx-X11/lib/src/xlibi18n/lcInit.c +Copyright: 1985-1987, 1991, 1998, The Open Group +License: MIT/X11 (BSD like) FIXME -Files: nx-X11/extras/Mesa/src/mesa/shader/atifragshader.h -Copyright: 2004, David Airlie -License: UNKNOWN +Files: nx-X11/extras/Mesa/src/mesa/main/mm.c +Copyright: 1999, Wittawat Yamwong +License: MIT/X11 (BSD like) FIXME -Files: nx-X11/lib/X11/imCallbk.c -Copyright: 1993, Digital Equipment Corporation, Maynard, Massachusetts - 1994, FUJITSU LIMITED - 1994, Sony Corporation -License: UNKNOWN +Files: nx-X11/include/Xarch.h +Copyright: 1997, Metro Link Incorporated +License: NTP FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/NXxvdisp.c -Copyright: 1991, Digital Equipment Corporation, Maynard, Massachusetts - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: nx-X11/programs/Xserver/os/xdmcp.c +Copyright: 1989, Network Computing Devices, Inc., Mountain View, California. +License: NTP FIXME -Files: nx-X11/lib/X11/WMProps.c -Copyright: 1987, Digital Equipment Corporation, Maynard, Massachusetts - 1987-1988, 1993, 1998, The Open Group - 1988, Wyse Technology, Inc., San Jose, Ca. -License: UNKNOWN +Files: nx-X11/include/extensions/randr.h +Copyright: 2000, Compaq Computer Corporation + 2002, Hewlett Packard Company + 2006, Intel Corporation + 2008, Red Hat, Inc. +License: NTP (legal disclaimer) FIXME -Files: nx-X11/lib/X11/imConv.c -Copyright: 1991-1992, Fuji Xerox Co.,Ltd +Files: nx-X11/lib/src/imConv.c +Copyright: 1991-1992, Fuji Xerox Co.,Ltd. 1993-1994, FUJITSU LIMITED -License: UNKNOWN +License: NTP (legal disclaimer) FIXME -Files: nx-X11/lib/X11/lcDB.c -Copyright: 1995, FUJITSU LIMITED - IBM Corporation 1993 -License: UNKNOWN +Files: nx-X11/lib/modules/im/ximcp/imLcPrs.c +Copyright: 1992, Fuji Xerox Co., Ltd. + 1992, Oki Technosystems Laboratory, Inc. +License: NTP (legal disclaimer) FIXME -Files: COPYING -Copyright: 1989, 1991 Free Software Foundation, Inc. - the software, and -License: UNKNOWN +Files: nx-X11/programs/Xserver/randr/rroutput.c +Copyright: 2006, Keith Packard + 2008, Red Hat, Inc. +License: NTP (legal disclaimer) FIXME -Files: nx-X11/lib/X11/imLcPrs.c -Copyright: 1992, Fuji Xerox Co., Ltd - 1992, Oki Technosystems Laboratory, Inc -License: UNKNOWN +Files: nx-X11/lib/src/SetLocale.c +Copyright: 1990-1991, OMRON Corporation, NTT Software Corporation, +License: NTP (legal disclaimer) FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/x2go.xpm -Copyright: 2008, Heinz-M. Graesing */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: nx-X11/lib/src/xlibi18n/ICWrap.c +Copyright: 1990-1991, OMRON Corporation, NTT Software Corporation, + 1991, the Open Software Foundation + 1993, the FUJITSU LIMITED +License: NTP (legal disclaimer) FIXME -Files: nx-X11/lib/X11/lcFile.c -Copyright: IBM Corporation 1993 -License: UNKNOWN +Files: nx-X11/programs/Xserver/hw/nxagent/X11/include/Xfixes_nxagent.h +Copyright: 2006, Oracle and/or its affiliates. + 2011, Red Hat, Inc. +License: NTP (legal disclaimer) FIXME -Files: nx-X11/lib/X11/Xprivate.h -Copyright: 2008, Jamey Sharp, Josh Triplett -License: UNKNOWN +Files: nx-X11/programs/Xserver/randr/rrprovider.c +Copyright: 2012, Red Hat Inc. +License: NTP (legal disclaimer) FIXME -Files: nx-X11/programs/Xserver/randr/rrcrtc.c -Copyright: 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2006, Keith Packard - 2008-2014, Oleksandr Shneyder */ - 2010, Red Hat, Inc - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: nx-X11/lib/modules/im/ximcp/imInsClbk.c +Copyright: 1993-1994, Sony Corporation +License: NTP (legal disclaimer) FIXME -Files: nx-X11/programs/Xserver/randr/rrxinerama.c -Copyright: 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2001-2005, Thomas Winischhofer, Vienna, Austria - 2006, Keith Packard - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: nx-X11/lib/src/xlibi18n/IMWrap.c +Copyright: 1991, the Open Software Foundation + 1993-1994, the Sony Corporation +License: NTP (legal disclaimer) FIXME -Files: nx-X11/programs/Xserver/randr/rroutput.c -Copyright: 2006, Keith Packard - 2008, Red Hat, Inc -License: UNKNOWN +Files: nx-X11/lib/src/FSWrap.c +Copyright: 1991, the Open Software Foundation + 1993, the TOSHIBA Corp. +License: NTP (legal disclaimer) FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c -Copyright: 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2002, Keith Packard, member of The XFree86 Project, Inc - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ -License: UNKNOWN +Files: nx-X11/programs/Xserver/hw/nxagent/Visual.h +Copyright: 2001, 2011, NoMachine (http:www.nomachine.com) + 2008-2014, Oleksandr Shneyder + 2011-2016, Mike Gabriel + 2014-2016, Mihai Moldovan + 2014-2016, Ulrich Sibiller + 2015-2016, Qindel Group (http:www.qindel.com) + of the aforementioned persons and companies. +License: NTP GENERATED FILE FIXME -Files: nx-X11/include/Xarch.h -Copyright: 1997, Metro Link Incorporated +Files: nx-X11/extras/Mesa/src/mesa/shader/atifragshader.h +Copyright: 2004, David Airlie License: UNKNOWN FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/NXglxext.c -Copyright: 1991-9 Silicon Graphics, Inc. - 2001, 2011 NoMachine (http://www.nomachine.com) */ - 2008-2014, Oleksandr Shneyder */ - 2011-2016, Mike Gabriel */ - 2014-2016, Mihai Moldovan */ - 2014-2016, Ulrich Sibiller */ - 2015-2016, Qindel Group (http://www.qindel.com) */ - of the aforementioned persons and companies. */ +Files: nx-X11/lib/src/Xrm.c +Copyright: 1987-1988, 1990, Digital Equipment Corporation, Maynard License: UNKNOWN FIXME -Files: nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 -Copyright: 1984, - 1991, 1993-1994, 1998 The Open Group - 2011, - 2016, Mike Gabriel +Files: nx-X11/lib/modules/im/ximcp/imCallbk.c +Copyright: 1993, Digital Equipment Corporation, Maynard, Massachusetts, + 1994, FUJITSU LIMITED + 1994, Sony Corporation License: UNKNOWN FIXME -Files: nx-X11/programs/Xserver/os/xdmcp.c -Copyright: 1989, Network Computing Devices, Inc., Mountain View, California +Files: nx-X11/programs/Xserver/include/list.h +Copyright: 2010, Francisco Jerez + 2010, Intel Corporation License: UNKNOWN FIXME -Files: nxproxy/Main.c -Copyright: 2001, 2011 NoMachine, http://www.nomachine.com/. */ - of NoMachine. Redistribution and use of the present */ +Files: COPYING +Copyright: 1989, 1991, Free Software Foundation, Inc., License: UNKNOWN FIXME -Files: nx-X11/lib/X11/Xlcint.h -Copyright: 1990-1991, OMRON Corporation, NTT Software Corporation - 1991, 1998 The Open Group - 1991, the Open Software Foundation - 1993, the TOSHIBA Corp - 1993-1994, Sony Corporation - 1993-1994, the FUJITSU LIMITED +Files: nx-X11/programs/Xserver/hw/nxagent/x2go.xpm +Copyright: 2008, Heinz-M. Graesing + of the aforementioned persons and companies. License: UNKNOWN FIXME -Files: nx-X11/lib/X11/SetLocale.c -Copyright: 1987,1998, The Open Group - 1990-1991, OMRON Corporation, NTT Software Corporation +Files: nx-X11/lib/src/Xprivate.h +Copyright: 2008, Jamey Sharp, Josh Triplett License: UNKNOWN FIXME -Files: nx-X11/lib/X11/ICWrap.c -Copyright: 1990-1991, OMRON Corporation, NTT Software Corporation - 1991, 1998 The Open Group - 1991, the Open Software Foundation - 1993, the FUJITSU LIMITED +Files: fix-patch-whitespace +Copyright: 2010, Keith Packard License: UNKNOWN FIXME -Files: nx-X11/programs/Xserver/randr/rrprovider.c -Copyright: 2012, Red Hat Inc +Files: nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 +Copyright: 1984-1991, 1993-1994, 1998, The Open Group + 2011-2016, Mike Gabriel License: UNKNOWN FIXME -Files: nx-X11/lib/X11/imInsClbk.c -Copyright: 1993-1994, Sony Corporation +Files: nx-X11/programs/Xserver/composite/compositeext.h +Copyright: 2009, NVIDIA Corporation License: UNKNOWN FIXME -Files: nx-X11/lib/X11/Xcms.txt -Copyright: 1990, 1991 Tektronix Inc +Files: nxproxy/src/Main.c +Copyright: 2001, 2011, NoMachine, http:www.nomachine.com/. + of NoMachine. Redistribution and use of the present License: UNKNOWN FIXME -Files: nx-X11/lib/X11/CCC.c -Copyright: 1990, 1991 Tektronix, Inc - 1994, 1998 The Open Group +Files: nx-X11/lib/src/xcms/Xcms.txt +Copyright: 1990-1991, Tektronix Inc. License: UNKNOWN FIXME -Files: nx-X11/lib/X11/Font.c -Copyright: 1986, 1998 The Open Group - 2000, The XFree86 Project, Inc +Files: nx-X11/lib/src/Font.c +Copyright: 1986, 1998, The Open Group + 2000, The XFree86 Project, Inc. License: UNKNOWN FIXME -Files: nx-X11/lib/X11/IMWrap.c -Copyright: 1991, 1998 The Open Group - 1991, the Open Software Foundation - 1993-1994, the Sony Corporation +Files: nx-X11/include/Xdefs.h +Copyright: 1999, The XFree86 Project Inc. License: UNKNOWN FIXME -Files: nx-X11/programs/Xserver/mi/mibstore.c -Copyright: 1987, 1998 The Open Group - 1987, the Regents of the University of California +Files: nx-X11/extras/Mesa/src/mesa/main/texenvprogram.c +Copyright: 2003, Tungsten Graphics, Inc., Cedar Park, Texas. License: UNKNOWN FIXME -Files: nx-X11/include/Xdefs.h -Copyright: 1999, The XFree86 Project Inc +Files: debian/copyright +Copyright: -format/1.0/ License: UNKNOWN FIXME -Files: debian/changelog -Copyright: attributions +Files: ChangeLog +Copyright: Update copyright attributions. License: UNKNOWN FIXME -Files: doc/nxcomp/DXPC_re-licensed_debug_784565.mbox -Copyright: states: +Files: doc/nxcomp/nxcomp-3.6-drops-compat-code-3.4.x-testing.pdf +Copyright: ê²Ã#züÂ7VSٌB§Ùܾ»Q,ì¯ñ—¥7»²À5s License: UNKNOWN FIXME diff --git a/debian/libnx-x11-6.symbols b/debian/libnx-x11-6.symbols index 2901c1d83..ed6bcf8e5 100644 --- a/debian/libnx-x11-6.symbols +++ b/debian/libnx-x11-6.symbols @@ -134,7 +134,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# XEHeadOfExtensionList@Base 3.5.0.29 XESetBeforeFlush@Base 3.5.0.29 XESetCloseDisplay@Base 3.5.0.29 - XESetCopyEventCookie@Base 2:3.5.99.2 + XESetCopyEventCookie@Base 3.5.99.2 XESetCopyGC@Base 3.5.0.29 XESetCreateFont@Base 3.5.0.29 XESetCreateGC@Base 3.5.0.29 @@ -147,7 +147,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# XESetPrintErrorValues@Base 3.5.0.29 XESetWireToError@Base 3.5.0.29 XESetWireToEvent@Base 3.5.0.29 - XESetWireToEventCookie@Base 2:3.5.99.2 + XESetWireToEventCookie@Base 3.5.99.2 XEmptyRegion@Base 3.5.0.29 XEnableAccessControl@Base 3.5.0.29 XEqualRegion@Base 3.5.0.29 @@ -174,7 +174,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# XFreeColormap@Base 3.5.0.29 XFreeColors@Base 3.5.0.29 XFreeCursor@Base 3.5.0.29 - XFreeEventData@Base 2:3.5.99.2 + XFreeEventData@Base 3.5.99.2 XFreeExtensionList@Base 3.5.0.29 XFreeFont@Base 3.5.0.29 XFreeFontInfo@Base 3.5.0.29 @@ -194,7 +194,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# XGetDefault@Base 3.5.0.29 XGetErrorDatabaseText@Base 3.5.0.29 XGetErrorText@Base 3.5.0.29 - XGetEventData@Base 2:3.5.99.2 + XGetEventData@Base 3.5.99.2 XGetFontPath@Base 3.5.0.29 XGetFontProperty@Base 3.5.0.29 XGetGCValues@Base 3.5.0.29 @@ -819,7 +819,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XCloseLC@Base 3.5.0.29 _XColor_to_XcmsRGB@Base 3.5.0.29 _XConnectDisplay@Base 3.5.0.29 - _XCopyEventCookie@Base 2:3.5.99.2 + _XCopyEventCookie@Base 3.5.99.2 _XCopyToArg@Base 3.5.0.29 _XCreateMutex_fn@Base 3.5.0.29 (arch=amd64 ia64 alpha ppc64 arm64)_XData32@Base 3.5.0.29 @@ -838,13 +838,13 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XEventsQueued@Base 3.5.0.29 _XF86BigfontFreeFontMetrics@Base 3.5.0.29 _XF86LoadQueryLocaleFont@Base 3.5.0.29 - _XFetchEventCookie@Base 2:3.5.99.2 + _XFetchEventCookie@Base 3.5.99.2 _XFlush@Base 3.5.0.29 _XFlushGCCache@Base 3.5.0.29 _XFreeAtomTable@Base 3.5.0.29 _XFreeDisplayLock_fn@Base 3.5.0.29 _XFreeDisplayStructure@Base 3.5.0.29 - _XFreeEventCookies@Base 2:3.5.99.2 + _XFreeEventCookies@Base 3.5.99.2 _XFreeExtData@Base 3.5.0.29 _XFreeMutex_fn@Base 3.5.0.29 _XFreeTemp@Base 3.5.0.29 @@ -857,7 +857,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XGetScanlinePad@Base 3.5.0.29 _XGetWindowAttributes@Base 3.5.0.29 _XHeadOfDisplayList@Base 3.5.0.29 -#MISSING: 3.5.99.2# _XIDHandler@Base 2:3.5.99.2 +#MISSING: 3.5.99.2# _XIDHandler@Base 3.5.99.2 _XIMCompileResourceList@Base 3.5.0.29 _XIOError@Base 3.5.0.29 _XIOErrorFunction@Base 3.5.0.29 @@ -866,7 +866,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XInitImageFuncPtrs@Base 3.5.0.29 _XInitKeysymDB@Base 3.5.0.29 _XInitOM@Base 3.5.0.29 - _XIsEventCookie@Base 2:3.5.99.2 + _XIsEventCookie@Base 3.5.99.2 _XKeyInitialize@Base 3.5.0.29 _XKeycodeToKeysym@Base 3.5.0.29 _XKeysymToKeycode@Base 3.5.0.29 @@ -881,7 +881,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XPollfdCacheAdd@Base 3.5.0.29 _XPollfdCacheDel@Base 3.5.0.29 _XPollfdCacheInit@Base 3.5.0.29 - _XProcessInternalConnection@Base 2:3.5.99.2 + _XProcessInternalConnection@Base 3.5.99.2 _XProcessWindowAttributes@Base 3.5.0.29 _XPutBackEvent@Base 3.5.0.29 (arch=amd64 ia64 alpha ppc64 arm64)_XRead32@Base 3.5.0.29 @@ -898,22 +898,22 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XSelect@Base 3.5.0.29 _XSend@Base 3.5.0.29 _XSendClientPrefix@Base 3.5.0.29 -#MISSING: 3.5.99.2# _XSeqSyncFunction@Base 2:3.5.99.2 +#MISSING: 3.5.99.2# _XSeqSyncFunction@Base 3.5.99.2 _XSetClipRectangles@Base 3.5.0.29 _XSetImage@Base 3.5.0.29 _XSetLastRequestRead@Base 3.5.0.29 -#MISSING: 3.5.99.2# _XSetPrivSyncFunction@Base 2:3.5.99.2 -#MISSING: 3.5.99.2# _XSetSeqSyncFunction@Base 2:3.5.99.2 - _XStoreEventCookie@Base 2:3.5.99.2 +#MISSING: 3.5.99.2# _XSetPrivSyncFunction@Base 3.5.99.2 +#MISSING: 3.5.99.2# _XSetSeqSyncFunction@Base 3.5.99.2 + _XStoreEventCookie@Base 3.5.99.2 _XTextHeight16@Base 3.5.0.29 _XTextHeight@Base 3.5.0.29 _XTranslateKey@Base 3.5.0.29 _XTranslateKeySym@Base 3.5.0.29 #MISSING: 2:3.5.99.9# _XTryShapeBitmapCursor@Base 3.5.0.29 - _XUnknownCopyEventCookie@Base 2:3.5.99.2 + _XUnknownCopyEventCookie@Base 3.5.99.2 _XUnknownNativeEvent@Base 3.5.0.29 _XUnknownWireEvent@Base 3.5.0.29 - _XUnknownWireEventCookie@Base 2:3.5.99.2 + _XUnknownWireEventCookie@Base 3.5.99.2 _XUnlockMutex_fn@Base 3.5.0.29 _XUnregisterFilter@Base 3.5.0.29 _XUnregisterInternalConnection@Base 3.5.0.29 @@ -1017,7 +1017,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XimGetICValueData@Base 3.5.0.29 _XimGetIMValueData@Base 3.5.0.29 _XimGetLocaleCode@Base 3.5.0.29 - _XimGetMyEndian@Base 2:3.5.99.2 + _XimGetMyEndian@Base 3.5.99.2 _XimGetResourceListRec@Base 3.5.0.29 _XimGetResourceListRecByQuark@Base 3.5.0.29 _XimGetWindowEventmask@Base 3.5.0.29 @@ -1156,7 +1156,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XkeyTable@Base 3.5.0.29 _XlcAddCT@Base 3.5.0.29 _XlcAddCharSet@Base 3.5.0.29 - _XlcAddGB18030LocaleConverters@Base 2:3.5.99.2 + _XlcAddGB18030LocaleConverters@Base 3.5.99.2 _XlcAddLoader@Base 3.5.0.29 _XlcAddUtf8Converters@Base 3.5.0.29 _XlcAddUtf8LocaleConverters@Base 3.5.0.29 @@ -1189,7 +1189,7 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _XlcInitCTInfo@Base 3.5.0.29 _XlcInitLoader@Base 3.5.0.29 _XlcLocaleDirName@Base 3.5.0.29 - _XlcLocaleLibDirName@Base 2:3.5.99.2 + _XlcLocaleLibDirName@Base 3.5.99.2 _XlcMapOSLocaleName@Base 3.5.0.29 _XlcNCompareISOLatin1@Base 3.5.0.29 _XlcOpenConverter@Base 3.5.0.29 @@ -1271,4 +1271,4 @@ libNX_X11.so.6 libnx-x11-6 #MINVER# _qfree@Base 3.5.0.29 #MISSING: 3.5.99.2# in6addr_any@Base 3.5.0.29 read_EncodingInfo@Base 3.5.0.29 - xlocaledir@Base 2:3.5.99.2 + xlocaledir@Base 3.5.99.2 diff --git a/debian/libnx-x11-dev.install b/debian/libnx-x11-dev.install index 169f0f6ef..6767e4d19 100644 --- a/debian/libnx-x11-dev.install +++ b/debian/libnx-x11-dev.install @@ -1,8 +1,6 @@ -usr/lib/*/libNX_X11.so -usr/lib/*/libNX_X11.a usr/include/*/nx-X11/ImUtil.h -usr/include/*/nx-X11/Xauth.h usr/include/*/nx-X11/XKBlib.h +usr/include/*/nx-X11/Xauth.h usr/include/*/nx-X11/Xcms.h usr/include/*/nx-X11/Xlib.h usr/include/*/nx-X11/XlibConf.h @@ -14,4 +12,6 @@ usr/include/*/nx-X11/Xutil.h usr/include/*/nx-X11/cursorfont.h usr/include/*/nx-X11/misc.h usr/include/*/nx-X11/os.h +usr/lib/*/libNX_X11.a +usr/lib/*/libNX_X11.so usr/lib/*/pkgconfig/nx-x11.pc diff --git a/debian/libxcomp-dev.install b/debian/libxcomp-dev.install index f73422f40..89f20a453 100644 --- a/debian/libxcomp-dev.install +++ b/debian/libxcomp-dev.install @@ -1,9 +1,9 @@ -usr/lib/*/libXcomp.so -usr/lib/*/libXcomp.a +usr/include/*/nx/MD5.h usr/include/*/nx/NX.h usr/include/*/nx/NXalert.h usr/include/*/nx/NXpack.h usr/include/*/nx/NXproto.h usr/include/*/nx/NXvars.h -usr/include/*/nx/MD5.h -usr/lib/*/pkgconfig/nxcomp.pc \ No newline at end of file +usr/lib/*/libXcomp.a +usr/lib/*/libXcomp.so +usr/lib/*/pkgconfig/nxcomp.pc diff --git a/debian/libxcomp3.docs b/debian/libxcomp3.docs index 8861756ba..0b15e2cfc 100644 --- a/debian/libxcomp3.docs +++ b/debian/libxcomp3.docs @@ -1,2 +1,2 @@ -doc/nxcomp/nxcomp-3.6-drops-compat-code-3.4.x-testing.pdf doc/nxcomp/README.on-retroactive-DXPC-license +doc/nxcomp/nxcomp-3.6-drops-compat-code-3.4.x-testing.pdf diff --git a/debian/libxcompshad-dev.install b/debian/libxcompshad-dev.install index 68318ee03..e0114c1e6 100644 --- a/debian/libxcompshad-dev.install +++ b/debian/libxcompshad-dev.install @@ -1,4 +1,4 @@ -usr/lib/*/libXcompshad.so -usr/lib/*/libXcompshad.a usr/include/*/nx/Shadow.h +usr/lib/*/libXcompshad.a +usr/lib/*/libXcompshad.so usr/lib/*/pkgconfig/nxcompshad.pc diff --git a/debian/libxcompshad-dev.links b/debian/libxcompshad-dev.links index adeb7ecb5..68e40471c 100644 --- a/debian/libxcompshad-dev.links +++ b/debian/libxcompshad-dev.links @@ -1,2 +1 @@ usr/share/doc/libxcompshad3 usr/share/doc/libxcompshad3-dev - diff --git a/debian/nx-x11proto-composite-dev.install b/debian/nx-x11proto-composite-dev.install index cf2c77e36..2e2a8ca3b 100644 --- a/debian/nx-x11proto-composite-dev.install +++ b/debian/nx-x11proto-composite-dev.install @@ -1,2 +1,2 @@ usr/include/*/nx-X11/extensions/composite.h -usr/include/*/nx-X11/extensions/compositeproto.h \ No newline at end of file +usr/include/*/nx-X11/extensions/compositeproto.h diff --git a/debian/nx-x11proto-damage-dev.install b/debian/nx-x11proto-damage-dev.install index 1503260cf..8fc4e6668 100644 --- a/debian/nx-x11proto-damage-dev.install +++ b/debian/nx-x11proto-damage-dev.install @@ -1,2 +1,2 @@ -usr/include/*/nx-X11/extensions/damagewire.h usr/include/*/nx-X11/extensions/damageproto.h +usr/include/*/nx-X11/extensions/damagewire.h diff --git a/debian/nx-x11proto-render-dev.install b/debian/nx-x11proto-render-dev.install index f2222d234..c0cde3eb3 100644 --- a/debian/nx-x11proto-render-dev.install +++ b/debian/nx-x11proto-render-dev.install @@ -1,3 +1,2 @@ usr/include/*/nx-X11/extensions/render.h usr/include/*/nx-X11/extensions/renderproto.h - diff --git a/debian/nx-x11proto-scrnsaver-dev.install b/debian/nx-x11proto-scrnsaver-dev.install index 952a6c52f..5a04b360b 100644 --- a/debian/nx-x11proto-scrnsaver-dev.install +++ b/debian/nx-x11proto-scrnsaver-dev.install @@ -1,3 +1,3 @@ usr/include/*/nx-X11/extensions/saver.h usr/include/*/nx-X11/extensions/saverproto.h -usr/include/*/nx-X11/extensions/scrnsaver.h \ No newline at end of file +usr/include/*/nx-X11/extensions/scrnsaver.h diff --git a/debian/nx-x11proto-xext-dev.install b/debian/nx-x11proto-xext-dev.install index 26a719b01..fb97e99cb 100644 --- a/debian/nx-x11proto-xext-dev.install +++ b/debian/nx-x11proto-xext-dev.install @@ -1,3 +1,4 @@ +usr/include/*/nx-X11/extensions/Xdbeproto.h usr/include/*/nx-X11/extensions/bigreqstr.h usr/include/*/nx-X11/extensions/dpms.h usr/include/*/nx-X11/extensions/dpmsstr.h @@ -6,10 +7,9 @@ usr/include/*/nx-X11/extensions/security.h usr/include/*/nx-X11/extensions/securstr.h usr/include/*/nx-X11/extensions/sync.h usr/include/*/nx-X11/extensions/syncstr.h -usr/include/*/nx-X11/extensions/xf86bigfproto.h -usr/include/*/nx-X11/extensions/xf86bigfont.h usr/include/*/nx-X11/extensions/xcmiscstr.h -usr/include/*/nx-X11/extensions/Xdbeproto.h +usr/include/*/nx-X11/extensions/xf86bigfont.h +usr/include/*/nx-X11/extensions/xf86bigfproto.h usr/include/*/nx-X11/extensions/xtestconst.h usr/include/*/nx-X11/extensions/xtestext1.h usr/include/*/nx-X11/extensions/xteststr.h diff --git a/debian/nx-x11proto-xfixes-dev.install b/debian/nx-x11proto-xfixes-dev.install index 91eae0306..b276f09a7 100644 --- a/debian/nx-x11proto-xfixes-dev.install +++ b/debian/nx-x11proto-xfixes-dev.install @@ -1,3 +1,2 @@ -usr/include/*/nx-X11/extensions/xfixeswire.h usr/include/*/nx-X11/extensions/xfixesproto.h - +usr/include/*/nx-X11/extensions/xfixeswire.h diff --git a/debian/nxagent.install b/debian/nxagent.install index 87ba3583f..3f9525906 100644 --- a/debian/nxagent.install +++ b/debian/nxagent.install @@ -1,9 +1,9 @@ etc/nxagent/keystrokes.cfg -usr/share/nx/VERSION.nxagent -usr/share/man/man1/nxagent.1* -usr/lib/*/nx/X11/ +etc/nxagent/nxagent.keyboard usr/bin/nxagent +usr/lib/*/nx/X11/ +usr/share/man/man1/nxagent.1* +usr/share/nx/VERSION.nxagent usr/share/pixmaps/nxagent.xpm -etc/nxagent/nxagent.keyboard # FIXME: compatibility symlink, drop for 3.6.0 release usr/lib/*/nx/bin/nxagent diff --git a/debian/patches/016_nx-X11_install-location.debian.patch b/debian/patches/016_nx-X11_install-location.debian.patch deleted file mode 100644 index a2a0f9f45..000000000 --- a/debian/patches/016_nx-X11_install-location.debian.patch +++ /dev/null @@ -1,45 +0,0 @@ -Description: FHS adaptation for Debian packaging -Abstract: - On Debian, binaries are installed to /usr//nx. - . - Also, a fake-libX11 library symlink is placed into - /usr//nx/X11. - . - The given paths will be overridden by the Debian packaging - and modified into multi-arch paths. - -Forwarded: not-needed -Author: Mike Gabriel -Last-Update: 2017-02-08 - ---- a/nx-X11/config/cf/Imake.tmpl -+++ b/nx-X11/config/cf/Imake.tmpl -@@ -736,7 +736,7 @@ - #define AlternateUsrLibDir YES - #endif - #else --#define UsrLibDir Concat4(/usr/local,/,LibDirName,/nx/X11) -+#define UsrLibDir Concat4(/usr,/,LibDirName,/nx/X11) - #ifndef AlternateUsrLibDir - #define AlternateUsrLibDir NO - #endif -@@ -754,7 +754,7 @@ - #define AlternateUsrDataDir YES - #endif - #else --#define UsrDataDir Concat4(/usr/local,/,share,/nx) -+#define UsrDataDir Concat4(/usr,/,share,/nx) - #ifndef AlternateUsrDataDir - #define AlternateUsrDataDir NO - #endif ---- a/nx-X11/config/cf/site.def -+++ b/nx-X11/config/cf/site.def -@@ -69,7 +69,7 @@ - #ifdef AfterVendorCF - - #ifndef ProjectRoot --#define ProjectRoot /usr/local -+#define ProjectRoot /usr - #endif - - /* diff --git a/debian/patches/102_xserver-xext_set-securitypolicy-path.debian.patch b/debian/patches/102_xserver-xext_set-securitypolicy-path.debian.patch deleted file mode 100644 index b3186a9b4..000000000 --- a/debian/patches/102_xserver-xext_set-securitypolicy-path.debian.patch +++ /dev/null @@ -1,19 +0,0 @@ -Description: FHS path fix for SecurityPolicy file - This patch is needed on Debian only, not reporting this path - change to upstream. - . - Originally contributed by Marcelo Boveto Shima . -Forwarded: not-needed -Author: Mike Gabriel -Last-Update: 2012-01-12 ---- a/nx-X11/programs/Xserver/Xext/security.c -+++ b/nx-X11/programs/Xserver/Xext/security.c -@@ -84,7 +84,7 @@ - - #ifdef NXAGENT_SERVER - --#define NX_ALTERNATIVEPOLICYFILE "/usr/local/share/nx/SecurityPolicy" -+#define NX_ALTERNATIVEPOLICYFILE "/usr/share/nx/SecurityPolicy" - - #endif - diff --git a/debian/patches/401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch b/debian/patches/401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch deleted file mode 100644 index ab16864df..000000000 --- a/debian/patches/401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch +++ /dev/null @@ -1,1870 +0,0 @@ ---- a/nxcomp/ClientChannel.cpp -+++ b/nxcomp/ClientChannel.cpp -@@ -447,6 +447,26 @@ - } - } - -+ // Get other bits of the header, so will not need to refer to them again -+ unsigned char inputDataByte = inputMessage[1]; -+ unsigned int buffer2 = GetUINT(inputMessage + 2, bigEndian_); -+ unsigned int inputDataSize = buffer2 - 1; -+ if (buffer2 == 0) -+ { -+ // BIG-REQUESTS -+ inputMessage += 4; -+ inputLength -= 4; -+ inputDataSize = GetULONG(inputMessage, bigEndian_) - 2; -+ } -+ if (inputLength != (4 * (inputDataSize + 1))) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead: inputLength=" << inputLength -+ << " mismatch inputDataSize=" << inputDataSize -+ << ".\n" << logofs_flush; -+ #endif -+ } -+ - // - // Go to the message's specific encoding. - // -@@ -455,6 +475,11 @@ - { - case X_AllocColor: - { -+ #ifdef WARNING -+ if (inputLength < 14) -+ *logofs << "handleRead: X_AllocColor inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> colormapCache); - const unsigned char *nextSrc = inputMessage + 8; -@@ -476,6 +501,11 @@ - break; - case X_ReparentWindow: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_ReparentWindow inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, bigEndian_), -@@ -486,6 +516,11 @@ - break; - case X_ChangeProperty: - { -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: X_ChangeProperty inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_ChangeProperty); - -@@ -501,8 +536,36 @@ - encodeBuffer.encodeCachedValue(format, 8, - clientCache_ -> changePropertyFormatCache); - unsigned int dataLength = GetULONG(inputMessage + 20, bigEndian_); -+ -+ // Self-preserving sanity check (otherwise we crash and dump core): -+ // some clients do this when not getting their beloved BIG-REQUESTS. -+ unsigned int maxLength = 0; -+ if (format == 8) -+ { -+ maxLength = inputLength - 24; -+ } -+ else if (format == 32) -+ { -+ maxLength = (inputLength - 24) >> 2; -+ } -+ else if (format == 16) -+ { -+ maxLength = (inputLength - 24) >> 1; -+ } -+ if (dataLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_ChangeProperty bogus dataLength=" << dataLength -+ << " set to " << maxLength -+ << " when format=" << (int)format -+ << " inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ dataLength = maxLength; -+ } -+ - encodeBuffer.encodeValue(dataLength, 32, 6); -- encodeBuffer.encodeValue(inputMessage[1], 2); -+ encodeBuffer.encodeValue(inputDataByte, 2); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 8, bigEndian_), 29, -@@ -533,7 +596,7 @@ - nextSrc += 4; - } - } -- else -+ else if (format == 16) - { - for (unsigned int i = 0; i < dataLength; i++) - { -@@ -541,6 +604,13 @@ - nextSrc += 2; - } - } -+ else -+ { -+ #ifdef WARNING -+ *logofs << "ChangeProperty bogus format=" << (int)format -+ << ".\n" << logofs_flush; -+ #endif -+ } - } - break; - case X_SendEvent: -@@ -551,6 +621,11 @@ - // ratio. - // - -+ #ifdef WARNING -+ if (inputLength < 44) -+ *logofs << "handleRead: X_SendEvent inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_SendEvent); - -@@ -562,7 +637,7 @@ - break; - } - -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - unsigned int window = GetULONG(inputMessage + 4, bigEndian_); - - if (window == 0 || window == 1) -@@ -599,7 +674,12 @@ - break; - case X_ChangeWindowAttributes: - { -- encodeBuffer.encodeValue((inputLength - 12) >> 2, 4); -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_ChangeWindowAttributes inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeValue(inputDataSize - 2, 4); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - unsigned int bitmask = GetULONG(inputMessage + 8, bigEndian_); -@@ -621,6 +701,11 @@ - break; - case X_ClearArea: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_ClearArea inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -654,7 +739,7 @@ - break; - } - -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - const unsigned char *nextSrc = inputMessage + 8; -@@ -668,6 +753,11 @@ - break; - case X_CloseFont: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_CloseFont inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int font = GetULONG(inputMessage + 4, bigEndian_); - encodeBuffer.encodeValue(font - clientCache_ -> lastFont, 29, 5); - clientCache_ -> lastFont = font; -@@ -675,6 +765,11 @@ - break; - case X_ConfigureWindow: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_ConfigureWindow inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_ConfigureWindow); - -@@ -708,6 +803,11 @@ - break; - case X_ConvertSelection: - { -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: X_ConvertSelection inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> convertSelectionRequestorCache, 9); - const unsigned char* nextSrc = inputMessage + 8; -@@ -725,6 +825,11 @@ - break; - case X_CopyArea: - { -+ #ifdef WARNING -+ if (inputLength < 28) -+ *logofs << "handleRead: X_CopyArea inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -793,6 +898,11 @@ - break; - case X_CopyGC: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_CopyGC inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int s_g_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -814,6 +924,11 @@ - break; - case X_CopyPlane: - { -+ #ifdef WARNING -+ if (inputLength < 32) -+ *logofs << "handleRead: X_CopyPlane inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, -@@ -833,6 +948,11 @@ - break; - case X_CreateGC: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_CreateGC inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int g_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -917,6 +1037,11 @@ - break; - case X_ChangeGC: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_ChangeGC inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int g_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -998,14 +1123,19 @@ - break; - case X_CreatePixmap: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_CreatePixmap inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - -- *logofs << "handleRead: X_CreatePixmap depth " << (unsigned) inputMessage[1] -+ *logofs << "handleRead: X_CreatePixmap depth " << (unsigned) inputDataByte - << ", pixmap id " << GetULONG(inputMessage + 4, bigEndian_) - << ", drawable " << GetULONG(inputMessage + 8, bigEndian_) - << ", width " << GetUINT(inputMessage + 12, bigEndian_) - << ", height " << GetUINT(inputMessage + 14, bigEndian_) -- << ", size " << GetUINT(inputMessage + 2, bigEndian_) << 2 -+ << ", length " << inputLength - << ".\n" << logofs_flush; - - unsigned int p_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1042,6 +1172,11 @@ - break; - case X_CreateWindow: - { -+ #ifdef WARNING -+ if (inputLength < 32) -+ *logofs << "handleRead: X_CreateWindow inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int w_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1054,7 +1189,7 @@ - #endif - - unsigned bitmask = GetULONG(inputMessage + 28, bigEndian_); -- encodeBuffer.encodeCachedValue((unsigned int) inputMessage[1], 8, -+ encodeBuffer.encodeCachedValue((unsigned int) inputDataByte, 8, - clientCache_ -> depthCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, bigEndian_), - clientCache_ -> windowCache); -@@ -1098,6 +1233,11 @@ - break; - case X_DeleteProperty: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_DeleteProperty inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - encodeBuffer.encodeValue(GetULONG(inputMessage + 8, bigEndian_), 29, 9); -@@ -1105,6 +1245,11 @@ - break; - case X_FillPoly: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_FillPoly inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1138,7 +1283,7 @@ - break; - } - -- unsigned int numPoints = ((inputLength - 16) >> 2); -+ unsigned int numPoints = (inputDataSize - 3); - - if (control -> isProtoStep10() == 1) - { -@@ -1209,7 +1354,12 @@ - break; - case X_FreeColors: - { -- unsigned int numPixels = GetUINT(inputMessage + 2, bigEndian_) - 3; -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_FreeColors inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ unsigned int numPixels = inputDataSize - 2; - encodeBuffer.encodeValue(numPixels, 16, 4); - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> colormapCache); -@@ -1225,12 +1375,22 @@ - break; - case X_FreeCursor: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_FreeCursor inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), - 29, clientCache_ -> cursorCache, 9); - } - break; - case X_FreeGC: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_FreeGC inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int g_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1284,6 +1444,11 @@ - break; - case X_FreePixmap: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_FreePixmap inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int p_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1318,6 +1483,11 @@ - break; - case X_GetAtomName: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_GetAtomName inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeValue(GetULONG(inputMessage + 4, bigEndian_), 29, 9); - - sequenceQueue_.push(clientSequence_, inputOpcode); -@@ -1327,6 +1497,11 @@ - break; - case X_GetGeometry: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_GetGeometry inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> drawableCache); - -@@ -1351,6 +1526,11 @@ - break; - case X_GetKeyboardMapping: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_GetKeyboardMapping inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeValue((unsigned int) inputMessage[4], 8); - encodeBuffer.encodeValue((unsigned int) inputMessage[5], 8); - -@@ -1361,6 +1541,11 @@ - break; - case X_GetProperty: - { -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: X_GetProperty inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_GetProperty); - -@@ -1378,7 +1563,7 @@ - break; - } - -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - unsigned int property = GetULONG(inputMessage + 8, bigEndian_); -@@ -1394,6 +1579,11 @@ - break; - case X_GetSelectionOwner: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_GetSelectionOwner inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> getSelectionOwnerSelectionCache, 9); - -@@ -1404,7 +1594,12 @@ - break; - case X_GrabButton: - { -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: X_GrabButton inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - encodeBuffer.encodeCachedValue(GetUINT(inputMessage + 8, bigEndian_), 16, -@@ -1423,7 +1618,12 @@ - break; - case X_GrabPointer: - { -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: X_GrabPointer inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - encodeBuffer.encodeCachedValue(GetUINT(inputMessage + 8, bigEndian_), 16, -@@ -1448,7 +1648,12 @@ - break; - case X_GrabKeyboard: - { -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_GrabKeyboard inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> windowCache); - unsigned int timestamp = GetULONG(inputMessage + 8, bigEndian_); -@@ -1471,6 +1676,11 @@ - break; - case X_PolyText8: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_PolyText8 inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1555,6 +1765,11 @@ - break; - case X_PolyText16: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_PolyText16 inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1639,6 +1854,11 @@ - break; - case X_ImageText8: - { -+ #ifdef WARNING -+ if (inputLength < 16 + (unsigned int)inputDataByte) -+ *logofs << "handleRead: X_ImageText8 inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1673,7 +1893,7 @@ - break; - } - -- unsigned int textLength = (unsigned int) inputMessage[1]; -+ unsigned int textLength = (unsigned int) inputDataByte; - encodeBuffer.encodeCachedValue(textLength, 8, - clientCache_ -> imageTextLengthCache, 4); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, -@@ -1706,6 +1926,11 @@ - break; - case X_ImageText16: - { -+ #ifdef WARNING -+ if (inputLength < 16 + (unsigned int)inputDataByte) -+ *logofs << "handleRead: X_ImageText16 inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -1740,7 +1965,7 @@ - break; - } - -- unsigned int textLength = (unsigned int) inputMessage[1]; -+ unsigned int textLength = (unsigned int) inputDataByte; - encodeBuffer.encodeCachedValue(textLength, 8, - clientCache_ -> imageTextLengthCache, 4); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, -@@ -1773,6 +1998,11 @@ - break; - case X_InternAtom: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_InternAtom inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_InternAtom); - -@@ -1796,8 +2026,18 @@ - } - - unsigned int nameLength = GetUINT(inputMessage + 4, bigEndian_); -+ unsigned int maxLength = inputLength - 8; -+ if (nameLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_InternAtom bogus nameLength=" << nameLength -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ nameLength = maxLength; -+ } - encodeBuffer.encodeValue(nameLength, 16, 6); -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - const unsigned char *nextSrc = inputMessage + 8; - - if (control -> isProtoStep7() == 1) -@@ -1827,7 +2067,22 @@ - break; - case X_ListFonts: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_ListFonts inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int textLength = GetUINT(inputMessage + 6, bigEndian_); -+ unsigned int maxLength = inputLength - 8; -+ if (textLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_ListFonts bogus textLength=" << textLength -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ textLength = maxLength; -+ } - encodeBuffer.encodeValue(textLength, 16, 6); - encodeBuffer.encodeValue(GetUINT(inputMessage + 4, bigEndian_), 16, 6); - const unsigned char* nextSrc = inputMessage + 8; -@@ -1853,7 +2108,22 @@ - case X_LookupColor: - case X_AllocNamedColor: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_AllocNamedColor inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int textLength = GetUINT(inputMessage + 8, bigEndian_); -+ unsigned int maxLength = inputLength - 12; -+ if (textLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_AllocNamedColor bogus textLength=" << textLength -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ textLength = maxLength; -+ } - encodeBuffer.encodeValue(textLength, 16, 6); - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), - 29, clientCache_ -> colormapCache); -@@ -1886,6 +2156,11 @@ - case X_QueryPointer: - case X_QueryTree: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_MapWindow...X_QueryTree inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - if (inputOpcode == X_DestroyWindow) -@@ -1923,7 +2198,22 @@ - break; - case X_OpenFont: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_OpenFont inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int nameLength = GetUINT(inputMessage + 8, bigEndian_); -+ unsigned int maxLength = inputLength - 12; -+ if (nameLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_InternAtom bogus nameLength=" << nameLength -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ nameLength = maxLength; -+ } - encodeBuffer.encodeValue(nameLength, 16, 7); - unsigned int font = GetULONG(inputMessage + 4, bigEndian_); - encodeBuffer.encodeValue(font - clientCache_ -> lastFont, 29, 5); -@@ -1947,6 +2237,11 @@ - break; - case X_PolyFillRectangle: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyFillRectangle inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2034,6 +2329,11 @@ - break; - case X_PolyFillArc: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyFillArc inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2135,6 +2435,11 @@ - break; - case X_PolyArc: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyArc inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2236,6 +2541,11 @@ - break; - case X_PolyPoint: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyPoint inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2269,8 +2579,8 @@ - break; - } - -- encodeBuffer.encodeValue(GetUINT(inputMessage + 2, bigEndian_) - 3, 16, 4); -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeValue(inputDataSize - 2, 32, 4); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> drawableCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, bigEndian_), -@@ -2303,6 +2613,11 @@ - break; - case X_PolyLine: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyLine inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2336,8 +2651,8 @@ - break; - } - -- encodeBuffer.encodeValue(GetUINT(inputMessage + 2, bigEndian_) - 3, 16, 4); -- encodeBuffer.encodeBoolValue((unsigned int) inputMessage[1]); -+ encodeBuffer.encodeValue(inputDataSize - 2, 32, 4); -+ encodeBuffer.encodeBoolValue((unsigned int) inputDataByte); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, -@@ -2370,8 +2685,12 @@ - break; - case X_PolyRectangle: - { -- encodeBuffer.encodeValue((GetUINT(inputMessage + 2, -- bigEndian_) - 3) >> 1, 16, 3); -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolyRectangle inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeValue((inputDataSize - 2) >> 1, 32, 3); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, -@@ -2391,6 +2710,11 @@ - break; - case X_PolySegment: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_PolySegment inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2424,8 +2748,7 @@ - break; - } - -- encodeBuffer.encodeValue((GetUINT(inputMessage + 2, -- bigEndian_) - 3) >> 1, 16, 4); -+ encodeBuffer.encodeValue((inputDataSize - 2) >> 1, 32, 4); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 8, -@@ -2491,6 +2814,11 @@ - break; - case X_PutImage: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_PutImage inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2522,7 +2850,12 @@ - break; - case X_QueryBestSize: - { -- encodeBuffer.encodeValue((unsigned int)inputMessage[1], 2); -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_QueryBestSize inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif -+ encodeBuffer.encodeValue((unsigned int)inputDataByte, 2); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); - encodeBuffer.encodeValue(GetUINT(inputMessage + 8, bigEndian_), 16, 8); -@@ -2535,10 +2868,15 @@ - break; - case X_QueryColors: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_QueryColors inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - // Differential encoding. - encodeBuffer.encodeBoolValue(1); - -- unsigned int numColors = ((inputLength - 8) >> 2); -+ unsigned int numColors = (inputDataSize - 1); - encodeBuffer.encodeValue(numColors, 16, 5); - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> colormapCache); -@@ -2567,15 +2905,20 @@ - break; - case X_QueryExtension: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_QueryExtension inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TEST - - char data[256]; - - int length = GetUINT(inputMessage + 4, bigEndian_); - -- if (length > 256) -+ if (length > 255) - { -- length = 256; -+ length = 255; - } - - strncpy(data, (char *) inputMessage + 8, length); -@@ -2588,6 +2931,16 @@ - #endif - - unsigned int nameLength = GetUINT(inputMessage + 4, bigEndian_); -+ unsigned int maxLength = inputLength - 8; -+ if (nameLength > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_QueryExtension bogus nameLength=" << nameLength -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ nameLength = maxLength; -+ } - encodeBuffer.encodeValue(nameLength, 16, 6); - const unsigned char *nextSrc = inputMessage + 8; - -@@ -2614,6 +2967,11 @@ - break; - case X_QueryFont: - { -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: X_QueryFont inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int font = GetULONG(inputMessage + 4, bigEndian_); - encodeBuffer.encodeValue(font - clientCache_ -> lastFont, 29, 5); - clientCache_ -> lastFont = font; -@@ -2625,6 +2983,11 @@ - break; - case X_SetClipRectangles: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_SetClipRectangles inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - MessageStore *messageStore = clientStore_ -> - getRequestStore(X_SetClipRectangles); - -@@ -2636,7 +2999,7 @@ - break; - } - -- unsigned int numRectangles = ((inputLength - 12) >> 3); -+ unsigned int numRectangles = ((inputDataSize - 2) >> 1); - - if (control -> isProtoStep9() == 1) - { -@@ -2647,7 +3010,7 @@ - encodeBuffer.encodeValue(numRectangles, 13, 4); - } - -- encodeBuffer.encodeValue((unsigned int) inputMessage[1], 2); -+ encodeBuffer.encodeValue((unsigned int) inputDataByte, 2); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), - clientCache_ -> gcCache); - encodeBuffer.encodeCachedValue(GetUINT(inputMessage + 8, bigEndian_), 16, -@@ -2668,7 +3031,22 @@ - break; - case X_SetDashes: - { -+ #ifdef WARNING -+ if (inputLength < 12) -+ *logofs << "handleRead: X_SetDashes inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - unsigned int numDashes = GetUINT(inputMessage + 10, bigEndian_); -+ unsigned int maxLength = inputLength - 12; -+ if (numDashes > maxLength) -+ { -+ #ifdef WARNING -+ *logofs << "handleRead X_SetDashes bogus numDashes=" << numDashes -+ << " set to " << maxLength -+ << ".\n" << logofs_flush; -+ #endif -+ numDashes = maxLength; -+ } - encodeBuffer.encodeCachedValue(numDashes, 16, - clientCache_ -> setDashesLengthCache, 5); - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, bigEndian_), -@@ -2683,6 +3061,11 @@ - break; - case X_SetSelectionOwner: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_SetSelectionOwner inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 4, bigEndian_), 29, - clientCache_ -> setSelectionOwnerCache, 9); - encodeBuffer.encodeCachedValue(GetULONG(inputMessage + 8, bigEndian_), 29, -@@ -2693,6 +3076,11 @@ - break; - case X_TranslateCoords: - { -+ #ifdef WARNING -+ if (inputLength < 16) -+ *logofs << "handleRead: X_TranslateCoords inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2764,6 +3152,11 @@ - break; - case X_GetImage: - { -+ #ifdef WARNING -+ if (inputLength < 20) -+ *logofs << "handleRead: X_GetImage inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -2802,7 +3195,7 @@ - } - - // Format. -- encodeBuffer.encodeValue((unsigned int) inputMessage[1], 2); -+ encodeBuffer.encodeValue((unsigned int) inputDataByte, 2); - // Drawable. - encodeBuffer.encodeXidValue(GetULONG(inputMessage + 4, - bigEndian_), clientCache_ -> drawableCache); -@@ -2869,6 +3262,11 @@ - } - else if (inputOpcode == opcodeStore_ -> putPackedImage) - { -+ #ifdef WARNING -+ if (inputLength < 24) -+ *logofs << "handleRead: putPackedImage inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - #ifdef TARGETS - - unsigned int t_id = GetULONG(inputMessage + 4, bigEndian_); -@@ -3004,7 +3402,7 @@ - << ".\n" << logofs_flush; - #endif - -- encodeBuffer.encodeCachedValue(*(inputMessage + 1), 8, -+ encodeBuffer.encodeCachedValue(inputDataByte, 8, - clientCache_ -> resourceCache); - } - else if (inputOpcode == opcodeStore_ -> freeUnpack) -@@ -3015,7 +3413,7 @@ - << ".\n" << logofs_flush; - #endif - -- encodeBuffer.encodeCachedValue(*(inputMessage + 1), 8, -+ encodeBuffer.encodeCachedValue(inputDataByte, 8, - clientCache_ -> resourceCache); - } - else if (inputOpcode == opcodeStore_ -> getControlParameters) -@@ -3130,6 +3528,11 @@ - // Enable or disable expose events - // coming from the real server. - // -+ #ifdef WARNING -+ if (inputLength < 8) -+ *logofs << "handleRead: setExposeParameters inputLength=" << inputLength -+ << ".\n" << logofs_flush; -+ #endif - - encodeBuffer.encodeBoolValue(*(inputMessage + 4)); - encodeBuffer.encodeBoolValue(*(inputMessage + 5)); -@@ -3198,10 +3601,10 @@ - { - if (hit) - { -- statistics -> addRenderCachedRequest(*(inputMessage + 1)); -+ statistics -> addRenderCachedRequest(inputDataByte); - } - -- statistics -> addRenderRequestBits(*(inputMessage + 1), inputLength << 3, bits); -+ statistics -> addRenderRequestBits(inputDataByte, inputLength << 3, bits); - } - - } // End if (firstRequest_)... else ... -@@ -4548,10 +4951,10 @@ - // - - /* --FIXME: Recover the sequence number if the proxy -+Fixed as below? - FIXME: Recover the sequence number if the proxy - is not connected to an agent. - */ -- if (serverSequence_ > lastSequence_ || -+ if (SequenceNumber_x_gt_y(serverSequence_, lastSequence_) || - control -> SessionMode != session_proxy) - { - #ifdef DEBUG -@@ -4564,7 +4967,7 @@ - lastSequence_ = serverSequence_; - } - #ifdef DEBUG -- else if (serverSequence_ < lastSequence_) -+ else if (SequenceNumber_x_gt_y(lastSequence_, serverSequence_)) - { - // - // Use our last auto-generated sequence. -@@ -5003,6 +5406,12 @@ - break; - default: - { -+ // BEWARE: not only inputOpcode == GenericEvent but also -+ // others not handled above, at least: -+ // GraphicsExpose 13 -+ // MapRequest 20 -+ // ConfigureRequest 23 -+ // and any beyond LASTEvent. - #ifdef TEST - *logofs << "handleWrite: Using generic event compression " - << "for OPCODE#" << (unsigned int) outputOpcode -@@ -5014,11 +5423,51 @@ - - for (unsigned int i = 0; i < 14; i++) - { -- decodeBuffer.decodeCachedValue(value, 16, -- *serverCache_ -> genericEventIntCache[i]); -+ //decodeBuffer.decodeCachedValue(value, 16, -+ // *serverCache_ -> genericEventIntCache[i]); -+ if ( ! (decodeBuffer.decodeCachedValue(value, 16, -+ *serverCache_ -> genericEventIntCache[i])) ) -+ { -+ #ifdef WARNING -+ *logofs << "decodeCachedValue failed for GenEvt:" -+ << " buffer length=" << length -+ << " i=" << i -+ << "\n" << logofs_flush; -+ #endif -+ break; -+ } - - PutUINT(value, outputMessage + i * 2 + 4, bigEndian_); - } -+ // Handle "X Generic Event Extension" -+ // Extra data is not cached... -+ if (outputOpcode == GenericEvent && *(outputMessage+1) != 0 && outputLength == 32) -+ { -+ unsigned int extraOutputLength = (GetULONG(outputMessage + 4, bigEndian_) << 2); -+ if (extraOutputLength > 0 && extraOutputLength < 100*1024*1024) -+ { -+ // Extend buffer for the extra data -+ outputMessage = writeBuffer_.addMessage(extraOutputLength); -+ // Decode data and write into buffer at new position -+ for (unsigned int i = 0; i < (extraOutputLength>>1); i++) -+ { -+ //decodeBuffer.decodeValue(value, 16); -+ if ( ! (decodeBuffer.decodeValue(value, 16)) ) -+ { -+ #ifdef WARNING -+ *logofs << "decodeValue failed for GenEvt:" -+ << " extraOutputLength=" << extraOutputLength -+ << " buffer length=" << length -+ << " i=" << i -+ << "\n" << logofs_flush; -+ #endif -+ break; -+ } -+ PutUINT(value, outputMessage + i * 2, bigEndian_); -+ } -+ } -+ } -+ - } - } // End of switch (outputOpcode)... - -@@ -6892,7 +7341,7 @@ - } - else - { -- if (serverSequence_ > lastSequence_) -+ if (SequenceNumber_x_gt_y(serverSequence_, lastSequence_)) - { - #ifdef DEBUG - *logofs << "handleNotify: Updating last event's sequence " -@@ -6904,7 +7353,7 @@ - lastSequence_ = serverSequence_; - } - #ifdef DEBUG -- else if (serverSequence_ < lastSequence_) -+ else if (SequenceNumber_x_gt_y(lastSequence_, serverSequence_)) - { - // - // Use our last auto-generated sequence. ---- a/nxcomp/ClientReadBuffer.cpp -+++ b/nxcomp/ClientReadBuffer.cpp -@@ -119,15 +119,34 @@ - - dataLength = (GetUINT(start + 2, bigEndian_) << 2); - -- if (dataLength < 4) -+ if (dataLength == 0) // or equivalently (dataLength < 4) - { -- #ifdef TEST -- *logofs << "ClientReadBuffer: WARNING! Assuming length 4 " -- << "for suspicious message of length " << dataLength -- << ".\n" << logofs_flush; -- #endif -+ // BIG-REQUESTS extension -+ if (size < 8) -+ { -+ remaining_ = 8 - size; -+ return 0; -+ } - -- dataLength = 4; -+ dataLength = (GetULONG(start + 4, bigEndian_) << 2); -+ -+// See WRITE_BUFFER_OVERFLOW_SIZE elsewhere -+// and also ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE. -+ if (dataLength < 8 || dataLength > 100*1024*1024) -+ { -+ #ifdef WARNING -+ *logofs << "BIG-REQUESTS with unacceptable dataLength=" -+ << dataLength << ", now set to 8.\n" << logofs_flush; -+ #endif -+ dataLength = 8; -+ } -+ else if (dataLength < 4*64*1024) -+ { -+ #ifdef WARNING -+ *logofs << "BIG-REQUESTS with silly dataLength=" -+ << dataLength << ".\n" << logofs_flush; -+ #endif -+ } - } - } - ---- a/nxcomp/DecodeBuffer.cpp -+++ b/nxcomp/DecodeBuffer.cpp -@@ -78,34 +78,45 @@ - { - if (!endOkay) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [A] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [A] in decodeValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- // -- // Label "context" is just used to identify -- // the routine which detected the problem in -- // present source file. -- // -- -- cerr << "Error" << ": Failure decoding data in context [A].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [A] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //// -+ //// Label "context" is just used to identify -+ //// the routine which detected the problem in -+ //// present source file. -+ //// -+ //cerr << "Error" << ": Failure decoding data in context [A].\n"; -+ //HandleAbort(); - } - -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [B] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [B] in decodeValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [B].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [B] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [B].\n"; -+ //HandleAbort(); - } - - lastBit = (nextSrcChar & srcMask_); -@@ -134,28 +145,40 @@ - { - if (!endOkay) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [C] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [C] in decodeValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [C].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [C] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [C].\n"; -+ //HandleAbort(); - } - -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [D] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [D] in decodeValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [D].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [D] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [D].\n"; -+ //HandleAbort(); - } - - unsigned char moreData = (nextSrcChar & srcMask_); -@@ -212,16 +235,24 @@ - - if (nextSrc_ >= end_) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [E] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [E] in decodeCachedValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [E].\n"; -- -- HandleAbort(); -+ // Failed: return value 0 -+ value = 0; -+ // Failed: return 0, though our callers do not check that... -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [E] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [E].\n"; -+ //HandleAbort(); - } - - unsigned int index = 0; -@@ -237,30 +268,33 @@ - nextSrc_++; - if (nextSrc_ >= end_) - { -- if (!endOkay) -- { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [F] " -- << "in decodeCachedValue() nextSrc_ = " -- << (nextSrc_ - buffer_) << " end_ = " -- << (end_ - buffer_) << ".\n" << logofs_flush; -- #endif -- -- cerr << "Error" << ": Failure decoding data in context [F].\n"; -- -- HandleAbort(); -- } -- -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [G] " -- << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -- << " end_ = " << (end_ - buffer_) << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [G] in decodeCachedValue(), returning 0:" -+ << " nextSrc_ = " << (nextSrc_ - buffer_) -+ << " end_ = " << (end_ - buffer_) -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [G].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //if (!endOkay) -+ //{ -+ // #ifdef PANIC -+ // *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [F] " -+ // << "in decodeCachedValue() nextSrc_ = " -+ // << (nextSrc_ - buffer_) << " end_ = " -+ // << (end_ - buffer_) << ".\n" << logofs_flush; -+ // #endif -+ // cerr << "Error" << ": Failure decoding data in context [F].\n"; -+ // HandleAbort(); -+ //} -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [G] " -+ // << "in decodeValue() nextSrc_ = " << (nextSrc_ - buffer_) -+ // << " end_ = " << (end_ - buffer_) << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [G].\n"; -+ //HandleAbort(); - } - - nextSrcChar = *nextSrc_; -@@ -288,15 +322,20 @@ - return 1; - } - -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " -- << "in decodeCacheValue() with no value found.\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [H] in decodeCachedValue(), returning 0:" -+ << " no value found" -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [H].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " -+ // << "in decodeCacheValue() with no value found.\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [H].\n"; -+ //HandleAbort(); - } - else - { -@@ -323,15 +362,20 @@ - return 1; - } - -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " -- << "in decodeCacheValue() with no value found.\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [F] in decodeCachedValue(), returning 0:" -+ << " no value found" -+ << " .\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [H].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] " -+ // << "in decodeCacheValue() with no value found.\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [H].\n"; -+ //HandleAbort(); - } - } - } -@@ -344,16 +388,22 @@ - - if (index > cache.getSize()) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [I] " -- << "in decodeCachedValue() index = " << index -- << " cache size = " << cache.getSize() << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [I] in decodeCachedValue(), returning 0:" -+ << " index = " << index -+ << " cache size = " << cache.getSize() -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [I].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [I] " -+ // << "in decodeCachedValue() index = " << index -+ // << " cache size = " << cache.getSize() << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [I].\n"; -+ //HandleAbort(); - } - - value = cache.get(index); -@@ -401,16 +451,22 @@ - { - if (!endOkay) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [K] " -- << "in decodeCachedValue() nextSrc_ " -- << (nextSrc_ - buffer_) << " end_ " << (end_ - buffer_) -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [K] in decodeCachedValue(), returning 0:" -+ << " nextSrc_ " << (nextSrc_ - buffer_) -+ << " end_ " << (end_ - buffer_) - << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [K].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [K] " -+ // << "in decodeCachedValue() nextSrc_ " -+ // << (nextSrc_ - buffer_) << " end_ " << (end_ - buffer_) -+ // << ".\n" << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [K].\n"; -+ //HandleAbort(); - } - - #ifdef TEST -@@ -446,15 +502,20 @@ - } - else - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [M] " -- << "in decodeValue() with index = 2.\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [M] in decodeCachedValue(), returning 0:" -+ << "with index = 2" -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [M].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [M] " -+ // << "in decodeValue() with index = 2.\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [M].\n"; -+ //HandleAbort(); - } - } - else -@@ -466,16 +527,22 @@ - - if (index > cache.getSize()) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [N] " -- << "in decodeCachedValue() " << "index = " << index -- << " cache size = " << cache.getSize() << ".\n" -- << logofs_flush; -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [N] in decodeCachedValue(), returning 0:" -+ << " index = " << index -+ << " cache size = " << cache.getSize() -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [N].\n"; -- -- HandleAbort(); -+ value = 0; -+ return 0; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [N] " -+ // << "in decodeCachedValue() " << "index = " << index -+ // << " cache size = " << cache.getSize() << ".\n" -+ // << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [N].\n"; -+ //HandleAbort(); - } - - value = cache.get(index); -@@ -538,16 +605,22 @@ - } - else if (end_ - nextSrc_ < (int) numBytes) - { -- #ifdef PANIC -- *logofs << "DecodeBuffer: PANIC! Assertion failed. Error [P] " -- << "in decodeMemory() " << "with length " << numBytes -+ #ifdef WARNING -+ *logofs << "DecodeBuffer: Error [P] in decodeMemory(), returning NULL:" -+ << " with length " << numBytes - << " and " << (end_ - nextSrc_) -- << " bytes remaining.\n" << logofs_flush; -+ << " bytes remaining" -+ << ".\n" << logofs_flush; - #endif -- -- cerr << "Error" << ": Failure decoding data in context [P].\n"; -- -- HandleAbort(); -+ return NULL; -+ //#ifdef PANIC -+ //*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [P] " -+ // << "in decodeMemory() " << "with length " << numBytes -+ // << " and " << (end_ - nextSrc_) -+ // << " bytes remaining.\n" << logofs_flush; -+ //#endif -+ //cerr << "Error" << ": Failure decoding data in context [P].\n"; -+ //HandleAbort(); - } - - nextSrc_ += numBytes; ---- a/nxcomp/DecodeBuffer.h -+++ b/nxcomp/DecodeBuffer.h -@@ -30,7 +30,8 @@ - #include "ActionCacheCompat.h" - #include "PositionCacheCompat.h" - --#define DECODE_BUFFER_OVERFLOW_SIZE 4194304 -+// See WriteBuffer.h and EncodeBuffer.h -+#define DECODE_BUFFER_OVERFLOW_SIZE 104857600 - - #define DECODE_BUFFER_POSTFIX_SIZE 1 - ---- a/nxcomp/EncodeBuffer.h -+++ b/nxcomp/EncodeBuffer.h -@@ -33,10 +33,10 @@ - // - // This should match the maximum size of - // a single message added to write buffer --// (see WriteBuffer.h). -+// (see WriteBuffer.h and DecodeBuffer.h). - // - --#define ENCODE_BUFFER_OVERFLOW_SIZE 4194304 -+#define ENCODE_BUFFER_OVERFLOW_SIZE 104857600 - - // - // Adjust for the control messages and the ---- a/nxcomp/SequenceQueue.h -+++ b/nxcomp/SequenceQueue.h -@@ -18,6 +18,22 @@ - #ifndef SequenceQueue_H - #define SequenceQueue_H - -+inline int SequenceNumber_x_gt_y(unsigned int x, unsigned int y) -+{ -+ // For two sequence numbers x and y, determine whether (x > y). -+ // Sequence numbers are the trailing 16 bits of a bigger number: -+ // need to handle wraparound, e.g. 0 is 65536, just after 65535. -+ if (x != (x & 0x00ffff)) return 0; -+ if (y != (y & 0x00ffff)) return 0; -+ // Closeness when comparison makes sense: arbitrarily set at 16*1024 -+ if ((x > y) && ((x-y) < 16*1024)) return 1; -+ // Wrapped value -+ unsigned int w = x + 64*1024; -+ // We know that w>y but test left for symmetry -+ if ((w > y) && ((w-y) < 16*1024)) return 1; -+ return 0; -+} -+ - // - // List of outstanding request messages which - // are waiting for a reply. This class is used ---- a/nxcomp/ServerChannel.cpp -+++ b/nxcomp/ServerChannel.cpp -@@ -104,7 +104,8 @@ - // - - #define HIDE_MIT_SHM_EXTENSION --#define HIDE_BIG_REQUESTS_EXTENSION -+// HIDE_BIG_REQUESTS_EXTENSION : No good to hide, some clients may send crap instead... -+#undef HIDE_BIG_REQUESTS_EXTENSION - #define HIDE_XFree86_Bigfont_EXTENSION - #undef HIDE_SHAPE_EXTENSION - #undef HIDE_XKEYBOARD_EXTENSION -@@ -1412,6 +1413,9 @@ - - unsigned int inputSequence = GetUINT(inputMessage + 2, bigEndian_); - -+ // Sometimes we get inputSequence=0 or =256 when inputOpcode=11=X_UnmapSubwindows -+ // Seems weird... but is "normal" and is to be accepted. -+ - // - // Check if this is an event which we can discard. - // -@@ -1905,6 +1909,12 @@ - break; - default: - { -+ // BEWARE: not only inputOpcode == GenericEvent but also -+ // others not handled above, at least: -+ // GraphicsExpose 13 -+ // MapRequest 20 -+ // ConfigureRequest 23 -+ // and any beyond LASTEvent. - #ifdef TEST - *logofs << "handleRead: Using generic event compression " - << "for OPCODE#" << (unsigned int) inputOpcode -@@ -1919,6 +1929,16 @@ - encodeBuffer.encodeCachedValue(GetUINT(inputMessage + i * 2 + 4, bigEndian_), - 16, *serverCache_ -> genericEventIntCache[i]); - } -+ // Handle "X Generic Event Extension" -+ // Cannot cache extra data... -+// FIXME: BUG ALERT: is it OK to have the first 32 bytes cached, but not the rest? -+ if (inputOpcode == GenericEvent && inputLength > 32) -+ { -+ for (unsigned int i = 14; i < ((inputLength-4)>>1); i++) -+ { -+ encodeBuffer.encodeValue(GetUINT(inputMessage + i * 2 + 4, bigEndian_), 16); -+ } -+ } - } - - } // switch (inputOpcode)... -@@ -3756,7 +3776,7 @@ - } - - unsigned int numPoints; -- decodeBuffer.decodeValue(numPoints, 16, 4); -+ decodeBuffer.decodeValue(numPoints, 32, 4); - outputLength = (numPoints << 2) + 12; - outputMessage = writeBuffer_.addMessage(outputLength); - unsigned int relativeCoordMode; -@@ -3802,7 +3822,7 @@ - } - - unsigned int numPoints; -- decodeBuffer.decodeValue(numPoints, 16, 4); -+ decodeBuffer.decodeValue(numPoints, 32, 4); - outputLength = (numPoints << 2) + 12; - outputMessage = writeBuffer_.addMessage(outputLength); - unsigned int relativeCoordMode; -@@ -3839,7 +3859,7 @@ - case X_PolyRectangle: - { - unsigned int numRectangles; -- decodeBuffer.decodeValue(numRectangles, 16, 3); -+ decodeBuffer.decodeValue(numRectangles, 32, 3); - outputLength = (numRectangles << 3) + 12; - outputMessage = writeBuffer_.addMessage(outputLength); - decodeBuffer.decodeXidValue(value, clientCache_ -> drawableCache); -@@ -3869,7 +3889,7 @@ - } - - unsigned int numSegments; -- decodeBuffer.decodeValue(numSegments, 16, 4); -+ decodeBuffer.decodeValue(numSegments, 32, 4); - outputLength = (numSegments << 3) + 12; - outputMessage = writeBuffer_.addMessage(outputLength); - decodeBuffer.decodeXidValue(value, clientCache_ -> drawableCache); -@@ -4590,7 +4610,29 @@ - - *outputMessage = (unsigned char) outputOpcode; - -- PutUINT(outputLength >> 2, outputMessage + 2, bigEndian_); -+ if (outputLength < 4*64*1024) -+ PutUINT(outputLength >> 2, outputMessage + 2, bigEndian_); -+ else -+ { -+ // Handle BIG-REQUESTS -+ PutUINT(0, outputMessage + 2, bigEndian_); -+// FIXME: BUG ALERT: following write may not work well, -+// particularly with un-flushed messages. -+if (outputMessage != writeBuffer_.getData()) -+{ -+*logofs << "PSz BUG handleWrite BIG-REQUESTS:" -+ << " have " << (unsigned int)(outputMessage - writeBuffer_.getData()) -+ << " bytes in buffer" -+ << ", write immediate of 4-byte header will not work well" -+ << "\n" << logofs_flush; -+} -+// But, it works well enough in my testing... -+ // Write first four bytes -+ if (transport_ -> write(write_immediate, outputMessage, 4) < 0) -+ return -1; -+ // Replace with new 4-byte length -+ PutULONG(1 + (outputLength >> 2), outputMessage, bigEndian_); -+ } - - #if defined(TEST) || defined(OPCODES) - *logofs << "handleWrite: Handled request OPCODE#" -@@ -5912,7 +5954,7 @@ - unsigned char opcode = *lastMotion_; - unsigned int size = 32; - -- if (GetUINT(buffer + 2, bigEndian_) < serverSequence_) -+ if (SequenceNumber_x_gt_y(serverSequence_, GetUINT(buffer + 2, bigEndian_))) - { - PutUINT(serverSequence_, (unsigned char *) buffer + 2, bigEndian_); - } ---- a/nxcomp/ServerReadBuffer.cpp -+++ b/nxcomp/ServerReadBuffer.cpp -@@ -108,14 +108,21 @@ - { - dataLength = 32 + (GetULONG(start + 4, bigEndian_) << 2); - } -+ else if (*start == GenericEvent && *(start+1) != 0) -+ { -+ // X Generic Event Extension -+ dataLength = 32 + (GetULONG(start + 4, bigEndian_) << 2); -+ } - else - { - dataLength = 32; - } - -- if (dataLength < 32) -+// See WRITE_BUFFER_OVERFLOW_SIZE elsewhere -+// and also ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE. -+ if (dataLength < 32 || dataLength > 100*1024*1024) - { -- #ifdef TEST -+ #ifdef WARNING - *logofs << "ServerReadBuffer: WARNING! Assuming length 32 " - << "for suspicious message of length " << dataLength - << ".\n" << logofs_flush; ---- a/nxcomp/WriteBuffer.h -+++ b/nxcomp/WriteBuffer.h -@@ -32,8 +32,14 @@ - // This is likely to be a reply to a X_ListFonts where - // user has a large amount of installed fonts. - // -+// Used also for messages sent, and should accommodate any BIG-REQUESTS. -+// Value was 4MB = 4194304, changed to 100MB = 104857600. -+// See also sanity check limits (set same, to 100*1024*1024) in -+// ClientReadBuffer.cpp ServerReadBuffer.cpp and ClientChannel.cpp, and -+// ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE elsewhere. -+// - --#define WRITE_BUFFER_OVERFLOW_SIZE 4194304 -+#define WRITE_BUFFER_OVERFLOW_SIZE 104857600 - - class WriteBuffer - { diff --git a/debian/patches/series b/debian/patches/series index 1a9405986..79df3658e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,2 @@ -#401_nxcomp_bigrequests-and-genericevent-extensions.full+lite.patch -016_nx-X11_install-location.debian.patch -102_xserver-xext_set-securitypolicy-path.debian.patch +2001_nx-X11_install-location.debian.patch +2002_xserver-xext_set-securitypolicy-path.debian.patch diff --git a/debian/rules b/debian/rules index 61ff2d934..ab69da2d8 100755 --- a/debian/rules +++ b/debian/rules @@ -21,6 +21,53 @@ override_dh_auto_clean: rm -Rf nx-X11/.build-exports dh_auto_clean +override_dh_clean: + rm nx-X11/config/Makefile + rm nx-X11/config/cf/Makefile + rm nx-X11/config/cf/date.def + rm nx-X11/config/cf/nxversion.def + rm nx-X11/include/GL/Makefile + rm nx-X11/include/Makefile + rm nx-X11/include/extensions/Makefile + rm nx-X11/programs/Makefile + rm nx-X11/programs/Xserver/GL/Makefile + rm nx-X11/programs/Xserver/GL/glx/Makefile + rm nx-X11/programs/Xserver/GL/mesa/GLcore/Makefile + rm nx-X11/programs/Xserver/GL/mesa/Makefile + rm nx-X11/programs/Xserver/GL/mesa/X/Makefile + rm nx-X11/programs/Xserver/GL/mesa/array_cache/Makefile + rm nx-X11/programs/Xserver/GL/mesa/main/Makefile + rm nx-X11/programs/Xserver/GL/mesa/math/Makefile + rm nx-X11/programs/Xserver/GL/mesa/shader/Makefile + rm nx-X11/programs/Xserver/GL/mesa/shader/grammar/Makefile + rm nx-X11/programs/Xserver/GL/mesa/shader/slang/Makefile + rm nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Makefile + rm nx-X11/programs/Xserver/GL/mesa/swrast/Makefile + rm nx-X11/programs/Xserver/GL/mesa/swrast_setup/Makefile + rm nx-X11/programs/Xserver/GL/mesa/tnl/Makefile + rm nx-X11/programs/Xserver/Makefile + rm nx-X11/programs/Xserver/Xext/Makefile + rm nx-X11/programs/Xserver/Xi/Makefile + rm nx-X11/programs/Xserver/composite/Makefile + rm nx-X11/programs/Xserver/damageext/Makefile + rm nx-X11/programs/Xserver/dbe/Makefile + rm nx-X11/programs/Xserver/dix/Makefile + rm nx-X11/programs/Xserver/fb/Makefile + rm nx-X11/programs/Xserver/hw/nxagent/Makefile + rm nx-X11/programs/Xserver/hw/nxagent/compext/Makefile + rm nx-X11/programs/Xserver/include/Makefile + rm nx-X11/programs/Xserver/mi/Makefile + rm nx-X11/programs/Xserver/miext/cw/Makefile + rm nx-X11/programs/Xserver/miext/damage/Makefile + rm nx-X11/programs/Xserver/os/Makefile + rm nx-X11/programs/Xserver/randr/Makefile + rm nx-X11/programs/Xserver/record/Makefile + rm nx-X11/programs/Xserver/render/Makefile + rm nx-X11/programs/Xserver/xfixes/Makefile + rm nx-X11/programs/Xserver/xkb/Makefile + rm nx-X11/xmakefile + dh_clean + override_dh_install: # strip static libs and remove .la files diff --git a/debian/watch b/debian/watch index 4ca027c1b..3620348df 100644 --- a/debian/watch +++ b/debian/watch @@ -1,3 +1,3 @@ version=3 -opts=filenamemangle=s/.*\/.*?([\d\.-]+)\.tar\.gz/nx-libs-$1.tar.gz/ \ -https://github.com/ArcticaProject/nx-libs/tags .*/archive/.*?([\d\.]+).tar.gz +opts=pgpsigurlmangle=s/$/.asc/ \ +http://releases.arctica-project.org/source/nx-libs/nx-libs-(.+)-full\.tar\.gz -- cgit v1.2.3