Skip to content
This repository
Browse code

Merge pull request #2524 from Montellese/touch_input_win32

[win32] improved touch input/gesture handling
  • Loading branch information...
commit ed0775a26edc3ad4f1e1465093b2061c9772e48a 2 parents 8d90fed + b941ff3
Sascha Montellese authored April 04, 2013
14  project/VS2010Express/XBMC.vcxproj
@@ -701,6 +701,9 @@
701 701
     <ClCompile Include="..\..\xbmc\input\KeyboardLayoutConfiguration.cpp" />
702 702
     <ClCompile Include="..\..\xbmc\input\KeyboardStat.cpp" />
703 703
     <ClCompile Include="..\..\xbmc\input\MouseStat.cpp" />
  704
+    <ClCompile Include="..\..\xbmc\input\touch\generic\GenericTouchActionHandler.cpp" />
  705
+    <ClCompile Include="..\..\xbmc\input\touch\generic\GenericTouchSwipeDetector.cpp" />
  706
+    <ClCompile Include="..\..\xbmc\input\touch\ITouchInputHandling.cpp" />
704 707
     <ClCompile Include="..\..\xbmc\input\windows\IRServerSuite.cpp" />
705 708
     <ClCompile Include="..\..\xbmc\input\windows\IrssMessage.cpp" />
706 709
     <ClCompile Include="..\..\xbmc\input\windows\WINJoystick.cpp" />
@@ -1048,6 +1051,13 @@
1048 1051
     <ClInclude Include="..\..\xbmc\guilib\GUIKeyboardFactory.h" />
1049 1052
     <ClInclude Include="..\..\xbmc\guilib\iimage.h" />
1050 1053
     <ClInclude Include="..\..\xbmc\guilib\imagefactory.h" />
  1054
+    <ClInclude Include="..\..\xbmc\input\touch\generic\GenericTouchActionHandler.h" />
  1055
+    <ClInclude Include="..\..\xbmc\input\touch\generic\GenericTouchSwipeDetector.h" />
  1056
+    <ClInclude Include="..\..\xbmc\input\touch\generic\IGenericTouchGestureDetector.h" />
  1057
+    <ClInclude Include="..\..\xbmc\input\touch\ITouchActionHandler.h" />
  1058
+    <ClInclude Include="..\..\xbmc\input\touch\ITouchInputHandler.h" />
  1059
+    <ClInclude Include="..\..\xbmc\input\touch\ITouchInputHandling.h" />
  1060
+    <ClInclude Include="..\..\xbmc\input\touch\TouchTypes.h" />
1051 1061
     <ClInclude Include="..\..\xbmc\input\windows\WINJoystick.h" />
1052 1062
     <ClInclude Include="..\..\xbmc\interfaces\json-rpc\PVROperations.h" />
1053 1063
     <ClInclude Include="..\..\xbmc\interfaces\legacy\Addon.h" />
@@ -1114,6 +1124,7 @@
1114 1124
     <ClInclude Include="..\..\xbmc\settings\windows\GUIWindowTestPattern.h" />
1115 1125
     <ClInclude Include="..\..\xbmc\utils\IRssObserver.h" />
1116 1126
     <ClInclude Include="..\..\xbmc\utils\RssManager.h" />
  1127
+    <ClInclude Include="..\..\xbmc\utils\Vector.h" />
1117 1128
     <ClInclude Include="..\..\xbmc\video\FFmpegVideoDecoder.h" />
1118 1129
     <ClInclude Include="..\..\xbmc\interfaces\python\swig.h" />
1119 1130
     <ClInclude Include="..\..\xbmc\interfaces\python\XBPython.h" />
@@ -1257,6 +1268,7 @@
1257 1268
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release (OpenGL)|Win32'">true</ExcludedFromBuild>
1258 1269
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">true</ExcludedFromBuild>
1259 1270
     </ClCompile>
  1271
+    <ClCompile Include="..\..\xbmc\utils\Vector.cpp" />
1260 1272
     <ClCompile Include="..\..\xbmc\video\VideoThumbLoader.cpp" />
1261 1273
     <ClCompile Include="..\..\xbmc\music\MusicThumbLoader.cpp" />
1262 1274
     <ClCompile Include="..\..\xbmc\ThumbnailCache.cpp" />
