Commit Graph

60 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
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
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
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 a7dea04b26 eolian: merge eo_file_parse and eot_file_parse 2015-05-22 17:32:21 +01: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 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
Savio Sena 6500c99669 eolian-cxx: Refactored eolian_cxx to cope with new Eolian API. 2014-09-12 16:50:09 -03:00
Daniel Kolesa cdd4860520 eolian: turn db validation into separate API 2014-08-21 16:35:59 +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 fd0210f30e eolian: list_get -> get, find_by -> get_by 2014-07-23 14:13:21 +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
Felipe Magno de Almeida 2ff390e087 Changed uses of std::abort to assert's with better description 2014-07-18 18:57:14 -03:00
Tom Hacohen 076d816364 Eolian generator: Disable system dir scan.
This was causing trouble for cross compilation.

Thanks to q66 for the fix and cedric for reporting.
2014-07-17 16:07:57 +01:00
Savio Sena 012b586c8b eolian-cxx: Pass references instead of pointers.
Fix Eolian-Cxx API to pass references instead of pointers.
2014-07-09 15:55:24 -03:00
Daniel Kolesa 96eaaaf074 eolian: refactoring step two
Move from all instances of Eolian_Class to Eolian_Class*.
2014-07-09 16:33:19 +01:00
Daniel Kolesa 5168297fdb eolian: new API: eolian_system_directory_scan, use it 2014-07-07 16:48:54 +01:00
Daniel Kolesa c05493b480 eolian-cxx: Added namespaces and more (see below)
Implemented namespaces
Added eolian_wrappers.hh with C++ code wrapping Eolain API
Changed eolian_cxx program options. Now they're eolian_gen's
Added functions to safe_str.hh (safe_lower, safe_upper, normalize_spaces, path_base)
Added a mocked version of type_lookup.hh in advance. The full
version will come as soon as complex-types are added.

Made apply again by Daniel Kolesa, original implementation by Savio Sena.
2014-06-30 19:35:06 +01:00