about - use entry_file_set() instead of direct file accessing.

This changes enventor makes much simpler to maintaining code.
Additionally, the about file should have been markup format.
Previously, it used to use markup partially so its format was ambigious.
This commit is contained in:
Hermet Park 2016-01-25 15:56:20 +09:00
parent 0c15bde219
commit c79a0aa4e5
2 changed files with 91 additions and 125 deletions

View File

@ -1,89 +1,89 @@
<font_size=11><b>[Enventor v0.7.0]</b></font_size> <font_size=11><b>[Enventor v0.7.0]</b></font_size></br>
</br>
This is an EDC editor with some convenient functions. It was started near the begining of June 2013, so expecting it to do everything a mature script editor does is a bit premature. However, considering its young age, it does a lot. This is an EDC editor with some convenient functions. It was started near the begining of June 2013, so expecting it to do everything a mature script editor does is a bit premature. However, considering its young age, it does a lot.</br>
</br>
Please see the following sites for more information. Please see the following sites for more information.</br>
</br>
http://www.enlightenment.org http://www.enlightenment.org</br>
https://phab.enlightenment.org/w/projects/enventor/ https://phab.enlightenment.org/w/projects/enventor/</br>
http://www.openhub.net/p/enventor http://www.openhub.net/p/enventor</br>
</br>
</br>
<font_size=11><b>[Short Cut Keys]</b></font_size> <font_size=11><b>[Short Cut Keys]</b></font_size></br>
</br>
Esc - Open/Close Menu Esc - Open/Close Menu</br>
F1 - About F1 - About</br>
F2 - New F2 - New</br>
F3 - Save F3 - Save</br>
F4 - Load F4 - Load</br>
F5 - Show/Hide Line Number F5 - Show/Hide Line Number</br>
F9 - Show/Hide Tools F9 - Show/Hide Tools</br>
F10 - Show/Hide Console F10 - Show/Hide Console</br>
F11 - Show/Hide Status F11 - Show/Hide Status</br>
F12 - Settings F12 - Settings</br>
</br>
Ctrl+S - Quick Save + Update Live View Ctrl+S - Quick Save + Update Live View</br>
Ctrl+I - On/Off Auto Indentation Ctrl+I - On/Off Auto Indentation</br>
Ctrl+O - On/Off Auto Completion Ctrl+O - On/Off Auto Completion</br>
Ctrl+W - Show/Hide Dummy Parts Ctrl+W - Show/Hide Dummy Parts</br>
Ctrl+H - On/Off Part Highlighting Ctrl+H - On/Off Part Highlighting</br>
Ctrl+T - Insert Defaut Template Code Ctrl+T - Insert Defaut Template Code</br>
Ctrl+Mouse Wheel Up - View Zoom In (Only if view size is set) / Font Size Up Ctrl+Mouse Wheel Up - View Zoom In (Only if view size is set) / Font Size Up</br>
Ctrl+Mouse Wheel Down - View Zoom Out (Only if view size is set) / Font Size Down Ctrl+Mouse Wheel Down - View Zoom Out (Only if view size is set) / Font Size Down</br>
</br>
Alt+Left - On/Off Full Edit View Alt+Left - On/Off Full Edit View</br>
Alt+Right - On/Off Full Live View Alt+Right - On/Off Full Live View</br>
Alt+Up - On/Off Full Console View Alt+Up - On/Off Full Console View</br>
Alt+Down - On/Off Full Editors View Alt+Down - On/Off Full Editors View</br>
</br>
Ctrl+A - Select Text All Ctrl+A - Select Text All</br>
Ctrl+Double Click - Select a word Ctrl+Double Click - Select a word</br>
Ctrl+Z - Undo Text Ctrl+Z - Undo Text</br>
Ctrl+R - Redo Text Ctrl+R - Redo Text</br>
Ctrl+C - Copy Selected Text Ctrl+C - Copy Selected Text</br>
Ctrl+V - Paste Copied Text Ctrl+V - Paste Copied Text</br>
Ctrl+X - Cut Selected Text Ctrl+X - Cut Selected Text</br>
Ctrl+D - Delete a Current line Ctrl+D - Delete a Current line</br>
Ctrl+F - Find/Replace Ctrl+F - Find/Replace</br>
Ctrl+L - Go to line Ctrl+L - Go to line</br>
Ctrl+Home - Go to the Top line Ctrl+Home - Go to the Top line</br>
Ctrl+End - Go to the Bottom line Ctrl+End - Go to the Bottom line</br>
Ctrl+Space - Search candidate keywords in the context Ctrl+Space - Search candidate keywords in the context</br>
</br>
</br>
<font_size=11><b>[Command Line Usage]</b></font_size> <font_size=11><b>[Command Line Usage]</b></font_size></br>
</br>
enventor --help enventor --help</br>
enventor [input file] [output file] [-t] [-i image path] [-s sound path] [-f font path] [-d data path] enventor [input file] [output file] [-t] [-i image path] [-s sound path] [-f font path] [-d data path]</br>
</br>
input file = EDC file to open. If input file is skipped, Enventor will open a default template code with a temporary file. input file = EDC file to open. If input file is skipped, Enventor will open a default template code with a temporary file.</br>
output file = EDJ file to store compiled file. If output file is skipped, Enventor will store the binary file to the temporary directory. output file = EDJ file to store compiled file. If output file is skipped, Enventor will store the binary file to the temporary directory.</br>
-t = Open template menu when you launch Enventor -t = Open template menu when you launch Enventor</br>
-i = path to image resources that the edc includes -i = path to image resources that the edc includes</br>
-s = path to sound resources that the edc includes -s = path to sound resources that the edc includes</br>
-f = path to font resources that the edc includes -f = path to font resources that the edc includes</br>
-d = path to data resources that the edc includes -d = path to data resources that the edc includes</br>
</br>
Examples of Enventor command line usage: Examples of Enventor command line usage:</br>
$ enventor $ enventor</br>
$ enventor -t $ enventor -t</br>
$ enventor newfile.edc -t $ enventor newfile.edc -t</br>
$ enventor sample.edc output.edj -i ./images -s ./sounds $ enventor sample.edc output.edj -i ./images -s ./sounds</br>
</br>
</br>
<font_size=11><b>[Developers]</b></font_size> <font_size=11><b>[Developers]</b></font_size></br>
</br>
Many developers have contributed to Enventor project. The following names are dedicated Enventor developers' names but there are more people who've gladly contributed for Enventor. For a complete list of contributors, See AUTHORS file. Many developers have contributed to Enventor project. The following names are dedicated Enventor developers' names but there are more people who've gladly contributed for Enventor. For a complete list of contributors, See AUTHORS file.</br>
</br>
Copyright (C) 2013 - 2016 by: Copyright (C) 2013 - 2016 by:</br>
</br>
Hermet Park Hermet Park</br>
Jaehyun Cho Jaehyun Cho</br>
Mykyta Biliavskyi Mykyta Biliavskyi</br>
Kateryna Fesyna Kateryna Fesyna</br>
Yunho Jeong Yunho Jeong</br>
Mincheol Seo Mincheol Seo</br>
Raoul Hecky Raoul Hecky</br>
</br>
And various contributors (See AUTHORS) And various contributors (See AUTHORS)</br>
</br>

