Commit Graph

34 Commits

Author SHA1 Message Date
Yeongjong Lee 9c52484caf efl_pack_table: rename table_position to cell_column, cell_row
Summary:
Rename ambiguous `table_position` property. it is actually related to child
column, row.

ref T7900

Reviewers: segfaultxavi, zmike

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7900

Differential Revision: https://phab.enlightenment.org/D9611
2019-08-27 12:57:35 +02:00
Yeongjong Lee b60e949fb6 efl_ui_table: remove inlist items in EINA_INLIST_FREE macro
Summary:
Check the EINA_INLIST_FREE document
```
in eina_inlist.h

NOTE: it is the duty of the body loop to properly remove the item from the
inlist and free it. This function will turn into a infinite loop if you
don't remove all items from the list.
```

This will avoid infinite loop when Efl.Ui.Table is invalidated.

ref T8145

Test Plan: See the test file in T8145

Reviewers: brunobelo, Jaehyun_Cho, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8145

Differential Revision: https://phab.enlightenment.org/D9699
2019-08-23 13:38:33 -04:00
Mike Blumenkrantz 7e517e2a11 elm/efl_ui: remove elm_layout_sizing_eval implementations
Summary:
historically there have been two methods of calculating sizes in elm:
* elm_layout_sizing_eval
* evas_object_smart_calculate (now efl_canvas_group_calculate)

the former was used to set size hints on widgets, while the latter was
used to perform internal size calcs for the widget. for things to
work correctly, these functions had to be triggered in just the right
order at just the right time. many hard-to-fix bugs related to widget
sizing over the years have been the result of this split

this patch removes elm_layout_sizing_eval implementations so that all
widgets perform both internal size calcs and size hint setting all
in the same function, ensuring that these are always in sync

the result is that in the vast majority of cases, far fewer recalcs
happen for widgets, and they are quicker to achieve their final size

Depends on D9438

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9439
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz 3ba31a1f5c efl_ui/table: optimize position_set operations with tables
if a table is moved and no other changes are made to the table or its children,
e.g., if the table is scrolled, then there is no need to loop over the table's
items repeatedly in order to accurately calculate all the item geometries
and positions.

instead, simply apply an offset from the last table calc position to each child
item and handle the position changes more transparently

this yields roughly a 12% perf improvement to the 'efl.ui.scroller simple2' test
and brings rendering up to nearly 60fps

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9346
2019-07-19 10:55:03 -07:00
Xavi Artigas 38d7d33354 Rename Efl.Ui.Direction -> Efl.Ui.Layout_Orientation
Summary:
This clarifies a bit the whole Orientation vs. Direction confusion, at the
expense of longer names (Image_Orientation vs. Layout_Orientation).
Also, the interfaces are now adjectives (Orientable) and the enums have long
names (*_Orientation).

Pretty big patch, but no functional changes.

Relates to T7863

Test Plan:
Everything builds and passes tests.
Elementary_tests show same behavior, including the "inverted" widgets, which
are the only parts which received a bit of code changes.
Proof:
https://travis-ci.org/Enlightenment/efl/builds/536277282

Reviewers: zmike, bu5hm4n, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8946
2019-05-24 12:30:32 -04:00
Xavi Artigas 41866a8855 Efl.Pack_Table: remove table_direction
Summary:
The only implementation of this interface, `Efl.Ui.Table`, only supports two fill
directions (horizontal or vertical), therefore the table_direction property which
supports primary and secondary directions is unnecessarily complicated. Remove it
and use only `Efl.Ui.Direction.direction` to select the fill direction.
Also, expanded the documentation.

Fixes T7962

Test Plan:
Everything builds and tests pass. Efl.Ui.Table elementary_test still work.
Examples need to be adjusted to stop using table_direction.

Reviewers: zmike, YOhoho, bu5hm4n, SanghyeonLee, Jaehyun_Cho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7962

Differential Revision: https://phab.enlightenment.org/D8902
2019-05-20 13:24:16 +02:00
Marcel Hollerbach 7aa9ea071a efl_pack: split algin and padding property
the pack interface is a general interface for how we pack things into a
container. the align and padding property has less to nothing to do with
this. Hence this commit splits the two properties into theire own
interface.

fix T7825

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8699
2019-04-26 12:06:02 +02:00
Jaehyun Cho f3b9f7f0d8 efl_ui: fix not to call _on_child_del() after container is deleted
If efl_ref() is called to child, then child may not be deleted when
container is deleted.
This causes _on_child_del() is called after container is deleted and it
causes crash if container data is accessed in _on_child_del().

