commit do server
[remotepc] / pcremote-client / pcremote-client.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 # ****************************************************************************
5 # Copyright (c) 2008  Zagaia - INdT/Fucapi.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Lesser General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10
11 #  This program is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #  GNU Lesser General Public License for more details.
15
16 #  You should have received a copy of the GNU Lesser General Public License
17 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 # ============================================================================
20 # Project Name :PC Remote
21 # Author       :Andre Portela
22 # Email        :andre_portela_@hotmail.com
23 # Version      :1.0
24 # Module       :main
25 # Class        :PCRemote custom Edje object with it's own call backs for the
26 #               main screen
27 # ============================================================================
28
29 from ecore import main_loop_begin
30 import ecore.evas
31 import sys
32 import os
33 from edje_objects import *
34 from connection.iconnection import Iconnection
35 from screenmanager import ScreenManager
36
37 width, height = 800, 480
38
39 #any argument deactivates fullscreen
40 if sys.argv.__len__() > 1:
41     screen = False
42 else:
43     screen = True
44 #if x11_16 is present, get it, otherwise get x11
45 if ecore.evas.engine_type_supported_get("software_x11_16"):
46     engine = ecore.evas.SoftwareX11_16
47 else:
48     engine = ecore.evas.SoftwareX11
49 #create the evas canvas
50 canvas = EvasCanvas(fullscreen=screen,engine=engine,size=(width, height))
51 #main .edj path
52 edje_file = os.path.join(os.path.dirname(sys.argv[0]), "pcremote.edj")
53 #the bluetooth socket object shared by all screens
54 sock = Iconnection('bluetooth')
55 #main edje object
56 main = MainScreen(canvas=canvas, file=edje_file, group="Main",name="Main", connection = sock)
57 main.show()
58 #future edje objects
59 tablet, slide, player, torrent = None, None, None, None
60 #focus on main edje object
61 main.focus = True
62 #this object connects all screens together
63 manager = ScreenManager(main, tablet, slide, player, torrent, sock)
64
65 ecore.main_loop_begin()
66