[EGIT] [tools/enventor] master 01/01: Edc_editor: enhance enventor_object_text insert API.

2015-09-04 Thread Mykyta Biliavskyi
hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=1fd611f4b617cc04b9f574ba94759d808af00ee0

commit 1fd611f4b617cc04b9f574ba94759d808af00ee0
Author: Mykyta Biliavskyi 
Date:   Fri Sep 4 15:42:43 2015 +0900

Edc_editor: enhance enventor_object_text insert API.

Summary:
added edit_text_insert function, that
shared for public use as enventor_object_text_insert
This API provide functionality for text insert with
support correct text replacement and redo/undo
feature support.

@fix T2691

Test Plan:
Lunch Enventor. Open "Find/Replace" dialog.
Fill "Find" field with exist string and fill
"Replace with" field with any text. Press "Replace All".
Close dialog window and check how work Ctrl+Z and Ctrl+R
hotkey combinations.

Reviewers: Hermet

Maniphest Tasks: T2691

Differential Revision: https://phab.enlightenment.org/D3005
---
 src/lib/edc_editor.c   | 41 +
 src/lib/enventor_private.h |  1 +
 src/lib/enventor_smart.c   |  2 +-
 3 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c
index 4b7e6d4..e765a7c 100644
--- a/src/lib/edc_editor.c
+++ b/src/lib/edc_editor.c
@@ -670,6 +670,47 @@ edit_selection_start_cb(void *data, Evas_Object *obj 
EINA_UNUSED,
ed->select_pos = elm_entry_cursor_pos_get(ed->en_edit);
 }
 
+void
+edit_text_insert(edit_data *ed, const char *text)
+{
+   const char *selection = elm_entry_selection_get(ed->en_edit);
+   selection = elm_entry_markup_to_utf8(selection);
+   if (!selection)
+ {
+elm_entry_entry_set(ed->en_edit, text);
+return;
+ }
+   int lenght = strlen(selection);
+   int pos_from = elm_entry_cursor_pos_get(ed->en_edit) - lenght;
+
+   Evas_Object *tb = elm_entry_textblock_get(ed->en_edit);
+   Evas_Textblock_Cursor *cur = evas_object_textblock_cursor_get(tb);
+   int old_pos = evas_textblock_cursor_pos_get(cur);
+   evas_textblock_cursor_pos_set(cur, pos_from + lenght);
+
+   /* append replacement text, and add relative diff into redoundo module */
+   evas_textblock_cursor_pos_set(cur, pos_from + lenght);
+   evas_textblock_cursor_text_append(cur, text);
+   redoundo_text_relative_push(ed->rd, text);
+
+   Evas_Textblock_Cursor *c_1 = evas_object_textblock_cursor_new(tb);
+   evas_textblock_cursor_pos_set(c_1, pos_from);
+
+   Evas_Textblock_Cursor *c_2 = evas_object_textblock_cursor_new(tb);
+   evas_textblock_cursor_pos_set(c_2, pos_from + lenght);
+   /* delete replaced text, and make diff into redoundo module */
+   redoundo_text_push(ed->rd, selection, pos_from, lenght, EINA_FALSE);
+   evas_textblock_cursor_range_delete(c_1, c_2);
+
+   evas_textblock_cursor_free(c_1);
+   evas_textblock_cursor_free(c_2);
+   evas_textblock_cursor_pos_set(cur, old_pos);
+
+   elm_entry_calc_force(ed->en_edit);
+   free(selection);
+}
+
+
 static void
 edit_cursor_changed_manual_cb(void *data, Evas_Object *obj EINA_UNUSED,
   void *event_info EINA_UNUSED)
diff --git a/src/lib/enventor_private.h b/src/lib/enventor_private.h
index 82638a8..8347dc7 100644
--- a/src/lib/enventor_private.h
+++ b/src/lib/enventor_private.h
@@ -277,5 +277,6 @@ void edit_selection_clear(edit_data *ed);
 Eina_Bool edit_redoundo(edit_data *ed, Eina_Bool undo);
 void edit_disabled_set(edit_data *ed, Eina_Bool disabled);
 void edit_error_set(edit_data *ed, int line, const char *target);
+void edit_text_insert(edit_data *ed, const char *text);
 
 #endif