To resolve the above issue, all callbacks of child are deleted not to
call _on_child_del() after container is deleted.
2019-04-26 18:25:50 +09:00
Yeongjong Lee 3e49501043 ui.table: remove leagcy evas_table from Efl.Ui.Table
Remove evas_table.
This expect to improve performance by removing internal function call related
evas_table.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8615
2019-04-21 12:13:13 +02:00
Yeongjong Lee 41136db8e8 ui.widget: remove elm_widget_sub_object_parent_add from each of widgets
since commit a1addad60e, To add myself as a sub object of parent object will be
done in Efl.Ui.Widget constructor.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8280
2019-04-18 11:01:19 +02:00
Marcel Hollerbach 37a5d6c0d1 efl_ui_table: remove callbacks when item is removed
everything else is wrong.

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8556
2019-04-17 15:21:14 +02:00
Marcel Hollerbach f7baa89ca9 efl_ui_table: correctly delete all items when clearing / unpacking
otherwise we do not clear the internals, and fail to get the count to 0.

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8555
2019-04-17 15:21:13 +02:00
Marcel Hollerbach 48778f3cfb efl_ui_table: hardening of pack_at function
_pack_at is used to add new subobjects to the table. When a object is
already part of this table, then we should not add it again. Additional,
when there is already a gi structure, but the parent is something else,
then we should NOT just reuse this struct, otherwise we might use a
struct reference that we do not own. The struct could be owned by
another table widget.

The test must be adjusted, before we did not error on adding a widget
twice. Now we do (just like in box). Hence we should not do that in
test.

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8554
2019-04-17 15:21:12 +02:00
Yeongjong Lee 37c703437a efl.pack_table: inherit efl.pack instead of efl.pack_linear
Summary:
>>! In T5301#110572, @jpeg wrote:
> Quick recap before I leave.
> ...
> ...
>  - Pack interfaces - T5328
>
> Table does not need to inherit from "linear" (1d) layout: this brings unnecessary complexity, for a dubious use case.

We don't have linear layout policy of table(2d) layout. furthermore, i don't
think it will be clearly defined. it is enough for Efl.Pack_Table to support
`efl_pack` which work the same as `efl_pack_end`.

ref T5719, T5328

Test Plan:
- make
- elementary_test -to 'efl.ui.table'
- elementary_test -to 'efl.ui.table(linear api)'

Reviewers: zmike, woohyun, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, jpeg, #committers

Tags: #efl

Maniphest Tasks: T5719, T5328

Differential Revision: https://phab.enlightenment.org/D8420
2019-03-20 12:54:25 +01:00
Yeongjong Lee f4b69b9c4d ui.box,table: update layout when homogeneous mode is changed.
Summary: changing homogeneous mode is needed layout_update.

Test Plan:
1. elementary_test -to 'efl.ui.box'
2. Click 'Homogenous' check box.
3. Check layout is updated.

Reviewers: zmike, Jaehyun_Cho, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8216
2019-03-08 08:22:12 -05:00
Mike Blumenkrantz 5bfe2e89d2 evas: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
evas and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D8107
2019-03-06 19:05:48 +01:00
Mike Blumenkrantz bb6caaa471 efl.ui: remove Efl.Ui.Theme_Apply_Error
Summary:
now that the error codes have been change to be compatible with eina_error,
this can be removed and will work through eina_error naturally

fix T7718

Depends on D8067

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7718

Differential Revision: https://phab.enlightenment.org/D8068
2019-03-04 13:37:07 -05:00
Mike Blumenkrantz 644b771fe4 efl.ui: Efl.Ui.Theme_Apply_Result -> Efl.Ui.Theme_Apply_Error
Summary:
this swaps the values of "no error" and "error" in order to maintain
consistency with the rest of efl where the zero value means "no error"
Depends on D8060

Reviewers: cedric

Reviewed By: cedric

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl_api

Differential Revision: https://phab.enlightenment.org/D8063
2019-03-04 13:36:41 -05:00
Yeongjong Lee 4628021fe5 efl_container: remove content_remove
Most of classes implements Efl.Container.content_remove are just calling "unpack"
except of "Efl.Canvas.Layout" and "Efl.Ui.Layout".
This patch remove the asymmetrical API and add content_remove API of
"Efl.Canvas.Layout" and "Efl.Ui.Layout" that child can be remove without efl_part
APIs.

ref T7576

Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7913
2019-02-27 21:20:33 +01:00
Yeongjong Lee 138fa4eeaa ui.table: implement homogeneous mode
Summary:
Homogeneous mode means children are of the same weight and of the same min size
which is determined by maximum min size of cells.

Depends on D7841

Reviewers: Jaehyun_Cho, jpeg, zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7892
2019-02-27 14:45:32 -05:00
Yeongjong Lee 5572000f1a efl_ui_table: refactor layout_update
Summary:
There are three reasons to refactor layout_update of Efl.Ui.Table.

=== 1. Inconsistency of hint behavior. ===

Some hint property is often not respected. for example, hint_min is ignored in
Table when it is used with hint_max even if hint_weight is 0. hint_aspect is
always ignored in Table.
The ambiguous behavior make it hard to layout widgets in container. of course,
we documented 'it's just a hint that should be used whenever appropriate.' but i
don't think it means that 'hint API is sometimes respected and we also don't
know when that API is respected.'. at least there is rule for consistent
behavior and we should be able to explain why a widget is located here and
why some hint property is ignored.

