Re: [E-devel] [Terminology] Cooperative tiling between Terminology and hosted programs

2023-02-06 Thread Cedric Bail
On Thursday, February 2nd, 2023 at 2:44 PM, Boris Faure  wrote:
> On 23-01-29 05:53, Vinícius dos Santos Oliveira wrote:
> > in my mind, Terminology tries to push the boundaries of what's possible
> > with terminal emulators forward. For instance, it has support for embedding
> > videos and images through custom escape sequences. It obviously expects
> > programs will make use of the new Terminology features.
> > 

> > It just occurred to me that programas could cooperate with Terminology to
> > make their own custom tiling. For instance, Emacs has the eshell mode where
> > Emacs acts as its own terminal emulator taking care of interpreting ANSI
> > escape sequences and tiling the embedded terminal in its own window all by
> > itself.
> > 

> > What if Terminology exposed an env var such as
> > TERMINOLOGY_SOCK=$XDG_RUNTIME_DIR/sock-1234.sock with a path for a UNIX
> > socket so the program (such as Emacs) could open it to cooperate with
> > Terminology? Emacs could open a new pty, spawn the embedded shell, and send
> > a fd to the master end of the new pty back to Terminology. The message
> > should include the position in the screen for the new embedded terminal.
> > Now Terminology would only read from the master end so it can draw the
> > contents of the embedded terminal appropriately in the new tile of the
> > terminal window. Emacs would still get all the input as usual and only send
> > input to the new terminal as it pleases (by writing in the master end of
> > the pty).
> > 

> > So, Terminology already decodes ANSI escape sequences and performs tiling
> > of terminal windows. The idea is to let applications reuse this
> > implementation to allow further embedding other interactive programs in
> > their own windows.
> > 

> > Thoughts?
> 

> That's some interesting thoughts. Terminology already has some custom
> escape codes. I would go that way to have interaction with an external
> program. There's no escape codes to handle the tiling, since those
> could also be used to DDOS terminology, but that's something could be
> thought about.

I like silly idea in my terminal :-) Maybe a first step is to allow running 
application in terminology. It would be possible using Wayland and 
Efl.Canvas.Wl to embedded one application. I wonder if it would be possible to 
have the terminal provide a WL_DISPLAY on a request so we can embedded an 
application?

https://git.enlightenment.org/enlightenment/efl/src/branch/master/src/lib/efl_canvas_wl

Have fun!
  Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] C API => Unified API

2021-06-29 Thread Cedric Bail
On Tuesday, June 29th, 2021 at 12:38 PM, Andreas Volz  
wrote:
> Am 28.06.21 um 22:40 schrieb Cedric Bail:
> > On Monday, June 28th, 2021 at 11:47 AM, Andreas Volz li...@brachttal.net 
> > wrote:
> > > Am 28.06.21 um 17:52 schrieb Cedric Bail:
> > > > On Sunday, June 27th, 2021 at 12:55 PM, Andreas Volz 
> > > > li...@brachttal.net wrote:
[...]
> > > > > For example I use edje_object_part_external_param_*() much in my
> > > > > application. I thought it might be an equivalent in Efl.Ui.Layout_Part
> > > > > but I don't see an obvious function.
[...]
> > > > Yes, I think this would be part of the efl_part API. Which should be 
> > > > something
> > > > like:
> > > >  efl::eo::downcast(layout.part("title")).text_set("hello");

> > > Hm, I'd assume this works for text objects. But with the external API[1]
> > > you could get/set also int/bool data if you know the object supports it
> > > without detail information of what UI type is the object. With the C API
> > > this is possible.
> > 

> > With the efl_part, in the case of an external, you should actually get the 
> > object
> > itself, not some kind of wrapper. You might have to do something like:
> > 

> > Eo *obj = efl_content_get(efl_part(layout, "yourpart"));
> > 

> > I am guessing you will need to do some casting in the C++ API, no idea on
> > that part I haven't played with it in a very long time and don't remember
> > enough.
> 

> I searched my local headers and found a file
> 

> efl_canvas_layout_part_external.eo[1] which defines (nearly) what I
> need. This shows internally the same code as you quoted above. I would
> have found it before but it seems the online docs are not recent. Maybe
> they need to be re-generated?
> 

> https://www.enlightenment.org/develop/api/efl/canvas/layout_part_external/property/content
> => This topic does not exist yet

I don't know how that part was updated before.
 

> But I still don't know how to set a non-text value on a efl_part. This
> were the reasons those tpes have been used in the old API.
> 

> typedef enum _Edje_External_Param_Type
> {
> EDJE_EXTERNAL_PARAM_TYPE_INT,
> EDJE_EXTERNAL_PARAM_TYPE_DOUBLE,
> EDJE_EXTERNAL_PARAM_TYPE_STRING,
> EDJE_EXTERNAL_PARAM_TYPE_BOOL,
> EDJE_EXTERNAL_PARAM_TYPE_CHOICE,
> EDJE_EXTERNAL_PARAM_TYPE_MAX
> } Edje_External_Param_Type;
> 

> With this you could put a e.g. spinner in a Layout and assign a INT
> value and it just works. Without knowing what widget type exactly is used.

The new interface is build around the idea that you have interfaces. Text is an
interface, not an object per say in the example above. For spinner, I believe 
they
expose an Range_Display interface. So for setting the range value, you would do 
something
like the following:
efl::eo::downcast(layout.part("spin")).range_value_set(10);

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Catch "delete,request" signal & shaped window

2021-06-28 Thread Cedric Bail

On Monday, June 28th, 2021 at 1:55 PM, Andreas Volz  wrote:
> Am 28.06.21 um 17:58 schrieb Cedric Bail:
> > On Sunday, June 27th, 2021 at 8:45 AM, Andreas Volz li...@brachttal.net 
> > wrote:
> > 

> > > two questions together after switching to the C++ version of the unified
> > > API.
> > 

> > > How could I receive the "delete,request" signal to catch of a user
> > > clicks the X from the window and do something before quitting. With the
> > > old API I did this somehow with evas_object_smart_callback_call() if I
> > > remember correct.
> > 

> > With the new API, we have an explicit lifecycle definition. I don't remember
> > how it is defined in C++, but in C, we do have a macro EFL_MAIN_EX() which
> > will call the following function:
> > -   efl_main: at startup just before the main loop start
> > -   efl_terminate: when the application is closed
> > -   efl_pause: when the application can reduce is paused (on desktop this is
> > related to being minimized)
> > -   efl_resume: the inverse of pause to get things back to speed
> 

> Yes, I just ask this as I run a very special mainloop in my application.
> I've my own mainloop logic and just start EFL with elm_init() in one of
> my threads. For various reasons I couldn't give main control in my
> application startup logic to EFL.
> 

> With the old API I just catched the window delete request and ended the
> mainloop with elm_shutdown() and elm_exit(). This worked great.
> regards

Oh, I see. In that case, you would have to reimplement the content of 
EFL_MAIN_EX
to match your need. It is only a few lines of code and it should be possible to
tailor it to your need. You can check the content of the macros in 

src/lib/ecore/efl_general.h .

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] C API => Unified API

2021-06-28 Thread Cedric Bail


On Monday, June 28th, 2021 at 11:47 AM, Andreas Volz  
wrote:
> Am 28.06.21 um 17:52 schrieb Cedric Bail:
> > On Sunday, June 27th, 2021 at 12:55 PM, Andreas Volz li...@brachttal.net 
> > wrote:
> > 

> > > I often don't find a Unified API equivalent in the new Unified API.
> > > Sure, the easy and obvious ones no problem. But sometimes the design
> > > seems to be changed a lot. Is there a general advice?
> > 

> > > For example I use edje_object_part_external_param_*() much in my
> > > application. I thought it might be an equivalent in Efl.Ui.Layout_Part
> > > but I don't see an obvious function.
> > 

> > > So any hints in general or this special case?
> > 

> > Yes, I think this would be part of the efl_part API. Which should be 
> > something
> > like:
> > efl::eo::downcastefl::Text(layout.part("title")).text_set("hello");
> > 

> > or in C:
> > efl_text_set(efl_part(layout, "title"), "hello");
> > 

> > The efl_part object returned is an Eo object that can only be used for one 
> > call. If
> > you want to use it for more than that you need to increase its ref 
> > counting. Something
> > 

> > like that:
> > 

> > Eo *part = efl_ref(efl_part(layout, "title"));
> > efl_text_set(part, "hello");
> > ...
> > efl_unref(part);
> 

> Hm, I'd assume this works for text objects. But with the external API[1]
> you could get/set also int/bool data if you know the object supports it
> without detail information of what UI type is the object. With the C API
> this is possible.

With the efl_part, in the case of an external, you should actually get the 
object
itself, not some kind of wrapper. You might have to do something like:
 Eo *obj = efl_content_get(efl_part(layout, "yourpart"));

I am guessing you will need to do some casting in the C++ API, no idea on
that part I haven't played with it in a very long time and don't remember
enough.

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Catch "delete,request" signal & shaped window

2021-06-28 Thread Cedric Bail
Hi,

On Sunday, June 27th, 2021 at 8:45 AM, Andreas Volz  wrote:
> two questions together after switching to the C++ version of the unified
> API.
> 

> How could I receive the "delete,request" signal to catch of a user
> clicks the X from the window and do something before quitting. With the
> old API I did this somehow with evas_object_smart_callback_call() if I
> remember correct.

With the new API, we have an explicit lifecycle definition. I don't remember
how it is defined in C++, but in C, we do have a macro EFL_MAIN_EX() which
will call the following function:
- efl_main: at startup just before the main loop start
- efl_terminate: when the application is closed
- efl_pause: when the application can reduce is paused (on desktop this is
related to being minimized)
- efl_resume: the inverse of pause to get things back to speed
 

> How to I create a shaped window. Before I called elm_win_shaped_set(),
> but now I didn't find a function. Maybe I overlooked it. Is this at the
> end the same as alpha on modern systems?

That I don't know.

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] C API => Unified API

2021-06-28 Thread Cedric Bail
Hi,

On Sunday, June 27th, 2021 at 12:55 PM, Andreas Volz  
wrote:
> I often don't find a Unified API equivalent in the new Unified API.
> Sure, the easy and obvious ones no problem. But sometimes the design
> seems to be changed a lot. Is there a general advice?
> 

> For example I use edje_object_part_external_param_*() much in my
> application. I thought it might be an equivalent in Efl.Ui.Layout_Part
> but I don't see an obvious function.
> 

> So any hints in general or this special case?

Yes, I think this would be part of the efl_part API. Which should be something
like:
 efl::eo::downcast(layout.part("title")).text_set("hello");

or in C:
 efl_text_set(efl_part(layout, "title"), "hello");

The efl_part object returned is an Eo object that can only be used for one 
call. If
you want to use it for more than that you need to increase its ref counting. 
Something
like that:
 Eo *part = efl_ref(efl_part(layout, "title"));
 efl_text_set(part, "hello");
 ...
 efl_unref(part);

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Crash using C++ Layout signal API

2021-06-23 Thread Cedric Bail
On Wednesday, June 23rd, 2021 at 3:53 PM, Andreas Volz  
wrote:
> Am 23.06.21 um 18:02 schrieb Cedric Bail:
> > On Tuesday, June 22nd, 2021 at 11:36 PM, Andreas Volz li...@brachttal.net 
> > wrote:
> > > Hello together,
> > 

> > > after some waiting time I would like to ask here if some other user
> > > could at least verify the same crash with C++ API that I described here:
> > 

> > > https://phab.enlightenment.org/T8943
> > 

> > > If I'm not strongly misusing the API than it's a very basic error. Just
> > > loading an Edje file into a Layout.
> > 

> > I vaguely remember discussion about this issue. I don't think we actually 
> > support function pointer in auto generated code, except for eo callback 
> > mechanism, due to some memory lifecycle uncertainty. And it kind of match 
> > what your bug report says.
> > 

> > > Would be good to know someone else does see the same.
> > > Do you know a workaround to come around this? Maybe use another C++
> > > compatible API / mix with C API to continue work on my application?
> > > regards
> > 

> > I remember that the workaround would be to switch to use the C API instead 
> > of the C++ one as I think we do have a smart pointer trick that allow you 
> > to directly use the C pointer and C function from the C++ object.
> 

> To make it explicit as question. You suggest to not use the C++ API at
> all in my application or just not for this use case?

Not use the C++ API that does take a function as a parameter except for
efl_event.

> Is it a good idea to mix usage of C and C++ API as long as it's not
> fully stable and then adapt later to full C++ usage? Do you know an
> example how to access the C API object?

The C++ API is header only, directly use the C API under it and the
this pointer of a C++ object is actually the Eo* resulting in no
overhead and no ABI in using the C++ binding. It does also means you
can safely go from C to C++ and back. When I played with it last time
you could just pass a C++ Eo object to a C function and the cast
would be done magically. If it isn't done magically anymore, I think
there is a _eo_ref() on the C++ object to get the Eo* pointer.

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Crash using C++ Layout signal API

2021-06-23 Thread Cedric Bail

On Tuesday, June 22nd, 2021 at 11:36 PM, Andreas Volz  
wrote:
> Hello together,
> 

> after some waiting time I would like to ask here if some other user
> could at least verify the same crash with C++ API that I described here:
> 

> https://phab.enlightenment.org/T8943
> 

> If I'm not strongly misusing the API than it's a very basic error. Just
> loading an Edje file into a Layout.

I vaguely remember discussion about this issue. I don't think we actually 
support function pointer in auto generated code, except for eo callback 
mechanism, due to some memory lifecycle uncertainty. And it kind of match what 
your bug report says.
 

> Would be good to know someone else does see the same.
> 

> Do you know a workaround to come around this? Maybe use another C++
> compatible API / mix with C API to continue work on my application?
> regards

I remember that the workaround would be to switch to use the C API instead of 
the C++ one as I think we do have a smart pointer trick that allow you to 
directly use the C pointer and C function from the C++ object.

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [e-users] Flat has landed

2021-03-30 Thread Cedric Bail
On Tuesday, March 30th, 2021 at 3:19 PM, Carsten Haitzler 
 wrote:
> On Tue, 30 Mar 2021 20:26:13 +0000 Cedric Bail ced...@ddlm.me said:
> > On Tuesday, March 30th, 2021 at 12:41 PM, Carsten Haitzler
> > ras...@rasterman.com wrote:
> > > On Tue, 30 Mar 2021 15:38:45 + Cedric Bail ced...@ddlm.me said:
> > > > On Saturday, March 27th, 2021 at 10:10 AM, Carsten Haitzler
> > > > ras...@rasterman.com wrote:
> > 

> > > > > For those who are not watching git commits...
> > > > > Flat theme has landed in git master efl today.
> > > > > Yay!
> > 

> > > > Nice work and slick result! Maybe just one area that got me confused, is
> > > > the wifi strength reported by the connman gadget. Took me a bit of time 
> > > > to
> > > > figure out if the signal was strong or weak. Maybe a tint of blue for 
> > > > strong
> > > > would help.
> > 

> > > the gadget itself or the list of APs in the popup?
> > 

> > The gadget itself. The list is readable, I guess, because you only expect
> > signal level information there.
> 

> the gadget itself doesn't show signal level at all... it never has... :) it 
> has
> actually irritated me for many years... :)

8-o How did I never realize that!?! I guess it required a change in UI and me 
trying to
debug my wifi network the same day to realize it. Dang.

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [e-users] Flat has landed

2021-03-30 Thread Cedric Bail
On Tuesday, March 30th, 2021 at 12:41 PM, Carsten Haitzler 
 wrote:
> On Tue, 30 Mar 2021 15:38:45 +0000 Cedric Bail ced...@ddlm.me said:
> > On Saturday, March 27th, 2021 at 10:10 AM, Carsten Haitzler
> > ras...@rasterman.com wrote:
> > 

> > > For those who are not watching git commits...
> > 

> > > Flat theme has landed in git master efl today.
> > 

> > > Yay!
> > 

> > Nice work and slick result! Maybe just one area that got me confused, is the
> > 

> > wifi strength reported by the connman gadget. Took me a bit of time to 
> > figure
> > 

> > out if the signal was strong or weak. Maybe a tint of blue for strong would
> > 

> > help.
> 

> the gadget itself or the list of APs in the popup?

The gadget itself. The list is readable, I guess, because you only expect 
signal level information there.

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Flat has landed

2021-03-30 Thread Cedric Bail
On Saturday, March 27th, 2021 at 10:10 AM, Carsten Haitzler 
 wrote:
> For those who are not watching git commits...
> 

> Flat theme has landed in git master efl today.
> 

> Yay!

Nice work and slick result! Maybe just one area that got me confused, is the 
wifi strength reported by the connman gadget. Took me a bit of time to figure 
out if the signal was strong or weak. Maybe a tint of blue for strong would 
help.

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Legacy API Vs Unified API

2019-12-04 Thread Cedric Bail
Hi,


On Wednesday, December 4, 2019 8:07 AM, Pablo Muñiz Gadea 
 wrote:
> Open question here: if you have to start a new project/app witch root will
> you take? Is the new API ready for production?

What is out of beta, yes! What is not... not :-) I would recommend starting 
using the new API and use legacy for missing widget. They should integrate and 
work together. The other way around is also possible, but would most likely 
lead to more work as you might be tempted to use legacy first and miss unified 
API.

Cedric

publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Memory leak issue when using signal to loading image in EDJE

2019-11-19 Thread Cedric Bail
Hi Jing,

On Tuesday, November 19, 2019 4:28 AM, Jing  wrote:
> Below are my parts definition in EDC file, i find the memory leak issue when 
> use signal "START_LOADING" and "STOP_LOADING" to start and stop the image 
> loading.
> If there anything wrong ? Please advise, thanks.

How do you detect your memory leak and could you share the memory leak report 
here or in pm?

Best,
  Cedric
 

> collections.group { "fresh_group";
> parts {
> image { "fresh";
> repeat_events: 1;
> desc { "default"
> min: CAPTION_ICON_SIZE CAPTION_ICON_SIZE;
> max: CAPTION_ICON_SIZE CAPTION_ICON_SIZE;
> anchors.vertical_center: "refresh_weather" VERTICAL_CENTER;
> anchors.horizontal_center: "refresh_weather" HORIZONTAL_CENTER;
> image { normal: "refresh_default.png"; }
> }
> desc { "loading1"
> inherit: "default";
> image { normal: "refresh_gif1.png"; }
> }
> desc { "loading2"
> inherit: "default";
> image { normal: "refresh_gif2.png"; }
> }
> desc { "loading3"
> inherit: "default";
> image { normal: "refresh_gif3.png"; }
> }
> desc { "loading4"
> inherit: "default";
> image { normal: "refresh_gif4.png"; }
> }
> desc { "loading5"
> inherit: "default";
> image { normal: "refresh_gif5.png"; }
> }
> desc { "loading6"
> inherit: "default";
> image { normal: "refresh_gif6.png"; }
> }
> desc { "loading7"
> inherit: "default";
> image { normal: "refresh_gif7.png"; }
> }
> desc { "loading8"
> inherit: "default";
> image { normal: "refresh_gif8.png"; }
> }
> }
> }
> programs {
> program {
> name: "start";
> signal: "START_LOADING";
> source: "cardstack";
> action: STATE_SET "default";
> target: "fresh";
> after: "img1";
> }
> program {
> name: "img1";
> action: STATE_SET "loading1";
> target: "fresh";
> transition: LINEAR 0.1;
> in: 0.1 0.0;
> after: "img2";
> }
> program {
> name: "img2";
> action: STATE_SET "loading2";
> target: "fresh";
> transition: LINEAR 0.1;
> in: 0.1 0.0;
> after: "img3";
> }
> program {
> name: "img3";
> action: STATE_SET "loading3";
> target: "fresh";
> transition: LINEAR 0.1;
> in: 0.1 0.0;
> after: "img4";
> }
> program {
> name: "img4";
> action: STATE_SET "loading4";
> target: "fresh";
> transition: LINEAR 0.1;
> in: 0.1 0.0;
> after: "img5";
> }
> program {
> name: "img5";
> action: STATE_SET "loading5";
> target: "fresh";
> transition: LINEAR 0.1;
> in: 0.1 0.0;
> after: "img6";
> }
> program {
> name: "img6";
> action: STATE_SET "loading6";
> target: "fresh";
> transition: LINEAR 0.1;
> in: 0.1 0.0;
> after: "img7";
> }
> program {
> name: "img7";
> action: STATE_SET "loading7";
> target: "fresh";
> transition: LINEAR 0.1;
> in: 0.1 0.0;
> after: "img8";
> }
> program {
> name: "img8";
> action: STATE_SET "loading8";
> target: "fresh";
> transition: LINEAR 0.1;
> in: 0.1 0.0;
> after: "img1";
> }
> program {
> name: "stop";
> signal: "STOP_LOADING";
> source: "cardstack";
> sequence {
> action: ACTION_STOP;
> target: "start";
> target: "img1";
> target: "img2";
> target: "img3";
> target: "img4";
> target: "img5";
> target: "img6";
> target: "img7";
> target: "img8";
> action: STATE_SET "default";
> target: "fresh";
> }
> }
> }
> }
> 

> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel



publickey - cedric@ddlm.me - 0x1869A77F.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] master 01/01: eldbus: only free the data when the future is resolved or rejected.

2019-11-18 Thread Cedric BAIL
stefan pushed a commit to branch master.

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

commit 3f3b7259453a4519e40e90b15962331158928ac4
Author: Cedric BAIL 
Date:   Fri Nov 15 09:39:38 2019 -0800

eldbus: only free the data when the future is resolved or rejected.

Reviewed-by: Stefan Schmidt 
Differential Revision: https://phab.enlightenment.org/D10684
---
 src/lib/eldbus/eldbus_model_proxy.c | 20 
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/lib/eldbus/eldbus_model_proxy.c 
b/src/lib/eldbus/eldbus_model_proxy.c
index bf1f8fb931..d0cbcb52af 100644
--- a/src/lib/eldbus/eldbus_model_proxy.c
+++ b/src/lib/eldbus/eldbus_model_proxy.c
@@ -39,8 +39,6 @@ struct _Eldbus_Property_Promise
   Eina_Stringshare *property;
 };
 
-static void 
_eldbus_model_proxy_property_set_data_free(Eldbus_Model_Proxy_Property_Set_Data 
*);
-
 static Eina_Bool
 _eldbus_model_proxy_load(Eldbus_Model_Proxy_Data *pd)
 {
@@ -236,6 +234,9 @@ _eldbus_model_proxy_cancel_cb(Efl_Loop_Consumer *consumer 
EINA_UNUSED,
Eldbus_Model_Proxy_Property_Set_Data *sd = data;
 
sd->promise = NULL;
+   eina_stringshare_del(sd->property);
+   eina_value_free(sd->value);
+   free(sd);
 }
 
 static Eldbus_Pending *
@@ -655,7 +656,6 @@ _eldbus_model_proxy_property_set_load_cb(void *data,
if (!signature || !properties)
  {
 eina_promise_reject(set_data->promise, EFL_MODEL_ERROR_UNKNOWN);
-_eldbus_model_proxy_property_set_data_free(set_data);
 goto end;
  }
 
@@ -688,7 +688,7 @@ _eldbus_model_proxy_property_set_cb(void *data,
  {
  ERR("%s: %s", error_name, error_text);
  eina_promise_reject(sd->promise, EFL_MODEL_ERROR_UNKNOWN);
- goto end;
+ return;
  }
 
value = eina_hash_find(pd->properties, sd->property);
@@ -705,9 +705,6 @@ _eldbus_model_proxy_property_set_cb(void *data,
   eina_promise_reject(sd->promise,
   EFL_MODEL_ERROR_NOT_FOUND);
  }
-
- end:
-   _eldbus_model_proxy_property_set_data_free(sd);
 }
 
 static const char *
@@ -726,13 +723,4 @@ 
_eldbus_model_proxy_property_type_get(Eldbus_Model_Proxy_Data *pd,
return property_introspection->type;
 }
 
-static void
-_eldbus_model_proxy_property_set_data_free(Eldbus_Model_Proxy_Property_Set_Data
 *data)
-{
-   EINA_SAFETY_ON_NULL_RETURN(data);
-   eina_stringshare_del(data->property);
-   eina_value_free(data->value);
-   free(data);
-}
-
 #include "eldbus_model_proxy.eo.c"

-- 




[EGIT] [core/efl] master 01/03: eo: refactor shortcut for EFL_EVENT_DESTRUCT event.

2019-11-17 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit c355616043c40b14cf613c5e5cce2e674177b34d
Author: Cedric BAIL 
Date:   Wed Nov 13 15:01:00 2019 -0800

eo: refactor shortcut for EFL_EVENT_DESTRUCT event.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10658
---
 src/lib/eo/eo_base_class.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 8d147d3152..d10bf287bd 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -72,7 +72,7 @@ struct _Efl_Object_Data
EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_NOREF);
 
EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_INVALIDATE);
-   Eina_Bool  has_destroyed_event_cb : 1; // No proper count: 
minor optimization triggered at destruction only
+   EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_DESTRUCT); // No proper count: minor 
optimization triggered at destruction only
Eina_Bool  callback_stopped : 1;
Eina_Bool  need_cleaning : 1;
 
@@ -1269,6 +1269,7 @@ _special_event_count_inc(Eo *obj_id, Efl_Object_Data *pd, 
const Efl_Callback_Arr
else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_CALLBACK_DEL)
else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_DEL)
else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_INVALIDATE)
+   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_DESTRUCT)
else if (it->desc == EFL_EVENT_NOREF && !pd->event_cb_EFL_EVENT_NOREF)
  {
 if (efl_event_callback_count(obj_id, EFL_EVENT_NOREF) > 0)
@@ -1280,8 +1281,6 @@ _special_event_count_inc(Eo *obj_id, Efl_Object_Data *pd, 
const Efl_Callback_Arr
  pd->event_cb_EFL_EVENT_NOREF = EINA_TRUE;
   }
  }
-   else if (it->desc == EFL_EVENT_DESTRUCT)
- pd->has_destroyed_event_cb = EINA_TRUE;
else if (it->desc == EFL_EVENT_OWNERSHIP_SHARED || it->desc == 
EFL_EVENT_OWNERSHIP_UNIQUE)
  {
 EO_OBJ_POINTER_RETURN(obj_id, obj);
@@ -1353,7 +1352,7 @@ _eo_callback_remove_all(Efl_Object_Data *pd)
eina_freeq_ptr_main_add(pd->callbacks, free, 0);
pd->callbacks = NULL;
pd->callbacks_count = 0;
-   pd->has_destroyed_event_cb = EINA_FALSE;
+   pd->event_cb_EFL_EVENT_DESTRUCT = EINA_FALSE;
pd->event_cb_EFL_EVENT_CALLBACK_ADD = EINA_FALSE;
pd->event_cb_EFL_EVENT_CALLBACK_DEL = EINA_FALSE;
pd->event_cb_EFL_EVENT_DEL = EINA_FALSE;
@@ -2005,6 +2004,7 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_DEL)
else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_INVALIDATE)
else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_NOREF)
+   else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_DESTRUCT)
 
if (!legacy_compare)
  {
@@ -2585,7 +2585,7 @@ err_parent_back:
// this isn't 100% correct, as the object is still "slightly" alive at this
// point (so efl_destructed_is() returns false), but triggering the
// "destruct" event here is the simplest, safest solution.
-   if (EINA_UNLIKELY(pd->has_destroyed_event_cb))
+   if (EINA_UNLIKELY(pd->event_cb_EFL_EVENT_DESTRUCT))
  _event_callback_call(obj, pd, EFL_EVENT_DESTRUCT, NULL, EINA_FALSE);
 
// remove generic data after this final event, in case they are used in a cb

-- 




[EGIT] [core/efl] master 02/03: eo: no need to oversize type.

2019-11-17 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 6d20f32cef837d494210e6012cc9ef678b555b7b
Author: Cedric BAIL 
Date:   Wed Nov 13 15:02:51 2019 -0800

eo: no need to oversize type.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10659
---
 src/lib/eo/eo_base_class.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index d10bf287bd..f475f5e22e 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -1259,7 +1259,7 @@ _pointer_hash(const uintptr_t val)
 static inline void
 _special_event_count_inc(Eo *obj_id, Efl_Object_Data *pd, const 
Efl_Callback_Array_Item *it)
 {
-   int event_hash;
+   unsigned char event_hash;
 
event_hash = _pointer_hash((uintptr_t) it->desc);
 
@@ -1996,7 +1996,7 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
   .inserted_before = 0,
   .generation = 1,
};
-   int event_hash;
+   unsigned char event_hash;
 
if (pd->callbacks_count == 0) return EINA_TRUE;
else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_ADD)

-- 




[EGIT] [core/efl] master 03/03: eo: do not over compute the hash when propagating events.

2019-11-17 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 75301b3a1abfebb94249efb6cb01426d763b6099
Author: Cedric BAIL 
Date:   Wed Nov 13 16:01:55 2019 -0800

eo: do not over compute the hash when propagating events.

This should slightly improve speed in theory. In practice, I have not seen
a benchmark which would budge by 5%, so I am not sure it improve speed that
much.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10660
---
 src/lib/eo/eo_base_class.c | 62 --
 1 file changed, 38 insertions(+), 24 deletions(-)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index f475f5e22e..382beaa8d8 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -1243,10 +1243,11 @@ _pointer_hash(const uintptr_t val)
 #endif
 }
 
-#define EFL_OBJECT_EVENT_CB_INC(Obj, It, Pd, Event) \
-  if (It->desc == Event && !Pd->event_cb_##Event)   \
-{   \
-   Pd->event_cb_##Event = EINA_TRUE;\
+#define EFL_OBJECT_EVENT_CB_INC(Obj, It, Pd, Event, Update_Hash)\
+  if (It->desc == Event && !Pd->event_cb_##Event)   \
+{   \
+   Update_Hash = EINA_FALSE;\
+   Pd->event_cb_##Event = EINA_TRUE;\
 }
 
 #define EFL_OBJECT_EVENT_CB_DEC(Obj, It, Pd, Event) \
@@ -1259,19 +1260,17 @@ _pointer_hash(const uintptr_t val)
 static inline void
 _special_event_count_inc(Eo *obj_id, Efl_Object_Data *pd, const 
Efl_Callback_Array_Item *it)
 {
-   unsigned char event_hash;
-
-   event_hash = _pointer_hash((uintptr_t) it->desc);
-
-   pd->callbacks_mask |= 1ULL << event_hash;
+   Eina_Bool update_hash = EINA_TRUE;
 
-   EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_CALLBACK_ADD)
-   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_CALLBACK_DEL)
-   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_DEL)
-   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_INVALIDATE)
-   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_DESTRUCT)
+   EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_CALLBACK_ADD, update_hash)
+   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_CALLBACK_DEL, 
update_hash)
+   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_DEL, update_hash)
+   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_INVALIDATE, 
update_hash)
+   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_DESTRUCT, 
update_hash)
else if (it->desc == EFL_EVENT_NOREF && !pd->event_cb_EFL_EVENT_NOREF)
  {
+update_hash = EINA_FALSE;
+
 if (efl_event_callback_count(obj_id, EFL_EVENT_NOREF) > 0)
   {
  EO_OBJ_POINTER_RETURN(obj_id, obj);
@@ -1287,6 +1286,15 @@ _special_event_count_inc(Eo *obj_id, Efl_Object_Data 
*pd, const Efl_Callback_Arr
 obj->ownership_track = EINA_TRUE;
 EO_OBJ_DONE(obj_id);
  }
+
+   if (update_hash)
+ {
+unsigned char event_hash;
+
+event_hash = _pointer_hash((uintptr_t) it->desc);
+
+pd->callbacks_mask |= 1ULL << event_hash;
+ }
 }
 
 static inline void
@@ -1976,8 +1984,12 @@ _cb_desc_match(const Efl_Event_Description *a, const 
Efl_Event_Description *b, E
return !strcmp(a->name, b->name);
 }
 
-#define EFL_OBJECT_EVENT_CALLBACK_BLOCK(Pd, Desc, Event)\
-  if ((Desc == Event) && (!(Pd->event_cb_##Event))) return EINA_TRUE;
+#define EFL_OBJECT_EVENT_CALLBACK_BLOCK(Pd, Desc, Event, Need_Hash) \
+  if (Desc == Event)\
+{   \
+   if (!(Pd->event_cb_##Event)) return EINA_TRUE;   \
+   Need_Hash = EINA_FALSE;  \
+}   \
 
 static inline Eina_Bool
 _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
@@ -1996,18 +2008,20 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
   .inserted_before = 0,
   .generation = 1,
};
-   unsigned char event_hash;
+   Eina_Bool need_hash = EINA_TRUE;
 
if (pd->callbacks_count == 0) return EINA_TRUE;
-   else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_ADD)
-   else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_DEL)
-   else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_DEL)
-   else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_INVALIDATE)
-   else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_NOREF)
-   else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd

[EGIT] [core/efl] master 01/07: ecore: properly handle children destruction in Efl.BooleanModel.

2019-11-13 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 560db3957792b0dc5ca90076e88cab09b4cb877b
Author: Cedric BAIL 
Date:   Thu Nov 7 16:08:30 2019 -0800

ecore: properly handle children destruction in Efl.BooleanModel.

The children removal event is happening on the parent model, so access
values directly.

T8358

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10623
---
 src/lib/ecore/efl_boolean_model.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/ecore/efl_boolean_model.c 
b/src/lib/ecore/efl_boolean_model.c
index 3eaad886ef..5ac0dcaab5 100644
--- a/src/lib/ecore/efl_boolean_model.c
+++ b/src/lib/ecore/efl_boolean_model.c
@@ -258,11 +258,11 @@ _child_removed(void *data, const Efl_Event *event)
Eina_Iterator *it;
Eina_Array updated;
 
-   if (!pd->parent) return;
+   if (!pd->values) return;
 
eina_array_step_set(, sizeof (Eina_Array), 8);
 
