Commit Graph

23 Commits

Author SHA1 Message Date
Daniel Kolesa cf200a7d28 eolian: remove legacy handling API and most of generation
Summary:
This removes all Eolian API that deals with handling of legacy
code. It also removes the code using it in the generator as well
as bindings, but for now keeps generation of .eo.legacy.h types,
as there are still instances in our codebase where things are
otherwise broken. We can remove the rest once that is resolved.

Reviewers: zmike, cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8255
2019-03-08 10:12:09 -05:00
Xavi Artigas 19fcd6e60f eolian: allow tagging complete classes as BETA
Summary:
This allows using the @beta tag in classes, like this:
class @beta Efl.Foo extends Efl.Bar { ... }

This will surround the class definition in the .eo.h file with an
EFL_BETA_API_SUPPORT #define, equivalent to tag every method and
event with @beta.

Test Plan: Nothing changes since no class uses this tag yet

Reviewers: q66, bu5hm4n, zmike

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7933
2019-02-13 18:48:02 +01:00
Xavi Artigas 6b7346b7b2 Remove individual class BETA guards
Summary:
Eolian adds a per-class BETA guard (like EFL_UI_WIN_BETA) to any method tagged
as @beta. This means that any app (and the EFL code) wanting to use BETA features
has to enable them class by class, which is cumbersome.
This commit replaces the individual guards with the global EFL_BETA_API_SUPPORT
guard, so apps only need to define one symbol to access BETA features.

Any usage of the per-class guards has been removed from the EFL code and examples.
When building EFL the global guard is defined by configure, so all EFL methods
already have access to BETA API.
Efl_Core.h and Efl_Ui.h no longer define EFL_BETA_API_SUPPORT. Apps wanting to
use BETA API have to define this symbol before including any EFL header
(It has been added to the examples requiring it).

Test Plan:
make && make check && make examples still work, but there's a lot less #defines
in the code

Reviewers: zmike, bu5hm4n, q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T6788

Differential Revision: https://phab.enlightenment.org/D7924
2019-02-13 18:09:17 +01:00
Marcel Hollerbach 37d2d378ec eolian: drop class function overriding
Until this commit eo did class functions as part of the vtable, which
enabled those functions to be overwritten in classes inheriting another
class. However in task T7675 we decided that this is not really good for
bindings, as most OOP languages do not support this sort of feature.

After this commit eolian realizes class function completly outside of
the vtable, the c-symbol that is the class funciton is now just directly
redirecting to a implementation, without the involvement of the vtable.

This also means a change to the syntax created by eo:

Calling before:
  class_function(CLASS_A);
Calling after:
   class_function();

Implementation before:
   class_function(const Eo *obj, void *pd) { ... }
Implementation after:
   class_function(void) { ... }

This fixes T7675.

Co-authored-by: lauromauro <lauromoura@expertisesolutions.com.br>

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D7901
2019-02-13 16:59:58 +01:00
Daniel Kolesa 543902f2ba eolian: make doc ref resolution global
Doc refs no longer introduce new dependencies into files. Instead,
they're parsed globally, and any doc ref lookup is also made
globally. This allows unit based dependencies to correspond more
to what files actually really need at compile time/runtime, with
docs being irrelevant to that; it also simplifies the API.

The doc resolution API now takes Eolian_State instead of
Eolian_Unit, too.
2018-04-18 16:38:14 +02:00
Daniel Kolesa edcd81ee49 eolian: update class name APIs 2018-03-12 16:03:37 +01:00
Daniel Kolesa d47610a732 eolian: do not require unit when stringifying types
As it is no longer necessary to pass unit when evaluating exprs,
it is not necessary to pass it here either. Convert all the APIs
to the new style and update all instances in our tree.
2018-01-16 16:39:05 +01:00
Daniel Kolesa 19c16b671e eolian: type_typedecl_get doesn't need a unit 2018-01-12 18:05:13 +01:00
Daniel Kolesa 18e18ca74c eolian: remove remaining global state (+ modify APIs accordingly) 2017-12-15 17:11:11 +01:00
Daniel Kolesa 2071bbe8fb eolian: clean up and fix function pointer generation
Out/inout params are now correctly handled.
2017-08-30 15:45:20 +02:00
Daniel Kolesa 93c93328ac eolian gen: clean up param gen 2017-08-30 15:34:49 +02:00
Daniel Kolesa e288f5160b eolian: change C type serialization API to account for returns
This will allow proper handling of const.
2017-08-10 12:12:38 +02:00
Lauro Moura 1634c14169 eolian: function pointers
First steps toward explicit function pointer support in eolian.

To declare a function pointer type, use the following syntax, similar to
a regular eolian method declaration.

function FunctionName {
  params {
    ...
  }
  return: Return type
}
2017-06-18 12:09:22 -03:00
Daniel Kolesa 45a73a0878 eolian: pass unit to class get_by_name/file 2017-05-30 17:15:53 +02:00
Daniel Kolesa 6d453bc694 eolian gen: pass the unit around 2017-05-30 17:15:53 +02:00
Daniel Kolesa 7b20950aaf eolian: fix incorrect function prototypes in legacy headers
C functions that take no arguments need to have void in the arg
list. Otherwise, it would mean taking any number of arguments.
2017-03-31 17:49:41 +02:00
Daniel Kolesa 95181f2d36 eolian: move base function doc API into implements
This allows us to unify retrieval of docs for both regular and
overridden funcs without having two separate APIs. It's currently
missing validation and docgen is still not adjusted properly for
it either, but at least there's this. Enables retrieval of docs
for overridden funcs by default as well.
2017-01-19 15:09:07 +01:00
Daniel Kolesa deb1e58e06 eolian gen: do not use EOLIAN_UNRESOLVED/PROPERTY for lookups 2017-01-12 15:13:30 +01:00
Daniel Kolesa db7b6dd7e0 eolian gen: use EWAPI for events instead of EOAPI
Apparently only methods/properties can be EOAPI.
2016-10-20 16:48:41 +02:00
Daniel Kolesa 2515556673 eolian gen: better checks for whether to add space after type 2016-10-14 15:31:49 +02:00
Daniel Kolesa a862e07520 eolian gen: use the C get function name getter instead of manual concat 2016-10-12 15:11:16 +02:00
Daniel Kolesa d3d63ea8d3 eolian gen: utilize the new class C name getter instead of manual concat 2016-10-12 15:05:46 +02:00
Daniel Kolesa 9553fd9640 eolian gen2: move to eolian gen (as the old one is gone) 2016-10-07 13:34:47 +02:00