start on device list, don't crash when list is empty
[enigma2.git] / lib / driver / rc.h
index 1ce13c7241da2199c7f8f643fa10af2e637f49b7..6653189af475dc9541a736c1f1b1901562cc3cae 100644 (file)
@@ -12,6 +12,8 @@ class eRCInput;
 class eRCDriver;
 class eRCKey;
 
+#ifndef SWIG
+
 /**
  * \brief A remote control.
  *
@@ -125,7 +127,8 @@ public:
        enum
        {
                flagBreak=1,
-               flagRepeat=2
+               flagRepeat=2,
+               flagAscii=4
        };
        
        bool operator<(const eRCKey &r) const
@@ -161,13 +164,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 +191,7 @@ public:
        Signal1<void, const eRCKey&> keyEvent;
        eRCInput();
        ~eRCInput();
-       
-       int lock();
-       void unlock();
-       int islocked() { return locked; }
+
        void close();
        bool open();
 
@@ -210,10 +216,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 +226,16 @@ public:
        void removeDevice(const std::string &id);
        eRCDevice *getDevice(const std::string &id);
        std::map<std::string,eRCDevice*,lstr> &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