Commit Graph

73 Commits

Author SHA1 Message Date
Felipe Magno de Almeida 95c2248065 ecore_drm: Rename EAPI macro to ECORE_DRM_API in Ecore DRM library
Patch from a series of patches to rename EAPI symbols to specific
library DSOs.

EAPI was designed to be able to pass
```__attribute__ ((visibility ("default")))``` for symbols with
GCC, which would mean that even if -fvisibility=hidden was used
when compiling the library, the needed symbols would get exported.

MSVC __almost__ works like GCC (or mingw) in which you can
declare everything as export and it will just work (slower, but
it will work). But there's a caveat: global variables will not
work the same way for MSVC, but works for mingw and GCC.

For global variables (as opposed to functions), MSVC requires
correct DSO visibility for MSVC: instead of declaring a symbol as
export for everything, you need to declare it as import when
importing from another DSO and export when defining it locally.

With current EAPI definitions, we get the following example
working in mingw and MSVC (observe it doesn't define any global
variables as exported symbols).

Example 1:
dll1:
```
EAPI void foo(void);

EAPI void bar()
{
  foo();
}
```
dll2:
```
EAPI void foo()
{
  printf ("foo\n");
}
```

This works fine with API defined as __declspec(dllexport) in both
cases and for gcc defining as
```__atttribute__((visibility("default")))```.

However, the following:
Example 2:

dll1:

```
EAPI extern int foo;
EAPI void foobar(void);

EAPI void bar()
{
  foo = 5;
  foobar();
}
```

dll2:

```
EAPI int foo = 0;
EAPI void foobar()
{
  printf ("foo %d\n", foo);
}
```

