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/gui/elistboxcontent.h>
26 #include <lib/driver/rc.h>
29 int object_total_remaining;
33 printf("%d items left\n", object_total_remaining);
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");
58 // typedef struct _object PyObject;
62 printf("C++ says: it's a %d!!!\n", i);
65 PSignal1<void,int> keyPressed;
67 PSignal1<void,int> &keyPressedSignal()
72 void keyEvent(const eRCKey &key)
78 /************************************************/
79 #include <lib/dvb/dvb.h>
80 #include <lib/dvb/db.h>
81 #include <lib/dvb/isection.h>
82 #include <lib/dvb/esection.h>
83 #include <lib/dvb_si/pmt.h>
84 #include <lib/dvb/scan.h>
87 class eMain: public eApplication, public Object
91 ePtr<eDVBScan> m_scan;
93 ePtr<eDVBResourceManager> m_mgr;
94 ePtr<iDVBChannel> m_channel;
97 void scanEvent(int evt)
99 eDebug("scan event %d!", evt);
100 if (evt == eDVBScan::evtFinish)
102 m_scan->insertInto(m_dvbdb);
106 ePtr<eConnection> m_scan_event_connection;
110 init.setRunlevel(eAutoInitNumbers::main);
113 m_dvbdb = new eDVBDB();
114 m_mgr = new eDVBResourceManager();
116 eDVBFrontendParametersSatellite fesat;
118 fesat.frequency = 11817000; // 12070000;
119 fesat.symbol_rate = 27500000;
120 fesat.polarisation = eDVBFrontendParametersSatellite::Polarisation::Vertical;
121 fesat.fec = eDVBFrontendParametersSatellite::FEC::f3_4;
122 fesat.inversion = eDVBFrontendParametersSatellite::Inversion::Off;
123 fesat.orbital_position = 192;
125 eDVBFrontendParameters *fe = new eDVBFrontendParameters();
129 if (m_mgr->allocateRawChannel(m_channel))
130 eDebug("shit it failed!");
132 eDebug("starting scan...");
134 std::list<ePtr<iDVBFrontendParameters> > list;
138 m_scan = new eDVBScan(m_channel);
140 m_scan->connectEvent(slot(*this, &eMain::scanEvent), m_scan_event_connection);
150 /************************************************/
153 int main(int argc, char **argv)
165 gFBDC::getInstance(my_dc);
175 for (int a=0; a<0x10; ++a)
176 pal[a | 0x10] = 0x111111 * a;
177 for (int a=0; a<0x10; ++a)
178 pal[a | 0x20] = (0x111100 * a) | 0xFF;
179 for (int a=0; a<0x10; ++a)
180 pal[a | 0x30] = (0x110011 * a) | 0xFF00;
181 for (int a=0; a<0x10; ++a)
182 pal[a | 0x40] = (0x001111 * a) | 0xFF0000;
183 p.setPalette(pal, 0, 256);
185 fontRenderClass::getInstance()->AddFont("/dbox2/cdkroot/share/fonts/arial.ttf", "Arial", 100);
187 eWidgetDesktop dsk(eSize(720, 576));
190 dsk.setBackgroundColor(gColor(0));
194 /* redrawing is done in an idle-timer, so we have to set the context */
195 dsk.setRedrawTask(main);
197 eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));
199 printf("executing main\n");
200 python.execute("mytest", "__main__");
207 eWidgetDesktop *getDesktop()