Beispiel #1
0
	def on_key_down(self, obj, event):
		if event.keyname in ("F6", "f"):
			self.evas_canvas.evas_obj.fullscreen = not self.evas_canvas.evas_obj.fullscreen
		elif event.keyname in ("Escape", "q"):
			ecore.main_loop_quit()
		elif event.keyname in ("F7", "plus") and not self.animate:
			ecore.timer_add(0.05, self.animate_zoom_in)
		elif event.keyname in ("F8", "minus") and not self.animate:
			ecore.timer_add(0.05, self.animate_zoom_out)
		elif event.keyname in ("Up", ) and not self.animate:
			delta_y = -10
			for icon in self.icons:
				icon.set_position(icon.pos[0], icon.pos[1]-delta_y)
			self.current_pos = (self.current_pos[0], self.current_pos[1]-delta_y)
		elif event.keyname in ("Down", ) and not self.animate:
			delta_y = 10
			for icon in self.icons:
				icon.set_position(icon.pos[0], icon.pos[1]-delta_y)
			self.current_pos = (self.current_pos[0], self.current_pos[1]-delta_y)
		elif event.keyname in ("Left", ) and not self.animate:
			delta_x = -10
			for icon in self.icons:
				icon.set_position(icon.pos[0]-delta_x, icon.pos[1])
			self.current_pos = (self.current_pos[0]-delta_x, self.current_pos[1])
		elif event.keyname in ("Right", ) and not self.animate:
			delta_x = 10
			for icon in self.icons:
				icon.set_position(icon.pos[0]-delta_x, icon.pos[1])
			self.current_pos = (self.current_pos[0]-delta_x, self.current_pos[1])
		else:
			print "key not recognized:", event.keyname
Beispiel #2
0
def request_next(client, files):
    if pop_existent(client, files):
        id = client.generate(generated_cb, files)
        print "generating id=%d" % id
    else:
        print "nothing left to generate."
        ecore.main_loop_quit()
Beispiel #3
0
def request_next(client, files):
    if pop_existent(client, files):
        id = client.generate(generated_cb, files)
        print "generating id=%d" % id
    else:
        print "nothing left to generate."
        ecore.main_loop_quit()
Beispiel #4
0
 def button_pressed(self, edje_obj, signal, source):
       if source == "usbmode":
               self.mode = signal
               if self.mode == "device" and self.power == "-500":
                 edje_obj.part_text_set("text_field", "won't work!")
               else:
                 edje_obj.part_text_set("text_field", "")
       elif source == "power":
               self.power = signal
               if signal != "-500":
                 if self.mode == "device":
                   edje_obj.signal_emit("hide_provide", "") 
                 elif self.mode == "host":
                  edje_obj.signal_emit("l-500", "is_default")
               if signal == "0":
                  edje_obj.part_text_set("text_field", "")
               elif signal == "100":
                  edje_obj.part_text_set("text_field", "")
               elif signal == "500":
                  edje_obj.part_text_set("text_field", "make shure your charger can provide 0.5A")
               elif signal == "1000":
                  edje_obj.part_text_set("text_field", "make shure your charger can provide 1A")
               elif signal == "500":
                  edje_obj.part_text_set("text_field", "")
       elif source == "programm":
               if signal == "ok":
                       self.write_data(self.mode, self.power)
                       ecore.main_loop_quit()
               elif signal == "cancel":
                       ecore.main_loop_quit()
Beispiel #5
0
def cb_completion(file, status):
    # This callback will be called at the end of the download, status will be
    # the HTTP status code (200 = Successfull)
    if status == 200:
        print("Download ended Successfully %s [%d]" % (file, status))
    else:
        print("Download ended with Errors %s [%d]" % (file, status))
    ecore.main_loop_quit()
def cb_completion(file, status):
    # This callback will be called at the end of the download, status will be
    # 0 if the download finish well or 1 in case of errors
    if status == 0:
        print("Download ended Successfully %s [%d]" % (file, status))
    else:
        print("Download ended with Errors %s [%d]" % (file, status))
    ecore.main_loop_quit()
def cb_completion(file, status):
    # This callback will be called at the end of the download, status will be
    # the HTTP status code (200 = Successfull)
    if status == 200:
        print ("Download ended Successfully %s [%d]" % (file, status))
    else:
        print ("Download ended with Errors %s [%d]" % (file, status))
    ecore.main_loop_quit()