This will work on mingw but will not work for MSVC. And that's why
EAPI is the only solution that worked for MSVC.

Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>
Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev>
Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>
2020-10-15 15:48:08 -03:00
Elyes HAOUAS 1fd0435f21 Get rid of trailing whitespaces (4 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12002
2020-06-23 10:29:14 +02:00
Xavi Artigas e7f4bc4c2a doxygen docs: Fix all invalid @param names
There were quite a few of these...
2020-04-20 12:24:41 +02:00
Carsten Haitzler 034ef0badc ecore drm - legacy - fix coverity leak complaint
is real - in error case. fix it to make coverity happy.
fix CID 1402696
2019-08-05 13:44:25 +01:00
Carsten Haitzler f40c91941d libinput check - move up to requiring 1.6 as a minimum for libinput 2017-11-12 21:47:02 +09:00
Derek Foreman 1a339c9e59 ecore_drm: Handle wheel scrolling separately from finger scrolling
Wheels are discrete and scroll in clicks, fingers are continuous and scroll
in fractional pixels.

This change causes wheel based scrolling to be returned in "clicks"
instead of "degrees" - allowing us to roll a single menu item with a click.

It also will allow us to reduce the speed of two finger scrolling without
messing up the speed of wheel scrolling.
2016-05-13 16:36:42 -05:00
Chris Michael d4307e3494 ecore-drm: Don't re-include config.h
As ecore_drm_private.h already includes config.h header, we don't need
to include it here in these files also

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-03-09 08:27:05 -05:00
Chris Michael 2dbe2732a2 ecore-drm: Update copyright notice
As portions of this code have been derived from existing code in
Weston, we should also be including their copyright/licence text to
give credit.

NB: Fixes T3286

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-03-09 08:22:22 -05:00
Chris Michael f87dceda85 ecore-drm: Don't reset event modifiers on touch motion
When we are sending an event for touch motion, we should be specifing
the modifers in the event structure (not setting them to zero).

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-02-22 12:13:06 -05:00
Derek Foreman ddc6962d77 ecore_drm: Add pointer warping API
Adds a new API: ecore_drm_device_pointer_warp() which warps the pointer
to the specified location.  All libinput seats with pointers are warped.
2016-02-18 15:50:16 -05:00
Derek Foreman 943f2df006 ecore_drm/ecore_wl2: logging: remove errant usage of %m
Summary:
printf %m stringifies and prints errno.  I've tried to remove its use
anywhere that the immediately preceding function might not set errno
or is a complicated function for which knowing errno doesn't really
give any useful information.

I've left a few of the drmMode calls because they're just wrappers
around ioctl, which legitimately sets errno.

@fix

Reviewers: zmike, devilhorns

Reviewed By: zmike, devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3572
2016-01-14 13:06:02 -05:00
Stefan Schmidt d1609c2afe ecore_drm: make sure we include math.h and link against libm for floor()
When we introduced the usage of floor() in ecore_drm_evdev.c we forgot to
include math.h for it as well as linking against libm. This caused linking
failures on some systems while it still worked on others. Better fix it for
good.

Original patch by aerodynamik.

ref T2953
2016-01-13 17:06:39 +01:00
JengHyun Kang b3dc27345a ecore-drm: Add a new API for keymap cache
Summary:
Originally, each keyboard devices could have their own keymap.
The one keyboard's keymap could different with others.
But for this, Ecore_Drm compile a new keymap when a keyboard is connected.
But this is a burden for some people who doesn't manage keymap for each keyboard.
They want to maintain only one keymap for system.
So, I added cached context/keymap and just ref/unref for each keyboard device.
People who want to different keymap for each keyboard just do not set cached
context/keymap. Then Ecore_Drm maintain keymaps about each keyboard devices.

Test Plan:
Connect a keyboard device and watch flow of ioctl.
Originally Ecore_Drm opened xkb data and compile keymap,
but after patch, that ioctl is disppeared.

@feature

Reviewers: raster, devilhorns, ManMower

Reviewed By: devilhorns, ManMower

Subscribers: cedric, input.hacker, ohduna, jpeg

Differential Revision: https://phab.enlightenment.org/D3503
2016-01-04 08:47:58 -05:00
Chris Michael 0d6383d69f ecore-drm: Add missing variable 'dev'
Seems this should have been declared in the previously pushed patch,
but was missing.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2015-12-29 09:12:50 -05:00
JengHyun Kang eb9b894167 Add a new Ecore_Drm API for setting left-handed mouse
Summary:
Add a new Ecore_Drm API named ecore_drm_device_left_handed_set().
Libinput support various input options. Left handed mode is one of options.
Right-handed people and left-handed people use a mouse
using different button mapping.
So if a left handed option is enabled, libinput change right mouse button and
left mouse button.
So support this option, I added this api using libinput's left handed option.

@feature

Test Plan:
After set left handed mode, left mouse button generate button numbered 3,
and right mouse button generate button numbered 1.

Reviewers: raster, ManMower, devilhorns

Subscribers: ohduna, cedric, jpeg, input.hacker

Differential Revision: https://phab.enlightenment.org/D3431
2015-12-29 09:04:16 -05:00
Sung-Jin Park 936350d37f ecore-drm: Add APIs to support key remap functionality
Summary:
This adds two new APIs to enable/set key remap functionality and
a number of keys to be remapped to the other keys. As of now there is no
api to do this therefore we need to remap using linux utility such as
'setkeycodes'. By adding/calling these apis, each Ecore_Drm_Evdev device
will have its specific key remap hash and we can apply each remapping keys
for each key/keyboard device.

Test Plan:
(1) Enable key remap and set remapping of a key on a specific keyboard device
(2) Plug in the keyboard device and check the key is being remapped or not
(3) Check the other keys are coming normally
(4) Check the the remapping key on a specific keyboard doesn't affect to any other devices

Signed-off-by: Sung-Jin Park <input.hacker@gmail.com>

Reviewers: raster, zmike, gwanglim, ManMower, devilhorns

Subscribers: JHyun, ohduna, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3463
2015-12-28 09:24:58 -05:00
Duna Oh 21b1a3f221 ecore-drm: Add logical pointer x, y variable in seat for reflecting multiple pointer's movement
Summary: When one pointer moves, we should update the position of other devices.

Test Plan:
(1) Two pointer devices are connected.
(2) Move the cursor to (x, y) position using "device 1".
(3) When you move the cursor using "device 2", the cursor doesn't start from (x, y) position. This causes discontinuous mouse motion.

Reviewers: raster, zmike, gwanglim, stefan_schmidt, devilhorns, ManMower

Reviewed By: devilhorns, ManMower

Subscribers: cedric, Jeon, input.hacker, jpeg

Differential Revision: https://phab.enlightenment.org/D3384
2015-11-30 11:05:07 -05:00
Chris Michael 0210051a40 ecore-drm: Don't send mouse_move event too early
We cannot be sending an ecore_event for mouse move here as it is too
early in the startup process for that too happen. Raising the event
here never gets caught because the ecore_evas has not yet registered
for ecore_input listening.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-17 15:54:34 -05:00
Stefan Schmidt 19c6617d78 ecore_drm_evdev: Avoid shadowing a local variable.
input is already used within this function so rename it in the block.
2015-08-07 15:26:54 +02:00
Chris Michael 79b33928fa ecore-drm: Ignore key events that are not seat wide state changes
Summary: This patch adds some checks to make sure that we can ignore
key events which are not seat wide state changes.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-23 11:54:24 -04:00
Mike Blumenkrantz 121e7be4b6 Revert "ecore-input: add keysym to Ecore_Event_Key struct"
This reverts commit c3f3c4eba8.

this was audited and found to be impractical due to portability concerns
2015-06-29 13:18:01 -04:00
Mike Blumenkrantz c3f3c4eba8 ecore-input: add keysym to Ecore_Event_Key struct
currently only functional for x11, wl, drm

@feature
2015-05-20 14:50:46 -04:00
Mun, Gwan-gyeong 34fd2cfa4a ecore-drm: add touch_motion event on touch_down event handler.
Summary:
  ecore-drm touch down handler does not produce ECORE_EVENT_MOUSE_MOVE event.
  so, when user touches screen, application can't handle mouse down event correctly.
  this fix adds touch_motion event on touch_down event handler.

Reviewers: zmike, cedric, raster, gwanglim, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2427
2015-04-29 08:55:06 -04:00
Boram Park 5c7cfdc133 ecore_drm: send a fake motion event to let other know the initial pos of mouse
Summary:
At the first time after finishing booting, the position of mouse cursor is in the
center of screen. But e doesn't know it. ecore_drm should let e know the initial
position of cursor by sending a fake motino event.

Reviewers: devilhorns, ManMower, zmike, raster, gwanglim

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2410
2015-04-29 08:54:03 -04:00
MinJeong Kim 45abf35ec0 ecore-drm: Fix using uninitialized output value
Summary:
This revision fixed using of uninitialized value 'output'.
The usage can cause segmentation fault when it try to refer current_mode

@fix

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2448
2015-04-29 08:47:32 -04:00
Mike Blumenkrantz 054fed5336 ecore-drm: fix multiclick interval time
libinput returns timestamps in milliseconds as int, not double
2015-04-24 13:40:32 -04:00
Mike Blumenkrantz 3d71a10891 ecore-drm: add safety checks to all EAPI functions 2015-04-24 12:53:01 -04:00
Derek Foreman 67460e2d78 ecore_drm: Don't crash if a device is assigned a bad output
Summary:
If an input device is assigned via udev to an output that we can't find
we just assign it to the first output instead.

Reviewers: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2408
2015-04-22 14:32:16 -04:00
Chris Michael 613e6ad934 ecore-drm: Don't fetch output geometry on every mouse movement
Summary: This is a better way to allow mouse movement across multiple
outputs as this does not require us to fetch output geometry on Every
mouse movement (as before).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-16 12:47:29 -04:00
Chris Michael b41ed6a6f8 ecore-drm: Fix mouse movement across multiple outputs
Summary: When running E-Wl with multiple outputs, we could not
previously move the mouse pointer across to the second output. This
commit fixes that issue.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-16 12:35:36 -04:00
Jean-Philippe ANDRE 0ef41604e8 Ecore: Use calloc() to initialize Ecore_Event_Key fully
Some fields (eg. data) may not be properly initialized.
Use calloc() instead of malloc() will ensure proper initialization
even if we add more fields.

These fields (data) would even be passed down to Evas as
Evas_Event_Key_Down for instance.
2015-03-25 15:34:23 -07:00
Chris Michael 49beaeacf4 ecore-drm: Center mouse pointer on an output when it gets created
Summary: This sets the initial mouse pointer position to be at the
center of an output.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-04 11:49:44 -05:00
Chris Michael f23acbac81 ecore-drm: Fix formatting
Summary: No functional changes, just formatting fixes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-03-04 11:49:44 -05:00
Derek Foreman 95cb1938c2 Use doubles to store libinput's mouse motion
Summary:
Using can result in motion being completely discarded.  Since we
only need integer data, we also only actually forward on an event
when the mouse moves more than a full unit.

Reviewers: zmike, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2062
2015-02-27 10:40:38 -05:00
Mike Blumenkrantz a57df757a8 ecore-drm modifier updating is now functional
when dealing with non-kbd devices, the seat can be iterated to locate a keyboard

this may or may not accurately set depressed, latched, locked, group values
2015-02-26 21:51:00 -05:00
Chris Michael fd0de9ae5c ecore-drm: Fix issue with ecore_drm_evdev->path being incorrect
Summary: When we try to ReleaseDevice of our evdev structure, the
'path' which was getting passed to our logind code was incorrect. This
was due to libinput not providing a function to get the full device
path. We fix this by making some eeze udev calls to find this device
and get the full device path.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-17 16:19:55 -05:00
Stefan Schmidt dc5a391d1c ecore/drm: Fix libinput >= 0.8 check
We need #if here as LIBINPUT_HIGHER_08 will be either 0 or 1

@fix
2015-02-12 18:38:51 +01:00
Chris Michael 5c68b659bb ecore-drm: Fix bad German formatting ;)
Summary: No functional changes, just formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-02-12 12:09:47 -05:00
Stefan Schmidt 52c48cfc21 ecore/drm: Add support for changed libinput API since 0.8
We check for libinput 06 or higher. In version 0.8 they got an API break
(hopefully the last one before 1.0) which we did not support so far. I have
seen libinput 0.9 used on gentoo and newer ubuntu systems so we should
definitely support them.

