SineStriker
2023-12-01 0d31eda795a5bbfd62f070b54f2409761a0eb87f
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
#include "corewindowagent.h"
#include "corewindowagent_p.h"
 
#ifdef Q_OS_WINDOWS
#  include "handler/win32windowcontext_p.h"
#else
#  include "handler/qtwindowcontext_p.h"
#endif
 
namespace QWK {
 
    CoreWindowAgentPrivate::CoreWindowAgentPrivate() {
    }
 
    CoreWindowAgentPrivate::~CoreWindowAgentPrivate() {
    }
 
    void CoreWindowAgentPrivate::init() {
    }
 
    void CoreWindowAgentPrivate::setup(QWindow *window, WindowItemDelegate *delegate) {
#ifdef Q_OS_WINDOWS
        m_eventHandler = new Win32WindowContext(window, delegate);
#else
        m_eventHandler = new QtWindowContext(window, delegate);
#endif
    }
 
    CoreWindowAgent::~CoreWindowAgent() {
    }
 
    void CoreWindowAgent::showSystemMenu(const QPoint &pos) {
        Q_D(CoreWindowAgent);
        d->m_eventHandler->showSystemMenu(pos);
    }
 
    void CoreWindowAgent::startSystemMove(const QPoint &pos) {
        Q_D(CoreWindowAgent);
        auto win = d->m_eventHandler->window();
        if (!win) {
            return;
        }
 
        Q_UNUSED(pos)
        win->startSystemMove();
    }
 
    void CoreWindowAgent::startSystemResize(Qt::Edges edges, const QPoint &pos) {
        Q_D(CoreWindowAgent);
        auto win = d->m_eventHandler->window();
        if (!win) {
            return;
        }
 
        Q_UNUSED(pos)
        win->startSystemResize(edges);
    }
 
    void CoreWindowAgent::centralize() {
    }
 
    void CoreWindowAgent::raise() {
    }
 
    CoreWindowAgent::CoreWindowAgent(CoreWindowAgentPrivate &d, QObject *parent)
        : QObject(parent), d_ptr(&d) {
        d.q_ptr = this;
 
        d.init();
    }
 
}