Commit Graph

23 Commits

Author SHA1 Message Date
Cedric BAIL b9e0d25a4c elementary: reduce event generation during object creation by Efl.Ui.WidgetFactory.
We can not freeze the canvas in all scenario as we are sometime building widget fully
asynchronously which prevent holding events on the canvas. Still it is better to do it
for the case we can.

Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10685
2019-12-11 11:11:52 +01:00
Bruno da Silva Belo f18a5b4389 c: coverity: resource leaked when using realloc.
Summary:
from https://en.cppreference.com/w/c/memory/realloc
```
On success, returns the pointer to the beginning of newly allocated memory.
To avoid a memory leak, the returned pointer must be deallocated with free()
or realloc(). The original pointer ptr is invalidated and any access to it
is undefined behavior (even if reallocation was in-place).

On failure, returns a null pointer. The original pointer ptr remains valid
and may need to be deallocated with free() or realloc(). ```
So a temporary to test if `realloc` failed
then use the original pointer to use `free`.
`CID1404749`
`CID1404741`

Reviewers: lauromoura, felipealmeida, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10284
2019-10-07 09:02:10 -04:00
Cedric Bail 267f8fcfa8 elementary: return an error when unimplemented function on Efl.Ui.Widget_Factory.
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10130
2019-09-25 11:31:02 -07:00
Cedric Bail 78ee2ca6b0 elementary: add support for default property on item being created by Efl.Ui.Widget_Factory.
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D10129
2019-09-25 11:31:00 -07:00
Lauro Moura 4234dcfc3e csharp: Fix factory instantiation
After 892c26f906, widget factories require
a widget to be their parents.

This commit updates C# tests and adds a warning message to elementary if the user does
not provide one.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10122
2019-09-24 13:56:07 -07:00
Cedric BAIL 2e1317baed 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 <zmike@samsung.com>
Co-authored-by: Marcel Hollerbach <mail@marcel-hollerbach.de>

Differential Revision: https://phab.enlightenment.org/D9958
2019-09-24 11:12:43 -07:00
Cedric Bail 5493cc5396 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 <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9955
2019-09-24 09:18:52 +02:00
Cedric Bail 0a99fb87bb elementary: rework Efl.Ui.Factory to have another additional stage during releasing of items.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9954
2019-09-24 09:18:50 +02:00
Cedric Bail 892c26f906 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 <mail@marcel-hollerbach.de>

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9953
2019-09-24 09:18:49 +02:00
Marcel Hollerbach 759ac54e7f efl: split Efl.Ui.Factory.create stage into constructing and building
constructing is called during construction time, building is called
after finalize. This is usefull for theme related properties that can
only be set after the theme is applied, which happens during finalize.
Being event allow the user of the factory to add more initialization
without needing to implement any new class.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9952
2019-09-24 09:18:47 +02:00
Jaehyun Cho 98c2a75bda elementary: unref objects when memory allocation fails in factory
The objects referenced are unreferenced when memory allocation fails in
elementary factory.

Differential Revision: https://phab.enlightenment.org/D9968
2019-09-23 14:15:41 +02:00
Cedric BAIL 3e9f619b1d elementary: Efl.Ui.Widget_Factory bind widget property before finalizing the widget.
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 <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9949
2019-09-19 14:37:56 -07:00
Cedric BAIL cc49c8ac64 elementary: leverage sizing information from model if available to avoid unecessary calc.
With the new Efl unified infrastructure, we do delay a lot of the computation to finalize,
by filling the object information before finalize we reduce unecessary computation.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9948
2019-09-19 14:37:54 -07:00
Chris Michael bb7353b450 efl_ui_widget_factory: Fix resource leaks
Small patch to fix resource leaks pointed out by Coverity

Fixes Coverity CID1404766
2019-09-17 09:21:15 -04:00
Cedric BAIL 00d58640e5 efl: mark Efl.Ui.Factory.create a protected method.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9606
2019-08-21 11:18:46 -07:00
Cedric BAIL f6cdbc2d43 elementary: allow Efl.Ui.Factory to have a chance to call constructor function.
Reviewed-by: Lauro Neto <Lauro Moura <lauromoura@expertisesolutions.com.br>>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9599
2019-08-21 11:18:36 -07:00
Cedric BAIL 0248d504b3 elementary: switch Efl.Ui.Factory API to a batch API and update all class using it.
Reviewed-by: Lauro Neto <Lauro Moura <lauromoura@expertisesolutions.com.br>>
Differential Revision: https://phab.enlightenment.org/D9579
2019-08-21 11:18:34 -07:00
Lauro Moura 252f0c42a0 elementary: Avoid segfault when part is not set.
Check whether we called `efl_part_get` before.

This was happening to C# bindings (maybe a bug there?) but in any case a
failure is safer than a segfault.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9563
2019-08-14 12:08:19 -07:00
Cedric BAIL 74aff95fca elementary: add support for widget part property bind.
Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D9527
2019-08-12 10:13:33 -07:00
Cedric BAIL 98e5a71974 efl: add an event for the View to know if someone did bound a property.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7945
2019-03-08 14:31:04 -08:00
Cedric BAIL d0b70ef4e7 efl: Property_Bind should actually tell us if it succeeded or failed by returning an Eina.Error.
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7939
2019-03-07 09:58:54 -08:00
SangHyeon Jade Lee 053146598c efl_ui : rename model connect and factory connect to bind property and factory.
As we discussed in T7469 with V40,

efl_ui_model_connect
efl_ui_factory_model_connect

need to be renamed to

efl_ui_bind_property
efl_ui_bind_factory

for this work,
Efl.Ui.Model.Connect interface is changed as Efl.Ui.Bind,
and bind_property and bind_factory both method is supported by this interface.

bind_factory need Efl.Ui.Factory,
and Efl.Ui.Factory inheritted Efl.Ui.Bind,
so I little bit concerned about circular referencing, but so far, it works well.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7529
2019-02-11 11:06:13 -08:00
Cedric BAIL aa0e89a590 elementary: add Efl.Ui.Widget_Factory.
The Widget_Factory is in charge of creating any object that inherit from Efl.Ui.Widget Class.
If the style property is connected to a model property, it will fetch it and build the widget
with that style. This factory is to be used with every View.

Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7704
2019-01-30 11:29:29 -08:00