+#undef WITH_SDL
+#ifdef WITH_SDL
+#error
+#define SDLDC
+#endif
#include <stdio.h>
#include <libsig_comp.h>
#include <lib/base/ebase.h>
#include <lib/gdi/grc.h>
#include <lib/gdi/gfbdc.h>
+#ifdef WITH_SDL
+#error
+#include <lib/gdi/sdl.h>
+#endif
#include <lib/gdi/font.h>
#include <lib/gui/ewidget.h>
#include <lib/actions/action.h>
+#include <lib/gdi/epng.h>
+
#ifdef OBJECT_DEBUG
int object_total_remaining;
#include <lib/dvb/idvb.h>
#include <lib/dvb/dvb.h>
#include <lib/dvb/db.h>
+#include <lib/dvb/dvbtime.h>
+#include <lib/dvb/epgcache.h>
class eMain: public eApplication, public Object
{
ePtr<eDVBResourceManager> m_mgr;
ePtr<eDVBDB> m_dvbdb;
-
+ ePtr<eDVBLocalTimeHandler> m_locale_time_handler;
ePtr<eComponentScan> m_scan;
-
+ ePtr<eEPGCache> m_epgcache;
+
public:
eMain()
{
/* TODO: put into init */
m_dvbdb = new eDVBDB();
m_mgr = new eDVBResourceManager();
-
+ m_locale_time_handler = new eDVBLocalTimeHandler();
+ m_epgcache = new eEPGCache();
m_mgr->setChannelList(m_dvbdb);
// m_scan = new eComponentScan();
eMain main;
#if 1
+#ifdef SDLDC
+ ePtr<gSDLDC> my_dc;
+ gSDLDC::getInstance(my_dc);
+#else
ePtr<gFBDC> my_dc;
gFBDC::getInstance(my_dc);
+#endif
- gPainter p(my_dc);
-
- gRGB pal[256];
- pal[0] = 0;
- pal[1] = 0xff00ff;
- pal[2] = 0xffFFff;
- pal[3] = 0x00ff00;
-
- for (int a=0; a<0x10; ++a)
- pal[a | 0x10] = 0x111111 * a;
- for (int a=0; a<0x10; ++a)
- pal[a | 0x20] = (0x111100 * a) | 0xFF;
- for (int a=0; a<0x10; ++a)
- pal[a | 0x30] = (0x110011 * a) | 0xFF00;
- for (int a=0; a<0x10; ++a)
- pal[a | 0x40] = (0x001111 * a) | 0xFF0000;
- p.setPalette(pal, 0, 256);
-
- fontRenderClass::getInstance()->AddFont("/dbox2/cdkroot/share/fonts/arial.ttf", "Arial", 100);
+ fontRenderClass::getInstance()->AddFont(FONTDIR "/arial.ttf", "Arial", 100);
eWidgetDesktop dsk(eSize(720, 576));
wdsk = &dsk;
- dsk.setBackgroundColor(gColor(0));
+
+
dsk.setDC(my_dc);
+
+ ePtr<gPixmap> m_pm;
+ loadPNG(m_pm, "data/pal.png");
+ if (!m_pm)
+ {
+ eFatal("hi ghost, please copy pal.png into your ./data, thanks!");
+ } else
+ dsk.setPalette(*m_pm);
+
+ dsk.setBackgroundColor(gRGB(0,0,0,0xFF));
#endif
/* redrawing is done in an idle-timer, so we have to set the context */
python.execute("mytest", "__main__");
-
// eApp->exec();
return 0;