Commit Graph

90 Commits

Author SHA1 Message Date
Felipe Magno de Almeida 45e1ccf312 eolian-cxx: Remove EOLIAN_TYPE_POINTER enumeration 2016-11-10 15:20:36 -02:00
Felipe Magno de Almeida 137dd4864d eina-cxx: eolian-cxx: Fix correct usage of is_eolian_object traits 2016-11-03 17:59:20 -02:00
Carsten Haitzler 7d654b2065 fix build for c++ after eolian api change 2016-11-03 22:48:09 +09:00
Felipe Magno de Almeida dbed78ad3b eina-cxx: Moved variant to eina C++ 2016-09-14 00:33:22 -03:00
Felipe Magno de Almeida a63cfcafc7 eolian-cxx: Implement future template class for C++ 2016-09-11 23:44:05 -03:00
Lauro Moura 16986ffc7a eolian_cxx: Fix behavior with explicit void return
Only perform the single value/return type substitution on properties if the
void return type is implicit (i.e. NULL return from function_return_type_get),
following the eolian-C implementation as we use the generated headers.

Also update example after Eo-Efl changes.
2016-08-17 20:54:27 -03:00
Felipe Magno de Almeida f4a90dcde2 eolian-cxx: Fix compilation break from changes in Eo nomenclature
Rename of classes and function calls in generated code and C++ headers
2016-08-11 16:24:15 -03:00
Felipe Magno de Almeida 1c402f62a9 eolian-cxx: Fix generation for ref generic_values and Eolian classes 2016-07-05 16:32:11 -03:00
Felipe Magno de Almeida b09c1f8093 eolian-cxx: Added stringshare 2016-06-21 16:35:09 -03:00
Felipe Magno de Almeida b97a156ac4 eolian-cxx: Work with @inout parameter of void type 2016-06-16 21:48:07 -03:00
Felipe Magno de Almeida 9a407761bc eolian-cxx: Fix generation of non-inline function in headers 2016-06-15 17:49:56 -03:00
Felipe Magno de Almeida 136d0d684b eolian-cxx: Fix conversion to bool in clang 2016-06-15 17:49:56 -03:00
Felipe Magno de Almeida 3a7af71079 eolian-cxx: Fixed generation of implicit conversion operators 2016-06-15 15:50:04 -03:00
Felipe Magno de Almeida 8906998ef2 eolian-cxx: Add support for ref parameters and correct ownership handling 2016-06-14 22:44:02 -03:00
Jean-Philippe Andre c6dfdeb0c8 cxx: Add support for protected and beta events
The code is horrible, pardon my C++.

Note: I guess @protected should also change the scope from
public: to protected: but that's another problem. Here I'm only
trying to fix the build while still introducing @beta and
@protected flags.
2016-06-14 16:27:42 +09:00
Daniel Kolesa 33c147f6d4 eolian: remove the unnecessary subtypes API
Inner type can now be retrieved as a base type of the type.
If the type has two inner types or more, there is a new API that allows you to
get the second inner type by calling it on the first one (same would apply to
getting third via second etc.).

This API is simpler to use and doesn't require an iterator.
2016-06-10 14:28:19 +01:00
Lauro Moura 7b63ecf4f6 eolian_cxx: Fix build after scope_get changes 2016-06-09 18:53:31 -03:00
Felipe Magno de Almeida 343b88a735 eolian-cxx: Fix some C++ quirks that makes clang warn about 2016-06-08 12:55:19 -03:00
Felipe Magno de Almeida f683efd2c1 eolian-cxx: Fix generation of some primitive types
Fix translation of primitive types for C++ binding
2016-06-08 12:19:15 -03:00
Felipe Magno de Almeida 27429cf40b eolian-cxx: Fix compilation error on clang with const UDT initialization 2016-06-06 03:49:16 -03:00
Larry Jr 6680eca359 eolian-cxx: fix compilation errors an olders gcc 2016-06-06 03:30:42 -03: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 66dade5604 eolian-cxx: Removed useless commented code 2016-05-26 16:46:40 -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
Stefan Schmidt e981bfc4e8 cxx: follow eoid to eo_self rename in cxx generator and bindings
Bringing efl back to a building state with cxx enabled.
2016-03-16 21:11:17 +01:00
Tom Hacohen 72c6236038 Revert "cxx: Migrate C++ binding to the new eo_add syntax"
This reverts commit 48f62ad686.
2016-03-11 12:29:03 +00:00
Vitor Sousa 48f62ad686 cxx: Migrate C++ binding to the new eo_add syntax 2016-03-09 15:46:19 -03:00
Vitor Sousa 9cbda57bf0 eolian-cxx: Fix Eolian C++ constructing methods with new eo_add
Also fix Eolian C++ examples using the new "eo_super".
2016-03-03 16:05:40 -03:00
Felipe Magno de Almeida 5c7d78d104 eolian-cxx: Partial fix for generation without eo_do 2016-03-03 16:05:40 -03:00
Felipe Magno de Almeida d40b046685 eolian-cxx: Fix C++ events with new Eo_Event_Cb signature 2016-02-29 11:01:04 -03:00
Jean-Philippe Andre 050bd0adc8 Eolian Cxx: Fix warnings related to deprecated EO_EV_DEL
Switch the generator to EO_BASE_EVENT_DEL.
2016-01-22 15:35:23 +09:00
Felipe Magno de Almeida 13606c4647 eolian-cxx: Fixed assert which was a tautology
Fixed the assert to the correct check

