Commit Graph

23 Commits

Author SHA1 Message Date
Marcel Hollerbach 165f6f0ae2 rewrite efl cnp and dnd handling
the previous commits introduced a abstraction for drag in drop which can
be now used for this here. With this commit all the direct protocol
handling in efl.ui is removed, and only the ecore evas API is used.

Additionally, this lead to a giant refactor of how APIs do work. All
Efl.Ui. interfaces have been removed except Efl.Ui.Selection and
Efl.Ui.Dnd, these two have been restructored.
A small list of what is new:
- In general no function pointers are used anymore. They feel very
  uncompftable in bindings and in C. For us its a lot easier to just
listen to a event when a drop enters or leaves, there is no need to
register custom functions for that.
- Asynchronous data transphere is handled via futures, which proved to
  be more error safe.
- Formats and actions are handled as mime types / strings.
- 0 is the default seat if you do not know what else to take.
- Content is in general passes as a content container from eina, this
  also allows applications to pass custom types

The legacy dnd and cnp API is implemented based on that.
All cnp related things are in elm_cnp.c the dnd parts are in elm_dnd.c

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11190
2020-03-08 10:59:40 +01:00
Xavi Artigas 6b7346b7b2 Remove individual class BETA guards
Summary:
Eolian adds a per-class BETA guard (like EFL_UI_WIN_BETA) to any method tagged
as @beta. This means that any app (and the EFL code) wanting to use BETA features
has to enable them class by class, which is cumbersome.
This commit replaces the individual guards with the global EFL_BETA_API_SUPPORT
guard, so apps only need to define one symbol to access BETA features.

Any usage of the per-class guards has been removed from the EFL code and examples.
When building EFL the global guard is defined by configure, so all EFL methods
already have access to BETA API.
Efl_Core.h and Efl_Ui.h no longer define EFL_BETA_API_SUPPORT. Apps wanting to
use BETA API have to define this symbol before including any EFL header
(It has been added to the examples requiring it).

Test Plan:
make && make check && make examples still work, but there's a lot less #defines
in the code

Reviewers: zmike, bu5hm4n, q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T6788

Differential Revision: https://phab.enlightenment.org/D7924
2019-02-13 18:09:17 +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
Taehyub Kim 4704fda84d efl_ui_dnd: fix the wrong parameter passing
Summary: fix the wrong parameter passing

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7797
2019-01-28 17:09:42 +09:00
Carsten Haitzler ab6c0e9f2b elm dnd/selection - only query wl things if thje window is a wl one...
check at RUNTIME not just with ifdefs at compile time. less ERR noise
for sure.
2019-01-09 18:57:23 +00:00
Cedric BAIL 327593e9b4 elementary: rename Efl.Selection -> Efl.Ui.Selection as it is only usable with User Interface related element.
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7505
2019-01-02 11:03:49 -08:00
Marcel Hollerbach 20ddd4c679 efl_app: introduce app_main for getting the app object
This brings in the possibility to receive the app object from bindings.
With the app object you can listen to pause / args / terminate / resume
events.

fix T7509

Differential Revision: https://phab.enlightenment.org/D7480
2018-12-20 12:56:54 +01:00
Marcel Hollerbach 66aa76ad89 efl_ui_dnd: fixup leaking inits and code duplication
In fff4d1ba97 one selection_manager_get
method was patched to behave like this, however, it completly broke the
fact of *only-one-manager* since the same code was duplicated in a other
files (efl_selection.c). This now unifies this code, and adds back the
assertion for only one manager per window.

Additionally a shutdown function is added, the app never destroyes, but
the selection manager decided to init some subsystems itself
(ecore_x for example). This lead to to a leak of init counts in ecore_x,
which lead to elementary test suite issues. This is now *finaly* fixed.

