Re: [E-devel] [EGIT] [core/efl] master 01/01: ecore_drm2: ERR once when page flip fails with EBUSY

2017-02-16 Thread The Rasterman
On Thu, 16 Feb 2017 09:39:40 -0500 Christopher Michael 
said:

> On 02/16/2017 09:08 AM, Derek Foreman wrote:
> > On 15/02/17 07:59 PM, Carsten Haitzler (The Rasterman) wrote:
> >> On Wed, 15 Feb 2017 08:02:02 -0800 Derek Foreman 
> >> said:
> >>
> >>> derekf pushed a commit to branch master.
> >>>
> >>> http://git.enlightenment.org/core/efl.git/commit/?id=ae5d00246667e0a37b123fef4618b670021f5d9e
> >>>
> >>> commit ae5d00246667e0a37b123fef4618b670021f5d9e
> >>> Author: Derek Foreman 
> >>> Date:   Wed Feb 15 09:51:32 2017 -0600
> >>>
> >>> ecore_drm2: ERR once when page flip fails with EBUSY
> >>>
> >>> On systems where this happens it'll probably happen a lot, so
> >>> we don't want to continuously log this, but since it's definitely
> >>> showing a bug somewhere (efl or kernel) it probably should be an ERR.
> >>
> >> hmmm... where i have seen this it doesn't happen THAT much... like it
> >> sometimes happens in blips like 1 here, 15 seconds later, another, 1 min
> >> later another, then maybe 2 mins later 3 in a row fast, then nothing for
> >> 10 sec... it's very blippy. i logged these for a while myself... :)
> >
> > Chris hit it somehow and replaced all the ERR with DBG - I think it's an
> > important enough error to be an ERR at least once, so I figured this was
> > a reasonable compromise.
> >
> 
> Agreed. I was testing some support for rotating Outputs (in drm2) via 
> Evas software rotation. Due to various issues with a given FBO, the ERR 
> here was being spewed quite a lot on the console. So Derek and I spoke 
> and came to the agreement that we can just spit this out once and things 
> will be fine.

hmmm... i guess. an alternative is to rate limit it too... eg if error happens,
if # of swaps since last error print > x then print, else suppress... then you
know if it's a one-off or if it does keep happening...

