Commit Graph

93 Commits

Author SHA1 Message Date
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
Felipe Magno de Almeida 51d9760fe6 eolian-cxx: Removed unused function
Removed unused function and consequent warning
2015-06-05 00:19:34 -03:00
Daniel Kolesa a7dea04b26 eolian: merge eo_file_parse and eot_file_parse 2015-05-22 17:32:21 +01:00
Daniel Zaoui 1941dae695 Fix Eolian Cxx generator
Compilation was failing due to the changes in the Eolian library. The
generator has not been updated.

This patch fixes the compilation but not the tests that I let to my
lovely q66.
2015-05-21 09:38:34 +03:00
Vitor Sousa 2c48b3212a eolian_cxx: Fix @beta on generated bindings for C++ 2015-05-12 15:51:31 +01:00
Vitor Sousa ce36f0be93 eolain_cxx: Fix C++ support for new Eolian features
Added optional constructor methods for C++ Eolian wrappers.
Changed the interface of wrappers' main constructors.
If there are optional constructor methods they should be passed as variadic
template argument at the end of the constructor.
To support variadic template arguments, the optional "parent" parameter is
now the first parameter and there is another constructor without the
"parent" parameter.

Checking for @optinal and @nullable attributes instead of @nonull.
Now @nonull is the default, and eina::optional is only used when @optional
or @nullable attribute is specified.

The names of constructor methods no longer have the class name prefixed.

Added unit tests for checking the binding of optional constructors.
Added new .eo file to be used in the test.

Changed the generated documentation of constructors.

Changed the efl::eo::inherit accordingly, to address these new features.
Now the constructor methods should be explicit called in the
efl::eo::inherit constructor, which will receive them via variadic
template arguments.

Added another constructor to efl::eo::inherit for passing the parent
object.

Updated some tests and examples to follow the new interface.

Removed some code that is no longer necessary.

Also, fix Eolian C++ support for constructing properties. fix
assertion when parsing constructing properties.

Now if a property is a constructing property eolian_cxx will generate a
constructor method that have the property name (without the "_set" suffix).
2015-04-14 01:06:57 -03:00
Vitor Sousa d530389898 eolian_cxx: Add protected methods and events to C++ wrappers and fixes
Using eina::string_view in eolian generated interfaces (instead of
std::string) to allow lightweight passing of both C strings and C++
std::string.

Also, No longer using eina::optional in generated headers for types
that already implements the concept of null state (like Eo wrappers
and eina_accessor).

Also fix allocating callback objects require by class methods
(i.e. static) in static vectors so the memory will be freed when the
programs exit.

Added a new test case for testing callbacks on class methods.

Moved method definitions and supplementary code from generated C++
wrappers to auxiliary header file (.eo.impl.hh) generated together
with the main ".eo.hh" file. Updated Makefiles to list such files in
the compilation and cleanup processes. Updated .gitignore to include
these new generated files.

Made general adjustments on the documentation of generated C++ wrappers

Added "PREDEFINED" preprocessor macro definition in the Doxyfile.in in
order to make some adjustments for better documentation in the C++
generated headers.  Excluding generation of documentation for classes
in the "eo_cxx" namespace (the namespace for "abstract" eolian C++
wrappers).  Now generating the documentation for the events too.
Hiding some auxiliary code from being documented. Some aesthetic
adjustments for generated white space. Generate documentation for the
main constructor of C++ wrappers and added auxiliary grammars to list
parameters names.
2015-04-14 01:06:57 -03:00
Vitor Sousa 9eb19f8852 eolian_cxx: Declaring all inherited events on the concrete C++ wrapper
Added declaration of all inherited events on the concrete type to
avoid unnecessary type conversion on event callbacks.

Note that when two events happens to have the same name, only the
event of the derived class is declared in the concrete class. Access to
such events should be made through the base class type specification.

Fix on forwarding callback object (changed std::move to std::forward).

Additional line break at the end of event handling methods in the
generated headers to improve readability.
2015-04-14 01:06:57 -03:00
Vitor Sousa 666b0da912 eolian_cxx: Using eina::optional to handle parameters without @nonull property 2015-01-05 15:52:27 -02:00
Vitor Sousa 4222cd3f50 eolian_cxx: Fix compilation of inheritance from Eolian generated classes
Updated the code for the "inheritance helper" functions and classes
to be in conformance with the new wrapper architecture.

