aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-01-20 14:35:19 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-01-20 14:35:19 +0000
commit9202d4248dd7df2f6e5eb53b4154c8297ec9b1d1 (patch)
tree6be7a641506defe96a73e0279f934ac5670aba81 /main
parent13b7a9b397f36ca3195aad3702feb3db4cbb2f3e (diff)
downloadenigma2-9202d4248dd7df2f6e5eb53b4154c8297ec9b1d1.tar.gz
enigma2-9202d4248dd7df2f6e5eb53b4154c8297ec9b1d1.zip
- redraw now in idle
- mainloop called from python (could be changed) - clock components manages timer - timer usuable from python
Diffstat (limited to 'main')
-rw-r--r--main/Makefile.am3
-rw-r--r--main/enigma.cpp73
2 files changed, 18 insertions, 58 deletions
diff --git a/main/Makefile.am b/main/Makefile.am
index 6b0fb416..46ce98b1 100644
--- a/main/Makefile.am
+++ b/main/Makefile.am
@@ -1,5 +1,6 @@
INCLUDES = \
- -I$(top_srcdir)/include
+ -I$(top_srcdir)/include \
+ -I/usr/include/python2.3
bin_PROGRAMS = enigma2
diff --git a/main/enigma.cpp b/main/enigma.cpp
index d350f445..faff4d89 100644
--- a/main/enigma.cpp
+++ b/main/enigma.cpp
@@ -19,6 +19,7 @@
#include <lib/gui/ewindow.h>
#include <lib/python/python.h>
+#include <lib/python/connections.h>
#ifdef OBJECT_DEBUG
int object_total_remaining;
@@ -28,11 +29,6 @@ void object_dump()
printf("%d items left\n", object_total_remaining);
}
#endif
-using namespace std;
- void print(const string &str, const char *c)
- {
- printf("%s (%s)\n", str.c_str(), c);
- }
void dumpRegion(const gRegion &region)
{
@@ -66,6 +62,13 @@ public:
eWidgetDesktop *wdsk;
+// typedef struct _object PyObject;
+
+void print(int i)
+{
+ printf("C++ says: it's a %d!!!\n", i);
+}
+
int main(int argc, char **argv)
{
#ifdef OBJECT_DEBUG
@@ -103,63 +106,15 @@ int main(int argc, char **argv)
wdsk = &dsk;
dsk.setDC(my_dc);
-
- eWindow *wnd = new eWindow(&dsk);
- wnd->move(ePoint(100, 100));
- wnd->resize(eSize(200, 200));
- wnd->show();
-
- eLabel *label = new eButton(wnd);
- label->setText("Hello!!");
- label->move(ePoint(40, 40));
- label->resize(eSize(100, 40));
-
- label = new eButton(wnd);
- label->setText("2nd!!");
- label->move(ePoint(40, 90));
- label->resize(eSize(100, 40));
-
-#if 0
- eWidget *bla2 = new eWidget(0);
- dsk.addRootWidget(bla2, 0);
-
- bla2->move(ePoint(160, 160));
- bla2->resize(eSize(200, 200));
- bla2->show();
#endif
-// dsk.recalcClipRegions();
-// dsk.paint();
-// dsk.invalidate(gRegion(eRect(0, 0, 720, 576)));
-
-// dumpRegion(wnd->m_visible_region);
-// dumpRegion(label->m_visible_region);
-// dumpRegion(label->m_visible_region);
+ /* redrawing is done in an idle-timer, so we have to set the context */
+ dsk.setRedrawTask(main);
- eDebug("painting!");
-
-
ePython python;
- printf("about to execute TEST :)\n");
- python.execute("mytest", "test");
-
- sleep(2);
-#endif
-
-#if 0
-
- // connections mit parametern: geht! :)
- using namespace std;
- using namespace SigC;
-
-
- Signal1<void,const string &> printer;
- int i;
- for (i=1; i<argc; ++i)
- printer.connect(bind(slot(print), argv[i]));
- printer("hello world\n");
-#endif
+ printf("executing main\n");
+ python.execute("mytest", "__main__");
return 0;
}
@@ -169,3 +124,7 @@ eWidgetDesktop *getDesktop()
return wdsk;
}
+void runMainloop()
+{
+ eApp->exec();
+}