-   it = eina_hash_iterator_data_new(pd->parent->values);
+   it = eina_hash_iterator_data_new(pd->values);
EINA_ITERATOR_FOREACH(it, v)
  {
 Efl_Boolean_Model_Storage_Range *lookup;
@@ -276,7 +276,7 @@ _child_removed(void *data, const Efl_Event *event)
   {
  unsigned char lower_mask = (((unsigned char)1) << (ev->index & 
0x7)) - 1;
  unsigned char upper_mask = (~(((unsigned char)1) << (ev->index & 
0x7))) & (~lower_mask);
- unsigned char offset = (ev->index - lookup->offset) >> 3;
+ uint16_t offset = (ev->index - lookup->offset) >> 3;
  uint16_t byte_length = lookup->length >> 3;
 
  // Manually shift all the byte in the buffer

-- 




[EGIT] [core/efl] master 07/07: efl: improve Efl.BooleanModel test by checking the child del case.

2019-11-13 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 6befb6e17bf4afb3c5b650be3b5238029253bce6
Author: Cedric BAIL 
Date:   Fri Nov 8 12:14:15 2019 -0800

efl: improve Efl.BooleanModel test by checking the child del case.

This has detected the bug that previous commit fix.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10634
---
 src/tests/efl/efl_test_composite_model.c | 126 ++-
 1 file changed, 109 insertions(+), 17 deletions(-)

diff --git a/src/tests/efl/efl_test_composite_model.c 
b/src/tests/efl/efl_test_composite_model.c
index abae4c3666..8d05b6d447 100644
--- a/src/tests/efl/efl_test_composite_model.c
+++ b/src/tests/efl/efl_test_composite_model.c
@@ -25,18 +25,26 @@
 #include 
 #include 
 
-static const int child_number = 3;
-static const int base_ints[] = { 41, 42, 43 };
+static const int child_number = 7;
+static const int base_ints[] = { 41, 42, 43, 44, 45, 46, 47 };
+
+static void
+_cleanup(Eo *o EINA_UNUSED, void *data EINA_UNUSED, const Eina_Future 
*dead_future EINA_UNUSED)
+{
+   ecore_main_loop_quit();
+}
 
 static Eina_Value
-_children_slice_get_then(void *data EINA_UNUSED,
- const Eina_Value v,
- const Eina_Future *dead_future EINA_UNUSED)
+_children_slice_get_then(Eo *o EINA_UNUSED,
+ void *data EINA_UNUSED,
+ const Eina_Value v)
 {
unsigned int i, len;
Efl_Model *child;
+   Eina_Future **all;
 
-   fail_if(eina_value_type_get() != EINA_VALUE_TYPE_ARRAY);
+   all = calloc(1, sizeof (Eina_Future *) * (eina_value_array_count() + 1));
+   if (!all) return eina_value_error_init(ENOMEM);
 
EINA_VALUE_ARRAY_FOREACH(, len, i, child)
  {
@@ -55,6 +63,8 @@ _children_slice_get_then(void *data EINA_UNUSED,
 fail_if(!eina_value_bool_get(p_true, _true));
 fail_if(!eina_value_bool_get(p_false, _false));
 
+all[i] = efl_model_property_set(child, "test_odd_even", v_int & 0x1 ? 
p_true : p_false);
+
 fail_if(v_int != base_ints[i]);
 fail_if(v_true != EINA_TRUE);
 fail_if(v_false != EINA_FALSE);
@@ -63,12 +73,87 @@ _children_slice_get_then(void *data EINA_UNUSED,
 eina_value_free(p_true);
 eina_value_free(p_false);
  }
+   all[i] = EINA_FUTURE_SENTINEL;
 
-   ecore_main_loop_quit();
+   return eina_future_as_value(eina_future_all_array(all));
+}
+
+static Eina_Value
+_children_odd_even_ready(Eo *model, void *data EINA_UNUSED, const Eina_Value v 
EINA_UNUSED)
+{
+   return eina_future_as_value(efl_model_children_slice_get(model, 0, 
child_number));
+}
+
+static Eina_Value
+_children_odd_even_check(Eo *model, void *data EINA_UNUSED, const Eina_Value v)
+{
+   unsigned int i, len;
+   Efl_Model *child, *first_child = NULL;
+
+   EINA_VALUE_ARRAY_FOREACH(, len, i, child)
+ {
+Eina_Value *p_odd_even = NULL;
+Eina_Value *p_int = NULL;
+Eina_Bool v_odd_even = EINA_TRUE;
+int v_int = -1;
+
+if (!first_child) first_child = child;
+
+p_int = efl_model_property_get(child, "test_p_int");
+p_odd_even = efl_model_property_get(child, "test_odd_even");
+
+fail_if(!eina_value_bool_get(p_odd_even, _odd_even));
+fail_if(!eina_value_int_get(p_int, _int));
+
+fail_if(v_int & 0x1 ? !v_odd_even : v_odd_even);
+
+eina_value_free(p_int);
+eina_value_free(p_odd_even);
+ }
+
+   efl_model_child_del(model, first_child);
+
+   return eina_future_as_value(efl_model_children_slice_get(model, 0, 
child_number - 1));
+}
+
+static Eina_Value
+_children_odd_even_check_after_removal(Eo *model EINA_UNUSED, void *data 
EINA_UNUSED,
+   const Eina_Value v)
+{
+   unsigned int i, len;
+   Efl_Model *child;
+
+   EINA_VALUE_ARRAY_FOREACH(, len, i, child)
+ {
+Eina_Value *p_odd_even = NULL;
+Eina_Value *p_int = NULL;
+Eina_Bool v_odd_even = EINA_TRUE;
+int v_int = -1;
+
+p_int = efl_model_property_get(child, "test_p_int");
+p_odd_even = efl_model_property_get(child, "test_odd_even");
+
+fail_if(!eina_value_bool_get(p_odd_even, _odd_even));
+fail_if(!eina_value_int_get(p_int, _int));
+
+fail_if(v_int & 0x1 ? !v_odd_even : v_odd_even);
+fail_if(v_int != base_ints[i + 1]);
+
+eina_value_free(p_int);
+eina_value_free(p_odd_even);
+ }
 
return v;
 }
 
+static Eina_Value
+_assert_on_error(Eo *o EINA_UNUSED, void *data EINA_UNUSED, Eina_Error error)
+{
+   ck_abort_msg("Assert on error triggered duing Boolean Model test with error 
'%s'.\n",
+eina_error_msg_get(error));
+   return eina_value_error_init(error);
+}
+
 EFL_START_TEST(efl_test_boolea

[EGIT] [core/efl] master 03/07: elementary: fix initialization order and memory leak when setting model on Efl.Ui.CollectionView.

2019-11-13 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 6cec0df499f16f452ceeba270384cb476a5f3ce8
Author: Cedric BAIL 
Date:   Thu Nov 7 16:17:06 2019 -0800

elementary: fix initialization order and memory leak when setting model on 
Efl.Ui.CollectionView.

This patch use volatile model to make sure that a model is properly cleaned 
once it is not
used anymore.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10625
---
 src/lib/elementary/efl_ui_collection_view.c | 53 ++---
 1 file changed, 26 insertions(+), 27 deletions(-)

diff --git a/src/lib/elementary/efl_ui_collection_view.c 
b/src/lib/elementary/efl_ui_collection_view.c
index 8d8b215f89..e3d4c96ff0 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -1874,7 +1874,9 @@ static void
 _efl_ui_collection_view_model_changed(void *data, const Efl_Event *event)
 {
Efl_Model_Changed_Event *ev = event->info;
+#ifdef VIEWPORT_ENABLE
Eina_List *requests = NULL;
+#endif
MY_DATA_GET(data, pd);
Eina_Iterator *it;
const char *property;
@@ -1883,22 +1885,21 @@ _efl_ui_collection_view_model_changed(void *data, const 
Efl_Event *event)
Efl_Model *mselect = NULL;
Eina_Bool selection = EINA_FALSE, sizing = EINA_FALSE;
 
-   // Cleanup all object, pending request and refetch everything
+   // Cleanup all object, pending request to prepare refetching everything
_all_cleanup(data, pd);
-
if (pd->model) efl_event_callback_array_del(pd->model, model_cbs(), data);
-   efl_replace(>model, NULL);
+   if (pd->multi_selectable_async_model)
+ {
+efl_event_callback_forwarder_del(pd->multi_selectable_async_model,
+ 
EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED,
+ data);
+efl_composite_detach(data, pd->multi_selectable_async_model);
+ }
 
if (!ev->current)
  {
-if (pd->multi_selectable_async_model)
-  {
- efl_event_callback_forwarder_del(pd->multi_selectable_async_model,
-  
EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED,
-  data);
- efl_composite_detach(data, pd->multi_selectable_async_model);
- efl_replace(>multi_selectable_async_model, NULL);
-  }
+efl_replace(>model, NULL);
+efl_replace(>multi_selectable_async_model, NULL);
 return ;
  }
 
@@ -1937,15 +1938,9 @@ _efl_ui_collection_view_model_changed(void *data, const 
Efl_Event *event)
// Build and connect the selection model properly
if (!mselect)
  {
-mselect = model = efl_add(EFL_UI_SELECT_MODEL_CLASS, data,
-  efl_ui_view_model_set(efl_added, model));
- }
-   if (pd->multi_selectable_async_model)
- {
-efl_event_callback_forwarder_del(pd->multi_selectable_async_model,
- 
EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED,
- data);
-efl_composite_detach(data, pd->multi_selectable_async_model);
+mselect = model = efl_add_ref(EFL_UI_SELECT_MODEL_CLASS, data,
+  efl_ui_view_model_set(efl_added, model),
+  efl_loop_model_volatile_make(efl_added));
  }
efl_replace(>multi_selectable_async_model, mselect);
efl_composite_attach(data, pd->multi_selectable_async_model);
@@ -1953,8 +1948,15 @@ _efl_ui_collection_view_model_changed(void *data, const 
Efl_Event *event)
 EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED,
 data);
 
-   if (!sizing) model = efl_add(EFL_UI_HOMOGENEOUS_MODEL_CLASS, data,
-efl_ui_view_model_set(efl_added, model));
+   if (!sizing) model = efl_add_ref(EFL_UI_HOMOGENEOUS_MODEL_CLASS, data,
+efl_ui_view_model_set(efl_added, model),
+efl_loop_model_volatile_make(efl_added));
+
+   efl_replace(>model, model);
+   efl_event_callback_array_add(pd->model, model_cbs(), data);
+
+   if (mselect) efl_unref(mselect);
+   if (!sizing) efl_unref(model);
 
count = efl_model_children_count_get(model);
 
@@ -1976,13 +1978,9 @@ _efl_ui_collection_view_model_changed(void *data, const 
Efl_Event *event)
 
 requests = eina_list_append(requests, request);
  }
-#endif
requests = _batch_request_flush(requests, data, pd);
+#endif
 
-   pd->model = model;
-   efl_event_callback_array_add(pd->model, model_cbs(), data);
-
-   efl_ui_position_manager_entity_item_size_changed(pd->manager, 0, coun

[EGIT] [core/efl] master 05/07: ecore: correctly apply the offset on the upper part of the boolean mask for Efl.BooleanModel.

2019-11-13 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit d505167d68e716c9833e70ae4a1ddf57a9bdbab2
Author: Cedric BAIL 
Date:   Fri Nov 8 12:12:30 2019 -0800

ecore: correctly apply the offset on the upper part of the boolean mask for 
Efl.BooleanModel.

The upper mask is the one that should actually move as the gap is between 
the lower and
the upper mask when removing an element from the array.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10632
---
 src/lib/ecore/efl_boolean_model.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore/efl_boolean_model.c 
b/src/lib/ecore/efl_boolean_model.c
index 5ac0dcaab5..552baf1096 100644
--- a/src/lib/ecore/efl_boolean_model.c
+++ b/src/lib/ecore/efl_boolean_model.c
@@ -282,8 +282,8 @@ _child_removed(void *data, const Efl_Event *event)
  // Manually shift all the byte in the buffer
  while (offset < byte_length)
{
-  lookup->buffer[offset] = (lookup->buffer[offset] & 
upper_mask) |
-((lookup->buffer[offset] & lower_mask) << 1);
+  lookup->buffer[offset] = ((lookup->buffer[offset] & 
upper_mask) >> 1) |
+(lookup->buffer[offset] & lower_mask);
   if (offset + 1 < byte_length)
 lookup->buffer[offset] |= lookup->buffer[offset + 1] & 0x1;
 

-- 




[EGIT] [core/efl] master 02/07: elementary: fix recursive case during model fetch in Efl.Ui.CollectionView.

2019-11-13 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit f71a109e70b7a952cbac204d78f4142350083892
Author: Cedric BAIL 
Date:   Thu Nov 7 16:14:44 2019 -0800

elementary: fix recursive case during model fetch in Efl.Ui.CollectionView.

Figuring out why model fetch was sometime not working recursively allow to
reduce the amount of request that need to be made. In this case, notifying
the position manager or lack of notification was triggering a case where the
item would not show up (Joice of nested asynchronous behavior).

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10624
---
 src/lib/elementary/efl_ui_collection_view.c | 43 ++---
 1 file changed, 21 insertions(+), 22 deletions(-)

diff --git a/src/lib/elementary/efl_ui_collection_view.c 
b/src/lib/elementary/efl_ui_collection_view.c
index 16680e8d47..8d8b215f89 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -57,8 +57,7 @@ struct _Efl_Ui_Collection_Request
uint64_t offset;
uint64_t length;
 
-   Eina_Bool model_requested : 1;
-   Eina_Bool model_fetched : 1;
+   Eina_Bool need_size : 1;
Eina_Bool need_entity : 1;
Eina_Bool entity_requested : 1;
 };
@@ -352,6 +351,7 @@ _request_add(Eina_List *requests, Efl_Ui_Collection_Request 
**request,
if ((*request)->offset + (*request)->length == index)
  {
 if (need_entity) (*request)->need_entity = EINA_TRUE;
+if (!need_entity) (*request)->need_size = EINA_TRUE;
 (*request)->length += 1;
 return requests;
  }
@@ -364,8 +364,8 @@ _request_add(Eina_List *requests, Efl_Ui_Collection_Request 
**request,
(*request)->offset = index;
(*request)->length = 1;
// At this point, we rely on the model caching ability to avoid recreating 
model
-   (*request)->model_requested = EINA_TRUE;
(*request)->need_entity = !!need_entity;
+   (*request)->need_size = EINA_TRUE;
 
return requests;
 }
@@ -379,7 +379,6 @@ _model_fetched_cb(Eo *obj, void *data, const Eina_Value v)
unsigned int i, len;
Eina_Bool request_entity = EINA_FALSE;
 
-   request->model_fetched = EINA_TRUE;
EINA_VALUE_ARRAY_FOREACH(, len, i, child)
  {
 Efl_Ui_Collection_Item_Lookup *insert;
@@ -435,11 +434,17 @@ _model_fetched_cb(Eo *obj, void *data, const Eina_Value v)
  }
 
if (request_entity)
- request->need_entity = EINA_TRUE;
+ {
+request->need_entity = EINA_TRUE;
 
-   if (request->need_entity &&
-   !request->entity_requested)
- _entity_request(obj, request);
+if (!request->entity_requested)
+  _entity_request(obj, request);
+ }
+   else if (request->need_size)
+ {
+efl_ui_position_manager_entity_item_size_changed(pd->manager, 
request->offset,
+ request->offset + 
len);
+ }
 
return v;
 }
@@ -624,7 +629,7 @@ _entity_fetched_cb(Eo *obj, void *data, const Eina_Value v)
 
// Currently position manager will flush its entire size cache on update, 
so only do
// it when necessary to improve performance.
-   if (updated_size)
+   if (updated_size || request->need_size)
  {
 efl_ui_position_manager_entity_item_size_changed(pd->manager,
  updated_size_start_id,
@@ -748,7 +753,6 @@ static Eina_Bool
 _entity_request(Efl_Ui_Collection_View *obj, Efl_Ui_Collection_Request 
*request)
 {
if (request->entity_requested) return EINA_TRUE;
-   if (request->model_fetched) return EINA_FALSE;
request->f = efl_future_then(obj, request->f,
 .success_type = EINA_VALUE_TYPE_ARRAY,
 .success = _entity_fetch_cb);
@@ -768,6 +772,7 @@ _entity_inflight_request(Efl_Ui_Collection_View *obj,
  Efl_Ui_Collection_Request *request,
  Efl_Ui_Collection_Request *inflight)
 {
+   inflight->need_size |= request->need_size;
if (request->need_entity == EINA_FALSE) return EINA_TRUE;
 
return _entity_request(obj, inflight);
@@ -825,8 +830,8 @@ _batch_request_flush(Eina_List *requests,
 
   rn->offset = iend;
   rn->length = rend - iend;
-  rn->model_requested = request->model_requested;
   rn->need_entity = request->need_entity;
+  rn->need_size = request->need_size;
 
   requests = eina_list_append(requests, rn);
 
@@ -877,12 +882,6 @@ _batch_request_flush(Eina_List *requests,
 
 // We now have a request, time to trigger a fetch
 // We assume here that we are always fetching the model 
(mode

[EGIT] [core/efl] master 04/07: ecore: remove the composited children from the source of an Efl.CompositeModel.

2019-11-13 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 652533e27d718366087792154e597a10ca9b54bb
Author: Cedric BAIL 
Date:   Fri Nov 8 12:10:50 2019 -0800

ecore: remove the composited children from the source of an 
Efl.CompositeModel.

The composite model was erroneously giving the reference to a children 
composited model
instead of the origianl children which made it impossible for the 
composited model
to delete the right child.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10631
---
 src/lib/ecore/efl_composite_model.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/ecore/efl_composite_model.c 
b/src/lib/ecore/efl_composite_model.c
index b3896bc99e..ad0c62b7e4 100644
--- a/src/lib/ecore/efl_composite_model.c
+++ b/src/lib/ecore/efl_composite_model.c
@@ -481,7 +481,7 @@ _efl_composite_model_efl_model_child_del(Eo *obj 
EINA_UNUSED,
  Efl_Composite_Model_Data *pd,
  Efl_Object *child)
 {
-   efl_model_child_del(pd->source, child);
+   efl_model_child_del(pd->source, efl_ui_view_model_get(child));
 }
 
 static void

-- 




[EGIT] [core/efl] master 06/07: efl: remove useless printf from Efl Container Model tests.

2019-11-13 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 06873a6fdb7a31679a14aefdba45db49f360d68a
Author: Cedric BAIL 
Date:   Fri Nov 8 12:13:53 2019 -0800

efl: remove useless printf from Efl Container Model tests.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10633
---
 src/tests/efl/efl_test_container_model.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/tests/efl/efl_test_container_model.c 
b/src/tests/efl/efl_test_container_model.c
index e311ea20aa..35dfed77f3 100644
--- a/src/tests/efl/efl_test_container_model.c
+++ b/src/tests/efl/efl_test_container_model.c
@@ -63,7 +63,6 @@ _children_slice_future_then(void *data EINA_UNUSED,
   abort();
}
  }
-   fprintf(stderr, "len: %i\n", len);
 
fail_if(len != 7);
 

-- 




[EGIT] [core/efl] master 02/05: elementary: properly handle in flight request in Efl.Ui.CollectionView.

2019-11-07 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 65955b7a9f84275c9ff799ef84cda6500c225bb1
Author: Cedric BAIL 
Date:   Wed Nov 6 15:09:14 2019 -0800

elementary: properly handle in flight request in Efl.Ui.CollectionView.

This fix adding item not always showing up in the CollectionView right away.
The main issue comes down to the fact we can not chain a new request when 
one
is already resolved partially. The code now make sure to properly do this.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10614
---
 src/lib/elementary/efl_ui_collection_view.c | 48 ++---
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/src/lib/elementary/efl_ui_collection_view.c 
b/src/lib/elementary/efl_ui_collection_view.c
index 3b7b8132ee..c08ae16dba 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -109,7 +109,7 @@ static const char *COLLECTION_VIEW_MANAGED_YES = "yes";
 #define MY_DATA_GET(obj, pd)\
   Efl_Ui_Collection_View_Data *pd = efl_data_scope_get(obj, MY_CLASS);
 
-static void _entity_request(Efl_Ui_Collection_View *obj, 
Efl_Ui_Collection_Request *request);
+static Eina_Bool _entity_request(Efl_Ui_Collection_View *obj, 
Efl_Ui_Collection_Request *request);
 static void _idle_cb(void *data, const Efl_Event *event);
 
 static int
@@ -435,10 +435,11 @@ _model_fetched_cb(Eo *obj, void *data, const Eina_Value v)
  }
 
if (request_entity)
- {
-request->need_entity = EINA_TRUE;
-_entity_request(obj, request);
- }
+ request->need_entity = EINA_TRUE;
+
+   if (request->need_entity &&
+   !request->entity_requested)
+ _entity_request(obj, request);
 
return v;
 }
@@ -449,12 +450,7 @@ _model_free_cb(Eo *o, void *data, const Eina_Future 
*dead_future EINA_UNUSED)
MY_DATA_GET(o, pd);
Efl_Ui_Collection_Request *request = data;
 
-   if (request->need_entity)
- {
-if (!request->entity_requested)
-  _entity_request(o, request);
- }
-   else
+   if (!request->entity_requested)
  {
 pd->requests = eina_list_remove(pd->requests, request);
 free(request);
@@ -632,7 +628,7 @@ _entity_fetched_cb(Eo *obj, void *data, const Eina_Value v)
  {
 efl_ui_position_manager_entity_item_size_changed(pd->manager,
  updated_size_start_id,
- i - 1);
+ request->offset + i - 
1);
 updated_size = EINA_FALSE;
  }
 
@@ -748,10 +744,11 @@ _cache_entity_fetch(Eina_List *requests, 
Efl_Ui_Collection_Request **request,
return requests;
 }
 
-static void
+static Eina_Bool
 _entity_request(Efl_Ui_Collection_View *obj, Efl_Ui_Collection_Request 
*request)
 {
-   if (request->model_requested && (!request->model_fetched)) return;
+   if (request->entity_requested) return EINA_TRUE;
+   if (request->model_fetched) return EINA_FALSE;
request->f = efl_future_then(obj, request->f,
 .success_type = EINA_VALUE_TYPE_ARRAY,
 .success = _entity_fetch_cb);
@@ -761,17 +758,19 @@ _entity_request(Efl_Ui_Collection_View *obj, 
Efl_Ui_Collection_Request *request)
 .data = request,
 .free = _entity_free_cb);
request->entity_requested = EINA_TRUE;
+   request->need_entity = EINA_TRUE;
+
+   return EINA_TRUE;
 }
 
-static inline void
+static inline Eina_Bool
 _entity_inflight_request(Efl_Ui_Collection_View *obj,
  Efl_Ui_Collection_Request *request,
  Efl_Ui_Collection_Request *inflight)
 {
-   if (request->need_entity == EINA_FALSE) return ;
-   if (inflight->entity_requested) return ;
+   if (request->need_entity == EINA_FALSE) return EINA_TRUE;
 
-   _entity_request(obj, inflight);
+   return _entity_request(obj, inflight);
 }
 
 static Eina_List *
@@ -804,7 +803,7 @@ _batch_request_flush(Eina_List *requests,
  // request included in current inflight request
  if (rstart >= istart && rend <= iend)
{
-  _entity_inflight_request(obj, request, inflight);
+  if (!_entity_inflight_request(obj, request, inflight)) 
continue;
 
   // In this case no need to start a request
   requests = eina_list_remove_list(requests, ll);
@@ -816,6 +815,8 @@ _batch_request_flush(Eina_List *requests,
  // request overflow left and right
  if (rstart < istart &&am

[EGIT] [core/efl] master 04/05: elementary: watch event on the model Efl.Ui.CollectionView use directly.

2019-11-07 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 1f66d9ed9b6eb5df09f66230e364197ccead00f5
Author: Cedric BAIL 
Date:   Thu Nov 7 11:53:15 2019 -0800

elementary: watch event on the model Efl.Ui.CollectionView use directly.

Efl.Model can be nested and Efl.Ui.CollectionView use this ability. 
Listening
on the nested model instead of the nester model can lead to event being 
triggered
that shouldn't. Better listen on the top model.

Differential Revision: https://phab.enlightenment.org/D10621
---
 src/lib/elementary/efl_ui_collection_view.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/lib/elementary/efl_ui_collection_view.c 
b/src/lib/elementary/efl_ui_collection_view.c
index c08ae16dba..16680e8d47 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -1884,12 +1884,10 @@ _efl_ui_collection_view_model_changed(void *data, const 
Efl_Event *event)
Efl_Model *mselect = NULL;
Eina_Bool selection = EINA_FALSE, sizing = EINA_FALSE;
 
-   if (ev->previous) efl_event_callback_array_del(ev->previous, model_cbs(), 
data);
-   if (ev->current) efl_event_callback_array_add(ev->current, model_cbs(), 
data);
-
// Cleanup all object, pending request and refetch everything
_all_cleanup(data, pd);
 
+   if (pd->model) efl_event_callback_array_del(pd->model, model_cbs(), data);
efl_replace(>model, NULL);
 
if (!ev->current)
@@ -1983,6 +1981,8 @@ _efl_ui_collection_view_model_changed(void *data, const 
Efl_Event *event)
requests = _batch_request_flush(requests, data, pd);
 
pd->model = model;
+   efl_event_callback_array_add(pd->model, model_cbs(), data);
+
efl_ui_position_manager_entity_item_size_changed(pd->manager, 0, count - 1);
switch(efl_ui_position_manager_entity_version(pd->manager, 1))
  {
@@ -1993,8 +1993,6 @@ _efl_ui_collection_view_model_changed(void *data, const 
Efl_Event *event)
count);
break;
  }
-
-
 }
 
 static void

-- 




[EGIT] [core/efl] master 03/05: eo: make sure to return the right value for efl_event_callback_call.

2019-11-07 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 620dd43db201cb5b24899c8f1e0bc3582f3e867e
Author: Cedric BAIL 
Date:   Thu Nov 7 10:58:04 2019 -0800

eo: make sure to return the right value for efl_event_callback_call.

EINA_FALSE is to be returned only if one of the callback did call
efl_event_callback_stop not if their was no callback called.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10620
---
 src/lib/eo/eo_base_class.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 43068c7f19..06cd48259f 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -1978,7 +1978,7 @@ _cb_desc_match(const Efl_Event_Description *a, const 
Efl_Event_Description *b, E
 }
 
 #define EFL_OBJECT_EVENT_CALLBACK_BLOCK(Pd, Desc, Event)\
-  if ((Desc == Event) && (!(Pd->event_cb_##Event))) return EINA_FALSE;
+  if ((Desc == Event) && (!(Pd->event_cb_##Event))) return EINA_TRUE;
 
 static inline Eina_Bool
 _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
@@ -1999,7 +1999,7 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
};
int event_hash;
 
-   if (pd->callbacks_count == 0) return EINA_FALSE;
+   if (pd->callbacks_count == 0) return EINA_TRUE;
else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_ADD)
else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_CALLBACK_DEL)
else EFL_OBJECT_EVENT_CALLBACK_BLOCK(pd, desc, EFL_EVENT_DEL)
@@ -2010,7 +2010,7 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
  {
 event_hash = _pointer_hash((uintptr_t) desc);
 if (!(pd->callbacks_mask & (1 << event_hash)))
-  return EINA_FALSE;
+  return EINA_TRUE;
  }
 
if (pd->event_frame)
@@ -2060,6 +2060,7 @@ restart_back:
 
// Handle nested restart of walking list
if (lookup) lookup->current = idx - 1;
+
it->func((void *) (*cb)->func_data, );
/* Abort callback calling if the func says so. */
if (pd->callback_stopped)
@@ -2083,6 +2084,7 @@ restart_back:
 
   // Handle nested restart of walking list
   if (lookup) lookup->current = idx - 1;
+
   (*cb)->items.item.func((void *) (*cb)->func_data, );
   /* Abort callback calling if the func says so. */
   if (pd->callback_stopped)
@@ -2176,7 +2178,6 @@ _efl_event_forwarder_callback(void *data, const Efl_Event 
*event)
Eina_Bool ret = EINA_FALSE;
 
ret = efl_event_callback_call(new_obj, event->desc, event->info);
-
if (!ret)
  {
 efl_event_callback_stop(event->object);

-- 




[EGIT] [core/efl] master 01/05: elementary: cleanup Eina_Future properly by relying on efl_future_then proper lifecycle.

2019-11-07 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit b77482e7d6846da1b1cceeda4811829400e921d0
Author: Cedric BAIL 
Date:   Wed Nov 6 15:06:17 2019 -0800

elementary: cleanup Eina_Future properly by relying on efl_future_then 
proper lifecycle.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10613
---
 src/lib/elementary/efl_ui_position_manager_list.c | 31 ++-
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/src/lib/elementary/efl_ui_position_manager_list.c 
b/src/lib/elementary/efl_ui_position_manager_list.c
index d22d42cb10..34d7e5f073 100644
--- a/src/lib/elementary/efl_ui_position_manager_list.c
+++ b/src/lib/elementary/efl_ui_position_manager_list.c
@@ -339,18 +339,23 @@ position_content(Eo *obj EINA_UNUSED, 
Efl_Ui_Position_Manager_List_Data *pd)
 }
 
 static Eina_Value
-_rebuild_job_cb(void *data, Eina_Value v EINA_UNUSED, const Eina_Future *f 
EINA_UNUSED)
+_rebuild_job_cb(Eo *obj, void *data, const Eina_Value v)
 {
-   MY_DATA_GET(data, pd);
+   Efl_Ui_Position_Manager_List_Data *pd = data;
 
-   if (!efl_alive_get(data)) return EINA_VALUE_EMPTY;
+   cache_require(obj, pd);
+   recalc_absolut_size(obj, pd);
+   position_content(obj, pd);
 
-   cache_require(data, pd);
-   recalc_absolut_size(data, pd);
-   position_content(data, pd);
-   pd->rebuild_absolut_size = NULL;
+   return v;
+}
 
-   return EINA_VALUE_EMPTY;
+static void
+_rebuild_job_free(Eo *o EINA_UNUSED, void *data, const Eina_Future 
*dead_future EINA_UNUSED)
+{
+   Efl_Ui_Position_Manager_List_Data *pd = data;
+
+   pd->rebuild_absolut_size = NULL;
 }
 
 static void
@@ -358,8 +363,10 @@ schedule_recalc_absolut_size(Eo *obj, 
Efl_Ui_Position_Manager_List_Data *pd)
 {
if (pd->rebuild_absolut_size) return;
 
-   pd->rebuild_absolut_size = efl_loop_job(efl_app_main_get());
-   eina_future_then(pd->rebuild_absolut_size, _rebuild_job_cb, obj);
+   pd->rebuild_absolut_size = efl_future_then(obj, 
efl_loop_job(efl_app_main_get()),
+  .success = _rebuild_job_cb,
+  .data = pd,
+  .free = _rebuild_job_free);
 }
 
 EOLIAN static void
@@ -386,7 +393,7 @@ 
_efl_ui_position_manager_list_efl_ui_position_manager_entity_scroll_position_set
 }
 
 EOLIAN static void
-_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_added(Eo 
*obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, int added_index 
EINA_UNUSED, Efl_Gfx_Entity *subobj)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_added(Eo 
*obj, Efl_Ui_Position_Manager_List_Data *pd, int added_index EINA_UNUSED, 
Efl_Gfx_Entity *subobj)
 {
if (pd->size == 0)
  {
@@ -403,7 +410,7 @@ 
_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_added(Eo *obj
 }
 
 EOLIAN static void
-_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_removed(Eo 
*obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, int removed_index 
EINA_UNUSED, Efl_Gfx_Entity *subobj)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_removed(Eo 
*obj, Efl_Ui_Position_Manager_List_Data *pd, int removed_index EINA_UNUSED, 
Efl_Gfx_Entity *subobj)
 {
pd->size --;
if (subobj)

-- 




[EGIT] [core/efl] master 01/01: elementary: fix end of fast scroll not showing up during Efl.Ui.CollectionView scroll.

2019-11-06 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit f7c6bec38ff0a19bdffab249836faaf7a1824c47
Author: Cedric BAIL 
Date:   Fri Nov 1 08:03:00 2019 -0700

elementary: fix end of fast scroll not showing up during 
Efl.Ui.CollectionView scroll.

efl_ui_position_manager_entity_entities_ready is expecting the end offset 
and not the
length of how many items have been updated. Sending the correct number 
fixes the problem.

Reviewed-by: Marcel Hollerbach 
Reviewed-by: SangHyeon Jade Lee 
Differential Revision: https://phab.enlightenment.org/D10590
---
 src/lib/elementary/efl_ui_collection_view.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/lib/elementary/efl_ui_collection_view.c 
b/src/lib/elementary/efl_ui_collection_view.c
index fa2dd423e9..3b7b8132ee 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -575,7 +575,6 @@ _entity_fetched_cb(Eo *obj, void *data, const Eina_Value v)
}
   }
 #endif
-
 // When requesting an entity, the model should already be in the cache
 if (!child) continue;
 
@@ -624,8 +623,8 @@ _entity_fetched_cb(Eo *obj, void *data, const Eina_Value v)

search_index - 1);
   updated_size = EINA_FALSE;
}
-  }}
-   ;
+  }
+ }
 
// Currently position manager will flush its entire size cache on update, 
so only do
// it when necessary to improve performance.
@@ -642,7 +641,7 @@ _entity_fetched_cb(Eo *obj, void *data, const Eina_Value v)
  {
 efl_ui_position_manager_entity_entities_ready(pd->manager,
   updated_entity_start_id,
-  i - 1);
+  request->offset + i - 1);
 
 efl_event_callback_del(efl_main_loop_get(), EFL_LOOP_EVENT_IDLE, 
_idle_cb, obj);
 efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_IDLE, 
_idle_cb, obj);
@@ -1054,7 +1053,7 @@ _batch_entity_cb(void *data, 
Efl_Ui_Position_Manager_Request_Range range, Eina_R
 
entities = memory.mem;
//count = efl_model_children_count_get(parent);
-   limit = range.end_id - range.start_id;;
+   limit = range.end_id - range.start_id;
 
// Look in the temporary cache now for the beginning of the buffer
 #ifdef VIEWPORT_ENABLE

-- 




[EGIT] [core/efl] master 01/01: efl: fix include due to stale files.

2019-10-31 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 81165d743fae05dbf47d2e639f09b073874d306a
Author: Cedric BAIL 
Date:   Thu Oct 31 15:43:16 2019 -0400

efl: fix include due to stale files.

Reviewers: zmike

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10583
---
 src/lib/efl/Efl.h | 1 -
 src/lib/evas/Efl_Canvas.h | 2 +-
 src/lib/evas/Evas.h   | 2 +-
 src/lib/evas/Evas_Eo.h| 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index 296fc1b359..bcdaef98b8 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -241,7 +241,6 @@ EAPI Efl_Object *efl_part(const Eo *obj, const char *name);
 #ifndef EFL_NOLEGACY_API_SUPPORT
 #include "interfaces/efl_gfx_types.eot.h"
 #include "interfaces/efl_ui_drag_types.eot.h"
-#include "interfaces/efl_input_types.eot.h"
 #include "interfaces/efl_text_types.eot.h"
 #endif
 
diff --git a/src/lib/evas/Efl_Canvas.h b/src/lib/evas/Efl_Canvas.h
index dcb3836218..82659a38e7 100644
--- a/src/lib/evas/Efl_Canvas.h
+++ b/src/lib/evas/Efl_Canvas.h
@@ -40,8 +40,8 @@ extern "C" {
 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/src/lib/evas/Evas.h b/src/lib/evas/Evas.h
index 9044398971..4b94bd6601 100644
--- a/src/lib/evas/Evas.h
+++ b/src/lib/evas/Evas.h
@@ -206,8 +206,8 @@ extern "C" {
 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 
 
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index ddf3b2d2b0..5a725cc205 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -186,7 +186,7 @@ struct _Efl_Canvas_Object_Animation_Event
  */
 
 /* Input events */
-#include "interfaces/efl_input_types.eot.h"
+#include "canvas/efl_input_types.eot.h"
 #include "canvas/efl_input_device.eo.h"
 #include "canvas/efl_canvas_pointer.eo.h"
 #include "canvas/efl_canvas_scene.eo.h"

-- 




[EGIT] [core/efl] master 01/04: evas: move efl_input_device into evas/Efl_Canvas.h

2019-10-31 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 7dc98ab3d01b47f14552ca021d49b49b24fb7057
Author: Cedric Bail 
Date:   Thu Oct 31 13:20:33 2019 -0400

evas: move efl_input_device into evas/Efl_Canvas.h

Summary:
The internal and the API we would like is mostly a canvas API. A lot of the 
code
in evas is working around the fact that efl_input_device is not defined 
inside Evas.
This patch is the first step to try to clean this up.

Depends on D10487

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10488
---
 src/bin/elementary/test_events.c   |   2 +-
 src/lib/ecore_evas/ecore_evas.c|   4 +-
 src/lib/ecore_evas/ecore_evas_drm.h|   1 +
 src/lib/ecore_evas/ecore_evas_util.c   |   1 +
 src/lib/edje/Efl_Layout.h  |   3 +
 src/lib/edje/edje_callbacks.c  |   3 -
 src/lib/edje/edje_private.h|   3 +-
 src/lib/efl/Efl.h  |   6 -
 src/lib/efl/interfaces/efl_common_internal.h   | 169 -
 src/lib/efl/interfaces/efl_interfaces_main.c   |   2 -
 src/lib/efl/interfaces/meson.build |   9 --
 src/lib/elementary/efl_ui_widget.c |   4 -
 src/lib/elementary/efl_ui_win.c|   3 -
 src/lib/elementary/elm_priv.h  |   1 +
 src/lib/emotion/emotion_smart.c|   1 +
 src/lib/evas/Efl_Canvas.h  |  13 ++
 src/lib/evas/Evas_Common.h |  22 ++-
 src/lib/evas/Evas_Eo.h |  23 +--
 src/lib/evas/Evas_Internal.h   | 160 +++
 .../canvas}/efl_canvas_pointer.eo  |   0
 .../interfaces => evas/canvas}/efl_canvas_scene.eo |   0
 .../interfaces => evas/canvas}/efl_input_device.c  |   7 +-
 .../interfaces => evas/canvas}/efl_input_device.eo |   0
 src/lib/evas/canvas/efl_input_event.c  |   4 +-
 src/lib/evas/canvas/efl_input_focus.c  |   5 -
 src/lib/evas/canvas/efl_input_hold.c   |   3 -
 src/lib/evas/canvas/efl_input_key.c|   3 -
 src/lib/evas/canvas/efl_input_pointer.c|   3 -
 .../interfaces => evas/canvas}/efl_input_types.eot |   0
 src/lib/evas/canvas/evas_callbacks.c   |   3 -
 src/lib/evas/canvas/evas_device.c  |   3 -
 src/lib/evas/canvas/evas_events.c  |   3 -
 src/lib/evas/canvas/evas_events_legacy.c   |   3 -
 src/lib/evas/canvas/evas_focus.c   |   2 -
 src/lib/evas/canvas/evas_key_grab.c|   3 -
 src/lib/evas/canvas/evas_main.c|   5 +-
 src/lib/evas/canvas/meson.build|   9 +-
 src/lib/evas/gesture/efl_canvas_gesture_private.h  |   2 -
 src/lib/evas/include/evas_common_private.h |   1 +
 39 files changed, 231 insertions(+), 258 deletions(-)

diff --git a/src/bin/elementary/test_events.c b/src/bin/elementary/test_events.c
index e1438db3cb..48eac326ed 100644
--- a/src/bin/elementary/test_events.c
+++ b/src/bin/elementary/test_events.c
@@ -5,7 +5,7 @@
 #include 
 
 #define EFL_INTERNAL_UNSTABLE
-#include "interfaces/efl_common_internal.h"
+#include "Evas_Internal.h"
 
 #define DEFAULT_TEXT "Click the white rectangle to get started"
 
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 9d2d4d10f1..d3c26ddb19 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -24,6 +24,7 @@
 #include "ecore_private.h"
 #include 
 #include 
+#define EFL_INTERNAL_UNSTABLE
 #include 
 
 #include "Ecore_Evas.h"
@@ -34,9 +35,6 @@
 #include "ecore_evas_extn.h"
 #include "ecore_evas_win32.h"
 
-#define EFL_INTERNAL_UNSTABLE
-#include "interfaces/efl_common_internal.h"
-
 #include "ecore_private.h"
 
 #ifndef O_BINARY
diff --git a/src/lib/ecore_evas/ecore_evas_drm.h 
b/src/lib/ecore_evas/ecore_evas_drm.h
index 401fb1e8f7..63ef7bed0c 100644
--- a/src/lib/ecore_evas/ecore_evas_drm.h
+++ b/src/lib/ecore_evas/ecore_evas_drm.h
@@ -1,6 +1,7 @@
 #ifndef ECORE_EVAS_DRM_H_
 # define ECORE_EVAS_DRM_H_
 
+#define EFL_INTERNAL_UNSTABLE
 # include "Evas_Internal.h"
 
 typedef struct _Ecore_Evas_Interface_Drm Ecore_Evas_Interface_Drm;
diff --git a/src/lib/ecore_evas/ecore_evas_util.c 
b/src/lib/ecore_evas/ecore_evas_util.c
index 4f3e9c4baa..7b07fdc699 100644
--- a/src/lib/ecore_evas/ecore_evas_util.c
+++ b/src/lib/ecore_evas/ecore_evas_util.c
@@ -11,6 +11,7 @@
 
 #include "Ecore_Evas.h"
 #in

[EGIT] [core/efl] master 03/04: evas: deprecate evas_device_parent_set.

2019-10-31 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 21f07b9fa980ffa181a0e88865236fc0c5bac9e7
Author: Cedric Bail 
Date:   Thu Oct 31 13:20:45 2019 -0400

evas: deprecate evas_device_parent_set.

Summary:
It is unlikely that the code was working before and it was a bad idea
anyway. There is no user of this API in EFL.

Depends on D10490

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10491
---
 src/lib/evas/Evas_Common.h|  2 +-
 src/lib/evas/canvas/evas_device.c | 17 ++---
 2 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index f68f544dd3..632260fbe0 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -1159,7 +1159,7 @@ EAPI const char *evas_device_description_get(const 
Evas_Device *dev);
  *
  * @since 1.8
  */
-EAPI void evas_device_parent_set(Evas_Device *dev, Evas_Device *parent);
+EAPI void evas_device_parent_set(Evas_Device *dev, Evas_Device *parent) 
EINA_DEPRECATED;
 
 /**
  * Get the parent of a device
diff --git a/src/lib/evas/canvas/evas_device.c 
b/src/lib/evas/canvas/evas_device.c
index af95619044..1652e79100 100644
--- a/src/lib/evas/canvas/evas_device.c
+++ b/src/lib/evas/canvas/evas_device.c
@@ -330,25 +330,12 @@ evas_device_description_get(const Evas_Device *dev)
 }
 
 EAPI void
-evas_device_parent_set(Evas_Device *dev, Evas_Device *parent)
+evas_device_parent_set(Evas_Device *dev EINA_UNUSED, Evas_Device *parent 
EINA_UNUSED)
 {
// Note: This function should be deprecated. parent_set doesn't make sense
// unless the parent is a seat device. Parent shouldn't be changed after
// creation.
-
-   SAFETY_CHECK(dev, EFL_INPUT_DEVICE_CLASS);
-
-   if (parent)
- {
-SAFETY_CHECK(parent, EFL_INPUT_DEVICE_CLASS);
- }
-   else if (efl_parent_get(dev))
- {
-efl_ref(dev);
- }
-
-   efl_parent_set(dev, parent);
-   evas_event_callback_call(efl_input_device_evas_get(dev), 
EVAS_CALLBACK_DEVICE_CHANGED, dev);
+   ERR("It is not advised and possible anymore to changed the parent of an 
Evas_Device.");
 }
 
 EAPI const Evas_Device *

-- 




[EGIT] [core/efl] master 02/04: evas: move exposed internal structure of Efl_Input_Device to be private.

2019-10-31 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 3fd669376470e03ec7ebe33e0040bc186c7ce913
Author: Cedric Bail 
Date:   Thu Oct 31 13:20:39 2019 -0400

evas: move exposed internal structure of Efl_Input_Device to be private.

Summary: Depends on D10489

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10490
---
 src/lib/evas/Evas_Internal.h   | 22 -
 src/lib/evas/canvas/efl_input_device.c | 59 
 src/lib/evas/canvas/evas_device.c  | 82 ++
 3 files changed, 91 insertions(+), 72 deletions(-)

diff --git a/src/lib/evas/Evas_Internal.h b/src/lib/evas/Evas_Internal.h
index baf7cd5b16..782742f5d9 100644
--- a/src/lib/evas/Evas_Internal.h
+++ b/src/lib/evas/Evas_Internal.h
@@ -32,16 +32,22 @@
 extern "C" {
 #endif
 
-
 #ifndef EFL_INTERNAL_UNSTABLE
 # error This file can not be included outside EFL
 #endif
 
 #include 
 
+EOAPI const Eina_List *efl_input_device_children_get(const Eo *obj);
+
+EOAPI void efl_input_device_evas_set(Eo *obj, Evas *e);
+EOAPI Evas *efl_input_device_evas_get(const Eo *obj);
+
+EOAPI void efl_input_device_subclass_set(Eo *obj, Evas_Device_Subclass 
sub_clas);
+EOAPI Evas_Device_Subclass efl_input_device_subclass_get(const Eo *obj);
+
 typedef struct _Efl_Input_Pointer_Data  Efl_Input_Pointer_Data;
 typedef struct _Efl_Input_Key_Data  Efl_Input_Key_Data;
-typedef struct _Efl_Input_Device_Data   Efl_Input_Device_Data;
 typedef struct _Efl_Input_Hold_Data Efl_Input_Hold_Data;
 typedef struct _Efl_Input_Focus_DataEfl_Input_Focus_Data;
 
@@ -112,18 +118,6 @@ struct _Efl_Input_Key_Data
Eina_Bool  no_stringshare : 1;
 };
 
-struct _Efl_Input_Device_Data
-{
-   Eo   *eo;
-   Eo   *evas; /* Evas */
-   Efl_Input_Device *source;  /* ref */
-   Eina_List*children; /* ref'ed by efl_parent, not by this list */
-   unsigned int  id;
-   Efl_Input_Device_Type klass;
-   unsigned int  subclass; // Evas_Device_Subclass (unused)
-   unsigned int  pointer_count;
-};
-
 struct _Efl_Input_Hold_Data
 {
Eo   *eo;
diff --git a/src/lib/evas/canvas/efl_input_device.c 
b/src/lib/evas/canvas/efl_input_device.c
index 690db7698d..607ffd5f76 100644
--- a/src/lib/evas/canvas/efl_input_device.c
+++ b/src/lib/evas/canvas/efl_input_device.c
@@ -9,6 +9,18 @@
 #define MY_CLASS EFL_INPUT_DEVICE_CLASS
 
 /* Efl Input Device = Evas Device */
+typedef struct _Efl_Input_Device_Data   Efl_Input_Device_Data;
+struct _Efl_Input_Device_Data
+{
+   Eo   *eo;
+   Eo   *evas; /* Evas */
+   Efl_Input_Device *source;  /* ref */
+   Eina_List*children; /* ref'ed by efl_parent, not by this list */
+   unsigned int  id;
+   Efl_Input_Device_Type klass;
+   unsigned int  subclass; // Evas_Device_Subclass (unused)
+   unsigned int  pointer_count;
+};
 
 typedef struct _Child_Device_Iterator Child_Device_Iterator;
 
@@ -226,5 +238,52 @@ _efl_input_device_is_pointer_type_get(const Eo *obj 
EINA_UNUSED, Efl_Input_Devic
return _is_pointer(pd);
 }
 
+static const Eina_List *
+_efl_input_device_children_get(const Eo *obj EINA_UNUSED, 
Efl_Input_Device_Data *pd)
+{
+   return pd->children;
+}
+
+EOAPI EFL_FUNC_BODY_CONST(efl_input_device_children_get, const Eina_List *, 
NULL);
+
+static Evas *
+_efl_input_device_evas_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data 
*pd)
+{
+   return pd->evas;
+}
+
+EOAPI EFL_FUNC_BODY_CONST(efl_input_device_evas_get, Evas *, NULL);
+
+static void
+_efl_input_device_evas_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd, 
Evas *e)
+{
+   pd->evas = e;
+}
+
+EOAPI EFL_VOID_FUNC_BODYV(efl_input_device_evas_set, EFL_FUNC_CALL(e), Evas 
*e);
+
+static Evas_Device_Subclass
+_efl_input_device_subclass_get(const Eo *obj EINA_UNUSED, 
Efl_Input_Device_Data *pd)
+{
+   return pd->subclass;
+}
+
+EOAPI EFL_FUNC_BODY_CONST(efl_input_device_subclass_get, Evas_Device_Subclass, 
0);
+
+static void
+_efl_input_device_subclass_set(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd,
+   Evas_Device_Subclass sub_clas)
+{
+   pd->subclass = sub_clas;
+}
+
+EOAPI EFL_VOID_FUNC_BODYV(efl_input_device_subclass_set, 
EFL_FUNC_CALL(sub_clas), Evas_Device_Subclass sub_clas);
+
+#define EFL_INPUT_DEVICE_EXTRA_OPS  \
+  EFL_OBJECT_OP_FUNC(efl_input_device_evas_get, _efl_input_device_evas_get), \
+  EFL_OBJECT_OP_FUNC(efl_input_device_evas_set, _efl_input_device_evas_set), \
+  EFL_OBJECT_OP_FUNC(efl_input_device_subclass_get, 
_efl_input_device_subclass_get), \
+  EFL_OBJECT_OP_FUNC(efl_input_device_subclass_set, 
_efl_input_device_subclass_set)

[EGIT] [core/efl] master 04/04: evas: move watching over destruction of device to custom logic due to high use.

2019-10-31 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit a9227fd5306ba68d020623121f3efd3f17857c76
Author: Cedric Bail 
Date:   Thu Oct 31 13:20:52 2019 -0400

evas: move watching over destruction of device to custom logic due to high 
use.

Summary:
This specific EFL_EVENT_DEL handler was registered thousand of time alone on
an Evas device. Potential solution are to improve handling of this kind of 
large
scale callback logic or just not take that path. I find it easier to have a 
custom
code in this case to handle the destruction of Evas device and avoid this
thousand of callback.

Depends on D10492

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10493
---
 src/lib/evas/Evas_Internal.h   |  5 ++
 src/lib/evas/canvas/efl_input_device.c | 42 +++
 src/lib/evas/canvas/evas_object_main.c | 98 --
 src/lib/evas/include/evas_private.h|  6 +++
 4 files changed, 99 insertions(+), 52 deletions(-)

diff --git a/src/lib/evas/Evas_Internal.h b/src/lib/evas/Evas_Internal.h
index 782742f5d9..d631cdcde5 100644
--- a/src/lib/evas/Evas_Internal.h
+++ b/src/lib/evas/Evas_Internal.h
@@ -38,6 +38,8 @@ extern "C" {
 
 #include 
 
+typedef struct _Evas_Object_Pointer_Data Evas_Object_Pointer_Data;
+
 EOAPI const Eina_List *efl_input_device_children_get(const Eo *obj);
 
 EOAPI void efl_input_device_evas_set(Eo *obj, Evas *e);
@@ -46,6 +48,9 @@ EOAPI Evas *efl_input_device_evas_get(const Eo *obj);
 EOAPI void efl_input_device_subclass_set(Eo *obj, Evas_Device_Subclass 
sub_clas);
 EOAPI Evas_Device_Subclass efl_input_device_subclass_get(const Eo *obj);
 
+EOAPI void efl_input_device_grab_register(Eo *obj, Efl_Canvas_Object *grab, 
Evas_Object_Pointer_Data *pdata);
+EOAPI void efl_input_device_grab_unregister(Eo *obj, Efl_Canvas_Object *grab, 
Evas_Object_Pointer_Data *pdata);
+
 typedef struct _Efl_Input_Pointer_Data  Efl_Input_Pointer_Data;
 typedef struct _Efl_Input_Key_Data  Efl_Input_Key_Data;
 typedef struct _Efl_Input_Hold_Data Efl_Input_Hold_Data;
diff --git a/src/lib/evas/canvas/efl_input_device.c 
b/src/lib/evas/canvas/efl_input_device.c
index 607ffd5f76..52eae92cbb 100644
--- a/src/lib/evas/canvas/efl_input_device.c
+++ b/src/lib/evas/canvas/efl_input_device.c
@@ -5,6 +5,8 @@
 #include "Evas.h"
 #define EFL_INTERNAL_UNSTABLE
 #include "Evas_Internal.h"
+#include "evas_common_private.h"
+#include "evas_private.h"
 
 #define MY_CLASS EFL_INPUT_DEVICE_CLASS
 
@@ -16,6 +18,9 @@ struct _Efl_Input_Device_Data
Eo   *evas; /* Evas */
Efl_Input_Device *source;  /* ref */
Eina_List*children; /* ref'ed by efl_parent, not by this list */
+   Eina_Hash*grabs; /* Hash of all the object that might grab this 
device.
+   We expect thousand of them to be registered 
here,
+   that is why we use a hash. */
unsigned int  id;
Efl_Input_Device_Type klass;
unsigned int  subclass; // Evas_Device_Subclass (unused)
@@ -71,6 +76,12 @@ _efl_input_device_efl_object_destructor(Eo *obj, 
Efl_Input_Device_Data *pd)
  }
efl_unref(pd->source);
 
+   if (pd->grabs)
+ {
+eina_hash_free(pd->grabs);
+pd->grabs = NULL;
+ }
+
return efl_destructor(efl_super(obj, MY_CLASS));
 }
 
@@ -279,11 +290,42 @@ _efl_input_device_subclass_set(Eo *obj EINA_UNUSED, 
Efl_Input_Device_Data *pd,
 
 EOAPI EFL_VOID_FUNC_BODYV(efl_input_device_subclass_set, 
EFL_FUNC_CALL(sub_clas), Evas_Device_Subclass sub_clas);
 
+static void
+_grab_del(void *data)
+{
+   Evas_Object_Pointer_Data *pdata = data;
+
+   evas_object_pointer_grab_del(pdata->obj, pdata);
+}
+
+static void
+_efl_input_device_grab_register(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd,
+Efl_Canvas_Object *grab, 
Evas_Object_Pointer_Data *pdata)
+{
+   if (!pd->grabs) pd->grabs = eina_hash_pointer_new(_grab_del);
+   eina_hash_add(pd->grabs, , pdata);
+}
+
+EOAPI EFL_VOID_FUNC_BODYV(efl_input_device_grab_register, EFL_FUNC_CALL(grab, 
pdata),
+  Efl_Canvas_Object *grab, Evas_Object_Pointer_Data 
*pdata);
+
+static void
+_efl_input_device_grab_unregister(Eo *obj EINA_UNUSED, Efl_Input_Device_Data 
*pd,
+  Efl_Canvas_Object *grab, 
Evas_Object_Pointer_Data *pdata)
+{
+   eina_hash_del(pd->grabs, , pdata);
+}
+
+EOAPI EFL_VOID_FUNC_BODYV(efl_input_device_grab_unregister, 
EFL_FUNC_CALL(grab, pdata),
+  Efl_Canvas_Object *grab, Evas_Object_Pointer_Data 
*pdata);
+
 #define EFL_INPUT_DEVICE_EXTRA_OPS  

[EGIT] [core/efl] master 08/08: eo: add debug ability to detect long chain of event handler.

2019-10-31 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit ff14c84fcb01d69323ea6e6547ec7d9f0c1fb756
Author: Cedric Bail 
Date:   Fri Oct 18 09:24:47 2019 -0700

eo: add debug ability to detect long chain of event handler.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10484
---
 src/lib/eo/eo_base_class.c | 58 ++
 1 file changed, 58 insertions(+)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index a159c656f6..39da0e8538 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -1492,6 +1492,29 @@ _efl_object_event_callback_priority_add(Eo *obj, 
Efl_Object_Data *pd,
const Efl_Callback_Array_Item_Full arr[] =
  { {desc, priority, func, (void *)user_data}, {NULL, 0, NULL, NULL}};
Eo_Callback_Description *cb = _eo_callback_new();
+#ifdef EO_DEBUG
+   unsigned int idx, r = 0, entries = 0;
+
+   for (idx = pd->callbacks_count ; idx > 0; idx--)
+ {
+Eo_Callback_Description **cb;
+
+cb = pd->callbacks + idx - 1;
+if (!(*cb)->func_array)
+  {
+ if (((*cb)->items.item.desc == desc) &&
+ ((*cb)->items.item.func == func) &&
+ ((*cb)->priority == priority) &&
+ ((*cb)->generation == _efl_event_generation(pd)))
+   r++;
+  }
+entries++;
+ }
+   if (r > 1) INF("Object '%s' got %i callback with event '%s' registered.",
+  efl_debug_name_get(obj), r, desc->name);
+   if (entries > 10) INF("Object '%s' got %i callbacks.",
+ efl_debug_name_get(obj), entries);
+#endif
 
// very unlikely so improve l1 instr cache by using goto
if (EINA_UNLIKELY(!cb || !desc || !func)) goto err;
@@ -1582,6 +1605,7 @@ _efl_object_event_callback_array_priority_add(Eo *obj, 
Efl_Object_Data *pd,
Efl_Callback_Array_Item_Full *ev_array;
 #ifdef EO_DEBUG
const Efl_Callback_Array_Item *prev;
+   unsigned int idx, r = 0, entries = 0;
 #endif
 
// very unlikely so improve l1 instr cache by using goto
@@ -1606,6 +1630,40 @@ _efl_object_event_callback_array_priority_add(Eo *obj, 
Efl_Object_Data *pd,
cb->generation = _efl_event_generation(pd);
if (!!cb->generation) pd->need_cleaning = EINA_TRUE;
 
+#ifdef EO_DEBUG
+   for (idx = pd->callbacks_count ; idx > 0; idx--)
+ {
+Eo_Callback_Description **cb;
+
+cb = pd->callbacks + idx - 1;
+if ((*cb)->func_array)
+  {
+ if (((*cb)->items.item_array == array) &&
+ ((*cb)->priority == priority) &&
+ ((*cb)->generation == _efl_event_generation(pd)))
+   r++;
+  }
+entries++;
+ }
+   if (r > 1)
+ {
+Eina_Strbuf *buf = eina_strbuf_new();
+Eina_Bool first = EINA_TRUE;
+
+for (it = array; it->func; it++)
+  {
+ if (first) eina_strbuf_append(buf, it->desc->name);
+ else eina_strbuf_append_printf(buf, ", %s", it->desc->name);
+ first = EINA_FALSE;
+  }
+INF("Object '%s' got %i callback with events array %s registered.",
+efl_debug_name_get(obj), r, eina_strbuf_string_get(buf));
+eina_strbuf_free(buf);
+ }
+   if (entries > 10) INF("Object '%s' got %i callbacks.",
+ efl_debug_name_get(obj), entries);
+#endif
+
_eo_callbacks_sorted_insert(pd, cb);
for (it = cb->items.item_array; it->func; it++)
  _special_event_count_inc(obj, pd, it);

-- 




[EGIT] [core/efl] master 07/08: eo: reduce memory use to track event registration and callback call.

2019-10-31 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit db93501e66c94c7d62df8079c9ada5b3b4d4c08c
Author: Cedric Bail 
Date:   Thu Oct 17 12:09:14 2019 -0700

eo: reduce memory use to track event registration and callback call.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10482
---
 src/lib/eo/Eo.h  |  11 +++
 src/lib/eo/eo_base_class.c   | 164 +--
 src/tests/eo/suite/eo_test_general.c |   4 +-
 3 files changed, 113 insertions(+), 66 deletions(-)

diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 6e30a29861..178372efed 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -2267,6 +2267,17 @@ EAPI int efl_callbacks_cmp(const Efl_Callback_Array_Item 
*a, const Efl_Callback_
  */
 #define efl_event_callback_forwarder_add(obj, desc, new_obj) 
efl_event_callback_forwarder_priority_add(obj, desc, 
EFL_CALLBACK_PRIORITY_DEFAULT, new_obj)
 
+/**
+ * @brief Count the number of event handler registered for a specific event.
+ *
+ * @param[in] obj The object.
+ * @param[in] desc The specific event.
+ * @return The number of handler registered for this specific events.
+ *
+ * @ingroup Efl_Object
+ */
+EOAPI unsigned int efl_event_callback_count(const Eo *obj, const 
Efl_Event_Description *desc);
+
 /**
  * @def Replace the previous Eo pointer with new content.
  *
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 9f50d57538..a159c656f6 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -43,6 +43,8 @@ typedef struct
Eina_Hash *schedulers;
 } Efl_Object_Extension;
 
+#define EFL_OBJECT_EVENT_CALLBACK(Event) Eina_Bool event_cb_##Event : 1;
+
 struct _Efl_Object_Data
 {
Eina_Inlist   *children;
@@ -63,15 +65,18 @@ struct _Efl_Object_Data
unsigned int   callbacks_count;
 
unsigned short event_freeze_count;
-   unsigned short event_cb_efl_event_callback_add_count;
-   unsigned short event_cb_efl_event_callback_del_count;
-   unsigned short event_cb_efl_event_del_count;
-   unsigned short event_cb_efl_event_noref_count;
-   unsigned short event_cb_efl_event_invalidate_count;
+
+   EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_CALLBACK_ADD);
+   EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_CALLBACK_DEL);
+   EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_DEL);
+   EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_NOREF);
+
+   EFL_OBJECT_EVENT_CALLBACK(EFL_EVENT_INVALIDATE);
+   Eina_Bool  has_destroyed_event_cb : 1; // No proper count: 
minor optimization triggered at destruction only
Eina_Bool  callback_stopped : 1;
Eina_Bool  need_cleaning : 1;
+
Eina_Bool  allow_parent_unref : 1; // Allows unref to zero 
even with a parent
-   Eina_Bool  has_destroyed_event_cb : 1; // No proper count: 
minor optimization triggered at destruction only
 };
 
 typedef enum
@@ -1233,6 +1238,19 @@ _pointer_hash(const uintptr_t val)
 #endif
 }
 
+#define EFL_OBJECT_EVENT_CB_INC(Obj, It, Pd, Event) \
+  if (It->desc == Event && !Pd->event_cb_##Event)   \
+{   \
+   Pd->event_cb_##Event = EINA_TRUE;\
+}
+
+#define EFL_OBJECT_EVENT_CB_DEC(Obj, It, Pd, Event) \
+  if (It->desc == Event && Pd->event_cb_##Event)\
+{   \
+   if (!efl_event_callback_count(Obj, Event))   \
+ Pd->event_cb_##Event = EINA_FALSE; \
+}
+
 static inline void
 _special_event_count_inc(Eo *obj_id, Efl_Object_Data *pd, const 
Efl_Callback_Array_Item *it)
 {
@@ -1242,25 +1260,21 @@ _special_event_count_inc(Eo *obj_id, Efl_Object_Data 
*pd, const Efl_Callback_Arr
 
pd->callbacks_mask |= 1 << event_hash;
 
-   if  (it->desc == EFL_EVENT_CALLBACK_ADD)
- CB_COUNT_INC(pd->event_cb_efl_event_callback_add_count);
-   else if (it->desc == EFL_EVENT_CALLBACK_DEL)
- CB_COUNT_INC(pd->event_cb_efl_event_callback_del_count);
-   else if (it->desc == EFL_EVENT_DEL)
- CB_COUNT_INC(pd->event_cb_efl_event_del_count);
-   else if (it->desc == EFL_EVENT_NOREF)
+   EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_CALLBACK_ADD)
+   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_CALLBACK_DEL)
+   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_DEL)
+   else EFL_OBJECT_EVENT_CB_INC(obj_id, it, pd, EFL_EVENT_INVALIDATE)
+   else if (it->desc == EFL_EVENT_NOREF && !pd->event_cb_EFL_EVENT_NOREF)
  {
-if (pd->event_cb_efl_event_noref_count == 0)
+if (efl_event_callback_count(obj_id, EFL_EVENT_NOREF) > 0)
   {
  EO_OBJ_POINTER_RETURN(obj_id

[EGIT] [core/efl] master 05/08: eo: add infrastructure to attach an Eina_Future_Scheduler to any source of event.

2019-10-31 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 474b1b2c2dcb3c8cab258b6642509a5762d1b1e0
Author: Cedric Bail 
Date:   Wed Oct 16 16:47:10 2019 -0700

eo: add infrastructure to attach an Eina_Future_Scheduler to any source of 
event.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10480
---
 src/lib/eo/Eo.h|  39 -
 src/lib/eo/eo.c|   1 +
 src/lib/eo/eo_base_class.c | 199 -
 3 files changed, 237 insertions(+), 2 deletions(-)

diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 69fd84a560..6e30a29861 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -317,6 +317,18 @@ EOAPI Eina_Bool efl_event_callback_priority_add(Eo *obj, 
const Efl_Event_Descrip
  */
 EOAPI Eina_Bool efl_event_callback_del(Eo *obj, const Efl_Event_Description 
*desc, Efl_Event_Cb func, const void *user_data);
 
+/**
+ * @brief Get the Eina_Future scheduler that trigger them on a specific set of 
events on an object.
+ *
+ * @param[in] obj The object that the scheduler is attached to.
+ * @param[in] array The events that when triggered on the object will trigger 
the Eina_Future.
+ *
+ * @return Return a scheduler that will trigger future exactly when the event 
are triggered.
+ *
+ * @note You must use EFL_SCHEDULER_ARRAY_DEFINE() to create the @p array.
+ */
+EOAPI Eina_Future_Scheduler *efl_event_future_scheduler_get(const Eo *obj, 
Efl_Callback_Array_Item *array);
+
 /**
  * @brief Add an array of callbacks created by @ref EFL_CALLBACKS_ARRAY_DEFINE
  * for an event with a specific priority. The array need to be sorted with @ref
@@ -1899,7 +1911,6 @@ EOAPI void efl_wref_add(Eo *obj, Efl_Object **wref);
  */
 EOAPI void efl_wref_del(Eo *obj, Efl_Object **wref);
 
-
 /**
  * @brief Generic data with string key on an object.
  *
@@ -2183,6 +2194,32 @@ EAPI int efl_callbacks_cmp(const Efl_Callback_Array_Item 
*a, const Efl_Callback_
  return internal;   \
   }
 
+/**
+ * Helper for creating global scheduler arrays. The callback will be set by 
scheduler get.
+ * Problems occur here in windows where you can't declare a static array with
+ * external symbols in them. These addresses are only known at runtime.
+ * This also allows for automatic sorting for better performance.
+ */
+#define EFL_SCHEDULER_ARRAY_DEFINE(Name, ...)   \
+  static Efl_Callback_Array_Item *  \
+  Name(void)\
+  { \
+ const Efl_Event_Description *tmp[] = { __VA_ARGS__ };  \
+ static Efl_Callback_Array_Item internal[EINA_C_ARRAY_LENGTH(tmp) + 1] = { 
{ 0, 0 } }; \
+\
+ if (internal[0].desc == NULL)  \
+   {\
+  unsigned int i;   \
+\
+  for (i = 0; i < EINA_C_ARRAY_LENGTH(tmp); i++)\
+internal[i].desc = tmp[i];  \
+\
+  qsort(internal, EINA_C_ARRAY_LENGTH(internal) - 1, sizeof 
(internal[0]), \
+(int(*)(const void*,const void*)) efl_callbacks_cmp);   \
+   }\
+ return internal;   \
+  }
+
 /**
  * @def efl_event_callback_add(obj, desc, cb, data)
  * Add a callback for an event.
diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c
index a5efc38e70..d2e190df3d 100644
--- a/src/lib/eo/eo.c
+++ b/src/lib/eo/eo.c
@@ -2770,6 +2770,7 @@ efl_callbacks_cmp(const Efl_Callback_Array_Item *a, const 
Efl_Callback_Array_Ite
else return -1;
 }
 
+
 #ifdef EO_DEBUG
 /* NOTE: cannot use ecore_time_get()! */
 static inline double
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index d14a70ca0c..9f50d57538 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -40,6 +40,7 @@ typedef struct
Eina_Inlist   *generic_data;
Eo  ***wrefs;
Eina_Hash *providers;
+   Eina_Hash *schedulers;
 } Efl_Object_Extension;
 
 struct _Efl_Object_Data
@@ -155,7 +156,8 @@ _efl_object_extension_noneed(Efl_Object_Data *pd)
(ext->generic_data) ||
(ext->wrefs) ||
(ext->composite_parent) ||
-   (ext->providers)) return;
+   (ext->providers) ||
+   (ext->schedulers)) return;
_efl_

[EGIT] [core/efl] master 06/08: ecore: remove custom code for generating Eina_Future_Schedule attached on Efl.Loop.

2019-10-31 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit aacb6bc0c88095339bc707751e207fb3148d035f
Author: Cedric Bail 
Date:   Wed Oct 16 16:47:47 2019 -0700

ecore: remove custom code for generating Eina_Future_Schedule attached on 
Efl.Loop.

This leverage the new infrastructure from Eo that provide a scheduler for 
any event
attached to any object.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10481
---
 src/lib/ecore/ecore_events.c  | 121 --
 src/lib/ecore/ecore_private.h |  13 -
 src/lib/ecore/efl_loop.c  |  13 ++---
 3 files changed, 5 insertions(+), 142 deletions(-)

diff --git a/src/lib/ecore/ecore_events.c b/src/lib/ecore/ecore_events.c
index 2dfdaf05f5..c2fc813c6d 100644
--- a/src/lib/ecore/ecore_events.c
+++ b/src/lib/ecore/ecore_events.c
@@ -7,18 +7,6 @@
 #include "Ecore.h"
 #include "ecore_private.h"
 
-typedef struct _Ecore_Future_Schedule_Entry
-{
-   Eina_Future_Schedule_Entry base;
-   Eina_Future_Scheduler_Cb cb;
-   Eina_Future *future;
-   Eina_Value value;
-} Ecore_Future_Schedule_Entry;
-
-//
-static Eina_Mempool*mp_future_schedule_entry   = NULL;
-//
-
 static Ecore_Event_Message_Handler *_event_msg_handler = NULL;
 
 EAPI Ecore_Event_Handler *
@@ -123,104 +111,6 @@ ecore_event_current_event_get(void)
return ecore_event_message_handler_current_event_get(_event_msg_handler);
 }
 
-static void _future_dispatch_cb(void *data, const Efl_Event *ev EINA_UNUSED);
-static void _event_del_cb(void *data, const Efl_Event *ev);
-
-EFL_CALLBACKS_ARRAY_DEFINE(ecore_future_callbacks,
-   { EFL_LOOP_EVENT_IDLE_ENTER, _future_dispatch_cb },
-   { EFL_LOOP_EVENT_IDLE, _future_dispatch_cb },
-   { EFL_EVENT_DEL, _event_del_cb });
-
-static void
-_future_dispatch_cb(void *data, const Efl_Event *ev EINA_UNUSED)
-{
-   Efl_Loop_Future_Scheduler *loopsched = data;
-   Eina_List *entries = loopsched->future_entries;
-   Ecore_Future_Schedule_Entry *entry;
-
-   loopsched->future_entries = NULL;
-   efl_event_callback_array_del((Eo *) loopsched->loop, 
ecore_future_callbacks(), loopsched);
-
-   EINA_LIST_FREE(entries, entry)
- {
-entry->cb(entry->future, entry->value);
-eina_mempool_free(mp_future_schedule_entry, entry);
- }
-}
-
-static void
-_event_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
-{
-   Efl_Loop_Future_Scheduler *loopsched = data;
-   Eina_List *entries = loopsched->future_entries;
-   Ecore_Future_Schedule_Entry *entry;
-
-   loopsched->future_entries = NULL;
-   efl_event_callback_array_del((Eo *) loopsched->loop, 
ecore_future_callbacks(), loopsched);
-
-   EINA_LIST_FREE(entries, entry)
- {
-eina_future_cancel(entry->future);
-eina_value_flush(>value);
-eina_mempool_free(mp_future_schedule_entry, entry);
- }
-}
-
-static Eina_Future_Schedule_Entry *
-ecore_future_schedule(Eina_Future_Scheduler *sched,
-  Eina_Future_Scheduler_Cb cb,
-  Eina_Future *future,
-  Eina_Value value)
-{
-   Efl_Loop_Future_Scheduler *loopsched = (Efl_Loop_Future_Scheduler *)sched;
-   Ecore_Future_Schedule_Entry *entry;
-
-   entry = eina_mempool_malloc(mp_future_schedule_entry, sizeof(*entry));
-   EINA_SAFETY_ON_NULL_RETURN_VAL(entry, NULL);
-   entry->base.scheduler = sched;
-   entry->cb = cb;
-   entry->future = future;
-   entry->value = value;
-
-   if (!loopsched->future_entries)
- efl_event_callback_array_add((Eo *) loopsched->loop, 
ecore_future_callbacks(), loopsched);
-
-   loopsched->future_entries = eina_list_append(loopsched->future_entries, 
entry);
-   return >base;
-}
-
-static void
-ecore_future_recall(Eina_Future_Schedule_Entry *s_entry)
-{
-   Ecore_Future_Schedule_Entry *entry = (Ecore_Future_Schedule_Entry *)s_entry;
-   Efl_Loop_Future_Scheduler *loopsched;
-   Eina_List *lookup;
-
-   loopsched = (Efl_Loop_Future_Scheduler *) entry->base.scheduler;
-
-   lookup = eina_list_data_find_list(loopsched->future_entries, entry);
-   if (!lookup) return;
-
-   loopsched->future_entries = 
eina_list_remove_list(loopsched->future_entries, lookup);
-   if (!loopsched->future_entries)
- efl_event_callback_array_del((Eo *) loopsched->loop, 
ecore_future_callbacks(), loopsched);
-
-   eina_value_flush(>value);
-   eina_mempool_free(mp_future_schedule_entry, entry);
-
-}
-
-static Eina_Future_Scheduler ecore_future_scheduler = {
-   .schedule = ecore_future_schedule,
-   .recall = ecore_future_recall,
-};
-
-Eina_Future_Scheduler *
-_ecore_event_future_scheduler_get(void)
-{
-   return _future_scheduler;
-}
-
 Eina_Bool
 _ecore_event_init(void)
 {
@@ -262,17 +152,6 @@ _ecore_event_

[EGIT] [core/efl] master 03/08: ecore: remove unecessary code for Eina_Future scheduler.

2019-10-31 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 514a96f4d6d633ac3039259c5bc642de365ed347
Author: Cedric Bail 
Date:   Wed Oct 16 12:14:20 2019 -0700

ecore: remove unecessary code for Eina_Future scheduler.

As we do not rely on legacy Ecore Event directly anymore, we do not
need to mind the shutting down of EFL.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10477
---
 src/lib/ecore/ecore_events.c | 26 --
 1 file changed, 26 deletions(-)

diff --git a/src/lib/ecore/ecore_events.c b/src/lib/ecore/ecore_events.c
index 76de86b7a7..2dfdaf05f5 100644
--- a/src/lib/ecore/ecore_events.c
+++ b/src/lib/ecore/ecore_events.c
@@ -16,10 +16,7 @@ typedef struct _Ecore_Future_Schedule_Entry
 } Ecore_Future_Schedule_Entry;
 
 //
-// XXX: still using legacy ecore events
-static Eina_Boolshutting_down  = EINA_FALSE;
 static Eina_Mempool*mp_future_schedule_entry   = NULL;
-//
 //
 
 static Ecore_Event_Message_Handler *_event_msg_handler = NULL;
@@ -199,8 +196,6 @@ ecore_future_recall(Eina_Future_Schedule_Entry *s_entry)
Efl_Loop_Future_Scheduler *loopsched;
Eina_List *lookup;
 
-   if (shutting_down) return;
-
loopsched = (Efl_Loop_Future_Scheduler *) entry->base.scheduler;
 
lookup = eina_list_data_find_list(loopsched->future_entries, entry);
@@ -267,12 +262,6 @@ _ecore_event_init(void)
// ECORE_EVENT_COUNT11
// no need to do as it was a count, nto an event
 
-   //
-   // XXX: ecore future still using legacy...
-   shutting_down = EINA_FALSE;
-//   ECORE_EV_FUTURE_ID = ecore_event_type_new();
-//   future_handler = ecore_event_handler_add(ECORE_EV_FUTURE_ID, 
ecore_future_dispatched, NULL);
-//   EINA_SAFETY_ON_NULL_GOTO(future_handler, err_handler);
//FIXME: Is 512 too high?
if (!mp_future_schedule_entry)
  {
@@ -287,27 +276,12 @@ _ecore_event_init(void)
return EINA_TRUE;
 
  err_pool:
-// XXX:
-//   ecore_event_handler_del(future_handler);
-//   future_handler = NULL;
-// err_handler:
-//   ECORE_EV_FUTURE_ID = -1;
return EINA_FALSE;
 }
 
 void
 _ecore_event_shutdown(void)
 {
-   shutting_down = EINA_TRUE;
-
-   //
-   // XXX: ecore future still using legacy...
-//   ecore_event_handler_del(future_handler);
-//   future_handler = NULL;
-//   ECORE_EV_FUTURE_ID = -1;
-   //
-   //
-
efl_loop_message_handler_message_clear(_event_msg_handler);
_event_msg_handler = NULL;
 }

-- 




[EGIT] [core/efl] master 02/08: ecore: remove unecessary field in data structure.

2019-10-31 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 2401dae848757a2928048310b7c3870e49da8924
Author: Cedric Bail 
Date:   Wed Oct 16 10:04:29 2019 -0700

ecore: remove unecessary field in data structure.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10476
---
 src/lib/ecore/ecore_private.h | 1 -
 src/lib/ecore/efl_loop.c  | 1 -
 src/lib/eo/eo_base_class.c| 1 -
 3 files changed, 3 deletions(-)

diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h
index f56cbae30a..84566b5a96 100644
--- a/src/lib/ecore/ecore_private.h
+++ b/src/lib/ecore/ecore_private.h
@@ -108,7 +108,6 @@ struct _Efl_Loop_Future_Scheduler
 {
Eina_Future_Scheduler  eina_future_scheduler;
const Eo  *loop;
-   Efl_Loop_Data *loop_data;
 
Eina_List *future_entries;
 };
diff --git a/src/lib/ecore/efl_loop.c b/src/lib/ecore/efl_loop.c
index 9a36d74658..774ec5ea49 100644
--- a/src/lib/ecore/efl_loop.c
+++ b/src/lib/ecore/efl_loop.c
@@ -681,7 +681,6 @@ efl_loop_future_scheduler_get(const Eo *obj)
_ecore_event_future_scheduler_get();
  pd->future_scheduler.eina_future_scheduler = *sched;
  pd->future_scheduler.loop = obj;
- pd->future_scheduler.loop_data = pd;
   }
 return &(pd->future_scheduler.eina_future_scheduler);
  }
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index b3cd4a6533..d14a70ca0c 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -1164,7 +1164,6 @@ _legacy_events_hash_free_cb(void *_desc)
 }
 
 /* EOF Legacy */
