rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=d8e424d4ba5611fe0f52b673a8342df9e768db50
commit d8e424d4ba5611fe0f52b673a8342df9e768db50 Author: Vyacheslav Reutskiy <v.reuts...@samsung.com> Date: Fri Sep 30 12:18:27 2016 +0300 project manager2: add header with data defines This allow use only project manager data structures in the eflete exporter. Change-Id: Ic99229bbe877b9d5cfa0c99883405ebb41bcc3be --- src/bin/Makefile.am | 1 + src/bin/project_manager/project_manager2.c | 3 +- src/bin/project_manager/project_manager2.h | 148 +------------------ src/bin/project_manager/project_manager2_data.h | 188 ++++++++++++++++++++++++ 4 files changed, 191 insertions(+), 149 deletions(-) diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 5cbf68b..475aa8c 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -30,6 +30,7 @@ EXTRA_DIST = \ project_manager/group_manager.h \ project_manager/group_manager_resources.h \ project_manager/project_manager2.h \ + project_manager/project_manager2_data.h \ project_manager/resource_manager.h \ resource_manager/resource_manager2.h \ resource_manager/resource_manager_private.h \ diff --git a/src/bin/project_manager/project_manager2.c b/src/bin/project_manager/project_manager2.c index 417829e..f28ad5b 100644 --- a/src/bin/project_manager/project_manager2.c +++ b/src/bin/project_manager/project_manager2.c @@ -533,7 +533,6 @@ _exe_error_handler(void *data, { if (!strncmp(exe_err_msg->lines[i].line, "ERROR: ", sizeof("ERROR: "))) { - last_error = PM_PROJECT_EXPORT_RESOURCE_FAILED; _end_send(ppd); } } @@ -552,7 +551,7 @@ _exporter_finish_handler(void *data, if (exporter_exit->exit_code != 0) { - last_error = PM_PROJECT_EXPORT_RESOURCE_FAILED; + last_error = exporter_exit->exit_code; _end_send(ppd); return ECORE_CALLBACK_DONE; } diff --git a/src/bin/project_manager/project_manager2.h b/src/bin/project_manager/project_manager2.h index fab6d87..20b38d6 100644 --- a/src/bin/project_manager/project_manager2.h +++ b/src/bin/project_manager/project_manager2.h @@ -32,87 +32,9 @@ * Of these files is .pro file, main Eflete project file. This file consist all * information about project in the current folder. */ - #include "eflete.h" #include "resource_manager2.h" - -/* don't forget to update on major changes */ -#define PROJECT_FILE_VERSION 5 - -/** - * @struct _Project - * - * Main struct of 'Project' in the Eflete. It struct consist a data of a opened - * project. - * Eflete project term - it's a eet file with extension '.pro', which consist - * all techical information about project. - * - * @ingroup ProjectManager - */ -struct _Project -{ - /* version of project file */ - int version; - /** File descriptor of open "*.pro" file. Needed for keep that file locked*/ -#ifdef _WIN32 - HANDLE pro_fd; -#else - int pro_fd; -#endif - /** The project name */ - Eina_Stringshare *name; - /** project path */ - Eina_Stringshare *pro_path; - /** the .pro file descriptor */ - Eet_File *ef; - /** this is worrking file, all changes are happened in this file. */ - Eina_Stringshare *dev; - /** ecore evas buffer for project objects */ - Ecore_Evas *ecore_evas; - /** edje_edit_object for global operations */ - Evas_Object *global_object; - /** this is saved file. */ - Eina_Stringshare *saved_edj; - - /** path where will be saved the develop edj file */ - Eina_Stringshare *develop_path; - /** compile options for release edj file. see edje_cc reference */ - Eina_Stringshare *release_options; - - struct { - Eina_List *groups; - Eina_List *tones; - Eina_List *sounds; - Eina_List *images; - Eina_List *image_sets; - Eina_List *fonts; - Eina_List *colorclasses; - Eina_List *styles; - Eina_List *global_data; - } RM; /* rename to resource_manager, - this is just to make coding simplier. easier and faster */ - - Eina_List *groups; - Eina_List *images; - Eina_List *image_sets; - Eina_List *sounds; - Eina_List *tones; - Eina_List *fonts; - Eina_List *colorclasses; - Eina_List *styles; - Eina_List *global_data; - - Eina_File *mmap_file; /**< mmaped dev file*/ - - Eina_List *nsimage_list; - -#ifdef HAVE_ENVENTOR - Enventor_Data *enventor; -#endif - - Eina_Bool changed : 1; - Eina_Bool close_request : 1; -}; +#include "project_manager2_data.h" /** * @enum _Build @@ -131,80 +53,12 @@ enum _Build }; /** - * @enum _PM_Project_Result - * - * The Project process result, it's means result of all project process: import, - * new project creation, save, etc. - * - * @ingroup ProjectManager - */ -enum _PM_Project_Result -{ - PM_PROJECT_SUCCESS = 0, - PM_PROJECT_CANCEL, - PM_PROJECT_ERROR, - PM_PROJECT_LOCKED, - PM_PROJECT_CREATE_PRO_FAILED, - PM_PROJECT_OPEN_PRO_FAILED, - PM_PROJECT_READ_PRO_FAILED, - PM_PROJECT_WRITE_PRO_FAILED, - PM_PROJECT_ADD_SPEC_GROUP_FAILED, - PM_PROJECT_ADD_SPEC_IMAGE_FAILED, - PM_PROJECT_ADD_SPEC_SAMPLE_FAILED, - PM_PROJECT_LOAD_INTERNAL_OBJ_FAILED, - PM_PROJECT_LOAD_GROUP_FAILED, - PM_PROJECT_COPY_GROUP_FAILED, - PM_PROJECT_COPY_FILE_FAILED, - PM_PROJECT_EXPORT_RESOURCE_FAILED, - PM_PROJECT_EXPORT_DEVELOP_EDJ_FAILED, - PM_PROJECT_BUILD_SOURCE_EDC_FAILED, - PM_PROJECT_LAST -}; - -/** * @typedef Build * @ingroup ProjectManager */ typedef enum _Build Build; /** - * @typedef PM_Project_Status - * @ingroup ProjectManager - */ -typedef enum _PM_Project_Result PM_Project_Result; - -/** - * @typedef PM_Project_Progress_Cb - * - * The Project process callback, this callback be called to receive the progress - * data (string). - * - * @param data The user data; - * @param progress_string The progress string from running Project thread. - * - * @return EINA_TRUE if callback done success, otherwise EINA_FALSE. - * - * @note If callback return EINA_FALSE the Project thread will be stoped. - * - * @ingroup ProjectManager - */ -typedef Eina_Bool -(* PM_Project_Progress_Cb)(void *data, Eina_Stringshare *progress_string); - -/** - * @typedef PM_Project_End_Cb - * - * This callback be called on the end of Project process. - * - * @param data The user data; - * @param result The project pro. - * - * @ingroup ProjectManager - */ -typedef void -(* PM_Project_End_Cb)(void *data, PM_Project_Result result, Project *project); - -/** * Create a new project which based on the imported edj file. * * @param name The name of new project; diff --git a/src/bin/project_manager/project_manager2_data.h b/src/bin/project_manager/project_manager2_data.h new file mode 100644 index 0000000..c2eda71 --- /dev/null +++ b/src/bin/project_manager/project_manager2_data.h @@ -0,0 +1,188 @@ +/* + * Edje Theme Editor + * Copyright (C) 2013-2016 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. + */ + +#ifndef PROJECT_MANAGER_DATA_H +#define PROJECT_MANAGER_DATA_H + +#include <Eina.h> +#include <Eet.h> +#include <Ecore_Evas.h> + +/* don't forget to update on major changes */ +#define PROJECT_FILE_VERSION 5 + +/** + * @struct _Project + * + * Main struct of 'Project' in the Eflete. It struct consist a data of a opened + * project. + * Eflete project term - it's a eet file with extension '.pro', which consist + * all techical information about project. + * + * @ingroup ProjectManager + */ +struct _Project +{ + /* version of project file */ + int version; + /** File descriptor of open "*.pro" file. Needed for keep that file locked*/ +#ifdef _WIN32 + HANDLE pro_fd; +#else + int pro_fd; +#endif + /** The project name */ + Eina_Stringshare *name; + /** project path */ + Eina_Stringshare *pro_path; + /** the .pro file descriptor */ + Eet_File *ef; + /** this is worrking file, all changes are happened in this file. */ + Eina_Stringshare *dev; + /** ecore evas buffer for project objects */ + Ecore_Evas *ecore_evas; + /** edje_edit_object for global operations */ + Evas_Object *global_object; + /** this is saved file. */ + Eina_Stringshare *saved_edj; + + /** path where will be saved the develop edj file */ + Eina_Stringshare *develop_path; + /** compile options for release edj file. see edje_cc reference */ + Eina_Stringshare *release_options; + + struct { + Eina_List *groups; + Eina_List *tones; + Eina_List *sounds; + Eina_List *images; + Eina_List *image_sets; + Eina_List *fonts; + Eina_List *colorclasses; + Eina_List *styles; + Eina_List *global_data; + } RM; /* rename to resource_manager, + this is just to make coding simplier. easier and faster */ + + Eina_List *groups; + Eina_List *images; + Eina_List *image_sets; + Eina_List *sounds; + Eina_List *tones; + Eina_List *fonts; + Eina_List *colorclasses; + Eina_List *styles; + Eina_List *global_data; + + Eina_File *mmap_file; /**< mmaped dev file*/ + + Eina_List *nsimage_list; + +#ifdef HAVE_ENVENTOR + Enventor_Data *enventor; +#endif + + Eina_Bool changed : 1; + Eina_Bool close_request : 1; +}; + +/** + * + */ +typedef struct _Project Project; + +/** + * @enum _PM_Project_Result + * + * The Project process result, it's means result of all project process: import, + * new project creation, save, etc. + * + * @ingroup ProjectManager + */ +enum _PM_Project_Result +{ + PM_PROJECT_SUCCESS = 0, + PM_PROJECT_CANCEL, + PM_PROJECT_ERROR, + PM_PROJECT_LOCKED, + PM_PROJECT_CREATE_PRO_FAILED, + PM_PROJECT_OPEN_PRO_FAILED, + PM_PROJECT_READ_PRO_FAILED, + PM_PROJECT_WRITE_PRO_FAILED, + PM_PROJECT_ADD_SPEC_GROUP_FAILED, + PM_PROJECT_ADD_SPEC_IMAGE_FAILED, + PM_PROJECT_ADD_SPEC_SAMPLE_FAILED, + PM_PROJECT_LOAD_INTERNAL_OBJ_FAILED, + PM_PROJECT_LOAD_GROUP_FAILED, + PM_PROJECT_COPY_GROUP_FAILED, + PM_PROJECT_COPY_FILE_FAILED, + PM_PROJECT_EXPORT_CREATE_PATH_FAILED, + PM_PROJECT_EXPORT_COPY_FILE_FAILED, + PM_PROJECT_EXPORT_SAVE_IMAGE_FAILED, + PM_PROJECT_EXPORT_WRONG_IMAGE_ID, + PM_PROJECT_EXPORT_CREATE_FILE_FAILED, + PM_PROJECT_EXPORT_SAVE_SAMPLE_FAILED, + PM_PROJECT_EXPORT_READ_EDJ_FONT_FAILED, + PM_PROJECT_EXPORT_SAVE_FONT_FAILED, + PM_PROJECT_EXPORT_CREATE_OBJECT_FAILED, + PM_PROJECT_EXPORT_DEVELOP_EDJ_FAILED, + PM_PROJECT_BUILD_SOURCE_EDC_FAILED, + PM_PROJECT_LAST +}; + +/** + * @typedef PM_Project_Status + * @ingroup ProjectManager + */ +typedef enum _PM_Project_Result PM_Project_Result; + +/** + * @typedef PM_Project_Progress_Cb + * + * The Project process callback, this callback be called to receive the progress + * data (string). + * + * @param data The user data; + * @param progress_string The progress string from running Project thread. + * + * @return EINA_TRUE if callback done success, otherwise EINA_FALSE. + * + * @note If callback return EINA_FALSE the Project thread will be stoped. + * + * @ingroup ProjectManager + */ +typedef Eina_Bool +(* PM_Project_Progress_Cb)(void *data, Eina_Stringshare *progress_string); + +/** + * @typedef PM_Project_End_Cb + * + * This callback be called on the end of Project process. + * + * @param data The user data; + * @param result The project pro. + * + * @ingroup ProjectManager + */ +typedef void +(* PM_Project_End_Cb)(void *data, PM_Project_Result result, Project *project); + + + +#endif /* PROJECT_MANAGER_DATA_H */ --