Beispiel #8
0
    def on_edje_signal_button_pressed(self, emission, source):
 
		if source == "quit":
		
			self.main.connection.terminate_connection()
			self.main.on_exit()
			ecore.main_loop_quit()

		elif source == "task_switcher":

			self.main.task_switcher()
			
		elif source == "mouse":
			
			self.main.transition_to("mouse_ui")

		elif source == "keyboard":
			
			self.main.transition_to("keyboard_ui")

		elif source == "presentation":
			
			self.main.transition_to("presentation")

		elif source == "multimedia":
			
			self.main.transition_to("multimedia")

		elif source == "games":
			
			self.main.transition_to("games")
		
		elif source == "ps3":
			
			self.main.transition_to("ps3_control")


		elif source == "connection":

			if self.main.connection.connect:
				self.main.groups["connection_status"].part_text_set("label_connect_to","Connected to:")
    				self.main.groups["connection_status"].part_text_set("label_client", self.main.connection.client_name)
				self.main.groups["connection_status"].part_text_set("label_addr",self.main.connection.client_addr)
			else:
				self.part_text_set("label_not_connect","You are not connect to any device")
		
			self.main.transition_to("connection_status")

		elif source == "about":
			
			self.main.transition_to("about")	

		elif source == "conf":

			self.main.transition_to("settings")			
		else:
			print source
			print "feature not implemented yet :) "
Beispiel #9
0
def animator_quit_program_after_10():
    global counter2
    counter2 += 1
    print "animator_quit_program_after_10: counter=", counter2
    if counter2 == 10:
        ecore.main_loop_quit()
        return False
    else:
        return True
Beispiel #10
0
    def on_edje_signal_button_pressed(self, emission, source):
        if source == "quit" or source == "no_option":

            self.main.connection.terminate_connection()
            self.main.on_exit()
            ecore.main_loop_quit()

        if source == "yes_option":

            self.main.connection.terminate_connection()
            self.main.transition_to("process_conn")
Beispiel #11
0
    def on_edje_signal_button_pressed(self, emission, source):
	if source == "quit" or source == "no_option" :
		
		self.main.connection.terminate_connection()
		self.main.on_exit()
		ecore.main_loop_quit()

	if source == "yes_option":
	
		self.main.connection.terminate_connection()
		self.main.transition_to("process_conn")
Beispiel #12
0
 def on_key_down(self, obj, event):
     if event.keyname in ("F6", "f"):
         self.evas_obj.fullscreen = not self.evas_obj.fullscreen
     elif event.keyname == "Escape":
         ecore.main_loop_quit()
     elif event.keyname == "a":
         self.list_obj.scroll(KineticList.SCROLL_PIXELS_UP, 1)
     elif event.keyname == "z":
         self.list_obj.scroll(KineticList.SCROLL_PIXELS_DOWN, 1)
     elif event.keyname == "Up":
         self.list_obj.scroll(KineticList.SCROLL_STEP_BACKWARD)
     elif event.keyname == "Down":
         self.list_obj.scroll(KineticList.SCROLL_STEP_FORWARD)
Beispiel #13
0
 def on_key_down(self, obj, event):
     if event.keyname in ("F6", "f"):
         self.evas_obj.fullscreen = not self.evas_obj.fullscreen
     elif event.keyname == "Escape":
         ecore.main_loop_quit()
     elif event.keyname == "a":
         self.list_obj.scroll(KineticList.SCROLL_PIXELS_UP, 1)
     elif event.keyname == "z":
         self.list_obj.scroll(KineticList.SCROLL_PIXELS_DOWN, 1)
     elif event.keyname == "Up":
         self.list_obj.scroll(KineticList.SCROLL_STEP_BACKWARD)
     elif event.keyname == "Down":
         self.list_obj.scroll(KineticList.SCROLL_STEP_FORWARD)
Beispiel #14
0
 def button_pressed(self, edje_obj, signal, source):
   if signal == "mute":
     print "mute"
   elif signal == "snapshot":
     print "snapshot"
     os.system("gpe-scap &")
   elif signal == "lock":
     print "lock"
   elif signal == "standby":
     print "standby"
     os.system("apm -s")
   elif signal == "shutdown":
     print "shutdown"
     os.system("halt")
   ecore.main_loop_quit()
