From efe70841651e1a58d8dc9d251419878cfbfcf404 Mon Sep 17 00:00:00 2001 From: Abraxa Date: Sun, 31 Aug 2008 02:00:48 +0000 Subject: [PATCH] Rename dialer main screen theme file Add "in call" screen theme file Rework TestView and EdjeGroup classes to allow the use of multiple edje groups and corresponding theme files Add compile_theme script, making use of easy_e17 Fix bug in EdjeGroup.__init__() that made use of newly renamed variable f git-svn-id: http://www.neo1973-germany.de/svn@107 46df4e5c-bc4e-4628-a0fc-830ba316316d --- epydial/compile_theme | 9 + epydial/data/themes/dialer_incall.edc | 203 ++++++++++++++++++ epydial/data/themes/dialer_incall.edj | Bin 0 -> 13351 bytes .../themes/{dialer.edc => dialer_main.edc} | 0 .../themes/{dialer.edj => dialer_main.edj} | Bin 24442 -> 24447 bytes epydial/epydial.py | 41 +++- 6 files changed, 242 insertions(+), 11 deletions(-) create mode 100755 epydial/compile_theme create mode 100644 epydial/data/themes/dialer_incall.edc create mode 100644 epydial/data/themes/dialer_incall.edj rename epydial/data/themes/{dialer.edc => dialer_main.edc} (100%) rename epydial/data/themes/{dialer.edj => dialer_main.edj} (99%) diff --git a/epydial/compile_theme b/epydial/compile_theme new file mode 100755 index 0000000..82099c8 --- /dev/null +++ b/epydial/compile_theme @@ -0,0 +1,9 @@ +#!/bin/bash + +cd data/themes + +for filename in *.edc +do + /opt/e17/bin/edje_cc -id ../images -fd ../fonts $filename +done + diff --git a/epydial/data/themes/dialer_incall.edc b/epydial/data/themes/dialer_incall.edc new file mode 100644 index 0000000..452322b --- /dev/null +++ b/epydial/data/themes/dialer_incall.edc @@ -0,0 +1,203 @@ +// incall.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"; \ + } \ + } \ +} \ +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/incall"; + 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); */ + + BUTTON(1, 0.1, 0.2, 0.9, 0.4, "End Call"); + BUTTON(2, 0.1, 0.45, 0.9, 0.65, "Back To Dialer"); + BUTTON(3, 0.1, 0.7, 0.9, 0.9, "Hold Call"); +/* DESIGN_SEPERATOR(1, 1/3, 25/70, 1/3, 35/70); */ +/* DESIGN_SEPERATOR(2, 2/3, 25/70, 2/3, 35/70); */ + } + } +} diff --git a/epydial/data/themes/dialer_incall.edj b/epydial/data/themes/dialer_incall.edj new file mode 100644 index 0000000000000000000000000000000000000000..6ca896cb9de30e6bd2b4680e9dbe1f4ac4d9e730 GIT binary patch literal 13351 zcmb_h2|!fk_P@CX?ku9TanW^iWM+%?3#SMHgL zk!5O@WM--5b1l@gMRUpIC2ooOQW8Z_|G)Fy?+$lHDtqsL^>DuLch5QBcg}ad?M{b_ zE#d@0s1G_N2<^0j(BLgWNQoDOR-=J62R$MPnj@&+=kzkLW*|KJ!+1SX5E|{kyBq-C zAjk{#P@e|=C}`Y$Jm3w1%?9@ZjpSGgumz}-Tn@*!09%fFQ_v=kL9f-js5hZHJt!{$ zRt(-qMi^!XwiOuK7e;ZpbYPzmrjny}w<{QUe~<|5a|PqNslav;1`6j`C9qwn`+-t8 zb_^IuXaY*&*eGECM!i1O=|LH`T9tu!kP(KB69gZM8O5L%mqT2AC{B%4a+iU%1V&@B zkjueWpAM+E0d3~kX<*$^Z>G|{3k+k*`aF-zl>!?9>~WPG#@S~gu#PGWW9suJuoj?` zT=xTD>rrnE+RL$-z-T-gsC3T*!*~jvL0h@p%2{FMEOY1lEdd(SvdnuxG)W%Lv0(0eb9(Bs;r5uxhZAP7RXLAhW<+}}an)|UFD*?72b;_4FIfj_{9ztE+KltxU zb5QNa$G|WjSQ|rCZBVY!T%|Zt%rOUjuW=0hV!1vCSQW~&)}7$G$SFVS2l??9$1orL zXm0pYogS16fQ5il3`#f#9lx%qtNZK(MtR`J6lL9cs6IowDr^(5Bwzuc4cy*$z|v4x zuZfd@!56m}V6OQgSLHn5y2uN^`GkR}kCYR~fzi0B`-k!H+W@R7*Na8@4zR7@LR~$##sf2R zx$n6g)(8J=!l+IU%J9Me6>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06SK6-ymGtR0>z|K3{axHg zw!2O2|GN42*Phz-c8ej7{N<*jD^_1fe$qGR()#v~=4eh&>q>u4XXDTMoZAf!H+X-? F{{fWO1g`)9 literal 0 HcmV?d00001 diff --git a/epydial/data/themes/dialer.edc b/epydial/data/themes/dialer_main.edc similarity index 100% rename from epydial/data/themes/dialer.edc rename to epydial/data/themes/dialer_main.edc diff --git a/epydial/data/themes/dialer.edj b/epydial/data/themes/dialer_main.edj similarity index 99% rename from epydial/data/themes/dialer.edj rename to epydial/data/themes/dialer_main.edj index f939daaa36ed48eb34e02b319101f064b098f191..88fcbd1fe71dde1b8bc5a744abeb33addf5e29c0 100644 GIT binary patch delta 95 zcmeyhkMaLL#tGV@ml+t8fmrGk0|Nsu5CcJ++C~R)EA!LJ3=Dyc3=Ga5-s$^+>;MQm hWiycN4`K6&0F}!FaY|-lPHItnZenKM=1!}RDgaiB7bE}x delta 90 zcmeyrkMY+&#tGV@=NK52fmrGk0|Nsu5CcJ+;zkE?E2Cq|3=Dyc3=Ga5-s!u5>;MQm cWgU?14`K801C`4IaY|-lPHNHSKC6!^0O4#D{Qv*} diff --git a/epydial/epydial.py b/epydial/epydial.py index 4884ec6..8177f56 100755 --- a/epydial/epydial.py +++ b/epydial/epydial.py @@ -11,8 +11,11 @@ FRAMETIME = 1.0 / 20 FULLSCREEN = True TITLE = "epydial" WM_INFO = ("epydial", "epydial") -EDJE_GROUP_NAME = "pyneo/dialer/main" -EDJE_FILE_NAME = "data/themes/dialer.edj" + +EDJE_FILE_PATH = "data/themes/" + +MAIN_GROUP_NAME = "pyneo/dialer/main" +INCALL_GROUP_NAME = "pyneo/dialer/incall" from datetime import datetime from dbus import SystemBus @@ -36,19 +39,29 @@ class EdjeGroup(edje.Edje): def __init__(self, main, group): self.main = main - if not os.path.exists(EDJE_FILE_NAME): - raise IOError("Edje theme file not found: " + EDJE_FILE_NAME) + # Theme file name is formed as follows: + # Last two group name parts, combined by underscore + # pyneo/dialer/main -> dialer_main.edj + group_parts = group.split("/") + file_name = EDJE_FILE_PATH + group_parts[-2] + "_" + group_parts[-1] + ".edj" + + if not os.path.exists(file_name): + raise IOError("Edje theme file for group %s not found: %s" % (group, file_name)) try: - edje.Edje.__init__(self, self.main.evas_canvas.evas_obj.evas, file=EDJE_FILE_NAME, group=group) + edje.Edje.__init__(self, self.main.evas_canvas.evas_obj.evas, file=file_name, group=group) except edje.EdjeLoadError, e: - raise SystemExit("Error loading %s: %s" % (f, e)) + raise SystemExit("Error loading %s: %s" % (file_name, e)) self.size = self.main.evas_canvas.evas_obj.evas.size +class InCallScreen(EdjeGroup): + def __init__(self, main): + EdjeGroup.__init__(self, main, INCALL_GROUP_NAME) + class MainScreen(EdjeGroup): def __init__(self, main): - EdjeGroup.__init__(self, main, EDJE_GROUP_NAME) + EdjeGroup.__init__(self, main, MAIN_GROUP_NAME) self.text = [] dbus_ml = e_dbus.DBusEcoreMainLoop() @@ -154,10 +167,16 @@ class TestView(object): self.evas_canvas = EvasCanvas(FULLSCREEN, "x11-16") self.groups = {} - self.groups[EDJE_GROUP_NAME] = MainScreen(self) - self.evas_canvas.evas_obj.data[EDJE_GROUP_NAME] = self.groups[EDJE_GROUP_NAME] - self.groups[EDJE_GROUP_NAME].show() - self.groups[EDJE_GROUP_NAME].part_text_set("numberdisplay_text", "wait ...") + + self.init_group(MAIN_GROUP_NAME, MainScreen(self)) + self.init_group(INCALL_GROUP_NAME, InCallScreen(self)) + + self.groups[MAIN_GROUP_NAME].part_text_set("numberdisplay_text", "wait ...") + self.groups[MAIN_GROUP_NAME].show() + + def init_group(self, name, instance): + self.groups[name] = instance + self.evas_canvas.evas_obj.data[name] = instance class EvasCanvas(object): def __init__(self, fullscreen, engine_name):