# "funktionalitaet"
def doClock(self):
- self.setText("clock: " + time.asctime())
+ t = time.localtime()
+ self.setText("%2d:%02d:%02d" % (t[3], t[4], t[5]))
# realisierung als GUI
def createWidget(self, parent, skindata):
def GUIdelete(self):
self.instance.setContent(None)
+ del self.instance
class ServiceList(HTMLComponent, GUIComponent):
def __init__(self):
self.progressbar = progressbar
self.text = text
self.scan = eComponentScan()
+ self.state = self.Idle
+ self.scanStatusChanged()
+
+ def execBegin(self):
+ self.scan.statusChanged.get().append(self.scanStatusChanged)
if self.scan.start():
self.state = self.Error
else:
self.state = self.Running
- self.scan.statusChanged.get().append(self.scanStatusChanged)
self.scanStatusChanged()
+
+ def execEnd(self):
+ self.scan.statusChanged.get().remove(self.scanStatusChanged)
+ if not self.isDone():
+ print "*** warning *** scan was not finished!"
def isDone(self):
return self.state == self.Done
-
- def fix(self):
- self.scan.statusChanged.get().remove(self.scanStatusChanged)
class ActionMap:
def __init__(self, context, actions = { }, prio=0):
class EventInfo(PerServiceDisplay):
Now = 0
Next = 1
+ Now_Duration = 2
+ Next_Duration = 3
+
def __init__(self, navcore, now_or_next):
# listen to evUpdatedEventInfo and evStopService
# note that evStopService will be called once to establish a known state
if not self.navcore.getCurrentService(service):
if not service.info(info):
- print "got info !"
ev = eServiceEventPtr()
- info.getEvent(ev, self.now_or_next)
- self.setText(ev.m_event_name)
+ info.getEvent(ev, self.now_or_next & 1)
+ if self.now_or_next & 2:
+ self.setText("%d min" % (ev.m_duration / 60))
+ else:
+ self.setText(ev.m_event_name)
print "new event info in EventInfo! yeah!"
def stopEvent(self):
class eConnection: public iObject, public Connection
{
-DECLARE_REF;
+DECLARE_REF(eConnection);
private:
ePtr<iObject> m_owner;
public:
<map context="ChannelSelectActions">
<key id=" " mapto="selectChannel" flags="mr" />
+
+ <!-- yes, this is flexible as hell. -->
+ <key id="p" mapto="bouquet:PREMIERE" flags="m" />
+ <key id="d" mapto="bouquet:Das Erste" flags="m" />
</map>
<map context="WindowActions">
void setRequested(int req) { requested=req; }
};
- // ... und Timer
-/**
- * \brief Gives a callback after a specified timeout.
- *
- * This class emits the signal \c eTimer::timeout after the specified timeout.
- */
-class eTimer
-{
- eMainloop &context;
- timeval nextActivation;
- long interval;
- bool bSingleShot;
- bool bActive;
-public:
- /**
- * \brief Constructs a timer.
- *
- * The timer is not yet active, it has to be started with \c start.
- * \param context The thread from which the signal should be emitted.
- */
- eTimer(eMainloop *context): context(*context), bActive(false) { }
- ~eTimer() { if (bActive) stop(); }
-
- PSignal0<void> timeout;
- void activate();
-
- bool isActive() { return bActive; }
- timeval &getNextActivation() { return nextActivation; }
-
- void start(long msec, bool singleShot=false);
- void stop();
- void changeInterval(long msek);
- bool operator<(const eTimer& t) const { return nextActivation < t.nextActivation; }
-};
+class eTimer;
// werden in einer mainloop verarbeitet
class eMainloop
void exit_loop();
};
+
/**
* \brief The application class.
*
eApp = 0;
}
};
+
+ // ... und Timer
+/**
+ * \brief Gives a callback after a specified timeout.
+ *
+ * This class emits the signal \c eTimer::timeout after the specified timeout.
+ */
+class eTimer
+{
+ eMainloop &context;
+ timeval nextActivation;
+ long interval;
+ bool bSingleShot;
+ bool bActive;
+public:
+ /**
+ * \brief Constructs a timer.
+ *
+ * The timer is not yet active, it has to be started with \c start.
+ * \param context The thread from which the signal should be emitted.
+ */
+ eTimer(eMainloop *context = eApp): context(*context), bActive(false) { }
+ ~eTimer() { if (bActive) stop(); }
+
+ PSignal0<void> timeout;
+ void activate();
+
+ bool isActive() { return bActive; }
+ timeval &getNextActivation() { return nextActivation; }
+
+ void start(long msec, bool singleShot=false);
+ void stop();
+ void changeInterval(long msek);
+ bool operator<(const eTimer& t) const { return nextActivation < t.nextActivation; }
+};
+
#endif
}
};
-#define DECLARE_REF private: oRefCount ref; public: void AddRef(); void Release();
+#ifndef SWIG
+#define DECLARE_REF(x) private: oRefCount ref; public: void AddRef(); void Release();
#ifdef OBJECT_DEBUG
extern int object_total_remaining;
#define DEFINE_REF(c) void c::AddRef() { ++object_total_remaining; ++ref; eDebug("OBJECT_DEBUG " #c "+%p now %d", this, (int)ref); } void c::Release() { --object_total_remaining; eDebug("OBJECT_DEBUG " #c "-%p now %d", this, ref-1); if (!--ref) delete this; }
#else
#define DEFINE_REF(c) void c::AddRef() { ++ref; } void c::Release() { if (!--ref) delete this; }
#endif
+#else
+#define DECLARE_REF(x) private: void AddRef(); void Release();
+#endif
+
+#ifdef SWIG
+class Object
+{
+};
+#endif
#endif
class eComponentScan: public Object, public iObject
{
-DECLARE_REF;
+DECLARE_REF(eComponentScan);
private:
void scanEvent(int event);
ePtr<eConnection> m_scan_event_connection;
class eDVBDB: public iDVBChannelList
{
-DECLARE_REF;
+DECLARE_REF(eDVBDB);
friend class eDVBDBQuery;
private:
struct channel
// we have to add a possibility to invalidate here.
class eDVBDBQuery: public iDVBChannelListQuery
{
-DECLARE_REF;
+DECLARE_REF(eDVBDBQuery);
private:
std::map<eServiceReferenceDVB, ePtr<eDVBService> >::iterator m_cursor;
ePtr<eDVBDB> m_db;
class eDVBAudio: public iObject
{
-DECLARE_REF;
+DECLARE_REF(eDVBAudio);
private:
ePtr<eDVBDemux> m_demux;
int m_fd, m_fd_demux;
class eDVBVideo: public iObject
{
-DECLARE_REF;
+DECLARE_REF(eDVBVideo);
private:
ePtr<eDVBDemux> m_demux;
int m_fd, m_fd_demux;
class eTSMPEGDecoder: public iTSMPEGDecoder
{
-DECLARE_REF;
+DECLARE_REF(eTSMPEGDecoder);
private:
ePtr<eDVBDemux> m_demux;
ePtr<eDVBAudio> m_audio;
friend class eDVBAudio;
friend class eDVBVideo;
public:
- DECLARE_REF
+ DECLARE_REF(eDVBDemux);
eDVBDemux(int adapter, int demux);
virtual ~eDVBDemux();
RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader);
class eDVBSectionReader: public iDVBSectionReader, public Object
{
- DECLARE_REF
+ DECLARE_REF(eDVBSectionReader);
private:
int fd;
Signal1<void, const __u8*> read;
class eDVBResourceManager: public iDVBResourceManager
{
- DECLARE_REF;
+ DECLARE_REF(eDVBResourceManager);
int avail, busy;
struct adapter
{
class eDVBChannel: public iDVBChannel, public eDVBDemux, public Object
{
- DECLARE_REF;
+ DECLARE_REF(eDVBChannel);
private:
ePtr<eDVBFrontend> m_frontend;
ePtr<iDVBFrontendParameters> m_current_frontend_parameters;
class eGTable: public iObject, public Object
{
-DECLARE_REF;
+DECLARE_REF(eGTable);
private:
ePtr<iDVBSectionReader> m_reader;
eDVBTableSpec m_table;
class eDVBFrontendParameters: public iDVBFrontendParameters
{
- DECLARE_REF;
+ DECLARE_REF(eDVBFrontendParameters);
union
{
eDVBFrontendParametersSatellite sat;
class eDVBFrontend: public iDVBFrontend, public Object
{
- DECLARE_REF;
+ DECLARE_REF(eDVBFrontend);
int m_type;
int m_fd;
#if HAVE_DVB_API_VERSION < 3
class eDVBService: public iStaticServiceInformation
{
- DECLARE_REF;
+ DECLARE_REF(eDVBService);
public:
eDVBService();
std::string m_service_name;
class eDVBChannelQuery: public iObject
{
- DECLARE_REF;
+ DECLARE_REF(eDVBChannelQuery);
public:
enum
{
class eDVBTransponderList: iDVBChannelList
{
- DECLARE_REF;
+ DECLARE_REF(eDVBTransponderList);
private:
std::map<eDVBChannelID, ePtr<iDVBFrontendParameters> > channels;
public:
class eDVBScan: public Object, public iObject
{
-DECLARE_REF;
+DECLARE_REF(eDVBScan);
private:
/* chid helper functions: */
class eDVBSatelliteEquipmentControl: public iDVBSatelliteEquipmentControl
{
public:
- DECLARE_REF;
+ DECLARE_REF(eDVBSatelliteEquipmentControl);
eDVBSatelliteEquipmentControl();
RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat);
};
class eTextPara: public iObject
{
-DECLARE_REF;
+DECLARE_REF(eTextPara);
private:
ePtr<Font> current_font, replacement_font;
FT_Face current_face, replacement_face;
class Font: public iObject
{
-DECLARE_REF;
+DECLARE_REF(Font);
public:
FTC_Image_Desc font;
fontRenderClass *renderer;
*/
class gFont: public iObject
{
-DECLARE_REF;
+DECLARE_REF(gFont);
public:
std::string family;
struct gPixmap: public iObject
{
-DECLARE_REF;
+DECLARE_REF(gPixmap);
private:
friend class gDC;
void fill(const gRegion &clip, const gColor &color);
/* gRC is the singleton which controls the fifo and dispatches commands */
class gRC: public iObject
{
-DECLARE_REF;
+DECLARE_REF(gRC);
private:
static gRC *instance;
class gDC: public iObject
{
-DECLARE_REF;
+DECLARE_REF(gDC);
protected:
ePtr<gPixmap> m_pixmap;
void eListbox::setContent(iListboxContent *content)
{
m_content = content;
+ if (content)
+ m_content->setListbox(this);
entryReset();
}
void eListbox::moveSelection(int dir)
{
+ /* refuse to do anything without a valid list. */
+ if (!m_content)
+ return;
+
/* we need the old top/sel to see what we have to redraw */
int oldtop = m_top;
int oldsel = m_selected;
{
ePtr<eWindowStyle> style;
+ if (!m_content)
+ return eWidget::event(event, data, data2);
assert(m_content);
recalcSize(); // move to event
void eListbox::entryReset()
{
- invalidate();
if (m_content)
m_content->cursorHome();
m_top = 0;
m_selected = 0;
+ invalidate();
+ eDebug("inval!");
}
anyway. */
#ifndef SWIG
protected:
+ iListboxContent();
friend class eListbox;
virtual void cursorHome()=0;
virtual void cursorEnd()=0;
pageDown,
justCheck
};
-protected:
- int event(int event, void *data=0, void *data2=0);
- void recalcSize();
-private:
- friend class iListboxContent;
-
+
+#ifndef SWIG
/* entryAdded: an entry was added *before* the given index. it's index is the given number. */
void entryAdded(int index);
/* entryRemoved: an entry with the given index was removed. */
void entryChanged(int index);
/* the complete list changed. you should not attemp to keep the current index. */
void entryReset();
+
+protected:
+ int event(int event, void *data=0, void *data2=0);
+ void recalcSize();
+private:
int m_top, m_selected;
int m_itemheight;
int m_items_per_page;
ePtr<iListboxContent> m_content;
+#endif
+
};
#endif
{
}
+iListboxContent::iListboxContent(): m_listbox(0)
+{
+}
+
void iListboxContent::setListbox(eListbox *lb)
{
m_listbox = lb;
class eListboxTestContent: public virtual iListboxContent
{
- DECLARE_REF;
+ DECLARE_REF(eListboxTestContent);
public:
#ifndef SWIG
class eListboxStringContent: public virtual iListboxContent
{
- DECLARE_REF;
+ DECLARE_REF(eListboxStringContent);
public:
eListboxStringContent();
void setList(std::list<std::string> &list);
class eListboxPythonStringContent: public virtual iListboxContent
{
- DECLARE_REF;
+ DECLARE_REF(eListboxPythonStringContent);
public:
eListboxPythonStringContent();
~eListboxPythonStringContent();
#include <lib/base/eptrlist.h> /* for eSmartPtrList */
#include <lib/gui/ewindowstyle.h> /* for eWindowStyle */
-class eWindowStyle;
-
class eWidget
{
friend class eWidgetDesktop;
painter.line(frame.bottomRight1(), frame.bottomLeft1());
painter.line(frame.bottomLeft1(), frame.topLeft1());
}
+
+DEFINE_REF(eWindowStyleSkinned);
+
+eWindowStyleSkinned::eWindowStyleSkinned()
+{
+}
+
+void eWindowStyleSkinned::handleNewSize(eWindow *wnd, const eSize &size)
+{
+}
+
+void eWindowStyleSkinned::paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title)
+{
+}
+
+void eWindowStyleSkinned::paintBackground(gPainter &painter, const ePoint &offset, const eSize &size)
+{
+}
+
+void eWindowStyleSkinned::setStyle(gPainter &painter, int what)
+{
+}
+
+void eWindowStyleSkinned::drawFrame(gPainter &painter, const eRect &frame, int what)
+{
+}
+
+void eWindowStyleSkinned::drawBorder(gPainter &painter, const eSize &size, const struct borderSet &border, int where)
+{
+}
+
class eWindowStyleSimple: public eWindowStyle
{
- DECLARE_REF;
+ DECLARE_REF(eWindowStyleSimple);
private:
ePtr<gFont> m_fnt;
gColor m_border_color_tl, m_border_color_br, m_title_color_back, m_title_color, m_background_color;
void drawFrame(gPainter &painter, const eRect &frame, int what);
};
+class eWindowStyleSkinned: public eWindowStyle
+{
+ DECLARE_REF(eWindowStyleSkinned);
+public:
+ eWindowStyleSkinned();
+ void handleNewSize(eWindow *wnd, const eSize &size);
+ void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title);
+ void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size);
+ void setStyle(gPainter &painter, int what);
+ void drawFrame(gPainter &painter, const eRect &frame, int what);
+
+ enum {
+ bsWindow,
+ bsButton,
+#ifndef SWIG
+ bsMax
+#endif
+ };
+
+ enum {
+ bpTopLeft = 1,
+ bpTop = 2,
+ bpTopRight = 4,
+ bpLeft = 8,
+ bpRight = 0x10,
+ bpBottomLeft = 0x20,
+ bpBottom = 0x40,
+ bpBottomRight = 0x80,
+ bpBackground = 0x100
+ };
+private:
+ struct borderSet
+ {
+ ePtr<gPixmap> m_pixmap[9];
+ };
+
+ void drawBorder(gPainter &painter, const eSize &size, const struct borderSet &border, int where);
+};
+
#endif
class eNavigation: public iObject, public Object
{
- DECLARE_REF;
+ DECLARE_REF(eNavigation);
private:
ePtr<iPlayableService> m_runningService;
ePtr<iServiceHandler> m_servicehandler;
class pNavigation: public iObject, public Object
{
-DECLARE_REF;
+DECLARE_REF(pNavigation);
public:
PSignal1<void, int> m_event;
-#ifndef __lib_nav_playlist_h
-#define __lib_nav_playlist_h
-
-#include <list>
-#include <lib/base/object.h>
-#include <lib/service/iservice.h>
-
-class ePlaylist: public iObject, public std::list<eServiceReference>
-{
-DECLARE_REF;
-public:
- ePlaylist();
- virtual ~ePlaylist();
- std::list<eServiceReference>::iterator m_current;
-};
-
-#endif
class eHTTPDyn: public eHTTPDataSource
{
- DECLARE_REF;
+ DECLARE_REF(eHTTPDyn);
private:
std::string result;
int wptr, size;
class eHTTPDynPathResolver: public iHTTPPathResolver
{
- DECLARE_REF;
+ DECLARE_REF(eHTTPDynPathResolver);
private:
- struct eHTTPDynEntry
+ struct eHTTPDynEntry: public iObject
{
- DECLARE_REF;
+ DECLARE_REF(eHTTPDynEntry);
public:
std::string request, path;
std::string (*function)(std::string request, std::string path, std::string opt, eHTTPConnection *content);
class eHTTPFile: public eHTTPDataSource
{
- DECLARE_REF;
+ DECLARE_REF(eHTTPFile);
private:
int fd, size;
const char *mime;
class eHTTPFilePathResolver: public iHTTPPathResolver
{
- DECLARE_REF;
+ DECLARE_REF(eHTTPFilePathResolver);
public:
struct eHTTPFilePath
{
class eHTTPError: public eHTTPDataSource
{
- DECLARE_REF;
+ DECLARE_REF(eHTTPError);
private:
int errcode;
public:
class eHTTPXMLRPCResolver: public iHTTPPathResolver
{
- DECLARE_REF;
+ DECLARE_REF(eHTTPXMLRPCResolver);
public:
eHTTPXMLRPCResolver();
eHTTPDataSource *getDataSource(std::string request, std::string path, eHTTPConnection *conn);
enigma_python_wrap.cxx: enigma_python.i
swig -I$(top_srcdir)/ -c++ -python enigma_python.i
+
+enigma_python.i: enigma_iobject.i
+
+enigma_iobject.i:
+ find ../../.. -name "*.cpp" | xargs grep -h "DEFINE_REF" > enigma_iobject.i
+
\ No newline at end of file
is usually caused by not marking PSignals as immutable.
*/
-%define RefCount(...)
-%typemap(newfree) __VA_ARGS__ * { eDebug("adding ref"); $1->AddRef(); }
-%extend __VA_ARGS__ { ~__VA_ARGS__() { eDebug("removing ref!"); self->Release(); } }
-%ignore __VA_ARGS__::~__VA_ARGS__();
-%enddef
-
%module enigma
%{
+
#define SWIG_COMPILE
#include <lib/base/ebase.h>
#include <lib/base/smartptr.h>
#include <lib/gui/ebutton.h>
#include <lib/gui/ewindow.h>
#include <lib/gui/ewidgetdesktop.h>
+#include <lib/gui/ewindowstyle.h>
#include <lib/gui/eslider.h>
#include <lib/python/connections.h>
#include <lib/gui/elistbox.h>
extern PSignal1<void,int> &keyPressedSignal();
%}
-RefCount(eListboxPythonStringContent)
-RefCount(eListboxServiceContent)
-RefCount(eComponentScan)
+%feature("ref") iObject "$this->AddRef(); eDebug(\"AddRef (%s:%d)!\", __FILE__, __LINE__); "
+%feature("unref") iObject "$this->Release(); eDebug(\"Release! %s:%d\", __FILE__, __LINE__); "
+
+%newobject eDebugClassPtr::operator->;
#define DEBUG
%include "typemaps.i"
%include <lib/base/smartptr.h>
%include <lib/service/iservice.h>
%include <lib/service/service.h>
+
%template(eServiceCenterPtr) ePtr<eServiceCenter>;
%include <lib/service/event.h>
%include <lib/gui/ewidgetdesktop.h>
%include <lib/gui/elistbox.h>
%include <lib/gui/elistboxcontent.h>
+%include <lib/gui/ewindowstyle.h>
%include <lib/service/listboxservice.h>
%include <lib/components/scan.h>
%include <lib/nav/pcore.h>
/************** eptr **************/
%template(eActionMapPtr) ePtr<eActionMap>;
-RefCount(eActionMap)
%apply eActionMapPtr OUTPUT { eActionMapPtr &ptr }
%apply eActionMap* *OUTPUT { eActionMap **ptr }
void quitMainloop();
%immutable keyPressed;
PSignal1<void,int> &keyPressedSignal();
+
RESULT eServiceEvent::parseFrom(Event *evt)
{
m_begin = 0; // ich bin FAUL
- m_duration = evt->getDuration();
-
+ m_duration = (evt->getDuration() & 0xFF) + ((evt->getDuration() >> 8) & 0xFF) * 60 + ((evt->getDuration() >> 16) & 0xFF) * 24 * 60;
for (DescriptorConstIterator desc = evt->getDescriptors()->begin(); desc != evt->getDescriptors()->end(); ++desc)
{
}
}
}
+ return 0;
}
+
+DEFINE_REF(eDebugClass);
class eServiceEvent: public iObject
{
-DECLARE_REF;
+DECLARE_REF(eServiceEvent);
public:
time_t m_begin;
int m_duration;
TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
+class eDebugClass: public iObject
+{
+ DECLARE_REF(eDebugClass);
+public:
+ int x;
+ static void getDebug(ePtr<eDebugClass> &ptr, int x) { ptr = new eDebugClass(x); }
+ eDebugClass(int i) { printf("build debug class %d\n", i); x = i; }
+ ~eDebugClass() { printf("remove debug class %d\n", x); }
+};
+
+// TEMPLATE_TYPEDEF(ePtr<eDebugClass>, eDebugClassPtr);
+
#endif
void eListboxServiceContent::setRoot(const eServiceReference &root)
{
+ m_list.clear();
m_root = root;
assert(m_service_center);
m_size = m_list.size();
cursorHome();
+
+ if (m_listbox)
+ m_listbox->entryReset();
}
void eListboxServiceContent::getCurrent(eServiceReference &ref)
class eListboxServiceContent: public virtual iListboxContent
{
- DECLARE_REF;
+ DECLARE_REF(eListboxServiceContent);
public:
eListboxServiceContent();
void setRoot(const eServiceReference &ref);
class eServiceCenter: public iServiceHandler
{
-DECLARE_REF;
+DECLARE_REF(eServiceCenter);
private:
std::map<int,iServiceHandlerPtr> handler;
static eServiceCenter *instance;
class eServiceFactoryDVB: public iServiceHandler
{
-DECLARE_REF;
+DECLARE_REF(eServiceFactoryDVB);
public:
eServiceFactoryDVB();
virtual ~eServiceFactoryDVB();
class eDVBServiceList: public iListableService
{
-DECLARE_REF;
+DECLARE_REF(eDVBServiceList);
private:
eServiceReference m_parent;
friend class eServiceFactoryDVB;
class eDVBServicePlay: public iPlayableService, public Object, public iServiceInformation
{
-DECLARE_REF;
+DECLARE_REF(eDVBServicePlay);
private:
friend class eServiceFactoryDVB;
eServiceReference m_reference;
class eStaticServiceFSInformation: public iStaticServiceInformation
{
- DECLARE_REF;
+ DECLARE_REF(eStaticServiceFSInformation);
public:
RESULT getName(const eServiceReference &ref, std::string &name);
};
class eServiceFactoryFS: public iServiceHandler
{
-DECLARE_REF;
+DECLARE_REF(eServiceFactoryFS);
public:
eServiceFactoryFS();
virtual ~eServiceFactoryFS();
class eServiceFS: public iListableService
{
-DECLARE_REF;
+DECLARE_REF(eServiceFS);
private:
std::string path;
friend class eServiceFactoryFS;
class eServiceFactoryMP3: public iServiceHandler
{
-DECLARE_REF;
+DECLARE_REF(eServiceFactoryMP3);
public:
eServiceFactoryMP3();
virtual ~eServiceFactoryMP3();
class eStaticServiceMP3Info: public iServiceInformation
{
- DECLARE_REF;
+ DECLARE_REF(eStaticServiceMP3Info);
friend class eServiceFactoryMP3;
eStaticServiceMP3Info();
public:
class eServiceMP3: public iPlayableService, public iPauseableService, public iServiceInformation, public Object
{
-DECLARE_REF;
+DECLARE_REF(eServiceMP3);
private:
friend class eServiceFactoryMP3;
std::string filename;
# we thus have one (static) hierarchy of screens (classes, not instances)
# and one with the instanciated components itself (both global and dynamic)
+had = dict()
+
def dump(dir, p = ""):
if isinstance(dir, dict):
for (entry, val) in dir.items():
- dump(val, p + "/" + entry)
- print p + ":" + str(dir.__class__)
+ dump(val, p + "(dict)/" + entry)
+ if hasattr(dir, "__dict__"):
+ for name, value in dir.__dict__.items():
+ if not had.has_key(str(value)):
+ had[str(value)] = 1
+ dump(value, p + "/" + str(name))
+ else:
+ print p + "/" + str(name) + ":" + str(dir.__class__) + "(cycle)"
+ else:
+ print p + ":" + str(dir)
+
+# + ":" + str(dir.__class__)
# defined components
components = {}
self.execEnd()
self.currentDialog.doClose()
+ dump(self.currentDialog)
+ print sys.getrefcount(self.currentDialog)
del self.currentDialog
del self.currentWindow
runScreenTest()
# now, run the mainloop
+
+#pt = eDebugClassPtr()
+#eDebugClass.getDebug(pt, 12)
+#p = pt.__deref__()
+#print pt.x
+#print p.x
+#print "removing ptr..."
+#pt = 0
+#print "now"
+#print "p is " + str(p)
+#print p.x
+#p = 0
+#
+#bla = eDebugClass()
+#bla = eDebugClass(2)
+#
+
# never call this directly - it will be called from the session!
def doClose(self):
GUISkin.close(self)
+
+ for (name, val) in self.items():
+ print "%s -> %d" % (name, sys.getrefcount(val))
+ del self[name]
def close(self, retval=None):
self.session.close()
self["list"].setRoot(eServiceReference("1:0:1:0:0:0:0:0:0:0:PREMIERE"))
self["okbutton"] = Button("ok", [self.channelSelected])
-
- self["actions"] = ActionMap("ChannelSelectActions",
+
+ class ChannelActionMap(ActionMap):
+ def action(self, context, action):
+ if action[:7] == "bouquet":
+ print "setting root to " + action[8:]
+ self.csel["list"].setRoot(eServiceReference("1:0:1:0:0:0:0:0:0:0:" + action[8:]))
+ else:
+ ActionMap.action(self, context, action)
+
+ self["actions"] = ChannelActionMap("ChannelSelectActions",
{
"selectChannel": self.channelSelected,
})
+ self["actions"].csel = self
def channelSelected(self):
self.session.nav.playService(self["list"].getCurrent())
"switchChannel": self.switchChannel,
"mainMenu": self.mainMenu
})
- self["channelSwitcher"] = Button("switch Channel", [self.switchChannel])
self["okbutton"] = Button("mainMenu", [self.mainMenu])
+ self["CurrentTime"] = Clock()
+
self["ServiceName"] = ServiceName(self.session.nav)
self["Event_Now"] = EventInfo(self.session.nav, EventInfo.Now)
self["Event_Next"] = EventInfo(self.session.nav, EventInfo.Next)
+
+ self["Event_Now_Duration"] = EventInfo(self.session.nav, EventInfo.Now_Duration)
+ self["Event_Next_Duration"] = EventInfo(self.session.nav, EventInfo.Next_Duration)
def mainMenu(self):
self.session.open(mainMenu)
self["okbutton"] = b
self["title"] = Header("clock dialog: here you see the current uhrzeit!")
-
class serviceScan(Screen):
def ok(self):
if self["scan"].isDone():
<widget name="title" position="10,120" size="280,50" />
<widget name="theClock" position="10,60" size="280,50" />
</screen>
- <screen name="infoBar" position="100,100" size="300,400" title="InfoBar">
- <widget name="channelSwitcher" position="10,190" size="280,50" />
+ <screen name="infoBar" position="80,350" size="540,150" title="InfoBar">
+ <widget name="CurrentTime" position="10,10" size="40,30" />
<widget name="ServiceName" position="50,20" size="200,30" />
- <widget name="Event_Now" position="50,50" size="200,30" />
- <widget name="Event_Next" position="50,80" size="200,30" />
+ <widget name="Event_Now" position="100,40" size="300,30" />
+ <widget name="Event_Next" position="100,90" size="300,30" />
+ <widget name="Event_Now_Duration" position="440,40" size="80,30" />
+ <widget name="Event_Next_Duration" position="440,90" size="80,30" />
</screen>
- <screen name="channelSelection" position="300,100" size="300,300" title="Channel Selection">
- <widget name="okbutton" position="10,190" size="280,50" />
- <widget name="list" position="10,30" size="280,140" />
+ <screen name="channelSelection" position="100,80" size="500,240" title="Channel Selection">
+ <widget name="list" position="20,50" size="300,150" />
+ <widget name="okbutton" position="340,50" size="140,30" />
</screen>
<screen name="serviceScan" position="150,100" size="300,200" title="Service Scan">
<widget name="scan_progress" position="10,10" size="280,50" />