enventor - added HELP function

This commit is contained in:
ChunEon Park 2013-07-21 15:56:44 +09:00
parent 4e8689163c
commit 9752938d54
5 changed files with 196 additions and 89 deletions

60
README
View File

@ -1,13 +1,15 @@
Enventor: The Edc Editor v0.1
********************************************************************************
FOR ANY ISSUES PLEASE EMAIL:
enlightenment-devel@lists.sourceforge.net
********************************************************************************
This is an EDC editor with some convenient functions. It's brand new and was
only started near the begining of June 2013, so expecting it to do everything a
mature script editor does is a bit premature, but considering it's
young age, it does a lot.
-------------------------------------------------------------------------------
Requirements:
-------------
-------------------------------------------------------------------------------
eina (>= 1.7.0)
eet (>= 1.7.0)
evas (>= 1.7.0)
@ -16,28 +18,26 @@ Requirements:
edje (>= 1.7.0)
eio (>= 1.7.0)
elementary (>= 1.7.0)
Please not that some features may not quite function correctly or completely on
EFL 1.7, and 1.8 or newer would be better.
Please see http://www.enlightenment.org for information on these.
This is an EDC editor with some convenient functions. It's brand new and was
only started near the begining of June 2013, so expecting it to do everything a
mature script editor does is a bit premature, but considering it's
young age, it does a lot.
--------------------------------------------------------------------------------
Compiling:
----------
--------------------------------------------------------------------------------
Once you have met requirements, copiling and installing is simple:
./build.sh
--------------------------------------------------------------------------------
Short Cut Keys:
---------------
--------------------------------------------------------------------------------
Esc = Open/Close Menu
F5 = Show/Hide Line Number
F6 = Show/Hide Status
@ -54,10 +54,16 @@ Ctrl+, = Full Edit View
Ctrl+. = Full Edje View
Ctrl+/ = Split View
Ctrl+W = Show/Hide Dummy Swallow Object
--------------------------------------------------------------------------------
Command Line Usage:
-------------------
--------------------------------------------------------------------------------
enventor --help
enventor [input file] [-id image path] [-sd sound path]
* FOR ANY ISSUES PLEASE EMAIL *
enlightenment-devel@lists.sourceforge.net

Binary file not shown.

View File

