[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47247] branches/soc-2012-swiss_cheese: Adds recognition for Windows 7 Touch Events and a CMake WITH_INPUT_TOUCH ( default off).

Nicholas Rishel rishel.nick at gmail.com
Thu May 31 00:08:03 CEST 2012


Revision: 47247
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47247
Author:   nicholas_rishel
Date:     2012-05-30 22:08:01 +0000 (Wed, 30 May 2012)
Log Message:
-----------
Adds recognition for Windows 7 Touch Events and a CMake WITH_INPUT_TOUCH (default off).

When INPUT_TOUCH is on, it defines _WIN32_WINNT as 0x601 (Windows 7). This is a short-term solution to enable usage for the Windows Touch API.

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/CMakeLists.txt
    branches/soc-2012-swiss_cheese/intern/ghost/CMakeLists.txt
    branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.cpp
    branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.h
    branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_TaskbarWin32.h
    branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_WindowWin32.cpp
    branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_WindowWin32.h

Modified: branches/soc-2012-swiss_cheese/CMakeLists.txt
===================================================================
--- branches/soc-2012-swiss_cheese/CMakeLists.txt	2012-05-30 21:15:17 UTC (rev 47246)
+++ branches/soc-2012-swiss_cheese/CMakeLists.txt	2012-05-30 22:08:01 UTC (rev 47247)
@@ -219,6 +219,9 @@
 
 # Misc
 option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
+if(WIN32)
+	option(WITH_INPUT_TOUCH "Enable Touch input (Windows 7 only)" OFF)
+endif()
 option(WITH_RAYOPTIMIZATION	"Enable use of SIMD (SSE) optimizations for the raytracer" ON)
 if(UNIX AND NOT APPLE)
 	option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
@@ -1849,6 +1852,7 @@
 	info_cfg_option(WITH_FFTW3)
 	info_cfg_option(WITH_INTERNATIONAL)
 	info_cfg_option(WITH_INPUT_NDOF)
+	info_cfg_option(WITH_INPUT_TOUCH)
 	info_cfg_option(WITH_CYCLES)
 
 	info_cfg_text("Compiler Options:")

Modified: branches/soc-2012-swiss_cheese/intern/ghost/CMakeLists.txt
===================================================================
--- branches/soc-2012-swiss_cheese/intern/ghost/CMakeLists.txt	2012-05-30 21:15:17 UTC (rev 47246)
+++ branches/soc-2012-swiss_cheese/intern/ghost/CMakeLists.txt	2012-05-30 22:08:01 UTC (rev 47247)
@@ -108,6 +108,10 @@
 	)
 endif()
 
