Commit Graph

49 Commits

Author SHA1 Message Date
Derek Foreman 7359f0be6e elm_cnp: allocate space for null terminator in _wl_targets_converter
strcat needs room for a string terminator.
2017-02-28 17:23:03 -06:00
Daniel Zaoui 0f915ab497 DnD/Container: fix drag during animation
If the user icons are set but animation time is set to 0, the icons are
not deleted, resulting in ghosts images in the application.
Additionally, behavior was badly handled when animation time or timeout
before drag were set to 0.

@fix
2017-02-01 11:19:04 +02:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Cedric BAIL a07a267145 elementary: fix float comparison warning in c&p. 2016-12-20 16:39:30 -08:00
Daniel Zaoui 819c14c86f DnD: cancel drag if mouse moves too much
In the case of an entry inside a draggable gengrid, trying to select
text was always resulting in starting a DnD operation because mouse
coordinates were not checked.

Now we check that the mouse coords don't move more than a finger size.

@fix
2016-11-10 08:26:26 +02:00
Chris Michael a0cdbc9ec2 elementary: Fix call to offer_supports_mime function
As this function was misnamed in Ecore_Wl2, update the code here to
use the proper API function.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-17 10:43:43 -04:00
Chris Michael a8ba4c28fb elementary: Fix potential resource leak
If we fail to allocate memory for savedtypes.types here, then the
"known" array would end up leaking. Defer creation of 'known' array
until after savedtypes.types is allocated, this way we don't leak.

Fixes CID1363216

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-26 14:01:15 -04:00
Marcel Hollerbach fcfc9959c2 elm_cnp: handle format of a drop correctly
the format can also be the result of mutliple or´ed values.
The new code now also uses the same mimetypes to format type relation
than the selection code.

This fixes dragging onto a container with multiple formats.
Spotted by ApBBB while dragging from ephoto to terminology.

This also fixes T3320
2016-09-24 19:07:22 +02:00
Marcel Hollerbach 0e0d0179c3 elm_cnp: refactor selection_get callbacks
before the format was not passed correctly, now the format is passed
correctly to the callback.

Also if a dnd operation was started while a cnp receive call was
going on (this happend because weston-editor failed to close the fd, so
EOF was never sent), then elm_cnp would behave wrong, since the
requestwidget, action, format would be different.
2016-09-23 11:15:14 +02:00
Marcel Hollerbach 57d97b4df9 elm_cnp: handle actions probebly
ecore_wl2 passes the action which should be performed, this action is
now converted and passed to the action of the elm callback.
2016-09-23 11:15:14 +02:00
Marcel Hollerbach 5884bba096 ecore_wl2: introduce offer api
This commits adds api to deal with wayland offers.
It also ports elm_cnp to use the new api.

The selection_get and dnd_drag_get calls are replaced by simply receive
data from the offer.

The Offer object is now also emitted in every Enter,Motion,Drop and
Leave event, so a potential user can prefetch data and display it.
To finish a dnd operation positiv, the user has to call the finish call
before the offer is destroyed
2016-09-23 11:15:14 +02:00
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Carsten Haitzler 4b145afcfe elm cnp windows - remove unused vars 2016-07-26 16:49:03 +09:00
Carsten Haitzler b3d40d393e elm cnp win32 - do one side at least of unix newlines to windows newln
this PARTLY addresses T3556 ... this handles our own conversion of
makrup to string then to a windows newlined string. this half. i wrote
the conversion code for the other way but it's unused as i am unsure
where exactly to plug in it. following the cnp code makes me not sure
where it goes so for now - not there, but ready to go.

to be clear. out API is unix text. utf8 strings at our api with UNIX
newlines. that is our api. that is the text we accept and produce. if
you deal with another file or interface that does not provide this
then the job of conversion is AT THAT POINT. eg elm_cnp.c has to do
this. as would file loads of text files (and saves) etc. - anything
else like forgivingly handling anything at the api level makes it
totally unclear what our api is and what should go in and come out.

to be portable we have to define what it is and the most portable
thing to do is at the api level within a process we define one and
only one format. UNIX \n format.

