Commit Graph

25 Commits

Author SHA1 Message Date
Shinwoo Kim cfc0d4866c efl_ui_widget: keep backward compatibility
It was possilbe to add an image with improper parent object before aa2d94f and
56752e0. This patch makes it possible. Sure there are error messages when user
adds an image object using non widget object as below but you can see image.

ERR<28822>:elementary ../src/lib/elementary/efl_ui_widget.c:4801 _efl_ui_widget_efl_object_constructor() You passed a wrong parent parameter (0x400000007ced (null)). Elementary widget's parent should be an elementary widget.
ERR<28822>:elementary ../src/lib/elementary/efl_ui_widget.c:4803 _efl_ui_widget_efl_object_constructor() No widget data for object 0x400000007ced ((null))
ERR<28822>:eina_safety ../src/lib/elementary/efl_ui_win.c:9450 efl_ui_win_shared_data_get() safety check failed: pd == NULL
ERR<28822>:eo ../src/lib/eo/eo.c:579 _efl_object_call_resolve() in src/lib/elementary/efl_ui_widget.eo.c:256: func 'efl_ui_widget_sub_object_add' (698) could not be resolved for class 'Evas.Canvas'.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9747
2019-08-27 15:02:32 +02:00
Marcel Hollerbach 56752e0b3b efl_ui_widget: do not walk parent chain for none legacy cases
walking here the parent chain can be very costly, esp. if you make a lot
of widgets visible or hide them. With this commit we ensure that we only
walk the parent chain when there is a custom chain, which is only the
case in legacy. This gets us about 2-3 FPS on the rpi with the
item_container benchmark.

With earlier commits, tree_unfocusable and disabled is honoring the
whole parent chain, so checking that alone, without the parent chain, is
fine.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9645
2019-08-20 12:30:05 -07:00
Christopher Michael 2abe5ad9bc elm_focus_legacy: Fix resource leaks
Summary:
Coverity reports 2 resource leaks here because old_chain & new_chain
are never freed if we fail to return widget data. Use just
ELM_WIDGET_DATA_GET, manually check for valid 'ppd' and if false we
can just break out of the for loop here.

Fixes Coverity CID1399096, CID1399095

@fix

Depends on D8352

Reviewers: raster, cedric, zmike, bu5hm4n, stefan_schmidt

Reviewed By: cedric, bu5hm4n

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8353
2019-03-18 14:47:58 -04:00
Mike Blumenkrantz 79a585884b elm: remove legacy type usage from eo focus functions
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8226
2019-03-07 14:17:03 -08:00
Mike Blumenkrantz c4fdda1fb0 elm_genlist*: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
efl 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: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8171
2019-03-07 14:15:20 -08:00
Mike Blumenkrantz bb85bb6b1d elm_gengrid*: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
efl 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: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8169
2019-03-07 14:15:18 -08:00
Marcel Hollerbach 229dc576e6 efl_ui_focus_object: rename events
the event now math the pattern of <property-name>,changed.

ref T7571

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7989
2019-02-22 14:00:32 +01:00
Marcel Hollerbach 93903a7ba3 efl_ui_focus_manager: rename focus,changed
focus,changed is already used in efl_ui_focus_object, which makes sense
there. However, here we listen for the property focus_manager, thus its
renamed to focus_manager,changed.

ref T7571

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7990
2019-02-22 14:00:28 +01:00
Marcel Hollerbach 37d2d378ec eolian: drop class function overriding
Until this commit eo did class functions as part of the vtable, which
enabled those functions to be overwritten in classes inheriting another
class. However in task T7675 we decided that this is not really good for
bindings, as most OOP languages do not support this sort of feature.

After this commit eolian realizes class function completly outside of
the vtable, the c-symbol that is the class funciton is now just directly
redirecting to a implementation, without the involvement of the vtable.

This also means a change to the syntax created by eo:

Calling before:
  class_function(CLASS_A);
Calling after:
   class_function();

Implementation before:
   class_function(const Eo *obj, void *pd) { ... }
Implementation after:
   class_function(void) { ... }

This fixes T7675.

