2008-12-27 23:42:12 +00:00
|
|
|
#!/usr/bin/env python2.5
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
__author__ = "Soeren Apel (abraxa@dar-clan.de), Frank Gau (fgau@gau-net.de), Thomas Gstaedtner (thomas (a) gstaedtner (.) net)"
|
|
|
|
__version__ = "prototype"
|
|
|
|
__copyright__ = "Copyright (c) 2008"
|
|
|
|
__license__ = "GPL3"
|
|
|
|
|
|
|
|
from epydial import *
|
|
|
|
|
|
|
|
class PixScreen(EdjeGroup):
|
|
|
|
pix_pointer = 0
|
|
|
|
|
|
|
|
def __init__(self, screen_manager):
|
|
|
|
EdjeGroup.__init__(self, screen_manager, PIX_SCREEN_NAME)
|
|
|
|
|
|
|
|
self.objects = os.listdir(PIX_FILE_PATH)
|
|
|
|
self.part_text_set("filename", self.objects[self.pix_pointer])
|
|
|
|
|
|
|
|
self.on_get_pix()
|
|
|
|
|
|
|
|
def on_get_pix(self):
|
|
|
|
self.image = self.evas.Image(file=PIX_FILE_PATH + self.objects[self.pix_pointer])
|
|
|
|
print 'pix: ', self.objects[self.pix_pointer]
|
|
|
|
x, y = self.image.image_size
|
|
|
|
dx, dy = self.part_size_get('clipper')
|
|
|
|
print 'x, y, dx, dy: ', x, y, dx, dy
|
|
|
|
if x * dy > y * dx:
|
|
|
|
y = y * dx / x
|
|
|
|
x = dx
|
|
|
|
else:
|
|
|
|
x = x * dy / y
|
|
|
|
y = dy
|
|
|
|
print 'x, y, dx, dy: ', x, y, dx, dy
|
2009-02-17 18:24:41 +00:00
|
|
|
self.image.fill = (361-x)/2, (361-y)/2, x, y
|
2008-12-27 23:42:12 +00:00
|
|
|
self.part_swallow('icon', self.image)
|
|
|
|
self.obj = self.part_object_get('clipper')
|
2009-02-17 18:24:41 +00:00
|
|
|
self.obj.geometry = 60+(361-x)/2, 140+(361-y)/2, x, y
|
2008-12-27 23:42:12 +00:00
|
|
|
self.obj.show()
|
|
|
|
print 'obj: ', self.obj
|
|
|
|
|
|
|
|
@edje.decorators.signal_callback("mouse,up,1", "*")
|
|
|
|
def on_edje_signal_dialer_status_triggered(self, emission, source):
|
|
|
|
if source == "pre":
|
|
|
|
self.image.delete()
|
|
|
|
self.pix_pointer += 1
|
|
|
|
self.part_text_set("filename", self.objects[self.pix_pointer])
|
|
|
|
self.on_get_pix()
|
|
|
|
if source == "rev":
|
|
|
|
self.image.delete()
|
|
|
|
self.pix_pointer -= 1
|
|
|
|
self.part_text_set("filename", self.objects[self.pix_pointer])
|
|
|
|
self.on_get_pix()
|
|
|
|
if source == "button_10":
|
|
|
|
self.image.delete()
|
|
|
|
PyneoController.show_dialer_screen()
|
|
|
|
print 'source: ', source
|
|
|
|
|