rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=6ad082552253e6c1b79fcc34e08cdfabe164afff
commit 6ad082552253e6c1b79fcc34e08cdfabe164afff Author: Vyacheslav Reutskiy <[email protected]> Date: Thu Mar 17 13:29:51 2016 +0200 UTC: drop the test for pm_style_resource_export.c We are not use this API and not planed to use Change-Id: Ia07ca5262ceb90f33ac7b13631fc43d667d8ae51 --- src/bin/project_manager/project_manager.c | 130 --------------------- src/bin/project_manager/project_manager.h | 23 ---- tests/Makefile.am | 3 +- .../pm_style_resource_export.c | 118 ------------------- tests/test_project_manager/test_project_manager.c | 2 - tests/test_project_manager/test_project_manager.h | 2 - 6 files changed, 1 insertion(+), 277 deletions(-) diff --git a/src/bin/project_manager/project_manager.c b/src/bin/project_manager/project_manager.c index 343f7c5..346ce5e 100644 --- a/src/bin/project_manager/project_manager.c +++ b/src/bin/project_manager/project_manager.c @@ -1267,136 +1267,6 @@ _styles_resources_load(Project *project) edje_edit_string_list_free(styles); } -TODO("rewrite") -#if 0 -Eina_Bool -pm_style_resource_export(Project *pro __UNUSED__ , Style *style __UNUSED__, Eina_Stringshare *path __UNUSED__) -{ - return false; - Eina_List *l, *l_next, *parts, *state_list, *l_states, *tween_list, *l_tween; - Eina_List *programs; - - Eina_List *images = NULL, *sounds = NULL, *fonts = NULL; - - Eina_Stringshare *dest, *source; - const char *data_name, *state_name, *data; - const char *state = NULL; double value = 0; char **state_split; - Edje_Part_Type part_type = EDJE_PART_TYPE_NONE; - Edje_Action_Type action_type = EDJE_ACTION_TYPE_NONE; - - assert(pro != NULL); - assert(style != NULL); - assert(style->obj != NULL); - assert(path != NULL); - - /* Collect lists with info needed resources */ - parts = edje_edit_parts_list_get(style->obj); - EINA_LIST_FOREACH_SAFE(parts, l, l_next, data_name) - { - part_type = edje_edit_part_type_get(style->obj, data_name); - switch (part_type) - { - case EDJE_PART_TYPE_IMAGE: - state_list = edje_edit_part_states_list_get(style->obj, data_name); - EINA_LIST_FOREACH(state_list, l_states, state_name) - { - state_split = eina_str_split(state_name, " ", 2); - state = eina_stringshare_add(state_split[0]); - value = atof(state_split[1]); - free(state_split[0]); - free(state_split); - - data = edje_edit_state_image_get(style->obj, data_name, - state, value); - if ((data) && (!eina_list_data_find(images, data))) - images = eina_list_append(images, eina_stringshare_add(data)); - edje_edit_string_free(data); - - tween_list = edje_edit_state_tweens_list_get(style->obj, - data_name, - state, value); - EINA_LIST_FOREACH(tween_list, l_tween, data) - { - if (!eina_list_data_find(images, data)) - images = eina_list_append(images, eina_stringshare_add(data)); - } - edje_edit_string_list_free(tween_list); - } - edje_edit_string_list_free(state_list); - break; - case EDJE_PART_TYPE_TEXT: - state_list = edje_edit_part_states_list_get(style->obj, data_name); - EINA_LIST_FOREACH(state_list, l_states, state_name) - { - state_split = eina_str_split(state_name, " ", 2); - state = eina_stringshare_add(state_split[0]); - value = atof(state_split[1]); - free(state_split[0]); - free(state_split); - - data = edje_edit_state_font_get(style->obj, data_name, - state, value); - if ((data) && (!eina_list_data_find(fonts, data))) - fonts = eina_list_append(fonts, eina_stringshare_add(data)); - edje_edit_string_free(data); - } - edje_edit_string_list_free(state_list); - break; - case EDJE_PART_TYPE_TEXTBLOCK: - break; - default: - break; - } - } - edje_edit_string_list_free(parts); - - programs = edje_edit_programs_list_get(style->obj); - EINA_LIST_FOREACH_SAFE(programs, l, l_next, data_name) - { - action_type = edje_edit_program_action_get(style->obj, data_name); - if (action_type == EDJE_ACTION_TYPE_SOUND_SAMPLE) - { - data = edje_edit_program_sample_name_get(style->obj, data_name); - if ((data) && (!eina_list_data_find(sounds, data))) - sounds = eina_list_append(sounds, data); - } - } - edje_edit_string_list_free(programs); - - dest = eina_stringshare_printf("%s/images", path); - EINA_LIST_FOREACH(pro->res.images, l, source) - { - if (!_image_resources_export(pro, images, dest, source, pro->dev, style->obj)) - WARN("Failed export images"); - } - eina_stringshare_del(dest); - EINA_LIST_FREE(images, data) - eina_stringshare_del(data); - - dest = eina_stringshare_printf("%s/sounds", path); - EINA_LIST_FOREACH(pro->res.sounds, l, source) - { - if (!_sound_resources_export(sounds, dest, source, style->obj)) - ERR("Failed export sounds"); - } - eina_stringshare_del(dest); - EINA_LIST_FREE(sounds, data) - eina_stringshare_del(data); - - dest = eina_stringshare_printf("%s/fonts", path); - EINA_LIST_FOREACH(pro->res.fonts, l, source) - { - if (!_font_resources_export(fonts, dest, source, pro->dev, style->obj)) - WARN("Failed export fonts"); - } - eina_stringshare_del(dest); - EINA_LIST_FREE(fonts, data) - eina_stringshare_del(data); - - return true; -} -#endif - Eina_Bool pm_project_resource_export(Project *pro __UNUSED__, const char* dir_path __UNUSED__) { diff --git a/src/bin/project_manager/project_manager.h b/src/bin/project_manager/project_manager.h index 27f95fb..c3dc1bc 100644 --- a/src/bin/project_manager/project_manager.h +++ b/src/bin/project_manager/project_manager.h @@ -516,29 +516,6 @@ pm_project_enventor_save(Project *project, const void *data) EINA_ARG_NONNULL(1); /** - * Export the resources, that uses into given style. - * - * This function collect lists of the resources, that uses in tgiven style. It - * can be images, sounds or fonts. - * Export images into directory path/images, in case if image stored in edj - * have path (like: O/border.png) path will restored (path/images/O/border.png). - * Will exported all images for group, include images from tween lists. - * Export sounds, that uses in programs. Will saved into directory path/sounds - * Export fonts into directory path/fonts - * - * @param pro The opened project; - * @param style The style to save the source code; - * @param path The dir, where resources will stored. - * - * @return EINA_TRUE if resources exported successful or EINA_FALSE in otherwise. - * - * @ingroup ProjectManager. - */ -//Eina_Bool -//pm_style_resource_export(Project *pro, Style *style, Eina_Stringshare *path); - - -/** * @struct _Resource * * Common structure for resources that can be used somewhere (images, sounds, diff --git a/tests/Makefile.am b/tests/Makefile.am index f1abb35..007d0d5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -191,8 +191,7 @@ project_manager_test_SOURCES = \ ../tests/test_project_manager/pm_project_save.c \ ../tests/test_project_manager/pm_project_close.c \ ../tests/test_project_manager/pm_project_meta_data_set.c \ -../tests/test_project_manager/pm_project_meta_data_get.c \ -../tests/test_project_manager/pm_style_resource_export.c +../tests/test_project_manager/pm_project_meta_data_get.c project_manager_test_CFLAGS = ${FLAGS} project_manager_test_LDADD = ${LD} diff --git a/tests/test_project_manager/pm_style_resource_export.c b/tests/test_project_manager/pm_style_resource_export.c deleted file mode 100644 index 7c0edf1..0000000 --- a/tests/test_project_manager/pm_style_resource_export.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Edje Theme Editor - * Copyright (C) 2013-2014 Samsung Electronics. - * - * This file is part of Edje Theme Editor. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; If not, see www.gnu.org/licenses/lgpl.html. - */ - -#include "test_project_manager.h" -#include "main_window.h" -#include "test_common.h" - -/** - * @addtogroup project_manager_test - * @{ - * @addtogroup pm_style_resource_export - * @{ - * project_manager - * <TABLE> - * @} - */ - -/** - * @addtogroup pm_style_resource_export - * @{ - * <tr> - * <td>pm_style_resource_export</td> - * <td>pm_style_resource_export_test_p</td> - * <td> - * This test check the export style resources procedure.<br> - * @precondition - * @step 1 Initialize elementary library. - * @step 2 Initialize Application Data structure. - * @step 3 Create directory for export resources. - * @step 4 Initialize main window. - * @step 5 Open project. - * @step 6 Fill widget inlist with data. - * @step 7 Find style that represent the group "elm/radio/base/def" - * @step 8 Load style into project. - * - * @procedure - * @step 1 Call pm_style_resource_export; - * @step 2 Check returned value. - * @step 3 Check exists image file in given path. - * @step 4 Check exists sound file in given path. - * @step 5 Check exists font file in given path. - * </td> - * <td>(Project *)project, (Style *)style, (Eina_Stringshare *)path</td> - * <td>All check passed </td> - * </tr> - * @} - */ - -EFLETE_TEST(pm_style_resource_export_test_p) -{ - Eina_Bool result = EINA_FALSE; - //Style *style = NULL; - Eina_Stringshare *path = NULL; - Eina_Stringshare *check_resource = NULL; -ck_assert(false); - elm_init(0,0); - app_init(); - ecore_file_recursive_rm("./UTC"); - path = eina_stringshare_add("./pm_style_resource_export_test_p/export"); - check_resource = eina_stringshare_printf("%s/images/radio.png", path); - ecore_file_mkdir(path); - - ui_main_window_add(); - ap.project = setup("pm_style_resource_export_test_p"); - /* wm_widgets_list_objects_load(ap.project->widgets, - evas_object_evas_get(ap.win), - ap.project->mmap_file);*/ - //style = wm_style_object_find(ap.project->widgets, "elm/radio/base/def"); - //ui_style_clicked(style); - - //result = pm_style_resource_export(ap.project, style, path); - ck_assert_msg(result, "Failed export resources of group."); - result = ecore_file_exists(check_resource); - ck_assert_msg(result, "Exported image does not exist"); - eina_stringshare_del(check_resource); - check_resource = eina_stringshare_printf("%s/sounds/kbd-tap.wav", path); - result = ecore_file_exists(check_resource); - ck_assert_msg(result, "Exported sound does not exist"); - eina_stringshare_del(check_resource); - check_resource = eina_stringshare_printf("%s/fonts/PTS55F.ttf", path); - result = ecore_file_exists(check_resource); - ck_assert_msg(result, "Exported font does not exist"); - - pm_project_close(ap.project); - ecore_file_recursive_rm("./UTC"); - ap.project = NULL; - ui_main_window_del(); - app_shutdown(); - teardown("./pm_style_resource_export_test_p"); - eina_stringshare_del(path); - eina_stringshare_del(check_resource); - elm_shutdown(); -} -END_TEST - -/** - * @addtogroup pm_style_resource_export - * @{ - * </TABLE> - * @} - * @} - */ diff --git a/tests/test_project_manager/test_project_manager.c b/tests/test_project_manager/test_project_manager.c index 7dd65b9..be24dd3 100644 --- a/tests/test_project_manager/test_project_manager.c +++ b/tests/test_project_manager/test_project_manager.c @@ -52,8 +52,6 @@ Suite* test_suite (void) { tcase_add_test(tcase, pm_project_meta_data_get_test_p); - tcase_add_test(tcase, pm_style_resource_export_test_p); - suite_add_tcase(suite, tcase); return suite; } diff --git a/tests/test_project_manager/test_project_manager.h b/tests/test_project_manager/test_project_manager.h index 19a768a..4686e16 100644 --- a/tests/test_project_manager/test_project_manager.h +++ b/tests/test_project_manager/test_project_manager.h @@ -47,5 +47,3 @@ void pm_project_close_test_p(int); void pm_project_meta_data_set_test_p(int); void pm_project_meta_data_get_test_p(int); - -void pm_style_resource_export_test_p(int); --
