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>
18 #include <lib/gui/ewindow.h>
21 int object_total_remaining;
25 printf("%d items left\n", object_total_remaining);
29 void dumpRegion(const gRegion ®ion)
31 fprintf(stderr, "extends: %d %d -> %d %d (%d rects)\n",
32 region.extends.left(), region.extends.top(),
33 region.extends.right(), region.extends.bottom(), region.rects.size());
34 for (int y=0; y<region.extends.bottom(); ++y)
36 for (int x=0; x<region.extends.right(); ++x)
38 unsigned char res = ' ';
39 for (unsigned int i=0; i < region.rects.size(); ++i)
40 if (region.rects[i].contains(ePoint(x, y)))
42 fprintf(stderr, "%c", res);
44 fprintf(stderr, "\n");
56 init.setRunlevel(eAutoInitNumbers::main);
58 gFBDC::getInstance(my_dc);
69 for (int a=0; a<0x10; ++a)
70 pal[a | 0x10] = (0x111111 * a) | 0xFF;
71 p.setPalette(pal, 0, 256);
73 fontRenderClass::getInstance()->AddFont("/dbox2/cdkroot/share/fonts/arial.ttf", "Arial", 100);
76 p.resetClip(gRegion(eRect(0, 0, 720, 576)));
83 c |= eRect(0, 20, 100, 10);
84 c |= eRect(0, 50, 100, 10);
85 c |= eRect(10, 10, 80, 100);
87 c -= eRect(20, 20, 40, 40);
89 p.setForegroundColor(gColor(3));
90 p.fill(eRect(0, 0, 100, 100));
91 p.fill(eRect(200, 0, 100, 100));
93 for (int a=0; a<c.rects.size(); ++a)
94 eDebug("%d %d -> %d %d", c.rects[a].left(), c.rects[a].top(), c.rects[a].right(), c.rects[a].bottom());
95 eDebug("extends: %d %d %d %d", c.extends.left(), c.extends.top(), c.extends.right(), c.extends.bottom());
96 p.setOffset(ePoint(100, 100));
99 p.setBackgroundColor(gColor(1));
101 p.setForegroundColor(gColor(2));
102 p.line(ePoint(0, 0), ePoint(220, 190));
105 p.setBackgroundColor(gColor(0x1f));
106 p.setForegroundColor(gColor(0x10));
108 ePtr<gFont> fnt = new gFont("Arial", 70);
110 p.renderText(eRect(100, 100, 500, 200), "Hello welt!");
114 eWidgetDesktop dsk(eSize(720, 576));
117 eWindow *bla = new eWindow(&dsk);
119 bla->move(ePoint(100, 100));
120 bla->resize(eSize(200, 200));
123 eLabel *blablub = new eLabel(bla->child());
124 blablub->setText("hello world");
125 blablub->move(ePoint(0, 0));
126 blablub->resize(eSize(400,400));
129 eWidget *bla2 = new eWidget(0);
130 dsk.addRootWidget(bla2, 0);
132 bla2->move(ePoint(160, 160));
133 bla2->resize(eSize(200, 200));
137 dsk.recalcClipRegions();
139 // dumpRegion(bla->m_visible_region);
140 // dumpRegion(bla2->m_visible_region);
141 // dumpRegion(blablub->m_visible_region);
145 dsk.invalidate(gRegion(eRect(0, 0, 720, 576)));
151 extern void contentTest();
153 eDebug("Contenttest");
158 p.resetClip(gRegion(eRect(0, 0, 720, 576)));
162 // blablub->setText("123");
163 // dumpRegion(blablub->m_visible_region);
164 // dumpRegion(dsk.m_dirty_region);