Revert "Make hidepip when pig configurable via a skin attribute"
[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, eRect, ePoint, getDesktop
6 from Screens.PictureInPicture import PipPigMode
7
8 class Pig(Renderer):
9         def __init__(self):
10                 Renderer.__init__(self)
11                 self.Position = self.Size = None
12
13         GUI_WIDGET = eVideoWidget
14
15         def postWidgetCreate(self, instance):
16                 desk = getDesktop(0)
17                 instance.setDecoder(0)
18                 instance.setFBSize(desk.size())
19
20         def applySkin(self, desktop, parent):
21                 ret = Renderer.applySkin(self, desktop, parent)
22                 if ret:
23                         self.Position = self.instance.position()
24                         self.Size = self.instance.size()
25                 return ret
26
27         def onShow(self):
28                 if self.instance:
29                         if self.Size:
30                                 self.instance.resize(self.Size)
31                         if self.Position:
32                                 self.instance.move(self.Position)
33                         PipPigMode(True)
34
35         def onHide(self):
36                 if self.instance:
37                         self.preWidgetRemove(self.instance)
38                         PipPigMode(False)