Changeset View
Changeset View
Standalone View
Standalone View
debug_console.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
44 | class Unmanaged; | 44 | class Unmanaged; | ||
45 | class DebugConsoleFilter; | 45 | class DebugConsoleFilter; | ||
46 | 46 | | |||
47 | class KWIN_EXPORT DebugConsoleModel : public QAbstractItemModel | 47 | class KWIN_EXPORT DebugConsoleModel : public QAbstractItemModel | ||
48 | { | 48 | { | ||
49 | Q_OBJECT | 49 | Q_OBJECT | ||
50 | public: | 50 | public: | ||
51 | explicit DebugConsoleModel(QObject *parent = nullptr); | 51 | explicit DebugConsoleModel(QObject *parent = nullptr); | ||
52 | virtual ~DebugConsoleModel(); | 52 | ~DebugConsoleModel() override; | ||
53 | 53 | | |||
54 | 54 | | |||
55 | int columnCount(const QModelIndex &parent) const override; | 55 | int columnCount(const QModelIndex &parent) const override; | ||
56 | QVariant data(const QModelIndex &index, int role) const override; | 56 | QVariant data(const QModelIndex &index, int role) const override; | ||
57 | QModelIndex index(int row, int column, const QModelIndex & parent) const override; | 57 | QModelIndex index(int row, int column, const QModelIndex & parent) const override; | ||
58 | int rowCount(const QModelIndex &parent) const override; | 58 | int rowCount(const QModelIndex &parent) const override; | ||
59 | QModelIndex parent(const QModelIndex &child) const override; | 59 | QModelIndex parent(const QModelIndex &child) const override; | ||
60 | 60 | | |||
Show All 24 Lines | |||||
85 | 85 | | |||
86 | }; | 86 | }; | ||
87 | 87 | | |||
88 | class DebugConsoleDelegate : public QStyledItemDelegate | 88 | class DebugConsoleDelegate : public QStyledItemDelegate | ||
89 | { | 89 | { | ||
90 | Q_OBJECT | 90 | Q_OBJECT | ||
91 | public: | 91 | public: | ||
92 | explicit DebugConsoleDelegate(QObject *parent = nullptr); | 92 | explicit DebugConsoleDelegate(QObject *parent = nullptr); | ||
93 | virtual ~DebugConsoleDelegate(); | 93 | ~DebugConsoleDelegate() override; | ||
94 | 94 | | |||
95 | QString displayText(const QVariant &value, const QLocale &locale) const override; | 95 | QString displayText(const QVariant &value, const QLocale &locale) const override; | ||
96 | }; | 96 | }; | ||
97 | 97 | | |||
98 | class KWIN_EXPORT DebugConsole : public QWidget | 98 | class KWIN_EXPORT DebugConsole : public QWidget | ||
99 | { | 99 | { | ||
100 | Q_OBJECT | 100 | Q_OBJECT | ||
101 | public: | 101 | public: | ||
102 | DebugConsole(); | 102 | DebugConsole(); | ||
103 | virtual ~DebugConsole(); | 103 | ~DebugConsole() override; | ||
104 | 104 | | |||
105 | protected: | 105 | protected: | ||
106 | void showEvent(QShowEvent *event) override; | 106 | void showEvent(QShowEvent *event) override; | ||
107 | 107 | | |||
108 | private: | 108 | private: | ||
109 | void initGLTab(); | 109 | void initGLTab(); | ||
110 | void updateKeyboardTab(); | 110 | void updateKeyboardTab(); | ||
111 | 111 | | |||
112 | QScopedPointer<Ui::DebugConsole> m_ui; | 112 | QScopedPointer<Ui::DebugConsole> m_ui; | ||
113 | QScopedPointer<DebugConsoleFilter> m_inputFilter; | 113 | QScopedPointer<DebugConsoleFilter> m_inputFilter; | ||
114 | }; | 114 | }; | ||
115 | 115 | | |||
116 | class SurfaceTreeModel : public QAbstractItemModel | 116 | class SurfaceTreeModel : public QAbstractItemModel | ||
117 | { | 117 | { | ||
118 | Q_OBJECT | 118 | Q_OBJECT | ||
119 | public: | 119 | public: | ||
120 | explicit SurfaceTreeModel(QObject *parent = nullptr); | 120 | explicit SurfaceTreeModel(QObject *parent = nullptr); | ||
121 | virtual ~SurfaceTreeModel(); | 121 | ~SurfaceTreeModel() override; | ||
122 | 122 | | |||
123 | int columnCount(const QModelIndex &parent) const override; | 123 | int columnCount(const QModelIndex &parent) const override; | ||
124 | QVariant data(const QModelIndex &index, int role) const override; | 124 | QVariant data(const QModelIndex &index, int role) const override; | ||
125 | QModelIndex index(int row, int column, const QModelIndex & parent) const override; | 125 | QModelIndex index(int row, int column, const QModelIndex & parent) const override; | ||
126 | int rowCount(const QModelIndex &parent) const override; | 126 | int rowCount(const QModelIndex &parent) const override; | ||
127 | QModelIndex parent(const QModelIndex &child) const override; | 127 | QModelIndex parent(const QModelIndex &child) const override; | ||
128 | }; | 128 | }; | ||
129 | 129 | | |||
130 | class DebugConsoleFilter : public InputEventSpy | 130 | class DebugConsoleFilter : public InputEventSpy | ||
131 | { | 131 | { | ||
132 | public: | 132 | public: | ||
133 | explicit DebugConsoleFilter(QTextEdit *textEdit); | 133 | explicit DebugConsoleFilter(QTextEdit *textEdit); | ||
134 | virtual ~DebugConsoleFilter(); | 134 | ~DebugConsoleFilter() override; | ||
135 | 135 | | |||
136 | void pointerEvent(MouseEvent *event) override; | 136 | void pointerEvent(MouseEvent *event) override; | ||
137 | void wheelEvent(WheelEvent *event) override; | 137 | void wheelEvent(WheelEvent *event) override; | ||
138 | void keyEvent(KeyEvent *event) override; | 138 | void keyEvent(KeyEvent *event) override; | ||
139 | void touchDown(quint32 id, const QPointF &pos, quint32 time) override; | 139 | void touchDown(quint32 id, const QPointF &pos, quint32 time) override; | ||
140 | void touchMotion(quint32 id, const QPointF &pos, quint32 time) override; | 140 | void touchMotion(quint32 id, const QPointF &pos, quint32 time) override; | ||
141 | void touchUp(quint32 id, quint32 time) override; | 141 | void touchUp(quint32 id, quint32 time) override; | ||
142 | 142 | | |||
Show All 18 Lines | |||||
161 | class Device; | 161 | class Device; | ||
162 | } | 162 | } | ||
163 | 163 | | |||
164 | class InputDeviceModel : public QAbstractItemModel | 164 | class InputDeviceModel : public QAbstractItemModel | ||
165 | { | 165 | { | ||
166 | Q_OBJECT | 166 | Q_OBJECT | ||
167 | public: | 167 | public: | ||
168 | explicit InputDeviceModel(QObject *parent = nullptr); | 168 | explicit InputDeviceModel(QObject *parent = nullptr); | ||
169 | virtual ~InputDeviceModel(); | 169 | ~InputDeviceModel() override; | ||
170 | 170 | | |||
171 | int columnCount(const QModelIndex &parent) const override; | 171 | int columnCount(const QModelIndex &parent) const override; | ||
172 | QVariant data(const QModelIndex &index, int role) const override; | 172 | QVariant data(const QModelIndex &index, int role) const override; | ||
173 | QModelIndex index(int row, int column, const QModelIndex & parent) const override; | 173 | QModelIndex index(int row, int column, const QModelIndex & parent) const override; | ||
174 | int rowCount(const QModelIndex &parent) const override; | 174 | int rowCount(const QModelIndex &parent) const override; | ||
175 | QModelIndex parent(const QModelIndex &child) const override; | 175 | QModelIndex parent(const QModelIndex &child) const override; | ||
176 | 176 | | |||
177 | private: | 177 | private: | ||
178 | void setupDeviceConnections(LibInput::Device *device); | 178 | void setupDeviceConnections(LibInput::Device *device); | ||
179 | QVector<LibInput::Device*> m_devices; | 179 | QVector<LibInput::Device*> m_devices; | ||
180 | }; | 180 | }; | ||
181 | 181 | | |||
182 | } | 182 | } | ||
183 | 183 | | |||
184 | #endif | 184 | #endif |