more __deref__ changes
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 21 Mar 2007 16:30:23 +0000 (16:30 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 21 Mar 2007 16:30:23 +0000 (16:30 +0000)
lib/gui/eslider.cpp
lib/gui/eslider.h
lib/gui/ewidgetdesktop.cpp
lib/gui/ewidgetdesktop.h
lib/gui/ewindowstyleskinned.cpp
lib/gui/ewindowstyleskinned.h
lib/python/Components/Sources/RadioText.py
lib/python/Plugins/Extensions/PicturePlayer/plugin.py
skin.py

index df199c4..dd2aac9 100644 (file)
@@ -5,6 +5,11 @@ eSlider::eSlider(eWidget *parent)
 {
 }
 
+void eSlider::setPixmap(ePtr<gPixmap> &pixmap)
+{
+       setPixmap(pixmap.operator->());
+}
+
 void eSlider::setPixmap(gPixmap *pixmap)
 {
        m_pixmap = pixmap;
index 303977a..c544072 100644 (file)
@@ -15,6 +15,7 @@ public:
        void setBorderWidth(int pixel);
        void setBorderColor(const gRGB &color);
        void setPixmap(gPixmap *pixmap);
+       void setPixmap(ePtr<gPixmap> &pixmap);
 protected:
        int event(int event, void *data=0, void *data2=0);
 private:
index 4d0c0a9..9e48308 100644 (file)
@@ -287,6 +287,11 @@ void eWidgetDesktop::setRedrawTask(eMainloop &ml)
                m_timer->start(0, 1);
 }
 
+void eWidgetDesktop::makeCompatiblePixmap(ePtr<gPixmap> &pm)
+{
+       makeCompatiblePixmap(*(pm.operator->()));
+}
+
 void eWidgetDesktop::makeCompatiblePixmap(gPixmap &pm)
 {
        if (m_comp_mode != cmImmediate)
index fb4b3b8..7237df9 100644 (file)
@@ -54,7 +54,8 @@ public:
        void setPalette(gPixmap &pm);
        
        void setRedrawTask(eMainloop &ml);
-       
+
+       void makeCompatiblePixmap(ePtr<gPixmap> &pm);
        void makeCompatiblePixmap(gPixmap &pm);
        
        enum {
index 03c3fb7..0b20c92 100644 (file)
@@ -214,6 +214,11 @@ RESULT eWindowStyleSkinned::getFont(int what, ePtr<gFont> &fnt)
        return 0;
 }
 
+void eWindowStyleSkinned::setPixmap(int bs, int bp, ePtr<gPixmap> &ptr)
+{
+       setPixmap(bs, bp, *(ptr.operator->()));
+}
+
 void eWindowStyleSkinned::setPixmap(int bs, int bp, gPixmap &pixmap)
 {
        if ((bs >= bsMax) || (bs < 0))
index 57c54a0..2a30f17 100644 (file)
@@ -52,6 +52,7 @@ public:
                bpiBottomRight =  8,
        };
        
+       void setPixmap(int bs, int bp, ePtr<gPixmap> &pixmap);
        void setPixmap(int bs, int bp, gPixmap &pixmap);
        
        enum {
index de10ad8..21a3f1a 100644 (file)
@@ -3,22 +3,24 @@ from Components.Element import cached
 from enigma import iPlayableService
 from Source import Source
 
-class RadioText(PerServiceBase, Source, object):
+class RdsDecoder(PerServiceBase, Source, object):
        def __init__(self, navcore):
                Source.__init__(self)
                PerServiceBase.__init__(self, navcore,
                        {
                                iPlayableService.evStart: self.gotEvent,
                                iPlayableService.evUpdatedRadioText: self.gotEvent,
+                               iPlayableService.evUpdatedRtpText: self.gotEvent,
+                               iPlayableService.evUpdatedRassInteractivePicMask: self.gotEvent,
                                iPlayableService.evEnd: self.gotEvent
                        }, with_event=True)
 
        @cached
-       def getText(self):
+       def getDecoder(self):
                service = self.navcore.getCurrentService()
-               return service and service.radioText()
+               return service and service.rdsDecoder()
 
-       radiotext = property(getText)
+       decoder = property(getDecoder)
 
        def gotEvent(self, what):
                if what in [iPlayableService.evStart, iPlayableService.evEnd]:
index 34e8c10..23c250e 100644 (file)
@@ -158,7 +158,7 @@ class ThumbView(Screen):
                        ptr = loadPic(self.path + self.thumblist[self.thumbindex], 180, 160, self.aspect, int(config.pic.resize.value), int(config.pic.rotate.value),1, cachefile)
                        if ptr != None:
                                self["thumb"+str(self.thumbindex)].show()
-                               self["thumb"+str(self.thumbindex)].instance.setPixmap(ptr.__deref__())
+                               self["thumb"+str(self.thumbindex)].instance.setPixmap(ptr)
                        
                        self.thumbindex += 1
                        if self.thumbindex < 6:
@@ -297,7 +297,7 @@ class PicView(Screen):
                if self.currPic != None:
                        self.old = self.index
                        self["file"].setText(self.list[self.old][0] + "  (" + str(self.old+1) + "/" + str(self.maxentry+1) + ")")
-                       self["picture"].instance.setPixmap(self.currPic.__deref__())
+                       self["picture"].instance.setPixmap(self.currPic)
 
                self.next()
                self["point"].show()
@@ -489,7 +489,7 @@ class picmain(Screen):
                        ptr = loadPic(self.filelist.getCurrentDirectory() + self.filelist.getFilename(), 180, 160, self.aspect, int(config.pic.resize.value), 0, 0, cachefile)
                        if ptr != None:
                                self["thumbnail"].show()
-                               self["thumbnail"].instance.setPixmap(ptr.__deref__())
+                               self["thumbnail"].instance.setPixmap(ptr)
                else:
                        self["thumbnail"].hide()
 
diff --git a/skin.py b/skin.py
index fc4721d..cb43326 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -119,9 +119,8 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
                        guiObject.setZPosition(int(value))
                elif attrib == "pixmap":
                        ptr = loadPixmap(value) # this should already have been filename-resolved.
-                       # that __deref__ still scares me!
-                       desktop.makeCompatiblePixmap(ptr.__deref__())
-                       guiObject.setPixmap(ptr.__deref__())
+                       desktop.makeCompatiblePixmap(ptr)
+                       guiObject.setPixmap(ptr)
                        # guiObject.setPixmapFromFile(value)
                elif attrib == "alphatest": # used by ePixmap
                        guiObject.setAlphatest(
@@ -189,8 +188,8 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
                        (name, pos) = value.split(':')
                        pos = parsePosition(pos)
                        ptr = loadPixmap(name)
-                       desktop.makeCompatiblePixmap(ptr.__deref__())
-                       guiObject.setPointer({"pointer": 0, "seek_pointer": 1}[attrib], ptr.__deref__(), pos)
+                       desktop.makeCompatiblePixmap(ptr)
+                       guiObject.setPointer({"pointer": 0, "seek_pointer": 1}[attrib], ptr, pos)
                elif attrib == 'shadowOffset':
                        guiObject.setShadowOffset(parsePosition(value))
                elif attrib == 'noWrap':
@@ -253,8 +252,8 @@ def loadSingleSkinData(desktop, dom_skin, path_prefix):
                                png = loadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, filename, path_prefix=path_prefix))
                                
                                # adapt palette
-                               desktop.makeCompatiblePixmap(png.__deref__())
-                               style.setPixmap(eWindowStyleSkinned.__dict__[bsName], eWindowStyleSkinned.__dict__[bpName], png.__deref__())
+                               desktop.makeCompatiblePixmap(png)
+                               style.setPixmap(eWindowStyleSkinned.__dict__[bsName], eWindowStyleSkinned.__dict__[bpName], png)
 
                for color in elementsWithTag(windowstyle.childNodes, "color"):
                        type = str(color.getAttribute("name"))