Commit Graph

81 Commits

Author SHA1 Message Date
Felipe Magno de Almeida b0f5c73ea3 ecore: Rename EAPI macro to ECORE_API in Ecore 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-09-20 10:23:26 -03:00
Xavi Artigas f528001f0d doxygen docs: Proper usage of @ingroup and @addtogroup
This patch brings in a lot of docs which were missing before.
Unfortunately, this brings along their warnings so this ends up adding
more warnings than it fixes. Still, a step in the right direction.

@ingroup puts the current block into the specified group, but IT DOES NOT
allow opening groups with @{.
This was used in lots of places, resulting in misplaced or ignored documentation.
@ingroup should be used only in individual docs. For groups we use @defgroup and
@addtogroup.

Also,this patch adds some small missing docs.
2020-04-14 18:48:30 +02:00
Xavi Artigas 4204396176 doxygen docs: Fix warnings in Ecore_Common.h 2020-03-26 14:27:51 +01:00
Xavi Artigas f546a57003 docs: ecore_animator's default framerate is 60 not 30
This was changed in 81242af6f9 without updating the docs.
2020-02-11 11:03:49 +01:00
Stefan Schmidt d0f69cf2e2 exotic: remove left-overs from Exotic support
This seems to have been gone a long time ago and only references left
that have not been disturbing the build. Time to clean up!

Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10793
2019-12-04 12:21:28 -08:00
Lauro Moura d0e10dd273 ecore: Fix download test.
Summary:
After ecore_main_loop_quit() changes, calling it from outside the main
loop does not make the next iteration of the main loop quit, causing the
original version of the test to deadlock.

Also update the function documentation about it.

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, felipealmeida, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9448
2019-07-30 15:22:03 -04:00
Xavi Artigas 68c530080b docs: Fix common misspellings in H files
Fixed all appearances of words from this list in H files:
https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2019-04-02 13:28:48 +02:00
Mike Blumenkrantz 1cab2e5fde ecore_exe: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
evas and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8125
2019-03-06 13:02:49 -08:00
Xavi Artigas 751ff0ed06 Mark EFL_MAIN and EFL_MAIN_EX macros as stable
They no longer require EFL_BETA_API_SUPPORT to be defined.
2019-02-14 17:11:04 +01:00
Derek Foreman 66ce295fc9 ecore_main: Add ECORE_FD_ALWAYS flag
This allows an fd handler to be called after select exits unconditionally.

Our wayland client code needs this to be thread safe, as it needs to
call prepare_read before entering select, and then either read or
cancel_read after select.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7914
2019-02-13 10:33:40 -06:00
Christopher Michael 4c587ef679 Revert this as it should not have been pushed yet
Revert "ecore_main: Add ECORE_FD_ALWAYS flag"

This reverts commit b5e90ebe0d.
2019-02-13 10:01:22 -05:00
Derek Foreman b5e90ebe0d ecore_main: Add ECORE_FD_ALWAYS flag
Summary:
This allows an fd handler to be called after select exits unconditionally.

Our wayland client code needs this to be thread safe, as it needs to
call prepare_read before entering select, and then either read or
cancel_read after select.

Reviewers: cedric

Reviewed By: cedric

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7914
2019-02-13 09:58:06 -05:00
Xavi Artigas c55299ca51 docs: Fix assorted typos in legacy documentation
Samsung reported a long list of typos in our legacy docs, this fixes them.
2019-01-28 13:14:20 +01:00
Wonki Kim d48ec2679b ecore: modify documentation for ecore_thread_wait
Summary: this patch modify ecore_thread_wait documentation to use it only main llop explicitly.

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7225
2019-01-09 13:08:43 -05:00
Cedric BAIL 894c2e6c8c ecore: remove BETA thread API integration with old Efl_Future. 2018-05-01 10:39:01 -07:00
Cedric BAIL 7058312809 ecore: ecore_exe.eo is no longer a Eo unified API. 2018-05-01 10:39:01 -07:00
Carsten Haitzler 6e308e6039 ecore - thread - document thread max limits more sensibly
leave the exact numbers less defined because core count can change on
the fly and could be virtually limited by policy in future etc. so
keep things less exactly defined so people dont go depending on exact
results which was never really intended.
2018-04-05 18:52:57 +09:00
Mike Blumenkrantz da9eef6027 ecore: add function for prepending an event handler
@feature
2018-01-30 13:02:07 -05:00
Cedric BAIL ee65414ef6 ecore: introduce ecore_init_ex/ecore_shutdown_ex to propagate argc,argv properly. 2017-11-07 16:08:39 -08:00
Cedric Bail 1ecbe5cffb ecore: add Efl_Core.h 2017-10-27 18:51:38 -07:00
Taehyub Kim 5360034675 ecore: remove doxygen warning messages
Summary:
remove doxygen warning messages
@fix

Reviewers: jpeg, cedric, woohyun

Reviewed By: jpeg

Differential Revision: https://phab.enlightenment.org/D5339
2017-10-18 19:24:28 +09:00
Jean-Philippe Andre 5971277e71 ecore: Try to fix build
ecore_types.eot does not exist anymore.
2017-05-29 13:36:51 +09:00
Jean-Philippe Andre 71678f301a ecore: Remove ecore_types.eot
This moves one enum from EO to legacy only (Ecore_Pos_Map).
Ideally the type should be in Ecore_Legacy and no Common, that
can be done later.

Ref T5522
2017-05-29 10:49:16 +09:00
Cedric BAIL 614c255f3b ecore: add ecore_event_type_flush.
During shutdown it is possible that some event are still in ecore events
queue and get processed after the shutdown of the module that did emit them.
This would lead to crash in some case. The answer to this problem is to
normally manually track all ecore event in the queue and destroy them
before shutdown... Of course that make the API difficult to use and
basically nobody got it right.

This new API do actually as it says remove all the ecore event of a
certain type from ecore events queue. It is to be called on shutdown.

@fix
2017-03-09 16:17:58 -08:00
Myoungwoon Roy, Kim 0f446c10be doxygen: fix typos, cacologique statements in API reference doxygen of Ecore_Common
Summary: There are some typos and calogique statements in doxygen of Ecore_Common so I had fixed typos, cacologique statements.

Test Plan: doxygen revision

Reviewers: stefan, cedric, raster, Jaehyun_Cho

Subscribers: conr2d, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-08 11:09:18 -08:00
Cedric BAIL 08c3102dc0 ecore: remove ecore_thread_promise_run. 2016-11-07 10:49:02 -08:00
Gustavo Sverzut Barbieri 564e499467 ecore_init() use getenv(ECORE_NO_SYSTEM_MODULES) and disable those.
Sometimes during debug of efl_net we get some "extra" sockets from
DBus to talk to upower, localed, timedated... which are helpful in
real life, but pollutes debugging.

Since I don't want to contaminate examples with
ecore_app_no_system_modules(), which could lead users to naively copy
those and end without the system modules features, add an envvar that
I can define in my tests when I need them.
2016-10-27 09:33:09 -02:00
Cedric BAIL 6c514dddb3 ecore: add a prototype ecore_thread helper with Efl_Promise/Efl_Future coupled. 2016-09-26 16:35:52 -07:00
Gustavo Sverzut Barbieri 960e1a1d16 eina/ecore: allow threads to be canceled, use in ecore_con.
As discussed in the mailing list, many people will use worker threads
to execute blocking syscalls and mandating ecore_thread_check() for
voluntary preemption reduces the ecore_thread usefulness a lot.

A clear example is ecore_con usage of connect() and getaddrinfo() in
threads. If the connect timeout expires, the thread will be cancelled,
but it was blocked on syscalls and they will hang around for long
time. If the application exits, ecore will print an error saying it
can SEGV.

Then enable access to pthread_setcancelstate(PTHREAD_CANCEL_ENABLE)
via eina_thread_cancellable_set(EINA_TRUE), to pthread_cancel() via
eina_thread_cancel(), to pthread_cleanup_push()/pthread_cleanup_pop()
via EINA_THREAD_CLEANUP_PUSH()/EINA_THREAD_CLEANUP_POP() and so on.

Ecore threads will enforce non-cancellable threads on its own code,
but the user may decide to enable that and allow cancellation, that's
not an issue since ecore_thread now plays well and use cleanup
functions.

Ecore con connect/resolve make use of that and enable cancellable
state, efl_net_dialer_tcp benefits a lot from that.

A good comparison of the benefit is to run:

   ./src/examples/ecore/efl_io_copier_example tcp://google.com:1234 :stdout:

before and after. It will timeout after 30s and with this patch the
thread is gone, no ecore error is printed about possible SEGV.
2016-09-14 01:47:23 -03:00
Jean-Philippe Andre 87d1b3f7c4 elm: Hide new init APIs behind BETA tag
This places the following behind beta:
- efl_quicklaunch_fallback
- efl_build_version_set

I don't think EFL_MAIN would have worked without BETA API support,
so no need to expose those for now.

@fix
2016-08-16 17:33:05 +09:00
Tom Hacohen bf772125e8 Eo: Move Eo back into beta.
Eo should now be considered beta again. This commit puts it back in beta
and makes it necessary to define EFL_BETA_API_SUPPORT before including
Eo.h.
2016-08-02 16:34:35 +01:00
Jean-Philippe Andre 45cd0465a4 efl: Add Efl.Version struct and APIs
The original idea behind knowing the app's version of EFL is not
a great story. It comes from the fact that some bugs exist in
earlier versions of EFL, and some things need to be fixed. But
those fixes may break behaviour for older apps. This patch is
opening the way to the slippery slope of bug compatibility.

Unfortunately this is a requirement if we want to be able to move
forward and not break apps when we fix bugs (behaviour or ABI).

I hope we will not need to implement too many (if any) workaround
such issues. For now, this will only be used as debugging info.

EFL_MAIN() and ELM_MAIN() will both set the app's EFL version
automatically at startup time. Some internal helpers can be added
later to check how the app build-time and run-time version of
EFL differ.

@feature
2016-06-29 15:01:34 +09:00
Cedric BAIL 5cc16b1c29 ecore: remove Ecore_Animator Eo object.
This is only a legacy API.
2016-06-03 17:00:12 -07:00
Felipe Magno de Almeida 8fec0d5139 eina: Remove unnecessary indirection to promises
Now when dealing with pointer types, we will not get pointer to
pointer semantics in callbacks and eina_promise_owner_value_set
for Eina_Promise.

It will work as expected:

Eina_Promise_Owner* promise = eina_promise_add();

void* p = malloc(sizeof(T));
eina_promise_owner_value_set(promise, p, &free);
2016-06-03 17:22:12 -03:00
Jean Guyomarc'h 198326fbd2 ecore: fix typo in documentation of Ecore_Exe_Event_Del 2016-05-06 22:18:57 +02:00
Cedric BAIL c1141c7b0b ecore: remove dead Ecore_Job eo object. 2016-05-03 13:31:43 -07:00
Cedric BAIL 3108f023ba ecore: move ecore idle exiter to relly on the factorized main loop event. 2016-04-21 14:49:00 -07:00
Cedric BAIL e87e501230 ecore: remove useless define 2016-04-21 14:49:00 -07:00
Cedric BAIL 5c87f2762f ecore: use new refactorized idle infrastructure to make idle enterer rely on mainloop events 2016-04-21 14:07:49 -07:00
Cedric BAIL 7c62154d52 ecore: allow for possible factorization of all idler event. 2016-04-21 14:07:49 -07:00
Cedric BAIL 3ff21c021d ecore: move Ecore_Idler to legacy and rely on Eo event restart capability. 2016-04-21 12:07:50 -07:00
Jean Guyomarc'h ca346eb273 ecore: fix documentation of Ecore_Exe_Event_Del 2016-04-09 21:52:39 +02:00
Felipe Magno de Almeida 887608e146 ecore: add promise for Ecore_Thread
Add ecore_thread_promise_run function that returns a Promise
and runs function in another thread which you can set the
value on a Eina_Promise_Owner.

Eina_Promise* promise;
Ecore_Thread* thread = ecore_thread_promise_run
( &function_heavy, &cancellation_function, private_data,
sizeof(ValueType), &promise);

This calls function_heavy on another thread and returns
the Ecore_Thread and a Eina_Promise as an out-parameter.

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-04-05 11:35:12 -07:00
Tom Hacohen 2bddf709c7 Ecore poller: Fix Eolian warnings.
This includes either migrating types to eolian, fixing namespace or
importing extra types.
2016-02-16 14:00:46 +00:00
Tom Hacohen 57cb1d8ec0 Ecore exe: Move more structs and enums to Eolian. 2016-02-12 14:29:27 +00:00
Felipe Magno de Almeida e1de58a3ad efl: Renamed Ecore.Time to Efl.Time and defined it
Moved the Ecore.Time @extern struct to Efl lib and defined it as
specified in C specification for struct tm. Thus, bindings can be
automatically generated for where struct tm is used.
2016-02-09 13:28:25 -02:00
Vitor Sousa 0e8ce5dd23 ecore: move Ecore_Pos_Map to ecore_types.eot
Move Ecore_Pos_Map from Ecore_Common.h to ecore_types.eot.
Give it the namespaced Eolian name "Ecore_Pos_Map" to follow the
standards.

Update documentation to refer to Ecore_Pos_Map instead of its previous
enum definition "_Ecore_Pos_Map".
2016-02-09 11:38:58 -02:00
Vitor Sousa c674f64a07 ecore: create ecore_types.eot and add Ecore.Time to it
Create the file ecore_types.eot to hold common types related with Ecore.

Add Ecore.Time as an external type to ecore_types.eot.
This type is intended to be a alias to struct tm (from time.h).
That way .eo files have a standard way to reference it.
Each language should manually bind it.
2016-02-09 11:38:58 -02:00
Carsten Haitzler 594dab8078 ecore docs - adjust docs to be explicit about ecore main loops nesting
it seems some people think ecore main loops can nest. they can't. be
explicit in docs.
2015-10-05 16:04:31 +09:00
Amitesh Singh 5f74afe4f7 ecore: fix typos in documentation 2015-09-28 15:49:11 +05:30