Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpad/src/backends/kwin_wayland/kwinwaylandtouchpad.h
- This file was copied to kcms/touchpad/src/backends/libinputcommon.h.
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #ifndef KWINWAYLANDTOUCHPAD_H | 19 | #ifndef KWINWAYLANDTOUCHPAD_H | ||
20 | #define KWINWAYLANDTOUCHPAD_H | 20 | #define KWINWAYLANDTOUCHPAD_H | ||
21 | 21 | | |||
22 | #include <QObject> | 22 | #include <backends/libinputcommon.h> | ||
23 | #include <QString> | 23 | #include <QString> | ||
24 | 24 | | |||
25 | class QDBusInterface; | 25 | class QDBusInterface; | ||
26 | 26 | | |||
27 | class KWinWaylandTouchpad : public QObject | 27 | class KWinWaylandTouchpad : public LibinputCommon | ||
28 | { | 28 | { | ||
29 | Q_OBJECT | 29 | Q_OBJECT | ||
30 | 30 | | |||
31 | // | | |||
32 | // general | | |||
33 | Q_PROPERTY(QString name READ name CONSTANT) | | |||
34 | Q_PROPERTY(bool supportsDisableEvents READ supportsDisableEvents CONSTANT) | | |||
35 | Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) | | |||
36 | | ||||
37 | // | | |||
38 | // advanced | | |||
39 | Q_PROPERTY(Qt::MouseButtons supportedButtons READ supportedButtons CONSTANT) | | |||
40 | | ||||
41 | Q_PROPERTY(bool supportsLeftHanded READ supportsLeftHanded CONSTANT) | | |||
42 | Q_PROPERTY(bool leftHandedEnabledByDefault READ leftHandedEnabledByDefault CONSTANT) | | |||
43 | Q_PROPERTY(bool leftHanded READ isLeftHanded WRITE setLeftHanded NOTIFY leftHandedChanged) | | |||
44 | | ||||
45 | Q_PROPERTY(bool supportsDisableEventsOnExternalMouse READ supportsDisableEventsOnExternalMouse CONSTANT) | | |||
46 | | ||||
47 | Q_PROPERTY(bool supportsDisableWhileTyping READ supportsDisableWhileTyping CONSTANT) | | |||
48 | Q_PROPERTY(bool disableWhileTypingEnabledByDefault READ disableWhileTypingEnabledByDefault CONSTANT) | | |||
49 | Q_PROPERTY(bool disableWhileTyping READ isDisableWhileTyping WRITE setDisableWhileTyping NOTIFY disableWhileTypingChanged) | | |||
50 | | ||||
51 | Q_PROPERTY(bool supportsMiddleEmulation READ supportsMiddleEmulation CONSTANT) | | |||
52 | Q_PROPERTY(bool middleEmulationEnabledByDefault READ middleEmulationEnabledByDefault CONSTANT) | | |||
53 | Q_PROPERTY(bool middleEmulation READ isMiddleEmulation WRITE setMiddleEmulation NOTIFY middleEmulationChanged) | | |||
54 | | ||||
55 | // | | |||
56 | // acceleration speed and profile | | |||
57 | Q_PROPERTY(bool supportsPointerAcceleration READ supportsPointerAcceleration CONSTANT) | | |||
58 | Q_PROPERTY(qreal pointerAcceleration READ pointerAcceleration WRITE setPointerAcceleration NOTIFY pointerAccelerationChanged) | | |||
59 | | ||||
60 | Q_PROPERTY(bool supportsPointerAccelerationProfileFlat READ supportsPointerAccelerationProfileFlat CONSTANT) | | |||
61 | Q_PROPERTY(bool defaultPointerAccelerationProfileFlat READ defaultPointerAccelerationProfileFlat CONSTANT) | | |||
62 | Q_PROPERTY(bool pointerAccelerationProfileFlat READ pointerAccelerationProfileFlat WRITE setPointerAccelerationProfileFlat NOTIFY pointerAccelerationProfileChanged) | | |||
63 | | ||||
64 | Q_PROPERTY(bool supportsPointerAccelerationProfileAdaptive READ supportsPointerAccelerationProfileAdaptive CONSTANT) | | |||
65 | Q_PROPERTY(bool defaultPointerAccelerationProfileAdaptive READ defaultPointerAccelerationProfileAdaptive CONSTANT) | | |||
66 | Q_PROPERTY(bool pointerAccelerationProfileAdaptive READ pointerAccelerationProfileAdaptive WRITE setPointerAccelerationProfileAdaptive NOTIFY pointerAccelerationProfileChanged) | | |||
67 | | ||||
68 | // | | |||
69 | // tapping | | |||
70 | Q_PROPERTY(int tapFingerCount READ tapFingerCount CONSTANT) | | |||
71 | Q_PROPERTY(bool tapToClickEnabledByDefault READ tapToClickEnabledByDefault CONSTANT) | | |||
72 | Q_PROPERTY(bool tapToClick READ isTapToClick WRITE setTapToClick NOTIFY tapToClickChanged) | | |||
73 | | ||||
74 | Q_PROPERTY(bool supportsLmrTapButtonMap READ supportsLmrTapButtonMap CONSTANT) | | |||
75 | Q_PROPERTY(bool lmrTapButtonMapEnabledByDefault READ lmrTapButtonMapEnabledByDefault CONSTANT) | | |||
76 | Q_PROPERTY(bool lmrTapButtonMap READ lmrTapButtonMap WRITE setLmrTapButtonMap NOTIFY lmrTapButtonMapChanged) | | |||
77 | | ||||
78 | Q_PROPERTY(bool tapAndDragEnabledByDefault READ tapAndDragEnabledByDefault CONSTANT) | | |||
79 | Q_PROPERTY(bool tapAndDrag READ isTapAndDrag WRITE setTapAndDrag NOTIFY tapAndDragChanged) | | |||
80 | | ||||
81 | Q_PROPERTY(bool tapDragLockEnabledByDefault READ tapDragLockEnabledByDefault CONSTANT) | | |||
82 | Q_PROPERTY(bool tapDragLock READ isTapDragLock WRITE setTapDragLock NOTIFY tapDragLockChanged) | | |||
83 | | ||||
84 | // | | |||
85 | // scrolling | | |||
86 | Q_PROPERTY(bool supportsNaturalScroll READ supportsNaturalScroll CONSTANT) | | |||
87 | Q_PROPERTY(bool naturalScrollEnabledByDefault READ naturalScrollEnabledByDefault CONSTANT) | | |||
88 | Q_PROPERTY(bool naturalScroll READ isNaturalScroll WRITE setNaturalScroll NOTIFY naturalScrollChanged) | | |||
89 | | ||||
90 | Q_PROPERTY(bool supportsScrollTwoFinger READ supportsScrollTwoFinger CONSTANT) | | |||
91 | Q_PROPERTY(bool scrollTwoFingerEnabledByDefault READ scrollTwoFingerEnabledByDefault CONSTANT) | | |||
92 | Q_PROPERTY(bool scrollTwoFinger READ isScrollTwoFinger WRITE setScrollTwoFinger NOTIFY scrollMethodChanged) | | |||
93 | | ||||
94 | Q_PROPERTY(bool supportsScrollEdge READ supportsScrollEdge CONSTANT) | | |||
95 | Q_PROPERTY(bool scrollEdgeEnabledByDefault READ scrollEdgeEnabledByDefault CONSTANT) | | |||
96 | Q_PROPERTY(bool scrollEdge READ isScrollEdge WRITE setScrollEdge NOTIFY scrollMethodChanged) | | |||
97 | | ||||
98 | Q_PROPERTY(bool supportsScrollOnButtonDown READ supportsScrollOnButtonDown CONSTANT) | | |||
99 | Q_PROPERTY(bool scrollOnButtonDownEnabledByDefault READ scrollOnButtonDownEnabledByDefault CONSTANT) | | |||
100 | Q_PROPERTY(bool scrollOnButtonDown READ isScrollOnButtonDown WRITE setScrollOnButtonDown NOTIFY scrollMethodChanged) | | |||
101 | | ||||
102 | Q_PROPERTY(quint32 defaultScrollButton READ defaultScrollButton CONSTANT) | | |||
103 | Q_PROPERTY(quint32 scrollButton READ scrollButton WRITE setScrollButton NOTIFY scrollButtonChanged) | | |||
104 | | ||||
105 | // Click Methods | | |||
106 | Q_PROPERTY(bool supportsClickMethodAreas READ supportsClickMethodAreas CONSTANT) | | |||
107 | Q_PROPERTY(bool defaultClickMethodAreas READ defaultClickMethodAreas CONSTANT) | | |||
108 | Q_PROPERTY(bool clickMethodAreas READ isClickMethodAreas WRITE setClickMethodAreas NOTIFY clickMethodChanged) | | |||
109 | | ||||
110 | Q_PROPERTY(bool supportsClickMethodClickfinger READ supportsClickMethodClickfinger CONSTANT) | | |||
111 | Q_PROPERTY(bool defaultClickMethodClickfinger READ defaultClickMethodClickfinger CONSTANT) | | |||
112 | Q_PROPERTY(bool clickMethodClickfinger READ isClickMethodClickfinger WRITE setClickMethodClickfinger NOTIFY clickMethodChanged) | | |||
113 | | ||||
114 | public: | 31 | public: | ||
115 | KWinWaylandTouchpad(QString dbusName); | 32 | KWinWaylandTouchpad(QString dbusName); | ||
116 | ~KWinWaylandTouchpad() override; | 33 | ~KWinWaylandTouchpad() override; | ||
117 | 34 | | |||
118 | bool init(); | 35 | bool init(); | ||
119 | 36 | | |||
120 | bool getConfig(); | 37 | bool getConfig(); | ||
121 | bool getDefaultConfig(); | 38 | bool getDefaultConfig(); | ||
122 | bool applyConfig(); | 39 | bool applyConfig(); | ||
123 | bool isChangedConfig() const; | 40 | bool isChangedConfig() const; | ||
124 | 41 | | |||
125 | // | 42 | // | ||
126 | // general | 43 | // general | ||
127 | QString name() const { | 44 | QString name() const override { | ||
128 | return m_name.val; | 45 | return m_name.val; | ||
129 | } | 46 | } | ||
130 | QString sysName() const { | 47 | QString sysName() const { | ||
131 | return m_sysName.val; | 48 | return m_sysName.val; | ||
132 | } | 49 | } | ||
133 | bool supportsDisableEvents() const { | 50 | bool supportsDisableEvents() const override { | ||
134 | return m_supportsDisableEvents.val; | 51 | return m_supportsDisableEvents.val; | ||
135 | } | 52 | } | ||
136 | void setEnabled(bool enabled) { | 53 | void setEnabled(bool enabled) override { | ||
137 | m_enabled.set(enabled); | 54 | m_enabled.set(enabled); | ||
138 | } | 55 | } | ||
139 | bool isEnabled() const { | 56 | bool isEnabled() const override { | ||
140 | return m_enabled.val; | 57 | return m_enabled.val; | ||
141 | } | 58 | } | ||
142 | Qt::MouseButtons supportedButtons() const { | | |||
143 | return m_supportedButtons.val; | | |||
144 | } | | |||
145 | | ||||
146 | // | 59 | // | ||
147 | // advanced | 60 | // advanced | ||
148 | bool supportsLeftHanded() const { | 61 | bool supportsLeftHanded() const override { | ||
149 | return m_supportsLeftHanded.val; | 62 | return m_supportsLeftHanded.val; | ||
150 | } | 63 | } | ||
151 | bool leftHandedEnabledByDefault() const { | 64 | bool supportsDisableEventsOnExternalMouse() const override { | ||
152 | return m_leftHandedEnabledByDefault.val; | | |||
153 | } | | |||
154 | bool isLeftHanded() const { | | |||
155 | return m_leftHanded.val; | | |||
156 | } | | |||
157 | void setLeftHanded(bool set) { | | |||
158 | m_leftHanded.set(set); | | |||
159 | } | | |||
160 | | ||||
161 | bool supportsDisableEventsOnExternalMouse() const { | | |||
162 | return m_supportsDisableEventsOnExternalMouse.val; | 65 | return m_supportsDisableEventsOnExternalMouse.val; | ||
163 | } | 66 | } | ||
164 | 67 | bool supportsDisableWhileTyping() const override { | |||
165 | bool supportsDisableWhileTyping() const { | | |||
166 | return m_supportsDisableWhileTyping.val; | 68 | return m_supportsDisableWhileTyping.val; | ||
167 | } | 69 | } | ||
168 | bool disableWhileTypingEnabledByDefault() const { | 70 | bool supportsMiddleEmulation() const override { | ||
169 | return m_disableWhileTypingEnabledByDefault.val; | | |||
170 | } | | |||
171 | bool isDisableWhileTyping() const { | | |||
172 | return m_disableWhileTyping.val; | | |||
173 | } | | |||
174 | void setDisableWhileTyping(bool set) { | | |||
175 | m_disableWhileTyping.set(set); | | |||
176 | } | | |||
177 | | ||||
178 | bool supportsMiddleEmulation() const { | | |||
179 | return m_supportsMiddleEmulation.val; | 71 | return m_supportsMiddleEmulation.val; | ||
180 | } | 72 | } | ||
181 | bool middleEmulationEnabledByDefault() const { | 73 | // | ||
182 | return m_middleEmulationEnabledByDefault.val; | 74 | // tapping | ||
183 | } | 75 | void setLmrTapButtonMap(bool set) override { | ||
184 | bool isMiddleEmulation() const { | 76 | m_lmrTapButtonMap.set(set); | ||
185 | return m_middleEmulation.val; | | |||
186 | } | | |||
187 | void setMiddleEmulation(bool set) { | | |||
188 | m_middleEmulation.set(set); | | |||
189 | } | 77 | } | ||
190 | | ||||
191 | // | 78 | // | ||
192 | // acceleration speed and profile | 79 | // acceleration speed and profile | ||
193 | bool supportsPointerAcceleration() const { | 80 | bool supportsPointerAcceleration() const override { | ||
194 | return m_supportsPointerAcceleration.val; | 81 | return m_supportsPointerAcceleration.val; | ||
195 | } | 82 | } | ||
196 | qreal pointerAcceleration() const { | 83 | bool supportsPointerAccelerationProfileFlat() const override { | ||
197 | return m_pointerAcceleration.val; | | |||
198 | } | | |||
199 | void setPointerAcceleration(qreal acceleration) { | | |||
200 | m_pointerAcceleration.set(acceleration); | | |||
201 | } | | |||
202 | | ||||
203 | bool supportsPointerAccelerationProfileFlat() const { | | |||
204 | return m_supportsPointerAccelerationProfileFlat.val; | 84 | return m_supportsPointerAccelerationProfileFlat.val; | ||
205 | } | 85 | } | ||
206 | bool defaultPointerAccelerationProfileFlat() const { | 86 | bool supportsPointerAccelerationProfileAdaptive() const override { | ||
207 | return m_defaultPointerAccelerationProfileFlat.val; | | |||
208 | } | | |||
209 | bool pointerAccelerationProfileFlat() const { | | |||
210 | return m_pointerAccelerationProfileFlat.val; | | |||
211 | } | | |||
212 | void setPointerAccelerationProfileFlat(bool set) { | | |||
213 | m_pointerAccelerationProfileFlat.set(set); | | |||
214 | } | | |||
215 | | ||||
216 | bool supportsPointerAccelerationProfileAdaptive() const { | | |||
217 | return m_supportsPointerAccelerationProfileAdaptive.val; | 87 | return m_supportsPointerAccelerationProfileAdaptive.val; | ||
218 | } | 88 | } | ||
219 | bool defaultPointerAccelerationProfileAdaptive() const { | | |||
220 | return m_defaultPointerAccelerationProfileAdaptive.val; | | |||
221 | } | | |||
222 | bool pointerAccelerationProfileAdaptive() const { | | |||
223 | return m_pointerAccelerationProfileAdaptive.val; | | |||
224 | } | | |||
225 | void setPointerAccelerationProfileAdaptive(bool set) { | | |||
226 | m_pointerAccelerationProfileAdaptive.set(set); | | |||
227 | } | | |||
228 | | ||||
229 | // | | |||
230 | // tapping | | |||
231 | int tapFingerCount() const { | | |||
232 | return m_tapFingerCount.val; | | |||
233 | } | | |||
234 | bool tapToClickEnabledByDefault() const { | | |||
235 | return m_tapToClickEnabledByDefault.val; | | |||
236 | } | | |||
237 | bool isTapToClick() const { | | |||
238 | return m_tapToClick.val; | | |||
239 | } | | |||
240 | void setTapToClick(bool set) { | | |||
241 | m_tapToClick.set(set); | | |||
242 | } | | |||
243 | | ||||
244 | bool supportsLmrTapButtonMap() const { | | |||
245 | return m_tapFingerCount.val > 1; | | |||
246 | } | | |||
247 | bool lmrTapButtonMapEnabledByDefault() const { | | |||
248 | return m_lmrTapButtonMapEnabledByDefault.val; | | |||
249 | } | | |||
250 | bool lmrTapButtonMap() const { | | |||
251 | return m_lmrTapButtonMap.val; | | |||
252 | } | | |||
253 | void setLmrTapButtonMap(bool set) { | | |||
254 | m_lmrTapButtonMap.set(set); | | |||
255 | } | | |||
256 | | ||||
257 | bool tapAndDragEnabledByDefault() const { | | |||
258 | return m_tapAndDragEnabledByDefault.val; | | |||
259 | } | | |||
260 | bool isTapAndDrag() const { | | |||
261 | return m_tapAndDrag.val; | | |||
262 | } | | |||
263 | void setTapAndDrag(bool set) { | | |||
264 | m_tapAndDrag.set(set); | | |||
265 | } | | |||
266 | | ||||
267 | bool tapDragLockEnabledByDefault() const { | | |||
268 | return m_tapDragLockEnabledByDefault.val; | | |||
269 | } | | |||
270 | bool isTapDragLock() const { | | |||
271 | return m_tapDragLock.val; | | |||
272 | } | | |||
273 | void setTapDragLock(bool set) { | | |||
274 | m_tapDragLock.set(set); | | |||
275 | } | | |||
276 | | ||||
277 | // | 89 | // | ||
278 | // scrolling | 90 | // scrolling | ||
279 | bool supportsNaturalScroll() const { | 91 | bool supportsNaturalScroll() const override { | ||
280 | return m_supportsNaturalScroll.val; | 92 | return m_supportsNaturalScroll.val; | ||
281 | } | 93 | } | ||
282 | bool naturalScrollEnabledByDefault() const { | 94 | bool supportsHorizontalScrolling() const override { | ||
283 | return m_naturalScrollEnabledByDefault.val; | 95 | return false; | ||
284 | } | | |||
285 | bool isNaturalScroll() const { | | |||
286 | return m_naturalScroll.val; | | |||
287 | } | 96 | } | ||
288 | void setNaturalScroll(bool set) { | 97 | bool supportsScrollTwoFinger() const override { | ||
289 | m_naturalScroll.set(set); | | |||
290 | } | | |||
291 | | ||||
292 | bool supportsScrollTwoFinger() const { | | |||
293 | return m_supportsScrollTwoFinger.val; | 98 | return m_supportsScrollTwoFinger.val; | ||
294 | } | 99 | } | ||
295 | bool scrollTwoFingerEnabledByDefault() const { | 100 | bool supportsScrollEdge() const override { | ||
296 | return m_scrollTwoFingerEnabledByDefault.val; | | |||
297 | } | | |||
298 | bool isScrollTwoFinger() const { | | |||
299 | return m_isScrollTwoFinger.val; | | |||
300 | } | | |||
301 | void setScrollTwoFinger(bool set) { | | |||
302 | m_isScrollTwoFinger.set(set); | | |||
303 | } | | |||
304 | | ||||
305 | bool supportsScrollEdge() const { | | |||
306 | return m_supportsScrollEdge.val; | 101 | return m_supportsScrollEdge.val; | ||
307 | } | 102 | } | ||
308 | bool scrollEdgeEnabledByDefault() const { | 103 | bool supportsScrollOnButtonDown() const override { | ||
309 | return m_scrollEdgeEnabledByDefault.val; | | |||
310 | } | | |||
311 | bool isScrollEdge() const { | | |||
312 | return m_isScrollEdge.val; | | |||
313 | } | | |||
314 | void setScrollEdge(bool set) { | | |||
315 | m_isScrollEdge.set(set); | | |||
316 | } | | |||
317 | | ||||
318 | bool supportsScrollOnButtonDown() const { | | |||
319 | return m_supportsScrollOnButtonDown.val; | 104 | return m_supportsScrollOnButtonDown.val; | ||
320 | } | 105 | } | ||
321 | bool scrollOnButtonDownEnabledByDefault() const { | 106 | // | ||
322 | return m_scrollOnButtonDownEnabledByDefault.val; | 107 | // Click method | ||
323 | } | 108 | bool supportsClickMethodAreas() const override { | ||
324 | bool isScrollOnButtonDown() const { | | |||
325 | return m_isScrollOnButtonDown.val; | | |||
326 | } | | |||
327 | void setScrollOnButtonDown(bool set) { | | |||
328 | m_isScrollOnButtonDown.set(set); | | |||
329 | } | | |||
330 | | ||||
331 | quint32 defaultScrollButton() const { | | |||
332 | return m_defaultScrollButton.val; | | |||
333 | } | | |||
334 | quint32 scrollButton() const { | | |||
335 | return m_scrollButton.val; | | |||
336 | } | | |||
337 | void setScrollButton(quint32 button) { | | |||
338 | m_scrollButton.set(button); | | |||
339 | } | | |||
340 | | ||||
341 | bool supportsClickMethodAreas() const { | | |||
342 | return m_supportsClickMethodAreas.val; | 109 | return m_supportsClickMethodAreas.val; | ||
343 | } | 110 | } | ||
344 | bool defaultClickMethodAreas() const { | 111 | bool supportsClickMethodClickfinger() const override { | ||
345 | return m_defaultClickMethodAreas.val; | | |||
346 | } | | |||
347 | bool isClickMethodAreas() const { | | |||
348 | return m_clickMethodAreas.val; | | |||
349 | } | | |||
350 | void setClickMethodAreas(bool set) { | | |||
351 | m_clickMethodAreas.set(set); | | |||
352 | } | | |||
353 | | ||||
354 | bool supportsClickMethodClickfinger() const { | | |||
355 | return m_supportsClickMethodClickfinger.val; | 112 | return m_supportsClickMethodClickfinger.val; | ||
356 | } | 113 | } | ||
357 | bool defaultClickMethodClickfinger() const { | | |||
358 | return m_defaultClickMethodClickfinger.val; | | |||
359 | } | | |||
360 | bool isClickMethodClickfinger() const { | | |||
361 | return m_clickMethodClickfinger.val; | | |||
362 | } | | |||
363 | void setClickMethodClickfinger(bool set) { | | |||
364 | m_clickMethodClickfinger.set(set); | | |||
365 | } | | |||
366 | | ||||
367 | Q_SIGNALS: | | |||
368 | void leftHandedChanged(); | | |||
369 | void pointerAccelerationChanged(); | | |||
370 | void pointerAccelerationProfileChanged(); | | |||
371 | void enabledChanged(); | | |||
372 | void tapToClickChanged(); | | |||
373 | void tapAndDragChanged(); | | |||
374 | void tapDragLockChanged(); | | |||
375 | void lmrTapButtonMapChanged(); | | |||
376 | void disableWhileTypingChanged(); | | |||
377 | void middleEmulationChanged(); | | |||
378 | void naturalScrollChanged(); | | |||
379 | void scrollMethodChanged(); | | |||
380 | void scrollButtonChanged(); | | |||
381 | void clickMethodChanged(); | | |||
382 | 114 | | |||
383 | private: | 115 | private: | ||
384 | template <typename T> | | |||
385 | struct Prop { | | |||
386 | explicit Prop(const QByteArray &dbusName) | | |||
387 | : dbus(dbusName) | | |||
388 | {} | | |||
389 | | ||||
390 | void set(T newVal) { | | |||
391 | if (avail && val != newVal) { | | |||
392 | val = newVal; | | |||
393 | } | | |||
394 | } | | |||
395 | void set(const Prop<T> &p) { | | |||
396 | if (avail && val != p.val) { | | |||
397 | val = p.val; | | |||
398 | } | | |||
399 | } | | |||
400 | bool changed() const { | | |||
401 | return avail && (old != val); | | |||
402 | } | | |||
403 | | ||||
404 | QByteArray dbus; | | |||
405 | bool avail; | | |||
406 | T old; | | |||
407 | T val; | | |||
408 | }; | | |||
409 | 116 | | |||
410 | template<typename T> | 117 | template<typename T> | ||
411 | bool valueLoader(Prop<T> &prop); | 118 | bool valueLoader(Prop<T> &prop); | ||
412 | 119 | | |||
413 | template<typename T> | 120 | template<typename T> | ||
414 | QString valueWriter(const Prop<T> &prop); | 121 | QString valueWriter(const Prop<T> &prop); | ||
415 | | ||||
416 | // | 122 | // | ||
417 | // general | 123 | // general | ||
418 | Prop<QString> m_name = Prop<QString>("name"); | 124 | Prop<QString> m_name = Prop<QString>("name"); | ||
419 | Prop<QString> m_sysName = Prop<QString>("sysName"); | 125 | Prop<QString> m_sysName = Prop<QString>("sysName"); | ||
420 | Prop<bool> m_supportsDisableEvents = Prop<bool>("supportsDisableEvents"); | | |||
421 | Prop<bool> m_enabled = Prop<bool>("enabled"); | | |||
422 | 126 | | |||
423 | // | 127 | // | ||
424 | // advanced | 128 | // advanced | ||
425 | Prop<Qt::MouseButtons> m_supportedButtons = Prop<Qt::MouseButtons>("supportedButtons"); | | |||
426 | | ||||
427 | Prop<bool> m_supportsLeftHanded = Prop<bool>("supportsLeftHanded"); | 129 | Prop<bool> m_supportsLeftHanded = Prop<bool>("supportsLeftHanded"); | ||
428 | Prop<bool> m_leftHandedEnabledByDefault = Prop<bool>("leftHandedEnabledByDefault"); | | |||
429 | Prop<bool> m_leftHanded = Prop<bool>("leftHanded"); | | |||
430 | | ||||
431 | Prop<bool> m_supportsDisableEventsOnExternalMouse = Prop<bool>("supportsDisableEventsOnExternalMouse"); | | |||
432 | | ||||
433 | Prop<bool> m_supportsDisableWhileTyping = Prop<bool>("supportsDisableWhileTyping"); | 130 | Prop<bool> m_supportsDisableWhileTyping = Prop<bool>("supportsDisableWhileTyping"); | ||
434 | Prop<bool> m_disableWhileTypingEnabledByDefault = Prop<bool>("disableWhileTypingEnabledByDefault"); | | |||
435 | Prop<bool> m_disableWhileTyping = Prop<bool>("disableWhileTyping"); | | |||
436 | | ||||
437 | Prop<bool> m_supportsMiddleEmulation = Prop<bool>("supportsMiddleEmulation"); | 131 | Prop<bool> m_supportsMiddleEmulation = Prop<bool>("supportsMiddleEmulation"); | ||
438 | Prop<bool> m_middleEmulationEnabledByDefault = Prop<bool>("middleEmulationEnabledByDefault"); | | |||
439 | Prop<bool> m_middleEmulation = Prop<bool>("middleEmulation"); | | |||
440 | 132 | | |||
441 | // | 133 | // | ||
442 | // acceleration speed and profile | 134 | // acceleration speed and profile | ||
443 | Prop<bool> m_supportsPointerAcceleration = Prop<bool>("supportsPointerAcceleration"); | 135 | Prop<bool> m_supportsPointerAcceleration = Prop<bool>("supportsPointerAcceleration"); | ||
444 | Prop<qreal> m_defaultPointerAcceleration = Prop<qreal>("defaultPointerAcceleration"); | | |||
445 | Prop<qreal> m_pointerAcceleration = Prop<qreal>("pointerAcceleration"); | | |||
446 | | ||||
447 | Prop<bool> m_supportsPointerAccelerationProfileFlat = Prop<bool>("supportsPointerAccelerationProfileFlat"); | | |||
448 | Prop<bool> m_defaultPointerAccelerationProfileFlat = Prop<bool>("defaultPointerAccelerationProfileFlat"); | | |||
449 | Prop<bool> m_pointerAccelerationProfileFlat = Prop<bool>("pointerAccelerationProfileFlat"); | | |||
450 | | ||||
451 | Prop<bool> m_supportsPointerAccelerationProfileAdaptive = Prop<bool>("supportsPointerAccelerationProfileAdaptive"); | | |||
452 | Prop<bool> m_defaultPointerAccelerationProfileAdaptive = Prop<bool>("defaultPointerAccelerationProfileAdaptive"); | | |||
453 | Prop<bool> m_pointerAccelerationProfileAdaptive = Prop<bool>("pointerAccelerationProfileAdaptive"); | | |||
454 | | ||||
455 | // | | |||
456 | // tapping | | |||
457 | Prop<int> m_tapFingerCount = Prop<int>("tapFingerCount"); | | |||
458 | Prop<bool> m_tapToClickEnabledByDefault = Prop<bool>("tapToClickEnabledByDefault"); | | |||
459 | Prop<bool> m_tapToClick = Prop<bool>("tapToClick"); | | |||
460 | | ||||
461 | Prop<bool> m_lmrTapButtonMapEnabledByDefault = Prop<bool>("lmrTapButtonMapEnabledByDefault"); | | |||
462 | Prop<bool> m_lmrTapButtonMap = Prop<bool>("lmrTapButtonMap"); | | |||
463 | | ||||
464 | Prop<bool> m_tapAndDragEnabledByDefault = Prop<bool>("tapAndDragEnabledByDefault"); | | |||
465 | Prop<bool> m_tapAndDrag = Prop<bool>("tapAndDrag"); | | |||
466 | Prop<bool> m_tapDragLockEnabledByDefault = Prop<bool>("tapDragLockEnabledByDefault"); | | |||
467 | Prop<bool> m_tapDragLock = Prop<bool>("tapDragLock"); | | |||
468 | 136 | | |||
469 | // | 137 | // | ||
470 | // scrolling | 138 | // scrolling | ||
471 | Prop<bool> m_supportsNaturalScroll = Prop<bool>("supportsNaturalScroll"); | 139 | Prop<bool> m_supportsNaturalScroll = Prop<bool>("supportsNaturalScroll"); | ||
472 | Prop<bool> m_naturalScrollEnabledByDefault = Prop<bool>("naturalScrollEnabledByDefault"); | | |||
473 | Prop<bool> m_naturalScroll = Prop<bool>("naturalScroll"); | | |||
474 | | ||||
475 | Prop<bool> m_supportsScrollTwoFinger = Prop<bool>("supportsScrollTwoFinger"); | | |||
476 | Prop<bool> m_scrollTwoFingerEnabledByDefault = Prop<bool>("scrollTwoFingerEnabledByDefault"); | | |||
477 | Prop<bool> m_isScrollTwoFinger = Prop<bool>("scrollTwoFinger"); | | |||
478 | | ||||
479 | Prop<bool> m_supportsScrollEdge = Prop<bool>("supportsScrollEdge"); | | |||
480 | Prop<bool> m_scrollEdgeEnabledByDefault = Prop<bool>("scrollEdgeEnabledByDefault"); | | |||
481 | Prop<bool> m_isScrollEdge = Prop<bool>("scrollEdge"); | | |||
482 | | ||||
483 | Prop<bool> m_supportsScrollOnButtonDown = Prop<bool>("supportsScrollOnButtonDown"); | | |||
484 | Prop<bool> m_scrollOnButtonDownEnabledByDefault = Prop<bool>("scrollOnButtonDownEnabledByDefault"); | | |||
485 | Prop<bool> m_isScrollOnButtonDown = Prop<bool>("scrollOnButtonDown"); | | |||
486 | | ||||
487 | Prop<quint32> m_defaultScrollButton = Prop<quint32>("defaultScrollButton"); | | |||
488 | Prop<quint32> m_scrollButton = Prop<quint32>("scrollButton"); | | |||
489 | | ||||
490 | Prop<bool> m_supportsClickMethodAreas = Prop<bool>("supportsClickMethodAreas"); | | |||
491 | Prop<bool> m_defaultClickMethodAreas = Prop<bool>("defaultClickMethodAreas"); | | |||
492 | Prop<bool> m_clickMethodAreas = Prop<bool>("clickMethodAreas"); | | |||
493 | | ||||
494 | Prop<bool> m_supportsClickMethodClickfinger = Prop<bool>("supportsClickMethodClickfinger"); | | |||
495 | Prop<bool> m_defaultClickMethodClickfinger = Prop<bool>("defaultClickMethodClickfinger"); | | |||
496 | Prop<bool> m_clickMethodClickfinger = Prop<bool>("clickMethodClickfinger"); | | |||
497 | | ||||
498 | 140 | | |||
499 | QDBusInterface *m_iface; | 141 | QDBusInterface *m_iface; | ||
500 | }; | 142 | }; | ||
501 | 143 | | |||
502 | #endif | 144 | #endif |