enventor - rename from option_data to config_data
This commit is contained in:
parent
d18c987bc6
commit
0903e0e352
|
@ -12,7 +12,7 @@ struct config_s
|
|||
Eina_Strbuf *edc_snd_path_buf; //pre-stored sound paths for edc compile.
|
||||
float font_size;
|
||||
|
||||
void (*update_cb)(void *data, option_data *od);
|
||||
void (*update_cb)(void *data, config_data *cd);
|
||||
void *update_cb_data;
|
||||
Evas_Coord_Size view_size;
|
||||
|
||||
|
@ -25,98 +25,98 @@ struct config_s
|
|||
};
|
||||
|
||||
void
|
||||
option_view_size_set(option_data *od, Evas_Coord w, Evas_Coord h)
|
||||
config_view_size_set(config_data *cd, Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
od->view_size.w = w;
|
||||
od->view_size.h = h;
|
||||
cd->view_size.w = w;
|
||||
cd->view_size.h = h;
|
||||
}
|
||||
|
||||
void
|
||||
option_view_size_get(option_data *od, Evas_Coord *w, Evas_Coord *h)
|
||||
config_view_size_get(config_data *cd, Evas_Coord *w, Evas_Coord *h)
|
||||
{
|
||||
if (w) *w = od->view_size.w;
|
||||
if (h) *h = od->view_size.h;
|
||||
if (w) *w = cd->view_size.w;
|
||||
if (h) *h = cd->view_size.h;
|
||||
}
|
||||
|
||||
static void
|
||||
option_edj_path_update(option_data *od)
|
||||
config_edj_path_update(config_data *cd)
|
||||
{
|
||||
//apply edj path also
|
||||
char buf[PATH_MAX];
|
||||
char edj_path[PATH_MAX];
|
||||
|
||||
char *ext = strstr(od->edc_path, ".edc");
|
||||
const char *file = ecore_file_file_get(od->edc_path);
|
||||
char *ext = strstr(cd->edc_path, ".edc");
|
||||
const char *file = ecore_file_file_get(cd->edc_path);
|
||||
if (ext && file)
|
||||
snprintf(buf, (ext - file) + 1, "%s", file);
|
||||
else
|
||||
strncpy(buf, file, sizeof(buf));
|
||||
sprintf(edj_path, "%s/%s.edj", ecore_file_dir_get(od->edc_path), buf);
|
||||
sprintf(edj_path, "%s/%s.edj", ecore_file_dir_get(cd->edc_path), buf);
|
||||
|
||||
eina_stringshare_replace(&od->edj_path, edj_path);
|
||||
eina_stringshare_replace(&cd->edj_path, edj_path);
|
||||
}
|
||||
|
||||
void
|
||||
option_edc_path_set(option_data *od, const char *edc_path)
|
||||
config_edc_path_set(config_data *cd, const char *edc_path)
|
||||
{
|
||||
eina_stringshare_replace(&od->edc_path, edc_path);
|
||||
option_edj_path_update(od);
|
||||
eina_stringshare_replace(&cd->edc_path, edc_path);
|
||||
config_edj_path_update(cd);
|
||||
}
|
||||
|
||||
option_data *
|
||||
option_init(const char *edc_path, const char *edc_img_path,
|
||||
config_data *
|
||||
config_init(const char *edc_path, const char *edc_img_path,
|
||||
const char *edc_snd_path)
|
||||
{
|
||||
option_data *od = calloc(1, sizeof(option_data));
|
||||
config_data *cd = calloc(1, sizeof(config_data));
|
||||
|
||||
od->edc_path = eina_stringshare_add(edc_path);
|
||||
option_edj_path_update(od);
|
||||
option_edc_img_path_set(od, edc_img_path);
|
||||
option_edc_snd_path_set(od, edc_snd_path);
|
||||
cd->edc_path = eina_stringshare_add(edc_path);
|
||||
config_edj_path_update(cd);
|
||||
config_edc_img_path_set(cd, edc_img_path);
|
||||
config_edc_snd_path_set(cd, edc_snd_path);
|
||||
|
||||
od->font_size = 1.0f;
|
||||
od->linenumber = EINA_TRUE;
|
||||
od->part_highlight = EINA_TRUE;
|
||||
od->dummy_swallow = EINA_TRUE;
|
||||
od->auto_indent = EINA_TRUE;
|
||||
cd->font_size = 1.0f;
|
||||
cd->linenumber = EINA_TRUE;
|
||||
cd->part_highlight = EINA_TRUE;
|
||||
cd->dummy_swallow = EINA_TRUE;
|
||||
cd->auto_indent = EINA_TRUE;
|
||||
|
||||
return od;
|
||||
return cd;
|
||||
}
|
||||
|
||||
void
|
||||
option_term(option_data *od)
|
||||
config_term(config_data *cd)
|
||||
{
|
||||
eina_stringshare_del(od->edc_path);
|
||||
eina_stringshare_del(od->edj_path);
|
||||
eina_stringshare_del(cd->edc_path);
|
||||
eina_stringshare_del(cd->edj_path);
|
||||
|
||||
Eina_List *l;
|
||||
Eina_Stringshare *str;
|
||||
|
||||
//free the image paths
|
||||
EINA_LIST_FOREACH(od->edc_img_path_list, l, str)
|
||||
EINA_LIST_FOREACH(cd->edc_img_path_list, l, str)
|
||||
eina_stringshare_del(str);
|
||||
eina_list_free(od->edc_img_path_list);
|
||||
eina_list_free(cd->edc_img_path_list);
|
||||
|
||||
//free the sound paths
|
||||
EINA_LIST_FOREACH(od->edc_snd_path_list, l, str)
|
||||
EINA_LIST_FOREACH(cd->edc_snd_path_list, l, str)
|
||||
eina_stringshare_del(str);
|
||||
eina_list_free(od->edc_snd_path_list);
|
||||
eina_list_free(cd->edc_snd_path_list);
|
||||
|
||||
free(od);
|
||||
free(cd);
|
||||
}
|
||||
|
||||
void
|
||||
option_edc_snd_path_set(option_data *od, const char *edc_snd_path)
|
||||
config_edc_snd_path_set(config_data *cd, const char *edc_snd_path)
|
||||
{
|
||||
//Free the existing paths
|
||||
Eina_List *l;
|
||||
const char *s;
|
||||
EINA_LIST_FOREACH(od->edc_snd_path_list, l, s)
|
||||
EINA_LIST_FOREACH(cd->edc_snd_path_list, l, s)
|
||||
eina_stringshare_del(s);
|
||||
od->edc_snd_path_list = eina_list_free(od->edc_snd_path_list);
|
||||
cd->edc_snd_path_list = eina_list_free(cd->edc_snd_path_list);
|
||||
|
||||
if (od->edc_snd_path_buf) eina_strbuf_free(od->edc_snd_path_buf);
|
||||
od->edc_snd_path_buf = eina_strbuf_new();
|
||||
if (cd->edc_snd_path_buf) eina_strbuf_free(cd->edc_snd_path_buf);
|
||||
cd->edc_snd_path_buf = eina_strbuf_new();
|
||||
|
||||
//parse paths by ';'
|
||||
const char *lex;
|
||||
|
@ -129,19 +129,19 @@ option_edc_snd_path_set(option_data *od, const char *edc_snd_path)
|
|||
{
|
||||
append = eina_stringshare_add_length(edc_snd_path,
|
||||
(lex - edc_snd_path));
|
||||
od->edc_snd_path_list = eina_list_append(od->edc_snd_path_list,
|
||||
cd->edc_snd_path_list = eina_list_append(cd->edc_snd_path_list,
|
||||
append);
|
||||
eina_strbuf_append(od->edc_snd_path_buf, " -sd ");
|
||||
eina_strbuf_append(od->edc_snd_path_buf, append);
|
||||
eina_strbuf_append(cd->edc_snd_path_buf, " -sd ");
|
||||
eina_strbuf_append(cd->edc_snd_path_buf, append);
|
||||
lex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
append = eina_stringshare_add(edc_snd_path);
|
||||
od->edc_snd_path_list = eina_list_append(od->edc_snd_path_list,
|
||||
cd->edc_snd_path_list = eina_list_append(cd->edc_snd_path_list,
|
||||
append);
|
||||
eina_strbuf_append(od->edc_snd_path_buf, " -sd ");
|
||||
eina_strbuf_append(od->edc_snd_path_buf, append);
|
||||
eina_strbuf_append(cd->edc_snd_path_buf, " -sd ");
|
||||
eina_strbuf_append(cd->edc_snd_path_buf, append);
|
||||
}
|
||||
|
||||
edc_snd_path = lex;
|
||||
|
@ -150,17 +150,17 @@ option_edc_snd_path_set(option_data *od, const char *edc_snd_path)
|
|||
|
||||
|
||||
void
|
||||
option_edc_img_path_set(option_data *od, const char *edc_img_path)
|
||||
config_edc_img_path_set(config_data *cd, const char *edc_img_path)
|
||||
{
|
||||
//Free the existing paths
|
||||
Eina_List *l;
|
||||
const char *s;
|
||||
EINA_LIST_FOREACH(od->edc_img_path_list, l, s)
|
||||
EINA_LIST_FOREACH(cd->edc_img_path_list, l, s)
|
||||
eina_stringshare_del(s);
|
||||
od->edc_img_path_list = eina_list_free(od->edc_img_path_list);
|
||||
cd->edc_img_path_list = eina_list_free(cd->edc_img_path_list);
|
||||
|
||||
if (od->edc_img_path_buf) eina_strbuf_free(od->edc_img_path_buf);
|
||||
od->edc_img_path_buf = eina_strbuf_new();
|
||||
if (cd->edc_img_path_buf) eina_strbuf_free(cd->edc_img_path_buf);
|
||||
cd->edc_img_path_buf = eina_strbuf_new();
|
||||
|
||||
//parse paths by ';'
|
||||
const char *lex;
|
||||
|
@ -173,19 +173,19 @@ option_edc_img_path_set(option_data *od, const char *edc_img_path)
|
|||
{
|
||||
append = eina_stringshare_add_length(edc_img_path,
|
||||
(lex - edc_img_path));
|
||||
od->edc_img_path_list = eina_list_append(od->edc_img_path_list,
|
||||
cd->edc_img_path_list = eina_list_append(cd->edc_img_path_list,
|
||||
append);
|
||||
eina_strbuf_append(od->edc_img_path_buf, " -id ");
|
||||
eina_strbuf_append(od->edc_img_path_buf, append);
|
||||
eina_strbuf_append(cd->edc_img_path_buf, " -id ");
|
||||
eina_strbuf_append(cd->edc_img_path_buf, append);
|
||||
lex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
append = eina_stringshare_add(edc_img_path);
|
||||
od->edc_img_path_list = eina_list_append(od->edc_img_path_list,
|
||||
cd->edc_img_path_list = eina_list_append(cd->edc_img_path_list,
|
||||
append);
|
||||
eina_strbuf_append(od->edc_img_path_buf, " -id ");
|
||||
eina_strbuf_append(od->edc_img_path_buf, append);
|
||||
eina_strbuf_append(cd->edc_img_path_buf, " -id ");
|
||||
eina_strbuf_append(cd->edc_img_path_buf, append);
|
||||
}
|
||||
|
||||
edc_img_path = lex;
|
||||
|
@ -193,130 +193,130 @@ option_edc_img_path_set(option_data *od, const char *edc_img_path)
|
|||
}
|
||||
|
||||
void
|
||||
option_apply(option_data *od)
|
||||
config_apply(config_data *cd)
|
||||
{
|
||||
if (od->update_cb) od->update_cb(od->update_cb_data, od);
|
||||
if (cd->update_cb) cd->update_cb(cd->update_cb_data, cd);
|
||||
}
|
||||
|
||||
const Eina_List *
|
||||
option_edc_img_path_list_get(option_data *od)
|
||||
config_edc_img_path_list_get(config_data *cd)
|
||||
{
|
||||
return od->edc_img_path_list;
|
||||
return cd->edc_img_path_list;
|
||||
}
|
||||
|
||||
const Eina_List *
|
||||
option_edc_snd_path_list_get(option_data *od)
|
||||
config_edc_snd_path_list_get(config_data *cd)
|
||||
{
|
||||
return od->edc_snd_path_list;
|
||||
return cd->edc_snd_path_list;
|
||||
}
|
||||
|
||||
const char *
|
||||
option_edc_img_path_get(option_data *od)
|
||||
config_edc_img_path_get(config_data *cd)
|
||||
{
|
||||
if (!od->edc_img_path_buf) return NULL;
|
||||
return eina_strbuf_string_get(od->edc_img_path_buf);
|
||||
if (!cd->edc_img_path_buf) return NULL;
|
||||
return eina_strbuf_string_get(cd->edc_img_path_buf);
|
||||
}
|
||||
|
||||
const char *
|
||||
option_edc_snd_path_get(option_data *od)
|
||||
config_edc_snd_path_get(config_data *cd)
|
||||
{
|
||||
if (!od->edc_snd_path_buf) return NULL;
|
||||
return eina_strbuf_string_get(od->edc_snd_path_buf);
|
||||
if (!cd->edc_snd_path_buf) return NULL;
|
||||
return eina_strbuf_string_get(cd->edc_snd_path_buf);
|
||||
}
|
||||
|
||||
const char *
|
||||
option_edc_path_get(option_data *od)
|
||||
config_edc_path_get(config_data *cd)
|
||||
{
|
||||
return od->edc_path;
|
||||
return cd->edc_path;
|
||||
}
|
||||
|
||||
const char *
|
||||
option_edj_path_get(option_data *od)
|
||||
config_edj_path_get(config_data *cd)
|
||||
{
|
||||
return od->edj_path;
|
||||
return cd->edj_path;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
option_linenumber_get(option_data *od)
|
||||
config_linenumber_get(config_data *cd)
|
||||
{
|
||||
return od->linenumber;
|
||||
return cd->linenumber;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
option_stats_bar_get(option_data *od)
|
||||
config_stats_bar_get(config_data *cd)
|
||||
{
|
||||
return od->stats_bar;
|
||||
return cd->stats_bar;
|
||||
}
|
||||
|
||||
void
|
||||
option_linenumber_set(option_data *od, Eina_Bool enabled)
|
||||
config_linenumber_set(config_data *cd, Eina_Bool enabled)
|
||||
{
|
||||
od->linenumber = enabled;
|
||||
cd->linenumber = enabled;
|
||||
}
|
||||
|
||||
void
|
||||
option_stats_bar_set(option_data *od, Eina_Bool enabled)
|
||||
config_stats_bar_set(config_data *cd, Eina_Bool enabled)
|
||||
{
|
||||
od->stats_bar = enabled;
|
||||
cd->stats_bar = enabled;
|
||||
}
|
||||
|
||||
void
|
||||
option_update_cb_set(option_data *od, void (*cb)(void *data, option_data *od),
|
||||
config_update_cb_set(config_data *cd, void (*cb)(void *data, config_data *cd),
|
||||
void *data)
|
||||
{
|
||||
od->update_cb = cb;
|
||||
od->update_cb_data = data;
|
||||
cd->update_cb = cb;
|
||||
cd->update_cb_data = data;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
option_part_highlight_get(option_data *od)
|
||||
config_part_highlight_get(config_data *cd)
|
||||
{
|
||||
return od->part_highlight;
|
||||
return cd->part_highlight;
|
||||
}
|
||||
|
||||
void
|
||||
option_part_highlight_set(option_data *od, Eina_Bool highlight)
|
||||
config_part_highlight_set(config_data *cd, Eina_Bool highlight)
|
||||
{
|
||||
od->part_highlight = highlight;
|
||||
cd->part_highlight = highlight;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
option_dummy_swallow_get(option_data *od)
|
||||
config_dummy_swallow_get(config_data *cd)
|
||||
{
|
||||
return od->dummy_swallow;
|
||||
return cd->dummy_swallow;
|
||||
}
|
||||
|
||||
void
|
||||
option_dummy_swallow_set(option_data *od, Eina_Bool dummy_swallow)
|
||||
config_dummy_swallow_set(config_data *cd, Eina_Bool dummy_swallow)
|
||||
{
|
||||
od->dummy_swallow = dummy_swallow;
|
||||
cd->dummy_swallow = dummy_swallow;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
option_auto_indent_get(option_data *od)
|
||||
config_auto_indent_get(config_data *cd)
|
||||
{
|
||||
return od->auto_indent;
|
||||
return cd->auto_indent;
|
||||
}
|
||||
|
||||
void
|
||||
option_font_size_set(option_data *od, float font_size)
|
||||
config_font_size_set(config_data *cd, float font_size)
|
||||
{
|
||||
if (font_size > MAX_FONT_SIZE)
|
||||
font_size = MAX_FONT_SIZE;
|
||||
else if (font_size < MIN_FONT_SIZE)
|
||||
font_size = MIN_FONT_SIZE;
|
||||
|
||||
od->font_size = font_size;
|
||||
cd->font_size = font_size;
|
||||
}
|
||||
|
||||
float
|
||||
option_font_size_get(option_data *od)
|
||||
config_font_size_get(config_data *cd)
|
||||
{
|
||||
return od->font_size;
|
||||
return cd->font_size;
|
||||
}
|
||||
|
||||
void
|
||||
option_auto_indent_set(option_data *od, Eina_Bool auto_indent)
|
||||
config_auto_indent_set(config_data *cd, Eina_Bool auto_indent)
|
||||
{
|
||||
od->auto_indent = auto_indent;
|
||||
cd->auto_indent = auto_indent;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ struct editor_s
|
|||
|
||||
syntax_helper *sh;
|
||||
stats_data *sd;
|
||||
option_data *od;
|
||||
config_data *cd;
|
||||
parser_data *pd;
|
||||
menu_data *md;
|
||||
|
||||
|
@ -146,7 +146,7 @@ edit_changed_cb(void *data, Evas_Object *obj, void *event_info)
|
|||
if (!strcmp(info->change.insert.content, "<br/>"))
|
||||
{
|
||||
last_line_inc(ed);
|
||||
if (option_auto_indent_get(ed->od)) indent_apply(ed);
|
||||
if (config_auto_indent_get(ed->cd)) indent_apply(ed);
|
||||
syntax_color = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -169,16 +169,16 @@ edit_changed_cb(void *data, Evas_Object *obj, void *event_info)
|
|||
static void
|
||||
save_msg_show(edit_data *ed)
|
||||
{
|
||||
if (!option_stats_bar_get(ed->od)) return;
|
||||
if (!config_stats_bar_get(ed->cd)) return;
|
||||
|
||||
char buf[PATH_MAX];
|
||||
|
||||
if (ed->edit_changed)
|
||||
snprintf(buf, sizeof(buf), "File saved. \"%s\"",
|
||||
option_edc_path_get(ed->od));
|
||||
config_edc_path_get(ed->cd));
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "Already saved. \"%s\"",
|
||||
option_edc_path_get(ed->od));
|
||||
config_edc_path_get(ed->cd));
|
||||
|
||||
stats_info_msg_update(ed->sd, buf);
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ edit_save(edit_data *ed)
|
|||
Evas_Object *tb = elm_entry_textblock_get(ed->en_edit);
|
||||
const char *text2 = evas_textblock_text_markup_to_utf8(tb, text);
|
||||
|
||||
FILE *fp = fopen(option_edc_path_get(ed->od), "w");
|
||||
FILE *fp = fopen(config_edc_path_get(ed->cd), "w");
|
||||
if (!fp) return EINA_FALSE;
|
||||
|
||||
fputs(text2, fp);
|
||||
|
@ -260,7 +260,7 @@ edit_mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
|
|||
static void
|
||||
cur_line_pos_set(edit_data *ed)
|
||||
{
|
||||
if (!option_stats_bar_get(ed->od)) return;
|
||||
if (!config_stats_bar_get(ed->cd)) return;
|
||||
|
||||
Evas_Coord y, h;
|
||||
elm_entry_cursor_geometry_get(ed->en_edit, NULL, &y, NULL, &h);
|
||||
|
@ -309,7 +309,7 @@ part_name_get_cb(void *data, Eina_Stringshare *part_name)
|
|||
void
|
||||
edit_cur_part_update(edit_data *ed)
|
||||
{
|
||||
if (!option_part_highlight_get(ed->od)) return;
|
||||
if (!config_part_highlight_get(ed->cd)) return;
|
||||
|
||||
parser_part_name_get(ed->pd, ed->en_edit, part_name_get_cb, ed);
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ key_up_cb(void *data, int type EINA_UNUSED, void *ev)
|
|||
}
|
||||
|
||||
edit_data *
|
||||
edit_init(Evas_Object *parent, stats_data *sd, option_data *od)
|
||||
edit_init(Evas_Object *parent, stats_data *sd, config_data *cd)
|
||||
{
|
||||
parser_data *pd = parser_init();
|
||||
syntax_helper *sh = syntax_init();
|
||||
|
@ -366,7 +366,7 @@ edit_init(Evas_Object *parent, stats_data *sd, option_data *od)
|
|||
ed->sd = sd;
|
||||
ed->pd = pd;
|
||||
ed->sh = sh;
|
||||
ed->od = od;
|
||||
ed->cd = cd;
|
||||
|
||||
ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, key_down_cb, ed);
|
||||
ecore_event_handler_add(ECORE_EVENT_KEY_UP, key_up_cb, ed);
|
||||
|
@ -482,7 +482,7 @@ edit_edc_read(edit_data *ed, const char *file_path)
|
|||
|
||||
EINA_ITERATOR_FOREACH(itr, line)
|
||||
{
|
||||
//Append edc code
|
||||
//Append edc ccde
|
||||
if (line_num > 0)
|
||||
{
|
||||
if (!eina_strbuf_append(strbuf, "<br/>")) goto err;
|
||||
|
@ -533,7 +533,7 @@ edit_changed_set(edit_data *ed, Eina_Bool changed)
|
|||
void
|
||||
edit_line_number_toggle(edit_data *ed)
|
||||
{
|
||||
Eina_Bool linenumber = option_linenumber_get(ed->od);
|
||||
Eina_Bool linenumber = config_linenumber_get(ed->cd);
|
||||
if (ed->linenumber == linenumber) return;
|
||||
ed->linenumber = linenumber;
|
||||
|
||||
|
@ -548,7 +548,7 @@ edit_new(edit_data *ed)
|
|||
{
|
||||
elm_entry_entry_set(ed->en_edit, "");
|
||||
elm_entry_entry_set(ed->en_line, "");
|
||||
edit_edc_read(ed, option_edc_path_get(ed->od));
|
||||
edit_edc_read(ed, config_edc_path_get(ed->cd));
|
||||
ed->edit_changed = EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -561,11 +561,11 @@ edit_group_name_get(edit_data *ed)
|
|||
void
|
||||
edit_font_size_update(edit_data *ed)
|
||||
{
|
||||
elm_object_scale_set(ed->en_edit, option_font_size_get(ed->od));
|
||||
elm_object_scale_set(ed->en_line, option_font_size_get(ed->od));
|
||||
elm_object_scale_set(ed->en_edit, config_font_size_get(ed->cd));
|
||||
elm_object_scale_set(ed->en_line, config_font_size_get(ed->cd));
|
||||
|
||||
char buf[128];
|
||||
snprintf(buf, sizeof(buf), "Font Size: %1.1fx",
|
||||
option_font_size_get(ed->od));
|
||||
config_font_size_get(ed->cd));
|
||||
stats_info_msg_update(ed->sd, buf);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
struct viewer_s
|
||||
{
|
||||
stats_data *sd;
|
||||
option_data *od;
|
||||
config_data *cd;
|
||||
|
||||
Evas_Object *parent;
|
||||
Evas_Object *layout;
|
||||
|
@ -58,11 +58,11 @@ layout_resize_cb(void *data, Evas *e EINA_UNUSED,
|
|||
Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
view_data *vd = data;
|
||||
if (!option_stats_bar_get(vd->od)) return;
|
||||
if (!config_stats_bar_get(vd->cd)) return;
|
||||
|
||||
Evas_Coord w, h;
|
||||
evas_object_geometry_get(obj, NULL, NULL, &w, &h);
|
||||
option_view_size_set(vd->od, w, h);
|
||||
config_view_size_set(vd->cd, w, h);
|
||||
stats_view_size_update(vd->sd);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ layout_mouse_move_cb(void *data, Evas *e EINA_UNUSED,
|
|||
Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
view_data *vd = data;
|
||||
if (!option_stats_bar_get(vd->od)) return;
|
||||
if (!config_stats_bar_get(vd->cd)) return;
|
||||
|
||||
Evas_Event_Mouse_Move *ev = event_info;
|
||||
|
||||
|
@ -127,7 +127,7 @@ static Eina_Bool
|
|||
view_obj_idler_cb(void *data)
|
||||
{
|
||||
view_data *vd = data;
|
||||
vd->layout = view_obj_create(vd, option_edj_path_get(vd->od),
|
||||
vd->layout = view_obj_create(vd, config_edj_path_get(vd->cd),
|
||||
vd->group_name);
|
||||
elm_object_content_set(vd->scroller, vd->layout);
|
||||
|
||||
|
@ -140,7 +140,7 @@ view_obj_idler_cb(void *data)
|
|||
void
|
||||
view_dummy_toggle(view_data *vd)
|
||||
{
|
||||
Eina_Bool dummy_obj = option_dummy_swallow_get(vd->od);
|
||||
Eina_Bool dummy_obj = config_dummy_swallow_get(vd->cd);
|
||||
if (dummy_obj == vd->dummy_obj) return;
|
||||
if (dummy_obj)
|
||||
{
|
||||
|
@ -177,14 +177,14 @@ view_reload_need_get(view_data *vd)
|
|||
|
||||
view_data *
|
||||
view_init(Evas_Object *parent, const char *group, stats_data *sd,
|
||||
option_data *od)
|
||||
config_data *cd)
|
||||
{
|
||||
view_data *vd = calloc(1, sizeof(view_data));
|
||||
vd->parent = parent;
|
||||
vd->sd = sd;
|
||||
vd->od = od;
|
||||
vd->cd = cd;
|
||||
vd->scroller = view_scroller_create(parent);
|
||||
vd->dummy_obj = option_dummy_swallow_get(od);
|
||||
vd->dummy_obj = config_dummy_swallow_get(cd);
|
||||
|
||||
view_new(vd, group);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ struct app_s
|
|||
view_data *vd;
|
||||
menu_data *md;
|
||||
stats_data *sd;
|
||||
option_data *od;
|
||||
config_data *cd;
|
||||
|
||||
Evas_Object *layout;
|
||||
Evas_Object *panes;
|
||||
|
@ -41,7 +41,7 @@ edc_changed_cb(void *data, int type EINA_UNUSED, void *event)
|
|||
|
||||
if (!edit_changed_get(ad->ed)) return ECORE_CALLBACK_RENEW;
|
||||
|
||||
if (strcmp(ev->filename, option_edc_path_get(ad->od)))
|
||||
if (strcmp(ev->filename, config_edc_path_get(ad->cd)))
|
||||
return ECORE_CALLBACK_RENEW;
|
||||
|
||||
rebuild_edc();
|
||||
|
@ -51,15 +51,15 @@ edc_changed_cb(void *data, int type EINA_UNUSED, void *event)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
edje_cc_cmd_set(option_data *od)
|
||||
edje_cc_cmd_set(config_data *cd)
|
||||
{
|
||||
Eina_Strbuf *buf = eina_strbuf_new();
|
||||
if (!buf) return EINA_FALSE;
|
||||
eina_strbuf_append_printf(buf, "edje_cc -fastcomp %s %s %s %s",
|
||||
option_edc_path_get(od),
|
||||
option_edj_path_get(od),
|
||||
option_edc_img_path_get(od),
|
||||
option_edc_snd_path_get(od));
|
||||
config_edc_path_get(cd),
|
||||
config_edj_path_get(cd),
|
||||
config_edc_img_path_get(cd),
|
||||
config_edc_snd_path_get(cd));
|
||||
eina_strbuf_append(buf, " > /dev/null");
|
||||
EDJE_CC_CMD = eina_strbuf_string_steal(buf);
|
||||
eina_strbuf_free(buf);
|
||||
|
@ -115,7 +115,7 @@ base_gui_construct(app_data *ad)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
edc_proto_setup(option_data *od)
|
||||
edc_proto_setup(config_data *cd)
|
||||
{
|
||||
Eina_Bool success = EINA_TRUE;
|
||||
|
||||
|
@ -123,11 +123,11 @@ edc_proto_setup(option_data *od)
|
|||
snprintf(buf, sizeof(buf), "%s/.proto/proto.edc",
|
||||
elm_app_data_dir_get());
|
||||
|
||||
if (!ecore_file_exists(option_edc_path_get(od)))
|
||||
if (!ecore_file_exists(config_edc_path_get(cd)))
|
||||
{
|
||||
EINA_LOG_INFO("No working edc file exists. Copy a proto.edc");
|
||||
success = eina_file_copy(buf,
|
||||
option_edc_path_get(od),
|
||||
config_edc_path_get(cd),
|
||||
EINA_FILE_COPY_DATA, NULL, NULL);
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ main_key_up_cb(void *data, int type EINA_UNUSED, void *ev)
|
|||
static void
|
||||
statusbar_toggle(app_data *ad)
|
||||
{
|
||||
if (option_stats_bar_get(ad->od))
|
||||
if (config_stats_bar_get(ad->cd))
|
||||
elm_object_signal_emit(ad->layout, "elm,state,statusbar,show", "");
|
||||
else
|
||||
elm_object_signal_emit(ad->layout, "elm,state,statusbar,hide", "");
|
||||
|
@ -169,7 +169,7 @@ statusbar_toggle(app_data *ad)
|
|||
static void
|
||||
part_highlight_toggle(app_data *ad)
|
||||
{
|
||||
Eina_Bool highlight = option_part_highlight_get(ad->od);
|
||||
Eina_Bool highlight = config_part_highlight_get(ad->cd);
|
||||
if (highlight) edit_cur_part_update(ad->ed);
|
||||
else view_part_highlight_set(ad->vd, NULL);
|
||||
|
||||
|
@ -211,16 +211,16 @@ main_key_down_cb(void *data, int type EINA_UNUSED, void *ev)
|
|||
//Part Highlight
|
||||
if (!strcmp(event->keyname, "h") || !strcmp(event->keyname, "H"))
|
||||
{
|
||||
option_part_highlight_set(ad->od,
|
||||
!option_part_highlight_get(ad->od));
|
||||
config_part_highlight_set(ad->cd,
|
||||
!config_part_highlight_get(ad->cd));
|
||||
part_highlight_toggle(ad);
|
||||
return ECORE_CALLBACK_DONE;
|
||||
}
|
||||
//Part Highlight
|
||||
if (!strcmp(event->keyname, "w") || !strcmp(event->keyname, "W"))
|
||||
{
|
||||
option_dummy_swallow_set(ad->od,
|
||||
!option_dummy_swallow_get(ad->od));
|
||||
config_dummy_swallow_set(ad->cd,
|
||||
!config_dummy_swallow_get(ad->cd));
|
||||
view_dummy_toggle(ad->vd);
|
||||
return ECORE_CALLBACK_DONE;
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ main_key_down_cb(void *data, int type EINA_UNUSED, void *ev)
|
|||
return ECORE_CALLBACK_DONE;
|
||||
}
|
||||
//Full Edje View
|
||||
if (!strcmp(event->keyname, "period"))
|
||||
if (!strcmp(event->keyname, "pericd"))
|
||||
{
|
||||
panes_full_view_right(ad->panes);
|
||||
return ECORE_CALLBACK_DONE;
|
||||
|
@ -239,14 +239,14 @@ main_key_down_cb(void *data, int type EINA_UNUSED, void *ev)
|
|||
//Font Size Up
|
||||
if (!strcmp(event->keyname, "equal"))
|
||||
{
|
||||
option_font_size_set(ad->od, option_font_size_get(ad->od) + 0.1f);
|
||||
config_font_size_set(ad->cd, config_font_size_get(ad->cd) + 0.1f);
|
||||
edit_font_size_update(ad->ed);
|
||||
return ECORE_CALLBACK_DONE;
|
||||
}
|
||||
//Font Size Down
|
||||
if (!strcmp(event->keyname, "minus"))
|
||||
{
|
||||
option_font_size_set(ad->od, option_font_size_get(ad->od) - 0.1f);
|
||||
config_font_size_set(ad->cd, config_font_size_get(ad->cd) - 0.1f);
|
||||
edit_font_size_update(ad->ed);
|
||||
return ECORE_CALLBACK_DONE;
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ main_key_down_cb(void *data, int type EINA_UNUSED, void *ev)
|
|||
//Main Menu
|
||||
if (!strcmp(event->keyname, "Escape"))
|
||||
{
|
||||
ad->menu_opened = menu_option_toggle();
|
||||
ad->menu_opened = menu_toggle();
|
||||
if (!ad->menu_opened)
|
||||
edit_focus_set(ad->ed);
|
||||
return ECORE_CALLBACK_DONE;
|
||||
|
@ -280,14 +280,14 @@ main_key_down_cb(void *data, int type EINA_UNUSED, void *ev)
|
|||
//Line Number
|
||||
else if (!strcmp(event->keyname, "F5"))
|
||||
{
|
||||
option_linenumber_set(ad->od, !option_linenumber_get(ad->od));
|
||||
config_linenumber_set(ad->cd, !config_linenumber_get(ad->cd));
|
||||
edit_line_number_toggle(ad->ed);
|
||||
return ECORE_CALLBACK_DONE;
|
||||
}
|
||||
//Statusbar
|
||||
else if (!strcmp(event->keyname, "F6"))
|
||||
{
|
||||
option_stats_bar_set(ad->od, !option_stats_bar_get(ad->od));
|
||||
config_stats_bar_set(ad->cd, !config_stats_bar_get(ad->cd));
|
||||
statusbar_toggle(ad);
|
||||
return ECORE_CALLBACK_DONE;
|
||||
}
|
||||
|
@ -303,40 +303,40 @@ part_changed_cb(void *data, const char *part_name)
|
|||
}
|
||||
|
||||
static void
|
||||
edc_edit_set(app_data *ad, stats_data *sd, option_data *od)
|
||||
edc_edit_set(app_data *ad, stats_data *sd, config_data *cd)
|
||||
{
|
||||
edit_data *ed = edit_init(ad->panes, sd, od);
|
||||
edit_edc_read(ed, option_edc_path_get(od));
|
||||
edit_data *ed = edit_init(ad->panes, sd, cd);
|
||||
edit_edc_read(ed, config_edc_path_get(cd));
|
||||
elm_object_part_content_set(ad->panes, "right", edit_obj_get(ed));
|
||||
edit_part_changed_cb_set(ed, part_changed_cb, ad);
|
||||
ad->ed = ed;
|
||||
}
|
||||
|
||||
static void
|
||||
edc_view_set(app_data *ad, option_data *od, stats_data *sd)
|
||||
edc_view_set(app_data *ad, config_data *cd, stats_data *sd)
|
||||
{
|
||||
const char *group = edit_group_name_get(ad->ed);
|
||||
view_data *vd = view_init(ad->panes, group, sd, od);
|
||||
view_data *vd = view_init(ad->panes, group, sd, cd);
|
||||
elm_object_part_content_set(ad->panes, "left", view_obj_get(vd));
|
||||
ad->vd = vd;
|
||||
}
|
||||
|
||||
static void
|
||||
statusbar_set(app_data *ad, option_data *od)
|
||||
statusbar_set(app_data *ad, config_data *cd)
|
||||
{
|
||||
stats_data *sd = stats_init(ad->layout, od);
|
||||
stats_data *sd = stats_init(ad->layout, cd);
|
||||
elm_object_part_content_set(ad->layout, "elm.swallow.statusbar",
|
||||
stats_obj_get(sd));
|
||||
ad->sd = sd;
|
||||
option_stats_bar_set(ad->od, EINA_TRUE);
|
||||
config_stats_bar_set(ad->cd, EINA_TRUE);
|
||||
statusbar_toggle(ad);
|
||||
}
|
||||
|
||||
static void
|
||||
option_update_cb(void *data, option_data *od)
|
||||
config_update_cb(void *data, config_data *cd)
|
||||
{
|
||||
app_data *ad = data;
|
||||
edje_cc_cmd_set(od);
|
||||
edje_cc_cmd_set(cd);
|
||||
edit_line_number_toggle(ad->ed);
|
||||
edit_font_size_update(ad->ed);
|
||||
statusbar_toggle(ad);
|
||||
|
@ -351,7 +351,7 @@ option_update_cb(void *data, option_data *od)
|
|||
view_new(ad->vd, edit_group_name_get(ad->ed));
|
||||
part_changed_cb(ad, NULL);
|
||||
if (ad->edc_monitor) eio_monitor_del(ad->edc_monitor);
|
||||
ad->edc_monitor = eio_monitor_add(option_edc_path_get(ad->od));
|
||||
ad->edc_monitor = eio_monitor_add(config_edc_path_get(ad->cd));
|
||||
}
|
||||
//If the edc is reloaded, then rebuild it!
|
||||
else if (edit_changed_get(ad->ed))
|
||||
|
@ -422,9 +422,9 @@ config_data_set(app_data *ad, int argc, char **argv)
|
|||
char snd_path[PATH_MAX];
|
||||
|
||||
args_dispatch(argc, argv, edc_path, img_path, snd_path);
|
||||
option_data *od = option_init(edc_path, img_path, snd_path);
|
||||
option_update_cb_set(od, option_update_cb, ad);
|
||||
ad->od = od;
|
||||
config_data *cd = config_init(edc_path, img_path, snd_path);
|
||||
config_update_cb_set(cd, config_update_cb, ad);
|
||||
ad->cd = cd;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -467,16 +467,16 @@ init(app_data *ad, int argc, char **argv)
|
|||
elm_setup();
|
||||
config_data_set(ad, argc, argv);
|
||||
|
||||
if (!edje_cc_cmd_set(ad->od)) return EINA_FALSE;
|
||||
if (!edc_proto_setup(ad->od)) return EINA_FALSE;
|
||||
if (!edje_cc_cmd_set(ad->cd)) return EINA_FALSE;
|
||||
if (!edc_proto_setup(ad->cd)) return EINA_FALSE;
|
||||
if (!base_gui_construct(ad)) return EINA_FALSE;
|
||||
|
||||
statusbar_set(ad, ad->od);
|
||||
edc_edit_set(ad, ad->sd, ad->od);
|
||||
edc_view_set(ad, ad->od, ad->sd);
|
||||
ad->md = menu_init(ad->win, ad->ed, ad->od, ad->vd, menu_close_cb, ad);
|
||||
statusbar_set(ad, ad->cd);
|
||||
edc_edit_set(ad, ad->sd, ad->cd);
|
||||
edc_view_set(ad, ad->cd, ad->sd);
|
||||
ad->md = menu_init(ad->win, ad->ed, ad->cd, ad->vd, menu_close_cb, ad);
|
||||
|
||||
ad->edc_monitor = eio_monitor_add(option_edc_path_get(ad->od));
|
||||
ad->edc_monitor = eio_monitor_add(config_edc_path_get(ad->cd));
|
||||
ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, edc_changed_cb, ad);
|
||||
|
||||
return EINA_TRUE;
|
||||
|
@ -489,7 +489,7 @@ term(app_data *ad)
|
|||
view_term(ad->vd);
|
||||
edit_term(ad->ed);
|
||||
stats_term(ad->sd);
|
||||
option_term(ad->od);
|
||||
config_term(ad->cd);
|
||||
|
||||
elm_shutdown();
|
||||
ecore_event_shutdown();
|
||||
|
|
|
@ -23,7 +23,7 @@ struct menu_s
|
|||
void (*close_cb)(void *data);
|
||||
void *close_cb_data;
|
||||
|
||||
option_data *od;
|
||||
config_data *cd;
|
||||
edit_data *ed;
|
||||
view_data *vd;
|
||||
|
||||
|
@ -196,18 +196,18 @@ setting_apply_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
menu_data *md = data;
|
||||
option_data *od = md->od;
|
||||
config_data *cd = md->cd;
|
||||
|
||||
option_edc_img_path_set(od, elm_object_text_get(md->img_path_entry));
|
||||
option_edc_snd_path_set(od, elm_object_text_get(md->snd_path_entry));
|
||||
option_font_size_set(od, (float) elm_slider_value_get(md->slider_font));
|
||||
option_stats_bar_set(od, elm_check_state_get(md->toggle_stats));
|
||||
option_linenumber_set(od, elm_check_state_get(md->toggle_linenumber));
|
||||
option_part_highlight_set(od, elm_check_state_get(md->toggle_highlight));
|
||||
option_dummy_swallow_set(od, elm_check_state_get(md->toggle_swallow));
|
||||
option_auto_indent_set(od, elm_check_state_get(md->toggle_indent));
|
||||
config_edc_img_path_set(cd, elm_object_text_get(md->img_path_entry));
|
||||
config_edc_snd_path_set(cd, elm_object_text_get(md->snd_path_entry));
|
||||
config_font_size_set(cd, (float) elm_slider_value_get(md->slider_font));
|
||||
config_stats_bar_set(cd, elm_check_state_get(md->toggle_stats));
|
||||
config_linenumber_set(cd, elm_check_state_get(md->toggle_linenumber));
|
||||
config_part_highlight_set(cd, elm_check_state_get(md->toggle_highlight));
|
||||
config_dummy_swallow_set(cd, elm_check_state_get(md->toggle_swallow));
|
||||
config_auto_indent_set(cd, elm_check_state_get(md->toggle_indent));
|
||||
|
||||
option_apply(od);
|
||||
config_apply(cd);
|
||||
|
||||
setting_close(md);
|
||||
}
|
||||
|
@ -245,19 +245,19 @@ setting_reset_btn_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
menu_data *md = data;
|
||||
option_data *od = md->od;
|
||||
config_data *cd = md->cd;
|
||||
|
||||
img_path_entry_update(md->img_path_entry,
|
||||
(Eina_List *)option_edc_img_path_list_get(md->od));
|
||||
(Eina_List *)config_edc_img_path_list_get(md->cd));
|
||||
snd_path_entry_update(md->snd_path_entry,
|
||||
(Eina_List *)option_edc_snd_path_list_get(md->od));
|
||||
elm_slider_value_set(md->slider_font, (double) option_font_size_get(od));
|
||||
(Eina_List *)config_edc_snd_path_list_get(md->cd));
|
||||
elm_slider_value_set(md->slider_font, (double) config_font_size_get(cd));
|
||||
|
||||
elm_check_state_set(md->toggle_stats, option_stats_bar_get(od));
|
||||
elm_check_state_set(md->toggle_linenumber, option_linenumber_get(od));
|
||||
elm_check_state_set(md->toggle_highlight, option_part_highlight_get(od));
|
||||
elm_check_state_set(md->toggle_swallow, option_dummy_swallow_get(od));
|
||||
elm_check_state_set(md->toggle_indent, option_auto_indent_get(od));
|
||||
elm_check_state_set(md->toggle_stats, config_stats_bar_get(cd));
|
||||
elm_check_state_set(md->toggle_linenumber, config_linenumber_get(cd));
|
||||
elm_check_state_set(md->toggle_highlight, config_part_highlight_get(cd));
|
||||
elm_check_state_set(md->toggle_swallow, config_dummy_swallow_get(cd));
|
||||
elm_check_state_set(md->toggle_indent, config_auto_indent_get(cd));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -278,7 +278,7 @@ setting_open(menu_data *md)
|
|||
elm_entry_single_line_set(img_path_entry, EINA_TRUE);
|
||||
elm_entry_scrollable_set(img_path_entry, EINA_TRUE);
|
||||
img_path_entry_update(img_path_entry,
|
||||
(Eina_List *)option_edc_img_path_list_get(md->od));
|
||||
(Eina_List *)config_edc_img_path_list_get(md->cd));
|
||||
evas_object_show(img_path_entry);
|
||||
elm_object_focus_set(img_path_entry, EINA_TRUE);
|
||||
|
||||
|
@ -291,7 +291,7 @@ setting_open(menu_data *md)
|
|||
elm_entry_single_line_set(snd_path_entry, EINA_TRUE);
|
||||
elm_entry_scrollable_set(snd_path_entry, EINA_TRUE);
|
||||
snd_path_entry_update(snd_path_entry,
|
||||
(Eina_List *)option_edc_snd_path_list_get(md->od));
|
||||
(Eina_List *)config_edc_snd_path_list_get(md->cd));
|
||||
evas_object_show(snd_path_entry);
|
||||
|
||||
elm_object_part_content_set(layout, "elm.swallow.snd_path_entry",
|
||||
|
@ -337,7 +337,7 @@ setting_open(menu_data *md)
|
|||
elm_slider_indicator_show_set(slider, EINA_FALSE);
|
||||
elm_slider_unit_format_set(slider, "%1.1fx");
|
||||
elm_slider_min_max_set(slider, MIN_FONT_SIZE, MAX_FONT_SIZE);
|
||||
elm_slider_value_set(slider, (double) option_font_size_get(md->od));
|
||||
elm_slider_value_set(slider, (double) config_font_size_get(md->cd));
|
||||
evas_object_show(slider);
|
||||
|
||||
elm_box_pack_end(box2, slider);
|
||||
|
@ -369,7 +369,7 @@ setting_open(menu_data *md)
|
|||
//Toggle (Status bar)
|
||||
Evas_Object *toggle_stats = elm_check_add(box);
|
||||
elm_object_style_set(toggle_stats, "toggle");
|
||||
elm_check_state_set(toggle_stats, option_stats_bar_get(md->od));
|
||||
elm_check_state_set(toggle_stats, config_stats_bar_get(md->cd));
|
||||
evas_object_size_hint_weight_set(toggle_stats, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(toggle_stats, EVAS_HINT_FILL,
|
||||
|
@ -382,7 +382,7 @@ setting_open(menu_data *md)
|
|||
//Toggle (Line Number)
|
||||
Evas_Object *toggle_linenumber = elm_check_add(box);
|
||||
elm_object_style_set(toggle_linenumber, "toggle");
|
||||
elm_check_state_set(toggle_linenumber, option_linenumber_get(md->od));
|
||||
elm_check_state_set(toggle_linenumber, config_linenumber_get(md->cd));
|
||||
evas_object_size_hint_weight_set(toggle_linenumber, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(toggle_linenumber, EVAS_HINT_FILL,
|
||||
|
@ -395,7 +395,7 @@ setting_open(menu_data *md)
|
|||
//Toggle (Part Highlighting)
|
||||
Evas_Object *toggle_highlight = elm_check_add(box);
|
||||
elm_object_style_set(toggle_highlight, "toggle");
|
||||
elm_check_state_set(toggle_highlight, option_part_highlight_get(md->od));
|
||||
elm_check_state_set(toggle_highlight, config_part_highlight_get(md->cd));
|
||||
evas_object_size_hint_weight_set(toggle_highlight, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(toggle_highlight, EVAS_HINT_FILL,
|
||||
|
@ -408,7 +408,7 @@ setting_open(menu_data *md)
|
|||
//Toggle (Dummy Swallow)
|
||||
Evas_Object *toggle_swallow = elm_check_add(box);
|
||||
elm_object_style_set(toggle_swallow, "toggle");
|
||||
elm_check_state_set(toggle_swallow, option_dummy_swallow_get(md->od));
|
||||
elm_check_state_set(toggle_swallow, config_dummy_swallow_get(md->cd));
|
||||
evas_object_size_hint_weight_set(toggle_swallow, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(toggle_swallow, EVAS_HINT_FILL,
|
||||
|
@ -421,7 +421,7 @@ setting_open(menu_data *md)
|
|||
//Toggle (Auto Indentation)
|
||||
Evas_Object *toggle_indent = elm_check_add(box);
|
||||
elm_object_style_set(toggle_indent, "toggle");
|
||||
elm_check_state_set(toggle_indent, option_auto_indent_get(md->od));
|
||||
elm_check_state_set(toggle_indent, config_auto_indent_get(md->cd));
|
||||
evas_object_size_hint_weight_set(toggle_indent, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(toggle_indent, EVAS_HINT_FILL,
|
||||
|
@ -519,7 +519,7 @@ help_open(menu_data *md)
|
|||
|
||||
EINA_ITERATOR_FOREACH(itr, line)
|
||||
{
|
||||
//Append edc code
|
||||
//Append edc ccde
|
||||
if (line_num > 0)
|
||||
{
|
||||
if (!eina_strbuf_append(strbuf, "<br/>")) goto err;
|
||||
|
@ -635,10 +635,10 @@ btn_effect_timer_cb(void *data)
|
|||
static void
|
||||
edc_reload(menu_data *md, const char *edc_path)
|
||||
{
|
||||
option_edc_path_set(md->od, edc_path);
|
||||
config_edc_path_set(md->cd, edc_path);
|
||||
edit_new(md->ed);
|
||||
view_reload_need_set(md->vd, EINA_TRUE);
|
||||
option_apply(md->od);
|
||||
config_apply(md->cd);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -720,10 +720,10 @@ fileselector_save_done_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
//Update the edc file and try to save.
|
||||
if (strcmp(option_edc_path_get(md->od), selected))
|
||||
if (strcmp(config_edc_path_get(md->cd), selected))
|
||||
edit_changed_set(md->ed, EINA_TRUE);
|
||||
|
||||
option_edc_path_set(md->od, selected);
|
||||
config_edc_path_set(md->cd, selected);
|
||||
|
||||
if (!edit_save(md->ed))
|
||||
{
|
||||
|
@ -737,7 +737,7 @@ fileselector_save_done_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
view_reload_need_set(md->vd, EINA_TRUE);
|
||||
option_apply(md->od);
|
||||
config_apply(md->cd);
|
||||
|
||||
fileselector_close(md);
|
||||
menu_close(md, EINA_FALSE);
|
||||
|
@ -969,13 +969,13 @@ menu_open(menu_data *md)
|
|||
}
|
||||
|
||||
menu_data *
|
||||
menu_init(Evas_Object *win, edit_data *ed, option_data *od, view_data *vd,
|
||||
menu_init(Evas_Object *win, edit_data *ed, config_data *cd, view_data *vd,
|
||||
void (*close_cb)(void *data), void *data)
|
||||
{
|
||||
menu_data *md = calloc(1, sizeof(menu_data));
|
||||
md->win = win;
|
||||
md->ed = ed;
|
||||
md->od = od;
|
||||
md->cd = cd;
|
||||
md->vd = vd;
|
||||
md->close_cb = close_cb;
|
||||
md->close_cb_data = data;
|
||||
|
@ -991,7 +991,7 @@ menu_term(menu_data *md)
|
|||
}
|
||||
|
||||
Eina_Bool
|
||||
menu_option_toggle()
|
||||
menu_toggle()
|
||||
{
|
||||
menu_data *md = g_md;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
struct statusbar_s
|
||||
{
|
||||
Evas_Object *layout;
|
||||
option_data *od;
|
||||
config_data *cd;
|
||||
};
|
||||
|
||||
void
|
||||
|
@ -20,13 +20,13 @@ void
|
|||
stats_edc_file_set(stats_data *sd, const char *group_name)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
const char *filename = ecore_file_file_get(option_edc_path_get(sd->od));
|
||||
const char *filename = ecore_file_file_get(config_edc_path_get(sd->cd));
|
||||
snprintf(buf, sizeof(buf), "<align=right>File [<color=#000000>%s</color>] Group [<color=#000000>%s</color>]</align>", filename, group_name);
|
||||
elm_object_part_text_set(sd->layout, "elm.text.file_group_name", buf);
|
||||
}
|
||||
|
||||
stats_data *
|
||||
stats_init(Evas_Object *parent, option_data *od)
|
||||
stats_init(Evas_Object *parent, config_data *cd)
|
||||
{
|
||||
stats_data *sd = calloc(1, sizeof(stats_data));
|
||||
|
||||
|
@ -39,7 +39,7 @@ stats_init(Evas_Object *parent, option_data *od)
|
|||
"Cursor [<color=#000000>0</color>,<color=#000000>0</color>] [<color=#000000>0.00</color>,<color=#000000>0.00</color>]");
|
||||
|
||||
sd->layout = layout;
|
||||
sd->od = od;
|
||||
sd->cd = cd;
|
||||
|
||||
stats_edc_file_set(sd, NULL);
|
||||
|
||||
|
@ -62,7 +62,7 @@ stats_term(stats_data *sd)
|
|||
void
|
||||
stats_info_msg_update(stats_data *sd, const char *msg)
|
||||
{
|
||||
if (!option_stats_bar_get(sd->od)) return;
|
||||
if (!config_stats_bar_get(sd->cd)) return;
|
||||
|
||||
elm_object_part_text_set(sd->layout, "elm.text.info_msg", msg);
|
||||
elm_object_signal_emit(sd->layout, "elm,action,info_msg,show", "");
|
||||
|
@ -72,7 +72,7 @@ void
|
|||
stats_view_size_update(stats_data *sd)
|
||||
{
|
||||
Evas_Coord w, h;
|
||||
option_view_size_get(sd->od, &w, &h);
|
||||
config_view_size_get(sd->cd, &w, &h);
|
||||
|
||||
char buf[128];
|
||||
snprintf(buf, sizeof(buf),
|
||||
|
|
|
@ -33,7 +33,7 @@ typedef struct app_s app_data;
|
|||
typedef struct statusbar_s stats_data;
|
||||
typedef struct editor_s edit_data;
|
||||
typedef struct syntax_color_s color_data;
|
||||
typedef struct config_s option_data;
|
||||
typedef struct config_s config_data;
|
||||
typedef struct parser_s parser_data;
|
||||
typedef struct attr_value_s attr_value;
|
||||
typedef struct dummy_obj_s dummy_obj;
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
option_data *option_init(const char *edc_path, const char *edc_img_path,
|
||||
config_data *config_init(const char *edc_path, const char *edc_img_path,
|
||||
const char *edc_snd_path);
|
||||
void option_term(option_data *od);
|
||||
const char *option_edc_path_get(option_data *od);
|
||||
const char *option_edj_path_get(option_data *od);
|
||||
const char *option_edc_img_path_get(option_data *od);
|
||||
const char *option_edc_snd_path_get(option_data *od);
|
||||
void option_edc_img_path_set(option_data *od, const char *edc_img_path);
|
||||
void option_edc_snd_path_set(option_data *od, const char *edc_snd_path);
|
||||
const Eina_List *option_edc_img_path_list_get(option_data *od);
|
||||
const Eina_List *option_edc_snd_path_list_get(option_data *od);
|
||||
void option_update_cb_set(option_data *od,
|
||||
void (*cb)(void *data, option_data *od),
|
||||
void config_term(config_data *cd);
|
||||
const char *config_edc_path_get(config_data *cd);
|
||||
const char *config_edj_path_get(config_data *cd);
|
||||
const char *config_edc_img_path_get(config_data *cd);
|
||||
const char *config_edc_snd_path_get(config_data *cd);
|
||||
void config_edc_img_path_set(config_data *cd, const char *edc_img_path);
|
||||
void config_edc_snd_path_set(config_data *cd, const char *edc_snd_path);
|
||||
const Eina_List *config_edc_img_path_list_get(config_data *cd);
|
||||
const Eina_List *config_edc_snd_path_list_get(config_data *cd);
|
||||
void config_update_cb_set(config_data *cd,
|
||||
void (*cb)(void *data, config_data *cd),
|
||||
void *data);
|
||||
void option_stats_bar_set(option_data *od, Eina_Bool enabled);
|
||||
void option_linenumber_set(option_data *od, Eina_Bool enabled);
|
||||
Eina_Bool option_stats_bar_get(option_data *od);
|
||||
Eina_Bool option_linenumber_get(option_data *od);
|
||||
void option_apply(option_data *od);
|
||||
void option_edc_path_set(option_data *od, const char *edc_path);
|
||||
void option_view_size_get(option_data *od, Evas_Coord *w, Evas_Coord *h);
|
||||
void option_view_size_set(option_data *od, Evas_Coord w, Evas_Coord h);
|
||||
Eina_Bool option_part_highlight_get(option_data *od);
|
||||
void option_part_highlight_set(option_data *od, Eina_Bool highlight);
|
||||
Eina_Bool option_dummy_swallow_get(option_data *od);
|
||||
void option_dummy_swallow_set(option_data *od, Eina_Bool dummy_swallow);
|
||||
void option_auto_indent_set(option_data *od, Eina_Bool auto_indent);
|
||||
Eina_Bool option_auto_indent_get(option_data *od);
|
||||
void option_font_size_set(option_data *od, float font_size);
|
||||
float option_font_size_get(option_data *od);
|
||||
void config_stats_bar_set(config_data *cd, Eina_Bool enabled);
|
||||
void config_linenumber_set(config_data *cd, Eina_Bool enabled);
|
||||
Eina_Bool config_stats_bar_get(config_data *cd);
|
||||
Eina_Bool config_linenumber_get(config_data *cd);
|
||||
void config_apply(config_data *cd);
|
||||
void config_edc_path_set(config_data *cd, const char *edc_path);
|
||||
void config_view_size_get(config_data *cd, Evas_Coord *w, Evas_Coord *h);
|
||||
void config_view_size_set(config_data *cd, Evas_Coord w, Evas_Coord h);
|
||||
Eina_Bool config_part_highlight_get(config_data *cd);
|
||||
void config_part_highlight_set(config_data *cd, Eina_Bool highlight);
|
||||
Eina_Bool config_dummy_swallow_get(config_data *cd);
|
||||
void config_dummy_swallow_set(config_data *cd, Eina_Bool dummy_swallow);
|
||||
void config_auto_indent_set(config_data *cd, Eina_Bool auto_indent);
|
||||
Eina_Bool config_auto_indent_get(config_data *cd);
|
||||
void config_font_size_set(config_data *cd, float font_size);
|
||||
float config_font_size_get(config_data *cd);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
edit_data *edit_init(Evas_Object *win, stats_data *sd, option_data *od);
|
||||
edit_data *edit_init(Evas_Object *win, stats_data *sd, config_data *cd);
|
||||
void edit_term(edit_data *ed);
|
||||
void edit_edc_read(edit_data *ed, const char *file_path);
|
||||
void edit_focus_set(edit_data *ed);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
view_data * view_init(Evas_Object *parent, const char *group, stats_data *sd,
|
||||
option_data *od);
|
||||
config_data *cd);
|
||||
void view_term(view_data *vd);
|
||||
Evas_Object *view_obj_get(view_data *vd);
|
||||
void view_new(view_data *vd, const char *group);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
menu_data *menu_init(Evas_Object *win, edit_data *ed, option_data *od, view_data *vd, void (*close_cb)(void *data), void *data);
|
||||
menu_data *menu_init(Evas_Object *win, edit_data *ed, config_data *cd, view_data *vd, void (*close_cb)(void *data), void *data);
|
||||
void menu_term(menu_data *md);
|
||||
Eina_Bool menu_option_toggle();
|
||||
Eina_Bool menu_toggle();
|
||||
void menu_ctxpopup_register(Evas_Object *ctxpopup);
|
||||
Eina_Bool menu_edc_load(menu_data *md);
|
||||
void menu_exit(menu_data *md);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
stats_data *stats_init(Evas_Object *parent, option_data *od);
|
||||
stats_data *stats_init(Evas_Object *parent, config_data *cd);
|
||||
void stats_term(stats_data *sd);
|
||||
void stats_view_size_update(stats_data *sd);
|
||||
void stats_cursor_pos_update(stats_data *sd, Evas_Coord x, Evas_Coord y,
|
||||
|
|
Loading…
Reference in New Issue