diff --git a/src/lib/enventor_smart.c b/src/lib/enventor_smart.c
index a7b9f12..11296e3 100644
--- a/src/lib/enventor_smart.c
+++ b/src/lib/enventor_smart.c
@@ -524,7 +524,7 @@ EOLIAN static void
 _enventor_object_text_insert(Eo *obj EINA_UNUSED, Enventor_Object_Data *pd,
  const char *text)
 {
-   elm_entry_entry_insert(edit_entry_get(pd->ed), text);
+   edit_text_insert(pd->ed, text);
 }
 
 EOLIAN static void

-- 




[EGIT] [tools/erigo] master 01/01: Enventor: check availability in live

2015-09-04 Thread Daniel Zaoui
jackdanielz pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=192f6a6d7f12de139f4897faededde65c5db3b38

commit 192f6a6d7f12de139f4897faededde65c5db3b38
Author: Daniel Zaoui 
Date:   Fri Sep 4 09:18:30 2015 +0300

Enventor: check availability in live

Enabling/disabling Enventor was previously done in the Makefile itself.
---
 src/bin/gui/CMakeLists.txt |  5 -
 src/bin/gui/rmview.c   | 55 +++---
 2 files changed, 42 insertions(+), 18 deletions(-)

diff --git a/src/bin/gui/CMakeLists.txt b/src/bin/gui/CMakeLists.txt
index b91d3e4..e1abcf8 100644
--- a/src/bin/gui/CMakeLists.txt
+++ b/src/bin/gui/CMakeLists.txt
@@ -1,10 +1,5 @@
 find_package(Gvc QUIET)
 find_package(CGraph QUIET)
-find_program(ENVENTOR NAMES enventor)
-
-if (ENVENTOR)
-   add_definitions(-DHAVE_ENVENTOR)
-endif(ENVENTOR)
 
 if (GVC_FOUND AND CGRAPH_FOUND)
add_definitions(-DHAVE_GRAPHVIZ)
diff --git a/src/bin/gui/rmview.c b/src/bin/gui/rmview.c
index 0972310..067d549 100644
--- a/src/bin/gui/rmview.c
+++ b/src/bin/gui/rmview.c
@@ -23,6 +23,8 @@ static Rmview_Resource_Type _rmview_toolbar_selected_type = 
RMVIEW_NOT_SELECTED;
 
 static Egui_Layout_Rm_Win_Widgets *g_rm_win = NULL;
 
+static Ecore_Event_Handler *_exe_event_data_handler = NULL;
+
 void rm_win_set(Egui_Layout_Rm_Win_Widgets *rm_win)
 {
if (g_rm_win) free(g_rm_win);
@@ -248,7 +250,6 @@ _res_changed(void *data EINA_UNUSED, Eo *obj, const 
Eo_Event_Description *desc E
return EO_CALLBACK_CONTINUE;
 }
 
-#ifdef HAVE_ENVENTOR
 static Eina_Bool
 _enventor_clicked(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description 
*desc EINA_UNUSED, void *event_info EINA_UNUSED)
 {
@@ -279,7 +280,6 @@ _enventor_clicked(void *data EINA_UNUSED, Eo *obj, const 
Eo_Event_Description *d
  }
return EO_CALLBACK_CONTINUE;
 }
-#endif
 
 /* callback on sve_button 'clicked' event */
 static Eina_Bool
@@ -382,6 +382,35 @@ _bt_del_clicked(void *data EINA_UNUSED, Eo *obj, const 
Eo_Event_Description *des
return EO_CALLBACK_CONTINUE;
 }
 
+static Eina_Bool
+_exe_event_data_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void 
*event_info)
+{
+   Ecore_Exe_Event_Data *ev = event_info;
+   Ecore_Exe_Event_Data_Line *el;
+   Eo *widget = ecore_exe_data_get(ev->exe);
+
+   if (eo_isa(widget, ELM_WIDGET_CLASS))
+ {
+for (el = ev->lines; el && el->line; el++)
+  {
+ if (strstr(el->line, "Version:"))
+   {
+  eo_do(widget, elm_obj_widget_disabled_set(EINA_FALSE));
+   }
+  }
+ }
+   return ECORE_CALLBACK_RENEW;
+}
+
+static void
+_check_enventor(Eo *widget)
+{
+   ecore_exe_pipe_run("enventor -v",
+ ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ |
+ ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR,
+ widget);
+}
+
 static void
 _rmview_build(Rmview_Resource_Type type)
 {
@@ -572,7 +601,6 @@ _rmview_build(Rmview_Resource_Type type)
  }
}
 