-
 struct _Eo_Callback_Description
 {
union

-- 




[EGIT] [core/efl] master 04/08: eina: only the type need to be NULL to assume EINA_VALUE_EMPTY.

2019-10-31 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 2f1894d054bb2b340117169204f8a01ff7e5dd3e
Author: Cedric Bail 
Date:   Wed Oct 16 16:45:50 2019 -0700

eina: only the type need to be NULL to assume EINA_VALUE_EMPTY.

This avoid comparison with potentially uninitialized byte.

Reviewed-by: Mike Blumenkrantz 
Differential Revision: https://phab.enlightenment.org/D10479
---
 src/lib/eina/eina_value.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c
index 63f45b9bbe..0596b70e9f 100644
--- a/src/lib/eina/eina_value.c
+++ b/src/lib/eina/eina_value.c
@@ -5664,7 +5664,7 @@ eina_value_copy(const Eina_Value *value, Eina_Value *copy)
 
EINA_SAFETY_ON_NULL_RETURN_VAL(value, EINA_FALSE);
 
-   if (!memcmp(value, &_eina_value_empty, sizeof (Eina_Value)))
+   if (value->type == NULL)
  {
 memcpy(copy, &_eina_value_empty, sizeof (Eina_Value));
 return EINA_TRUE;

-- 




[EGIT] [core/efl] master 01/08: eo: prevent unecessary callback call walk.

2019-10-31 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 7f53d9158395504151e1ff3dcae715a799d913a8
Author: Cedric Bail 
Date:   Tue Oct 15 17:04:32 2019 -0700

eo: prevent unecessary callback call walk.

This patch introduce a small hash (64 or 32bits) that cache all existing
Efl_Event_Description callback handler registered on an object. It slightly
reduce the time needed to do an unecessary call and cost just a few bytes
per object.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10475
---
 src/lib/eo/eo_base_class.c   | 30 ++
 src/tests/eo/suite/eo_test_general.c |  4 ++--
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 67deec898a..b3cd4a6533 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -53,6 +53,11 @@ struct _Efl_Object_Data
 
Efl_Event_Callback_Frame  *event_frame;
Eo_Callback_Description  **callbacks;
+#ifdef EFL64
+   uint64_t   callbacks_mask;
+#else
+   uint32_t   callbacks_mask;
+#endif
Eina_Inlist   *pending_futures;
unsigned int   callbacks_count;
 
@@ -1209,9 +1214,26 @@ _efl_pending_future_new(void)
 #define CB_COUNT_INC(cnt) do { if ((cnt) != 0x) (cnt)++; } while(0)
 #define CB_COUNT_DEC(cnt) do { if ((cnt) != 0x) (cnt)--; } while(0)
 
+static inline unsigned char
+_pointer_hash(const uintptr_t val)
+{
+   static const unsigned char shift = (unsigned char) log2(1 + sizeof 
(Efl_Event_Description));
+#ifdef EFL64
+   return (unsigned char)(((val) >> shift) & 0x3F);
+#else
+   return (unsigned char)(((val) >> shift) & 0x1F);
+#endif
+}
+
 static inline void
 _special_event_count_inc(Eo *obj_id, Efl_Object_Data *pd, const 
Efl_Callback_Array_Item *it)
 {
+   int event_hash;
+
+   event_hash = _pointer_hash((uintptr_t) it->desc);
+
+   pd->callbacks_mask |= 1 << event_hash;
+
if  (it->desc == EFL_EVENT_CALLBACK_ADD)
  CB_COUNT_INC(pd->event_cb_efl_event_callback_add_count);
else if (it->desc == EFL_EVENT_CALLBACK_DEL)
@@ -1682,6 +1704,7 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
   .inserted_before = 0,
   .generation = 1,
};
+   int event_hash;
 
if (pd->callbacks_count == 0) return EINA_FALSE;
else if ((desc == EFL_EVENT_CALLBACK_ADD) &&
@@ -1695,6 +1718,13 @@ _event_callback_call(Eo *obj_id, Efl_Object_Data *pd,
else if ((desc == EFL_EVENT_NOREF) &&
 (pd->event_cb_efl_event_noref_count == 0)) return EINA_FALSE;
 
+   if (!legacy_compare)
+ {
+event_hash = _pointer_hash((uintptr_t) desc);
+if (!(pd->callbacks_mask & (1 << event_hash)))
+  return EINA_FALSE;
+ }
+
if (pd->event_frame)
  frame.generation = 
((Efl_Event_Callback_Frame*)pd->event_frame)->generation + 1;
 
diff --git a/src/tests/eo/suite/eo_test_general.c 
b/src/tests/eo/suite/eo_test_general.c
index 1494f46c95..61bf10b8e5 100644
--- a/src/tests/eo/suite/eo_test_general.c
+++ b/src/tests/eo/suite/eo_test_general.c
@@ -1808,9 +1808,9 @@ EFL_START_TEST(efl_object_size)
// Update this number only if you modified the class size on purpose
 
 #ifdef EO_DEBUG
-   ck_assert_int_le(efl_class_memory_size_get(SIMPLE_CLASS), 164);
+   ck_assert_int_le(efl_class_memory_size_get(SIMPLE_CLASS), 180);
 #else
-   ck_assert_int_le(efl_class_memory_size_get(SIMPLE_CLASS), 148);
+   ck_assert_int_le(efl_class_memory_size_get(SIMPLE_CLASS), 164);
 #endif
 }
 EFL_END_TEST

-- 




[EGIT] [core/efl] master 03/03: elementary: handle case when XFIXES is not available.

2019-10-31 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 9852e6cabc529e2f4bcb2863c13d1309c75327c8
Author: Cedric Bail 
Date:   Thu Oct 31 09:17:53 2019 -0400

elementary: handle case when XFIXES is not available.

Summary:
ECORE_X_EVENT_FIXES_SELECTION_NOTIFY is only initialized when XFIXES
is available. If ecore_event_handler_add is called with type == 0, it
will trigger an abort and elementary would not initialize properly.

Depends on D10491

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10492
---
 src/lib/elementary/efl_ui_selection_manager.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_selection_manager.c 
b/src/lib/elementary/efl_ui_selection_manager.c
index 3c8ab8d9ab..3a5db9713c 100644
--- a/src/lib/elementary/efl_ui_selection_manager.c
+++ b/src/lib/elementary/efl_ui_selection_manager.c
@@ -5475,8 +5475,9 @@ _efl_ui_selection_manager_efl_object_constructor(Eo *obj, 
Efl_Ui_Selection_Manag
  
_efl_sel_manager_x11_selection_notify, pd);
 pd->clear_handler = 
ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR,
 _x11_selection_clear, pd);
-pd->fix_handler = 
ecore_event_handler_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY,
-  _x11_fixes_selection_notify, 
pd);
+if (ECORE_X_EVENT_FIXES_SELECTION_NOTIFY) // If XFIXES is not 
available ECORE_X_EVENT_FIXES_SELECTION_NOTIFY would be NULL
+  pd->fix_handler = 
ecore_event_handler_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY,
+
_x11_fixes_selection_notify, pd);
  }
 #endif
 

