- hopefully fixed some python/refcount stuff (__deref__ is still evil!)
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 27 Feb 2005 02:20:31 +0000 (02:20 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 27 Feb 2005 02:20:31 +0000 (02:20 +0000)
 - first work on skin support, not really far
 - improved infobar
 - deletes components when destroying screens
 - fixed elistbox and component
 - add ability to change bouqet - real query parser still unfinished

47 files changed:
components.py
include/connection.h
keymap.xml
lib/base/ebase.h
lib/base/object.h
lib/components/scan.h
lib/dvb/db.h
lib/dvb/decoder.h
lib/dvb/demux.h
lib/dvb/dvb.h
lib/dvb/esection.h
lib/dvb/frontend.h
lib/dvb/idvb.h
lib/dvb/list.h
lib/dvb/scan.h
lib/dvb/sec.h
lib/gdi/font.h
lib/gdi/gpixmap.h
lib/gdi/grc.h
lib/gui/elistbox.cpp
lib/gui/elistbox.h
lib/gui/elistboxcontent.cpp
lib/gui/elistboxcontent.h
lib/gui/ewidget.h
lib/gui/ewindowstyle.cpp
lib/gui/ewindowstyle.h
lib/nav/core.h
lib/nav/pcore.h
lib/nav/playlist.h
lib/network/http_dyn.h
lib/network/http_file.h
lib/network/httpd.h
lib/network/xmlrpc.h
lib/python/Makefile.am
lib/python/enigma_python.i
lib/service/event.cpp
lib/service/event.h
lib/service/listboxservice.cpp
lib/service/listboxservice.h
lib/service/service.h
lib/service/servicedvb.h
lib/service/servicefs.cpp
lib/service/servicefs.h
lib/service/servicemp3.h
mytest.py
screens.py
skin.py

index 219e4f5..a5df8ff 100644 (file)
@@ -159,7 +159,8 @@ class Clock(HTMLComponent, GUIComponent, VariableText):
 
 # "funktionalitaet"    
        def doClock(self):
 
 # "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):
 
 # realisierung als GUI
        def createWidget(self, parent, skindata):
@@ -270,6 +271,7 @@ class MenuList(HTMLComponent, GUIComponent):
        
        def GUIdelete(self):
                self.instance.setContent(None)
        
        def GUIdelete(self):
                self.instance.setContent(None)
+               del self.instance
 
 class ServiceList(HTMLComponent, GUIComponent):
        def __init__(self):
 
 class ServiceList(HTMLComponent, GUIComponent):
        def __init__(self):
@@ -316,18 +318,24 @@ class ServiceScan:
                self.progressbar = progressbar
                self.text = text
                self.scan = eComponentScan()
                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
                if self.scan.start():
                        self.state = self.Error
                else:
                        self.state = self.Running
-               self.scan.statusChanged.get().append(self.scanStatusChanged)
                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 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 ActionMap:
        def __init__(self, context, actions = { }, prio=0):
@@ -376,6 +384,9 @@ class PerServiceDisplay(GUIComponent, VariableText):
 class EventInfo(PerServiceDisplay):
        Now = 0
        Next = 1
 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
        def __init__(self, navcore, now_or_next):
                # listen to evUpdatedEventInfo and evStopService
                # note that evStopService will be called once to establish a known state
@@ -392,10 +403,12 @@ class EventInfo(PerServiceDisplay):
                
                if not self.navcore.getCurrentService(service):
                        if not service.info(info):
                
                if not self.navcore.getCurrentService(service):
                        if not service.info(info):
-                               print "got info !"
                                ev = eServiceEventPtr()
                                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):
                print "new event info in EventInfo! yeah!"
 
        def stopEvent(self):
index 5ae90d5..a6fc4b5 100644 (file)
@@ -6,7 +6,7 @@
 
 class eConnection: public iObject, public Connection
 {
 
 class eConnection: public iObject, public Connection
 {
-DECLARE_REF;
+DECLARE_REF(eConnection);
 private:
        ePtr<iObject> m_owner;
 public:
 private:
        ePtr<iObject> m_owner;
 public:
index a17aebb..82b8a50 100644 (file)
        
        <map context="ChannelSelectActions">
                <key id=" " mapto="selectChannel" flags="mr" />
        
        <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">
                
        </map>
        <map context="WindowActions">
                
index 187f954..d9a17b7 100644 (file)
@@ -171,40 +171,7 @@ public:
        void setRequested(int req) { requested=req; }
 };
 
        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
 
                        // werden in einer mainloop verarbeitet
 class eMainloop
@@ -231,6 +198,7 @@ public:
        void exit_loop();
 };
 
        void exit_loop();
 };
 
+
 /**
  * \brief The application class.
  *
 /**
  * \brief The application class.
  *
@@ -250,4 +218,40 @@ public:
                eApp = 0;
        }
 };
                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
 #endif
index 64d9a88..edd68a8 100644 (file)
@@ -37,12 +37,22 @@ public:
        }
 };
 
        }
 };
 
-#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
 #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
 
 #endif
index 073919c..ca64f5e 100644 (file)
@@ -7,7 +7,7 @@ class eDVBScan;
 
 class eComponentScan: public Object, public iObject
 {
 
 class eComponentScan: public Object, public iObject
 {
-DECLARE_REF;
+DECLARE_REF(eComponentScan);
 private:
        void scanEvent(int event);
        ePtr<eConnection> m_scan_event_connection;
 private:
        void scanEvent(int event);
        ePtr<eConnection> m_scan_event_connection;
index 55998eb..22eb0b7 100644 (file)
@@ -8,7 +8,7 @@ class ServiceDescriptionTable;
 
 class eDVBDB: public iDVBChannelList
 {
 
 class eDVBDB: public iDVBChannelList
 {
-DECLARE_REF;
+DECLARE_REF(eDVBDB);
        friend class eDVBDBQuery;
 private:
        struct channel
        friend class eDVBDBQuery;
 private:
        struct channel
@@ -37,7 +37,7 @@ public:
        // we have to add a possibility to invalidate here.
 class eDVBDBQuery: public iDVBChannelListQuery
 {
        // 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;
 private:
        std::map<eServiceReferenceDVB, ePtr<eDVBService> >::iterator m_cursor;
        ePtr<eDVBDB> m_db;
index b1e6561..b566df8 100644 (file)
@@ -6,7 +6,7 @@
 
 class eDVBAudio: public iObject
 {
 
 class eDVBAudio: public iObject
 {
-DECLARE_REF;
+DECLARE_REF(eDVBAudio);
 private:
        ePtr<eDVBDemux> m_demux;
        int m_fd, m_fd_demux;
 private:
        ePtr<eDVBDemux> m_demux;
        int m_fd, m_fd_demux;
@@ -19,7 +19,7 @@ public:
 
 class eDVBVideo: public iObject
 {
 
 class eDVBVideo: public iObject
 {
-DECLARE_REF;
+DECLARE_REF(eDVBVideo);
 private:
        ePtr<eDVBDemux> m_demux;
        int m_fd, m_fd_demux;
 private:
        ePtr<eDVBDemux> m_demux;
        int m_fd, m_fd_demux;
@@ -32,7 +32,7 @@ public:
 
 class eTSMPEGDecoder: public iTSMPEGDecoder
 {
 
 class eTSMPEGDecoder: public iTSMPEGDecoder
 {
-DECLARE_REF;
+DECLARE_REF(eTSMPEGDecoder);
 private:
        ePtr<eDVBDemux> m_demux;
        ePtr<eDVBAudio> m_audio;
 private:
        ePtr<eDVBDemux> m_demux;
        ePtr<eDVBAudio> m_audio;
index c7fa5bc..d8c1078 100644 (file)
@@ -11,7 +11,7 @@ class eDVBDemux: public iDVBDemux
        friend class eDVBAudio;
        friend class eDVBVideo;
 public:
        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);
        eDVBDemux(int adapter, int demux);
        virtual ~eDVBDemux();
        RESULT createSectionReader(eMainloop *context, ePtr<iDVBSectionReader> &reader);
@@ -20,7 +20,7 @@ public:
 
 class eDVBSectionReader: public iDVBSectionReader, public Object
 {
 
 class eDVBSectionReader: public iDVBSectionReader, public Object
 {
-       DECLARE_REF
+       DECLARE_REF(eDVBSectionReader);
 private:
        int fd;
        Signal1<void, const __u8*> read;
 private:
        int fd;
        Signal1<void, const __u8*> read;
index 52dd9a0..8a13b40 100644 (file)
@@ -10,7 +10,7 @@ class eDVBChannel;
 
 class eDVBResourceManager: public iDVBResourceManager
 {
 
 class eDVBResourceManager: public iDVBResourceManager
 {
-       DECLARE_REF;
+       DECLARE_REF(eDVBResourceManager);
        int avail, busy;
        struct adapter
        {
        int avail, busy;
        struct adapter
        {
@@ -40,7 +40,7 @@ public:
 
 class eDVBChannel: public iDVBChannel, public eDVBDemux, public Object
 {
 
 class eDVBChannel: public iDVBChannel, public eDVBDemux, public Object
 {
-       DECLARE_REF;
+       DECLARE_REF(eDVBChannel);
 private:
        ePtr<eDVBFrontend> m_frontend;
        ePtr<iDVBFrontendParameters> m_current_frontend_parameters;
 private:
        ePtr<eDVBFrontend> m_frontend;
        ePtr<iDVBFrontendParameters> m_current_frontend_parameters;
index 6b8c878..df0b93e 100644 (file)
@@ -6,7 +6,7 @@
 
 class eGTable: public iObject, public Object
 {
 
 class eGTable: public iObject, public Object
 {
-DECLARE_REF;
+DECLARE_REF(eGTable);
 private:
        ePtr<iDVBSectionReader> m_reader;
        eDVBTableSpec m_table;
 private:
        ePtr<iDVBSectionReader> m_reader;
        eDVBTableSpec m_table;
index 9036dc3..f4e99fa 100644 (file)
@@ -6,7 +6,7 @@
 
 class eDVBFrontendParameters: public iDVBFrontendParameters
 {
 
 class eDVBFrontendParameters: public iDVBFrontendParameters
 {
-       DECLARE_REF;
+       DECLARE_REF(eDVBFrontendParameters);
        union
        {
                eDVBFrontendParametersSatellite sat;
        union
        {
                eDVBFrontendParametersSatellite sat;
@@ -33,7 +33,7 @@ public:
 
 class eDVBFrontend: public iDVBFrontend, public Object
 {
 
 class eDVBFrontend: public iDVBFrontend, public Object
 {
-       DECLARE_REF;
+       DECLARE_REF(eDVBFrontend);
        int m_type;
        int m_fd;
 #if HAVE_DVB_API_VERSION < 3
        int m_type;
        int m_fd;
 #if HAVE_DVB_API_VERSION < 3
index 4d728b4..da62686 100644 (file)
@@ -160,7 +160,7 @@ class eDVBChannelQuery;
 
 class eDVBService: public iStaticServiceInformation
 {
 
 class eDVBService: public iStaticServiceInformation
 {
-       DECLARE_REF;
+       DECLARE_REF(eDVBService);
 public:
        eDVBService();
        std::string m_service_name;
 public:
        eDVBService();
        std::string m_service_name;
@@ -194,7 +194,7 @@ public:
 
 class eDVBChannelQuery: public iObject
 {
 
 class eDVBChannelQuery: public iObject
 {
-       DECLARE_REF;
+       DECLARE_REF(eDVBChannelQuery);
 public:
        enum
        {
 public:
        enum
        {
index 6df4980..80ad20e 100644 (file)
@@ -3,7 +3,7 @@
 
 class eDVBTransponderList: iDVBChannelList
 {
 
 class eDVBTransponderList: iDVBChannelList
 {
-       DECLARE_REF;
+       DECLARE_REF(eDVBTransponderList);
 private:
        std::map<eDVBChannelID, ePtr<iDVBFrontendParameters> > channels;
 public:
 private:
        std::map<eDVBChannelID, ePtr<iDVBFrontendParameters> > channels;
 public:
index 96264e8..2f75291 100644 (file)
@@ -10,7 +10,7 @@
 
 class eDVBScan: public Object, public iObject
 {
 
 class eDVBScan: public Object, public iObject
 {
-DECLARE_REF;
+DECLARE_REF(eDVBScan);
 private:
                /* chid helper functions: */
                
 private:
                /* chid helper functions: */
                
