i think runLoop is better :)
[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         switch (o->opcode)
36         {
37         case gOpcode::flush:
38 //              if (update)
39                         lcd->update();
40         default:
41                 gDC::exec(o);
42                 break;
43         }
44 }
45
46 void gLCDDC::setUpdate(int u)
47 {
48         update=u;
49 }
50
51 eAutoInitPtr<gLCDDC> init_gLCDDC(eAutoInitNumbers::graphic-1, "gLCDDC");