Merge branch 'bug_618_fix_display_recording_indication'
[enigma2.git] / lib / python / Components / Renderer / Canvas.py
index 01b05fb0dc54b42f5d1d0715782707a25762a8de..acf0dbf73bfec096fc147ef8f7a1a90d8438f571 100644 (file)
@@ -29,12 +29,28 @@ class Canvas(Renderer):
 
        def draw(self, list):
                for l in list:
-                       print "drawing ..", l
-                       self.instance.fillRect(eRect(l[1], l[2], l[3], l[4]), gRGB(l[5]))
+                       if l[0] == 1:
+                               self.instance.fillRect(eRect(l[1], l[2], l[3], l[4]), gRGB(l[5]))
+                       elif l[0] == 2:
+                               self.instance.writeText(eRect(l[1], l[2], l[3], l[4]), gRGB(l[5]), gRGB(l[6]), l[7], l[8], l[9])
+                       else:
+                               print "drawlist entry:", l
+                               raise RuntimeError("invalid drawlist entry")
 
        def changed(self, what):
                self.pull_updates()
 
        def postWidgetCreate(self, instance):
                self.sequence = None
+
+               from enigma import eSize
+
+               def parseSize(str):
+                       x, y = str.split(',')
+                       return eSize(int(x), int(y))
+
+               for (attrib, value) in self.skinAttributes:
+                       if attrib == "size":
+                               self.instance.setSize(parseSize(value))
+
                self.pull_updates()