View File

@ -239,49 +239,15 @@ about_open(menu_data *md)
evas_object_show(entry); evas_object_show(entry);
elm_object_focus_set(entry, EINA_TRUE); elm_object_focus_set(entry, EINA_TRUE);
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>");
//Read README //Read README
char buf[PATH_MAX]; char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/about/ABOUT", elm_app_data_dir_get()); snprintf(buf, sizeof(buf), "%s/about/ABOUT", elm_app_data_dir_get());
elm_entry_autosave_set(entry, EINA_FALSE);
Eina_Strbuf *strbuf = NULL; elm_entry_file_set(entry, buf, ELM_TEXT_FORMAT_MARKUP_UTF8);
Eina_Iterator *itr = NULL;
Eina_File *file = eina_file_open(buf, EINA_FALSE);
if (!file) goto err;
itr = eina_file_map_lines(file);
if (!itr) goto err;
strbuf = eina_strbuf_new();
if (!strbuf) goto err;
Eina_File_Line *line;
int line_num = 0;
EINA_ITERATOR_FOREACH(itr, line)
{
//Append edc ccde
if (line_num > 0)
{
if (!eina_strbuf_append(strbuf, EOL)) 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>");
md->about_layout = layout; md->about_layout = layout;
menu_activate_request(); menu_activate_request();
err:
if (strbuf) eina_strbuf_free(strbuf);
if (itr) eina_iterator_free(itr);
if (file) eina_file_close(file);
} }
static void static void