multi-file: itemize redo/undo functions.

This commit is contained in:
Hermet Park 2016-07-07 19:13:25 +09:00
parent 50cb8c7d42
commit ace06a6d8b
4 changed files with 20 additions and 22 deletions

View File

@ -138,7 +138,7 @@ static void
redo_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
if (enventor_object_redo(base_enventor_get()))
if (enventor_item_redo(file_mgr_focused_item_get()))
stats_info_msg_update(_("Redo text."));
else
stats_info_msg_update(_("No text to be redo."));
@ -148,7 +148,7 @@ static void
undo_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
if (enventor_object_undo(base_enventor_get()))
if (enventor_item_undo(file_mgr_focused_item_get()))
stats_info_msg_update(_("Undo text."));
else
stats_info_msg_update(_("No text to be undo."));

View File

@ -29,6 +29,8 @@ EAPI void enventor_item_modified_set(Enventor_Item *it, Eina_Bool modified);
EAPI Eina_Bool enventor_item_del(Enventor_Item *it);
Eina_Bool enventor_item_template_insert(Enventor_Item *it, char *syntax, size_t n);
Eina_Bool enventor_item_template_part_insert(Enventor_Item *it, Edje_Part_Type part, Enventor_Template_Insert_Type insert_type, Eina_Bool fixed_w, Eina_Bool fixed_h, char *rel1_x_to, char *rel1_y_to, char *rel2_x_to, char *rel2_y_to, float align_x, float align_y, int min_w, int min_h, float rel1_x, float rel1_y, float rel2_x,float rel2_y, char *syntax, size_t n);
EAPI Eina_Bool enventor_item_redo(Enventor_Item *it);
EAPI Eina_Bool enventor_item_undo(Enventor_Item *it);
#include "enventor_object.eo.legacy.h"

View File

@ -190,12 +190,6 @@ class Enventor.Object (Elm.Widget, Efl.File) {
@in part_name: const(char) *;
}
}
redo {
return: bool;
}
undo {
return: bool;
}
font_set {
params {
@in font_name: const(char) *;

View File

@ -834,20 +834,6 @@ _enventor_object_disabled_set(Eo *obj EINA_UNUSED,
pd->disabled = !!disabled;
}
//TODO: Itemize
EOLIAN static Eina_Bool
_enventor_object_redo(Eo *obj EINA_UNUSED, Enventor_Object_Data *pd)
{
return edit_redoundo(pd->main_it->ed, EINA_FALSE);
}
//TODO: Itemize
EOLIAN static Eina_Bool
_enventor_object_undo(Eo *obj EINA_UNUSED, Enventor_Object_Data *pd)
{
return edit_redoundo(pd->main_it->ed, EINA_TRUE);
}
EOLIAN static void
_enventor_object_program_run(Eo *obj EINA_UNUSED,
Enventor_Object_Data *pd EINA_UNUSED,
@ -1231,5 +1217,21 @@ enventor_item_template_part_insert(Enventor_Item *it,
NULL, syntax, n);
}
EAPI Eina_Bool
enventor_item_redo(Enventor_Item *it)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(it, EINA_FALSE);
return edit_redoundo(it->ed, EINA_FALSE);
}
EAPI Eina_Bool
enventor_item_undo(Enventor_Item *it)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(it, EINA_FALSE);
return edit_redoundo(it->ed, EINA_TRUE);
}
#include "enventor_object.eo.c"