Changeset View
Changeset View
Standalone View
Standalone View
internal_client.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | ||||
3 | This file is part of the KDE project. | ||||
4 | | ||||
5 | Copyright (C) 2019 Martin Flöser <mgraesslin@kde.org> | ||||
6 | | ||||
7 | This program is free software; you can redistribute it and/or modify | ||||
8 | it under the terms of the GNU General Public License as published by | ||||
9 | the Free Software Foundation; either version 2 of the License, or | ||||
10 | (at your option) any later version. | ||||
11 | | ||||
12 | This program is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | GNU General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU General Public License | ||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | #pragma once | ||||
21 | | ||||
22 | #include "shell_client.h" | ||||
23 | | ||||
24 | | ||||
25 | namespace KWin | ||||
26 | { | ||||
27 | | ||||
28 | class KWIN_EXPORT InternalClient : public ShellClient | ||||
29 | { | ||||
30 | Q_OBJECT | ||||
31 | public: | ||||
32 | InternalClient(KWayland::Server::ShellSurfaceInterface *surface); | ||||
33 | // needed for template <class T> void WaylandServer::createSurface(T *surface) | ||||
34 | InternalClient(KWayland::Server::XdgShellSurfaceInterface *surface); | ||||
35 | // needed for template <class T> void WaylandServer::createSurface(T *surface) | ||||
36 | InternalClient(KWayland::Server::XdgShellPopupInterface *surface); | ||||
37 | ~InternalClient() override; | ||||
38 | | ||||
39 | bool eventFilter(QObject *watched, QEvent *event) override; | ||||
40 | | ||||
41 | NET::WindowType windowType(bool direct = false, int supported_types = 0) const override; | ||||
42 | void killWindow() override; | ||||
43 | bool isPopupWindow() const override; | ||||
44 | void setInternalFramebufferObject(const QSharedPointer<QOpenGLFramebufferObject> &fbo) override; | ||||
45 | void closeWindow() override; | ||||
46 | bool isCloseable() const override; | ||||
47 | bool isMaximizable() const override; | ||||
48 | bool isMinimizable() const override; | ||||
49 | bool isMovable() const override; | ||||
50 | bool isMovableAcrossScreens() const override; | ||||
51 | bool isResizable() const override; | ||||
52 | bool noBorder() const override; | ||||
53 | bool userCanSetNoBorder() const override; | ||||
54 | bool wantsInput() const override; | ||||
55 | bool isInternal() const override; | ||||
56 | bool isLockScreen() const override; | ||||
57 | bool isInputMethod() const override; | ||||
58 | quint32 windowId() const override; | ||||
59 | using AbstractClient::resizeWithChecks; | ||||
60 | void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) override; | ||||
61 | QWindow *internalWindow() const override; | ||||
62 | | ||||
63 | protected: | ||||
64 | bool acceptsFocus() const override; | ||||
65 | void doMove(int x, int y) override; | ||||
66 | void doResizeSync() override; | ||||
67 | bool requestGeometry(const QRect &rect) override; | ||||
68 | void doSetGeometry(const QRect &rect) override; | ||||
69 | | ||||
70 | private: | ||||
71 | void findInternalWindow(); | ||||
72 | void updateInternalWindowGeometry(); | ||||
73 | void syncGeometryToInternalWindow(); | ||||
74 | | ||||
75 | NET::WindowType m_windowType = NET::Normal; | ||||
76 | quint32 m_windowId = 0; | ||||
77 | QWindow *m_internalWindow = nullptr; | ||||
78 | Qt::WindowFlags m_internalWindowFlags = Qt::WindowFlags(); | ||||
79 | }; | ||||
80 | | ||||
81 | } |