+if(WITH_INPUT_TOUCH)
+	add_definitions(-DWITH_INPUT_TOUCH)
+endif()
+
 if(WITH_HEADLESS OR WITH_GHOST_SDL)
 	if(WITH_HEADLESS)
 		list(APPEND SRC

Modified: branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.cpp
===================================================================
--- branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.cpp	2012-05-30 21:15:17 UTC (rev 47246)
+++ branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.cpp	2012-05-30 22:08:01 UTC (rev 47247)
@@ -37,7 +37,7 @@
  * @date	May 7, 2001
  */
 
-#ifdef BF_GHOST_DEBUG
+#ifdef WITH_GHOST_DEBUG
 #include <iostream>
 #endif
 
@@ -986,6 +986,15 @@
 					((GHOST_WindowWin32 *)window)->processWin32TabletInitEvent();
 					break;
 				////////////////////////////////////////////////////////////////////////
+				// Touch events, processed
+				////////////////////////////////////////////////////////////////////////
+#ifdef WITH_INPUT_TOUCH
+				case WM_TOUCHDOWN:
+				case WM_TOUCHUP:
+				case WM_TOUCHMOVE:
+					break;
+#endif
+				////////////////////////////////////////////////////////////////////////
 				// Mouse events, processed
 				////////////////////////////////////////////////////////////////////////
 				case WM_LBUTTONDOWN:

Modified: branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.h	2012-05-30 21:15:17 UTC (rev 47246)
+++ branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_SystemWin32.h	2012-05-30 22:08:01 UTC (rev 47247)
@@ -37,11 +37,42 @@
 #error WIN32 only!
 #endif // WIN32
 
-#define _WIN32_WINNT 0x501 // require Windows XP or newer
+#ifdef WITH_INPUT_TOUCH
+#	define _WIN32_WINNT 0x0601 // require Windows 7 or newer
+#else
+#	define _WIN32_WINNT 0x501 // require Windows XP or newer
+#endif
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <ole2.h> // for drag-n-drop
 
+#ifdef WITH_INPUT_TOUCH
+#	ifndef SM_DIGITIZER
+#		define SM_DIGITIZER 94
+#	endif // SM_DIGITIZER
+#	ifndef TABLET_CONFIG_NONE
+#		define TABLET_CONFIG_NONE 0x00000000
+#	endif // TABLET_CONFIG_NONE
+#	ifndef NID_INTEGRATED_TOUCH
+#		define NID_INTEGRATED_TOUCH 0x00000001
+#	endif // NID_INTEGRATED_TOUCH
+#	ifndef NID_EXTERNAL_TOUCH
+#		define NID_EXTERNAL_TOUCH 0x00000002
+#	endif // NID_EXTERNAL_TOUCH
+#	ifndef NID_INTEGRATED_PEN
+#		define NID_INTEGRATED_PEN 0x00000004
+#	endif // NID_INTEGRATED_PEN
+#	ifndef NID_EXTERNAL_PEN
+#		define NID_EXTERNAL_PEN 0x00000008
+#	endif // NID_EXTERNAL_PEN
+#	ifndef NID_MULTI_INPUT
+#		define NID_MULTI_INPUT 0x00000040
+#	endif // NID_MULTI_INPUT
+#	ifndef NID_READY
+#		define NID_READY 0x00000080
+#	endif // NID_READY
+#endif //WITH_INPUT_TOUCH
+
 #include "GHOST_System.h"
 
 #if defined(__CYGWIN32__)

Modified: branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_TaskbarWin32.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_TaskbarWin32.h	2012-05-30 21:15:17 UTC (rev 47246)
+++ branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_TaskbarWin32.h	2012-05-30 22:08:01 UTC (rev 47247)
@@ -8,7 +8,11 @@
 #error WIN32 only!
 #endif // WIN32
 
-#define _WIN32_WINNT 0x501 // require Windows XP or newer
+#ifdef WITH_INPUT_TOUCH
+#	define _WIN32_WINNT 0x0601 // require Windows 7 or newer
+#else
+#	define _WIN32_WINNT 0x501 // require Windows XP or newer
+#endif
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <shlobj.h>

Modified: branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_WindowWin32.cpp	2012-05-30 21:15:17 UTC (rev 47246)
+++ branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_WindowWin32.cpp	2012-05-30 22:08:01 UTC (rev 47247)
@@ -275,6 +275,12 @@
 		// Store a pointer to this class in the window structure
 		::SetWindowLongPtr(m_hWnd, GWL_USERDATA, (LONG_PTR) this);
 
+#ifdef WITH_INPUT_TOUCH
+		if (GetSystemMetrics(SM_DIGITIZER) & NID_MULTI_INPUT){
+			RegisterTouchWindow(m_hWnd, 0);
+		}
+#endif
+
 		// Store the device context
 		m_hDC = ::GetDC(m_hWnd);
 

Modified: branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_WindowWin32.h
===================================================================
--- branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_WindowWin32.h	2012-05-30 21:15:17 UTC (rev 47246)
+++ branches/soc-2012-swiss_cheese/intern/ghost/intern/GHOST_WindowWin32.h	2012-05-30 22:08:01 UTC (rev 47247)
@@ -40,7 +40,11 @@
 #include "GHOST_Window.h"
 #include "GHOST_TaskbarWin32.h"
 
-#define _WIN32_WINNT 0x501 // require Windows XP or newer
+#ifdef WITH_INPUT_TOUCH
+#	define _WIN32_WINNT 0x0601 // require Windows 7 or newer
+#else
+#	define _WIN32_WINNT 0x501 // require Windows XP or newer
+#endif
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 




More information about the Bf-blender-cvs mailing list