aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-09-01 00:29:38 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-09-01 00:29:38 +0000
commitb8e9b51fb1a75b1805cf3108ffdc22aff9f75cf2 (patch)
tree26659ac83b322549e2d842a2426f421c3da412e7 /lib
parent5ec9643747ed0dc24917ddac6310be0e49f74ce5 (diff)
downloadenigma2-b8e9b51fb1a75b1805cf3108ffdc22aff9f75cf2.tar.gz
enigma2-b8e9b51fb1a75b1805cf3108ffdc22aff9f75cf2.zip
- reenable lcd support
Diffstat (limited to 'lib')
-rw-r--r--lib/gdi/glcddc.cpp23
-rw-r--r--lib/gdi/glcddc.h9
-rw-r--r--lib/gdi/grc.cpp4
-rw-r--r--lib/gdi/lcd.cpp88
-rw-r--r--lib/gdi/lcd.h5
5 files changed, 23 insertions, 106 deletions
diff --git a/lib/gdi/glcddc.cpp b/lib/gdi/glcddc.cpp
index 1a5e03fa..75d256e2 100644
--- a/lib/gdi/glcddc.cpp
+++ b/lib/gdi/glcddc.cpp
@@ -1,11 +1,13 @@
-#ifndef DISABLE_LCD
-
#include <lib/gdi/glcddc.h>
+#include <lib/gdi/lcd.h>
+#include <lib/base/init.h>
+#include <lib/base/init_num.h>
gLCDDC *gLCDDC::instance;
-gLCDDC::gLCDDC(eLCD *lcd): lcd(lcd)
+gLCDDC::gLCDDC()
{
+ lcd = new eDBoxLCD();
instance=this;
update=1;
@@ -24,16 +26,18 @@ gLCDDC::gLCDDC(eLCD *lcd): lcd(lcd)
gLCDDC::~gLCDDC()
{
+ delete lcd;
instance=0;
}
void gLCDDC::exec(gOpcode *o)
{
+ eDebug("gLCDDC exec!!! %d", o->opcode);
switch (o->opcode)
{
-// case gOpcode::flush:
- case gOpcode::end:
- if (update)
+ case gOpcode::flush:
+ eDebug("END! WRITE!");
+// if (update)
lcd->update();
default:
gDC::exec(o);
@@ -41,14 +45,9 @@ void gLCDDC::exec(gOpcode *o)
}
}
-gLCDDC *gLCDDC::getInstance()
-{
- return instance;
-}
-
void gLCDDC::setUpdate(int u)
{
update=u;
}
-#endif //DISABLE_LCD
+eAutoInitPtr<gLCDDC> init_gLCDDC(eAutoInitNumbers::graphic-1, "gLCDDC");
diff --git a/lib/gdi/glcddc.h b/lib/gdi/glcddc.h
index d4cfab82..6d5f3834 100644
--- a/lib/gdi/glcddc.h
+++ b/lib/gdi/glcddc.h
@@ -1,5 +1,3 @@
-#ifndef DISABLE_LCD
-
#ifndef __glcddc_h
#define __glcddc_h
@@ -14,14 +12,11 @@ class gLCDDC: public gDC
void exec(gOpcode *opcode);
gSurface surface;
public:
- gLCDDC(eLCD *lcd);
+ gLCDDC();
~gLCDDC();
void setUpdate(int update);
- static gLCDDC *getInstance();
+ static int getInstance(ePtr<gLCDDC> &ptr) { if (!instance) return -1; ptr = instance; return 0; }
int islocked() { return lcd->islocked(); }
};
-
#endif
-
-#endif //DISABLE_LCD
diff --git a/lib/gdi/grc.cpp b/lib/gdi/grc.cpp
index 99fe0859..05aaa6ff 100644
--- a/lib/gdi/grc.cpp
+++ b/lib/gdi/grc.cpp
@@ -373,6 +373,10 @@ void gPainter::notify()
void gPainter::end()
{
+ gOpcode o;
+ o.opcode = gOpcode::flush;
+ o.dc = m_dc.grabRef();
+ m_rc->submit(o);
}
gDC::gDC()
diff --git a/lib/gdi/lcd.cpp b/lib/gdi/lcd.cpp
index 4de4df05..6b353230 100644
--- a/lib/gdi/lcd.cpp
+++ b/lib/gdi/lcd.cpp
@@ -1,6 +1,3 @@
-#if 0
-#ifndef DISABLE_LCD
-
#include <lib/gdi/lcd.h>
#include <unistd.h>
@@ -10,11 +7,10 @@
#include <dbox/fp.h>
#include <dbox/lcd-ks0713.h>
-#include <lib/base/esize.h>
-#include <lib/system/init.h>
-#include <lib/system/init_num.h>
+#include <lib/gdi/esize.h>
+#include <lib/base/init.h>
+#include <lib/base/init_num.h>
#include <lib/gdi/glcddc.h>
-#include <lib/system/econfig.h>
eDBoxLCD *eDBoxLCD::instance;
@@ -53,28 +49,6 @@ void eLCD::unlock()
locked=0;
}
-/* void eLCD::line(ePoint start, ePoint dst, int color)
-{
-int Ax=start.x(), // dieser code rult ganz ganz doll weil er ganz ganz fast ist und auch sehr gut dokumentiert is
-Ay=start.y(), Bx=dst.x(), // t. es handelt sich immerhin um den weltbekannten bresenham algorithmus der nicht nur
-By=dst.y(); int dX, dY, fbXincr, // sehr schnell ist sondern auch sehr gut dokumentiert und getestet wurde. nicht
-fbYincr, fbXYincr, dPr, dPru, P; __u8 // nur auf dem LCD der dbox, sondern auch ueberall anders. und auch auf der
-*AfbAddr = &buffer()[Ay*stride()+Ax]; __u8 // dbox mit LCD soll das teil nun tun, und ich denke das tut es. ausse
-*BfbAddr = &buffer()[By*stride()+Bx]; fbXincr= // rdem hat dieser algo den vorteil dass man fehler sehr leicht fi
-1; if ( (dX=Bx-Ax) >= 0) goto AFTERNEGX; dX=-dX; // ndet und beheben kann. das liegt nicht zuletzt an den komment
-fbXincr=-1; AFTERNEGX: fbYincr=stride(); if ( (dY=By // aren. und ausserdem, je kuerzer der code, desto weniger k
--Ay) >= 0) goto AFTERNEGY; fbYincr=-stride(); dY=-dY;AFTERNEGY: // ann daran falsch sein. erwaehnte ich schon, da
-fbXYincr = fbXincr+fbYincr; if (dY > dX) goto YisIndependent; dPr = dY+ // s dieser tolle code wahnsinnig schnell
-dY; P = -dX; dPru = P+P; dY = dX>>1; XLOOP: *AfbAddr=color; *BfbAddr=color; if ((P+=dPr) > 0) // ist? bye, tmbinc
-goto RightAndUp; AfbAddr+=fbXincr; BfbAddr-=fbXincr; if ((dY=dY-1) > 0) goto XLOOP; *AfbAddr=color; if ((dX & 1)
-== 0) return; *BfbAddr=color; return; RightAndUp: AfbAddr+=fbXYincr; BfbAddr-=fbXYincr; P+=dPru; if ((dY=dY-1) >
-0) goto XLOOP; *AfbAddr=color; if ((dX & 1) == 0) return; *BfbAddr=color; return; YisIndependent: dPr = dX+dX; P
-= -dY; dPru = P+P; dX = dY>>1; YLOOP: *AfbAddr=color; *BfbAddr=color; if ((P+=dPr) > 0) goto RightAndUp2; AfbAddr
-+=fbYincr; BfbAddr-=fbYincr; if ((dX=dX-1) > 0) goto YLOOP; *AfbAddr=color; if ((dY & 1) == 0) return; *BfbAddr=
-color;return; RightAndUp2: AfbAddr+=fbXYincr; BfbAddr-=fbXYincr; P+=dPru; if ((dX=dX-1) > 0) goto YLOOP; *AfbAddr
-=color; if((dY & 1) == 0) return; *BfbAddr=color; return; // nun ist der tolle code leider zu ende. tut mir leid.
-} */
-
eDBoxLCD::eDBoxLCD(): eLCD(eSize(128, 64))
{
#ifndef NO_LCD
@@ -92,25 +66,10 @@ eDBoxLCD::eDBoxLCD(): eLCD(eSize(128, 64))
ioctl(lcdfd, LCD_IOCTL_ASC_MODE, &i);
int lcdbrightness=0, lcdcontrast=0;
- if( eConfig::getInstance()->getKey("/ezap/lcd/brightness", lcdbrightness) )
- {
- lcdbrightness=130;
- eConfig::getInstance()->setKey("/ezap/lcd/brightness", lcdbrightness);
- }
- if( eConfig::getInstance()->getKey("/ezap/lcd/contrast", lcdcontrast) )
- {
- lcdcontrast=32;
- eConfig::getInstance()->setKey("/ezap/lcd/contrast", lcdcontrast);
- }
+ lcdbrightness=130;
+ lcdcontrast=32;
setLCDParameter(lcdbrightness, lcdcontrast);
- int tmp;
- if( eConfig::getInstance()->getKey("/ezap/lcd/inverted", tmp ) )
- {
- inverted=0;
- eConfig::getInstance()->setKey("/ezap/lcd/inverted", (int) 0 );
- }
- else
- inverted=(unsigned char)tmp;
+ inverted=0;
}
}
@@ -142,26 +101,6 @@ int eDBoxLCD::setLCDParameter(int brightness, int contrast)
return(0);
}
-int eDBoxLCD::switchLCD(int state)
-{
- int lcdbrightness, lcdcontrast, lcdstandby=0;
-
- eConfig::getInstance()->getKey("/ezap/lcd/contrast", lcdcontrast);
-
- if(state==0)
- {
- eConfig::getInstance()->getKey("/ezap/lcd/standby", lcdstandby);
- setLCDParameter(lcdstandby, lcdcontrast);
- }
- else
- {
- eConfig::getInstance()->getKey("/ezap/lcd/brightness", lcdbrightness);
- setLCDParameter(lcdbrightness, lcdcontrast);
-
- }
- return(0);
-}
-
eDBoxLCD::~eDBoxLCD()
{
if (lcdfd>0)
@@ -196,18 +135,3 @@ void eDBoxLCD::update()
write(lcdfd, raw, 120*8);
}
-class eDBoxLCDHardware
-{
- eDBoxLCD lcd;
- gLCDDC lcddc;
-public:
- eDBoxLCDHardware(): lcddc(&lcd)
- {
- }
-};
-
-eAutoInitP0<eDBoxLCDHardware> init_eDBoxLCDHardware(eAutoInitNumbers::lowlevel, "d-Box LCD Hardware");
-
-#endif //DISABLE_LCD
-
-#endif
diff --git a/lib/gdi/lcd.h b/lib/gdi/lcd.h
index 88e543f7..aee1417d 100644
--- a/lib/gdi/lcd.h
+++ b/lib/gdi/lcd.h
@@ -1,5 +1,3 @@
-#ifndef DISABLE_LCD
-
#ifndef __lcd_h
#define __lcd_h
@@ -41,7 +39,6 @@ class eDBoxLCD: public eLCD
unsigned char inverted;
public:
static eDBoxLCD *getInstance();
- int switchLCD(int state);
int setLCDParameter(int brightness, int contrast);
void setInverted( unsigned char );
eDBoxLCD();
@@ -50,5 +47,3 @@ public:
};
#endif
-
-#endif //DISABLE_LCD