From eb266da10552eeefcb0f7dfe514d4385aec563f8 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周日, 03 12月 2023 05:05:23 +0800
Subject: [PATCH] Add windows context implementation

---
 src/core/qwindowkit_windows.h |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/core/qwindowkit_windows.h b/src/core/qwindowkit_windows.h
index c7726b9..ff7ff2b 100644
--- a/src/core/qwindowkit_windows.h
+++ b/src/core/qwindowkit_windows.h
@@ -2,5 +2,23 @@
 #define QWINDOWKIT_WINDOWS_H
 
 #include <QtCore/qt_windows.h>
+#include <QtCore/qglobal.h>
+
+// MOC can't handle C++ attributes before 5.15.
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
+#  define Q_NODISCARD    [[nodiscard]]
+#  define Q_MAYBE_UNUSED [[maybe_unused]]
+#else
+#  define Q_NODISCARD
+#  define Q_MAYBE_UNUSED
+#endif
+
+#ifndef GET_X_LPARAM
+#  define GET_X_LPARAM(lp) (static_cast<int>(static_cast<short>(LOWORD(lp))))
+#endif
+
+#ifndef GET_Y_LPARAM
+#  define GET_Y_LPARAM(lp) (static_cast<int>(static_cast<short>(HIWORD(lp))))
+#endif
 
 #endif // QWINDOWKIT_WINDOWS_H

--
Gitblit v1.9.1