src/gui/kernel/qapplication_win.cpp
changeset 19 fcece45ef507
parent 18 2f34d5167611
child 25 e24348a560a6
equal deleted inserted replaced
18:2f34d5167611 19:fcece45ef507
   112 #  if defined(Q_WS_WINCE)
   112 #  if defined(Q_WS_WINCE)
   113 #    include <bldver.h>
   113 #    include <bldver.h>
   114 #  endif
   114 #  endif
   115 #  include <winable.h>
   115 #  include <winable.h>
   116 #endif
   116 #endif
       
   117 
       
   118 #include "private/qwinnativepangesturerecognizer_win_p.h"
   117 
   119 
   118 #ifndef WM_TOUCH
   120 #ifndef WM_TOUCH
   119 #  define WM_TOUCH 0x0240
   121 #  define WM_TOUCH 0x0240
   120 
   122 
   121 #  define TOUCHEVENTF_MOVE       0x0001
   123 #  define TOUCHEVENTF_MOVE       0x0001
  2522                         SetCapture(autoCaptureWnd);
  2524                         SetCapture(autoCaptureWnd);
  2523                 }
  2525                 }
  2524             }
  2526             }
  2525             result = false;
  2527             result = false;
  2526             break;
  2528             break;
       
  2529 #if !defined(Q_WS_WINCE) || defined(QT_WINCE_GESTURES)
  2527         case WM_GESTURE: {
  2530         case WM_GESTURE: {
  2528             GESTUREINFO gi;
  2531             GESTUREINFO gi;
  2529             memset(&gi, 0, sizeof(GESTUREINFO));
  2532             memset(&gi, 0, sizeof(GESTUREINFO));
  2530             gi.cbSize = sizeof(GESTUREINFO);
  2533             gi.cbSize = sizeof(GESTUREINFO);
  2531 
  2534 
  2554                     qWarning() << "translateGestureEvent: error = " << dwErr;
  2557                     qWarning() << "translateGestureEvent: error = " << dwErr;
  2555             }
  2558             }
  2556             result = true;
  2559             result = true;
  2557             break;
  2560             break;
  2558         }
  2561         }
       
  2562 #endif // !defined(Q_WS_WINCE) || defined(QT_WINCE_GESTURES)
  2559         default:
  2563         default:
  2560             result = false;                        // event was not processed
  2564             result = false;                        // event was not processed
  2561             break;
  2565             break;
  2562         }
  2566         }
  2563     }
  2567     }
  3996 }
  4000 }
  3997 
  4001 
  3998 #endif //QT_NO_SESSIONMANAGER
  4002 #endif //QT_NO_SESSIONMANAGER
  3999 
  4003 
  4000 
  4004 
       
  4005 bool QApplicationPrivate::HasTouchSupport = false;
  4001 PtrRegisterTouchWindow QApplicationPrivate::RegisterTouchWindow = 0;
  4006 PtrRegisterTouchWindow QApplicationPrivate::RegisterTouchWindow = 0;
  4002 PtrGetTouchInputInfo QApplicationPrivate::GetTouchInputInfo = 0;
  4007 PtrGetTouchInputInfo QApplicationPrivate::GetTouchInputInfo = 0;
  4003 PtrCloseTouchInputHandle QApplicationPrivate::CloseTouchInputHandle = 0;
  4008 PtrCloseTouchInputHandle QApplicationPrivate::CloseTouchInputHandle = 0;
  4004 
  4009 
  4005 void QApplicationPrivate::initializeMultitouch_sys()
  4010 void QApplicationPrivate::initializeMultitouch_sys()
  4006 {
  4011 {
       
  4012     static const IID QT_IID_IInkTablets = {0x112086D9, 0x7779, 0x4535, {0xA6, 0x99, 0x86, 0x2B, 0x43, 0xAC, 0x18, 0x63} };
       
  4013     static const IID QT_IID_IInkTablet2 = {0x90c91ad2, 0xfa36, 0x49d6, {0x95, 0x16, 0xce, 0x8d, 0x57, 0x0f, 0x6f, 0x85} };
       
  4014     static const CLSID QT_CLSID_InkTablets = {0x6E4FCB12, 0x510A, 0x4d40, {0x93, 0x04, 0x1D, 0xA1, 0x0A, 0xE9, 0x14, 0x7C} };
       
  4015 
       
  4016     IInkTablets *iInkTablets = 0;
       
  4017     HRESULT hr = CoCreateInstance(QT_CLSID_InkTablets, NULL, CLSCTX_ALL, QT_IID_IInkTablets, (void**)&iInkTablets);
       
  4018     if (SUCCEEDED(hr)) {
       
  4019         long count = 0;
       
  4020         iInkTablets->get_Count(&count);
       
  4021         for (long i = 0; i < count; ++i) {
       
  4022             IInkTablet *iInkTablet = 0;
       
  4023             hr = iInkTablets->Item(i, &iInkTablet);
       
  4024             if (FAILED(hr))
       
  4025                 continue;
       
  4026             IInkTablet2 *iInkTablet2 = 0;
       
  4027             hr = iInkTablet->QueryInterface(QT_IID_IInkTablet2, (void**)&iInkTablet2);
       
  4028             iInkTablet->Release();
       
  4029             if (FAILED(hr))
       
  4030                 continue;
       
  4031             TabletDeviceKind kind;
       
  4032             hr = iInkTablet2->get_DeviceKind(&kind);
       
  4033             iInkTablet2->Release();
       
  4034             if (FAILED(hr))
       
  4035                 continue;
       
  4036             if (kind == TDK_Touch) {
       
  4037                 QApplicationPrivate::HasTouchSupport = true;
       
  4038                 break;
       
  4039             }
       
  4040         }
       
  4041         iInkTablets->Release();
       
  4042     }
       
  4043 
  4007     QLibrary library(QLatin1String("user32"));
  4044     QLibrary library(QLatin1String("user32"));
  4008     // MinGW (g++ 3.4.5) accepts only C casts.
  4045     // MinGW (g++ 3.4.5) accepts only C casts.
  4009     RegisterTouchWindow = (PtrRegisterTouchWindow)(library.resolve("RegisterTouchWindow"));
  4046     RegisterTouchWindow = (PtrRegisterTouchWindow)(library.resolve("RegisterTouchWindow"));
  4010     GetTouchInputInfo = (PtrGetTouchInputInfo)(library.resolve("GetTouchInputInfo"));
  4047     GetTouchInputInfo = (PtrGetTouchInputInfo)(library.resolve("GetTouchInputInfo"));
  4011     CloseTouchInputHandle = (PtrCloseTouchInputHandle)(library.resolve("CloseTouchInputHandle"));
  4048     CloseTouchInputHandle = (PtrCloseTouchInputHandle)(library.resolve("CloseTouchInputHandle"));