[EGIT] [core/elementary] elementary-1.15 01/01: list: fix crash while setting nearest item in viewport

2015-08-16 Thread Amitesh Singh
ami pushed a commit to branch elementary-1.15.

http://git.enlightenment.org/core/elementary.git/commit/?id=d8d78a708769773d02f96222d3e772edbe536942

commit d8d78a708769773d02f96222d3e772edbe536942
Author: Amitesh Singh amitesh...@samsung.com
Date:   Sat Aug 15 22:46:51 2015 +0530

list: fix crash while setting nearest item in viewport

This is an example of classic code copy and paste mistake.
Probably inspired from similar code in genlist/gengrid.
We were actually deleting the other items (except selected one) in
viewport in _elm_list_nearest_visible_item_get() which results into crash
while deleting the list object.

@fix

Resolves: T2662
---
 src/lib/elm_list.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 7c9d086..dc325da 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -1233,7 +1233,6 @@ _elm_list_nearest_visible_item_get(Evas_Object *obj, 
Elm_List_Item_Data *it)
  if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) 
  !elm_object_item_disabled_get(EO_OBJ(item)))
{
-  eina_list_free(item_list);
   return item;
}
   }
@@ -1248,12 +1247,10 @@ _elm_list_nearest_visible_item_get(Evas_Object *obj, 
Elm_List_Item_Data *it)
  if (ELM_RECTS_INCLUDE(vx, vy, vw, vh, cx, cy, cw, ch) 
  !elm_object_item_disabled_get(EO_OBJ(item)))
{
-  eina_list_free(item_list);
   return item;
}
   }
  }
-   eina_list_free(item_list);
 
return it;
 }

-- 




[EGIT] [bindings/python/python-efl] master 01/01: Improve a bit Genlist documentation

2015-08-16 Thread Dave Andreoli
davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=191ce5c22c8e651309f7e84adbba9d51c54c56c4

commit 191ce5c22c8e651309f7e84adbba9d51c54c56c4
Author: Dave Andreoli d...@gurumeditation.it
Date:   Sun Aug 16 12:10:46 2015 +0200

Improve a bit Genlist documentation

This can be improved lots more, but I'm out of time :(
---
 CODING| 39 +
 doc/elementary/genlist.rst| 73 ++-
 efl/elementary/genlist_widget.pxi | 16 -
 3 files changed, 72 insertions(+), 56 deletions(-)

diff --git a/CODING b/CODING
index d01752c..8b1fed6 100644
--- a/CODING
+++ b/CODING
@@ -23,6 +23,45 @@ Style
   ...also because I found it more readable and I like it more :P -davemds-
 
 
+Documentation cheatsheet
+
+
+* Links:
+
+  :class:`List`(for classes)
+  :func:`elm_list_go`  (for functions)
+  :attr:`homogeneous`  (for properties)
+  :ref:`Elm_List_Mode` (for enums)
+
+  :func:`efl.evas.Object.delete`  (for items not in current scope)
+  :func:`~efl.evas.Object.delete` (will show it short, just delete)
+
+* Formatting:
+
+  ``ELM_LIST_SCROLL``  (for enum values, bools and None)
+
+
+* Versions:
+
+.. versionadded:: 1.15
+
+.. versionchanged:: 1.15
+Description of the change.
+
+.. deprecated:: 1.15
+Use the blah, blah way instead.
+
+* Notes:
+
+.. seealso:: :py:attr:`mode`
+
+.. note:: Some text to be noted, blah, blah, blah,
+some more information for this note, etc.
+
+.. warning:: Same as note, but the box will be red
+some more information for this warning, etc.
+
+
 Design patterns
 ===
 
diff --git a/doc/elementary/genlist.rst b/doc/elementary/genlist.rst
index 493a06c..53a6b6c 100644
--- a/doc/elementary/genlist.rst
+++ b/doc/elementary/genlist.rst
@@ -14,8 +14,8 @@ Elementary that could have more flexible items and allow many 
more
 entries while still being fast and low on memory usage. At the same time
 it was also made to be able to do tree structures. But the price to pay
 is more complexity when it comes to usage. If all you want is a simple
