Merge branch 'bug_618_fix_display_recording_indication'
[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, getDesktop
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                 desk = getDesktop(0)
16                 instance.setDecoder(0)
17                 instance.setFBSize(desk.size())
18
19         def applySkin(self, desktop, parent):
20                 ret = Renderer.applySkin(self, desktop, parent)
21                 if ret:
22                         self.Position = self.instance.position() # fixme, scaling!
23                         self.Size = self.instance.size()
24                 return ret
25
26         def onShow(self):
27                 if self.instance:
28                         if self.Size:
29                                 self.instance.resize(self.Size)
30                         if self.Position:
31                                 self.instance.move(self.Position)
32
33         def onHide(self):
34                 if self.instance:
35                         self.preWidgetRemove(self.instance)