diff options
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscontext.h')
-rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.h | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h index 9dfde67797..b50010321b 100644 --- a/src/plugins/platforms/windows/qwindowscontext.h +++ b/src/plugins/platforms/windows/qwindowscontext.h @@ -80,7 +80,6 @@ class QTouchDevice; struct QWindowsUser32DLL { - QWindowsUser32DLL(); inline void init(); inline bool initTouch(); @@ -94,30 +93,36 @@ struct QWindowsUser32DLL typedef BOOL (WINAPI *RemoveClipboardFormatListener)(HWND); typedef BOOL (WINAPI *GetDisplayAutoRotationPreferences)(DWORD *); typedef BOOL (WINAPI *SetDisplayAutoRotationPreferences)(DWORD); + typedef BOOL (WINAPI *EnableNonClientDpiScaling)(HWND); + typedef int (WINAPI *GetWindowDpiAwarenessContext)(HWND); + typedef int (WINAPI *GetAwarenessFromDpiAwarenessContext)(int); // Touch functions from Windows 7 onwards (also for use with Q_CC_MSVC). - IsTouchWindow isTouchWindow; - RegisterTouchWindow registerTouchWindow; - UnregisterTouchWindow unregisterTouchWindow; - GetTouchInputInfo getTouchInputInfo; - CloseTouchInputHandle closeTouchInputHandle; + IsTouchWindow isTouchWindow = nullptr; + RegisterTouchWindow registerTouchWindow = nullptr; + UnregisterTouchWindow unregisterTouchWindow = nullptr; + GetTouchInputInfo getTouchInputInfo = nullptr; + CloseTouchInputHandle closeTouchInputHandle = nullptr; // Windows Vista onwards - SetProcessDPIAware setProcessDPIAware; + SetProcessDPIAware setProcessDPIAware = nullptr; // Clipboard listeners are present on Windows Vista onwards // but missing in MinGW 4.9 stub libs. Can be removed in MinGW 5. - AddClipboardFormatListener addClipboardFormatListener; - RemoveClipboardFormatListener removeClipboardFormatListener; + AddClipboardFormatListener addClipboardFormatListener = nullptr; + RemoveClipboardFormatListener removeClipboardFormatListener = nullptr; // Rotation API - GetDisplayAutoRotationPreferences getDisplayAutoRotationPreferences; - SetDisplayAutoRotationPreferences setDisplayAutoRotationPreferences; + GetDisplayAutoRotationPreferences getDisplayAutoRotationPreferences = nullptr; + SetDisplayAutoRotationPreferences setDisplayAutoRotationPreferences = nullptr; + + EnableNonClientDpiScaling enableNonClientDpiScaling = nullptr; + GetWindowDpiAwarenessContext getWindowDpiAwarenessContext = nullptr; + GetAwarenessFromDpiAwarenessContext getAwarenessFromDpiAwarenessContext = nullptr; }; // Shell scaling library (Windows 8.1 onwards) struct QWindowsShcoreDLL { - QWindowsShcoreDLL(); void init(); inline bool isValid() const { return getProcessDpiAwareness && setProcessDpiAwareness && getDpiForMonitor; } @@ -125,9 +130,9 @@ struct QWindowsShcoreDLL { typedef HRESULT (WINAPI *SetProcessDpiAwareness)(int); typedef HRESULT (WINAPI *GetDpiForMonitor)(HMONITOR,int,UINT *,UINT *); - GetProcessDpiAwareness getProcessDpiAwareness; - SetProcessDpiAwareness setProcessDpiAwareness; - GetDpiForMonitor getDpiForMonitor; + GetProcessDpiAwareness getProcessDpiAwareness = nullptr; + SetProcessDpiAwareness setProcessDpiAwareness = nullptr; + GetDpiForMonitor getDpiForMonitor = nullptr; }; class QWindowsContext @@ -181,12 +186,14 @@ public: inline bool windowsProc(HWND hwnd, UINT message, QtWindows::WindowsEventType et, - WPARAM wParam, LPARAM lParam, LRESULT *result); + WPARAM wParam, LPARAM lParam, LRESULT *result, + QWindowsWindow **platformWindowPtr); QWindow *keyGrabber() const; void setKeyGrabber(QWindow *hwnd); void setWindowCreationContext(const QSharedPointer<QWindowCreationContext> &ctx); + QSharedPointer<QWindowCreationContext> windowCreationContext() const; void setTabletAbsoluteRange(int a); void setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness); |