-list with icons and a single text, use the normal
-:py:class:`~efl.elementary.list.List` object.
+list (not much items) with icons and a single text, use the normal
+:class:`List` object.
 
 Genlist has a fairly large API, mostly because it's relatively complex,
 trying to be both expansive, powerful and efficient. First we will begin
@@ -26,63 +26,45 @@ Genlist item classes - creating items
 =
 
 In order to have the ability to add and delete items on the fly, genlist
-implements a class (callback) system where the application provides a
+implements the item class (callback) system where the application provides a
 structure with information about that type of item (genlist may contain
 multiple different items with different classes, states and styles).
-Genlist will call the functions in this struct (methods) when an item is
+Genlist will call the functions in this class (methods) when an item is
 realized (i.e., created dynamically, while the user is scrolling the
 grid). All objects will simply be deleted when no longer needed with
-:py:meth:`~efl.evas.Object.delete`. :py:class:`GenlistItemClass` contains the
+:func:`efl.evas.Object.delete`. :class:`GenlistItemClass` contains the
 following members:
 
-- ``item_style`` - This is a constant string and simply defines the name
-  of the item style. It **must** be specified and the default should be
-  ``default.``
-- ``decorate_item_style`` - This is a constant string and simply defines
-  the name of the decorate mode item style. It is used to specify
-  decorate mode item style. It can be used when you call
-  :py:attr:`GenlistItem.decorate_mode`.
-- ``decorate_all_item_style`` - This is a constant string and simply
-  defines the name of the decorate all item style. It is used to specify
-  decorate all item style. It can be used to set selection, checking and
-  deletion mode. This is used when you call
-  :py:attr:`Genlist.decorate_mode`.
-- ``func`` - A struct with pointers to functions that will be called when
-  an item is going to be actually created. All of them receive a ``data``
-  parameter that will point to the same data passed to
-  :py:meth:`GenlistItem.append_to` and related item creation functions, and an
-  ``obj`` parameter that points to the genlist object itself.
-
-The function pointers inside ``func`` are ``text_get``, ``content_get``,
-``state_get`` and ``del``. The 3 first functions also receive a ``part``
-parameter described below. A brief description of these functions follows:
-
-- ``text_get`` - The ``part`` parameter is the name string of one of the
-  existing text parts in the Edje group implementing the item's theme.
-  See :py:meth:`GenlistItemClass.text_get`.
-- ``content_get`` - The ``part`` parameter is the 

[EGIT] [admin/devs] master 01/01: add my new ed25519 key.

2015-08-16 Thread Cedric BAIL
cedric pushed a commit to branch master.

http://git.enlightenment.org/admin/devs.git/commit/?id=1f01ed70f63273b29abdd9bd9a87cca11ad4f1e1

commit 1f01ed70f63273b29abdd9bd9a87cca11ad4f1e1
Author: Cedric BAIL ced...@osg.samsung.com
Date:   Sun Aug 16 18:59:30 2015 +0200

add my new ed25519 key.
---
 developers/cedric/id_ed25519.pub | 1 +
 1 file changed, 1 insertion(+)

diff --git a/developers/cedric/id_ed25519.pub b/developers/cedric/id_ed25519.pub
new file mode 100644
index 000..3573d2e
--- /dev/null
+++ b/developers/cedric/id_ed25519.pub
@@ -0,0 +1 @@
+ssh-ed25519 
C3NzaC1lZDI1NTE5IDNg4QtaT7/7nLjMAbTOXaAWfT4k8h7qTMBrsg39P9KK 
cedric@ativ9

-- 




[EGIT] [admin/devs] master 01/01: New ed25519 key

