global: 'Dream Multimedia' -> 'Dream Property'
[enigma2-plugins.git] / merlinepg / src / ShowMe.py
1 #######################################################################
2 #
3 #    ShowMe-Tool for Dreambox-Enigma2
4 #    Coded by Vali (c)2010
5 #    Support: www.dreambox-tools.info
6 #
7 #
8 #  This plugin is licensed under the Creative Commons
9 #  Attribution-NonCommercial-ShareAlike 3.0 Unported License.
10 #  To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
11 #  or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
12 #
13 #  Alternatively, this plugin may be distributed and executed on hardware which
14 #  is licensed by Dream Property GmbH.
15 #
16 #
17 #  This plugin is NOT free software. It is open source, you are allowed to
18 #  modify it (if you keep the license), but it may not be commercially
19 #  distributed other than under the conditions noted above.
20 #
21 #
22 #######################################################################
23
24
25
26 from Screens.Screen import Screen
27 from Components.ActionMap import ActionMap
28 from Components.AVSwitch import AVSwitch
29 from Components.Pixmap import Pixmap
30 from enigma import ePicLoad, getDesktop
31
32
33
34 class ShowMe(Screen):
35         if (getDesktop(0).size().width()) == 1920:
36                 skin="""
37                         <screen flags="wfNoBorder" position="0,0" size="1920,1080" title="Show..." backgroundColor="#ffffffff">
38                                 <widget name="Picture" position="0,0" size="1920,1080" zPosition="1"/>
39                         </screen>"""
40         else:
41                 skin="""
42                         <screen flags="wfNoBorder" position="0,0" size="1280,720" title="Show..." backgroundColor="#ffffffff">
43                                 <widget name="Picture" position="0,0" size="1280,720" zPosition="1"/>
44                         </screen>"""
45
46         def __init__(self, session, whatPic = None):
47                 self.skin = ShowMe.skin
48                 Screen.__init__(self, session)
49                 self.whatPic = whatPic
50                 self.EXscale = (AVSwitch().getFramebufferScale())
51                 self.EXpicload = ePicLoad()
52                 self["Picture"] = Pixmap()
53                 self["actions"] = ActionMap(["WizardActions"],
54                 {
55                         "ok": self.close,
56                         "back": self.close
57                 }, -1)
58                 self.ExPicload_conn = self.EXpicload.PictureData.connect(self.DecodeAction)
59                 self.onLayoutFinish.append(self.Show_Picture)
60
61         def Show_Picture(self):
62                 if self.whatPic is not None:
63                         self.EXpicload.setPara([self["Picture"].instance.size().width(), self["Picture"].instance.size().height(), self.EXscale[0], self.EXscale[1], 0, 1, "#121214"])
64                         self.EXpicload.startDecode(self.whatPic)
65
66         def DecodeAction(self, pictureInfo=" "):
67                 if self.whatPic is not None:
68                         ptr = self.EXpicload.getData()
69                         self["Picture"].instance.setPixmap(ptr)