diff --git a/data/about/COMMAND b/data/about/COMMAND new file mode 100644 index 0000000..1eda1e8 --- /dev/null +++ b/data/about/COMMAND @@ -0,0 +1,19 @@ +enventor --help
+enventor [input file] [output file] [-t] [-i image path] [-s sound path] [-f font path] [-d data path] [-w workspace path]
+
+input file = EDC file to open. If input file is skipped, Enventor will open a default template code with a temporary file.
+output file = EDJ file to store compiled file. If output file is skipped, Enventor will store the binary file to the temporary directory.
+-t = Open template menu when you launch Enventor
+-i = path to image resources that the edc includes
+-s = path to sound resources that the edc includes
+-f = path to font resources that the edc includes
+-d = path to data resources that the edc includes
+-w = workspace directory path that contains group edc files
+
+Examples of Enventor command line usage:
+$ enventor
+$ enventor input.edc -i ./images
+$ enventor input.edc output.edj -i ./images
+$ enventor -t
+$ enventor newfile.edc -t
+$ enventor input.edc output.edj -i ./images -s ./sounds -w ./workspace diff --git a/data/about/DEVEL b/data/about/DEVEL new file mode 100644 index 0000000..9b9d7f0 --- /dev/null +++ b/data/about/DEVEL @@ -0,0 +1,15 @@ +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.
+
+Copyright (C) 2013 - 2016 by:
+
+Hermet Park
+Jaehyun Cho
+Mykyta Biliavskyi
+Kateryna Fesyna
+Tae-Hyup Kim
+Yunho Jeong
+Mincheol Seo
+Raoul Hecky
+Yurii Tsivun
+
+And various contributors (See AUTHORS) diff --git a/data/about/HISTORY b/data/about/HISTORY new file mode 100644 index 0000000..ff38c6b --- /dev/null +++ b/data/about/HISTORY @@ -0,0 +1,61 @@ +Changes since Enventor 0.7.0
+
+Additions:
+ * Editor: Open/Close Bracket Highlighting.
+ * Statusbar: Support view inverting function (for simulating device rotation)
+ * Introduce a edc navigator.
+ * Support a color selector for "color" keywords in edc to change color.
+ * Add Enventor APis.
+ - enventor_object_part_states_list_get()
+ - enventor_object_parts_list_get()
+ - enventor_object_part_type_get()
+ - enventor_object_programs_list_get()
+ - ctxpopup,activated signal.
+
+Removes:
+ * Remove fixed size option in setting.
+ * Remove minimum new template code.
+ * Remove Enventr_Max_Line data type.
+
+Improvements:
+ * Editor: Support group name macros and preview those group macros.
+ * Improve Dummy Spacer UI.
+ * Statusbar supports live view zooming.
+ * Statusbar supports view size setting.
+ * View Scale slider in setting works on step size for mouse wheel.
+ * Improve the usage of the live view zooming with mouse wheel.
+ * Template code: fixed weird code insertion inside LazyEDC block.
+ * Support more autocomplete keywords.
+ * New design of Enventor logo.
+ * Improve tools ui.
+ * Simpilier editor ctxpopup ui.
+ * Console Box: Clicking Error log redirects editor cursor to the error code.
+ * Auto Indentation: Apply auto indentation for a edc file which is newly loaded.
+ * Auto Indentation: Improve logics for better smart results.
+ * Auto-select error code when error is occured.
+ * Auto completion: improve logic to guide better smart candidates lists.
+ * Live Edit: Select a name text in edc for a newly inserted part.
+ * Part Selection: Select a name in edc for a current selected part.
+ * RedoUndo: Support real-time preview when we undo/redo the code.
+ * Set a default font as Monospace type.
+ * Support monospace font types in the setting fonts list.
+ * In default, Select a current font type in the text setting.
+ * Editor Ctxpopup: Support Back key to reset the modification.
+
+Fixes:
+ * Fix incorrect tools' tooltip position.
+ * Remove some unsupported edc keyowrds.
+ * Fix some memory leak issues.
+ * Fix ridiculous editor cursor jumping issue.
+ * Fix to paste markup symbols correctly.
+ * Fix editor to work with Copy and Paste Plain Text mode.
+ * Fix crash issues.
+ * Fix a bug that dummy swallow is invisible.
+ * Fix a bug that part selection in live view doesn't work.
+ * Fix not to insert an empty line at the end of file.
+ * Fix to keep the edc changed status correctly. This brought enventor save edc files multiple times unnecessarily.
+ * Fix initial line max is 0 issue.
+ * Reset cursor position to 0 when edc file is loaded.
+ * Fix to update images properly even if very large size of image were updated by other process.
+
+Please see NEWS for more information. diff --git a/data/about/INTRO b/data/about/INTRO new file mode 100644 index 0000000..377b0a0 --- /dev/null +++ b/data/about/INTRO @@ -0,0 +1,10 @@ +Enventor v0.8.0
+
+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.
+
+Please see the following sites for more information.
+
+http://www.enlightenment.org
+https://phab.enlightenment.org/w/projects/enventor/
+http://www.openhub.net/p/enventor + diff --git a/data/about/Makefile.am b/data/about/Makefile.am index 7f557dc..1b01716 100644 --- a/data/about/Makefile.am +++ b/data/about/Makefile.am @@ -1,6 +1,10 @@ MAINTAINERCLEANFILES = Makefile.in filesdir = $(datadir)/$(PACKAGE)/about files_DATA = \ -ABOUT +INTRO \ +HISTORY \ +SHORTCUT \ +COMMAND \ +DEVEL EXTRA_DIST = $(files_DATA) diff --git a/data/about/SHORTCUT b/data/about/SHORTCUT new file mode 100644 index 0000000..681d9af --- /dev/null +++ b/data/about/SHORTCUT @@ -0,0 +1,43 @@ +Functions:
+ Esc - Open/Close Menu
+ F1 - About
+ F2 - New
+ F3 - Save
+ F4 - Load
+ F5 - Toggle Line Number
+ F8 - Toggle Tools
+ F9 - Toggle File Browser
+ F10 - Toggle EDC Navigator
+ F11 - Toggle Status
+ F12 - Settings
+
+ Ctrl+S - Quick Save + Update Live View
+ Ctrl+I - Toggle Auto Indentation
+ Ctrl+O - Toggle Auto Completion
+ Ctrl+W - Toggle Dummy Parts
+ Ctrl+H - Toggle Part Highlighting
+ Ctrl+M - Toggle Mirror Mode
+ Ctrl+T - Insert Defaut Template Code
+ Ctrl+Mouse Wheel Up - View Zoom In / Font Size Up
+ Ctrl+Mouse Wheel Down - View Zoom Out / Font Size Down
+
+Panes Control:
+ Alt+Left - Toggle Full Edit View
+ Alt+Right - Toggle Full Live View
+ Alt+Up - Toggle Full Console View
+ Alt+Down - Toggle Full Editors View
+
+Text Editor:
+ Ctrl+A - Select Text All
+ Ctrl+Double Click - Select a word
+ Ctrl+Z - Undo Text
+ Ctrl+R - Redo Text
+ Ctrl+C - Copy Selected Text
+ Ctrl+V - Paste Copied Text
+ Ctrl+X - Cut Selected Text
+ Ctrl+D - Delete a Current line
+ Ctrl+F - Find/Replace
+ Ctrl+L - Go to line
+ Ctrl+Home - Go to the Top line
+ Ctrl+End - Go to the Bottom line
+ Ctrl+Space - Search candidate keywords in the context diff --git a/data/themes/default/layout_common.edc b/data/themes/default/layout_common.edc index 43ee74d..45f0927 100644 --- a/data/themes/default/layout_common.edc +++ b/data/themes/default/layout_common.edc @@ -13,120 +13,6 @@ images { image: "bg_demo.png" COMP; } -group { name: "about_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; - } - } - swallow { "elm.swallow.back_button"; - scale: 1; - clip_to: "clipper"; - desc { - fixed: 1 1; - min: 26 26; - max: 26 26; - align: 1 0.0; - rel1.relative: 0 0; - rel2.relative: 0 0; - rel1.to: "back_button_padding"; - rel2.to: "back_button_padding"; - } - } - spacer { "back_button_padding"; - scale: 1; - desc { - fixed: 1 1; - min: 22 0; - align: 1 0.0; - rel1.relative: 1 0; - rel2.relative: 1 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" ""; - } - } -} - group { name: "fileselector_layout"; parts { part { name: "clipper"; diff --git a/data/themes/default/theme_ext.edc b/data/themes/default/theme_ext.edc index 5da128f..723892e 100644 --- a/data/themes/default/theme_ext.edc +++ b/data/themes/default/theme_ext.edc @@ -745,114 +745,6 @@ group { name: "elm/scroller/base/enventor"; } } -group { name: "elm/scroller/entry/about"; - inherit: "elm/scroller/base/enventor"; - image: "bg_glow_in.png" COMP; - parts { - part { name: "elm.swallow.content"; - description { state: "default" 0.0; - rel1.to: "elm.swallow.icon"; - rel1.relative: 1.0 0.0; - rel1.offset: 0 0; - rel2.to: "elm.swallow.end"; - rel2.relative: 0.0 1.0; - rel2.offset: -1 -1; - } - } - part { name: "elm.swallow.icon"; type: SWALLOW; - clip_to: "clipper"; - description { state: "default" 0.0; - fixed: 1 1; - rel1.offset: 1 1; - rel2.offset: 1 -2; - rel2.relative: 0.0 1.0; - visible: 0; - align: 1.0 0.0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0.0 0.0; - } - } - program { - signal: "elm,action,show,icon"; source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; - } - program { - signal: "elm,action,hide,icon"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; - } - part { name: "elm.swallow.end"; type: SWALLOW; - clip_to: "clipper"; - description { state: "default" 0.0; - fixed: 1 1; - rel1.offset: -2 1; - rel1.relative: 1.0 0.0; - rel2.offset: -2 -2; - visible: 0; - align: 0.0 0.0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 1.0 0.0; - } - } - program { - signal: "elm,action,show,end"; source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.end"; - } - program { - signal: "elm,action,hide,end"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.end"; - } - part { name: "glow"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - image.normal: "bg_glow_in.png"; - image.border: 7 7 7 7; - image.middle: 0; - fill.smooth: 0; - color: 255 255 255 0; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - description { state: "focused2" 0.0; - inherit: "default" 0.0; - color: 255 255 255 64; - } - } - } - programs { - program { - signal: "elm,action,focus_highlight,show"; source: "elm"; - action: STATE_SET "focused" 0.0; - target: "glow"; - after: "focus_in2"; - } - program { name: "focus_in2"; - action: STATE_SET "focused2" 0.0; - transition: DECELERATE 0.5; - target: "glow"; - } - program { - signal: "elm,action,focus_highlight,hide"; source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.3; - target: "glow"; - } - } -} - group { name: "elm/ctxpopup/bg/enventor"; parts { part { name: "ctxpopup_bg"; diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 3616ae4..c7c1174 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -32,7 +32,8 @@ enventor_SOURCES = \ edc_navigator.c \ file_browser.c \ build_setting.c \ - preference_setting.c + preference_setting.c \ + about.c enventor_LDADD = \ $(top_builddir)/src/lib/libenventor.la \ diff --git a/src/bin/about.c b/src/bin/about.c new file mode 100644 index 0000000..9658c79 --- /dev/null +++ b/src/bin/about.c @@ -0,0 +1,232 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "common.h" + +static Evas_Coord win_x = -1; +static Evas_Coord win_y = -1; +static Evas_Coord win_w = DEFAULT_ABOUT_WIN_W; +static Evas_Coord win_h = DEFAULT_ABOUT_WIN_H; +static Evas_Object *g_win = NULL; + +static void +keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + about_close(); +} + +static void +win_delete_request_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + about_close(); +} + +static void +win_moved_cb(void *data EINA_UNUSED, Evas_Object *obj, + void *event_info EINA_UNUSED) +{ + /* Move the window with the previous remembered position when the window is + moved by window manager first time. */ + if ((win_x != -1) || (win_y != -1)) evas_object_move(obj, win_x, win_y); + evas_object_smart_callback_del(obj, "moved", win_moved_cb); +} + +void +about_open(void) +{ + Evas_Object *win = g_win; + if (win) + { + elm_win_activate(win); + return; + } + + Evas_Object *entry; + char buf[PATH_MAX]; + + //Win + win = elm_win_add(base_win_get(), _("Enventor About"), ELM_WIN_BASIC); + elm_win_focus_highlight_enabled_set(win, EINA_TRUE); + elm_win_title_set(win, _("About")); + evas_object_smart_callback_add(win, "delete,request", win_delete_request_cb, + NULL); + evas_object_smart_callback_add(win, "moved", win_moved_cb, NULL); + + //Bg + Evas_Object *bg = elm_bg_add(win); + evas_object_show(bg); + elm_win_resize_object_add(win, bg); + + //Scroller + Evas_Object *scroller = elm_scroller_add(win); + evas_object_show(scroller); + elm_win_resize_object_add(win, scroller); + + //Box + Evas_Object *box = elm_box_add(win); + evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(box); + elm_object_content_set(scroller, box); + + //Frame1: Introduction + Evas_Object *intro_frame = elm_frame_add(box); + elm_frame_autocollapse_set(intro_frame, EINA_TRUE); + elm_object_text_set(intro_frame, "Introduction"); + evas_object_size_hint_weight_set(intro_frame, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(intro_frame, EVAS_HINT_FILL, 0); + evas_object_show(intro_frame); + elm_box_pack_end(box, intro_frame); + + //Entry + entry = elm_entry_add(intro_frame); + elm_entry_scrollable_set(entry, EINA_FALSE); + elm_entry_line_wrap_set(entry, EINA_TRUE); + elm_entry_editable_set(entry, EINA_FALSE); + elm_entry_line_wrap_set(entry, ELM_WRAP_MIXED); + elm_object_content_set(intro_frame, entry); + + //Read File + snprintf(buf, sizeof(buf), "%s/about/INTRO", elm_app_data_dir_get()); + elm_entry_autosave_set(entry, EINA_FALSE); + elm_entry_file_set(entry, buf, ELM_TEXT_FORMAT_MARKUP_UTF8); + + + //Frame2: Version History + Evas_Object *version_frame = elm_frame_add(box); + elm_frame_autocollapse_set(version_frame, EINA_TRUE); + elm_frame_collapse_set(version_frame, EINA_TRUE); + elm_object_text_set(version_frame, "Version History"); + evas_object_size_hint_weight_set(version_frame, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(version_frame, EVAS_HINT_FILL, + 0); + evas_object_show(version_frame); + elm_box_pack_end(box, version_frame); + + //Entry + entry = elm_entry_add(version_frame); + elm_entry_scrollable_set(entry, EINA_FALSE); + elm_entry_line_wrap_set(entry, EINA_TRUE); + elm_entry_editable_set(entry, EINA_FALSE); + elm_entry_line_wrap_set(entry, ELM_WRAP_MIXED); + elm_object_content_set(version_frame, entry); + + //Read File + snprintf(buf, sizeof(buf), "%s/about/HISTORY", elm_app_data_dir_get()); + elm_entry_autosave_set(entry, EINA_FALSE); + elm_entry_file_set(entry, buf, ELM_TEXT_FORMAT_MARKUP_UTF8); + + + //Frame3: Shortcut Keys + Evas_Object *key_frame = elm_frame_add(box); + elm_frame_autocollapse_set(key_frame, EINA_TRUE); + elm_frame_collapse_set(key_frame, EINA_TRUE); + elm_object_text_set(key_frame, "Shortcut keys"); + evas_object_size_hint_weight_set(key_frame, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(key_frame, EVAS_HINT_FILL, 0); + evas_object_show(key_frame); + elm_box_pack_end(box, key_frame); + + //Entry + entry = elm_entry_add(key_frame); + elm_entry_scrollable_set(entry, EINA_FALSE); + elm_entry_line_wrap_set(entry, EINA_TRUE); + elm_entry_editable_set(entry, EINA_FALSE); + elm_entry_line_wrap_set(entry, ELM_WRAP_MIXED); + elm_object_content_set(key_frame, entry); + + //Read File + snprintf(buf, sizeof(buf), "%s/about/SHORTCUT", elm_app_data_dir_get()); + elm_entry_autosave_set(entry, EINA_FALSE); + elm_entry_file_set(entry, buf, ELM_TEXT_FORMAT_MARKUP_UTF8); + + + //Frame4: Commandline + Evas_Object *command_frame = elm_frame_add(box); + elm_frame_autocollapse_set(command_frame, EINA_TRUE); + elm_frame_collapse_set(command_frame, EINA_TRUE); + elm_object_text_set(command_frame, "Commandline Usage"); + evas_object_size_hint_weight_set(command_frame, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(command_frame, EVAS_HINT_FILL, 0); + evas_object_show(command_frame); + elm_box_pack_end(box, command_frame); + + //Entry + entry = elm_entry_add(command_frame); + elm_entry_scrollable_set(entry, EINA_FALSE); + elm_entry_line_wrap_set(entry, EINA_TRUE); + elm_entry_editable_set(entry, EINA_FALSE); + elm_entry_line_wrap_set(entry, ELM_WRAP_MIXED); + elm_object_content_set(command_frame, entry); + + //Read File + snprintf(buf, sizeof(buf), "%s/about/COMMAND", elm_app_data_dir_get()); + elm_entry_autosave_set(entry, EINA_FALSE); + elm_entry_file_set(entry, buf, ELM_TEXT_FORMAT_MARKUP_UTF8); + + //Frame5: EDC References + Evas_Object *refer_frame = elm_frame_add(box); + elm_object_text_set(refer_frame, "EDC References (Not support yet)"); + evas_object_size_hint_weight_set(refer_frame, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(refer_frame, EVAS_HINT_FILL, + EVAS_HINT_FILL); + evas_object_show(refer_frame); + elm_box_pack_end(box, refer_frame); + + //Frame6:Developers + Evas_Object *devel_frame = elm_frame_add(box); + elm_frame_autocollapse_set(devel_frame, EINA_TRUE); + elm_frame_collapse_set(devel_frame, EINA_TRUE); + elm_object_text_set(devel_frame, "Developers"); + evas_object_size_hint_weight_set(devel_frame, EVAS_HINT_EXPAND, 0); + evas_object_size_hint_align_set(devel_frame, EVAS_HINT_FILL, + EVAS_HINT_FILL); + evas_object_show(devel_frame); + elm_box_pack_end(box, devel_frame); + + //Entry + entry = elm_entry_add(devel_frame); + elm_entry_scrollable_set(entry, EINA_FALSE); + elm_entry_line_wrap_set(entry, EINA_TRUE); + elm_entry_editable_set(entry, EINA_FALSE); + elm_entry_line_wrap_set(entry, ELM_WRAP_MIXED); + elm_object_content_set(devel_frame, entry); + + //Read File + snprintf(buf, sizeof(buf), "%s/about/DEVEL", elm_app_data_dir_get()); + elm_entry_autosave_set(entry, EINA_FALSE); + elm_entry_file_set(entry, buf, ELM_TEXT_FORMAT_MARKUP_UTF8); + + + win_w = (Evas_Coord) ((double) win_w * elm_config_scale_get()); + win_h = (Evas_Coord) ((double) win_h * elm_config_scale_get()); + evas_object_resize(win, win_w, win_h); + evas_object_show(win); + + //Keygrabber + Evas_Object *keygrabber = + evas_object_rectangle_add(evas_object_evas_get(win)); + evas_object_event_callback_add(keygrabber, EVAS_CALLBACK_KEY_DOWN, + keygrabber_key_down_cb, NULL); + if (!evas_object_key_grab(keygrabber, "Escape", 0, 0, EINA_TRUE)) + EINA_LOG_ERR(_("Failed to grab key - Escape")); + + g_win = win; +} + +void +about_close(void) +{ + Evas_Object *win = g_win; + if (!win) return; + + //Save last state + evas_object_geometry_get(win, NULL, NULL, &win_w, &win_h); + elm_win_screen_position_get(win, &win_x, &win_y); + evas_object_del(win); + g_win = NULL; +} diff --git a/src/bin/main.c b/src/bin/main.c index 9d61153..b269f48 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -746,7 +746,7 @@ keygrabber_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, { enventor_object_ctxpopup_dismiss(base_enventor_get()); live_edit_cancel(); - menu_about(); + about_open(); return; } //New diff --git a/src/bin/menu.c b/src/bin/menu.c index 0bb0c2b..b4b57b7 100644 --- a/src/bin/menu.c +++ b/src/bin/menu.c @@ -10,7 +10,6 @@ struct menu_s Evas_Object *newfile_layout; Evas_Object *warning_layout; Evas_Object *fileselector_layout; - Evas_Object *about_layout; const char *last_accessed_path; @@ -43,12 +42,6 @@ newfile_close(menu_data *md) elm_object_signal_emit(md->newfile_layout, "elm,state,dismiss", ""); } -static void -about_close(menu_data *md) -{ - elm_object_signal_emit(md->about_layout, "elm,state,dismiss", ""); -} - static void warning_close(menu_data *md) { @@ -86,17 +79,6 @@ fileselector_dismiss_done(void *data, Evas_Object *obj EINA_UNUSED, menu_deactivate_request(); } -static void -about_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->about_layout); - md->about_layout = NULL; - menu_deactivate_request(); -} - static void menu_dismiss_done(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, @@ -137,14 +119,6 @@ newfile_cancel_btn_cb(void *data, Evas_Object *obj EINA_UNUSED, newfile_close(md); } -static void -about_back_btn_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, - void *envent_info EINA_UNUSED) -{ - menu_data *md = data; - about_close(md); -} - static void menu_back_btn_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *envent_info EINA_UNUSED) @@ -234,60 +208,10 @@ warning_open(menu_data *md, Evas_Smart_Cb yes_cb, Evas_Smart_Cb save_cb) } static void -about_open(menu_data *md) -{ - //Layout - Evas_Object *layout = elm_layout_add(base_win_get()); - elm_layout_file_set(layout, EDJE_PATH, "about_layout"); - elm_object_signal_callback_add(layout, "elm,state,dismiss,done", "", - about_dismiss_done, md); - evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(layout); - base_win_resize_object_add(layout); - - //Back Button - Evas_Object *back_button = elm_button_add(layout); - elm_object_style_set(back_button, ENVENTOR_NAME); - elm_object_scale_set(back_button, 1.15); - elm_object_focus_allow_set(back_button, EINA_FALSE); - evas_object_show(back_button); - evas_object_smart_callback_add(back_button, "clicked", - about_back_btn_clicked_cb, md); - - //Back Button Icon - Evas_Object *back_img = elm_image_add(back_button); - elm_image_file_set(back_img, EDJE_PATH, "close"); - elm_object_content_set(back_button, back_img); - - elm_object_part_content_set(layout, "elm.swallow.back_button", back_button); - - //Entry - Evas_Object *entry = elm_entry_add(layout); - elm_object_style_set(entry, "about"); - elm_entry_scrollable_set(entry, EINA_TRUE); - elm_entry_line_wrap_set(entry, EINA_TRUE); - elm_entry_editable_set(entry, EINA_FALSE); - elm_entry_line_wrap_set(entry, ELM_WRAP_MIXED); - evas_object_show(entry); - elm_object_focus_set(entry, EINA_TRUE); - elm_object_part_content_set(layout, "elm.swallow.entry", entry); - - //Read README - char buf[PATH_MAX]; - snprintf(buf, sizeof(buf), "%s/about/ABOUT", elm_app_data_dir_get()); - elm_entry_autosave_set(entry, EINA_FALSE); - elm_entry_file_set(entry, buf, ELM_TEXT_FORMAT_MARKUP_UTF8); - - md->about_layout = layout; - menu_activate_request(); -} - -static void -about_btn_cb(void *data, Evas_Object *obj EINA_UNUSED, +about_btn_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - menu_data *md = data; - about_open(md); + about_open(); } static void @@ -699,13 +623,6 @@ menu_term(void) free(md); } -void -menu_about(void) -{ - menu_data *md = g_md; - about_open(md); -} - void menu_setting(void) { @@ -765,11 +682,6 @@ menu_toggle(void) fileselector_close(md); return; } - if (md->about_layout) - { - about_close(md); - return; - } //Main Menu if (md->active_request) menu_close(md); diff --git a/src/include/Makefile.am b/src/include/Makefile.am index 326d878..6cc70a7 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am @@ -19,4 +19,5 @@ EXTRA_DIST = common.h \ edc_navigator.h \ file_browser.h \ build_setting.h \ - preference_setting.h + preference_setting.h \ + about.h diff --git a/src/include/about.h b/src/include/about.h new file mode 100644 index 0000000..5fedf75 --- /dev/null +++ b/src/include/about.h @@ -0,0 +1,5 @@ +#define DEFAULT_ABOUT_WIN_W 533 +#define DEFAULT_ABOUT_WIN_H 533 + +void about_open(void); +void about_close(void); diff --git a/src/include/common.h b/src/include/common.h index e3a3e05..96f18fd 100644 --- a/src/include/common.h +++ b/src/include/common.h @@ -83,6 +83,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" #include "file_mgr.h" #include "build_setting.h" #include "preference_setting.h" +#include "about.h" /* localization */ #ifdef HAVE_GETTEXT