@@ -2963,4 +2975,4 @@
2963 2975
     </VisualStudio>
2964 2976
   </ProjectExtensions>
2965 2977
   <Import Project="$(SolutionDir)\$(ProjectFileName).targets.user" Condition="Exists('$(SolutionDir)\$(ProjectFileName).targets.user')" />
2966  
-</Project>
  2978
+</Project>
44  project/VS2010Express/XBMC.vcxproj.filters
@@ -295,6 +295,12 @@
295 295
     <Filter Include="profiles\windows">
296 296
       <UniqueIdentifier>{b5a6d872-7e56-4976-81c5-47baad252337}</UniqueIdentifier>
297 297
     </Filter>
  298
+    <Filter Include="input\touch">
  299
+      <UniqueIdentifier>{4e236b17-3720-4ed8-89af-90cb86bf9b03}</UniqueIdentifier>
  300
+    </Filter>
  301
+    <Filter Include="input\touch\generic">
  302
+      <UniqueIdentifier>{d062c356-66f2-49e7-9510-b216701d2298}</UniqueIdentifier>
  303
+    </Filter>
298 304
   </ItemGroup>
299 305
   <ItemGroup>
300 306
     <ClCompile Include="..\..\xbmc\win32\pch.cpp">
@@ -3000,6 +3006,18 @@
3000 3006
     <ClCompile Include="..\..\xbmc\profiles\ProfilesManager.cpp">
3001 3007
       <Filter>profiles</Filter>
3002 3008
     </ClCompile>
  3009
+    <ClCompile Include="..\..\xbmc\input\touch\generic\GenericTouchActionHandler.cpp">
  3010
+      <Filter>input\touch\generic</Filter>
  3011
+    </ClCompile>
  3012
+    <ClCompile Include="..\..\xbmc\input\touch\generic\GenericTouchSwipeDetector.cpp">
  3013
+      <Filter>input\touch\generic</Filter>
  3014
+    </ClCompile>
  3015
+    <ClCompile Include="..\..\xbmc\input\touch\ITouchInputHandling.cpp">
  3016
+      <Filter>input\touch</Filter>
  3017
+    </ClCompile>
  3018
+    <ClCompile Include="..\..\xbmc\utils\Vector.cpp">
  3019
+      <Filter>utils</Filter>
  3020
+    </ClCompile>
3003 3021
   </ItemGroup>
3004 3022
   <ItemGroup>
3005 3023
     <ClInclude Include="..\..\xbmc\win32\pch.h">
@@ -5858,6 +5876,30 @@
5858 5876
     <ClInclude Include="..\..\xbmc\profiles\ProfilesManager.h">
5859 5877
       <Filter>profiles</Filter>
5860 5878
     </ClInclude>
  5879
+    <ClInclude Include="..\..\xbmc\input\touch\ITouchActionHandler.h">
  5880
+      <Filter>input\touch</Filter>
  5881
+    </ClInclude>
  5882
+    <ClInclude Include="..\..\xbmc\input\touch\generic\GenericTouchActionHandler.h">
  5883
+      <Filter>input\touch\generic</Filter>
  5884
+    </ClInclude>
  5885
+    <ClInclude Include="..\..\xbmc\input\touch\TouchTypes.h">
  5886
+      <Filter>input\touch</Filter>
  5887
+    </ClInclude>
  5888
+    <ClInclude Include="..\..\xbmc\input\touch\generic\GenericTouchSwipeDetector.h">
  5889
+      <Filter>input\touch\generic</Filter>
  5890
+    </ClInclude>
  5891
+    <ClInclude Include="..\..\xbmc\input\touch\generic\IGenericTouchGestureDetector.h">
  5892
+      <Filter>input\touch\generic</Filter>
  5893
+    </ClInclude>
  5894
+    <ClInclude Include="..\..\xbmc\input\touch\ITouchInputHandler.h">
  5895
+      <Filter>input\touch</Filter>
  5896
+    </ClInclude>
  5897
+    <ClInclude Include="..\..\xbmc\input\touch\ITouchInputHandling.h">
  5898
+      <Filter>input\touch</Filter>
  5899
+    </ClInclude>
  5900
+    <ClInclude Include="..\..\xbmc\utils\Vector.h">
  5901
+      <Filter>utils</Filter>
  5902
