Commit Graph

324 Commits

Author SHA1 Message Date
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