Commit Graph

342 Commits

Author SHA1 Message Date
Daniel Kolesa beacff7959 elua: add eolian_type_aliased_base_get to lua bindings 2015-11-19 13:19:22 +00: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
Stefan Schmidt b94f9254b1 bindings/eina_cxx: add eina_cxx group as link to main page to find API docs 2015-08-11 14:04:51 +02: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
Daniel Kolesa cd7a78f2a5 eolian: add API: eolian_declaration_get_by_name
Sorry for last minute new API, but this one is necessary to implement
proper verification of references in docs, which I would like to have
in 1.15. It allows you to retrieve any kind of declaration by full
namespace, so that you can check for an existence of an Eolian decl,
rather than checking every type individually.

@feature
2015-07-07 10:57:24 +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 51f49642b4 eolian: remove the outdated and ugly database printer (needs rework) 2015-06-17 14:26:07 +01:00
Daniel Kolesa cf2e94e11b elua: unexpose "old" documentation api from eolian bindings 2015-06-10 17:36:33 +01:00
Daniel Kolesa 944e9eb5b0 elua: bind recent eolian APIs to eolian lua api 2015-06-10 17:30:42 +01:00
Daniel Kolesa 934cfb621c eo_cxx: remove unused parameter 2015-05-29 11:10:41 +01:00
Tom Hacohen 52d998f475 Eo base: Remove the free_func parameter from key_data_set.
This was not really useful and against the Eolian guidelines.
While I promised I won't break things until the 27th, I was ill
(still am), so I'm giving myself a 1 day pass. :P
2015-05-28 17:47:59 +01:00
Daniel Kolesa 3aabb41d1d elua: make eo bindings work with the new generated format 2015-05-28 15:54:35 +01:00
Daniel Kolesa a7dea04b26 eolian: merge eo_file_parse and eot_file_parse 2015-05-22 17:32:21 +01:00
Vitor Sousa f45f3e9f13 eina_cxx, eldbus_cxx: Fix perfect forwarding of arguments
Summary:
Changed some std::move clauses to std::forward<Type> in order to allow
perfect forwarding.

@fix

Reviewers: felipealmeida, JackDanielZ, tasn, q66

Reviewed By: q66

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2508
2015-05-22 10:31:18 +01:00
Daniel Kolesa 54974b074b eolian: remove const_get/const_set support
This was made obsolete by per-accessor values. It was
also hacky and i've wanted to remove it for a while.
2015-05-20 18:05:45 +01:00
Daniel Kolesa 6b91b1bd12 eolian: allow keys/values in property get/set
Sometimes it is necessary to specify a different set of values for a
getter or a setter. This commit allows such specializations. This also
renders @const_get and @const_set useless (soon to be removed).

To function correctly, this required adjustment of several public APIs
as well as deprecation of eolian_function_parameter_get_by_name.

This function was not used in any generator and was pretty much
useless in the first place, so it was removed.

@fix
2015-05-20 17:42:44 +01:00
Daniel Kolesa 5c199857c9 eolian: distinguish between get/set for property keys/values retrieval 2015-05-20 17:03:37 +01:00
Daniel Kolesa 957a89168b eolian: precompute all enum field values (faster runtime, constness) 2015-05-13 18:10:02 +01:00
Daniel Kolesa d2365e6267 eolian: allow forced retrieval of enum field values 2015-05-13 17:57:03 +01:00
Daniel Kolesa ed58165b50 eolian: butts 2015-05-12 16:25:52 +01:00
Felipe Magno de Almeida eaa6961378 eina-cxx: Fix compilation error on clang
Clang implicitly deletes the default-constructor on range_ptrlist, which must be explicitly defined.
2015-04-14 01:06:57 -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 72604d4957 eina_cxx: Add methods to get an eina::accessor from an eina::ptr_array
eina::ptr_array was missing the methods to get an eina::accessor from it.
Added these methods.
2015-04-14 01:06:57 -03:00
Vitor Sousa 5619c6bc8d eina_cxx: Fix compatibility between eina::optionals of convertible types
Now an eina::optional that wraps a specific type can be constructed or
have content assigned to it using another eina::optional that wraps a
different type, provided that the two wrapped types are convertible
between each other.

Added "disengage" member function to be able to disengage a R-value
eina::optional of different contained type.
It also adds for increased convenience.

Fix constructing an engaged eina::optional from an disengaged one.

Fix small assertion problem of trying to construct an eina::optional
already flagged as engaged.

Fix incorrect use of std::move. Changed it to std::forward.

