- fix av switch
[enigma2.git] / lib / gdi / lcd.h
1 #ifndef DISABLE_LCD
2
3 #ifndef __lcd_h
4 #define __lcd_h
5
6 #include <asm/types.h>
7 #include <lib/gdi/esize.h>
8 #include <lib/gdi/erect.h>
9
10 #define LCD_CONTRAST_MIN 0
11 #define LCD_CONTRAST_MAX 63
12 #define LCD_BRIGHTNESS_MIN 0
13 #define LCD_BRIGHTNESS_MAX 255
14
15 class eLCD
16 {
17 protected:
18         eSize res;
19         unsigned char *_buffer;
20         int lcdfd;
21         int _stride;
22         int locked;
23 public:
24         int lock();
25         void unlock();
26         int islocked() { return locked; }
27
28         eLCD(eSize size);
29         virtual ~eLCD();
30
31         __u8 *buffer() { return (__u8*)_buffer; }
32         int stride() { return _stride; }
33         eSize size() { return res; }
34         
35         virtual void update()=0;
36 };
37
38 class eDBoxLCD: public eLCD
39 {
40         static eDBoxLCD *instance;
41         unsigned char inverted;
42 public:
43         static eDBoxLCD *getInstance();
44         int switchLCD(int state);
45         int setLCDParameter(int brightness, int contrast);
46         void setInverted( unsigned char );
47         eDBoxLCD();
48         ~eDBoxLCD();
49         void update();
50 };
51
52 #endif
53
54 #endif //DISABLE_LCD