-#ifdef HAVE_ENVENTOR
  if (res_type == RESOURCE_EDJE)
{
   Eo *icon = elm_image_add(g_rm_win->rm_table);
@@ -583,19 +611,18 @@ _rmview_build(Rmview_Resource_Type type)
 efl_gfx_visible_set(EINA_TRUE)
);
   bt = _rmview_button_add(g_rm_win->rm_table, "");
-  elm_object_tooltip_text_set(bt, "Open edc file in Enventor");
-  eo_do(bt,
-elm_obj_container_content_set("icon", icon),
-elm_obj_widget_disabled_set(EINA_FALSE)
-   );
+  eo_do(bt, elm_obj_container_content_set("icon", icon));
   eo_do(g_rm_win->rm_table, elm_obj_table_pack(bt, 
table_col++, table_line, 1, 1));
 
   data = RMVIEW_FIELD_DATA_BUILD(2, it_data);
-  eo_do(bt, eo_key_data_set(_STR_RMVIEW, data));
-  eo_do(bt, eo_event_callback_add(EO_BASE_EVENT_DEL, 
_field_data_free, data));
-  eo_do(bt, 
eo_event_callback_add(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, 
_enventor_clicked, NULL));
+  eo_do(bt,
+eo_key_data_set(_STR_RMVIEW, data),
+eo_event_callback_add(EO_BASE_EVENT_DEL, 
_field_data_free, data),
+
eo_event_callback_add(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, 
_enventor_clicked, NULL),
+elm_obj_widget_disabled_set(EINA_TRUE));
+  elm_object_tooltip_text_set(bt, "Open edc file in Enventor");
+  _check_enventor(bt);
}
-#endif
 
  bt = _rmview_button_add(g_rm_win->rm_table, "save");
  it_data->bt_save = bt;