Member variable "parents" of efl::eo::eo_class struct was split in two
member variables, "ancestors" and "parents", the former containing all
Eo class ancestors and the later only the direct bases.
Changed all required files accordingly.

Check to avoid using biding string when the parameter is @out now matches
any variation of "char".

Add default constructor to efl::eo::concrete in order to allow it to be
NULL initialized in the "inheritance helper" classes.

Removed conflicting parent_set member function in the efl::eo::inherit
class.

Removed the "inheritance_extension_function" generator since it is no
longer used.
2015-01-05 15:52:27 -02:00
Vitor Sousa 6519ae6ed9 eolian_cxx: Fix "dreaded diamond" inheritance problem for C++ wrappers
Solved diamond inheritance problem by completely removing inheritance in
the abstract class.
All ancestors are inherited directly in the concrete class.
The algorithm that list the ancestors also avoid repetition.

Now concrete classes define methods too. This helps referring the correct
method directly by the object type (when there are methods with the same
name).

Moved the declaration and definition of constructor methods to the concrete
class, since they should not be used in derived classes.

Updated example that call "color_set".
With this model, if two ancestor classes have a method with the same name,
to call one of them from a derived class you must write the scoped name of
the member function in the wrapper.
In this case, either Evas.Object and Evas.SmartObject have a property
named "color".

Added "from_global" option to the full_name grammar too.
2015-01-05 15:52:27 -02:00
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
Vitor Sousa d5ec6c41d9 eolian_cxx: Fix: Using binding type for @out parameter instead of native type
No longer reverting to the native type when the parameter has "@out"
direction.

Added "is_out" member variable to eolian_type class.
With that, generators can keep track of the direction of the parameters.
Also added helper functions "type_is_out" and "type_is_complex".

Created "to_native" functions in eo_cxx_interop.hh to convert binding types
from C++ arguments to the actual C function arguments.
Added static assertions in these functions to enforce compatibility
between the binding and the native type (Required by @out parameters).

Reworked the overload of the "to_c" function for eo::base derivated
objects. Now there is a overload that rely in the compatibility
between the native type and the wrapper, enabling a wrapper to be used as
an output parameter.
2015-01-05 15:52:27 -02:00
Felipe Magno de Almeida 890ce1f9cf eolian-cxx: Fixed C++ conversion for lists
Signed-off-by: Vitor Sousa <vitorsousasilva@gmail.com>
2015-01-05 15:52:27 -02:00
Larry Jr dff706f123 added new types in lookup table
Signed-off-by: Vitor Sousa <vitorsousasilva@gmail.com>
2015-01-05 15:52:27 -02:00
Vitor Sousa 132abc3534 eolian_cxx: Fix Eolian C++ generated wrapper inconsistencies
In convert.cc: Reading functions instead of implements to convert the
Eolian_Class. It avoids creation of methods that do not belong to the
class, in special it avoids calling the default constructor twice in the
generated code.

No longer generating one constructor in the C++ wrapper for each eolian
class constructor, since the correct behavior demands that all constructor
should be called. Now the wrappers have "constructor methods" that
must be called when creating a new object.

Updated test cases and examples to match the new interface. Some class
constructors and some test cases have to be removed since they were based
on the wrong assumption that constructors are mutually exclusive.

Created new generators for forwarding parameters and for looping over
the relevant parameters to the C++ wrapper executing a generic lambda.

Added a TODO comment regarding the call of constructor methods of all
base classes. Currently there is no base type with constructors, so this
situation should be discussed more.