2015-08-16 Thread maxerba
maxerba pushed a commit to branch master.

http://git.enlightenment.org/admin/devs.git/commit/?id=13cd8f061deb31a902b10c762fea8d0609490861

commit 13cd8f061deb31a902b10c762fea8d0609490861
Author: maxerba maiur...@gmail.com
Date:   Sun Aug 16 19:50:06 2015 +0200

New ed25519 key
---
 developers/maxerba/id_ed25519.pub | 1 +
 1 file changed, 1 insertion(+)

diff --git a/developers/maxerba/id_ed25519.pub 
b/developers/maxerba/id_ed25519.pub
new file mode 100644
index 000..456101a
--- /dev/null
+++ b/developers/maxerba/id_ed25519.pub
@@ -0,0 +1 @@
+ssh-ed25519 
C3NzaC1lZDI1NTE5IOD6nZgXp0aEM/dls5Cx8WdbiXZpUhwrHpIj0oabSwwY max@rubino

-- 




[EGIT] [apps/ephoto] master 02/02: Fix memory leak

2015-08-16 Thread Flavio Ceolin
ceolin pushed a commit to branch master.

http://git.enlightenment.org/apps/ephoto.git/commit/?id=f8471f846a19617adcf25f1e39380758c9ed7353

commit f8471f846a19617adcf25f1e39380758c9ed7353
Author: Flavio Ceolin flavio.ceo...@gmail.com
Date:   Sun Aug 16 20:03:43 2015 -0300

Fix memory leak

String returned by _ephoto_get_file_size() was leaking.
---
 src/bin/ephoto_single_browser.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/bin/ephoto_single_browser.c b/src/bin/ephoto_single_browser.c
index e24ef06..420f848 100644
--- a/src/bin/ephoto_single_browser.c
+++ b/src/bin/ephoto_single_browser.c
@@ -611,11 +611,13 @@ _ephoto_single_browser_recalc(Ephoto_Single_Browser *sb)
}
  else
{
+  char *tmp = _ephoto_get_file_size(sb-entry-path);
   evas_object_image_size_get(elm_image_object_get(v-image), 
w, h);
   snprintf(image_info, PATH_MAX,
b%s:/b %sb%s:/b %dx%d
b%s:/b %s,
_(Type), efreet_mime_type_get(sb-entry-path), 
_(Resolution), w, h,
-   _(File Size), 
_ephoto_get_file_size(sb-entry-path));
+   _(File Size), tmp);
+  free(tmp);
   sb-botbox = 