Added constexpr property for trivial constructors.

Added auxiliary function "make_optional".

Added unit test to check compatibility between eina::optionals of
convertible types.
2015-04-14 01:06:57 -03:00
Vitor Sousa 5043dcb830 eo_cxx: Fix signal_connection disconnect crash
Fixed crash when disconnecting event inside of its own event callback.
Instead of deleting the callback object immediately during disconnection
(which causes the callback to be freed), the deletion is now scheduled
for later (using ecore_main_loop_thread_safe_call_async).

Updated some Makefiles to proper include ecore now that it is used in
all event wrappers.

Added a unit test to verify crashes under these circumstances.
2015-04-14 01:06:57 -03:00
Vitor Sousa 3b441cdf4a ecore_cxx: Fix perfect forward of callback argument 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 be58d02cb6 eina_cxx: Add eina::string_view class (non owning reference to string)
Add an implementation of string_view to Eina C++. It is a non owning
reference to a string that allows lightweight argument passing of both
C++ std::string and C strings (const char*) on interfaces.
2015-04-14 01:06:57 -03:00
Cedric BAIL 1a6dfd76e7 eo_cxx: fix after change in internal function naming of Eo. 2015-04-03 16:22:06 +02:00
Daniel Kolesa e663773d9e elua: only check gettability in __index with no keys 2015-04-01 14:22:00 +01:00
Daniel Kolesa 34beed984d elua: clarify comments in eo.lua (explain how the property system works) 2015-04-01 14:20:08 +01:00
Daniel Kolesa c37f68ee46 elua: cast data, not cbs (data stores the cb id) 2015-03-19 15:01:16 +00:00
Daniel Kolesa 9ef2b35317 Revert "elua: more reliable eoid->lua number conversion"
This reverts commit 8bb13b626f.

Seems like this method is not so reliable after all :) Results
in precision loss for Eo IDs, so revert to the old hacky way.
2015-03-19 14:59:15 +00:00
Daniel Kolesa 0bd2fc15e9 elua: unexpose callback add/del events 2015-03-06 14:38:12 +00:00
Daniel Kolesa 8bb13b626f elua: more reliable eoid->lua number conversion 2015-03-06 14:36:25 +00:00
Daniel Kolesa e75cf0db13 elua: remove irrelevant comment 2015-03-06 14:29:37 +00:00
Daniel Kolesa bcc5ba83b3 elua: a func-to-idx cache for eo callbacks 2015-03-06 14:25:29 +00:00
Daniel Kolesa 00e2f5d882 elua: connect the del event on first callback connect 2015-03-04 10:32:16 +00:00
Daniel Kolesa 8eca257bf8 elua: connect del callback by default 2015-03-03 16:38:24 +00:00
Daniel Kolesa a8cfea6911 elua: better callback resource handling 2015-03-03 16:28:41 +00:00
Daniel Kolesa adbac89310 elua: implement callback disconnect + better error handling 2015-03-03 16:16:59 +00:00
Daniel Kolesa e55ecf6d4c elua: initial better callback system with indirection 2015-03-03 16:08:22 +00:00
Daniel Kolesa 4b01fd6298 elua: eo_class_addr_get -> eo_obj_addr_get 2015-03-03 15:59:16 +00:00
Daniel Kolesa c0e20c0c3d elua: callback stubs for basic event handling 2015-03-03 15:43:02 +00:00
Daniel Kolesa c9c13bd650 elua: callback updates in eo bindings
Priority is now supported. Some initial infra for disconnect
has been added.
2015-03-03 15:30:35 +00:00
Daniel Kolesa 34387cfba4 elua: unregister all classes on eo.lua shutdown 2015-03-03 14:05:55 +00:00
Daniel Kolesa 72b26fd49b elua: minor eo bindings optimization 2015-02-26 17:07:33 +00:00
Daniel Kolesa b4dee8db54 elua: update eo bindings for lualian generated code 2015-02-26 15:36:15 +00:00
Daniel Kolesa 212571c406 elua: guarantee multiple inheritance availability on any object 2015-02-25 15:11:52 +00:00
Daniel Kolesa 7806e79024 elua: better mixin behavior (+ fix bad lookup) 2015-02-25 14:01:45 +00:00
Daniel Kolesa f0bf599435 elua: slightly less broken mixin behavior 2015-02-25 12:09:16 +00:00
Daniel Kolesa 4301690535 eolian: add APIs for nullable/optional (+ lua bindings) 2015-02-12 13:24:06 +00:00
Daniel Zaoui d95224b5a7 Eo: add function name to the eo_do pre and post hooks.
This is useful to determine the Eolian class/function.
2015-01-11 16:28:44 +02:00
Daniel Kolesa f58f59d635 elua: convert some eolian binding API results to numbers
This might fix some bugs and is the right thing to do anyway.
2015-01-09 15:45:03 +00: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 b713342987 eina_cxx: Allow creating an eina::optional<T> from a type convertible to T 2015-01-05 15:52:27 -02:00
Vitor Sousa 11eff05ead eo_cxx: Implicit conversion from C++ wrapper to void* via address_of operator 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 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
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
Vitor Sousa 2b94d874fe eo_cxx: Fix leakage of eo objects by removing unnecessary "eo_ref"
Removed the call to eo_ref in the conversion from eo::base to the native
Eo* (in "to_c" function) in order to avoid eo objects being leaked.
2015-01-05 15:52:27 -02:00
Vitor Sousa fb5ba0f758 eina_cxx: Fix eina::array cend method recursive calling itself
@fix
2015-01-05 15:52:27 -02:00
Vitor Sousa ee81566ac8 eina_cxx: Fix eina::accessor for C++ Eo wrappers
Created a specialization of the eina::accessor for C++ Eo wrappers.

