KWin
Loading...
Searching...
No Matches
integration.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
6 SPDX-FileCopyrightText: 2019 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10#pragma once
11
12#include <epoxy/egl.h>
13
14#include <QObject>
15#include <QtGui/private/qgenericunixservices_p.h>
16#include <qpa/qplatformintegration.h>
17
18namespace KWin
19{
20
21class Output;
22
23namespace QPA
24{
25
26class Screen;
27
28class Integration : public QObject, public QPlatformIntegration
29{
30 Q_OBJECT
31public:
32 explicit Integration();
33 ~Integration() override;
34
35 bool hasCapability(Capability cap) const override;
36 QPlatformWindow *createPlatformWindow(QWindow *window) const override;
37 QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
38 QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
39 QAbstractEventDispatcher *createEventDispatcher() const override;
40 QPlatformFontDatabase *fontDatabase() const override;
41 QStringList themeNames() const override;
42 QPlatformTheme *createPlatformTheme(const QString &name) const override;
43 QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
44 QPlatformAccessibility *accessibility() const override;
45 QPlatformNativeInterface *nativeInterface() const override;
46 QPlatformServices *services() const override;
47 void initialize() override;
48
49 QHash<Output *, Screen *> screens() const;
50
51private Q_SLOTS:
52 void handleOutputEnabled(Output *output);
53 void handleOutputDisabled(Output *output);
54 void handleWorkspaceCreated();
55
56private:
57 std::unique_ptr<QPlatformFontDatabase> m_fontDb;
58 mutable std::unique_ptr<QPlatformAccessibility> m_accessibility;
59 std::unique_ptr<QPlatformNativeInterface> m_nativeInterface;
60 QPlatformPlaceholderScreen *m_dummyScreen = nullptr;
61 QHash<Output *, Screen *> m_screens;
62 std::unique_ptr<QGenericUnixServices> m_services;
63};
64
65}
66}
QPlatformWindow * createPlatformWindow(QWindow *window) const override
QAbstractEventDispatcher * createEventDispatcher() const override
bool hasCapability(Capability cap) const override
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const override
QPlatformNativeInterface * nativeInterface() const override
QPlatformTheme * createPlatformTheme(const QString &name) const override
void initialize() override
QPlatformFontDatabase * fontDatabase() const override
QPlatformAccessibility * accessibility() const override
QPlatformServices * services() const override
QHash< Output *, Screen * > screens() const
QStringList themeNames() const override
QPlatformOffscreenSurface * createPlatformOffscreenSurface(QOffscreenSurface *surface) const override