Commit Graph

104 Commits

Author SHA1 Message Date
Felipe Magno de Almeida 24b6b8f459 ecore_wayland: Rename EAPI macro to ECORE_WAYLAND_API in Ecore Wayland 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-30 23:06:53 -03:00
Vincent Torri 3c619b96fc remove arguments of LOGFN in ecre_x and ecore_wayland as the are always the same
Reviewers: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11769
2020-05-04 15:15:07 +01:00
Jean-Philippe Andre ff24ac2d6d efl: Reset ecore event types on init
This fixes cycles of init/shutdown/init where ecore event types would
become invalid, since they are now stored in a dynamic array rather than
a statically stored array.

The risk here is that if a module of EFL tends to init/shutdown in a
"normal" scenario then the event type array will grow in a leaking
manner. This could be fixed by resetting those event ID's only when the
loop actually exits (EFL_EVENT_DEL on the main loop). I'm not using
EFL_EVENT_DEL in this patch as this would add too many event callbacks
to the main loop object, which may result in slightly slower event calls
to it, affecting the overall performance.
2017-12-19 11:14:37 +09:00
Cedric BAIL 88889f5369 ecore_wayland: avoid crash during shutdown due to Ecore_Event queue. 2017-03-09 16:17:58 -08:00
Stefan Schmidt 337939ef14 ecore_wayland: rename session recovery to align namespace
Align out extension naming with other unstable wayland protocols.
The unstable protocols from the wayland-protocols repo are prefixed
with a zwp additionally we keep a e prefix for now as we are still
developing this here. No functional change, just rename.

Pointed out by Derek that the session-recovery interface name is a
bit to generic here.
2015-12-18 14:51:04 +01:00
Stefan Schmidt 598f46f25e ecore_wayland: only bind session recovery interface when env var is set
To avoid trouble for other wayland testing we hide the session recovery work
behind EFL_WAYLAND_SESSION_RECOVERY. Without this env var being set we do not
bind the global.

ref T2922
2015-12-16 22:18:08 +01:00
Stefan Schmidt 56cc11c3b1 ecore_wayland: remove disabled code for session recovery listener
The listener is handled inside ecore_wl_window. Remove the dead code from here.
2015-12-16 22:18:08 +01:00
Chris Michael 0a4660c77d ecore-wl: Make "server mode" a global
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-12-03 12:02:40 -05:00
Mike Blumenkrantz fe10889ec7 ecore-wayland: plug some trivial leaks 2015-10-20 17:51:44 -04:00
Mike Blumenkrantz 89245476c0 ecore-wayland: only do deferred shell surface creation when a surface exists 2015-10-19 16:20:45 -04:00
Mike Blumenkrantz 265ad8b5d0 ecore-wayland: defer shell surface creation for windows if shell is not bound
in the case where a surface is created before the compositor binds its shell(s),
a shell surface would never be created

fixes case where internal windows would not create frames in enlightenment

@fix
2015-10-19 16:15:46 -04:00
Chris Michael ff9703efc3 ecore-wayland: Comment out unused functions for session listener
Summary: As session listener is currently disabled in Ecore_Wayland,
we don't need these functions defined so comment them out.

Thanks to Tom for the report :)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-10-09 08:54:41 -04:00
Chris Michael 571c67c6a5 ecore-wayland: Don't use custom animator when in server mode
Signed-off-by: Chris Michael <cp.michael@samsung.com>

Reviewed-by: @zmike

necessary to avoid breaking the compositor canvas animator
2015-10-05 16:47:32 -04:00
Boram Park 3ebdfd8779 ecore_wl: abort if wl_display_dispatch returns negative value
Summary:
If the connection between server and client has problems, wl_display_dispatch
an return negative value. i.e. when enlightenment has been killed accidently.
In this case, app can enter into infinite loop.

Signed-off-by: Boram Park <boram1288.park@samsung.com>

Reviewers: stefan_schmidt, zmike, gwanglim, raster, devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3077
2015-09-23 09:22:29 -04:00
Stefan Schmidt 54695313dd ecore_wayland: bind and destroy session_recovery interface correctly.
This was missing from the initial session recovery support patches. Bind
the interface so we can actually work with it on the client side and destroy
it at the end.

