Package elisa :: Package base_components :: Module context
[hide private]
[frames] | no frames]

Source Code for Module elisa.base_components.context

 1  # -*- coding: utf-8 -*- 
 2  # Elisa - Home multimedia server 
 3  # Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com). 
 4  # All rights reserved. 
 5  # 
 6  # This file is available under one of two license agreements. 
 7  # 
 8  # This file is licensed under the GPL version 3. 
 9  # See "LICENSE.GPL" in the root of this distribution including a special 
10  # exception to use Elisa with Fluendo's plugins. 
11  # 
12  # The GPL part of Elisa is also available under a commercial licensing 
13  # agreement from Fluendo. 
14  # See "LICENSE.Elisa" in the root directory of this distribution package 
15  # for details on that license. 
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
42 - def __init__(self):
43 Component.__init__(self) 44 self._aspect_ratio = None
45
46 - def aspect_ratio__get(self):
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