Beispiel #15
0
 def button_pressed(self, edje_obj, signal, source):
   if signal == "mute":
     print "mute"
     self.mute()
   elif signal == "snapshot":
     print "snapshot"
     os.system("gpe-scap &")
   elif signal == "lock":
     print "lock"
   elif signal == "standby":
     print "standby"
     #os.system("apm -s")
     self.Usage_iface.Suspend()
   elif signal == "shutdown":
     print "shutdown"
     os.system("poweroff")
   ecore.main_loop_quit()
Beispiel #16
0
    def on_edje_signal_button_pressed(self, emission, source):
	if source == "quit":
		
		self.main.on_exit()
		ecore.main_loop_quit()

	elif source == "connect":

		self.main.connection = Connect(self.main.bluez_version)
		self.main.new_device = True
		self.bus = self.main.bus
		manager = dbus.Interface(self.bus.get_object("org.bluez", "/"),"org.bluez.Manager")
		
		self.path = manager.DefaultAdapter()
		self.adapter = dbus.Interface(self.bus.get_object("org.bluez", self.path),"org.bluez.Adapter")
		self.adapter.connect_to_signal("DeviceCreated", self._device_created)

		os.system("dbus-send --system --print-reply --dest=com.nokia.bt_ui /com/nokia/bt_ui com.nokia.bt_ui.show_search_dlg string: string: array:string: string:require")
		#self.dbus_bt_dialog = dbus.Interface(self.bus.get_object("com.nokia.bt_ui", "/"),"com.nokia.bt_ui")
		#bt_dialog = self.dbus_bt_dialog.show_search_dlg("","",[""],"require")
		self.dbus_manager = self.bus.get_object("com.nokia.bt_ui", "/com/nokia/bt_ui")
		self.dbus_manager.connect_to_signal("search_result", self._device_selected)

	elif source == "reconnect":

		self.main.new_device = False
		self.main.transition_to("reconnect_list")
		#wainting for connection

	elif source == "wait_connection":

		self.main.new_device = False
		self.main.transition_to("wait_conn")

	elif source == "task_switcher":

		self.main.task_switcher()
def cb(req):
    print "GET:", req
    count[0] -= 1
    if count[0] < 1:
        ecore.main_loop_quit()
Beispiel #18
0
 def on_delete_request(self, evas_obj):
     ecore.main_loop_quit()
Beispiel #19
0
 def quit(self):
     self.emit("closing")
     logger.info("emitted closing")
     ecore.main_loop_quit()
Beispiel #20
0
 def on_key_down(self, obj, event):
     if event.keyname in ("F6", "f"):
         self.evas_canvas.evas_obj.fullscreen = not self.evas_canvas.evas_obj.fullscreen
     elif event.keyname == "Escape":
         ecore.main_loop_quit()
Beispiel #21
0
def on_key_down(obj, event, ee):
    if event.keyname in ("F6", "f"):
        ee.fullscreen = not ee.fullscreen
    elif event.keyname == "Escape":
        ecore.main_loop_quit()
Beispiel #22
0
def handle_read(fd_handler, file):
    line = file.read(1)
    r = bool(line and not fd_handler.has_error())
    if not r:
        ecore.main_loop_quit()
    return r
Beispiel #23
0
    def on_edje_signal_button_pressed(self, emission, source):
 
		if source == "quit":
		
			self.main.connection.terminate_connection()
			self.main.on_exit()
			ecore.main_loop_quit()
			
		elif source == "mouse":
			
			self.main.transition_to("mouse_ui")

		elif source == "keyboard":
			
			self.main.transition_to("keyboard_ui")

		elif source == "presentation":
			
			self.main.transition_to("presentation")

		elif source == "multimedia":
			
			self.main.transition_to("multimedia")

		elif source == "games":
			
			self.main.transition_to("games")

		elif source == "accelerometer":
			self.main.accelerometer_prev = "menu"
			self.main.transition_to("accelerometer")

		elif source == "connection":

			if self.main.connection.connect:
				self.main.groups["connection_status"].part_text_set("label_connect_to","Connected to:")
    				self.main.groups["connection_status"].part_text_set("label_client", self.main.connection.client_name)
				self.main.groups["connection_status"].part_text_set("label_addr",self.main.connection.client_addr)
			else:
				self.part_text_set("label_not_connect","You are not connect to any device")
		
			self.main.transition_to("connection_status")

		elif source == "about":
			
			self.main.groups["about"].part_text_set("label_version","ReMoko v0.4")
			self.main.groups["about"].part_text_set("label_developed","Developed by:")
			self.main.groups["about"].part_text_set("label_name","Valerio Valerio")
			self.main.groups["about"].part_text_set("label_email","<*****@*****.**>")
			self.main.groups["about"].part_text_set("label_thanks","Thanks to:")
			self.main.groups["about"].part_text_set("label_claudio","Claudio Takahasi")
			self.main.groups["about"].part_text_set("label_daniel","Daniel Willmann ")
			self.main.groups["about"].part_text_set("label_joachim","Joachim Breitner")
			
			
			self.main.transition_to("about")	

		elif source == "conf":

			self.main.transition_to("settings")			
		else:
			
			print "feature not implemented yet :) "
