[browser] fixed menu skin to set the size automatically.
[vuplus_dvbapp] / lib / driver / rcconsole.h
1 #ifndef __lib_driver_rcconsole_h
2 #define __lib_driver_rcconsole_h
3
4 #include <termios.h>
5 #include <lib/driver/rc.h>
6
7 class eRCConsoleDriver: public eRCDriver
8 {
9         struct termios ot;
10 protected:
11         int handle;
12         ePtr<eSocketNotifier> sn;
13         bool m_escape;
14         void keyPressed(int);
15 public:
16         eRCConsoleDriver(const char *filename);
17         ~eRCConsoleDriver();
18         void flushBuffer() const
19         {
20                 char data[16];
21                 if (handle != -1)
22                         while ( ::read(handle, data, 16) == 16 );
23         }
24         void lock() const
25         {
26                 if ( sn )
27                         sn->stop();
28         }
29         void unlock() const
30         {
31                 if ( sn )
32                         sn->start();
33         }
34 };
35
36 class eRCConsole: public eRCDevice
37 {
38 public:
39         void handleCode(long code);
40         eRCConsole(eRCDriver *driver);
41         const char *getDescription() const;
42         const char *getKeyDescription(const eRCKey &key) const;
43         int getKeyCompatibleCode(const eRCKey &key) const;
44 };
45
46 #endif