X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/bf82503dcba2b12fc921040397a0387d6dea9dbb..1036de712ab59acf11d5012d182cea8734b8412b:/skin.py diff --git a/skin.py b/skin.py index d11cce02..520780e6 100644 --- a/skin.py +++ b/skin.py @@ -74,13 +74,9 @@ def applySingleAttribute(guiObject, desktop, attrib, value): elif attrib == 'zPosition': guiObject.setZPosition(int(value)) elif attrib == "pixmap": - ptr = gPixmapPtr() - if loadPNG(ptr, value): - raise "loading PNG failed!" - x = ptr - ptr = ptr.__deref__() - desktop.makeCompatiblePixmap(ptr) - guiObject.setPixmap(ptr) + ptr = loadPNG(value) + desktop.makeCompatiblePixmap(ptr.__deref__()) + guiObject.setPixmap(ptr.__deref__()) # guiObject.setPixmapFromFile(value) elif attrib == "alphatest": # used by ePixmap guiObject.setAlphatest( @@ -143,12 +139,6 @@ def applyAllAttributes(guiObject, desktop, attributes): def loadSkin(desktop): print "loading skin..." - def getPNG(x): - g = gPixmapPtr() - loadPNG(g, x) - g = g.grabRef() - return g - skin = dom.childNodes[0] assert skin.tagName == "skin", "root element in skin must be 'skin'!" @@ -174,11 +164,11 @@ def loadSkin(desktop): bpName = str(pixmap.getAttribute("pos")) filename = str(pixmap.getAttribute("filename")) - png = getPNG(filename) + png = loadPNG(filename) # adapt palette - desktop.makeCompatiblePixmap(png) - style.setPixmap(eWindowStyleSkinned.__dict__[bsName], eWindowStyleSkinned.__dict__[bpName], png) + desktop.makeCompatiblePixmap(png.__deref__()) + style.setPixmap(eWindowStyleSkinned.__dict__[bsName], eWindowStyleSkinned.__dict__[bpName], png.__deref__()) for color in elementsWithTag(windowstyle.childNodes, "color"): type = str(color.getAttribute("name"))