diff options
author | Mihai Moldovan <ionic@ionic.de> | 2017-12-15 12:55:17 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2017-12-15 12:55:17 +0100 |
commit | 1dad092caf01d733990648e6df64cbf964df5143 (patch) | |
tree | 39de0e643e76754a3e23ca9dd0350b8ba4f76250 /nxcompshad | |
parent | 6d70b9e3c47f27a166f4aacb522c5c1e49092dd9 (diff) | |
parent | 2b9025f797ee322e21077e100c2ee27c2e7fa0e0 (diff) | |
download | nx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.gz nx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.bz2 nx-libs-1dad092caf01d733990648e6df64cbf964df5143.zip |
Merge branch '3.6.x'
Diffstat (limited to 'nxcompshad')
-rw-r--r-- | nxcompshad/.gitignore | 21 | ||||
-rw-r--r-- | nxcompshad/CHANGELOG | 404 | ||||
-rw-r--r-- | nxcompshad/COPYING | 339 | ||||
-rw-r--r-- | nxcompshad/LICENSE | 22 | ||||
-rw-r--r-- | nxcompshad/Makefile.am | 21 | ||||
-rw-r--r-- | nxcompshad/Makefile.in | 192 | ||||
-rw-r--r-- | nxcompshad/Misc.h | 42 | ||||
-rw-r--r-- | nxcompshad/Poller.h | 31 | ||||
-rw-r--r-- | nxcompshad/Regions.h | 35 | ||||
l---------[-rw-r--r--] | nxcompshad/VERSION | 2 | ||||
-rw-r--r-- | nxcompshad/Win.cpp | 1137 | ||||
-rw-r--r-- | nxcompshad/Win.h | 224 | ||||
-rw-r--r-- | nxcompshad/configure.ac | 62 | ||||
-rw-r--r-- | nxcompshad/configure.in | 287 | ||||
-rw-r--r-- | nxcompshad/include/Shadow.h (renamed from nxcompshad/Shadow.h) | 26 | ||||
-rwxr-xr-x | nxcompshad/install-sh | 238 | ||||
l--------- | nxcompshad/m4/ax_cxx_compile_stdcxx.m4 | 1 | ||||
l--------- | nxcompshad/m4/ax_cxx_compile_stdcxx_11.m4 | 1 | ||||
l--------- | nxcompshad/m4/nx-macros.m4 | 1 | ||||
-rw-r--r-- | nxcompshad/nxcompshad.pc.in | 13 | ||||
-rw-r--r-- | nxcompshad/src/Core.cpp (renamed from nxcompshad/Core.cpp) | 78 | ||||
-rw-r--r-- | nxcompshad/src/Core.h (renamed from nxcompshad/Core.h) | 26 | ||||
-rw-r--r-- | nxcompshad/src/Input.cpp (renamed from nxcompshad/Input.cpp) | 26 | ||||
-rw-r--r-- | nxcompshad/src/Input.h (renamed from nxcompshad/Input.h) | 24 | ||||
-rw-r--r-- | nxcompshad/src/Logger.cpp (renamed from nxcompshad/Logger.cpp) | 48 | ||||
-rw-r--r-- | nxcompshad/src/Logger.h (renamed from nxcompshad/Logger.h) | 36 | ||||
-rw-r--r-- | nxcompshad/src/Makefile.am | 44 | ||||
-rw-r--r-- | nxcompshad/src/Manager.cpp (renamed from nxcompshad/Manager.cpp) | 32 | ||||
-rw-r--r-- | nxcompshad/src/Manager.h (renamed from nxcompshad/Manager.h) | 24 | ||||
-rw-r--r-- | nxcompshad/src/Misc.h | 50 | ||||
-rw-r--r-- | nxcompshad/src/Poller.h | 31 | ||||
-rw-r--r-- | nxcompshad/src/Regions.h | 43 | ||||
-rw-r--r-- | nxcompshad/src/Shadow.cpp (renamed from nxcompshad/Shadow.cpp) | 60 | ||||
-rw-r--r-- | nxcompshad/src/Updater.cpp (renamed from nxcompshad/Updater.cpp) | 32 | ||||
-rw-r--r-- | nxcompshad/src/Updater.h (renamed from nxcompshad/Updater.h) | 24 | ||||
-rw-r--r-- | nxcompshad/src/X11.cpp (renamed from nxcompshad/X11.cpp) | 36 | ||||
-rw-r--r-- | nxcompshad/src/X11.h (renamed from nxcompshad/X11.h) | 28 | ||||
-rw-r--r-- | nxcompshad/src/X11/include/XTest_nxcompshad.h | 71 | ||||
-rw-r--r-- | nxcompshad/src/X11/include/Xdamage_nxcompshad.h | 92 | ||||
-rw-r--r-- | nxcompshad/src/X11/include/Xrandr_nxcompshad.h | 80 |
40 files changed, 838 insertions, 3146 deletions
diff --git a/nxcompshad/.gitignore b/nxcompshad/.gitignore new file mode 100644 index 000000000..5eafb1add --- /dev/null +++ b/nxcompshad/.gitignore @@ -0,0 +1,21 @@ +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/Makefile +src/Makefile.in diff --git a/nxcompshad/CHANGELOG b/nxcompshad/CHANGELOG deleted file mode 100644 index 3472a4afe..000000000 --- a/nxcompshad/CHANGELOG +++ /dev/null @@ -1,404 +0,0 @@ -ChangeLog: - -nxcompshad-3.5.0-2 - -- Fixed TR03G02189. Now key combinations involving the Shift keys - are recognized correctly. - -nxcompshad-3.5.0-1 - -- Opened the 3.5.0 branch based on nxcompshad-3.4.0-3. - -- Updated copyright to year 2011. - -nxcompshad-3.4.0-3 - -- Updated copyright to year 2010. - -nxcompshad-3.4.0-2 - -- Fixed TR08G02256. Now the Shadow session is shown correctly with - MIT-SHM extension disabled. - -- Improved updateShadowFrameBuffer() and ~Poller() functions. - -- Avoided memory leak. - -nxcompshad-3.4.0-1 - -- Opened the 3.4.0 branch based on nxcompshad-3.3.0-3. - -- Updated version number. - -- Updated copyright to year 2009. - -- Improved error messages logging in case of initialization failures. - -nxcompshad-3.3.0-3 - -- Fixed TR01G02158. Keymap initialization could be incorrect because - of a type mismatch on 64 bit platforms. - -nxcompshad-3.3.0-2 - -- Updated VERSION. - -nxcompshad-3.3.0-1 - -- Opened the 3.3.0 branch based on nxcompshad-3.2.0-3. - -nxcompshad-3.2.0-3 - -- Improved keycode translation. - -nxcompshad-3.2.0-2 - -- Solved a problem when sending fake modifier events. - -- Added support for keyboard events handling for the web player. - -- Changed keycodes translation for Solaris keyboard. - -- Corrected a problem for keycodes translation from Solaris keyboard. - -- Fixed TR02F02001. In shadow session the shadower's keyboard layout - could be wrong. Now keycodes are correctly translated if master and - shadow keyboards have different layouts. - -- Added NXShadowGetScreenSize() and NXShadowSetScreenSize() functions, - so that the shadow session can handle correctly the resize of the - master session window. - -- Solved a compilation problem on GCC 4.3. - -nxcompshad-3.2.0-1 - -- Opened the 3.2.0 branch based on nxcompshad-3.1.0-2. - -nxcompshad-3.1.0-2 - -- Updated file VERSION to match the current release version. - -nxcompshad-3.1.0-1 - -- Opened the 3.1.0 branch based on nxcompshad-3.0.0-19. - -nxcompshad-3.0.0-19 - -- Skip initialization of damage extension if it was already disabled. - -nxcompshad-3.0.0-18 - -- The poller destructor checks if the damage extension is in use. - -- Small changes to the function getting the screen content in the case - damage is not in use. - -nxcompshad-3.0.0-17 - -- Cleanup of some log messages. - -nxcompshad-3.0.0-16 - -- Disabled some log message in the functions initializing the poller. - -nxcompshad-3.0.0-15 - -- Before calling XTest functions, it is checked if the connection to - master X server has been initialized. - -nxcompshad-3.0.0-14 - -- After the shm segment is created, its mode is changed and it is - marked for destroying. A check on the number of attaches is done. - -nxcompshad-3.0.0-13 - -- Creating the shm segment even if the uid of master X server can't be - retrieved. - -- Fixed reallocation of update region. - -- Checking if the master X server provides XTest extension. - -nxcompshad-3.0.0-12 - -- Fixed a compiler warning on AMD64 platform. - -- Changed configure script to add -fPIC option. - -- Fixed a mismatch in UpdateManager destructor. - -nxcompshad-3.0.0-11 - -- Fixed the function setting the uid of shm segment. - -- Sync with the master X server before marking the shm segment to be - destroyed. - -nxcompshad-3.0.0-10 - -- Setting the shm segments as readable only by the master X server - process. - -- Mark shm segments to be destroyed when the last process detach. - -- Enabled keycode translation in order to allow keyboards of different - models to work. - -nxcompshad-3.0.0-9 - -- Changed the LICENSE file to state that the software is only made - available under the version 2 of the GPL. - -- Added file COPYING. - -- Changes to translate keycodes between different keyboard types. The - keycodes are translated through the keysym. - -- Changes to convert a Mode_switch key to ISO_Level3_Shift if it is - needed. - -nxcompshad-3.0.0-8 - -- Added interface function NXShadowDisableShm disabling the use of - MIT-SHM extension. - -- Added interface function NXShadowDisableDamage disabling the use of - DAMAGE extension. - -- Added interface function NXShadowSetDisplayUid setting the uid of - shadowed X server - -- Changed the owner of shared memory segments to the uid of the sha- - dowed X server. - -- Fixed logWarning method. - -- Moved the code initializing the use of shared memory to shmInit - method of X11 Poller. - -nxcompshad-3.0.0-7 - -- Removed the class qualifier in the declaration of destroyUpdate- - ManagerRegion(). - -nxcompshad-3.0.0-6 - -- Fixed build errors on 64 bit platforms. - -- Called XTestGrabControl to override possible grabs of the X server. - -nxcompshad-3.0.0-5 - -- Added some stub members to the Poller class. These are intended to - handle keyboard state. - -- Changes in the default polling algorithm to disable the line pri- - ority persistence. - -nxcompshad-3.0.0-4 - -- If a low layer handling of screen changes is available (DAMAGE in - case of X11), polling routine uses it and returns immediately. - -- Creating a Damage notify object if the extension is supported. - -- DamageNotify events are saved in the update region. After all avail- - able events have been handled, the content of screen is retrieved - by ShnGetImage requests. - -- XDamageSubtract and XSync are done before any event handling. - -- Damages are requested as raw rectangles. - -- Added Xdamage and Xrandr to required libraries. - -- Fixed a problem with some lines not refreshed in shadowing mode. - -nxcompshad-3.0.0-3 - -- Added destroyUpdateManagerRegion() method to UpdateManager class. - -- Turned off some log messages. - -- Changed configure.in to remove warnings related to deprecated header - files and options. - -- Changed Makefile.in to remove autom4te.cache dir if the target is - 'distclean'. - -- Removed multi-word file names. - -nxcompshad-3.0.0-2 - -- Changes to get the screen of original display by a ShmGetImage. - -- Exit the polling loop if more than 50 ms have elapsed. - -nxcompshad-3.0.0-1 - -- Created nxcompshad based on nxshadow-3.0.0-7. - -nxshadow-3.0.0-7 - -- Deleted files KeyCursorTmp.cpp, scancodes.h, constant.h. - -- Renamed NXshadow.h to Shadow.h. - -- Merged NXshadowEvent.h with Shadow.h. - -- Fixed configure.in, changed Makefile.in to build Xcompshad library, - rebuilt configure script. - -nxshadow-3.0.0-6 - -- Implemented a callback mechanism to ask the caller program if screen - polling have to be suspended. - -nxshadow-3.0.0-5 - -- Changes to comply with the library name. - -- Fixed a bug in CorePoller that could prevent the update of the last - line of a rectangle. - -nxshadow-3.0.0-4 - -- Removed some parameters of the NXShadowAddUpdaterDisplay() function. - -nxshadow-3.0.0-3 - -- Updated copyright notices to the current year. - -- Code cleanup in KeysCursorTmp.c file. - -nxshadow-3.0.0-2 - -- If master agent uses shared memory extension, the GetImage is rea- - lized by XShmGetImage() function. - -- Added new parameters to NXShadowAddUpdaterDisplay() function, the - depth and bit mask color of the master display. - -nxshadow-3.0.0-1 - -- Opened the nxshadow-3.0.0 branch based on the nxaccess-3.0.0-13. - -- Renamed NXaccess.h NXaccessEvent.h and RegionM.h files as NXshadow.h - NXshadowEvent.h and Regions.h. - -- Modified the Makefile.in file and configure scripts in order to - compile the component. - -nxaccess-3.0.0-13 - -- Fixed X11Poller.cpp pre-processing. - -nxaccess-3.0.0-12 - -- Fixed build problems on Solaris. - -nxaccess-3.0.0-11 - -- Added NXShadowUpdateBuffer() function. This function creates the - buffer for the polling. - -- If the scaline fails, the polling will suspend for 50 ms. - -- Added some functions in order to access data member class. - -nxaccess-3.0.0-10 - -- Used XTEST extension to make the shared display create input events. - -nxaccess-3.0.0-9 - -- Added the mouse events. - -- Now, it's possible to connect to X server display or agent display, - the display's content is captured by GetImage and sent to another - display by PutImage. - -nxaccess-3.0.0-8 - -- Added KeysCursorTmp.cpp file. - -- Solved a problem with the keys, when the window lost focus the Key- - Release events weren't propagated. - -nxaccess-3.0.0-7 - -- Added functions in order to remove issues with some keys combina- - tion. - -nxaccess-3.0.0-6 - -- Added functions to simulate keys Ctrl + Alt + Del in order to run - the Task Manager application. - -- Now nxaccess is able to manage all switches between desktops. - -nxaccess-3.0.0-5 - -- Solved a problem with the cursor shape. After a while, the cursor - shape are no more updated. - -- Now the cursor is updated only when it changes its shape. - -- Removed a dirty lines after screen updates. - -- Removed the unused file Keyboard.cpp. - -- Added the colorCorrect() macro in NXaccess.h. - -- Removed the colorCorrect() function in Updater.cpp. - -nxaccess-3.0.0-4 - -- Renamed some source files and functions conforming them to the name - of component. - -nxaccess-3.0.0-3 - -- Removed the parameter of type Display in all methods of the class - Poller. - -- Print, Break and Pause keys are enabled. - -nxaccess-3.0.0-2 - -- Modified the Makefile.in in order to avoid compiling the executive - file. - -- Removed the unused file Main.cpp. - -- The Windows keys are enabled. - -- Synchronized local and remote states of Num_Lock, Caps_Lock and - Scroll_Lock. - -- Updated the NoMachine copyright notices. - -nxaccess-3.0.0-1 - -- Opened the 3.0.0 branch based on the nxmirror-2.0.0-3. - -nxmirror-2.0.0-3 - -- Added the keyboard events for all layouts. - -- The mouse wheel button is enabled. - -nxmirror-2.0.0-2 - -- Completed implementation of the keyboard events only for italian - layout. - -- Added the mouse events and shape cursor. - -nxmirror-2.0.0-1 - -- Opened the 2.0.0 branch based on the 1.5.0-60. - -- Added CHANGELOG. diff --git a/nxcompshad/COPYING b/nxcompshad/COPYING deleted file mode 100644 index d511905c1..000000000 --- a/nxcompshad/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/nxcompshad/LICENSE b/nxcompshad/LICENSE deleted file mode 100644 index 2c7f95a2d..000000000 --- a/nxcompshad/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2001, 2011 NoMachine - http://www.nomachine.com/. - -NXCOMPSHAD and NX extensions to X are copyright of NoMachine. - -Redistribution and use of this software is allowed according to the -following terms: - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License Version 2, and -not any other version, as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTA- -BILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, you can request a copy to NoMachine -or write to the Free Software Foundation, Inc., 59 Temple Place, -Suite 330, Boston, MA 02111-1307 USA - -All rights reserved. diff --git a/nxcompshad/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 1580a3594..000000000 --- a/nxcompshad/Makefile.in +++ /dev/null @@ -1,192 +0,0 @@ -############################################################################ -# # -# Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. # -# # -# NXCOMP, NX protocol compression and NX extensions to this software # -# are copyright of NoMachine. Redistribution and use of the present # -# software is allowed according to terms specified in the file LICENSE # -# which comes in the source distribution. # -# # -# Check http://www.nomachine.com/licensing.html for applicability. # -# # -# NX and NoMachine are trademarks of Medialogic S.p.A. # -# # -# All rights reserved. # -# # -############################################################################ - -# -# Get values from configure script. -# - -VERSION=@VERSION@ -LIBVERSION=@LIBVERSION@ - -# -# We would really like to enable all warnings, -Wredundant-decls, -# though, gives a warning caused by pthread.h and unistd.h and -# GCC 3.4 was changed in a way that it now complains about some -# of the -W directives we used before (-Wmissing-declarations, -# -Wnested-externs, -Wstrict-prototypes and -Wmissing-prototypes). -# - -CXX = @CXX@ -CXXFLAGS = @CXXFLAGS@ @X_CFLAGS@ @DEFS@ \ - -Wall -Wpointer-arith -CXXINCLUDES = -CXXDEFINES = - -# -# C programs don't share the C++ flags. They should -# have their own @CCFLAGS@. -# - -CC = @CC@ -CCFLAGS = @X_CFLAGS@ @DEFS@ \ - -Wall -Wpointer-arith -CCINCLUDES = -CCDEFINES = - -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -L/usr/X11R6/lib -lX11 - -# -# Only if THREADS is defined. -# -# LIBS = $(LIBS) -lpthread -# - -# -# Only if you want ElectricFence. -# -# LIBS = $(LIBS) -lefence -# - -# -# Only if you want mpatrol. -# -# LIBS = $(LIBS) -lmpatrol -lbfd -liberty -# - -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -man1dir = @mandir@/man1 -VPATH = @srcdir@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -# -# This should be autodetected. -# - -MAKEDEPEND = @MAKEDEPEND@ -DEPENDINCLUDES = -I/usr/include/g++ -I/usr/include/g++-3 - -.SUFFIXES: .cpp.c - -.cpp.o: - $(CXX) -c $(CXXFLAGS) $(CXXINCLUDES) $(CXXDEFINES) $< -.c.o: - $(CC) -c $(CCFLAGS) $(CCINCLUDES) $(CCDEFINES) $< - -LIBRARY = Xcompshad - -LIBNAME = lib$(LIBRARY) -LIBFULL = lib$(LIBRARY).so.$(VERSION) -LIBLOAD = lib$(LIBRARY).so.$(LIBVERSION) -LIBSHARED = lib$(LIBRARY).so -LIBARCHIVE = lib$(LIBRARY).a - -MSRC = Main.c - -CSRC = - -CXXSRC = Core.cpp \ - Input.cpp \ - Logger.cpp \ - Shadow.cpp \ - X11.cpp \ - Win.cpp \ - Updater.cpp \ - Manager.cpp - -MOBJ = $(MSRC:.c.cpp=.o) -COBJ = $(CSRC:.c=.o) -CXXOBJ = $(CXXSRC:.cpp=.o) - -MLIBS = -L. -lXShadow - -ifeq ($(findstring -lgdi32,$(LIBS)),-lgdi32) - -# We need a smarter way to detect windows -# platform. - -LIBDLL = cyg$(LIBRARY).dll -LIBDLLSTATIC = lib${LIBRARY}.dll.a - -all: depend $(LIBARCHIVE) $(LIBDLL) - -else - -EXTRALIBS = -lXtst -lXrandr -lXdamage - -all: depend $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) - -endif - -$(LIBFULL): $(CXXOBJ) $(COBJ) - $(CXX) -o $@ $(LDFLAGS) $(CXXOBJ) $(COBJ) $(LIBS) $(EXTRALIBS) - -$(LIBLOAD): $(LIBFULL) - rm -f $(LIBLOAD) - ln -s $(LIBFULL) $(LIBLOAD) - -$(LIBSHARED): $(LIBFULL) - rm -f $(LIBSHARED) - ln -s $(LIBFULL) $(LIBSHARED) - -$(LIBARCHIVE): $(CXXOBJ) $(COBJ) - rm -f $(LIBARCHIVE) - ar clq $(LIBARCHIVE) $(CXXOBJ) $(COBJ) - ranlib $(LIBARCHIVE) - -$(LIBDLL): $(LIBARCHIVE) - $(CC) -o $@ \ - -shared \ - -Wl,--out-implib=$(LIBDLLSTATIC) \ - -Wl,--export-all-symbols \ - -Wl,--enable-auto-import \ - -Wl,--whole-archive ${LIBARCHIVE} \ - -Wl,--no-whole-archive \ - ${LIBS} -L/usr/X11R6/lib - -$(PROGRAM): $(MOBJ) $(COBJ) $(CXXOBJ) $(LIBDLL) -# $(CC) $(CCFLAGS) -o $@ $(MOBJ) $(MLIBS) - -depends: depend.status - -depend: depend.status - -depend.status: - if [ -x $(MAKEDEPEND) ] ; then \ - $(MAKEDEPEND) $(CXXINCLUDES) $(CCINCLUDES) \ - $(DEPENDINCLUDES) -f Makefile $(MSRC) $(CSRC) $(CXXSRC) 2>/dev/null; \ - fi - touch depend.status - -install: install.bin install.man - -install.bin: - -install.man: - -clean: - -rm -f *~ *.o *.bak st?????? core core.* *.out.* *.exe.stackdump \ - $(LIBFULL) $(LIBLOAD) $(LIBSHARED) $(LIBARCHIVE) $(LIBDLL) $(LIBDLLSTATIC) $(PROGRAM) $(PROGRAM).exe - -distclean: clean - -rm -rf config.status config.log config.cache depend.status Makefile tags autom4te.cache diff --git a/nxcompshad/Misc.h b/nxcompshad/Misc.h deleted file mode 100644 index 6dc86359f..000000000 --- a/nxcompshad/Misc.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#ifndef Misc_H -#define Misc_H - -#include <iostream> - -#include <errno.h> -#include <string.h> - -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 4435b5bba..000000000 --- a/nxcompshad/Poller.h +++ /dev/null @@ -1,31 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#ifndef Poller_H -#define Poller_H - -#if defined(__CYGWIN32__) || defined(WIN32) - -#include "Win.h" - -#else - -#include "X11.h" - -#endif - -#endif /* Poller_H */ diff --git a/nxcompshad/Regions.h b/nxcompshad/Regions.h deleted file mode 100644 index b9303dcb7..000000000 --- a/nxcompshad/Regions.h +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#ifndef Region_H -#define Region_H - -#include <X11/Xlib.h> -#include <X11/Xutil.h> - -typedef struct { - short x1, x2, y1, y2; -} Box, BOX, BoxRec, *BoxPtr; - -typedef struct _XRegion { - long size; - long numRects; - BOX *rects; - BOX extents; -}; - -#endif /* Region_H */ diff --git a/nxcompshad/VERSION b/nxcompshad/VERSION index 1545d9665..6ff19de4b 100644..120000 --- a/nxcompshad/VERSION +++ b/nxcompshad/VERSION @@ -1 +1 @@ -3.5.0 +../VERSION
\ No newline at end of file diff --git a/nxcompshad/Win.cpp b/nxcompshad/Win.cpp deleted file mode 100644 index 481cbcac0..000000000 --- a/nxcompshad/Win.cpp +++ /dev/null @@ -1,1137 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#if defined(__CYGWIN32__) || defined(WIN32) - -#include <X11/keysym.h> - -#define PANIC -#define WARNING -#undef TEST -#undef DEBUG - -#include "Poller.h" -#include "Logger.h" - -Poller::Poller(Input *input, Display *display, int depth) : CorePoller(input, display) -{ - logTrace("Poller::Poller"); - - screenDC_ = NULL; - screenBmp_ = NULL; - memoryDC_ = NULL; - pDIBbits_ = NULL; - DIBBuffer_ = NULL; - pKey_ = NULL; - pMouse_ = NULL; - path_ = NULL; - keymapName_ = input -> getKeymap(); - keymap_ = NULL; - toggleButtonState_ = 0; - serverModifierState_ = 0; - display_ = display; - depth_ = DefaultDepth(display_, DefaultScreen(display_)); - oldCursor_ = 0; - xCursor_ = 0; -} - -Poller::~Poller() -{ - logTrace("Poller::~Poller"); - - if (screenDC_) - { - BOOL result = ReleaseDC(NULL, screenDC_); - - logTest("Poller::~Poller", "ReleaseDC returned [%d].", result); - - screenDC_ = NULL; - } - - if (memoryDC_) - { - BOOL result = DeleteDC(memoryDC_); - - logTest("Poller::~Poller", "DeleteDC returned [%d].", result); - - memoryDC_ = NULL; - } - - if (screenBmp_) - { - BOOL result = DeleteObject(screenBmp_); - - logTest("Poller::~Poller", "DeleteObject returned [%d].", result); - - screenBmp_ = NULL; - } - - if (DIBBuffer_) - { - logDebug("Poller::~Poller", "Delete DIBBuffer_ [%p].", DIBBuffer_); - - delete [] DIBBuffer_; - } - - if (pKey_) - { - logDebug("Poller::~Poller", " pKey_[%p].", pKey_); - - delete [] pKey_; - } - - if (pMouse_) - { - logDebug("Poller::~Poller", " pMouse_[%p].", pMouse_); - - delete [] pMouse_; - } - - if (keymap_) - { - logDebug("Poller::~Poller", " keymap_[%p].", keymap_); - - delete [] keymap_; - } -} - -int Poller::init() -{ - logTrace("Poller::init"); - - int maxLengthArrayINPUT = 6; - - platformOS(); - - pKey_ = new INPUT [maxLengthArrayINPUT]; - - if (pKey_ == NULL) - { - logError("Poller::init", ESET(ENOMEM)); - - return -1; - } - - for (int i = 0; i < maxLengthArrayINPUT; i++) - { - pKey_[i].type = INPUT_KEYBOARD; - pKey_[i].ki.wVk = (WORD) 0; - pKey_[i].ki.time = (DWORD) 0; - pKey_[i].ki.dwExtraInfo = (DWORD) 0; - } - - pMouse_ = new INPUT; - - if (pMouse_ == NULL) - { - logError("Poller::init", ESET(ENOMEM)); - - return -1; - } - - pMouse_ -> type = INPUT_MOUSE; - - pMouse_ -> mi.dx = 0; - pMouse_ -> mi.dy = 0; - pMouse_ -> mi.mouseData = (DWORD) 0; - pMouse_ -> mi.time = 0; - pMouse_ -> mi.dwExtraInfo = (ULONG_PTR) NULL; - - screenDC_ = GetDC(NULL); - - if (screenDC_ == NULL) - { - logError("Poller::init", ESET(ENOMSG)); - - return -1; - } - - switch(depth_) - { - case 8: - { - depth_ = 16; - break; - } - case 16: - { - depth_ = 16; - break; - } - case 24: - { - depth_ = 32; - break; - } - default: - { - logError("Poller::init", ESET(EINVAL)); - - return -1; - } - } - - width_ = GetDeviceCaps(screenDC_, HORZRES); - height_ = GetDeviceCaps(screenDC_, VERTRES); - - bpl_ = width_ * (depth_ >> 3); - bpp_ = (depth_ >> 3); - - logTest("Poller::init", "Screen geometry is [%d, %d] depth is [%d] bpl [%d] bpp [%d].", - width_, height_, depth_, bpl_, bpp_); - - logTest("Poller::init", "Got device context at [%p] screen size is (%d,%d).", - screenDC_, width_, height_); - - memoryDC_ = CreateCompatibleDC(screenDC_); - - if (memoryDC_ == NULL) - { - logError("Poller::init", ESET(ENOMSG)); - - return -1; - } - - // - // Delete the old bitmap for the memory device. - // - - HBITMAP bitmap = (HBITMAP) GetCurrentObject(memoryDC_, OBJ_BITMAP); - - if (bitmap && DeleteObject(bitmap) == 0) - { - logError("Poller::init", ESET(ENOMSG)); - } - - // - // Bitmap header describing the bitmap we want to get from GetDIBits. - // - - bmi_.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bmi_.bmiHeader.biWidth = width_; - bmi_.bmiHeader.biHeight = -height_; - bmi_.bmiHeader.biPlanes = 1; - bmi_.bmiHeader.biBitCount = depth_; - bmi_.bmiHeader.biCompression = BI_RGB; - bmi_.bmiHeader.biSizeImage = 0; - bmi_.bmiHeader.biXPelsPerMeter = 0; - bmi_.bmiHeader.biYPelsPerMeter = 0; - bmi_.bmiHeader.biClrUsed = 0; - bmi_.bmiHeader.biClrImportant = 0; - - screenBmp_ = CreateDIBSection(memoryDC_, &bmi_, DIB_RGB_COLORS, &pDIBbits_, NULL, 0); - ReleaseDC(NULL,memoryDC_); - - if (screenBmp_ == NULL) - { - logTest ("Poller::init", "This video device is not supporting DIB section"); - - pDIBbits_ = NULL; - - screenBmp_ = CreateCompatibleBitmap(screenDC_, width_, height_); - - if (screenBmp_ == NULL) - { - logError("Poller::init", ESET(ENOMSG)); - - return -1; - } - - if (SelectObject(memoryDC_, screenBmp_) == NULL) - { - logError("Poller::init", ESET(ENOMSG)); - - return -1; - } - } - else - { - logTest ("Poller::init", "Enabled the DIB section"); - - if (SelectObject(memoryDC_, screenBmp_) == NULL) - { - logError("Poller::init", ESET(ENOMSG)); - - return -1; - } - } - - // - // Check if the screen device raster capabilities - // support the bitmap transfer. - // - - if ((GetDeviceCaps(screenDC_, RASTERCAPS) & RC_BITBLT) == 0) - { - logTest("Poller::init", "This video device is not supporting the bitmap transfer."); - - logError("Poller::init", ESET(ENOMSG)); - - return -1; - } - - // - // Check if the memory device raster capabilities - // support the GetDIBits and SetDIBits functions. - // - - if ((GetDeviceCaps(memoryDC_, RASTERCAPS) & RC_DI_BITMAP) == 0) - { - logTest("Poller::init", "This memory device is not supporting the GetDIBits and SetDIBits " - "function."); - - logError("Poller::init", ESET(ENOMSG)); - - return -1; - } - - if (GetDeviceCaps(screenDC_, PLANES) != 1) - { - logTest("Poller::init", "This video device has more than 1 color plane."); - - logError("Poller::init", ESET(ENOMSG)); - - return -1; - } - - return CorePoller::init(); -} - -// -// FIXME: Remove me. -// - -void ErrorExit(LPTSTR lpszFunction) -{ - LPVOID lpMsgBuf; - DWORD dw = GetLastError(); - - FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM, - NULL, - dw, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, - 0, NULL ); - - logTest(lpszFunction, " Failed with error [%ld]: %s", dw, (char*)lpMsgBuf); - - LocalFree(lpMsgBuf); - ExitProcess(dw); -} - -// -// FIXME: End. -// - -char *Poller::getRect(XRectangle r) -{ - logTrace("Poller::getRect"); - - logDebug("Poller::getRect", "Going to retrive rectangle [%d, %d, %d, %d].", - r.x, r.y, r.width, r.height); - - // - // The CAPTUREBLT operation could be a very - // cpu-consuming task. We should make some - // test to see how much it is expensive. - // Anyway we get tooltip windows and any - // other special effect not included with - // only the SRCCOPY operation. - // - - if (BitBlt(memoryDC_, r.x, r.y, r.width, r.height, - screenDC_, r.x, r.y, SRCCOPY | CAPTUREBLT) == 0) - { - logError("Poller::getRect", ESET(ENOMSG)); - - logTest("Poller::getRect", "Failed to perform a bit-block transfer."); - logTest("Poller::getRect", "bit-block error=%lu", GetLastError()); - - return NULL; - } - - // bmi_.bmiHeader.biWidth = r.width; - // bmi_.bmiHeader.biHeight = -r.height; - - if (pDIBbits_ == NULL) - { - static long nPixel = 0; - - if (nPixel < r.width * r.height) - { - - if (DIBBuffer_) - { - delete [] DIBBuffer_; - } - - nPixel = r.width * r.height; - - DIBBuffer_ = new char [nPixel * bpp_]; - - if (DIBBuffer_ == NULL) - { - logError("Poller::getRect", ESET(ENOMEM)); - - nPixel = 0; - - return NULL; - } - } - - if (GetDIBits(memoryDC_, screenBmp_, height_ - r.height - r.y, r.height, - DIBBuffer_, &bmi_, DIB_RGB_COLORS) == 0) - { - logError("Poller::getRect", ESET(ENOMSG)); - - logTest("Poller::getRect", "Failed to retrieve the screen bitmap."); - - return NULL; - } - - return DIBBuffer_; - } - else - { - return (char *) pDIBbits_ + r.y * bpl_ + r.x * bpp_; - } -} - -void Poller::handleKeyboardEvent(Display *display, XEvent *event) -{ - KeySym keysym; - char *keyname = new char [31]; - keyTranslation tr = {0, 0}; - unsigned char scancode = 0; - int lengthArrayINPUT = 0; - - if (XLookupString((XKeyEvent *) event, keyname, 30, &keysym, NULL) > 0) - { - logTest("Poller::handleKeyboardEvent", "keyname %s, keysym [%x]", keyname, (unsigned int)keysym); - } - - if (specialKeys(keysym, event -> xkey.state, event -> type) == 1) - { - delete[] keyname; - return; - } - - tr = xkeymapTranslateKey(keysym, event -> xkey.keycode, event -> xkey.state); - scancode = tr.scancode; - - logTest("Poller::handleKeyboardEvent", "keyname [%s] scancode [0x%x], keycode[0x%x], keysym [%x]", keyname, - tr.scancode, event ->xkey.keycode, (unsigned int)keysym); - - if (scancode == 0) - { - delete[] keyname; - return; - } - - if (event -> type == KeyPress) - { - int test1 = MapVirtualKey(scancode, MAPVK_VSC_TO_VK_EX); - int test2 = MapVirtualKey(0x24, MAPVK_VSC_TO_VK_EX); - - if (test1 == test2) - { - simulateCtrlAltDel(); - } - - if (isModifier(scancode) == 0) - { - savedServerModifierState_ = serverModifierState_; - } - - ensureServerModifiers(tr, &lengthArrayINPUT); - if (sendInput(scancode, 1, &lengthArrayINPUT) == 0) - { - logTest("Poller::handleKeyboardEvent", "lengthArrayINPUT [%d].", lengthArrayINPUT); - } - restoreServerModifiers(scancode); - } - else if (event -> type == KeyRelease) - { - if (sendInput(scancode, 0, &lengthArrayINPUT) == 0) - { - logTest("Poller::handleKeyboardEvent", "lengthArrayINPUT [%d].", lengthArrayINPUT); - } - } - - updateModifierState(scancode, (event -> type == KeyPress)); - - delete[] keyname; -} - -void Poller::handleWebKeyboardEvent(KeySym keysym, Bool isKeyPress) -{ -/* -FIXME -*/ -} - -void Poller::handleMouseEvent(Display *display, XEvent *event) -{ - DWORD flg = 0; - DWORD whl = 0; - - if (event -> type == ButtonPress) - { - logTest("Poller::handleMouseEvent", "ButtonPress.\n"); - switch (event -> xbutton.button) - { - case Button1: - { - flg = MOUSEEVENTF_LEFTDOWN; - break; - } - case Button2: - { - flg = MOUSEEVENTF_MIDDLEDOWN; - break; - } - case Button3: - { - flg = MOUSEEVENTF_RIGHTDOWN; - break; - } - case Button4: - { - flg = MOUSEEVENTF_WHEEL; - whl = WHEEL_DELTA; - pMouse_ -> mi.mouseData = whl; - break; - } - case Button5: - { - flg = MOUSEEVENTF_WHEEL; - whl = (DWORD) (-WHEEL_DELTA); - pMouse_ -> mi.mouseData = whl; - break; - } - } - } - else if (event -> type == ButtonRelease) - { - switch (event -> xbutton.button) - { - case Button1: - { - flg = MOUSEEVENTF_LEFTUP; - break; - } - case Button2: - { - flg = MOUSEEVENTF_MIDDLEUP; - break; - } - case Button3: - { - flg = MOUSEEVENTF_RIGHTUP; - break; - } - case Button4: - { - flg = MOUSEEVENTF_WHEEL; - whl = 0; - pMouse_ -> mi.mouseData = whl; - break; - } - case Button5: - { - flg = MOUSEEVENTF_WHEEL; - whl = 0; - pMouse_ -> mi.mouseData = whl; - break; - } - } - } - else if (event -> type == MotionNotify) - { - logTest("Poller::handleMouseEvent", "SetCursor - MotionNotify"); - - SetCursorPos(event -> xmotion.x, event -> xmotion.y); - } - - if (flg > 0) - { - // logTest("Poller::handleMouseEvent", "SetCursor - flg > 0"); - // - // FIXME: move the cursor to the pace the event occurred - // - - SetCursorPos(event -> xbutton.x, event -> xbutton.y); - - // - // FIXME: Remove me: send the click/release event - // mouse_event(flg, 0, 0, whl, (ULONG_PTR)NULL); - // - - pMouse_ -> mi.dwFlags = flg; - - if (SendInput(1, pMouse_, sizeof(INPUT)) == 0) - { - logTest("Poller::handleMouseEvent", "Failed SendInput"); - } - } -} - -int Poller::updateCursor(Window wnd, Visual* vis) -{ - BYTE *mBits, *andBits, *xorBits; - - logTrace("Poller::Cursor"); - - // - // Retrieve mouse cursor handle. - // - - CURSORINFO cursorInfo; - cursorInfo.cbSize = sizeof(CURSORINFO); - - if (GetCursorInfo(&cursorInfo) == 0) - { - logTest("Poller::Cursor", "GetCursorInfo() failed [%u].\n", (unsigned int)GetLastError()); - LocalFree(&cursorInfo); - return -1; - } - - HCURSOR hCursor = cursorInfo.hCursor; - - if (hCursor == 0) - { - logTest("Poller::Cursor","Cursor Handle is NULL. Error[%u].\n", (unsigned int)GetLastError()); - return 1; - } - - if (hCursor == oldCursor_) - { - LocalFree(&cursorInfo); - return 1; - } - else - { - oldCursor_ = hCursor; - } - - // - // Get cursor info. - // - - // logTest("Poller::Cursor","hCursor [%xH] GetCursor [%xH].\n", hCursor, GetCursor()); - - ICONINFO iconInfo; - if (GetIconInfo(hCursor, &iconInfo) == 0) - { - logTest("Poller::Cursor","GetIconInfo() failed. Error[%d].", (unsigned int)GetLastError()); - LocalFree(&iconInfo); - // return -1; - } - - BOOL isColorCursor = FALSE; - if (iconInfo.hbmColor != NULL) - { - isColorCursor = TRUE; - } - - if (iconInfo.hbmMask == NULL) - { - logTest("Poller::Cursor","Cursor bitmap handle is NULL.\n"); - return -1; - } - - // - // Check bitmap info for the cursor - // - - BITMAP bmMask; - if (!GetObject(iconInfo.hbmMask, sizeof(BITMAP), (LPVOID)&bmMask)) - { - logTest("Poller::Cursor","GetObject() for bitmap failed.\n"); - DeleteObject(iconInfo.hbmMask); - LocalFree(&bmMask); - return -1; - } - - if (bmMask.bmPlanes != 1 || bmMask.bmBitsPixel != 1) - { - logTest("Poller::Cursor","Incorrect data in cursor bitmap.\n"); - LocalFree(&bmMask); - DeleteObject(iconInfo.hbmMask); - return -1; - } - - // Get monochrome bitmap data for cursor - // NOTE: they say we should use GetDIBits() instead of GetBitmapBits(). - mBits = new BYTE[bmMask.bmWidthBytes * bmMask.bmHeight]; - - if (mBits == NULL)//Data bitmap - { - DeleteObject(iconInfo.hbmMask); - DestroyCursor(cursorInfo.hCursor); - LocalFree(&iconInfo); - LocalFree(&bmMask); - delete[] mBits; - return -1; - } - - BOOL success = GetBitmapBits(iconInfo.hbmMask, bmMask.bmWidthBytes * bmMask.bmHeight, mBits); - - if (!success) - { - logTest("Poller::Cursor","GetBitmapBits() failed.\n"); - delete[] mBits; - return -1; - } - - andBits = mBits; - - long width = bmMask.bmWidth; - long height = (isColorCursor) ? bmMask.bmHeight : bmMask.bmHeight/2; - - // - // The bitmask is formatted so that the upper half is - // the icon AND bitmask and the lower half is the icon XOR bitmask. - // - - if (!isColorCursor) - { - xorBits = andBits + bmMask.bmWidthBytes * height; - -/* logTest("Poller::Cursor","no color widthB[%ld] width[%ld] height[%ld] totByte[%ld] mbits[%ld].\n", - bmMask.bmWidthBytes,width,height,success,bmMask.bmHeight * bmMask.bmWidthBytes);*/ - - if (xCursor_ > 0) - { - XFreeCursor(display_, xCursor_); - } - - xCursor_ = createCursor(wnd, vis, (unsigned int)iconInfo.xHotspot, (unsigned int)iconInfo.yHotspot, - width, height, (unsigned char *)xorBits, (unsigned char *)andBits); - - XDefineCursor(display_, wnd, xCursor_); - } - - delete []mBits; - DeleteObject(iconInfo.hbmMask); - LocalFree(&bmMask); - DestroyCursor(cursorInfo.hCursor); - LocalFree(&iconInfo); - - return success; -} - -unsigned char Poller::specialKeys(unsigned int keysym, unsigned int state, int pressed) -{ - return 0; -} - -void Poller::ensureServerModifiers(keyTranslation tr, int *lengthArrayINPUT) -{ - return; -} - -void Poller::restoreServerModifiers(UINT scancode) -{ - keyTranslation dummy; - int lengthArrayINPUT = 0; - - if (isModifier(scancode) == 1) - { - return; - } - - dummy.scancode = 0; - dummy.modifiers = savedServerModifierState_; - ensureServerModifiers(dummy, &lengthArrayINPUT); - if (sendInput(0, 0, &lengthArrayINPUT) == 0) - { - logTest("Poller::restoreServerModifiers", "lengthArrayINPUT [%d]", lengthArrayINPUT); - } -} - -int Poller::updateShadowFrameBuffer(void) -{ - return 1; -} - -void Poller::addToKeymap(char *keyname, unsigned char scancode, unsigned short modifiers, char *mapname) -{ - return; -} - -FILE *Poller::xkeymapOpen(char *filename) -{ - return NULL; -} - -int Poller::xkeymapRead(char *mapname) -{ - return 1; -} - -void Poller::xkeymapInit(char *keyMapName) -{ - return; -} - -keyTranslation Poller::xkeymapTranslateKey(unsigned int keysym, unsigned int keycode, - unsigned int state) -{ - keyTranslation tr = { 0, 0 }; - - return tr; -} - -unsigned char Poller::getKeyState(unsigned int state, unsigned int keysym) -{ - return 0; -} - -char *Poller::getKsname(unsigned int keysym) -{ - char *ksname = NULL; - - return ksname; -} - -// -// Routine used to fool Winlogon into thinking CtrlAltDel was pressed -// -char Poller::simulateCtrlAltDel(void) -{ - HDESK oldDesktop = GetThreadDesktop(GetCurrentThreadId()); - - // - // Switch into the Winlogon desktop. - // - if (selectDesktopByName("Winlogon") == 0) - { - logTest("SimulateCtrlAltDelThreadFn","Failed to select logon desktop."); - return 0; - } - - logTest("SimulateCtrlAltDelThreadFn","Generating ctrl-alt-del."); - - // - // Winlogon uses hotkeys to trap Ctrl-Alt-Del. - // - PostMessage(HWND_BROADCAST, WM_HOTKEY, 0, MAKELONG(MOD_ALT | MOD_CONTROL, VK_DELETE)); - - // - // Switch back to our original desktop. - // - if (oldDesktop != NULL) - { - selectDesktop(oldDesktop); - } - - return 1; -} - -// Switches the current thread into a different desktop by desktop handle -// This call takes care of all the evil memory management involved -char Poller::selectDesktop(HDESK newDesktop) -{ - // - // Only on NT. - // - if (isWinNT()) - { - HDESK oldDesktop = GetThreadDesktop(GetCurrentThreadId()); - - DWORD dummy; - char newName[256]; - - if (GetUserObjectInformation(newDesktop, UOI_NAME, &newName, 256, &dummy) == 0) - { - logDebug("Poller::selectDesktop","GetUserObjectInformation() failed. Error[%lu].", GetLastError()); - return 0; - } - - logTest("Poller::selectDesktop","New Desktop to [%s] (%x) from (%x).", - newName, (unsigned int)newDesktop, (unsigned int)oldDesktop); - - // - // Switch the desktop. - // - if(SetThreadDesktop(newDesktop) == 0) - { - logDebug("Poller::SelectDesktop","Unable to SetThreadDesktop(), Error=%lu.", GetLastError()); - return 0; - } - - // - // Switched successfully - destroy the old desktop. - // - if (CloseDesktop(oldDesktop) == 0) - { - logDebug("Poller::selectHdesk","Failed to close old desktop (%x), Error=%lu.", - (unsigned int)oldDesktop, GetLastError()); - return 0; - } - } - - return 1; -} - -// -// Switches the current thread into a different desktop, by name -// Calling with a valid desktop name will place the thread in that desktop. -// Calling with a NULL name will place the thread in the current input desktop. -// - -char Poller::selectDesktopByName(char *name) -{ - // - // Only on NT. - // - if (isWinNT()) - { - HDESK desktop; - - if (name != NULL) - { - // - // Attempt to open the named desktop. - // - desktop = OpenDesktop(name, 0, FALSE, - DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | - DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL | - DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS | - DESKTOP_SWITCHDESKTOP | GENERIC_WRITE); - } - else - { - // - // Open the input desktop. - // - desktop = OpenInputDesktop(0, FALSE, - DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | - DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL | - DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS | - DESKTOP_SWITCHDESKTOP | GENERIC_WRITE); - } - - if (desktop == NULL) - { - logDebug("Poller::selectDesktopByName","Unable to open desktop, Error=%lu.", GetLastError()); - return 0; - } - - // - // Switch to the new desktop - // - if (selectDesktop(desktop) == 0) - { - // - // Failed to enter the new desktop, so free it! - // - logDebug("Poller::selectDesktopByName","Failed to select desktop."); - - if (CloseDesktop(desktop) == 0) - { - logDebug("Poller::selectDesktopByName","Failed to close desktop, Error=%lu.", GetLastError()); - return 0; - } - } - - return 1; - } - - return (name == NULL); -} - -void Poller::platformOS() -{ - OSVERSIONINFO osversioninfo; - osversioninfo.dwOSVersionInfoSize = sizeof(osversioninfo); - - // - // Get the current OS version. - // - if (GetVersionEx(&osversioninfo) == 0) - { - platformID_ = 0; - } - platformID_ = osversioninfo.dwPlatformId; - -// -// versionMajor = osversioninfo.dwMajorVersion; -// versionMinor = osversioninfo.dwMinorVersion; -// -} - -char Poller::checkDesktop() -{ - // - // Only on NT. - // - if (isWinNT()) - { - // - // Get the input and thread desktops. - // - HDESK desktop = GetThreadDesktop(GetCurrentThreadId()); - HDESK inputDesktop = OpenInputDesktop(0, FALSE, - DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | - DESKTOP_ENUMERATE | DESKTOP_HOOKCONTROL | - DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS | - DESKTOP_SWITCHDESKTOP | GENERIC_WRITE); - - if (inputDesktop == NULL) - { - return 0; - } - - DWORD dummy; - char desktopName[256]; - char inputName[256]; - - if (GetUserObjectInformation(desktop, UOI_NAME, &desktopName, 256, &dummy) == 0) - { - if (CloseDesktop(inputDesktop) == 0) - { - logDebug("Poller::checkDesktop", "Failed to close desktop, Error[%d].", (unsigned int)GetLastError()); - return 0; - } - } - - if (GetUserObjectInformation(inputDesktop, UOI_NAME, &inputName, 256, &dummy) == 0) - { - if (CloseDesktop(inputDesktop) == 0) - { - logDebug("Poller::checkDesktop", "Failed to close input desktop, Error[%d].", (unsigned int)GetLastError()); - return 0; - } - } - - if (strcmp(desktopName, inputName) != 0) - { - // - // Switch to new desktop. - // - selectDesktop(inputDesktop); - } - - if (CloseDesktop(desktop) == 0) - { - logDebug("Poller::checkDesktop", "Failed to close input desktop, Error[%d].", (unsigned int)GetLastError()); - return 0; - } - - if (CloseDesktop(inputDesktop) == 0) - { - logDebug("Poller::checkDesktop", "Failed to close input desktop, Error[%d].", (unsigned int)GetLastError()); - return 0; - } - } - - return 1; -} - -unsigned char Poller::isModifier(UINT scancode) -{ - return 0; -} - -void Poller::updateModifierState(UINT scancode, unsigned char pressed) -{ - return; -} - -Cursor Poller::createCursor(Window wnd, Visual *vis,unsigned int x, unsigned int y, - int width, int height, unsigned char *xormask, unsigned char *andmask) -{ - Pixmap maskglyph, cursorglyph; - XColor bg, fg; - Cursor xcursor; - unsigned char *cursor; - unsigned char *mask, *pmask, *pcursor, tmp; - int scanline, offset; - - scanline = (width + 7) / 8; - offset = scanline * height; - - pmask = andmask; - pcursor = xormask; - for (int i = 0; i < offset; i++) - { - // - // The pixel is black if both the bit of andmask and xormask is one. - // - - tmp = *pcursor & *pmask; - *pcursor ^= tmp; - *pmask ^= tmp; - - *pmask = ~(*pmask); - - pmask++; - pcursor++; - } - - cursor = new unsigned char[offset]; - memcpy(cursor, xormask, offset); - - mask = new unsigned char[offset]; - memcpy(mask, andmask, offset); - - fg.red = fg.blue = fg.green = 0xffff; - bg.red = bg.blue = bg.green = 0x0000; - fg.flags = bg.flags = DoRed | DoBlue | DoGreen; - - cursorglyph = createGlyph(wnd, vis, width, height, cursor); - maskglyph = createGlyph(wnd, vis, width, height, mask); - - xcursor = XCreatePixmapCursor(display_, cursorglyph, maskglyph, &fg, &bg, x, y); - - XFreePixmap(display_, maskglyph); - XFreePixmap(display_, cursorglyph); - delete[]mask; - delete[]cursor; - - return xcursor; -} - -Pixmap Poller::createGlyph(Window wnd, Visual *visual, int width, int height, unsigned char *data) -{ - XImage *image; - Pixmap bitmap; - int scanline; - GC glyphGC; - - scanline = (width + 7) / 8; - - bitmap = XCreatePixmap(display_, wnd, width, height, 1); - glyphGC = XCreateGC(display_, bitmap, 0, NULL); - - image = XCreateImage(display_, visual, 1, ZPixmap, 0, (char *)data, width, height, 8, scanline); - image->byte_order = 1; // MSBFirst -- LSBFirst = 0 - image->bitmap_bit_order = 1; - XInitImage(image); - -/* logTest("Poller::createGlyph","XPutImage on pixmap %d,%d,%d,%d.\n", - 0, 0, width, height);*/ - XPutImage(display_, bitmap, glyphGC, image, 0, 0, 0, 0, width, height); - XFree(image); - - return bitmap; -} -#endif /* defined(__CYGWIN32__) || defined(WIN32) */ diff --git a/nxcompshad/Win.h b/nxcompshad/Win.h deleted file mode 100644 index fe591ff02..000000000 --- a/nxcompshad/Win.h +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -#ifdef __CYGWIN32__ - -#ifndef Win32Poller_H -#define Win32Poller_H - -//#include <X11/X.h> - -#include <Windows.h> -#include <wingdi.h> -#include <winable.h> -#include <winuser.h> - -#define CAPTUREBLT 0x40000000 - -#define KEYEVENTF_SCANCODE 0x00000008 -#define MAPVK_VSC_TO_VK_EX 3 -// -// The CAPTUREBLT is a raster operation used -// in bit blit transfer. -// -// Using this operation includes any windows -// that are layered on top of your window in -// the resulting image. By default, the image -// only contains your window. -// - -#include "Core.h" - -typedef struct _keyTranslation -{ - unsigned char scancode; - unsigned short modifiers; - -}keyTranslation; - -class Poller : public CorePoller -{ - public: - - Display *display_; - keyTranslation *keymap_; - unsigned char keymapLoaded_; - int minKeycode_; - - Poller(Input *, Display *display, int = 16); - - ~Poller(); - - int init(); - - int updateCursor(Window, Visual*); - - private: - - - int Poller::updateShadowFrameBuffer(void); - void handleKeyboardEvent(Display *, XEvent *); - void handleWebKeyboardEvent(KeySym keysym, Bool isKeyPress); - void addToKeymap(char *keyname, unsigned char scancode, unsigned short modifiers, char *mapname); - int xkeymapRead(char *mapname); - FILE *xkeymapOpen(char *filename); - void xkeymapInit(char *keyMapName); - keyTranslation xkeymapTranslateKey(unsigned int keysym, unsigned int keycode, unsigned int state); - unsigned char getKeyState(unsigned int state, unsigned int keysym); - char *getKsname(unsigned int keysym); - unsigned char specialKeys(unsigned int keysym, unsigned int state, int pressed); - - unsigned char toggleSwitch(unsigned char ToggleStateClient, unsigned char ToggleStateServer, UINT scancode, - int *lengthArrayINPUT); - - void updateModifierState(UINT, unsigned char); - - unsigned char toggleServerState(UINT scancode); - unsigned char keyState(UINT scancode, UINT mapType); - unsigned char keyStateAsync(UINT scancode); - - void handleMouseEvent(Display *, XEvent *); - - Cursor createCursor(Window wnd, Visual *vis, unsigned int x, unsigned int y, int width, - int height, unsigned char *xormask, unsigned char *andmask); - - Pixmap createGlyph(Window wnd, Visual *visual, int width, int height, unsigned char *data); - - char isWinNT(); - char selectDesktop(HDESK new_desktop); - char selectDesktopByName(char *name); - void platformOS(); - char simulateCtrlAltDel(void); - DWORD platformID_; - - INPUT *pKey_, *pMouse_; - - char *keymapName_; - char *path_; - - unsigned char toggleButtonState_; - unsigned short serverModifierState_; - unsigned short savedServerModifierState_; - - void ensureServerModifiers(keyTranslation tr, int *lenghtArrayINPUT); - void restoreServerModifiers(UINT scancode); - unsigned char isModifier(UINT scancode); - - char sendInput(unsigned char scancode, unsigned char pressed, int *lengthArrayINPUT); - - char *getRect(XRectangle); - char checkDesktop(); - - char *DIBBuffer_; - - HCURSOR oldCursor_; - - VOID *pDIBbits_; - HDC screenDC_; - HDC memoryDC_; - BITMAPINFO bmi_; - HBITMAP screenBmp_; - - Cursor xCursor_; - -}; - -#undef TEST - -inline unsigned char Poller::toggleSwitch(unsigned char ToggleStateClient, unsigned char ToggleStateServer, - UINT scancode, int *lengthArrayINPUT) -{ - return 1; -} - -inline unsigned char Poller::toggleServerState(UINT scancode) -{ - return (GetKeyState(MapVirtualKeyEx(scancode, 3, GetKeyboardLayout((DWORD)NULL))) & 0x1); -} - -inline unsigned char Poller::keyStateAsync(UINT vKeycode) -{ - return GetAsyncKeyState(vKeycode); -} - -inline unsigned char Poller::keyState(UINT code, UINT mapType) -{ - if (mapType == 0) - { - // - // Virtual Keycode - // - return ((GetKeyState(code) & 0x80) == 0x80); - } - else - { - // - // scancode - // - return ((GetKeyState(MapVirtualKeyEx(code, 3, GetKeyboardLayout((DWORD)NULL))) & 0x80) == 0x80); - } -} - -inline char Poller::isWinNT() -{ - return (platformID_ == VER_PLATFORM_WIN32_NT); -} - -inline char Poller::sendInput(unsigned char scancode, unsigned char pressed, int *lengthArrayINPUT) -{ - DWORD keyEvent = 0; - DWORD extended = 0; - - if (scancode > 0) - { - if (pressed == 0) - { - keyEvent = KEYEVENTF_KEYUP; - } - - if (scancode & 0x80) - { - scancode &= ~0x80; - extended = KEYEVENTF_EXTENDEDKEY; - } - - pKey_[*lengthArrayINPUT].ki.wScan = (WORD) scancode; - pKey_[*lengthArrayINPUT].ki.dwFlags = (DWORD) (keyEvent | KEYEVENTF_SCANCODE | extended); - (*lengthArrayINPUT)++; - } - - - if (*lengthArrayINPUT > 0) { - // FIXME: Remove me. - logTest("Poller::sendInput", "length Input [%d] event: %s", *lengthArrayINPUT, - pressed == 1 ? "KeyPress": "KeyRelease"); - - if (SendInput(*lengthArrayINPUT, pKey_, sizeof(INPUT)) == 0) - { - logTest("Poller::sendInput", "Failed SendInput, event: %s", pressed == 1 ? "KeyPress": "KeyRelease"); - *lengthArrayINPUT = 0; - return 0; - } - - *lengthArrayINPUT = 0; - } - - return 1; -} -#endif /* Win32Poller_H */ - -#endif /* __CYGWIN32__ */ diff --git a/nxcompshad/configure.ac b/nxcompshad/configure.ac new file mode 100644 index 000000000..b8e359f5d --- /dev/null +++ b/nxcompshad/configure.ac @@ -0,0 +1,62 @@ +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]) + +# Silence warning: ar: 'u' modifier ignored since 'D' is the default +AC_SUBST(AR_FLAGS, [cr]) + +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_DEFAULT_OPTIONS + +AC_ARG_ENABLE([cxx11], + [AS_HELP_STRING([--enable-cxx11], + [enable optional features requiring C++11 support (disabled by default)])], + [AS_IF([test x$enableval = xyes], + [AX_CXX_COMPILE_STDCXX_11([], [mandatory])])]) + +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 3f16ee97f..000000000 --- a/nxcompshad/configure.in +++ /dev/null @@ -1,287 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -dnl Prolog - -AC_INIT(Shadow.h) -AC_PREREQ(2.13) - -dnl Reset default compilation flags. - -CXXFLAGS="-O3" -CPPFLAGS="-O3" - -dnl Reset default linking directives. - -LIBSTATIC="" -LIBSHARED="" - -dnl Prefer headers and libraries from nx-X11, if present. - -if test -d "../nx-X11/exports/include" ; then - CXXFLAGS="$CXXFLAGS -I../nx-X11/exports/include" - LIBS="$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 -Wnested-externs" - CPPFLAGS="$CPPFLAGS -Wmissing-declarations -Wnested-externs" - ;; -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 -bundle flag. Under Solaris, instead, we need -dnl the options -G -h. - -if test "$DARWIN" = yes; then - LDFLAGS="$LDFLAGS -bundle" -elif test "$SUN" = yes; then - LDFLAGS="$LDFLAGS -G -h \$(LIBLOAD)" -else - LDFLAGS="$LDFLAGS -Wl,-soname,\$(LIBLOAD)" -fi - -dnl Check to see if in_addr_t is defined. -dnl Could use a specific configure test. - -AC_DEFUN(nxconf_INADDRT, -[AC_CACHE_CHECK(for in_addr_t, nxconf_cv_inaddrt, -[AC_TRY_COMPILE([#include <netinet/in.h>],[in_addr_t t; t = 1; return t;], -nxconf_cv_inaddrt=yes, nxconf_cv_inaddrt=no) -rm -f conftest*]) -INADDRT= -test "$nxconf_cv_inaddrt" = yes && INADDRT=yes]) -nxconf_INADDRT - -dnl If in_addr_t is not defined use unsigned int. - -if test "$INADDRT" != yes ; then - echo -e "using unsigned int for type in_addr_t" - CXXFLAGS="$CXXFLAGS -DIN_ADDR_T=unsigned" - CPPFLAGS="$CPPFLAGS -DIN_ADDR_T=unsigned" -else - CXXFLAGS="$CXXFLAGS -DIN_ADDR_T=in_addr_t" - CPPFLAGS="$CPPFLAGS -DIN_ADDR_T=in_addr_t" -fi - -dnl Check whether --with-version was given. - -AC_SUBST(LIBVERSION) -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) - -if test -x "../nx-X11/config/makedepend/makedepend" ; then - MAKEDEPEND=../nx-X11/config/makedepend/makedepend -else - if test -x "/usr/X11R6/bin/makedepend" ; then - MAKEDEPEND=/usr/X11R6/bin/makedepend - else - if test -x "/usr/openwin/bin/makedepend" ; then - MAKEDEPEND=/usr/openwin/bin/makedepend - else - MAKEDEPEND=makedepend - fi - fi -fi - -AC_OUTPUT(Makefile) diff --git a/nxcompshad/Shadow.h b/nxcompshad/include/Shadow.h index e1eddb95c..c59d91eeb 100644 --- a/nxcompshad/Shadow.h +++ b/nxcompshad/include/Shadow.h @@ -1,24 +1,32 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <X11/Xlib.h> +#include <nx-X11/Xlib.h> #define NXShadowCorrectColor(length, buffer) \ \ @@ -57,6 +65,8 @@ typedef struct _ShadowOptions extern ShadowOptions NXShadowOptions; +extern void NXShadowResetOptions(); + extern int NXShadowCreate(void *, char *, char *, void **); extern void NXShadowDestroy(void); 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/ax_cxx_compile_stdcxx.m4 b/nxcompshad/m4/ax_cxx_compile_stdcxx.m4 new file mode 120000 index 000000000..28ebfd1a6 --- /dev/null +++ b/nxcompshad/m4/ax_cxx_compile_stdcxx.m4 @@ -0,0 +1 @@ +../../m4/ax_cxx_compile_stdcxx.m4
\ No newline at end of file diff --git a/nxcompshad/m4/ax_cxx_compile_stdcxx_11.m4 b/nxcompshad/m4/ax_cxx_compile_stdcxx_11.m4 new file mode 120000 index 000000000..5fbe8790d --- /dev/null +++ b/nxcompshad/m4/ax_cxx_compile_stdcxx_11.m4 @@ -0,0 +1 @@ +../../m4/ax_cxx_compile_stdcxx_11.m4
\ No newline at end of file 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 new file mode 100644 index 000000000..b12ca3e12 --- /dev/null +++ b/nxcompshad/nxcompshad.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: nxcompshad +Description: Shadow Session Support for NX Compression Library +Version: @COMPSHAD_VERSION@ +Requires: nxcomp +Requires.private: x11 +Cflags: -I${includedir} +Libs: -L${libdir} -lXcompshad + diff --git a/nxcompshad/Core.cpp b/nxcompshad/src/Core.cpp index 6f9449387..f92f85c41 100644 --- a/nxcompshad/Core.cpp +++ b/nxcompshad/src/Core.cpp @@ -1,20 +1,32 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <string.h> #include <sys/time.h> @@ -189,14 +201,6 @@ int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *s { logTrace("CorePoller::isChanged"); -#if defined(__CYGWIN32__) || defined(WIN32) - - checkDesktop(); - -#endif - -#if !defined(__CYGWIN32__) && !defined(WIN32) - if (mirror_ == 1) { int result = mirrorChanges_; @@ -206,8 +210,6 @@ int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *s return result; } -#endif - logDebug("CorePoller:isChanged", "Going to use default polling algorithm.\n"); // @@ -409,64 +411,64 @@ int CorePoller::isChanged(int (*checkIfInputCallback)(void *), void *arg, int *s if (foundChanges) { - int start, last, curLine, left, right; + int start, last, curWorkLine, left, right; - for (curLine = 0; curLine < (int) height_; curLine++) + for (curWorkLine = 0; curWorkLine < (int) height_; curWorkLine++) { - if (lineStatus_[curLine] == LINE_HAS_CHANGED) + if (lineStatus_[curWorkLine] == LINE_HAS_CHANGED) { break; } } - start = curLine; - last = curLine; + start = curWorkLine; + last = curWorkLine; - left = lefts_[curLine]; - right = rights_[curLine]; - curLine++; + left = lefts_[curWorkLine]; + right = rights_[curWorkLine]; + curWorkLine++; while (1) { - for (; curLine < (int) height_; curLine++) + for (; curWorkLine < (int) height_; curWorkLine++) { - if (lineStatus_[curLine] == LINE_HAS_CHANGED) + if (lineStatus_[curWorkLine] == LINE_HAS_CHANGED) { break; } } - if (curLine == (int) height_) + if (curWorkLine == (int) height_) { break; } - if ((curLine - last > minSliceHeight_) || (last - start > maxSliceHeight_)) + if ((curWorkLine - 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]; + start = curWorkLine; + left = lefts_[curWorkLine]; + right = rights_[curWorkLine]; } else { - if (lefts_[curLine] < left) + if (lefts_[curWorkLine] < left) { - left = lefts_[curLine]; + left = lefts_[curWorkLine]; } - if (rights_[curLine] > right) + if (rights_[curWorkLine] > right) { - right = rights_[curLine]; + right = rights_[curWorkLine]; } } - last = curLine; + last = curWorkLine; - curLine++; + curWorkLine++; } // diff --git a/nxcompshad/Core.h b/nxcompshad/src/Core.h index 9bc8a645b..601d277c0 100644 --- a/nxcompshad/Core.h +++ b/nxcompshad/src/Core.h @@ -1,18 +1,26 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 @@ -103,10 +111,6 @@ class CorePoller int imageByteOrder_; - #ifdef __CYGWIN32__ - virtual char checkDesktop(void) = 0; - #endif - Display *shadowDisplay_; void update(char *src, XRectangle r); diff --git a/nxcompshad/Input.cpp b/nxcompshad/src/Input.cpp index f9bf1810d..8de74c3c3 100644 --- a/nxcompshad/Input.cpp +++ b/nxcompshad/src/Input.cpp @@ -1,20 +1,32 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <string.h> #define PANIC diff --git a/nxcompshad/Input.h b/nxcompshad/src/Input.h index 6250e790b..cbba029a9 100644 --- a/nxcompshad/Input.h +++ b/nxcompshad/src/Input.h @@ -1,24 +1,32 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <X11/Xlib.h> +#include <nx-X11/Xlib.h> typedef struct Event { diff --git a/nxcompshad/Logger.cpp b/nxcompshad/src/Logger.cpp index c367c5d7f..2f3eab65c 100644 --- a/nxcompshad/Logger.cpp +++ b/nxcompshad/src/Logger.cpp @@ -1,20 +1,32 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ -/* NXCOMP, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <stdio.h> #include <ctype.h> #include <unistd.h> @@ -29,11 +41,14 @@ Logger logger; -void Logger::user(const char *format, va_list arguments) +void Logger::user(const char *format, ...) { char string[1024]; + va_list arguments; + va_start(arguments, format); vsnprintf(string, 1024, format, arguments); + va_end(arguments); fprintf(stderr, "%s\n", string); } @@ -44,20 +59,26 @@ void Logger::error(const char *name, int error) name, error, strerror(error)); } -void Logger::warning(const char *name, const char *format, va_list arguments) +void Logger::warning(const char *name, const char *format, ...) { char string[1024]; + va_list arguments; + va_start(arguments, format); vsnprintf(string, 1024, format, arguments); + va_end(arguments); fprintf(stderr, "%s: WARNING! %s\n", name, string); } -void Logger::test(const char *name, const char *format, va_list arguments) +void Logger::test(const char *name, const char *format, ...) { char string[1024]; + va_list arguments; + va_start(arguments, format); vsnprintf(string, 1024, format, arguments); + va_end(arguments); fprintf(stderr, "%s: %s\n", name, string); } @@ -67,11 +88,14 @@ void Logger::trace(const char *name) fprintf(stderr, "%s\n", name); } -void Logger::debug(const char *name, const char *format, va_list arguments) +void Logger::debug(const char *name, const char *format, ...) { char string[1024]; + va_list arguments; + va_start(arguments, format); vsnprintf(string, 1024, format, arguments); + va_end(arguments); fprintf(stderr, "%s: %s\n", name, string); } diff --git a/nxcompshad/Logger.h b/nxcompshad/src/Logger.h index 94e4da857..37b378cb2 100644 --- a/nxcompshad/Logger.h +++ b/nxcompshad/src/Logger.h @@ -1,25 +1,33 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ -/* NXCOMP, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <errno.h> -#include <stdarg.h> +#include <cerrno> +#include <cstdarg> // // Error handling macros. @@ -35,17 +43,17 @@ class Logger { public: - void user(const char *format, va_list arguments); + void user(const char *format, ...) __attribute__((format(gnu_printf, 2, 3))); void error(const char *name, int error); - void warning(const char *name, const char *format, va_list arguments); + void warning(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); - void test(const char *name, const char *format, va_list arguments); + void test(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); void trace(const char *name); - void debug(const char *name, const char *format, va_list arguments); + void debug(const char *name, const char *format, ...) __attribute__((format(gnu_printf, 3, 4))); void dump(const char *name, const char *data, int size); }; diff --git a/nxcompshad/src/Makefile.am b/nxcompshad/src/Makefile.am new file mode 100644 index 000000000..33f3abdb9 --- /dev/null +++ b/nxcompshad/src/Makefile.am @@ -0,0 +1,44 @@ +NULL = + +lib_LTLIBRARIES = libXcompshad.la + +libXcompshad_la_SOURCES = \ + Core.cpp \ + Input.cpp \ + Logger.cpp \ + Manager.cpp \ + Shadow.cpp \ + Updater.cpp \ + X11.cpp \ + $(NULL) + +libXcompshad_la_LIBADD = \ + @Xext_LIBS@ \ + @Xdamage_LIBS@ \ + @Xrandr_LIBS@ \ + @Xtst_LIBS@ \ + -L$(top_srcdir)/../nx-X11/lib/src/.libs -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/Manager.cpp b/nxcompshad/src/Manager.cpp index ba9260a13..6e3f6b1b0 100644 --- a/nxcompshad/Manager.cpp +++ b/nxcompshad/src/Manager.cpp @@ -1,23 +1,35 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/keysym.h> +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <nx-X11/Xlib.h> +#include <nx-X11/Xutil.h> +#include <nx-X11/keysym.h> #include <string.h> #define PANIC diff --git a/nxcompshad/Manager.h b/nxcompshad/src/Manager.h index 267754906..92a82cd32 100644 --- a/nxcompshad/Manager.h +++ b/nxcompshad/src/Manager.h @@ -1,24 +1,32 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <X11/Xlib.h> +#include <nx-X11/Xlib.h> #include "Updater.h" #include "Regions.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 <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* 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 <iostream> + +#include <cerrno> +#include <cstring> + +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..2fde91007 --- /dev/null +++ b/nxcompshad/src/Poller.h @@ -0,0 +1,31 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* 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 + +#include "X11.h" + +#endif /* Poller_H */ diff --git a/nxcompshad/src/Regions.h b/nxcompshad/src/Regions.h new file mode 100644 index 000000000..2bc24a39c --- /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 <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* 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 <nx-X11/Xlib.h> +#include <nx-X11/Xutil.h> + +typedef struct { + short x1, x2, y1, y2; +} Box, BOX, BoxRec, *BoxPtr; + +struct _XRegion { + long size; + long numRects; + BOX *rects; + BOX extents; +}; + +#endif /* Region_H */ diff --git a/nxcompshad/Shadow.cpp b/nxcompshad/src/Shadow.cpp index f9525adcf..7c0cc6f4e 100644 --- a/nxcompshad/Shadow.cpp +++ b/nxcompshad/src/Shadow.cpp @@ -1,20 +1,32 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <signal.h> #include <string.h> @@ -45,8 +57,6 @@ static UpdateManager *updateManager; static Poller *poller; static Input *input; -int NXShadowRemoveAllUpdaters(); - inline bool NXShadowNotInitialized() { // @@ -136,7 +146,7 @@ static int NXCreatePoller(Display *display, Display **shadowDisplay) if (input == NULL) { - logError("NXCreatePoller", ESET(EBADFD)); + logError("NXCreatePoller", ESET(EBADF)); return -1; } @@ -171,7 +181,7 @@ static int NXCreateUpdateManager() if (input == NULL || poller == NULL) { - logError("NXCreateUpdateManager", ESET(EBADFD)); + logError("NXCreateUpdateManager", ESET(EBADF)); return -1; } @@ -285,8 +295,6 @@ int NXShadowCreate(void *dpy, char *keymap, char* shadowDisplayName, void **shad return 1; } -#if !defined(__CYGWIN32__) && !defined(WIN32) - void NXShadowSetDisplayUid(int uid) { NXShadowOptions.optionShadowDisplayUid = uid; @@ -314,8 +322,6 @@ void NXShadowSetScreenSize(int *w, int *h) poller -> setScreenSize(w, h); } -#endif - void NXShadowDestroy() { if (poller) @@ -346,7 +352,7 @@ void NXShadowHandleInput() if (NXShadowNotInitialized()) { - logError("NXShadowHandleInput - NXShadow not properly initialized.", ESET(EBADFD)); + logError("NXShadowHandleInput - NXShadow not properly initialized.", ESET(EBADF)); return; } @@ -366,7 +372,7 @@ int NXShadowHasChanged(int (*callback)(void *), void *arg, int *suspended) if (NXShadowNotInitialized()) { - logError("NXShadowHasChanged - NXShadow not properly initialized.", ESET(EBADFD)); + logError("NXShadowHasChanged - NXShadow not properly initialized.", ESET(EBADF)); return -1; } @@ -378,9 +384,7 @@ int NXShadowHasChanged(int (*callback)(void *), void *arg, int *suspended) updateManager -> newRegion(); -#if !defined(__CYGWIN32__) && !defined(WIN32) poller -> getEvents(); -#endif result = poller -> isChanged(callback, arg, suspended); @@ -407,7 +411,7 @@ void NXShadowExportChanges(long *numRects, char **pBox) if (NXShadowNotInitialized()) { - logError("NXShadowExportChanges - NXShadow not properly initialized.", ESET(EBADFD)); + logError("NXShadowExportChanges - NXShadow not properly initialized.", ESET(EBADF)); } updateManager -> update(); @@ -430,22 +434,6 @@ void NXShadowWebKeyEvent(KeySym keysym, Bool isKeyPress) poller -> handleWebKeyEvent(keysym, isKeyPress); } -#ifdef __CYGWIN32__ - -int NXShadowCaptureCursor(unsigned int wnd, void *vis) -{ - Window window = (Window)wnd; - Visual *visual = reinterpret_cast<Visual*>(vis); - - logTrace("NXShadowCaptureCursor"); - - logTest("NXShadowCaptureCursor","Init"); - - return poller -> updateCursor(window, visual); -} - -#endif - void NXShadowUpdateBuffer(void **buffer) { char **fBuffer = reinterpret_cast<char **>(buffer); diff --git a/nxcompshad/Updater.cpp b/nxcompshad/src/Updater.cpp index 245c6ce31..4b677a78c 100644 --- a/nxcompshad/Updater.cpp +++ b/nxcompshad/src/Updater.cpp @@ -1,23 +1,35 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/keysym.h> +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <nx-X11/Xlib.h> +#include <nx-X11/Xutil.h> +#include <nx-X11/keysym.h> #include <string.h> #define PANIC diff --git a/nxcompshad/Updater.h b/nxcompshad/src/Updater.h index daa26c10b..10d75c0d6 100644 --- a/nxcompshad/Updater.h +++ b/nxcompshad/src/Updater.h @@ -1,24 +1,32 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <X11/Xlib.h> +#include <nx-X11/Xlib.h> #include "Regions.h" #include "Input.h" diff --git a/nxcompshad/X11.cpp b/nxcompshad/src/X11.cpp index 2d1140f11..3031bde37 100644 --- a/nxcompshad/X11.cpp +++ b/nxcompshad/src/X11.cpp @@ -1,31 +1,41 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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) +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #define PANIC #define WARNING #undef TEST #undef DEBUG -#include <X11/Xlibint.h> -#include <X11/Xproto.h> -#include <X11/extensions/XTest.h> -#include <X11/keysym.h> +#include <nx-X11/Xlibint.h> +#include <nx-X11/Xproto.h> +#include <nx-X11/keysym.h> +#include "X11/include/XTest_nxcompshad.h" #include <string.h> #include <sys/ipc.h> #include <sys/shm.h> @@ -1582,5 +1592,3 @@ int anyEventPredicate(Display *display, XEvent *event, XPointer parameter) { return 1; } - -#endif /* !defined(__CYGWIN32__) && !defined(WIN32) */ diff --git a/nxcompshad/X11.h b/nxcompshad/src/X11.h index 21275420c..87dd31fea 100644 --- a/nxcompshad/X11.h +++ b/nxcompshad/src/X11.h @@ -1,27 +1,35 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ +/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ +/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ +/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ +/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ +/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ /* */ /* NXCOMPSHAD, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ +/* are copyright of the aforementioned persons and companies. */ /* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ +/* 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 <X11/Xlib.h> +#include <nx-X11/Xlib.h> #include <X11/extensions/XShm.h> -#include <X11/extensions/Xdamage.h> -#include <X11/extensions/Xrandr.h> +#include "X11/include/Xdamage_nxcompshad.h" +#include "X11/include/Xrandr_nxcompshad.h" #include "Core.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 <nx-X11/Xfuncproto.h> + +_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 + * <X11/extensions/Xdamaga.h> + * + * This copy of code has been introduced to allow a clear namespace + * separation between <X11/...> and <nx-X11/...> 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 <X11/extensions/Xdamage.h> instead for inclusion in + * nxcompshad, it will attempt pulling in the <X11/extensions/Xfixes.h> + * header which in turn will include <X11/Xlib.h>. However, the headers of + * the same name from <nx-X11/...> 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 <mike.gabriel@das-netzwerkteam.de> + */ + + +#ifndef _XDAMAGE_H_ +#define _XDAMAGE_H_ + +#include <X11/extensions/damagewire.h> +#include <nx-X11/Xfuncproto.h> + +/* from <X11/extensions/Xfixes.h> */ +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 + * <X11/extensions/Xrandr.h> + * + * This copy of code has been introduced to allow a clear namespace + * separation between <X11/...> and <nx-X11/...> 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 <X11/extensions/Xrandr.h> instead for inclusion in + * nxcompshad, it will attempt pulling in the <X11/extensions/Xrender.h> + * header which in turn will include <X11/Xlib.h>. However, the headers of + * the same name from <nx-X11/...> 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 <mike.gabriel@das-netzwerkteam.de> + */ + +#ifndef _XRANDR_H_ +#define _XRANDR_H_ + +/* from <X11/extensions/randr.h> */ +#define RRScreenChangeNotify 0 +#define RRScreenChangeNotifyMask (1L << 0) + +#include <X11/Xfuncproto.h> + +_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_ */ |