@fix - partial
2016-07-26 16:44:10 +09:00
Marcel Hollerbach d2926f74ff elm_cnp: use defined charset before falling back to default
the chance is very high that some glyphs are not fitting into the
default (US-ASCII) so better falling back here on specified utf8.

@ref T3972
2016-07-14 13:58:26 +02:00
Marcel Hollerbach 75bb8060b3 ecore_wl2: split of cnp_selection_data_ready and
dnd_selection_data_ready

before there was the case that both handlers are called even if just dnd
data arrived.
2016-07-11 11:02:52 +02:00
Marcel Hollerbach c300678391 ecore_wl2: buffer reading of the data
Otherwise callbacks can go out even if the selection data is not ready
to read.
2016-07-11 11:02:52 +02:00
Carsten Haitzler 4bc6ba4ff0 elm cnp - wl - fix memory leak
fix memory leak specified in CID 1357160 , 1357159 , 1357158 , 1357157
2016-07-08 16:00:29 +09:00
Jean-Philippe Andre 85d45ee9b1 elm: Fix cnp crash on WL
See D4144.

Original author: @slotus.lee

SEG_FAULT happens when the object which has selection is deleted,
and new selection is done at another object.
Reason: loss_cb is not removed when the object which has selection is deleted.
When new selection is set for new object, the loss_cb is called for deleted
object. As result, SEG_FAULT happens.
This issue was also happened in X11 (https://phab.enlightenment.org/D2763)

Test plan:
(on wayland environment) Run elementary test, open Entry, do selection,
close Entry window, open Entry one more time, do selection.
2016-07-08 14:34:26 +09:00
Artem Popov 71a0573187 Elementary: cnp - check on NULL data in elm_drag_start
Summary:
check on NULL add in wayland elm_drag_start API
@fix

Test Plan: Call elm_grag_start with data = NULL under wayland

Reviewers: zmike, NikaWhite, jpeg

Reviewed By: NikaWhite, jpeg

Subscribers: bu5hm4n, myoungwoon, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4119
2016-07-04 11:01:05 +09:00
Chris Michael dce25efef4 elementary: Fix explicit null dereference
This patch fixes an issue reported by coverity where 'type' variable
could be null and passing null to strcmp is not good ;)

Fixes Coverity CID1357147

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-30 10:59:28 -04:00
Chris Michael f024234090 elementary: Fix erroneous usage of EINA_UNUSED
'data' parameter is actually used in this function, so remove mis-use
of EINA_UNUSED in function

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-29 11:48:53 -04:00
Chris Michael 8fb9c91d8f elementary: Fix over-zealous optimization attempt
This is a fix for some over-zealous optimization attempt. Basically,
we cannot optimize out multiple calls to ecore_wl2_window_input_get as
the window can change in the for loop.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-29 10:52:34 -04:00
Chris Michael 2c85f3b525 elementary: Fix bug in wl dnd where all subsequent mimetypes would be
accepted

This fixes an issue where in wl dnd, if one mimetype was accepted by a
drop, then all subsequent types would have been accepted also..

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-29 09:59:32 -04:00
Chris Michael 0addbf9b44 elementary: Reformat elm_cnp to be readable
NB: No functional changes, just formatting so I can read this hot mess

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-06-29 09:27:17 -04:00
Marcel Hollerbach 12eb732d46 ecore_wl2: use ECORE_WL2_EVENT_DATA_SOURCE_END
this event is emited each time the dragging is cancled. So the dragwin
should be deleted here.
2016-06-28 17:03:05 +02:00
Tom Hacohen 6202cc7485 Adjust the code according to the eo event stop changes.
This was changed in the previous commit.
2016-06-20 18:02:00 +01:00
Jean Guyomarc'h f53a739e0e ecore_cocoa: simplify clipboard functions naming
ecore_cocoa_selection_clipboard_xxxx() have been renamed into
ecore_cocoa_clipboard_xxxx() and they have nothing to do with
selection, only with clipboard.