Created an override of the "accessor" methods in the eina::list specialization
for Eo wrappers (in eina_list.hh). It is necessary to create accessors with the
correct type.

Created specializations of std::is_base_of to avoid compilation errors related
with _Eo_Opaque type.

Added new test cases in "eina_cxx_test_accessor.cc" to test the accessor
specialization.

Added efl::eina::eina_init to the existing test cases to correctly do the
on demand initialization required by the tests.

@fix
2015-01-05 15:52:27 -02:00
Vinícius dos Santos Oliveira 5a2ac0c42f [eina-cxx] fix: wrong parameter type preventing the use of copy ctor
"Eina_Stringshare *" type is interchangeable with "const char *".
The "stealing" constructor from efl::eina::stringshare was incorrectly
using "char *" instead "const char *", preventing it from being used.
2015-01-04 17:56:53 -02:00
Daniel Kolesa 67c693eff1 elua: support is_c_only in lualian 2014-12-03 15:27:38 +00:00
Daniel Kolesa dc081b10e7 elua: update eolian bindings 2014-11-28 12:59:06 +00:00
Jean-Philippe ANDRE 72a3ec3fa0 Eolian lua: Fix typo in function name 2014-11-27 00:46:47 +09:00
Daniel Kolesa 3b59913b9a elua: update eolian bindings 2014-11-20 17:16:04 +00:00
Felipe Magno de Almeida 8240676b01 [eina-cxx] Fixed EFL_CXX_THROW not defined
Fixed errors of EFL_CXX_THROW not defined when #include'ing specific
eina C++ headers.
2014-10-23 18:06:13 -02:00
Felipe Magno de Almeida 7acdf2b1dd [cxx] Fixed eina::value get for string
The get function for string in eina::value wronfully was freeing the
string returned from eina_value_get. Which crashed applications that
used it.
2014-10-23 17:39:12 -02:00
Daniel Kolesa 54d7fed7b6 elua: handle event/property mixins correctly in eo 2014-10-17 16:14:49 +01:00
Daniel Kolesa 9e770c06be elua: complete property handling in eo bindings (getters, setters, keys, vals) 2014-10-17 15:54:47 +01:00
Daniel Kolesa 8414846142 elua: ffi.string in method calls is bad... reduce allocs 2014-10-17 14:56:44 +01:00
Savio S. Machado 0ca819974c eo-cxx: Replace C++ throw with EFL_CXX_THROW. 2014-10-13 07:45:34 -03:00
Daniel Kolesa 1e55e26422 elua: properly hook up gc so that eo objects are unref'd in C when collected 2014-10-10 15:44:49 +01:00
Daniel Kolesa 4c418e61cc elua: fix eo callback return 2014-10-10 14:46:50 +01:00
Daniel Kolesa 2863c51edd elua: very basic event support in eo bindings 2014-10-10 13:58:04 +01:00
Daniel Kolesa 9cb6ccf686 elua: initial, restricted support for property syntax and property/event inheritance 2014-10-10 13:48:25 +01:00
Savio S. Machado 1bea224203 eina-cxx: Replace throws with EFL_CXX_THROW. 2014-10-09 14:13:35 -03: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 1a6013e959 eo-cxx: Add static assert to check boolean size. 2014-10-03 15:05:51 -03:00
Daniel Kolesa 915f3a3424 elua: update eo bindings 2014-10-02 15:04:02 +01:00
Daniel Kolesa 99803b013f elua: generate the object ctor function 2014-10-02 14:55:30 +01:00
Daniel Kolesa 8a9c3a028e eolian: call the methods/properties from constructors directly for now 2014-10-02 14:40:58 +01:00
Daniel Kolesa a2bde0bf96 eolian: new API: eolian_class_c_get_function_name_get
This allows bindings to easily retrieve name of the C function used to
retrieve the Eo_Class. Also, update the Lua Eolian bindings and generator.
2014-10-02 11:00:06 +01:00
Daniel Kolesa 990cf6651a elua: update eo lua API against generated lualian output 2014-10-02 10:41:30 +01:00
Savio Sena ced2163b29 eolian-cxx: Reinterpret cast instead. 2014-09-30 18:53:23 -03:00
Savio Sena 8671a8d8e2 eolian-cxx: Add Eina_Bool* also to C++ interop. 2014-09-30 18:08:06 -03:00
Savio Sena b551593087 eo-cxx: s/eo_add/eo_add_ref/ in efl::eo::inherit. 2014-09-29 15:16:07 -03:00
Savio Sena e9e2344982 eolian-cxx: Replace old eo_add with eo_add_ref.
eo_add_ref behaves like the old eo_add.
2014-09-26 18:56:41 -03:00
Savio Sena 684617cfdc eo-cxx: Get rid of eo_add_custom. 2014-09-25 16:11:03 -03:00
Daniel Kolesa fc40591f11 elua: update eolian bindings and generator 2014-09-25 15:53:42 +01:00
Daniel Kolesa 15d9fec0e0 elua: class unregister + keep track of Eo_Class 2014-09-24 13:49:58 +01:00
Daniel Kolesa 85a135d32e elua: remove the eo_methods stuff, improve class registration 2014-09-24 13:37:26 +01:00
Daniel Kolesa 0061d5a437 elua: Eo metatype with method table redirection 2014-09-24 11:51:27 +01:00
Daniel Kolesa 92d39a9ed9 elua: ad the rest of Eo APIs to ffi cdef 2014-09-24 11:10:08 +01:00
Daniel Kolesa cc1a5149fe elua: add some more eo APIs to ffi cdef 2014-09-24 10:39:47 +01:00
Stefan Schmidt c2eb17325c docs/eina_cxx: Add main landing page for Eina C++ documentation 2014-09-19 15:27:33 +02:00
Savio Sena eea43ec144 eo-cxx: Added _reset() to efl::eo::base. 2014-09-15 18:54:13 -03:00
Savio Sena b2d8a216f1 eina-cxx: Added EFL_CXX_NO_EXCEPTIONS flag.
This flag allows one to compile Eina++ replacing C++ exceptions with a
call to abort().

