code refactoring.

replace *edc, *edj to *input, *output
For the general editor, modify them in advance.
This commit is contained in:
ChunEon Park 2015-07-04 01:18:27 +09:00
parent d2e3c6dc6b
commit 9bf1c484f7
8 changed files with 208 additions and 206 deletions

View File

@ -2,19 +2,19 @@
typedef struct config_s
{
const char *edc_path;
const char *edj_path;
const char *input_path;
const char *output_path;
const char *font_name;
const char *font_style;
Eina_List *edc_img_path_list;
Eina_List *edc_snd_path_list;
Eina_List *edc_fnt_path_list;
Eina_List *edc_dat_path_list;
Eina_Strbuf *edc_img_path_buf; //pre-stored image paths for edc compile.
Eina_Strbuf *edc_snd_path_buf; //pre-stored sound paths for edc compile.
Eina_Strbuf *edc_fnt_path_buf; //pre-stored font paths for edc compile.
Eina_Strbuf *edc_dat_path_buf; //pre-stored data paths for edc compile.
Eina_List *img_path_list;
Eina_List *snd_path_list;
Eina_List *fnt_path_list;
Eina_List *dat_path_list;
Eina_Strbuf *img_path_buf; //pre-stored image paths for compile.
Eina_Strbuf *snd_path_buf; //pre-stored sound paths for compile.
Eina_Strbuf *fnt_path_buf; //pre-stored font paths for compile.
Eina_Strbuf *dat_path_buf; //pre-stored data paths for compile.
Eina_List *syntax_color_list;
@ -50,8 +50,8 @@ config_edj_path_update(config_data *cd)
char buf[PATH_MAX];
Eina_Tmpstr *tmp_path;
char *ext = strstr(cd->edc_path, ".edc");
const char *file = ecore_file_file_get(cd->edc_path);
char *ext = strstr(cd->input_path, ".edc");
const char *file = ecore_file_file_get(cd->input_path);
if (ext && file)
{
char filename[PATH_MAX];
@ -67,7 +67,7 @@ config_edj_path_update(config_data *cd)
return;
}
eina_stringshare_replace(&cd->edj_path, tmp_path);
eina_stringshare_replace(&cd->output_path, tmp_path);
eina_tmpstr_del(tmp_path);
}
@ -148,10 +148,10 @@ config_load(void)
// loaded config is not compatile with current version of Enventor
if (cd->version < ENVENTOR_CONFIG_VERSION)
{
cd->edc_img_path_list = NULL;
cd->edc_snd_path_list = NULL;
cd->edc_fnt_path_list = NULL;
cd->edc_dat_path_list = NULL;
cd->img_path_list = NULL;
cd->snd_path_list = NULL;
cd->fnt_path_list = NULL;
cd->dat_path_list = NULL;
cd->font_scale = 1;
cd->view_scale = 1;
cd->editor_size = DEFAULT_EDITOR_SIZE;
@ -170,37 +170,37 @@ config_load(void)
g_cd = cd;
if (!cd->edc_img_path_list)
if (!cd->img_path_list)
{
sprintf(buf, "%s/images", elm_app_data_dir_get());
config_edc_img_path_set(buf);
config_img_path_set(buf);
}
else cd->edc_img_path_buf =
config_paths_buf_set(cd->edc_img_path_list, " -id ");
else cd->img_path_buf =
config_paths_buf_set(cd->img_path_list, " -id ");
if (!cd->edc_snd_path_list)
if (!cd->snd_path_list)
{
sprintf(buf, "%s/sounds", elm_app_data_dir_get());
config_edc_snd_path_set(buf);
config_snd_path_set(buf);
}
else cd->edc_snd_path_buf =
config_paths_buf_set(cd->edc_snd_path_list, " -sd ");
else cd->snd_path_buf =
config_paths_buf_set(cd->snd_path_list, " -sd ");
if (!cd->edc_fnt_path_list)
if (!cd->fnt_path_list)
{
sprintf(buf, "%s/fonts", elm_app_data_dir_get());
config_edc_fnt_path_set(buf);
config_fnt_path_set(buf);
}
else cd->edc_fnt_path_buf =
config_paths_buf_set(cd->edc_fnt_path_list, " -fd ");
else cd->fnt_path_buf =
config_paths_buf_set(cd->fnt_path_list, " -fd ");
if (!cd->edc_dat_path_list)
if (!cd->dat_path_list)
{
sprintf(buf, "%s/data", elm_app_data_dir_get());
config_edc_dat_path_set(buf);
config_dat_path_set(buf);
}
else cd->edc_dat_path_buf =
config_paths_buf_set(cd->edc_dat_path_list, " -dd ");
else cd->dat_path_buf =
config_paths_buf_set(cd->dat_path_list, " -dd ");
if (!cd->syntax_color_list)
{
@ -221,13 +221,13 @@ eddc_init(void)
edd_base = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_LIST_STRING(edd_base, config_data,
"edc_img_path_list", edc_img_path_list);
"img_path_list", img_path_list);
EET_DATA_DESCRIPTOR_ADD_LIST_STRING(edd_base, config_data,
"edc_snd_path_list", edc_snd_path_list);
"snd_path_list", snd_path_list);
EET_DATA_DESCRIPTOR_ADD_LIST_STRING(edd_base, config_data,
"edc_fnt_path_list", edc_fnt_path_list);
"fnt_path_list", fnt_path_list);
EET_DATA_DESCRIPTOR_ADD_LIST_STRING(edd_base, config_data,
"edc_dat_path_list", edc_dat_path_list);
"dat_path_list", dat_path_list);
EET_DATA_DESCRIPTOR_ADD_LIST_STRING(edd_base, config_data,
"syntax_color_list", syntax_color_list);
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "version", version, EET_T_UINT);
@ -273,38 +273,40 @@ eddc_init(void)
}
void
config_edc_path_set(const char *edc_path)
config_input_path_set(const char *input_path)
{
config_data *cd = g_cd;
eina_stringshare_replace(&cd->edc_path, edc_path);
eina_stringshare_replace(&cd->input_path, input_path);
config_edj_path_update(cd);
}
void
config_init(const char *edc_path, const char *edj_path,
Eina_List *edc_img_path, Eina_List *edc_snd_path,
Eina_List *edc_fnt_path, Eina_List *edc_dat_path)
config_init(const char *input_path, const char *output_path,
Eina_List *img_path, Eina_List *snd_path,
Eina_List *fnt_path, Eina_List *dat_path)
{
eddc_init();
config_data *cd = config_load();
g_cd = cd;
if (edc_path[0]) config_edc_path_set(edc_path);
if (edj_path[0])
eina_stringshare_replace(&cd->edj_path, edj_path);
if (input_path[0]) config_input_path_set(input_path);
if (output_path[0]) eina_stringshare_replace(&cd->output_path, output_path);
if (edc_img_path)
g_cd->edc_img_path_list = edc_img_path;
if (input_path[0]) config_input_path_set(input_path);
if (output_path[0]) eina_stringshare_replace(&cd->output_path, output_path);
if (edc_snd_path)
g_cd->edc_snd_path_list = edc_snd_path;
if (img_path)
g_cd->img_path_list = img_path;
if (edc_fnt_path)
g_cd->edc_fnt_path_list = edc_fnt_path;
if (snd_path)
g_cd->snd_path_list = snd_path;
if (edc_dat_path)
g_cd->edc_dat_path_list = edc_dat_path;
if (fnt_path)
g_cd->fnt_path_list = fnt_path;
if (dat_path)
g_cd->dat_path_list = dat_path;
}
void
@ -314,191 +316,191 @@ config_term(void)
config_save(cd);
eina_stringshare_del(cd->edc_path);
eina_stringshare_del(cd->edj_path);
eina_stringshare_del(cd->input_path);
eina_stringshare_del(cd->output_path);
Eina_Stringshare *str;
EINA_LIST_FREE(cd->edc_img_path_list, str) eina_stringshare_del(str);
EINA_LIST_FREE(cd->edc_snd_path_list, str) eina_stringshare_del(str);
EINA_LIST_FREE(cd->edc_fnt_path_list, str) eina_stringshare_del(str);
EINA_LIST_FREE(cd->edc_dat_path_list, str) eina_stringshare_del(str);
EINA_LIST_FREE(cd->img_path_list, str) eina_stringshare_del(str);
EINA_LIST_FREE(cd->snd_path_list, str) eina_stringshare_del(str);
EINA_LIST_FREE(cd->fnt_path_list, str) eina_stringshare_del(str);
EINA_LIST_FREE(cd->dat_path_list, str) eina_stringshare_del(str);
EINA_LIST_FREE(cd->syntax_color_list, str) eina_stringshare_del(str);
if (cd->edc_img_path_buf) eina_strbuf_free(cd->edc_img_path_buf);
if (cd->edc_snd_path_buf) eina_strbuf_free(cd->edc_snd_path_buf);
if (cd->edc_fnt_path_buf) eina_strbuf_free(cd->edc_fnt_path_buf);
if (cd->edc_dat_path_buf) eina_strbuf_free(cd->edc_dat_path_buf);
if (cd->img_path_buf) eina_strbuf_free(cd->img_path_buf);
if (cd->snd_path_buf) eina_strbuf_free(cd->snd_path_buf);
if (cd->fnt_path_buf) eina_strbuf_free(cd->fnt_path_buf);
if (cd->dat_path_buf) eina_strbuf_free(cd->dat_path_buf);
eet_data_descriptor_free(edd_base);
free(cd);
}
void
config_edc_snd_path_set(const char *edc_snd_path)
config_snd_path_set(const char *snd_path)
{
config_data *cd = g_cd;
//Free the existing paths
const char *s;
EINA_LIST_FREE(cd->edc_snd_path_list, s) eina_stringshare_del(s);
EINA_LIST_FREE(cd->snd_path_list, s) eina_stringshare_del(s);
if (cd->edc_snd_path_buf) eina_strbuf_free(cd->edc_snd_path_buf);
cd->edc_snd_path_buf = eina_strbuf_new();
if (cd->snd_path_buf) eina_strbuf_free(cd->snd_path_buf);
cd->snd_path_buf = eina_strbuf_new();
//parse paths by ';'
const char *lex;
Eina_Stringshare *append;
while(edc_snd_path && (strlen(edc_snd_path) > 0))
while(snd_path && (strlen(snd_path) > 0))
{
lex = strstr(edc_snd_path, ";");
lex = strstr(snd_path, ";");
if (lex)
{
append = eina_stringshare_add_length(edc_snd_path,
(lex - edc_snd_path));
cd->edc_snd_path_list = eina_list_append(cd->edc_snd_path_list,
append = eina_stringshare_add_length(snd_path,
(lex - snd_path));
cd->snd_path_list = eina_list_append(cd->snd_path_list,
append);
eina_strbuf_append(cd->edc_snd_path_buf, " -sd ");
eina_strbuf_append(cd->edc_snd_path_buf, append);
eina_strbuf_append(cd->snd_path_buf, " -sd ");
eina_strbuf_append(cd->snd_path_buf, append);
lex++;
}
else
{
append = eina_stringshare_add(edc_snd_path);
cd->edc_snd_path_list = eina_list_append(cd->edc_snd_path_list,
append = eina_stringshare_add(snd_path);
cd->snd_path_list = eina_list_append(cd->snd_path_list,
append);
eina_strbuf_append(cd->edc_snd_path_buf, " -sd ");
eina_strbuf_append(cd->edc_snd_path_buf, append);
eina_strbuf_append(cd->snd_path_buf, " -sd ");
eina_strbuf_append(cd->snd_path_buf, append);
}
edc_snd_path = lex;
snd_path = lex;
}
}
void
config_edc_dat_path_set(const char *edc_dat_path)
config_dat_path_set(const char *dat_path)
{
config_data *cd = g_cd;
//Free the existing paths
const char *s;
EINA_LIST_FREE(cd->edc_dat_path_list, s) eina_stringshare_del(s);
EINA_LIST_FREE(cd->dat_path_list, s) eina_stringshare_del(s);
if (cd->edc_dat_path_buf) eina_strbuf_free(cd->edc_dat_path_buf);
cd->edc_dat_path_buf = eina_strbuf_new();
if (cd->dat_path_buf) eina_strbuf_free(cd->dat_path_buf);
cd->dat_path_buf = eina_strbuf_new();
//parse paths by ';'
const char *lex;
Eina_Stringshare *append;
while(edc_dat_path && (strlen(edc_dat_path) > 0))
while(dat_path && (strlen(dat_path) > 0))
{
lex = strstr(edc_dat_path, ";");
lex = strstr(dat_path, ";");
if (lex)
{
append = eina_stringshare_add_length(edc_dat_path,
(lex - edc_dat_path));
cd->edc_dat_path_list = eina_list_append(cd->edc_dat_path_list,
append = eina_stringshare_add_length(dat_path,
(lex - dat_path));
cd->dat_path_list = eina_list_append(cd->dat_path_list,
append);
eina_strbuf_append(cd->edc_dat_path_buf, " -dd ");
eina_strbuf_append(cd->edc_dat_path_buf, append);
eina_strbuf_append(cd->dat_path_buf, " -dd ");
eina_strbuf_append(cd->dat_path_buf, append);
lex++;
}
else
{
append = eina_stringshare_add(edc_dat_path);
cd->edc_dat_path_list = eina_list_append(cd->edc_dat_path_list,
append = eina_stringshare_add(dat_path);
cd->dat_path_list = eina_list_append(cd->dat_path_list,
append);
eina_strbuf_append(cd->edc_dat_path_buf, " -dd ");
eina_strbuf_append(cd->edc_dat_path_buf, append);
eina_strbuf_append(cd->dat_path_buf, " -dd ");
eina_strbuf_append(cd->dat_path_buf, append);
}
edc_dat_path = lex;
dat_path = lex;
}
}
void
config_edc_fnt_path_set(const char *edc_fnt_path)
config_fnt_path_set(const char *fnt_path)
{
config_data *cd = g_cd;
//Free the existing paths
const char *s;
EINA_LIST_FREE(cd->edc_fnt_path_list, s) eina_stringshare_del(s);
EINA_LIST_FREE(cd->fnt_path_list, s) eina_stringshare_del(s);
if (cd->edc_fnt_path_buf) eina_strbuf_free(cd->edc_fnt_path_buf);
cd->edc_fnt_path_buf = eina_strbuf_new();
if (cd->fnt_path_buf) eina_strbuf_free(cd->fnt_path_buf);
cd->fnt_path_buf = eina_strbuf_new();
//parse paths by ';'
const char *lex;
Eina_Stringshare *append;
while(edc_fnt_path && (strlen(edc_fnt_path) > 0))
while(fnt_path && (strlen(fnt_path) > 0))
{
lex = strstr(edc_fnt_path, ";");
lex = strstr(fnt_path, ";");
if (lex)
{
append = eina_stringshare_add_length(edc_fnt_path,
(lex - edc_fnt_path));
cd->edc_fnt_path_list = eina_list_append(cd->edc_fnt_path_list,
append = eina_stringshare_add_length(fnt_path,
(lex - fnt_path));
cd->fnt_path_list = eina_list_append(cd->fnt_path_list,
append);
eina_strbuf_append(cd->edc_fnt_path_buf, " -fd ");
eina_strbuf_append(cd->edc_fnt_path_buf, append);
eina_strbuf_append(cd->fnt_path_buf, " -fd ");
eina_strbuf_append(cd->fnt_path_buf, append);
lex++;
}
else
{
append = eina_stringshare_add(edc_fnt_path);
cd->edc_fnt_path_list = eina_list_append(cd->edc_fnt_path_list,
append = eina_stringshare_add(fnt_path);
cd->fnt_path_list = eina_list_append(cd->fnt_path_list,
append);
eina_strbuf_append(cd->edc_fnt_path_buf, " -fd ");
eina_strbuf_append(cd->edc_fnt_path_buf, append);
eina_strbuf_append(cd->fnt_path_buf, " -fd ");
eina_strbuf_append(cd->fnt_path_buf, append);
}
edc_fnt_path = lex;
fnt_path = lex;
}
}
void
config_edc_img_path_set(const char *edc_img_path)
config_img_path_set(const char *img_path)
{
config_data *cd = g_cd;
//Free the existing paths
const char *s;
EINA_LIST_FREE(cd->edc_img_path_list, s) eina_stringshare_del(s);
EINA_LIST_FREE(cd->img_path_list, s) eina_stringshare_del(s);
if (cd->edc_img_path_buf) eina_strbuf_free(cd->edc_img_path_buf);
cd->edc_img_path_buf = eina_strbuf_new();
if (cd->img_path_buf) eina_strbuf_free(cd->img_path_buf);
cd->img_path_buf = eina_strbuf_new();
//parse paths by ';'
const char *lex;
Eina_Stringshare *append;
while(edc_img_path && (strlen(edc_img_path) > 0))
while(img_path && (strlen(img_path) > 0))
{
lex = strstr(edc_img_path, ";");
lex = strstr(img_path, ";");
if (lex)
{
append = eina_stringshare_add_length(edc_img_path,
(lex - edc_img_path));
cd->edc_img_path_list = eina_list_append(cd->edc_img_path_list,
append = eina_stringshare_add_length(img_path,
(lex - img_path));
cd->img_path_list = eina_list_append(cd->img_path_list,
append);
eina_strbuf_append(cd->edc_img_path_buf, " -id ");
eina_strbuf_append(cd->edc_img_path_buf, append);
eina_strbuf_append(cd->img_path_buf, " -id ");
eina_strbuf_append(cd->img_path_buf, append);
lex++;
}
else
{
append = eina_stringshare_add(edc_img_path);
cd->edc_img_path_list = eina_list_append(cd->edc_img_path_list,
append = eina_stringshare_add(img_path);
cd->img_path_list = eina_list_append(cd->img_path_list,
append);
eina_strbuf_append(cd->edc_img_path_buf, " -id ");
eina_strbuf_append(cd->edc_img_path_buf, append);
eina_strbuf_append(cd->img_path_buf, " -id ");
eina_strbuf_append(cd->img_path_buf, append);
}
edc_img_path = lex;
img_path = lex;
}
}
@ -510,77 +512,77 @@ config_apply(void)
}
Eina_List *
config_edc_img_path_list_get(void)
config_img_path_list_get(void)
{
config_data *cd = g_cd;
return cd->edc_img_path_list;
return cd->img_path_list;
}
Eina_List *
config_edc_snd_path_list_get(void)
config_snd_path_list_get(void)
{
config_data *cd = g_cd;
return cd->edc_snd_path_list;
return cd->snd_path_list;
}
Eina_List *
config_edc_dat_path_list_get(void)
config_dat_path_list_get(void)
{
config_data *cd = g_cd;
return cd->edc_dat_path_list;
return cd->dat_path_list;
}
Eina_List *
config_edc_fnt_path_list_get(void)
config_fnt_path_list_get(void)
{
config_data *cd = g_cd;
return cd->edc_fnt_path_list;
return cd->fnt_path_list;
}
const char *
config_edc_img_path_get(void)
config_img_path_get(void)
{
config_data *cd = g_cd;
if (!cd->edc_img_path_buf) return NULL;
return eina_strbuf_string_get(cd->edc_img_path_buf);
if (!cd->img_path_buf) return NULL;
return eina_strbuf_string_get(cd->img_path_buf);
}
const char *
config_edc_snd_path_get(void)
config_snd_path_get(void)
{
config_data *cd = g_cd;
if (!cd->edc_snd_path_buf) return NULL;
return eina_strbuf_string_get(cd->edc_snd_path_buf);
if (!cd->snd_path_buf) return NULL;
return eina_strbuf_string_get(cd->snd_path_buf);
}
const char *
config_edc_dat_path_get(void)
config_dat_path_get(void)
{
config_data *cd = g_cd;
if (!cd->edc_dat_path_buf) return NULL;
return eina_strbuf_string_get(cd->edc_dat_path_buf);
if (!cd->dat_path_buf) return NULL;
return eina_strbuf_string_get(cd->dat_path_buf);
}
const char *
config_edc_fnt_path_get(void)
config_fnt_path_get(void)
{
config_data *cd = g_cd;
if (!cd->edc_fnt_path_buf) return NULL;
return eina_strbuf_string_get(cd->edc_fnt_path_buf);
if (!cd->fnt_path_buf) return NULL;
return eina_strbuf_string_get(cd->fnt_path_buf);
}
const char *
config_edc_path_get(void)
config_input_path_get(void)
{
config_data *cd = g_cd;
return cd->edc_path;
return cd->input_path;
}
const char *
config_edj_path_get(void)
config_output_path_get(void)
{
config_data *cd = g_cd;
return cd->edj_path;
return cd->output_path;
}
void

View File

@ -54,7 +54,7 @@ warning_replace_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
file_mgr_data *fmd = data;
enventor_object_file_set(fmd->enventor, config_edc_path_get());
enventor_object_file_set(fmd->enventor, config_input_path_get());
warning_close(fmd);
}
@ -148,14 +148,14 @@ file_mgr_edc_save(void)
char buf[PATH_MAX];
file_mgr_data *fmd = g_fmd;
Eina_Bool save_success = enventor_object_save(fmd->enventor, config_edc_path_get());
Eina_Bool save_success = enventor_object_save(fmd->enventor, config_input_path_get());
if (!config_stats_bar_get()) return;
if (save_success)
snprintf(buf, sizeof(buf), "File saved. \"%s\"", config_edc_path_get());
snprintf(buf, sizeof(buf), "File saved. \"%s\"", config_input_path_get());
else
snprintf(buf, sizeof(buf), "Already saved. \"%s\"", config_edc_path_get());
snprintf(buf, sizeof(buf), "Already saved. \"%s\"", config_input_path_get());
stats_info_msg_update(buf);
}

View File

@ -195,7 +195,7 @@ live_edit_insert(live_data *ld)
ld->part_info.rel2_x,
ld->part_info.rel2_y,
NULL, 0);
enventor_object_save(ld->enventor, config_edc_path_get());
enventor_object_save(ld->enventor, config_input_path_get());
}
static Eina_Bool

View File

@ -56,18 +56,18 @@ enventor_common_setup(Evas_Object *enventor)
enventor_object_auto_indent_set(enventor, config_auto_indent_get());
enventor_object_auto_complete_set(enventor, config_auto_complete_get());
Eina_List *list = eina_list_append(NULL, config_edj_path_get());
Eina_List *list = eina_list_append(NULL, config_output_path_get());
enventor_object_path_set(enventor, ENVENTOR_PATH_TYPE_EDJ, list);
eina_list_free(list);
enventor_object_path_set(enventor, ENVENTOR_PATH_TYPE_IMAGE,
config_edc_img_path_list_get());
config_img_path_list_get());
enventor_object_path_set(enventor, ENVENTOR_PATH_TYPE_SOUND,
config_edc_snd_path_list_get());
config_snd_path_list_get());
enventor_object_path_set(enventor, ENVENTOR_PATH_TYPE_FONT,
config_edc_fnt_path_list_get());
config_fnt_path_list_get());
enventor_object_path_set(enventor, ENVENTOR_PATH_TYPE_DATA,
config_edc_dat_path_list_get());
config_dat_path_list_get());
}
static void
@ -470,7 +470,7 @@ enventor_ctxpopup_changed_cb(void *data, Evas_Object *obj,
return;
}
ad->on_saving = EINA_TRUE;
enventor_object_save(obj, config_edc_path_get());
enventor_object_save(obj, config_input_path_get());
}
static void
@ -481,7 +481,7 @@ enventor_live_view_updated_cb(void *data, Evas_Object *obj,
if (ad->lazy_save && enventor_object_modified_get(obj))
{
enventor_object_save(obj, config_edc_path_get());
enventor_object_save(obj, config_input_path_get());
ad->lazy_save = EINA_FALSE;
}
else
@ -539,10 +539,10 @@ enventor_setup(app_data *ad)
enventor_common_setup(enventor);
enventor_object_file_set(enventor, config_edc_path_get());
enventor_object_file_set(enventor, config_input_path_get());
base_enventor_set(enventor);
base_title_set(config_edc_path_get());
base_title_set(config_input_path_get());
base_live_view_set(enventor_object_live_view_get(enventor));
ad->enventor = enventor;
@ -564,7 +564,7 @@ default_template_insert(app_data *ad)
char msg[64];
snprintf(msg, sizeof(msg), "Template code inserted, (%s)", syntax);
stats_info_msg_update(msg);
enventor_object_save(ad->enventor, config_edc_path_get());
enventor_object_save(ad->enventor, config_input_path_get());
}
else
{

View File

@ -321,7 +321,7 @@ exit_save_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
menu_data *md = data;
enventor_object_save(md->enventor, config_edc_path_get());
enventor_object_save(md->enventor, config_input_path_get());
elm_exit();
}
@ -369,7 +369,7 @@ new_save_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
menu_data *md = data;
enventor_object_save(md->enventor, config_edc_path_get());
enventor_object_save(md->enventor, config_input_path_get());
newfile_open(md);
warning_close(md);
menu_close(md);
@ -426,8 +426,8 @@ fileselector_save_done_cb(void *data, Evas_Object *obj, void *event_info)
if (is_edc)
{
config_edc_path_set(selected);
Eina_List *list = eina_list_append(NULL, config_edj_path_get());
config_input_path_set(selected);
Eina_List *list = eina_list_append(NULL, config_output_path_get());
enventor_object_path_set(md->enventor, ENVENTOR_PATH_TYPE_EDJ, list);
eina_list_free(list);
if (!enventor_object_save(md->enventor, selected))
@ -451,7 +451,7 @@ fileselector_save_done_cb(void *data, Evas_Object *obj, void *event_info)
enventor_object_path_set(md->enventor, ENVENTOR_PATH_TYPE_EDJ,
edj_pathes);
enventor_object_modified_set(md->enventor, EINA_TRUE);
enventor_object_save(md->enventor, config_edc_path_get());
enventor_object_save(md->enventor, config_input_path_get());
eina_list_free(edj_pathes);
}
@ -516,7 +516,7 @@ fileselector_load_done_cb(void *data, Evas_Object *obj, void *event_info)
"elm,action,msg,show", "");
return;
}
config_edc_path_set(selected);
config_input_path_set(selected);
enventor_object_file_set(md->enventor, selected);
base_title_set(selected);
fileselector_close(md);
@ -612,7 +612,7 @@ load_save_btn_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
menu_data *md = data;
enventor_object_save(md->enventor, config_edc_path_get());
enventor_object_save(md->enventor, config_input_path_get());
edc_file_load(md);
warning_close(md);
}