evas_object_rectangle_add(evas_object_evas_get(sb-table));
   evas_object_color_set(sb-botbox, 0, 0, 0, 0);
   evas_object_size_hint_min_set(sb-botbox, 0, 
sb-ephoto-bottom_bar_size);
@@ -1154,7 +1156,7 @@ _apply_crop(void *data, Evas_Object *obj EINA_UNUSED, 
void *event_info EINA_UNUS
Evas_Object *crop;
 
const char *path, *key, *type;;
-   char tmp_path[PATH_MAX], image_info[PATH_MAX];
+   char tmp_path[PATH_MAX], image_info[PATH_MAX], *tmp;
int x, y, w, h, cx, cy, cw, ch, iw, ih;
int nx, ny, nw, nh, i, j, tmpx, tmpy, ind, index;
double scalex, scaley, scalew, scaleh;
@@ -1212,10 +1214,12 @@ _apply_crop(void *data, Evas_Object *obj EINA_UNUSED, 
void *event_info EINA_UNUS
evas_object_show(sb-viewer);
 
evas_object_del(sb-botbox);
+   tmp = _ephoto_get_file_size(tmp_path);
snprintf(image_info, PATH_MAX,
  b%s:/b %sb%s:/b %dx%db%s:/b %s,
  _(Type), efreet_mime_type_get(tmp_path), _(Resolution), nw, 
nh,
- _(File Size), _ephoto_get_file_size(tmp_path));
+ _(File Size), tmp);
+   free(tmp);
sb-botbox = evas_object_rectangle_add(evas_object_evas_get(sb-table));
evas_object_color_set(sb-botbox, 0, 0, 0, 0);
evas_object_size_hint_min_set(sb-botbox, 0, sb-ephoto-bottom_bar_size);

-- 




[EGIT] [admin/devs] master 01/01: Remove old Dsa key

2015-08-16 Thread maxerba
maxerba pushed a commit to branch master.

http://git.enlightenment.org/admin/devs.git/commit/?id=91527ce605f34cb021332bbfdbe6030789ef6c62

commit 91527ce605f34cb021332bbfdbe6030789ef6c62
Author: maxerba maiur...@gmail.com
Date:   Mon Aug 17 00:28:59 2015 +0200

Remove old Dsa key
---
 developers/maxerba/id_dsa.pub | 2 --
 1 file changed, 2 deletions(-)

diff --git a/developers/maxerba/id_dsa.pub b/developers/maxerba/id_dsa.pub
deleted file mode 100644
index 5e33eaa..000
--- a/developers/maxerba/id_dsa.pub
+++ /dev/null
@@ -1,2 +0,0 @@
-ssh-dss 
B3NzaC1kc3MAAACBAIlb5xC8bNS1KAW+5ptWNbuDK41zvp9Q/AP/bVf7Rg04JTwz4B/xuqEmegncUkGHePJyqcax6RbR1ioNh+YMdOq+ewSJ3tOv6Y1+aeKFwkUYnSWnxsZrleuePyz0JKdkGQCfE6i1/NWyWEzEqHNVcMTA9lY5s08HJoUndMBplN4pFQDdvZUqetNevv+Yfe3P+e0yS+IMLQAAAIAFsF4wRPygzpCzGIa6l3QB6h5o1ehkle+Pqb28dvraeX5WpGxypywvddIoSog5xSV0SZGaZCSPyEiWVElcv8M+ZfL06oLm9/evbYpNpeAUNAfa7zYMgK90CJlKPTPG6GQrAS2AKUbGdZKJxcpzxckq6AbeDQ4KgsrSiqUgqe0W8gAAAIAHICM4fK5+4fuoUJZ75WdWzx+JKrqNo/UYeoFOyBs8E6b8vzWJEFeOmFo/gNeGpp/SzdlbkaQgX7gE
 [...]
-

-- 




[EGIT] [apps/ephoto] master 01/02: browser: Fix function type

2015-08-16 Thread Flavio Ceolin
ceolin pushed a commit to branch master.

http://git.enlightenment.org/apps/ephoto.git/commit/?id=68271a0c89c61eb7bf74eb94242bd5580830963a

commit 68271a0c89c61eb7bf74eb94242bd5580830963a
Author: Flavio Ceolin flavio.ceo...@gmail.com
Date:   Sun Aug 16 19:24:52 2015 -0300

browser: Fix function type

Returning char * instead of const char * since the function returns
an strdup() string.
---
 src/bin/ephoto_single_browser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/ephoto_single_browser.c b/src/bin/ephoto_single_browser.c
index dc83825..e24ef06 100644
--- a/src/bin/ephoto_single_browser.c
+++ b/src/bin/ephoto_single_browser.c
@@ -507,7 +507,7 @@ _last_entry_find(Ephoto_Single_Browser *sb)
return eina_list_last_data_get(sb-ephoto-entries);
 }
 
