Package elisa :: Package plugins :: Package bad :: Package osso :: Module osso_service
[hide private]
[frames] | no frames]

Source Code for Module elisa.plugins.bad.osso.osso_service

 1  # -*- coding: utf-8 -*- 
 2  # Elisa - Home multimedia server 
 3  # Copyright (C) 2007-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  from elisa.base_components.service_provider import ServiceProvider 
18  from elisa.core import common 
19  from elisa.core.log import Loggable 
20  import dbus 
21  import dbus.glib 
22  import dbus.service 
23   
24 -class OssoDbusService(dbus.service.Object, Loggable):
25 - def __init__(self):
26 self.name = 'com.fluendo.elisa' 27 self.path = '/com/fluendo/elisa' 28 bus_name = dbus.service.BusName(self.name, bus=dbus.SessionBus()) 29 dbus.service.Object.__init__(self, bus_name, self.path)
30 31 @dbus.service.method(dbus_interface='com.fluendo.elisa', 32 in_signature='', out_signature='')
33 - def top_application(self):
34 # FIXME: implement this properly without hardcoding pigment stuff 35 self.debug('top application') 36 interface_controller = common.application.interface_controller 37 for frontend in interface_controller._frontends.values(): 38 self.debug('update frontend %s' % frontend) 39 if frontend.context.gtk_window is not None: 40 frontend.context.gtk_window.present() 41 else: 42 frontend.context.viewport_handle.visible = False 43 frontend.context.viewport_handle.visible = True 44 self.debug('updated frontend %s' % frontend)
45
46 -class OssoService(ServiceProvider):
47 - def initialize(self):
48 self.debug('service initialize') 49 self._osso_service = OssoDbusService()
50
51 - def clean(self):
52 self._osso_service = None
53
54 - def start(self):
55 pass
56
57 - def stop(self):
58 pass
59