Commit Graph

21 Commits

Author SHA1 Message Date
Felipe Magno de Almeida 138e9e5294 eo: Rename EAPI macro to EO_API in Eo library
Summary:
Patch from a series of patches to rename EAPI symbols to specific
library DSOs.

=  The Rationale =

This patch is 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
LIBAPI is the only solution that works for MSVC.

Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>
Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>
Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev>

Reviewers: jptiz, lucas, vtorri, woohyun

Reviewed By: jptiz, lucas, vtorri

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12203
2020-12-09 13:52:25 -03:00
Marcel Hollerbach 46885653bc eo: remove class functions from eo
As in the previous commit explained, we want to get rid of class
functions in eo, and make them just c functions right away.

This commit removes the class parameter from the eo_class_function_set
call, and adjusts the tests to not depend on class functions anymore.
Class functions are now not tested anymore, tests that used them as a
way to test *things* are adjusted to test them now with object
functions, tests that just tested the working of class functions are
dropped.

This fixes T7675.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7902
2019-02-13 16:59:59 +01:00
Marcel Hollerbach 0709bdea6f eo: change API call of efl_class_functions_set
The next commit will bring support for something like reflection. This
commit prepares the whole tree for getting another argument in
efl_class_functions_set.

ref T7681

Differential Revision: https://phab.enlightenment.org/D7882
2019-02-07 14:43:25 +01:00
Tom Hacohen 7ebf9d879d Eo: Change the way functions are registered to classes
This change lets us remove a field from the structure that leads to
around 20KiB more of saving in private dirty pages in elementary.

This also looks a bit better and feels a bit cleaner.

Breaks API and ABI.
2016-09-09 11:14:35 +01:00
Tom Hacohen a8ccb191c6 Adjust the EFL to the Eo class_initilizer changes. 2016-09-05 16:03:17 +01:00
Tom Hacohen c8c0bbcfcf Efl object: rename EFL_OBJECT_OVERRIDE_OPS_DEFINE.
It is now called EFL_OPS_DEFINE as it's used for general purpose ops
definition.
2016-09-05 16:03:16 +01:00
Tom Hacohen a6f126af12 Efl object: Don't pass events to eo class creation.
This was never used and there is no plan to ever use it. I'm going to
soon add a different mechanism with which it will be possible to provide
them again to Eo if ever needed without breaking ABI. Though it's
unlikely it will ever be.
2016-08-23 14:47:28 +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
Felipe Magno de Almeida 62841aee3c eolian: Make promise eolian generation use macros for hooks
Modify the way hooks are defined and used by promise generation in
Eolian in the Eo API.

Instead of passing macro names as parameters to EO_FUNC_BODY macros,
just re-define the actual hooks when it is needed.
2016-04-11 01:28:50 -03:00
Felipe Magno de Almeida 944e11559c eo: add before and after macro hooks for API generation functions
Add two parameters for macros that generate API functions in Eo so
that the generation can be customized with macros used by Eolian.

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-04-06 14:32:04 -07:00
Tom Hacohen 9328524da4 Eo: Remove EO_SENTINEL.
This was never really needed because we always had the count.
Removing this now because we are already breaking API and ABI.
2015-09-28 15:52:50 +01:00
Tom Hacohen 37f84b7e96 Eo: Drop doc field from ops and events.
This hasn't been used for a while. Since we are going to break Eo a bit anyway
it's a good opportunity to drop this.

This may cause a slight performance issues with legacy events, such as
smart callbacks. This shouldn't really be a problem as we've migrated away from
them. If it does, we need to migrate the remaining parts. Only relevant
for callbacks that are added before the classes are created, which
shouldn't be possible except for smart, only for old evas callbacks.
2015-09-28 15:09:16 +01:00
Tom Hacohen c32bb4fe95 Eo2: Updated naming Eo2->Eo. 2014-04-10 04:20:21 +01:00
Tom Hacohen 055dd3c521 eo2: change the order of EO2_OP_FUNC* to put EAPI first.
This looks cleaner and more aligned. Also, it makes more sense as the
internal function is bound to the EAPI and not the other way around.
2014-04-10 04:20:20 +01:00
Tom Hacohen 7c0598c930 eo2: access tests makeup 2014-04-10 04:20:18 +01:00
Tom Hacohen ac2f6d0bf5 eo2: updated the access test to use eo2. 2014-04-10 04:20:17 +01:00
Tom Hacohen 682c69764d Revert "eo: libs,test,benchmarks Eo_Class -> Eo"
This reverts commit 1714fe93f4.

We actually want this type, it makes things clearer.

Conflicts:
	src/tests/eo/function_overrides/function_overrides_inherit2.c
	src/tests/eo/function_overrides/function_overrides_simple.c
	src/tests/eo/suite/eo_test_class_simple.c
2013-09-27 16:40:32 +01:00
Jérémy Zurcher 1714fe93f4 eo: libs,test,benchmarks Eo_Class -> Eo
Conflicts:
	src/tests/eo/suite/eo_test_general.c
2013-09-27 14:01:46 +01:00
Daniel Zaoui f6a37f88d2 Eo: Add reference functions for objects data
We want to introduce a new mechanism concerning the data of the Eo
objects.
The goal is to improve the memory management by defragmenting the memory
banks used by the Eo objects. The first phase has been done by raster
and consists in allocating the objects into a separate memory region
that the one used by malloc. So now, we know where our objects are
located.
Now, moving objects means moving data of objects. The issue we have here
is that a lot of data pointers are stored into data of other objects,
e.g Evas Object data into lists for rendering...
We need a way to reference the data and eo_data_get doesn't provide us
that. So we need to improve the API for data extraction by requesting
from the developer if the data will be stored or not. Five functions are
supplied:
- eo_data_scope_get: no referencing, the data pointer is no more used after
exiting the function.
- eo_data_ref: reference the data of the object. It means that while the
data is referenced, the object cannot be moved.
- eo_data_xref: reference the data of the object but for debug purpose,
we associate the objects that references. Same behavior as eo_data_ref
for non-debug.
- eo_data_unref: unreference the data of an object.
- eo_data_xunref: unreference the data of an object previously
referenced by another object.

I deprecated the eo_data_get function. Most of the time,
eo_data_scope_get needs to be used.

In the next patches, I changed the eo_data_get to the corresponding
functions, according to the usage of the data pointer.

The next step is to find all the places in the code where the data is
stored but not yet referenced. This will be done by:
- requesting from every object to unreference all data to other objects.
- moving all the objects from one region to another
- requesting from every object to rerefenrence the data.
- debugging by hunting the segmentation faults and other weird
creatures.
2013-05-01 10:37:08 +03:00
Vincent Torri 3b5a3448b7 merge: add eo
SVN revision: 77072
2012-09-26 06:56:52 +00:00