-- 




[EGIT] [core/efl] master 02/03: edje: load edje seat callback only when necessary.

2019-10-31 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit e502da834592b5e13b09a509fd5c9c0ac9d093d7
Author: Cedric Bail 
Date:   Thu Oct 31 09:17:46 2019 -0400

edje: load edje seat callback only when necessary.

Summary:
This reduce in elementary_test the number of callback registered on the
canvas from hundreds to around 10.

Depends on D10486

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10487
---
 src/lib/edje/edje_cache.c   | 37 -
 src/lib/edje/edje_legacy.c  |  2 +-
 src/lib/edje/edje_load.c|  7 +--
 src/lib/edje/edje_private.h | 15 ++-
 src/lib/edje/edje_program.c | 15 ---
 5 files changed, 56 insertions(+), 20 deletions(-)

diff --git a/src/lib/edje/edje_cache.c b/src/lib/edje/edje_cache.c
index 20ae174f5d..64eb6ad5ec 100644
--- a/src/lib/edje/edje_cache.c
+++ b/src/lib/edje/edje_cache.c
@@ -140,9 +140,9 @@ _edje_programs_patterns_init(Edje_Part_Collection *edc)
j = 0;
 
/* FIXME: Build specialized data type for each case */
-#define EDJE_LOAD_PROGRAMS_ADD(Array, Edc, It, Git, All)  \
-  for (It = 0; It < Edc->programs.Array##_count; ++It, ++Git) \
-All[Git] = Edc->programs.Array[It];
+#define EDJE_LOAD_PROGRAMS_ADD(Array, Edc, It, Git, All)\
+   for (It = 0; It < Edc->programs.Array##_count; ++It, ++Git)  \
+ All[Git] = Edc->programs.Array[It];
 
EDJE_LOAD_PROGRAMS_ADD(fnmatch, edc, i, j, all);
EDJE_LOAD_PROGRAMS_ADD(strncmp, edc, i, j, all);
@@ -367,12 +367,14 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
   {
  edc->patterns.table_programs_size = n;
 
-#define EDJE_LOAD_BUILD_TABLE(Array, Edc, It, Tmp) \
-  for (It = 0; It < Edc->programs.Array##_count; ++It) \
-{  \
-   Tmp = Edc->programs.Array[It];  \
-   Edc->patterns.table_programs[Tmp->id] = Tmp;\
-}
+#define EDJE_LOAD_BUILD_TABLE(Array, Edc, It, Tmp)  \
+ for (It = 0; It < Edc->programs.Array##_count; ++It)   \
+   {\
+  Tmp = Edc->programs.Array[It];\
+  Edc->patterns.table_programs[Tmp->id] = Tmp;  \
+  if (!Edc->need_seat && Tmp->signal && !strncmp(Tmp->signal, 
"seat,", 5)) \
+Edc->need_seat = EINA_TRUE; \
+   }
 
  EDJE_LOAD_BUILD_TABLE(fnmatch, edc, i, pr);
  EDJE_LOAD_BUILD_TABLE(strcmp, edc, i, pr);
@@ -382,6 +384,23 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
   }
  }
 
+   /* Search for the use of allowed seat used by part if we still do not know 
if seat are needed. */
+   if (!edc->need_seat)
+ {
+unsigned int i;
+
+for (i = 0; i < edc->parts_count; i++)
+  {
+ Edje_Part *part = edc->parts[i];
+
+ if (part->allowed_seats)
+   {
+  edc->need_seat = EINA_TRUE;
+  break;
+   }
+  }
+ }
+
_edje_part_collection_fix(edc);
 
return edc;
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index a72b951058..5ac97c706c 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -78,7 +78,7 @@ edje_object_signal_callback_add(Evas_Object *obj, const char 
*emission, const ch
 
ed = _edje_fetch(obj);
if (!ed || ed->delete_me) return;
-   _edje_object_signal_callback_add(ed, emission, source, func, NULL, NULL, 
data);
+   _edje_object_signal_callback_add(obj, ed, emission, source, func, NULL, 
NULL, data);
 }
 
 EAPI void *
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 0c43475bf5..92713a2325 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -670,12 +670,14 @@ _edje_device_canvas_del(void *data, const Efl_Event 
*event)
  efl_event_callback_array_del(event->object, edje_device_callbacks(), ed);
 }
 
-static void
+void
 _edje_devices_add(Edje *ed, Evas *tev)
 {
const Eina_List *devices, *l;
Efl_Input_Device *dev;
 
+   ed->need_seat = EINA_TRUE;
+
devices = evas_device_list(tev, NULL);
EINA_LIST_FOREACH(devices, l, dev)
  {
@@ -868,7 +870,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const 
Eina_File *file, const ch
}
 
  /* handle multiseat stuff */
- _edje_devices_add(ed, tev);
+ if (ed->

[EGIT] [core/efl] master 01/03: edje: improve callback count on Evas canvas.

2019-10-31 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 27e1bf2fe3778b6460b40fd20de3eb41988110df
Author: Cedric Bail 
Date:   Thu Oct 31 09:17:40 2019 -0400

edje: improve callback count on Evas canvas.

Summary:
This reduce by 3 the amount of callback registered on the canvas. Another
potential improvement would be to only register those callback if someone
is listening for a 'seat,*' event or if the edje file define seat filters.

Depends on D10484

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10486
---
 src/lib/edje/edje_load.c | 43 ++-
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 5bfd11fb82..0c43475bf5 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -646,18 +646,28 @@ _edje_device_changed_cb(void *data, const Efl_Event 
*event)
_edje_seat_event_filter_apply(ed, seat);
 }
 
+static void _edje_device_canvas_del(void *data, const Efl_Event *event);
+
+EFL_CALLBACKS_ARRAY_DEFINE(edje_device_callbacks,
+   { EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED, 
_edje_device_added_cb },
+   { EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED, 
_edje_device_removed_cb },
+   { EFL_EVENT_DEL, _edje_device_canvas_del });
+
+EFL_CALLBACKS_ARRAY_DEFINE(edje_device_custom_callbacks,
+   { EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED, 
_edje_device_changed_cb },
+   { EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED, 
_edje_device_added_cb },
+   { EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED, 
_edje_device_removed_cb },
+   { EFL_EVENT_DEL, _edje_device_canvas_del });
+
 static void
 _edje_device_canvas_del(void *data, const Efl_Event *event)
 {
Edje *ed = data;
-   efl_event_callback_del(event->object, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
-  _edje_device_added_cb, ed);
-   efl_event_callback_del(event->object, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
-  _edje_device_removed_cb, ed);
 
if (ed->collection && ed->collection->use_custom_seat_names)
- efl_event_callback_del(event->object, 
EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED,
-_edje_device_changed_cb, ed);
+ efl_event_callback_array_del(event->object, 
edje_device_custom_callbacks(), ed);
+   else
+ efl_event_callback_array_del(event->object, edje_device_callbacks(), ed);
 }
 
 static void
@@ -672,16 +682,11 @@ _edje_devices_add(Edje *ed, Evas *tev)
 if (efl_input_device_type_get(dev) == EFL_INPUT_DEVICE_TYPE_SEAT)
   _edje_device_add(ed, dev);
  }
-   efl_event_callback_add(tev, EFL_EVENT_DEL, _edje_device_canvas_del, ed);
-
-   efl_event_callback_add(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
-  _edje_device_added_cb, ed);
-   efl_event_callback_add(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
-  _edje_device_removed_cb, ed);
 
if (ed->collection && ed->collection->use_custom_seat_names)
- efl_event_callback_add(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED,
-_edje_device_changed_cb, ed);
+ efl_event_callback_array_add(tev, edje_device_custom_callbacks(), ed);
+   else
+ efl_event_callback_array_add(tev, edje_device_callbacks(), ed);
 }
 
 static inline void
@@ -1880,14 +1885,10 @@ _edje_file_callbacks_del(Edje *ed, Evas *e)
Evas *tev = e;
 
if (!tev) tev = evas_object_evas_get(ed->obj);
-   efl_event_callback_del(tev, EFL_EVENT_DEL, _edje_device_canvas_del, ed);
-   efl_event_callback_del(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_ADDED,
-  _edje_device_added_cb, ed);
-   efl_event_callback_del(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVED,
-  _edje_device_removed_cb, ed);
if (ed->collection && ed->collection->use_custom_seat_names)
- efl_event_callback_del(tev, EFL_CANVAS_SCENE_EVENT_DEVICE_CHANGED,
-_edje_device_changed_cb, ed);
+ efl_event_callback_array_del(tev, edje_device_custom_callbacks(), ed);
+   else
+ efl_event_callback_array_del(tev, edje_device_callbacks(), ed);
 }
 
 void

-- 




[EGIT] [core/efl] master 01/04: eina: change default policy of Chained Mempool to recycle memory right away.

2019-10-30 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 1f445dd12db8cfeb8c4d9c5334ca9ba490bef9f3
Author: Cedric BAIL 
Date:   Fri Oct 25 07:58:31 2019 -0700

eina: change default policy of Chained Mempool to recycle memory right away.

Until now, Chained Mempool would first empty its pool and the started to
recycle memory. Now it does always try to recycle first. This should limit
memory fragmentation to some extend.

Reviewed-by: Mike Blumenkrantz 
Differential Revision: https://phab.enlightenment.org/D10534
---
 .../eina/mp/chained_pool/eina_chained_mempool.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c 