Adding a LIBINPUT_HIGHER_08 define to check for this. So far we have only one
location where we need it. Once there is a libinput 1.0 we should remove the
support for older versions.

http://lists.freedesktop.org/archives/wayland-devel/2015-January/019383.html
2015-02-12 18:06:12 +01:00
Mike Blumenkrantz 11311bf01c ecore-drm should probably send the expected (reversed) scroll z value 2015-02-03 19:18:01 -05:00
Chris Michael 90ffc57f0c ecore-drm: Limit mouse movement to within the output size
Summary: This patch adds support to limit the mouse from moving
outside the output dimensions, and fixes coordinate transformation
calls to use the Output from the Input device

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-01-13 10:35:52 -05:00
Chris Michael 5d767aff32 ecore-drm: Finish implementing touch events
Summary: This fixes the touch events to actually send button down/up
when the proper touch event occurs

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:59 -05:00
Chris Michael ea417ef9de ecore-drm: Comment out debug line for unhandled touch_frame event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael d3d5c80ad6 ecore-drm: Update pointer motion event coordinates
Summary: This fixes pointer motion events to be transformed based on
output coordinates

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael ed12acbfc6 ecore-drm: Transform touch events into output coordinates
Summary: This updates touch events to be transformed into output
coordinates

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
Chris Michael 011b2a36af ecore-drm: Handle various touch events
Summary: This adds code to handle various touch events (up, down,
motion) so that touchscreen devices can work with ecore_drm.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-10 12:01:58 -05:00
kabeer khan 8b573930c7 ecore_drm: Removed unused variables in ecore_drm_evdev
Summary: Signed-off-by: kabeer khan <kabeer.khan@samsung.com>

@fix

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1762
2014-12-10 08:01:39 -05:00
Chris Michael 33e3e9c8a2 ecore-drm: Port ecore_drm to use libinput
Summary: This ports the input code of ecore_drm to make use of
libinput for handling of devices, events, etc

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-12-09 15:13:49 -05:00
Chris Michael 21fe5e6eab ecore-drm: Fix some error/warn message formatting
NB: Nothing functional here, just alignment of error messages in output.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-22 15:44:50 -04:00
Chris Michael 20e97d07a3 ecore-drm: Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-15 14:32:49 -04:00