Co-authored-by: lauromauro <lauromoura@expertisesolutions.com.br>

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D7901
2019-02-13 16:59:58 +01:00
Jérémy Zurcher 8a617fda97 silence most left over compiler warnings
Summary: silence -Wshadow -Wunused-variable -Wunused-parameter

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7473
2018-12-18 13:08:01 +01:00
Marcel Hollerbach 2df601d589 elm_focus: implement legacy targets for logical widgets
they are now handled. The list of parents is walked until a possible
candidate is found or the parent chain is the same then in the next
focused element.

fix T7389

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7404
2018-12-17 09:12:22 +01:00
Marcel Hollerbach dfc9cd8a67 elm_focus: implement elm_object_focus_next_item_set / get
you can use this now to let the focus move to the widget container of
the passed item.

I know this patch contains a whitespace change, but i have to get out
this whitespace each & every time i am editing the file - which is
annoying. So remove it once, which makes further work easier.

fixes T6183.

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7408
2018-12-17 09:12:22 +01:00
Marcel Hollerbach 9c1c35b9b8 elm_legacy: use the new api
with using the new api of efl.ui.focus.object we can resolve a bug that
was pointed out in P243.

Differential Revision: https://phab.enlightenment.org/D7267
2018-11-20 20:50:42 +01:00
Marcel Hollerbach 9f758dc363 elm: update widgets that have documented focus and unfocused events
this emits focus and unfocus on those widgets.

fixes T7386

Depends on D7124

Differential Revision: https://phab.enlightenment.org/D7103
2018-11-15 13:55:37 +01:00
Marcel Hollerbach c5add3ef40 elm: add unfocus / focus signals to gen* and toolbar
this adds back unfocus / focus emitting when items in those containers
are getting focus.

Differential Revision: https://phab.enlightenment.org/D7100
2018-11-13 17:01:37 +01:00
Marcel Hollerbach 14f10bfd64 elm_focus_legacy: remove wrong EINA_UNUSED
Summary: Depends on D6532

Reviewers: devilhorns, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6533
2018-07-09 16:39:37 -04:00
Marcel Hollerbach df5c47a9eb elm_focus_legacy: check if top is really a window
Summary:
if not, things are going to fall apart, as manager_top then can be NULL
or invalid. Top has to be a window element, if this is not the case,
then the widget tree of the given widget is dangling somewhere in the
void. Calculating the next object in there or even the active manager
will result in errors, since the active manager is not really the active
manager, but rather just a manager object somewhere in a danging widget
subtree.

Moving the focus into such a dangling widgettree might result in a stuck
focus rect on this object, since the DFS of the focus manager
implementation cannot backtrack anymore into the widgets that are still
part of the widget graph.

Depends on D6531

Reviewers: devilhorns, segfaultxavi, zmike

Reviewed By: segfaultxavi

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6532
2018-07-09 16:39:35 -04:00
Marcel Hollerbach fdc4925bf5 elm_focus_legacy: fix focus moving for legacy
Summary:
elm_object_focus_next was not working correctly for objects where obj is
not the focused object.

fix T5940

Reviewers: devilhorns, segfaultxavi, zmike, stefan_schmidt

Reviewed By: segfaultxavi

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T5940

Differential Revision: https://phab.enlightenment.org/D6531
2018-07-09 16:39:30 -04:00
Marcel Hollerbach 7c9afc6d7b elm: remove unused vars 2018-05-01 20:27:07 +02:00
Marcel Hollerbach b5baa68c88 elm_focus_legacy: fix cycling in legacy windows 2018-05-01 20:26:41 +02:00
Marcel Hollerbach ad3d741fa0 elm_focus_legacy: remove useless function
it was only used in one place and had a wrong name.
2018-05-01 20:26:41 +02:00
Marcel Hollerbach f75bce9597 elm_focus_legacy: only search widget mapping on elm_widgets
fix T6909
2018-05-01 20:26:41 +02:00
Chris Michael 66a5126d97 elementary: Remove unused variable 2018-05-01 13:50:41 -04:00
Marcel Hollerbach 04c63cb489 elm_focus_legacy: set custom chain
fix T6182
2018-04-30 19:26:06 +02:00
Marcel Hollerbach fdfcae968b elm_widget: Introduce elm_focus_legacy
Code located here is meant for a legacy tree and legacy widgets.
This is checked on the entry of the function
2018-04-30 19:24:47 +02:00