PEP8: Fix whitespace
[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                 self.hidePip = True
13
14         GUI_WIDGET = eVideoWidget
15
16         def postWidgetCreate(self, instance):
17                 desk = getDesktop(0)
18                 instance.setDecoder(0)
19                 instance.setFBSize(desk.size())
20
21         def applySkin(self, desktop, parent):
22                 attribs = self.skinAttributes[:]
23                 for (attrib, value) in self.skinAttributes:
24                         if attrib == "hidePip":
25                                 self.hidePip = value == 1
26                                 attribs.remove((attrib,value))
27                                 break
28                 self.skinAttributes = attribs
29                 ret = Renderer.applySkin(self, desktop, parent)
30                 if ret:
31                         self.Position = self.instance.position()
32                         self.Size = self.instance.size()
33                 return ret
34
35         def onShow(self):
36                 if self.instance:
37                         if self.Size:
38                                 self.instance.resize(self.Size)
39                         if self.Position:
40                                 self.instance.move(self.Position)
41                         self.hidePip and PipPigMode(True)
42
43         def onHide(self):
44                 if self.instance:
45                         self.preWidgetRemove(self.instance)
46                         self.hidePip and PipPigMode(False)