Commit Graph

24 Commits

Author SHA1 Message Date
Stefan Schmidt 46d066d074 tests: add dependency on simple.eo.hh for new eina_cxx iterator test
With commit fd0cf8b764 we got a new test for
eina_cxx iterator. Like some other tests it needs to have the eimple.eo.hh
header already generated. Make sure we note this dependency in the build as
it fails without.
2016-03-23 16:55:03 +01:00
Vincent Torri dce4a966ad Test rework #11: Eina_Cxx 2016-02-16 12:41:06 +00:00
Stefan Schmidt 8b167c2361 eina_cxx: make sure simple.eo lands in the tarball in all cases
This would fail if you have not enabled tests and run distcheck.
2016-01-18 13:50:07 +01:00
Felipe Magno de Almeida 88cce73f90 eina-cxx: Remove Eo classes defined manually
Use Eolian to generate the Eo classes for the tests. This should fix T2940.

@fix
2016-01-11 16:10:55 -02:00
Felipe Magno de Almeida a3db1dddd3 efl-js: JavaScript Eolian binding
To configure efl sources with bindings to use in nodejs add ––with-js=nodejs in configure flags to generate node files

$ configure --with-js=nodejs

and compile normally with:

$ make
$ make install

To use, you have to require efl:

efl = require('efl')

The bindings is divided in two parts: generated and manually
written. The generation uses the Eolian library for parsing Eo files
and generate C++ code that is compiled against V8 interpreter library
to create a efl.node file that can be required in a node.js instance.

@feature
2015-12-23 23:59:40 -02:00
Stefan Schmidt d48c5accea Revert "autotools: enable make check per individual modules."
This reverts commit 35119e7bfd.

Reverted to bring make check back in a working state. Also the way we
want to handle a more modular testing needs discussion.
2015-05-07 20:50:56 +02:00
kabeer khan 35119e7bfd autotools: enable make check per individual modules.
Currently make check runs tests of whole EFL.Enabled running
of tests of individual modules by make check-<modulename>

Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-05-07 09:53:07 +02: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 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
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
Stefan Schmidt b050a1890e eina_cxx: Include newly added header to unbreak make distcheck 2014-10-24 13:02:07 +02:00
Felipe Magno de Almeida d21e400425 eina-cxx: eldbus-cxx: eo-cxx: Fixed test includes and header installation 2014-07-18 18:57:14 -03:00
Savio Sena 256e21d939 eina-cxx: Added interop containers. 2014-07-18 18:55:56 -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
Savio Sena 073b666022 autotools: Fixed 'make examples' and 'make examples-install'
It was broken in set-ups with ($(builddir) != $(srcdir)) && ($(builddir) !=
$(srcdir)/build)
2014-07-02 20:01:09 -03:00
Guillaume Friloux 9bee17a0aa Dont install c++ headers of bindings when --disable-c++11 is used. 2014-06-02 15:54:06 +02:00
Felipe Magno de Almeida 8149823897 eolian-cxx: fix make distcheck and automake files for Eolian C++
Summary:
Fixed distcheck for Eolian C++. Made the generated files as
nodist so it doesn't get picked up for generation way too
early.

Reviewers: cedric, seoz

CC: cedric

Maniphest Tasks: T1220

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

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-05-04 12:21:30 +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
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 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 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
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
Cedric Bail 47955c302a eina_cxx: make sure it can build out of the source tree. 2014-02-26 11:06:05 -03:00
Felipe Magno de Almeida f279225a63 eina: add a C++ bindings to Eina @feature.
The goal of this library is to make the life of C++ developers easier
when having to manipulate Eina datatype by providing a layer to abstract
those data type in C++. Check examples for now. Documentation will come
soon, but we are pushing that rather sooner to get feedback on those bindings.

As you will notice, this library is just composed of headers. There is no .so
and we do think it is better this way. Reducing ABI and API stability issue for
applications developers who are the primary target of this binding.

Also please note that you will need to have C++11 to use this binding.

Signed-off-by: Cedric Bail <cedric.bail@free.fr>
2014-02-25 18:05:01 -03:00