[EGIT] [enlightenment/modules/edgar] master 01/01: Cpu gadget: add a popup with the list of running processes

2015-09-13 Thread Dave Andreoli
davemds pushed a commit to branch master.

http://git.enlightenment.org/enlightenment/modules/edgar.git/commit/?id=7cdd484427f44dd43239a4fd1e47c27ef53b37bc

commit 7cdd484427f44dd43239a4fd1e47c27ef53b37bc
Author: Dave Andreoli 
Date:   Sun Sep 13 16:23:14 2015 +0200

Cpu gadget: add a popup with the list of running processes
---
 GADGETS/cpu/__init__.py | 98 +
 GADGETS/cpu/cpu.edc | 11 +-
 2 files changed, 92 insertions(+), 17 deletions(-)

diff --git a/GADGETS/cpu/__init__.py b/GADGETS/cpu/__init__.py
index 53d0f7c..2cc6ca3 100644
--- a/GADGETS/cpu/__init__.py
+++ b/GADGETS/cpu/__init__.py
@@ -1,5 +1,6 @@
 # This python file use the following encoding: utf-8
 
+from operator import itemgetter
 import psutil
 
 import e
@@ -8,6 +9,8 @@ from efl import ecore
 from efl import evas
 from efl import edje
 from efl.evas import EXPAND_BOTH, FILL_BOTH
+from efl.elementary import Box, Label, Entry, Icon, Genlist, GenlistItemClass, 
\
+ELM_OBJECT_SELECT_MODE_NONE, ELM_LIST_COMPRESS
 
 
 __gadget_name__ = 'CPU Monitor'
@@ -19,7 +22,6 @@ __gadget_vapi__ = 1
 __gadget_opts__ = { 'popup_on_desktop': False }
 
 
-
 class Gadget(e.Gadget):
 
 def __init__(self):
@@ -27,7 +29,11 @@ class Gadget(e.Gadget):
 
 self.num_cores = len(psutil.cpu_percent(interval=0, percpu=True))
 self.aspect = None
-self.poller = None
+self.main_poller = None
+self.popups_poller = None
+self.popups_itc = GenlistItemClass(item_style='default',
+   text_get_func=self.gl_text_get,
+   
content_get_func=self.gl_content_get)
 
 def instance_created(self, obj, site):
 super().instance_created(obj, site)
@@ -48,17 +54,17 @@ class Gadget(e.Gadget):
 obj.size_hint_aspect = (evas.EVAS_ASPECT_CONTROL_BOTH,
 self.aspect[0] * self.num_cores, 
self.aspect[1])
 
-if self.poller is None:
-self.poller = ecore.Poller(8, self.poller_cb, 
ecore.ECORE_POLLER_CORE)
+if self.main_poller is None:
+self.main_poller = ecore.Poller(8, self.main_poller_cb)
 
 def instance_destroyed(self, obj):
 super().instance_destroyed(obj)
 
-if len(self._instances) < 1 and self.poller is not None:
-self.poller.delete()
-self.poller = None
+if len(self._instances) < 1 and self.main_poller is not None:
+self.main_poller.delete()
+self.main_poller = None
 
-def poller_cb(self):
+def main_poller_cb(self):
 percents = psutil.cpu_percent(interval=0, percpu=True)
 
 for obj in self._instances:
@@ -66,3 +72,79 @@ class Gadget(e.Gadget):
 bar.message_send(0, percents[i])
 
 return ecore.ECORE_CALLBACK_RENEW
+
+def popup_created(self, popup):
+super().popup_created(popup)
+
+box = Box(popup)
+popup.part_swallow('main.swallow', box)
+box.show()
+
+en = Entry(popup, single_line=True, editable=False)
+en.text_style_user_push("DEFAULT='font_weight=Bold'")
+box.pack_end(en)
+en.show()
+popup.data['head'] = en
+
+li = Genlist(popup, homogeneous=True, mode=ELM_LIST_COMPRESS,
+ select_mode=ELM_OBJECT_SELECT_MODE_NONE,
+ size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH)
+box.pack_end(li)
+li.show()
+popup.data['list'] = li
+
+self.popups_poller_cb()
+if self.popups_poller is None:
+self.popups_poller = ecore.Poller(16, self.popups_poller_cb)
+
+def popup_destroyed(self, popup):
+super().popup_destroyed(popup)
+
+if len(self._popups) < 1 and self.popups_poller is not None:
+self.popups_poller.delete()
+self.popups_poller = None
+
+def popups_poller_cb(self):
+# build an orderd list of all running procs (pid, name, cpu_perc, 
mun_t)
+self.top_procs = [ (p.pid, p.name(),
+p.cpu_percent(interval=0) / self.num_cores,
+p.num_threads())
+   for p in psutil.process_iter() ]
+self.top_procs.sort(key=itemgetter(2), reverse=True)
+
+# update all the visible genlists
+for popup in self._popups:
+li = popup.data['list']
+
+# adjust the size (items count) of the genlist
+items_count = li.items_count()
+procs_count = len(self.top_procs)
+if procs_count > items_count:
+for idx in range(items_count, procs_count):
+li.item_append(self.popups_itc, idx)
+elif procs_count < items_count:
+for idx in range(procs_count, items_count):
+li.last_item.delete()
+
+# update visible list items and the 

