summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehw/tdeeventdevice.h
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2014-05-16 03:08:00 +0200
committerSlávek Banko <slavek.banko@axis.cz>2014-05-16 03:08:00 +0200
commit2c730f70a604b72adbeece6a01af11affd025a5e (patch)
treee7011019258cfb7d328ba43dbaa17901f968863f /tdecore/tdehw/tdeeventdevice.h
parent0290dbaf6c3a1b5a82e38ffba2c4fd5272511642 (diff)
downloadtdelibs-2c730f70a604b72adbeece6a01af11affd025a5e.tar.gz
tdelibs-2c730f70a604b72adbeece6a01af11affd025a5e.zip
Optimize watching switches on input event devices
This relates to Bugs 1992 and 2052
Diffstat (limited to 'tdecore/tdehw/tdeeventdevice.h')
-rw-r--r--tdecore/tdehw/tdeeventdevice.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/tdecore/tdehw/tdeeventdevice.h b/tdecore/tdehw/tdeeventdevice.h
index e2a03b10f..64130508c 100644
--- a/tdecore/tdehw/tdeeventdevice.h
+++ b/tdecore/tdehw/tdeeventdevice.h
@@ -122,12 +122,22 @@ class TDECORE_EXPORT TDEEventDevice : public TDEGenericDevice
void internalSetEventType(TDEEventDeviceType::TDEEventDeviceType et);
/**
+ * @internal
+ */
+ void internalReadProvidedSwitches();
+
+ /**
* @param sl a TDESwitchType::TDESwitchType with all switches provided by this device
* @internal
*/
void internalSetProvidedSwitches(TDESwitchType::TDESwitchType sl);
/**
+ * @internal
+ */
+ void internalReadActiveSwitches();
+
+ /**
* @param sl a TDESwitchType::TDESwitchType with all active switches provided by this device
* @internal
*/
@@ -137,10 +147,12 @@ class TDECORE_EXPORT TDEEventDevice : public TDEGenericDevice
* @param hwmanager the master hardware manager
* @internal
*/
- void internalStartFdMonitoring(TDEHardwareDevices* hwmanager);
+ void internalStartMonitoring(TDEHardwareDevices* hwmanager);
protected slots:
void eventReceived();
+ void processActiveSwitches();
+ virtual void connectNotify( const char* signal );
signals:
/**
@@ -150,13 +162,16 @@ class TDECORE_EXPORT TDEEventDevice : public TDEGenericDevice
*/
void keyPressed(unsigned int keycode, TDEEventDevice* device);
+ void switchChanged();
+
private:
TDEEventDeviceType::TDEEventDeviceType m_eventType;
TDESwitchType::TDESwitchType m_providedSwitches;
TDESwitchType::TDESwitchType m_switchActive;
int m_fd;
- bool m_fdMonitorActive;
+ bool m_monitorActive;
+ TQTimer* m_watchTimer;
TQSocketNotifier* m_eventNotifier;
friend class TDEHardwareDevices;