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 df199c47ddaa1fa5dfb7c4ffd5384229bf418fde..dd2aac9e73c329b9f3eb64ad73ae30c84263719b 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 303977a2574485edcf87322a3bf01a2df38fd75f..c544072650a1ad2b1ce3ccb300536133a193f120 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 4d0c0a9b73437cd04ee798b1892d8fa5906f018a..9e4830830e3266cc2624c73de058dfc34351a253 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 fb4b3b82b2c3a7ab7e1f207b0e52bc19f80d007f..7237df96a2107b6c3a2d1dcddb4653d6542cb8e8 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 03c3fb74156b4526e4a5bad3e228d8b6758056b7..0b20c9255995a9749f60e65726bf9127cbcd9ba8 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 57c54a08ff704e5e8032faff22729a69bb673c21..2a30f1787785606bcd3d74993586b06e6827df83 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 de10ad8159227563f41e793d742c7daf7902edc6..21a3f1aab364228a92cfdde89ac0bec9ba025664 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 34e8c10f471e017e021d224458ef6f3cce1e13d0..23c250efcdb931788ae180668b8ff9cc123c1b28 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 fc4721dd69943695f7257e742bfd645cd54fbd8a..cb433269a584459d0c8d1a5ad719ca32211bd9ef 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"))