index 0bda004..ea01108 100644 (file)
@@ -7,7 +7,7 @@
 class eDVBSatelliteEquipmentControl: public iDVBSatelliteEquipmentControl
 {
 public:
 class eDVBSatelliteEquipmentControl: public iDVBSatelliteEquipmentControl
 {
 public:
-       DECLARE_REF;
+       DECLARE_REF(eDVBSatelliteEquipmentControl);
        eDVBSatelliteEquipmentControl();
        RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat);
 };
        eDVBSatelliteEquipmentControl();
        RESULT prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, eDVBFrontendParametersSatellite &sat);
 };
index a17fee7..ff2a88c 100644 (file)
@@ -79,7 +79,7 @@ class eLCD;
 
 class eTextPara: public iObject
 {
 
 class eTextPara: public iObject
 {
-DECLARE_REF;
+DECLARE_REF(eTextPara);
 private:
        ePtr<Font> current_font, replacement_font;
        FT_Face current_face, replacement_face;
 private:
        ePtr<Font> current_font, replacement_font;
        FT_Face current_face, replacement_face;
@@ -139,7 +139,7 @@ public:
 
 class Font: public iObject
 {
 
 class Font: public iObject
 {
-DECLARE_REF;
+DECLARE_REF(Font);
 public:
        FTC_Image_Desc font;
        fontRenderClass *renderer;
 public:
        FTC_Image_Desc font;
        fontRenderClass *renderer;
index 9dd170a..396d92b 100644 (file)
@@ -89,7 +89,7 @@ struct gLookup
  */
 class gFont: public iObject
 {
  */
 class gFont: public iObject
 {
-DECLARE_REF;
+DECLARE_REF(gFont);
 public:
 
        std::string family;
 public:
 
        std::string family;
@@ -133,7 +133,7 @@ struct gSurfaceSystem: gSurface
 
 struct gPixmap: public iObject
 {
 
 struct gPixmap: public iObject
 {
-DECLARE_REF;
+DECLARE_REF(gPixmap);
 private:
        friend class gDC;
        void fill(const gRegion &clip, const gColor &color);
 private:
        friend class gDC;
        void fill(const gRegion &clip, const gColor &color);
index 5eb8131..f682990 100644 (file)
@@ -124,7 +124,7 @@ struct gOpcode
                /* gRC is the singleton which controls the fifo and dispatches commands */
 class gRC: public iObject
 {
                /* gRC is the singleton which controls the fifo and dispatches commands */
 class gRC: public iObject
 {
-DECLARE_REF;
+DECLARE_REF(gRC);
 private:
        static gRC *instance;
        
 private:
        static gRC *instance;
        
@@ -212,7 +212,7 @@ public:
 
 class gDC: public iObject
 {
 
 class gDC: public iObject
 {
-DECLARE_REF;
+DECLARE_REF(gDC);
 protected:
        ePtr<gPixmap> m_pixmap;
 
 protected:
        ePtr<gPixmap> m_pixmap;
 
index 1dae137..a3fae34 100644 (file)
@@ -22,11 +22,17 @@ eListbox::~eListbox()
 void eListbox::setContent(iListboxContent *content)
 {
        m_content = content;
 void eListbox::setContent(iListboxContent *content)
 {
        m_content = content;
+       if (content)
+               m_content->setListbox(this);
        entryReset();
 }
 
 void eListbox::moveSelection(int dir)
 {
        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;
                /* we need the old top/sel to see what we have to redraw */
        int oldtop = m_top;
        int oldsel = m_selected;
@@ -98,6 +104,8 @@ int eListbox::event(int event, void *data, void *data2)
        {
                ePtr<eWindowStyle> style;
                
        {
                ePtr<eWindowStyle> style;
                
+               if (!m_content)
+                       return eWidget::event(event, data, data2);
                assert(m_content);
                recalcSize(); // move to event
                
                assert(m_content);
                recalcSize(); // move to event
                
@@ -183,9 +191,10 @@ void eListbox::entryChanged(int index)
 
 void eListbox::entryReset()
 {
 
 void eListbox::entryReset()
 {
-       invalidate();
        if (m_content)
                m_content->cursorHome();
        m_top = 0;
        m_selected = 0;
        if (m_content)
                m_content->cursorHome();
        m_top = 0;
        m_selected = 0;
+       invalidate();
+       eDebug("inval!");
 }
 }
index 78e0fbe..9e23bde 100644 (file)
@@ -21,6 +21,7 @@ public:
                   anyway. */
 #ifndef SWIG   
 protected:
                   anyway. */
 #ifndef SWIG   
 protected:
+       iListboxContent();
        friend class eListbox;
        virtual void cursorHome()=0;
        virtual void cursorEnd()=0;
        friend class eListbox;
        virtual void cursorHome()=0;
        virtual void cursorEnd()=0;
@@ -72,12 +73,8 @@ public:
                pageDown,
                justCheck
        };
                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. */
                /* 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. */
@@ -86,11 +83,18 @@ private:
        void entryChanged(int index);
                /* the complete list changed. you should not attemp to keep the current index. */
        void entryReset();
        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;
        int m_top, m_selected;
        int m_itemheight;
        int m_items_per_page;
        ePtr<iListboxContent> m_content;
+#endif
+
 };
 
 #endif
 };
 
 #endif
index 0a10b27..209b525 100644 (file)
@@ -29,6 +29,10 @@ iListboxContent::~iListboxContent()
 {
 }
 
 {
 }
 
+iListboxContent::iListboxContent(): m_listbox(0)
+{
+}
+
 void iListboxContent::setListbox(eListbox *lb)
 {
        m_listbox = lb;
 void iListboxContent::setListbox(eListbox *lb)
 {
        m_listbox = lb;
index deea300..a2e1fd3 100644 (file)
@@ -6,7 +6,7 @@
 
 class eListboxTestContent: public virtual iListboxContent
 {
 
 class eListboxTestContent: public virtual iListboxContent
 {
-       DECLARE_REF;
+       DECLARE_REF(eListboxTestContent);
 public:
 
 #ifndef SWIG
 public:
 
 #ifndef SWIG
@@ -37,7 +37,7 @@ private:
 
 class eListboxStringContent: public virtual iListboxContent
 {
 
 class eListboxStringContent: public virtual iListboxContent
 {
-       DECLARE_REF;
+       DECLARE_REF(eListboxStringContent);
 public:
        eListboxStringContent();
        void setList(std::list<std::string> &list);
 public:
        eListboxStringContent();
        void setList(std::list<std::string> &list);
@@ -75,7 +75,7 @@ private:
 
 class eListboxPythonStringContent: public virtual iListboxContent
 {
 
 class eListboxPythonStringContent: public virtual iListboxContent
 {
-       DECLARE_REF;
+       DECLARE_REF(eListboxPythonStringContent);
 public:
        eListboxPythonStringContent();
        ~eListboxPythonStringContent();
 public:
        eListboxPythonStringContent();
        ~eListboxPythonStringContent();
index 12d2e74..97eb143 100644 (file)
@@ -5,8 +5,6 @@
 #include <lib/base/eptrlist.h> /* for eSmartPtrList */
 #include <lib/gui/ewindowstyle.h> /* for eWindowStyle */
 
 #include <lib/base/eptrlist.h> /* for eSmartPtrList */
 #include <lib/gui/ewindowstyle.h> /* for eWindowStyle */
 
-class eWindowStyle;
-
 class eWidget
 {
        friend class eWidgetDesktop;
 class eWidget
 {
        friend class eWidgetDesktop;
index ccf7299..3b8271f 100644 (file)
@@ -105,3 +105,34 @@ void eWindowStyleSimple::drawFrame(gPainter &painter, const eRect &frame, int wh
        painter.line(frame.bottomRight1(), frame.bottomLeft1());
        painter.line(frame.bottomLeft1(), frame.topLeft1());
 }
        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)
+{
+}
+
index 74ff88d..6431c24 100644 (file)
@@ -32,7 +32,7 @@ public:
 
 class eWindowStyleSimple: public eWindowStyle
 {
 
 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;
 private:
        ePtr<gFont> m_fnt;
        gColor m_border_color_tl, m_border_color_br, m_title_color_back, m_title_color, m_background_color;
@@ -47,4 +47,43 @@ public:
        void drawFrame(gPainter &painter, const eRect &frame, int what);
 };
 
        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
 #endif
index c049e43..6c94fe2 100644 (file)
@@ -8,7 +8,7 @@
 
 class eNavigation: public iObject, public Object
 {
 
 class eNavigation: public iObject, public Object
 {
-       DECLARE_REF;
+       DECLARE_REF(eNavigation);
 private:
        ePtr<iPlayableService> m_runningService;
        ePtr<iServiceHandler> m_servicehandler;
 private:
        ePtr<iPlayableService> m_runningService;
        ePtr<iServiceHandler> m_servicehandler;
index 004bab2..1a910b8 100644 (file)
@@ -8,7 +8,7 @@
 
 class pNavigation: public iObject, public Object
 {
 
 class pNavigation: public iObject, public Object
 {
-DECLARE_REF;
+DECLARE_REF(pNavigation);
 public:
        PSignal1<void, int> m_event;
        
 public:
        PSignal1<void, int> m_event;
        
index 6d89406..e69de29 100644 (file)
@@ -1,17 +0,0 @@
-#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
index 6111640..24e4dba 100644 (file)
@@ -5,7 +5,7 @@
 
 class eHTTPDyn: public eHTTPDataSource
 {
 
 class eHTTPDyn: public eHTTPDataSource
 {
-       DECLARE_REF;
+       DECLARE_REF(eHTTPDyn);
 private:
        std::string result;
        int wptr, size;
 private:
        std::string result;
        int wptr, size;
@@ -17,11 +17,11 @@ public:
 
 class eHTTPDynPathResolver: public iHTTPPathResolver
 {
 
 class eHTTPDynPathResolver: public iHTTPPathResolver
 {
-       DECLARE_REF;
+       DECLARE_REF(eHTTPDynPathResolver);
 private:
 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);
        public:
                std::string request, path;
                std::string (*function)(std::string request, std::string path, std::string opt, eHTTPConnection *content);
index 6feb562..a9c86c5 100644 (file)
@@ -5,7 +5,7 @@
 
 class eHTTPFile: public eHTTPDataSource
 {
 
 class eHTTPFile: public eHTTPDataSource
 {
-       DECLARE_REF;
+       DECLARE_REF(eHTTPFile);
 private:       
        int fd, size;
        const char *mime;
 private:       
        int fd, size;
        const char *mime;
@@ -20,7 +20,7 @@ public:
 
 class eHTTPFilePathResolver: public iHTTPPathResolver
 {
 
 class eHTTPFilePathResolver: public iHTTPPathResolver
 {
-       DECLARE_REF;
+       DECLARE_REF(eHTTPFilePathResolver);
 public:
        struct eHTTPFilePath
        {
 public:
        struct eHTTPFilePath
        {
index 30c3c03..aa8c528 100644 (file)
@@ -41,7 +41,7 @@ typedef ePtr<eHTTPDataSource> eHTTPDataSourcePtr;
 
 class eHTTPError: public eHTTPDataSource
 {
 
 class eHTTPError: public eHTTPDataSource
 {
-       DECLARE_REF;
+       DECLARE_REF(eHTTPError);
 private:
        int errcode;
 public:
 private:
        int errcode;
 public:
index 05fd3cc..b43e8e3 100644 (file)
@@ -71,7 +71,7 @@ int xmlrpc_checkArgs(std::string args, std::vector<eXMLRPCVariant>&, ePtrList<eX
 
 class eHTTPXMLRPCResolver: public iHTTPPathResolver
 {
 
 class eHTTPXMLRPCResolver: public iHTTPPathResolver
 {
-       DECLARE_REF;
+       DECLARE_REF(eHTTPXMLRPCResolver);
 public:
        eHTTPXMLRPCResolver();
        eHTTPDataSource *getDataSource(std::string request, std::string path, eHTTPConnection *conn);
 public:
        eHTTPXMLRPCResolver();
        eHTTPDataSource *getDataSource(std::string request, std::string path, eHTTPConnection *conn);
index e82cb65..dbcf489 100644 (file)
@@ -9,3 +9,9 @@ libenigma_python_a_SOURCES = \
 
 enigma_python_wrap.cxx: enigma_python.i
        swig -I$(top_srcdir)/ -c++ -python enigma_python.i
 
 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
index 33fc0a1..096254f 100644 (file)
@@ -32,14 +32,9 @@ Oh, things like "operator= is private in this context" etc.
 is usually caused by not marking PSignals as immutable. 
 */
 
 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
 %{
 %module enigma
 %{
+
 #define SWIG_COMPILE
 #include <lib/base/ebase.h>
 #include <lib/base/smartptr.h>
 #define SWIG_COMPILE
 #include <lib/base/ebase.h>
 #include <lib/base/smartptr.h>
@@ -54,6 +49,7 @@ is usually caused by not marking PSignals as immutable.
 #include <lib/gui/ebutton.h>
 #include <lib/gui/ewindow.h>
 #include <lib/gui/ewidgetdesktop.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>
 #include <lib/gui/eslider.h>
 #include <lib/python/connections.h>
 #include <lib/gui/elistbox.h>
@@ -69,9 +65,10 @@ extern void quitMainloop();
 extern PSignal1<void,int> &keyPressedSignal();
 %}
 
 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"
 
 #define DEBUG
 %include "typemaps.i"
@@ -82,6 +79,7 @@ RefCount(eComponentScan)
 %include <lib/base/smartptr.h>
 %include <lib/service/iservice.h>
 %include <lib/service/service.h>
 %include <lib/base/smartptr.h>
 %include <lib/service/iservice.h>
 %include <lib/service/service.h>
+
 %template(eServiceCenterPtr) ePtr<eServiceCenter>;
 %include <lib/service/event.h>
 
 %template(eServiceCenterPtr) ePtr<eServiceCenter>;
 %include <lib/service/event.h>
 
@@ -103,6 +101,7 @@ RefCount(eComponentScan)
 %include <lib/gui/ewidgetdesktop.h>
 %include <lib/gui/elistbox.h>
 %include <lib/gui/elistboxcontent.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>
 %include <lib/service/listboxservice.h>
 %include <lib/components/scan.h>
 %include <lib/nav/pcore.h>
@@ -111,7 +110,6 @@ RefCount(eComponentScan)
 /**************  eptr  **************/
 
 %template(eActionMapPtr) ePtr<eActionMap>;
 /**************  eptr  **************/
 
 %template(eActionMapPtr) ePtr<eActionMap>;
-RefCount(eActionMap)
 %apply eActionMapPtr OUTPUT { eActionMapPtr &ptr }
 %apply eActionMap* *OUTPUT { eActionMap **ptr }
 
 %apply eActionMapPtr OUTPUT { eActionMapPtr &ptr }
 %apply eActionMap* *OUTPUT { eActionMap **ptr }
 
@@ -169,3 +167,4 @@ void runMainloop();
 void quitMainloop();
 %immutable keyPressed;
 PSignal1<void,int> &keyPressedSignal();
 void quitMainloop();
 %immutable keyPressed;
 PSignal1<void,int> &keyPressedSignal();
+
index 7ea1656..58079da 100644 (file)
@@ -8,8 +8,7 @@ DEFINE_REF(eServiceEvent);
 RESULT eServiceEvent::parseFrom(Event *evt)
 {
        m_begin = 0;    // ich bin FAUL
 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)
        {
        
        for (DescriptorConstIterator desc = evt->getDescriptors()->begin(); desc != evt->getDescriptors()->end(); ++desc)
        {
@@ -24,4 +23,7 @@ RESULT eServiceEvent::parseFrom(Event *evt)
                }
                }
        }
                }
                }
        }
+       return 0;
 }
 }
+
+DEFINE_REF(eDebugClass);
index 094b080..99ce5b2 100644 (file)
@@ -8,7 +8,7 @@ class Event;
 
 class eServiceEvent: public iObject
 {
 
 class eServiceEvent: public iObject
 {
-DECLARE_REF;
+DECLARE_REF(eServiceEvent);
 public:
        time_t m_begin;
        int m_duration;
 public:
        time_t m_begin;
        int m_duration;
@@ -20,4 +20,16 @@ public:
 
 TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
 
 
 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
 #endif
index 881047d..647dbdb 100644 (file)
@@ -3,6 +3,7 @@
 
 void eListboxServiceContent::setRoot(const eServiceReference &root)
 {
 
 void eListboxServiceContent::setRoot(const eServiceReference &root)
 {
+       m_list.clear();
        m_root = root;
        
        assert(m_service_center);
        m_root = root;
        
        assert(m_service_center);
@@ -16,6 +17,9 @@ void eListboxServiceContent::setRoot(const eServiceReference &root)
 
        m_size = m_list.size();
        cursorHome();
 
        m_size = m_list.size();
        cursorHome();
+       
+       if (m_listbox)
+               m_listbox->entryReset();
 }
 
 void eListboxServiceContent::getCurrent(eServiceReference &ref)
 }
 
 void eListboxServiceContent::getCurrent(eServiceReference &ref)
index 9d0cb72..231bab1 100644 (file)
@@ -8,7 +8,7 @@ class eServiceCenter;
 
 class eListboxServiceContent: public virtual iListboxContent
 {
 
 class eListboxServiceContent: public virtual iListboxContent
 {
-       DECLARE_REF;
+       DECLARE_REF(eListboxServiceContent);
 public:
        eListboxServiceContent();
        void setRoot(const eServiceReference &ref);
 public:
        eListboxServiceContent();
        void setRoot(const eServiceReference &ref);
index 9f4b456..2dd01ac 100644 (file)
@@ -11,7 +11,7 @@ typedef ePtr<eServiceCenter> eServiceCenterPtr;
 
 class eServiceCenter: public iServiceHandler
 {
 
 class eServiceCenter: public iServiceHandler
 {
-DECLARE_REF;
+DECLARE_REF(eServiceCenter);
 private:
        std::map<int,iServiceHandlerPtr> handler;
        static eServiceCenter *instance;
 private:
        std::map<int,iServiceHandlerPtr> handler;
        static eServiceCenter *instance;
index 2e8d899..d414d69 100644 (file)
@@ -9,7 +9,7 @@
 
 class eServiceFactoryDVB: public iServiceHandler
 {
 
 class eServiceFactoryDVB: public iServiceHandler
 {
-DECLARE_REF;
+DECLARE_REF(eServiceFactoryDVB);
 public:
        eServiceFactoryDVB();
        virtual ~eServiceFactoryDVB();
 public:
        eServiceFactoryDVB();
        virtual ~eServiceFactoryDVB();
@@ -24,7 +24,7 @@ public:
 
 class eDVBServiceList: public iListableService
 {
 
 class eDVBServiceList: public iListableService
 {
-DECLARE_REF;
+DECLARE_REF(eDVBServiceList);
 private:
        eServiceReference m_parent;
        friend class eServiceFactoryDVB;
 private:
        eServiceReference m_parent;
        friend class eServiceFactoryDVB;
@@ -36,7 +36,7 @@ public:
 
 class eDVBServicePlay: public iPlayableService, public Object, public iServiceInformation
 {
 
 class eDVBServicePlay: public iPlayableService, public Object, public iServiceInformation
 {
-DECLARE_REF;
+DECLARE_REF(eDVBServicePlay);
 private:
        friend class eServiceFactoryDVB;
        eServiceReference m_reference;
 private:
        friend class eServiceFactoryDVB;
        eServiceReference m_reference;
index 5a94567..9db8502 100644 (file)
@@ -14,7 +14,7 @@
 
 class eStaticServiceFSInformation: public iStaticServiceInformation
 {
 
 class eStaticServiceFSInformation: public iStaticServiceInformation
 {
-       DECLARE_REF;
+       DECLARE_REF(eStaticServiceFSInformation);
 public:
        RESULT getName(const eServiceReference &ref, std::string &name);
 };
 public:
        RESULT getName(const eServiceReference &ref, std::string &name);
 };
index 337ff62..61fcb4a 100644 (file)
@@ -5,7 +5,7 @@
 
 class eServiceFactoryFS: public iServiceHandler
 {
 
 class eServiceFactoryFS: public iServiceHandler
 {
-DECLARE_REF;
+DECLARE_REF(eServiceFactoryFS);
 public:
        eServiceFactoryFS();
        virtual ~eServiceFactoryFS();
 public:
        eServiceFactoryFS();
        virtual ~eServiceFactoryFS();
@@ -22,7 +22,7 @@ private:
 
 class eServiceFS: public iListableService
 {
 
 class eServiceFS: public iListableService
 {
-DECLARE_REF;
+DECLARE_REF(eServiceFS);
 private:
        std::string path;
        friend class eServiceFactoryFS;
 private:
        std::string path;
        friend class eServiceFactoryFS;
index 40287ae..4bec736 100644 (file)
@@ -7,7 +7,7 @@ class eStaticServiceMP3Info;
 
 class eServiceFactoryMP3: public iServiceHandler
 {
 
 class eServiceFactoryMP3: public iServiceHandler
 {
-DECLARE_REF;
+DECLARE_REF(eServiceFactoryMP3);
 public:
        eServiceFactoryMP3();
        virtual ~eServiceFactoryMP3();
 public:
        eServiceFactoryMP3();
        virtual ~eServiceFactoryMP3();
@@ -24,7 +24,7 @@ private:
 
 class eStaticServiceMP3Info: public iServiceInformation
 {
 
 class eStaticServiceMP3Info: public iServiceInformation
 {
-       DECLARE_REF;
+       DECLARE_REF(eStaticServiceMP3Info);
        friend class eServiceFactoryMP3;
        eStaticServiceMP3Info();
 public:
        friend class eServiceFactoryMP3;
        eStaticServiceMP3Info();
 public:
@@ -33,7 +33,7 @@ public:
 
 class eServiceMP3: public iPlayableService, public iPauseableService, public iServiceInformation, public Object
 {
 
 class eServiceMP3: public iPlayableService, public iPauseableService, public iServiceInformation, public Object
 {
-DECLARE_REF;
+DECLARE_REF(eServiceMP3);
 private:
        friend class eServiceFactoryMP3;
        std::string filename;
 private:
        friend class eServiceFactoryMP3;
        std::string filename;
index 8015888..13a2c26 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -17,11 +17,23 @@ from skin import applyGUIskin
 # we thus have one (static) hierarchy of screens (classes, not instances)
 # and one with the instanciated components itself (both global and dynamic)
 
 # 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():
 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 = {}
 
 # defined components
 components = {}
@@ -61,6 +73,8 @@ class Session:
                self.execEnd()
                self.currentDialog.doClose()
                
                self.execEnd()
                self.currentDialog.doClose()
                
+               dump(self.currentDialog)
+               print sys.getrefcount(self.currentDialog)
                del self.currentDialog
                del self.currentWindow
                
                del self.currentDialog
                del self.currentWindow
                
@@ -137,3 +151,20 @@ keymapparser.readKeymap()
 runScreenTest()
 
 # now, run the mainloop
 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)
+#
+
index cf0daae..dd13c55 100644 (file)
@@ -25,6 +25,10 @@ class Screen(dict, HTMLSkin, GUISkin):
        # never call this directly - it will be called from the session!
        def doClose(self):
                GUISkin.close(self)
        # 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()
        
        def close(self, retval=None):
                self.session.close()
@@ -89,11 +93,20 @@ class channelSelection(Screen):
                self["list"].setRoot(eServiceReference("1:0:1:0:0:0:0:0:0:0:PREMIERE"))
                
                self["okbutton"] = Button("ok", [self.channelSelected])
                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,
                        })
                        {
                                "selectChannel": self.channelSelected,
                        })
+               self["actions"].csel = self
 
        def channelSelected(self):
                self.session.nav.playService(self["list"].getCurrent())
 
        def channelSelected(self):
                self.session.nav.playService(self["list"].getCurrent())
@@ -109,13 +122,17 @@ class infoBar(Screen):
                                "switchChannel": self.switchChannel,
                                "mainMenu": self.mainMenu
                        })
                                "switchChannel": self.switchChannel,
                                "mainMenu": self.mainMenu
                        })
-               self["channelSwitcher"] = Button("switch Channel", [self.switchChannel])
                self["okbutton"] = Button("mainMenu", [self.mainMenu])
                
                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["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)
        
        def mainMenu(self):
                self.session.open(mainMenu)
@@ -136,7 +153,6 @@ class clockDisplay(Screen):
                self["okbutton"] = b
                self["title"] = Header("clock dialog: here you see the current uhrzeit!")
 
                self["okbutton"] = b
                self["title"] = Header("clock dialog: here you see the current uhrzeit!")
 
-
 class serviceScan(Screen):
        def ok(self):
                if self["scan"].isDone():
 class serviceScan(Screen):
        def ok(self):
                if self["scan"].isDone():
diff --git a/skin.py b/skin.py
index 46a1429..db4812a 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -23,15 +23,17 @@ dom = xml.dom.minidom.parseString(
                        <widget name="title" position="10,120" size="280,50" />
                        <widget name="theClock" position="10,60" size="280,50" />
                </screen>
                        <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="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>
-               <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" />
                </screen>
                <screen name="serviceScan" position="150,100" size="300,200" title="Service Scan">
                        <widget name="scan_progress" position="10,10" size="280,50" />