-static const char *
+static char *
 _ephoto_get_file_size(const char *path)
 {
char isize[PATH_MAX];

-- 




[EGIT] [apps/rage] master 01/01: use blank focus style for input catcher button widget

2015-08-16 Thread Carsten Haitzler (Rasterman)
raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=b0d6d61b24874f40fda0553e56efa1f9c1b40437

commit b0d6d61b24874f40fda0553e56efa1f9c1b40437
Author: Carsten Haitzler (Rasterman) ras...@rasterman.com
Date:   Mon Aug 17 10:50:05 2015 +0900

use blank focus style for input catcher button widget
---
 src/bin/win.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/bin/win.c b/src/bin/win.c
index 4e768e2..4b95e9f 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -410,6 +410,7 @@ win_add(void)
dnd_init(win, o);
 
o = elm_button_add(win);
+   elm_object_focus_move_policy_set(o, ELM_FOCUS_MOVE_POLICY_CLICK);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, o);
evas_object_color_set(o, 0, 0, 0, 0);
@@ -424,6 +425,7 @@ win_add(void)
 
// a dummy button to collect key events and have focus
o = elm_button_add(win);
+   elm_object_focus_highlight_style_set(o, blank);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, o);
evas_object_lower(o);

-- 




[EGIT] [core/elementary] master 01/01: elm theme - add a blank focus style if you want invisible focus

2015-08-16 Thread Carsten Haitzler
raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=e5ebef8de1a81a8b96800f4a1b43c528aaa9989a

commit e5ebef8de1a81a8b96800f4a1b43c528aaa9989a
Author: Carsten Haitzler (Rasterman) ras...@rasterman.com
Date:   Mon Aug 17 10:48:47 2015 +0900

elm theme - add a blank focus style if you want invisible focus

in some cases you may want a widget to focus but not to get a blue
hilightaround it - thus provide a blank focus style just for this.

@feature
---
 data/themes/edc/elm/focus.edc | 5 +
 1 file changed, 5 insertions(+)

diff --git a/data/themes/edc/elm/focus.edc b/data/themes/edc/elm/focus.edc
index 19d78cd..f4da05f 100644
--- a/data/themes/edc/elm/focus.edc
+++ b/data/themes/edc/elm/focus.edc
@@ -155,3 +155,8 @@ group { name: elm/focus_highlight/top/default;
   }
}
 }
+
+group { name: elm/focus_highlight/top/blank;
+   parts {
+   }
+}

-- 




[EGIT] [core/elementary] master 01/01: Entry: fix cursor repositioning on theme_apply

2015-08-16 Thread Daniel Hirt
herdsman pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=7d1c89c266cd196ab9f6f3886514a0cab64465bb

commit 7d1c89c266cd196ab9f6f3886514a0cab64465bb
Author: Daniel Hirt daniel.h...@samsung.com
Date:   Mon Aug 17 08:34:21 2015 +0300

Entry: fix cursor repositioning on theme_apply

Summary:
The original code did not consider the case where the text will be
reapplied by chunks. The repositioning of the cursor should be postponed
to when the idler work is done, or not required at all.
Fixes T2646.
@fix

Reviewers: NikaWhite

Reviewed By: NikaWhite

Maniphest Tasks: T2646

Differential Revision: https://phab.enlightenment.org/D2952
---
 src/lib/elm_entry.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index c9e36d4..0ba453b 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -831,9 +831,6 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data 
*sd)
// and one of them can delete elm_entry.
evas_object_ref(obj);
 
-   if (sd-cursor_pos != 0)
- elm_entry_cursor_pos_set(obj, sd-cursor_pos);
-
if (elm_widget_focus_get(obj))
  edje_object_signal_emit(sd-entry_edje, elm,action,focus, elm);
 
@@ -2689,6 +2686,8 @@ _text_append_idler(void *data)
  }
else
  {
+edje_object_part_text_cursor_pos_set(sd-entry_edje, elm.text,
+  EDJE_CURSOR_MAIN, sd-cursor_pos);
 free(sd-append_text_left);
 sd-append_text_left = NULL;
 sd-append_text_idler = NULL;
@@ -2926,6 +2925,8 @@ _entry_text_append(Evas_Object* obj, const char* entry, 
Eina_Bool set)
{
   edje_object_part_text_append(sd-entry_edje, elm.text, 
entry);
}
+ edje_object_part_text_cursor_pos_set(sd-entry_edje, elm.text,
+   EDJE_CURSOR_MAIN, sd-cursor_pos);
  eo_do(obj, eo_event_callback_call(ELM_ENTRY_EVENT_TEXT_SET_DONE, 
NULL));
   }
  }

