2 #include <libsig_comp.h>
3 #include <lib/base/ebase.h>
4 #include <lib/base/eerror.h>
5 #include <lib/base/init.h>
6 #include <lib/base/init_num.h>
10 #include <lib/gdi/grc.h>
11 #include <lib/gdi/gfbdc.h>
12 #include <lib/gdi/font.h>
14 #include <lib/gui/ewidget.h>
15 #include <lib/gui/ewidgetdesktop.h>
16 #include <lib/gui/elabel.h>
17 #include <lib/gui/ebutton.h>
19 #include <lib/gui/ewindow.h>
21 #include <lib/python/python.h>
22 #include <lib/python/connections.h>
24 #include <lib/driver/rc.h>
27 int object_total_remaining;
31 printf("%d items left\n", object_total_remaining);
35 void dumpRegion(const gRegion ®ion)
37 fprintf(stderr, "extends: %d %d -> %d %d (%d rects)\n",
38 region.extends.left(), region.extends.top(),
39 region.extends.right(), region.extends.bottom(), region.rects.size());
40 for (int y=0; y<region.extends.bottom(); ++y)
42 for (int x=0; x<region.extends.right(); ++x)
44 unsigned char res = ' ';
45 for (unsigned int i=0; i < region.rects.size(); ++i)
46 if (region.rects[i].contains(ePoint(x, y)))
48 fprintf(stderr, "%c", res);
50 fprintf(stderr, "\n");
55 class eMain: public eApplication, public Object
61 init.setRunlevel(eAutoInitNumbers::main);
67 // typedef struct _object PyObject;
71 printf("C++ says: it's a %d!!!\n", i);
74 PSignal1<void,int> keyPressed;
76 PSignal1<void,int> &keyPressedSignal()
81 void keyEvent(const eRCKey &key)
87 int main(int argc, char **argv)
98 gFBDC::getInstance(my_dc);
108 for (int a=0; a<0x10; ++a)
109 pal[a | 0x10] = 0x111111 * a;
110 for (int a=0; a<0x10; ++a)
111 pal[a | 0x20] = (0x111100 * a) | 0xFF;
112 for (int a=0; a<0x10; ++a)
113 pal[a | 0x30] = (0x110011 * a) | 0xFF00;
114 for (int a=0; a<0x10; ++a)
115 pal[a | 0x40] = (0x001111 * a) | 0xFF0000;
116 p.setPalette(pal, 0, 256);
118 fontRenderClass::getInstance()->AddFont("/dbox2/cdkroot/share/fonts/arial.ttf", "Arial", 100);
120 eWidgetDesktop dsk(eSize(720, 576));
123 dsk.setBackgroundColor(gColor(0));
127 /* redrawing is done in an idle-timer, so we have to set the context */
128 dsk.setRedrawTask(main);
130 eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));
134 printf("executing main\n");
135 python.execute("mytest", "__main__");
140 eWidgetDesktop *getDesktop()