Commit Graph

76 Commits

Author SHA1 Message Date
Lauro Moura 7d4c5f5d7c eo_cxx: Fix do_eo_add after lifecycle branch.
Summary:
Also changed the previously failing tests to use ck_assert_int_eqinstead
of fail_if for better reporting.

Test Plan: make check

Reviewers: cedric, felipealmeida

Reviewed By: cedric

Subscribers: #committers, zmike

Tags: #efl

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-05-25 10:00:42 -07:00
Lauro Moura 473d5b79c5 efl_cxx: remove eolized promises from the CXX bindings
Summary:
Also added a blacklist header to temporarily disable generation of eo
methods with futures as arguments or return type.

Once the models branch lands, we should enable future support again with
eina_futures.

Reviewers: cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D6018
2018-05-01 10:39:01 -07:00
Felipe Magno de Almeida 92f5383e3c efl-cxx: Fix using efl_add_ref instead of efl_add 2018-04-03 17:28:07 -03:00
Carsten Haitzler 1c74aaa7e9 Revert "cxx: Fix manual code after efl_app change."
This reverts commit 135154303b.

Revert "efl: move signal events from efl.loop to efl.app"
This reverts commit 3dbca39f98.

Revert "efl: add test suite for efl_app"
This reverts commit 3e94be5d73.

Revert "efl: create Efl.App class, the parent of Efl.Loop"
This reverts commit 28fe00b94e.

Go back to before efl.app because I think this should be done with
superclassing here not a parent object. reasons?

1. multiple loops per single thread make no sense. so if multilpe loop
objects they wont be contained in a single app object and then deleted
like this.
2. the app object is not really sharable in this design so it cant be
accessed from other threads
3. it makes it harder to get the main loop or app object (well 2 func
calls one calling the other and more typing. it is longer to type and
more work where it is not necessary, and again it can't work from
other threads unless we go duplicating efl.app per thread and then
what is the point of splittyign out the signal events from efl.loop
then?)

etc.
2018-03-03 13:40:33 +09:00
Lauro Moura 135154303b cxx: Fix manual code after efl_app change.
Test Plan: Run make check

Reviewers: felipealmeida

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5827
2018-02-26 21:14:09 -03:00
Carsten Haitzler 9bedda14b3 efl loop - rename ecore_main_loop_get to efl_main_loop_get
ecore_main_loop_get() is really a new "eo api" but it's using our old
ecore_* namespace, so move to the new efl namespace.
2018-01-02 16:13:54 +09:00
Jean-Philippe Andre 207a0cf3e3 eo: Move hacky API auto_unref to C only
This API is meant to be used by parts only, and by bindings dealing with
part objects. This patch fixes make check which got broken in the after
the previous one (cxx).
2017-12-05 15:06:34 +09:00
Jean-Philippe Andre 725026a4ba cxx: Fix one conversion to Eina_Value 2017-12-05 15:01:45 +09:00
Jean-Philippe Andre c9322dd561 cxx: Add global _delete() method to all objects
This is really just calling efl_del() and detaching the internal pointer
from the C++ object. This will not affect other references, which means
after del the object may still be alive, probably without a parent.
2017-12-05 15:01:45 +09:00
Jean-Philippe Andre 09cf282741 cxx: Use per-function guards in efl object
This prevents generation of del().
I also removed constructor, finalize and destructor as I believe this
requires special work with eo_inherit (where did this work go??).
2017-12-05 15:01:45 +09:00
Jean-Philippe Andre 9d14b4cfe8 cxx: Give ref to returned objects
This should give a ref to obj in the following scenario:

  auto obj = other.function();

Where obj is an eo object.
2017-12-05 10:17:02 +09:00
Jean-Philippe Andre 753304c69d cxx: Add define EFL_CXXPERIMENTAL for testing
I'll hide some controversial features behind this, until we come to an
agreement with @felipealmeida and people who actually know C++ (iow: not
just me^^).

