Single Shot Timers..
[enigma2.git] / skin.py
diff --git a/skin.py b/skin.py
index a40952041530cfe4428d6eeb5359ab0724896c5b..520780e6c2aef4d3e5fc5673af71d25ae664cd71 100644 (file)
--- 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(
@@ -128,6 +124,8 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
                        guiObject.setForegroundColor(parseColor(value))
                elif attrib == "selectionDisabled":
                        guiObject.setSelectionEnable(0)
+               elif attrib == "transparent":
+                       guiObject.setTransparent(int(value))
                elif attrib != 'name':
                        print "unsupported attribute " + attrib + "=" + value
        except int:
@@ -141,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'!"
        
@@ -172,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"))