Please use EFL_CXX_THROW() macro instead of C++ throw() from now on.
2014-09-12 16:09:28 -03:00
Savio Sena bbb570d4db eo-cxx: Use new Eo API in efl::eo::inherit.
_eo_call_resolve() now gets "is_main_loop" argument.
2014-09-12 15:56:34 -03:00
Savio Sena 7578dd4a55 eina-cxx: Removed unecessary eo_refs.
eo_clone_allocator already handles that.
2014-09-12 15:28:23 -03:00
Daniel Kolesa 599bee0553 elua: update eolian bindings to latest version 2014-09-09 16:30:46 +01:00
Daniel Kolesa cdd4860520 eolian: turn db validation into separate API 2014-08-21 16:35:59 +01:00
Daniel Kolesa 6abb6e4adc eolian: remove comma 2014-08-21 09:26:05 +01:00
Daniel Kolesa c85a805d91 elua: eolian binding fix 2014-08-21 09:26:05 +01:00
Daniel Kolesa 44ffdf340c elua: update eolian bindings 2014-08-21 09:26:05 +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 33c39282b1 eolian: support "eo: null;" for legacy only functions/properties 2014-08-21 09:26:05 +01:00
Daniel Kolesa bbdb655bdb elua: update lualian 2014-08-21 09:26:05 +01:00
Daniel Kolesa fd28d213a7 elua: update eolian bindings 2014-08-21 09:26:05 +01:00
Daniel Kolesa 3636f5c9a8 elua: make generator work again
Also adds to_array API to Lua eina iterators.
2014-07-25 17:11:20 +01:00
Daniel Kolesa b354b3e69d elua: update eolian bindings 2014-07-25 16:54:32 +01:00
Savio Sena d0b09ea0df eo-cxx: Added _release to efl::eo::inherit.
Just like previously added in efl::eo::base.
2014-07-24 19:52:23 -03:00
Savio Sena 425f220f92 eo-cxx: Added generic parent_type and parent_set.
This allows us to use any type implementing _eo_ptr() with the parent
idiom "efl::eo::parent = obj" and also with efl::eo::inherit parent_set.
2014-07-24 19:52:23 -03:00
Savio Sena 82af4fb19d eo-cxx: Fixed return of the assignment operator. 2014-07-21 19:57:52 -03:00
Felipe Magno de Almeida 83db6524ba eldbus-cxx: Used inner braces for initialization of inner struct
This removes lots of warnings when compiling with clang.
2014-07-18 19:23:43 -03:00
Felipe Magno de Almeida 7af91ee8fa eo-cxx: Added support for returning-void function objects 2014-07-18 18:57:14 -03:00
Felipe Magno de Almeida 1848d39588 eo-cxx: Removed the necessity of copying for interoperability of containers 2014-07-18 18:57:14 -03:00
Felipe Magno de Almeida c4faec118e eina-cxx: Added move-constructors to lists 2014-07-18 18:57:14 -03:00
Felipe Magno de Almeida df1c03b56b eo-cxx: Added default-constructor to wref type 2014-07-18 18:57:14 -03:00
Felipe Magno de Almeida e256a92eb1 eina-cxx: Added range_list to range types for eina-cxx
Added range_list which abstracts a ptr_list for wrapper types.
2014-07-18 18:57:14 -03:00
Felipe Magno de Almeida df5f57d0ad eo-cxx: Added catch-all to_c interoperability function 2014-07-18 18:57:14 -03:00
Felipe Magno de Almeida 10502307a7 eina-cxx: Fixed includ'ing list and array containers and fixed constructor
Added include for eina_list and eina_array for Eina.hh and fixed the
eina_ptrlist constructor receiving a raw Eina_List*.
2014-07-18 18:57:14 -03:00
Savio Sena b9c30eac71 eo-cxx: Fixed duplicated constructors. 2014-07-18 18:57:13 -03:00
Felipe Magno de Almeida bde4b6e9df eolian-cxx: Added eo_base extension_inheritance
Added eo::base as a partial specialization for extension inheritance,
since eo::base is not generated.
2014-07-18 18:57:13 -03:00
Felipe Magno de Almeida 377bb449ba eolian-cxx: Added empty wrapper constructor
Added empty wrapper constructor to generation from std::nullptr_t and
allowed efl::eo::base to be empty with proper copy-constructors and
assignment operators.
2014-07-18 18:57:13 -03:00
Savio Sena 78e396ac19 eolian-cxx: Initial version of complex types / callbacks / events implementation. 2014-07-18 18:57:13 -03:00
Savio Sena 256e21d939 eina-cxx: Added interop containers. 2014-07-18 18:55:56 -03:00
Felipe Magno de Almeida 835b8756ec Fixes ABI breakage in Eldbus for use with C++ Eldbus
Summary:
This fixes the breakage when Eldbus_Service_Interface_Desc added a
wrongfully methods2 field to a class that is allocated by the user.

