diff options
Diffstat (limited to 'unix')
-rw-r--r-- | unix/common/CMakeLists.txt | 6 | ||||
-rw-r--r-- | unix/tx/CMakeLists.txt | 10 | ||||
-rw-r--r-- | unix/vncconfig/CMakeLists.txt | 10 | ||||
-rw-r--r-- | unix/vncpasswd/CMakeLists.txt | 3 | ||||
-rw-r--r-- | unix/x0vncserver/CMakeLists.txt | 11 | ||||
-rw-r--r-- | unix/x0vncserver/XDesktop.cxx | 19 | ||||
-rw-r--r-- | unix/x0vncserver/XDesktop.h | 14 |
7 files changed, 45 insertions, 28 deletions
diff --git a/unix/common/CMakeLists.txt b/unix/common/CMakeLists.txt index 611e1956..87e2ae79 100644 --- a/unix/common/CMakeLists.txt +++ b/unix/common/CMakeLists.txt @@ -1,9 +1,9 @@ -include_directories(${CMAKE_SOURCE_DIR}/common) -include_directories(${CMAKE_SOURCE_DIR}/unix/common) - add_library(unixcommon STATIC randr.cxx) +target_include_directories(unixcommon PUBLIC ${CMAKE_SOURCE_DIR}/common) +target_include_directories(unixcommon PUBLIC ${CMAKE_SOURCE_DIR}/unix/common) + if(UNIX) libtool_create_control_file(unixcommon) endif() diff --git a/unix/tx/CMakeLists.txt b/unix/tx/CMakeLists.txt index e913de3c..e28621a6 100644 --- a/unix/tx/CMakeLists.txt +++ b/unix/tx/CMakeLists.txt @@ -1,9 +1,9 @@ -include_directories(SYSTEM ${X11_INCLUDE_DIR}) - -include_directories(${CMAKE_SOURCE_DIR}/common) -include_directories(${CMAKE_SOURCE_DIR}/common/rfb) - add_library(tx STATIC TXWindow.cxx) +target_include_directories(tx SYSTEM PUBLIC ${X11_INCLUDE_DIR}) + +target_include_directories(tx PUBLIC ${CMAKE_SOURCE_DIR}/common) +target_include_directories(tx PUBLIC ${CMAKE_SOURCE_DIR}/common/rfb) + target_link_libraries(tx ${X11_LIBRARIES}) diff --git a/unix/vncconfig/CMakeLists.txt b/unix/vncconfig/CMakeLists.txt index 8734ff63..0589f161 100644 --- a/unix/vncconfig/CMakeLists.txt +++ b/unix/vncconfig/CMakeLists.txt @@ -1,14 +1,14 @@ -include_directories(SYSTEM ${X11_INCLUDE_DIR}) - -include_directories(${CMAKE_SOURCE_DIR}/common) -include_directories(${CMAKE_SOURCE_DIR}/unix/tx) - add_executable(vncconfig buildtime.c vncExt.c vncconfig.cxx QueryConnectDialog.cxx) +target_include_directories(vncconfig SYSTEM PUBLIC ${X11_INCLUDE_DIR}) + +target_include_directories(vncconfig PUBLIC ${CMAKE_SOURCE_DIR}/common) +target_include_directories(vncconfig PUBLIC ${CMAKE_SOURCE_DIR}/unix/tx) + target_link_libraries(vncconfig tx rfb network rdr ${X11_LIBRARIES}) install(TARGETS vncconfig DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) diff --git a/unix/vncpasswd/CMakeLists.txt b/unix/vncpasswd/CMakeLists.txt index 9f716fac..9b672041 100644 --- a/unix/vncpasswd/CMakeLists.txt +++ b/unix/vncpasswd/CMakeLists.txt @@ -1,8 +1,7 @@ -include_directories(${CMAKE_SOURCE_DIR}/common) - add_executable(vncpasswd vncpasswd.cxx) +target_include_directories(vncpasswd PUBLIC ${CMAKE_SOURCE_DIR}/common) target_link_libraries(vncpasswd tx rfb os) install(TARGETS vncpasswd DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) diff --git a/unix/x0vncserver/CMakeLists.txt b/unix/x0vncserver/CMakeLists.txt index 488a78fd..31da5118 100644 --- a/unix/x0vncserver/CMakeLists.txt +++ b/unix/x0vncserver/CMakeLists.txt @@ -1,9 +1,3 @@ -include_directories(SYSTEM ${X11_INCLUDE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/unix/common) -include_directories(${CMAKE_SOURCE_DIR}/unix/tx) -include_directories(${CMAKE_SOURCE_DIR}/unix) -include_directories(${CMAKE_SOURCE_DIR}/common) - add_executable(x0vncserver buildtime.c Geometry.cxx @@ -20,6 +14,11 @@ add_executable(x0vncserver ../vncconfig/QueryConnectDialog.cxx ) +target_include_directories(x0vncserver SYSTEM PUBLIC ${X11_INCLUDE_DIR}) +target_include_directories(x0vncserver PUBLIC ${CMAKE_SOURCE_DIR}/unix/common) +target_include_directories(x0vncserver PUBLIC ${CMAKE_SOURCE_DIR}/unix/tx) +target_include_directories(x0vncserver PUBLIC ${CMAKE_SOURCE_DIR}/unix) +target_include_directories(x0vncserver PUBLIC ${CMAKE_SOURCE_DIR}/common) target_link_libraries(x0vncserver tx rfb network rdr unixcommon) if(X11_FOUND AND X11_XTest_LIB) diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index bd13450b..b3d5e54c 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -27,6 +27,7 @@ #include <unistd.h> #include <rfb/LogWriter.h> +#include <rfb/Exception.h> #include <x0vncserver/XDesktop.h> @@ -43,7 +44,6 @@ #endif #ifdef HAVE_XRANDR #include <X11/extensions/Xrandr.h> -#include <rfb/Exception.h> #include <RandrGlue.h> extern "C" { void vncSetGlueContext(Display *dpy, void *res); @@ -52,7 +52,6 @@ void vncSetGlueContext(Display *dpy, void *res); #include <x0vncserver/Geometry.h> #include <x0vncserver/XPixelBuffer.h> -using namespace std; using namespace rfb; extern const unsigned short code_map_qnum_to_xorgevdev[]; @@ -277,8 +276,10 @@ void XDesktop::start(VNCServer* vs) { void XDesktop::stop() { running = false; +#ifdef HAVE_XTEST // Delete added keycodes deleteAddedKeysyms(dpy); +#endif #ifdef HAVE_XDAMAGE if (haveDamage) @@ -356,6 +357,9 @@ void XDesktop::pointerEvent(const Point& pos, int buttonMask) { } } oldButtonMask = buttonMask; +#else + (void)pos; + (void)buttonMask; #endif } @@ -397,7 +401,6 @@ KeyCode XDesktop::XkbKeysymToKeycode(Display* dpy, KeySym keysym) { return keycode; } -#endif KeyCode XDesktop::addKeysym(Display* dpy, KeySym keysym) { @@ -513,6 +516,7 @@ KeyCode XDesktop::keysymToKeycode(Display* dpy, KeySym keysym) { return keycode; } +#endif void XDesktop::keyEvent(uint32_t keysym, uint32_t xtcode, bool down) { @@ -547,6 +551,10 @@ void XDesktop::keyEvent(uint32_t keysym, uint32_t xtcode, bool down) { vlog.debug("%d %s", keycode, down ? "down" : "up"); XTestFakeKeyEvent(dpy, keycode, down, CurrentTime); +#else + (void)keysym; + (void)xtcode; + (void)down; #endif } @@ -779,6 +787,9 @@ unsigned int XDesktop::setScreenLayout(int fb_width, int fb_height, return ret; #else + (void)fb_width; + (void)fb_height; + (void)layout; return rfb::resultProhibited; #endif /* HAVE_XRANDR */ } @@ -939,6 +950,7 @@ void XDesktop::queryRejected() queryConnectSock = 0; } +#ifdef HAVE_XFIXES bool XDesktop::setCursor() { XFixesCursorImage *cim; @@ -986,3 +998,4 @@ bool XDesktop::setCursor() XFree(cim); return true; } +#endif diff --git a/unix/x0vncserver/XDesktop.h b/unix/x0vncserver/XDesktop.h index 02217496..1cb73f43 100644 --- a/unix/x0vncserver/XDesktop.h +++ b/unix/x0vncserver/XDesktop.h @@ -54,10 +54,6 @@ public: virtual void queryConnection(network::Socket* sock, const char* userName); virtual void pointerEvent(const rfb::Point& pos, int buttonMask); - KeyCode XkbKeysymToKeycode(Display* dpy, KeySym keysym); - KeyCode addKeysym(Display* dpy, KeySym keysym); - void deleteAddedKeysyms(Display* dpy); - KeyCode keysymToKeycode(Display* dpy, KeySym keysym); virtual void keyEvent(uint32_t keysym, uint32_t xtcode, bool down); virtual void clientCutText(const char* str); virtual unsigned int setScreenLayout(int fb_width, int fb_height, @@ -101,7 +97,17 @@ protected: unsigned ledState; const unsigned short *codeMap; unsigned codeMapLen; + +protected: +#ifdef HAVE_XTEST + KeyCode XkbKeysymToKeycode(Display* dpy, KeySym keysym); + KeyCode addKeysym(Display* dpy, KeySym keysym); + void deleteAddedKeysyms(Display* dpy); + KeyCode keysymToKeycode(Display* dpy, KeySym keysym); +#endif +#ifdef HAVE_XFIXES bool setCursor(); +#endif rfb::ScreenSet computeScreenLayout(); }; |