-- 




[EGIT] [apps/terminology] master 01/02: Dont use : as a separator but trim it from selected word. Fixes T2602

2015-08-16 Thread Panagiotis Galatsanos
billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=8e8207dae1e2fc9195de5c97041d5d44629b702a

commit 8e8207dae1e2fc9195de5c97041d5d44629b702a
Author: godfath3r galatsan...@gmail.com
Date:   Sun Aug 16 20:36:38 2015 +0200

Dont use : as a separator but trim it from selected word. Fixes T2602

Reviewers: billiob

Maniphest Tasks: T2602

Differential Revision: https://phab.enlightenment.org/D2931
---
 src/bin/termio.c | 95 ++--
 1 file changed, 92 insertions(+), 3 deletions(-)

diff --git a/src/bin/termio.c b/src/bin/termio.c
index 9992b22..c92fd6e 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -2600,7 +2600,6 @@ _codepoint_is_wordsep(const Eina_Unicode g)
')',
'*',
',',
-   ':',
';',
'=',
'?',
@@ -2770,6 +2769,95 @@ _codepoint_is_wordsep(const Eina_Unicode g)
return EINA_FALSE;
 }
 
+Eina_Bool
+_to_trim(Eina_Unicode codepoint)
+{
+   static const Eina_Unicode trim_chars[] =
+ {
+   ':',
+   '',
+   '',
+   '.'
+ };
+   int i = 0;
+   size_t len;
+   len = sizeof(trim_chars)/sizeof((trim_chars)[0]);
+
+   for (i == 0; i  len; i++)
+ if (codepoint == trim_chars[i])
+   return EINA_TRUE;
+   return EINA_FALSE;
+}
+
+static void
+_trim_sel_word(Termio *sd, int w)
+{
+   Termcell *cells;
+   int start = 0, end = 0, line = 0, k = 0;
+   if (sd-pty-selection.start.y != sd-pty-selection.end.y)
+ {
+start = sd-pty-selection.start.x;
+end = sd-pty-selection.end.x;
+k = sd-pty-selection.end.y - sd-pty-selection.start.y;
+for (; k = 0; k--)
+  {
+ line = sd-pty-selection.start.y;
+ cells = termpty_cellrow_get(sd-pty, line, w); 
+
+ while (_to_trim(cells[start].codepoint)) start++;
+
+ if (start = w)
+   {
+  start = 0;
+  sd-pty-selection.start.y += 1;
+   }
+ 
+ if (sd-pty-selection.start.y == sd-pty-selection.end.y)
+   {
+  start = 0; 
+  line = sd-pty-selection.start.y;
+  cells = termpty_cellrow_get(sd-pty, line, w); 
+  while (_to_trim(cells[start].codepoint)) start++;
+  while (_to_trim(cells[end].codepoint)) end--;
+  break;
+   }
+  }
+sd-pty-selection.start.x = start;
+
+start = sd-pty-selection.start.x;
+end = sd-pty-selection.end.x;
+k = sd-pty-selection.end.y;
+for (; k = sd-pty-selection.start.y; k--)
+  {
+ line = sd-pty-selection.end.y;
+ cells = termpty_cellrow_get(sd-pty, line, w); 
+
+ while (_to_trim(cells[end].codepoint)) end--;
+
+ if (end = 0)
+   {
+  end = w;
+  sd-pty-selection.end.y -= 1;
+   }
+  }
+sd-pty-selection.end.x = end;
+ }
+   else
+ {
+line = sd-pty-selection.start.y;
+start = sd-pty-selection.start.x;
+end = sd-pty-selection.end.x;
+
+cells = termpty_cellrow_get(sd-pty, line, w);
+
+while (_to_trim(cells[start].codepoint)) start++;
+while (_to_trim(cells[end].codepoint)) end--;
+
+sd-pty-selection.start.x = start;
+sd-pty-selection.end.x = end;
+ }
+}
+
 static void
 _sel_word(Termio *sd, int cx, int cy)
 {
@@ -2884,6 +2972,7 @@ _sel_word(Termio *sd, int cx, int cy)
 
   end:
 
+   _trim_sel_word(sd, w);
sd-pty-selection.by_word = EINA_TRUE;
sd-pty-selection.is_top_to_bottom = EINA_TRUE;
 
@@ -3991,9 +4080,9 @@ _smart_cb_mouse_down(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_UNUS
  if (!sd-pty-selection.is_active  sd-didclick)
sd-pty-selection.is_active = EINA_TRUE;
  if (shift  sd-pty-selection.is_active)
-  _sel_word_to(sd, cx, cy - sd-scroll, EINA_TRUE);
+   _sel_word_to(sd, cx, cy - sd-scroll, EINA_TRUE);
  else
-  _sel_word(sd, cx, cy - sd-scroll);
+   _sel_word(sd, cx, cy - sd-scroll);
  if (sd-pty-selection.is_active)
termio_take_selection(data, ELM_SEL_TYPE_PRIMARY);
  sd-didclick = EINA_TRUE;

-- 




[EGIT] [apps/terminology] master 02/02: fix small issue on word selection and simplify code

2015-08-16 Thread Boris Faure
billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=716cb03b5b6a2bdba2a913ba3a2f6df9fc8793d1

commit 716cb03b5b6a2bdba2a913ba3a2f6df9fc8793d1
Author: Boris Faure bill...@gmail.com
Date:   Sun Aug 16 21:40:58 2015 +0200

fix small issue on word selection and simplify code
---
 src/bin/termio.c | 113 ++-
 1 file changed, 54 insertions(+), 59 deletions(-)

diff --git a/src/bin/termio.c b/src/bin/termio.c
index c92fd6e..69eaf1b 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -2769,7 +2769,7 @@ _codepoint_is_wordsep(const Eina_Unicode g)
return EINA_FALSE;
 }
 
-Eina_Bool
+static Eina_Bool
 _to_trim(Eina_Unicode codepoint)
 {
static const Eina_Unicode trim_chars[] =
@@ -2779,83 +2779,78 @@ _to_trim(Eina_Unicode codepoint)
'',
'.'
  };
-   int i = 0;
-   size_t len;
+   size_t i = 0, len;
len = sizeof(trim_chars)/sizeof((trim_chars)[0]);
 
-   for (i == 0; i  len; i++)
+   for (i = 0; i  len; i++)
  if (codepoint == trim_chars[i])
return EINA_TRUE;
return EINA_FALSE;
 }
 
 static void
