7 #include <libsig_comp.h>
9 #include <lib/actions/action.h>
10 #include <lib/driver/rc.h>
11 #include <lib/base/ioprio.h>
12 #include <lib/base/ebase.h>
13 #include <lib/base/eerror.h>
14 #include <lib/base/init.h>
15 #include <lib/base/init_num.h>
16 #include <lib/gdi/gfbdc.h>
17 #include <lib/gdi/glcddc.h>
18 #include <lib/gdi/grc.h>
20 #include <lib/gdi/sdl.h>
22 #include <lib/gdi/epng.h>
23 #include <lib/gdi/font.h>
24 #include <lib/gui/ebutton.h>
25 #include <lib/gui/elabel.h>
26 #include <lib/gui/elistboxcontent.h>
27 #include <lib/gui/ewidget.h>
28 #include <lib/gui/ewidgetdesktop.h>
29 #include <lib/gui/ewindow.h>
30 #include <lib/python/connections.h>
31 #include <lib/python/python.h>
40 int object_total_remaining;
44 printf("%d items left\n", object_total_remaining);
48 static eWidgetDesktop *wdsk, *lcddsk;
50 static int prev_ascii_code;
52 int getPrevAsciiCode()
54 int ret = prev_ascii_code;
59 void keyEvent(const eRCKey &key)
62 eActionMap::getInstance(ptr);
63 if (key.flags & eRCKey::flagAscii)
65 prev_ascii_code = key.code;
66 ptr->keyPressed(key.producer->getIdentifier(), 510 /* faked KEY_ASCII */, 0);
69 ptr->keyPressed(key.producer->getIdentifier(), key.code, key.flags);
72 /************************************************/
74 #include <lib/components/scan.h>
75 #include <lib/dvb/idvb.h>
76 #include <lib/dvb/dvb.h>
77 #include <lib/dvb/db.h>
78 #include <lib/dvb/dvbtime.h>
79 #include <lib/dvb/epgcache.h>
81 class eMain: public eApplication, public Object
85 ePtr<eDVBResourceManager> m_mgr;
87 ePtr<eDVBLocalTimeHandler> m_locale_time_handler;
88 ePtr<eComponentScan> m_scan;
89 ePtr<eEPGCache> m_epgcache;
94 init.setRunlevel(eAutoInitNumbers::main);
96 /* TODO: put into init */
97 m_dvbdb = new eDVBDB();
98 m_mgr = new eDVBResourceManager();
99 m_locale_time_handler = new eDVBLocalTimeHandler();
100 m_epgcache = new eEPGCache();
101 m_mgr->setChannelList(m_dvbdb);
106 m_dvbdb->saveServicelist();
113 int main(int argc, char **argv)
123 #ifdef HAVE_GSTREAMER
124 gst_init(&argc, &argv);
127 // set pythonpath if unset
128 setenv("PYTHONPATH", LIBDIR "/enigma2/python", 0);
129 printf("PYTHONPATH: %s\n", getenv("PYTHONPATH"));
139 gSDLDC::getInstance(my_dc);
142 gFBDC::getInstance(my_dc);
144 int double_buffer = my_dc->haveDoubleBuffering();
147 ePtr<gLCDDC> my_lcd_dc;
148 gLCDDC::getInstance(my_lcd_dc);
151 /* ok, this is currently hardcoded for arabic. */
152 /* some characters are wrong in the regular font, force them to use the replacement font */
153 for (int i = 0x60c; i <= 0x66d; ++i)
154 eTextPara::forceReplacementGlyph(i);
155 eTextPara::forceReplacementGlyph(0xfdf2);
156 for (int i = 0xfe80; i < 0xff00; ++i)
157 eTextPara::forceReplacementGlyph(i);
160 eWidgetDesktop dsk(eSize(720, 576));
161 eWidgetDesktop dsk_lcd(eSize(132, 64));
164 dsk_lcd.setStyleID(1);
166 /* if (double_buffer)
168 eDebug(" - double buffering found, enable buffered graphics mode.");
169 dsk.setCompositionMode(eWidgetDesktop::cmBuffered);
176 dsk_lcd.setDC(my_lcd_dc);
179 loadPNG(m_pm, DATADIR "/enigma2/pal.png");
182 eFatal("pal.png not found!");
184 dsk.setPalette(*m_pm);
186 dsk.setBackgroundColor(gRGB(0,0,0,0xFF));
189 /* redrawing is done in an idle-timer, so we have to set the context */
190 dsk.setRedrawTask(main);
191 dsk_lcd.setRedrawTask(main);
193 eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));
195 printf("executing main\n");
199 setIoPrio(IOPRIO_CLASS_BE, 3);
201 python.execute("mytest", "__main__");
203 if (exit_code == 5) /* python crash */
210 gPainter p(my_lcd_dc);
211 p.resetClip(eRect(0, 0, 132, 64));
219 eWidgetDesktop *getDesktop(int which)
221 return which ? lcddsk : wdsk;
224 eApplication *getApplication()
234 void quitMainloop(int exitCode)
236 exit_code = exitCode;