+    </ClInclude>
5861 5903
   </ItemGroup>
5862 5904
   <ItemGroup>
5863 5905
     <ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc">
@@ -5889,4 +5931,4 @@
5889 5931
       <Filter>interfaces\swig</Filter>
5890 5932
     </None>
5891 5933
   </ItemGroup>
5892  
-</Project>
  5934
+</Project>
6  xbmc/input/touch/generic/GenericTouchSwipeDetector.cpp
@@ -161,6 +161,12 @@ bool CGenericTouchSwipeDetector::OnTouchMove(unsigned int index, const Pointer &
161 161
     else if (deltaYabs > m_dpi * SWIPE_MIN_DISTANCE)
162 162
       m_swipeDetected = true;
163 163
   }
  164
+
  165
+  if (m_directions == TouchMoveDirectionNone)
  166
+  {
  167
+    m_done = true;
  168
+    return false;
  169
+  }
164 170
   
165 171
   return true;
166 172
 }
150  xbmc/windowing/windows/WinEventsWin32.cpp
@@ -18,6 +18,11 @@
18 18
 *
19 19
 */
20 20
 
  21
+#ifndef _USE_MATH_DEFINES
  22
+#define _USE_MATH_DEFINES
  23
+#endif
  24
+#include <math.h>
  25
+
21 26
 #include "utils/log.h"
22 27
 #include "Windowsx.h"
23 28
 #include "windowing/WinEvents.h"
@@ -26,6 +31,8 @@
26 31
 #include "Application.h"
27 32
 #include "input/XBMC_vkeys.h"
28 33
 #include "input/MouseStat.h"
  34
+#include "input/touch/generic/GenericTouchActionHandler.h"
  35
+#include "input/touch/generic/GenericTouchSwipeDetector.h"
29 36
 #include "input/windows/WINJoystick.h"
30 37
 #include "storage/MediaManager.h"
31 38
 #include "windowing/WindowingFactory.h"
@@ -49,6 +56,12 @@ using namespace PERIPHERALS;
49 56
 
50 57
 HWND g_hWnd = NULL;
51 58
 
  59
+#ifndef LODWORD
  60
+#define LODWORD(longval) ((DWORD)((DWORDLONG)(longval)))
  61
+#endif
  62
+
  63
+#define ROTATE_ANGLE_DEGREE(arg) GID_ROTATE_ANGLE_FROM_ARGUMENT(LODWORD(arg)) * 180 / M_PI
  64
+
52 65
 #define XBMC_arraysize(array)	(sizeof(array)/sizeof(array[0]))
53 66
 
54 67
 /* Masks for processing the windows KEYDOWN and KEYUP messages */
@@ -65,8 +78,9 @@ uint32_t g_uQueryCancelAutoPlay = 0;
65 78
 int XBMC_TranslateUNICODE = 1;
66 79
 
67 80
 PHANDLE_EVENT_FUNC CWinEventsWin32::m_pEventFunc = NULL;
68  
-int CWinEventsWin32::m_lastGesturePosX = 0;
69  
-int CWinEventsWin32::m_lastGesturePosY = 0;
  81
+int CWinEventsWin32::m_originalZoomDistance = 0;
  82
+Pointer CWinEventsWin32::m_touchPointer;
  83
+CGenericTouchSwipeDetector* CWinEventsWin32::m_touchSwipeDetector = NULL;
70 84
 
71 85
 // register to receive SD card events (insert/remove)
72 86
 // seen at http://www.codeproject.com/Messages/2897423/Re-No-message-triggered-on-SD-card-insertion-remov.aspx
@@ -355,6 +369,16 @@ static XBMC_keysym *TranslateKey(WPARAM vkey, UINT scancode, XBMC_keysym *keysym
355 369
   return(keysym);
356 370
 }
357 371
 
  372
+void CWinEventsWin32::MessagePush(XBMC_Event *newEvent)
  373
+{
  374
+  // m_pEventFunc should be set because MessagePush is only executed by
  375
+  // methods called from WndProc()
  376
+  if (m_pEventFunc == NULL)
  377
+    return;
  378
+
  379
+  m_pEventFunc(*newEvent);
  380
+}
  381
+
358 382
 bool CWinEventsWin32::MessagePump()