@ -8,12 +8,91 @@ images {
group { name: "help_layout";
parts {
part { name: "clipper";
type: RECT;
description { state: "default" 0.0;
color: 127 127 127 127;
}
description { state: "show" 0.0;
color: 255 255 255 255;
}
}
part { name: "bg";
type: RECT;
clip_to: "clipper";
description { state: "default" 0.0;
color: 0 0 0 175;
}
}
part { name: "left_top_padding";
type: SPACER;
scale: 1;
description { state: "default" 0.0;
min: 10 10;
fixed: 1 1;
align: 0 0;
rel2.relative: 0 0;
}
}
part { name: "right_bottom_padding";
type: SPACER;
scale: 1;
description { state: "default" 0.0;
min: 10 10;
fixed: 1 1;
align: 1 1;
rel1.relative: 1 1;
}
}
part { name: "elm.swallow.entry";
type: SWALLOW;
scale: 1;
clip_to: "clipper";
description { state: "default" 0.0;
rel1.to: "left_top_padding";
rel1.relative: 1 1;
rel2.to: "right_bottom_padding";
rel2.relative: 0 0;
}
}
part { name: "event_blocker";
type: RECT;
description { state: "default" 0.0;
color: 0 0 0 0;
visible: 1;
}
description { state: "hide" 0.0;
inherit: "default" 0.0;
visible: 0;
}
}
}
programs {
program { name: "load";
signal: "load";
action: STATE_SET "show" 0.0;
transition: "DECELERATE" 0.5;
target: "clipper";
after: "event_blocker_hide";
}
program { name: "dismiss";
signal: "elm,state,dismiss";
source: "";
action: STATE_SET "default" 0.0;
// transition: "DECELERATE" 0.125;
target: "clipper";
target: "event_blocker";
after: "dismiss_done";
}
program { name: "event_blocker_hide";
signal: "elm,state,event_blocker,hide";
source: "";
action: STATE_SET "hide" 0.0;
target: "event_blocker";
}
program { name: "dismiss_done";
action: SIGNAL_EMIT "elm,state,dismiss,done" "";
}
}
}

View File

@ -104,13 +104,8 @@ styles
}
*/
}
/*
group { name: "elm/scroller/entry/enventor";
data {
item: "focus_highlight" "on";
}
script {
public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer;
public timer0(val) {
@ -254,41 +249,6 @@ group { name: "elm/scroller/entry/enventor";
}
}
}
part { name: "conf_over";
mouse_events: 0;
description { state: "default" 0.0;
rel1.to: "bg";
rel2.to: "bg";
image {
normal: "shelf_inset.png";
border: 7 7 7 7;
middle: 0;
}
fill.smooth : 0;
}
description { state: "enabled" 0.0;
inherit: "default" 0.0;
color: 200 155 0 255;
}
}
part { name: "focus_highlight";
mouse_events: 0;
description { state: "default" 0.0;
rel1.offset: -1 -1;
rel2.offset: 0 0;
image {
normal: "sl_bt2_2.png";
border: 7 7 7 7;
middle: 0;
}
fill.smooth : 0;
color: 200 155 0 0;
}
description { state: "enabled" 0.0;
inherit: "default" 0.0;
color: 200 155 0 255;
}
}
part { name: "sb_vbar_clip_master";
type: RECT;
mouse_events: 0;
@ -660,26 +620,9 @@ group { name: "elm/scroller/entry/enventor";
set_int(sbvis_timer, v);
}
}
program { name: "highlight_show";
signal: "elm,action,focus_highlight,show";
source: "elm";
action: STATE_SET "enabled" 0.0;
transition: ACCELERATE 0.3;
target: "focus_highlight";
target: "conf_over";
}
program { name: "highlight_hide";
signal: "elm,action,focus_highlight,hide";
source: "elm";
action: STATE_SET "default" 0.0;
transition: DECELERATE 0.3;
target: "focus_highlight";
target: "conf_over";
}
}
}
*/
group { name: "elm/entry/base/enventor";
parts {
part { name: "elm.text";

View File

@ -8,6 +8,7 @@ struct menu_s
Evas_Object *setting_layout;
Evas_Object *warning_layout;
Evas_Object *fileselector_layout;
Evas_Object *help_layout;
Evas_Object *img_path_entry;
Evas_Object *snd_path_entry;
Evas_Object *toggle_stats;
@ -44,6 +45,12 @@ fileselector_close(menu_data *md)
elm_object_signal_emit(md->fileselector_layout, "elm,state,dismiss", "");
}
static void
help_close(menu_data *md)
{
elm_object_signal_emit(md->help_layout, "elm,state,dismiss", "");
}
static void
setting_close(menu_data *md)
{
@ -86,12 +93,27 @@ setting_dismiss_done(void *data, Evas_Object *obj EINA_UNUSED,
const char *source EINA_UNUSED)
{
menu_data *md = data;
evas_object_del(md->setting_layout);
md->setting_layout = NULL;
evas_object_del(md->help_layout);
md->help_layout = NULL;
elm_object_disabled_set(md->menu_layout, EINA_FALSE);
elm_object_focus_set(md->menu_layout, EINA_TRUE);
}
static void
help_dismiss_done(void *data, Evas_Object *obj EINA_UNUSED,
const char *emission EINA_UNUSED,
const char *source EINA_UNUSED)
{
menu_data *md = data;
evas_object_del(md->help_layout);
md->help_layout = NULL;
if (md->menu_layout)
{
elm_object_disabled_set(md->menu_layout, EINA_FALSE);
elm_object_focus_set(md->menu_layout, EINA_TRUE);
}
}
static void
menu_dismiss_done(void *data, Evas_Object *obj EINA_UNUSED,
const char *emission EINA_UNUSED,
@ -413,10 +435,62 @@ help_open(menu_data *md)
Evas_Object *layout = elm_layout_add(md->win);
elm_layout_file_set(layout, EDJE_PATH, "help_layout");
elm_object_signal_callback_add(layout, "elm,state,dismiss,done", "",
setting_dismiss_done, md);
help_dismiss_done, md);
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(md->win, layout);
evas_object_show(layout);
//Entry
Evas_Object *entry = elm_entry_add(layout);
elm_object_style_set(entry, elm_app_name_get());
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_entry_line_wrap_set(entry, EINA_TRUE);
evas_object_show(entry);
elm_object_part_content_set(layout, "elm.swallow.entry", entry);
elm_entry_entry_append(entry, "<color=#ffffff><font_size=12>");
//Read README
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/docs/README", elm_app_data_dir_get());
Eina_File *file = eina_file_open(buf, EINA_FALSE);
if (!file) goto err;
Eina_Iterator *itr = eina_file_map_lines(file);
if (!itr) goto err;
Eina_Strbuf *strbuf = eina_strbuf_new();
if (!strbuf) goto err;
Eina_File_Line *line;
int line_num = 0;
EINA_ITERATOR_FOREACH(itr, line)
{
//Append edc code
if (line_num > 0)
{
if (!eina_strbuf_append(strbuf, "<br/>")) goto err;
}
if (!eina_strbuf_append_length(strbuf, line->start, line->length))
goto err;
line_num++;
}
elm_entry_entry_append(entry, eina_strbuf_string_get(strbuf));
elm_entry_entry_append(entry, "</font_size></color>");
if (md->menu_layout)
elm_object_disabled_set(md->menu_layout, EINA_TRUE);
md->help_layout = layout;
err:
if (strbuf) eina_strbuf_free(strbuf);
if (itr) eina_iterator_free(itr);
if (file) eina_file_close(file);
}
static void
@ -746,6 +820,11 @@ menu_option_toggle()
fileselector_close(md);
return EINA_TRUE;
}
else if (md->help_layout)
{
help_close(md);
return EINA_TRUE;
}
}
//Ctxpopup