@fix
2015-08-26 15:58:27 +02:00
Chris Michael 034c297566 ecore-wayland: Remove improper use of EINA_UNUSED
Summary: 'version' is actually used inside this function so no need
for EINA_UNUSED here.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-07-08 11:48:41 -04:00
Mike Blumenkrantz d927c1623a ecore-wl: disable session recovery
this is guaranteed to crash in 100% of use cases.
2015-07-01 12:12:26 -04:00
Stefan Schmidt 633747a05d ecore_wl: Hookup wl listener for uuid event from session recovery protocol
This should listen for events containing the assigned UUID from the compositor.
2015-06-29 17:10:06 +02:00
Chris Michael 5d48756227 ecore-wayland: Fix issue of events not getting dispatched properly
Summary: In order for wayland events to be processed properly, we
should be dispatching any pending events off of the queue First before
we make the call to flush.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-06-23 11:11:29 -04:00
Chris Michael 13df35050c ecore-wayland: Fix T2466: Update xdg shell protocol code
Summary: This updates the xdg_shell protocol and code to support
XDG_SHELL version 5. This allows EFL/Elm apps to function again in
Weston.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-06-08 10:58:51 -04:00
Boram Park 842969c231 ecore_wl: get dpi after all pending events are handled
Summary: ecore_wl_dpi_get will return the correct value after wl_output's events are handled

Reviewers: zmike, devilhorns, bryceharrington

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2479
2015-05-11 09:27:13 -04:00
Bryce Harrington a2e301db71 ecore-wayland: Use calloc rather than malloc+memset
Summary:
In addition to being fewer lines of code,
malloc + memset to 0 is slower than calloc.  See
http://stackoverflow.com/questions/2688466/why-mallocmemset-is-slower-than-calloc

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>

Reviewers: zmike, cedric, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2182
2015-03-17 20:30:32 -04:00
Bryce Harrington db91d16f78 ecore-wayland: Whitespace cleanup
Summary: Remove trailing whitespace, convert tabs to spaces as per style guide.

Reviewers: zmike

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2157
2015-03-13 21:43:08 -04:00
Mike Blumenkrantz 37c2451b5f ecore-wl cursor setup no longer triggers errors on startup
@fix T2202
2015-03-12 15:56:34 -04:00
Mike Blumenkrantz 5ff4539333 ecore-wl now prints an error when the socket dies 2015-03-12 14:34:01 -04:00
Philippe Coval 17dbfd3ec7 ecore-wayland: make possible to disable xdg-shell at runtime
Summary:
Since xdg-shell is not yet supported officialy by wayland
It makes sense to have it disabled by default
and enable it on purpose.

Using env variable : EFL_WAYLAND_DONT_USE_XDG_SHELL
(name is inspired from Qt implementation of xdg-shell
but in the opposite way)

There is no EFL_WAYLAND_USE_XDG_SHELL in efl,
please use EFL_WAYLAND_DONT_USE_XDG_SHELL instead.

By default xdg-shell is enabled since it's supported by efl

Since there is only one shell supported at runtime
it's easier to switch to wl-shell (wayland's fallback shell)
by change this env variable.

Note, this patch can be reverted once xdg-shell replaces wl-shell
in wayland which is not the case in weston-1.6
but could integrated into upcoming wayland-1.7
(to be confirmed on release)

Change-Id: Id3732492397df9abe4a7c9e6e92a8f2c993c8395
Bug: https://phab.enlightenment.org/T1901
Bug-Tizen: TC-1353/part
Forwarded: https://phab.enlightenment.org/T1901
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>

Tizen Test Plan: echo 'export EFL_WAYLAND_DONT_USE_XDG_SHELL=defined' > /etc/profile.d/ecore.sh

Reviewers: seoz, devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1734
2014-12-05 14:08:02 -05:00
Srivardhan Hebbar 8004a794b1 ecore_wayland: Making _ecore_wl_shutdown return int instead of EINA_BOOL.
Summary:
_ecore_wl_shutdown should return int instead of EINA_BOOL. So changing the function prototype.

@fix

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1574
2014-10-23 10:41:06 -04:00
Chris Michael f2bcb7d50e ecore-wayland: Add error message for calling shutdown without calling
init

Summary: If someone calls ecore_wayland_shutdown without first calling
ecore_wl_init, then the init count is wrong. Warn the caller.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-23 10:33:40 -04:00
Srivardhan Hebbar 005cdf359d ecore_wayland: Making _ecore_wl_init_count not to go below zero in shutdown.
Summary:
If _ecore_wl_init_count goes below zero, then there would be problem if someone calls ecore_wl_shutdown 1st and then ecore_wl_init later. So fixing this issue in ecore_wl_shutdown.

@fix

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1571
2014-10-23 09:02:47 -04:00
Chris Michael fc4b1982cc ecore-wayland: We should be dispatching pending events After we flush
clients