> Cheers,
> dh
> 
> 
> >>> ---
> >>>  src/lib/ecore_drm2/ecore_drm2_fb.c | 13 ++---
> >>>  1 file changed, 10 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c
> >>> b/src/lib/ecore_drm2/ecore_drm2_fb.c index f838168..fe27508 100644
> >>> --- a/src/lib/ecore_drm2/ecore_drm2_fb.c
> >>> +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
> >>> @@ -424,6 +424,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb,
> >>> Ecore_Drm2_Output *output)
> >>>  do
> >>>{
> >>> + static Eina_Bool bugged_about_bug = EINA_FALSE;
> >>>   repeat = EINA_FALSE;
> >>>   ret = sym_drmModePageFlip(fb->fd, output->crtc_id, fb->id,
> >>> DRM_MODE_PAGE_FLIP_EVENT,
> >>> @@ -434,12 +435,18 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb,
> >>> Ecore_Drm2_Output *output)
> >>>* until we can flip or we give up (100 tries with a yield
> >>>* between each try). We can't expect everyone to run the
> >>>* latest bleeding edge kernel IF a workaround is possible
> >>> -  * in userspace, so do this. */
> >>> +  * in userspace, so do this.
> >>> +  * We only report this as an ERR once since if it will
> >>> +  * generate a huge amount of spam otherwise. */
> >>>   if ((ret < 0) && (errno == EBUSY))
> >>> {
> >>>repeat = EINA_TRUE;
> >>> -  if (count == 0)
> >>> -WRN("Pageflip fail - EBUSY from drmModePageFlip...");
> >>> +  if (count == 0 && !bugged_about_bug)
> >>> +{
> >>> +   ERR("Pageflip fail - EBUSY from drmModePageFlip -
> >>> "
> >>> +   "This is either a kernel bug or an EFL one.");
> >>> +   bugged_about_bug = EINA_TRUE;
> >>> +}
> >>>count++;
> >>>if (count > 500)
> >>>  {
> >>>
> >>> --
> >>>
> >>>
> 
> 
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [EGIT] [core/efl] master 01/01: ecore_drm2: ERR once when page flip fails with EBUSY

2017-02-16 Thread The Rasterman
On Thu, 16 Feb 2017 08:08:22 -0600 Derek Foreman  said:

> On 15/02/17 07:59 PM, Carsten Haitzler (The Rasterman) wrote:
> > On Wed, 15 Feb 2017 08:02:02 -0800 Derek Foreman 
> > said:
> >
> >> derekf pushed a commit to branch master.
> >>
> >> http://git.enlightenment.org/core/efl.git/commit/?id=ae5d00246667e0a37b123fef4618b670021f5d9e
> >>
> >> commit ae5d00246667e0a37b123fef4618b670021f5d9e
> >> Author: Derek Foreman 
> >> Date:   Wed Feb 15 09:51:32 2017 -0600
> >>
> >> ecore_drm2: ERR once when page flip fails with EBUSY
> >>
> >> On systems where this happens it'll probably happen a lot, so
> >> we don't want to continuously log this, but since it's definitely
> >> showing a bug somewhere (efl or kernel) it probably should be an ERR.
> >
> > hmmm... where i have seen this it doesn't happen THAT much... like it
> > sometimes happens in blips like 1 here, 15 seconds later, another, 1 min
> > later another, then maybe 2 mins later 3 in a row fast, then nothing for 10
> > sec... it's very blippy. i logged these for a while myself... :)
> 
> Chris hit it somehow and replaced all the ERR with DBG - I think it's an 
> important enough error to be an ERR at least once, so I figured this was 
> a reasonable compromise.

orly? hmmm... i just saw occasional blips (~every minute or so) so i kind of
thought it was ok... but hmmm... interesting he hit is solidly.

> >> ---
> >>  src/lib/ecore_drm2/ecore_drm2_fb.c | 13 ++---
> >>  1 file changed, 10 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c
> >> b/src/lib/ecore_drm2/ecore_drm2_fb.c index f838168..fe27508 100644
> >> --- a/src/lib/ecore_drm2/ecore_drm2_fb.c
> >> +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
> >> @@ -424,6 +424,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output
> >> *output)
> >>  do
> >>{
> >> + static Eina_Bool bugged_about_bug = EINA_FALSE;
> >>   repeat = EINA_FALSE;
> >>   ret = sym_drmModePageFlip(fb->fd, output->crtc_id, fb->id,
> >> DRM_MODE_PAGE_FLIP_EVENT,
> >> @@ -434,12 +435,18 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb,
> >> Ecore_Drm2_Output *output)
> >>* until we can flip or we give up (100 tries with a yield
> >>* between each try). We can't expect everyone to run the
> >>* latest bleeding edge kernel IF a workaround is possible
> >> -  * in userspace, so do this. */
> >> +  * in userspace, so do this.
> >> +  * We only report this as an ERR once since if it will
> >> +  * generate a huge amount of spam otherwise. */
> >>   if ((ret < 0) && (errno == EBUSY))
> >> {
> >>repeat = EINA_TRUE;
> >> -  if (count == 0)
> >> -WRN("Pageflip fail - EBUSY from drmModePageFlip...");
> >> +  if (count == 0 && !bugged_about_bug)
> >> +{
> >> +   ERR("Pageflip fail - EBUSY from drmModePageFlip - "
> >> +   "This is either a kernel bug or an EFL one.");
> >> +   bugged_about_bug = EINA_TRUE;
> >> +}
> >>count++;
> >>if (count > 500)
> >>  {
> >>
> >> --
> >>
> >>
> >
> >
> 


-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] What do you think of Vala?

2017-02-16 Thread The Rasterman
On Thu, 16 Feb 2017 20:36:21 +0100 "Dr. Michael Lauer"  said:

> Sorry for resurrecting such an old thread, but I just became aware of it.
> 
> In case you didn’t know, me and some colleagues did quite a lot of work
> on EFL bindings about 8 years ago. We came to a point where the bindings
> were usable for some – small – apps, in particular integrating into the glib
> main loop to get Vala’s async dbus communication working.
> 
> By now I’m pretty sure the APIs have changed a lot, but perhaps some of this
> work can be resurrected and used, if you’re interested about Vala.
> 
> It remains to be discussed whether an automatic or semi-automatic
> plus fine-tuned way of generating these bindings is to be preferred.
> Back in the days, used a semi-automatic approach since I wanted the
> bindings to feel as high-level-OO-like as possible.
> 
> Would be cool to see some of this work being used. The machine were
> git.freesmartphone.org  was hosted died some
> time ago, but I just uploaded uploaded the repository from a backup to
> https://github.com/freesmartphone/libeflvala/
> 

we definitely want fully automatic bindings. no manual binding (beyond
core/basic types). this is the path we already have for: js, lua, c++. there is
a specific binding generator per language with just core data types (growable
arrays, linked lists, stringshares etc.) hand-mapped because this tends to be
specific per language target as most languages have a lot of these data types
built in and so you want these to map cleanly.

above this the base object class then also gets manually bound (ref counting,
construction/destruction handling etc.). promises/futures are still a bit up in
the air, but also manual due to languages often incorporating these into the
core language itself. after this it's all automated. or should be. as we also
GENERATE the C api from the .eo IDL files... but this is the new eo based api
and not "legacy" which was done by hand over the years. so we are basically
growing a whole new parallel api that embodies common design concepts in a
high-level OO way in these .eo IDL files, then it's very easy to map efl api to
almost any decent language automatically. i am NOT a fan of manual or even
semi-automatic binding as it requires continual maintenance and eventually
people get tired of doing it as it's generally boring painful work. get a
generator + base bindings to work once and at most "fix the odd future bug in
it", then have it automated. every time you do "make" in the efl tree then you
get the bindings to tag along and update adding new classes, methods,
types, events and so on automatically as it's all generated at build time. :)

> Best regards,
> 
> :M:
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


-- 
- Codito, ergo sum - "I code, therefore I am" --
The Rasterman (Carsten Haitzler)ras...@rasterman.com


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] master 01/01: eo: ensure the generation is correctly clamped

2017-02-16 Thread Marcel Hollerbach
cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ae8004033112f0f4f94ad6d0eac2f010b5c009cd

commit ae8004033112f0f4f94ad6d0eac2f010b5c009cd
Author: Marcel Hollerbach 
Date:   Thu Feb 16 13:37:16 2017 -0800

eo: ensure the generation is correctly clamped

Summary:
when a few recursive event emissions are happening, and in some deep
recursive level a subscription to the same object is happening, the
subscription would just be executed when the complete recursion is done.
that is wrong. The subscription needs to be executed when the event is
called after the subscription is added, undepended from any recursive
level. That fixes that and adds a regression test for it.

This was discovered in e, since e gives a lot of error messages about a eo 
object
that is already freed. It turned out this object is returned from evas, and 
exactly
the above happened to the EFL_EVENT_DEL subscription of that object.

Test Plan: make check

Reviewers: tasn, cedric, stefan_schmidt

Subscribers: stefan_schmidt, netstar, zmike, raster, jpeg

Differential Revision: https://phab.enlightenment.org/D4656

Signed-off-by: Cedric BAIL 
---
 src/lib/eo/eo_base_class.c | 32 ++---
 src/tests/eo/suite/eo_test_event.c | 71 ++
 2 files changed, 98 insertions(+), 5 deletions(-)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 2f3803a..c6b4775 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -1062,20 +1062,42 @@ _eo_callbacks_clear(Efl_Object_Data *pd)
 {
Eo_Callback_Description **itr;
unsigned int i = 0;
+   Eina_Bool remove_callbacks;
+   unsigned int generation_clamp;
 
/* If there are no deletions waiting. */
if (!pd->need_cleaning) return;
-   /* Abort if we are currently walking the list. */
-   if (pd->event_frame) return;
 
-   pd->need_cleaning = EINA_FALSE;
+
+   if (pd->event_frame)
+ {
+/* there is still a event emission going on ... do not delete 
anything! */
+remove_callbacks = EINA_FALSE;
+/* if we are in event subscription we need to clamp the generations at 
the current frame otherwise we are possiblity not executing that later */
+generation_clamp = pd->event_frame->generation;
+ }
+   else
+ {
+/* no event emission running */
+/* remove deleted callbacks */
+remove_callbacks = EINA_TRUE;
+/* clap to 0 generation */
+generation_clamp = 0;
+/* we dont need to clean later */
+pd->need_cleaning = EINA_FALSE;
+ }
+
while (i < pd->callbacks_count)
  {
 itr = pd->callbacks + i;
-if ((*itr)->delete_me) _eo_callback_remove(pd, itr);
+if (remove_callbacks && (*itr)->delete_me)
+  {
+ _eo_callback_remove(pd, itr);
+  }
 else
   {
- (*itr)->generation = 0;
+ if ((*itr)->generation > generation_clamp)
+   (*itr)->generation = generation_clamp;
  i++;
   }
  }
diff --git a/src/tests/eo/suite/eo_test_event.c 
b/src/tests/eo/suite/eo_test_event.c
index ebbeaa8..66902db 100644
--- a/src/tests/eo/suite/eo_test_event.c
+++ b/src/tests/eo/suite/eo_test_event.c
@@ -14,8 +14,12 @@
 EWAPI const Efl_Class *efl_test_event_class_get(void);
 
 EWAPI extern const Efl_Event_Description _EFL_TEST_EVENT_EVENT_TESTER;
+EWAPI extern const Efl_Event_Description 
_EFL_TEST_EVENT_EVENT_TESTER_SUBSCRIBE;
+EWAPI extern const Efl_Event_Description 
_EFL_TEST_EVENT_EVENT_TESTER_CLAMP_TEST;
 
 #define EFL_TEST_EVENT_EVENT_TESTER (&(_EFL_TEST_EVENT_EVENT_TESTER))
+#define EFL_TEST_EVENT_EVENT_TESTER_SUBSCRIBE 
(&(_EFL_TEST_EVENT_EVENT_TESTER_SUBSCRIBE))
+#define EFL_TEST_EVENT_EVENT_TESTER_CLAMP_TEST 
(&(_EFL_TEST_EVENT_EVENT_TESTER_CLAMP_TEST))
 
 typedef struct {
Eina_Bool event1;
@@ -131,17 +135,84 @@ START_TEST(eo_event_call_in_call)
efl_object_shutdown();
 }
 END_TEST
+
+static Eina_Bool emitted = 0;
+
+static void
+_generation_clamp_step3(void *data EINA_UNUSED, const Efl_Event *e EINA_UNUSED)
+{
+   emitted = 1;
+}
+
+static void
+_generation_clamp_subscribe(void *data EINA_UNUSED, const Efl_Event *e)
+{
+   //generation is 2
+   efl_event_callback_add(e->object, EFL_TEST_EVENT_EVENT_TESTER_CLAMP_TEST, 
_generation_clamp_step3, NULL);
+}
+
+static void
+_generation_clamp_step1(void *data EINA_UNUSED, const Efl_Event *e)
+{
+   //generation is 1
+   efl_event_callback_call(e->object, EFL_TEST_EVENT_EVENT_TESTER_SUBSCRIBE, 
NULL);
+
+   efl_event_callback_call(e->object, EFL_TEST_EVENT_EVENT_TESTER_CLAMP_TEST, 
NULL);
+   efl_event_callback_call(e->object, EFL_TEST_EVENT_EVENT_TESTER_CLAMP_TEST, 
NULL);
+}
+
+
+START_TEST(eo_event_generation_bug)
+{
+   efl_object_init();
+
+   /*
+* The idea is:
+*
+* #1 a event gets emitted (generation is 1)
+  

Re: [E-devel] What do you think of Vala?

2017-02-16 Thread Vincent Torri
Read this : https://www.bassi.io/articles/2017/02/13/on-vala/

Vincent Torri


On Thu, Feb 16, 2017 at 9:31 PM, Pau Espin Pedrol  wrote:
> Hi Mickey,
>
> I actually picked up from you the maintenance of efvala for some time,
> but I eventually gave up as at that time API breaks alone took more
> time than the amount I had available to work on this.
>
> It's been a long time since I last used/worked on these bindings, so
> my memory is not that good now. As far as I remember, I initially did
> some work in a gitorious repository (which I think became lost when
> gitorious was brought down). After that, I think the bindings were
> merged into the enlightenment repository at that time. See the
> following commit introducing it [1] and the history around it [2].
>
> Together with that, I wrote some simple applications to use the
> bindings, such as emtooth (version 2, firs version was written in C),
> etalk (telepathy client) and erocks (gstreamer player afair). Most of
> them are not really high quality code, as my architecture/programming
> skills at that time were not impressive. Some of them were also lost
> during gitorious fall, but I think recently re-pushed some of them
> into github from what I could find in my hard drive.
>
> The status of EFL nowadays is far better than a few years ago, and as
> far as I know there's a lot more tools to support bindings generation
> (eolian and such). That together with a good stable API as we see
> nowadays will make it far more easier to maintain and develop in case
> somebody wants to take over.
>
> [1] 
> https://github.com/kakaroto/e17/commit/f208fa3af597a9406efd57858d6241c67e023e2d
> [2] 
> https://git.enlightenment.org/legacy/subversion-history.git/log/trunk/BINDINGS/vala
>
> Regards,
>
> Pau Espin Pedrol
>
>
> 2017-02-16 20:36 GMT+01:00 Dr. Michael Lauer :
>> Sorry for resurrecting such an old thread, but I just became aware of it.
>>
>> In case you didn’t know, me and some colleagues did quite a lot of work
>> on EFL bindings about 8 years ago. We came to a point where the bindings
>> were usable for some – small – apps, in particular integrating into the glib
>> main loop to get Vala’s async dbus communication working.
>>
>> By now I’m pretty sure the APIs have changed a lot, but perhaps some of this 
>> work
>> can be resurrected and used, if you’re interested about Vala.
>>
>> It remains to be discussed whether an automatic or semi-automatic
>> plus fine-tuned way of generating these bindings is to be preferred.
>> Back in the days, used a semi-automatic approach since I wanted the
>> bindings to feel as high-level-OO-like as possible.
>>
>> Would be cool to see some of this work being used. The machine were
>> git.freesmartphone.org  was hosted died some 
>> time ago, but I just uploaded
>> uploaded the repository from a backup to 
>> https://github.com/freesmartphone/libeflvala/ 
>> 
>>
>> Best regards,
>>
>> :M:
>>
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> ___
>> enlightenment-devel mailing list
>> enlightenment-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] What do you think of Vala?

2017-02-16 Thread Pau Espin Pedrol
Hi Mickey,

I actually picked up from you the maintenance of efvala for some time,
but I eventually gave up as at that time API breaks alone took more
time than the amount I had available to work on this.

It's been a long time since I last used/worked on these bindings, so
my memory is not that good now. As far as I remember, I initially did
some work in a gitorious repository (which I think became lost when
gitorious was brought down). After that, I think the bindings were
merged into the enlightenment repository at that time. See the
following commit introducing it [1] and the history around it [2].

Together with that, I wrote some simple applications to use the
bindings, such as emtooth (version 2, firs version was written in C),
etalk (telepathy client) and erocks (gstreamer player afair). Most of
them are not really high quality code, as my architecture/programming
skills at that time were not impressive. Some of them were also lost
during gitorious fall, but I think recently re-pushed some of them
into github from what I could find in my hard drive.

The status of EFL nowadays is far better than a few years ago, and as
far as I know there's a lot more tools to support bindings generation
(eolian and such). That together with a good stable API as we see
nowadays will make it far more easier to maintain and develop in case
somebody wants to take over.

[1] 
https://github.com/kakaroto/e17/commit/f208fa3af597a9406efd57858d6241c67e023e2d
[2] 
https://git.enlightenment.org/legacy/subversion-history.git/log/trunk/BINDINGS/vala

Regards,

Pau Espin Pedrol


2017-02-16 20:36 GMT+01:00 Dr. Michael Lauer :
> Sorry for resurrecting such an old thread, but I just became aware of it.
>
> In case you didn’t know, me and some colleagues did quite a lot of work
> on EFL bindings about 8 years ago. We came to a point where the bindings
> were usable for some – small – apps, in particular integrating into the glib
> main loop to get Vala’s async dbus communication working.
>
> By now I’m pretty sure the APIs have changed a lot, but perhaps some of this 
> work
> can be resurrected and used, if you’re interested about Vala.
>
> It remains to be discussed whether an automatic or semi-automatic
> plus fine-tuned way of generating these bindings is to be preferred.
> Back in the days, used a semi-automatic approach since I wanted the
> bindings to feel as high-level-OO-like as possible.
>
> Would be cool to see some of this work being used. The machine were
> git.freesmartphone.org  was hosted died some 
> time ago, but I just uploaded
> uploaded the repository from a backup to 
> https://github.com/freesmartphone/libeflvala/ 
> 
>
> Best regards,
>
> :M:
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [apps/extra] master 01/02: extra: move the common fields to a struct

2017-02-16 Thread Marcel Hollerbach
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/apps/extra.git/commit/?id=34e1160449c0c2652be6d96fead37556e6cd0d37

commit 34e1160449c0c2652be6d96fead37556e6cd0d37
Author: Marcel Hollerbach 
Date:   Thu Feb 16 20:28:42 2017 +0100

extra: move the common fields to a struct
---
 src/bin/extra_background_selector.c |  4 +--
 src/bin/extra_theme_selector.c  |  8 +++---
 src/lib/extra.c | 50 ++---
 src/lib/extra.h | 13 ++
 4 files changed, 39 insertions(+), 36 deletions(-)

diff --git a/src/bin/extra_background_selector.c 
b/src/bin/extra_background_selector.c
index c3e2538..436ea71 100644
--- a/src/bin/extra_background_selector.c
+++ b/src/bin/extra_background_selector.c
@@ -119,7 +119,7 @@ _text_basic_get(void *data, Evas_Object *obj EINA_UNUSED, 
const char *source EIN
 {
Extra_Background *t = data;
 
-   return strdup(t->name);
+   return strdup(t->obj.name);
 }
 
 static void
@@ -164,4 +164,4 @@ extra_background_selector_create(void)
evas_object_event_callback_add(grid, EVAS_CALLBACK_HIDE, _selector_hide, 
NULL);
 
return grid;
-}
\ No newline at end of file
+}
diff --git a/src/bin/extra_theme_selector.c b/src/bin/extra_theme_selector.c
index f84431d..35e5de1 100644
--- a/src/bin/extra_theme_selector.c
+++ b/src/bin/extra_theme_selector.c
@@ -63,7 +63,7 @@ _install_theme(void *data, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_U
Eina_Strbuf *title;
 
title = eina_strbuf_new();
-   eina_strbuf_append_printf(title, "Installing theme %s!", candidate->name);
+   eina_strbuf_append_printf(title, "Installing theme %s!", 
candidate->obj.name);
 
progress = extra_ui_progress_popup_show(eina_strbuf_string_get(title), 
_install_done, candidate);
extra_theme_download(progress, candidate);
@@ -137,8 +137,8 @@ _popup_theme(Evas_Object *win, Extra_Theme *theme)
Evas_Object *o, *inwin, *table;
char title_str[1024], author_str[1024];
 
-   snprintf(title_str, sizeof(title_str), "%s", theme->name);
-   snprintf(author_str, sizeof(author_str), "%s", theme->author);
+   snprintf(title_str, sizeof(title_str), "%s", 
theme->obj.name);
+   snprintf(author_str, sizeof(author_str), "%s", 
theme->obj.author);
 
inwin = o = elm_win_inwin_add(win);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -203,7 +203,7 @@ _text_basic_get(void *data, Evas_Object *obj EINA_UNUSED, 
const char *source EIN
 {
Extra_Theme *t = data;
 
-   return strdup(t->name);
+   return strdup(t->obj.name);
 }
 
 static void
diff --git a/src/lib/extra.c b/src/lib/extra.c
index 382e49a..8d848ba 100644
--- a/src/lib/extra.c
+++ b/src/lib/extra.c
@@ -21,7 +21,7 @@ Eina_List *_background_list = NULL;
 void _extra_theme_cache_load();
 static Eina_Bool extra_request_may_override(Extra_Request *req, Extra_Progress 
*progress);
 
-#define GEN_FILE_NAME(buf, t) eina_strbuf_append_printf(buf, "%s-%d.edj", 
t->id, t->version);
+#define GEN_FILE_NAME(buf, t) eina_strbuf_append_printf(buf, "%s-%d.edj", 
t->obj.id, t->obj.version);
 
 //===
 //theme stuff
@@ -67,11 +67,11 @@ _fill_themes(Eina_Strbuf *buf)
 versionNumb = atoi(eina_strbuf_string_get(obj->version));
 
 theme = calloc(1, sizeof(*theme));
-theme->theme.id = sec_strdup(obj->id);
-theme->theme.name = sec_strdup(obj->name);
-theme->theme.author = sec_strdup(obj->author);
+theme->theme.obj.id = sec_strdup(obj->id);
+theme->theme.obj.name = sec_strdup(obj->name);
+theme->theme.obj.author = sec_strdup(obj->author);
 theme->theme.description = sec_strdup(obj->description);
-theme->theme.version = versionNumb;
+theme->theme.obj.version = versionNumb;
 _theme_list = eina_list_append(_theme_list, theme);
 
 extra_json_list_part_free(&template, obj);
@@ -122,10 +122,10 @@ _fill_backgrounds(Eina_Strbuf *buf)
 
 versionNumb = atoi(eina_strbuf_string_get(obj->version));
 
-background->background.author = sec_strdup(obj->author);
-background->background.id = sec_strdup(obj->id);
-background->background.name = sec_strdup(obj->name);
-background->background.version = versionNumb;
+background->background.obj.author = sec_strdup(obj->author);
+background->background.obj.id = sec_strdup(obj->id);
+background->background.obj.name = sec_strdup(obj->name);
+background->background.obj.version = versionNumb;
 
 _background_list = eina_list_append(_background_list, background);
 
@@ -325,7 +325,7 @@ EAPI Extra_Theme *extra_theme_get(const char *id)
Eina_List *item;
 
EINA_LIST_FOREACH(extra_themes_list(), item, theme)
- if (!strcmp(id, theme->id))
+ if (!strcmp(id, theme->obj.id))
return theme;
 
return NULL;
@@ -403,7 +403,7 @@ extra_theme_preview_get(Extra_Theme *theme)
//download is in progress do not return the path
if

[EGIT] [apps/extra] master 02/02: extra: refactor code of local/remote paths

2017-02-16 Thread Marcel Hollerbach
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/apps/extra.git/commit/?id=67f2a7087d5912551eb77509ec4141d1243e9e2d

commit 67f2a7087d5912551eb77509ec4141d1243e9e2d
Author: Marcel Hollerbach 
Date:   Thu Feb 16 20:55:51 2017 +0100

extra: refactor code of local/remote paths
---
 src/lib/extra.c | 114 +---
 1 file changed, 59 insertions(+), 55 deletions(-)

diff --git a/src/lib/extra.c b/src/lib/extra.c
index 8d848ba..06994cb 100644
--- a/src/lib/extra.c
+++ b/src/lib/extra.c
@@ -363,32 +363,40 @@ extra_theme_install_path_get(Extra_Theme *theme)
return path;
 }
 
-static char *
-_extra_preview_remote_generate(const char *purpose, const char *id)
+typedef struct {
+   char *remote;
+   char *local;
+} Extra_Path_Pair;
+
+static Extra_Path_Pair*
+_extra_preview_path_pair_gen(const char *resource, Extra_Base_Object *obj)
 {
-   const char *pattern = "http://"; HOSTNAME "/%s/preview/%s.png";
-   char *url;
+   Eina_Strbuf *remote, *local;
+   Extra_Path_Pair *result;
 
-   url = malloc((strlen(pattern) + strlen(purpose) + strlen(id) - 1) * 
sizeof(char));
-   sprintf(url, pattern, purpose, id);
+   result = calloc(1, sizeof(Extra_Path_Pair));
 
-   return url;
-}
+   remote = eina_strbuf_new();
+   local = eina_strbuf_new();
 
-static char *
-_extra_preview_local_generate(const char *purpose, const char *id, int version)
-{
-   Eina_Strbuf *local_preview;
-   char *tmp;
+   eina_strbuf_append_printf(remote, "http://"; HOSTNAME "/%s/preview/%s.png", 
resource, obj->id);
+   eina_strbuf_append_printf(local, "%s/%s/%s-%s-%d.png", 
efreet_cache_home_get(), PACKAGE_NAME, resource, obj->id, obj->version);
 
-   local_preview = eina_strbuf_new();
+   result->local = eina_strbuf_string_steal(local);
+   result->remote = eina_strbuf_string_steal(remote);
 
-   eina_strbuf_append(local_preview, efreet_cache_home_get());
-   eina_strbuf_append_printf(local_preview, "/%s/%s-%s-%d.png", PACKAGE_NAME, 
purpose, id, version);
-   tmp = eina_strbuf_string_steal(local_preview);
-   eina_strbuf_free(local_preview);
+   eina_strbuf_free(remote);
+   eina_strbuf_free(local);
 
-   return tmp;
+   return result;
+}
+
+static void
+_extra_path_pair_free(Extra_Path_Pair* pair)
+{
+   free(pair->remote);
+   free(pair->local);
+   free(pair);
 }
 
 Extra_Progress p = {NULL, NULL, NULL};
@@ -396,40 +404,39 @@ Extra_Progress p = {NULL, NULL, NULL};
 EAPI char*
 extra_theme_preview_get(Extra_Theme *theme)
 {
-   char *src, *dst;
-   char *local;
Extra_Theme_Private *priv = ((Extra_Theme_Private*) theme);
+   Extra_Path_Pair *pair;
+   char *local;
 
//download is in progress do not return the path
if (priv->preview) return NULL;
 
-   local = _extra_preview_local_generate("themes", theme->obj.id, 
theme->obj.version);
+   pair = _extra_preview_path_pair_gen("themes", &theme->obj);
+   local = pair->local;
+
if (!ecore_file_exists(local))
  {
-free(local);
 local = NULL;
  }
else
  {
 if (!priv->cache_preview)
-  {
- src = _extra_preview_remote_generate("themes", theme->obj.id);
- dst = _extra_preview_local_generate("themes", theme->obj.id, 
theme->obj.version);
+  extra_file_cache_download(&p, pair->remote, pair->local, 
&priv->cache_preview);
+ }
 
- extra_file_cache_download(&p, src, dst, &priv->cache_preview);
+   if (local)
+ local = strdup(local);
+
+   _extra_path_pair_free(pair);
 
- free(src);
- free(dst);
-  }
- }
return local;
 }
 
 EAPI Extra_Request*
 extra_theme_preview_download(Extra_Progress *progress, Extra_Theme *theme)
 {
-   char *remote, *dst;
Extra_Theme_Private *priv = ((Extra_Theme_Private*) theme);
+   Extra_Path_Pair *pair;
 
if (priv->preview)
  {
@@ -439,13 +446,11 @@ extra_theme_preview_download(Extra_Progress *progress, 
Extra_Theme *theme)
   return NULL;
  }
 
-   remote = _extra_preview_remote_generate("themes", theme->obj.id);
-   dst = _extra_preview_local_generate("themes", theme->obj.id, 
theme->obj.version);
+   pair = _extra_preview_path_pair_gen("themes", &theme->obj);
 
-   extra_file_download(progress, remote, dst, &priv->preview);
+   extra_file_download(progress, pair->remote, pair->local, &priv->preview);
 
-   free(remote);
-   free(dst);
+   _extra_path_pair_free(pair);
 
return priv->preview;
 }
@@ -726,39 +731,40 @@ extra_background_download(Extra_Progress *progress, 
Extra_Background *background
 EAPI char*
 extra_background_preview_get(Extra_Background *background)
 {
-   char *src, *dst;
-   char *local;
Extra_Background_Private *priv = (Extra_Background_Private*) background;
+   Extra_Path_Pair *pair;
+   char *local;
 
if (priv->preview) return NULL;
 
-   local = _extra_preview_local_generate("backgrounds", background->obj.id, 
background->obj.version);
+   pair = _extra_preview_path_pair_gen("backgrounds", &backgr

[E-devel] What do you think of Vala?

2017-02-16 Thread Dr. Michael Lauer
Sorry for resurrecting such an old thread, but I just became aware of it.

In case you didn’t know, me and some colleagues did quite a lot of work
on EFL bindings about 8 years ago. We came to a point where the bindings
were usable for some – small – apps, in particular integrating into the glib
main loop to get Vala’s async dbus communication working.

By now I’m pretty sure the APIs have changed a lot, but perhaps some of this 
work
can be resurrected and used, if you’re interested about Vala.

It remains to be discussed whether an automatic or semi-automatic
plus fine-tuned way of generating these bindings is to be preferred.
Back in the days, used a semi-automatic approach since I wanted the
bindings to feel as high-level-OO-like as possible.

Would be cool to see some of this work being used. The machine were
git.freesmartphone.org  was hosted died some 
time ago, but I just uploaded
uploaded the repository from a backup to 
https://github.com/freesmartphone/libeflvala/ 


Best regards,

:M:

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [apps/extra] master 01/01: extra: do not use the same request field for cache and download

2017-02-16 Thread Marcel Hollerbach
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/apps/extra.git/commit/?id=b62d34180cc5459a7e311db81ab03ca728dfc23f

commit b62d34180cc5459a7e311db81ab03ca728dfc23f
Author: Marcel Hollerbach 
Date:   Thu Feb 16 20:10:20 2017 +0100

extra: do not use the same request field for cache and download

otherwise we could get a racecondition between two preview_get calls and
preview_download.
---
 src/lib/extra.c| 26 ++--
 src/lib/extra_api_helper.c | 61 +++---
 src/lib/extra_private.h|  2 +-
 3 files changed, 61 insertions(+), 28 deletions(-)

diff --git a/src/lib/extra.c b/src/lib/extra.c
index 42de822..382e49a 100644
--- a/src/lib/extra.c
+++ b/src/lib/extra.c
@@ -29,6 +29,7 @@ static Eina_Bool extra_request_may_override(Extra_Request 
*req, Extra_Progress *
 typedef struct {
   Extra_Theme theme;
   Extra_Request *preview;
+  Extra_Request *cache_preview;
   Extra_Request *main;
 } Extra_Theme_Private;
 
@@ -86,6 +87,7 @@ _fill_themes(Eina_Strbuf *buf)
 typedef struct {
   Extra_Background background;
   Extra_Request *preview;
+  Extra_Request *cache_preview;
   Extra_Request *main;
 } Extra_Background_Private;
 
@@ -394,6 +396,7 @@ Extra_Progress p = {NULL, NULL, NULL};
 EAPI char*
 extra_theme_preview_get(Extra_Theme *theme)
 {
+   char *src, *dst;
char *local;
Extra_Theme_Private *priv = ((Extra_Theme_Private*) theme);
 
@@ -408,7 +411,16 @@ extra_theme_preview_get(Extra_Theme *theme)
  }
else
  {
-extra_theme_preview_download(&p, theme);
+if (!priv->cache_preview)
+  {
+ src = _extra_preview_remote_generate("themes", theme->id);
+ dst = _extra_preview_local_generate("themes", theme->id, 
theme->version);
+
+ extra_file_cache_download(&p, src, dst, &priv->cache_preview);
+
+ free(src);
+ free(dst);
+  }
  }
return local;
 }
@@ -714,6 +726,7 @@ extra_background_download(Extra_Progress *progress, 
Extra_Background *background
 EAPI char*
 extra_background_preview_get(Extra_Background *background)
 {
+   char *src, *dst;
char *local;
Extra_Background_Private *priv = (Extra_Background_Private*) background;
 
@@ -727,7 +740,16 @@ extra_background_preview_get(Extra_Background *background)
  }
else
  {
-extra_background_preview_download(&p, background);
+if (!priv->cache_preview)
+  {
+ src = _extra_preview_remote_generate("backgrounds", 
background->id);
+ dst = _extra_preview_local_generate("backgrounds", 
background->id, background->version);
+
+ extra_file_cache_download(&p, src, dst, &priv->cache_preview);
+
+ free(src);
+ free(dst);
+  }
  }
return local;
 }
diff --git a/src/lib/extra_api_helper.c b/src/lib/extra_api_helper.c
index fc3bd3f..c36fcb1 100644
--- a/src/lib/extra_api_helper.c
+++ b/src/lib/extra_api_helper.c
@@ -286,8 +286,8 @@ end:
return ECORE_CALLBACK_CANCEL;
 }
 
-void
-extra_file_download(Extra_Progress *progress, const char *from, const char 
*to, Extra_Request **req)
+static Extra_Download_Job*
+_extra_file_job_new(Extra_Progress *progress, const char *from, const char 
*to, Extra_Request **req)
 {
Extra_Download_Job *job;
 
@@ -297,30 +297,41 @@ extra_file_download(Extra_Progress *progress, const char 
*from, const char *to,
job->to = strdup(to);
job->from = strdup(from);
 
-   if (ecore_file_exists(to))
- {
-char path[PATH_MAX], *dir;
-const char *file;
+   if (req)
+ *req = &job->req;
 
-file = ecore_file_file_get(to);
-dir = ecore_file_dir_get(to);
+   return job;
+}
 
-snprintf(path, sizeof(path), "%s/cache-%s", dir, file);
-ecore_file_remove(path);
-ecore_file_download(from, path,
-  NULL,
-  _download_check_progress_cb,
-  job, &job->cache);
+void
+extra_file_cache_download(Extra_Progress *progress, const char *from, const 
char *to, Extra_Request **req)
+{
+   Extra_Download_Job *job = _extra_file_job_new(progress, from, to, req);
+
+   char path[PATH_MAX], *dir;
+   const char *file;
+
+   file = ecore_file_file_get(to);
+   dir = ecore_file_dir_get(to);
+
+   snprintf(path, sizeof(path), "%s/cache-%s", dir, file);
+   ecore_file_remove(path);
+   ecore_file_download(from, path,
+ NULL,
+ _download_check_progress_cb,
+ job, &job->cache);
+
+   free(dir);
+}
+
+void
+extra_file_download(Extra_Progress *progress, const char *from, const char 
*to, Extra_Request **req)
+{
+   Extra_Download_Job *job = _extra_file_job_new(progress, from, to, req);
+
+   ecore_file_download(from, to,
+ _download_complete_cb,
+ _download_progress_cb,
+ job, &job->full);
 
-free(dir);
- }
-   else
- {
-ecore_file_download(from, to,
-  _download_complete_cb,
-  _download_progress_cb,
-  

[EGIT] [core/enlightenment] master 01/01: remove unused variable in e_exec.c

2017-02-16 Thread Christopher Michael
devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=37e84e1b40d1ca0ce4098b7930f1368411109c13

commit 37e84e1b40d1ca0ce4098b7930f1368411109c13
Author: Chris Michael 
Date:   Thu Feb 16 13:46:20 2017 -0500

remove unused variable in e_exec.c

Signed-off-by: Chris Michael 
---
 src/bin/e_exec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/bin/e_exec.c b/src/bin/e_exec.c
index 5652507..f253e02 100644
--- a/src/bin/e_exec.c
+++ b/src/bin/e_exec.c
@@ -591,7 +591,6 @@ static Eina_Bool
 _e_exec_instance_free(E_Exec_Instance *inst)
 {
Eina_List *instances;
-   E_Client *ec;
 
if (inst->ref) return EINA_FALSE;
E_FREE_LIST(inst->watchers, free);

-- 




[EGIT] [apps/extra] master 01/01: extra: only override progress if we are not muted

2017-02-16 Thread Marcel Hollerbach
bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/apps/extra.git/commit/?id=fe62d65bca504a7fddc23901b0f7486e8b5ee793

commit fe62d65bca504a7fddc23901b0f7486e8b5ee793
Author: Marcel Hollerbach 
Date:   Thu Feb 16 18:07:05 2017 +0100

extra: only override progress if we are not muted

otherwise we could never reach the done callback which wants to be
waited for.
---
 src/bin/extra_util.c   |  1 +
 src/lib/extra.c| 40 +++-
 src/lib/extra_api_helper.c |  2 +-
 src/lib/extra_private.h|  1 +
 4 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/src/bin/extra_util.c b/src/bin/extra_util.c
index a2d6a83..834ff47 100644
--- a/src/bin/extra_util.c
+++ b/src/bin/extra_util.c
@@ -175,6 +175,7 @@ _small_preview_done_cb(void *data)
 evas_object_show(p->image);
 free(preview);
  }
+   p->req = NULL;
evas_object_show(p->image);
evas_object_hide(p->progress);
 }
diff --git a/src/lib/extra.c b/src/lib/extra.c
index 1aa19d2..42de822 100644
--- a/src/lib/extra.c
+++ b/src/lib/extra.c
@@ -19,6 +19,7 @@ Eina_List *_background_list = NULL;
 #define sec_strdup(v) v ? eina_strbuf_string_steal(v) : NULL
 
 void _extra_theme_cache_load();
+static Eina_Bool extra_request_may_override(Extra_Request *req, Extra_Progress 
*progress);
 
 #define GEN_FILE_NAME(buf, t) eina_strbuf_append_printf(buf, "%s-%d.edj", 
t->id, t->version);
 
@@ -420,7 +421,10 @@ extra_theme_preview_download(Extra_Progress *progress, 
Extra_Theme *theme)
 
if (priv->preview)
  {
-priv->preview->progress = *progress;
+if (extra_request_may_override(priv->preview, progress))
+  return priv->preview;
+else
+  return NULL;
  }
 
remote = _extra_preview_remote_generate("themes", theme->id);
@@ -461,10 +465,12 @@ extra_theme_download(Extra_Progress *progress, 
Extra_Theme *theme)
EINA_SAFETY_ON_NULL_RETURN_VAL(progress, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(theme, NULL);
 
-   if (priv->main)
+   if (priv->preview)
  {
-priv->main->progress = *progress;
-return priv->main;
+if (extra_request_may_override(priv->preview, progress))
+  return priv->preview;
+else
+  return NULL;
  }
 
urlstr = extra_theme_download_url_get(theme);
@@ -685,10 +691,12 @@ extra_background_download(Extra_Progress *progress, 
Extra_Background *background
EINA_SAFETY_ON_NULL_RETURN_VAL(progress, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(background, NULL);
 
-   if (priv->main)
+   if (priv->preview)
  {
-memcpy(&priv->preview->progress, progress, sizeof(Extra_Progress));
-return priv->main;
+if (extra_request_may_override(priv->preview, progress))
+  return priv->preview;
+else
+  return NULL;
  }
 
urlstr = extra_background_download_url_get(background);
@@ -732,8 +740,10 @@ extra_background_preview_download(Extra_Progress 
*progress, Extra_Background *ba
 
if (priv->preview)
  {
-memcpy(&priv->preview->progress, progress, sizeof(Extra_Progress));
-return priv->preview;
+if (extra_request_may_override(priv->preview, progress))
+  return priv->preview;
+else
+  return NULL;
  }
 
remote = _extra_preview_remote_generate("backgrounds", background->id);
@@ -764,7 +774,19 @@ extra_request_mute(Extra_Request *req)
 {
if(!req) return;
 
+   req->muted = EINA_TRUE;
+
req->progress.data = NULL;
req->progress.progress_cb = NULL;
req->progress.done_cb = NULL;
 }
+
+static Eina_Bool
+extra_request_may_override(Extra_Request *req, Extra_Progress *progress)
+{
+   if (!req->muted) return EINA_FALSE;
+
+   memcpy(&req->progress, progress, sizeof(Extra_Progress));
+
+   return EINA_TRUE;
+}
diff --git a/src/lib/extra_api_helper.c b/src/lib/extra_api_helper.c
index b03f7fd..fc3bd3f 100644
--- a/src/lib/extra_api_helper.c
+++ b/src/lib/extra_api_helper.c
@@ -274,7 +274,7 @@ _download_check_progress_cb(void *data EINA_UNUSED, const 
char *file,
  }
else
  {
-INF("Everything is ok\n");
+INF("Everything is ok %s %ld\n", file, dltotal);
 ecore_file_download_abort(job->cache);
 _download_job_free(job);
  }
diff --git a/src/lib/extra_private.h b/src/lib/extra_private.h
index 9412489..02be01f 100644
--- a/src/lib/extra_private.h
+++ b/src/lib/extra_private.h
@@ -40,6 +40,7 @@ typedef struct {
 
 struct _Extra_Request
 {
+   Eina_Bool muted;
Extra_Progress progress;
 };
 

-- 




[EGIT] [core/efl] master 03/04: docgen: make sure all class retrievals are cached

2017-02-16 Thread Daniel Kolesa
q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f297454ac0566b8614cc4a7dd1cbce5a3a1307c8

commit f297454ac0566b8614cc4a7dd1cbce5a3a1307c8
Author: Daniel Kolesa 
Date:   Thu Feb 16 17:20:00 2017 +0100

docgen: make sure all class retrievals are cached
---
 src/scripts/elua/apps/docgen/doctree.lua | 25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/src/scripts/elua/apps/docgen/doctree.lua 
b/src/scripts/elua/apps/docgen/doctree.lua
index dd6032d..1a3061b 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -156,6 +156,13 @@ M.Doc = Node:clone {
 
 local revh = {}
 
+local class_type_str = {
+[eolian.class_type.REGULAR] = "class",
+[eolian.class_type.ABSTRACT] = "class",
+[eolian.class_type.MIXIN] = "mixin",
+[eolian.class_type.INTERFACE] = "interface"
+}
+
 M.Class = Node:clone {
 -- class types
 UNKNOWN = eolian.class_type.UNKNOWN,
@@ -186,12 +193,7 @@ M.Class = Node:clone {
 end,
 
 type_str_get = function(self)
-return ({
-[eolian.class_type.REGULAR] = "class",
-[eolian.class_type.ABSTRACT] = "class",
-[eolian.class_type.MIXIN] = "mixin",
-[eolian.class_type.INTERFACE] = "interface"
-})[self:type_get()]
+return class_type_str[self:type_get()]
 end,
 
 theme_str_get = function(self)
@@ -1319,7 +1321,14 @@ M.Implement = Node:clone {
 end,
 
 class_get = function(self)
-return M.Class(self.impl:class_get())
+local ccl = self._cache_cl
+if ccl then
+return ccl
+end
+-- so that we don't re-instantiate, it gets cached over there too
+ccl = M.Class.by_name_get(self.impl:class_get():full_name_get())
+self._cache_cl = ccl
+return ccl
 end,
 
 function_get = function(self)
@@ -1407,7 +1416,7 @@ M.DocTokenizer = Node:clone {
 local reft = eolian.doc_ref_type
 local ret
 if tp == reft.CLASS or tp == reft.FUNC or tp == reft.EVENT then
-ret = { M.Class(d1):type_str_get() }
+ret = { class_type_str[d1:type_get()] }
 if not ret[1] then
 error("unknown class type for class '"
   .. d1:full_name_get() .. "'")

-- 




[EGIT] [core/efl] master 04/04: docgen: add -p to print what exactly is being generated currently

2017-02-16 Thread Daniel Kolesa
q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=cbe7859d1c79fbb991186605b5ea2defdfe9ef52

commit cbe7859d1c79fbb991186605b5ea2defdfe9ef52
Author: Daniel Kolesa 
Date:   Thu Feb 16 17:29:23 2017 +0100

docgen: add -p to print what exactly is being generated currently
---
 src/scripts/elua/apps/gendoc.lua | 41 
 1 file changed, 33 insertions(+), 8 deletions(-)

diff --git a/src/scripts/elua/apps/gendoc.lua b/src/scripts/elua/apps/gendoc.lua
index 9cbbf7a..9100f73 100644
--- a/src/scripts/elua/apps/gendoc.lua
+++ b/src/scripts/elua/apps/gendoc.lua
@@ -8,6 +8,8 @@ local writer = require("docgen.writer")
 local keyref = require("docgen.keyref")
 local dtree = require("docgen.doctree")
 
+local printgen = function() end
+
 local propt_to_type = {
 [dtree.Function.PROPERTY] = "(get, set)",
 [dtree.Function.PROP_GET] = "(get)",
@@ -327,6 +329,7 @@ end
 
 local build_ref = function()
 local f = writer.Writer("reference", "EFL Reference")
+printgen("Generating reference...")
 
 f:write_editable({ "reference" }, "general")
 f:write_nl()
@@ -717,7 +720,9 @@ end
 
 local build_class = function(cl)
 local cln = cl:nspaces_get()
-local f = writer.Writer(cln, cl:full_name_get())
+local fulln = cl:full_name_get()
+local f = writer.Writer(cln, fulln)
+printgen("Generating class: " .. fulln)
 stats.check_class(cl)
 
 keyref.add(cl:full_name_get():gsub("%.", "_"), cln, "c")
@@ -804,7 +809,9 @@ end
 
 local build_alias = function(tp)
 local ns = dtree.Node.nspaces_get(tp, "alias")
-local f = writer.Writer(ns, tp:full_name_get())
+local fulln = tp:full_name_get()
+local f = writer.Writer(ns, fulln)
+printgen("Generating alias: " .. fulln)
 stats.check_alias(tp)
 
 write_tsigs(f, tp, ns)
@@ -821,7 +828,9 @@ end
 
 local build_struct = function(tp)
 local ns = dtree.Node.nspaces_get(tp, "struct")
-local f = writer.Writer(ns, tp:full_name_get())
+local fulln = tp:full_name_get()
+local f = writer.Writer(ns, fulln)
+printgen("Generating struct: " .. fulln)
 stats.check_struct(tp)
 
 write_tsigs(f, tp, ns)
@@ -853,7 +862,9 @@ end
 
 local build_enum = function(tp)
 local ns = dtree.Node.nspaces_get(tp, "enum")
-local f = writer.Writer(ns, tp:full_name_get())
+local fulln = tp:full_name_get()
+local f = writer.Writer(ns, fulln)
+printgen("Generating enum: " .. fulln)
 stats.check_enum(tp)
 
 write_tsigs(f, tp, ns)
@@ -885,7 +896,9 @@ end
 
 local build_variable = function(v, constant)
 local ns = v:nspaces_get()
-local f = writer.Writer(ns, v:full_name_get())
+local fulln = v:full_name_get()
+local f = writer.Writer(ns, fulln)
+printgen("Generating variable: " .. fulln)
 if constant then
 stats.check_constant(v)
 else
@@ -1068,7 +1081,9 @@ build_method = function(impl, cl)
 local over = impl:is_overridden(cl)
 local fn = impl:function_get()
 local mns = fn:nspaces_get(cl)
-local f = writer.Writer(mns, cl:full_name_get() .. "." .. fn:name_get())
+local methn = cl:full_name_get() .. "." .. fn:name_get()
+local f = writer.Writer(mns, methn)
+printgen("Generating method: " .. methn)
 stats.check_method(fn, cl)
 
 write_inherited_from(f, impl, cl, over)
@@ -1110,7 +1125,9 @@ build_property = function(impl, cl)
 local over = impl:is_overridden(cl)
 local fn = impl:function_get()
 local pns = fn:nspaces_get(cl)
-local f = writer.Writer(pns, cl:full_name_get() .. "." .. fn:name_get())
+local propn = cl:full_name_get() .. "." .. fn:name_get()
+local f = writer.Writer(pns, propn)
+printgen("Generating property: " .. propn)
 
 write_inherited_from(f, impl, cl, over)
 
@@ -1216,7 +1233,9 @@ end
 
 build_event = function(ev, cl)
 local evn = ev:nspaces_get(cl)
-local f = writer.Writer(evn, cl:full_name_get() .. ": " .. ev:name_get())
+local evnm = cl:full_name_get() .. ": " .. ev:name_get()
+local f = writer.Writer(evn, evnm)
+printgen("Generating event: " .. evnm)
 
 f:write_h("Signature", 2)
 local buf = { ev:name_get() }
@@ -1271,6 +1290,7 @@ getopt.parse {
 callback = getopt.help_cb(io.stdout)
 },
 { "v", "verbose", false, help = "Be verbose." },
+{ "p", "print-gen", false, help = "Print what is being generated." },
 
 { category = "Generator" },
 { "r", "root", true, help = "Root path of the docs." },
@@ -1290,6 +1310,9 @@ getopt.parse {
 if opts["h"] then
 return
 end
+if opts["p"] then
+printgen = function(...) print(...) end
+end
 if opts["graph-theme-dark"] then
 current_theme = default_theme_light
 end
@@ -1329,6 +1352,8 @@ getopt.parse {
 build_typedecls()
 build_variables()
 keyref.build()
+-- newline if printing what's 

[EGIT] [core/efl] master 01/04: docgen: cache class retrievals for performance

2017-02-16 Thread Daniel Kolesa
q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b9090529e5e573499138fd1ad90982300abf77fd

commit b9090529e5e573499138fd1ad90982300abf77fd
Author: Daniel Kolesa 
Date:   Thu Feb 16 16:06:56 2017 +0100

docgen: cache class retrievals for performance
---
 src/scripts/elua/apps/docgen/doctree.lua | 36 +++-
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/src/scripts/elua/apps/docgen/doctree.lua 
b/src/scripts/elua/apps/docgen/doctree.lua
index 042dcab..7b48808 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -10,6 +10,16 @@ local writer
 
 local M = {}
 
+local get_cache = function(o, nm)
+local ret = o[nm]
+if not ret then
+ret = {}
+o[nm] = ret
+return ret, false
+end
+return ret, true
+end
+
 M.Node = util.Object:clone {
 scope = {
 UNKNOWN = eolian.object_scope.UNKNOWN,
@@ -256,25 +266,41 @@ M.Class = Node:clone {
 -- static getters
 
 by_name_get = function(name)
+local stor = get_cache(M.Class, "_cache_bn")
+local ret = stor[name]
+if ret then
+return ret
+end
 local v = eolian.class_get_by_name(name)
 if not v then
 return nil
 end
-return M.Class(v)
+ret = M.Class(v)
+stor[name] = ret
+return ret
 end,
 
 by_file_get = function(name)
+local stor = get_cache(M.Class, "_cache_bf")
+local ret = stor[name]
+if ret then
+return ret
+end
 local v = eolian.class_get_by_file(name)
 if not v then
 return nil
 end
-return M.Class(v)
+ret = M.Class(v)
+stor[name] = ret
+return ret
 end,
 
 all_get = function()
-local ret = {}
-for cl in eolian.all_classes_get() do
-ret[#ret + 1] = M.Class(cl)
+local ret, had = get_cache(M.Class, "_cache_all")
+if not had then
+for cl in eolian.all_classes_get() do
+ret[#ret + 1] = M.Class(cl)
+end
 end
 return ret
 end

-- 




[EGIT] [core/efl] master 02/04: docgen: cache function instantiations

2017-02-16 Thread Daniel Kolesa
q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0dfb6516a1484bd1b16fce3d0fa6b8d9b965fa29

commit 0dfb6516a1484bd1b16fce3d0fa6b8d9b965fa29
Author: Daniel Kolesa 
Date:   Thu Feb 16 17:12:43 2017 +0100

docgen: cache function instantiations
---
 src/scripts/elua/apps/docgen/doctree.lua | 44 ++--
 1 file changed, 31 insertions(+), 13 deletions(-)

diff --git a/src/scripts/elua/apps/docgen/doctree.lua 
b/src/scripts/elua/apps/docgen/doctree.lua
index 7b48808..dd6032d 100644
--- a/src/scripts/elua/apps/docgen/doctree.lua
+++ b/src/scripts/elua/apps/docgen/doctree.lua
@@ -224,7 +224,12 @@ M.Class = Node:clone {
 end,
 
 functions_get = function(self, ft)
-local ret = {}
+local ret = self._cache_funcs
+if ret then
+return ret
+end
+ret = {}
+self._cache_funcs = ret
 for fn in self.class:functions_get(ft) do
 ret[#ret + 1] = M.Function(fn)
 end
@@ -232,7 +237,13 @@ M.Class = Node:clone {
 end,
 
 function_get_by_name = function(self, fn, ft)
-return M.Function(self.class:function_get_by_name(fn, ft))
+local fun = self._cache_func
+if fun then
+return fun
+end
+fun = M.Function(self.class:function_get_by_name(fn, ft))
+self._cache_func = fun
+return fun
 end,
 
 events_get = function(self)
@@ -306,6 +317,13 @@ M.Class = Node:clone {
 end
 }
 
+local func_type_str = {
+[eolian.function_type.PROPERTY] = "property",
+[eolian.function_type.PROP_GET] = "property",
+[eolian.function_type.PROP_SET] = "property",
+[eolian.function_type.METHOD] = "method"
+}
+
 M.Function = Node:clone {
 -- function types
 UNRESOLVED = eolian.function_type.UNRESOLVED,
@@ -328,12 +346,7 @@ M.Function = Node:clone {
 end,
 
 type_str_get = function(self)
-return ({
-[eolian.function_type.PROPERTY] = "property",
-[eolian.function_type.PROP_GET] = "property",
-[eolian.function_type.PROP_SET] = "property",
-[eolian.function_type.METHOD] = "method"
-})[self:type_get()]
+return func_type_str[self:type_get()]
 end,
 
 scope_get = function(self, ft)
@@ -1310,8 +1323,14 @@ M.Implement = Node:clone {
 end,
 
 function_get = function(self)
-local func, tp = self.impl:function_get()
-return M.Function(func), tp
+local func, tp = self._cache_func, self._cache_tp
+if func then
+return func, tp
+end
+func, tp = self.impl:function_get()
+func = M.Function(func)
+self._cache_func, self._cache_tp = func, tp
+return func, tp
 end,
 
 doc_get = function(self, ftype, inh)
@@ -1410,9 +1429,8 @@ M.DocTokenizer = Node:clone {
 ret[#ret + 1] = tok:lower()
 end
 if tp == reft.FUNC then
-local fid = M.Function(d2)
-ret[#ret + 1] = fid:type_str_get()
-ret[#ret + 1] = fid:name_get():lower()
+ret[#ret + 1] = func_type_str[d2:type_get()]
+ret[#ret + 1] = d2:name_get():lower()
 elseif tp == reft.EVENT then
 ret[#ret + 1] = "event"
 ret[#ret + 1] = d2:name_get():lower()

-- 




Re: [E-devel] [EGIT] [core/efl] master 01/01: ecore_drm2: ERR once when page flip fails with EBUSY

2017-02-16 Thread Christopher Michael
On 02/16/2017 09:08 AM, Derek Foreman wrote:
> On 15/02/17 07:59 PM, Carsten Haitzler (The Rasterman) wrote:
>> On Wed, 15 Feb 2017 08:02:02 -0800 Derek Foreman  
>> said:
>>
>>> derekf pushed a commit to branch master.
>>>
>>> http://git.enlightenment.org/core/efl.git/commit/?id=ae5d00246667e0a37b123fef4618b670021f5d9e
>>>
>>> commit ae5d00246667e0a37b123fef4618b670021f5d9e
>>> Author: Derek Foreman 
>>> Date:   Wed Feb 15 09:51:32 2017 -0600
>>>
>>> ecore_drm2: ERR once when page flip fails with EBUSY
>>>
>>> On systems where this happens it'll probably happen a lot, so
>>> we don't want to continuously log this, but since it's definitely
>>> showing a bug somewhere (efl or kernel) it probably should be an ERR.
>>
>> hmmm... where i have seen this it doesn't happen THAT much... like it 
>> sometimes
>> happens in blips like 1 here, 15 seconds later, another, 1 min later another,
>> then maybe 2 mins later 3 in a row fast, then nothing for 10 sec... it's very
>> blippy. i logged these for a while myself... :)
>
> Chris hit it somehow and replaced all the ERR with DBG - I think it's an
> important enough error to be an ERR at least once, so I figured this was
> a reasonable compromise.
>

Agreed. I was testing some support for rotating Outputs (in drm2) via 
Evas software rotation. Due to various issues with a given FBO, the ERR 
here was being spewed quite a lot on the console. So Derek and I spoke 
and came to the agreement that we can just spit this out once and things 
will be fine.

Cheers,
dh


>>> ---
>>>  src/lib/ecore_drm2/ecore_drm2_fb.c | 13 ++---
>>>  1 file changed, 10 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c
>>> b/src/lib/ecore_drm2/ecore_drm2_fb.c index f838168..fe27508 100644
>>> --- a/src/lib/ecore_drm2/ecore_drm2_fb.c
>>> +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
>>> @@ -424,6 +424,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output
>>> *output)
>>>  do
>>>{
>>> + static Eina_Bool bugged_about_bug = EINA_FALSE;
>>>   repeat = EINA_FALSE;
>>>   ret = sym_drmModePageFlip(fb->fd, output->crtc_id, fb->id,
>>> DRM_MODE_PAGE_FLIP_EVENT,
>>> @@ -434,12 +435,18 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, 
>>> Ecore_Drm2_Output
>>> *output)
>>>* until we can flip or we give up (100 tries with a yield
>>>* between each try). We can't expect everyone to run the
>>>* latest bleeding edge kernel IF a workaround is possible
>>> -  * in userspace, so do this. */
>>> +  * in userspace, so do this.
>>> +  * We only report this as an ERR once since if it will
>>> +  * generate a huge amount of spam otherwise. */
>>>   if ((ret < 0) && (errno == EBUSY))
>>> {
>>>repeat = EINA_TRUE;
>>> -  if (count == 0)
>>> -WRN("Pageflip fail - EBUSY from drmModePageFlip...");
>>> +  if (count == 0 && !bugged_about_bug)
>>> +{
>>> +   ERR("Pageflip fail - EBUSY from drmModePageFlip - "
>>> +   "This is either a kernel bug or an EFL one.");
>>> +   bugged_about_bug = EINA_TRUE;
>>> +}
>>>count++;
>>>if (count > 500)
>>>  {
>>>
>>> --
>>>
>>>



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [EGIT] [core/efl] master 01/01: ecore_drm2: ERR once when page flip fails with EBUSY

2017-02-16 Thread Derek Foreman
On 15/02/17 07:59 PM, Carsten Haitzler (The Rasterman) wrote:
> On Wed, 15 Feb 2017 08:02:02 -0800 Derek Foreman  
> said:
>
>> derekf pushed a commit to branch master.
>>
>> http://git.enlightenment.org/core/efl.git/commit/?id=ae5d00246667e0a37b123fef4618b670021f5d9e
>>
>> commit ae5d00246667e0a37b123fef4618b670021f5d9e
>> Author: Derek Foreman 
>> Date:   Wed Feb 15 09:51:32 2017 -0600
>>
>> ecore_drm2: ERR once when page flip fails with EBUSY
>>
>> On systems where this happens it'll probably happen a lot, so
>> we don't want to continuously log this, but since it's definitely
>> showing a bug somewhere (efl or kernel) it probably should be an ERR.
>
> hmmm... where i have seen this it doesn't happen THAT much... like it 
> sometimes
> happens in blips like 1 here, 15 seconds later, another, 1 min later another,
> then maybe 2 mins later 3 in a row fast, then nothing for 10 sec... it's very
> blippy. i logged these for a while myself... :)

Chris hit it somehow and replaced all the ERR with DBG - I think it's an 
important enough error to be an ERR at least once, so I figured this was 
a reasonable compromise.

>> ---
>>  src/lib/ecore_drm2/ecore_drm2_fb.c | 13 ++---
>>  1 file changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c
>> b/src/lib/ecore_drm2/ecore_drm2_fb.c index f838168..fe27508 100644
>> --- a/src/lib/ecore_drm2/ecore_drm2_fb.c
>> +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
>> @@ -424,6 +424,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output
>> *output)
>>  do
>>{
>> + static Eina_Bool bugged_about_bug = EINA_FALSE;
>>   repeat = EINA_FALSE;
>>   ret = sym_drmModePageFlip(fb->fd, output->crtc_id, fb->id,
>> DRM_MODE_PAGE_FLIP_EVENT,
>> @@ -434,12 +435,18 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output
>> *output)
>>* until we can flip or we give up (100 tries with a yield
>>* between each try). We can't expect everyone to run the
>>* latest bleeding edge kernel IF a workaround is possible
>> -  * in userspace, so do this. */
>> +  * in userspace, so do this.
>> +  * We only report this as an ERR once since if it will
>> +  * generate a huge amount of spam otherwise. */
>>   if ((ret < 0) && (errno == EBUSY))
>> {
>>repeat = EINA_TRUE;
>> -  if (count == 0)
>> -WRN("Pageflip fail - EBUSY from drmModePageFlip...");
>> +  if (count == 0 && !bugged_about_bug)
>> +{
>> +   ERR("Pageflip fail - EBUSY from drmModePageFlip - "
>> +   "This is either a kernel bug or an EFL one.");
>> +   bugged_about_bug = EINA_TRUE;
>> +}
>>count++;
>>if (count > 500)
>>  {
>>
>> --
>>
>>
>
>


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] master 03/03: gengrid: Remove duplicated smart callbacks

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=af0d850a9dbfa13a171641d9f2b6236eeafdc4da

commit af0d850a9dbfa13a171641d9f2b6236eeafdc4da
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 22:05:58 2017 +0900

gengrid: Remove duplicated smart callbacks

WRN... evas_smart.c:219 evas_smart_cb_descriptions_fix() duplicated
  smart callback description with name 'item,focused' and type ''
---
 src/lib/elementary/elm_gengrid.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c
index 20a6d0b..f677857 100644
--- a/src/lib/elementary/elm_gengrid.c
+++ b/src/lib/elementary/elm_gengrid.c
@@ -81,8 +81,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
{SIG_WIDGET_ACCESS_CHANGED, ""}, /**< handled by elm_widget */
{SIG_LAYOUT_FOCUSED, ""}, /**< handled by elm_layout */
{SIG_LAYOUT_UNFOCUSED, ""}, /**< handled by elm_layout */
-   {SIG_ITEM_FOCUSED, ""},
-   {SIG_ITEM_UNFOCUSED, ""},
 
{NULL, NULL}
 };

-- 




[EGIT] [core/efl] master 02/03: widget: Reduce WRN to DBG for on_focus_region message

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1166f753fb843591f84482d5288619fa68f1110d

commit 1166f753fb843591f84482d5288619fa68f1110d
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 22:00:19 2017 +0900

widget: Reduce WRN to DBG for on_focus_region message

Many widgets don't implement this function, and this case is
perfectly well handled by the caller. No need to WRN here.
---
 src/lib/elementary/elm_widget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index a070c4c..9243bee 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -222,7 +222,7 @@ _elm_widget_mirrored_reload(Evas_Object *obj)
 EOLIAN static Eina_Bool
 _elm_widget_on_focus_region(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, 
Evas_Coord *x EINA_UNUSED, Evas_Coord *y EINA_UNUSED, Evas_Coord *w 
EINA_UNUSED, Evas_Coord *h EINA_UNUSED)
 {
-   WRN("The %s widget does not implement the \"on_focus_region\" function.",
+   DBG("The %s widget does not implement the \"on_focus_region\" function.",
efl_class_name_get(efl_class_get(obj)));
 
return EINA_FALSE;

-- 




[EGIT] [core/efl] master 01/03: evas: Silence useless WRN message on canvas del

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4fdd30bce5d2d068bc85513f50ef0b5bae9aae65

commit 4fdd30bce5d2d068bc85513f50ef0b5bae9aae65
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 21:56:11 2017 +0900

evas: Silence useless WRN message on canvas del
---
 src/lib/evas/canvas/evas_device.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lib/evas/canvas/evas_device.c 
b/src/lib/evas/canvas/evas_device.c
index 9a65d79..80a5ab7 100644
--- a/src/lib/evas/canvas/evas_device.c
+++ b/src/lib/evas/canvas/evas_device.c
@@ -43,6 +43,7 @@ _new_default_device_find(Evas_Public_Data *e, Evas_Device 
*old_dev)
Evas_Device *dev, *def, *old_parent;
Evas_Device_Class old_class;
 
+   if (e->cleanup) return NULL;
old_class = efl_input_device_type_get(old_dev);
old_parent = efl_input_device_parent_get(old_dev);
def = NULL;

-- 




[EGIT] [core/efl] master 01/01: ecore_evas: Fix mouse event in inlined windows

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=29416352d74b63b91d658b16f14e149246a4c0be

commit 29416352d74b63b91d658b16f14e149246a4c0be
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 21:51:47 2017 +0900

ecore_evas: Fix mouse event in inlined windows

This fixes the following ERR message:
ERR<10589>:eina_safety 
/home/jpeg/e/core/efl/src/lib/ecore_evas/ecore_evas.c:3149
  _ecore_evas_mouse_move_process_internal() safety check failed: cursor == 
NULL
---
 src/lib/ecore_evas/ecore_evas_buffer.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c 
b/src/lib/ecore_evas/ecore_evas_buffer.c
index 74bcdd7..21d03ec 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -725,6 +725,7 @@ ecore_evas_buffer_allocfunc_new(int w, int h,
  {
 ERR("Could not init the Ecore Evas cursors");
 ecore_evas_free(ee);
+return NULL;
  }
evas_event_feed_mouse_in(ee->evas, 0, NULL);
 
@@ -916,6 +917,12 @@ ecore_evas_object_image_new(Ecore_Evas *ee_target)
evas_key_lock_add(ee->evas, "Num_Lock");
evas_key_lock_add(ee->evas, "Scroll_Lock");
 
+   if (!_ecore_evas_cursors_init(ee))
+ {
+ERR("Could not init the Ecore Evas cursors");
+ecore_evas_free(ee);
+return NULL;
+ }
_ecore_evas_register_animators(ee);
 
ee_target->sub_ecore_evas = eina_list_append(ee_target->sub_ecore_evas, ee);

-- 




[EGIT] [website/www-content] master 01/01: Wiki page debian-start changed with summary [] by Pierre Couderc

2017-02-16 Thread Pierre Couderc
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=a4f257eff930a63a16964f72b29ede3c9716edf5

commit a4f257eff930a63a16964f72b29ede3c9716edf5
Author: Pierre Couderc 
Date:   Thu Feb 16 04:47:53 2017 -0800

Wiki page debian-start changed with summary [] by Pierre Couderc
---
 pages/distros/debian-start.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pages/distros/debian-start.txt b/pages/distros/debian-start.txt
index 9aa9386..16e9cf3 100644
--- a/pages/distros/debian-start.txt
+++ b/pages/distros/debian-start.txt
@@ -159,4 +159,4 @@ startx
 These run-time requirements may be provided - or not - by a display manger. In 
this case, you can reboot and choose Enlightenment as a window manager.
 
 == Test ==
-This procedure has been tested in February 2017 on jessie 8.7.1 and on stretch.
+This procedure has been tested in February 2017 on jessie 8.7.1 and on stretch 
(potential problems on stretch).

-- 




[EGIT] [core/efl] master 02/02: win: Avoid magic check failed in ecore with inline win

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=063c3529a5c851a46e6b89cc5c2bee08cd3c8ea2

commit 063c3529a5c851a46e6b89cc5c2bee08cd3c8ea2
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 21:45:12 2017 +0900

win: Avoid magic check failed in ecore with inline win

Fixes T4663
---
 src/lib/elementary/efl_ui_win.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 06d3bd5..492bf8a 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -2696,6 +2696,7 @@ _elm_win_on_img_obj_del(void *data,
 static void
 _elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj)
 {
+   if (!imgobj) return;
evas_object_event_callback_del_full
  (imgobj, EVAS_CALLBACK_DEL, _elm_win_on_img_obj_del, obj);
evas_object_event_callback_del_full
@@ -2771,7 +2772,7 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, 
Efl_Ui_Win_Data *sd)
sd->pointer.surf = NULL;
 #endif
 
-   if (sd->img_obj)
+   if (sd->type == ELM_WIN_INLINED_IMAGE)
  {
 _elm_win_img_callbacks_del(obj, sd->img_obj);
 sd->img_obj = NULL;

-- 




[EGIT] [core/efl] master 01/02: elm_test: Fix invalid API use (EO)

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e99f6a87eec60f7ee4ca526520b2493892e1d97f

commit e99f6a87eec60f7ee4ca526520b2493892e1d97f
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 21:32:39 2017 +0900

elm_test: Fix invalid API use (EO)
---
 src/bin/elementary/test_win_inline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/elementary/test_win_inline.c 
b/src/bin/elementary/test_win_inline.c
index b9b8d84..10b80c1 100644
--- a/src/bin/elementary/test_win_inline.c
+++ b/src/bin/elementary/test_win_inline.c
@@ -227,7 +227,7 @@ test_win_inline(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *even
 
box = efl_add(EFL_UI_BOX_CLASS, win);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-   efl_pack(win, box);
+   elm_win_resize_object_add(win, box);
evas_object_show(box);
 
win2 = elm_win_add(win, "inlined", ELM_WIN_INLINED_IMAGE);

-- 




[EGIT] [core/efl] master 01/01: win: Avoid malloc in icon_object_set

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c09b921e34545ad93bd9091e35a816e687276310

commit c09b921e34545ad93bd9091e35a816e687276310
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 20:40:22 2017 +0900

win: Avoid malloc in icon_object_set

Also support both Evas.Image and EO Efl.Canvas.Image classes.
Add a test case in elm_test (under "Icon").

I'm not so happy about this patch... it shows that the API
barrier between legacy and EO implemented for images may not
be such a great idea after all :(
---
 src/bin/elementary/test_icon.c  |  6 
 src/lib/elementary/efl_ui_win.c | 73 +++--
 2 files changed, 55 insertions(+), 24 deletions(-)

diff --git a/src/bin/elementary/test_icon.c b/src/bin/elementary/test_icon.c
index 5c901a6..0b79b4c 100644
--- a/src/bin/elementary/test_icon.c
+++ b/src/bin/elementary/test_icon.c
@@ -107,6 +107,12 @@ test_icon(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *event_info
elm_box_pack_end(hbox, bt);
evas_object_show(bt);
 
+   /* Set window icon too */
+   ic = evas_object_image_filled_add(evas_object_evas_get(win));
+   evas_object_image_file_set(ic, buf, NULL);
+   elm_win_icon_object_set(win, ic);
+   evas_object_show(ic);
+
evas_object_resize(win, 400, 400);
evas_object_show(win);
 }
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index f558430..06d3bd5 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -3185,46 +3185,71 @@ _elm_win_xwin_update(Efl_Ui_Win_Data *sd)
// set window icon
if (sd->icon)
  {
-void *data;
+Eo *image = NULL;
 
 if (efl_isa(sd->icon, EFL_CANVAS_IMAGE_INTERNAL_CLASS))
+  image = sd->icon;
+
+if (image)
   {
- data = evas_object_image_data_get(sd->icon, EINA_FALSE);
- if (data)
+ int w = 0, h = 0, stride, x, y;
+ Eina_Bool unmap = EINA_FALSE;
+ Eina_Rw_Slice sl = {};
+
+ if (efl_isa(image, EFL_CANVAS_IMAGE_CLASS))
+   {
+  unmap = EINA_TRUE;
+  efl_gfx_buffer_size_get(image, &w, &h);
+  efl_gfx_buffer_map(image, &sl, 
EFL_GFX_BUFFER_ACCESS_MODE_READ,
+ 0, 0, w, h, EFL_GFX_COLORSPACE_ARGB, 
0,
+ &stride);
+   }
+ else
+   {
+  evas_object_image_size_get(image, &w, &h);
+  stride = evas_object_image_stride_get(image);
+  sl.mem = evas_object_image_data_get(image, EINA_FALSE);
+   }
+
+ if (sl.mem)
{
   Ecore_X_Icon ic;
-  int w = 0, h = 0, stride, x, y;
-  unsigned char *p;
-  unsigned int *p2;
 
-  evas_object_image_size_get(sd->icon, &w, &h);
-  stride = evas_object_image_stride_get(sd->icon);
+  ic.width = w;
+  ic.height = h;
   if ((w > 0) && (h > 0) &&
   (stride >= (int)(w * sizeof(unsigned int
 {
-   ic.width = w;
-   ic.height = h;
-   ic.data = malloc(w * h * sizeof(unsigned int));
-
-   if (ic.data)
+   if (stride == (int)(w * sizeof(unsigned int)))
  {
-p = (unsigned char *)data;
-p2 = (unsigned int *)ic.data;
-for (y = 0; y < h; y++)
+ic.data = sl.mem;
+ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
+ }
+   else
+ {
+ic.data = malloc(w * h * sizeof(unsigned int));
+if (ic.data)
   {
- for (x = 0; x < w; x++)
+ unsigned char *p = sl.mem;
+ unsigned int *p2 = ic.data;
+
+ for (y = 0; y < h; y++)
{
-  *p2 = *((unsigned int *)p);
-  p += sizeof(unsigned int);
-  p2++;
+  for (x = 0; x < w; x++)
+{
+   *p2 = *((unsigned int *)p);
+   p += sizeof(unsigned int);
+   p2++;
+}
+  p += (stride - (w * sizeof(unsigned 
int)));
   

[EGIT] [core/efl] master 01/01: evas: Flush post-event callbacks only when needed

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a014b2140069c8c9b03f048698537abe7316cc10

commit a014b2140069c8c9b03f048698537abe7316cc10
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 20:17:12 2017 +0900

evas: Flush post-event callbacks only when needed

This avoids flushing the post-event cb queue when processing
recursive events. See 54e5841b2f6386765dd5e2831aa3481b952e5.
---
 src/lib/evas/canvas/evas_callbacks.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/evas_callbacks.c 
b/src/lib/evas/canvas/evas_callbacks.c
index d4fd953..c57682c 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -246,9 +246,10 @@ _evas_post_event_callback_call(Evas *eo_e, 
Evas_Public_Data *e, int min_event_id
e->running_post_events--;
_evas_unwalk(e);
 
-   if (!e->running_post_events && e->post_events)
+   if (!e->running_post_events && e->post_events
+   && (e->current_event == EVAS_CALLBACK_LAST))
  {
-WRN("Not all post-event callbacks hve been processed!");
+WRN("Not all post-event callbacks have been processed!");
 _evas_post_event_callback_call(eo_e, e, 0);
  }
 }

-- 




[EGIT] [core/efl] master 01/01: win: Fix window icons with object set

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8226fb2e8710eec05d6bbc7bc9651f7543259cd1

commit 8226fb2e8710eec05d6bbc7bc9651f7543259cd1
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 20:05:04 2017 +0900

win: Fix window icons with object set

Fixes T4981
---
 src/lib/elementary/efl_ui_win.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 3f581d8..f558430 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -3187,7 +3187,7 @@ _elm_win_xwin_update(Efl_Ui_Win_Data *sd)
  {
 void *data;
 
-if (efl_isa(sd->icon, EFL_CANVAS_IMAGE_CLASS))
+if (efl_isa(sd->icon, EFL_CANVAS_IMAGE_INTERNAL_CLASS))
   {
  data = evas_object_image_data_get(sd->icon, EINA_FALSE);
  if (data)

-- 




[EGIT] [core/efl] master 01/01: evas: Re-fix post-event cb by supporting recursion

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=54e5841b2f6386765dd5e2831aa3481b952e5fd4

commit 54e5841b2f6386765dd5e2831aa3481b952e5fd4
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 19:34:08 2017 +0900

evas: Re-fix post-event cb by supporting recursion

The previous patch (b184874fa5a0c3177c) was preventing
post-event callbacks from triggering any form of input event,
including side-effects due to mouse,in. In fact by tracking
which exact events we want to post-process we can support
proper recursion. This fixes crashes in Bryce.

I'm not changing the documentation as this is still a dubious
code design.

Fixes T3144
Fixes T5157
---
 src/lib/evas/canvas/evas_callbacks.c | 17 ++--
 src/lib/evas/canvas/evas_events.c| 74 +---
 src/lib/evas/canvas/evas_focus.c | 10 +++--
 src/lib/evas/canvas/evas_object_inform.c | 54 +++
 src/lib/evas/canvas/evas_object_main.c   | 17 +---
 src/lib/evas/include/evas_private.h  |  6 ++-
 6 files changed, 108 insertions(+), 70 deletions(-)

diff --git a/src/lib/evas/canvas/evas_callbacks.c 
b/src/lib/evas/canvas/evas_callbacks.c
index 42dd851..d4fd953 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -222,19 +222,20 @@ _eo_evas_cb(void *data, const Efl_Event *event)
 }
 
 void
-_evas_post_event_callback_call(Evas *eo_e, Evas_Public_Data *e)
+_evas_post_event_callback_call(Evas *eo_e, Evas_Public_Data *e, int 
min_event_id)
 {
Evas_Post_Callback *pc;
Eina_List *l, *l_next;
int skip = 0;
 
-   if (e->delete_me || e->running_post_events) return;
+   if (e->delete_me) return;
if (!e->post_events) return;
 
_evas_walk(e);
-   e->running_post_events = EINA_TRUE;
+   e->running_post_events++;
EINA_LIST_FOREACH_SAFE(e->post_events, l, l_next, pc)
  {
+if ((unsigned int) pc->event_id < (unsigned int) min_event_id) break;
 e->post_events = eina_list_remove_list(e->post_events, l);
 if ((!skip) && (!e->delete_me) && (!pc->delete_me))
   {
@@ -242,8 +243,14 @@ _evas_post_event_callback_call(Evas *eo_e, 
Evas_Public_Data *e)
   }
 EVAS_MEMPOOL_FREE(_mp_pc, pc);
  }
-   e->running_post_events = EINA_FALSE;
+   e->running_post_events--;
_evas_unwalk(e);
+
+   if (!e->running_post_events && e->post_events)
+ {
+WRN("Not all post-event callbacks hve been processed!");
+_evas_post_event_callback_call(eo_e, e, 0);
+ }
 }
 
 void
@@ -609,6 +616,8 @@ evas_post_event_callback_push(Evas *eo_e, 
Evas_Object_Event_Post_Cb func, const
 
pc->func = func;
pc->data = data;
+   pc->type = e->current_event;
+   pc->event_id = _evas_event_counter;
e->post_events = eina_list_prepend(e->post_events, pc);
 }
 
diff --git a/src/lib/evas/canvas/evas_events.c 
b/src/lib/evas/canvas/evas_events.c
index 69a1586..aa0c9e7 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -30,16 +30,14 @@ static void
 _canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, 
int y,
  unsigned int timestamp, const void *data);
 
-static inline Eina_Bool
-_evas_event_feed_allow(Evas_Public_Data *e)
+static inline void
+_evas_event_feed_check(Evas_Public_Data *e)
 {
-   if (EINA_LIKELY(!e->running_post_events)) return EINA_TRUE;
-   ERR("Can not feed input events while running post-event callbacks!");
-   return EINA_FALSE;
+   if (EINA_LIKELY(!e->running_post_events)) return;
+   DBG("Feeding new input events from a post-event callback is risky!");
 }
 
-#define EVAS_EVENT_FEED_SAFETY_CHECK(evas, ...) do { \
-   if (!_evas_event_feed_allow(evas)) return __VA_ARGS__; } while (0)
+#define EVAS_EVENT_FEED_SAFETY_CHECK(evas) _evas_event_feed_check(evas)
 
 static void
 _evas_event_havemap_adjust_f(Evas_Object *eo_obj EINA_UNUSED, 
Evas_Object_Protected_Data *obj, Eina_Vector2 *point, Eina_Bool mouse_grabbed)
@@ -1500,7 +1498,7 @@ _canvas_event_feed_mouse_down_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
  }
if (copy) eina_list_free(copy);
e->last_mouse_down_counter++;
-   _evas_post_event_callback_call(eo_e, e);
+   _evas_post_event_callback_call(eo_e, e, event_id);
/* update touch point's state to EVAS_TOUCH_POINT_STILL */
_evas_touch_point_update(eo_e, 0, pdata->x, pdata->y, 
EVAS_TOUCH_POINT_STILL);
_evas_unwalk(e);
@@ -1508,7 +1506,7 @@ _canvas_event_feed_mouse_down_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_Da
if (ev->device) efl_unref(ev->device);
 }
 
-static int
+static void
 _post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer *parent_ev,
 Evas_Pointer_Data *pdata)
 {
@@ -1517,14 +1515,13 @@ _post_up_handle(Evas_Public_Data *e, Efl_Input_Pointer 
*parent_ev,
Efl_Input_Pointer *evt;
Evas_Object *eo_obj;
Evas *eo_e = e->evas;
-   in

[EGIT] [core/efl] master 01/03: evas/doc: Add warning about post_event_callback_push

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5335352eda4f4e1fe11c0aace94d9e6c1c2e87b9

commit 5335352eda4f4e1fe11c0aace94d9e6c1c2e87b9
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 16:25:50 2017 +0900

evas/doc: Add warning about post_event_callback_push
---
 src/lib/evas/Evas_Legacy.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 2140609..3ed05ab 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -218,6 +218,14 @@ EAPI void *evas_event_callback_del_full(Evas *e, 
Evas_Callback_Type type, Evas_E
  * callback prepares information ready for taking action, but the post callback
  * actually does the action).
  *
+ * This function should only be called from inside an evas input event
+ * callback. The event_info data may be kept up until @p func is called, in
+ * order to check the state of the "on-hold" flag for instance. Do not modify
+ * the canvas or otherwise trigger or feed a events to the canvas from inside
+ * @p func. Use jobs to safely modify the canvas.
+ *
+ * @warning Only use this function if you know exactly what you are doing!
+ *
  */
 EAPI void  evas_post_event_callback_push(Evas *e, Evas_Object_Event_Post_Cb 
func, const void *data);
 

-- 




[EGIT] [core/efl] master 02/03: evas: Ensure post-event cb push is called from an event cb

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e434653fc2a23b1841ebbe243f5169813939b178

commit e434653fc2a23b1841ebbe243f5169813939b178
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 16:26:42 2017 +0900

evas: Ensure post-event cb push is called from an event cb

This rejects calls to evas_post_event_callback_push() that don't
originate from inside an input event callback.
---
 src/lib/evas/canvas/evas_callbacks.c | 28 +---
 src/lib/evas/canvas/evas_main.c  |  1 +
 src/lib/evas/include/evas_private.h  |  1 +
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/src/lib/evas/canvas/evas_callbacks.c 
b/src/lib/evas/canvas/evas_callbacks.c
index 2b4e88e..da5bb48 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -252,6 +252,8 @@ _evas_post_event_callback_free(Evas *eo_e)
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
Evas_Post_Callback *pc;
 
+   if (EINA_LIKELY(!e->post_events)) return;
+
EINA_LIST_FREE(e->post_events, pc)
  {
 EVAS_MEMPOOL_FREE(_mp_pc, pc);
@@ -323,6 +325,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, 
Evas_Object_Protected_Data
/* MEM OK */
const Evas_Button_Flags CLICK_MASK = EVAS_BUTTON_DOUBLE_CLICK | 
EVAS_BUTTON_TRIPLE_CLICK;
Evas_Button_Flags flags = EVAS_BUTTON_NONE;
+   Evas_Callback_Type prev_type;
Evas_Public_Data *e;
 
if (!obj) return;
@@ -364,27 +367,41 @@ evas_object_event_callback_call(Evas_Object *eo_obj, 
Evas_Object_Protected_Data
 efl_event_desc = _legacy_evas_callback_table(type);
  }
 
+   prev_type = e->current_event;
+   e->current_event = type;
+
efl_event_callback_legacy_call(eo_obj, efl_event_desc, event_info);
 
/* multi events with finger 0 - only for eo callbacks */
if (type == EVAS_CALLBACK_MOUSE_DOWN)
  {
 if (_evas_object_callback_has_by_type(obj, EVAS_CALLBACK_MULTI_DOWN))
-  efl_event_callback_call(eo_obj, EFL_EVENT_FINGER_DOWN, event_info);
+  {
+ e->current_event = EVAS_CALLBACK_MULTI_DOWN;
+ efl_event_callback_call(eo_obj, EFL_EVENT_FINGER_DOWN, 
event_info);
+  }
 efl_input_pointer_button_flags_set(event_info, flags);
  }
else if (type == EVAS_CALLBACK_MOUSE_UP)
  {
 if (_evas_object_callback_has_by_type(obj, EVAS_CALLBACK_MULTI_UP))
-  efl_event_callback_call(eo_obj, EFL_EVENT_FINGER_UP, event_info);
+  {
+ e->current_event = EVAS_CALLBACK_MULTI_UP;
+ efl_event_callback_call(eo_obj, EFL_EVENT_FINGER_UP, event_info);
+  }
 efl_input_pointer_button_flags_set(event_info, flags);
  }
else if (type == EVAS_CALLBACK_MOUSE_MOVE)
  {
 if (_evas_object_callback_has_by_type(obj, EVAS_CALLBACK_MULTI_MOVE))
-  efl_event_callback_call(eo_obj, EFL_EVENT_FINGER_MOVE, event_info);
+  {
+ e->current_event = EVAS_CALLBACK_MULTI_MOVE;
+ efl_event_callback_call(eo_obj, EFL_EVENT_FINGER_MOVE, 
event_info);
+  }
  }
 
+   e->current_event = prev_type;
+
 nothing_here:
if (!obj->no_propagate)
  {
@@ -580,6 +597,11 @@ evas_post_event_callback_push(Evas *eo_e, 
Evas_Object_Event_Post_Cb func, const
Evas_Post_Callback *pc;
 
if (!e || e->delete_me) return;
+   if (e->current_event == EVAS_CALLBACK_LAST)
+ {
+ERR("%s() can only be called from an input event callback!", 
__FUNCTION__);
+return;
+ }
EVAS_MEMPOOL_INIT(_mp_pc, "evas_post_callback", Evas_Post_Callback, 64, );
pc = EVAS_MEMPOOL_ALLOC(_mp_pc, Evas_Post_Callback);
if (!pc) return;
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 3a1aa0e..fff28b4 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -214,6 +214,7 @@ _evas_canvas_efl_object_constructor(Eo *eo_obj, 
Evas_Public_Data *e)
e->framespace.w = 0;
e->framespace.h = 0;
e->hinting = EVAS_FONT_HINTING_BYTECODE;
+   e->current_event = EVAS_CALLBACK_LAST;
e->name_hash = eina_hash_string_superfast_new(NULL);
eina_clist_init(&e->calc_list);
eina_clist_init(&e->calc_done);
diff --git a/src/lib/evas/include/evas_private.h 
b/src/lib/evas/include/evas_private.h
index a62852a..ff28339 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -929,6 +929,7 @@ struct _Evas_Public_Data
intlast_mouse_up_counter;
intnochange;
Evas_Font_Hinting_Flags hinting;
+   Evas_Callback_Type current_event;
 
Eina_List *touch_points;
Eina_List *devices;

-- 




[EGIT] [core/efl] master 03/03: evas: Strengthen post-event callbacks

2017-02-16 Thread Jean-Philippe ANDRÉ
jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b184874fa5a0c3177c24a1989d24dcfb650af052

commit b184874fa5a0c3177c24a1989d24dcfb650af052
Author: Jean-Philippe Andre 
Date:   Thu Feb 16 16:47:57 2017 +0900

evas: Strengthen post-event callbacks

See T3144 that I marked as Wontfix.

Bryce in E manually feeds events from a post-event callback
resulting in Evas going insane and leading to frequent crashes.
The ideal solution (for E) would be to ensure that everything works
smoothly, the input event data is valid up until the post-event cb
is called, etc... Unfortunately, with recursive events the exact
order of operations may be messed up: the post-event

I don't want to add yet more complexity to Evas events here (it's
already spaghetti all over the place) so I'm simply blocking any
new event feed when running the post-event callback list.

It's not possible to just freeze the events (I tried, it failed).

**
Some more explanation:

post-event callbacks are used to implement reverse-order logic
where the on-hold flag of an input event may be set by an event
listener that does not come first.

Here's a situation to illustrate: scroller A inside scroller B.

As events are propagated from children to parents (assuming the
propagate flag is set), we'd assume the events to go first to A
and then to B, which means a mouse wheel event would make the
inner-most scroller (A) scroll, and the outer-most scroller (B)
wouldn't budge.

But as things are designed, A and B are not simple evas objects,
and the actual event-catching object is a top-most transparent
rectangle (top-most in Z stack order). Since A is inside B, B's
rectangle BR is over A's rectangle AR, thus catches the wheel
event first. But in terms of UX we still want A to scroll, not B.

The solution then is to reverse the event processing order and
post-event callbacks are the way to do that. This comes with the
consequence that the event_info needs to remain valid until the
post-event is called, and stay the same (so that the on-hold flag
set by A can be read by B).

Recursive events (by explicit feed or modifying the canvas so
that mouse,in or mouse,out are triggered) mess with this logic,
and trigger the post-events too early (event is not fully
processed) or too late (event_info is not valid anymore... and
crash!).

Thanks @raster for explaining the goal of post-event callbacks!
---
 src/lib/evas/canvas/evas_callbacks.c | 10 +-
 src/lib/evas/canvas/evas_events.c| 36 +---
 src/lib/evas/include/evas_private.h  |  1 +
 3 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/src/lib/evas/canvas/evas_callbacks.c 
b/src/lib/evas/canvas/evas_callbacks.c
index da5bb48..42dd851 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -227,12 +227,12 @@ _evas_post_event_callback_call(Evas *eo_e, 
Evas_Public_Data *e)
Evas_Post_Callback *pc;
Eina_List *l, *l_next;
int skip = 0;
-   static int first_run = 1; // FIXME: This is a workaround to prevent this
- // function from being called recursively.
 
-   if (e->delete_me || (!first_run)) return;
+   if (e->delete_me || e->running_post_events) return;
+   if (!e->post_events) return;
+
_evas_walk(e);
-   first_run = 0;
+   e->running_post_events = EINA_TRUE;
EINA_LIST_FOREACH_SAFE(e->post_events, l, l_next, pc)
  {
 e->post_events = eina_list_remove_list(e->post_events, l);
@@ -242,7 +242,7 @@ _evas_post_event_callback_call(Evas *eo_e, Evas_Public_Data 
*e)
   }
 EVAS_MEMPOOL_FREE(_mp_pc, pc);
  }
-   first_run = 1;
+   e->running_post_events = EINA_FALSE;
_evas_unwalk(e);
 }
 
diff --git a/src/lib/evas/canvas/evas_events.c 
b/src/lib/evas/canvas/evas_events.c
index ff20292..69a1586 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -30,6 +30,17 @@ static void
 _canvas_event_feed_mouse_move_legacy(Evas *eo_e, Evas_Public_Data *e, int x, 
int y,
  unsigned int timestamp, const void *data);
 
+static inline Eina_Bool
+_evas_event_feed_allow(Evas_Public_Data *e)
+{
+   if (EINA_LIKELY(!e->running_post_events)) return EINA_TRUE;
+   ERR("Can not feed input events while running post-event callbacks!");
+   return EINA_FALSE;
+}
+
+#define EVAS_EVENT_FEED_SAFETY_CHECK(evas, ...) do { \
+   if (!_evas_event_feed_allow(evas)) return __VA_ARGS__; } while (0)
+
 static void
 _evas_event_havemap_adjust_f(Evas_Object *eo_obj EINA_UNUSED, 
Evas_Object_Protected_Data *obj, Eina_Vector2 *point, Eina_Bool mouse_grabbed)
 {
@@ -1390,6 +1401,7 @@ _canvas_event_feed_mouse_down_internal(Evas_Public_Data 
*e, Efl_Input_Pointer_D

[E-devel] Enlightenment DR 0.21.6 Release

2017-02-16 Thread Simon Lees
CHANGES
https://git.enlightenment.org/core/enlightenment.git/tree/NEWS?h=v0.21.6

TICKETS ADDRESSED
  * https://phab.enlightenment.org/T2452
  * https://phab.enlightenment.org/T2579
  * https://phab.enlightenment.org/T5077

SHA256SUM + DOWNLOAD
63df61b30decf2efa5d60449ab8c79aebc2396ddac20b4d4ce942f6442a1debc
http://download.enlightenment.org/rel/apps/enlightenment/enlightenment-0.21.6.tar.gz

ed0714b54d692cbcec412bdb169e5360355347ce775d27d6ae0cee25111b563d
http://download.enlightenment.org/rel/apps/enlightenment/enlightenment-0.21.6.tar.xz

See the full announcement for more details:
https://www.enlightenment.org/news/e21_6_release

-- 

Simon Lees (Simotek)http://simotek.net

Emergency Update Team   keybase.io/simotek
SUSE Linux   Adelaide Australia, UTC+10:30
GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B



signature.asc
Description: OpenPGP digital signature
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel