summaryrefslogtreecommitdiff
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
parentea4bc8790d221c987e1fc8ca7421bddfb76b5a90 (diff)
Test Externals: keep in sync with the C test
-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 {
95 rel1.offset: 0 60; 95 rel1.offset: 0 60;
96 params { 96 params {
97 string: "label" "icon + label"; 97 string: "label" "icon + label";
98 string: "icon" "home"; 98 string: "icon" "user-home";
99 } 99 }
100 } 100 }
101 } 101 }
@@ -121,7 +121,7 @@ collections {
121 align: 0.5 0.0; 121 align: 0.5 0.0;
122 rel1.offset: 0 180; 122 rel1.offset: 0 180;
123 params { 123 params {
124 string: "icon" "home"; 124 string: "icon" "user-home";
125 } 125 }
126 } 126 }
127 description { state: "left" 0.0; 127 description { state: "left" 0.0;
@@ -157,7 +157,7 @@ collections {
157 rel1.offset: 0 300; 157 rel1.offset: 0 300;
158 params { 158 params {
159 string: "label" "disabled"; 159 string: "label" "disabled";
160 string: "icon" "home"; 160 string: "icon" "user-home";
161 bool: "disabled" 1; 161 bool: "disabled" 1;
162 } 162 }
163 } 163 }
@@ -215,7 +215,7 @@ collections {
215 rel1.offset: 0 60; 215 rel1.offset: 0 60;
216 params { 216 params {
217 string: "label" "Horizontal"; 217 string: "label" "Horizontal";
218 string: "icon" "home"; 218 string: "icon" "user-home";
219 string: "unit format" "%.1f units"; 219 string: "unit format" "%.1f units";
220 string: "indicator format" "%.0f"; 220 string: "indicator format" "%.0f";
221 double: "min" -100.0; 221 double: "min" -100.0;
@@ -233,7 +233,7 @@ collections {
233 rel1.offset: 0 90; 233 rel1.offset: 0 90;
234 params { 234 params {
235 string: "label" "Disabled"; 235 string: "label" "Disabled";
236 string: "icon" "home"; 236 string: "icon" "user-home";
237 bool: "disabled" 1; 237 bool: "disabled" 1;
238 double: "value" 0.5; 238 double: "value" 0.5;
239 } 239 }
@@ -263,7 +263,7 @@ collections {
263 rel1.offset: 20 160; 263 rel1.offset: 20 160;
264 params { 264 params {
265 string: "label" "Horizontal"; 265 string: "label" "Horizontal";
266 string: "icon" "home"; 266 string: "icon" "user-home";
267 bool: "horizontal" 0; 267 bool: "horizontal" 0;
268 string: "unit format" "%.0f u"; 268 string: "unit format" "%.0f u";
269 string: "indicator format" "%.3f"; 269 string: "indicator format" "%.3f";
@@ -286,7 +286,7 @@ collections {
286 rel1.offset: 80 160; 286 rel1.offset: 80 160;
287 params { 287 params {
288 string: "label" "Inverted"; 288 string: "label" "Inverted";
289 string: "icon" "home"; 289 string: "icon" "user-home";
290 bool: "horizontal" 0; 290 bool: "horizontal" 0;
291 bool: "inverted" 1; 291 bool: "inverted" 1;
292 string: "unit format" "%.0f u"; 292 string: "unit format" "%.0f u";
@@ -310,7 +310,7 @@ collections {
310 rel1.offset: 140 160; 310 rel1.offset: 140 160;
311 params { 311 params {
312 string: "label" "Disabled"; 312 string: "label" "Disabled";
313 string: "icon" "home"; 313 string: "icon" "user-home";
314 double: "min" -70.0; 314 double: "min" -70.0;
315 double: "max" 70.0; 315 double: "max" 70.0;
316 bool: "disabled" 1; 316 bool: "disabled" 1;
@@ -588,6 +588,7 @@ embryo script and from Python code.";
588 params { 588 params {
589 string: "label" "infinite bouce"; 589 string: "label" "infinite bouce";
590 string: "unit format" ""; 590 string: "unit format" "";
591 bool: "pulse" 1;
591 } 592 }
592 } 593 }
593 } 594 }
@@ -601,7 +602,7 @@ embryo script and from Python code.";
601 rel1.offset: 0 140; 602 rel1.offset: 0 140;
602 params { 603 params {
603 string: "label" "inverted"; 604 string: "label" "inverted";
604 string: "icon" "home"; 605 string: "icon" "user-home";
605 bool: "inverted" 1; 606 bool: "inverted" 1;
606 string: "unit format" "%.3f units"; 607 string: "unit format" "%.3f units";
607 } 608 }
@@ -635,6 +636,7 @@ embryo script and from Python code.";
635 string: "label" "infinite bouce"; 636 string: "label" "infinite bouce";
636 bool: "horizontal" 0; 637 bool: "horizontal" 0;
637 string: "unit format" ""; 638 string: "unit format" "";
639 bool: "pulse" 1;
638 } 640 }
639 } 641 }
640 } 642 }
@@ -649,7 +651,7 @@ embryo script and from Python code.";
649 rel2.offset: 0 -50; 651 rel2.offset: 0 -50;
650 params { 652 params {
651 string: "label" "inverted"; 653 string: "label" "inverted";
652 string: "icon" "home"; 654 string: "icon" "user-home";
653 bool: "horizontal" 0; 655 bool: "horizontal" 0;
654 bool: "inverted" 1; 656 bool: "inverted" 1;
655 bool: "disabled" 1; 657 bool: "disabled" 1;
@@ -667,6 +669,7 @@ embryo script and from Python code.";
667 rel2.offset: 0 -50; 669 rel2.offset: 0 -50;
668 params { 670 params {
669 string: "style" "wheel"; 671 string: "style" "wheel";
672 bool: "pulse" 1;
670 } 673 }
671 } 674 }
672 } 675 }
@@ -732,6 +735,18 @@ embryo script and from Python code.";
732 } 735 }
733 program { name: "disable_button3"; 736 program { name: "disable_button3";
734 action: PARAM_SET "ext_button3" "disabled" 1; 737 action: PARAM_SET "ext_button3" "disabled" 1;
738 after: "start_pulsing1";
739 }
740 program { name: "start_pulsing1";
741 action: PARAM_SET "ext_pbar2" "pulsing" 1;
742 after: "start_pulsing2";
743 }
744 program { name: "start_pulsing2";
745 action: PARAM_SET "ext_pbar5" "pulsing" 1;
746 after: "start_pulsing3";
747 }
748 program { name: "start_pulsing3";
749 action: PARAM_SET "ext_pbar7" "pulsing" 1;
735 after: "anim_0"; 750 after: "anim_0";
736 } 751 }
737 program { name: "anim_0"; 752 program { name: "anim_0";
@@ -798,6 +813,18 @@ embryo script and from Python code.";
798 } 813 }
799 program { name: "reenable_button3"; 814 program { name: "reenable_button3";
800 action: PARAM_SET "ext_button3" "disabled" 0; 815 action: PARAM_SET "ext_button3" "disabled" 0;
816 after: "stop_pulsing1";
817 }
818 program { name: "stop_pulsing1";
819 action: PARAM_SET "ext_pbar2" "pulsing" 0;
820 after: "stop_pulsing2";
821 }
822 program { name: "stop_pulsing2";
823 action: PARAM_SET "ext_pbar5" "pulsing" 0;
824 after: "stop_pulsing3";
825 }
826 program { name: "stop_pulsing3";
827 action: PARAM_SET "ext_pbar7" "pulsing" 0;
801 } 828 }
802 script { 829 script {
803 public my_value; 830 public my_value;
@@ -816,6 +843,9 @@ embryo script and from Python code.";
816 external_param_set_bool(PART:"ext_button1", "disabled", 0); 843 external_param_set_bool(PART:"ext_button1", "disabled", 0);
817 external_param_set_bool(PART:"ext_button2", "disabled", 0); 844 external_param_set_bool(PART:"ext_button2", "disabled", 0);
818 external_param_set_bool(PART:"ext_button3", "disabled", 0); 845 external_param_set_bool(PART:"ext_button3", "disabled", 0);
846 external_param_set_bool(PART:"ext_pbar2", "pulsing", 0);
847 external_param_set_bool(PART:"ext_pbar5", "pulsing", 0);
848 external_param_set_bool(PART:"ext_pbar7", "pulsing", 0);
819 } 849 }
820 } 850 }
821 } 851 }
@@ -827,6 +857,9 @@ embryo script and from Python code.";
827 external_param_set_bool(PART:"ext_button1", "disabled", 1); 857 external_param_set_bool(PART:"ext_button1", "disabled", 1);
828 external_param_set_bool(PART:"ext_button2", "disabled", 1); 858 external_param_set_bool(PART:"ext_button2", "disabled", 1);
829 external_param_set_bool(PART:"ext_button3", "disabled", 1); 859 external_param_set_bool(PART:"ext_button3", "disabled", 1);
860 external_param_set_bool(PART:"ext_pbar2", "pulsing", 1);
861 external_param_set_bool(PART:"ext_pbar5", "pulsing", 1);
862 external_param_set_bool(PART:"ext_pbar7", "pulsing", 1);
830 timer_cb(0); 863 timer_cb(0);
831 } 864 }
832 } 865 }
@@ -1025,4 +1058,189 @@ embryo script and from Python code.";
1025 } 1058 }
1026 } 1059 }
1027 } 1060 }
1061 group { name: "external/icon";
1062 parts {
1063 COMMON_EXTERNAL_UNDER
1064 part { name: "icon_1"; type: EXTERNAL;
1065 source: "elm/icon";
1066 clip_to: "clip";
1067 description { state: "default" 0.0;
1068 align: 0.0 0.0;
1069 min: 64 64;
1070 max: 64 64;
1071 fixed: 1 1;
1072 params {
1073 string: "icon" "user-trash";
1074 bool: "smooth" 1;
1075 }
1076 map {
1077 on: 1;
1078 smooth: 1;
1079 rotation.center: "icon_1";
1080 }
1081 }
1082 description { state: "rotate" 0.0;
1083 inherit: "default" 0.0;
1084 map.rotation.z: 360.0;
1085 }
1086 }
1087 part { name: "icon_3_bg"; type: RECT;
1088 clip_to: "clip";
1089 description { state: "default" 0.0;
1090 color: 255 0 0 127;
1091 rel1.relative: 0.0 0.5;
1092 rel2.relative: 0.5 1.0;
1093 }
1094 description { state: "anim" 0.0;
1095 inherit: "default" 0.0;
1096 rel1.relative: 0.5 0.5;
1097 rel2.relative: 0.5 0.5;
1098 }
1099 }
1100 part { name: "icon_3"; type: EXTERNAL;
1101 source: "elm/icon";
1102 clip_to: "clip";
1103 description { state: "default" 0.0;
1104 rel.to: "icon_3_bg";
1105 params {
1106 string: "icon" "view-refresh";
1107 bool: "scale up" 0;
1108 bool: "scale down" 0;
1109 }
1110 }
1111 }
1112 part { name: "info3"; type: TEXT;
1113 description { state: "default" 0.0;
1114 clip_to: "clip";
1115 rel1.relative: 0.0 0.9;
1116 text {
1117 text: "ScaleUp:0 ScaleDown:0";
1118 size: 10;
1119 align: 0.0 1.0;
1120 }
1121 }
1122 }
1123 part { name: "icon_2"; type: EXTERNAL;
1124 source: "elm/icon";
1125 clip_to: "clip";
1126 description { state: "default" 0.0;
1127 rel1.relative: 0.9 0.9;
1128 align: 0.0 0.0;
1129 params {
1130 string: "icon" "folder";
1131 bool: "scale up" 1;
1132 bool: "scale down" 1;
1133 }
1134 }
1135 description { state: "anim" 0.0;
1136 inherit: "default" 0.0;
1137 rel1.relative: 0.2 0.2;
1138 }
1139 }
1140 part { name: "info2"; type: TEXT;
1141 description { state: "default" 0.0;
1142 clip_to: "clip";
1143 rel1.relative: 0.5 0.9;
1144 text {
1145 align: 1.0 1.0;
1146 text: "ScaleUp:1 ScaleDown:1";
1147 size: 10;
1148 }
1149 }
1150 }
1151 part { name: "icon_4"; type: EXTERNAL;
1152 source: "elm/icon";
1153 clip_to: "clip";
1154 description { state: "default" 0.0;
1155 rel1.relative: 0.5 0.0;
1156 rel2.relative: 1.0 0.5;
1157 params {
1158 string: "icon" "user-bookmarks";
1159 }
1160 }
1161 }
1162 COMMON_EXTERNAL_OVER
1163 }
1164
1165 programs {
1166 COMMON_EXTERNAL_PROGRAM
1167 program { signal: "elm_test,animations,start"; source: "elm_test";
1168 after: "rotate_icon1";
1169 after: "animate_icon2";
1170 after: "animate_icon3";
1171 }
1172 program { name: "rotate_icon1";
1173 action: STATE_SET "rotate" 0.0;
1174 target: "icon_1";
1175 transition: LINEAR 2.0;
1176 after: "loop_rotate";
1177 }
1178 program { name: "loop_rotate";
1179 action: STATE_SET "default" 0.0;
1180 target: "icon_1";
1181 after: "rotate_icon1";
1182 }
1183 program { name: "animate_icon2";
1184 action: STATE_SET "anim" 0.0;
1185 transition: ACCELERATE 4.0;
1186 target: "icon_2";
1187 after: "loop_animate";
1188 }
1189 program { name: "loop_animate";
1190 action: STATE_SET "default" 0.0;
1191 transition: DECELERATE 4.0;
1192 target: "icon_2";
1193 after: "animate_icon2";
1194 }
1195 program { name: "animate_icon3";
1196 action: STATE_SET "anim" 0.0;
1197 transition: ACCELERATE 4.0;
1198 target: "icon_3_bg";
1199 after: "loop_animate3";
1200 }
1201 program { name: "loop_animate3";
1202 action: STATE_SET "default" 0.0;
1203 transition: DECELERATE 4.0;
1204 target: "icon_3_bg";
1205 after: "animate_icon3";
1206 }
1207
1208 }
1209 }
1210
1211 group { name: "external/combobox";
1212 parts {
1213 COMMON_EXTERNAL_UNDER
1214 part { name: "combobox"; type: EXTERNAL;
1215 source: "elm/combobox";
1216 clip_to: "clip";
1217 description { state: "default" 0.0;
1218 rel2.relative: 1.0 0.0;
1219 align: 0.5 0.0;
1220 params {
1221 string: "guide" "Widgets";
1222 }
1223 }
1224 }
1225 part { name: "info"; type: TEXT;
1226 clip_to: "clip";
1227 description { state: "default" 0.;
1228 rel1 {
1229 to: "combobox";
1230 relative: 0.0 1.0;
1231 }
1232 text {
1233 text: "";
1234 font: "Sans";
1235 size: 24;
1236 align: 0.5 1.0;
1237 }
1238 }
1239 }
1240 COMMON_EXTERNAL_OVER
1241 }
1242 programs {
1243 COMMON_EXTERNAL_PROGRAM
1244 }
1245 }
1028} 1246}
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):
128 128
129 win.show() 129 win.show()
130 130
131def edje_external_icon_clicked(obj, item=None):
132 win = StandardWindow("edje-external-icon", "Edje External Icon",
133 autodel=True, size=(320, 400))
134 if obj is None:
135 win.callback_delete_request_add(lambda o: elementary.exit())
136
137 ly = Layout(win, file=(
138 os.path.join(script_path, "test_external.edj"),
139 "external/icon"),
140 size_hint_weight=EXPAND_BOTH)
141 win.resize_object_add(ly)
142 ly.show()
143 ly.signal_emit("elm_test,animations,start", "elm_test")
144
145 win.show()
146
131 147
132if __name__ == "__main__": 148if __name__ == "__main__":
133 win = StandardWindow("test", "python-elementary test application", 149 win = StandardWindow("test", "python-elementary test application",
@@ -148,11 +164,14 @@ if __name__ == "__main__":
148 box0.pack_end(fr) 164 box0.pack_end(fr)
149 fr.show() 165 fr.show()
150 166
151 items = [("Ext Button", edje_external_button_clicked), 167 items = [
152 ("Ext ProgressBar", edje_external_pbar_clicked), 168 ("Ext Button", edje_external_button_clicked),
153 ("Ext Scroller", edje_external_scroller_clicked), 169 ("Ext ProgressBar", edje_external_pbar_clicked),
154 ("Ext Slider", edje_external_slider_clicked), 170 ("Ext Scroller", edje_external_scroller_clicked),
155 ("Ext Video", edje_external_video_clicked)] 171 ("Ext Slider", edje_external_slider_clicked),
172 ("Ext Video", edje_external_video_clicked),
173 ("Ext Icon", edje_external_icon_clicked),
174 ]
156 175
157 li = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) 176 li = List(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
158 box0.pack_end(li) 177 box0.pack_end(li)