5 #include <libsig_comp.h>
6 #include <lib/base/ebase.h>
7 #include <lib/base/eerror.h>
8 #include <lib/base/init.h>
9 #include <lib/base/init_num.h>
13 #include <lib/gdi/grc.h>
14 #include <lib/gdi/gfbdc.h>
16 #include <lib/gdi/sdl.h>
18 #include <lib/gdi/font.h>
20 #include <lib/gui/ewidget.h>
21 #include <lib/gui/ewidgetdesktop.h>
22 #include <lib/gui/elabel.h>
23 #include <lib/gui/ebutton.h>
25 #include <lib/gui/ewindow.h>
27 #include <lib/python/python.h>
28 #include <lib/python/connections.h>
30 #include <lib/gui/elistboxcontent.h>
32 #include <lib/driver/rc.h>
34 #include <lib/actions/action.h>
36 #include <lib/gdi/epng.h>
39 int object_total_remaining;
43 printf("%d items left\n", object_total_remaining);
47 void dumpRegion(const gRegion ®ion)
49 fprintf(stderr, "extends: %d %d -> %d %d (%d rects)\n",
50 region.extends.left(), region.extends.top(),
51 region.extends.right(), region.extends.bottom(), region.rects.size());
52 for (int y=0; y<region.extends.bottom(); ++y)
54 for (int x=0; x<region.extends.right(); ++x)
56 unsigned char res = ' ';
57 for (unsigned int i=0; i < region.rects.size(); ++i)
58 if (region.rects[i].contains(ePoint(x, y)))
60 fprintf(stderr, "%c", res);
62 fprintf(stderr, "\n");
68 // typedef struct _object PyObject;
72 printf("C++ says: it's a %d!!!\n", i);
75 PSignal1<void,int> keyPressed;
77 PSignal1<void,int> &keyPressedSignal()
82 void keyEvent(const eRCKey &key)
85 eActionMap::getInstance(ptr);
86 ptr->keyPressed(0, key.code, key.flags);
88 // keyPressed(key.code);
91 /************************************************/
93 #include <lib/components/scan.h>
94 #include <lib/dvb/idvb.h>
95 #include <lib/dvb/dvb.h>
96 #include <lib/dvb/db.h>
97 #include <lib/dvb/dvbtime.h>
98 #include <lib/dvb/epgcache.h>
100 class eMain: public eApplication, public Object
104 ePtr<eDVBResourceManager> m_mgr;
105 ePtr<eDVBDB> m_dvbdb;
106 ePtr<eDVBLocalTimeHandler> m_locale_time_handler;
107 ePtr<eComponentScan> m_scan;
108 ePtr<eEPGCache> m_epgcache;
113 init.setRunlevel(eAutoInitNumbers::main);
115 /* TODO: put into init */
116 m_dvbdb = new eDVBDB();
117 m_mgr = new eDVBResourceManager();
118 m_locale_time_handler = new eDVBLocalTimeHandler();
119 m_epgcache = new eEPGCache();
120 m_mgr->setChannelList(m_dvbdb);
122 // m_scan = new eComponentScan();
133 /************************************************/
136 int main(int argc, char **argv)
149 gSDLDC::getInstance(my_dc);
152 gFBDC::getInstance(my_dc);
155 fontRenderClass::getInstance()->AddFont(FONTDIR "/arial.ttf", "Arial", 100);
157 eWidgetDesktop dsk(eSize(720, 576));
165 loadPNG(m_pm, "data/pal.png");
168 eFatal("hi ghost, please copy pal.png into your ./data, thanks!");
170 dsk.setPalette(*m_pm);
172 dsk.setBackgroundColor(gRGB(0,0,0,0xFF));
175 /* redrawing is done in an idle-timer, so we have to set the context */
176 dsk.setRedrawTask(main);
178 eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));
180 printf("executing main\n");
182 python.execute("mytest", "__main__");
189 eWidgetDesktop *getDesktop()