Commit Graph

138 Commits

Author SHA1 Message Date
Felipe Magno de Almeida a3ade15d5a cxx: Add license to CXX bindings.
Summary:
Like C#, it will also be Apache 2.0

Depends on D9414

Reviewers: vitor.sousa, woohyun, jpeg, lauromoura

Reviewed By: lauromoura

Subscribers: jpeg, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9418
2019-10-24 10:40:16 -03:00
Lauro Moura 507061a145 bindings: Fix disposal of eolian state
Summary:
It was actually leaking before. Let's use some RAII classes that were
already there.

ref T8280

Reviewers: q66, felipealmeida, brunobelo

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8280

Differential Revision: https://phab.enlightenment.org/D10237
2019-09-30 16:08:24 +02:00
Felipe Magno de Almeida 289cd1f3d4 eolian-cxx: Fix use after free for base variable
T8137
Differential Revision: https://phab.enlightenment.org/D9575
2019-08-16 09:30:54 +02:00
Felipe Magno de Almeida dccd68491c eolian-cxx: Generate eot files
Summary:
Eolian Type files were not being generated, which made some template
specialization to not be defined, for example for function_wrappers.

Reviewers: bu5hm4n, woohyun, lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9468
2019-07-31 18:38:02 -03:00
Daniel Kolesa db57523e78 eolian: refactor parsing API and path handling
This splits the eolian_file_parse API into two, one for parsing
files already present in the database (always by filename) and
one for parsing paths.

It fixes several bugs/leaks on the way (incorrect use of
stringshare etc.) as well as adds checking for whether there
are no conflicting filenames at scan time, for free. That means
it is now no longer possible to scan two paths which have an eo
or eot file of the same name in them.

It should also be faster now.

It also fixes T7820.

@fix
2019-05-03 17:06:49 +02:00
Marcel Hollerbach 42a23d1afa build: remove unused meson file
this was added by accident

Differential Revision: https://phab.enlightenment.org/D7469
2018-12-17 17:43:06 +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
Marcel Hollerbach e85311c992 meson: here comes cxx bindings
this commits is bringing cxx bindings.
You can enable / disable them with the cxx option.

Differential Revision: https://phab.enlightenment.org/D7181
2018-10-24 12:05:58 +02:00
Marcel Hollerbach 52e0b8440b Revert "meson: add cxx bindings"
This reverts commit 5aaf2cbb5d.

The cxx bindings were accidently merged. Things are missing (like .eot.h
files)
2018-10-18 16:12:13 +02:00
Marcel Hollerbach 5aaf2cbb5d meson: add cxx bindings
this commit adds cxx bindings to meson.

Differential Revision: https://phab.enlightenment.org/D7169
2018-10-18 16:01:07 +02:00
Lauro Moura c9dd86579f efl_mono: More uniformization of the handling of names
Summary:
Uses a common helper to open and close namespaces, to get the managed
and unmanaged name of things, the interface, concrete and inherit class
names, etc.

eolian_cxx: Add namespace information to func_def, as it'll avoid
eolian-cxx clients dealing with the eolian C api directly when trying
to access a function pointer namespace.
Depends on D6048

Reviewers: felipealmeida, vitor.sousa

Reviewed By: vitor.sousa

Subscribers: cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6049
2018-05-03 18:04:41 -03: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 ad8a077f23 eolian cxx: fix typo 2018-03-09 00:41:09 +01:00
Daniel Kolesa b6fa5aa844 eolian cxx: replace declaration api with obj api 2018-03-08 23:21:05 +01:00
Daniel Kolesa 1117a67818 eolian cxx: remove usages of obsolete file_get APIs 2018-03-08 22:53:51 +01:00
Lauro Moura 6f092071ac eolian cxx,csharp: Update after eolian changes
Closes D5829.
2018-03-02 23:58:20 +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 7ae1030383 eolian cxx: pass state when getting decls 2017-12-17 23:08:07 +01:00
Lauro Moura aab5cc03ff eolian_cxx: Fix unit initialization
Summary:
eolian_cxx was segfaulting due to a null unit being passed to
class_get_by_file.

Reviewers: felipealmeida, jpeg, q66

Differential Revision: https://phab.enlightenment.org/D5611
2017-12-06 17:42:46 +01:00
Daniel Kolesa fd868bff34 eolian cxx: free state on exit 2017-12-05 16:47:19 +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
Jean-Philippe Andre 8cdb3184f8 cxx: Fix compilation after merge
This resolves a few issues and brings back the experimental features.

Also, disable some of the ugliest experiments:
 - manual function overrides,
 - define APIs only in eo_cxx namespace

Some APIs are generated behind EFL_CXXPERIMENT (eg. event_name_cb_add or
some weak pointer stuff). I believe they are useful but would like to
make sure there are no serious drawbacks with generating those.
2017-12-05 15:01:45 +09:00
Jean-Philippe Andre 2b0805ddce cxx: Define types after forward declarations
This is useful if the types refer to the current class.
2017-12-05 15:01:45 +09:00
Jean-Philippe Andre 5901b4601e cxx: Implement support for parts
This generates methods like this:

  Part_Class part_name() const;

Which can then be used like:

  slider.indicator().format_string_set("%1.1f");
