multi-file: redoundo implemtation.
Still a lots of changes required... >.<
This commit is contained in:
parent
e58c6c7600
commit
6780f25ad4
|
@ -38,7 +38,11 @@ warning_ignore_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
file_mgr_data *fmd = data;
|
||||
enventor_object_modified_set(base_enventor_get(), EINA_TRUE);
|
||||
|
||||
//FIXME: Specify which file has been changed?
|
||||
Enventor_Item *it = enventor_object_focused_item_get(base_enventor_get());
|
||||
enventor_item_modified_set(it, EINA_TRUE);
|
||||
|
||||
warning_close(fmd);
|
||||
}
|
||||
|
||||
|
@ -47,7 +51,11 @@ warning_save_as_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
file_mgr_data *fmd = data;
|
||||
enventor_object_modified_set(base_enventor_get(), EINA_TRUE);
|
||||
|
||||
//FIXME: Sepcify which file has been changed?
|
||||
Enventor_Item *it = enventor_object_focused_item_get(base_enventor_get());
|
||||
enventor_item_modified_set(it, EINA_TRUE);
|
||||
|
||||
menu_edc_save();
|
||||
warning_close(fmd);
|
||||
}
|
||||
|
@ -57,7 +65,10 @@ warning_replace_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
file_mgr_data *fmd = data;
|
||||
|
||||
//FIXME: Specify which file has been changed?
|
||||
file_mgr_main_file_set(config_input_path_get());
|
||||
|
||||
warning_close(fmd);
|
||||
}
|
||||
|
||||
|
@ -284,6 +295,7 @@ file_mgr_save_all(void)
|
|||
it = file_mgr_main_item_get();
|
||||
if (!enventor_item_file_save(it, NULL)) ret = EINA_FALSE;
|
||||
|
||||
//Sub files.
|
||||
Eina_List *l;
|
||||
Eina_List *sub_its =
|
||||
(Eina_List *) enventor_object_sub_items_get(base_enventor_get());
|
||||
|
@ -302,3 +314,27 @@ file_mgr_main_item_get(void)
|
|||
{
|
||||
return enventor_object_main_item_get(base_enventor_get());
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
file_mgr_modified_get(void)
|
||||
{
|
||||
file_mgr_data *fmd = g_fmd;
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(fmd, EINA_FALSE);
|
||||
|
||||
Enventor_Item *it;
|
||||
|
||||
//Main file.
|
||||
it = file_mgr_main_item_get();
|
||||
if (enventor_item_modified_get(it)) return EINA_TRUE;
|
||||
|
||||
//Sub files.
|
||||
Eina_List *l;
|
||||
Eina_List *sub_its =
|
||||
(Eina_List *) enventor_object_sub_items_get(base_enventor_get());
|
||||
EINA_LIST_FOREACH(sub_its, l, it)
|
||||
{
|
||||
if (enventor_item_modified_get(it)) return EINA_TRUE;
|
||||
}
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
|
|
@ -484,31 +484,37 @@ enventor_ctxpopup_activated_cb(void *data EINA_UNUSED,
|
|||
}
|
||||
|
||||
static void
|
||||
enventor_ctxpopup_changed_cb(void *data, Enventor_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
enventor_ctxpopup_changed_cb(void *data, Enventor_Object *obj EINA_UNUSED,
|
||||
void *event_info)
|
||||
{
|
||||
app_data *ad = data;
|
||||
Enventor_Item *it = event_info;
|
||||
|
||||
Enventor_Item *it = file_mgr_focused_item_get();
|
||||
if (!enventor_item_modified_get(it)) return;
|
||||
|
||||
if (!enventor_object_modified_get(obj)) return;
|
||||
//FIXME: Probably, this lazy stuff is broken.
|
||||
//These data should be up to items.
|
||||
if (ad->on_saving)
|
||||
{
|
||||
ad->lazy_save = EINA_TRUE;
|
||||
return;
|
||||
}
|
||||
ad->on_saving = EINA_TRUE;
|
||||
|
||||
enventor_item_file_save(it, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
enventor_live_view_updated_cb(void *data, Enventor_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
enventor_live_view_updated_cb(void *data, Enventor_Object *obj EINA_UNUSED,
|
||||
void *event_info)
|
||||
{
|
||||
app_data *ad = data;
|
||||
|
||||
Enventor_Item *it = file_mgr_focused_item_get();
|
||||
if (ad->lazy_save && enventor_object_modified_get(obj))
|
||||
Enventor_Item *it = event_info;
|
||||
|
||||
//FIXME: Probably, this lazy stuff is broken.
|
||||
//These data should be up to items.
|
||||
if (ad->lazy_save && enventor_item_modified_get(it))
|
||||
{
|
||||
enventor_item_file_save(it, NULL);
|
||||
ad->lazy_save = EINA_FALSE;
|
||||
|
@ -533,6 +539,7 @@ static void
|
|||
enventor_focused_cb(void *data EINA_UNUSED, Enventor_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
//FIXME: Get the all modified file list.
|
||||
if (file_mgr_edc_modified_get()) file_mgr_warning_open();
|
||||
}
|
||||
|
||||
|
|
|
@ -379,7 +379,7 @@ fileselector_save_done_cb(void *data, Evas_Object *obj, void *event_info)
|
|||
edj_pathes = eina_list_append(edj_pathes, selected);
|
||||
enventor_object_path_set(enventor, ENVENTOR_PATH_TYPE_EDJ,
|
||||
edj_pathes);
|
||||
enventor_object_modified_set(enventor, EINA_TRUE);
|
||||
enventor_item_modified_set(it, EINA_TRUE);
|
||||
enventor_item_file_save(it, NULL);
|
||||
eina_list_free(edj_pathes);
|
||||
}
|
||||
|
@ -667,7 +667,7 @@ menu_edc_load(void)
|
|||
menu_data *md = g_md;
|
||||
EINA_SAFETY_ON_NULL_RETURN(md);
|
||||
|
||||
if (enventor_object_modified_get(base_enventor_get()))
|
||||
if (file_mgr_modified_get())
|
||||
warning_open(md, load_yes_btn_cb, load_save_btn_cb);
|
||||
else
|
||||
edc_file_load(md);
|
||||
|
|
|
@ -12,3 +12,4 @@ Enventor_Item *file_mgr_focused_item_get(void);
|
|||
void file_mgr_file_focus(Enventor_Item *it);
|
||||
Eina_Bool file_mgr_save_all(void);
|
||||
Enventor_Item *file_mgr_main_item_get(void);
|
||||
Eina_Bool file_mgr_modified_get(void);
|
||||
|
|
|
@ -24,5 +24,7 @@ EAPI Eina_Bool enventor_item_text_insert(Enventor_Item *it, const char *text);
|
|||
EAPI const char * enventor_item_text_get(const Enventor_Item *it);
|
||||
EAPI Eina_Bool enventor_item_line_delete(Enventor_Item *it);
|
||||
EAPI Eina_Bool enventor_item_file_save(Enventor_Item *it, const char *file);
|
||||
EAPI Eina_Bool enventor_item_modified_get(const Enventor_Item *it);
|
||||
EAPI void enventor_item_modified_set(Enventor_Item *it, Eina_Bool modified);
|
||||
|
||||
#include "enventor_object.eo.legacy.h"
|
||||
|
|
|
@ -29,6 +29,7 @@ struct editor_s
|
|||
Evas_Object *layout;
|
||||
Evas_Object *ctxpopup;
|
||||
Enventor_Object *enventor;
|
||||
Enventor_Item *it;
|
||||
Eina_Stringshare *filepath;
|
||||
|
||||
syntax_helper *sh;
|
||||
|
@ -63,6 +64,7 @@ struct editor_s
|
|||
Eina_Bool on_select_recover : 1;
|
||||
Eina_Bool on_save : 1;
|
||||
Eina_Bool main : 1;
|
||||
Eina_Bool disabled : 1;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -524,7 +526,7 @@ ctxpopup_candidate_changed_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
|
||||
edit_changed_set(ed, EINA_TRUE);
|
||||
evas_object_smart_callback_call(ed->enventor, SIG_CTXPOPUP_CHANGED,
|
||||
(void *)text);
|
||||
ed->it);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -536,7 +538,8 @@ ctxpopup_preview_dismiss_cb(void *data, Evas_Object *obj,
|
|||
//Since the ctxpopup will be shown again, Don't revert the focus.
|
||||
elm_object_tree_focus_allow_set(ed->layout, EINA_TRUE);
|
||||
elm_object_focus_set(ed->en_edit, EINA_TRUE);
|
||||
evas_object_smart_callback_call(ed->enventor, SIG_CTXPOPUP_DISMISSED, NULL);
|
||||
evas_object_smart_callback_call(ed->enventor, SIG_CTXPOPUP_DISMISSED,
|
||||
ed->it);
|
||||
evas_object_del(obj);
|
||||
}
|
||||
|
||||
|
@ -1336,7 +1339,7 @@ edit_cur_indent_depth_get(edit_data *ed)
|
|||
}
|
||||
|
||||
edit_data *
|
||||
edit_init(Enventor_Object *enventor, Eina_Bool main)
|
||||
edit_init(Enventor_Object *enventor, Enventor_Item *it)
|
||||
{
|
||||
edit_data *ed = calloc(1, sizeof(edit_data));
|
||||
if (!ed)
|
||||
|
@ -1418,12 +1421,12 @@ edit_init(Enventor_Object *enventor, Eina_Bool main)
|
|||
ed->en_edit = en_edit;
|
||||
ed->layout = layout;
|
||||
ed->enventor = enventor;
|
||||
ed->it = it;
|
||||
ed->cur_line = -1;
|
||||
ed->select_pos = -1;
|
||||
ed->pd = parser_init();
|
||||
ed->rd = redoundo_init(ed, enventor);
|
||||
ed->sh = syntax_init(ed);
|
||||
ed->main = main;
|
||||
|
||||
return ed;
|
||||
}
|
||||
|
@ -1674,6 +1677,10 @@ edit_disabled_set(edit_data *ed, Eina_Bool disabled)
|
|||
//Turn off the part highlight in case of disable.
|
||||
if (disabled) view_part_highlight_set(VIEW_DATA, NULL);
|
||||
else if (enventor_obj_part_highlight_get(ed->enventor)) edit_view_sync(ed);
|
||||
|
||||
//Reset whatever ctrl pressed is on.
|
||||
ed->ctrl_pressed = EINA_FALSE;
|
||||
ed->disabled = disabled;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1717,6 +1724,7 @@ edit_redoundo(edit_data *ed, Eina_Bool undo)
|
|||
Eina_Bool
|
||||
edit_key_down_event_dispatch(edit_data *ed, const char *key)
|
||||
{
|
||||
if (ed->disabled) return EINA_FALSE;
|
||||
//Control Key
|
||||
if (!strcmp("Control_L", key))
|
||||
{
|
||||
|
@ -1746,6 +1754,8 @@ edit_key_down_event_dispatch(edit_data *ed, const char *key)
|
|||
Eina_Bool
|
||||
edit_key_up_event_dispatch(edit_data *ed, const char *key)
|
||||
{
|
||||
if (ed->disabled) return EINA_FALSE;
|
||||
|
||||
//Control Key
|
||||
if (!strcmp("Control_L", key))
|
||||
ed->ctrl_pressed = EINA_FALSE;
|
||||
|
@ -1833,5 +1843,11 @@ edit_text_get(edit_data *ed)
|
|||
Eina_Bool
|
||||
edit_is_main_file(edit_data *ed)
|
||||
{
|
||||
return ed->main;
|
||||
return (enventor_object_main_item_get(ed->enventor) == ed->it);
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
edit_focus_get(edit_data *ed)
|
||||
{
|
||||
return elm_object_focus_get(ed->en_edit);
|
||||
}
|
||||
|
|
|
@ -1306,13 +1306,11 @@ end_of_parts_block_find(const char *pos)
|
|||
static const char *
|
||||
group_beginning_pos_get(const char* source, const char *group_name)
|
||||
{
|
||||
if (!group_name) return NULL;
|
||||
|
||||
const char* GROUP_SYNTAX_NAME = "group";
|
||||
const char *quot = QUOT_UTF8;
|
||||
const int quot_len = QUOT_UTF8_LEN;
|
||||
|
||||
const char *pos = strstr(source, GROUP_SYNTAX_NAME);
|
||||
int group_name_len = strlen(group_name);
|
||||
|
||||
//TODO: Process comments and quotes.
|
||||
while (pos)
|
||||
|
@ -1322,7 +1320,7 @@ group_beginning_pos_get(const char* source, const char *group_name)
|
|||
name += quot_len;
|
||||
pos = strstr(name, quot);
|
||||
if (!pos) return NULL;
|
||||
if (!strncmp(name, group_name, group_name_len))
|
||||
if (!strncmp(name, group_name, 5))
|
||||
return pos;
|
||||
pos = strstr(++pos, GROUP_SYNTAX_NAME);
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ edj_mgr_view_del(view_data *vd)
|
|||
}
|
||||
|
||||
view_data *
|
||||
edj_mgr_view_new(const char *group)
|
||||
edj_mgr_view_new(Enventor_Item *it, const char *group)
|
||||
{
|
||||
edj_mgr *em = g_em;
|
||||
|
||||
|
@ -141,7 +141,7 @@ edj_mgr_view_new(const char *group)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
view_data *vd = view_init(em->enventor, group, view_del_cb, edj);
|
||||
view_data *vd = view_init(em->enventor, it, group, view_del_cb, edj);
|
||||
if (!vd)
|
||||
{
|
||||
free(edj);
|
||||
|
|
|
@ -16,6 +16,7 @@ struct viewer_s
|
|||
Evas_Object *scroller;
|
||||
Evas_Object *event_rect;
|
||||
Enventor_Object *enventor;
|
||||
Enventor_Item *it;
|
||||
|
||||
Evas_Object *part_obj;
|
||||
Evas_Object *part_highlight;
|
||||
|
@ -181,8 +182,7 @@ view_obj_create_post_job(view_data *vd)
|
|||
|
||||
view_obj_parts_callbacks_set(vd);
|
||||
|
||||
evas_object_smart_callback_call(vd->enventor, SIG_LIVE_VIEW_LOADED,
|
||||
(void*)edj_mgr_obj_get());
|
||||
evas_object_smart_callback_call(vd->enventor, SIG_LIVE_VIEW_LOADED, vd->it);
|
||||
view_images_monitor_set(vd);
|
||||
}
|
||||
|
||||
|
@ -383,8 +383,7 @@ update_edj_file_internal(view_data *vd)
|
|||
vd->edj_reload_need = EINA_FALSE;
|
||||
vd->file_set_finished = EINA_TRUE;
|
||||
|
||||
evas_object_smart_callback_call(vd->enventor, SIG_LIVE_VIEW_UPDATED,
|
||||
edj_mgr_obj_get());
|
||||
evas_object_smart_callback_call(vd->enventor, SIG_LIVE_VIEW_UPDATED, vd->it);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
|
@ -604,7 +603,7 @@ view_wireframes_set(view_data *vd, Eina_Bool wireframes)
|
|||
}
|
||||
|
||||
view_data *
|
||||
view_init(Enventor_Object *enventor, const char *group,
|
||||
view_init(Enventor_Object *enventor, Enventor_Item *it, const char *group,
|
||||
void (*del_cb)(void *data), void *data)
|
||||
{
|
||||
view_data *vd = calloc(1, sizeof(view_data));
|
||||
|
@ -614,6 +613,7 @@ view_init(Enventor_Object *enventor, const char *group,
|
|||
return NULL;
|
||||
}
|
||||
vd->enventor = enventor;
|
||||
vd->it = it;
|
||||
vd->scroller = view_scroller_create(enventor);
|
||||
|
||||
vd->group_name = eina_stringshare_add(group);
|
||||
|
|
|
@ -88,15 +88,6 @@ class Enventor.Object (Elm.Widget, Efl.File) {
|
|||
focus: bool;
|
||||
}
|
||||
}
|
||||
@property modified {
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
modified: bool;
|
||||
}
|
||||
}
|
||||
@property font_scale {
|
||||
set {
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ void wireframes_obj_update(Evas_Object *layout);
|
|||
/* edj_mgr */
|
||||
void edj_mgr_init(Enventor_Object *enventor);
|
||||
void edj_mgr_term(void);
|
||||
view_data * edj_mgr_view_new(const char *group);
|
||||
view_data * edj_mgr_view_new(Enventor_Item *it, const char *group);
|
||||
view_data *edj_mgr_view_get(Eina_Stringshare *group);
|
||||
Evas_Object * edj_mgr_obj_get(void);
|
||||
view_data *edj_mgr_view_switch_to(view_data *vd);
|
||||
|
@ -196,7 +196,7 @@ void redoundo_diff_buildable(redoundo_data *rd, Eina_Bool buildable);
|
|||
|
||||
|
||||
/* edj_viewer */
|
||||
view_data * view_init(Enventor_Object *enventor, const char *group, void (*del_cb)(void *data), void *data);
|
||||
view_data * view_init(Enventor_Object *enventor, Enventor_Item *it, const char *group, void (*del_cb)(void *data), void *data);
|
||||
void view_term(view_data *vd);
|
||||
Evas_Object *view_obj_get(view_data *vd);
|
||||
void view_new(view_data *vd, const char *group);
|
||||
|
@ -237,7 +237,7 @@ void ctxpopup_img_preview_reload(Evas_Object *ctxpopup, const char *imgpath);
|
|||
void edit_font_update(edit_data *ed);
|
||||
Eina_Bool edit_key_down_event_dispatch(edit_data *ed, const char *key);
|
||||
Eina_Bool edit_key_up_event_dispatch(edit_data *ed, const char *key);
|
||||
edit_data *edit_init(Enventor_Object *enventor, Eina_Bool main);
|
||||
edit_data *edit_init(Enventor_Object *enventor, Enventor_Item *it);
|
||||
void edit_term(edit_data *ed);
|
||||
Evas_Object *edit_obj_get(edit_data *ed);
|
||||
Eina_Bool edit_changed_get(edit_data *ed);
|
||||
|
@ -283,6 +283,7 @@ void edit_cursor_pos_set(edit_data *ed, int position);
|
|||
int edit_cursor_pos_get(edit_data *ed);
|
||||
const char *edit_selection_get(edit_data *ed);
|
||||
Eina_Bool edit_is_main_file(edit_data *ed);
|
||||
Eina_Bool edit_focus_get(edit_data *ed);
|
||||
|
||||
/* util */
|
||||
void mem_fail_msg(void);
|
||||
|
|
|
@ -93,7 +93,7 @@ key_up_cb(void *data, int type EINA_UNUSED, void *ev)
|
|||
Enventor_Object_Data *pd = data;
|
||||
Ecore_Event_Key *event = ev;
|
||||
|
||||
edit_key_up_event_dispatch(pd->main_it.ed, event->key);
|
||||
edit_key_up_event_dispatch(pd->focused_it->ed, event->key);
|
||||
|
||||
return ECORE_CALLBACK_DONE;
|
||||
}
|
||||
|
@ -103,10 +103,10 @@ key_down_cb(void *data, int type EINA_UNUSED, void *ev)
|
|||
{
|
||||
Enventor_Object_Data *pd = data;
|
||||
Ecore_Event_Key *event = ev;
|
||||
Eina_Bool ret = enventor_object_focus_get(pd->obj);
|
||||
Eina_Bool ret = edit_focus_get(pd->focused_it->ed);
|
||||
if (!ret) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
if (edit_key_down_event_dispatch(pd->main_it.ed, event->key))
|
||||
if (edit_key_down_event_dispatch(pd->focused_it->ed, event->key))
|
||||
return ECORE_CALLBACK_DONE;
|
||||
|
||||
if (autocomp_event_dispatch(event->key))
|
||||
|
@ -119,7 +119,8 @@ static void
|
|||
edit_view_sync_cb(void *data, Eina_Stringshare *state_name, double state_value,
|
||||
Eina_Stringshare *part_name, Eina_Stringshare *group_name)
|
||||
{
|
||||
Enventor_Object_Data *pd = data;
|
||||
Enventor_Item *it = data;
|
||||
Enventor_Object_Data *pd = it->pd;
|
||||
|
||||
edj_mgr_all_views_reload();
|
||||
|
||||
|
@ -130,7 +131,7 @@ edit_view_sync_cb(void *data, Eina_Stringshare *state_name, double state_value,
|
|||
if (vd) edj_mgr_view_switch_to(vd);
|
||||
else
|
||||
{
|
||||
vd = edj_mgr_view_new(group_name);
|
||||
vd = edj_mgr_view_new(it, group_name);
|
||||
if (!vd) return;
|
||||
}
|
||||
view_dummy_set(vd, pd->dummy_parts);
|
||||
|
@ -476,21 +477,6 @@ _enventor_object_auto_complete_list_show(Eo *obj EINA_UNUSED,
|
|||
autocomp_list_show();
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_enventor_object_modified_set(Eo *obj EINA_UNUSED, Enventor_Object_Data *pd,
|
||||
Eina_Bool modified)
|
||||
{
|
||||
//Main Item
|
||||
edit_changed_set(pd->main_it.ed, modified);
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_enventor_object_modified_get(Eo *obj EINA_UNUSED, Enventor_Object_Data *pd)
|
||||
{
|
||||
//Main Item
|
||||
return edit_changed_get(pd->main_it.ed);
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_enventor_object_path_set(Eo *obj EINA_UNUSED,
|
||||
Enventor_Object_Data *pd EINA_UNUSED,
|
||||
|
@ -665,7 +651,7 @@ _enventor_object_focus_set(Eo *obj EINA_UNUSED,
|
|||
EOLIAN static Eina_Bool
|
||||
_enventor_object_focus_get(Eo *obj EINA_UNUSED, Enventor_Object_Data *pd)
|
||||
{
|
||||
return elm_object_focus_get(edit_entry_get(pd->main_it.ed));
|
||||
return edit_focus_get(pd->focused_it->ed);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
|
@ -865,11 +851,12 @@ enventor_object_sub_item_add(Enventor_Object *obj, const char *file)
|
|||
|
||||
pd->sub_its = eina_list_append(pd->sub_its, it);
|
||||
|
||||
it->ed = edit_init(obj, EINA_FALSE);
|
||||
it->ed = edit_init(obj, it);
|
||||
it->pd = pd;
|
||||
|
||||
edit_load(it->ed, file);
|
||||
edit_changed_set(it->ed, EINA_FALSE);
|
||||
edit_disabled_set(it->ed, EINA_TRUE);
|
||||
|
||||
return it;
|
||||
}
|
||||
|
@ -885,8 +872,8 @@ enventor_object_main_item_set(Enventor_Object *obj, const char *file)
|
|||
_enventor_main_item_free(pd);
|
||||
|
||||
pd->main_it.pd = pd;
|
||||
pd->main_it.ed = edit_init(obj, EINA_TRUE);
|
||||
edit_view_sync_cb_set(pd->main_it.ed, edit_view_sync_cb, pd);
|
||||
pd->main_it.ed = edit_init(obj, &pd->main_it);
|
||||
edit_view_sync_cb_set(pd->main_it.ed, edit_view_sync_cb, &pd->main_it);
|
||||
pd->focused_it = &pd->main_it;
|
||||
|
||||
Eina_Bool ret = efl_file_set(obj, file, NULL);
|
||||
|
@ -927,7 +914,7 @@ enventor_item_focus_set(Enventor_Item *it)
|
|||
Enventor_Object *obj = it->pd->obj;
|
||||
Enventor_Object_Data *pd = eo_data_scope_get(obj, ENVENTOR_OBJECT_CLASS);
|
||||
|
||||
edit_view_sync_cb_set(it->ed, edit_view_sync_cb, pd);
|
||||
edit_view_sync_cb_set(it->ed, edit_view_sync_cb, it);
|
||||
|
||||
pd->focused_it = it;
|
||||
|
||||
|
@ -1095,4 +1082,21 @@ enventor_item_file_save(Enventor_Item *it, const char *file)
|
|||
return saved;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
enventor_item_modified_get(const Enventor_Item *it)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(it, EINA_FALSE);
|
||||
|
||||
return edit_changed_get(it->ed);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
enventor_item_modified_set(Enventor_Item *it, Eina_Bool modified)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN(it);
|
||||
|
||||
edit_changed_set(it->ed, modified);
|
||||
}
|
||||
|
||||
|
||||
#include "enventor_object.eo.c"
|
||||
|
|
|
@ -193,7 +193,7 @@ redoundo_undo(redoundo_data *rd, Eina_Bool *changed)
|
|||
|
||||
if (!rd->last_diff)
|
||||
{
|
||||
Eina_Bool saved = edit_save(rd->ed, build_edc_path_get());
|
||||
Eina_Bool saved = edit_save(rd->ed, edit_file_get(rd->ed));
|
||||
if (saved) build_edc();
|
||||
return 0;
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ redoundo_undo(redoundo_data *rd, Eina_Bool *changed)
|
|||
|
||||
if (rd->last_diff && rd->last_diff->buildable)
|
||||
{
|
||||
edit_save(rd->ed, build_edc_path_get());
|
||||
edit_save(rd->ed, edit_file_get(rd->ed));
|
||||
build_edc();
|
||||
}
|
||||
|
||||
|
@ -341,7 +341,7 @@ redoundo_redo(redoundo_data *rd, Eina_Bool *changed)
|
|||
|
||||
if (rd->last_diff && rd->last_diff->buildable)
|
||||
{
|
||||
edit_save(rd->ed, build_edc_path_get());
|
||||
edit_save(rd->ed, edit_file_get(rd->ed));
|
||||
build_edc();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue