Changeset View
Changeset View
Standalone View
Standalone View
plugins/qpa/integration.h
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2015 Martin Gräßlin <mgraesslin@kde.org> | 5 | Copyright (C) 2015 Martin Gräßlin <mgraesslin@kde.org> | ||
6 | Copyright (C) 2019 Vlad Zagorodniy <vladzzag@gmail.com> | ||||
6 | 7 | | |||
7 | This program is free software; you can redistribute it and/or modify | 8 | 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 | 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 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | 11 | (at your option) any later version. | ||
11 | 12 | | |||
12 | This program is distributed in the hope that it will be useful, | 13 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 16 | GNU General Public License for more details. | ||
16 | 17 | | |||
17 | You should have received a copy of the GNU General Public License | 18 | 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 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 20 | *********************************************************************/ | ||
20 | #ifndef KWIN_QPA_INTEGRATION_H | 21 | #ifndef KWIN_QPA_INTEGRATION_H | ||
21 | #define KWIN_QPA_INTEGRATION_H | 22 | #define KWIN_QPA_INTEGRATION_H | ||
22 | 23 | | |||
23 | #include <epoxy/egl.h> | 24 | #include <epoxy/egl.h> | ||
24 | #include "fixqopengl.h" | 25 | #include "fixqopengl.h" | ||
25 | 26 | | |||
26 | #include <fixx11h.h> | 27 | #include <fixx11h.h> | ||
27 | #include <qpa/qplatformintegration.h> | 28 | #include <qpa/qplatformintegration.h> | ||
28 | #include <QObject> | 29 | #include <QObject> | ||
29 | 30 | | |||
30 | namespace KWayland | | |||
31 | { | | |||
32 | namespace Client | | |||
33 | { | | |||
34 | class Compositor; | | |||
35 | class Shell; | | |||
36 | } | | |||
37 | } | | |||
38 | | ||||
39 | namespace KWin | 31 | namespace KWin | ||
40 | { | 32 | { | ||
41 | namespace QPA | 33 | namespace QPA | ||
42 | { | 34 | { | ||
43 | 35 | | |||
44 | class Screen; | 36 | class Screen; | ||
45 | 37 | | |||
46 | class Integration : public QObject, public QPlatformIntegration | 38 | class Integration : public QObject, public QPlatformIntegration | ||
47 | { | 39 | { | ||
48 | Q_OBJECT | 40 | Q_OBJECT | ||
49 | public: | 41 | public: | ||
50 | explicit Integration(); | 42 | explicit Integration(); | ||
51 | ~Integration() override; | 43 | ~Integration() override; | ||
52 | 44 | | |||
53 | bool hasCapability(Capability cap) const override; | 45 | bool hasCapability(Capability cap) const override; | ||
54 | QPlatformWindow *createPlatformWindow(QWindow *window) const override; | 46 | QPlatformWindow *createPlatformWindow(QWindow *window) const override; | ||
55 | QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; | 47 | QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; | ||
56 | QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; | 48 | QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override; | ||
57 | QAbstractEventDispatcher *createEventDispatcher() const override; | 49 | QAbstractEventDispatcher *createEventDispatcher() const override; | ||
58 | QPlatformFontDatabase *fontDatabase() const override; | 50 | QPlatformFontDatabase *fontDatabase() const override; | ||
59 | QStringList themeNames() const override; | 51 | QStringList themeNames() const override; | ||
60 | QPlatformTheme *createPlatformTheme(const QString &name) const override; | 52 | QPlatformTheme *createPlatformTheme(const QString &name) const override; | ||
61 | QPlatformNativeInterface *nativeInterface() const override; | | |||
62 | QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; | 53 | QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override; | ||
63 | | ||||
64 | void initialize() override; | | |||
65 | QPlatformInputContext *inputContext() const override; | 54 | QPlatformInputContext *inputContext() const override; | ||
66 | 55 | | |||
67 | KWayland::Client::Compositor *compositor() const; | 56 | void initialize() override; | ||
68 | EGLDisplay eglDisplay() const; | | |||
69 | 57 | | |||
70 | private: | 58 | private: | ||
71 | void initScreens(); | 59 | void initScreens(); | ||
72 | KWayland::Client::Shell *shell() const; | | |||
73 | 60 | | |||
74 | QPlatformFontDatabase *m_fontDb; | 61 | QPlatformFontDatabase *m_fontDb; | ||
75 | QPlatformNativeInterface *m_nativeInterface; | 62 | QPlatformNativeInterface *m_nativeInterface; | ||
76 | KWayland::Client::Compositor *m_compositor = nullptr; | | |||
77 | KWayland::Client::Shell *m_shell = nullptr; | | |||
78 | EGLDisplay m_eglDisplay = EGL_NO_DISPLAY; | | |||
79 | Screen *m_dummyScreen = nullptr; | 63 | Screen *m_dummyScreen = nullptr; | ||
80 | QScopedPointer<QPlatformInputContext> m_inputContext; | 64 | QScopedPointer<QPlatformInputContext> m_inputContext; | ||
81 | QVector<Screen*> m_screens; | 65 | QVector<Screen*> m_screens; | ||
82 | }; | 66 | }; | ||
83 | 67 | | |||
84 | } | 68 | } | ||
85 | } | 69 | } | ||
86 | 70 | | |||
87 | #endif | 71 | #endif |