View File

@ -35,17 +35,17 @@ newfile_set(Evas_Object *enventor, Eina_Bool template_new)
snprintf(buf, sizeof(buf), "%s/templates/%s.edc",
elm_app_data_dir_get(), elm_object_item_text_get(it));
if (template_new && config_edc_path_get())
sprintf(path, "%s", config_edc_path_get());
if (template_new && config_input_path_get())
sprintf(path, "%s", config_input_path_get());
else
{
Eina_Tmpstr *tmp_path;
eina_file_mkstemp(DEFAULT_EDC_FORMAT, &tmp_path);
sprintf(path, "%s", (const char *)tmp_path);
eina_tmpstr_del(tmp_path);
config_edc_path_set(path);
config_input_path_set(path);
Eina_List *list = eina_list_append(NULL, config_edj_path_get());
Eina_List *list = eina_list_append(NULL, config_output_path_get());
enventor_object_path_set(enventor, ENVENTOR_PATH_TYPE_EDJ, list);
eina_list_free(list);
}
@ -71,7 +71,7 @@ newfile_default_set(Eina_Bool default_edc)
snprintf(buf, sizeof(buf), "%s/templates/basic.edc",
elm_app_data_dir_get());
success = eina_file_copy(buf,config_edc_path_get(),
success = eina_file_copy(buf,config_input_path_get(),
EINA_FILE_COPY_DATA, NULL, NULL);
if (!success)
{

View File

@ -112,10 +112,10 @@ setting_apply_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
{
setting_data *sd = data;
config_edc_img_path_set(elm_object_text_get(sd->img_path_entry));
config_edc_snd_path_set(elm_object_text_get(sd->snd_path_entry));
config_edc_fnt_path_set(elm_object_text_get(sd->fnt_path_entry));
config_edc_dat_path_set(elm_object_text_get(sd->dat_path_entry));
config_img_path_set(elm_object_text_get(sd->img_path_entry));
config_snd_path_set(elm_object_text_get(sd->snd_path_entry));
config_fnt_path_set(elm_object_text_get(sd->fnt_path_entry));
config_dat_path_set(elm_object_text_get(sd->dat_path_entry));
config_view_scale_set(elm_slider_value_get(sd->slider_view));
config_tools_set(elm_check_state_get(sd->toggle_tools));
config_console_set(elm_check_state_get(sd->toggle_console));
@ -150,13 +150,13 @@ setting_reset_btn_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
setting_data *sd = data;
img_path_entry_update(sd->img_path_entry,
(Eina_List *)config_edc_img_path_list_get());
(Eina_List *)config_img_path_list_get());
snd_path_entry_update(sd->snd_path_entry,
(Eina_List *)config_edc_snd_path_list_get());
(Eina_List *)config_snd_path_list_get());
fnt_path_entry_update(sd->fnt_path_entry,
(Eina_List *)config_edc_fnt_path_list_get());
(Eina_List *)config_fnt_path_list_get());
dat_path_entry_update(sd->dat_path_entry,
(Eina_List *)config_edc_dat_path_list_get());
(Eina_List *)config_dat_path_list_get());
elm_slider_value_set(sd->slider_view, (double) config_view_scale_get());
@ -239,7 +239,7 @@ general_layout_create(setting_data *sd, Evas_Object *parent)
//Image Path Entry
Evas_Object *img_path_entry = entry_create(layout);
img_path_entry_update(img_path_entry,
(Eina_List *)config_edc_img_path_list_get());
(Eina_List *)config_img_path_list_get());
elm_object_focus_set(img_path_entry, EINA_TRUE);
elm_object_part_content_set(layout, "elm.swallow.img_path_entry",
img_path_entry);
@ -247,20 +247,20 @@ general_layout_create(setting_data *sd, Evas_Object *parent)
//Sound Path Entry
Evas_Object *snd_path_entry = entry_create(layout);
snd_path_entry_update(snd_path_entry,
(Eina_List *)config_edc_snd_path_list_get());
(Eina_List *)config_snd_path_list_get());
elm_object_part_content_set(layout, "elm.swallow.snd_path_entry",
snd_path_entry);
//Font Path Entry
Evas_Object *fnt_path_entry = entry_create(layout);
fnt_path_entry_update(fnt_path_entry,
(Eina_List *)config_edc_fnt_path_list_get());
(Eina_List *)config_fnt_path_list_get());
elm_object_part_content_set(layout, "elm.swallow.fnt_path_entry",
fnt_path_entry);
//Data Path Entry
Evas_Object *dat_path_entry = entry_create(layout);
dat_path_entry_update(dat_path_entry,
(Eina_List *)config_edc_dat_path_list_get());
(Eina_List *)config_dat_path_list_get());
elm_object_part_content_set(layout, "elm.swallow.dat_path_entry",
dat_path_entry);

