Commit Graph

15 Commits

Author SHA1 Message Date
Vitor Sousa ed75aa32d6 cxx: General C++ Eo wrapper generation improvement
Using a new architecture in the generated files that simplify multiple
inheritance and allows the use of interface types as parameters.

No longer using a hand-crafted C++ header for eo_base.eo.
This file was added to the generation process.

Updated all files that are dependent in the hand-crafted eo_base
C++ header.

Now there is a class that contains the essentials functions of the former
eo::base wrapper and that is used to create (through inheritance) the
"concrete" classes for all Eo generated wrappers.

No longer binding any function or property that are protected, private or
legacy for now.

eolian_type_instance is now a struct with general information for the
whole type.

Added the new header file namespace_generator.hh to hold namespace
generation grammars.

Separated declaration and definition of Eo wrappers methods.

Referring for most objects by its full name (starting at the global
namespace ::) in the generated files.

Created additional helper grammars to avoid code replication.

Removed a TODO comment referring to a doubt about inheritance of
constructor methods.
Added a TODO comment regarding memory allocation for callbacks in static
member functions.
2015-01-05 15:52:27 -02:00
Larry Jr ebebcf6438 catch exceptions in cxx wrappers and throw a eina_error 2015-01-05 15:52:27 -02:00
Vitor Sousa 64dede1cf1 eolian_cxx: Fix callback handling on generated wrappers
Added callbacks to the event EO_EV_DEL for deleting heap-allocated
function objects. This will enforce that the allocated memory,
necessary for maintaining these callable objects alive, is freed at
least when the underlaying Eo object is destroyed.

Functions and constructor methods are now able to have multiple
callback types.

Removed some unused generators, since they become inconsistent now that
functions are required to handle multiple callback types.

Allocating callback objects in the constructor methods instead of
delaying it until the final constructor is called.

Created some generators to avoid code repetition.

Now the generator parameters_forward_to_c replicate the behavior of the
generator parameters_list. The generator parameters_list was, then,
removed since it have a less intuitive name.

Added a TODO comment regarding the behaviour of simple not translating
callbacks that are not followed by a user data pointer.

The generator parameter_type was moved from "parameters_generator.hh" to
"type_generator.hh" for more consistency and convenience.
2015-01-05 15:52:27 -02:00
Savio Sena 0cc5f5c94d eolian-cxx: Added generation of call_constructor for parent_type. 2014-07-25 11:32:56 -03:00
Savio Sena fb82d67ab1 eolian-cxx: Fixed inheritance operations generation rules.
The generated code was not converting the types from C to C++ correctly.
2014-07-24 19:52:23 -03:00
Savio Sena bd68d29968 eolian-cxx: Added grammar rule parameters_cxx_list.
Now with the correct semantics: list parameters converting to C++.
2014-07-24 19:52:23 -03:00
Savio Sena cc04dff0b9 eolian-cxx: Removed unused code.
Sanitized grammar removing old code which is not unecessary for good.
2014-07-24 19:52:23 -03:00
Felipe Magno de Almeida ad66192465 eolian-cxx: Fixed generation using abstract return-type instead of C type
The _tmp_ret variable should use the native C type and not the
abstracted C++ type.
2014-07-18 19:20:55 -03:00
Felipe Magno de Almeida c1e8918b88 eolian-cxx: Fixed inheritance feature with callbacks
The addition of callbacks was making the inheritance to fail. Fixed
generation by using the C types, instead of the abstracted callback
types for the wrapper functions.
2014-07-18 19:00:35 -03:00
Felipe Magno de Almeida 907544be7b eolian-cxx: Various and various fixes with callbacks
Mimic the callback function generation for other functions that were
being generated incorrectly and inconsistently.
2014-07-18 18:59:12 -03:00
Felipe Magno de Almeida 401cc81355 eolian-cxx: Workaround for multiple callbacks without corresponding void*data
Added workaround for generating classes with methods that have more
than one callback but doesn't have a corresponding void* data
parameter. E.g., elm_box.eo.
2014-07-18 18:57:14 -03:00
Savio Sena 78e396ac19 eolian-cxx: Initial version of complex types / callbacks / events implementation. 2014-07-18 18:57:13 -03:00
Felipe Magno de Almeida 5e5b00bc90 eolian-cxx: Disabled temporarily the inheritance feature
This feature is buggy when using multi-level namespaces. I disabled it
temporarily and will fix it ASAP and re-enable it.
2014-07-18 12:28:03 -03:00
Savio Sena ce63b16f40 eolian-cxx: Make proper handling of namespaces.
Summary:
The generation of class prefixes was not taking into account the full
classname -- the namespace was not being prepended to it. Fixed that and
also re-organized the code a bit, removed some Wshadow warnings also.

This commit fixes 'make examples' and 'make check'.

Reviewers: tasn, cedric, q66

CC: felipealmeida, smohanty, cedric

Differential Revision: https://phab.enlightenment.org/D1100
2014-07-01 10:55:45 +01:00
Savio Sena 46b6e8a563 eolian_cxx: initial version of the EFL C++ Bindings Generator.
Summary:
This patch adds 'eolian_cxx' -- a C++ bindings generator --
to the EFL tree. Eolian Cxx uses Eolian API to read .eo files and generate
.eo.hh. It relies/depends on Eo Cxx and Eina Cxx (both non-generated
bindings).

src/bin/eolian_cxx: The eolian_cxx program.
src/lib/eolian_cxx: A header-only library that implements the C++ code
generation that binds the .eo classes.

=Examples=

src/examples/eolian_cxx/eolian_cxx_simple_01.cc: The simplest example,
it just uses some "dummy" generated C++ classes.

src/examples/eolian_cxx/eolian_cxx_inherit_01.cc: Illustrates how
pure C++ classes inherit from .eo generated classes.

src/examples/evas/evas_cxx_rectangle.cc: More realistic example using
the generated bindings Evas Cxx. Still a bit shallow because we don't
have full fledged .eo descriptions yet, but will be improved.

=Important=

The generated code is not supported and not a stable API/ABI. It is
here to gather people interest and get review before we set things in
stone for release 1.11.

@feature

Reviewers: cedric, smohanty, raster, stefan_schmidt

CC: felipealmeida, JackDanielZ, cedric, stefan

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

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-03 00:56:32 +02:00