Features protected:
 - easy wref (using -> without locking)
 - xxx_event_cb_add() functions in object classes
 - instantiate(obj) to create a new object
 - add as a synonym for instantiate (both in efl::eo)
2017-12-05 10:14:03 +09:00
Jean-Philippe Andre 5425baa906 cxx: Add support for function pointers
This was tested on the function pointer Efl.Ui.Format_Func_Cb
2017-12-05 10:14:03 +09:00
Jean-Philippe Andre 488c29febd cxx: Add FIXME note in eina_value.hh
I think some concepts are not handled properly in this set of classes.
I'll do some more experiments to see if I can find a working solution,
but I think we need 3 variants of eina_value, instead of just the two
provided.
2017-12-05 10:09:58 +09:00
Jean-Philippe Andre cfb3365060 cxx: Add strbuf support
Comes in two fashions:
 - strbuf_view (read-only)
 - strbuf (read/write)
2017-12-05 10:09:58 +09:00
Jean-Philippe Andre db8227a34a cxx: Add alternative form to instantiate object
This still uses the instantiate object but provides a more convenient
syntax for objects declared before their creation (eg. a global win).

Note: I wonder if we shouldn't rename instantiate to add. It would be
closer to EFL API's while being much much easier to type.
2017-12-05 10:09:58 +09:00
Jean-Philippe Andre 289a4e3aaa cxx: Only give a single ref to unparented objects
On instantiation objects get either one or two refs:
 - with a parent, they will have 2 refs, one for C++, one for the
   parent.
 - without a parent, they get a single ref, the one for C++

This will break the existing C++ examples, which I will fix in later
patches.

Note that the window is a strange object which can be created with no
parent but internally reparents itself to an object it creates (oh so
ugly).
2017-11-14 12:18:39 +09:00
Andy Williams d5dbcdabd1 eo: Rename efl_ref_get to efl_ref_count 2017-11-08 09:30:42 +00:00
Jean-Philippe Andre 58527a3dbb cxx: Fix log color in eina_log.hh
Changed from invalid "black" to arbitrary choice of green.
2017-11-07 09:57:24 +09:00
Jean-Philippe Andre 64698daeb5 cxx: Add support for operator == with objects 2017-11-07 09:57:24 +09:00
Jean-Philippe Andre e7009b77a2 cxx: Add experimental "easy" way to use wref
I hid it behind ifdef for now as I'm very much unsure of what I'm doing.
This whole modern C++ thing is still weird to me :)

Prerequisite:
 #define EFL_CXX_WREF_EASY

This allows constructs such as:

  auto wobj = obj._get_wref();
  std::cout << wobj->text_get() << std::endl;
2017-11-07 09:57:24 +09:00
Jean-Philippe Andre 88e10da36b cxx: Mark wref::lock as const
This allows passing in wref to a lambda.
If we passed normal refs, we would end up with dangling references and
many ERR messages.
2017-11-07 09:57:24 +09:00
Jean-Philippe Andre 8c991b104c cxx: Add nullptr constructor for weak refs
This allows constructs such as:

  wref_obj = obj;
  ...
  wref_obj = nullptr;