2017-12-05 10:15:40 +09:00
Jean-Philippe Andre 03af836332 cxx: Use set for forward classes
This avoids duplication. Not very important as there are FWD_GUARD
macros anyway.
2017-12-05 10:14:03 +09:00
Jean-Philippe Andre 4fdc5fd0b2 cxx: Fix some pedantic warnings from clang
Shadow variables, 0 used as nullptr.
clang still complains that usage() is not declared as noreturn.
2017-12-05 10:14:03 +09:00
Jean-Philippe Andre 5425baa906 cxx: Add support for function pointers
This was tested on the function pointer Efl.Ui.Format_Func_Cb
2017-12-05 10:14:03 +09:00
Jean-Philippe Andre be267a071e cxx: No need to declare the current class twice
This avoids double _FWD_GUARD for the current class in a .eo.hh header.
2017-12-05 10:09:58 +09: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
Daniel Kolesa e55ab81835 eolian: always implicitly validate database and remove its API 2017-09-13 23:58:47 +02:00
Felipe Magno de Almeida 6dcc8dd07f eolian-cxx: Fixed compilation error after Eolian_Unit type introduction 2017-06-02 18:27:46 -03:00
Felipe Magno de Almeida a1f2db255b cxx: Modify how to generate C++ headers and allow cyclic dependencies
Allow cyclic dependencies in generated C++ headers by changing order
of includes and creating forward declarations.
2017-01-18 22:47:04 -02:00
Daniel Kolesa 82ef73ca18 eolian: remove type silencing stuff entirely
this was useful during transition, but not anymore
2016-10-25 18:02:23 +02:00
Felipe Magno de Almeida dbed78ad3b eina-cxx: Moved variant to eina C++ 2016-09-14 00:33:22 -03:00
Stefan Schmidt 2f22a634b0 eolian_cxx: add missing libgen.h include for basename() to fix build on OS X
On Linux this went through and has gone unnoticed. basename() needs libgen.h
though and eolian_cxx was not including it.
2016-06-06 11:45:08 +02:00
Felipe Magno de Almeida 2a3d7860db eolian-cxx: Rewrite to accomodate new features of the C++ binding 2016-06-06 02:54:36 -03:00
Felipe Magno de Almeida a2d783a7c2 eolian-cxx: Fixed lookup of class types 2016-05-26 16:47:04 -03:00
Felipe Magno de Almeida 6e23780bb1 eolian-cxx: Fix generation of complex types in C++ binding
Fixed generation of complex types in C++ binding, with tests. This
problem came after the removal of the pointer types for top-level
complex types.
2016-05-23 17:34:50 -03:00
Felipe Magno de Almeida e3c8b280c6 c++: Reorganized C++ binding generation
Moved all generation to a single Makefile_Cxx.am file instead of
throughout the whole project. And fixed C++ generation on Elementary
after elm merge.
2016-05-23 15:05:50 -03:00
Daniel Kolesa 7782c0bcb9 eolian: add event_prefix and have classes follow that or eo_prefix by default
Previously events used to use class name as a prefix and ignored eo_prefix
when specified. This is no longer the case. Events follow eo_prefix by default
now. In order to get around this for classes where this is undesirable, a new
field event_prefix was added which takes priority over eo_prefix. If neither
is specified, class name is used like previously.

@feature
2016-05-17 17:50:43 +01:00
Felipe Magno de Almeida 535a069a23 eolian-cxx: Remove .Base requirement
Remove requirement that class can't have the same name as another
class's namespace.
2016-04-21 18:31:53 -03:00
Vitor Sousa f57d4b9a3c eolian_cxx: Fix C++ compilation with new Eolian_Type_Type values 2016-03-03 18:58:11 +00:00
Daniel Kolesa 30bc1d285b eolian: allow silencing of type errors in validation
This allows generators to silence type errors in validation in order
to reduce duplicate error messages when generating multiple files.
Also adjusted the C generator to only emit type errors when generating
Eo header files.

@feature
2016-02-10 16:05:07 +00:00
Felipe Magno de Almeida 932b6e7463 eolian-cxx: Fixed possible exception escaping main
Added try/catch around main to show the reason for the generation failure.

@fix CID 1265600
2015-10-09 13:54:32 -03:00
Daniel Kolesa 3f1d29f1ec eolian: remove support for old style docs completely 2015-09-03 15:42:01 +01:00
Daniel Kolesa 825349c7b8 eolian: improve function_full_c_name_get API
It's now generalized to work properly with legacy functions
as well as correctly append suffixes. Thus, it can be easily
used with the documentation generator and in other places.

@feature
2015-07-08 12:10:20 +01:00
Vitor Sousa dae35333fd eolian_cxx: Use C++ wrappers instead of native types as parameters
Summary:
Using C++ wrapper types in the signature of methods of the generated
classes.
Now, when the type is an Eo type defined in Eolian, eolian_cxx will detect
it and use the equivalent C++ wrapper.

Types defined in Eolian no longer need to be specified in the lookup table,
so removed them from there.

Disable wrapping of non-const char*. The current wrapper (unique_ptr) is
not suited for some required operations like ownership acquisition from
C code.

Fix constructing properties that only have the "set" method.

Fix translation of non-const parameters.

Modified Makefiles to allow proper inclusion of evas_cxx headers required
by some tests and examples.

Move one auxiliary function to another reader to make it more accessible.

@feature

Reviewers: felipealmeida, q66, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2752
2015-06-24 15:23:01 +01:00
Daniel Kolesa 950322fd12 eolian: remove support for old event doc syntax 2015-06-11 17:14:51 +01:00