Merge branch 'master' of git+ssh://git.enlightenment.org/tools/enventor
Conflicts: data/themes/default/images.edc data/themes/default/images/Makefile.am
2
AUTHORS
|
@ -2,3 +2,5 @@ Hermet (Chuneon Park) <hermet@hermet.pe.kr>
|
||||||
Cedric Bail <cedric.bail@free.fr>
|
Cedric Bail <cedric.bail@free.fr>
|
||||||
Raoul Hecky <raoul.hecky@gmail.com>
|
Raoul Hecky <raoul.hecky@gmail.com>
|
||||||
Daniel Juyung Seo <seojuyung2@gmail.com>
|
Daniel Juyung Seo <seojuyung2@gmail.com>
|
||||||
|
Ryuan Choi <ryuan.choi@gmail.com>
|
||||||
|
Jihoon Kim <jihoon48.kim@samsung.com>
|
||||||
|
|
1
README
|
@ -15,6 +15,7 @@ it does a lot.
|
||||||
ecore (>= 1.8.0)
|
ecore (>= 1.8.0)
|
||||||
edje (>= 1.8.0)
|
edje (>= 1.8.0)
|
||||||
eio (>= 1.8.0)
|
eio (>= 1.8.0)
|
||||||
|
efreet (>= 1.8.0)
|
||||||
elementary (>= 1.8.0)
|
elementary (>= 1.8.0)
|
||||||
|
|
||||||
Please note that some features may not quite function correctly or completely on
|
Please note that some features may not quite function correctly or completely on
|
||||||
|
|
|
@ -6,6 +6,90 @@ images {
|
||||||
image: "panes_recover_arrow.png" COMP;
|
image: "panes_recover_arrow.png" COMP;
|
||||||
image: "hotkeys_open.png" COMP;
|
image: "hotkeys_open.png" COMP;
|
||||||
image: "hotkeys_close.png" COMP;
|
image: "hotkeys_close.png" COMP;
|
||||||
|
image: "logo_s.png" COMP;
|
||||||
|
image: "new.png" COMP;
|
||||||
|
image: "load.png" COMP;
|
||||||
|
image: "save.png" COMP;
|
||||||
|
image: "lines.png" COMP;
|
||||||
|
image: "setting.png" COMP;
|
||||||
|
image: "status.png" COMP;
|
||||||
|
}
|
||||||
|
|
||||||
|
group { name: "status";
|
||||||
|
parts {
|
||||||
|
part { name: "img";
|
||||||
|
type: IMAGE;
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
image.normal: "status.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group { name: "setting";
|
||||||
|
parts {
|
||||||
|
part { name: "img";
|
||||||
|
type: IMAGE;
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
image.normal: "setting.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group { name: "lines";
|
||||||
|
parts {
|
||||||
|
part { name: "img";
|
||||||
|
type: IMAGE;
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
image.normal: "lines.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group { name: "save";
|
||||||
|
parts {
|
||||||
|
part { name: "img";
|
||||||
|
type: IMAGE;
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
image.normal: "save.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group { name: "load";
|
||||||
|
parts {
|
||||||
|
part { name: "img";
|
||||||
|
type: IMAGE;
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
image.normal: "load.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group { name: "new";
|
||||||
|
parts {
|
||||||
|
part { name: "img";
|
||||||
|
type: IMAGE;
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
image.normal: "new.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group { name: "logo";
|
||||||
|
parts {
|
||||||
|
part { name: "img";
|
||||||
|
type: IMAGE;
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
image.normal: "logo_s.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group { name: "hotkeys_open";
|
group { name: "hotkeys_open";
|
||||||
|
|
|
@ -61,4 +61,12 @@ EXTRA_DIST = \
|
||||||
panes_recover_arrow.png \
|
panes_recover_arrow.png \
|
||||||
hotkeys_close.png \
|
hotkeys_close.png \
|
||||||
hotkeys_open.png \
|
hotkeys_open.png \
|
||||||
pm_fill.png
|
pm_fill.png \
|
||||||
|
logo_s.png \
|
||||||
|
new.png \
|
||||||
|
load.png \
|
||||||
|
save.png \
|
||||||
|
lines.png \
|
||||||
|
setting.png \
|
||||||
|
status.png \
|
||||||
|
hotkey_inset_light.png
|
||||||
|
|
After Width: | Height: | Size: 148 B |
After Width: | Height: | Size: 540 B |
After Width: | Height: | Size: 587 B |
After Width: | Height: | Size: 876 B |
After Width: | Height: | Size: 494 B |
After Width: | Height: | Size: 593 B |
After Width: | Height: | Size: 631 B |
After Width: | Height: | Size: 549 B |
|
@ -4,6 +4,10 @@ styles {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
images {
|
||||||
|
image: "hotkey_inset_light.png" COMP;
|
||||||
|
}
|
||||||
|
|
||||||
group { name: "viewer_layout";
|
group { name: "viewer_layout";
|
||||||
parts {
|
parts {
|
||||||
part { name: "prev_clipper";
|
part { name: "prev_clipper";
|
||||||
|
@ -93,7 +97,7 @@ group { name: "slider_layout";
|
||||||
part { name: "elm.swallow.plus";
|
part { name: "elm.swallow.plus";
|
||||||
type: SWALLOW;
|
type: SWALLOW;
|
||||||
description { state: "default" 0.0;
|
description { state: "default" 0.0;
|
||||||
min: 20 20;
|
min: 24 24;
|
||||||
fixed: 1 1;
|
fixed: 1 1;
|
||||||
align: 0 0.5;
|
align: 0 0.5;
|
||||||
rel1.relative: 0.0 0.5;
|
rel1.relative: 0.0 0.5;
|
||||||
|
@ -103,14 +107,13 @@ group { name: "slider_layout";
|
||||||
part { name: "elm.swallow.minus";
|
part { name: "elm.swallow.minus";
|
||||||
type: SWALLOW;
|
type: SWALLOW;
|
||||||
description { state: "default" 0.0;
|
description { state: "default" 0.0;
|
||||||
min: 20 20;
|
min: 24 24;
|
||||||
fixed: 1 1;
|
fixed: 1 1;
|
||||||
align: 0 0.5;
|
align: 0 0.5;
|
||||||
rel1.to: "elm.swallow.plus";
|
rel1.to: "elm.swallow.plus";
|
||||||
rel2.to: "elm.swallow.plus";
|
rel2.to: "elm.swallow.plus";
|
||||||
rel1.relative: 1.0 0.5;
|
rel1.relative: 1.0 0.5;
|
||||||
rel2.relative: 1.0 0.5;
|
rel2.relative: 1.0 0.5;
|
||||||
rel1.offset: 1 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
part { name: "elm.swallow.slider";
|
part { name: "elm.swallow.slider";
|
||||||
|
@ -285,7 +288,7 @@ group { name: "main_layout";
|
||||||
description { state: "default" 0.0;
|
description { state: "default" 0.0;
|
||||||
rel1.relative: 0 0;
|
rel1.relative: 0 0;
|
||||||
rel2.relative: 1 0;
|
rel2.relative: 1 0;
|
||||||
min: 0 30;
|
min: 0 26;
|
||||||
fixed: 0 1;
|
fixed: 0 1;
|
||||||
align: 0.5 0;
|
align: 0.5 0;
|
||||||
}
|
}
|
||||||
|
@ -294,6 +297,18 @@ group { name: "main_layout";
|
||||||
align: 0.5 1;
|
align: 0.5 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
part { name: "hotkey_overlay";
|
||||||
|
type: IMAGE;
|
||||||
|
scale: 1;
|
||||||
|
mouse_events: 0;
|
||||||
|
description { state: "default" 0.0;
|
||||||
|
rel1.to: "elm.swallow.hotkeys";
|
||||||
|
rel2.to: "elm.swallow.hotkeys";
|
||||||
|
image.normal: "hotkey_inset_light.png";
|
||||||
|
image.border: 0 0 0 1;
|
||||||
|
image.border_scale: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
part { name: "elm.swallow.panes";
|
part { name: "elm.swallow.panes";
|
||||||
type: SWALLOW;
|
type: SWALLOW;
|
||||||
scale: 1;
|
scale: 1;
|
||||||
|
|
|
@ -2199,4 +2199,18 @@ group { name: "elm/panes/vertical/enventor";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
programs {
|
||||||
|
program { signal: "mouse,down,1"; source: "bar";
|
||||||
|
action: SIGNAL_EMIT "elm,action,press" "elm";
|
||||||
|
}
|
||||||
|
program { signal: "mouse,up,1"; source: "bar";
|
||||||
|
action: SIGNAL_EMIT "elm,action,unpress" "elm";
|
||||||
|
}
|
||||||
|
program { signal: "mouse,clicked,1"; source: "bar";
|
||||||
|
action: SIGNAL_EMIT "elm,action,click" "elm";
|
||||||
|
}
|
||||||
|
program { signal: "mouse,down,1,double"; source: "bar";
|
||||||
|
action: SIGNAL_EMIT "elm,action,click,double" "elm";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ enventor_SOURCES = \
|
||||||
edj_mgr.c \
|
edj_mgr.c \
|
||||||
build.c \
|
build.c \
|
||||||
hotkeys.c \
|
hotkeys.c \
|
||||||
|
search.c \
|
||||||
globals.c
|
globals.c
|
||||||
|
|
||||||
enventor_LDADD = @ENVENTOR_LIBS@
|
enventor_LDADD = @ENVENTOR_LIBS@
|
||||||
|
|
|
@ -74,6 +74,11 @@ void base_hotkeys_set(Evas_Object *hotkeys)
|
||||||
{
|
{
|
||||||
base_data *bd = g_bd;
|
base_data *bd = g_bd;
|
||||||
elm_object_part_content_set(bd->layout, "elm.swallow.hotkeys", hotkeys);
|
elm_object_part_content_set(bd->layout, "elm.swallow.hotkeys", hotkeys);
|
||||||
|
|
||||||
|
if (config_hotkeys_get())
|
||||||
|
elm_object_signal_emit(bd->layout, "elm,state,hotkeys,show", "");
|
||||||
|
else
|
||||||
|
elm_object_signal_emit(bd->layout, "elm,state,hotkeys,hide", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1,18 +1,6 @@
|
||||||
#include <Elementary.h>
|
#include <Elementary.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
const char *IMGPATH = "imgpath";
|
|
||||||
const char *SNDPATH = "sndpath";
|
|
||||||
const char *FNTPATH = "fntpath";
|
|
||||||
const char *DATPATH = "datpath";
|
|
||||||
const char *FNTSIZE = "fntsize";
|
|
||||||
const char *VIEWSCALE = "viewscale";
|
|
||||||
const char *STATSBAR = "statsbar";
|
|
||||||
const char *LINENUM = "linenum";
|
|
||||||
const char *HIGHLIGHT = "highlight";
|
|
||||||
const char *SWALLOW = "swallow";
|
|
||||||
const char *INDENT = "indent";
|
|
||||||
|
|
||||||
typedef struct config_s
|
typedef struct config_s
|
||||||
{
|
{
|
||||||
const char *edc_path;
|
const char *edc_path;
|
||||||
|
@ -34,15 +22,16 @@ typedef struct config_s
|
||||||
void *update_cb_data;
|
void *update_cb_data;
|
||||||
Evas_Coord_Size view_size;
|
Evas_Coord_Size view_size;
|
||||||
|
|
||||||
Eina_Bool stats_bar : 1;
|
Eina_Bool stats_bar;
|
||||||
Eina_Bool linenumber : 1;
|
Eina_Bool linenumber;
|
||||||
Eina_Bool part_highlight : 1;
|
Eina_Bool part_highlight;
|
||||||
Eina_Bool dummy_swallow : 1;
|
Eina_Bool dummy_swallow;
|
||||||
Eina_Bool auto_indent : 1;
|
Eina_Bool auto_indent;
|
||||||
Eina_Bool hotkeys : 1;
|
Eina_Bool hotkeys;
|
||||||
} config_data;
|
} config_data;
|
||||||
|
|
||||||
static config_data *g_cd = NULL;
|
static config_data *g_cd = NULL;
|
||||||
|
static Eet_Data_Descriptor *edd_base = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
config_edj_path_update(config_data *cd)
|
config_edj_path_update(config_data *cd)
|
||||||
|
@ -62,74 +51,11 @@ config_edj_path_update(config_data *cd)
|
||||||
eina_stringshare_replace(&cd->edj_path, edj_path);
|
eina_stringshare_replace(&cd->edj_path, edj_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Eina_Bool
|
|
||||||
config_load(config_data *cd)
|
|
||||||
{
|
|
||||||
char buf[PATH_MAX];
|
|
||||||
snprintf(buf, sizeof(buf), "%s/.enventor/config.eet", getenv("HOME"));
|
|
||||||
Eet_File *ef = eet_open(buf, EET_FILE_MODE_READ);
|
|
||||||
if (!ef)
|
|
||||||
{
|
|
||||||
EINA_LOG_ERR("Cannot load a config file \"%s\"", buf);
|
|
||||||
return EINA_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int size;
|
|
||||||
char *ret;
|
|
||||||
|
|
||||||
ret = eet_read(ef, IMGPATH, &size);
|
|
||||||
if (size > 0) { config_edc_img_path_set(ret); free(ret); }
|
|
||||||
ret = eet_read(ef, SNDPATH, &size);
|
|
||||||
if (size > 0) { config_edc_snd_path_set(ret); free(ret); }
|
|
||||||
ret = eet_read(ef, FNTPATH, &size);
|
|
||||||
if (size > 0) { config_edc_fnt_path_set(ret); free(ret); }
|
|
||||||
ret = eet_read(ef, DATPATH, &size);
|
|
||||||
if (size > 0) { config_edc_data_path_set(ret); free(ret); }
|
|
||||||
ret = eet_read(ef, FNTSIZE, &size);
|
|
||||||
if (size > 0) { cd->font_size = atof(ret); free(ret); }
|
|
||||||
ret = eet_read(ef, VIEWSCALE, &size);
|
|
||||||
if (size > 0) { cd->view_scale = atof(ret); free(ret); }
|
|
||||||
ret = eet_read(ef, STATSBAR, &size);
|
|
||||||
if (size > 0) { cd->stats_bar = (Eina_Bool) atoi(ret); free(ret); }
|
|
||||||
ret = eet_read(ef, LINENUM, &size);
|
|
||||||
if (size > 0) { cd->linenumber = (Eina_Bool) atoi(ret); free(ret); }
|
|
||||||
ret = eet_read(ef, HIGHLIGHT, &size);
|
|
||||||
if (size > 0) { cd->part_highlight = (Eina_Bool) atoi(ret); free(ret); }
|
|
||||||
ret = eet_read(ef, SWALLOW, &size);
|
|
||||||
if (size > 0) { cd->dummy_swallow = (Eina_Bool) atoi(ret); free(ret); }
|
|
||||||
ret = eet_read(ef, INDENT, &size);
|
|
||||||
if (size > 0) { cd->auto_indent = (Eina_Bool) atoi(ret); free(ret); }
|
|
||||||
|
|
||||||
eet_close(ef);
|
|
||||||
|
|
||||||
return EINA_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
edc_paths_write(Eet_File *ef, const char *key, Eina_List *paths,
|
|
||||||
Eina_Strbuf *strbuf)
|
|
||||||
{
|
|
||||||
Eina_List *l;
|
|
||||||
char *path;
|
|
||||||
|
|
||||||
eina_strbuf_reset(strbuf);
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(paths, l, path)
|
|
||||||
{
|
|
||||||
eina_strbuf_append(strbuf, path);
|
|
||||||
eina_strbuf_append(strbuf, ";");
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *str = eina_strbuf_string_get(strbuf);
|
|
||||||
eet_write(ef, key, str, strlen(str) + 1, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
config_save(config_data *cd)
|
config_save(config_data *cd)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
snprintf(buf, sizeof(buf), "%s/.enventor", getenv("HOME"));
|
snprintf(buf, sizeof(buf), "%s/enventor", efreet_config_home_get());
|
||||||
|
|
||||||
//Create config folder if it doesn't exist.
|
//Create config folder if it doesn't exist.
|
||||||
if (!ecore_file_exists(buf))
|
if (!ecore_file_exists(buf))
|
||||||
|
@ -143,7 +69,8 @@ config_save(config_data *cd)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Save config file.
|
//Save config file.
|
||||||
snprintf(buf, sizeof(buf), "%s/.enventor/config.eet", getenv("HOME"));
|
snprintf(buf, sizeof(buf), "%s/enventor/config.eet",
|
||||||
|
efreet_config_home_get());
|
||||||
Eet_File *ef = eet_open(buf, EET_FILE_MODE_WRITE);
|
Eet_File *ef = eet_open(buf, EET_FILE_MODE_WRITE);
|
||||||
if (!ef)
|
if (!ef)
|
||||||
{
|
{
|
||||||
|
@ -151,38 +78,130 @@ config_save(config_data *cd)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Use Eet Descriptor if the attributes are getting bigger and bigger
|
eet_data_write(ef, edd_base, "config", cd, 1);
|
||||||
Eina_Strbuf *strbuf = eina_strbuf_new();
|
|
||||||
edc_paths_write(ef, IMGPATH, cd->edc_img_path_list, strbuf);
|
|
||||||
edc_paths_write(ef, SNDPATH, cd->edc_snd_path_list, strbuf);
|
|
||||||
edc_paths_write(ef, FNTPATH, cd->edc_fnt_path_list, strbuf);
|
|
||||||
edc_paths_write(ef, DATPATH, cd->edc_data_path_list, strbuf);
|
|
||||||
eina_strbuf_free(strbuf);
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%f", cd->font_size);
|
|
||||||
eet_write(ef, FNTSIZE, buf, strlen(buf) + 1, 0);
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%f", cd->view_scale);
|
|
||||||
eet_write(ef, VIEWSCALE, buf, strlen(buf) + 1, 0);
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%d", cd->stats_bar);
|
|
||||||
eet_write(ef, STATSBAR, buf, strlen(buf) + 1, 0);
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%d", cd->linenumber);
|
|
||||||
eet_write(ef, LINENUM, buf, strlen(buf) + 1, 0);
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%d", cd->part_highlight);
|
|
||||||
eet_write(ef, HIGHLIGHT, buf, strlen(buf) + 1, 0);
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%d", cd->dummy_swallow);
|
|
||||||
eet_write(ef, SWALLOW, buf, strlen(buf) + 1, 0);
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%d", cd->auto_indent);
|
|
||||||
eet_write(ef, INDENT, buf, strlen(buf) + 1, 0);
|
|
||||||
|
|
||||||
eet_close(ef);
|
eet_close(ef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Eina_Strbuf *
|
||||||
|
config_paths_buf_set(Eina_List *paths, const char *prefix)
|
||||||
|
{
|
||||||
|
Eina_List *l;
|
||||||
|
const char *s;
|
||||||
|
|
||||||
|
Eina_Strbuf *buf = eina_strbuf_new();
|
||||||
|
|
||||||
|
EINA_LIST_FOREACH(paths, l, s)
|
||||||
|
{
|
||||||
|
eina_strbuf_append(buf, prefix);
|
||||||
|
eina_strbuf_append(buf, s);
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
static config_data *
|
||||||
|
config_load()
|
||||||
|
{
|
||||||
|
char buf[PATH_MAX];
|
||||||
|
snprintf(buf, sizeof(buf), "%s/enventor/config.eet",
|
||||||
|
efreet_config_home_get());
|
||||||
|
|
||||||
|
config_data *cd = NULL;
|
||||||
|
Eet_File *ef = eet_open(buf, EET_FILE_MODE_READ);
|
||||||
|
if (ef)
|
||||||
|
{
|
||||||
|
cd = eet_data_read(ef, edd_base, "config");
|
||||||
|
eet_close(ef);
|
||||||
|
}
|
||||||
|
else EINA_LOG_ERR("Cannot load a config file \"%s\"", buf);
|
||||||
|
|
||||||
|
//failed to load config file. set default values.
|
||||||
|
if (!cd)
|
||||||
|
{
|
||||||
|
cd = calloc(1, sizeof(config_data));
|
||||||
|
|
||||||
|
cd->font_size = 1.0f;
|
||||||
|
cd->view_scale = 1;
|
||||||
|
cd->stats_bar = EINA_TRUE;
|
||||||
|
cd->linenumber = EINA_TRUE;
|
||||||
|
cd->part_highlight = EINA_TRUE;
|
||||||
|
cd->dummy_swallow = EINA_TRUE;
|
||||||
|
cd->auto_indent = EINA_TRUE;
|
||||||
|
cd->hotkeys = EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_cd = cd;
|
||||||
|
|
||||||
|
if (!cd->edc_img_path_list)
|
||||||
|
{
|
||||||
|
sprintf(buf, "%s/images", elm_app_data_dir_get());
|
||||||
|
config_edc_img_path_set(buf);
|
||||||
|
}
|
||||||
|
else cd->edc_img_path_buf =
|
||||||
|
config_paths_buf_set(cd->edc_img_path_list, " -id ");
|
||||||
|
|
||||||
|
if (!cd->edc_snd_path_list)
|
||||||
|
{
|
||||||
|
sprintf(buf, "%s/sounds", elm_app_data_dir_get());
|
||||||
|
config_edc_snd_path_set(buf);
|
||||||
|
}
|
||||||
|
else cd->edc_snd_path_buf =
|
||||||
|
config_paths_buf_set(cd->edc_snd_path_list, " -sd ");
|
||||||
|
|
||||||
|
if (!cd->edc_fnt_path_list)
|
||||||
|
{
|
||||||
|
sprintf(buf, "%s/fonts", elm_app_data_dir_get());
|
||||||
|
config_edc_fnt_path_set(buf);
|
||||||
|
}
|
||||||
|
else cd->edc_fnt_path_buf =
|
||||||
|
config_paths_buf_set(cd->edc_fnt_path_list, " -fd ");
|
||||||
|
|
||||||
|
if (!cd->edc_data_path_list)
|
||||||
|
{
|
||||||
|
sprintf(buf, "%s/data", elm_app_data_dir_get());
|
||||||
|
config_edc_data_path_set(buf);
|
||||||
|
}
|
||||||
|
else cd->edc_data_path_buf =
|
||||||
|
config_paths_buf_set(cd->edc_data_path_list, " -dd ");
|
||||||
|
|
||||||
|
return cd;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
eddc_init()
|
||||||
|
{
|
||||||
|
Eet_Data_Descriptor_Class eddc;
|
||||||
|
eet_eina_stream_data_descriptor_class_set(&eddc, sizeof(eddc),
|
||||||
|
"config", sizeof(config_data));
|
||||||
|
edd_base = eet_data_descriptor_stream_new(&eddc);
|
||||||
|
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_LIST_STRING(edd_base, config_data,
|
||||||
|
"edc_img_path_list", edc_img_path_list);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_LIST_STRING(edd_base, config_data,
|
||||||
|
"edc_snd_path_list", edc_snd_path_list);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_LIST_STRING(edd_base, config_data,
|
||||||
|
"edc_fnt_path_list", edc_fnt_path_list);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_LIST_STRING(edd_base, config_data,
|
||||||
|
"edc_data_path_list",
|
||||||
|
edc_data_path_list);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "font_size", font_size,
|
||||||
|
EET_T_FLOAT);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "view_scale",
|
||||||
|
view_scale, EET_T_DOUBLE);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "stats_bar", stats_bar,
|
||||||
|
EET_T_UCHAR);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "linenumber",
|
||||||
|
linenumber, EET_T_UCHAR);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "part_highlight",
|
||||||
|
part_highlight, EET_T_UCHAR);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "dummy_swallow",
|
||||||
|
dummy_swallow, EET_T_UCHAR);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "auto_indent",
|
||||||
|
auto_indent, EET_T_UCHAR);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(edd_base, config_data, "hotkeys",
|
||||||
|
hotkeys, EET_T_UCHAR);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
config_edc_path_set(const char *edc_path)
|
config_edc_path_set(const char *edc_path)
|
||||||
{
|
{
|
||||||
|
@ -196,30 +215,16 @@ config_init(const char *edc_path, const char *edc_img_path,
|
||||||
const char *edc_snd_path, const char *edc_fnt_path,
|
const char *edc_snd_path, const char *edc_fnt_path,
|
||||||
const char *edc_data_path)
|
const char *edc_data_path)
|
||||||
{
|
{
|
||||||
config_data *cd = calloc(1, sizeof(config_data));
|
eddc_init();
|
||||||
|
|
||||||
|
config_data *cd = config_load();
|
||||||
g_cd = cd;
|
g_cd = cd;
|
||||||
|
|
||||||
cd->edc_path = eina_stringshare_add(edc_path);
|
if (edc_path[0]) config_edc_path_set(edc_path);
|
||||||
config_edj_path_update(cd);
|
if (edc_img_path[0]) config_edc_img_path_set(edc_img_path);
|
||||||
|
if (edc_snd_path[0]) config_edc_snd_path_set(edc_snd_path);
|
||||||
if (!config_load(cd))
|
if (edc_fnt_path[0]) config_edc_fnt_path_set(edc_fnt_path);
|
||||||
{
|
if (edc_data_path[0]) config_edc_data_path_set(edc_data_path);
|
||||||
//failed to load config file. set default values.
|
|
||||||
cd->font_size = 1.0f;
|
|
||||||
cd->view_scale = 1;
|
|
||||||
cd->linenumber = EINA_TRUE;
|
|
||||||
cd->part_highlight = EINA_TRUE;
|
|
||||||
cd->dummy_swallow = EINA_TRUE;
|
|
||||||
cd->auto_indent = EINA_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (edc_img_path) config_edc_img_path_set(edc_img_path);
|
|
||||||
if (edc_snd_path) config_edc_snd_path_set(edc_snd_path);
|
|
||||||
if (edc_fnt_path) config_edc_fnt_path_set(edc_fnt_path);
|
|
||||||
if (edc_data_path) config_edc_data_path_set(edc_data_path);
|
|
||||||
|
|
||||||
//hotkey is not decided yet to keep the function or not.
|
|
||||||
cd->hotkeys = EINA_TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -260,6 +265,7 @@ config_term()
|
||||||
if (cd->edc_fnt_path_buf) eina_strbuf_free(cd->edc_fnt_path_buf);
|
if (cd->edc_fnt_path_buf) eina_strbuf_free(cd->edc_fnt_path_buf);
|
||||||
if (cd->edc_data_path_buf) eina_strbuf_free(cd->edc_data_path_buf);
|
if (cd->edc_data_path_buf) eina_strbuf_free(cd->edc_data_path_buf);
|
||||||
|
|
||||||
|
eet_data_descriptor_free(edd_base);
|
||||||
free(cd);
|
free(cd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -793,7 +793,8 @@ edit_edc_read(edit_data *ed, const char *file_path)
|
||||||
Eina_Stringshare *group_name =
|
Eina_Stringshare *group_name =
|
||||||
parser_first_group_name_get(ed->pd, ed->en_edit);
|
parser_first_group_name_get(ed->pd, ed->en_edit);
|
||||||
|
|
||||||
stats_edc_group_set(group_name);
|
stats_edc_group_update(group_name);
|
||||||
|
stats_line_num_update(0, ed->line_max);
|
||||||
base_title_set(config_edc_path_get());
|
base_title_set(config_edc_path_get());
|
||||||
|
|
||||||
ecore_animator_add(syntax_color_timer_cb, ed);
|
ecore_animator_add(syntax_color_timer_cb, ed);
|
||||||
|
|
|
@ -55,7 +55,7 @@ f12_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
btn_create(Evas_Object *parent, const char *text, Evas_Smart_Cb cb, void *data)
|
btn_create(Evas_Object *parent, const char *text, Evas_Smart_Cb cb, void *data, const char *img_name)
|
||||||
{
|
{
|
||||||
Evas_Object *btn = elm_button_add(parent);
|
Evas_Object *btn = elm_button_add(parent);
|
||||||
elm_object_style_set(btn, "anchor");
|
elm_object_style_set(btn, "anchor");
|
||||||
|
@ -66,6 +66,10 @@ btn_create(Evas_Object *parent, const char *text, Evas_Smart_Cb cb, void *data)
|
||||||
evas_object_smart_callback_add(btn, "clicked", cb, data);
|
evas_object_smart_callback_add(btn, "clicked", cb, data);
|
||||||
evas_object_show(btn);
|
evas_object_show(btn);
|
||||||
|
|
||||||
|
Evas_Object *img = elm_image_add(btn);
|
||||||
|
elm_image_file_set(img, EDJE_PATH, img_name);
|
||||||
|
elm_object_content_set(btn, img);
|
||||||
|
|
||||||
return btn;
|
return btn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,40 +82,40 @@ hotkeys_create(Evas_Object *parent, edit_data *ed)
|
||||||
|
|
||||||
Evas_Object *btn;
|
Evas_Object *btn;
|
||||||
|
|
||||||
btn = btn_create(box, "F1: About", f1_cb, NULL);
|
btn = btn_create(box, "About", f1_cb, NULL, "logo");
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F2: New", f2_cb, NULL);
|
btn = btn_create(box, "New", f2_cb, NULL, "new");
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F3: Save", f3_cb, NULL);
|
btn = btn_create(box, "Save", f3_cb, NULL, "save");
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F4: Load", f4_cb, NULL);
|
btn = btn_create(box, "Load", f4_cb, NULL, "load");
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F5: Line Num", f5_cb, ed);
|
btn = btn_create(box, "Lines", f5_cb, ed, "lines");
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F6: Status", f6_cb, NULL);
|
btn = btn_create(box, "Status", f6_cb, NULL, "status");
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F7: ---", NULL, NULL);
|
btn = btn_create(box, "---", NULL, NULL, NULL);
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F8: ---", NULL, NULL);
|
btn = btn_create(box, "---", NULL, NULL, NULL);
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F9: ---", NULL, NULL);
|
btn = btn_create(box, "---", NULL, NULL, NULL);
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F10: ---", NULL, NULL);
|
btn = btn_create(box, "---", NULL, NULL, NULL);
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F11: ---", NULL, NULL);
|
btn = btn_create(box, "---", NULL, NULL, NULL);
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
btn = btn_create(box, "F12: Setting", f12_cb, NULL);
|
btn = btn_create(box, "Setting", f12_cb, NULL, "setting");
|
||||||
elm_box_pack_end(box, btn);
|
elm_box_pack_end(box, btn);
|
||||||
|
|
||||||
return box;
|
return box;
|
||||||
|
|
|
@ -162,6 +162,12 @@ ctrl_func(app_data *ad, const char *key)
|
||||||
//Go to Begin/End
|
//Go to Begin/End
|
||||||
if (!strcmp(key, "Home") || !strcmp(key, "End"))
|
if (!strcmp(key, "Home") || !strcmp(key, "End"))
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
//Find/Replace
|
||||||
|
if (!strcmp(key, "f") || !strcmp(key, "F"))
|
||||||
|
{
|
||||||
|
search_edit_word(ad->ed, "RECT");
|
||||||
|
return ECORE_CALLBACK_DONE;
|
||||||
|
}
|
||||||
//Template Code
|
//Template Code
|
||||||
if (!strcmp(key, "t") || !strcmp(key, "T"))
|
if (!strcmp(key, "t") || !strcmp(key, "T"))
|
||||||
{
|
{
|
||||||
|
@ -336,7 +342,7 @@ edc_view_set(Eina_Stringshare *group)
|
||||||
|
|
||||||
if (!vd) return;
|
if (!vd) return;
|
||||||
|
|
||||||
if (group) stats_edc_group_set(group);
|
if (group) stats_edc_group_update(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -403,10 +409,6 @@ args_dispatch(int argc, char **argv, char *edc_path, char *img_path,
|
||||||
char *snd_path, char *fnt_path, char *data_path)
|
char *snd_path, char *fnt_path, char *data_path)
|
||||||
{
|
{
|
||||||
Eina_Bool default_edc = EINA_TRUE;
|
Eina_Bool default_edc = EINA_TRUE;
|
||||||
Eina_Bool default_img = EINA_TRUE;
|
|
||||||
Eina_Bool default_snd = EINA_TRUE;
|
|
||||||
Eina_Bool default_fnt = EINA_TRUE;
|
|
||||||
Eina_Bool default_data = EINA_TRUE;
|
|
||||||
|
|
||||||
//No arguments. set defaults
|
//No arguments. set defaults
|
||||||
if (argc == 1) goto defaults;
|
if (argc == 1) goto defaults;
|
||||||
|
@ -434,45 +436,29 @@ args_dispatch(int argc, char **argv, char *edc_path, char *img_path,
|
||||||
if (argc > (cur_arg + 1))
|
if (argc > (cur_arg + 1))
|
||||||
{
|
{
|
||||||
if (!strcmp("-id", argv[cur_arg]))
|
if (!strcmp("-id", argv[cur_arg]))
|
||||||
{
|
sprintf(img_path, "%s", argv[cur_arg + 1]);
|
||||||
sprintf(img_path, "%s", argv[cur_arg + 1]);
|
|
||||||
default_img = EINA_FALSE;
|
|
||||||
}
|
|
||||||
else if (!strcmp("-sd", argv[cur_arg]))
|
else if (!strcmp("-sd", argv[cur_arg]))
|
||||||
{
|
sprintf(snd_path, "%s", argv[cur_arg + 1]);
|
||||||
sprintf(snd_path, "%s", argv[cur_arg + 1]);
|
|
||||||
default_snd = EINA_FALSE;
|
|
||||||
}
|
|
||||||
else if (!strcmp("-fd", argv[cur_arg]))
|
else if (!strcmp("-fd", argv[cur_arg]))
|
||||||
{
|
sprintf(fnt_path, "%s", argv[cur_arg + 1]);
|
||||||
sprintf(fnt_path, "%s", argv[cur_arg + 1]);
|
|
||||||
default_fnt = EINA_FALSE;
|
|
||||||
}
|
|
||||||
else if (!strcmp("-dd", argv[cur_arg]))
|
else if (!strcmp("-dd", argv[cur_arg]))
|
||||||
{
|
sprintf(data_path, "%s", argv[cur_arg + 1]);
|
||||||
sprintf(data_path, "%s", argv[cur_arg + 1]);
|
|
||||||
default_data = EINA_FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
cur_arg += 2;
|
cur_arg += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
if (default_edc) sprintf(edc_path, "%s", PROTO_EDC_PATH);
|
if (default_edc) sprintf(edc_path, "%s", PROTO_EDC_PATH);
|
||||||
if (default_img) sprintf(img_path, "%s/images", elm_app_data_dir_get());
|
|
||||||
if (default_snd) sprintf(snd_path, "%s/sounds", elm_app_data_dir_get());
|
|
||||||
if (default_fnt) sprintf(fnt_path, "%s/fonts", elm_app_data_dir_get());
|
|
||||||
if (default_data) sprintf(data_path, "%s/data", elm_app_data_dir_get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
config_data_set(app_data *ad, int argc, char **argv)
|
config_data_set(app_data *ad, int argc, char **argv)
|
||||||
{
|
{
|
||||||
char edc_path[PATH_MAX];
|
char edc_path[PATH_MAX] = { 0, };
|
||||||
char img_path[PATH_MAX];
|
char img_path[PATH_MAX] = { 0, };
|
||||||
char snd_path[PATH_MAX];
|
char snd_path[PATH_MAX] = { 0, };
|
||||||
char fnt_path[PATH_MAX];
|
char fnt_path[PATH_MAX] = { 0, };
|
||||||
char data_path[PATH_MAX];
|
char data_path[PATH_MAX] = { 0, };
|
||||||
|
|
||||||
args_dispatch(argc, argv, edc_path, img_path, snd_path, fnt_path, data_path);
|
args_dispatch(argc, argv, edc_path, img_path, snd_path, fnt_path, data_path);
|
||||||
config_init(edc_path, img_path, snd_path, fnt_path, data_path);
|
config_init(edc_path, img_path, snd_path, fnt_path, data_path);
|
||||||
|
@ -482,6 +468,7 @@ config_data_set(app_data *ad, int argc, char **argv)
|
||||||
static void
|
static void
|
||||||
elm_setup()
|
elm_setup()
|
||||||
{
|
{
|
||||||
|
elm_need_efreet();
|
||||||
elm_config_profile_set("standard");
|
elm_config_profile_set("standard");
|
||||||
|
|
||||||
/* Recover the scale & theme since it will be reset by
|
/* Recover the scale & theme since it will be reset by
|
||||||
|
|
|
@ -547,7 +547,7 @@ about_open(menu_data *md)
|
||||||
|
|
||||||
elm_object_part_content_set(layout, "elm.swallow.entry", entry);
|
elm_object_part_content_set(layout, "elm.swallow.entry", entry);
|
||||||
|
|
||||||
elm_entry_entry_append(entry, "<color=#ffffff><font_size=12>");
|
elm_entry_entry_append(entry, "<color=#ffffff>");
|
||||||
|
|
||||||
//Read README
|
//Read README
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
void
|
||||||
|
search_edit_word(edit_data *ed, const char *word)
|
||||||
|
{
|
||||||
|
printf("search word - %s\n", word);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
|
@ -25,7 +25,7 @@ stats_line_num_update(int cur_line, int max_line)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
stats_edc_group_set(Eina_Stringshare *group_name)
|
stats_edc_group_update(Eina_Stringshare *group_name)
|
||||||
{
|
{
|
||||||
stats_data *sd = g_sd;
|
stats_data *sd = g_sd;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ stats_init(Evas_Object *parent)
|
||||||
sd->layout = layout;
|
sd->layout = layout;
|
||||||
|
|
||||||
stats_cursor_pos_update(0, 0, 0, 0);
|
stats_cursor_pos_update(0, 0, 0, 0);
|
||||||
stats_edc_group_set(NULL);
|
stats_edc_group_update(NULL);
|
||||||
|
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,4 +18,5 @@ EXTRA_DIST = common.h \
|
||||||
indent.h \
|
indent.h \
|
||||||
syntax_helper.h \
|
syntax_helper.h \
|
||||||
template_code.h \
|
template_code.h \
|
||||||
hotkeys.h
|
hotkeys.h \
|
||||||
|
search.h
|
||||||
|
|
|
@ -26,5 +26,6 @@ typedef struct indent_s indent_data;
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
#include "hotkeys.h"
|
#include "hotkeys.h"
|
||||||
#include "base_gui.h"
|
#include "base_gui.h"
|
||||||
|
#include "search.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -5,5 +5,5 @@ void stats_cursor_pos_update(Evas_Coord x, Evas_Coord y, float rel_x, float rel_
|
||||||
void stats_info_msg_update(const char *msg);
|
void stats_info_msg_update(const char *msg);
|
||||||
void stats_line_num_update(int cur_line, int max_line);
|
void stats_line_num_update(int cur_line, int max_line);
|
||||||
Evas_Object *stats_obj_get();
|
Evas_Object *stats_obj_get();
|
||||||
void stats_edc_group_set(const char *group_name);
|
void stats_edc_group_update(const char *group_name);
|
||||||
Eina_Stringshare *stats_group_name_get();
|
Eina_Stringshare *stats_group_name_get();
|
||||||
|
|