[EGIT] [enlightenment/modules/edgar] master 01/01: Cpu gadget: add compatibility with older psutil

2015-09-13 Thread Dave Andreoli
davemds pushed a commit to branch master.

http://git.enlightenment.org/enlightenment/modules/edgar.git/commit/?id=4386c386e44534ec808ea3443782229a4e258e4e

commit 4386c386e44534ec808ea3443782229a4e258e4e
Author: Dave Andreoli 
Date:   Sun Sep 13 16:47:56 2015 +0200

Cpu gadget: add compatibility with older psutil

not tested yet, will try tomorrow..but should work
---
 GADGETS/cpu/__init__.py | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/GADGETS/cpu/__init__.py b/GADGETS/cpu/__init__.py
index 2cc6ca3..7bf9366 100644
--- a/GADGETS/cpu/__init__.py
+++ b/GADGETS/cpu/__init__.py
@@ -106,10 +106,16 @@ class Gadget(e.Gadget):
 
 def popups_poller_cb(self):
 # build an orderd list of all running procs (pid, name, cpu_perc, 
mun_t)
-self.top_procs = [ (p.pid, p.name(),
-p.cpu_percent(interval=0) / self.num_cores,
-p.num_threads())
-   for p in psutil.process_iter() ]
+if psutil.version_info[0] < 2:
+self.top_procs = [ (p.pid, p.name,
+p.get_cpu_percent(interval=0) / self.num_cores,
+p.get_num_threads())
+   for p in psutil.process_iter() ]
+else:
+self.top_procs = [ (p.pid, p.name(),
+p.cpu_percent(interval=0) / self.num_cores,
+p.num_threads())
+   for p in psutil.process_iter() ]
 self.top_procs.sort(key=itemgetter(2), reverse=True)
 
 # update all the visible genlists

-- 




[EGIT] [apps/terminology] master 02/03: fix backlog locking

2015-09-13 Thread Boris Faure
billiob pushed a commit to branch master.

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

commit 386cf11b19988462e675294cdec5ff74ebd73690
Author: Boris Faure 
Date:   Thu Sep 10 23:38:59 2015 +0200

fix backlog locking
---
 src/bin/termpty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 5ff680b..73c76e9 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -977,7 +977,7 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
if ((new_w == new_h) && (new_w == 1)) return; // FIXME: something weird is
  // going on at term init
 
-   termpty_backlog_unlock();
+   termpty_backlog_lock();
 
