Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpad/src/backends/x11/xlibtouchpad.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 XLIBTOUCHPAD_H | 19 | #ifndef XLIBTOUCHPAD_H | ||
20 | #define XLIBTOUCHPAD_H | 20 | #define XLIBTOUCHPAD_H | ||
21 | 21 | | |||
22 | #include <QObject> | ||||
22 | #include <QVariantHash> | 23 | #include <QVariantHash> | ||
23 | #include <QSet> | 24 | #include <QSet> | ||
24 | 25 | | |||
25 | #include <xcb/xcb.h> | 26 | #include <xcb/xcb.h> | ||
26 | #include "xcbatom.h" | 27 | #include "xcbatom.h" | ||
27 | #include "propertyinfo.h" | 28 | #include "propertyinfo.h" | ||
28 | 29 | | |||
29 | enum ParaType { | 30 | enum ParaType { | ||
30 | PT_INT, | 31 | PT_INT, | ||
31 | PT_BOOL, | 32 | PT_BOOL, | ||
32 | PT_DOUBLE | 33 | PT_DOUBLE | ||
33 | }; | 34 | }; | ||
34 | 35 | | |||
35 | struct Parameter { | 36 | struct Parameter { | ||
36 | const char *name; /* Name of parameter */ | 37 | const char *name; /* Name of parameter */ | ||
37 | enum ParaType type; /* Type of parameter */ | 38 | enum ParaType type; /* Type of parameter */ | ||
38 | double min_val; /* Minimum allowed value */ | 39 | double min_val; /* Minimum allowed value */ | ||
39 | double max_val; /* Maximum allowed value */ | 40 | double max_val; /* Maximum allowed value */ | ||
40 | const char *prop_name; /* Property name */ | 41 | const char *prop_name; /* Property name */ | ||
41 | int prop_format; /* Property format (0 for floats) */ | 42 | int prop_format; /* Property format (0 for floats) */ | ||
42 | unsigned prop_offset; /* Offset inside property */ | 43 | unsigned prop_offset; /* Offset inside property */ | ||
43 | }; | 44 | }; | ||
44 | 45 | | |||
45 | class XlibTouchpad | 46 | class XlibTouchpad : public QObject | ||
46 | { | 47 | { | ||
48 | Q_OBJECT | ||||
romangg: Necessary? | |||||
49 | | ||||
47 | public: | 50 | public: | ||
48 | XlibTouchpad(Display *display, int deviceId); | 51 | XlibTouchpad(QObject *parent, Display *display, int deviceId); | ||
49 | virtual ~XlibTouchpad() {}; | 52 | virtual ~XlibTouchpad() {}; | ||
50 | 53 | | |||
51 | int deviceId() { return m_deviceId; } | 54 | int deviceId() { return m_deviceId; } | ||
52 | const QStringList &supportedParameters() const { return m_supported; } | 55 | const QStringList &supportedParameters() const { return m_supported; } | ||
53 | bool applyConfig(const QVariantHash &p); | 56 | bool applyConfig(const QVariantHash &p); | ||
54 | bool getConfig(QVariantHash &p); | 57 | bool getConfig(QVariantHash &p); | ||
58 | virtual bool getConfig() { return false; } | ||||
59 | virtual bool applyConfig() { return false; } | ||||
60 | virtual bool getDefaultConfig() { return false; } | ||||
61 | virtual bool isChangedConfig() { return false; } | ||||
55 | void setEnabled(bool enable); | 62 | void setEnabled(bool enable); | ||
56 | bool enabled(); | 63 | bool enabled(); | ||
57 | void setTouchpadOff(int touchpadOff); | 64 | void setTouchpadOff(int touchpadOff); | ||
58 | int touchpadOff(); | 65 | int touchpadOff(); | ||
59 | 66 | | |||
60 | XcbAtom &touchpadOffAtom(); | 67 | XcbAtom &touchpadOffAtom(); | ||
61 | 68 | | |||
62 | protected: | 69 | protected: | ||
Show All 24 Lines |
Necessary?