From 14791e602a2e4062a41d545fd731fdc259d17d4a Mon Sep 17 00:00:00 2001 From: fgau Date: Wed, 27 Aug 2008 21:26:20 +0000 Subject: [PATCH] initialisation git-svn-id: http://www.neo1973-germany.de/svn@93 46df4e5c-bc4e-4628-a0fc-830ba316316d --- epydial/data/themes/dialer.edc | 387 +++++++++++++++++++++++++++++++++ epydial/data/themes/dialer.edj | Bin 0 -> 24438 bytes epydial/epydial.py | 199 +++++++++++++++++ 3 files changed, 586 insertions(+) create mode 100644 epydial/data/themes/dialer.edc create mode 100644 epydial/data/themes/dialer.edj create mode 100755 epydial/epydial.py diff --git a/epydial/data/themes/dialer.edc b/epydial/data/themes/dialer.edc new file mode 100644 index 0000000..8f4c4e1 --- /dev/null +++ b/epydial/data/themes/dialer.edc @@ -0,0 +1,387 @@ +// dialer.edc +// this is a theme for epydial, a pyneo dialer +// +// TODO: make the font colors shinier :) +// +// Signal1: "dialer_send" +// Parameter1.1: $"keynumber" +// Parameter1.2: "backspace" +// Parameter1.2: "dial" + +data { + item: "author" "thomasg [thomas (a) gstaedtner (.) net]"; + item: "version" "prototype"; + item: "name" "epydial_default"; +} + +color_classes { + color_class { + name: "button_inactive"; + color: 255 255 255 255; + color2: 25 215 0 255; + color3: 25 215 0 255; + } + color_class { + name: "button_active"; + color: 0 0 0 255; + color2: 0 0 0 255; + color3: 0 0 0 255; + } +} + +spectra { + spectrum { + name: "background"; + color: 80 80 80 255 1; + color: 210 210 210 255 1; + } + spectrum { + name: "button"; + color: 5 5 5 255 1; + color: 110 110 110 255 1; + color: 10 10 10 255 1; + } + spectrum { + name: "button_active"; + color: 15 170 0 255 1; + color: 130 255 0 255 1; + color: 20 200 0 255 1; + } +} + +#define BUTTON(button_number, rel1x, rel1y, rel2x, rel2y, button_caption) \ +part { \ + name: "button_"button_number; \ + type: GRADIENT; \ + description { \ + state: "default" 0; \ + gradient { \ + spectrum: "button"; \ + rel1 { relative: 0 0; offset: 0 0; }; \ + rel2 { relative: 0 0.75; offset: 0 0; }; \ + } \ + fill { \ + spread: 1; \ + angle: 1; \ + size { relative: 1 0; offset: 0 0; }; \ + } \ + rel1 { relative: rel1x rel1y; offset: 0 0; }; \ + rel2 { relative: rel2x rel2y; offset: 0 0; }; \ + } \ + description { \ + state: "default" 0.5; \ + inherit: "default" 0; \ + gradient.spectrum: "button_active"; \ + rel1.offset: 0 -5; \ + rel2.offset: 0 5; \ + } \ + description { \ + state: "default" 1; \ + inherit: "default" 0; \ + } \ +} \ +part { \ + name: "button_accent_"button_number; \ + type: RECT; \ + description { \ + state: "default" 0; \ + color: 25 215 0 255; \ + rel1 { \ + to: "button_"button_number; \ + relative: 0 0.95; \ + } \ + rel2.to: "button_"button_number; \ + } \ +} \ +part { \ + name: "button_"button_number"_caption"; \ + type: TEXT; \ + mouse_events: 0; \ + effect: GLOW; \ + description { \ + state: "default" 0; \ + color_class: "button_inactive"; \ + rel1 { \ + to: "button_"button_number; \ + relative: 0 0; \ + } \ + rel2 { \ + to: "button_"button_number; \ + relative: 1 1; \ + } \ + text { \ + text: button_caption; \ + size: 18; \ + font: "Sans:style=Bold,Edje-Vera"; \ + fit: 1 1; \ + } \ + } \ +} \ +program { \ + name: "button_"button_number"_signal_emit"; \ + signal: "mouse,down,*"; \ + source: "button_"button_number; \ + action: SIGNAL_EMIT "dialer_send" button_caption; \ +} \ +program { \ + name: "button_"button_number"_animation"; \ + signal: "mouse,down,*"; \ + source: "button_"button_number; \ + action: STATE_SET "default" 0.5; \ + target: "button_"button_number; \ +} \ +program { \ + name: "button_"button_number"_animation_end"; \ + signal: "mouse,up,*"; \ + source: "button_"button_number; \ + action: STATE_SET "default" 1; \ + target: "button_"button_number; \ + transition: DECELERATE 0.1; \ +} + +#define DESIGN_STRIPE(stripe_number, rel1x, rel1y, rel2x, rel2y) \ +part { \ + name: "design_stripe_"stripe_number; \ + type: RECT; \ + description { \ + state: "default" 0; \ + color: 0 0 0 255; \ + rel1 { relative: rel1x rel1y; offset: 0 0; }; \ + rel2 { relative: rel2x rel2y; offset: 0 0; }; \ + } \ +} + +#define DESIGN_SEPERATOR(seperator_number, rel1x, rel1y, rel2x, rel2y) \ +part { \ + name: "design_seperator_"seperator_number; \ + type: RECT; \ + description { \ + state: "defeault" 0; \ + color: 255 255 255 100; \ + rel1 { relative: rel1x rel1y; offset: -0.5 7; }; \ + rel2 { relative: rel2x rel2y; offset: 0.5 -9; }; \ + } \ +} + +collections { + group { + name: "pyneo/dialer/main"; + min: 100 100; + max: 800 800; + parts { + part { + name: "background"; + type: GRADIENT; + description { + state: "default" 0; + gradient { + spectrum: "background"; + rel1 { relative: 0 0; offset: 0 0; }; + rel2 { relative: 0 1; offset: 0 0; }; + } + fill { + spread: 1; + angle: 1; + size { relative: 1 0; offset: 0 0; }; + } + rel1 { relative: 0 0; offset: 0 0; }; + rel2 { relative: 1 1; offset: 0 0; }; + } + } + + /* stripes - just for design :) */ + DESIGN_STRIPE(1, 1/2, 0.18, 1, 0.18); + DESIGN_STRIPE(2, 1/2, 0.22, 1, 0.22); + DESIGN_STRIPE(3, 1/2, 0.26, 1, 0.26); + + part { + name: "numberdisplay_background"; + type: RECT; + description { + state: "default" 0; + color: 0 0 0 255; + rel1 { relative: 0.02 0.02; offset: 0 0; }; + rel2 { relative: 0.9 0.3; offset: 0 0; }; + } + } + part { + name: "numberdisplay_foreground"; + type: RECT; + description { + state: "default" 0; + color: 255 255 255 255; + rel1 { + to: "numberdisplay_background"; + offset: 2 2; + } + rel2 { + to: "numberdisplay_background"; + offset: -7 -7; + } + } + description { + state: "default" 0.5; + inherit: "default" 0; + color: 150 255 60 255; + rel1.offset: -10 -10; + rel2.offset: 10 10; + } + description { + state: "default" 1; + inherit: "default" 0; + } + + } + program { + name: "numberdisplay_forground_signal_emit"; + signal: "mouse,down,*"; + source: "numberdisplay_foreground"; + action: SIGNAL_EMIT "dialer_send" "dial"; + } + program { + name: "numberdisplay_foreground_animation"; + signal: "mouse,down,*"; + source: "numberdisplay_foreground"; + action: STATE_SET "default" 0.5; + target: "numberdisplay_foreground"; + transition: LINEAR 0.25; + } + program { + name: "numberdisplay_foreground_animation_end"; + signal: "mouse,up,*"; + source: "numberdisplay_foreground"; + action: STATE_SET "default" 1;; + target: "numberdisplay_foreground"; + transition: LINEAR 0.25; + } + part { + name: "numberdisplay_text"; + type: TEXT; + mouse_events: 0; + effect: OUTLINE_SOFT_SHADOW; + description { + state: "default" 0; + color_class: "button_inactive"; + rel1 { + to: "numberdisplay_foreground"; + relative: 0.02 0; + } + rel2 { + to: "numberdisplay_foreground"; + relative: 0.75 1; + } + text { + text: "testmode"; + size: 18; + font: "Sans:style=Bold,Edje-Vera"; + fit: 1 1; + } + } + } + part { + name: "numberdisplay_backspace"; + type: TEXT; + mouse_events: 0; + effect: GLOW; + description { + state: "default" 0; + color_class: "button_inactive"; + rel1 { + to: "numberdisplay_foreground"; + relative: 0.77 0; + } + rel2 { + to: "numberdisplay_foreground"; + relative: 1 1; + } + text { + text: "<"; + size: 18; + font: "Sans:style=Bold,Edje-Vera"; + fit: 1 1; + } + } + } + part { + name: "numberdisplay_backspace_area"; + type: RECT; + description { + state: "default" 0; + color: 0 0 0 0; + rel1 { relative: 2/3 0; offset: 0 0; }; + rel2 { relative: 3/3 22/70; offset: 0 0; }; + } + description { + state: "default" 0.3; + rel1.to: "numberdisplay_foreground"; + rel2.to: "numberdisplay_foreground"; + } + description { + state: "default" 0.6; + inherit: "default" 0.3; + color: 255 0 0 100; + } + description { + state: "default" 1; + inherit: "default" 0; + } + } + program { + name: "numberdisplay_backspace_area_signal_emit"; + signal: "mouse,down,*"; + source: "numberdisplay_backspace_area"; + action: SIGNAL_EMIT "dialer_send" "backspace"; + } + program { + name: "numberdisplay_backspace_area_animation_start"; + signal: "mouse,down,*"; + source: "numberdisplay_backspace_area"; + action: STATE_SET "default" 0.3; + target: "numberdisplay_backspace_area"; + transition: LINEAR 0; + after: "numberdisplay_backspace_area_animation_continue"; + } + program { + name: "numberdisplay_backspace_area_animation_continue"; + action: STATE_SET "default" 0.6; + target: "numberdisplay_backspace_area"; + transition: LINEAR 0.3; + after: "numberdisplay_backspace_area_animation_stop"; + } + program { + name: "numberdisplay_backspace_area_animation_stop"; + action: STATE_SET "default" 1; + target: "numberdisplay_backspace_area"; + transition: LINEAR 0; + } + + /* row 1 */ + BUTTON(1, 0, 25/70, 1/3, 35/70, 1); + BUTTON(2, 1/3, 25/70, 2/3, 35/70, 2); + BUTTON(3, 2/3, 25/70, 3/3, 35/70, 3); + DESIGN_SEPERATOR(1, 1/3, 25/70, 1/3, 35/70); + DESIGN_SEPERATOR(2, 2/3, 25/70, 2/3, 35/70); + + /* row 2 */ + BUTTON(4, 0, 36/70, 1/3, 46/70, 4); + BUTTON(5, 1/3, 36/70, 2/3, 46/70, 5); + BUTTON(6, 2/3, 36/70, 3/3, 46/70, 6); + DESIGN_SEPERATOR(4, 1/3, 36/70, 1/3, 46/70); + DESIGN_SEPERATOR(5, 2/3, 36/70, 2/3, 46/70); + + /* row 3 */ + BUTTON(7, 0, 47/70, 1/3, 57/70, 7); + BUTTON(8, 1/3, 47/70, 2/3, 57/70, 8); + BUTTON(9, 2/3, 47/70, 3/3, 57/70, 9); + DESIGN_SEPERATOR(7, 1/3, 47/70, 1/3, 57/70); + DESIGN_SEPERATOR(8, 2/3, 47/70, 2/3, 57/70); + + /* row 4 */ + BUTTON(10, 0, 58/70 , 1/3, 68/70, "*"); + BUTTON(11, 1/3, 58/70, 2/3, 68/70, 0); + BUTTON(12, 2/3, 58/70, 3/3, 68/70, "#"); + DESIGN_SEPERATOR(10, 1/3, 58/70, 1/3, 68/70); + DESIGN_SEPERATOR(11, 2/3, 58/70, 2/3, 68/70); + } + } +} diff --git a/epydial/data/themes/dialer.edj b/epydial/data/themes/dialer.edj new file mode 100644 index 0000000000000000000000000000000000000000..dcf1b959442b4aeffebd63e7af45529130e1383f GIT binary patch literal 24438 zcmd6O30#y__y0rYf=gPiiO8_1>@YL32o|}Jmiv;sjspxx!VJy~AZ}>ct7&ejsim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#?`L0rHHl z?;HIiyA7uOOce4@>=lz%aW2>cQ|rBgn6>`BS*pciW%&QvVD_Bp$stMiYkW3kH?oYs z`kgETrCZqnZw(~}YlaMXeW+$g?`}PDXUiC#Y1NCY@+YshTMgUIEtAJLcClXDE>~l} zwR;}G4go%#xbS&?`?m##@TZ~J7q~$2o>vmcZhGCM-%4`dI@<1dIp5Q7c_l{ao>y#( zV@`LZmKf4cnPJ<5c^+EqaUy$O!6g3aG_xlbjP3uoc?}6cjwpA@Kbu!d#O$QiHmP0z zuV#}*{%e!T{x_Q4!u>}HhL}xB4y}>Vsshwc%*boxQED)&Q~@DRNa4i*ex`6jGA7Om zJLPN1aB8l7(nfsT_mrdJuc#5s)u=5Gu<9tgha_+E`!H#fcouu52&`=wQ3Iy57%0-i zBj%u5vkmLQukk+@dEESsl*3*om-7s1hqa&BArw@`U#nc z)jqp*DSN&oWh0^#_CGdj!_-O!csM_Ap5N2rS5SyVvVm-u8e|jE6lfxOAaLyQN$Jm8y!5NvMoUzLj z6o(3O*{sgGJb@p&h{lPE+H?WG%+SvEhAI)U_zMb!r3yY`Fg1J?Zr*NoHYlYSW6XRs z&KqdYDMc6OWadgz-MQ2nGfS$7R*K`ZI_vcWi%B8TOtAy2+dAN2!mEDAhQj1uGKYru z|8ZcmF`c^J2z{-=Y>Uf*jCbms+_Yoazux)qodbh6PiwHSM`X7=hrxR;zqG7{Io4%d z@y~8PO=EnwUR{t`eBSwJ`<_3Rr+r-Z&fI!GZ+8xyvP^UAlaE3+HoUm3{nfkmmqvEU zxtr!1u_&QOuUk3l6F=N?uGjc@4p{OS)Inhr9}{y6&d>UCF#c5a?p_JwnURKu I`LFi=KY;rb3jhEB literal 0 HcmV?d00001 diff --git a/epydial/epydial.py b/epydial/epydial.py new file mode 100755 index 0000000..46b0243 --- /dev/null +++ b/epydial/epydial.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python2.5 +# -*- coding: utf-8 -*- +__author__ = "" +__version__ = "prototype" +__copyright__ = "Copyright (c) 2008" +__license__ = "GPL3" + +WIDTH = 480 +HEIGHT = 640 +FS = True +TITLE = "epydial" +WM_INFO = ("epydial", "epydial") + +import os +import sys +import ecore +import ecore.evas +import evas.decorators +import edje.decorators +import edje +from dbus import SystemBus +from e_dbus import DBusEcoreMainLoop +import e_dbus +from datetime import datetime +from os import system # alsactl is used with a sytem call +from pyneo.dbus_support import * +from pyneo.sys_support import pr_set_name + +from ConfigParser import SafeConfigParser +from os.path import exists +import time + +#import sqlite3 + +for i in "data/themes/dialer.edj".split(): + if os.path.exists( i ): + global edjepath + edjepath = i + break +else: + raise "Edje not found" + +class edje_group(edje.Edje): + def __init__(self, main, group): + self.main = main + global edjepath + f = edjepath + try: + edje.Edje.__init__(self, self.main.evas_canvas.evas_obj.evas, file=f, group=group) + except edje.EdjeLoadError, e: + raise SystemExit("error loading %s: %s" % (f, e)) + self.size = self.main.evas_canvas.evas_obj.evas.size + +class dialer_main(edje_group): + def __init__(self, main): + edje_group.__init__(self, main, "pyneo/dialer/main") + self.text = [] + + dbus_ml = e_dbus.DBusEcoreMainLoop() + self.system_bus = SystemBus(mainloop=dbus_ml) + self.init_dbus() + + def init_dbus(self): + try: + self.gsm = object_by_url('dbus:///org/pyneo/GsmDevice') + self.wireless = object_by_url('dbus:///org/pyneo/gsmdevice/Network') + self.keyring = object_by_url('dbus:///org/pyneo/GsmDevice') + except Exception, e: + print e + #if not self.dbus_timer: + # self.dbus_timer = ecore.timer_add(2, self.init_dbus) + # We had an error, keep the timer running + #return True + + # No error, all went well + #if self.dbus_timer: self.dbus_timer.stop() + # D-Bus is ready, let's init GSM + self.gsm_on() + + def gsm_on(self): + try: + if self.gsm.GetPower('sample', dbus_interface=DIN_POWERED, ): + print '---', 'gsm device is already on' + else: + self.gsm.SetPower('sample', True, dbus_interface=DIN_POWERED, ) + print '---', 'switching device on' + except Exception, e: + print e + #if not self.gsm_timer: + # self.gsm_timer = ecore.timer_add(5, self.gsm_on) + # We had an error, keep the timer running + #return True + # No error + #if self.gsm_timer: self.gsm_timer.stop() + # GSM ready, let's ask SIM PIN + self.sim_pin() + + def sim_pin(self): + self.res = dedbusmap(self.keyring.GetOpened(dbus_interface=DIN_KEYRING)) + if self.res['code'] != 'READY': # TODO unify! + print '---', 'opening keyring' + self.part_text_set("numberdisplay_text", "Enter " + self.res['code']) + self.res = dedbusmap(self.keyring.GetOpened(dbus_interface=DIN_KEYRING)) + else: + print '---', 'already authorized' + self.nw_register() + + def nw_register(self): + self.nw_res = dedbusmap(self.wireless.GetStatus(dbus_interface=DIN_WIRELESS)) + if not self.nw_res['stat'] in (1, 5, ): # TODO unify! + print '---', 'registering to gsm network' + self.wireless.Register(dbus_interface=DIN_WIRELESS) + self.nw_res = dedbusmap(self.wireless.GetStatus(dbus_interface=DIN_WIRELESS)) + else: + print '---', 'already registered' + + @edje.decorators.signal_callback("dialer_send", "*") + def on_edje_signal_numberkey_triggered(self, emission, source): + if self.res['code'] != 'READY': + if source in ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "#", "*", ): + self.text.append(source) + print ''.join(self.text) + self.part_text_set("numberdisplay_text", "".join(self.text)) + elif source == "backspace": + self.text = self.text[:-1] + print ''.join(self.text) + self.part_text_set("numberdisplay_text", "".join(self.text)) + elif source == "dial": + print '---', 'send pin' + self.keyring.Open(''.join(self.text), dbus_interface=DIN_KEYRING, ) + self.part_text_set("numberdisplay_text", "register ...") + self.nw_register() + else: + if source in ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "#", "*", ): + self.text.append(source) + print ''.join(self.text) + self.part_text_set("numberdisplay_text", "".join(self.text)) + elif source == "backspace": + self.text = self.text[:-1] + print ''.join(self.text) + self.part_text_set("numberdisplay_text", "".join(self.text)) + elif source == "dial": + print '---', 'dial number' + self.part_text_set("numberdisplay_text", "register ...") + +class TestView(object): + def __init__(self): + edje.frametime_set(1.0 / 20) + self.evas_canvas = EvasCanvas(fullscreen=FS, engine="x11-16", size="480x640") + + self.groups = {} + self.groups["pyneo/dialer/main"] = dialer_main(self) + self.evas_canvas.evas_obj.data["pyneo/dialer/main"] = self.groups["pyneo/dialer/main"] + self.groups["pyneo/dialer/main"].show() + self.groups["pyneo/dialer/main"].part_text_set("numberdisplay_text", "wait ...") + +class EvasCanvas(object): + def __init__(self, fullscreen, engine, size): + if engine == "x11": + f = ecore.evas.SoftwareX11 +# elif engine == "x11-16": +# if ecore.evas.engine_type_supported_get("software_x11_16"): +# f = ecore.evas.SoftwareX11_16 + else: + print "warning: x11-16 is not supported, fallback to x11" + f = ecore.evas.SoftwareX11 + + self.evas_obj = f(w=480, h=640) + self.evas_obj.callback_delete_request = self.on_delete_request + self.evas_obj.callback_resize = self.on_resize + + self.evas_obj.title = TITLE + self.evas_obj.name_class = WM_INFO + self.evas_obj.fullscreen = FS +# self.evas_obj.size = size + self.evas_obj.show() + + def on_resize(self, evas_obj): + x, y, w, h = evas_obj.evas.viewport + size = (w, h) + for key in evas_obj.data.keys(): + evas_obj.data[key].size = size + + def on_delete_request(self, evas_obj): + ecore.main_loop_quit() + +if __name__ == "__main__": + TestView() + ecore.main_loop_begin() + +''' +export LDFLAGS="$LDFLAGS -L/opt/e17/lib" +export PKG_CONFIG_PATH="/opt/e17/lib/pkgconfig:$PKG_CONFIG_PATH" +export PATH="$PATH:/opt/e17/bin" +export PYTHONPATH="/home/fgau/usr/lib/python2.5/site-packages" + +edje_cc -v -id ../images -fd ../fonts *edc +''' +