don't crash when no left/right border pixmap defined
[enigma2.git] / lib / gdi / lcd.h
1 #ifndef __lcd_h
2 #define __lcd_h
3
4 #include <asm/types.h>
5 #include <lib/gdi/esize.h>
6 #include <lib/gdi/erect.h>
7
8 #define LCD_CONTRAST_MIN 0
9 #define LCD_CONTRAST_MAX 63
10 #define LCD_BRIGHTNESS_MIN 0
11 #define LCD_BRIGHTNESS_MAX 255
12
13 class eLCD
14 {
15 #ifdef SWIG
16         eLCD(eSize size);
17         ~eLCD();
18 #else
19 protected:
20         eSize res;
21         unsigned char *_buffer;
22         int lcdfd;
23         int _stride;
24         int locked;
25 #endif
26 public:
27         int lock();
28         void unlock();
29         int islocked() { return locked; }
30 #ifndef SWIG
31         eLCD(eSize size);
32         virtual ~eLCD();
33         __u8 *buffer() { return (__u8*)_buffer; }
34         int stride() { return _stride; }
35         eSize size() { return res; }
36         
37         virtual void update()=0;
38 #endif
39 };
40
41 class eDBoxLCD: public eLCD
42 {
43         static eDBoxLCD *instance;
44         unsigned char inverted;
45 #ifdef SWIG
46         eDBoxLCD();
47         ~eDBoxLCD();
48 #endif
49 public:
50 #ifndef SWIG
51         eDBoxLCD();
52         ~eDBoxLCD();
53 #endif
54         static eDBoxLCD *getInstance();
55         int eDBoxLCD::setLCDContrast(int contrast);
56         int eDBoxLCD::setLCDBrightness(int brightness);
57         void setInverted( unsigned char );
58         void update();
59 };
60
61 #endif