diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-03-21 16:30:23 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2007-03-21 16:30:23 +0000 |
| commit | 9248bf86cddef4cf3904748bcd94ddabef68f8c7 (patch) | |
| tree | d6a7db24a485a22a122b53dde6ed56ac8e1d5c70 | |
| parent | 4404768ce6bb07bf2784da7806444acd462c3a33 (diff) | |
| download | enigma2-9248bf86cddef4cf3904748bcd94ddabef68f8c7.tar.gz enigma2-9248bf86cddef4cf3904748bcd94ddabef68f8c7.zip | |
more __deref__ changes
| -rw-r--r-- | lib/gui/eslider.cpp | 5 | ||||
| -rw-r--r-- | lib/gui/eslider.h | 1 | ||||
| -rw-r--r-- | lib/gui/ewidgetdesktop.cpp | 5 | ||||
| -rw-r--r-- | lib/gui/ewidgetdesktop.h | 3 | ||||
| -rw-r--r-- | lib/gui/ewindowstyleskinned.cpp | 5 | ||||
| -rw-r--r-- | lib/gui/ewindowstyleskinned.h | 1 | ||||
| -rw-r--r-- | lib/python/Components/Sources/RadioText.py | 10 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/PicturePlayer/plugin.py | 6 | ||||
| -rw-r--r-- | skin.py | 13 |
9 files changed, 34 insertions, 15 deletions
diff --git a/lib/gui/eslider.cpp b/lib/gui/eslider.cpp index df199c47..dd2aac9e 100644 --- a/lib/gui/eslider.cpp +++ b/lib/gui/eslider.cpp @@ -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; diff --git a/lib/gui/eslider.h b/lib/gui/eslider.h index 303977a2..c5440726 100644 --- a/lib/gui/eslider.h +++ b/lib/gui/eslider.h @@ -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: diff --git a/lib/gui/ewidgetdesktop.cpp b/lib/gui/ewidgetdesktop.cpp index 4d0c0a9b..9e483083 100644 --- a/lib/gui/ewidgetdesktop.cpp +++ b/lib/gui/ewidgetdesktop.cpp @@ -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) diff --git a/lib/gui/ewidgetdesktop.h b/lib/gui/ewidgetdesktop.h index fb4b3b82..7237df96 100644 --- a/lib/gui/ewidgetdesktop.h +++ b/lib/gui/ewidgetdesktop.h @@ -54,7 +54,8 @@ public: void setPalette(gPixmap &pm); void setRedrawTask(eMainloop &ml); - + + void makeCompatiblePixmap(ePtr<gPixmap> &pm); void makeCompatiblePixmap(gPixmap &pm); enum { diff --git a/lib/gui/ewindowstyleskinned.cpp b/lib/gui/ewindowstyleskinned.cpp index 03c3fb74..0b20c925 100644 --- a/lib/gui/ewindowstyleskinned.cpp +++ b/lib/gui/ewindowstyleskinned.cpp @@ -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)) diff --git a/lib/gui/ewindowstyleskinned.h b/lib/gui/ewindowstyleskinned.h index 57c54a08..2a30f178 100644 --- a/lib/gui/ewindowstyleskinned.h +++ b/lib/gui/ewindowstyleskinned.h @@ -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 { diff --git a/lib/python/Components/Sources/RadioText.py b/lib/python/Components/Sources/RadioText.py index de10ad81..21a3f1aa 100644 --- a/lib/python/Components/Sources/RadioText.py +++ b/lib/python/Components/Sources/RadioText.py @@ -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]: diff --git a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py index 34e8c10f..23c250ef 100644 --- a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py +++ b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py @@ -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() @@ -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")) |