Since the API is not stable yet, I can change it.
2016-06-07 22:20:31 +02:00
Ji-Youn Park 8cf9ee67bd efl_ui_win: rename elm_win to efl_ui_win 2016-06-07 23:11:48 +08:30
Cedric Bail 75a53ece10 eo: for consistency use object like all our API. 2016-05-18 08:18:04 -07:00
Carsten Haitzler 43661180f7 efl - key/data/value/obj attach to eo objects - make these properties
the key data now is a property so they come out in bindings really
nicely like:

  obj.key_data["blah"] = x;

  x = obj.key_data["blah"];

etc.
2016-05-18 02:02:45 +09:00
Chris Michael 8ed0aa02cf elementary: Don't define handlers if we are not going to use them
These handlers are only used when building for X11, not for Wayland,
so conditionally compile them in/out

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-15 09:53:16 -04:00
memeka b01af6e57c elementary: Fix build issue when x11 is disabled
When we compile efl using --with-x11=none, then
_tempfile_new and _tmpinfo_free end up being undefined, however these
functions are used by wayland too so they need to be defined regardless.

@fix
2016-05-14 06:44:39 -04:00
Thiep Ha e7805d97b6 elm cnp: simplify data preparer
Use eina_strbuf to simplify the data preparer for uri.
This helps remove the complex for loop and also
reduce the memory allocated for uri array.
This also removes redundant checking.
2016-05-11 18:00:19 +09:00
Mike Blumenkrantz 37ed59474e Revert "elm cnp/Wl: Remove duplicated data receive callback"
This reverts commit f5d10f1961.

this breaks pasting into efl applications on wayland

fix T3455
2016-05-10 13:23:05 -04:00
Amitesh Singh 6a237f3cca elm_cnp: comment the debug macro
It was accidently enabled in 1bc9483a82
2016-05-04 16:28:56 +05:30
Thiep Ha f5d10f1961 elm cnp/Wl: Remove duplicated data receive callback
If we do drag & drop and then do copy & paste, both _wl_selection_receive
and _wl_dnd_receive are called for one action (dnd or cnp). It is reduntdant.
We only need one data received callback to handle two cases dnd and cnp.
2016-05-03 17:13:47 +00:00
Thiep Ha bcba96656a elm cnp/wl: add uri data type checking
When selection owner provides uri type (uri/text-list),
it should check if data is in correct format.
2016-05-03 17:13:47 +00:00
Thiep Ha ae1b2a124f elm cnp/Wl: set selection for all data types
Currently, not all selection data types are set.
This patch sets selection for all suitable types that we supported.
2016-05-03 17:13:47 +00:00
Thiep Ha 8796e938a3 elm cnp/Wl: Remove duplicated data send callback
If we do drag & drop and then do copy & paste, both _wl_selection_send
and _wl_dnd_send are called for one action (dnd or cnp). It is reduntdant.
We only need one callback to handle two cases dnd and cnp.
2016-05-03 17:13:47 +00:00
Thiep Ha 8a46f78c7d elm dnd/wl: add types' notify handler
This patch adds notify handlers for types.
It provides different ways to handle different data types.
2016-05-03 17:13:47 +00:00
Thiep Ha 1bc9483a82 elm dnd/wl: add type converters
we support different types for DnD, but there is no converters.
This patch adds converters for types, so that we can send
different data for different types.
2016-05-03 17:13:47 +00:00
Mike Blumenkrantz 8325b78aed elm_cnp: accept appropriate text types in wl drop handlers
this fixes text dnd

@fix
2016-04-21 13:58:45 -04:00
Mike Blumenkrantz f6f76bf87f elm_cnp: do not send null accepts for every type within wl data offers
once is sufficient
2016-04-21 13:58:45 -04:00
Mike Blumenkrantz c9208871ae elm_cnp: attempt to get all applicable mime types when getting selection
@fix
2016-04-21 13:58:45 -04:00
Carsten Haitzler 5e09d1307b eo base - remove the duplicated key dels and just do eo_key_del() now
this rationalizes all the duplicated key dels (key_data, key_obj and
key_value).
2016-04-21 18:02:31 +09:00
Cedric BAIL c2a1c49ab2 elementary: move all legacy files to their expected new location. 2016-03-23 13:24:41 -07:00