summaryrefslogtreecommitdiff
path: root/src/tests/emotion
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-10 06:04:28 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2013-01-10 06:04:28 +0000
commit96878d9d8e2ec1b8857239a70ca91eebaa78301d (patch)
treec666f029def63b117695f8351f9f7c6294dbb105 /src/tests/emotion
parentb14e37dca7ca5d4a06d96f00425e6b69721a7dd3 (diff)
efl/emotion_test: allow to run in tree.
if you EFL_RUN_IN_TREE=1 before running it, it will work without installing. SVN revision: 82511
Diffstat (limited to 'src/tests/emotion')
-rw-r--r--src/tests/emotion/emotion_test_main.c40
1 files changed, 36 insertions, 4 deletions
diff --git a/src/tests/emotion/emotion_test_main.c b/src/tests/emotion/emotion_test_main.c
index 5bf3d3ab8a..651deae109 100644
--- a/src/tests/emotion/emotion_test_main.c
+++ b/src/tests/emotion/emotion_test_main.c
@@ -99,13 +99,45 @@ main_delete_request(Ecore_Evas *ee EINA_UNUSED)
99 ecore_main_loop_quit(); 99 ecore_main_loop_quit();
100} 100}
101 101
102static const char *
103theme_get(void)
104{
105 static int is_local = -1;
106 if (is_local == -1)
107 {
108 struct stat st;
109 is_local = (stat(PACKAGE_BUILD_DIR"/src/tests/emotion/data/theme.edj", &st) == 0);
110 }
111
112 if (is_local)
113 return PACKAGE_BUILD_DIR"/src/tests/emotion/data/theme.edj";
114 else
115 return PACKAGE_DATA_DIR"/data/theme.edj";
116}
117
118static const char *
119fonts_dir_get(void)
120{
121 static int is_local = -1;
122 if (is_local == -1)
123 {
124 struct stat st;
125 is_local = (stat(PACKAGE_BUILD_DIR"/src/tests/emotion/data/fonts", &st) == 0);
126 }
127
128 if (is_local)
129 return PACKAGE_BUILD_DIR"/src/tests/emotion/data/fonts";
130 else
131 return PACKAGE_DATA_DIR"/data/fonts";
132}
133
102void 134void
103bg_setup(void) 135bg_setup(void)
104{ 136{
105 Evas_Object *o; 137 Evas_Object *o;
106 138
107 o = edje_object_add(evas); 139 o = edje_object_add(evas);
108 edje_object_file_set(o, PACKAGE_DATA_DIR"/data/theme.edj", "background"); 140 edje_object_file_set(o, theme_get(), "background");
109 evas_object_move(o, 0, 0); 141 evas_object_move(o, 0, 0);
110 evas_object_resize(o, startw, starth); 142 evas_object_resize(o, startw, starth);
111 evas_object_layer_set(o, -999); 143 evas_object_layer_set(o, -999);
@@ -587,9 +619,9 @@ init_video_object(const char *module_filename, const char *filename)
587 oe = edje_object_add(evas); 619 oe = edje_object_add(evas);
588 evas_object_data_set(oe, "frame_data", fd); 620 evas_object_data_set(oe, "frame_data", fd);
589 if (reflex) 621 if (reflex)
590 edje_object_file_set(oe, PACKAGE_DATA_DIR"/data/theme.edj", "video_controller/reflex"); 622 edje_object_file_set(oe, theme_get(), "video_controller/reflex");
591 else 623 else
592 edje_object_file_set(oe, PACKAGE_DATA_DIR"/data/theme.edj", "video_controller"); 624 edje_object_file_set(oe, theme_get(), "video_controller");
593 edje_extern_object_min_size_set(o, w, h); 625 edje_extern_object_min_size_set(o, w, h);
594 edje_object_part_swallow(oe, "video_swallow", o); 626 edje_object_part_swallow(oe, "video_swallow", o);
595 edje_object_size_min_calc(oe, &w, &h); 627 edje_object_size_min_calc(oe, &w, &h);
@@ -717,7 +749,7 @@ main(int argc, char **argv)
717 evas = ecore_evas_get(ecore_evas); 749 evas = ecore_evas_get(ecore_evas);
718 evas_image_cache_set(evas, 8 * 1024 * 1024); 750 evas_image_cache_set(evas, 8 * 1024 * 1024);
719 evas_font_cache_set(evas, 1 * 1024 * 1024); 751 evas_font_cache_set(evas, 1 * 1024 * 1024);
720 evas_font_path_append(evas, PACKAGE_DATA_DIR"/data/fonts"); 752 evas_font_path_append(evas, fonts_dir_get());
721 753
722 emotion_init(); 754 emotion_init();
723 755