(final?) fix in getCurrentIP
[enigma2.git] / skin.py
diff --git a/skin.py b/skin.py
index f5a67185af488c3e2a839642dcb06238d29a7e33..8535dc810ee34d27e9b0794fe0c00091bc9b802b 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(
@@ -126,6 +122,20 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
                        guiObject.setBackgroundColor(parseColor(value))
                elif attrib == "foregroundColor":
                        guiObject.setForegroundColor(parseColor(value))
+               elif attrib == "selectionDisabled":
+                       guiObject.setSelectionEnable(0)
+               elif attrib == "transparent":
+                       guiObject.setTransparent(int(value))
+               elif attrib == "borderColor":
+                       guiObject.setBorderColor(parseColor(value))
+               elif attrib == "borderWidth":
+                       guiObject.setBorderWidth(int(value))
+               elif attrib == "scrollbarMode":
+                       guiObject.setScrollbarMode(
+                               { "showOnDemand": guiObject.showOnDemand,
+                                       "showAlways": guiObject.showAlways,
+                                       "showNever": guiObject.showNever
+                               }[value])
                elif attrib != 'name':
                        print "unsupported attribute " + attrib + "=" + value
        except int:
@@ -139,12 +149,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'!"
        
@@ -170,11 +174,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"))