Commit Graph

28 Commits

Author SHA1 Message Date
Jean-Philippe Andre d4b4ee867b evas: Modify wheel events direction to bool (EO)
The orientation was overkill here. We only want a bool.

Ref T5870
2017-08-10 14:42:08 +09:00
Jean-Philippe Andre 7f724f6c5d evas: Fix mouse event info in global events
When using the legacy API (and in fact also with the EO API) to
listen to mouse events (move, in, out...) on a window instead
of an actual evas object, some information was missing:
 - buttons (bitmask of pressed buttons)
 - prev.x/y (previous position)

This is because Evas had not handled the event yet at this
point, it was coming directly from ecore_evas with incomplete
information. This patch involves evas a little bit earlier, and
also fixes evas_events_legacy.c to have consistent values for
cur/prev canvas/ouput coordinates. See also 890a91785 and
484dae76e6. Those commits were making the pointer coord
a seat-based property (instead of canvas-based) but the event
should already have those proper values before converting to
a legacy struct. This patch restores the meaning of the DUP
macros, as I observed 4 different coordinates from the app side
(instead of just 2: prev and cur).

Thanks to Andy for reporting the original issue on the ML!
2017-07-10 17:01:05 +09:00
Mike Blumenkrantz 890a917852 evas: redo pointer data to be per-seat instead of per-device
pointer devices are grouped into seats, and it is the seat which has
states related to canvas coordinates

@fix

ref 484dae76e6
2017-06-02 18:23:42 -04:00
Jean-Philippe Andre 8ff2dffe7c evas/elm: Fix bad propagation of ON_HOLD flag
Test scenario:
  elementary_test -to "ExtScroller"

Try and modify a slider's value with the mouse wheel. Bad things
were happenning, as the flag ON_HOLD was not properly propagated
from the slider to the scroller. This is because the legacy
event_info structure inside the eo event info was not updated
with the new flag value.

By introducing a new EO only API, which is meant to remain
internal, we can use a single legacy info structure, fixing
this issue.

Note: In the future this API needs to be internal, not protected.

@fix
2017-04-12 18:43:15 +09:00
Guilherme Iscaro 484dae76e6 Evas: Add support for per mouse pointer mode/properties.
This patch introduces the possibility to set the pointer mode and
query other properties like current position per pointer device.
The old API will still works, however it will only act on the default seat.
2016-12-02 09:57:50 -02:00
Jean-Philippe Andre 0c850f67ce evas: Fix previous pointer position in output coords
This fixes the test "Window Socket" map resize.
I broke that in 40fec5f608

Makes me wonder if the previous position should be exposed
in EO as well.
2016-11-08 14:15:14 +09:00
Jean-Philippe Andre 40fec5f608 evas: Fix legacy events output vs. canvas coords
In case of a mapped object (eg. when applying a map to a window
in wayland compositor), the canvas and output coordinates are
not meant to be the same.

In EO land, applications should instead use the common interface
Efl.Input.Interface.pointer_xy.get (on the canvas).

@fix
2016-10-26 13:42:54 +09:00
Jean-Philippe Andre b675571bd8 evas events: Fix axis input values
This adds support for distance, pressure, tilt and twist.
Not entirely sure if normalized & raw (x,y) should be exposed
in the eo interface. Also not sure what to do with tilt_x/y
(as used by libinput) or touch/tool width "major/minor" vs.
radius x/y.

Add debug logs in the example, including the distance.
I can't test most of these values due to a lack of compatible
hardware, but the most basic features seem to work :)
2016-09-01 11:57:43 +09:00
Jean-Philippe Andre d504284dd2 efl: Rename Efl.Event.XX to Efl.Input.XX
This removes:
 Efl.Event interface

And renames:
 Efl.Event.Input -> Efl.Input.Event
 Efl.Event -> Efl.Input.Event (merged)
 Efl.Event.Pointer -> Efl.Input.Pointer
 Efl.Event.Key -> Efl.Input.Key
 Efl.Event.Hold -> Efl.Input.Hold

This also moves some interfaces from efl/ to evas/ where they
belong better.

This allows renaming Eo_Event to Efl_Event.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 925878e931 evas events: Switch axis events to the new eo type
This converts Evas_Axis or Ecore_Axis info arrays into basic
pointer data. Also marks those fields as set. All events need
to properly implement the value_has property (mark all bits
whenever a value is known).
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 8938d8d557 evas events: Rename properties and introduce generic value
This paves the way to a merge of pointer and axis events into
the class Efl.Event.Pointer.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 834794ed84 evas events: Add new "finger,move/down/up" events for multi touch
This moves MULTI events to those new finger event types,
and also sends a finger event for finger 0 (aka the pointer).