359 383
 {
360 384
   MSG  msg;
@@ -805,33 +829,41 @@ void CWinEventsWin32::OnGestureNotify(HWND hWnd, LPARAM lParam)
805 829
   POINT point = { gn->ptsLocation.x, gn->ptsLocation.y };
806 830
   WindowFromScreenCoords(hWnd, &point);
807 831
 
808  
-  // by default that we want no gestures
  832
+  // by default we only want twofingertap and pressandtap gestures
  833
+  // the other gestures are enabled best on supported gestures
809 834
   GESTURECONFIG gc[] = {{ GID_ZOOM, 0, GC_ZOOM},
810 835
                         { GID_ROTATE, 0, GC_ROTATE},
811 836
                         { GID_PAN, 0, GC_PAN},
812  
-                        { GID_TWOFINGERTAP, 0, GC_TWOFINGERTAP },
813  
-                        { GID_PRESSANDTAP, 0, GC_PRESSANDTAP }};
  837
+                        { GID_TWOFINGERTAP, GC_TWOFINGERTAP, GC_TWOFINGERTAP },
  838
+                        { GID_PRESSANDTAP, GC_PRESSANDTAP, GC_PRESSANDTAP }};
814 839
 
815 840
   // send a message to see if a control wants any
816  
-  CGUIMessage message(GUI_MSG_GESTURE_NOTIFY, 0, 0, point.x, point.y);
817  
-  if (g_windowManager.SendMessage(message))
  841
+  int gestures = 0;
  842
+  if ((gestures = CGenericTouchActionHandler::Get().QuerySupportedGestures((float)point.x, (float)point.y)) != EVENT_RESULT_UNHANDLED)
818 843
   {
819  
-    int gestures = message.GetParam1();
820 844
     if (gestures & EVENT_RESULT_ZOOM)
821 845
       gc[0].dwWant |= GC_ZOOM;
822 846
     if (gestures & EVENT_RESULT_ROTATE)
823 847
       gc[1].dwWant |= GC_ROTATE;
824 848
     if (gestures & EVENT_RESULT_PAN_VERTICAL)
825  
-      gc[2].dwWant |= GC_PAN_WITH_SINGLE_FINGER_VERTICALLY | GC_PAN_WITH_GUTTER | GC_PAN_WITH_INERTIA;
  849
+      gc[2].dwWant |= GC_PAN | GC_PAN_WITH_SINGLE_FINGER_VERTICALLY | GC_PAN_WITH_GUTTER | GC_PAN_WITH_INERTIA;
826 850
     if (gestures & EVENT_RESULT_PAN_VERTICAL_WITHOUT_INERTIA)
827  
-      gc[2].dwWant |= GC_PAN_WITH_SINGLE_FINGER_VERTICALLY;
  851
+      gc[2].dwWant |= GC_PAN | GC_PAN_WITH_SINGLE_FINGER_VERTICALLY;
828 852
     if (gestures & EVENT_RESULT_PAN_HORIZONTAL)
829  
-      gc[2].dwWant |= GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY | GC_PAN_WITH_GUTTER | GC_PAN_WITH_INERTIA;
  853
+      gc[2].dwWant |= GC_PAN | GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY | GC_PAN_WITH_GUTTER | GC_PAN_WITH_INERTIA;
830 854
     if (gestures & EVENT_RESULT_PAN_HORIZONTAL_WITHOUT_INERTIA)
831  
-      gc[2].dwWant |= GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY;
832  
-    gc[0].dwBlock = gc[0].dwWant ^ 1;
833  
-    gc[1].dwBlock = gc[1].dwWant ^ 1;
834  
-    gc[2].dwBlock = gc[2].dwWant ^ 30;
  855
+      gc[2].dwWant |= GC_PAN | GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY;
  856
+    if (gestures & EVENT_RESULT_SWIPE)
  857
+    {
  858
+      gc[2].dwWant |= GC_PAN | GC_PAN_WITH_SINGLE_FINGER_VERTICALLY | GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY | GC_PAN_WITH_GUTTER;
  859
+
  860
+      // create a new touch swipe detector
  861
+      m_touchSwipeDetector = new CGenericTouchSwipeDetector(&CGenericTouchActionHandler::Get(), 160.0f);
  862
+    }
  863
+
  864
+    gc[0].dwBlock = gc[0].dwWant ^ 0x01;
  865
+    gc[1].dwBlock = gc[1].dwWant ^ 0x01;
  866
+    gc[2].dwBlock = gc[2].dwWant ^ 0x1F;
835 867
   }
