1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 __maintainer__ = 'Lionel Martin <lionel@fluendo.com>'
19 __maintainer2__ = 'Florian Boucault <florian@fluendo.com>'
20
21
22 from elisa.core.component import Component
23
24 -class Context(Component):
25 """
26 DOCME
27
28 @ivar viewport_handle: main window instance (eg. Pigment viewport, GTK
29 window, etc.)
30 @type viewport_handle: any
31 @ivar context_handle: first object to add to the viewport (eg. Pigment
32 group, GTK Box, etc.)
33 @type context_handle: any
34 @ivar aspect_ratio: can be '16:9', 'auto', 'mm'
35 DOCME: what is 'mm'?
36 @type aspect_ratio: string
37 """
38
39 viewport_handle = None
40 context_handle = None
41
43 Component.__init__(self)
44 self._aspect_ratio = None
45
47 return self._aspect_ratio
48
49 - def aspect_ratio__set(self, aspect_ratio):
50 if self._aspect_ratio == aspect_ratio:
51 return
52
53 if aspect_ratio not in ('auto', 'mm') and \
54 not isinstance(aspect_ratio.split(':'), tuple) and \
55 len(aspect_ratio.split(':')) != 2:
56 raise TypeError
57
58 old_aspect_ratio = self._aspect_ratio
59 self._aspect_ratio = aspect_ratio
60
61 self.aspect_ratio_changed(old_aspect_ratio, aspect_ratio)
62
63 - def aspect_ratio_changed(self, old_aspect_ratio, new_aspect_ratio):
64 """
65 DOCME
66 """
67 pass
68
69 - def theme_changed(self, old_theme, new_theme):
70 """
71 DOCME
72 """
73 pass
74