aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2016-10-22 11:25:30 +0200
committerDave Andreoli <dave@gurumeditation.it>2016-10-22 11:25:30 +0200
commit2e5e96a8dd4c00976c517666819202f22954df90 (patch)
tree3e8589fc016bc5ecfb80b4bcb492bdf7aafa5559 /examples
parentwarnings -- (diff)
downloadpython-efl-2e5e96a8dd4c00976c517666819202f22954df90.tar.gz
Test Externals: keep in sync with the C test
Diffstat (limited to 'examples')
-rw-r--r--examples/elementary/test_external.edc238
-rw-r--r--examples/elementary/test_external.edjbin416265 -> 423047 bytes
-rw-r--r--examples/elementary/test_external.py29
3 files changed, 252 insertions, 15 deletions
diff --git a/examples/elementary/test_external.edc b/examples/elementary/test_external.edc
index 689b751..79363e1 100644
--- a/examples/elementary/test_external.edc
+++ b/examples/elementary/test_external.edc
@@ -95,7 +95,7 @@ collections {
rel1.offset: 0 60;
params {
string: "label" "icon + label";
- string: "icon" "home";
+ string: "icon" "user-home";
}
}
}
@@ -121,7 +121,7 @@ collections {
align: 0.5 0.0;
rel1.offset: 0 180;
params {
- string: "icon" "home";
+ string: "icon" "user-home";
}
}
description { state: "left" 0.0;
@@ -157,7 +157,7 @@ collections {
rel1.offset: 0 300;
params {
string: "label" "disabled";
- string: "icon" "home";
+ string: "icon" "user-home";
bool: "disabled" 1;
}
}
@@ -215,7 +215,7 @@ collections {
rel1.offset: 0 60;
params {
string: "label" "Horizontal";
- string: "icon" "home";
+ string: "icon" "user-home";
string: "unit format" "%.1f units";
string: "indicator format" "%.0f";
double: "min" -100.0;
@@ -233,7 +233,7 @@ collections {
rel1.offset: 0 90;
params {
string: "label" "Disabled";
- string: "icon" "home";
+ string: "icon" "user-home";
bool: "disabled" 1;
double: "value" 0.5;
}
@@ -263,7 +263,7 @@ collections {
rel1.offset: 20 160;
params {
string: "label" "Horizontal";
- string: "icon" "home";
+ string: "icon" "user-home";
bool: "horizontal" 0;
string: "unit format" "%.0f u";
string: "indicator format" "%.3f";
@@ -286,7 +286,7 @@ collections {
rel1.offset: 80 160;
params {
string: "label" "Inverted";
- string: "icon" "home";
+ string: "icon" "user-home";
bool: "horizontal" 0;
bool: "inverted" 1;
string: "unit format" "%.0f u";
@@ -310,7 +310,7 @@ collections {
rel1.offset: 140 160;
params {
string: "label" "Disabled";
- string: "icon" "home";
+ string: "icon" "user-home";
double: "min" -70.0;
double: "max" 70.0;
bool: "disabled" 1;
@@ -588,6 +588,7 @@ embryo script and from Python code.";
params {
string: "label" "infinite bouce";
string: "unit format" "";
+ bool: "pulse" 1;
}
}
}
@@ -601,7 +602,7 @@ embryo script and from Python code.";
rel1.offset: 0 140;
params {
string: "label" "inverted";
- string: "icon" "home";
+ string: "icon" "user-home";
bool: "inverted" 1;
string: "unit format" "%.3f units";
}
@@ -635,6 +636,7 @@ embryo script and from Python code.";
string: "label" "infinite bouce";
bool: "horizontal" 0;
string: "unit format" "";
+ bool: "pulse" 1;
}
}
}
@@ -649,7 +651,7 @@ embryo script and from Python code.";
rel2.offset: 0 -50;
params {
string: "label" "inverted";
- string: "icon" "home";
+ string: "icon" "user-home";
bool: "horizontal" 0;
bool: "inverted" 1;
bool: "disabled" 1;
@@ -667,6 +669,7 @@ embryo script and from Python code.";
rel2.offset: 0 -50;
params {
string: "style" "wheel";
+ bool: "pulse" 1;
}
}
}
@@ -732,6 +735,18 @@ embryo script and from Python code.";
}
program { name: "disable_button3";
action: PARAM_SET "ext_button3" "disabled" 1;
+ after: "start_pulsing1";
+ }
+ program { name: "start_pulsing1";
+ action: PARAM_SET "ext_pbar2" "pulsing" 1;
+ after: "start_pulsing2";
+ }
+ program { name: "start_pulsing2";
+ action: PARAM_SET "ext_pbar5" "pulsing" 1;
+ after: "start_pulsing3";
+ }
+ program { name: "start_pulsing3";
+ action: PARAM_SET "ext_pbar7" "pulsing" 1;
after: "anim_0";
}
program { name: "anim_0";
@@ -798,6 +813,18 @@ embryo script and from Python code.";
}
program { name: "reenable_button3";
action: PARAM_SET "ext_button3" "disabled" 0;
+ after: "stop_pulsing1";
+ }
+ program { name: "stop_pulsing1";
+ action: PARAM_SET "ext_pbar2" "pulsing" 0;
+ after: "stop_pulsing2";
+ }
+ program { name: "stop_pulsing2";
+ action: PARAM_SET "ext_pbar5" "pulsing" 0;
+ after: "stop_pulsing3";
+ }
+ program { name: "stop_pulsing3";
+ action: PARAM_SET "ext_pbar7" "pulsing" 0;
}
script {
public my_value;
@@ -816,6 +843,9 @@ embryo script and from Python code.";
external_param_set_bool(PART:"ext_button1", "disabled", 0);
external_param_set_bool(PART:"ext_button2", "disabled", 0);
external_param_set_bool(PART:"ext_button3", "disabled", 0);
+ external_param_set_bool(PART:"ext_pbar2", "pulsing", 0);
+ external_param_set_bool(PART:"ext_pbar5", "pulsing", 0);
+ external_param_set_bool(PART:"ext_pbar7", "pulsing", 0);
}
}
}
@@ -827,6 +857,9 @@ embryo script and from Python code.";
external_param_set_bool(PART:"ext_button1", "disabled", 1);
external_param_set_bool(PART:"ext_button2", "disabled", 1);
external_param_set_bool(PART:"ext_button3", "disabled", 1);
+ external_param_set_bool(PART:"ext_pbar2", "pulsing", 1);
+ external_param_set_bool(PART:"ext_pbar5", "pulsing", 1);
+ external_param_set_bool(PART:"ext_pbar7", "pulsing", 1);
timer_cb(0);
}
}
@@ -1025,4 +1058,189 @@ embryo script and from Python code.";
}
}
}
+ group { name: "external/icon";
+ parts {
+ COMMON_EXTERNAL_UNDER
+ part { name: "icon_1"; type: EXTERNAL;
+ source: "elm/icon";
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ align: 0.0 0.0;
+ min: 64 64;
+ max: 64 64;
+ fixed: 1 1;
+ params {
+ string: "icon" "user-trash";
+ bool: "smooth" 1;
+ }
+ map {
+ on: 1;
+ smooth: 1;
+ rotation.center: "icon_1";
+ }
+ }
+ description { state: "rotate" 0.0;
+ inherit: "default" 0.0;
+ map.rotation.z: 360.0;
+ }
+ }
+ part { name: "icon_3_bg"; type: RECT;
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ color: 255 0 0 127;
+ rel1.relative: 0.0 0.5;
+ rel2.relative: 0.5 1.0;
+ }
+ description { state: "anim" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.5 0.5;
+ rel2.relative: 0.5 0.5;
+ }
+ }
+ part { name: "icon_3"; type: EXTERNAL;
+ source: "elm/icon";
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ rel.to: "icon_3_bg";
+ params {
+ string: "icon" "view-refresh";
+ bool: "scale up" 0;
+ bool: "scale down" 0;
+ }
+ }
+ }
+ part { name: "info3"; type: TEXT;
+ description { state: "default" 0.0;
+ clip_to: "clip";
+ rel1.relative: 0.0 0.9;
+ text {
+ text: "ScaleUp:0 ScaleDown:0";
+ size: 10;
+ align: 0.0 1.0;
+ }
+ }
+ }
+ part { name: "icon_2"; type: EXTERNAL;
+ source: "elm/icon";
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ rel1.relative: 0.9 0.9;
+ align: 0.0 0.0;
+ params {
+ string: "icon" "folder";
+ bool: "scale up" 1;
+ bool: "scale down" 1;
+ }
+ }
+ description { state: "anim" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.2 0.2;
+ }
+ }
+ part { name: "info2"; type: TEXT;
+ description { state: "default" 0.0;
+ clip_to: "clip";
+ rel1.relative: 0.5 0.9;
+ text {
+ align: 1.0 1.0;
+ text: "ScaleUp:1 ScaleDown:1";
+ size: 10;
+ }
+ }
+ }
+ part { name: "icon_4"; type: EXTERNAL;
+ source: "elm/icon";
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ rel1.relative: 0.5 0.0;
+ rel2.relative: 1.0 0.5;
+ params {
+ string: "icon" "user-bookmarks";
+ }
+ }
+ }
+ COMMON_EXTERNAL_OVER
+ }
+
+ programs {
+ COMMON_EXTERNAL_PROGRAM
+ program { signal: "elm_test,animations,start"; source: "elm_test";
+ after: "rotate_icon1";
+ after: "animate_icon2";
+ after: "animate_icon3";
+ }
+ program { name: "rotate_icon1";
+ action: STATE_SET "rotate" 0.0;
+ target: "icon_1";
+ transition: LINEAR 2.0;
+ after: "loop_rotate";
+ }
+ program { name: "loop_rotate";
+ action: STATE_SET "default" 0.0;
+ target: "icon_1";
+ after: "rotate_icon1";
+ }
+ program { name: "animate_icon2";
+ action: STATE_SET "anim" 0.0;
+ transition: ACCELERATE 4.0;
+ target: "icon_2";
+ after: "loop_animate";
+ }
+ program { name: "loop_animate";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 4.0;
+ target: "icon_2";
+ after: "animate_icon2";
+ }
+ program { name: "animate_icon3";
+ action: STATE_SET "anim" 0.0;
+ transition: ACCELERATE 4.0;
+ target: "icon_3_bg";
+ after: "loop_animate3";
+ }
+ program { name: "loop_animate3";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 4.0;
+ target: "icon_3_bg";
+ after: "animate_icon3";
+ }
+
+ }
+ }
+
+ group { name: "external/combobox";
+ parts {
+ COMMON_EXTERNAL_UNDER
+ part { name: "combobox"; type: EXTERNAL;
+ source: "elm/combobox";
+ clip_to: "clip";
+ description { state: "default" 0.0;
+ rel2.relative: 1.0 0.0;
+ align: 0.5 0.0;
+ params {
+ string: "guide" "Widgets";
+ }
+ }
+ }
+ part { name: "info"; type: TEXT;
+ clip_to: "clip";
+ description { state: "default" 0.;
+ rel1 {
+ to: "combobox";
+ relative: 0.0 1.0;
+ }
+ text {
+ text: "";
+ font: "Sans";
+ size: 24;
+ align: 0.5 1.0;
+ }
+ }
+ }
+ COMMON_EXTERNAL_OVER
+ }
+ programs {
+ COMMON_EXTERNAL_PROGRAM
+ }
+ }
}
diff --git a/examples/elementary/test_external.edj b/examples/elementary/test_external.edj
index 0a2b0d5..c667ed1 100644
--- a/examples/elementary/test_external.edj
+++ b/examples/elementary/test_external.edj
Binary files differ
diff --git a/examples/elementary/test_external.py b/examples/elementary/test_external.py
index 2fd08a8..bbac4b2 100644
--- a/examples/elementary/test_external.py
+++ b/examples/elementary/test_external.py
@@ -128,6 +128,22 @@ def edje_external_video_clicked(obj, item=None):
win.show()
+def edje_external_icon_clicked(obj, item=None):
+ win = StandardWindow("edje-external-icon", "Edje External Icon",
+ autodel=True, size=(320, 400))
+ if obj is None:
+ win.callback_delete_request_add(lambda o: elementary.exit())
+
+ ly = Layout(win, file=(
+ os.path.join(script_path, "test_external.edj"),
+ "external/icon"),
+ size_hint_weight=EXPAND_BOTH)
+ win.resize_object_add(ly)
+ ly.show()
+ ly.signal_emit("elm_test,animations,start", "elm_test")
+
+ win.show()
+
if __name__ == "__main__":
win = StandardWindow("test", "python-elementary test application",
@@ -148,11 +164,14 @@ if __name__ == "__main__":
box0.pack_end(fr)
fr.show()
- items = [("Ext Button", edje_external_button_clicked),
- ("Ext ProgressBar", edje_external_pbar_clicked),
- ("Ext Scroller", edje_external_scroller_clicked),
- ("Ext Slider", edje_external_slider_clicked),
- ("Ext Video", edje_external_video_clicked)]
+ items = [
+ ("Ext Button", edje_external_button_clicked),
+ ("Ext ProgressBar", edje_external_pbar_clicked),
+ ("Ext Scroller", edje_external_scroller_clicked),
+ ("Ext Slider", edje_external_slider_clicked),
+ ("Ext Video", edje_external_video_clicked),
+ ("Ext Icon", edje_external_icon_clicked),
+ ]
li = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
box0.pack_end(li)