Changeset View
Changeset View
Standalone View
Standalone View
debug_console.h
Show All 15 Lines | |||||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 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/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_DEBUG_CONSOLE_H | 20 | #ifndef KWIN_DEBUG_CONSOLE_H | ||
21 | #define KWIN_DEBUG_CONSOLE_H | 21 | #define KWIN_DEBUG_CONSOLE_H | ||
22 | 22 | | |||
23 | #include <kwin_export.h> | 23 | #include <kwin_export.h> | ||
24 | #include "input.h" | ||||
24 | 25 | | |||
25 | #include <QAbstractItemModel> | 26 | #include <QAbstractItemModel> | ||
26 | #include <QStyledItemDelegate> | 27 | #include <QStyledItemDelegate> | ||
27 | #include <QVector> | 28 | #include <QVector> | ||
28 | 29 | | |||
30 | class QTextEdit; | ||||
31 | | ||||
29 | namespace Ui | 32 | namespace Ui | ||
30 | { | 33 | { | ||
31 | class DebugConsole; | 34 | class DebugConsole; | ||
32 | } | 35 | } | ||
33 | 36 | | |||
34 | namespace KWin | 37 | namespace KWin | ||
35 | { | 38 | { | ||
36 | 39 | | |||
37 | class Client; | 40 | class Client; | ||
38 | class ShellClient; | 41 | class ShellClient; | ||
39 | class Unmanaged; | 42 | class Unmanaged; | ||
43 | class DebugConsoleFilter; | ||||
40 | 44 | | |||
41 | class KWIN_EXPORT DebugConsoleModel : public QAbstractItemModel | 45 | class KWIN_EXPORT DebugConsoleModel : public QAbstractItemModel | ||
42 | { | 46 | { | ||
43 | Q_OBJECT | 47 | Q_OBJECT | ||
44 | public: | 48 | public: | ||
45 | explicit DebugConsoleModel(QObject *parent = nullptr); | 49 | explicit DebugConsoleModel(QObject *parent = nullptr); | ||
46 | virtual ~DebugConsoleModel(); | 50 | virtual ~DebugConsoleModel(); | ||
47 | 51 | | |||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | |||||
93 | { | 97 | { | ||
94 | Q_OBJECT | 98 | Q_OBJECT | ||
95 | public: | 99 | public: | ||
96 | DebugConsole(); | 100 | DebugConsole(); | ||
97 | virtual ~DebugConsole(); | 101 | virtual ~DebugConsole(); | ||
98 | 102 | | |||
99 | private: | 103 | private: | ||
100 | QScopedPointer<Ui::DebugConsole> m_ui; | 104 | QScopedPointer<Ui::DebugConsole> m_ui; | ||
105 | QScopedPointer<DebugConsoleFilter> m_inputFilter; | ||||
101 | }; | 106 | }; | ||
102 | 107 | | |||
103 | class SurfaceTreeModel : public QAbstractItemModel | 108 | class SurfaceTreeModel : public QAbstractItemModel | ||
104 | { | 109 | { | ||
105 | Q_OBJECT | 110 | Q_OBJECT | ||
106 | public: | 111 | public: | ||
107 | explicit SurfaceTreeModel(QObject *parent = nullptr); | 112 | explicit SurfaceTreeModel(QObject *parent = nullptr); | ||
108 | virtual ~SurfaceTreeModel(); | 113 | virtual ~SurfaceTreeModel(); | ||
109 | 114 | | |||
110 | int columnCount(const QModelIndex &parent) const override; | 115 | int columnCount(const QModelIndex &parent) const override; | ||
111 | QVariant data(const QModelIndex &index, int role) const override; | 116 | QVariant data(const QModelIndex &index, int role) const override; | ||
112 | QModelIndex index(int row, int column, const QModelIndex & parent) const override; | 117 | QModelIndex index(int row, int column, const QModelIndex & parent) const override; | ||
113 | int rowCount(const QModelIndex &parent) const override; | 118 | int rowCount(const QModelIndex &parent) const override; | ||
114 | QModelIndex parent(const QModelIndex &child) const override; | 119 | QModelIndex parent(const QModelIndex &child) const override; | ||
115 | }; | 120 | }; | ||
116 | 121 | | |||
122 | class DebugConsoleFilter : public InputEventFilter | ||||
123 | { | ||||
124 | public: | ||||
125 | explicit DebugConsoleFilter(QTextEdit *textEdit); | ||||
126 | virtual ~DebugConsoleFilter(); | ||||
127 | | ||||
128 | bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override; | ||||
129 | bool wheelEvent(QWheelEvent *event) override; | ||||
130 | bool keyEvent(QKeyEvent *event) override; | ||||
131 | bool touchDown(quint32 id, const QPointF &pos, quint32 time) override; | ||||
132 | bool touchMotion(quint32 id, const QPointF &pos, quint32 time) override; | ||||
133 | bool touchUp(quint32 id, quint32 time) override; | ||||
134 | | ||||
135 | private: | ||||
136 | QTextEdit *m_textEdit; | ||||
137 | }; | ||||
138 | | ||||
117 | } | 139 | } | ||
118 | 140 | | |||
119 | #endif | 141 | #endif |