From e1cbc7a1f19a97c7c00ba32df17b30d4cf32c630 Mon Sep 17 00:00:00 2001
From: Yuhang Zhao <zhaoyuhang@rankyee.com>
Date: 摹曛, 07 12月 2023 17:36:56 +0800
Subject: [PATCH] port sync dwm code

---
 src/core/windowitemdelegate.h |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/core/windowitemdelegate.h b/src/core/windowitemdelegate.h
index 9886fa5..7d7e6d1 100644
--- a/src/core/windowitemdelegate.h
+++ b/src/core/windowitemdelegate.h
@@ -2,27 +2,35 @@
 #define WINDOWITEMDELEGATE_H
 
 #include <QtCore/QObject>
+#include <QtCore/QPoint>
 #include <QtGui/QWindow>
 
-#include <QWKCore/qwkcoreglobal.h>
+#include <QWKCore/corewindowagent.h>
 
 namespace QWK {
 
-    class WindowItemDelegate {
-        Q_DISABLE_COPY(WindowItemDelegate)
+    class QWK_CORE_EXPORT WindowItemDelegate {
+    public:
+        WindowItemDelegate();
+        virtual ~WindowItemDelegate();
 
     public:
-        WindowItemDelegate() = default;
-        virtual ~WindowItemDelegate() = default;
+        // Item property query
+        virtual QWindow *window(const QObject *obj) const = 0;
+        virtual bool isEnabled(const QObject *obj) const = 0;
+        virtual bool isVisible(const QObject *obj) const = 0;
+        virtual QRect mapGeometryToScene(const QObject *obj) const = 0;
 
-    public:
-        virtual QWindow *window(QObject *obj) const = 0;
+        // Host property query
+        virtual QWindow *hostWindow(const QObject *host) const = 0;
+        virtual bool isHostSizeFixed(const QObject *host) const = 0;
 
-        virtual bool isEnabled(QObject *obj) const = 0;
-        virtual bool isVisible(QObject *obj) const = 0;
+        // Callbacks
+        virtual bool resetQtGrabbedControl() const;
+
+    private:
+        Q_DISABLE_COPY_MOVE(WindowItemDelegate)
     };
-
-    using WindowItemDelegatePtr = std::shared_ptr<WindowItemDelegate>;
 
 }
 

--
Gitblit v1.9.1