Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-03-25 07:56:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-25 07:56:48 +0300
commit5f8fa29755a062a3dff4a574c904f5e24cc48cca (patch)
tree29b17db0080d68f9ea3d320e97ada1f7cdfc4910 /intern
parent2c04bab116c5e5e0d93e78a7c196a59c6c3a2944 (diff)
add cmake option to build without xinput (tablet support)
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/CMakeLists.txt5
-rw-r--r--intern/ghost/SConscript3
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp13
3 files changed, 17 insertions, 4 deletions
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
index 33185a63d5b..d629b44a106 100644
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@ -118,6 +118,11 @@ if(APPLE)
endif()
elseif(UNIX)
+
+ if(WITH_X11_XINPUT)
+ add_definitions(-DWITH_X11_XINPUT)
+ endif()
+
list(APPEND INC ${X11_X11_INCLUDE_PATH})
list(APPEND SRC
diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript
index 7aedc08ce96..b67545f216a 100644
--- a/intern/ghost/SConscript
+++ b/intern/ghost/SConscript
@@ -21,7 +21,8 @@ if window_system in ('linux2', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'fr
sources.remove('intern' + os.sep + f + 'Carbon.cpp')
except ValueError:
pass
- defs += ['PREFIX=\\"/usr/local/\\"']
+ defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option
+ defs += ['WITH_X11_XINPUT'] # XXX, make an option
elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
for f in pf:
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 890c40f6f11..3578ae8619f 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -439,7 +439,9 @@ GHOST_WindowX11(
setTitle(title);
+#ifdef WITH_X11_XINPUT
initXInputDevices();
+#endif
// now set up the rendering context.
if (installDrawingContext(type) == GHOST_kSuccess) {
@@ -493,6 +495,8 @@ static bool match_token(const char *haystack, const char *needle)
return FALSE;
}
+#ifdef WITH_X11_XINPUT
+
/* Determining if an X device is a Tablet style device is an imperfect science.
** We rely on common conventions around device names as well as the type reported
** by Wacom tablets. This code will likely need to be expanded for alternate tablet types
@@ -652,8 +656,9 @@ void GHOST_WindowX11::initXInputDevices()
}
XFree(version);
}
-}
+}
+#endif /* WITH_X11_XINPUT */
Window
GHOST_WindowX11::
@@ -1275,14 +1280,16 @@ GHOST_WindowX11::
if (m_custom_cursor) {
XFreeCursor(m_display, m_custom_cursor);
}
-
+
+#ifdef WITH_X11_XINPUT
/* close tablet devices */
if(m_xtablet.StylusDevice)
XCloseDevice(m_display, m_xtablet.StylusDevice);
if(m_xtablet.EraserDevice)
XCloseDevice(m_display, m_xtablet.EraserDevice);
-
+#endif /* WITH_X11_XINPUT */
+
if (m_context != s_firstContext) {
glXDestroyContext(m_display, m_context);
}