File indexing completed on 2024-11-17 05:01:39

0001 /*  This file is part of the KDE libraries
0002     SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
0003     SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 #ifndef X11INTEGRATION_H
0008 #define X11INTEGRATION_H
0009 
0010 #include "kdeplatformtheme.h"
0011 #include <QHash>
0012 #include <QObject>
0013 #include <xcb/xcb.h>
0014 
0015 class QWindow;
0016 
0017 class X11Integration : public QObject
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit X11Integration(KdePlatformTheme *platformTheme);
0022     ~X11Integration() override;
0023     void init();
0024 
0025     void setWindowProperty(QWindow *window, const QByteArray &name, const QByteArray &value);
0026 
0027     bool eventFilter(QObject *watched, QEvent *event) override;
0028 
0029 private:
0030     void installColorScheme(QWindow *w);
0031     void installDesktopFileName(QWindow *w);
0032     QHash<QByteArray, xcb_atom_t> m_atoms;
0033     KdePlatformTheme *m_platformTheme;
0034 };
0035 
0036 #endif