Added a TODO comment regarding the way callback parameters are being
processed.
2015-01-05 15:52:27 -02:00
Felipe Magno de Almeida 36405c6556 eolian-cxx: Fixed pointer dereferencing for Eolian types and constant propagation for C++ eina list containers
With the addition of pointer types, the eolian C++ generator now has
to dereference to get the base type which might be a complex type.
2014-10-08 22:28:51 -03:00
Savio Sena df7d02650b eolian-cxx: Add Eina_Bool* to type conversion table. 2014-09-30 17:41:41 -03:00
Savio Sena 13de9d089c eolian-cxx: Get rid of class_prefix and related code.
This patch fixes the use of eolian_function_full_c_name_get API also.
2014-09-25 16:09:40 -03:00
Savio Sena 991027ac9b eolian-cxx: Remove warnings during release compilation. 2014-09-16 19:17:57 -03:00
Savio Sena 6500c99669 eolian-cxx: Refactored eolian_cxx to cope with new Eolian API. 2014-09-12 16:50:09 -03:00
Savio Sena fa01f747a8 eolian-cxx: Added properties_get() wrapper.
Returns the list of all properties in a class.
2014-09-12 16:48:58 -03:00
Savio Sena c61bc0dec0 eolian-cxx: Added wrappers to handle Eolian_Implements. 2014-09-12 16:48:40 -03:00
Savio Sena cc70746d10 eolian-cxx: Added new wrappers to handle Eolian_Function.
function_is_constructor() and function_is_visible().
2014-09-12 16:47:51 -03:00
Savio Sena 5a7d60cb77 eolian-cxx: Added wrappers to handle Eolian_Constructor. 2014-09-12 16:47:07 -03:00
Savio Sena 753f6ab918 eolian-cxx: Make class_name() wrapper return lower-case string. 2014-09-12 16:44:47 -03:00
Savio Sena aef69a6a91 eolian-cxx: Refactored Eolian_Function functions
Renamed function_type to function_op_type and added function_type with
new semantics of returning if function is either regular or
class-function.
2014-09-12 16:42:51 -03:00
Savio Sena 3c90053091 eolian-cxx: Simply use find_replace instead of long form. 2014-09-12 16:41:33 -03:00
Savio Sena 8722d2b9a5 eolian-cxx: Clean-up.
Removed iterator_iterator, unused functions and reworded comments.
2014-09-12 16:39:47 -03:00
Daniel Kolesa b69b90832f eolian: remove constructors section cruft 2014-08-27 15:43:47 +01:00
Daniel Kolesa 0e873a260d eolian_cxx: very quick workaround to make tests compile again (needs fix) 2014-08-27 15:43:47 +01:00
Daniel Kolesa cdd4860520 eolian: turn db validation into separate API 2014-08-21 16:35:59 +01:00
Daniel Kolesa 452497eac5 eolian: remove a bunch of pointless stringshare refs + fix in lua 2014-08-21 09:26:05 +01:00
Daniel Kolesa 913e0f09fa eolian: get rid of the data hash in Eolian_Function 2014-08-21 09:26:05 +01:00
Daniel Kolesa 93726c86a3 eolian: get rid of eolian_parameter_information_get 2014-08-21 09:26:04 +01:00
Daniel Kolesa ad3dbe834b eolian: API refactoring
Remove eolian_implement_information_get. Also, fix some nasty lookup problems.
2014-08-21 09:26:04 +01:00
Daniel Kolesa 057e01d67f eolian: API refactoring
Start getting rid of the terrible _information_get APIs, starting with events.
2014-08-21 09:26:04 +01:00
Savio Sena 3b24c6ce91 eolian-cxx: Scan all files only when explicitly requested.
Fix T1463
2014-08-08 15:12:31 -03:00
Daniel Kolesa a3182948ad eolian: use libgen.h basename 2014-07-23 19:37:03 +01:00
Daniel Kolesa 315d5de11d eolian: use just filename (not path) for eolian_class_get_by_file 2014-07-23 17:15:00 +01:00
Daniel Kolesa 88cc1167e9 eolian: eolian_parameters_get -> eolian_function_parameters_get 2014-07-23 14:17:19 +01:00
Daniel Kolesa fd0210f30e eolian: list_get -> get, find_by -> get_by 2014-07-23 14:13:21 +01:00
Daniel Kolesa 8d775fc96d eolian_cxx: fix migration to iterators 2014-07-23 13:45:25 +01:00
Daniel Zaoui 0efeeaf1c0 Eolian: modify APIs to return iterators instead of lists.
The change affects the C and the C++ generators.
2014-07-23 13:45:25 +01:00
Savio Sena 721d8ca144 eolian-cxx: Oops. Fixing function_return_is_explicit_void the right way. 2014-07-21 22:56:31 -03:00
Savio Sena b3bd72cd11 eolian-cxx: Handle exclicitly void-return getters.
Whenever a getter explicitly defines a void return the generated code
shall not convert single-parameter getters in any ways.

Actually the correct approach would be to delegate all conversions to
Eolian Database instead of for the generators.
2014-07-21 22:13:54 -03:00