forked from enlightenment/enventor
file_tab: add a partial implmentation.
This commit is contained in:
parent
4100cc9131
commit
e61cfb6124
1
README
1
README
|
@ -39,6 +39,7 @@ F7 - Toggle Tools
|
|||
F8 - Toggle Status
|
||||
F9 - Toggle File Browser
|
||||
F10 - Toggle EDC Navigator
|
||||
F11 - Toggle File Tab
|
||||
F12 - Settings
|
||||
|
||||
Ctrl+S - Quick Save + Update Live View
|
||||
|
|
|
@ -10,7 +10,6 @@ images {
|
|||
image: "highlight.png" COMP;
|
||||
image: "lines.png" COMP;
|
||||
image: "console.png" COMP;
|
||||
image: "status.png" COMP;
|
||||
image: "dummy.png" COMP;
|
||||
image: "mirror.png" COMP;
|
||||
image: "goto.png" COMP;
|
||||
|
@ -46,6 +45,9 @@ images {
|
|||
image: "brows_font.png" COMP;
|
||||
image: "template.png" COMP;
|
||||
image: "part_outline.png" COMP;
|
||||
image: "left.png" COMP;
|
||||
image: "right.png" COMP;
|
||||
image: "filetab.png" COMP;
|
||||
}
|
||||
|
||||
#define ICON_GROUP(_group_name, _image_path) \
|
||||
|
@ -64,7 +66,6 @@ ICON_GROUP("find", "find.png")
|
|||
ICON_GROUP("highlight", "highlight.png")
|
||||
ICON_GROUP("lines", "lines.png")
|
||||
ICON_GROUP("console", "console.png")
|
||||
ICON_GROUP("status", "status.png")
|
||||
ICON_GROUP("dummy", "dummy.png")
|
||||
ICON_GROUP("mirror", "mirror.png")
|
||||
ICON_GROUP("up", "slider_up.png")
|
||||
|
@ -105,5 +106,8 @@ ICON_GROUP("brows_sound", "brows_sound.png")
|
|||
ICON_GROUP("brows_font", "brows_font.png")
|
||||
ICON_GROUP("template", "template.png")
|
||||
ICON_GROUP("part_outline", "part_outline.png")
|
||||
ICON_GROUP("left_arrow", "left.png")
|
||||
ICON_GROUP("right_arrow", "right.png")
|
||||
ICON_GROUP("filetab", "filetab.png")
|
||||
|
||||
#undef ICON_GROUP
|
||||
|
|
|
@ -45,7 +45,6 @@ EXTRA_DIST = \
|
|||
lines.png \
|
||||
setting_icon.png \
|
||||
console.png \
|
||||
status.png \
|
||||
dummy.png \
|
||||
mirror.png \
|
||||
goto.png \
|
||||
|
@ -94,4 +93,7 @@ EXTRA_DIST = \
|
|||
brows_image.png \
|
||||
brows_sound.png \
|
||||
brows_font.png \
|
||||
template.png
|
||||
template.png \
|
||||
left.png \
|
||||
right.png \
|
||||
filetab.png
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
|
@ -1772,6 +1772,11 @@ group { "colorselector_layout";
|
|||
|
||||
group { "statusbar_layout";
|
||||
parts {
|
||||
rect { "bg";
|
||||
desc { "default";
|
||||
color: 64 64 64 255;
|
||||
}
|
||||
}
|
||||
rect { "base_clip";
|
||||
desc { "default";
|
||||
color: 255 255 255 255;
|
||||
|
@ -2309,7 +2314,7 @@ group { "main_layout";
|
|||
spacer { "base";
|
||||
scale: 1;
|
||||
desc {
|
||||
min: 810 440;
|
||||
min: 810 475;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.panes";
|
||||
|
@ -2322,7 +2327,7 @@ group { "main_layout";
|
|||
rel2 {
|
||||
relative: 0.0 0.0;
|
||||
to_x: "elm.swallow.edc_navigator";
|
||||
to_y: "elm.swallow.statusbar";
|
||||
to_y: "elm.swallow.file_tab";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2338,6 +2343,31 @@ group { "main_layout";
|
|||
color: 200 0 0 175;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.file_tab";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 { to: "elm.swallow.statusbar"; relative: 0 0; }
|
||||
rel2 { to: "elm.swallow.statusbar"; relative: 1 0; }
|
||||
align: 0.5 0;
|
||||
min: 0 22;
|
||||
fixed: 0 1;
|
||||
}
|
||||
desc { "visible";
|
||||
inherit: "default";
|
||||
align: 0.5 1;
|
||||
}
|
||||
}
|
||||
rect { "separator";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel1 { to: "elm.swallow.file_tab"; relative: 0 1; offset: 0 -2; }
|
||||
rel2 { to: "elm.swallow.file_tab"; relative: 1 1; offset: -1 -3; }
|
||||
align: 0.5 0;
|
||||
min: 0 1;
|
||||
fixed: 0 1;
|
||||
color: 50 50 50 100;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.statusbar";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
|
@ -2360,7 +2390,7 @@ group { "main_layout";
|
|||
}
|
||||
rel2 {
|
||||
relative: 0.0 0.0;
|
||||
to_y: "elm.swallow.statusbar";
|
||||
to_y: "elm.swallow.file_tab";
|
||||
}
|
||||
align: 1 0;
|
||||
min: 200 0;
|
||||
|
@ -2381,7 +2411,7 @@ group { "main_layout";
|
|||
}
|
||||
rel2 {
|
||||
relative: 1.0 0.0;
|
||||
to_y: "elm.swallow.statusbar";
|
||||
to_y: "elm.swallow.file_tab";
|
||||
}
|
||||
align: 0 0;
|
||||
min: 200 0;
|
||||
|
@ -2397,7 +2427,7 @@ group { "main_layout";
|
|||
}
|
||||
rel2 {
|
||||
relative: 1.0 0.0;
|
||||
to_y: "elm.swallow.statusbar";
|
||||
to_y: "elm.swallow.file_tab";
|
||||
}
|
||||
visible: 1;
|
||||
}
|
||||
|
@ -2440,6 +2470,18 @@ group { "main_layout";
|
|||
target: "elm.swallow.statusbar";
|
||||
transition: DECELERATE 0.25;
|
||||
}
|
||||
program { "file_tab_show";
|
||||
signal: "elm,state,file_tab,show";
|
||||
action: STATE_SET "visible";
|
||||
target: "elm.swallow.file_tab";
|
||||
transition: DECELERATE 0.25;
|
||||
}
|
||||
program { "file_tab_hide";
|
||||
signal: "elm,state,file_tab,hide";
|
||||
action: STATE_SET "default";
|
||||
target: "elm.swallow.file_tab";
|
||||
transition: DECELERATE 0.25;
|
||||
}
|
||||
program { "alert_show";
|
||||
signal: "elm,state,alert,show";
|
||||
action: STATE_SET "visible";
|
||||
|
@ -3028,7 +3070,7 @@ group { "text_editor_tools_layout";
|
|||
align: 1.0 0.5;
|
||||
}
|
||||
}
|
||||
swallow { "elm.swallow.status";
|
||||
swallow { "elm.swallow.file_tab";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "padding10";
|
||||
|
@ -3040,7 +3082,7 @@ group { "text_editor_tools_layout";
|
|||
spacer { "padding11";
|
||||
scale: 1;
|
||||
desc { "default";
|
||||
rel.to: "elm.swallow.status";
|
||||
rel.to: "elm.swallow.file_tab";
|
||||
rel2.relative: 0.0 1.0;
|
||||
min: 8 0;
|
||||
fixed: 1 0;
|
||||
|
|
|
@ -33,7 +33,8 @@ enventor_SOURCES = \
|
|||
file_browser.c \
|
||||
build_setting.c \
|
||||
preference_setting.c \
|
||||
help.c
|
||||
help.c \
|
||||
file_tab.c
|
||||
|
||||
enventor_LDADD = \
|
||||
$(top_builddir)/src/lib/libenventor.la \
|
||||
|
|
|
@ -82,6 +82,20 @@ base_statusbar_toggle(Eina_Bool toggle)
|
|||
elm_object_signal_emit(bd->layout, "elm,state,statusbar,hide", "");
|
||||
}
|
||||
|
||||
void
|
||||
base_file_tab_toggle(Eina_Bool toggle)
|
||||
{
|
||||
base_data *bd = g_bd;
|
||||
assert(bd);
|
||||
|
||||
if (toggle) config_file_tab_set(!config_file_tab_get());
|
||||
|
||||
if (config_file_tab_get())
|
||||
elm_object_signal_emit(bd->layout, "elm,state,file_tab,show", "");
|
||||
else
|
||||
elm_object_signal_emit(bd->layout, "elm,state,file_tab,hide", "");
|
||||
}
|
||||
|
||||
void base_file_browser_toggle(Eina_Bool toggle)
|
||||
{
|
||||
base_data *bd = g_bd;
|
||||
|
@ -245,6 +259,7 @@ base_gui_term(void)
|
|||
ecore_timer_del(bd->edc_navi_update_timer);
|
||||
file_browser_term();
|
||||
edc_navigator_term();
|
||||
file_tab_term();
|
||||
panes_term();
|
||||
|
||||
free(bd);
|
||||
|
@ -338,6 +353,10 @@ base_gui_init(void)
|
|||
Evas_Object *edc_navigator = edc_navigator_init(layout);
|
||||
elm_object_part_content_set(layout, "elm.swallow.edc_navigator",
|
||||
edc_navigator);
|
||||
//File Tab
|
||||
Evas_Object *file_tab = file_tab_init(layout);
|
||||
elm_object_part_content_set(layout, "elm.swallow.file_tab", file_tab);
|
||||
|
||||
bd->win = win;
|
||||
bd->layout = layout;
|
||||
bd->console = console;
|
||||
|
|
|
@ -45,6 +45,7 @@ typedef struct config_s
|
|||
Eina_Bool file_browser_loaded;
|
||||
Eina_Bool edc_navigator;
|
||||
Eina_Bool red_alert;
|
||||
Eina_Bool file_tab;
|
||||
} config_data;
|
||||
|
||||
static config_data *g_cd = NULL;
|
||||
|
@ -194,9 +195,10 @@ config_load(void)
|
|||
cd->auto_complete = EINA_TRUE;
|
||||
cd->version = ENVENTOR_CONFIG_VERSION;
|
||||
cd->smart_undo_redo = EINA_FALSE;
|
||||
cd->file_browser = EINA_TRUE;
|
||||
cd->file_browser = EINA_FALSE;
|
||||
cd->edc_navigator = EINA_TRUE;
|
||||
cd->red_alert = EINA_TRUE;
|
||||
cd->file_tab = EINA_FALSE;
|
||||
}
|
||||
|
||||
g_cd = cd;
|
||||
|
@ -325,6 +327,8 @@ eddc_init(void)
|
|||
edc_navigator, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "red_alert",
|
||||
red_alert, EET_T_UCHAR);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "file_tab", file_tab,
|
||||
EET_T_UCHAR);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -683,13 +687,6 @@ config_linenumber_get(void)
|
|||
return cd->linenumber;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
config_stats_bar_get(void)
|
||||
{
|
||||
config_data *cd = g_cd;
|
||||
return cd->stats_bar;
|
||||
}
|
||||
|
||||
void
|
||||
config_linenumber_set(Eina_Bool enabled)
|
||||
{
|
||||
|
@ -697,6 +694,27 @@ config_linenumber_set(Eina_Bool enabled)
|
|||
cd->linenumber = enabled;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
config_file_tab_get(void)
|
||||
{
|
||||
config_data *cd = g_cd;
|
||||
return cd->file_tab;
|
||||
}
|
||||
|
||||
void
|
||||
config_file_tab_set(Eina_Bool enabled)
|
||||
{
|
||||
config_data *cd = g_cd;
|
||||
cd->file_tab = enabled;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
config_stats_bar_get(void)
|
||||
{
|
||||
config_data *cd = g_cd;
|
||||
return cd->stats_bar;
|
||||
}
|
||||
|
||||
void
|
||||
config_stats_bar_set(Eina_Bool enabled)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,156 @@
|
|||
#include "common.h"
|
||||
|
||||
typedef struct file_tab_s
|
||||
{
|
||||
Evas_Object *in_box;
|
||||
Evas_Object *scroller;
|
||||
Evas_Object *out_box;
|
||||
} file_data;
|
||||
|
||||
typedef struct file_tab_it_s
|
||||
{
|
||||
Enventor_Item *it;
|
||||
file_data *fd;
|
||||
|
||||
} file_tab_it;
|
||||
|
||||
file_data *g_fd = NULL;
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Internal method implementation */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Externally accessible calls */
|
||||
/*****************************************************************************/
|
||||
|
||||
Eina_Bool file_tab_it_add(Enventor_Item *enventor_it)
|
||||
{
|
||||
if (!enventor_it)
|
||||
{
|
||||
EINA_LOG_ERR("enventor_it = NULL?");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
file_data *fd = g_fd;
|
||||
if (!fd) return EINA_FALSE;
|
||||
|
||||
file_tab_it *fti = NULL;
|
||||
fti = calloc(1, sizeof(file_tab_it));
|
||||
if (!fti)
|
||||
{
|
||||
EINA_LOG_ERR("Failed to allocate Memory!");
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
const char *filepath = enventor_item_file_get(enventor_it);
|
||||
if (!filepath)
|
||||
{
|
||||
EINA_LOG_ERR("No file path??");
|
||||
goto err;
|
||||
}
|
||||
|
||||
//Filter out file path and just have a file name without extension.
|
||||
char *filename = ecore_file_strip_ext(ecore_file_file_get(filepath));
|
||||
if (!filename)
|
||||
{
|
||||
EINA_LOG_ERR("no filename??");
|
||||
goto err;
|
||||
}
|
||||
|
||||
Evas_Object *btn = elm_button_add(fd->in_box);
|
||||
elm_object_text_set(btn, filename);
|
||||
elm_object_style_set(btn, "enventor");
|
||||
evas_object_size_hint_weight_set(btn, 0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, 0, 0.5);
|
||||
evas_object_show(btn);
|
||||
|
||||
elm_box_pack_end(fd->in_box, btn);
|
||||
|
||||
free(filename);
|
||||
|
||||
return EINA_TRUE;
|
||||
|
||||
err:
|
||||
free(fti);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
Evas_Object *
|
||||
file_tab_init(Evas_Object *parent)
|
||||
{
|
||||
file_data *fd = calloc(1, sizeof(file_data));
|
||||
if (!fd)
|
||||
{
|
||||
EINA_LOG_ERR("Failed to allocate Memory!");
|
||||
return NULL;
|
||||
}
|
||||
g_fd = fd;
|
||||
|
||||
//Outer Box
|
||||
Evas_Object *out_box = elm_box_add(parent);
|
||||
elm_box_padding_set(out_box, ELM_SCALE_SIZE(5), 0);
|
||||
elm_box_horizontal_set(out_box, EINA_TRUE);
|
||||
|
||||
//Left Button
|
||||
Evas_Object *left_btn = elm_button_add(out_box);
|
||||
elm_object_style_set(left_btn, ENVENTOR_NAME);
|
||||
evas_object_size_hint_weight_set(left_btn, 0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(left_btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_show(left_btn);
|
||||
elm_box_pack_end(out_box, left_btn);
|
||||
|
||||
//Left Button Icon
|
||||
Evas_Object *img1 = elm_image_add(left_btn);
|
||||
elm_image_file_set(img1, EDJE_PATH, "left_arrow");
|
||||
elm_object_content_set(left_btn, img1);
|
||||
|
||||
//Right Button
|
||||
Evas_Object *right_btn = elm_button_add(out_box);
|
||||
evas_object_size_hint_weight_set(right_btn, 0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(right_btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_style_set(right_btn, ENVENTOR_NAME);
|
||||
evas_object_show(right_btn);
|
||||
elm_box_pack_end(out_box, right_btn);
|
||||
|
||||
//Right Button Icon
|
||||
Evas_Object *img2 = elm_image_add(right_btn);
|
||||
elm_image_file_set(img2, EDJE_PATH, "right_arrow");
|
||||
elm_object_content_set(right_btn, img2);
|
||||
|
||||
//Scroller
|
||||
Evas_Object *scroller = elm_scroller_add(out_box);
|
||||
elm_object_style_set(scroller, ENVENTOR_NAME);
|
||||
elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF,
|
||||
ELM_SCROLLER_POLICY_OFF);
|
||||
evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_show(scroller);
|
||||
elm_box_pack_end(out_box, scroller);
|
||||
|
||||
//Inner Box
|
||||
Evas_Object *in_box = elm_box_add(scroller);
|
||||
elm_box_horizontal_set(in_box, EINA_TRUE);
|
||||
evas_object_size_hint_weight_set(in_box, 0, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(in_box, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_content_set(scroller, in_box);
|
||||
|
||||
fd->out_box = out_box;
|
||||
fd->in_box = in_box;
|
||||
fd->scroller = scroller;
|
||||
|
||||
return out_box;
|
||||
}
|
||||
|
||||
void
|
||||
file_tab_term(void)
|
||||
{
|
||||
file_data *fd = g_fd;
|
||||
if (!fd) return;
|
||||
|
||||
evas_object_del(fd->out_box);
|
||||
|
||||
free(fd);
|
||||
g_fd = NULL;
|
||||
}
|
|
@ -44,7 +44,7 @@ tools_update(void)
|
|||
tools_dummy_update(EINA_FALSE);
|
||||
tools_outline_update(EINA_FALSE);
|
||||
tools_mirror_mode_update(EINA_FALSE);
|
||||
tools_status_update(EINA_FALSE);
|
||||
tools_file_tab_update(EINA_FALSE);
|
||||
tools_file_browser_update(EINA_FALSE);
|
||||
tools_edc_navigator_update(EINA_FALSE);
|
||||
}
|
||||
|
@ -594,6 +594,7 @@ enventor_setup(app_data *ad)
|
|||
|
||||
ad->main_it =
|
||||
enventor_object_main_file_set(enventor, config_input_path_get());
|
||||
file_tab_it_add(ad->main_it);
|
||||
|
||||
base_enventor_set(enventor);
|
||||
base_text_editor_set(ad->main_it);
|
||||
|
@ -828,6 +829,13 @@ keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
|
|||
tools_edc_navigator_update(EINA_TRUE);
|
||||
return;
|
||||
}
|
||||
//File Tab
|
||||
if (!strcmp(ev->key, "F11"))
|
||||
{
|
||||
enventor_object_ctxpopup_dismiss(base_enventor_get());
|
||||
tools_file_tab_update(EINA_TRUE);
|
||||
return;
|
||||
}
|
||||
//Setting
|
||||
if (!strcmp(ev->key, "F12"))
|
||||
{
|
||||
|
|
|
@ -227,7 +227,7 @@ preference_setting_content_get(preference_setting_data *psd,
|
|||
toggle_create(box, _("Tools"),
|
||||
config_tools_get(),
|
||||
_("Tools (F7)<br>"
|
||||
"Display the tools on the top area.<br>"
|
||||
"Display Tools on the top area.<br>"
|
||||
"Tools displays the essential function <br>"
|
||||
"toggles to edit the layout."));
|
||||
elm_box_pack_end(box, toggle_tools);
|
||||
|
@ -236,8 +236,8 @@ preference_setting_content_get(preference_setting_data *psd,
|
|||
Evas_Object *toggle_status =
|
||||
toggle_create(box, _("Status"), config_stats_bar_get(),
|
||||
_("Status (F8)<br>"
|
||||
"Display Status bar on the bottom area.<br>"
|
||||
"Status bar displays subsidiary information for<br>"
|
||||
"Display Status bar, which shows subsidiary<br>"
|
||||
"information for editing in the bottom area."
|
||||
"editing."));
|
||||
elm_box_pack_end(box, toggle_status);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ typedef struct tools_s
|
|||
{
|
||||
Evas_Object *swallow_btn;
|
||||
Evas_Object *outline_btn;
|
||||
Evas_Object *status_btn;
|
||||
Evas_Object *file_tab;
|
||||
Evas_Object *file_browser_btn;
|
||||
Evas_Object *edc_navigator_btn;
|
||||
Evas_Object *lines_btn;
|
||||
|
@ -93,10 +93,10 @@ edc_navigator_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
static void
|
||||
status_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
file_tab_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
tools_status_update(EINA_TRUE);
|
||||
tools_file_tab_update(EINA_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -370,15 +370,16 @@ tools_init(Evas_Object *parent)
|
|||
btn);
|
||||
td->edc_navigator_btn = btn;
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "status",
|
||||
_("Status (F11)<br>"
|
||||
"Display the status bar, which shows subsidiary<br>"
|
||||
"information for editing in the bottom area."),
|
||||
status_cb);
|
||||
btn = tools_btn_create(text_editor_ly, "filetab",
|
||||
_("File Tab (F11)<br>"
|
||||
"Display the file tab in the bottom area<br>"
|
||||
"It shows an opened file list to switch<br>"
|
||||
"files quickly. to switch files quickly."),
|
||||
file_tab_cb);
|
||||
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.status", btn);
|
||||
td->status_btn = btn;
|
||||
elm_object_part_content_set(text_editor_ly, "elm.swallow.file_tab", btn);
|
||||
td->file_tab = btn;
|
||||
|
||||
btn = tools_btn_create(text_editor_ly, "menu",
|
||||
_("Enventor menu (Esc)<br>"
|
||||
|
@ -576,18 +577,18 @@ tools_mirror_mode_update(Eina_Bool toggle)
|
|||
}
|
||||
|
||||
void
|
||||
tools_status_update(Eina_Bool toggle)
|
||||
tools_file_tab_update(Eina_Bool toggle)
|
||||
{
|
||||
tools_data *td = g_td;
|
||||
if (!td) return;
|
||||
|
||||
base_statusbar_toggle(toggle);
|
||||
base_file_tab_toggle(toggle);
|
||||
|
||||
//Toggle on/off
|
||||
if (config_stats_bar_get())
|
||||
elm_object_signal_emit(td->status_btn, "icon,highlight,enabled", "");
|
||||
if (config_file_tab_get())
|
||||
elm_object_signal_emit(td->file_tab, "icon,highlight,enabled", "");
|
||||
else
|
||||
elm_object_signal_emit(td->status_btn, "icon,highlight,disabled", "");
|
||||
elm_object_signal_emit(td->file_tab, "icon,highlight,disabled", "");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -57,14 +57,14 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
|
|||
|
||||
#define ROUNDING(x, dig) (floor((x) * pow(10, dig) + 0.5) / pow(10, dig))
|
||||
|
||||
#define ENVENTOR_CONFIG_VERSION 10
|
||||
#define ENVENTOR_CONFIG_VERSION 11
|
||||
|
||||
#define EVENT_KEY_MODIFIER_CHECK(NAME, MASK) \
|
||||
((MASK & ECORE_EVENT_MODIFIER_##NAME) && \
|
||||
!((0xFF ^ ECORE_EVENT_MODIFIER_##NAME) & (MASK & 0x0F)))
|
||||
|
||||
#define WIN_DEFAULT_W 900
|
||||
#define WIN_DEFAULT_H 440
|
||||
#define WIN_DEFAULT_H 475
|
||||
|
||||
#define ENVENTOR_BETA_API_SUPPORT 1
|
||||
#include <Enventor.h>
|
||||
|
@ -85,6 +85,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
|
|||
#include "build_setting.h"
|
||||
#include "preference_setting.h"
|
||||
#include "help.h"
|
||||
#include "file_tab.h"
|
||||
|
||||
/* localization */
|
||||
#ifdef HAVE_GETTEXT
|
||||
|
|
|
@ -25,8 +25,10 @@ const char *config_syntax_color_get(Enventor_Syntax_Color_Type color_type);
|
|||
void config_update_cb_set(void (*cb)(void *data), void *data);
|
||||
void config_stats_bar_set(Eina_Bool enabled);
|
||||
void config_linenumber_set(Eina_Bool enabled);
|
||||
void config_file_tab_set(Eina_Bool enabled);
|
||||
Eina_Bool config_stats_bar_get(void);
|
||||
Eina_Bool config_linenumber_get(void);
|
||||
Eina_Bool config_file_tab_get(void);
|
||||
void config_apply(void);
|
||||
void config_input_path_set(const char *input_path);
|
||||
void config_view_size_get(Evas_Coord *w, Evas_Coord *h);
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
Evas_Object *file_tab_init(Evas_Object *parent);
|
||||
void file_tab_term(void);
|
||||
|
|
@ -5,7 +5,7 @@ void tools_lines_update(Eina_Bool toggle);
|
|||
void tools_dummy_update(Eina_Bool toggle);
|
||||
void tools_outline_update(Eina_Bool toggle);
|
||||
void tools_mirror_mode_update(Eina_Bool toggle);
|
||||
void tools_status_update(Eina_Bool toggle);
|
||||
void tools_file_tab_update(Eina_Bool toggle);
|
||||
void tools_file_browser_update(Eina_Bool toggle);
|
||||
void tools_edc_navigator_update(Eina_Bool toggle);
|
||||
void tools_goto_update(void);
|
||||
|
|
|
@ -4,7 +4,7 @@ EAPI Evas_Object *enventor_object_add(Evas_Object *parent);
|
|||
|
||||
//FIXME: Should be eofied.
|
||||
EAPI Enventor_Item *enventor_object_main_file_set(Evas_Object *obj, const char *file);
|
||||
|
||||
EAPI Evas_Object *enventor_item_editor_get(const Enventor_Item *it);
|
||||
EAPI const char *enventor_item_file_get(const Enventor_Item *it);
|
||||
|
||||
#include "enventor_object.eo.legacy.h"
|
||||
|
|
|
@ -29,6 +29,7 @@ struct editor_s
|
|||
Evas_Object *layout;
|
||||
Evas_Object *ctxpopup;
|
||||
Enventor_Object *enventor;
|
||||
Eina_Stringshare *filepath;
|
||||
|
||||
syntax_helper *sh;
|
||||
parser_data *pd;
|
||||
|
@ -1012,6 +1013,9 @@ edit_edc_load(edit_data *ed, const char *file_path)
|
|||
|
||||
ret = EINA_TRUE;
|
||||
|
||||
eina_stringshare_del(ed->filepath);
|
||||
ed->filepath = eina_stringshare_add(file_path);
|
||||
|
||||
err:
|
||||
//Even any text is not inserted, line number should start with 1
|
||||
if (ed->line_max == 0) line_init(ed);
|
||||
|
@ -1444,6 +1448,7 @@ edit_term(edit_data *ed)
|
|||
ecore_thread_cancel(ed->syntax_color_thread);
|
||||
ecore_timer_del(ed->syntax_color_timer);
|
||||
evas_object_del(ed->scroller);
|
||||
eina_stringshare_del(ed->filepath);
|
||||
|
||||
free(ed);
|
||||
|
||||
|
@ -1744,6 +1749,13 @@ edit_key_up_event_dispatch(edit_data *ed, const char *key)
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
edit_file_get(edit_data *ed)
|
||||
{
|
||||
return ed->filepath;
|
||||
}
|
||||
|
||||
void
|
||||
edit_selection_region_center_set(edit_data *ed, int start, int end)
|
||||
{
|
||||
|
|
|
@ -275,5 +275,6 @@ void edit_text_insert(edit_data *ed, const char *text);
|
|||
void edit_part_cursor_set(edit_data *ed, const char *group_name, const char *part_name);
|
||||
redoundo_data *edit_redoundo_get(edit_data *ed);
|
||||
void edit_selection_region_center_set(edit_data *ed, int start, int end);
|
||||
const char *edit_file_get(edit_data *ed);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -975,6 +975,9 @@ enventor_object_main_file_set(Enventor_Object *obj, const char *file)
|
|||
return &pd->main_it;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/* Enventor_Item Functions. */
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
Evas_Object *
|
||||
enventor_item_editor_get(const Enventor_Item *it)
|
||||
{
|
||||
|
@ -985,4 +988,15 @@ enventor_item_editor_get(const Enventor_Item *it)
|
|||
return edit_obj_get(it->ed);
|
||||
}
|
||||
|
||||
const char *
|
||||
enventor_item_file_get(const Enventor_Item *it)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(it, NULL);
|
||||
|
||||
if (!it->ed) return NULL;
|
||||
|
||||
return edit_file_get(it->ed);
|
||||
}
|
||||
|
||||
|
||||
#include "enventor_object.eo.c"
|
||||
|
|
Loading…
Reference in New Issue