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>
24 int object_total_remaining;
28 printf("%d items left\n", object_total_remaining);
32 void print(const string &str, const char *c)
34 printf("%s (%s)\n", str.c_str(), c);
37 void dumpRegion(const gRegion ®ion)
39 fprintf(stderr, "extends: %d %d -> %d %d (%d rects)\n",
40 region.extends.left(), region.extends.top(),
41 region.extends.right(), region.extends.bottom(), region.rects.size());
42 for (int y=0; y<region.extends.bottom(); ++y)
44 for (int x=0; x<region.extends.right(); ++x)
46 unsigned char res = ' ';
47 for (unsigned int i=0; i < region.rects.size(); ++i)
48 if (region.rects[i].contains(ePoint(x, y)))
50 fprintf(stderr, "%c", res);
52 fprintf(stderr, "\n");
57 class eMain: public eApplication, public Object
63 init.setRunlevel(eAutoInitNumbers::main);
69 int main(int argc, char **argv)
80 gFBDC::getInstance(my_dc);
90 for (int a=0; a<0x10; ++a)
91 pal[a | 0x10] = 0x111111 * a;
92 for (int a=0; a<0x10; ++a)
93 pal[a | 0x20] = (0x111100 * a) | 0xFF;
94 for (int a=0; a<0x10; ++a)
95 pal[a | 0x30] = (0x110011 * a) | 0xFF00;
96 for (int a=0; a<0x10; ++a)
97 pal[a | 0x40] = (0x001111 * a) | 0xFF0000;
98 p.setPalette(pal, 0, 256);
100 fontRenderClass::getInstance()->AddFont("/dbox2/cdkroot/share/fonts/arial.ttf", "Arial", 100);
102 eWidgetDesktop dsk(eSize(720, 576));
107 eWindow *wnd = new eWindow(&dsk);
108 wnd->move(ePoint(100, 100));
109 wnd->resize(eSize(200, 200));
112 eLabel *label = new eButton(wnd);
113 label->setText("Hello!!");
114 label->move(ePoint(40, 40));
115 label->resize(eSize(100, 40));
117 label = new eButton(wnd);
118 label->setText("2nd!!");
119 label->move(ePoint(40, 90));
120 label->resize(eSize(100, 40));
123 eWidget *bla2 = new eWidget(0);
124 dsk.addRootWidget(bla2, 0);
126 bla2->move(ePoint(160, 160));
127 bla2->resize(eSize(200, 200));
131 // dsk.recalcClipRegions();
133 // dsk.invalidate(gRegion(eRect(0, 0, 720, 576)));
135 // dumpRegion(wnd->m_visible_region);
136 // dumpRegion(label->m_visible_region);
137 // dumpRegion(label->m_visible_region);
144 printf("about to execute TEST :)\n");
145 python.execute("mytest", "test");
152 // connections mit parametern: geht! :)
154 using namespace SigC;
157 Signal1<void,const string &> printer;
159 for (i=1; i<argc; ++i)
160 printer.connect(bind(slot(print), argv[i]));
161 printer("hello world\n");
167 eWidgetDesktop *getDesktop()