Merge branch 'bug_539_add_multicontent_pixmap_progress'
[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();
17         ~eLCD();
18 #else
19 protected:
20         void setSize(int xres, int yres, int bpp);
21         eSize res;
22         unsigned char *_buffer;
23         int lcdfd;
24         int _stride;
25         int locked;
26 #endif
27 public:
28         int lock();
29         void unlock();
30         int islocked() { return locked; }
31         bool detected() { return lcdfd >= 0; }
32 #ifndef SWIG
33         eLCD();
34         virtual ~eLCD();
35         __u8 *buffer() { return (__u8*)_buffer; }
36         int stride() { return _stride; }
37         eSize size() { return res; }
38         virtual void update()=0;
39 #endif
40 };
41
42 class eDBoxLCD: public eLCD
43 {
44         static eDBoxLCD *instance;
45         unsigned char inverted;
46         int is_oled;
47 #ifdef SWIG
48         eDBoxLCD();
49         ~eDBoxLCD();
50 #endif
51 public:
52 #ifndef SWIG
53         eDBoxLCD();
54         ~eDBoxLCD();
55 #endif
56         static eDBoxLCD *getInstance();
57         int setLCDContrast(int contrast);
58         int setLCDBrightness(int brightness);
59         void setInverted( unsigned char );
60         bool isOled() const { return !!is_oled; }
61         void update();
62 };
63
64 #endif