-#if 0
-#ifndef DISABLE_LCD
-
#include <lib/gdi/lcd.h>
#include <unistd.h>
#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;
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
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;
}
}
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)
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
#include <lib/gdi/grc.h>
#include <lib/gdi/gfbdc.h>
+#include <lib/gdi/glcddc.h>
#ifdef WITH_SDL
#error
#include <lib/gdi/sdl.h>
}
-eWidgetDesktop *wdsk;
+eWidgetDesktop *wdsk, *lcddsk;
// typedef struct _object PyObject;
ePtr<eDVBDB> m_dvbdb;
ePtr<eDVBLocalTimeHandler> m_locale_time_handler;
ePtr<eComponentScan> m_scan;
- ePtr<eEPGCache> m_epgcache;
+// ePtr<eEPGCache> m_epgcache;
public:
eMain()
m_dvbdb = new eDVBDB();
m_mgr = new eDVBResourceManager();
m_locale_time_handler = new eDVBLocalTimeHandler();
- m_epgcache = new eEPGCache();
+// m_epgcache = new eEPGCache();
m_mgr->setChannelList(m_dvbdb);
// m_scan = new eComponentScan();
double_buffer = my_dc->haveDoubleBuffering();
#endif
+ ePtr<gLCDDC> my_lcd_dc;
+ gLCDDC::getInstance(my_lcd_dc);
+
fontRenderClass::getInstance()->AddFont(FONTDIR "/arial.ttf", "Arial", 100);
eWidgetDesktop dsk(eSize(720, 576));
+ eWidgetDesktop dsk_lcd(eSize(132, 64));
if (double_buffer)
{
}
wdsk = &dsk;
+ lcddsk = &dsk_lcd;
dsk.setDC(my_dc);
+ dsk_lcd.setDC(my_lcd_dc);
ePtr<gPixmap> m_pm;
loadPNG(m_pm, "data/pal.png");
/* redrawing is done in an idle-timer, so we have to set the context */
dsk.setRedrawTask(main);
+ dsk_lcd.setRedrawTask(main);
+
+ eWindow *lcd_win = new eWindow(&dsk_lcd);
+
+ lcd_win->setFlag(eWindow::wfNoBorder);
+
+ lcd_win->move(ePoint(0, 0));
+ lcd_win->resize(eSize(132, 64));
+
+ eLabel *lcd_label = new eLabel(lcd_win);
+ lcd_label->move(ePoint(0, 0));
+ lcd_label->resize(eSize(132, 64));
+ lcd_label->setText("bla bla bla, this lcd\nSUCKS!");
+
+ lcd_win->show();
eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));