Sine Striker
2023-12-02 5f8f04721a61398b71afac017b10150663afbbbd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "abstractwindowcontext_p.h"
 
namespace QWK {
 
    AbstractWindowContext::~AbstractWindowContext() {
        delete m_delegate;
    }
 
    void AbstractWindowContext::setupWindow(QWindow *window) {
        m_windowHandle = window;
    }
 
    bool AbstractWindowContext::setHitTestVisible(QObject *obj, bool visible) {
        Q_ASSERT(obj);
        if (!obj) {
            return false;
        }
 
        if (visible) {
            m_hitTestVisibleItems.insert(obj);
        } else {
            m_hitTestVisibleItems.remove(obj);
        }
        return true;
    }
 
    bool AbstractWindowContext::setHitTestVisible(const QRect &rect, bool visible) {
        Q_ASSERT(rect.isValid());
        if (!rect.isValid()) {
            return false;
        }
 
        if (visible) {
            m_hitTestVisibleRects.append(rect);
        } else {
            m_hitTestVisibleRects.removeAll(rect);
        }
        return true;
    }
 
    bool AbstractWindowContext::setSystemButton(CoreWindowAgent::SystemButton button,
                                                     QObject *obj) {
        Q_ASSERT(obj);
        Q_ASSERT(button != CoreWindowAgent::Unknown);
        if (!obj || (button == CoreWindowAgent::Unknown)) {
            return false;
        }
 
        if (m_systemButtons[button] == obj) {
            return false;
        }
        m_systemButtons[button] = obj;
        return true;
    }
 
    bool AbstractWindowContext::setTitleBar(QObject *item) {
        Q_ASSERT(item);
        if (!item) {
            return false;
        }
 
        if (m_titleBar == item) {
            return false;
        }
        m_titleBar = item;
        return true;
    }
 
    void AbstractWindowContext::showSystemMenu(const QPoint &pos) {
        // ?
    }
 
}