From c6e0fe646e78a6aff588277445fde9752f886a71 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 6 Dec 2016 14:34:27 -0500 Subject: Get the new input device routines almost ready. Still have the page disabled in lumina-config right now, but it is coming along nicely. --- src-qt5/core/libLumina/LInputDevice.h | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'src-qt5/core/libLumina/LInputDevice.h') diff --git a/src-qt5/core/libLumina/LInputDevice.h b/src-qt5/core/libLumina/LInputDevice.h index f7a4713c..82dee4fd 100644 --- a/src-qt5/core/libLumina/LInputDevice.h +++ b/src-qt5/core/libLumina/LInputDevice.h @@ -18,6 +18,14 @@ #include +//Internal data structure for storing the property information +struct propData{ + int id; + QString name; + QVariant value; + xcb_atom_t atom; +}; + class LInputDevice{ public: LInputDevice(unsigned int id, unsigned int type); //don't use this directly - use the "listDevices()" function instead @@ -31,16 +39,22 @@ public: bool isExtension(); //Property Management - QStringList listProperties(); - QVariant propertyValue(QString prop); + QList listProperties(); + QString propertyName(int prop); + QVariant getPropertyValue(int prop); + bool setPropertyValue(int prop, QVariant value); private: - unsigned int devID; //device ID number - assigned at class creation - unsigned int devType; //device "use" identifier - assigned at class creation - QHash devProps; //Known device properties + unsigned int devID; //device ID number - assigned at class creation + unsigned int devType; //device "use" identifier - assigned at class creation + QHash devProps; //Known device properties + + void getProperties(); + void readProperties(); + QVariant valueToVariant(QString value); //xinput output to QVariant + QString variantToString(QVariant value); //QVariant to xinput input string - void getProperties(); - //QString devName; //device name - use this for cross-session management (id #'s can get changed every session) + //QString devName; //device name - use this for cross-session management (id #'s can get changed every session) }; //Static functions for overall management -- cgit