- reenable lcd support
[enigma2.git] / lib / gdi / glcddc.cpp
1 #include <lib/gdi/glcddc.h>
2 #include <lib/gdi/lcd.h>
3 #include <lib/base/init.h>
4 #include <lib/base/init_num.h>
5
6 gLCDDC *gLCDDC::instance;
7
8 gLCDDC::gLCDDC()
9 {
10         lcd = new eDBoxLCD();
11         instance=this;
12         
13         update=1;
14
15         surface.x=lcd->size().width();
16         surface.y=lcd->size().height();
17         surface.bpp=8;
18         surface.bypp=1;
19         surface.stride=lcd->stride();
20         surface.data=lcd->buffer();
21
22         surface.clut.colors=256;
23         surface.clut.data=0;
24         m_pixmap = new gPixmap(&surface);
25 }
26
27 gLCDDC::~gLCDDC()
28 {
29         delete lcd;
30         instance=0;
31 }
32
33 void gLCDDC::exec(gOpcode *o)
34 {
35         eDebug("gLCDDC exec!!! %d", o->opcode);
36         switch (o->opcode)
37         {
38         case gOpcode::flush:
39                 eDebug("END! WRITE!");
40 //              if (update)
41                         lcd->update();
42         default:
43                 gDC::exec(o);
44                 break;
45         }
46 }
47
48 void gLCDDC::setUpdate(int u)
49 {
50         update=u;
51 }
52
53 eAutoInitPtr<gLCDDC> init_gLCDDC(eAutoInitNumbers::graphic-1, "gLCDDC");