@fix CID 1316018
2015-10-09 13:51:20 -03:00
Felipe Magno de Almeida c2132a0666 eolian-cxx: Fix inheritance from C++ classes after Eo ABI breakage
Fixed removal of op field from Eo_Op_Description and removed
unnecessary use of internal Eo API to implement the Eo API function
for theh constructor of the inherited class.
2015-09-30 17:55:16 -05:00
Tom Hacohen 37f84b7e96 Eo: Drop doc field from ops and events.
This hasn't been used for a while. Since we are going to break Eo a bit anyway
it's a good opportunity to drop this.

This may cause a slight performance issues with legacy events, such as
smart callbacks. This shouldn't really be a problem as we've migrated away from
them. If it does, we need to migrate the remaining parts. Only relevant
for callbacks that are added before the classes are created, which
shouldn't be possible except for smart, only for old evas callbacks.
2015-09-28 15:09:16 +01:00
Vitor Sousa 22094b6a27 eolian_cxx: Fix C++ generated inheritance wrappers
Summary:
Fix a bug that happens when a Eolian C++ wrapper have no default
constructor (because it have obligatory constructing methods) and it is
being used as a return of a inheritance wrappers.
Switched to a conversion of the native type as the default return, instead
of a value initialized wrapper.

Reviewers: q66, felipealmeida

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2769
2015-06-25 15:58:43 +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 a1b2358527 eolian_cxx: initialize all members in a struct correctly
Fixes CID 1298133.

@fix
2015-06-08 10:48:22 +01:00
Vitor Sousa 2c48b3212a eolian_cxx: Fix @beta on generated bindings for C++ 2015-05-12 15:51:31 +01:00
Felipe Magno de Almeida 5791065d29 Fix uninitialized member by coverity CID 1294558
Initialize the scope member in the default constructor.
2015-04-23 21:24:06 -03: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 09be34b825 eolian_cxx: fix build error for some generated C++ wrappers
Name generation for some C++ wrapper functions were adding an illegal ":"
in the function name.
Fixed the logical error that was causing this to happens when converting
namespaces to function prefixes.

@fix
2015-04-03 16:30:46 +02:00
Vitor Sousa 0ca8f7c718 eolian_cxx: Fix wrapper constructors by updating to the new eo_add_ref interface 2015-02-23 17:04:53 -03:00
Felipe Magno de Almeida c57fa54fc8 eolian-cxx: Fixed mixed inheritance between C and C++ classes
Removed genereation for Eo.Base primitive methods which segfault'ed
on parent_set function.
2015-01-05 18:59:09 -02: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
Larry Jr 2b12114777 allow C++ user create new classes inheriting from Eolian generated Classes 2015-01-05 15:52:27 -02:00
Vitor Sousa 0685885c2a eolian_cxx: Add implicit conversion of the returned pointer of C++ wrappers
Overloaded address-of operator for C++ Eolian wrappers for implicit converting
to any ancestor pointer type when getting the object memory address.

Added new grammars to aid the creation of the pointer wrappers
responsible of doing the implicit conversions.

Added a unit test which checks the address-of overload for arbitrary classes.
Added new .eo files to be used in it.
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