allow skin elements to use alphablend. *BE CAREFUL:* This is a major performance...
[enigma2.git] / skin.py
diff --git a/skin.py b/skin.py
index e5c4837155b31c726dfb97891e6c283ed23070bc..8de161dae9dd4f6ae4387db9f86c6c8985b3c671 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -56,7 +56,9 @@ try:
 except (SkinError, IOError, AssertionError), err:
        print "SKIN ERROR:", err
        print "defaulting to standard skin..."
+       config.skin.primary_skin.value = 'skin.xml'
        loadSkin('skin.xml')
+
 loadSkin('skin_default.xml')
 
 def parsePosition(str):
@@ -128,8 +130,9 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
                        # guiObject.setPixmapFromFile(value)
                elif attrib == "alphatest": # used by ePixmap
                        guiObject.setAlphatest(
-                               { "on": True,
-                                 "off": False
+                               { "on": 1,
+                                 "off": 0,
+                                 "blend": 2,
                                }[value])
                elif attrib == "orientation": # used by eSlider
                        try:
@@ -168,8 +171,12 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
                                        print "illegal flag %s!" % f
                elif attrib == "backgroundColor":
                        guiObject.setBackgroundColor(parseColor(value))
+               elif attrib == "backgroundColorSelected":
+                       guiObject.setBackgroundColorSelected(parseColor(value))
                elif attrib == "foregroundColor":
                        guiObject.setForegroundColor(parseColor(value))
+               elif attrib == "foregroundColorSelected":
+                       guiObject.setForegroundColorSelected(parseColor(value))
                elif attrib == "shadowColor":
                        guiObject.setShadowColor(parseColor(value))
                elif attrib == "selectionDisabled":
@@ -213,7 +220,23 @@ def loadSingleSkinData(desktop, dom_skin, path_prefix):
        
        skin = dom_skin.childNodes[0]
        assert skin.tagName == "skin", "root element in skin must be 'skin'!"
-       
+
+       for c in elementsWithTag(skin.childNodes, "output"):
+               id = int(c.getAttribute("id") or "0")
+               if id == 0: # framebuffer
+                       for res in elementsWithTag(c.childNodes, "resolution"):
+                               xres = int(res.getAttribute("xres" or "720"))
+                               yres = int(res.getAttribute("yres" or "576"))
+                               bpp = int(res.getAttribute("bpp" or "32"))
+
+                               from enigma import gFBDC
+                               i = gFBDC.getInstance()
+                               i.setResolution(xres, yres)
+
+                               if bpp != 32:
+                                       # load palette (not yet implemented)
+                                       pass
+
        for c in elementsWithTag(skin.childNodes, "colors"):
                for color in elementsWithTag(c.childNodes, "color"):
                        name = str(color.getAttribute("name"))