if (ty->altbuf)
  {

-- 




[EGIT] [apps/terminology] master 03/03: termpty: fix resizing

2015-09-13 Thread Boris Faure
billiob pushed a commit to branch master.

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

commit a334bf6554b31941cb646217e5e3e8d3061f0f0b
Author: Boris Faure 
Date:   Sun Sep 13 23:15:07 2015 +0200

termpty: fix resizing

do not add a useless newline
do not copy the same content few times
---
 src/bin/termpty.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 73c76e9..ef1bc87 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -947,6 +947,7 @@ _termpty_line_rewrap(Termpty *ty, Termcell *cells, int len,
   }
 len -= copy_width;
 si->x += copy_width;
+cells += copy_width;
 if (si->x >= si->w)
   {
  si->y++;
@@ -954,7 +955,7 @@ _termpty_line_rewrap(Termpty *ty, Termcell *cells, int len,
   }
 _check_screen_info(ty, si);
  }
-   if (!autowrapped)
+   if (!autowrapped && si->x != 0)
  {
 si->y++;
 si->x = 0;

-- 




[EGIT] [apps/terminology] master 01/03: fix line length computation

2015-09-13 Thread Boris Faure
billiob pushed a commit to branch master.

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

commit 78cb50c7a39296474c5f1f5d48e7328f1d12d9cf
Author: Boris Faure 
Date:   Thu Sep 10 23:38:21 2015 +0200

fix line length computation
---
 src/bin/termpty.c | 34 +++---
 1 file changed, 23 insertions(+), 11 deletions(-)

diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 66752da..5ff680b 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -579,16 +579,27 @@ termpty_free(Termpty *ty)
 }
 
 static Eina_Bool
-termpty_line_is_empty(const Termcell *cells, ssize_t nb_cells)
+_termpty_cell_is_empty(const Termcell *cell)
 {
-   ssize_t len = nb_cells;
+   if ((cell->codepoint != 0) &&
+   (!cell->att.invisible) &&
+   (cell->att.fg != COL_INVIS))
+ {
+return EINA_FALSE;
+ }
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_termpty_line_is_empty(const Termcell *cells, ssize_t nb_cells)
+{
+   ssize_t len;
 
for (len = nb_cells - 1; len >= 0; len--)
  {
 const Termcell *cell = cells + len;
 
-if ((cell->codepoint != 0) &&
-(cell->att.bg != COL_INVIS))
+if (!_termpty_cell_is_empty(cell))
   return EINA_FALSE;
  }
 
@@ -605,8 +616,7 @@ termpty_line_length(const Termcell *cells, ssize_t nb_cells)
  {
 const Termcell *cell = cells + len;
 
-if ((cell->codepoint != 0) &&
-(cell->att.bg != COL_INVIS))
+if (!_termpty_cell_is_empty(cell))
   return len + 1;
  }
 
@@ -988,22 +998,24 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
new_si.h = new_h;
 
/* compute the effective height on the old screen */
-   effective_old_h = old_h;
+   effective_old_h = 0;
for (old_y = old_h -1; old_y >= 0; old_y--)
  {
-Termcell *cells = _SCREEN(ty, 0, old_y);
-if (!termpty_line_is_empty(cells, old_w) &&
-ty->cursor_state.cy < old_y)
+Termcell *cells = &(TERMPTY_SCREEN(ty, 0, old_y));
+if (!_termpty_line_is_empty(cells, old_w))
   {
  effective_old_h = old_y + 1;
  break;
   }
  }
 
+   if (effective_old_h <= ty->cursor_state.cy)
+ effective_old_h = ty->cursor_state.cy + 1;
+
for (old_y = 0; old_y < effective_old_h; old_y++)
  {
 /* for each line in the old screen, append it to the new screen */
-Termcell *cells = _SCREEN(ty, 0, old_y);
+Termcell *cells = &(TERMPTY_SCREEN(ty, 0, old_y));
 int len;
 
 len = termpty_line_length(cells, old_w);

-- 




[EGIT] [apps/terminology] master 01/01: ctrl-[2-8] are now handled by terminology. Ref T2723

2015-09-13 Thread Boris Faure
billiob pushed a commit to branch master.

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

commit d844278723d7f15f5b7a43b0ee93f3378beeaf08
Author: Boris Faure 
Date:   Mon Sep 14 00:01:01 2015 +0200

ctrl-[2-8] are now handled by terminology. Ref T2723
---
 src/bin/keyin.c | 24 +++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/bin/keyin.c b/src/bin/keyin.c
index f5bc81e..b17f4fa 100644
--- a/src/bin/keyin.c
+++ b/src/bin/keyin.c
@@ -146,7 +146,7 @@ _handle_key_to_pty(Termpty *ty, const Evas_Event_Key_Down 
*ev,
  return;
   }
  }
-   if (ev->key && ev->key[0] == 'K' && ev->key[1] == 'k')
+   if (ev->key[0] == 'K' && ev->key[1] == 'k')
  {
 if (!evas_key_lock_is_set(ev->locks, "Num_Lock"))
   {
@@ -171,6 +171,28 @@ _handle_key_to_pty(Termpty *ty, const Evas_Event_Key_Down 
*ev,
   alt, shift, ctrl))
return;
 
+   if (ctrl)
+ {
+#define CTRL_NUM(Num, Code)\
+if (!strcmp(ev->key, Num)) \
+  {\
+ if (alt)  \
+   termpty_write(ty, "\033"Code, 2);   \
+ else  \
+   termpty_write(ty, Code, 1); \
+ return;   \
+  }
+CTRL_NUM("2", "\0")
+CTRL_NUM("3", "\x1b")
+CTRL_NUM("4", "\x1c")
+CTRL_NUM("5", "\x1d")
+CTRL_NUM("6", "\x1e")
+CTRL_NUM("7", "\x1f")
+CTRL_NUM("8", "\x7f")
+
+#undef CTRL_NUM
+ }
+
if (ev->string)
  {
 if (alt)

-- 




[EGIT] [admin/devs] master 01/01: Promote Dongyeon Kim @spacegrapher to regular dev

2015-09-13 Thread Jean-Philippe Andre
jpeg pushed a commit to branch master.

http://git.enlightenment.org/admin/devs.git/commit/?id=49854b26281765188c0b61a115ab93949f09aac3

commit 49854b26281765188c0b61a115ab93949f09aac3
Author: Jean-Philippe Andre 
Date:   Mon Sep 14 11:57:58 2015 +0900

Promote Dongyeon Kim @spacegrapher to regular dev
---
 {probies => developers}/spacegrapher/icon-big.png | Bin
 {probies => developers}/spacegrapher/icon-map.png | Bin
 {probies => developers}/spacegrapher/icon-med.png | Bin
 {probies => developers}/spacegrapher/icon-sml.png | Bin
 {probies => developers}/spacegrapher/id_rsa.pub   |   0
 {probies => developers}/spacegrapher/info.txt |   0
 6 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/probies/spacegrapher/icon-big.png 
b/developers/spacegrapher/icon-big.png
similarity index 100%
rename from probies/spacegrapher/icon-big.png
rename to developers/spacegrapher/icon-big.png
diff --git a/probies/spacegrapher/icon-map.png 
b/developers/spacegrapher/icon-map.png
similarity index 100%
rename from probies/spacegrapher/icon-map.png
rename to developers/spacegrapher/icon-map.png
diff --git a/probies/spacegrapher/icon-med.png 
b/developers/spacegrapher/icon-med.png
similarity index 100%
rename from probies/spacegrapher/icon-med.png
rename to developers/spacegrapher/icon-med.png
diff --git a/probies/spacegrapher/icon-sml.png 
b/developers/spacegrapher/icon-sml.png
similarity index 100%
rename from probies/spacegrapher/icon-sml.png
rename to developers/spacegrapher/icon-sml.png
diff --git a/probies/spacegrapher/id_rsa.pub 
b/developers/spacegrapher/id_rsa.pub
similarity index 100%
rename from probies/spacegrapher/id_rsa.pub
rename to developers/spacegrapher/id_rsa.pub
diff --git a/probies/spacegrapher/info.txt b/developers/spacegrapher/info.txt
similarity index 100%
rename from probies/spacegrapher/info.txt
rename to developers/spacegrapher/info.txt

-- 




[EGIT] [admin/devs] master 01/01: promote nikawhite access to developer.

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

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

commit ca150793ef2ede91d2f337870161317398089ce9
Author: ChunEon Park 
Date:   Mon Sep 14 13:53:35 2015 +0900

promote nikawhite access to developer.
---
 developers/nikawhite/id_rsa.pub |  1 +
 developers/nikawhite/info.txt   | 10 ++
 2 files changed, 11 insertions(+)

diff --git a/developers/nikawhite/id_rsa.pub b/developers/nikawhite/id_rsa.pub
new file mode 100644
index 000..915d0f8
--- /dev/null
+++ b/developers/nikawhite/id_rsa.pub
@@ -0,0 +1 @@
+ssh-rsa 
B3NzaC1yc2EDAQABAAABAQDMqDBUDlM1siK2XZ6mdaZhaSZQbg92w+RiSUzMX58eJZmzjv/+tbNPxe65w4lD5L3axltOpORFrUcYgppXfCrnDj44PwKtnKDlU6S++FuNSaRltnwguvECBbnoObzFda9s4OY8GBhFTVd4VwzJdeoUJztF9f6k1WcpKgsbJ0nukPSCP+/j1RPqRQAnU9ofbzr4tXXY1vJUqQLlvs2gSkx+wjRCSuTPOsMpEnxQ/jh+vqW85Gcqbk06kWPKWZU28BfU9LmFaiMDCf3E4OPRdr1Kf6IUfmPWzFhvAQTCT9JxmTVWGTlJpK3E2HIxajWvlfnBjaeUw7Df+9bYICWfO261
 nikawhite@mbiliavskyi
diff --git a/developers/nikawhite/info.txt b/developers/nikawhite/info.txt
new file mode 100644
index 000..666cf73
--- /dev/null
+++ b/developers/nikawhite/info.txt
@@ -0,0 +1,10 @@
+Login:nikawhite
+IRC Nick: nikawhite
+Cloak:developer/nikawhite
+Name: Mykyta Biliavskyi
+Location: Kiev, Ukraine
+GeoData:  50.43912 30.496453
+E-Mail:   belyavski...@gmail.com
+Managing: efl edje theme editor (eflete)
+Contributing: efl, elementary, terminology
+Platform: Ubuntu (Linux)

-- 




[EGIT] [tools/enventor] master 01/01: edc_parser: recognize keyword "offset" as changeable value.

2015-09-13 Thread Mykyta Biliavskyi
nikawhite pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=9647ca44d232298d4f3d7dcf8b233ab47579ec0d

commit 9647ca44d232298d4f3d7dcf8b233ab47579ec0d
Author: Mykyta Biliavskyi 
Date:   Mon Sep 14 14:22:25 2015 +

edc_parser: recognize keyword "offset" as changeable value.

Summary:
Keyword "offset" added into list of arguments.
This attribute is represented by two spinners with range
-100..100. "offset" is used inside "relative" and "fill"
blocks

Reviewers: Hermet

Differential Revision: https://phab.enlightenment.org/D3027
---
 src/lib/edc_parser.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/src/lib/edc_parser.c b/src/lib/edc_parser.c
index 17960fc..39bf4ff 100644
--- a/src/lib/edc_parser.c
+++ b/src/lib/edc_parser.c
@@ -675,6 +675,21 @@ type_init_thread_blocking(void *data, Ecore_Thread *thread 
EINA_UNUSED)
attr.value.append_str = ATTR_APPEND_SEMICOLON;
eina_inarray_push(td->attrs, );
 
+   xy = eina_array_new(2);
+   eina_array_push(xy, eina_stringshare_add("X:"));
+   eina_array_push(xy, eina_stringshare_add("Y:"));
+
+   memset(, 0x00, sizeof(parser_attr));
+   attr.keyword = eina_stringshare_add("offset");
+   attr.value.strs = xy;
+   attr.value.cnt = 2;
+   attr.value.min = -100;
+   attr.value.max = 100;
+   attr.value.type = ATTR_VALUE_INTEGER;
+   attr.value.prepend_str = ATTR_PREPEND_COLON;
+   attr.value.append_str = ATTR_APPEND_SEMICOLON;
+   eina_inarray_push(td->attrs, );
+
//Type: Float
xy = eina_array_new(2);
eina_array_push(xy, eina_stringshare_add("X:"));

-- 




[EGIT] [tools/enventor] master 01/01: Edc_editor: remove "cursor, changed, manual" callback.

2015-09-13 Thread Mykyta Biliavskyi
nikawhite pushed a commit to branch master.

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

commit ae2d88fa7626486ab5f3859293fe4c6e130004b0
Author: Mykyta Biliavskyi 
Date:   Mon Sep 14 14:34:42 2015 +

Edc_editor: remove "cursor,changed,manual" callback.

Summary:
For the initiate synchronizing cursor position
and the live view object was moved edit_view_sync into
callback function for "cursor,changed" entry signal.
It is neccessary, because keys "Page up" and "Page down"
didn't initiate the signal "cursor,changed,manual".

Reviewers: Hermet

Differential Revision: https://phab.enlightenment.org/D3034
---
 src/lib/edc_editor.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/src/lib/edc_editor.c b/src/lib/edc_editor.c
index e765a7c..770ff00 100644
--- a/src/lib/edc_editor.c
+++ b/src/lib/edc_editor.c
@@ -710,21 +710,13 @@ edit_text_insert(edit_data *ed, const char *text)
free(selection);
 }
 
-
-static void
-edit_cursor_changed_manual_cb(void *data, Evas_Object *obj EINA_UNUSED,
-  void *event_info EINA_UNUSED)
-{
-   edit_data *ed = data;
-   edit_view_sync(ed);
-}
-
 static void
 edit_cursor_changed_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
 {
edit_data *ed = data;
cur_line_pos_set(ed, EINA_FALSE);
+   edit_view_sync(ed);
 }
 
 static void
@@ -1160,8 +1152,6 @@ edit_init(Evas_Object *enventor)
elm_entry_line_wrap_set(en_edit, ELM_WRAP_NONE);
evas_object_smart_callback_add(en_edit, "focused", edit_focused_cb, ed);
evas_object_smart_callback_add(en_edit, "changed,user", edit_changed_cb, 
ed);
-   evas_object_smart_callback_add(en_edit, "cursor,changed,manual",
-  edit_cursor_changed_manual_cb, ed);
evas_object_smart_callback_add(en_edit, "cursor,changed",
   edit_cursor_changed_cb, ed);
evas_object_smart_callback_add(en_edit, "clicked,double",

--