9 #include <libsig_comp.h>
10 #include <lib/base/ebase.h>
11 #include <lib/base/eerror.h>
12 #include <lib/base/init.h>
13 #include <lib/base/init_num.h>
17 #include <lib/gdi/grc.h>
18 #include <lib/gdi/gfbdc.h>
19 #include <lib/gdi/glcddc.h>
23 #include <lib/gdi/sdl.h>
25 #include <lib/gdi/font.h>
27 #include <lib/gui/ewidget.h>
28 #include <lib/gui/ewidgetdesktop.h>
29 #include <lib/gui/elabel.h>
30 #include <lib/gui/ebutton.h>
32 #include <lib/gui/ewindow.h>
34 #include <lib/python/python.h>
35 #include <lib/python/connections.h>
37 #include <lib/gui/elistboxcontent.h>
39 #include <lib/driver/rc.h>
41 #include <lib/actions/action.h>
43 #include <lib/gdi/epng.h>
46 int object_total_remaining;
50 printf("%d items left\n", object_total_remaining);
54 void dumpRegion(const gRegion ®ion)
56 fprintf(stderr, "extends: %d %d -> %d %d (%d rects)\n",
57 region.extends.left(), region.extends.top(),
58 region.extends.right(), region.extends.bottom(), region.rects.size());
60 for (int y=0; y<region.extends.bottom(); ++y)
62 for (int x=0; x<region.extends.right(); ++x)
64 unsigned char res = ' ';
65 for (unsigned int i=0; i < region.rects.size(); ++i)
66 if (region.rects[i].contains(ePoint(x, y)))
68 fprintf(stderr, "%c", res);
70 fprintf(stderr, "\n");
76 eWidgetDesktop *wdsk, *lcddsk;
78 // typedef struct _object PyObject;
82 printf("C++ says: it's a %d!!!\n", i);
85 PSignal1<void,int> keyPressed;
87 PSignal1<void,int> &keyPressedSignal()
92 void keyEvent(const eRCKey &key)
95 eActionMap::getInstance(ptr);
96 ptr->keyPressed(0, key.code, key.flags);
98 // keyPressed(key.code);
101 /************************************************/
103 #include <lib/components/scan.h>
104 #include <lib/dvb/idvb.h>
105 #include <lib/dvb/dvb.h>
106 #include <lib/dvb/db.h>
107 #include <lib/dvb/dvbtime.h>
108 #include <lib/dvb/epgcache.h>
110 class eMain: public eApplication, public Object
114 ePtr<eDVBResourceManager> m_mgr;
115 ePtr<eDVBDB> m_dvbdb;
116 ePtr<eDVBLocalTimeHandler> m_locale_time_handler;
117 ePtr<eComponentScan> m_scan;
118 ePtr<eEPGCache> m_epgcache;
123 init.setRunlevel(eAutoInitNumbers::main);
125 /* TODO: put into init */
126 m_dvbdb = new eDVBDB();
127 m_mgr = new eDVBResourceManager();
128 m_locale_time_handler = new eDVBLocalTimeHandler();
129 m_epgcache = new eEPGCache();
130 m_mgr->setChannelList(m_dvbdb);
132 // m_scan = new eComponentScan();
144 /************************************************/
146 eLabel *lcd_label, *lcd_clock;
148 int main(int argc, char **argv)
154 // set pythonpath if unset
155 setenv("PYTHONPATH", LIBDIR "/enigma2/python", 0);
156 printf("PYTHONPATH: %s\n", getenv("PYTHONPATH"));
162 int double_buffer = 0;
167 gSDLDC::getInstance(my_dc);
170 gFBDC::getInstance(my_dc);
172 double_buffer = my_dc->haveDoubleBuffering();
175 ePtr<gLCDDC> my_lcd_dc;
176 gLCDDC::getInstance(my_lcd_dc);
178 fontRenderClass::getInstance()->AddFont(FONTDIR "/arial.ttf", "Arial", 100);
180 eWidgetDesktop dsk(eSize(720, 576));
181 eWidgetDesktop dsk_lcd(eSize(132, 64));
183 /* if (double_buffer)
185 eDebug(" - double buffering found, enable buffered graphics mode.");
186 dsk.setCompositionMode(eWidgetDesktop::cmBuffered);
193 dsk_lcd.setDC(my_lcd_dc);
196 loadPNG(m_pm, DATADIR "/enigma2/pal.png");
199 eFatal("pal.png not found!");
201 dsk.setPalette(*m_pm);
203 dsk.setBackgroundColor(gRGB(0,0,0,0xFF));
206 /* redrawing is done in an idle-timer, so we have to set the context */
207 dsk.setRedrawTask(main);
208 dsk_lcd.setRedrawTask(main);
210 eWindow *lcd_win = new eWindow(&dsk_lcd);
212 lcd_win->setFlag(eWindow::wfNoBorder);
214 lcd_win->move(ePoint(0, 0));
215 lcd_win->resize(eSize(132, 64));
217 lcd_label = new eLabel(lcd_win);
218 lcd_label->move(ePoint(0, 10));
219 lcd_label->resize(eSize(132, 36));
220 ePtr<gFont> font = new gFont("Arial", 16);
221 lcd_label->setFont(font);
223 lcd_clock = new eLabel(lcd_win);
224 lcd_clock->move(ePoint(50, 46));
225 lcd_clock->resize(eSize(132, 20));
226 //ePtr<gFont> clkfont = new gFont("Arial", 18);
227 lcd_clock->setFont(font);
229 //lcd_label->setText("bla bla bla, this lcd\nSUCKS!");
230 //lcd_clock->setText("88:88:88");
234 eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));
236 printf("executing main\n");
238 python.execute("mytest", "__main__");
245 eWidgetDesktop *getDesktop()
260 void setLCD(const char *string)
262 lcd_label->setText(string);
265 void setLCDClock(const char *string)
267 lcd_clock->setText(string);