NOTE: This may require a separation between a mouse input and
      an actual finger touch. To be defined, ie: do we let the app
      check the input device info to decide whether the event is
      actually the first finger of a multi touch device, or do
      we want to send only actual finger events from multi touch
      devices only?

@feature
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 049a5ddb44 evas events: Remove now unused code 2016-08-26 10:18:01 +09:00
Jean-Philippe Andre ab7f281c34 evas events: Fix crash when translating legacy events
An obvious crash happened when reusing a legacy struct
from another type.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 405680e836 evas events: Switch hold event to new eo type
Evas_Event_Hold is now barely used anywhere.
This also adds support for event_flags to this type.
2016-08-26 10:18:00 +09:00
Jean-Philippe Andre 6d6e41c5c9 evas: Fix mouse inputs when also listening to multi
Since the new event type is the same for multi and single
touch (finger id is the only difference), multi touch listeners
would get triggered even for single mouse events.

Fixes https://phab.enlightenment.org/T4345
Fixes https://phab.enlightenment.org/T4378

This raises a question though: How do we want to differentiate
between single & multi touch events in the eo interfaces?
2016-08-17 13:13:23 +09:00
Jean-Philippe Andre 6d52d1db2b evas: Fix ordering of input event
The previous patch 1185c40e50 shows how having
two event types for the same thing (key or mouse input events)
was a bad idea. The only guaranteed order of callbacks is the
priority but even that was not enforced (since legacy or eo
style event had to come first).

Fixes T4310
2016-08-16 20:22:57 +09: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
Jean-Philippe Andre 9f5d279722 Evas events: Implement support for hold event 2016-06-27 16:38:46 +09:00
Jean-Philippe Andre 70a358357a widget: Switch to pointer & key events
Unfortunately, since all widgets rely on the legacy evas
event structs, I had to add a translation mechanism.
2016-06-14 16:27:42 +09:00
Jean-Philippe Andre 0505a729e2 Evas: Simplify eo event mechanism
So, I was stupid. I was relying on legacy callbacks to
trigger eo events, which means that only when a legacy
callback was registered would my new eo events be triggered.

Instead, I can pass the eo event desc & info whenever
calling evas_object_event_callback_call().
2016-06-02 14:19:18 +09:00
Jean-Philippe Andre b0a32b0bd0 Efl: Rename Efl.Pointer.Event into Efl.Event.Pointer
Also renames two types: Efl.Pointer.Flags and Efl.Event.Flags
2016-05-31 19:03:04 +09:00
Jean-Philippe Andre 4381d3a824 Evas events: Store position as double only
This splits pixel and subpixel precision by using
different methods rather than two different storage values.
2016-05-31 19:03:04 +09:00
Jean-Philippe Andre 0a27c78a33 Evas events: Split pointer events
This is going back to the same idea as legacy. We will have
events such as:
- move
- down
- up
- in
- out
- wheel
- cancel ("new" - very rare)

Now the question is whether/how we should divide "multi" events
which start from the 2nd finger from standard mouse events. The first
multitouch finger should by default look like a mouse event.
2016-05-31 19:03:04 +09:00
Jean-Philippe Andre c68f71239c Evas events: Add EO APIs for lock & modifiers
This moves Efl.Pointer.Event back to Evas. Originally I wanted
to share this class with Ecore but eventually I didn't need to
do so, since only ecore_evas (which depends on evas) really needs
access to these.

The internal data struct is not moved out of efl (yet?)
2016-05-31 19:03:04 +09:00
Jean-Philippe Andre 7658ed7ae3 Evas events: Forward more pointer events
This continues the work started in the previous commit:
forward full event info (Efl_Pointer_Event) from evas to
the upper layers.

This also includes more support for IN and OUT.
2016-05-31 19:03:04 +09:00
Jean-Philippe Andre ef843e8801 efl: Simplify pointer event names + add missing
No more difference between touch & mouse.
Add axis, cancel, in and out.
2016-05-31 19:03:04 +09:00
Jean-Philippe Andre ea8c6e5632 Evas: Extend pointer events and add legacy conversion routines
To be honest, this commit is a bit of a mess since it's a
rebased version of some temporary work patches.
2016-05-31 19:03:04 +09:00