346619aa36
Summary: And finally nothing inside libkwineffects, libkwinglutils, libkwinxrenderutils and kwineffect and kwin core uses KWin::display. We are finally XLib free! This change drops KWin::display and removes the include to QX11Info from kwinglobals.h. And the libraries no longer need to link X11Extras. Due to that removal a few seeming unrelated changes are required to add the include where needed and linkage to X11Extras. The biggest change is to x11 platform plugin which still needs the display and caches it in the Platform and passes it to various places in a way that the code doesn't need to be adjusted. Reviewers: #kwin, #plasma_on_wayland Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D3337
73 lines
2 KiB
C++
73 lines
2 KiB
C++
/********************************************************************
|
|
KWin - the KDE window manager
|
|
This file is part of the KDE project.
|
|
|
|
Copyright (C) 2016 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*********************************************************************/
|
|
#ifndef KWIN_XINPUTINTEGRATION_H
|
|
#define KWIN_XINPUTINTEGRATION_H
|
|
|
|
#include <QObject>
|
|
#include <QPointer>
|
|
#include <QScopedPointer>
|
|
typedef struct _XDisplay Display;
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
class XInputEventFilter;
|
|
class XKeyPressReleaseEventFilter;
|
|
class X11Cursor;
|
|
class Xkb;
|
|
|
|
class XInputIntegration : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit XInputIntegration(Display *display, QObject *parent);
|
|
virtual ~XInputIntegration();
|
|
|
|
void init();
|
|
void startListening();
|
|
|
|
bool hasXinput() const {
|
|
return m_hasXInput;
|
|
}
|
|
void setCursor(X11Cursor *cursor);
|
|
void setXkb(Xkb *xkb);
|
|
|
|
private:
|
|
Display *display() const {
|
|
return m_x11Display;
|
|
}
|
|
|
|
bool m_hasXInput = false;
|
|
int m_xiOpcode = 0;
|
|
int m_majorVersion = 0;
|
|
int m_minorVersion = 0;
|
|
QPointer<X11Cursor> m_x11Cursor;
|
|
// TODO: QPointer
|
|
Xkb *m_xkb = nullptr;
|
|
Display *m_x11Display;
|
|
|
|
QScopedPointer<XInputEventFilter> m_xiEventFilter;
|
|
QScopedPointer<XKeyPressReleaseEventFilter> m_keyPressFilter;
|
|
QScopedPointer<XKeyPressReleaseEventFilter> m_keyReleaseFilter;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|