This patch adds the respective eldbus_service_interface_register2 and
eldbus_service_interface_fallback_register2 for registration of
Eldbus_Service_Interface_Desc2 which is now versioned. So future the
functions can be backwards compatible and the struct be forward
compatible and leaves the Eldbus_Service_Interface_Desc and
eldbus_service_interface_register and
eldbus_service_interface_fallback_register intact as it was in EFL
1.10.

This fixes T1408

Reviewers: cedric, stefan_schmidt, raster

Reviewed By: raster

Subscribers: cedric

Maniphest Tasks: T1408

Differential Revision: https://phab.enlightenment.org/D1188
2014-07-15 08:01:14 +09:00
Daniel Kolesa 10ea6e9f0f elua: use the type API in lualian (but only basics of it) 2014-07-14 16:08:31 +01:00
Daniel Kolesa 30e8d8a735 elua: make the lua generator generate things again - type stuff will need re-work 2014-07-14 15:37:32 +01:00
Daniel Kolesa c548981046 elua: update eolian bindings and add Ptr_Iterator and String_Iterator common objects to eina iterator module 2014-07-14 15:16:46 +01:00
Felipe Magno de Almeida 1baf9e4825 eldbus: Fixes ABI break in Eldbus_Method with appended void* data
Summary:
Removed the void* data variable from Eldbus_Method and created another
struct that has the void* data and added an array of Eldbus_Method2 in
the descriptor for the Eldbus_Service_Interface_Desc and making the
appropriate modifications in the implementation to use both
descriptions.

