some notes about skins and pngs
[enigma2.git] / skin.py
diff --git a/skin.py b/skin.py
index 8535dc810ee34d27e9b0794fe0c00091bc9b802b..5f27acca4d8b179ddd6cd55aa23457dbdc29aa8e 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -14,13 +14,10 @@ def dump(x, i=0):
        except:
                None
 
+from Tools.Directories import resolveFilename, SCOPE_SKIN
+
 # read the skin
-try:
-       # first we search in the current path
-       skinfile = file('data/skin.xml', 'r')
-except:
-       # if not found in the current path, we use the global datadir-path
-       skinfile = file('/usr/share/enigma2/skin.xml', 'r')
+skinfile = file(resolveFilename(SCOPE_SKIN, 'skin.xml'), 'r')
 dom = xml.dom.minidom.parseString(skinfile.read())
 skinfile.close()
 
@@ -75,6 +72,7 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
                        guiObject.setZPosition(int(value))
                elif attrib == "pixmap":
                        ptr = loadPNG(value)
+                       # that __deref__ still scares me!
                        desktop.makeCompatiblePixmap(ptr.__deref__())
                        guiObject.setPixmap(ptr.__deref__())
                        # guiObject.setPixmapFromFile(value)
@@ -136,6 +134,14 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
                                        "showAlways": guiObject.showAlways,
                                        "showNever": guiObject.showNever
                                }[value])
+               elif attrib == "enableWrapAround":
+                       guiObject.setWrapAround(True)
+               elif attrib == "pointer":
+                       (name, pos) = value.split(':')
+                       pos = parsePosition(pos)
+                       ptr = loadPNG(name)
+                       desktop.makeCompatiblePixmap(ptr.__deref__())
+                       guiObject.setPointer(ptr.__deref__(), pos)
                elif attrib != 'name':
                        print "unsupported attribute " + attrib + "=" + value
        except int:
@@ -165,7 +171,7 @@ def loadSkin(desktop):
        for windowstyle in elementsWithTag(skin.childNodes, "windowstyle"):
                style = eWindowStyleSkinned()
                
-               style.setTitleFont(gFont("Arial", 20));
+               style.setTitleFont(gFont("Regular", 20));
                style.setTitleOffset(eSize(20, 5));
                
                for borderset in elementsWithTag(windowstyle.childNodes, "borderset"):
@@ -206,7 +212,6 @@ def readSkin(screen, skin, name, desktop):
        
        if myscreen is None:
                # try embedded skin
-               print screen.__dict__
                if "parsedSkin" in screen.__dict__:
                        myscreen = screen.parsedSkin
                elif "skin" in screen.__dict__: