Commit Graph

405 Commits

Author SHA1 Message Date
Christopher Michael 62bea1701c eolian: Fix resource leak
Summary:
Small patch to fix a resource leak detected by Coverity. Coverity
reports that 'refls' going out of scope leaks the storage it points
to, so let's free it before we leave the function.

Fixes Coverity CID1399099
Depends on D8309

Reviewers: raster, cedric, q66, zmike, bu5hm4n, stefan

Reviewed By: q66

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8310
2019-03-12 11:31:51 -04:00
Marcel Hollerbach 1c62ed5349 efl: ensure legacy is only relying on stable types
Summary:
This commit changes the beta ness of a few types, those types are
looking quite stable. Edje types will likely not change. The
Efl.Gfx.Join types are actaully already stable since the last release,
since evas_vg was stable back then and those enums have been in there.

The elementary stuff looks a bit unthought, and we have the chance to
change the API in the backend, so maybe we want to not declare it
stable, but rather reintroduce the legacy types.

With this we can enable eolian generation of beta tags for types.

ref T7726

Depends on D8276

Reviewers: cedric, segfaultxavi, zmike, stefan_schmidt, q66

Reviewed By: segfaultxavi, q66

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7726

Differential Revision: https://phab.enlightenment.org/D8277
2019-03-09 16:39:06 +01:00
Cedric BAIL bc12d9feb5 eo: make reflection getter const function.
Getter are usually not modifying there object. This is going to put a strong
limit on what a getter property for MVVM is, as it will prevent any side
effect on getting a property from a View.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7969
2019-03-08 14:31:08 -08:00
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
Daniel Kolesa 1a17aff85f eolian: add support for marking type declarations beta
Summary:
This also simplifies the beta checking API by unifying it under
objects (makes much more sense that way) and reworks the validator
to have betaness support within its context state, allowing checks
to be done easily in any place.

The betaness checks are disabled for types for the time being,
because otherwise there are too many errors (types are assumed
to be stable as they are not tagged beta, but they reference beta
classes all over the place). Set EOLIAN_TYPEDECL_BETA_WARN to 1
in your environment to force enable the checks.

Reviewers: zmike, bu5hm4n, stefan_schmidt, lauromoura, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl, #eolian

Differential Revision: https://phab.enlightenment.org/D8102
2019-03-08 08:17:01 -05:00
Daniel Kolesa 4b1622b5fc eolian: remove support for inlist/inarray
This feature was kind of ill-conceived and never worked properly.
Since there isn't enough time to make it work right at this point
and there are no users of it in the API, remove it for now.

It might get added in the next release cycle, in a proper form.

@feature
2019-02-28 20:28:24 +01:00
Marcel Hollerbach 3555029f9f eolian_gen: fix generation of legacy class functions
we forgot to generate the legacy function. This no now added back.

ref D8029

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8037
2019-02-28 16:11:52 +01:00
Cedric BAIL b23f65291f eo: make reflection setter able to return an error code in case of failure.
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7935
2019-02-21 11:54:09 -08:00
Daniel Kolesa b6b7317f4e eolian gen: generate a separate file with legacy implementations
If legacy implementations are generated, eolian_gen now creates
a separate file for them and includes it. The file name convention
for that is <.c file name without ext>.legacy.<.c file name ext>
or <.c file name>.legacy.c if it has no ext, so for example
foo.eo.c becomes foo.eo.legacy.c and foo becomes foo.legacy.c.

The file is generated assuming there are any legacy APIs contained
inside the .eo file.
2019-02-21 16:52:40 +01:00
Daniel Kolesa e335663da0 eolian gen: emit doxygen references to constants in uppercase
Since these are made into macros in C, they get uppercase names.
Reflect this in documentation generation.

Fixes T7691.
2019-02-21 12:14:33 +01:00
Daniel Kolesa 8952c05ddd eolian gen: initial support for reflection api
This adds support for generating reflection functions for
properties. This support is basic for now, supporting only
primitive types and string(shares), it will be expanded later
as required.

@feature
2019-02-15 17:17:15 +01: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 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 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
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
Daniel Kolesa 347f096bf7 eolian_gen: add support for header-only depfiles
By default, dependency files are now generated only for headers.
This makes sense for the C generator and our dependency tracking
needs. If full dependencies are needed, there is now the 'D'
output, which has the old behavior.
2019-02-06 14:31:23 +01:00
Marcel Hollerbach bb673d3f70 eolian: add support for the container array
this fixes a lot of different warnings in the efl_mono test generation.

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D7730
2019-01-23 16:43:04 +01:00
Marcel Hollerbach 5a11fd8587 eolian_gen: void out keys depending on how they are setted
this avoid warings about keys not beeing used in the fallback function.

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D7630
2019-01-16 14:40:13 +01:00
Marcel Hollerbach e43f090265 cmake: remove!
This build was never complete and also was not maintained probebly.

It is also dropped in favour of meson which is cool, merged, works & is fast.

Differential Revision: https://phab.enlightenment.org/D7010
2018-12-20 20:07:26 +01:00
Marcel Hollerbach 79ded15ad3 meson: enable cross compiling
the inital work for this commit was coming from `Mark van der Putten`.
In order to not have more options for this, the idea came up to use
mesons autodetection using PATH.

If a cross file is specified, the binaries are used from the system,
rather than from the intree. (Which means --cross-file has the
dependency of efl on the buildsystem)

Differential Revision: https://phab.enlightenment.org/D7415
2018-12-07 13:05:31 +01:00
Marcel Hollerbach c1dd57d210 meson: use eolian_gen with -S
this ensures that eolian does not parse installed .eo files

Differential Revision: https://phab.enlightenment.org/D7405
2018-12-03 19:00:26 +01:00
Daniel Kolesa 14ce54c303 eolian: implement new inherit behavior
Eolian now separates 'parent' and 'extensions'. For regular
classes, parent is the first item in the inherits list and
extesions is the rest. For interfaces and mixins, parent is
NULL and extends is the inherits list.

The reason for this is the separation of them in syntax in near
future. It also slightly changes the behavior; since for interfaces
and mixins, parent is always NULL now, you can freely inherit from
all types of classes without needing to manually put an interface
type as the first item of the inherits list.
2018-11-23 13:57:07 +01:00
Carsten Haitzler 9f63f356fc eolian - fix warnings about strin truncation by expanding buffers
fixes noisy warnings...
2018-11-09 11:43:59 +00:00
Daniel Kolesa d82deea833 eolian gen: add generation of build dependencies
It is now possible to generate a separate .d file which will
contain Make-style dependencies for the files generated in that
batch, i.e. if you geerate header, legacy header and source, the
.eo.d file will contain dependency lists for those three.

It should be possible to integrate this into our build system to
enable proper regeneration of .eo files in an incremental manner.

Fixes T2251.
2018-10-24 12:02:43 +02:00
Xavi Artigas fc3135ce2c eolian: use the legacy_prefix to generate the legacy doxygen group names
Summary:
Legacy group names are not consistent (for example, only half of them have the
_Group suffix), therefore this commit does not fix ALL problems related to
EO-generated @ingroup tags not matching manually-generated @defgroup tags.
However, it fixes a great deal of them and the rest should be easier to fix
by hand.

Test Plan:
After running "make doc", some of the EO-generated methods like
ecore_timer_interval_set() which did not appear in the API reference
documentation should be available now.

Reviewers: q66, jsuya, Jaehyun_Cho

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7148
2018-10-09 15:29:08 +02:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Daniel Kolesa b47782372b eolian: silence a potentially uninitialized warning
Compiler thinks mname might be used uninitialized, which is never
the case, because cl only exists if mname has been set. It still
creates an annoying warning though, so fix that.
2018-06-11 13:07:23 +02:00
Daniel Kolesa cc744596b3 eolian gen: remove unused promise variables 2018-05-03 17:14:39 +02: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 fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Daniel Kolesa bf1e3a702f eolian: event/function_get_by_name -> by_name_get 2018-03-16 14:26:15 +01:00
Daniel Kolesa 1f4d919cf9 eolian: update type/var name APIs 2018-03-12 16:28:28 +01:00
Daniel Kolesa edcd81ee49 eolian: update class name APIs 2018-03-12 16:03:37 +01:00
Daniel Kolesa c7b44dfa2c eolian gen: switch from decl api to object api 2018-03-08 19:57:55 +01:00
Daniel Kolesa 482c5d1ba2 eolian: get rid of old APIs for typedecl retrieval 2018-03-07 13:53:08 +01:00
Daniel Kolesa 434b0a399d eolian: remove old class retrieval APIs 2018-03-07 13:08:49 +01:00
Daniel Kolesa 9ab4560459 eolian*: replace various directory_scan/file_parse 2018-03-02 13:30:27 +01:00
Daniel Kolesa 6a284e48c9 eolian: eolian_* -> eolian_state_*, Eolian -> Eolian_State 2018-02-27 16:12:35 +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 dd2e579fec eolian: do not require unit for expr eval APIs
The necessary information is now stored directly in the expr
during database validation.

Also enable expr validation for params.
2018-01-16 16:37:52 +01:00
Daniel Kolesa c6436337a4 eolian: aliased_base_get funcs don't need unit 2018-01-12 18:05:13 +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 c8aa30e698 eolian: make declaration APIs use units 2017-12-15 17:11:11 +01:00
Daniel Kolesa 8a1f93f698 eolian: pass state where necessary
This modifies the API so that global state removal is made
possible. It's still used internally for now but externally
the state is contained.
2017-12-05 16:41:42 +01:00
Felipe Magno de Almeida 66eb8ddfeb eolian: Add inarray and inlist to source generation 2017-12-04 20:34:47 -02:00
Daniel Kolesa 2f81b26367 eolian: scan system dir by default
The '-S' option lets you reverse that. But by default, most
people will want the prefix to be scanned for eo files.
2017-11-14 13:47:09 +01:00
Daniel Kolesa 753359230a eolian: more intuitive generation options and mrge impls into .c
Previously the output base name used to include extension, now
you don't need to specify an extension and it's determined from
the input file name instead.

Also, implementation boilerplate used to merge with .eo.c before,
which made no sense. Now it's merged with .c instead when it
exists or makes a new .c file when it doesn't.
2017-11-10 14:48:59 +01:00
Daniel Kolesa 4f8a9b50f4 eolian: make inherits_get return a list of classes, not strings
Most of the time you need to retrieve the class from the string
anyway, so remove this relic of old Eolian and gain some small
performance benefits and extra convenience.

Subtly breaks API but everything should be updated.
2017-10-25 16:25:41 +02:00