836 868
   if (g_Windowing.PtrSetGestureConfig)
837 869
     g_Windowing.PtrSetGestureConfig(hWnd, 0, 5, gc, sizeof(GESTURECONFIG));
@@ -849,35 +881,99 @@ void CWinEventsWin32::OnGesture(HWND hWnd, LPARAM lParam)
849 881
   // convert to window coordinates
850 882
   POINT point = { gi.ptsLocation.x, gi.ptsLocation.y };
851 883
   WindowFromScreenCoords(hWnd, &point);
  884
+
  885
+  if (gi.dwID == GID_BEGIN)
  886
+    m_touchPointer.reset();
  887
+
  888
+  // if there's a "current" touch from a previous event, copy it to "last"
  889
+  if (m_touchPointer.current.valid())
  890
+    m_touchPointer.last = m_touchPointer.current;
  891
+
  892
+  // set the "current" touch
  893
+  m_touchPointer.current.x = (float)point.x;
  894
+  m_touchPointer.current.y = (float)point.y;
  895
+  m_touchPointer.current.time = time(NULL);
  896
+
852 897
   switch (gi.dwID)
853 898
   {
854 899
   case GID_BEGIN:
855 900
     {
856  
-      m_lastGesturePosX = point.x;
857  
-      m_lastGesturePosY = point.y;
858  
-      g_application.OnAction(CAction(ACTION_GESTURE_BEGIN, 0, (float)point.x, (float)point.y, 0, 0));
  901
+      // set the "down" touch
  902
+      m_touchPointer.down = m_touchPointer.current;
  903
+      m_originalZoomDistance = 0;
  904
+
  905
+      CGenericTouchActionHandler::Get().OnTouchGestureStart((float)point.x, (float)point.y);
859 906
     }
860 907
     break;
  908
+
861 909
   case GID_END:
862  
-    {
863  
-      g_application.OnAction(CAction(ACTION_GESTURE_END));
864  
-    }
  910
+    CGenericTouchActionHandler::Get().OnTouchGestureEnd((float)point.x, (float)point.y, 0.0f, 0.0f, 0.0f, 0.0f);
865 911
     break;
  912
+
866 913
   case GID_PAN:
867 914
     {
868  
-      g_application.OnAction(CAction(ACTION_GESTURE_PAN, 0, (float)point.x, (float)point.y,
869  
-                                    (float)(point.x - m_lastGesturePosX), (float)(point.y - m_lastGesturePosY)));
870  
-      m_lastGesturePosX = point.x;
871  
-      m_lastGesturePosY = point.y;
  915
+      if (!m_touchPointer.moving)
  916
+        m_touchPointer.moving = true;
  917
+
  918
+      // calculate the velocity of the pan gesture
  919
+      float velocityX, velocityY;
  920
+      m_touchPointer.velocity(velocityX, velocityY);
  921
+
  922
+      CGenericTouchActionHandler::Get().OnTouchGesturePan(m_touchPointer.current.x, m_touchPointer.current.y,
  923
+                                                          m_touchPointer.current.x - m_touchPointer.last.x, m_touchPointer.current.y - m_touchPointer.last.y,
  924
+                                                          velocityX, velocityY);
  925
+
  926
+      if (m_touchSwipeDetector != NULL)
  927
+      {
  928
+        if (gi.dwFlags & GF_BEGIN)
  929
+        {
  930
+          m_touchPointer.down = m_touchPointer.current;
  931
+          m_touchSwipeDetector->OnTouchDown(0, m_touchPointer);
  932
+        }
  933
+        else if (gi.dwFlags & GF_END)
  934
+        {
  935
+          m_touchSwipeDetector->OnTouchUp(0, m_touchPointer);
  936
+
  937
+          delete m_touchSwipeDetector;
  938
+          m_touchSwipeDetector = NULL;
  939
+        }
  940
+        else
  941
+          m_touchSwipeDetector->OnTouchMove(0, m_touchPointer);
  942
+      }
872 943
     }
873 944
     break;
  945
+
874 946
   case GID_ROTATE:
875  
-    CLog::Log(LOGDEBUG, "%s - Rotating", __FUNCTION__);
  947
+    {
  948
+      if (gi.dwFlags == GF_BEGIN)
  949
+        break;
  950
+
  951
+      CGenericTouchActionHandler::Get().OnRotate((float)point.x, (float)point.y,
  952
+                                                 -(float)ROTATE_ANGLE_DEGREE(gi.ullArguments));
  953
+    }
876 954
     break;
  955
+
877 956
   case GID_ZOOM:
878  
-    CLog::Log(LOGDEBUG, "%s - Zooming", __FUNCTION__);
  957
+    {
  958
+      if (gi.dwFlags == GF_BEGIN)
  959
+      {
  960
+        m_originalZoomDistance = (int)LODWORD(gi.ullArguments);
  961
+        break;
  962
+      }
  963
+
  964
+      // avoid division by 0
  965
+      if (m_originalZoomDistance == 0)
  966
+        break;
  967
+
  968
+      CGenericTouchActionHandler::Get().OnZoomPinch((float)point.x, (float)point.y,
  969
+                                                    (float)LODWORD(gi.ullArguments) / (float)m_originalZoomDistance);
  970
+    }
879 971
     break;
  972
+
880 973
   case GID_TWOFINGERTAP:
  974
+    CGenericTouchActionHandler::Get().OnTap((float)point.x, (float)point.y, 2);
  975
+    break;
  976
+
881 977
   case GID_PRESSANDTAP:
882 978
   default:
883 979
     // You have encountered an unknown gesture
15  xbmc/windowing/windows/WinEventsWin32.h
@@ -23,22 +23,29 @@
23 23
 
24 24
 #pragma once
25 25
 
26  
-#include "WinEvents.h"
  26
+#include "windowing/WinEvents.h"
  27
+#include "input/MouseStat.h"
  28
+#include "input/touch/TouchTypes.h"
  29
+
  30
+class CGenericTouchSwipeDetector;
27 31
 
28 32
 class CWinEventsWin32 : public CWinEventsBase
29 33
 {
30 34
 public:
  35
+  static void MessagePush(XBMC_Event *newEvent);
31 36
   static bool MessagePump();
32 37
   static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
33  
-  static PHANDLE_EVENT_FUNC m_pEventFunc;
  38
+
34 39
 private:
35 40
   static void RegisterDeviceInterfaceToHwnd(GUID InterfaceClassGuid, HWND hWnd, HDEVNOTIFY *hDeviceNotify);
36 41
   static void WindowFromScreenCoords(HWND hWnd, POINT *point);
37 42
   static void OnGestureNotify(HWND hWnd, LPARAM lParam);
38 43
   static void OnGesture(HWND hWnd, LPARAM lParam);
39 44
 
40  
-  static int m_lastGesturePosX;
41  
-  static int m_lastGesturePosY;
  45
+  static PHANDLE_EVENT_FUNC m_pEventFunc;
  46
+  static int m_originalZoomDistance;
  47
+  static Pointer m_touchPointer;
  48
+  static CGenericTouchSwipeDetector *m_touchSwipeDetector;
42 49
 };
43 50
 
44 51
 #endif // WINDOW_EVENTS_WIN32_H
3  xbmc/windowing/windows/WinSystemWin32.h
@@ -115,6 +115,9 @@ typedef struct tagGESTURENOTIFYSTRUCT {
115 115
     DWORD dwInstanceID;             // internally used
116 116
 } GESTURENOTIFYSTRUCT, *PGESTURENOTIFYSTRUCT;
117 117
 
  118
+#define GID_ROTATE_ANGLE_TO_ARGUMENT(_arg_)     ((USHORT)((((_arg_) + 2.0 * 3.14159265) / (4.0 * 3.14159265)) * 65535.0))
  119
+#define GID_ROTATE_ANGLE_FROM_ARGUMENT(_arg_)   ((((double)(_arg_) / 65535.0) * 4.0 * 3.14159265) - 2.0 * 3.14159265)
  120
+
118 121
 DECLARE_HANDLE(HGESTUREINFO);
119 122
 
120 123
 #endif

0 notes on commit ed0775a

Please sign in to comment.
Something went wrong with that request. Please try again.