prepare for skin updating and scaling
[openblackhole/openblackhole-enigma2.git] / lib / python / Components / Renderer / Pig.py
1 ##
2 ## P(icture)i(n)g(raphics) renderer
3 ##
4 from Renderer import Renderer
5 from enigma import eVideoWidget, eSize, ePoint
6
7 class Pig(Renderer):
8         def __init__(self):
9                 Renderer.__init__(self)
10                 self.Position = self.Size = None
11
12         GUI_WIDGET = eVideoWidget
13
14         def postWidgetCreate(self, instance):
15                 instance.setDecoder(0)
16
17         def applySkin(self, desktop, parent):
18                 ret = Renderer.applySkin(self, desktop, parent)
19                 if ret:
20                         self.Position = self.instance.position() # fixme, scaling!
21                         self.Size = self.instance.size()
22                 return ret
23
24         def preWidgetRemove(self, instance):
25                 instance.resize(eSize(720,576))
26                 instance.move(ePoint(0,0))
27
28         def onShow(self):
29                 if self.instance:
30                         if self.Size:
31                                 self.instance.resize(self.Size)
32                         if self.Position:
33                                 self.instance.move(self.Position)
34
35         def onHide(self):
36                 if self.instance:
37                         self.preWidgetRemove(self.instance)