X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/6a88cbc2bfa43b2a18eb896b3d635622da7e9d0a..2b1a35585e9edead2200e4e4868d549c3b1e8106:/lib/driver/rc.h?ds=sidebyside diff --git a/lib/driver/rc.h b/lib/driver/rc.h index 1ce13c72..9708ea7b 100644 --- a/lib/driver/rc.h +++ b/lib/driver/rc.h @@ -12,6 +12,8 @@ class eRCInput; class eRCDriver; class eRCKey; +#ifndef SWIG + /** * \brief A remote control. * @@ -39,7 +41,7 @@ public: * For Example, it might be 16bit codes with one bit make/break or special codes * for repeat. */ - virtual void handleCode(int code)=0; + virtual void handleCode(long code)=0; /** * \brief Get user readable description. * \result The description. @@ -93,7 +95,7 @@ class eRCShortDriver: public eRCDriver { protected: int handle; - eSocketNotifier *sn; + ePtr sn; void keyPressed(int); public: eRCShortDriver(const char *filename); @@ -104,7 +106,7 @@ class eRCInputEventDriver: public eRCDriver { protected: int handle; - eSocketNotifier *sn; + ePtr sn; void keyPressed(int); public: std::string getDeviceName(); @@ -124,10 +126,15 @@ public: } enum { + /* there are not really flags.. */ + flagMake=0, flagBreak=1, - flagRepeat=2 + flagRepeat=2, + flagLong=3, + /* but this is. */ + flagAscii=4, }; - + bool operator<(const eRCKey &r) const { if (r.producer == producer) @@ -161,13 +168,19 @@ public: rrate; // repeat rate (in ms) }; +#endif + class eRCInput: public Object { int locked; int handle; static eRCInput *instance; int keyboardMode; - +#ifdef SWIG + eRCInput(); + ~eRCInput(); +public: +#else public: struct lstr { @@ -182,10 +195,7 @@ public: Signal1 keyEvent; eRCInput(); ~eRCInput(); - - int lock(); - void unlock(); - int islocked() { return locked; } + void close(); bool open(); @@ -210,10 +220,6 @@ public: lock the console and pass this as the console fd for making the tc* stuff working. */ - - enum { kmNone, kmAscii, kmAll }; - void setKeyboardMode(int mode) { keyboardMode = mode; } - int getKeyboardMode() { return keyboardMode; } void keyPressed(const eRCKey &key) { @@ -224,10 +230,16 @@ public: void removeDevice(const std::string &id); eRCDevice *getDevice(const std::string &id); std::map &getDevices(); - - static eRCInput *getInstance() { return instance; } - + eRCConfig config; +#endif + enum { kmNone, kmAscii, kmAll }; + void setKeyboardMode(int mode) { keyboardMode = mode; } + int getKeyboardMode() { return keyboardMode; } + static eRCInput *getInstance() { return instance; } + int lock(); + void unlock(); + int islocked() { return locked; } }; #endif