2017-11-07 09:57:24 +09:00
Jean-Philippe Andre 03b22c4d7b cxx: Instantiate objects with 2 refs
This is the original meaning of efl_add_ref().
Somehow the "ref" bool was set to true in the first call, and false in
the second call.
2017-11-07 09:57:24 +09:00
Felipe Magno de Almeida de349e1b9e eo-cxx: Fix compilation error with any_value received by value 2017-10-30 21:05:39 -02:00
Felipe Magno de Almeida 96d3af10bf eolian-cxx: Add optional parameter to lambda for unnamed proxy instantiation 2017-09-28 17:50:14 -03:00
Felipe Magno de Almeida bb887f9869 eolian-cxx: Fix compilation errors with new any_value_ptr and mstring types 2017-09-25 21:57:25 -03:00
Felipe Magno de Almeida 89608b15ee eo-cxx: Fix test errors with new Eolian @own framework 2017-09-18 20:22:32 -03:00
Felipe Magno de Almeida 192c7e35f6 eo-cxx: Fix assignment operator for eo::concrete 2017-09-17 06:17:01 -03:00
Felipe Magno de Almeida b5c4aeab94 eo-cxx: Fix possible non-initialization in copy-constructor and move-constructor 2017-09-15 15:16:58 -03:00
Felipe Magno de Almeida 6ded80a9b5 eo-cxx: Fix conversion from char* to std::string 2017-09-15 14:56:23 -03:00
Felipe Magno de Almeida 48b3c127f7 eo-cxx: Require instantiate keyword for constructors calling efl_add to avoid ambiguity 2017-09-08 11:47:29 +09:00
Felipe Magno de Almeida 1cfc96dd5b eo-cxx: Fix ompilation error for uncomplete Eina_Future type 2017-09-06 17:03:36 +09:00
Felipe Magno de Almeida a7649a7897 eolian-cxx: Add workaround for function pointer types 2017-08-22 22:40:13 -03:00
Felipe Magno de Almeida 348a7084af eolian-cxx: Add workaround for clang removing const from parameters 2017-08-10 15:52:25 -03:00
Felipe Magno de Almeida 634f7d0dbb eo-cxx: Add overload for Eina_Bool inout handling interoperability
Add convert_inout_impl overload to handle bool/Eina_Bool conversion in inout direction.
2017-07-27 13:20:20 -03:00
Felipe Magno de Almeida 0fcee227aa eolian-cxx: Fix C++ generation errors with handle opaque types 2017-06-18 11:31:43 -03:00
Felipe Magno de Almeida a1f2db255b cxx: Modify how to generate C++ headers and allow cyclic dependencies
Allow cyclic dependencies in generated C++ headers by changing order
of includes and creating forward declarations.
2017-01-18 22:47:04 -02:00
Felipe Magno de Almeida ae822a396c eina-cxx: Add visit_unsafe to eina::variant and make ~variant possibly noexcept
visit_unsafe member function visits the variant but assumes the
pre-condition that the variant is not empty. This avoids the
possibility of throwing an exception when the destructors
of the types used in variant are also guaranteed to be
noexcept.

CID 1367508
2016-12-20 15:33:57 -03:00
Felipe Magno de Almeida 3704173017 eina-cxx: Add move constructor and move assignment operator for eina::variant
CID 1362797
2016-12-20 15:26:35 -03:00
Cedric BAIL 6ee17d8f2d bindings: remove Eina_Promise from C++ bindings. 2016-11-07 12:03:55 -08:00
Felipe Magno de Almeida 137dd4864d eina-cxx: eolian-cxx: Fix correct usage of is_eolian_object traits 2016-11-03 17:59:20 -02:00
Felipe Magno de Almeida 17da4b5b9d eo-cxx: Fix compilation and warnings in clang 2016-10-20 04:52:18 -02:00
Felipe Magno de Almeida 88419e5e87 eina-cxx: Implement aligned_union for GCC 4.9 2016-09-22 19:27:56 -03:00
Felipe Magno de Almeida 10293e6520 eo-cxx: Add progress to future and promise 2016-09-20 23:30:29 -03:00
Felipe Magno de Almeida 5df0b6765b eo-cxx: Replace for ENOMEM to avoid warnings 2016-09-14 00:55:51 -03:00
Felipe Magno de Almeida 5e735fe762 eo-cxx: Fix race promises 2016-09-14 00:33:22 -03:00
Felipe Magno de Almeida 3339f03964 eo-cxx: Add promise type 2016-09-14 00:33:22 -03:00
Felipe Magno de Almeida e0b444f95f eo-cxx: Add race promises through eina::variant 2016-09-14 00:33:22 -03:00
Felipe Magno de Almeida 2bdad3f1d6 eo-cxx: race for promises 2016-09-14 00:33:22 -03:00