Differential Revision: https://phab.enlightenment.org/D7105
2018-10-02 16:13:13 +02:00
Carsten Haitzler a475b18961 efl ui dnd - further fixes on drop list data key handling
the efl ui dnd code didn't reset the drop list key to null (deleting
it) once it had freed the list of frop items. this also fixes another
issue in T7113 which causes crashes on exit.
2018-07-16 17:07:02 +09:00
Mike Blumenkrantz fff4d1ba97 efl/selection_manager: make selection manager a child of the app
Summary:
a selection manager is application-wide, not per-window. creating separate
managers for each window duplicates all callbacks for the window's display
server, guaranteeing broken behavior at any time when more than one window
exists

fix T6937

Reviewers: bu5hm4n, devilhorns

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6937

Differential Revision: https://phab.enlightenment.org/D6483
2018-07-03 12:39:26 -04:00
JongMin Lee 47caa0115a elm: resolve possible memory leak.
@fix
2018-04-20 16:45:50 +09:00
JongMin Lee c21ffd8735 elm: resolve possible memory leak.
@fix
2018-04-20 15:59:49 +09:00
JongMin Lee a07d729b2f elm: resolve possible memory leak.
@fix
2018-04-20 15:41:32 +09: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
Shinwoo Kim 3cd2243028 Fix static analysis result
[Dereference after null check]

(1) src/lib/ecore/ecore_main.c
 - _efl_loop_handler_efl_object_finalize checks if pd->loop_data is NULL.
   After that, _handler_reset > _handler_clear > _ecore_main_fd_handler_del >
   _ecore_main_fdh_pool_del is directly dereferencing pd->pool_data.
 - _efl_loop_handler_efl_object_parent_set checks if pd->loop_data as well.
   Then it calls _handler_reset as well.

(2) src/lib/ecore_wayland/ecore_wl_dnd.c
  - ecore_wl_dnd_selection_set checks if t - result of wl_array_add - is NULL.
    And it is dereferecing t directly for wl_data_source_offer.

(3) src/lib/elementary/efl_ui_dnd.c
 - Third parameter const char *data could be NULL.
   In this case strlen dereferences NULL. The data should be non NULL value.
   I have checked this with Mr. Thiep Ha.

(4) src/lib/evas/canvas/evas_object_inform.c
 - _efl_canvas_object_efl_gfx_stack_stack_below checks if obj->layer is NULL.
   So it could call evas_object_inform_call_call_restack which is dereferencing
   obj->layer directly.
2018-04-05 19:40:57 +09:00
Carsten Haitzler 5db6b05187 elm - dont get top widget for non-ui objects 2018-02-13 15:21:49 +09:00
Carsten Haitzler 26833b8d28 efl ui did - dont segv if createicon func is not provided 2018-02-01 20:09:05 +09:00
Jean-Philippe Andre c91ae98fd3 cnp: Rename selection data to content
This solves an issue with C# bindings where a field of a struct can not
have the same name as the struct itself. Go figure why.
2018-01-18 18:46:15 +09:00
Thiep Ha 07e7bbd4b5 selection_dnd: fix warnings in clang
Fix warnings about type convert and vars init in clang and remove comments.
2018-01-16 16:35:14 +09:00
Boris Faure a8d2c6c42f elementary dnd: fix tautology 2018-01-15 21:30:28 +01:00
Thiep Ha e88bbaa1e3 cnp_dnd: make legacy APIs use new interfaces
Legacy APIs can uses efl_selection, efl_ui_dnd, efl_ui_dnd_container interfaces
with helper functions.
2018-01-11 17:56:24 +09:00
Thiep Ha 35339504b0 dnd: add efl_ui_dnd_container
efl_ui_dnd_container is the interface of dnd for container objects.
2018-01-11 17:56:24 +09:00
Thiep Ha e6ab4b41ed dnd: add efl_ui_dnd
Efl_Ui_Dnd is the interface for drag and drop of elm_cnp.
2018-01-11 17:56:24 +09:00