View File

@ -3,22 +3,22 @@
#define MAX_VIEW_SCALE 10.0
#define MIN_VIEW_SCALE 0.1
void config_init(const char *edc_path, const char *edj_path, Eina_List *edc_img_path, Eina_List *edc_snd_path, Eina_List *edc_fnt_path, Eina_List *edc_dat_path);
void config_init(const char *input_path, const char *output_path, Eina_List *img_path, Eina_List *snd_path, Eina_List *fnt_path, Eina_List *dat_path);
void config_term(void);
const char *config_edc_path_get(void);
const char *config_edj_path_get(void);
const char *config_edc_img_path_get(void);
const char *config_edc_snd_path_get(void);
const char *config_edc_fnt_path_get(void);
const char *config_edc_dat_path_get(void);
void config_edc_img_path_set(const char *edc_img_path);
void config_edc_snd_path_set(const char *edc_snd_path);
void config_edc_fnt_path_set(const char *edc_fnt_path);
void config_edc_dat_path_set(const char *edc_fnt_path);
Eina_List *config_edc_img_path_list_get(void);
Eina_List *config_edc_snd_path_list_get(void);
Eina_List *config_edc_fnt_path_list_get(void);
Eina_List *config_edc_dat_path_list_get(void);
const char *config_input_path_get(void);
const char *config_output_path_get(void);
const char *config_img_path_get(void);
const char *config_snd_path_get(void);
const char *config_fnt_path_get(void);
const char *config_dat_path_get(void);
void config_img_path_set(const char *img_path);
void config_snd_path_set(const char *snd_path);
void config_fnt_path_set(const char *fnt_path);
void config_dat_path_set(const char *fnt_path);
Eina_List *config_img_path_list_get(void);
Eina_List *config_snd_path_list_get(void);
Eina_List *config_fnt_path_list_get(void);
Eina_List *config_dat_path_list_get(void);
void config_syntax_color_set(Enventor_Syntax_Color_Type color_type, const char *val);
const char *config_syntax_color_get(Enventor_Syntax_Color_Type color_type);
void config_update_cb_set(void (*cb)(void *data), void *data);
@ -27,7 +27,7 @@ void config_linenumber_set(Eina_Bool enabled);
Eina_Bool config_stats_bar_get(void);
Eina_Bool config_linenumber_get(void);
void config_apply(void);
void config_edc_path_set(const char *edc_path);
void config_input_path_set(const char *input_path);
void config_view_size_get(Evas_Coord *w, Evas_Coord *h);
void config_view_size_set(Evas_Coord w, Evas_Coord h);
Eina_Bool config_view_size_configurable_get(void);