forked from enlightenment/ecrire
parent
2b5546e0a2
commit
e0139c5da9
|
@ -12,12 +12,12 @@ extern int _ecrire_log_dom;
|
|||
#define INF(...) EINA_LOG_DOM_INFO(_ecrire_log_dom, __VA_ARGS__)
|
||||
#define DBG(...) EINA_LOG_DOM_DBG(_ecrire_log_dom, __VA_ARGS__)
|
||||
|
||||
struct _Ecrire_Entry {
|
||||
Evas_Object *entry;
|
||||
Evas_Object *frame;
|
||||
typedef struct _Ecrire_Editor
|
||||
{
|
||||
Evas_Object *win;
|
||||
const char *filename;
|
||||
int unsaved;
|
||||
Evas_Object *frame;
|
||||
Evas_Object *entry;
|
||||
|
||||
struct
|
||||
{
|
||||
Elm_Object_Item *copy, *cut, *save, *paste, *undo, *redo;
|
||||
|
@ -28,6 +28,10 @@ struct _Ecrire_Entry {
|
|||
Elm_Object_Item *copy, *cut, *save, *paste, *undo, *redo;
|
||||
} toolbar;
|
||||
|
||||
|
||||
const char *filename;
|
||||
int unsaved;
|
||||
|
||||
struct
|
||||
{
|
||||
const char *name;
|
||||
|
@ -39,15 +43,13 @@ struct _Ecrire_Entry {
|
|||
Eina_List *undo_stack_ptr;
|
||||
Eina_List *last_saved_stack_ptr;
|
||||
Eina_Bool undo_stack_can_merge;
|
||||
};
|
||||
} Ecrire_Editor;
|
||||
|
||||
typedef struct _Ecrire_Entry Ecrire_Entry;
|
||||
|
||||
void ecrire_open(const char *filename, const char *font_name, int font_size);
|
||||
void ecrire_font_set_save(Ecrire_Entry *inst, const char *font, int size);
|
||||
void ecrire_entry_font_set(Ecrire_Entry *inst, const char *font, int font_size);
|
||||
void ecrire_save(Ecrire_Entry *inst, void *callback_func);
|
||||
void ecrire_entry_save(Ecrire_Entry *inst, const char *file);
|
||||
void ecrire_editor_open(const char *filename, const char *font_name, int font_size);
|
||||
void ecrire_editor_font_set_save(Ecrire_Editor *inst, const char *font, int size);
|
||||
void ecrire_editor_font_set(Ecrire_Editor *inst, const char *font, int font_size);
|
||||
void ecrire_editor_save_then(Ecrire_Editor *inst, void *callback_func);
|
||||
void ecrire_editor_save(Ecrire_Editor *inst, const char *file);
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
|
|
|
@ -17,17 +17,17 @@ int _ecrire_log_dom = -1;
|
|||
static void
|
||||
_win_del_do(void *data)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
evas_object_del(inst->win);
|
||||
eina_stringshare_del(inst->filename);
|
||||
free(inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_init_entry(Ecrire_Entry *inst)
|
||||
_init_entry(Ecrire_Editor *inst)
|
||||
{
|
||||
Elm_Entry_Change_Info *inf;
|
||||
ecrire_entry_font_set(inst, inst->font.name, inst->font.size);
|
||||
ecrire_editor_font_set(inst, inst->font.name, inst->font.size);
|
||||
|
||||
/* Init the undo stack */
|
||||
EINA_LIST_FREE(inst->undo_stack, inf)
|
||||
|
@ -55,7 +55,7 @@ _init_entry(Ecrire_Entry *inst)
|
|||
}
|
||||
|
||||
static void
|
||||
_alert_if_need_saving(void (*cb_done)(void *data), Ecrire_Entry *inst)
|
||||
_alert_if_need_saving(void (*cb_done)(void *data), Ecrire_Editor *inst)
|
||||
{
|
||||
if (!elm_object_item_disabled_get(inst->menu.save))
|
||||
ui_alert_need_saving(inst->entry, cb_done, inst);
|
||||
|
@ -67,7 +67,7 @@ static void
|
|||
_cb_sel_start(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
elm_object_item_disabled_set(inst->menu.copy, EINA_FALSE);
|
||||
elm_object_item_disabled_set(inst->menu.cut, EINA_FALSE);
|
||||
elm_object_item_disabled_set(inst->toolbar.copy, EINA_FALSE);
|
||||
|
@ -78,7 +78,7 @@ static void
|
|||
_cb_sel_clear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
elm_object_item_disabled_set(inst->menu.copy, EINA_TRUE);
|
||||
elm_object_item_disabled_set(inst->menu.cut, EINA_TRUE);
|
||||
elm_object_item_disabled_set(inst->toolbar.copy, EINA_TRUE);
|
||||
|
@ -86,7 +86,7 @@ _cb_sel_clear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
static void
|
||||
_update_cur_file(const char *file, Ecrire_Entry *inst)
|
||||
_update_cur_file(const char *file, Ecrire_Editor *inst)
|
||||
{
|
||||
const char *saving = (!elm_object_item_disabled_get(inst->menu.save)) ?
|
||||
"*" : "";
|
||||
|
@ -132,12 +132,12 @@ _cb_cur_changed(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
|
|||
static void
|
||||
_cb_cur_changed_manual(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
inst->undo_stack_can_merge = EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_update_undo_redo_items(Ecrire_Entry *inst)
|
||||
_update_undo_redo_items(Ecrire_Editor *inst)
|
||||
{
|
||||
Eina_Bool disabled;
|
||||
|
||||
|
@ -166,7 +166,7 @@ _update_undo_redo_items(Ecrire_Entry *inst)
|
|||
}
|
||||
|
||||
static void
|
||||
_undo_stack_add(Ecrire_Entry *inst, Elm_Entry_Change_Info *_info)
|
||||
_undo_stack_add(Ecrire_Editor *inst, Elm_Entry_Change_Info *_info)
|
||||
{
|
||||
Elm_Entry_Change_Info *inf;
|
||||
|
||||
|
@ -224,7 +224,7 @@ _undo_stack_add(Ecrire_Entry *inst, Elm_Entry_Change_Info *_info)
|
|||
}
|
||||
|
||||
static void
|
||||
_undo_redo_do(Ecrire_Entry *inst, Elm_Entry_Change_Info *inf, Eina_Bool undo)
|
||||
_undo_redo_do(Ecrire_Editor *inst, Elm_Entry_Change_Info *inf, Eina_Bool undo)
|
||||
{
|
||||
DBG("%s: %s", (undo) ? "Undo" : "Redo",
|
||||
inf->change.insert.content);
|
||||
|
@ -280,7 +280,7 @@ static void
|
|||
_cb_undo(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
/* In undo we care about the current item */
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
Elm_Entry_Change_Info *inf = NULL;
|
||||
if (!eina_list_next(inst->undo_stack_ptr))
|
||||
return;
|
||||
|
@ -308,7 +308,7 @@ _cb_undo(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
|||
static void
|
||||
_cb_redo(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
Elm_Entry_Change_Info *inf = NULL;
|
||||
if (!eina_list_prev(inst->undo_stack_ptr))
|
||||
return;
|
||||
|
@ -341,7 +341,7 @@ _cb_redo(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
|||
static void
|
||||
_cb_ent_changed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
elm_object_item_disabled_set(inst->menu.save, EINA_FALSE);
|
||||
elm_object_item_disabled_set(inst->toolbar.save, EINA_FALSE);
|
||||
_update_cur_file(inst->filename, inst);
|
||||
|
@ -351,7 +351,7 @@ _cb_ent_changed(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
|||
}
|
||||
|
||||
static void
|
||||
_load_to_entry(Ecrire_Entry *inst, const char *file)
|
||||
_load_to_entry(Ecrire_Editor *inst, const char *file)
|
||||
{
|
||||
Eina_Bool ok = 1;
|
||||
|
||||
|
@ -391,11 +391,11 @@ _cb_fs_open_done(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
|
||||
if (!selected) return;
|
||||
|
||||
ecrire_open(selected, _ent_cfg->font.name, _ent_cfg->font.size);
|
||||
ecrire_editor_open(selected, _ent_cfg->font.name, _ent_cfg->font.size);
|
||||
}
|
||||
|
||||
void
|
||||
ecrire_entry_save(Ecrire_Entry *inst, const char *file)
|
||||
ecrire_editor_save(Ecrire_Editor *inst, const char *file)
|
||||
{
|
||||
Eina_Bool ok;
|
||||
|
||||
|
@ -415,20 +415,20 @@ ecrire_entry_save(Ecrire_Entry *inst, const char *file)
|
|||
}
|
||||
|
||||
static void
|
||||
_cb_fs_ecrire_entry_save(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
_cb_fs_ecrire_editor_save(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
const char *filename = event_info;
|
||||
|
||||
if (filename)
|
||||
ecrire_entry_save(inst, filename);
|
||||
ecrire_editor_save(inst, filename);
|
||||
}
|
||||
|
||||
static void
|
||||
_open_do(void *data)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
|
||||
ui_file_open_save_dialog_open(inst->win, EINA_FALSE, _cb_fs_open_done, inst);
|
||||
}
|
||||
|
@ -436,23 +436,23 @@ _open_do(void *data)
|
|||
static void
|
||||
_cb_goto_line(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
ui_goto_dialog_open(inst->win, inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_open(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
|
||||
_open_do(inst);
|
||||
}
|
||||
|
||||
void
|
||||
ecrire_save(Ecrire_Entry *inst, void *callback_func)
|
||||
ecrire_editor_save_then(Ecrire_Editor *inst, void *callback_func)
|
||||
{
|
||||
if (inst->filename)
|
||||
ecrire_entry_save(inst, inst->filename);
|
||||
ecrire_editor_save(inst, inst->filename);
|
||||
else
|
||||
ui_file_open_save_dialog_open(inst->win, EINA_TRUE, callback_func, inst);
|
||||
}
|
||||
|
@ -460,69 +460,69 @@ ecrire_save(Ecrire_Entry *inst, void *callback_func)
|
|||
static void
|
||||
_cb_save(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
ecrire_save(inst, _cb_fs_ecrire_entry_save);
|
||||
Ecrire_Editor *inst = data;
|
||||
ecrire_editor_save_then(inst, _cb_fs_ecrire_editor_save);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_save_as(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
ui_file_open_save_dialog_open(inst->win, EINA_TRUE, _cb_fs_ecrire_entry_save, inst);
|
||||
Ecrire_Editor *inst = data;
|
||||
ui_file_open_save_dialog_open(inst->win, EINA_TRUE, _cb_fs_ecrire_editor_save, inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_new(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
ecrire_open(NULL, _ent_cfg->font.name, _ent_cfg->font.size);
|
||||
ecrire_editor_open(NULL, _ent_cfg->font.name, _ent_cfg->font.size);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_close(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
_alert_if_need_saving(_win_del_do, inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_cut(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
elm_entry_selection_cut(inst->entry);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_copy(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
elm_entry_selection_copy(inst->entry);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_paste(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
elm_entry_selection_paste(inst->entry);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_find(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
ui_find_dialog_open(inst->win, inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_font_settings(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
ui_settings_open(elm_object_top_widget_get(inst->win), inst);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_win_del(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
(void) data;
|
||||
_alert_if_need_saving(_win_del_do, inst);
|
||||
}
|
||||
|
@ -530,14 +530,14 @@ _cb_win_del(void *data, Evas_Object *obj, void *event_info)
|
|||
static void
|
||||
_cb_win_focused(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
elm_object_focus_set(inst->entry, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
Eina_Bool ctrl, alt, shift;
|
||||
Evas_Event_Key_Down *ev = event;
|
||||
|
||||
|
@ -555,7 +555,7 @@ _cb_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event)
|
|||
}
|
||||
|
||||
void
|
||||
ecrire_entry_font_set(Ecrire_Entry *inst, const char *font, int font_size)
|
||||
ecrire_editor_font_set(Ecrire_Editor *inst, const char *font, int font_size)
|
||||
{
|
||||
const Evas_Object *tb = elm_entry_textblock_get(inst->entry);
|
||||
Eina_Strbuf *sbuf;
|
||||
|
@ -586,9 +586,9 @@ ecrire_entry_font_set(Ecrire_Entry *inst, const char *font, int font_size)
|
|||
}
|
||||
|
||||
void
|
||||
ecrire_font_set_save(Ecrire_Entry *inst, const char *font, int size)
|
||||
ecrire_editor_font_set_save(Ecrire_Editor *inst, const char *font, int size)
|
||||
{
|
||||
ecrire_entry_font_set(inst, font, size);
|
||||
ecrire_editor_font_set(inst, font, size);
|
||||
|
||||
eina_stringshare_replace(&_ent_cfg->font.name, font);
|
||||
_ent_cfg->font.size = size;
|
||||
|
@ -598,7 +598,7 @@ ecrire_font_set_save(Ecrire_Entry *inst, const char *font, int size)
|
|||
|
||||
|
||||
static Evas_Object *
|
||||
_ecrire_toolbar_add(Ecrire_Entry *inst)
|
||||
_ecrire_toolbar_add(Ecrire_Editor *inst)
|
||||
{
|
||||
Evas_Object *tb;
|
||||
Elm_Object_Item *it;
|
||||
|
@ -638,7 +638,7 @@ _ecrire_toolbar_add(Ecrire_Entry *inst)
|
|||
}
|
||||
|
||||
static void
|
||||
_ecrire_menu_add(Ecrire_Entry *inst)
|
||||
_ecrire_menu_add(Ecrire_Editor *inst)
|
||||
{
|
||||
Evas_Object *menu;
|
||||
Elm_Object_Item *it;
|
||||
|
@ -679,13 +679,13 @@ _ecrire_menu_add(Ecrire_Entry *inst)
|
|||
}
|
||||
|
||||
void
|
||||
ecrire_open(const char *filename, const char *font_name, int font_size)
|
||||
ecrire_editor_open(const char *filename, const char *font_name, int font_size)
|
||||
{
|
||||
Evas_Object *win, *pad, *fr, *bx, *entry, *cur_info;
|
||||
Evas_Object *toolbar;
|
||||
Evas_Coord w = 600, h = 600;
|
||||
|
||||
Ecrire_Entry *inst = calloc(1, sizeof(Ecrire_Entry));
|
||||
Ecrire_Editor *inst = calloc(1, sizeof(Ecrire_Editor));
|
||||
inst->unsaved = 1;
|
||||
inst->filename = NULL;
|
||||
inst->last_saved_stack_ptr = NULL;
|
||||
|
@ -830,7 +830,7 @@ elm_main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
ecrire_open(filename, _ent_cfg->font.name, _ent_cfg->font.size);
|
||||
ecrire_editor_open(filename, _ent_cfg->font.name, _ent_cfg->font.size);
|
||||
|
||||
elm_run();
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ static void (*done_cb)(void *data);
|
|||
static void
|
||||
_discard(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = done_data;
|
||||
Ecrire_Editor *inst = done_data;
|
||||
|
||||
if (data)
|
||||
evas_object_del(data);
|
||||
|
@ -20,13 +20,13 @@ static void
|
|||
_fs_save_done(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info)
|
||||
{
|
||||
Ecrire_Entry *inst;
|
||||
Ecrire_Editor *inst;
|
||||
const char *selected = event_info;
|
||||
|
||||
inst = done_data;
|
||||
if (selected)
|
||||
{
|
||||
ecrire_entry_save(inst, selected);
|
||||
ecrire_editor_save(inst, selected);
|
||||
done_cb(data);
|
||||
}
|
||||
}
|
||||
|
@ -34,10 +34,10 @@ _fs_save_done(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
static void
|
||||
_save(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = done_data;
|
||||
Ecrire_Editor *inst = done_data;
|
||||
|
||||
evas_object_del(data);
|
||||
ecrire_save(inst, _fs_save_done);
|
||||
ecrire_editor_save_then(inst, _fs_save_done);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -57,7 +57,7 @@ _my_parent_del(void *data EINA_UNUSED, Evas_Object *obj, void *event_info)
|
|||
}
|
||||
|
||||
Evas_Object *
|
||||
ui_goto_dialog_open(Evas_Object *parent, Ecrire_Entry *inst)
|
||||
ui_goto_dialog_open(Evas_Object *parent, Ecrire_Editor *inst)
|
||||
{
|
||||
Evas_Object *entry = inst->entry;
|
||||
Evas_Object *popup, *bx, *hbx, *btn;
|
||||
|
|
|
@ -129,7 +129,7 @@ my_win_del(void *data EINA_UNUSED, Evas_Object *obj, void *event_info)
|
|||
}
|
||||
|
||||
Evas_Object *
|
||||
ui_find_dialog_open(Evas_Object *parent, Ecrire_Entry *inst)
|
||||
ui_find_dialog_open(Evas_Object *parent, Ecrire_Editor *inst)
|
||||
{
|
||||
Evas_Object *entry = inst->entry;
|
||||
Evas_Object *win, *bg, *tbl, *bx, *exp, *pad, *lbl, *hbx, *btn;
|
||||
|
|
|
@ -19,7 +19,7 @@ static void
|
|||
_cb_popup_del(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
|
||||
elm_object_focus_set(inst->win, 1);
|
||||
if (_settings_popup)
|
||||
|
@ -61,7 +61,7 @@ _cb_font_selected(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info)
|
||||
{
|
||||
const char *selected;
|
||||
Ecrire_Entry *inst;
|
||||
Ecrire_Editor *inst;
|
||||
Elm_Object_Item *it = event_info;
|
||||
if (!it) return;
|
||||
|
||||
|
@ -72,26 +72,26 @@ _cb_font_selected(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
return;
|
||||
|
||||
eina_stringshare_replace(&inst->font.name, selected);
|
||||
ecrire_font_set_save(inst, inst->font.name, inst->font.size);
|
||||
ecrire_editor_font_set_save(inst, inst->font.name, inst->font.size);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_spinner_delay_changed(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
|
||||
inst->font.size = elm_spinner_value_get(obj);
|
||||
|
||||
if (inst->font.name)
|
||||
ecrire_font_set_save(inst, inst->font.name, inst->font.size);
|
||||
ecrire_editor_font_set_save(inst, inst->font.name, inst->font.size);
|
||||
}
|
||||
|
||||
static void
|
||||
_cb_check_changed(void *data, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst;
|
||||
Ecrire_Editor *inst;
|
||||
Eina_Bool enabled = elm_check_state_get(obj);
|
||||
|
||||
inst = data;
|
||||
|
@ -102,11 +102,11 @@ _cb_check_changed(void *data, Evas_Object *obj,
|
|||
if (enabled)
|
||||
{
|
||||
inst->font.name = NULL;
|
||||
ecrire_font_set_save(inst, NULL, 0);
|
||||
ecrire_editor_font_set_save(inst, NULL, 0);
|
||||
}
|
||||
else if (inst->font.name)
|
||||
{
|
||||
ecrire_font_set_save(inst, inst->font.name, inst->font.size);
|
||||
ecrire_editor_font_set_save(inst, inst->font.name, inst->font.size);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,12 +114,12 @@ static void
|
|||
_cb_btn_clicked(void *data, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ecrire_Entry *inst = data;
|
||||
Ecrire_Editor *inst = data;
|
||||
_cb_popup_del(inst, NULL, NULL);
|
||||
}
|
||||
|
||||
Evas_Object *
|
||||
ui_settings_open(Evas_Object *parent, Ecrire_Entry *inst)
|
||||
ui_settings_open(Evas_Object *parent, Ecrire_Editor *inst)
|
||||
{
|
||||
Evas_Object *pop, *tb, *rec, *bx, *hbx, *btn, *list, *lb, *sp, *ck;
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
void ui_file_open_save_dialog_open(Evas_Object *parent, Eina_Bool save, Evas_Smart_Cb func, void *data);
|
||||
|
||||
Evas_Object *ui_find_dialog_open(Evas_Object *parent, Ecrire_Entry *inst);
|
||||
Evas_Object *ui_goto_dialog_open(Evas_Object *parent, Ecrire_Entry *inst);
|
||||
Evas_Object *ui_settings_open(Evas_Object *parent, Ecrire_Entry *inst);
|
||||
Evas_Object *ui_find_dialog_open(Evas_Object *parent, Ecrire_Editor *inst);
|
||||
Evas_Object *ui_goto_dialog_open(Evas_Object *parent, Ecrire_Editor *inst);
|
||||
Evas_Object *ui_settings_open(Evas_Object *parent, Ecrire_Editor *inst);
|
||||
|
||||
void ui_alert_need_saving(Evas_Object *entry, void (*done)(void *data), void *data);
|
||||
|
||||
|
|
Loading…
Reference in New Issue