Beispiel #24
0
def connected_cb(client, success, files):
    if not success:
        print "could not connect to server."
        ecore.main_loop_quit()
        return
    request_next(client, files)
Beispiel #25
0
def on_delete_request(ee):
    ecore.main_loop_quit()
 def exit(self, pointer):
     ecore.main_loop_quit()
Beispiel #27
0
 def main_quit(self):
     """ Terminates the main loop.
     """
     ecore.main_loop_quit()
Beispiel #28
0
#!/usr/bin/python

import sys
import ecore.evas
import evas
import ecore

try:
    engine_name = sys.argv[1]
except IndexError:
    engine_name = None

try:
    extra_options = sys.argv[2]
except IndexError:
    extra_options = None

ee = ecore.evas.new(engine_name, 10, 20, 300, 400, extra_options)

canvas = ee.evas
o = evas.Rectangle(canvas, size=canvas.size, color="#ff0000")
o.show()

o.event_callback_add(evas.EVAS_CALLBACK_DEL, lambda *a: ecore.main_loop_quit())
ee.associate(o)

ee.show()
ecore.main_loop_begin()
Beispiel #29
0
def key_down_cb(bg, event, ee):
    k = event.key
    if k == "Escape":
        ecore.main_loop_quit()
    if k in ("F6", "f"):
        ee.fullscreen = not ee.fullscreen
Beispiel #30
0
 def quit(self):
     ecore.main_loop_quit()
Beispiel #31
0
def connected_cb(client, success, files):
    if not success:
        print "could not connect to server."
        ecore.main_loop_quit()
        return
    request_next(client, files)
Beispiel #32
0
 def main_quit(self):
     """ Terminates the main loop.
     """
     ecore.main_loop_quit()
Beispiel #33
0
def on_delete_request(ee):
    ecore.main_loop_quit()
Beispiel #34
0
def quit_after_3s():
    ecore.main_loop_quit()
    return False
Beispiel #35
0
 def quit(self):
     ecore.main_loop_quit()
Beispiel #36
0
 def exit(self, pointer):
     ecore.main_loop_quit()
Beispiel #37
0
 def quit(self):
     self.emit("closing")
     logger.info("emitted closing")
     ecore.main_loop_quit()
     elementary.shutdown()
Beispiel #38
0
def quit_after_3s():
    ecore.main_loop_quit()
    return False
Beispiel #39
0
	def on_delete_request(self, evas_obj):
		ecore.main_loop_quit()