b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
index 6d4facf74d..f70339e080 100644
--- a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
+++ b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
@@ -182,16 +182,10 @@ _eina_chained_mempool_usage_cmp(const Eina_Inlist *l1, 
const Eina_Inlist *l2)
 static void *
 _eina_chained_mempool_alloc_in(Chained_Mempool *pool, Chained_Pool *p)
 {
-  void *mem;
+  void *mem = NULL;
 
-  if (p->last)
-{
-  mem = p->last;
-  p->last += pool->item_alloc;
-  if (p->last >= p->limit)
-p->last = NULL;
-}
-  else
+  // Let's try to first recycle memory
+  if (p->base)
 {
 #ifndef NVALGRIND
   VALGRIND_MAKE_MEM_DEFINED(p->base, pool->item_alloc);
@@ -199,6 +193,13 @@ _eina_chained_mempool_alloc_in(Chained_Mempool *pool, 
Chained_Pool *p)
   // Request a free pointer
   mem = eina_trash_pop(>base);
 }
+  else if (p->last)
+{
+  mem = p->last;
+  p->last += pool->item_alloc;
+  if (p->last >= p->limit)
+p->last = NULL;
+}
 
   // move to end - it just filled up
   if (!p->base && !p->last)
@@ -306,7 +307,7 @@ eina_chained_mempool_malloc(void *data, EINA_UNUSED 
unsigned int size)
 
// we have reached the end of the list - no free pools
if (!p)
- {
+  {
//new chain created ,point it to be the first_fill chain
 pool->first_fill = _eina_chained_mp_pool_new(pool);
 if (!pool->first_fill)

-- 




[EGIT] [core/efl] master 03/04: eina: make use of the new near allocation policy for Eina_List.

2019-10-30 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit efbc90ff87dd75c9887ba4d11837920d25270162
Author: Cedric BAIL 
Date:   Fri Oct 25 08:00:23 2019 -0700

eina: make use of the new near allocation policy for Eina_List.

The idea is to improve memory locality and hopefully get better cache hit
in general.

Reviewed-by: Mike Blumenkrantz 
Differential Revision: https://phab.enlightenment.org/D10536
---
 src/lib/eina/eina_list.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lib/eina/eina_list.c b/src/lib/eina/eina_list.c
index 844e387293..d81bf6cb63 100644
--- a/src/lib/eina/eina_list.c
+++ b/src/lib/eina/eina_list.c
@@ -213,11 +213,11 @@ _eina_list_mempool_accounting_free(Eina_List_Accounting 
*accounting)
 }
 
 static inline Eina_List *
-_eina_list_mempool_list_new(EINA_UNUSED Eina_List *list)
+_eina_list_mempool_list_new(Eina_List *before, Eina_List *after)
 {
Eina_List *tmp;
 
-   tmp = eina_mempool_malloc(_eina_list_mp, sizeof (Eina_List));
+   tmp = eina_mempool_malloc_near(_eina_list_mp, before, after, sizeof 
(Eina_List));
if (!tmp)
  return NULL;
 #ifdef EINA_LIST_MAGIC
@@ -585,7 +585,7 @@ eina_list_append(Eina_List *list, const void *data)
 {
Eina_List *l, *new_l;
 
-   new_l = _eina_list_mempool_list_new(list);
+   new_l = _eina_list_mempool_list_new(NULL, list);
if (!new_l) return list;
 
new_l->next = NULL;
@@ -619,7 +619,7 @@ eina_list_prepend(Eina_List *list, const void *data)
 {
Eina_List *new_l;
 
-   new_l = _eina_list_mempool_list_new(list);
+   new_l = _eina_list_mempool_list_new(list, NULL);
if (!new_l) return list;
 
new_l->prev = NULL;
@@ -680,7 +680,7 @@ eina_list_append_relative_list(Eina_List *list,
EINA_MAGIC_CHECK_LIST(relative, NULL);
 #endif
 
-   new_l = _eina_list_mempool_list_new(list);
+   new_l = _eina_list_mempool_list_new(relative, relative->next);
if (!new_l) return list;
 
new_l->next = relative->next;
@@ -733,7 +733,7 @@ eina_list_prepend_relative_list(Eina_List *list,
 #ifdef EINA_LIST_MAGIC
EINA_MAGIC_CHECK_LIST(relative, NULL);
 #endif
-   new_l = _eina_list_mempool_list_new(list);
+   new_l = _eina_list_mempool_list_new(relative->prev, relative);
if (!new_l) return list;
 
new_l->prev = relative->prev;

-- 




[EGIT] [core/efl] master 04/04: eina: introduce a simple malloc near implementation for Chained Mempool.

2019-10-30 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 313796a4f6d642dfdc75a99d2f3934e656938330
Author: Cedric BAIL 
Date:   Fri Oct 25 09:11:06 2019 -0700

eina: introduce a simple malloc near implementation for Chained Mempool.

This actually seems to significantly and reliably improve speed result with
expedite in a higher way than I expected (~10%) which is neat, I guess.

Reviewed-by: Mike Blumenkrantz 
Differential Revision: https://phab.enlightenment.org/D10537
---
 .../eina/mp/chained_pool/eina_chained_mempool.c| 52 +-
 1 file changed, 51 insertions(+), 1 deletion(-)

diff --git a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c 
b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
index 1917e07921..261b02c200 100644
--- a/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
+++ b/src/modules/eina/mp/chained_pool/eina_chained_mempool.c
@@ -371,6 +371,56 @@ eina_chained_mempool_free(void *data, void *ptr)
return;
 }
 
+static void *
+eina_chained_mempool_malloc_near(void *data,
+ void *after, void *before,
+ unsigned int size EINA_UNUSED)
+{
+   Chained_Mempool *pool = data;
+   Chained_Pool *p = NULL;
+   void *mem = NULL;
+
+   if (!eina_spinlock_take(>mutex))
+ {
+#ifdef EINA_HAVE_DEBUG_THREADS
+assert(eina_thread_equal(pool->self, eina_thread_self()));
+#endif
+ }
+
+   if (after)
+ {
+Eina_Rbtree *r = eina_rbtree_inline_lookup(pool->root, after,
+   0, 
_eina_chained_mp_pool_key_cmp, NULL);
+
+if (r)
+  {
+ p = EINA_RBTREE_CONTAINER_GET(r, Chained_Pool);
+
+ if (!p->base && !p->last)
+   p = NULL;
+  }
+ }
+
+   if (before && p == NULL)
+ {
+Eina_Rbtree *r = eina_rbtree_inline_lookup(pool->root, before,
+   0, 
_eina_chained_mp_pool_key_cmp, NULL);
+if (r)
+  {
+ p = EINA_RBTREE_CONTAINER_GET(r, Chained_Pool);
+ if (!p->base && !p->last)
+   p = NULL;
+  }
+ }
+
+   if (p) mem = _eina_chained_mempool_alloc_in(pool, p);
+
+   eina_spinlock_release(>mutex);
+
+   if (!mem) return eina_chained_mempool_malloc(pool, size);
+   return mem;
+}
+
 static Eina_Bool
 eina_chained_mempool_from(void *data, void *ptr)
 {
@@ -727,7 +777,7 @@ static Eina_Mempool_Backend _eina_chained_mp_backend = {
_chained_mempool_repack,
_chained_mempool_from,
_chained_mempool_iterator_new,
-   NULL
+   _chained_mempool_malloc_near
 };
 
 Eina_Bool chained_init(void)

-- 




[EGIT] [core/efl] master 02/04: eina: introduce an API for requesting memory near already allocated memory from an Eina_Mempool.

2019-10-30 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit fb5cf0197707494b5b6d961ea9301b92e1ec34e3
Author: Cedric BAIL 
Date:   Fri Oct 25 08:01:35 2019 -0700

eina: introduce an API for requesting memory near already allocated memory 
from an Eina_Mempool.

Reviewed-by: Mike Blumenkrantz 
Differential Revision: https://phab.enlightenment.org/D10535
---
 src/lib/eina/eina_inline_mempool.x | 14 +
 src/lib/eina/eina_mempool.c|  3 ++-
 src/lib/eina/eina_mempool.h| 23 ++
 .../eina/mp/chained_pool/eina_chained_mempool.c|  3 ++-
 src/modules/eina/mp/one_big/eina_one_big.c |  3 ++-
 .../eina/mp/pass_through/eina_pass_through.c   |  1 +
 6 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/src/lib/eina/eina_inline_mempool.x 
b/src/lib/eina/eina_inline_mempool.x
index 0805c82f07..b0ab81587d 100644
--- a/src/lib/eina/eina_inline_mempool.x
+++ b/src/lib/eina/eina_inline_mempool.x
@@ -61,6 +61,11 @@ struct _Eina_Mempool_Backend
 * @use eina_mempool_iterator_new
 */
Eina_Iterator *(*iterator)(void *data);
+   /** Function to allocate memory near already allocated memory.
+* @since 1.24
+* @use eina_mempool_malloc_near
+*/
+   void *(*alloc_near)(void *data, void *after, void *before, unsigned int 
size);
 };
 
 struct _Eina_Mempool_Backend_ABI1
@@ -80,6 +85,7 @@ struct _Eina_Mempool_Backend_ABI2
void (*repack)(void *data, Eina_Mempool_Repack_Cb cb, void *cb_data);
Eina_Bool (*from)(void *data, void *element);
Eina_Iterator *(*iterator)(void *data);
+   void *(*alloc_near)(void *data, void *after, void *before, unsigned int 
size);
 };
 
 struct _Eina_Mempool
@@ -101,6 +107,14 @@ eina_mempool_malloc(Eina_Mempool *mp, unsigned int size)
return mp->backend.alloc(mp->backend_data, size);
 }
 
+static inline void *
+eina_mempool_malloc_near(Eina_Mempool *mp, void *after, void *before, unsigned 
int size)
+{
+   if (mp->backend2 && mp->backend2->alloc_near && (!(after == NULL && before 
== NULL)))
+ return mp->backend2->alloc_near(mp->backend_data, after, before, size);
+   return mp->backend.alloc(mp->backend_data, size);
+}
+
 static inline void *
 eina_mempool_calloc(Eina_Mempool *mp, unsigned int size)
 {
diff --git a/src/lib/eina/eina_mempool.c b/src/lib/eina/eina_mempool.c
index 51a29906f2..93c32e9d7e 100644
--- a/src/lib/eina/eina_mempool.c
+++ b/src/lib/eina/eina_mempool.c
@@ -98,13 +98,14 @@ _new_va(const char *name,
SBP(shutdown);
 #undef SBP
 
-   if (be->repack || be->from)
+   if (be->repack || be->from || be->iterator || be->alloc_near)
  {
 mp->backend2 = calloc(1, sizeof (Eina_Mempool_Backend_ABI2));
 if (!mp->backend2) goto on_error;
 mp->backend2->repack = be->repack;
 mp->backend2->from = be->from;
 mp->backend2->iterator = be->iterator;
+mp->backend2->alloc_near = be->alloc_near;
  }
 
mp->backend_data = mp->backend.init(context, options, args);
diff --git a/src/lib/eina/eina_mempool.h b/src/lib/eina/eina_mempool.h
index d7759ce6c8..9b845c6565 100644
--- a/src/lib/eina/eina_mempool.h
+++ b/src/lib/eina/eina_mempool.h
@@ -124,6 +124,29 @@ static inline void *eina_mempool_realloc(Eina_Mempool *mp, 
void *element, unsign
  */
 static inline void *eina_mempool_malloc(Eina_Mempool *mp, unsigned int size) 
EINA_MALLOC EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
 
+/**
+ * @brief Allocates memory in the given mempool using locality hint to improve 
future memory access use.
+ *
+ * @param[in] mp The mempool
+ * @param[in] after Hint to the nearest pointer after which to try find an 
empty spot.
+ * @param[in] before Hint to the nearest pointer before which to try find an 
empty spot.
+ * @param[in] size The size in bytes to allocate
+ * @return The newly allocated data that might be near @p after and @p before.
+ *
+ * This function is to be used to improve cache locality of structure that are 
likely to be used
+ * one after another. An example of this use would be Eina_List.
+ *
+ * @note This function allocates and returns @p size bytes using the mempool 
@p mp.
+ *   If not used anymore, the data must be freed with eina_mempool_free().
+ * @note @p after and @p before must be either @c NULL or allocated by the 
same mempool
+ *   @p mp. They are hint and if no space near them is found, memory will 
be allocated
+ *   without locality improvement.
+ * @warning No checks are done for @p mp.
+ *
+ * @see eina_mempool_free()
+ */
+static inline void *eina_mempool_malloc_near(Eina_Mempool *mp, void *after, 
void *before, unsigned int size) EINA_WARN_UNUSED_RESULT;
+
 /**
  * @brief Allocates and zeros memory using the given mempool.
  *
diff --git a/

[EGIT] [core/efl] master 01/01: evas: disable Eina Cow Garbage Collection on dynamic content.

2019-10-25 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 4329b88df4712c8c44794d1fe94de333d9bbfab1
Author: Cedric BAIL 
Date:   Fri Oct 25 15:45:14 2019 -0400

evas: disable Eina Cow Garbage Collection on dynamic content.

Summary:
Dynamic content are likely to trigger an image state change at pretty
much every frame. This lead to unecessary attempt by Eina_Cow to
deduplicate/cleanup data that are changing all the time. This reduce
memory consumption in Expedite tests that in some small amount. The
gain get bigger the more animation you get on screen. There might be
other potential gain for heavy animated case.

Reviewers: zmike, Hermet, bu5hm4n, smohanty

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8302

Differential Revision: https://phab.enlightenment.org/D10532
---
 src/lib/evas/canvas/evas_image_private.h | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_image_private.h 
b/src/lib/evas/canvas/evas_image_private.h
index 2d468184eb..6d18205d1f 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -231,7 +231,10 @@ void _evas_image_load(Evas_Object *eo_obj, 
Evas_Object_Protected_Data *obj, Evas
   EINA_COW_WRITE_BEGIN(evas_object_image_state_cow, Obj->cur, 
Evas_Object_Image_State, Write)
 
 # define EINA_COW_IMAGE_STATE_WRITE_END(Obj, Write) \
-  EINA_COW_WRITE_END(evas_object_image_state_cow, Obj->cur, Write)
+  eina_cow_done(evas_object_image_state_cow, ((const 
Eina_Cow_Data**)&(Obj->cur)), Write, \
+Obj->content_hint == EFL_GFX_IMAGE_CONTENT_HINT_DYNAMIC ? 
EINA_FALSE : EINA_TRUE); \
+  } \
+  while (0);
 
 # define EINA_COW_PIXEL_WRITE_BEGIN(Obj, Write) \
   EINA_COW_WRITE_BEGIN(evas_object_image_pixels_cow, Obj->pixels, 
Evas_Object_Image_Pixels, Write)

-- 




[EGIT] [core/efl] master 11/11: ecore_con: use only Eina_Magic infrastructure for set and check in Ecore_Con_Url.

2019-10-14 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 18de24baeb17b13d1f0719db66253f2c001ab283
Author: Cedric BAIL 
Date:   Mon Oct 14 09:38:23 2019 -0400

ecore_con: use only Eina_Magic infrastructure for set and check in 
Ecore_Con_Url.

Summary:
We can not have half our code rely on Ecore magic check and the other half
use Eina_Magic or this will lead to inconsistency with Eina_Magic 
definition.

Reviewers: zmike, segfaultxavi, bu5hm4n, raster

Reviewed By: raster

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10383
---
 src/lib/ecore_con/ecore_con_url.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/ecore_con/ecore_con_url.c 
b/src/lib/ecore_con/ecore_con_url.c
index 27b391c32d..c92af111c9 100644
--- a/src/lib/ecore_con/ecore_con_url.c
+++ b/src/lib/ecore_con/ecore_con_url.c
@@ -159,7 +159,7 @@ struct _Ecore_Con_Url
 #define ECORE_CON_URL_CHECK_RETURN(u, ...) \
   do \
 { \
-   if (!ECORE_MAGIC_CHECK(u, ECORE_MAGIC_CON_URL)) \
+   if (!EINA_MAGIC_CHECK(u, ECORE_MAGIC_CON_URL)) \
  { \
 ECORE_MAGIC_FAIL(u, ECORE_MAGIC_CON_URL, __FUNCTION__); \
 return __VA_ARGS__; \

-- 




[EGIT] [core/efl] master 03/03: ecore_con: use only Eina_Magic infrastructure for set and check in Ecore_Con.

2019-10-11 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 8b5ffea13101faa5205e6d6b1feabb0479ebfd69
Author: Cedric BAIL 
Date:   Fri Oct 11 08:51:53 2019 -0400

ecore_con: use only Eina_Magic infrastructure for set and check in 
Ecore_Con.

Summary:
We can not have half our code rely on Ecore magic check and the other half
use Eina_Magic or this will lead to inconsistency with Eina_Magic 
definition.
Depends on D10363

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10364
---
 src/lib/ecore_con/ecore_con_legacy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_con/ecore_con_legacy.c 
b/src/lib/ecore_con/ecore_con_legacy.c
index d1c402e045..050a30f1f2 100644
--- a/src/lib/ecore_con/ecore_con_legacy.c
+++ b/src/lib/ecore_con/ecore_con_legacy.c
@@ -93,7 +93,7 @@ typedef struct _Ecore_Con_Lookup_Ctx {
   do\
 {   \
if (!svr) return __VA_ARGS__;\
-   if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER)) \
+   if (!EINA_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))  \
  {  \
 ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_CON_SERVER, __FUNCTION__); \
 return __VA_ARGS__; \
@@ -113,7 +113,7 @@ typedef struct _Ecore_Con_Lookup_Ctx {
   do\
 {   \
if (!cl) return __VA_ARGS__; \
-   if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT))  \
+   if (!EINA_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT))   \
  {  \
 ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, __FUNCTION__); \
 return __VA_ARGS__; \

-- 




[EGIT] [core/efl] master 02/03: ecore_con: do not crash in test if nothing is returned by Ecore_Con_Url.

2019-10-11 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit e5c1eb57471b39208e578dac434bf71198f0373e
Author: Cedric BAIL 
Date:   Fri Oct 11 08:51:48 2019 -0400

ecore_con: do not crash in test if nothing is returned by Ecore_Con_Url.

Summary: Depends on D10362

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10363
---
 src/tests/ecore_con/ecore_con_test_ecore_con_url.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/tests/ecore_con/ecore_con_test_ecore_con_url.c 
b/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
index bdf26f07c3..69552485e9 100644
--- a/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
+++ b/src/tests/ecore_con/ecore_con_test_ecore_con_url.c
@@ -259,9 +259,11 @@ EFL_START_TEST(ecore_con_test_ecore_con_url_download)
 
ecore_con_url_verbose_set(url, EINA_TRUE);
 
+   fail_unless (ecore_con_url_url_get(url));
fail_if (strcmp(ecore_con_url_url_get(url), link));
 
ecore_con_url_data_set(url, url_data);
+   fail_unless (ecore_con_url_data_get(url));
fail_if (strcmp(ecore_con_url_data_get(url), url_data));
 
info = (url_test *) malloc(sizeof(url_test));

-- 




[EGIT] [core/efl] master 01/03: ecore_con: destructor are always called when finalize return NULL.

2019-10-11 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 1f1f0f75c0d3f51fb043319516ab6d43f1cb347d
Author: Cedric BAIL 
Date:   Fri Oct 11 08:51:43 2019 -0400

ecore_con: destructor are always called when finalize return NULL.

Summary:
This prevent crash and double free during an invalid Ecore_Con_Eet failure
to initialize.

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10362
---
 src/lib/ecore_con/ecore_con_eet.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/lib/ecore_con/ecore_con_eet.c 
b/src/lib/ecore_con/ecore_con_eet.c
index bd7aed5ec5..2a7db4 100644
--- a/src/lib/ecore_con/ecore_con_eet.c
+++ b/src/lib/ecore_con/ecore_con_eet.c
@@ -693,14 +693,9 @@ _ecore_con_eet_base_efl_object_destructor(Eo *obj, 
Ecore_Con_Eet_Base_Data *pd)
 EOLIAN static Efl_Object *
 _ecore_con_eet_base_efl_object_finalize(Eo *obj, Ecore_Con_Eet_Base_Data *pd)
 {
-   if (pd->server) return efl_finalize(efl_super(obj, 
ECORE_CON_EET_BASE_CLASS));
+   if (!pd->server) return NULL;
 
-   eet_data_descriptor_free(pd->edd);
-   eet_data_descriptor_free(pd->matching);
-   eina_hash_free(pd->data_callbacks);
-   eina_hash_free(pd->raw_data_callbacks);
-
-   return NULL;
+   return efl_finalize(efl_super(obj, ECORE_CON_EET_BASE_CLASS));
 }
 
 EOLIAN static void

-- 




[EGIT] [core/efl] master 09/09: eldbus: properly cleanup local variable during destruction.

2019-10-07 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 5cc9ea90c4a0381990e9fd961a99b74d0ce4fade
Author: Cedric BAIL 
Date:   Mon Oct 7 10:04:18 2019 -0400

eldbus: properly cleanup local variable during destruction.

Summary: Depends on D10288

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt, jsuya

Reviewed By: zmike

Subscribers: ProhtMeyhet, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10289
---
 src/lib/eldbus/eldbus_model.c  |  9 +++--
 src/lib/eldbus/eldbus_signal_handler.c | 10 +-
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/lib/eldbus/eldbus_model.c b/src/lib/eldbus/eldbus_model.c
index 3fc4e66fcb..ee86ff54a5 100644
--- a/src/lib/eldbus/eldbus_model.c
+++ b/src/lib/eldbus/eldbus_model.c
@@ -54,8 +54,11 @@ _eldbus_model_connection_set(Eo *obj EINA_UNUSED,
  Eldbus_Model_Data *pd,
  Eldbus_Connection *dbus)
 {
+   Eldbus_Connection *tounref = pd->connection;
+
eldbus_connection_ref(dbus);
-   if (pd->connection) eldbus_connection_unref(pd->connection);
+   pd->connection = NULL;
+   if (tounref) eldbus_connection_unref(tounref);
pd->connection = dbus;
 }
 
@@ -77,8 +80,10 @@ _eldbus_model_efl_object_finalize(Eo *obj, Eldbus_Model_Data 
*pd)
 static void
 _eldbus_model_efl_object_invalidate(Eo *obj, Eldbus_Model_Data *pd)
 {
-   if (pd->connection) eldbus_connection_unref(pd->connection);
+   Eldbus_Connection *connection = pd->connection;
+
pd->connection = NULL;
+   if (connection) eldbus_connection_unref(connection);
 
efl_invalidate(efl_super(obj, MY_CLASS));
 }
diff --git a/src/lib/eldbus/eldbus_signal_handler.c 
b/src/lib/eldbus/eldbus_signal_handler.c
index dba557bbc1..3ed7cb3a71 100644
--- a/src/lib/eldbus/eldbus_signal_handler.c
+++ b/src/lib/eldbus/eldbus_signal_handler.c
@@ -241,14 +241,14 @@ _eldbus_signal_handler_del(Eldbus_Signal_Handler *handler)
 
/* after cbs_free dispatch these shouldn't exit, error if they do */
 
-   eina_stringshare_del(handler->sender);
-   eina_stringshare_del(handler->path);
-   eina_stringshare_del(handler->interface);
-   eina_stringshare_del(handler->member);
+   eina_stringshare_replace(>sender, NULL);
+   eina_stringshare_replace(>path, NULL);
+   eina_stringshare_replace(>interface, NULL);
+   eina_stringshare_replace(>member, NULL);
eina_strbuf_free(handler->match);
EINA_INLIST_FOREACH_SAFE(handler->args, list, arg)
  {
-eina_stringshare_del(arg->value);
+eina_stringshare_replace(>value, NULL);
 free(arg);
  }
eina_inlist_sorted_state_free(handler->state_args);

-- 




[EGIT] [core/efl] master 06/09: eldbus: properly call parent finalize during creation of Eldbus.Model_Method.

2019-10-07 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit e0187ce2ec409ceabf93664a0c6a4105676b2e66
Author: Cedric BAIL 
Date:   Mon Oct 7 10:03:58 2019 -0400

eldbus: properly call parent finalize during creation of 
Eldbus.Model_Method.

Summary: @fix

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt, jsuya

Reviewed By: bu5hm4n

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10286
---
 src/lib/eldbus/eldbus_model_method.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/eldbus/eldbus_model_method.c 
b/src/lib/eldbus/eldbus_model_method.c
index dbdbdde831..fe18a4aaa9 100644
--- a/src/lib/eldbus/eldbus_model_method.c
+++ b/src/lib/eldbus/eldbus_model_method.c
@@ -37,7 +37,7 @@ _eldbus_model_method_efl_object_finalize(Eo *obj, 
Eldbus_Model_Method_Data *pd)
  pd->proxy,
  pd->method->name, 
pd->method->arguments);
 
-   return obj;
+   return efl_finalize(efl_super(obj, MY_CLASS));
 }
 
 static void

-- 




[EGIT] [core/efl] master 07/09: eldbus: Eldbus_Proxy require to handle self desctruction as refcounting doesn't fully protect.

2019-10-07 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 7f91f6280d103c2c5148276b438adf5bbdcf373d
Author: Cedric BAIL 
Date:   Mon Oct 7 10:04:05 2019 -0400

eldbus: Eldbus_Proxy require to handle self desctruction as refcounting 
doesn't fully protect.

Summary:
If the connection is destroyed before the proxy, the proxy will clear 
itself and self destroy.
Before that it will trigger the free callback to handle proper cleanup. 
Refcounting it doesn't
protect it from this self destruction scenario. So it is mandatory to 
always have a free callback
set on a proxy to handle its death properly.
Depends on D10286

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt, jsuya

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10287
---
 src/lib/eldbus/eldbus_model_arguments.c | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/lib/eldbus/eldbus_model_arguments.c 
b/src/lib/eldbus/eldbus_model_arguments.c
index ed6cbe2cce..ca0b6d68b4 100644
--- a/src/lib/eldbus/eldbus_model_arguments.c
+++ b/src/lib/eldbus/eldbus_model_arguments.c
@@ -39,6 +39,14 @@ _eldbus_model_arguments_efl_object_constructor(Eo *obj, 
Eldbus_Model_Arguments_D
return efl_constructor(efl_super(obj, MY_CLASS));
 }
 
+static void
+_cleanup_proxy_cb(void *data, const void *deadptr)
+{
+   Eldbus_Model_Arguments_Data *pd = data;
+
+   if (pd->proxy == deadptr) pd->proxy = NULL;
+}
+
 static Efl_Object *
 _eldbus_model_arguments_efl_object_finalize(Eo *obj, 
Eldbus_Model_Arguments_Data *pd)
 {
@@ -47,6 +55,8 @@ _eldbus_model_arguments_efl_object_finalize(Eo *obj, 
Eldbus_Model_Arguments_Data
  eldbus_model_connection_set(obj,
  
eldbus_object_connection_get(eldbus_proxy_object_get(pd->proxy)));
 
+   eldbus_proxy_free_cb_add(pd->proxy, _cleanup_proxy_cb, pd);
+
return efl_finalize(efl_super(obj, MY_CLASS));
 }
 
@@ -73,7 +83,12 @@ _eldbus_model_arguments_efl_object_destructor(Eo *obj, 
Eldbus_Model_Arguments_Da
eina_hash_free(pd->properties);
 
eina_stringshare_del(pd->name);
-   eldbus_proxy_unref(pd->proxy);
+   if (pd->proxy)
+ {
+eldbus_proxy_free_cb_del(pd->proxy, _cleanup_proxy_cb, pd);
+eldbus_proxy_unref(pd->proxy);
+pd->proxy = NULL;
+ }
 
efl_destructor(efl_super(obj, MY_CLASS));
 }

-- 




[EGIT] [core/efl] master 08/09: eldbus: connection are destroyed on invalidate, there is no point for any object to not cleanup on invalidate.

2019-10-07 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit d28870daa7506bb73af4e92ee8b48c952f3d6aa6
Author: Cedric BAIL 
Date:   Mon Oct 7 10:04:12 2019 -0400

eldbus: connection are destroyed on invalidate, there is no point for any 
object to not cleanup on invalidate.

Summary:
This solve a bug when there is a change in order of destruction and you 
would expect the model to still work.
Depends on D10287

Reviewers: zmike, bu5hm4n, segfaultxavi, stefan_schmidt, jsuya

Reviewed By: bu5hm4n

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10288
---
 src/lib/eldbus/eldbus_model_arguments.c  | 4 ++--
 src/lib/eldbus/eldbus_model_arguments.eo | 2 +-
 src/lib/eldbus/eldbus_model_signal.c | 4 ++--
 src/lib/eldbus/eldbus_model_signal.eo| 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lib/eldbus/eldbus_model_arguments.c 
b/src/lib/eldbus/eldbus_model_arguments.c
index ca0b6d68b4..817d896d0d 100644
--- a/src/lib/eldbus/eldbus_model_arguments.c
+++ b/src/lib/eldbus/eldbus_model_arguments.c
@@ -76,7 +76,7 @@ _eldbus_model_arguments_custom_constructor(Eo *obj 
EINA_UNUSED,
 }
 
 static void
-_eldbus_model_arguments_efl_object_destructor(Eo *obj, 
Eldbus_Model_Arguments_Data *pd)
+_eldbus_model_arguments_efl_object_invalidate(Eo *obj, 
Eldbus_Model_Arguments_Data *pd)
 {
_eldbus_model_arguments_unload(pd);
 
@@ -90,7 +90,7 @@ _eldbus_model_arguments_efl_object_destructor(Eo *obj, 
Eldbus_Model_Arguments_Da
 pd->proxy = NULL;
  }
 
-   efl_destructor(efl_super(obj, MY_CLASS));
+   efl_invalidate(efl_super(obj, MY_CLASS));
 }
 
 static Eina_Iterator *
diff --git a/src/lib/eldbus/eldbus_model_arguments.eo 
b/src/lib/eldbus/eldbus_model_arguments.eo
index 627ab680a7..15129041b1 100644
--- a/src/lib/eldbus/eldbus_model_arguments.eo
+++ b/src/lib/eldbus/eldbus_model_arguments.eo
@@ -25,7 +25,7 @@ class @beta Eldbus.Model.Arguments extends Eldbus.Model {
 implements {
 Efl.Object.constructor;
 Efl.Object.finalize;
-Efl.Object.destructor;
+Efl.Object.invalidate;
 Efl.Model.properties { get; }
 Efl.Model.property { set; get; }
 }
diff --git a/src/lib/eldbus/eldbus_model_signal.c 
b/src/lib/eldbus/eldbus_model_signal.c
index d1bb490195..5d05742870 100644
--- a/src/lib/eldbus/eldbus_model_signal.c
+++ b/src/lib/eldbus/eldbus_model_signal.c
@@ -43,11 +43,11 @@ _eldbus_model_signal_signal_constructor(Eo *obj EINA_UNUSED,
 }
 
 static void
-_eldbus_model_signal_efl_object_destructor(Eo *obj, Eldbus_Model_Signal_Data 
*pd)
+_eldbus_model_signal_efl_object_invalidate(Eo *obj, Eldbus_Model_Signal_Data 
*pd)
 {
_eldbus_model_signal_callback_del(pd);
 
-   efl_destructor(efl_super(obj, MY_CLASS));
+   efl_invalidate(efl_super(obj, MY_CLASS));
 }
 
 
diff --git a/src/lib/eldbus/eldbus_model_signal.eo 
b/src/lib/eldbus/eldbus_model_signal.eo
index 722784037f..c5b6f2224f 100644
--- a/src/lib/eldbus/eldbus_model_signal.eo
+++ b/src/lib/eldbus/eldbus_model_signal.eo
@@ -14,7 +14,7 @@ class @beta Eldbus.Model.Signal extends 
Eldbus.Model.Arguments {
 }
 implements {
 Efl.Object.constructor;
-Efl.Object.destructor;
+Efl.Object.invalidate;
 }
 constructors {
 .signal_constructor;

-- 




[EGIT] [core/efl] master 01/01: elementary: always use a font that matches our expectation for our test instead of the system one.

2019-10-02 Thread Cedric BAIL
lauromoura pushed a commit to branch master.

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

commit b6c76c78b8a0704b0dbe6e7c558dcc8787510290
Author: Cedric BAIL 
Date:   Wed Oct 2 23:28:38 2019 -0300

elementary: always use a font that matches our expectation for our test 
instead of the system one.

Summary:
Our tests do rely on the font to have certain characteristic so that they 
have the value and the
item size being calculated is the one we expect. As it is quite hard to 
support an infinite number
of font with random size, it is easier to embed one we can rely on for our 
test. I have copied Vera
from Expedite and changed evas global font path to look for it first. After 
this patch, even with an
incompatible font in the system, it does still pass all tests. This add 
around 400KB of data to our
git, but is necessary for a reliable tests suite.

@fix

T8277

Reviewers: lauromoura, zmike, bu5hm4n

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8277

Differential Revision: https://phab.enlightenment.org/D10276
---
 src/tests/elementary/fonts/Vera.ttf | Bin 0 -> 65932 bytes
 src/tests/elementary/fonts/VeraBI.ttf   | Bin 0 -> 63208 bytes
 src/tests/elementary/fonts/VeraBd.ttf   | Bin 0 -> 58716 bytes
 src/tests/elementary/fonts/VeraIt.ttf   | Bin 0 -> 63684 bytes
 src/tests/elementary/fonts/VeraSe.ttf   | Bin 0 -> 60280 bytes
 src/tests/elementary/fonts/VeraSeBd.ttf | Bin 0 -> 58736 bytes
 src/tests/elementary/fonts/fonts.alias  |   7 +++
 src/tests/elementary/fonts/fonts.dir|  31 +++
 src/tests/elementary/suite_helpers.c|  13 +++--
 9 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/src/tests/elementary/fonts/Vera.ttf 
b/src/tests/elementary/fonts/Vera.ttf
new file mode 100644
index 00..58cd6b5e61
Binary files /dev/null and b/src/tests/elementary/fonts/Vera.ttf differ
diff --git a/src/tests/elementary/fonts/VeraBI.ttf 
b/src/tests/elementary/fonts/VeraBI.ttf
new file mode 100644
index 00..b55eee397e
Binary files /dev/null and b/src/tests/elementary/fonts/VeraBI.ttf differ
diff --git a/src/tests/elementary/fonts/VeraBd.ttf 
b/src/tests/elementary/fonts/VeraBd.ttf
new file mode 100644
index 00..51d6111d72
Binary files /dev/null and b/src/tests/elementary/fonts/VeraBd.ttf differ
diff --git a/src/tests/elementary/fonts/VeraIt.ttf 
b/src/tests/elementary/fonts/VeraIt.ttf
new file mode 100644
index 00..cc23c9efd2
Binary files /dev/null and b/src/tests/elementary/fonts/VeraIt.ttf differ
diff --git a/src/tests/elementary/fonts/VeraSe.ttf 
b/src/tests/elementary/fonts/VeraSe.ttf
new file mode 100644
index 00..4b4ecc6667
Binary files /dev/null and b/src/tests/elementary/fonts/VeraSe.ttf differ
diff --git a/src/tests/elementary/fonts/VeraSeBd.ttf 
b/src/tests/elementary/fonts/VeraSeBd.ttf
new file mode 100644
index 00..672bf761fe
Binary files /dev/null and b/src/tests/elementary/fonts/VeraSeBd.ttf differ
diff --git a/src/tests/elementary/fonts/fonts.alias 
b/src/tests/elementary/fonts/fonts.alias
new file mode 100644
index 00..c5a31c8fe5
--- /dev/null
+++ b/src/tests/elementary/fonts/fonts.alias
@@ -0,0 +1,7 @@
+Vera-Bold-Italic -Bitstream-Bitstream Vera 
Sans-bold-i-normal--0-0-0-0-p-0-ascii-0
+Vera-Normal -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-ascii-0
+Vera-Bold -Bitstream-Bitstream Vera Sans-bold-r-normal--0-0-0-0-p-0-ascii-0
+Vera-Italic -Bitstream-Bitstream Vera Sans-medium-i-normal--0-0-0-0-p-0-ascii-0
+Vera-Serif -Bitstream-Bitstream Vera Serif-medium-r-normal--0-0-0-0-p-0-ascii-0
+Vera-Serif-Bold -Bitstream-Bitstream Vera 
Serif-bold-r-normal--0-0-0-0-p-0-ascii-0
+Vera -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-ascii-0
diff --git a/src/tests/elementary/fonts/fonts.dir 
b/src/tests/elementary/fonts/fonts.dir
new file mode 100644
index 00..660691d350
--- /dev/null
+++ b/src/tests/elementary/fonts/fonts.dir
@@ -0,0 +1,31 @@
+30
+VeraBI.ttf -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-ascii-0
+VeraBI.ttf -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-fcd8859-15
+VeraBI.ttf -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-iso8859-1
+VeraBI.ttf -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-iso8859-15
+VeraBI.ttf -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-iso8859-9
+Vera.ttf -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-ascii-0
+Vera.ttf -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-fcd8859-15
+Vera.ttf -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-iso8859-1
+Vera.ttf -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-iso8859-15
+Vera.ttf -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-iso8859-9
+VeraBd.ttf -Bitstream-Bitstr

[EGIT] [core/efl] master 01/01: evas: fix memory leak with Efl.Canvas.Vg

2019-09-26 Thread Cedric BAIL
hermet pushed a commit to branch master.

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

commit 29beda7f4f365425656e3340ea2da592d00fb52c
Author: Cedric Bail 
Date:   Fri Sep 27 14:19:38 2019 +0900

evas: fix memory leak with Efl.Canvas.Vg

Summary:
It is not correct to change the parent and hope that refcount will work
for you. The parent chain is a decision made by the user, not something
a widget can touch. Only ref count are to be used when given an outside
object. As things where not triggering destruction, there was also no
point where the image buffer would be getting to zero and be freed. This
commit also fix this.

Reviewers: Hermet, zmike

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10169
---
 src/lib/evas/canvas/efl_canvas_vg_object.c  | 22 +-
 src/lib/evas/canvas/efl_canvas_vg_object.eo |  2 +-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c 
b/src/lib/evas/canvas/efl_canvas_vg_object.c
index 1f8e05189b..0c8e50bed3 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -145,7 +145,7 @@ _efl_canvas_vg_object_root_node_set(Eo *eo_obj, 
Efl_Canvas_Vg_Object_Data *pd, E
if (pd->user_entry && pd->user_entry->root)
  {
 efl_canvas_vg_node_vg_obj_set(pd->user_entry->root, NULL, NULL);
-efl_parent_set(pd->user_entry->root, NULL);
+efl_replace(>user_entry->root, NULL);
  }
 
if (root_node)
@@ -160,10 +160,8 @@ _efl_canvas_vg_object_root_node_set(Eo *eo_obj, 
Efl_Canvas_Vg_Object_Data *pd, E
}
   }
 pd->user_entry->w = pd->user_entry->h = 0;
-pd->user_entry->root = root_node;
 
-// set the parent so that vg canvas can render it.
-efl_parent_set(pd->user_entry->root, pd->root);
+efl_replace(>user_entry->root, root_node);
 efl_canvas_vg_node_vg_obj_set(root_node, eo_obj, pd);
  }
else if (pd->user_entry)
@@ -333,8 +331,9 @@ _cleanup_reference(void *data, const Efl_Event *event 
EINA_UNUSED)
 }
 
 EOLIAN static void
-_efl_canvas_vg_object_efl_object_destructor(Eo *eo_obj, 
Efl_Canvas_Vg_Object_Data *pd)
+_efl_canvas_vg_object_efl_object_invalidate(Eo *eo_obj, 
Efl_Canvas_Vg_Object_Data *pd)
 {
+   Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, 
EFL_CANVAS_OBJECT_CLASS);
Evas *e = evas_object_evas_get(eo_obj);
 
efl_event_callback_del(e, EFL_CANVAS_SCENE_EVENT_RENDER_POST, 
_cleanup_reference, pd);
@@ -343,11 +342,17 @@ _efl_canvas_vg_object_efl_object_destructor(Eo *eo_obj, 
Efl_Canvas_Vg_Object_Dat
efl_unref(pd->root);
pd->root = NULL;
 
-   if (pd->user_entry) free(pd->user_entry);
+   if (pd->user_entry)
+ {
+Vg_User_Entry *user_entry = pd->user_entry;
+
+ENFN->ector_surface_cache_drop(ENC, user_entry->root);
+free(pd->user_entry);
+ }
pd->user_entry = NULL;
evas_cache_vg_entry_del(pd->vg_entry);
 
-   efl_destructor(efl_super(eo_obj, MY_CLASS));
+   efl_invalidate(efl_super(eo_obj, MY_CLASS));
 }
 
 EOLIAN static Eo *
@@ -364,7 +369,7 @@ _efl_canvas_vg_object_efl_object_constructor(Eo *eo_obj, 
Efl_Canvas_Vg_Object_Da
 
/* default root node */
pd->obj = obj;
-   pd->root = efl_add_ref(EFL_CANVAS_VG_CONTAINER_CLASS, NULL);
+   pd->root = efl_add_ref(EFL_CANVAS_VG_CONTAINER_CLASS, eo_obj);
 
eina_array_step_set(>cleanup, sizeof(pd->cleanup), 8);
 
@@ -375,7 +380,6 @@ static Efl_Object *
 _efl_canvas_vg_object_efl_object_finalize(Eo *obj, Efl_Canvas_Vg_Object_Data 
*pd)
 {
Evas *e = evas_object_evas_get(obj);
-   efl_parent_set(pd->root, obj);
 
// TODO: If we start to have to many Evas_Object_VG per canvas, it may be 
nice
// to actually have one event per canvas and one array per canvas to.
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.eo 
b/src/lib/evas/canvas/efl_canvas_vg_object.eo
index e414f1aaa7..2213c232ae 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.eo
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.eo
@@ -78,7 +78,7 @@ class @beta Efl.Canvas.Vg.Object extends Efl.Canvas.Object 
implements Efl.File,
implements {
   Efl.Object.constructor;
   Efl.Object.finalize;
-  Efl.Object.destructor;
+  Efl.Object.invalidate;
   Efl.File.load;
   Efl.File.unload;
   Efl.File.file { set; }

-- 




[EGIT] [core/efl] master 04/05: elementary: forward Efl.Input.Clickable event to Efl.Ui.Collection* event.

2019-09-25 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 26d5b7366eb4852aa4441947201b11ea637a0ad2
Author: Cedric Bail 
Date:   Wed Sep 25 21:59:25 2019 -0400

elementary: forward Efl.Input.Clickable event to Efl.Ui.Collection* event.

Summary: Depends on D10176

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8266

Differential Revision: https://phab.enlightenment.org/D10177
---
 src/lib/elementary/efl_ui_collection.c  | 14 --
 src/lib/elementary/efl_ui_collection_view.c | 13 +++--
 src/lib/elementary/efl_ui_item_clickable.eo | 17 -
 3 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/src/lib/elementary/efl_ui_collection.c 
b/src/lib/elementary/efl_ui_collection.c
index abef6732c1..0dac5b0a60 100644
--- a/src/lib/elementary/efl_ui_collection.c
+++ b/src/lib/elementary/efl_ui_collection.c
@@ -621,8 +621,18 @@ _redirect_cb(void *data, const Efl_Event *ev)
 {
Eo *obj = data;
 
-#define REDIRECT_EVT(item_evt, item) \
-   if (item_evt == ev->desc) efl_event_callback_call(obj, item, ev->object);
+#define REDIRECT_EVT(Desc, Item_Desc)   \
+   if (Desc == ev->desc)\
+ {  \
+Efl_Ui_Item_Clickable_Clicked item_clicked; \
+Efl_Input_Clickable_Clicked *clicked = ev->info;\
+\
+item_clicked.clicked = *clicked;\
+item_clicked.item = ev->object; \
+\
+efl_event_callback_call(obj, Item_Desc, _clicked); \
+ }
+
REDIRECT_EVT(EFL_INPUT_EVENT_PRESSED, EFL_UI_EVENT_ITEM_PRESSED);
REDIRECT_EVT(EFL_INPUT_EVENT_UNPRESSED, EFL_UI_EVENT_ITEM_UNPRESSED);
REDIRECT_EVT(EFL_INPUT_EVENT_LONGPRESSED, EFL_UI_EVENT_ITEM_LONGPRESSED);
diff --git a/src/lib/elementary/efl_ui_collection_view.c 
b/src/lib/elementary/efl_ui_collection_view.c
index a13e69e49a..608c31c059 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -183,8 +183,17 @@ _redirect_item_cb(void *data, const Efl_Event *ev)
 {
Eo *obj = data;
 
-#define REDIRECT_EVT(item_evt, item)\
-   if (item_evt == ev->desc) efl_event_callback_call(obj, item, ev->object);
+#define REDIRECT_EVT(Desc, Item_Desc)   \
+   if (Desc == ev->desc)\
+ {  \
+Efl_Ui_Item_Clickable_Clicked item_clicked; \
+Efl_Input_Clickable_Clicked *clicked = ev->info;\
+\
+item_clicked.clicked = *clicked;\
+item_clicked.item = ev->object; \
+\
+efl_event_callback_call(obj, Item_Desc, _clicked); \
+ }
REDIRECT_EVT(EFL_INPUT_EVENT_PRESSED, EFL_UI_EVENT_ITEM_PRESSED);
REDIRECT_EVT(EFL_INPUT_EVENT_UNPRESSED, EFL_UI_EVENT_ITEM_UNPRESSED);
REDIRECT_EVT(EFL_INPUT_EVENT_LONGPRESSED, EFL_UI_EVENT_ITEM_LONGPRESSED);
diff --git a/src/lib/elementary/efl_ui_item_clickable.eo 
b/src/lib/elementary/efl_ui_item_clickable.eo
index 7177d24f49..1c4f9f318e 100644
--- a/src/lib/elementary/efl_ui_item_clickable.eo
+++ b/src/lib/elementary/efl_ui_item_clickable.eo
@@ -1,12 +1,19 @@
+import efl_input_clickable;
+
+struct @beta Efl.Ui.Item_Clickable_Clicked {
+   clicked: Efl.Input.Clickable_Clicked;
+   item: Efl.Ui.Item;
+}
+
 interface @beta Efl.Ui.Item_Clickable
 {
[[Shared sets of events between @Efl.Ui.Collection and 
@Efl.Ui.Collection_View.]]
event_prefix: efl_ui;
events {
-  item,pressed : Efl.Ui.Item; [[A $press event occurred over an item.]]
-  item,unpressed : Efl.Ui.Item; [[An $unpress event occurred over an 
item.]]
-  item,longpressed : Efl.Ui.Item; [[A $longpressed event occurred over an 
item.]]
-  item,clicked : Efl.Ui.Item; [[A $clicked event occurred over an item.]]
-  item,clicked,any : Efl.Ui.Item; [[A $clicked,any event occurred over an 
item.]]
+  item,pressed : Efl.Ui.Item_Clickable_Clicked; [[A $press event occurred 
over an item.]]
+  item,unpressed : Efl.Ui.Item_Clickable_Clicked; [[An $unpress event 
occurred over an item.]]
+  item,longpressed : Efl.Ui.Item_Clickable_Clicked; [[A $longpressed event 
occurr

[EGIT] [core/efl] master 03/05: elementary: temporary workaround include issue that prevent acces to Evas_Eo.h

2019-09-25 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit b8af6c17fc29226d351e141457dcded8c122c5eb
Author: Cedric Bail 
Date:   Wed Sep 25 21:59:20 2019 -0400

elementary: temporary workaround include issue that prevent acces to 
Evas_Eo.h

Summary: Depends on D10175

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8266

Differential Revision: https://phab.enlightenment.org/D10176
---
 src/lib/elementary/Efl_Ui.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index 80cdde78b5..060fdc93c1 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -307,6 +307,7 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
 # include 
 # include 
 # include 
+# include 
 # include 
 # include 
 # include 

-- 




[EGIT] [core/efl] master 05/05: elementary: stabilize Efl.Ui.Item_Clickable.

2019-09-25 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 41d0ead833d0e48fb42aa537439f0fbd27d39a91
Author: Cedric Bail 
Date:   Wed Sep 25 21:59:29 2019 -0400

elementary: stabilize Efl.Ui.Item_Clickable.

Summary: Depends on D10177

Reviewers: zmike, bu5hm4n, segfaultxavi, lauromoura, SanghyeonLee, 
felipealmeida

Reviewed By: zmike, SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8266

Differential Revision: https://phab.enlightenment.org/D10173
---
 src/lib/elementary/efl_ui_item_clickable.eo | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_item_clickable.eo 
b/src/lib/elementary/efl_ui_item_clickable.eo
index 1c4f9f318e..5f92a5fbce 100644
--- a/src/lib/elementary/efl_ui_item_clickable.eo
+++ b/src/lib/elementary/efl_ui_item_clickable.eo
@@ -1,11 +1,11 @@
 import efl_input_clickable;
 
-struct @beta Efl.Ui.Item_Clickable_Clicked {
+struct Efl.Ui.Item_Clickable_Clicked {
clicked: Efl.Input.Clickable_Clicked;
item: Efl.Ui.Item;
 }
 
-interface @beta Efl.Ui.Item_Clickable
+interface Efl.Ui.Item_Clickable
 {
[[Shared sets of events between @Efl.Ui.Collection and 
@Efl.Ui.Collection_View.]]
event_prefix: efl_ui;

-- 




[EGIT] [core/efl] master 02/05: elementary: rename Efl.Ui.Collection_Event to Efl.Ui.Item_Clickable

2019-09-25 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 7cf364f270de5a582ad92ec7c3277837e58c045a
Author: Cedric Bail 
Date:   Wed Sep 25 21:59:14 2019 -0400

elementary: rename Efl.Ui.Collection_Event to Efl.Ui.Item_Clickable

Summary: Depends on D10171

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: zmike, SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8266

Differential Revision: https://phab.enlightenment.org/D10175
---
 src/lib/elementary/Efl_Ui.h | 2 +-
 src/lib/elementary/efl_ui_collection.eo | 2 +-
 src/lib/elementary/efl_ui_collection_view.eo| 2 +-
 src/lib/elementary/efl_ui_item.c| 2 +-
 .../{efl_ui_collection_events.eo => efl_ui_item_clickable.eo}   | 2 +-
 src/lib/elementary/meson.build  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index 29ef99383e..80cdde78b5 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -307,7 +307,7 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
 # include 
 # include 
 # include 
-# include 
+# include 
 # include 
 # include 
 # include 
diff --git a/src/lib/elementary/efl_ui_collection.eo 
b/src/lib/elementary/efl_ui_collection.eo
index 28ecb4975d..a57e07b028 100644
--- a/src/lib/elementary/efl_ui_collection.eo
+++ b/src/lib/elementary/efl_ui_collection.eo
@@ -4,7 +4,7 @@ class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
Efl.Ui.Multi_Selectable,
Efl.Ui.Focus.Manager_Sub,
Efl.Ui.Widget_Focus_Manager,
-   Efl.Ui.Collection_Events
+   Efl.Ui.Item_Clickable
composites
Efl.Ui.Scrollable,
Efl.Ui.Scrollbar,
diff --git a/src/lib/elementary/efl_ui_collection_view.eo 
b/src/lib/elementary/efl_ui_collection_view.eo
index ac379d94e8..9278cd04c7 100644
--- a/src/lib/elementary/efl_ui_collection_view.eo
+++ b/src/lib/elementary/efl_ui_collection_view.eo
@@ -4,7 +4,7 @@ class Efl.Ui.Collection_View extends Efl.Ui.Layout_Base 
implements
 Efl.Ui.Multi_Selectable_Async,
 Efl.Ui.Focus.Manager_Sub,
 Efl.Ui.Widget_Focus_Manager,
-Efl.Ui.Collection_Events
+Efl.Ui.Item_Clickable
 composites Efl.Ui.Scrollable, Efl.Ui.Scrollbar, 
Efl.Ui.Multi_Selectable_Async
 {
[[This widget displays a list of items in an arrangement controlled by an 
external @.position_manager
diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c
index 7cdfe16424..3dce9c3837 100644
--- a/src/lib/elementary/efl_ui_item.c
+++ b/src/lib/elementary/efl_ui_item.c
@@ -237,5 +237,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_item, 
Efl_Ui_Item_Data)
 #include "efl_ui_selectable.eo.c"
 #include "efl_ui_multi_selectable.eo.c"
 #include "efl_ui_single_selectable.eo.c"
-#include "efl_ui_collection_events.eo.c"
+#include "efl_ui_item_clickable.eo.c"
 
diff --git a/src/lib/elementary/efl_ui_collection_events.eo 
b/src/lib/elementary/efl_ui_item_clickable.eo
similarity index 92%
rename from src/lib/elementary/efl_ui_collection_events.eo
rename to src/lib/elementary/efl_ui_item_clickable.eo
index 653172564b..7177d24f49 100644
--- a/src/lib/elementary/efl_ui_collection_events.eo
+++ b/src/lib/elementary/efl_ui_item_clickable.eo
@@ -1,4 +1,4 @@
-interface @beta Efl.Ui.Collection_Events
+interface @beta Efl.Ui.Item_Clickable
 {
[[Shared sets of events between @Efl.Ui.Collection and 
@Efl.Ui.Collection_View.]]
event_prefix: efl_ui;
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index 8166aafd95..c2cd86bbc9 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -171,7 +171,7 @@ pub_eo_files = [
   'efl_ui_relative_layout.eo',
   'efl_ui_action_connector.eo',
   'efl_ui_format.eo',
-  'efl_ui_collection_events.eo',
+  'efl_ui_item_clickable.eo',
   'efl_ui_collection.eo',
   'efl_ui_position_manager_entity.eo',
   'efl_ui_position_manager_list.eo',

-- 




[EGIT] [core/efl] master 01/05: elementary: stabilize Efl.Ui.Collection_View.

2019-09-25 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 4c3dce94eb80a22cfd7e0c42a2a0e4bb9091978c
Author: Cedric Bail 
Date:   Wed Sep 25 21:59:09 2019 -0400

elementary: stabilize Efl.Ui.Collection_View.

Reviewers: zmike, bu5hm4n, segfaultxavi, lauromoura, SanghyeonLee, 
felipealmeida

Reviewed By: zmike, SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8261

Differential Revision: https://phab.enlightenment.org/D10171
---
 src/lib/elementary/efl_ui_collection_view.eo | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/efl_ui_collection_view.eo 
b/src/lib/elementary/efl_ui_collection_view.eo
index a0cbbc8545..ac379d94e8 100644
--- a/src/lib/elementary/efl_ui_collection_view.eo
+++ b/src/lib/elementary/efl_ui_collection_view.eo
@@ -1,4 +1,4 @@
-class @beta Efl.Ui.Collection_View extends Efl.Ui.Layout_Base implements
+class Efl.Ui.Collection_View extends Efl.Ui.Layout_Base implements
 Efl.Ui.Layout_Orientable,
 Efl.Ui.Selectable,
 Efl.Ui.Multi_Selectable_Async,
@@ -35,7 +35,7 @@ class @beta Efl.Ui.Collection_View extends Efl.Ui.Layout_Base 
implements
 factory: Efl.Ui.Factory; [[The factory.]]
  }
   }
-  @property position_manager {
+  @property position_manager @beta {
 [[Position manager object that handles placement of items.]]
 values {
position_manager : Efl.Ui.Position_Manager.Entity @move; [[The 
objects ownership is passed to the item container.]]

-- 




[EGIT] [core/efl] master 01/08: elementary: stabilize Efl.Ui.Widget_Factory.

2019-09-25 Thread Cedric BAIL
lauromoura pushed a commit to branch master.

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

commit 31b99e67c475e7687dbed64514e1692f552506e8
Author: Cedric Bail 
Date:   Wed Sep 25 11:45:38 2019 -0300

elementary: stabilize Efl.Ui.Widget_Factory.

Summary:
T8271
Depends on D10130

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7885

Differential Revision: https://phab.enlightenment.org/D10131
---
 src/lib/elementary/efl_ui_widget_factory.eo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_widget_factory.eo 
b/src/lib/elementary/efl_ui_widget_factory.eo
index 7cdfab2887..47367b395c 100644
--- a/src/lib/elementary/efl_ui_widget_factory.eo
+++ b/src/lib/elementary/efl_ui_widget_factory.eo
@@ -1,4 +1,4 @@
-class @beta Efl.Ui.Widget_Factory extends Efl.Loop_Consumer implements 
Efl.Ui.Factory, Efl.Part
+class Efl.Ui.Widget_Factory extends Efl.Loop_Consumer implements 
Efl.Ui.Factory, Efl.Part
 {
[[Efl Ui Factory that provides @Efl.Ui.Widget.
 

-- 




[EGIT] [core/efl] master 05/08: efl: stabilize Efl.Model

2019-09-25 Thread Cedric BAIL
lauromoura pushed a commit to branch master.

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

commit 2078fe00e07e7e86f2c784e8b676cbfdfa697ea4
Author: Cedric Bail 
Date:   Wed Sep 25 12:00:28 2019 -0300

efl: stabilize Efl.Model

Summary:
T8267
Depends on D10135

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7885

Differential Revision: https://phab.enlightenment.org/D10136
---
 src/lib/efl/interfaces/efl_model.eo | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_model.eo 
b/src/lib/efl/interfaces/efl_model.eo
index 5713df6dc4..477e9e10b5 100644
--- a/src/lib/efl/interfaces/efl_model.eo
+++ b/src/lib/efl/interfaces/efl_model.eo
@@ -1,4 +1,4 @@
-struct @beta Efl.Model_Property_Event {
+struct Efl.Model_Property_Event {
  [[EFL model property event data structure]]
  changed_properties: array; [[List of changed properties]]
  invalidated_properties: array; [[Removed properties 
identified by name]]
@@ -13,7 +13,7 @@ struct @beta Efl.Model_Children_Event {
   the parent, it will be available here.]]
 }
 
-interface @beta Efl.Model
+interface Efl.Model
 {
[[Basic Model abstraction.
 
@@ -178,8 +178,8 @@ interface @beta Efl.Model
   properties,changed: Efl.Model_Property_Event; [[Event dispatched when
   properties list is
   available.]]
-  child,added: Efl.Model_Children_Event; [[Event dispatched when new child 
is added.]]
-  child,removed: Efl.Model_Children_Event; [[Event dispatched when child 
is removed.]]
+  child,added @beta: Efl.Model_Children_Event; [[Event dispatched when new 
child is added.]]
+  child,removed @beta: Efl.Model_Children_Event; [[Event dispatched when 
child is removed.]]
   children,count,changed: void; [[Event dispatched when children count is 
finished.]]
}
 }

-- 




[EGIT] [core/efl] master 03/08: efl: stabilize Efl.Ui.Property_Bind

2019-09-25 Thread Cedric BAIL
lauromoura pushed a commit to branch master.

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

commit 31dda961147428b609c7d82735911a9ec1737c62
Author: Cedric Bail 
Date:   Wed Sep 25 11:56:54 2019 -0300

efl: stabilize Efl.Ui.Property_Bind

Summary:
T7579
Depends on D10133

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7885

Differential Revision: https://phab.enlightenment.org/D10134
---
 src/lib/efl/interfaces/efl_ui_property_bind.eo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/efl/interfaces/efl_ui_property_bind.eo 
b/src/lib/efl/interfaces/efl_ui_property_bind.eo
index 31d66e0134..aafd772e58 100644
--- a/src/lib/efl/interfaces/efl_ui_property_bind.eo
+++ b/src/lib/efl/interfaces/efl_ui_property_bind.eo
@@ -6,7 +6,7 @@ struct Efl.Ui.Property_Event {
changed_properties: array; [[List of changed properties]]
 }
 
-interface @beta Efl.Ui.Property_Bind
+interface Efl.Ui.Property_Bind
 {
[[Efl UI Property_Bind interface.
  view object can have @Efl.Model to manage the data,

-- 




[EGIT] [core/efl] master 06/08: elementary: stabilize Efl.Ui.View_Model

2019-09-25 Thread Cedric BAIL
lauromoura pushed a commit to branch master.

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

commit 4473483503813a3ae79b88cd9d47fa1edfcde9ee
Author: Cedric Bail 
Date:   Wed Sep 25 12:02:14 2019 -0300

elementary: stabilize Efl.Ui.View_Model

Summary:
T8268
Depends on D10136

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7885

Differential Revision: https://phab.enlightenment.org/D10137
---
 src/lib/elementary/efl_ui_view_model.eo | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_view_model.eo 
b/src/lib/elementary/efl_ui_view_model.eo
index a5caaa8d1c..ebc25dd342 100644
--- a/src/lib/elementary/efl_ui_view_model.eo
+++ b/src/lib/elementary/efl_ui_view_model.eo
@@ -17,7 +17,7 @@ function @beta EflUiViewModelPropertySet {
return: future; [[The value that was finally set.]]
 };
 
-class @beta Efl.Ui.View_Model extends Efl.Composite_Model
+class Efl.Ui.View_Model extends Efl.Composite_Model
 {
[[Efl model providing helpers for custom properties used when linking a 
model to a view and you need to
  generate/adapt values for display.
@@ -60,7 +60,7 @@ class @beta Efl.Ui.View_Model extends Efl.Composite_Model
  }
  return: Eina.Error;
   }
-  property_logic_add {
+  property_logic_add @beta {
  [[Add callbacks that will be triggered when someone ask for the 
specified property name when getting or
setting a property.
 
@@ -79,7 +79,7 @@ class @beta Efl.Ui.View_Model extends Efl.Composite_Model
  }
  return: Eina.Error;
   }
-  property_logic_del {
+  property_logic_del @beta {
  [[Delete previously added callbacks that were triggered when someone 
asked for the specified property name
when getting or setting a property.
 

-- 




[EGIT] [core/efl] master 07/08: ecore: stabilize Efl.Composite_Model.

2019-09-25 Thread Cedric BAIL
lauromoura pushed a commit to branch master.

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

commit acb314fb1dade1cc37b2a2025da928cf5b338940
Author: Cedric Bail 
Date:   Wed Sep 25 12:03:27 2019 -0300

ecore: stabilize Efl.Composite_Model.

Summary: Depends on D10137

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7885

Differential Revision: https://phab.enlightenment.org/D10138
---
 src/lib/ecore/efl_composite_model.eo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/ecore/efl_composite_model.eo 
b/src/lib/ecore/efl_composite_model.eo
index 4244e930bc..34c2e203d4 100644
--- a/src/lib/ecore/efl_composite_model.eo
+++ b/src/lib/ecore/efl_composite_model.eo
@@ -1,4 +1,4 @@
-class @beta Efl.Composite_Model extends Efl.Loop_Model implements Efl.Ui.View
+class Efl.Composite_Model extends Efl.Loop_Model implements Efl.Ui.View
 {
[[Efl model for all composite class which provide a unified API to set 
source of data.
 

-- 




[EGIT] [core/efl] master 02/08: efl: stabilize Efl.Ui.Factory.

2019-09-25 Thread Cedric BAIL
lauromoura pushed a commit to branch master.

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

commit bf1f7cfab78b408bc015dca299bdcef6b1776ea3
Author: Cedric Bail 
Date:   Wed Sep 25 11:55:30 2019 -0300

efl: stabilize Efl.Ui.Factory.

Summary:
T8262
Depends on D10132

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7885

Differential Revision: https://phab.enlightenment.org/D10133
---
 src/lib/efl/interfaces/efl_ui_factory.eo | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_ui_factory.eo 
b/src/lib/efl/interfaces/efl_ui_factory.eo
index b0518a0755..61d0ce961e 100644
--- a/src/lib/efl/interfaces/efl_ui_factory.eo
+++ b/src/lib/efl/interfaces/efl_ui_factory.eo
@@ -1,10 +1,10 @@
-struct @beta Efl.Ui.Factory_Item_Created_Event {
+struct Efl.Ui.Factory_Item_Created_Event {
[[EFL UI Factory event structure provided when an item was just created.]]
model: Efl.Model; [[The model already set on the new item.]]
item: Efl.Gfx.Entity; [[The item that was just created.]]
 }
 
-interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, 
Efl.Ui.Factory_Bind
+interface Efl.Ui.Factory extends Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind
 {
[[Interface for factory-pattern object creation.
 

-- 




[EGIT] [core/efl] master 04/08: efl: stabilize Efl.Ui.Factory_Bind

2019-09-25 Thread Cedric BAIL
lauromoura pushed a commit to branch master.

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

commit c3db2793043b40c943f589ac37ebf60cd3385d4e
Author: Cedric Bail 
Date:   Wed Sep 25 11:59:45 2019 -0300

efl: stabilize Efl.Ui.Factory_Bind

Summary:
T8264
Depends on D10134

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7885

Differential Revision: https://phab.enlightenment.org/D10135
---
 src/lib/efl/interfaces/efl_ui_factory_bind.eo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/efl/interfaces/efl_ui_factory_bind.eo 
b/src/lib/efl/interfaces/efl_ui_factory_bind.eo
index 740c627b82..f924073954 100644
--- a/src/lib/efl/interfaces/efl_ui_factory_bind.eo
+++ b/src/lib/efl/interfaces/efl_ui_factory_bind.eo
@@ -1,4 +1,4 @@
-interface @beta Efl.Ui.Factory_Bind
+interface Efl.Ui.Factory_Bind
 {
[[Efl UI Property interface.
  view object can have @Efl.Model and need to set cotent with those model 
stored data.

-- 




[EGIT] [core/efl] master 08/08: ecore: stabilize Efl.Loop_Model

2019-09-25 Thread Cedric BAIL
lauromoura pushed a commit to branch master.

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

commit a55580ab27d268af8c559edd762cdf09ba31fbf8
Author: Cedric Bail 
Date:   Wed Sep 25 12:05:38 2019 -0300

ecore: stabilize Efl.Loop_Model

Summary:
T8270
Depends on D10138

Reviewers: zmike, segfaultxavi, bu5hm4n, SanghyeonLee, lauromoura, 
felipealmeida

Reviewed By: SanghyeonLee

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7885

Differential Revision: https://phab.enlightenment.org/D10139
---
 src/lib/ecore/efl_loop_model.eo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/ecore/efl_loop_model.eo b/src/lib/ecore/efl_loop_model.eo
index 3a15490fce..ec2488e4fd 100644
--- a/src/lib/ecore/efl_loop_model.eo
+++ b/src/lib/ecore/efl_loop_model.eo
@@ -1,4 +1,4 @@
-abstract @beta Efl.Loop_Model extends Efl.Loop_Consumer implements Efl.Model
+abstract Efl.Loop_Model extends Efl.Loop_Consumer implements Efl.Model
 {
data: null;
methods {

-- 




[EGIT] [core/efl] master 01/01: efl: improve error message to be really useful.

2019-09-25 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 25cba85a6a060c89d77ac76c63cc1979b6388dbe
Author: Cedric Bail 
Date:   Wed Sep 25 15:50:35 2019 -0400

efl: improve error message to be really useful.

Reviewers: zmike, bu5hm4n

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10168
---
 src/lib/efl/interfaces/efl_file.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lib/efl/interfaces/efl_file.c 
b/src/lib/efl/interfaces/efl_file.c
index d6f262d3e2..a35710f0f3 100644
--- a/src/lib/efl/interfaces/efl_file.c
+++ b/src/lib/efl/interfaces/efl_file.c
@@ -172,7 +172,11 @@ efl_file_simple_load(Eo *obj, const char *file, const char 
*key)
 {
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
efl_ref(obj);
-   EINA_SAFETY_ON_TRUE_GOTO(efl_file_set(obj, file), fail);
+   if (efl_file_set(obj, file))
+ {
+EINA_LOG_ERR("File set to '%s' on '%s' failed.", file, 
efl_debug_name_get(obj));
+goto fail;
+ }
efl_file_key_set(obj, key);
if (file)
  {

-- 




[EGIT] [core/efl] master 04/05: elementary: return an error when unimplemented function on Efl.Ui.Widget_Factory.

2019-09-25 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 267f8fcfa82af22c20c79687eb1aed5d5c513ab8
Author: Cedric Bail 
Date:   Wed Sep 25 16:52:18 2019 +

elementary: return an error when unimplemented function on 
Efl.Ui.Widget_Factory.

Reviewed-by: Cedric BAIL 
Differential Revision: https://phab.enlightenment.org/D10130
---
 src/bindings/mono/efl_mono/Bind.cs|  3 +--
 src/lib/efl/interfaces/efl_ui_factory_bind.eo |  1 +
 src/lib/elementary/efl_ui_layout.c| 10 ++
 src/lib/elementary/efl_ui_layout_factory.c|  6 --
 src/lib/elementary/efl_ui_widget_factory.c| 12 +++-
 src/lib/elementary/efl_ui_widget_factory.eo   |  1 +
 6 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/src/bindings/mono/efl_mono/Bind.cs 
b/src/bindings/mono/efl_mono/Bind.cs
index 14c45d9dd0..c31186cbb7 100644
--- a/src/bindings/mono/efl_mono/Bind.cs
+++ b/src/bindings/mono/efl_mono/Bind.cs
@@ -112,8 +112,7 @@ public class BindableFactoryPart
 /// Binds the given factory to this part.
 public Eina.Error BindFactory(Efl.Ui.IFactory factory)
 {
-this.Binder.BindFactory(this.PartName, factory);
-return Eina.Error.NO_ERROR;
+return this.Binder.BindFactory(this.PartName, factory);
 }
 }
 
diff --git a/src/lib/efl/interfaces/efl_ui_factory_bind.eo 
b/src/lib/efl/interfaces/efl_ui_factory_bind.eo
index d26832453f..740c627b82 100644
--- a/src/lib/efl/interfaces/efl_ui_factory_bind.eo
+++ b/src/lib/efl/interfaces/efl_ui_factory_bind.eo
@@ -14,6 +14,7 @@ interface @beta Efl.Ui.Factory_Bind
 key: string; [[Key string for bind model property data]]
 factory: Efl.Ui.Factory; [[@Efl.Ui.Factory for create and bind 
model property data]]
  }
+ return: Eina.Error; [[0 when it succeed, an error code otherwise.]]
   }
}
 }
diff --git a/src/lib/elementary/efl_ui_layout.c 
b/src/lib/elementary/efl_ui_layout.c
index c4310f01c1..1797d8a45f 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -2527,16 +2527,16 @@ 
_efl_ui_layout_base_efl_ui_property_bind_property_bind(Eo *obj, Efl_Ui_Layout_Da
return 0;
 }
 
-EOLIAN static void
+EOLIAN static Eina_Error
 _efl_ui_layout_base_efl_ui_factory_bind_factory_bind(Eo *obj EINA_UNUSED, 
Efl_Ui_Layout_Data *pd,
 const char *key, 
Efl_Ui_Factory *factory)
 {
-   EINA_SAFETY_ON_NULL_RETURN(key);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(key, EFL_PROPERTY_ERROR_INVALID_KEY);
Efl_Ui_Layout_Factory_Tracking *tracking;
Eina_Stringshare *ss_key;
 
if (!_elm_layout_part_aliasing_eval(obj, , EINA_TRUE))
- return;
+ return EFL_PROPERTY_ERROR_INVALID_KEY;
 
// Check if there is a model and register it
_efl_ui_layout_base_model_watch(obj, pd);
@@ -2566,7 +2566,7 @@ _efl_ui_layout_base_efl_ui_factory_bind_factory_bind(Eo 
*obj EINA_UNUSED, Efl_Ui
else
  {
 tracking = calloc(1, sizeof (Efl_Ui_Layout_Factory_Tracking));
-if (!tracking) return ;
+if (!tracking) return ENOMEM;
 
 tracking->key = ss_key;
 
@@ -2577,6 +2577,8 @@ _efl_ui_layout_base_efl_ui_factory_bind_factory_bind(Eo 
*obj EINA_UNUSED, Efl_Ui
tracking->factory = efl_ref(factory);
 
_efl_ui_layout_view_model_content_update(pd, tracking, ss_key);
+
+   return EINA_ERROR_NO_ERROR;
 }
 
 EOLIAN void
diff --git a/src/lib/elementary/efl_ui_layout_factory.c 
b/src/lib/elementary/efl_ui_layout_factory.c
index cfc2749dd3..b6032e70e9 100644
--- a/src/lib/elementary/efl_ui_layout_factory.c
+++ b/src/lib/elementary/efl_ui_layout_factory.c
@@ -88,7 +88,7 @@ _efl_ui_layout_factory_efl_object_destructor(Eo *obj, 
Efl_Ui_Layout_Factory_Data
efl_destructor(efl_super(obj, MY_CLASS));
 }
 
-EOLIAN static void
+EOLIAN static Eina_Error
 _efl_ui_layout_factory_efl_ui_factory_bind_factory_bind(Eo *obj EINA_UNUSED, 
Efl_Ui_Layout_Factory_Data *pd,
 const char *key, 
Efl_Ui_Factory *factory)
 {
@@ -99,7 +99,7 @@ _efl_ui_layout_factory_efl_ui_factory_bind_factory_bind(Eo 
*obj EINA_UNUSED, Efl
if (factory == NULL)
  {
 eina_hash_del(pd->bind.factories, ss_key, NULL);
-return;
+return EINA_ERROR_NO_ERROR;
  }
 
f_old = eina_hash_set(pd->bind.factories, ss_key, efl_ref(factory));
@@ -108,6 +108,8 @@ _efl_ui_layout_factory_efl_ui_factory_bind_factory_bind(Eo 
*obj EINA_UNUSED, Efl
 efl_unref(f_old);
 eina_stringshare_del(ss_key);
  }
+
+   return EINA_ERROR_NO_ERROR;
 }
 
 EOLIAN static Eina_Error
diff --git a/src/lib/elementary/efl_ui_widget_factory.c 
b/src/lib/elementary/efl_ui_widget_factory.c
index 54b1b8dc09..13160af8e1 100644
--- a/src/lib/elementary/efl_ui_widget_factory.c
+++ b/src/lib/elementary/efl_ui_widget_factory.c
@@ -

[EGIT] [core/efl] master 03/05: elementary: add support for default property on item being created by Efl.Ui.Widget_Factory.

2019-09-25 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 78ee2ca6b0604ddf6ac2479da9585b68ad937613
Author: Cedric Bail 
Date:   Tue Sep 24 17:13:49 2019 -0700

elementary: add support for default property on item being created by 
Efl.Ui.Widget_Factory.

Reviewed-by: SangHyeon Jade Lee 
Differential Revision: https://phab.enlightenment.org/D10129
---
 src/lib/elementary/efl_ui_widget_factory.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/src/lib/elementary/efl_ui_widget_factory.c 
b/src/lib/elementary/efl_ui_widget_factory.c
index 00ba103cda..54b1b8dc09 100644
--- a/src/lib/elementary/efl_ui_widget_factory.c
+++ b/src/lib/elementary/efl_ui_widget_factory.c
@@ -36,6 +36,8 @@ struct _Efl_Ui_Widget_Factory_Data
 
Eina_Hash *parts;
 
+   Eina_Stringshare *default_property;
+
Eina_Stringshare *style;
 };
 
@@ -182,6 +184,9 @@ _efl_ui_widget_factory_releasing(void *data, const 
Efl_Event *ev)
efl_key_data_set(ui_view, "efl.ui.widget.factory.size_check", NULL);
if (efl_isa(ui_view, EFL_UI_ITEM_CLASS)) 
efl_ui_item_calc_locked_set(ui_view, EINA_TRUE);
 
+   // Bind default property
+   if (pd->default_property) efl_ui_property_bind(ui_view, NULL, 
pd->default_property);
+
// Bind all property before the object is finalize
it = eina_hash_iterator_data_new(pd->parts);
EINA_ITERATOR_FOREACH(it, bpd)
@@ -405,6 +410,12 @@ 
_efl_ui_property_bind_part_efl_ui_property_bind_property_bind(Eo *obj EINA_UNUSE
 return ENOENT;
  }
 
+   if (!key)
+ {
+eina_stringshare_replace(>pd->default_property, property);
+return;
+ }
+
if (!pd->pd->parts)
  pd->pd->parts = eina_hash_stringshared_new(NULL);
 

-- 




[EGIT] [core/efl] master 05/05: elementary: properly mark iterator usage in Efl.Ui.Factory.

2019-09-25 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit e5ad8716bd1f0f94a9d6b789c99fc00721d419f8
Author: Cedric Bail 
Date:   Tue Sep 24 16:48:31 2019 -0700

elementary: properly mark iterator usage in Efl.Ui.Factory.

Reviewed-by: SangHyeon Jade Lee 
Differential Revision: https://phab.enlightenment.org/D10132
---
 src/lib/efl/interfaces/efl_ui_factory.eo | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_ui_factory.eo 
b/src/lib/efl/interfaces/efl_ui_factory.eo
index 47dd203f6e..b0518a0755 100644
--- a/src/lib/efl/interfaces/efl_ui_factory.eo
+++ b/src/lib/efl/interfaces/efl_ui_factory.eo
@@ -21,10 +21,10 @@ interface @beta Efl.Ui.Factory extends 
Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind
Note: This is the function you need to implement for a custom 
factory, but if you want to use a factory,
you should rely on @Efl.Ui.View_Factory.create_with_event.]]
  params {
-models: iterator; [[Efl iterator providing the model to 
be associated to the new item.
+models: iterator @move; [[Efl iterator providing the 
model to be associated to the new item.
It should remain valid until the 
end of the function call.]]
  }
- return: future; [[Created UI object.]]
+ return: future @move @no_unused; [[Created UI 
object.]]
   }
   release {
  [[Release a UI object and disconnect from models.]]

-- 




[EGIT] [tools/expedite] master 01/02: main: lookup for the right file thanks error warning in Efl!

2019-09-25 Thread Cedric Bail
cedric pushed a commit to branch master.

http://git.enlightenment.org/tools/expedite.git/commit/?id=105e6568a4974fd86d11291a10cf615a13df43ed

commit 105e6568a4974fd86d11291a10cf615a13df43ed
Author: Cedric Bail 
Date:   Wed Sep 25 10:25:47 2019 -0700

main: lookup for the right file thanks error warning in Efl!
---
 src/bin/ui.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/bin/ui.c b/src/bin/ui.c
index d31d4a5..adaba18 100644
--- a/src/bin/ui.c
+++ b/src/bin/ui.c
@@ -12,7 +12,6 @@ static double t_start = 0.0;
 static double t_loop = 0.0;
 static intf_start = 0;
 static intf_loop = 0;
-static char   data_dir[4096];
 
 int async_render = 0;
 Eina_List *menu = NULL;
@@ -568,7 +567,6 @@ ui_loop(void *data EINA_UNUSED)
 tr = tt;
 EINA_LIST_FOREACH(menu, l, mi)
   {
- char buf[4096];
  Evas_Coord x, y, w, h, tw, th;
  Evas_Coord len;
  double a;
@@ -624,8 +622,7 @@ ui_loop(void *data EINA_UNUSED)
   efl_gfx_color_set(o, a, a, a, a);
 
   o = o_menu_icon;
-  snprintf(buf, 4096, "%s%s", data_dir, mi->icon);
-  efl_file_simple_load(o, buf, NULL);
+  efl_file_simple_load(o, build_path(mi->icon), NULL);
   efl_gfx_color_set(o, a / 2, a / 2, a / 2, a / 2);
}
  i++;

-- 




[EGIT] [tools/expedite] master 02/02: Updated to fit EFL 1.23 API.

2019-09-25 Thread Cedric Bail
cedric pushed a commit to branch master.

http://git.enlightenment.org/tools/expedite.git/commit/?id=ac6a3bcb44a4385a8c01222e6f2e9b178325b3ad

commit ac6a3bcb44a4385a8c01222e6f2e9b178325b3ad
Author: Cedric Bail 
Date:   Wed Sep 25 10:26:17 2019 -0700

Updated to fit EFL 1.23 API.
---
 src/bin/image_blend_border.c| 2 +-
 src/bin/image_blend_border_recolor.c| 2 +-
 src/bin/image_blend_solid_border.c  | 2 +-
 src/bin/image_blend_solid_middle_border.c   | 4 ++--
 src/bin/image_blend_solid_middle_unscaled.c | 4 ++--
 src/bin/ui.c| 2 +-
 src/bin/widgets_list_1.c| 2 +-
 src/bin/widgets_list_1_grouped.c| 2 +-
 src/bin/widgets_list_2.c| 2 +-
 src/bin/widgets_list_2_grouped.c| 2 +-
 src/bin/widgets_list_3.c| 4 ++--
 src/bin/widgets_list_3_grouped.c| 4 ++--
 src/bin/widgets_list_4.c| 4 ++--
 src/bin/widgets_list_4_grouped.c| 4 ++--
 14 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/bin/image_blend_border.c b/src/bin/image_blend_border.c
index 188bfe7..4acad32 100644
--- a/src/bin/image_blend_border.c
+++ b/src/bin/image_blend_border.c
@@ -26,7 +26,7 @@ static void _setup(void)
 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
 o_images[i] = o;
 efl_file_simple_load(o, build_path("bar.png"), NULL);
-efl_gfx_image_border_set(o, 6, 6, 6, 6);
+efl_gfx_image_border_insets_set(o, 6, 6, 6, 6);
 efl_gfx_entity_visible_set(o, EINA_TRUE);
  }
done = 0;
diff --git a/src/bin/image_blend_border_recolor.c 
b/src/bin/image_blend_border_recolor.c
index 4de2697..5d46f2b 100644
--- a/src/bin/image_blend_border_recolor.c
+++ b/src/bin/image_blend_border_recolor.c
@@ -27,7 +27,7 @@ static void _setup(void)
 o_images[i] = o;
 efl_file_simple_load(o, build_path("pan.png"), NULL);
 efl_gfx_color_set(o, 64, 64, 64, 255);
-efl_gfx_image_border_set(o, 3, 3, 3, 3);
+efl_gfx_image_border_insets_set(o, 3, 3, 3, 3);
 efl_gfx_entity_visible_set(o, EINA_TRUE);
  }
done = 0;
diff --git a/src/bin/image_blend_solid_border.c 
b/src/bin/image_blend_solid_border.c
index b72d7b7..b4d972d 100644
--- a/src/bin/image_blend_solid_border.c
+++ b/src/bin/image_blend_solid_border.c
@@ -26,7 +26,7 @@ static void _setup(void)
 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
 o_images[i] = o;
 efl_file_simple_load(o, build_path("frame.png"), NULL);
-efl_gfx_image_border_set(o, 8, 8, 8, 8);
+efl_gfx_image_border_insets_set(o, 8, 8, 8, 8);
 efl_gfx_entity_visible_set(o, EINA_TRUE);
  }
done = 0;
diff --git a/src/bin/image_blend_solid_middle_border.c 
b/src/bin/image_blend_solid_middle_border.c
index 95e22c8..329fc13 100644
--- a/src/bin/image_blend_solid_middle_border.c
+++ b/src/bin/image_blend_solid_middle_border.c
@@ -26,8 +26,8 @@ static void _setup(void)
 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
 o_images[i] = o;
 efl_file_simple_load(o, build_path("bar.png"), NULL);
-efl_gfx_image_border_set(o, 6, 6, 6, 6);
-efl_gfx_image_border_center_fill_set(o, 
EFL_GFX_BORDER_FILL_MODE_SOLID);
+efl_gfx_image_border_insets_set(o, 6, 6, 6, 6);
+efl_gfx_image_center_fill_mode_set(o, EFL_GFX_CENTER_FILL_MODE_SOLID);
 efl_gfx_entity_visible_set(o, EINA_TRUE);
  }
done = 0;
diff --git a/src/bin/image_blend_solid_middle_unscaled.c 
b/src/bin/image_blend_solid_middle_unscaled.c
index 5a3fdc0..67b50d3 100644
--- a/src/bin/image_blend_solid_middle_unscaled.c
+++ b/src/bin/image_blend_solid_middle_unscaled.c
@@ -28,8 +28,8 @@ static void _setup(void)
 efl_file_simple_load(o, build_path("logo.png"), NULL);
 efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
 efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
-efl_gfx_image_border_set(o, 43, 48, 48, 83);
-efl_gfx_image_border_center_fill_set(o, 
EFL_GFX_BORDER_FILL_MODE_SOLID);
+efl_gfx_image_border_insets_set(o, 43, 48, 48, 83);
+efl_gfx_image_center_fill_mode_set(o, EFL_GFX_CENTER_FILL_MODE_SOLID);
 efl_gfx_entity_visible_set(o, EINA_TRUE);
  }
done = 0;
diff --git a/src/bin/ui.c b/src/bin/ui.c
index adaba18..f7292d1 100644
--- a/src/bin/ui.c
+++ b/src/bin/ui.c
@@ -463,7 +463,7 @@ ui_setup(unsigned int ui_w, unsigned int ui_h)
efl_file_simple_load(o, build_path("text_sel.png"), NULL);
efl_gfx_entity_size_set(o, EINA_SIZE2D(96, 32));
efl_gfx_fill_set(o, EINA_RECT(0, 0, 96, 32));
-   efl_gfx_image_border_set(o, 7, 7, 7, 7);
+   efl_gfx_image_border_insets_set(o, 7, 7, 7, 7);
o_menu_text_sel = o;
 
o = evas_object_text_add(evas);
diff --git a/src/bin/widgets_list_1.c b/src/bin/widgets_list_1.c
index 01f0869..c30847e 100644
--- a/src/bin/widgets_list

[EGIT] [core/efl] master 01/01: elementary: another forgotten file that need removal.

2019-09-24 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 653cf9b788ccd0fdb52339d94442d0df29a6ce4c
Author: Cedric Bail 
Date:   Tue Sep 24 11:54:20 2019 -0700

elementary: another forgotten file that need removal.
---
 src/lib/elementary/Efl_Ui.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index fdc77f2daa..29ef99383e 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -330,7 +330,6 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
 # include 
 
 # include 
-# include 
 # include 
 # include 
 # include 

-- 




[EGIT] [core/efl] master 01/01: elementary: fix up left over header that got removed.

2019-09-24 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit b3adcff0dfb6aae6296cdf4ccabada293332e11a
Author: Cedric Bail 
Date:   Tue Sep 24 11:30:22 2019 -0700

elementary: fix up left over header that got removed.
---
 src/lib/elementary/Efl_Ui.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index 5ee021cea0..fdc77f2daa 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -329,7 +329,6 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
 # include 
 # include 
 
-# include "efl_ui_list_view_types.eot.h"
 # include 
 # include 
 # include 

-- 




[EGIT] [core/efl] master 02/09: elementary: add an interface for asynchronous multi selection.

2019-09-24 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 3c9a46372efe03f6f90488342d999aad02e0036d
Author: Cedric Bail 
Date:   Sun Sep 15 12:50:27 2019 -0700

elementary: add an interface for asynchronous multi selection.

This interface is currently focusing on being use by widget like
Efl.Ui.Collection_View or Efl.Ui.Select_Model. I have decided that
it should not be available along with Efl.Ui.Multi_Selectable.

Differential Revision: https://phab.enlightenment.org/D9957
---
 src/lib/elementary/Efl_Ui.h|   1 +
 src/lib/elementary/efl_ui.eot  |   8 +
 src/lib/elementary/efl_ui_collection_events.eo |   2 +-
 src/lib/elementary/efl_ui_multi_selectable.eo  |   8 +-
 .../elementary/efl_ui_multi_selectable_async.eo|  63 
 src/lib/elementary/efl_ui_select_model.c   | 342 +++--
 src/lib/elementary/efl_ui_select_model.eo  |  36 +--
 src/lib/elementary/meson.build |   1 +
 src/tests/elementary/efl_ui_test_select_model.c|   4 +-
 9 files changed, 405 insertions(+), 60 deletions(-)

diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index 53c10adfcf..2c899fa20c 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -326,6 +326,7 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
 # include 
 # include 
 # include 
+# include 
 # include 
 
 # include "efl_ui_list_view_types.eot.h"
diff --git a/src/lib/elementary/efl_ui.eot b/src/lib/elementary/efl_ui.eot
index 4e665113f6..b397b27094 100644
--- a/src/lib/elementary/efl_ui.eot
+++ b/src/lib/elementary/efl_ui.eot
@@ -96,5 +96,13 @@ enum @beta Efl.Ui.Widget_Orientation_Mode
   not change according to the window or screen orientation.]]
 }
 
+enum @beta Efl.Ui.Select_Mode {
+   [[Type of multi selectable object.]]
+   single, [[Only single child is selected. If a child is selected,
+ previous selected child will be unselected.]]
+   multi, [[Allow multiple selection of children.]]
+   none [[No child can be selected at all.]]
+}
+
 /* Types for A11Y (internal/beta API) */
 type @beta @extern Efl.Access.Action_Data: __undefined_type; [[Internal struct 
for accesssibility.]]
diff --git a/src/lib/elementary/efl_ui_collection_events.eo 
b/src/lib/elementary/efl_ui_collection_events.eo
index 653172564b..9ef6a991df 100644
--- a/src/lib/elementary/efl_ui_collection_events.eo
+++ b/src/lib/elementary/efl_ui_collection_events.eo
@@ -1,6 +1,6 @@
 interface @beta Efl.Ui.Collection_Events
 {
-   [[Shared sets of events between @Efl.Ui.Collection and 
@Efl.Ui.Collection_View.]]
+   [[Shared sets of events between @Efl.Ui.Collection and 
Efl.Ui.Collection_View.]]
event_prefix: efl_ui;
events {
   item,pressed : Efl.Ui.Item; [[A $press event occurred over an item.]]
diff --git a/src/lib/elementary/efl_ui_multi_selectable.eo 
b/src/lib/elementary/efl_ui_multi_selectable.eo
index 9b581357a1..a3806c1608 100644
--- a/src/lib/elementary/efl_ui_multi_selectable.eo
+++ b/src/lib/elementary/efl_ui_multi_selectable.eo
@@ -1,10 +1,4 @@
-enum @beta Efl.Ui.Select_Mode {
-   [[Type of multi selectable object.]]
-   single, [[Only single child is selected. If a child is selected,
- previous selected child will be unselected.]]
-   multi, [[Allow multiple selection of children.]]
-   none [[No child can be selected at all.]]
-}
+import efl_ui;
 
 interface @beta Efl.Ui.Multi_Selectable extends Efl.Ui.Single_Selectable
 {
diff --git a/src/lib/elementary/efl_ui_multi_selectable_async.eo 
b/src/lib/elementary/efl_ui_multi_selectable_async.eo
new file mode 100644
index 00..6f4ed14abe
--- /dev/null
+++ b/src/lib/elementary/efl_ui_multi_selectable_async.eo
@@ -0,0 +1,63 @@
+import efl_ui;
+
+interface @beta Efl.Ui.Multi_Selectable_Async extends Efl.Ui.Single_Selectable
+{
+   [[Interface for getting access to a range of selected items for widgets 
that provide them asynchronously.
+
+ The implementor of this interface provides the possibility to select 
multiple @Efl.Ui.Selectable.
+ If not, only @Efl.Ui.Single_Selectable should be implemented.
+ A widget can only provide either this interface or 
@Efl.Ui.Multi_Selectable, but not both.]]
+   methods
+   {
+  @property select_mode {
+ [[The mode type for children selection.]]
+ set {}
+ get {}
+ values {
+ mode: Efl.Ui.Select_Mode; [[Type of selection of children]]
+ }
+  }
+  selected_iterator_new {
+ [[Gets an iterator of all the selected child of this model.
+ ]]
+ return: iterator @move @no_unused; [[The iterator gives 
indices of selected children.
+ It is valid until any change is made on 
the model.]]
+  }
+  unselected_iterator_new {
+ [[Gets an iterator of all the child of 

[EGIT] [core/efl] master 06/09: elementary: add Efl.Ui.Grid_View by leveraging MVVM and Collection/Position_Manager infrastructure.

2019-09-24 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 5096cd32ad580cfc8fa58c130b378b12855a
Author: Cedric Bail 
Date:   Sun Sep 15 23:18:50 2019 -0700

elementary: add Efl.Ui.Grid_View by leveraging MVVM and 
Collection/Position_Manager infrastructure.

Co-authored-by: Marcel Hollerbach 

Differential Revision: https://phab.enlightenment.org/D9960
---
 src/lib/elementary/Efl_Ui.h  |  1 +
 src/lib/elementary/efl_ui_collection_view.eo |  2 +-
 src/lib/elementary/efl_ui_grid_view.c| 26 ++
 src/lib/elementary/efl_ui_grid_view.eo   | 17 +
 src/lib/elementary/meson.build   |  2 ++
 5 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index 7f0c2ab4e9..5ee021cea0 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -335,6 +335,7 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
 # include 
 # include 
 # include 
+# include 
 
 # include 
 # include 
diff --git a/src/lib/elementary/efl_ui_collection_view.eo 
b/src/lib/elementary/efl_ui_collection_view.eo
index d0efbf347a..ffbbc0eefd 100644
--- a/src/lib/elementary/efl_ui_collection_view.eo
+++ b/src/lib/elementary/efl_ui_collection_view.eo
@@ -11,7 +11,7 @@ class @beta Efl.Ui.Collection_View extends Efl.Ui.Layout_Base 
implements
  object. By using different @.position_manager objects this widget can 
show unidimensional lists or
  two-dimensional grids of items, for example.
 
- This class is intended to act as a base for widgets like List_View or 
Grid_View,
+ This class is intended to act as a base for widgets like List_View or 
@Efl.Ui.Grid_View,
  which hide this complexity from the user.
 
  Items are generated by the @Efl.Ui.Factory defined with .factory.set to 
match the content of the
diff --git a/src/lib/elementary/efl_ui_grid_view.c 
b/src/lib/elementary/efl_ui_grid_view.c
new file mode 100644
index 00..4c5ac044b7
--- /dev/null
+++ b/src/lib/elementary/efl_ui_grid_view.c
@@ -0,0 +1,26 @@
+#ifdef HAVE_CONFIG_H
+#include "elementary_config.h"
+#endif
+
+#define ELM_LAYOUT_PROTECTED
+#define EFL_UI_SCROLL_MANAGER_PROTECTED
+#define EFL_UI_SCROLLBAR_PROTECTED
+
+#include 
+
+#define MY_CLASS  EFL_UI_GRID_VIEW_CLASS
+#define MY_CLASS_PFX  efl_ui_grid_view
+
+#define MY_CLASS_NAME "Efl.Ui.Grid_View"
+
+EOLIAN static Eo *
+_efl_ui_grid_view_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
+{
+   obj = efl_constructor(efl_super(obj, MY_CLASS));
+
+   efl_ui_collection_view_position_manager_set(obj, 
efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS));
+
+   return obj;
+}
+
+#include "efl_ui_grid_view.eo.c"
diff --git a/src/lib/elementary/efl_ui_grid_view.eo 
b/src/lib/elementary/efl_ui_grid_view.eo
new file mode 100644
index 00..18e513e8c9
--- /dev/null
+++ b/src/lib/elementary/efl_ui_grid_view.eo
@@ -0,0 +1,17 @@
+class @beta Efl.Ui.Grid_View extends Efl.Ui.Collection_View
+{
+   [[A scrollable grid of @Efl.Ui.Item objects, typically 
@Efl.Ui.Grid_Default_Item objects.
+
+ Items are added asynchronously by an @Efl.Ui.Factory from the definition 
of an @Efl.Model.
+
+ The orientation (vertical or horizontal) of the grid can be set with
+ @Efl.Ui.Layout_Orientable.orientation.
+
+ Items inside this widget can be selected according to the 
@Efl.Ui.Multi_Selectable_Async.select_mode
+ policy, and the selection can be retrieved with 
@Efl.Ui.Multi_Selectable_Async.selected_iterator_new.
+   ]]
+   data: null;
+   implements {
+  Efl.Object.constructor;
+   }
+}
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index 9580b3e229..8166aafd95 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -186,6 +186,7 @@ pub_eo_files = [
   'efl_ui_view_model.eo',
   'efl_ui_collection_view.eo',
   'efl_ui_collection_view_focus_manager.eo',
+  'efl_ui_grid_view.eo',
 ]
 
 foreach eo_file : pub_eo_files
@@ -899,6 +900,7 @@ elementary_src = [
   'efl_ui_grid_default_item.c',
   'efl_ui_grid.c',
   'efl_ui_list_view.c',
+  'efl_ui_grid_view.c',
   'efl_ui_layout_factory.c',
   'efl_ui_scroller.c',
   'efl_ui_scroll_manager.c',

-- 




[EGIT] [core/efl] master 05/09: elementary: migrate Efl.Ui.List_View to use Efl.Ui.Collection_View.

2019-09-24 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 78b69d45b57ce43ac0373a4f10ac548a3a458dbf
Author: Cedric Bail 
Date:   Thu Sep 19 11:19:56 2019 -0700

elementary: migrate Efl.Ui.List_View to use Efl.Ui.Collection_View.

Differential Revision: https://phab.enlightenment.org/D10035
---
 .../elementary/efl_ui_list_view_example_1.c|   38 +-
 .../elementary/efl_ui_list_view_example_2.c|3 +-
 .../elementary/efl_ui_list_view_example_3.c|   54 +-
 src/lib/elementary/Efl_Ui.h|1 +
 src/lib/elementary/efl_ui_list_view.c  | 1031 +---
 src/lib/elementary/efl_ui_list_view.eo |  102 +-
 src/lib/elementary/efl_ui_list_view_model.eo   |   41 -
 src/lib/elementary/efl_ui_list_view_pan.eo |   12 -
 .../elementary/efl_ui_list_view_precise_layouter.c |  728 --
 .../efl_ui_list_view_precise_layouter.eo   |   10 -
 src/lib/elementary/efl_ui_list_view_private.h  |   78 --
 src/lib/elementary/efl_ui_list_view_relayout.eo|   30 -
 src/lib/elementary/efl_ui_list_view_seg_array.c|  477 -
 src/lib/elementary/efl_ui_list_view_seg_array.h|   42 -
 src/lib/elementary/efl_ui_list_view_types.eot  |   12 -
 src/lib/elementary/meson.build |9 -
 16 files changed, 45 insertions(+), 2623 deletions(-)

diff --git a/src/examples/elementary/efl_ui_list_view_example_1.c 
b/src/examples/elementary/efl_ui_list_view_example_1.c
index 757082aa9d..5c1f4f5fe1 100644
--- a/src/examples/elementary/efl_ui_list_view_example_1.c
+++ b/src/examples/elementary/efl_ui_list_view_example_1.c
@@ -14,39 +14,20 @@
 
 #define NUM_ITEMS 400
 
-const char *styles[] = {
-"odd",
-"even"
-   };
-
-char edj_path[PATH_MAX];
-
 static void
 _realized_cb(void *data EINA_UNUSED, const Efl_Event *event)
 {
-   Efl_Ui_List_View_Item_Event *ie = event->info;
-   if (!ie->layout) return;
+   Efl_Gfx_Entity *layout = event->info;
 
-   Efl_Ui_Layout *layout = ie->layout;
elm_object_focus_allow_set(layout, EINA_TRUE);
 }
 
-/*
-static void
-_unrealized_cb(void *data EINA_UNUSED, const Efl_Event *event)
-{
-   Efl_Ui_List_View_Item_Event *ie = event->info;
-
-   efl_ui_view_model_set(ie->layout, NULL);
-   efl_del(ie->layout);
-}
-*/
 static Efl_Model*
 _make_model(Evas_Object *win)
 {
Eina_Value vtext;
Efl_Generic_Model *model, *child;
-   unsigned int i, s;
+   unsigned int i;
char buf[256];
 
model = efl_add(EFL_GENERIC_MODEL_CLASS, win);
@@ -54,10 +35,7 @@ _make_model(Evas_Object *win)
 
for (i = 0; i < (NUM_ITEMS); i++)
  {
-s = i%2;
 child = efl_model_child_add(model);
-eina_value_set(, styles[s]);
-efl_model_property_set(child, "odd_style", );
 
 snprintf(buf, sizeof(buf), "Item # %i", i);
 eina_value_set(, buf);
@@ -88,17 +66,13 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
 
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
efl_ui_widget_factory_item_class_set(factory, 
EFL_UI_LIST_DEFAULT_ITEM_CLASS);
-   efl_ui_property_bind(factory, "signal/efl,state,%v", "odd_style");
-   efl_ui_property_bind(factory, "signal/efl,state,%{selected;unselected}", 
"selected");
efl_ui_property_bind(factory, "efl.text", "title");
 
-   li = efl_add(EFL_UI_LIST_VIEW_CLASS, win
- , efl_ui_list_view_layout_factory_set(efl_added, factory)
- , efl_ui_view_model_set(efl_added, selmodel)
-   );
+   li = efl_add(EFL_UI_LIST_VIEW_CLASS, win,
+efl_ui_collection_view_factory_set(efl_added, factory),
+efl_ui_view_model_set(efl_added, selmodel));
 
-   efl_event_callback_add(li, EFL_UI_LIST_VIEW_EVENT_ITEM_REALIZED, 
_realized_cb, NULL);
-//   efl_event_callback_add(li, EFL_UI_LIST_VIEW_EVENT_ITEM_UNREALIZED, 
_unrealized_cb, NULL);
+   efl_event_callback_add(li, EFL_UI_COLLECTION_VIEW_EVENT_ITEM_REALIZED, 
_realized_cb, NULL);
 
elm_win_resize_object_add(win, li);
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
diff --git a/src/examples/elementary/efl_ui_list_view_example_2.c 
b/src/examples/elementary/efl_ui_list_view_example_2.c
index 5a4d680614..3464af5841 100644
--- a/src/examples/elementary/efl_ui_list_view_example_2.c
+++ b/src/examples/elementary/efl_ui_list_view_example_2.c
@@ -37,13 +37,12 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
efl_ui_property_bind(factory, "efl.text", "filename");
 
li = efl_add(EFL_UI_LIST_VIEW_CLASS, win);
-   efl_ui_list_view_layout_factory_set(li, factory);
+   efl_ui_collection_view_factory_set(li, factory);
efl_ui_view_model_set(li, model);
 
evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EV

[EGIT] [core/efl] master 03/09: elementary: fix children removal in Efl.Ui.Select_Model by not remembering index and relying on underlayer infrastructure to do it for us.

2019-09-24 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 832d300e203621c9c32cb186fef16a529cc4306b
Author: Cedric Bail 
Date:   Wed Sep 18 19:39:44 2019 -0700

elementary: fix children removal in Efl.Ui.Select_Model by not remembering 
index and relying on underlayer infrastructure to do it for us.

Differential Revision: https://phab.enlightenment.org/D10034
---
 src/lib/elementary/efl_ui_select_model.c | 35 +---
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/src/lib/elementary/efl_ui_select_model.c 
b/src/lib/elementary/efl_ui_select_model.c
index 93db5b3a6f..b969441bbc 100644
--- a/src/lib/elementary/efl_ui_select_model.c
+++ b/src/lib/elementary/efl_ui_select_model.c
@@ -22,13 +22,22 @@ struct _Efl_Ui_Select_Model_Data
 
Efl_Ui_Select_Model *fallback_model;
Efl_Ui_Select_Model *last_model;
-   unsigned long last;
 
Efl_Ui_Select_Mode selection;
 
Eina_Bool none : 1;
 };
 
+static void
+_efl_ui_select_model_child_removed(void *data, const Efl_Event *event)
+{
+   Efl_Ui_Select_Model_Data *pd = data;
+   Efl_Model_Children_Event *ev = event->info;
+
+   if (ev->child == pd->last_model)
+ efl_replace(>last_model, NULL);
+}
+
 static Eo*
 _efl_ui_select_model_efl_object_constructor(Eo *obj,
 Efl_Ui_Select_Model_Data *pd)
@@ -39,8 +48,7 @@ _efl_ui_select_model_efl_object_constructor(Eo *obj,
 
efl_boolean_model_boolean_add(obj, "selected", EINA_FALSE);
 
-   efl_replace(>last_model, NULL);
-   pd->last = 0;
+   efl_event_callback_add(obj, EFL_MODEL_EVENT_CHILD_REMOVED, 
_efl_ui_select_model_child_removed, pd);
pd->none = EINA_TRUE;
 
parent = efl_parent_get(obj);
@@ -122,20 +130,16 @@ _commit_change(Eo *child, void *data EINA_UNUSED, const 
Eina_Value v)
  {
 // select case
 pd->none = EINA_FALSE;
-pd->last = efl_composite_model_index_get(child);
 efl_replace(>last_model, child);
 efl_event_callback_call(child, EFL_UI_SELECT_MODEL_EVENT_SELECTED, 
child);
  }
else
  {
 // unselect case
-unsigned long last;
-
-last = efl_composite_model_index_get(child);
-if (pd->last == last)
+// There should only be one model which represent the same data at all 
in memory
+if (pd->last_model == child) // direct comparison of pointer is ok
   {
  efl_replace(>last_model, NULL);
- pd->last = 0;
  pd->none = EINA_TRUE;
 
  // Just in case we need to refill the fallback
@@ -395,10 +399,7 @@ _efl_ui_select_model_efl_model_property_set(Eo *obj,
  // there is nothing special to do, just normal commit change will 
do.
  if (!newflag)
{
-  unsigned int i;
-
-  i = efl_composite_model_index_get(obj);
-  if (pd->parent->last == i && !newflag)
+  if (pd->parent->last_model == obj && !newflag)
 {
efl_replace(>last_model, NULL);
pd->parent->none = EINA_TRUE;
@@ -413,7 +414,7 @@ _efl_ui_select_model_efl_model_property_set(Eo *obj,
 
   // In this case we need to first unselect the previously 
selected one
   // and then commit the change to this one.
-  selected = pd->parent->last;
+  selected = 
efl_composite_model_index_get(pd->parent->last_model);
 
   // There was, need to unselect the previous one along 
setting the new value
   parent = efl_parent_get(obj);
@@ -451,8 +452,10 @@ _efl_ui_select_model_efl_model_property_get(const Eo *obj, 
Efl_Ui_Select_Model_D
  {
 if (pd->none)
   return eina_value_error_new(EFL_MODEL_ERROR_INCORRECT_VALUE);
-else
-  return eina_value_ulong_new(pd->last);
+else if (pd->last_model)
+  return 
eina_value_ulong_new(efl_composite_model_index_get(pd->last_model));
+else // Nothing selected yet, try again later
+  return eina_value_error_new(EAGAIN);
  }
// Redirect to are we ourself selected
if (pd->parent && eina_streq("self.selected", property))

-- 




[EGIT] [core/efl] master 01/09: elementary: factorize all events emitted by a Efl.Ui.Collection into their own interface.

2019-09-24 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 1c0916ef03549eb742f635f29c4340b0989839a6
Author: Cedric Bail 
Date:   Sun Sep 15 14:38:03 2019 -0700

elementary: factorize all events emitted by a Efl.Ui.Collection into their 
own interface.

For most event it is actually meaningful to share them with 
Efl.Ui.Collection_View so let's do it.

Differential Revision: https://phab.enlightenment.org/D9956
---
 src/lib/elementary/Efl_Ui.h|  1 +
 src/lib/elementary/efl_ui_collection.eo| 11 ++-
 src/lib/elementary/efl_ui_collection_events.eo | 12 
 src/lib/elementary/efl_ui_item.c   |  2 ++
 src/lib/elementary/meson.build |  1 +
 5 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index a4285ef04f..53c10adfcf 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -307,6 +307,7 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
 # include 
 # include 
 # include 
+# include 
 # include 
 # include 
 # include 
diff --git a/src/lib/elementary/efl_ui_collection.eo 
b/src/lib/elementary/efl_ui_collection.eo
index f040fd87bc..4a320c362a 100644
--- a/src/lib/elementary/efl_ui_collection.eo
+++ b/src/lib/elementary/efl_ui_collection.eo
@@ -3,7 +3,8 @@ class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
Efl.Ui.Layout_Orientable,
Efl.Ui.Multi_Selectable,
Efl.Ui.Focus.Manager_Sub,
-   Efl.Ui.Widget_Focus_Manager
+   Efl.Ui.Widget_Focus_Manager,
+   Efl.Ui.Collection_Events
composites
Efl.Ui.Scrollable,
Efl.Ui.Scrollbar,
@@ -25,7 +26,6 @@ class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
  Items inside this widget can be selected according to the 
@Efl.Ui.Multi_Selectable.select_mode
  policy, and the selection can be retrieved with 
@Efl.Ui.Multi_Selectable.selected_items_get.
]]
-   event_prefix:efl_ui;
methods {
   item_scroll {
  [[Brings the passed item into the viewport.]]
@@ -90,12 +90,5 @@ class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
   Efl.Ui.Multi_Selectable.unselect_range;
   Efl.Ui.Single_Selectable.fallback_selection {get; set;}
}
-   events {
-  item,pressed : Efl.Ui.Item; [[A $press event occurred over an item.]]
-  item,unpressed : Efl.Ui.Item; [[An $unpress event occurred over an 
item.]]
-  item,longpressed : Efl.Ui.Item; [[A $longpressed event occurred over an 
item.]]
-  item,clicked : Efl.Ui.Item; [[A $clicked event occurred over an item.]]
-  item,clicked,any : Efl.Ui.Item; [[A $clicked,any event occurred over an 
item.]]
-   }
 }
 
diff --git a/src/lib/elementary/efl_ui_collection_events.eo 
b/src/lib/elementary/efl_ui_collection_events.eo
new file mode 100644
index 00..653172564b
--- /dev/null
+++ b/src/lib/elementary/efl_ui_collection_events.eo
@@ -0,0 +1,12 @@
+interface @beta Efl.Ui.Collection_Events
+{
+   [[Shared sets of events between @Efl.Ui.Collection and 
@Efl.Ui.Collection_View.]]
+   event_prefix: efl_ui;
+   events {
+  item,pressed : Efl.Ui.Item; [[A $press event occurred over an item.]]
+  item,unpressed : Efl.Ui.Item; [[An $unpress event occurred over an 
item.]]
+  item,longpressed : Efl.Ui.Item; [[A $longpressed event occurred over an 
item.]]
+  item,clicked : Efl.Ui.Item; [[A $clicked event occurred over an item.]]
+  item,clicked,any : Efl.Ui.Item; [[A $clicked,any event occurred over an 
item.]]
+   }
+}
\ No newline at end of file
diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c
index 1b0c4f1a46..b454555497 100644
--- a/src/lib/elementary/efl_ui_item.c
+++ b/src/lib/elementary/efl_ui_item.c
@@ -214,3 +214,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_item, 
Efl_Ui_Item_Data)
 #include "efl_ui_selectable.eo.c"
 #include "efl_ui_multi_selectable.eo.c"
 #include "efl_ui_single_selectable.eo.c"
+#include "efl_ui_collection_events.eo.c"
+
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index 3770fe9448..a1c001a7bb 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -173,6 +173,7 @@ pub_eo_files = [
   'efl_ui_relative_layout.eo',
   'efl_ui_action_connector.eo',
   'efl_ui_format.eo',
+  'efl_ui_collection_events.eo',
   'efl_ui_collection.eo',
   'efl_ui_position_manager_entity.eo',
   'efl_ui_position_manager_list.eo',

-- 




[EGIT] [core/efl] master 04/09: elementary: introduce Efl.Ui.CollectionView a generic listing View.

2019-09-24 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 2e1317baedb844a490e96b574fcec3c1ef52c6d9
Author: Cedric BAIL 
Date:   Fri Jul 5 14:03:13 2019 -0700

elementary: introduce Efl.Ui.CollectionView a generic listing View.

The idea of this widget is to provide to MVVM what Efl.Ui.Collection 
provide and
leverage the same shared logic for layout.

Co-authored-by: Mike Blumenkrantz 
Co-authored-by: Marcel Hollerbach 

Differential Revision: https://phab.enlightenment.org/D9958
---
 .../elementary/efl_ui_collection_view_example_1.c  |  107 +
 src/examples/elementary/meson.build|1 +
 src/lib/elementary/Efl_Ui.h|2 +-
 src/lib/elementary/efl_ui_collection_events.eo |2 +-
 src/lib/elementary/efl_ui_collection_view.c| 2301 
 src/lib/elementary/efl_ui_collection_view.eo   |   61 +
 .../efl_ui_collection_view_focus_manager.eo|7 +
 src/lib/elementary/efl_ui_item.c   |   23 +
 src/lib/elementary/efl_ui_item.eo  |   12 +
 src/lib/elementary/efl_ui_item_private.h   |1 +
 src/lib/elementary/efl_ui_position_manager_list.c  |   35 +-
 src/lib/elementary/efl_ui_widget.c |2 -
 src/lib/elementary/efl_ui_widget_factory.c |   33 +-
 src/lib/elementary/elm_priv.h  |1 +
 src/lib/elementary/meson.build |3 +
 15 files changed, 2555 insertions(+), 36 deletions(-)

diff --git a/src/examples/elementary/efl_ui_collection_view_example_1.c 
b/src/examples/elementary/efl_ui_collection_view_example_1.c
new file mode 100644
index 00..72960651fb
--- /dev/null
+++ b/src/examples/elementary/efl_ui_collection_view_example_1.c
@@ -0,0 +1,107 @@
+//  gcc -o efl_ui_collection_view_example_1 efl_ui_collection_view_example_1.c 
`pkg-config --cflags --libs efl-ui
+
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#else
+# define EFL_BETA_API_SUPPORT 1
+#endif
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define NUM_ITEMS 400
+
+static Efl_Model*
+_make_model(Evas_Object *win)
+{
+   Eina_Value vtext;
+   Efl_Generic_Model *model, *child;
+   unsigned int i;
+   char buf[256];
+
+   model = efl_add(EFL_GENERIC_MODEL_CLASS, win);
+   eina_value_setup(, EINA_VALUE_TYPE_STRING);
+
+   for (i = 0; i < (NUM_ITEMS); i++)
+ {
+child = efl_model_child_add(model);
+snprintf(buf, sizeof(buf), "Item # %i", i);
+eina_value_set(, buf);
+efl_model_property_set(child, "title", );
+ }
+
+   eina_value_flush();
+   return model;
+}
+
+static void
+_item_constructing(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+   Efl_Gfx_Entity *item = ev->info;
+
+   if (!efl_ui_item_calc_locked_get(item))
+ efl_gfx_hint_size_min_set(item, EINA_SIZE2D(50, 50));
+}
+
+EAPI_MAIN void
+efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+   Efl_Ui_Factory *factory;
+   Evas_Object *win, *li;
+   Eo *model;
+   Eo *position_manager;
+   Efl_App *app = ev->object;
+   Eina_Accessor *ac;
+   Eina_Bool list = EINA_TRUE, multi = EINA_FALSE, none = EINA_FALSE;
+   Efl_Ui_Select_Mode mode = EFL_UI_SELECT_MODE_SINGLE;
+   const char *arg;
+   unsigned int i;
+
+   ac = efl_core_command_line_command_access(app);
+   EINA_ACCESSOR_FOREACH(ac, i, arg)
+ {
+if (eina_streq(arg, "grid")) list = EINA_FALSE;
+if (eina_streq(arg, "multi")) multi = EINA_TRUE;
+if (eina_streq(arg, "none")) none = EINA_TRUE;
+ }
+   eina_accessor_free(ac);
+
+   if (multi) mode = EFL_UI_SELECT_MODE_MULTI;
+   if (none) mode = EFL_UI_SELECT_MODE_NONE;
+
+   win = efl_add(EFL_UI_WIN_CLASS, app,
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
+ efl_ui_win_autohide_set(efl_added, EINA_TRUE));
+   elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
+   model = _make_model(win);
+
+   factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
+   efl_ui_property_bind(factory, "text", "title");
+
+   if (list)
+ {
+position_manager = efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS);
+efl_ui_widget_factory_item_class_set(factory, 
EFL_UI_LIST_DEFAULT_ITEM_CLASS);
+ }
+   else
+ {
+position_manager = efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS);
+efl_ui_widget_factory_item_class_set(factory, 
EFL_UI_GRID_DEFAULT_ITEM_CLASS);
+efl_event_callback_add(factory, 
EFL_UI_FACTORY_EVENT_ITEM_CONSTRUCTING, _item_constructing, NULL);
+ }
+
+   li = efl_add(EFL_UI_COLLECTION_VIEW_CLASS, win,
+efl_ui_collection_view_position_manager_set(efl_added, 
position_manager),
+efl_ui_view_model_set(efl_added, model),
+efl_ui_multi_selectable_async_select_mode_set

[EGIT] [core/efl] master 07/09: elementary: add a basic test for MVVM infrastructure.

2019-09-24 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit d5a21c7998f9f4a4901a49b874ff1e2dec3c3c08
Author: Cedric Bail 
Date:   Fri Sep 20 15:01:49 2019 -0700

elementary: add a basic test for MVVM infrastructure.

Differential Revision: https://phab.enlightenment.org/D10063
---
 src/bin/elementary/meson.build   |   1 +
 src/bin/elementary/test.c|   4 +-
 src/bin/elementary/test_ui_collection_view.c | 144 +++
 3 files changed, 148 insertions(+), 1 deletion(-)

diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build
index 388623d5c0..debce1ded8 100644
--- a/src/bin/elementary/meson.build
+++ b/src/bin/elementary/meson.build
@@ -157,6 +157,7 @@ elementary_test_src = [
   'test_ui_tab_pager.c',
   'test_ui_relative_layout.c',
   'test_ui_collection.c',
+  'test_ui_collection_view.c',
   'test_ui_items.c',
   'test_ui_frame.c',
   'test_efl_ui_animation_view.c',
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index bf90382bd4..8d5e997140 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -399,8 +399,9 @@ void test_ui_spotlight_scroll(void *data, Evas_Object *obj, 
void *event_info);
 
 void test_ui_relative_layout(void *data, Evas_Object *obj, void *event_info);
 void test_efl_ui_radio(void *data, Evas_Object *obj, void *event_info);
-void test_efl_ui_collection_list(void *data, Evas_Object *obj, void 
*event_info );
+void test_efl_ui_collection_list(void *data, Evas_Object *obj, void 
*event_info);
 void test_efl_ui_collection_grid(void *data, Evas_Object *obj, void 
*event_info);
+void test_efl_ui_collection_view(void *data, Evas_Object *obj, void 
*event_info);
 void test_efl_ui_item(void *data, Evas_Object *obj, void *event_info);
 void test_ui_frame(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void 
*event_info EINA_UNUSED);
 
@@ -909,6 +910,7 @@ add_tests:
ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Relative_Layout", 
test_ui_relative_layout);
ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Collection List", 
test_efl_ui_collection_list);
ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Collection Grid", 
test_efl_ui_collection_grid);
+   ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Collection_View", 
test_efl_ui_collection_view);
ADD_TEST_EO(NULL, "Containers", "Items", test_efl_ui_item);
ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Frame", test_ui_frame);
 
diff --git a/src/bin/elementary/test_ui_collection_view.c 
b/src/bin/elementary/test_ui_collection_view.c
new file mode 100644
index 00..4a3f2f7b7c
--- /dev/null
+++ b/src/bin/elementary/test_ui_collection_view.c
@@ -0,0 +1,144 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include 
+#include 
+
+#define NUM_ITEMS 50
+
+static Efl_Model*
+_make_model(Efl_Ui_Win *win)
+{
+   Eina_Value vi;
+   Efl_Generic_Model *model, *child;
+   unsigned int i;
+
+   model = efl_add(EFL_GENERIC_MODEL_CLASS, win);
+   model = efl_add(EFL_UI_VIEW_MODEL_CLASS, model,
+   efl_ui_view_model_set(efl_added, model));
+   eina_value_setup(, EINA_VALUE_TYPE_INT);
+
+   efl_ui_view_model_property_string_add(model, "relative", "Relative index 
${child.index}", "WRONG", "WRONG");
+   efl_ui_view_model_property_string_add(model, "title", "Initial index 
${initial}", "WRONG", "WRONG");
+
+
+   for (i = 0; i < (NUM_ITEMS); i++)
+ {
+child = efl_model_child_add(model);
+eina_value_set(, i);
+efl_model_property_set(child, "initial", );
+ }
+
+   eina_value_flush();
+   return model;
+}
+
+static void
+_item_constructing(void *data EINA_UNUSED, const Efl_Event *ev)
+{
+   Efl_Gfx_Entity *item = ev->info;
+
+   if (!efl_ui_item_calc_locked_get(item))
+ efl_gfx_hint_size_min_set(item, EINA_SIZE2D(100, 50));
+}
+
+static void
+_item_select(void *data, const Efl_Event *ev)
+{
+   Efl_Ui_Widget *w = efl_ui_single_selectable_last_selected_get(ev->object);
+   Efl_Model *m = efl_ui_view_model_get(w);
+
+   if (m) efl_ui_view_model_set(data, m);
+}
+
+void test_efl_ui_collection_view(void *data EINA_UNUSED,
+ Evas_Object *obj EINA_UNUSED,
+ void *event_info EINA_UNUSED)
+{
+   Efl_Ui_Win *win;
+   Efl_Model *model;
+   Efl_Ui_Frame *f;
+   Efl_Ui_Table *tbl;
+   Efl_Ui_List_View *lv;
+   Efl_Ui_Grid_View *gv;
+   Efl_Ui_Factory *fg, *fl;
+   Efl_Ui_Box *ib;
+   Efl_Ui_Widget *o;
+   Efl_Model_Provider *provider;
+
+   win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
+ efl_text_set(efl_added, "Efl.Ui.Collection_View

[EGIT] [core/efl] master 03/08: elementary: Efl.Ui.Image_Factory bind property also during widget creation.

2019-09-24 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit af3f1b070f1ef4480694fe4ab954b83fdae43f09
Author: Cedric BAIL 
Date:   Fri Aug 23 14:48:14 2019 -0700

elementary: Efl.Ui.Image_Factory bind property also during widget creation.

In the same vain as previous patch this will initialize more of the widget 
during its
creation and reduce unecessary recalc.

Reviewed-by: Marcel Hollerbach 
Reviewed-by: SangHyeon Jade Lee 
Differential Revision: https://phab.enlightenment.org/D9950
---
 src/lib/elementary/efl_ui_image_factory.c  | 22 +-
 src/lib/elementary/efl_ui_image_factory.eo |  1 +
 2 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/lib/elementary/efl_ui_image_factory.c 
b/src/lib/elementary/efl_ui_image_factory.c
index 4d0c139e8b..0010570baa 100644
--- a/src/lib/elementary/efl_ui_image_factory.c
+++ b/src/lib/elementary/efl_ui_image_factory.c
@@ -35,34 +35,22 @@ _efl_ui_image_factory_efl_object_destructor(Eo *obj 
EINA_UNUSED, Efl_Ui_Image_Fa
efl_destructor(efl_super(obj, MY_CLASS));
 }
 
-static Eina_Value
-_efl_ui_image_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value 
value)
+EOLIAN static void
+_efl_ui_image_factory_efl_ui_factory_building(const Eo *obj EINA_UNUSED, 
Efl_Ui_Image_Factory_Data *pd, Efl_Gfx_Entity *ui_view)
 {
-   Efl_Ui_Image_Factory_Data *pd = data;
-   Efl_Gfx_Entity *entity;
-   int len, i;
-
-   EINA_VALUE_ARRAY_FOREACH(, len, i, entity)
- efl_ui_property_bind(entity, "filename", pd->property);
+   efl_ui_property_bind(ui_view, "filename", pd->property);
 
-   return value;
+   efl_ui_factory_building(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), 
ui_view);
 }
 
 EOLIAN static Eina_Future *
 _efl_ui_image_factory_efl_ui_factory_create(Eo *obj, Efl_Ui_Image_Factory_Data 
*pd,
 Eina_Iterator *models, 
Efl_Gfx_Entity *parent)
 {
-   Eina_Future *f;
-
if (!parent) return efl_loop_future_rejected(obj, 
EFL_FACTORY_ERROR_NOT_SUPPORTED);
if (!pd->property) return efl_loop_future_rejected(obj, 
EFL_FACTORY_ERROR_NOT_SUPPORTED);
 
-   f = efl_ui_factory_create(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), 
models, parent);
-
-   return efl_future_then(obj, f,
-  .success_type = EINA_VALUE_TYPE_ARRAY,
-  .success = _efl_ui_image_factory_bind,
-  .data = pd);
+   return efl_ui_factory_create(efl_super(obj, EFL_UI_IMAGE_FACTORY_CLASS), 
models, parent);
 }
 
 EOLIAN static Eina_Error
diff --git a/src/lib/elementary/efl_ui_image_factory.eo 
b/src/lib/elementary/efl_ui_image_factory.eo
index 5ebcc1cd32..57acc7ea12 100644
--- a/src/lib/elementary/efl_ui_image_factory.eo
+++ b/src/lib/elementary/efl_ui_image_factory.eo
@@ -5,6 +5,7 @@ class @beta Efl.Ui.Image_Factory extends Efl.Ui.Caching_Factory
   Efl.Object.constructor;
   Efl.Object.destructor;
   Efl.Ui.Factory.create;
+  Efl.Ui.Factory.building;
   Efl.Ui.Property_Bind.property_bind;
}
 }

-- 




[EGIT] [core/efl] master 01/08: ecore: correctly handle children removal in Efl.Composite_Model by updating all required index.

2019-09-24 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 6e497527125e4727e6168b1ee4b54d4146808633
Author: Cedric Bail 
Date:   Wed Sep 18 19:31:05 2019 -0700

ecore: correctly handle children removal in Efl.Composite_Model by updating 
all required index.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10032
---
 src/lib/ecore/efl_composite_model.c | 99 ++---
 1 file changed, 82 insertions(+), 17 deletions(-)

diff --git a/src/lib/ecore/efl_composite_model.c 
b/src/lib/ecore/efl_composite_model.c
index 26322357d2..b3896bc99e 100644
--- a/src/lib/ecore/efl_composite_model.c
+++ b/src/lib/ecore/efl_composite_model.c
@@ -40,7 +40,26 @@ static int
 _children_indexed_key(const Efl_Composite_Model_Data *node,
   const int *key, int length EINA_UNUSED, void *data 
EINA_UNUSED)
 {
-   return node->index - *key;
+   if (node->index > (unsigned int) *key) return 1;
+   if (node->index < (unsigned int) *key) return -1;
+   return 0;
+}
+
+static void
+_mark_greater(Efl_Composite_Model_Data *root, Eina_Array *mark, const unsigned 
int upper)
+{
+   if (!root) return ;
+
+   if (root->index > upper)
+ {
+eina_array_push(mark, root);
+_mark_greater((void*) EINA_RBTREE_GET(root)->son[0], mark, upper);
+_mark_greater((void*) EINA_RBTREE_GET(root)->son[1], mark, upper);
+ }
+   else
+ {
+_mark_greater((void*) EINA_RBTREE_GET(root)->son[0], mark, upper);
+ }
 }
 
 static void
@@ -137,36 +156,83 @@ _efl_composite_model_index_get(const Eo *obj, 
Efl_Composite_Model_Data *pd)
 }
 
 static void
-_efl_composite_model_child_added(void *data, const Efl_Event *event)
+_efl_composite_model_child_event(Efl_Composite_Model_Data *pd,
+ const Efl_Model_Children_Event *ev,
+ const Efl_Event_Description *description)
 {
-   Efl_Composite_Model_Data *pd = data;
-   Efl_Model_Children_Event *ev = event->info;
+   Efl_Composite_Model_Data *cpd;
Efl_Model_Children_Event cev = { 0 };
+   Eina_Array mark;
+   Eina_Array_Iterator iterator;
+   unsigned int i;
 
cev.index = ev->index;
if (ev->child)
- cev.child = _efl_composite_lookup(efl_class_get(pd->self),
-   pd->self, ev->child, ev->index);
-   efl_event_callback_call(pd->self, EFL_MODEL_EVENT_CHILD_ADDED, );
+ {
+cev.child = _efl_composite_lookup(efl_class_get(pd->self),
+  pd->self, ev->child, ev->index);
+ }
+   else
+ {
+cpd = (void*) eina_rbtree_inline_lookup(pd->indexed, , 
sizeof (unsigned int),
+
EINA_RBTREE_CMP_KEY_CB(_children_indexed_key), NULL);
+if (cpd) cev.child = efl_ref(cpd->self);
+ }
+
+   if (cev.child && description == EFL_MODEL_EVENT_CHILD_REMOVED)
+ {
+cpd = efl_data_scope_get(cev.child, EFL_COMPOSITE_MODEL_CLASS);
+
+// Remove child from lookup tree if it exist before triggering 
anything further
+pd->indexed = eina_rbtree_inline_remove(pd->indexed, 
EINA_RBTREE_GET(cpd),
+
EINA_RBTREE_CMP_NODE_CB(_children_indexed_cmp), NULL);
+cpd->inserted = EINA_FALSE;
+efl_replace(>source, NULL);
+ }
+
+   // Update all index above this one if necessaryy
+   eina_array_step_set(, sizeof (Eina_Array), 8);
+   _mark_greater((void*) pd->indexed, , cev.index);
+
+   // Correct index of the object stored that need to
+   // There is no need to remove and reinsert them as their relative order 
will not change.
+   EINA_ARRAY_ITER_NEXT(, i, cpd, iterator)
+ {
+if (description == EFL_MODEL_EVENT_CHILD_REMOVED) cpd->index--;
+else cpd->index++;
+
+efl_ref(cpd->self);
+ }
+
+   efl_event_callback_call(pd->self, description, );
+
+   // Notify of the index change only after notifying of the removal top avoid 
overlap
+   EINA_ARRAY_ITER_NEXT(, i, cpd, iterator)
+  {
+ efl_model_properties_changed(cpd->self, 
EFL_COMPOSITE_MODEL_CHILD_INDEX);
+ efl_unref(cpd->self);
+  }
+   eina_array_flush();
 
efl_unref(cev.child);
 }
 
 static void
-_efl_composite_model_child_removed(void *data, const Efl_Event *event)
+_efl_composite_model_child_added(void *data, const Efl_Event *event)
 {
Efl_Composite_Model_Data *pd = data;
Efl_Model_Children_Event *ev = event->info;
-   Efl_Model_Children_Event cev = { 0 };
 
-   cev.index = ev->index;
-   if (ev->child)
- cev.child = _efl_composite_lookup(efl_class_get(pd->self),
-   pd->self, ev->child, ev->index);
+   _efl_composite_model_child

[EGIT] [core/efl] master 08/08: efl: make Efl.Ui.Factory.release work in batches.

2019-09-24 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 5493cc539678739471d5c6444a36dc5fdc3866a8
Author: Cedric Bail 
Date:   Sun Sep 15 22:39:05 2019 -0700

efl: make Efl.Ui.Factory.release work in batches.

This will enable better strategy in scheduling removal of object from the 
cache
instead of doing the throttling in the View as there is a better 
understanding
of the different layer the items are going to go through and where they will
consume time.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D9955
---
 src/lib/efl/interfaces/efl_ui_factory.eo|   2 +-
 src/lib/elementary/efl_ui_caching_factory.c | 100 +---
 src/lib/elementary/efl_ui_layout.c  |  18 ++---
 src/lib/elementary/efl_ui_list_view.c   |   4 +-
 src/lib/elementary/efl_ui_widget_factory.c  |  18 +++--
 5 files changed, 100 insertions(+), 42 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_ui_factory.eo 
b/src/lib/efl/interfaces/efl_ui_factory.eo
index 1db7d8fb9c..47dd203f6e 100644
--- a/src/lib/efl/interfaces/efl_ui_factory.eo
+++ b/src/lib/efl/interfaces/efl_ui_factory.eo
@@ -29,7 +29,7 @@ interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, 
Efl.Ui.Factory_Bind
   release {
  [[Release a UI object and disconnect from models.]]
  params {
-ui_view: Efl.Gfx.Entity; [[Object to remove.]]
+ui_views: iterator @move; [[Object to remove.]]
  }
   }
}
diff --git a/src/lib/elementary/efl_ui_caching_factory.c 
b/src/lib/elementary/efl_ui_caching_factory.c
index 54f5fd9442..7dbfc0aae9 100644
--- a/src/lib/elementary/efl_ui_caching_factory.c
+++ b/src/lib/elementary/efl_ui_caching_factory.c
@@ -21,6 +21,7 @@ struct _Efl_Ui_Caching_Factory_Data
// end of the list objects are added and removed.
Eina_List *cache;
Eina_Hash *lookup;
+   Eina_Future *flush;
 
struct {
   unsigned int memory;
@@ -57,15 +58,29 @@ _efl_ui_caching_factory_remove(Efl_Ui_Caching_Factory_Data 
*pd, Eina_List *l, Ef
 
 static void
 _efl_ui_caching_factory_item_del(Eo *obj, Efl_Ui_Caching_Factory_Data *pd,
- Efl_Gfx_Entity *entity)
+ Eina_Iterator *entities)
 {
-   if (pd->klass) efl_del(entity);
-   else efl_ui_factory_release(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS), 
entity);
+   if (!pd->klass)
+ {
+efl_ui_factory_release(efl_super(obj, EFL_UI_CACHING_FACTORY_CLASS), 
entities);
+ }
+   else
+ {
+Efl_Gfx_Entity *entity;
+
+EINA_ITERATOR_FOREACH(entities, entity)
+  efl_del(entity);
+eina_iterator_free(entities);
+ }
 }
 
 static void
 _efl_ui_caching_factory_flush(Eo *obj, Efl_Ui_Caching_Factory_Data *pd)
 {
+   Eina_Array scheduled;
+
+   eina_array_step_set(, sizeof (Eina_Array), 8);
+
while (pd->limit.items != 0 &&
   pd->current.items > pd->limit.items)
  {
@@ -75,7 +90,8 @@ _efl_ui_caching_factory_flush(Eo *obj, 
Efl_Ui_Caching_Factory_Data *pd)
 
 _efl_ui_caching_factory_remove(pd, eina_list_last(pd->cache), entity);
 if (pd->lookup) eina_hash_del(pd->lookup, 
efl_ui_widget_style_get(entity), entity);
-_efl_ui_caching_factory_item_del(obj, pd, entity);
+
+eina_array_push(, entity);
  }
 
while (pd->limit.memory != 0 &&
@@ -87,8 +103,13 @@ _efl_ui_caching_factory_flush(Eo *obj, 
Efl_Ui_Caching_Factory_Data *pd)
 
 _efl_ui_caching_factory_remove(pd, eina_list_last(pd->cache), entity);
 if (pd->lookup) eina_hash_del(pd->lookup, 
efl_ui_widget_style_get(entity), entity);
-_efl_ui_caching_factory_item_del(obj, pd, entity);
+
+eina_array_push(, entity);
  }
+
+   // We could improve this by doing some limited batch to reduce potential 
spike usage
+   _efl_ui_caching_factory_item_del(obj, pd, 
eina_array_iterator_new());
+   eina_array_flush();
 }
 
 static Eina_Value
@@ -343,38 +364,67 @@ _efl_ui_caching_factory_items_limit_get(const Eo *obj 
EINA_UNUSED,
return pd->limit.items;
 }
 
+static Eina_Value
+_schedule_cache_flush(Eo *obj, void *data, const Eina_Value v)
+{
+   Efl_Ui_Caching_Factory_Data *pd = data;
+
+   // And check if the cache need some triming
+   _efl_ui_caching_factory_flush(obj, pd);
+
+   return v;
+}
+
+static void
+_schedule_done(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future 
EINA_UNUSED)
+{
+   Efl_Ui_Caching_Factory_Data *pd = data;
+
+   pd->flush = NULL;
+}
+
 static void
 _efl_ui_caching_factory_efl_ui_factory_release(Eo *obj,
Efl_Ui_Caching_Factory_Data *pd,
-   Efl_Gfx_Entity *ui_view)
+   Eina_Iterator *ui_views)
 {
+   Efl_

[EGIT] [core/efl] master 06/08: efl: simplify logic for widget created by factory.

2019-09-24 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 892c26f906d23595b709b834dde6b032bdd6d89d
Author: Cedric Bail 
Date:   Sun Sep 15 20:50:05 2019 -0700

efl: simplify logic for widget created by factory.

In an attempt to make things more complex than they should have been,
I tried to change the inheritance tree on the fly and assume widget would
rely on autodeleting its children. This is way more complex of a solution
than to let the View actually release all the child manually and just set
the window as the default parent.h

Co-authored-by: Marcel Hollerbach 

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D9953
---
 src/examples/elementary/layout_property_bind.c |  2 +-
 src/lib/efl/interfaces/efl_interfaces_main.c   |  7 ++-
 src/lib/efl/interfaces/efl_ui_factory.eo   |  1 -
 src/lib/efl/interfaces/efl_ui_view_factory.eo  |  1 -
 src/lib/elementary/efl_ui_caching_factory.c| 76 +-
 src/lib/elementary/efl_ui_caching_factory.eo   |  2 +-
 src/lib/elementary/efl_ui_image_factory.c  |  6 +-
 src/lib/elementary/efl_ui_layout.c |  4 +-
 src/lib/elementary/efl_ui_list_view.c  |  4 +-
 src/lib/elementary/efl_ui_widget_factory.c | 32 ---
 src/lib/elementary/efl_ui_widget_factory.eo|  1 +
 src/lib/elementary/elm_priv.h  |  2 +
 12 files changed, 74 insertions(+), 64 deletions(-)

diff --git a/src/examples/elementary/layout_property_bind.c 
b/src/examples/elementary/layout_property_bind.c
index da4c5e6020..f9c5cf979e 100644
--- a/src/examples/elementary/layout_property_bind.c
+++ b/src/examples/elementary/layout_property_bind.c
@@ -169,7 +169,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
efl_ui_property_bind(img_factory, "", "path"); //connect to "path" property
efl_ui_factory_bind(priv->bt, "icon", img_factory);
 
-   efl_future_then(win, efl_ui_view_factory_create_with_event(img_factory, 
NULL, bxr),
+   efl_future_then(win, efl_ui_view_factory_create_with_event(img_factory, 
NULL),
.success = _wait_for_image,
.data = priv);
 
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c 
b/src/lib/efl/interfaces/efl_interfaces_main.c
index 4f144bebcf..91b7ff1775 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -127,10 +127,11 @@ _efl_ui_view_factory_item_created(Eo *factory, void *data 
EINA_UNUSED, const Ein
return v;
 }
 
-static Eina_Future *
-_efl_ui_view_factory_create_with_event(Efl_Ui_Factory *factory, Eina_Iterator 
*models, Efl_Gfx_Entity *parent)
+EOLIAN static Eina_Future *
+_efl_ui_view_factory_create_with_event(Efl_Ui_Factory *factory, Eina_Iterator 
*models)
 {
-   return efl_future_then(factory, efl_ui_factory_create(factory, models, 
parent),
+   EINA_SAFETY_ON_NULL_RETURN_VAL(factory, NULL);
+   return efl_future_then(factory, efl_ui_factory_create(factory, models),
   .success_type = EINA_VALUE_TYPE_ARRAY,
   .success = _efl_ui_view_factory_item_created);
 }
diff --git a/src/lib/efl/interfaces/efl_ui_factory.eo 
b/src/lib/efl/interfaces/efl_ui_factory.eo
index bd3d84f11b..7eda0c6c84 100644
--- a/src/lib/efl/interfaces/efl_ui_factory.eo
+++ b/src/lib/efl/interfaces/efl_ui_factory.eo
@@ -23,7 +23,6 @@ interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, 
Efl.Ui.Factory_Bind
  params {
 models: iterator; [[Efl iterator providing the model to 
be associated to the new item.
It should remain valid until the 
end of the function call.]]
-parent: Efl.Gfx.Entity; [[Efl canvas.]]
  }
  return: future; [[Created UI object.]]
   }
diff --git a/src/lib/efl/interfaces/efl_ui_view_factory.eo 
b/src/lib/efl/interfaces/efl_ui_view_factory.eo
index bb1e4a44c3..728c25907c 100644
--- a/src/lib/efl/interfaces/efl_ui_view_factory.eo
+++ b/src/lib/efl/interfaces/efl_ui_view_factory.eo
@@ -12,7 +12,6 @@ class @beta Efl.Ui.View_Factory
  event onto.]]
 models: iterator; [[Efl iterator providing the model to 
be associated to the new item. It should
  remain valid until the end of the 
function call.]]
-parent: Efl.Gfx.Entity; [[Efl canvas]]
  }
  return: future; [[Created UI object]]
   }
diff --git a/src/lib/elementary/efl_ui_caching_factory.c 
b/src/lib/elementary/efl_ui_caching_factory.c
index 843871ebe1..3035c308b4 100644
--- a/src/lib/elementary/efl_ui_caching_factory.c
+++ b/src/lib/elementary/efl_ui_caching_factory.c
@@ -125,7 +125,7 @@ _efl_ui_caching_factory_create_then(Eo *model, void *data, 
const Eina_Value v)
 

[EGIT] [core/efl] master 04/08: elementary: Efl.Ui.Layout_Factory bind property during widget creation.

2019-09-24 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 3c0b496ad34289b9e09a1d357bea31fb0069544a
Author: Cedric BAIL 
Date:   Fri Aug 23 14:51:54 2019 -0700

elementary: Efl.Ui.Layout_Factory bind property during widget creation.

In the same vain as previous patch this will initialize more of the widget 
during its
creation and reduce unecessary recalc.

Reviewed-by: Marcel Hollerbach 
Reviewed-by: SangHyeon Jade Lee 
Differential Revision: https://phab.enlightenment.org/D9951
---
 src/lib/elementary/efl_ui_layout_factory.c  | 37 -
 src/lib/elementary/efl_ui_layout_factory.eo |  1 -
 2 files changed, 5 insertions(+), 33 deletions(-)

diff --git a/src/lib/elementary/efl_ui_layout_factory.c 
b/src/lib/elementary/efl_ui_layout_factory.c
index 58c8235b9e..ed9d975d40 100644
--- a/src/lib/elementary/efl_ui_layout_factory.c
+++ b/src/lib/elementary/efl_ui_layout_factory.c
@@ -70,46 +70,19 @@ _efl_ui_layout_factory_efl_object_destructor(Eo *obj, 
Efl_Ui_Layout_Factory_Data
efl_destructor(efl_super(obj, MY_CLASS));
 }
 
-static Eina_Value
-_efl_ui_layout_factory_bind(Eo *obj EINA_UNUSED, void *data, const Eina_Value 
value)
-{
-   Efl_Ui_Layout_Factory_Data *pd = data;
-   Efl_Gfx_Entity *layout;
-   int len, i;
-
-   EINA_VALUE_ARRAY_FOREACH(, len, i, layout)
- {
-eina_hash_foreach(pd->bind.properties, _property_bind, layout);
-eina_hash_foreach(pd->bind.factories, _factory_bind, layout);
-
-evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 0);
-evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, 
EVAS_HINT_FILL);
- }
-
-   return value;
-}
-
 static void
 _efl_ui_layout_factory_efl_ui_factory_building(const Eo *obj, 
Efl_Ui_Layout_Factory_Data *pd, Efl_Gfx_Entity *ui_view)
 {
if (pd->klass || pd->group || pd->style)
  efl_ui_layout_theme_set(ui_view, pd->klass, pd->group, pd->style);
 
-   efl_ui_factory_building(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), 
ui_view);
-}
-
-EOLIAN static Eina_Future *
-_efl_ui_layout_factory_efl_ui_factory_create(Eo *obj, 
Efl_Ui_Layout_Factory_Data *pd,
- Eina_Iterator *models, 
Efl_Gfx_Entity *parent)
-{
-   Eina_Future *f;
+   eina_hash_foreach(pd->bind.properties, _property_bind, ui_view);
+   eina_hash_foreach(pd->bind.factories, _factory_bind, ui_view);
 
-   f = efl_ui_factory_create(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), 
models, parent);
+   efl_gfx_hint_weight_set(ui_view, EFL_GFX_HINT_EXPAND, 0);
+   efl_gfx_hint_fill_set(ui_view, EINA_TRUE, EINA_TRUE);
 
-   return efl_future_then(obj, f,
-  .success_type = EINA_VALUE_TYPE_ARRAY,
-  .success = _efl_ui_layout_factory_bind,
-  .data = pd);
+   efl_ui_factory_building(efl_super(obj, EFL_UI_LAYOUT_FACTORY_CLASS), 
ui_view);
 }
 
 EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_layout_factory.eo 
b/src/lib/elementary/efl_ui_layout_factory.eo
index d6d473e655..0d35d21706 100644
--- a/src/lib/elementary/efl_ui_layout_factory.eo
+++ b/src/lib/elementary/efl_ui_layout_factory.eo
@@ -15,7 +15,6 @@ class @beta Efl.Ui.Layout_Factory extends 
Efl.Ui.Caching_Factory
implements {
   Efl.Object.constructor;
   Efl.Object.destructor;
-  Efl.Ui.Factory.create;
   Efl.Ui.Factory.building;
   Efl.Ui.Property_Bind.property_bind;
   Efl.Ui.Factory_Bind.factory_bind;

-- 




[EGIT] [core/efl] master 07/08: elementary: rework Efl.Ui.Factory to have another additional stage during releasing of items.

2019-09-24 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 0a99fb87bb856bb53ef627184dc968c6ee46fc7a
Author: Cedric Bail 
Date:   Sun Sep 15 20:52:50 2019 -0700

elementary: rework Efl.Ui.Factory to have another additional stage during 
releasing of items.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D9954
---
 src/lib/efl/interfaces/efl_ui_factory.eo|  1 +
 src/lib/elementary/efl_ui_caching_factory.c |  3 +-
 src/lib/elementary/efl_ui_widget_factory.c  | 62 +++--
 3 files changed, 61 insertions(+), 5 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_ui_factory.eo 
b/src/lib/efl/interfaces/efl_ui_factory.eo
index 7eda0c6c84..1db7d8fb9c 100644
--- a/src/lib/efl/interfaces/efl_ui_factory.eo
+++ b/src/lib/efl/interfaces/efl_ui_factory.eo
@@ -39,5 +39,6 @@ interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, 
Efl.Ui.Factory_Bind
   item,building: Efl.Gfx.Entity; [[Event triggered when an item has 
processed @Efl.Object.finalize, but before all the factory are done building it.
  Note: if the @Efl.Ui.Factory does keep a 
cache of object, this will be called when object are pulled out of the cache.]]
   item,created: Efl.Gfx.Entity; [[Event triggered when an item has been 
successfully created by the factory and is about to be used by an 
@Efl.Ui.View.]]
+  item,releasing: Efl.Gfx.Entity; [[Event triggered when an item is being 
released by the @Efl.Ui.Factory. It must be assumed that after this call, the 
object can be recycle to another @Efl.Ui.View and there can be more than one 
call for the same item.]]
}
 }
diff --git a/src/lib/elementary/efl_ui_caching_factory.c 
b/src/lib/elementary/efl_ui_caching_factory.c
index 3035c308b4..54f5fd9442 100644
--- a/src/lib/elementary/efl_ui_caching_factory.c
+++ b/src/lib/elementary/efl_ui_caching_factory.c
@@ -136,6 +136,7 @@ _efl_ui_caching_factory_create_then(Eo *model, void *data, 
const Eina_Value v)
_efl_ui_caching_factory_remove(r->pd, eina_list_data_find(r->pd->cache, w), 
w);
 
efl_ui_view_model_set(w, model);
+   efl_event_callback_call(r->factory, EFL_UI_FACTORY_EVENT_ITEM_BUILDING, w);
 
return eina_value_object_init(w);
 }
@@ -356,7 +357,7 @@ _efl_ui_caching_factory_efl_ui_factory_release(Eo *obj,
 
// Change parent, disconnect the object and make it invisible
efl_gfx_entity_visible_set(ui_view, EINA_FALSE);
-   efl_ui_view_model_set(ui_view, NULL);
+   efl_event_callback_call(obj, EFL_UI_FACTORY_EVENT_ITEM_RELEASING, ui_view);
 
// Add to the cache
pd->cache = eina_list_prepend(pd->cache, ui_view);
diff --git a/src/lib/elementary/efl_ui_widget_factory.c 
b/src/lib/elementary/efl_ui_widget_factory.c
index a485edfe7b..d7fc34ba64 100644
--- a/src/lib/elementary/efl_ui_widget_factory.c
+++ b/src/lib/elementary/efl_ui_widget_factory.c
@@ -90,9 +90,28 @@ static void
 _efl_ui_widget_factory_constructing(void *data EINA_UNUSED, const Efl_Event 
*ev)
 {
Efl_Gfx_Entity *ui_view = ev->info;
+   const Efl_Model *model;
+   Eina_Value *width, *height;
+
+   model = efl_ui_view_model_get(ui_view);
+
+   // Fetch min size from model if available to avoid recalculcating it
+   width = efl_model_property_get(model, "self.width");
+   height = efl_model_property_get(model, "self.height");
+   if (eina_value_type_get(width) != EINA_VALUE_TYPE_ERROR &&
+   eina_value_type_get(height) != EINA_VALUE_TYPE_ERROR)
+ {
+Eina_Size2D s;
 
-   /* NOP */
-   (void)(ui_view);
+if (!eina_value_int_convert(width, )) s.w = 0;
+if (!eina_value_int_convert(height, )) s.h = 0;
+
+/* efl_event_freeze(ui_view); */
+efl_key_data_set(ui_view, "efl.ui.widget.factory.size_set", 
(void*)EINA_TRUE);
+efl_gfx_hint_size_min_set(ui_view, s);
+ }
+   eina_value_free(width);
+   eina_value_free(height);
 }
 
 
@@ -109,6 +128,10 @@ _efl_ui_widget_factory_building(void *data, const 
Efl_Event *ev)
 
model = efl_ui_view_model_get(ui_view);
 
+   // Check property size only if not checked yet
+   if (!efl_key_data_get(ui_view, "efl.ui.widget.factory.size_check"))
+ _efl_ui_widget_factory_constructing(data, ev);
+
// Bind all property before the object is finalize
it = eina_hash_iterator_data_new(pd->parts);
EINA_ITERATOR_FOREACH(it, bpd)
@@ -152,9 +175,37 @@ _efl_ui_widget_factory_building(void *data, const 
Efl_Event *ev)
eina_value_free(property);
 }
 
+static void
+_efl_ui_widget_factory_releasing(void *data, const Efl_Event *ev)
+{
+   Efl_Ui_Widget_Factory_Data *pd = data;
+   Efl_Gfx_Entity *ui_view = ev->info;
+   Efl_Ui_Bind_Part_Data *bpd;
+   Eina_Iterator *it;
+
+   efl_key_data_set(ui_view, "efl.ui.widget.factory.size_set", NULL);
+   efl_key_data_set(ui_view, &q

[EGIT] [core/efl] master 02/08: ecore: update Efl.Boolean_Model to handle children removal and shifting all necessary boolean and index.

2019-09-24 Thread Cedric BAIL
bu5hm4n pushed a commit to branch master.

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

commit 23c24b36a12079a85bfd88ea8874f3156bdc04c2
Author: Cedric Bail 
Date:   Wed Sep 18 19:31:39 2019 -0700

ecore: update Efl.Boolean_Model to handle children removal and shifting all 
necessary boolean and index.

Reviewed-by: Marcel Hollerbach 
Differential Revision: https://phab.enlightenment.org/D10033
---
 src/lib/ecore/efl_boolean_model.c | 401 +-
 1 file changed, 308 insertions(+), 93 deletions(-)

diff --git a/src/lib/ecore/efl_boolean_model.c 
b/src/lib/ecore/efl_boolean_model.c
index 2e09930fb0..4c440f1ffb 100644
--- a/src/lib/ecore/efl_boolean_model.c
+++ b/src/lib/ecore/efl_boolean_model.c
@@ -8,6 +8,7 @@
 
 typedef struct _Efl_Boolean_Model_Data Efl_Boolean_Model_Data;
 typedef struct _Efl_Boolean_Model_Value Efl_Boolean_Model_Value;
+typedef struct _Efl_Boolean_Model_Storage_Range 
Efl_Boolean_Model_Storage_Range;
 
 struct _Efl_Boolean_Model_Data
 {
@@ -15,19 +16,106 @@ struct _Efl_Boolean_Model_Data
Eina_Hash *values;
 };
 
+struct _Efl_Boolean_Model_Storage_Range
+{
+   EINA_RBTREE;
+
+   unsigned int  offset;
+   uint16_t  length; // Maximum length of the buffer will be 256, to avoid 
math error we rely on 16bits here.
+
+   // We over allocate this buffer to have things fitting in one alloc
+   unsigned char buffer[256];
+};
+
 struct _Efl_Boolean_Model_Value
 {
Eina_Stringshare *property;
 
-   // This is not the best for supporting sparse bitfield with random insertion
-   // but will do for now (Would be best to have a tree of fixed size array
-   // or something along that line).
-   unsigned char *buffer;
-   unsigned int   buffer_count;
+   Eina_Rbtree *buffers_root;
+   Efl_Boolean_Model_Storage_Range *last;
 
Eina_Bool  default_value;
 };
 
+static Eina_Rbtree_Direction
+_storage_range_cmp(const Efl_Boolean_Model_Storage_Range *left,
+   const Efl_Boolean_Model_Storage_Range *right,
+   void *data EINA_UNUSED)
+{
+   // We should not have any overlapping range
+   if (left->offset < right->offset)
+ return EINA_RBTREE_LEFT;
+   return EINA_RBTREE_RIGHT;
+}
+
+static int
+_storage_range_key(const Efl_Boolean_Model_Storage_Range *node,
+   const unsigned int *key, int length EINA_UNUSED, void *data 
EINA_UNUSED)
+{
+   if (node->offset > *key) return 1;
+   if (node->offset + node->length < *key) return -1;
+   // The key is in the range!
+   return 0;
+}
+
+static void
+_storage_range_free(Eina_Rbtree *node, void *data EINA_UNUSED)
+{
+   free(node);
+}
+
+static Efl_Boolean_Model_Storage_Range *
+_storage_lookup(Efl_Boolean_Model_Data *pd,
+const char *property,
+unsigned int index,
+Eina_Bool allocate,
+Eina_Bool value,
+Eina_Bool *found,
+Eina_Bool *default_value)
+{
+   Efl_Boolean_Model_Storage_Range *lookup;
+   Efl_Boolean_Model_Value *v;
+   Eina_Stringshare *s;
+
+   // Check if this is requesting a defined boolean property
+   // Property are defined and their value are stored on the parent BOOLEAN
+   s = eina_stringshare_add(property);
+   v = eina_hash_find(pd->parent->values, s);
+   eina_stringshare_del(s);
+
+   if (!v) return NULL;
+   *found = EINA_TRUE;
+   *default_value = !!v->default_value;
+
+   lookup = (void*) eina_rbtree_inline_lookup(v->buffers_root, , sizeof 
(unsigned int),
+  
EINA_RBTREE_CMP_KEY_CB(_storage_range_key), NULL);
+   if (lookup) return lookup;
+   if (!allocate) return NULL;
+
+   // The value is the same as the default value, why bother allocate
+   if (*default_value == value) return NULL;
+
+   // For simplicity we do not create a sparse array, every boolean 
potentially needed are allocated
+   // FIXME: keep it a sparse allocated buffer and only allocate needed buffer 
on demand
+   do
+ {
+lookup = calloc(1, sizeof (Efl_Boolean_Model_Storage_Range));
+if (!lookup) return NULL;
+
+lookup->offset = v->last ? v->last->offset + v->last->length + 1 : 0;
+lookup->length = sizeof (lookup->buffer) * 8; // Number of bits in the 
buffer
+// Initialize the buffer to the right default value
+if (default_value) memset(>buffer[0], *default_value, sizeof 
(>buffer));
+
+v->buffers_root = eina_rbtree_inline_insert(v->buffers_root, 
EINA_RBTREE_GET(lookup),
+
EINA_RBTREE_CMP_NODE_CB(_storage_range_cmp), NULL);
+v->last = lookup;
+ }
+   while (v->last->offset + v->last->length < index);
+
+   return lookup;
+}
+
 static Eina_Iterator *
 _efl_boolean_model_efl_model_properties_get(const Eo *obj,
 

[EGIT] [core/efl] master 02/06: efl: improve test in checking the return value during Eina_Value get operation.

2019-09-23 Thread Cedric BAIL
zmike pushed a commit to branch master.

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

commit 059e48ff0ef3f084e459e9542e47ba67c9e3f5c1
Author: Cedric Bail 
Date:   Mon Sep 23 15:27:34 2019 -0400

efl: improve test in checking the return value during Eina_Value get 
operation.

Summary: Depends on D10061

Reviewers: zmike, bu5hm4n, SanghyeonLee, segfaultxavi, felipealmeida, 
lauromoura

Reviewed By: bu5hm4n

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10062
---
 src/tests/efl/efl_test_composite_model.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/tests/efl/efl_test_composite_model.c 
b/src/tests/efl/efl_test_composite_model.c
index 5a7d3f21ab..abae4c3666 100644
--- a/src/tests/efl/efl_test_composite_model.c
+++ b/src/tests/efl/efl_test_composite_model.c
@@ -51,9 +51,9 @@ _children_slice_get_then(void *data EINA_UNUSED,
 p_true = efl_model_property_get(child, "test_p_true");
 p_false = efl_model_property_get(child, "test_p_false");
 
-eina_value_int_get(p_int, _int);
-eina_value_bool_get(p_true, _true);
-eina_value_bool_get(p_false, _false);
+fail_if(!eina_value_int_get(p_int, _int));
+fail_if(!eina_value_bool_get(p_true, _true));
+fail_if(!eina_value_bool_get(p_false, _false));
 
 fail_if(v_int != base_ints[i]);
 fail_if(v_true != EINA_TRUE);

-- 




[EGIT] [core/efl] master 17/23: ecore: properly initialize the event structure in Efl.Generic_Model.

2019-09-19 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 6af8a70f37d4ddbf8629e0b6d747518620bca3f7
Author: Cedric Bail 
Date:   Tue Sep 17 18:42:51 2019 -0700

ecore: properly initialize the event structure in Efl.Generic_Model.

Reviewed-by: Mike Blumenkrantz 
Differential Revision: https://phab.enlightenment.org/D10028
---
 src/lib/ecore/efl_generic_model.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/ecore/efl_generic_model.c 
b/src/lib/ecore/efl_generic_model.c
index 99b6f480ec..c478e918d2 100644
--- a/src/lib/ecore/efl_generic_model.c
+++ b/src/lib/ecore/efl_generic_model.c
@@ -144,7 +144,7 @@ _efl_generic_model_efl_model_children_count_get(const Eo 
*obj EINA_UNUSED, Efl_G
 static Eo *
 _efl_generic_model_efl_model_child_add(Eo *obj, Efl_Generic_Model_Data *sd)
 {
-   Efl_Model_Children_Event cevt;
+   Efl_Model_Children_Event cevt = { 0 };
Efl_Model *child;
 
child = efl_add(EFL_GENERIC_MODEL_CLASS, obj);

-- 




[EGIT] [core/efl] master 18/23: ecore: properly initialize all field in event generated by Efl.Generic_Model

2019-09-19 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit f402efbba31515095ac41551483e51b6e283b094
Author: Cedric Bail 
Date:   Tue Sep 17 19:03:48 2019 -0700

ecore: properly initialize all field in event generated by Efl.Generic_Model

Reviewed-by: Mike Blumenkrantz 
Differential Revision: https://phab.enlightenment.org/D10029
---
 src/lib/ecore/efl_generic_model.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/ecore/efl_generic_model.c 
b/src/lib/ecore/efl_generic_model.c
index c478e918d2..dc33428d99 100644
--- a/src/lib/ecore/efl_generic_model.c
+++ b/src/lib/ecore/efl_generic_model.c
@@ -175,7 +175,7 @@ _efl_generic_model_efl_model_child_del(Eo *obj, 
Efl_Generic_Model_Data *sd, Eo *
  {
 if (data == child)
   {
- Efl_Model_Children_Event cevt;
+ Efl_Model_Children_Event cevt = { 0 };
 
  sd->childrens = eina_list_remove_list(sd->childrens, l);
 

-- 




[EGIT] [core/efl] master 16/23: eina: add code to help debug leaking Eina_Value.

2019-09-19 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 2fdad9294876f475225618e9f50d558a62c6bcf3
Author: Cedric Bail 
Date:   Sat Sep 14 19:12:44 2019 -0700

eina: add code to help debug leaking Eina_Value.

Reviewed-by: Mike Blumenkrantz 
Differential Revision: https://phab.enlightenment.org/D9942
---
 src/lib/eina/eina_value.c | 41 +
 1 file changed, 41 insertions(+)

diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c
index 3df0baa329..63f45b9bbe 100644
--- a/src/lib/eina/eina_value.c
+++ b/src/lib/eina/eina_value.c
@@ -5279,6 +5279,9 @@ typedef struct _Eina_Value_Inner_Mp Eina_Value_Inner_Mp;
 struct _Eina_Value_Inner_Mp
 {
Eina_Mempool *mempool;
+#ifdef DEBUG
+   int size;
+#endif
int references;
 };
 
@@ -5310,6 +5313,9 @@ _eina_value_inner_mp_get(int size)
  return NULL;
 
imp->references = 0;
+#ifdef DEBUG
+   imp->size = size;
+#endif
 
imp->mempool = eina_mempool_add(_eina_value_mp_choice,
"Eina_Value_Inner_Mp", NULL, size, 16);
@@ -5517,7 +5523,42 @@ eina_value_init(void)
 Eina_Bool
 eina_value_shutdown(void)
 {
+#ifdef DEBUG
+   Eina_Iterator *it;
+   Eina_Value_Inner_Mp *imp;
+#endif
+
eina_lock_take(&_eina_value_inner_mps_lock);
+
+#ifdef DEBUG
+   it = eina_hash_iterator_data_new(_eina_value_inner_mps);
+   EINA_ITERATOR_FOREACH(it, imp)
+ {
+Eina_Iterator *mit;
+Eina_Value *value;
+
+fprintf(stderr, "There is still %i Eina_Value in pool of size %i\n",
+imp->references, imp->size);
+mit = eina_mempool_iterator_new(imp->mempool);
+EINA_ITERATOR_FOREACH(mit, value)
+  {
+ if (value->type)
+   {
+  char *str = eina_value_to_string(value);
+  fprintf(stderr, "Value %p of type '%s' containing '%s' still 
allocated.\n",
+  value, value->type->name, str);
+  free(str);
+   }
+ else
+   {
+  fprintf(stderr, "Unknown type found for value %p\n", value);
+   }
+  }
+eina_iterator_free(mit);
+ }
+   eina_iterator_free(it);
+#endif
+
if (eina_hash_population(_eina_value_inner_mps) != 0)
  ERR("Cannot free eina_value internal memory pools -- still in use!");
else

-- 




[EGIT] [core/efl] master 20/23: efl: improve Efl.Boolean_Model test to enforce Eina_Value type too.

2019-09-19 Thread Cedric BAIL
cedric pushed a commit to branch master.

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

commit 8128e3fea2af21b41ff420fc0fc2cd2045b72684
Author: Cedric Bail 
Date:   Wed Sep 18 19:30:17 2019 -0700

efl: improve Efl.Boolean_Model test to enforce Eina_Value type too.

Reviewed-by: Mike Blumenkrantz 
Differential Revision: https://phab.enlightenment.org/D10031
---
 src/tests/efl/efl_test_composite_model.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/tests/efl/efl_test_composite_model.c 
b/src/tests/efl/efl_test_composite_model.c
index d20bc1c017..5a7d3f21ab 100644
--- a/src/tests/efl/efl_test_composite_model.c
+++ b/src/tests/efl/efl_test_composite_model.c
@@ -43,7 +43,7 @@ _children_slice_get_then(void *data EINA_UNUSED,
 Eina_Value *p_int = NULL;
 Eina_Value *p_true = NULL;
 Eina_Value *p_false = NULL;
-int v_int = 0;
+int v_int = -1;
 Eina_Bool v_true = EINA_FALSE;
 Eina_Bool v_false = EINA_TRUE;
 
@@ -51,9 +51,9 @@ _children_slice_get_then(void *data EINA_UNUSED,
 p_true = efl_model_property_get(child, "test_p_true");
 p_false = efl_model_property_get(child, "test_p_false");
 
-eina_value_get(p_int, _int);
-eina_value_get(p_true, _true);
-eina_value_get(p_false, _false);
+eina_value_int_get(p_int, _int);
+eina_value_bool_get(p_true, _true);
+eina_value_bool_get(p_false, _false);
 
 fail_if(v_int != base_ints[i]);
 fail_if(v_true != EINA_TRUE);

-- 




  1   2   3   4   5   6   7   8   9   10   >