X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/2334840aabb952e3b6ee5cc60c368f7f2884d9dd..52492210cfa975235fb07171f0348e9471edd8ef:/main/enigma.cpp diff --git a/main/enigma.cpp b/main/enigma.cpp index 3102c20a..f7cf44e0 100644 --- a/main/enigma.cpp +++ b/main/enigma.cpp @@ -3,40 +3,37 @@ #endif #include +#include #include + +#include +#include #include #include #include #include - -#include - -#include #include #include - +#include #ifdef WITH_SDL #include #endif +#include #include - +#include +#include +#include #include #include -#include -#include - #include - -#include #include +#include -#include - -#include - -#include +#include "bsod.h" -#include +#ifdef HAVE_GSTREAMER +#include +#endif #ifdef OBJECT_DEBUG int object_total_remaining; @@ -47,36 +44,7 @@ void object_dump() } #endif -void dumpRegion(const gRegion ®ion) -{ - fprintf(stderr, "extends: %d %d -> %d %d (%d rects)\n", - region.extends.left(), region.extends.top(), - region.extends.right(), region.extends.bottom(), region.rects.size()); -#if 0 - for (int y=0; y keyPressed; @@ -133,10 +101,6 @@ public: } }; -/************************************************/ - -eLabel *lcd_label, *lcd_clock; - int exit_code; int main(int argc, char **argv) @@ -145,10 +109,15 @@ int main(int argc, char **argv) atexit(object_dump); #endif +#ifdef HAVE_GSTREAMER + gst_init(&argc, &argv); +#endif + // set pythonpath if unset setenv("PYTHONPATH", LIBDIR "/enigma2/python", 0); printf("PYTHONPATH: %s\n", getenv("PYTHONPATH")); - + + bsodLogInit(); ePython python; eMain main; @@ -209,48 +178,33 @@ int main(int argc, char **argv) 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)); - - lcd_label = new eLabel(lcd_win); - lcd_label->move(ePoint(0, 4)); - lcd_label->resize(eSize(132, 42)); - ePtr font = new gFont("Regular", 19); - //ePtr font = new gFont("Regular", 16); - lcd_label->setFont(font); - - lcd_clock = new eLabel(lcd_win); - lcd_clock->move(ePoint(50, 46)); - lcd_clock->resize(eSize(132, 18)); - ePtr clkfont = new gFont("Regular", 16); - lcd_clock->setFont(clkfont); - - //lcd_label->setText("bla bla bla, this lcd\nSUCKS!"); - //lcd_clock->setText("88:88:88"); - - lcd_win->show(); - eRCInput::getInstance()->keyEvent.connect(slot(keyEvent)); printf("executing main\n"); - + + bsodCatchSignals(); + python.execute("mytest", "__main__"); - lcd_win->hide(); + if (exit_code == 5) /* python crash */ + bsodFatal(); dsk.paint(); dsk_lcd.paint(); + { + gPainter p(my_lcd_dc); + p.resetClip(eRect(0, 0, 132, 64)); + p.clear(); + p.flush(); + } + return exit_code; } -eWidgetDesktop *getDesktop() +eWidgetDesktop *getDesktop(int which) { - return wdsk; + return which ? lcddsk : wdsk; } eApplication *getApplication() @@ -268,13 +222,3 @@ void quitMainloop(int exitCode) exit_code = exitCode; eApp->quit(0); } - -void setLCD(const char *string) -{ - lcd_label->setText(string); -} - -void setLCDClock(const char *string) -{ - lcd_clock->setText(string); -}