@@ -686,6 +713,9 @@ _rmview_toolbar_clicked(void *data, Evas_Object *obj 
EINA_UNUSED, void *event_in
  return;

[EGIT] [tools/enventor] master 01/01: fix eo build break.

2015-09-04 Thread ChunEon Park
hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=31c0b592b3fca2840a0302b4e9d06789c6c971eb

commit 31c0b592b3fca2840a0302b4e9d06789c6c971eb
Author: ChunEon Park 
Date:   Fri Sep 4 15:37:11 2015 +0900

fix eo build break.

removed docs actually it's empty.

the doc will be filled at Enventor 1.0
---
 src/lib/enventor_object.eo | 357 ++---
 1 file changed, 42 insertions(+), 315 deletions(-)

diff --git a/src/lib/enventor_object.eo b/src/lib/enventor_object.eo
index 9940d11..a837f0e 100644
--- a/src/lib/enventor_object.eo
+++ b/src/lib/enventor_object.eo
@@ -3,510 +3,237 @@ class Enventor.Object (Elm.Widget, Efl.File) {
methods {
   @property part_highlight {
  set {
-/*@
-@brief
-@warning
-@see
-@ingroup Enventor */
  }
  get {
-/*@
-@brief
-@return
-@warning
-@see
-@ingroup Enventor */
  }
  values {
-part_highlight: bool; /*@ ... */
+part_highlight: bool;
  }
   }
   @property live_view_scale {
  set {
-/*@
-@brief
-@warning
-@see
-@ingroup Enventor */
  }
  get {
-/*@
-@brief
-@return
-@warning
-@see
-@ingroup Enventor */
  }
  values {
-scale: double; /*@ ... */
+scale: double;
  }
   }
   @property dummy_swallow {
  set {
-/*@
-@brief
-@warning
-@see
-@ingroup Enventor */
  }
  get {
-/*@
-@brief
-@return
-@warning
-@see
-@ingroup Enventor */
  }
  values {
-dummy_swallow: bool; /*@ ... */
+dummy_swallow: bool;
  }
   }
   @property auto_complete {
  set {
-/*@
-@brief
-@warning
-@see
-@ingroup Enventor */
  }
  get {
-/*@
-@brief
-@return
-@warning
-@see
-@ingroup Enventor */
  }
  values {
-auto_complete: bool; /*@ ... */
+auto_complete: bool;
  }
   }
   @property auto_indent {
  set {
-/*@
-@brief
-@warning
-@see
-@ingroup Enventor */
  }
  get {
-/*@
-@brief
-@return
-@warning
-@see
-@ingroup Enventor */
  }
  values {
-auto_indent: bool; /*@ ... */
+auto_indent: bool;
  }
   }
   @property ctxpopup {
  set {
-/*@
-@brief
-@warning
-@see
-@ingroup Enventor */
  }
  get {
-/*@
-@brief
-@return
-@warning
-@see
-@ingroup Enventor */
  }
  values {
-ctxpopup: bool; /*@ ... */
+ctxpopup: bool;
  }
   }
   @property focus {
  set {
-/*@
-@brief
-@warning
-@see
-@ingroup Enventor */
  }
  get {
-/*@
-@brief
-@return
-@warning
-@see
-@ingroup Enventor */
  }
  values {
-focus: bool; /*@ ... */
+focus: bool;
  }
   }
   @property modified {
  set {
-/*@
-@brief
-@warning
-@see
-@ingroup Enventor */
  }
  get {
-/*@
-@brief
-@return
-@warning
-@see
-@ingroup Enventor */
  }
  values {
-modified: bool; /*@ ... */
+modified: bool;
  }
   }
   @property font_scale {
  set {
-/*@
-@brief
-@warning
-@see
-@ingroup Enventor */
  }
  get {
-/*@
-@brief
-@return
-@warning
-@see
-@ingroup Enventor */
  }
  values {
-font_scale: double; /*@ ... */
+font_scale: double;
  }
   }
   @property linenumber {
  set {
-/*@
-@brief
-@warning
-@see
-@ingroup Enventor */
  }
  get {
-/*@
-@brief
-

[EGIT] [tools/enventor] master 01/01: Candidate list: filter the generated program names.

2015-09-04 Thread Mykyta Biliavskyi
hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=0a64eab88b711d1fdf7e03c6f4514a443b47e4fe

commit 0a64eab88b711d1fdf7e03c6f4514a443b47e4fe
Author: Mykyta Biliavskyi 
Date:   Fri Sep 4 15:39:00 2015 +0900

Candidate list: filter the generated program names.

Summary:
for cases when candidate list contain
names of programs, all generated names will be
ignored.
The generated name is started with: "program_0x" - template.

Reviewers: Hermet

Differential Revision: https://phab.enlightenment.org/D2970
---
 src/lib/ctxpopup.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/lib/ctxpopup.c b/src/lib/ctxpopup.c
index 71d7e88..d507d70 100644
--- a/src/lib/ctxpopup.c
+++ b/src/lib/ctxpopup.c
@@ -470,6 +470,9 @@ image_candidate_set(Evas_Object *ctxpopup, ctxpopup_data 
*ctxdata)
 static Eina_Bool
 program_candidate_set(Evas_Object *ctxpopup, ctxpopup_data *ctxdata)
 {
+   const char *PROGRAM_GEN = "program_0x";
+   int PROGRAM_GEN_LEN = 10;
+   int candidate_cntr = 0;
view_data *vd = edj_mgr_view_get(NULL);
if (!vd) return EINA_FALSE;
Eina_List *parts = view_programs_list_get(vd);
@@ -477,13 +480,16 @@ program_candidate_set(Evas_Object *ctxpopup, 
ctxpopup_data *ctxdata)
char *part;
EINA_LIST_FOREACH(parts, l, part)
  {
+if (!strncmp(part, PROGRAM_GEN, PROGRAM_GEN_LEN))
+   continue;
 snprintf(ctxdata->candidate, sizeof(ctxdata->candidate), "\"%s\"",
  part);
 elm_ctxpopup_item_append(ctxpopup, ctxdata->candidate, NULL,
  ctxpopup_it_cb, ctxdata);
+candidate_cntr++;
  }
view_string_list_free(parts);
-   return EINA_TRUE;
+   return candidate_cntr ? EINA_TRUE : EINA_FALSE;
 }
 
 static Eina_Bool

--