openATV enigma2
openATV is an open source SetTopBox Graphical user interface.
lcd.h
Go to the documentation of this file.
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 #include "gpixmap.h"
8 
9 #define LCD_CONTRAST_MIN 0
10 #define LCD_CONTRAST_MAX 63
11 #define LCD_BRIGHTNESS_MIN 0
12 #define LCD_BRIGHTNESS_MAX 255
13 
15 
16 #define LED_IOCTL_BRIGHTNESS_NORMAL 0X10
17 #define LED_IOCTL_BRIGHTNESS_DEEPSTANDBY 0X11
18 #define LED_IOCTL_BLINKING_TIME 0X12
19 #define LED_IOCTL_SET_DEFAULT 0x13
20 
21 class eLCD
22 {
23 #ifdef SWIG
24  eLCD();
25  ~eLCD();
26 #else
27 protected:
29  int lcd_type;
30  unsigned char *_buffer;
31  int lcdfd;
32  int _stride;
33  int locked;
34  static eLCD *instance;
35  void setSize(int xres, int yres, int bpp);
36  char boxtype_name[20];
37 #endif
38 public:
39  static eLCD *getInstance();
40  virtual int lock();
41  virtual void unlock();
42  virtual int islocked() { return locked; };
43  virtual bool detected() { return lcdfd >= 0; };
44  virtual int setLCDContrast(int contrast)=0;
45  virtual int setLCDBrightness(int brightness)=0;
46  virtual int setLED(int value, int option)=0;
47  virtual void setInverted( unsigned char )=0;
48  virtual void setFlipped(bool)=0;
49  virtual void setDump(bool)=0;
50  virtual int waitVSync()=0;
51  virtual bool isOled() const=0;
52  int getLcdType() { return lcd_type; };
53  virtual void setPalette(gUnmanagedSurface)=0;
54 #ifndef SWIG
55  eLCD();
56  virtual ~eLCD();
57  uint8_t *buffer() { return (uint8_t*)_buffer; };
58  int stride() { return _stride; };
59  virtual eSize size() { return res; };
60  virtual void update()=0;
61 #if defined(HAVE_TEXTLCD) || defined(HAVE_7SEGMENT)
62  virtual void renderText(ePoint start, const char *text);
63 #endif
64 #endif
65 };
66 
67 class eDBoxLCD: public eLCD
68 {
69  unsigned char inverted;
70  bool flipped;
71  bool dump;
72 #ifdef SWIG
73  eDBoxLCD();
74  ~eDBoxLCD();
75 #endif
76 public:
77 #ifndef SWIG
78  eDBoxLCD();
79  ~eDBoxLCD();
80 #endif
81  int setLCDContrast(int contrast);
82  int setLCDBrightness(int brightness);
83  int setLED(int value, int option);
84  void setInverted( unsigned char );
85  void setFlipped(bool);
86  void setDump(bool);
87  bool isOled() const { return !!lcd_type; };
89  void update();
90  int waitVSync() { return 0; };
91  void dumpLCD2PNG(void);
92 };
93 
94 #endif
Definition: lcd.h:68
int waitVSync()
Definition: lcd.h:90
~eDBoxLCD()
Definition: lcd.cpp:296
int setLCDBrightness(int brightness)
Definition: lcd.cpp:238
void setFlipped(bool)
Definition: lcd.cpp:199
void setInverted(unsigned char)
Definition: lcd.cpp:193
int setLED(int value, int option)
Definition: lcd.cpp:273
int setLCDContrast(int contrast)
Definition: lcd.cpp:211
void setPalette(gUnmanagedSurface)
Definition: lcd.h:88
void setDump(bool)
Definition: lcd.cpp:205
eDBoxLCD()
Definition: lcd.cpp:80
void update()
Definition: lcd.cpp:390
bool isOled() const
Definition: lcd.h:87
void dumpLCD2PNG(void)
Definition: lcd.cpp:305
Definition: lcd.h:22
int stride()
Definition: lcd.h:58
char boxtype_name[20]
Definition: lcd.h:36
int lcd_type
Definition: lcd.h:29
uint8_t * buffer()
Definition: lcd.h:57
virtual eSize size()
Definition: lcd.h:59
virtual bool detected()
Definition: lcd.h:43
void setSize(int xres, int yres, int bpp)
Definition: lcd.cpp:33
eLCD()
Definition: lcd.cpp:20
virtual void setPalette(gUnmanagedSurface)=0
virtual void update()=0
virtual ~eLCD()
Definition: lcd.cpp:44
virtual void setInverted(unsigned char)=0
virtual int setLCDBrightness(int brightness)=0
virtual int setLCDContrast(int contrast)=0
virtual bool isOled() const =0
virtual void setFlipped(bool)=0
eSize res
Definition: lcd.h:28
virtual int setLED(int value, int option)=0
int getLcdType()
Definition: lcd.h:52
int lcdfd
Definition: lcd.h:31
static eLCD * instance
Definition: lcd.h:34
static eLCD * getInstance()
Definition: lcd.cpp:28
virtual void setDump(bool)=0
virtual void unlock()
Definition: lcd.cpp:60
virtual int islocked()
Definition: lcd.h:42
virtual int waitVSync()=0
unsigned char * _buffer
Definition: lcd.h:30
virtual int lock()
Definition: lcd.cpp:51
int locked
Definition: lcd.h:33
int _stride
Definition: lcd.h:32
Definition: epoint.h:9
Definition: esize.h:8
op
Definition: lcd.h:14
@ LED_BRIGHTNESS
Definition: lcd.h:14
@ LED_BLINKINGTIME
Definition: lcd.h:14
@ LED_DEEPSTANDBY
Definition: lcd.h:14
value
Definition: Profile.py:29
Definition: gpixmap.h:163