Beispiel #40
0
	def new_action(self, signal):
		global display, m, mem, last_signal, sintax_error, keytable_n
		print "Received signal: "+signal
		if mem == sintax_error:
			mem = ""
			self.print_to(display, "0")
		if signal == "M-":
			m = ""
			return
		if signal == "M+":
			mem_ = mem
			self.calculate_result()
			m = mem
			mem = mem_
			return
		if signal == "M":
			signal = m
		if signal == "home":
			self.main_group.hide()
			self.__main_group("main")
			self.main_group.show()
			if mem <> "":
				self.print_to(display, mem)
			else:
				self.print_to(display, "0")
			keytable_n = 0
			return
		if signal[:1] == "_":
			if signal == "_cst":
				self.main_group.hide()
				self.__main_group("sub_1")
				self.main_group.show()
				if mem <> "":
					self.print_to(display, mem)
				else:
					self.print_to(display, "0")
				keytable_n = 1
			if signal == "_fns":
				self.main_group.hide()
				self.__main_group("sub_2")
				self.main_group.show()
				if mem <> "":
					self.print_to(display, mem)
				else:
					self.print_to(display, "0")
				keytable_n = 2
			return
		if ((last_signal == "=") & (self.is_op(signal) == False)):
			mem = ""
			self.print_to(display, "0")	
		if signal == "Exit":
			ecore.main_loop_quit()
		elif signal == "rnd":
			self.current_state(signal)
		elif signal == "=":
			if string.replace(string.replace(mem,"(",""),")","") <> "":
				self.calculate_result()
				self.print_to(display, mem)
		elif signal == "C":
			mem = ""
			self.print_to(display, "0")
		elif signal == "<-":
			consts = ("arcsin(","arccos(","arctan(","sin(","cos(","tan(","√(","π","mu","C_2","B_2","B_4","N_0","B_L","∆","M_1")
			mem_ = mem
			for i in consts:
				if mem[len(mem)-len(i):] == i:
					mem = mem[:len(mem)-len(i)]
					break;
			if mem == mem_: mem = mem[:len(mem)-1]
			if mem == "":
				self.print_to(display, "0")
			else:
				self.print_to(display, mem)
		elif signal[:1] == "o":
			pass
		elif signal[:1] == "?":
			self.print_to(display, "Developed by "+__author__+"  -> [email protected]")
		else:
			self.current_state(signal)
		last_signal = signal
def key_down_cb(bg, event, ee):
    k = event.key
    if k == "Escape":
        ecore.main_loop_quit()
    if k in ("F6", "f"):
        ee.fullscreen = not ee.fullscreen
Beispiel #42
0
 def stop(self):
     ecore.main_loop_quit()
     self.running = False
Beispiel #43
0
def click_close(edje_obj, signal, source):
  ecore.main_loop_quit()
Beispiel #44
0
def on_key_down(obj, event, ee):
    if event.keyname in ("F6", "f"):
        ee.fullscreen = not ee.fullscreen
    elif event.keyname == "Escape":
        ecore.main_loop_quit()
Beispiel #45
0
def handle_read(fd_handler, file):
    line = file.read(1)
    r = bool(line and not fd_handler.has_error())
    if not r:
        ecore.main_loop_quit()
    return r
Beispiel #46
0
 def quit_game(obj, signal, source):
     main_loop_quit()
	def shutdown( self ):
		ecore.main_loop_quit()
Beispiel #48
0
    def on_edje_signal_button_pressed(self, emission, source):

        if source == "quit":

            self.main.connection.terminate_connection()
            self.main.on_exit()
            ecore.main_loop_quit()

        elif source == "mouse":

            self.main.transition_to("mouse_ui")

        elif source == "keyboard":

            self.main.transition_to("keyboard_ui")

        elif source == "presentation":

            self.main.transition_to("presentation")

        elif source == "multimedia":

            self.main.transition_to("multimedia")

        elif source == "games":

            self.main.transition_to("games")

        elif source == "accelerometer":
            self.main.accelerometer_prev = "menu"
            self.main.transition_to("accelerometer")

        elif source == "connection":

            if self.main.connection.connect:
                self.main.groups["connection_status"].part_text_set(
                    "label_connect_to", "Connected to:")
                self.main.groups["connection_status"].part_text_set(
                    "label_client", self.main.connection.client_name)
                self.main.groups["connection_status"].part_text_set(
                    "label_addr", self.main.connection.client_addr)
            else:
                self.part_text_set("label_not_connect",
                                   "You are not connect to any device")

            self.main.transition_to("connection_status")

        elif source == "about":

            self.main.groups["about"].part_text_set("label_version",
                                                    "ReMoko v0.4")
            self.main.groups["about"].part_text_set("label_developed",
                                                    "Developed by:")
            self.main.groups["about"].part_text_set("label_name",
                                                    "Valerio Valerio")
            self.main.groups["about"].part_text_set("label_email",
                                                    "<*****@*****.**>")
            self.main.groups["about"].part_text_set("label_thanks",
                                                    "Thanks to:")
            self.main.groups["about"].part_text_set("label_claudio",
                                                    "Claudio Takahasi")
            self.main.groups["about"].part_text_set("label_daniel",
                                                    "Daniel Willmann ")
            self.main.groups["about"].part_text_set("label_joachim",
                                                    "Joachim Breitner")

            self.main.transition_to("about")

        elif source == "conf":

            self.main.transition_to("settings")
        else:

            print "feature not implemented yet :) "