KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
flutter/Window.cpp
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2019 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11
12
13#include "Window_p.h"
14#include "core/Logging_p.h"
15
16using namespace KDDockWidgets;
17using namespace KDDockWidgets::flutter;
18
19Window::Window(std::shared_ptr<Core::View> rootView)
20 : Core::Window()
21 , m_rootView(rootView)
22{
23 if (rootView)
24 setGeometry(rootView->geometry());
25}
26
27Window::~Window() = default;
28
29std::shared_ptr<Core::View> Window::rootView() const
30{
31 return m_rootView;
32}
33
34Core::Window::Ptr Window::transientParent() const
35{
36 return nullptr;
37}
38
39void Window::setGeometry(Rect r)
40{
41 m_geometry = r;
42}
43
44void Window::setVisible(bool is)
45{
46 if (is == m_isVisible)
47 return;
48
49 // FLUTTER_TODO: Actually hide the flutter window
50
51 m_isVisible = is;
52}
53
54bool Window::supportsHonouringLayoutMinSize() const
55{
56 // maybe...
57 return false;
58}
59
60void Window::setWindowState(WindowState)
61{
62 KDDW_WARN("Window::setWindowState: Not implemented yet");
63}
64
65Rect Window::geometry() const
66{
67 return m_geometry;
68}
69
70bool Window::isVisible() const
71{
72 return m_isVisible;
73}
74
75Core::WId Window::handle() const
76{
77 return Core::WId(m_rootView ? m_rootView->handle() : Core::HANDLE());
78}
79
80bool Window::equals(std::shared_ptr<Core::Window> w) const
81{
82 if (!w)
83 return false;
84
85 auto window = std::static_pointer_cast<flutter::Window>(w);
86 return window->handle() == handle();
87}
88
89void Window::setFramePosition(Point pt)
90{
91 m_geometry.moveTopLeft(pt);
92 m_rootView->setGeometry(m_geometry);
93}
94
95Rect Window::frameGeometry() const
96{
97 // FLUTTER_TODO: How to get this from flutter
98 return m_geometry;
99}
100
101void Window::resize(int w, int h)
102{
103 Rect geo = geometry();
104 geo.setSize({ w, h });
105 setGeometry(geo);
106}
107
108bool Window::isActive() const
109{
110 KDDW_WARN("Window::isActive: Not implemented yet");
111 return {};
112}
113
114WindowState Window::windowState() const
115{
116 KDDW_WARN("Window::windowState: Not implemented yet");
117 return {};
118}
119
120Point Window::mapFromGlobal(Point) const
121{
122 KDDW_WARN("Window::mapFromGlobal: Not implemented yet");
123 return {};
124}
125
126Point Window::mapToGlobal(Point) const
127{
128 KDDW_WARN("Window::mapToGlobal: Not implemented yet");
129 return {};
130}
131
132void Window::destroy()
133{
134 KDDW_WARN("Window::destroy: Not implemented yet");
135}
136
137Size Window::minSize() const
138{
139 KDDW_WARN("Window::minSize: Not implemented yet");
140 return {};
141}
142
143Size Window::maxSize() const
144{
145 KDDW_WARN("Window::maxSize: Not implemented yet");
146 return {};
147}
148
149Point Window::fromNativePixels(Point) const
150{
151 KDDW_WARN("Window::fromNativePixels: Not implemented yet");
152 return {};
153}
154
155bool Window::isFullScreen() const
156{
157 KDDW_WARN("Window::isFullScreen: Not implemented yet");
158 return {};
159}
160
161Core::Screen::Ptr Window::screen() const
162{
163 KDDW_WARN("Window::screen: Not implemented yet");
164 return {};
165}
166
167void Window::onScreenChanged(Core::Object *, WindowScreenChangedCallback)
168{
169 KDDW_WARN("Window::onScreenChange: Not implemented yet");
170}
Class to abstract QAction, so code still works with QtQuick and Flutter.
typedef HANDLE

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8