Summary: When flush_clients is called, those clients may add events to
the queue. We should be waiting to dispatch pending events until After
clients have been flushed.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-20 10:14:35 -04:00
Chris Michael bd5852be29 ecore-wayland: Bump xdg_shell version for pending release
Wayland 1.6 is due in 2 weeks. The existing xdg_shell code here will
not function with current wayland (from git) unless we bump the xdg
version number.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-01 16:15:37 -04:00
Chris Michael 795e260442 ecore-wayland: Check for valid shell before sending bound event
We could have either wl_shell OR xdg_shell, so check if we have either
one before dispatching the interfaces_bound event.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-01 16:15:37 -04:00
Chris Michael ea7721026c ecore-wayland: Add missing EINA_UNUSED and fix it's usage in other
places

Some paramaters here were being used, while others were not. This
fixes the various usage of EINA_UNUSED here to be proper.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-01 16:15:37 -04:00
Chris Michael 65bd5f91ee ecore-wayland: Check return of calloc
Calloc 'can' fail so lets check the return and make sure 'global' is
valid else we will segfault.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-01 16:15:37 -04:00
Chris Michael c656332d48 ecore-wayland: Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-10-01 16:15:37 -04:00
Chris Michael 9787c89935 Added support for xdg-shell protocol in ecore-wayland
Summary: Signed-off-by: vivek <vivek.ellur@samsung.com>

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1326
2014-10-01 16:15:37 -04:00
Srivardhan Hebbar 7fd450e690 ecore_wayland: Added goto in ecore_init for exit to reduce repetition of code.
Summary:
Instead of repeating the clean-up code if any initialization fails in the init function, I've moved those to one location and added goto.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1461
2014-09-18 11:03:26 -04:00
Srivardhan Hebbar 50a0195f7e ecore_wayland: Added cursor_theme_name in Ecore_Wl_input.
Summary:
1. Added cursor_theme_name to Ecore_Wl_Input struct.
2. Made it configurable through environment variable ECORE_WL_INPUT_CURSOR_THEME_NAME.
3. Added a API ecore_wl_cursor_theme_name_set for user to set manually.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1458
2014-09-18 10:52:29 -04:00
Chris Michael e1da3db8fa ecore-wayland; Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-09-17 09:17:03 -04:00
Srivardhan Hebbar c01c8456fe ecore_wayland: Added cursor_size in Ecore_Wl_Input.
Summary:
1. Added cursor_size to Ecore_Wl_Input struct.
2. Made it configurable through environment variable ECORE_WL_INPUT_CURSOR_SIZE.
3. Added a API ecore_wl_input_cursor_size_set for user to set manually.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>

Reviewers: devilhorns

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1456

Conflicts:
	src/lib/ecore_wayland/ecore_wl_private.h
2014-09-17 09:12:58 -04:00
Chris Michael 1cd3fbbd95 ecore-wayland: Fix ecore_wl_screen_size_get function to handle more
than one output.

ecore_wl_screen_size_get function Should take into account all
existing outputs. Modify code to loop outputs and add up the sizes.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-08-26 11:11:21 -04:00
Chris Michael 4def4e751e ecore-wayland: Fix formatting
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-08-26 11:11:14 -04:00
Carsten Haitzler da13577897 wcore-wayland - fix screen size get
based on https://review.tizen.org/gerrit/#/c/26077/ - but with
comments, formatting changes and so on.
2014-08-26 19:39:39 +09:00
Chris Michael 50287ab731 ecore-wayland: Implement ivi-shell support for Ecore_Wayland
IVI-Shell is a wayland shell implementation for in-vehicle infotainment.

Summary: This is a set of patches proposed to implement IVI-Shell (https://phab.enlightenment.org/T1552).

Reviewers: ntanibata, devilhorns

Subscribers: mbachmann

Projects: #efl

Differential Revision: https://phab.enlightenment.org/D1350

@feature
2014-08-25 09:04:38 -04:00
Chris Michael e97af447ef Revert "Added support for xdg-shell protocol in ecore-wayland"
This reverts commit 2f4db577b5.
2014-08-13 10:35:00 -04:00
Chris Michael f041344f9d Revert "ecore-wayland: Fix formatting"
This reverts commit ff29972703.
2014-08-13 10:34:57 -04:00
Chris Michael 85aaa363ab Revert "ecore-wayland: Calloc Can fail, so check that it works (or return if"
This reverts commit a49835a8d1.
2014-08-13 10:34:55 -04:00
Chris Michael 3291d32bf9 Revert "ecore-wayland: Add missing EINA_UNUSED for unused function paramater"
This reverts commit 67766929ca.

Revert all the xdg_shell changes. Should not have been pushed due to
new API function.
2014-08-13 10:34:28 -04:00
Chris Michael 67766929ca ecore-wayland: Add missing EINA_UNUSED for unused function paramater
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-08-13 09:41:27 -04:00
Chris Michael a49835a8d1 ecore-wayland: Calloc Can fail, so check that it works (or return if
not).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2014-08-13 09:41:27 -04:00