Commit Graph

808 Commits

Author SHA1 Message Date
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
Daniel Kolesa f395e861fb elua: make it possible to get class lua body from address 2014-06-10 15:48:53 +01:00
Daniel Kolesa ff519ccc4a elua: move __ctor_common, __do_start, __do_end out of the object (as it's effectively empty now, it can be generated) 2014-06-10 15:48:53 +01:00
Daniel Kolesa 3e65deabf8 elua: remove the implemented eo_base stuff - will be generated 2014-06-10 15:48:53 +01:00
Daniel Kolesa 4b3c7190ca elua: use eo_finalize plus update bound eo api 2014-06-10 15:48:53 +01:00
Daniel Kolesa 65bf6cd6ac elua: do not generate entirely new list types 2014-06-10 15:48:53 +01:00
Daniel Kolesa 22d03089fc elua: a simple list type generator in eina_list 2014-06-10 15:48:53 +01:00
Daniel Kolesa aeaadae1fe elua: eolian fix 2014-06-10 15:48:53 +01:00
Daniel Kolesa 39cdde7280 elua: prevent method calls on bad objects 2014-06-10 15:48:53 +01:00
Daniel Kolesa b665bdbd8a elua: eolian binding fix plus support namespaces in the lualian generator 2014-06-10 15:48:53 +01:00
Daniel Kolesa 272a96de42 elua: update eolian implements api 2014-06-10 15:48:52 +01:00
Daniel Kolesa 6614d02a69 elua: update lualian against latest eolian API 2014-06-10 15:48:52 +01:00
Daniel Kolesa 8c047b6170 elua: support for eolian typedefs, unfrotunately it's just a stub for now as eolian typedefs haven't been landed in master yet 2014-06-10 15:48:50 +01:00
Daniel Kolesa 69ae66e083 elua: remove some superfluous fields in eolian bindings 2014-06-10 15:48:50 +01:00
Daniel Kolesa e90973e5cb elua: eolian fix (return nil instead of null in type_information_get), generate different names for type conversion funcs 2014-06-10 15:48:49 +01:00
Daniel Kolesa 6da958d462 elua: initial support for complex types in lualian plus bug fixes 2014-06-10 15:48:49 +01:00
Daniel Kolesa 19c87a870e elua: cover the new eolian APIs 2014-06-10 15:48:49 +01:00
q66 e7ed8b08f9 elua: lualian can now query type information 2014-06-10 15:48:49 +01:00
q66 c593e67306 elua: lualian now has access to types 2014-06-10 15:48:49 +01:00
q66 61b7fd28b8 elua: start support for eolian complex types 2014-06-10 15:48:49 +01:00
q66 425f551e85 elua: minor update 2014-06-10 15:48:48 +01:00
q66 53f9a93328 elua: update against eolian API 2014-06-10 15:48:48 +01:00
Daniel Kolesa cefd51b955 elua: adjust module system for injection into loaded table nad preload, lualian can now inject inside of existing modules 2014-06-10 15:48:48 +01:00
Daniel Kolesa 3f70a9a79e elua: respect possible retval from ctor 2014-06-10 15:48:48 +01:00
Daniel Kolesa c68a73d6e2 elua: cleanup 2014-06-10 15:48:48 +01:00
Daniel Kolesa 15e1702290 elua: fix accidental garbage collection of log domains 2014-06-10 15:48:48 +01:00
Daniel Kolesa dca8afb2cc elua: rename eo __ctor to __tor_common (so that it's not automatically called with no ctor provided) 2014-06-10 15:48:48 +01:00
Daniel Kolesa 2cb887be13 elua: bindings fixes, lualian can now generate properties correctly (doesn't perform type conversions yet) 2014-06-10 15:48:48 +01:00
Daniel Kolesa 567ff9f0b3 elua: fixes and more lualian stuff 2014-06-10 15:48:47 +01:00
Daniel Kolesa aae4567b4d elua: eina bindings fixes, include support in lualian 2014-06-10 15:48:47 +01:00
Daniel Kolesa b930c9c432 elua: property support in object system, lualian progress, initial (incomplete) eo bindings 2014-06-10 15:48:47 +01:00
Daniel Kolesa 2ba2b1f6bf elua: initial code for lualian, a luajit binding generator based on eolian 2014-06-10 15:48:47 +01:00
Daniel Kolesa 78a9fee179 elua: more fixes 2014-06-10 15:48:47 +01:00
Daniel Kolesa 08e0fea8ca elua: list and readonly object fixes 2014-06-10 15:48:47 +01:00
Daniel Kolesa 6f7f03daf9 elua: gitignore 2014-06-10 15:48:47 +01:00
Daniel Kolesa 588d06d157 elua: fixes 2014-06-10 15:48:47 +01:00
Daniel Kolesa 1d330fb7d5 elua: list iterator/accessor access 2014-06-10 15:48:47 +01:00
Daniel Kolesa 99e0bcbe4c elua: fix eolian defs 2014-06-10 15:48:47 +01:00
Daniel Kolesa 799a394285 elua: wrap iteration functions in closures for extra encapsulation 2014-06-10 15:48:47 +01:00
Daniel Kolesa 9bd9a455f9 elua: safe iterators 2014-06-10 15:48:47 +01:00
Daniel Kolesa b052ef53e3 elua: list equality 2014-06-10 15:48:47 +01:00
Daniel Kolesa c0a0fd318f elua: safe accessors 2014-06-10 15:48:47 +01:00
Daniel Kolesa 6c8fc0a87e elua: add Readonly_Object to util.lua (its instances are read only userdata, requires special care, but is not intended for the user), use it in List 2014-06-10 15:48:47 +01:00
Daniel Kolesa 3ff1633180 elua: bindings for eina_accessor, accesor support in eina_list bindings, iterator updates 2014-06-10 15:48:47 +01:00
Daniel Kolesa f4d34ce1ab elua: pointers won't work with metatypes and these types are opaque anyway 2014-06-10 15:48:47 +01:00
Daniel Kolesa 134e871f4b elua: eolian bindings, string list 2014-06-10 15:48:47 +01:00
Daniel Kolesa 0cfc75eb1c elua: provide a conversion method from list to table 2014-06-10 15:48:47 +01:00
Daniel Kolesa f55ade5689 elua: typo fix 2014-06-10 15:48:47 +01:00
Daniel Kolesa 2d0be0a015 elua: simple bindings to Eina_List (cannot be used raw conveniently, and is safe because it doesn't allow any writing to the list) 2014-06-10 15:48:47 +01:00
Daniel Kolesa f3c0072c13 elua: use ffi.errno 2014-06-10 15:48:47 +01:00
Daniel Kolesa 210cfb81e2 elua: use standard error() call instead of returning true/false in module init 2014-06-10 15:48:47 +01:00
Daniel Kolesa bce656b93f elua: benchmark module, plus return values for init/shutdown 2014-06-10 15:48:47 +01:00
Daniel Kolesa 4b5b051dfa elua: leftover code 2014-06-10 15:48:47 +01:00
Daniel Kolesa b58888e0cd elua: eina_counter bindings 2014-06-10 15:48:47 +01:00
Daniel Kolesa 8fe7eb5381 elua: eina_hamster for luajit, oh yeah 2014-06-10 15:48:47 +01:00
Daniel Kolesa 9e00121fa4 elua: when using file module's map_all or map_new, prefer a copy by default (safer) but allow also raw with a parameter; and unmap if we're doing a copy 2014-06-10 15:48:47 +01:00
Daniel Kolesa 957e61c518 elua: complete xattr bindings 2014-06-10 15:48:46 +01:00
Daniel Kolesa d937e43d4a elua: complete eina_file bindings 2014-06-10 15:48:46 +01:00
Daniel Kolesa 3542c13074 elua: more file bindings, initial xattr bindings 2014-06-10 15:48:46 +01:00
Daniel Kolesa 0398788df9 elua: bind more of eina_file 2014-06-10 15:48:46 +01:00
Daniel Kolesa da9fbe677f elua: initial eina_file bindings, iterator container retrieval support and cleanup of main.c 2014-06-10 15:48:46 +01:00
Daniel Kolesa e6278f346f elua: better iterator naming 2014-06-10 15:48:46 +01:00
Daniel Kolesa 258b6347b7 elua: bindings for eina_tiler plus iterator improvements 2014-06-10 15:48:46 +01:00
Daniel Kolesa 6fe5d100f0 elua: done binding eina_rectangle (all inline funcs rewritten) 2014-06-10 15:48:46 +01:00
Daniel Kolesa 5aedc8c722 elua: initial rectangle mdule and iterator fixes/cleanups 2014-06-10 15:48:46 +01:00
Daniel Kolesa 155eae24e1 elua: safe iterators using ffi metatypes 2014-06-10 15:48:46 +01:00
Daniel Kolesa 79d7663e8b elua: iterator bindings (for use by other modules, will probably become private) 2014-06-10 15:48:46 +01:00
Daniel Kolesa 0b7fd25b16 elua: typo 2014-06-10 15:48:46 +01:00
Daniel Kolesa 008925aa32 elua: allow setting of default domain 2014-06-10 15:48:46 +01:00
Daniel Kolesa dcd2b6166b elua: more logging functionality (utility funcs for default domain printing) 2014-06-10 15:48:46 +01:00
Daniel Kolesa 3af66c7f65 elua: safe logging within sandbox 2014-06-10 15:48:46 +01:00
Daniel Kolesa 68de26604c elua: start binding Eina
Added initial eina logging module, added library handling utility funcs in util.lua, added .gitignores
2014-06-10 15:48:46 +01:00
vitor.sousa 0902b6a6f8 eina_cxx: add documentation to the Eina C++ header files.
Summary:
Added documentation to almost all classes that are intended for direct use by the library users.
Marked classes/functions used by the library itself as @internal.
Modified the Doxyfile.in to enable the generation of documentation to the bindings.

Reviewers: felipealmeida, cedric, woohyun, smohanty, raster

CC: savio, cedric

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

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
2014-06-04 22:34:47 +02:00
Tom Hacohen d9263e6571 Eo base: rename event_freeze_get to event_freeze_count_get.
This is needed because of a possible clash between the method event_freeze
and the property event_freeze with bindings.
2014-06-02 12:50:23 +01:00
Vitor Sousa b5718761b9 C++11 explicit conversion from accessor to bollean
Summary:
Replaced the "safe bool idiom" by explicit conversion to bollean,
in order to follow the improved conventions of the C++11.

Reviewers: felipealmeida, cedric, woohyun, smohanty, raster

Reviewed By: raster

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D903
2014-05-28 17:54:01 +09:00
Vitor Sousa 062c08fbab Correction for the macro EINA_CXX_DOM_LOG
Summary: The previous definition of EINA_CXX_DOM_LOG could cause a problem if used inside an one-line "if" statement followed by an "else". Changed the top "if" by a "for" statement to avoid this problem.

Reviewers: felipealmeida, cedric, woohyun, smohanty, raster

Reviewed By: raster

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D902
2014-05-28 17:51:14 +09:00
Vitor Sousa a9f58d0d13 Fixed rbegin/rend implementation on the Eina C++ ranges.
Summary:
Fixed the rbegin/rend functions returning switched reverse iterators.
Added code to some unit tests for comparing elements in reverse order, in interest of
checking the correctness of the rbegin/rend functions.

Reviewers: felipealmeida, cedric, woohyun, smohanty, raster

Reviewed By: felipealmeida

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D901
2014-05-28 17:49:06 +09:00
Savio Sena e68225ae69 eina-cxx: remove a warning.
Summary: When assert is disabled 'diff' variable was unused.

Reviewers: tasn, cedric

CC: JackDanielZ, smohanty, felipealmeida, cedric

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

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-24 02:24:46 +02: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
Felipe Magno de Almeida 64c6c63725 eina-cxx: add eina_integer_sequence, eina_optional and their tests.
Summary: eina::optional mimics C++14 std::optional behavior and semantics.

Reviewers: felipealmeida, cedric, smohanty, woohyun, raster

CC: cedric

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

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-03 00:53:31 +02:00
Savio Sena 98efcdcd63 eet-cxx: remove unused typedef.
Summary: This patch removes warnings.

Reviewers: cedric, smohanty, felipealmeida

CC: cedric

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

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-02 08:19:02 +02:00
Savio Sena 1cec8103c7 eina_cxx: fix a bug in efl::eina::range_inlist constructor.
Summary: Fixes const propagation of range_inlist.

Reviewers: cedric, raster, seoz, raoulh, Andreas, smohanty

CC: felipealmeida, cedric

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

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-04-26 16:26:38 +02:00
Felipe Magno de Almeida 6bb01b0d18 eina-cxx: Modified eina C++ log use syntax
Summary:
Modified syntax for eina C++ log to imitate the macro call as returning a stream. So, instead of:

  EINA_CXX_DOM_LOG_CRIT(efl::eina::global_domain, "foo " << 5);

It is now used as:

  EINA_CXX_DOM_LOG_CRIT(efl::eina::global_domain) << "foo " << 5;

Which more closely resambles using IOStreams in C++.

@feature

Reviewers: cedric, barbieri, smohanty

Reviewed By: barbieri

CC: cedric

Differential Revision: https://phab.enlightenment.org/D623
2014-04-09 19:12:46 +09:00
Felipe Magno de Almeida 6436618c92 eet-cxx: Renamed a few local variables and avoided other warnings
Summary: Renamed a few local variables to avoid excessive warnings with -Wshadow warning. Also made construction of a few objects pass all arguments for explicit initialization to avoid other harmless warning.

Reviewers: cedric, tasn, smohanty, raster

Reviewed By: raster

CC: cedric

Differential Revision: https://phab.enlightenment.org/D698
2014-04-09 19:11:46 +09:00
Felipe Magno de Almeida ab3eb4b2d3 eet-cxx: add implementation for eet C++.
Usage example:

  struct type
  {
    int foo;
    float bar;
  };

  type t0;

  auto descriptor = make_descriptor("type", &type::ofo, &type::bar);

  eet_data_write(file, descriptor.native_handle(), "type", &t0, false);

  std::unique_ptr<type> p = read_by_ptr(file, "type", descriptor);
  type t = read(file, "type", descriptor);

@feature

Reviewers: cedric, smohanty

Reviewed By: cedric

CC: savio, cedric

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

Signed-off-by: Cedric BAIL <cedric.bail@free.fr>
2014-04-01 22:00:13 +09:00
Felipe Magno de Almeida 9e364d6f4b eina-cxx: Fixes compilation errors and warnings in clang
Summary: @fix compilation errors with defining variable and type on the same statement on clang without a default-constructor. Also removed warnings with inconsistent uses of struct/class for forward declaration and unused parameters.

Reviewers: cedric, stefan_schmidt

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D622
2014-03-11 10:07:18 +09:00
Felipe Magno de Almeida 2ab6aac74d eina-cxx: Added malloc_clone_allocator to use with POD's when wrapping Eina C structures
Summary:
Added efl::eina::malloc_clone_allocator to be used with ptr_* data
structures for wrapping structures allocated by EFL in C.

This allows for example:

  void foo(Eina_List* l)
  {
    efl::eina::ptr_list<int, efl::eina::malloc_clone_allocator> list(l);
  }

If the standard efl::eina::heap_no_clone_allocator is used, the
deallocation code uses C++ delete operator, which causes undefined
behavior because the allocation was originally done with malloc.

Reviewers: cedric

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D614
2014-03-10 12:35:00 +09:00
Felipe Magno de Almeida 416376e03c eina-cxx: Added eina_log support for C++, using IOStreams syntax
Summary:
Added eina_log support for C++ using the following macros:

For logging into a domain:

EINA_CXX_DOM_LOG
EINA_CXX_DOM_LOG_CRIT
EINA_CXX_DOM_LOG_ERR
EINA_CXX_DOM_LOG_INFO
EINA_CXX_DOM_LOG_DBG
EINA_CXX_DOM_LOG_WARN

And for logging into the default domain:

EINA_CXX_LOG
EINA_CXX_LOG_CRIT
EINA_CXX_LOG_ERR
EINA_CXX_LOG_INFO
EINA_CXX_LOG_DBG
EINA_CXX_LOG_WARN

The usage is simple as can be seen in the tests:

  efl::eina::log_domain domain("error_domain_name");
  domain.set_level(efl::eina::log_level::critical);
  EINA_CXX_DOM_LOG_CRIT(domain, "something went wrong with the following error: " << error);

@feature

Reviewers: cedric

CC: raster, savio, cedric, sanjeev

Differential Revision: https://phab.enlightenment.org/D605
2014-03-10 12:35:00 +09:00
Felipe Magno de Almeida 5942207b25 eina-cxx: Added range types for containers
Summary:
Added inarray, inlist, ptr_array and ptr_list's range types named: range_inarray, range_inlist, range_ptr_array and range_ptr_list.

Each has two "flavours": mutable and not mutable. The const versions are parameterized by a const parameter. For example: range_ptr_list<int const> and the mutable doesn't have the const, so: range_ptr_list<int>.

The difference between the two is that the const versions can't modify the elements from the sequence, while the mutable allows so. Also, the const receives a Eina_Array const* while the mutable must have a Eina_Array*.

Reviewers: cedric

CC: savio, cedric

Differential Revision: https://phab.enlightenment.org/D613
2014-03-10 12:35:00 +09:00
Felipe Magno de Almeida 4105c002b3 ecore-cxx: add support for exceptions.
Summary:
Added support for exceptions on ecore_main_loop_thread_safe_call_async and
ecore_main_loop_thread_safe_call_sync. Also optimized the transport of the
return value through a parameter on ecore_main_loop_thread_safe_call_sync.

ecore-cxx: Changed uses of alignas for aligned_storage in C++11

Reviewers: cedric, raster

CC: savio, cedric

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

Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2014-03-07 14:37:03 +09:00
Felipe Magno de Almeida bc0a54c57c eina-cxx: renamed efl::eina::eina_value to efl::eina::value
Reviewers: cedric

CC: savio, cedric

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

Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2014-03-07 14:32:42 +09:00
Felipe Magno de Almeida 91f5a9b043 ecore_cxx: add main_loop_thread_safe_call_sync and main_loop_thread_safe_call_async with tests
The point of this binding is to enable the support for easy lambda for ecore function
that wont be using Eo. See the tests on how to use those.

Reviewers: cedric, raster

CC: savio, cedric

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

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-02-26 18:52:08 -03:00
Cedric Bail 96b1b880a4 eina_cxx: move Eina_CXX to a bindings subdirectory.
We do expect to integrate more bindings support in EFL to make them
first class citizen and make sure they get proper attention during
the development cycle. It so make sense to give them a proper
subdirectory.
2014-02-26 12:18:26 -03:00