Reviewers: cedric, stefan_schmidt, raster

CC: cedric

Maniphest Tasks: T1408

Differential Revision: https://phab.enlightenment.org/D1139
2014-07-08 11:57:08 +09:00
Savio Sena 4e6825d6ac eolian-cxx: Removed Wshadow warnings.
Summary:
Removes Wshadow warnings by prepending/appending radices to
the target variables and parameters.

Reviewers: felipealmeida

CC: cedric

Differential Revision: https://phab.enlightenment.org/D1118
2014-07-04 20:04:32 -03:00
Felipe Magno de Almeida 30df128be5 eldbus-cxx: Implementation of eldbus C++ API
Summary:
Applications can:

  void method_callback(void* data, const Eldbus_Service_Interface* iface,
                       const Eldbus_Message* message);
  struct { ... } data_struct;

  Eldbus_Method methods[] =
   {
     "method1", ELDBUS_ARGS("b", "bool"), ELDBUS_ARGS("b", "bool"), ELDBUS_METHOD_FLAG_HAS_DATA
     , (Eldbus_Method_Cb)&method_callback, &data_struct
   };

   And method_callback will be called with data parameter pointing to data_struct global object.

Also, Eldbus-cxx supports registering an interface passing a lambda or
function object as method. For example:

  edb::service_interface iface = edb::service_interface_register
    (c, path, interface
     , es::method("SendStringAndBool"
                  , [expected_string, expected_bool] (std::string const& n, bool b
                                                      , bool* out)
                  {
                    std::cout << "Running SendStringAndBool" << std::endl;
                    ck_assert(n == expected_string);
                    ck_assert(b == expected_bool);
                    *out = b;
                    return n;
                  }
                  , es::ins<std::string, bool>("string", "bool")
                  , es::outs<std::string, bool>("string", "bool")
                  )
    );

When a request for "SendStringAndBool" with the proper signature is
called, executes the lambda and replies with the return value and
its bool* out parameter value.

Reviewers: cedric, woohyun, raster

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D1052
2014-07-03 16:28:23 +09:00
Daniel Kolesa d870125231 elua: use the new dedup API in lualian 2014-06-30 17:20:07 +01:00
Daniel Kolesa ac22afec8a elua: update lualian against latest changes 2014-06-30 17:20:06 +01:00
Daniel Kolesa 7ea7542e9e elua: eo_prefix fix + add method name deduplication to lua generator 2014-06-23 14:16:12 +01:00
Daniel Kolesa 471b4435b4 elua: eo_prefix_get will always return a valid value 2014-06-23 14:05:50 +01:00
Savio Sena 656d280e6a Eina-Cxx: Added native type constructors and examples.
Summary:
This patch allows us to construct efl::eina:: types from
their respective C types.

Reviewers: cedric, felipealmeida, q66

Reviewed By: q66

CC: smohanty, woohyun, raster, cedric

Differential Revision: https://phab.enlightenment.org/D1068
2014-06-20 01:00:14 +01:00
Felipe Magno de Almeida f5c4481be8 eina-cxx: fix compilation error on clang
Summary:
Fixed compilation error on clang when std::vector<char>::iterator and
std::string::iterator are the same type in type_traits for contiguous
traits optimization.

@fix

Reviewers: MagikBSD, tasn, cedric, raster, savio, woohyun

Reviewed By: tasn

CC: cedric

Maniphest Tasks: T1328

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

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
2014-06-12 17:34:22 +02:00
Felipe Magno de Almeida b1eccf2993 eina-cxx: fix compilation error on clang in eina_thread.hh
Summary:
Fixed compilation error for using std::hash without #include'ing
<functional>

@fix

Reviewers: MagikBSD, tasn, cedric, raster, woohyun

CC: savio, cedric

Maniphest Tasks: T1328

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

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
2014-06-12 02:12:42 +02:00
Daniel Kolesa 6df8766b6a elua: some janitoring (add newlines to the end of files) 2014-06-10 15:48:53 +01:00
Daniel Kolesa c6e5d8d002 elua: return the value properly in eo 2014-06-10 15:48:53 +01:00