So, i'll suggest priority of hint property. this refactoring support following
priority.
1) HintMin
2) HintMin + HintAspect
3) HintMargin
4) HintMax
5) HintAspect
6) HintWeight, HintFill
7) HintAlign

ref T5487
Please check with unit test D7840

=== 2. To Enhance usability. ===

Efl.Ui.Table is using homogeneous mode of evas_table which have same columns,
rows size. but i think a table can generally change columns, rows size and
we can provide homogeneous mode option.(D7892)

In this patch
 - table columns(rows) min size is decided by maximum size among its cells
width(height) min size.
 - table columns(rows) weight is decided by maximum weight among its cells
horizontal(vertical) weight.

Also, pack_align is implemented. it is used if no item has a weight.

=== 3. To remove internal evas_table. ===

This is low priority work. however, i guess is is necessary for lightweight
container widget. there are two size_hint callback to adjust table size and
efl_canvas_group_calculate is called twice when it is resized.
This patch is first step to remove internal evas_table.

Test Plan:
make check
elementary_test -to 'efl.ui.table'

Reviewers: jpeg, Jaehyun_Cho, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T5487

Differential Revision: https://phab.enlightenment.org/D7841
2019-02-27 14:45:27 -05:00
Yeongjong Lee c9350e4ccb efl_ui_table: fix correct parameters of table_rows_get
Test Plan:
efl_pack_table_size_set(ui_table, 3, 4);
efl_pack_table_size_get(ui_table, &cols, &rows);

Check (cols, rows) are (3, 4)

Reviewers: Jaehyun_Cho, zmike, jpeg, bu5hm4n

Reviewed By: Jaehyun_Cho, bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7838
2019-02-22 20:05:39 +09:00
Marcel Hollerbach 46885653bc eo: remove class functions from eo
As in the previous commit explained, we want to get rid of class
functions in eo, and make them just c functions right away.

This commit removes the class parameter from the eo_class_function_set
call, and adjusts the tests to not depend on class functions anymore.
Class functions are now not tested anymore, tests that used them as a
way to test *things* are adjusted to test them now with object
functions, tests that just tested the working of class functions are
dropped.

This fixes T7675.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7902
2019-02-13 16:59:59 +01:00
Marcel Hollerbach 0709bdea6f eo: change API call of efl_class_functions_set
The next commit will bring support for something like reflection. This
commit prepares the whole tree for getting another argument in
efl_class_functions_set.

ref T7681

Differential Revision: https://phab.enlightenment.org/D7882
2019-02-07 14:43:25 +01:00
WooHyun Jung 7f2b26861f elm: prevent from accessing null pointer after memory allocation
Summary: Add null checking code just after allocating memory

Test Plan: make check

Reviewers: jypark, Jaehyun_Cho, zmike

Reviewed By: Jaehyun_Cho, zmike

Subscribers: devilhorns, zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7801
2019-01-29 09:23:44 -05:00
Marcel Hollerbach f00ae98a1d elm: add container api for the two objects
this resolves unimplemented API by just mirroring the calls to different
API calls.

ref T5719

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7749
2019-01-26 11:41:59 +01:00
Jaehyun Cho 4f9c8d524c efl_ui_theme: Introduce Efl.Ui.Theme class
Summary:
Efl.Ui.Theme class is required to support language bindings.
Efl.Ui.Theme works based on current elm_theme features.

This patch fixes T7357.

Reviewers: segfaultxavi, cedric, lauromoura, woohyun, zmike, SanghyeonLee

Reviewed By: segfaultxavi, SanghyeonLee

Subscribers: SanghyeonLee, herdsman, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7357

Differential Revision: https://phab.enlightenment.org/D7244
2018-11-20 13:56:37 +09:00
Marcel Hollerbach f570e7435e elm-containers: use alive api
check if the object is in its correct lifetime before performing
operations

Differential Revision: https://phab.enlightenment.org/D6724
2018-09-14 11:19:01 +02:00
Xavi Artigas 55bd097a3d Efl.Gfx.Entity (from Efl.Gfx)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:32 -07:00
Xavi Artigas 9dcc31ed4a Efl.Access.Object (from Efl.Access)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:24 -07:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Cedric Bail 14b9a674ac elementary: in case of an object being destroyed, there is no point to warn. 2018-04-06 11:32:00 -07:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
SangHyeon Lee 0f16a06710 interface : change efl_pack_grid and efl_ui_grid to efl_pack_table and efl_ui_table
Summary:
Change name of 'grid' to 'table' for matching on common ui naming
and avoiding confusion with 'gengrid' and 'grid view'.
grid will be introduced as grid image view after.

Test Plan:
checked make & make install
checked make check - there are errors but not related with these changes.
checked make examples - there are errors in cxx but not related with these changes.
checked make discheck - failed
test in elementary_test with Efl.Ui.Table and Table_static.

Reviewers: raster, cedric, jpeg, felipealmeida

Differential Revision: https://phab.enlightenment.org/D5668
2017-12-19 14:25:08 +09:00