-_trim_sel_word(Termio *sd, int w)
+_trim_sel_word(Termio *sd)
 {
+   Termpty *pty = sd-pty;
Termcell *cells;
-   int start = 0, end = 0, line = 0, k = 0;
-   if (sd-pty-selection.start.y != sd-pty-selection.end.y)
- {
-start = sd-pty-selection.start.x;
-end = sd-pty-selection.end.x;
-k = sd-pty-selection.end.y - sd-pty-selection.start.y;
-for (; k = 0; k--)
-  {
- line = sd-pty-selection.start.y;
- cells = termpty_cellrow_get(sd-pty, line, w); 
-
- while (_to_trim(cells[start].codepoint)) start++;
+   int start = 0, end = 0, y = 0;
+   ssize_t w;
 
- if (start = w)
-   {
-  start = 0;
-  sd-pty-selection.start.y += 1;
-   }
- 
- if (sd-pty-selection.start.y == sd-pty-selection.end.y)
-   {
-  start = 0; 
-  line = sd-pty-selection.start.y;
-  cells = termpty_cellrow_get(sd-pty, line, w); 
-  while (_to_trim(cells[start].codepoint)) start++;
-  while (_to_trim(cells[end].codepoint)) end--;
-  break;
-   }
-  }
-sd-pty-selection.start.x = start;
+   /* 1st step: trim from the start */
+   start = pty-selection.start.x;
+   for (y = pty-selection.start.y;
+y = pty-selection.end.y;
+y++)
+ {
+cells = termpty_cellrow_get(pty, y, w);
 
-start = sd-pty-selection.start.x;
-end = sd-pty-selection.end.x;
-k = sd-pty-selection.end.y;
-for (; k = sd-pty-selection.start.y; k--)
-  {
- line = sd-pty-selection.end.y;
- cells = termpty_cellrow_get(sd-pty, line, w); 
+while (start  w  _to_trim(cells[start].codepoint))
+  start++;
 
- while (_to_trim(cells[end].codepoint)) end--;
+if (start  w)
+  break;
 
- if (end = 0)
-   {
-  end = w;
-  sd-pty-selection.end.y -= 1;
-   }
-  }
-sd-pty-selection.end.x = end;
+start = 0;
  }
-   else
+   /* check validy of the selection */
+   if ((y  pty-selection.end.y) ||
+   ((y == pty-selection.end.y) 
+(start = pty-selection.end.x)))
  {
-line = sd-pty-selection.start.y;
-start = sd-pty-selection.start.x;
-end = sd-pty-selection.end.x;
+pty-selection.start.y = pty-selection.start.y;
+pty-selection.start.x = pty-selection.end.x;
+return;
+ }
+   pty-selection.start.y = y;
+   pty-selection.start.x = start;
 
-cells = termpty_cellrow_get(sd-pty, line, w);
+   /* 2nd step: trim from the end */
+   end = pty-selection.end.x;
+   for (y = pty-selection.end.y;
+y = pty-selection.start.y;
+y--)
+ {
+cells = termpty_cellrow_get(pty, y, w);
 
-while (_to_trim(cells[start].codepoint)) start++;
-while (_to_trim(cells[end].codepoint)) end--;
+while (end = 0  _to_trim(cells[end].codepoint))
+  end--;
 
-sd-pty-selection.start.x = start;
-sd-pty-selection.end.x = end;
+if (end = 0)
+  break;
+ }
+   if (end  0)
+ return;
+   /* check validy of the selection */
+   if ((y  pty-selection.start.y) ||
+   ((y == pty-selection.start.y) 
+(end  pty-selection.start.x)))
+ {
+pty-selection.end.x = pty-selection.end.x;
+pty-selection.end.y = pty-selection.start.y;
+return;
  }
+   pty-selection.end.x = end;
+   pty-selection.end.y = y;
 }
 
 static void
@@ -2972,9 +2967,9 @@ _sel_word(Termio *sd, int cx, int cy)
 
   end:
 
-   _trim_sel_word(sd, w);
sd-pty-selection.by_word = EINA_TRUE;

[EGIT] [apps/terminology] master 01/01: add powerlines to word separators

2015-08-16 Thread Boris Faure
billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=a33a937ab76913845fd43b7b85c63486c9d9cb39

commit a33a937ab76913845fd43b7b85c63486c9d9cb39
Author: Boris Faure bill...@gmail.com
Date:   Sun Aug 16 21:48:22 2015 +0200

add powerlines to word separators
---
 src/bin/termio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/bin/termio.c b/src/bin/termio.c
index 69eaf1b..91eb8cc 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -2718,6 +2718,9 @@ _codepoint_is_wordsep(const Eina_Unicode g)
0xa60d,
0xa60f,
0xa6f5,
+   0xe0a0,
+   0xe0b0,
+   0xe0b2,
0xfe10,
0xfe41,
0xfe42,

--