From 523515e2cc86b2df32afa7b2efa39479eff88ebd Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Thu, 4 Jul 2019 17:54:49 -0300 Subject: [PATCH 1/6] eolian_cxx: update tests to no longer use forbidden eolian notations Update eolian_cxx tests in order to remove forbidden eolian notations. For tests with containers that support non-pointer types, change `ptr(int)` to `int`. For tests with containers that only support pointer types, change `ptr(int)` to `string`. Remove tests for features that are no longer meaningful with eolian new restrictions. Add a FIXME note to eina::range_array when used with eina::string_view. --- src/tests/eolian_cxx/callback.eo | 4 +- src/tests/eolian_cxx/complex.eo | 54 ++++---- src/tests/eolian_cxx/complex_cxx.cc | 20 +-- .../eolian_cxx/eolian_cxx_test_binding.cc | 47 +------ src/tests/eolian_cxx/generic.c | 8 +- src/tests/eolian_cxx/generic.eo | 4 +- .../eolian_cxx/name1_name2_type_generation.c | 129 ------------------ .../eolian_cxx/name1_name2_type_generation.eo | 90 ------------ 8 files changed, 48 insertions(+), 308 deletions(-) diff --git a/src/tests/eolian_cxx/callback.eo b/src/tests/eolian_cxx/callback.eo index a62ec0031b..6dd2c721b7 100644 --- a/src/tests/eolian_cxx/callback.eo +++ b/src/tests/eolian_cxx/callback.eo @@ -1,7 +1,7 @@ struct Callback_Event { field1: int; - field2: list; + field2: list; } class Callback extends Efl.Object @@ -11,7 +11,7 @@ class Callback extends Efl.Object prefix,event1: void; prefix,event2: Callback; prefix,event3: int; - prefix,event4: const(array); + prefix,event4: const(array); prefix,event5: Callback_Event; } } diff --git a/src/tests/eolian_cxx/complex.eo b/src/tests/eolian_cxx/complex.eo index 13ed1ca385..16fec03210 100644 --- a/src/tests/eolian_cxx/complex.eo +++ b/src/tests/eolian_cxx/complex.eo @@ -5,7 +5,7 @@ class Complex extends Efl.Object // container test inptrcont { params { - l: list; + l: list; } } inclasscont { @@ -15,22 +15,22 @@ class Complex extends Efl.Object } incontcont { params { - l: list>; + l: list>; } } incontcontown { params { - l: list> @owned; + l: list> @owned; } } incontowncontown { params { - l: list @owned> @owned; + l: list @owned> @owned; } } incontowncont { params { - l: list @owned>; + l: list @owned>; } } instringcont { @@ -50,42 +50,42 @@ class Complex extends Efl.Object } inarray { params { - l: array; + l: array; } } inarrayown { params { - l: array @owned; + l: array @owned; } } inhash { params { - l: hash; + l: hash; } } inhashown { params { - l: hash @owned; + l: hash @owned; } } initerator { params { - l: iterator; + l: iterator; } } initeratorown { params { - l: iterator @owned; + l: iterator @owned; } } inaccessor { params { - l: accessor; + l: accessor; } } inaccessorown { params { - l: accessor @owned; + l: accessor @owned; } } // out @@ -96,22 +96,22 @@ class Complex extends Efl.Object } outcontcont { params { - @out l: list>; + @out l: list>; } } outcontcontown { params { - @out l: list> @owned; + @out l: list> @owned; } } outcontowncontown { params { - @out l: list @owned> @owned; + @out l: list @owned> @owned; } } outcontowncont { params { - @out l: list @owned>; + @out l: list @owned>; } } outstringcont { @@ -131,51 +131,51 @@ class Complex extends Efl.Object } outarray { params { - @out l: array; + @out l: array; } } outarrayown { params { - @out l: array @owned; + @out l: array @owned; } } outhash { params { - @out l: hash; + @out l: hash; } } outhashown { params { - @out l: hash @owned; + @out l: hash @owned; } } outiterator { params { - @out l: iterator; + @out l: iterator; } } outiteratorown { params { - @out l: iterator @owned; + @out l: iterator @owned; } } outaccessor { params { - @out l: accessor; + @out l: accessor; } } outaccessorown { params { - @out l: accessor @owned; + @out l: accessor @owned; } } foo { params { - l: list; + l: list; } } bar { - return: array; + return: array; } wrapper_r { return: Complex; diff --git a/src/tests/eolian_cxx/complex_cxx.cc b/src/tests/eolian_cxx/complex_cxx.cc index 37e9661400..33999041ab 100644 --- a/src/tests/eolian_cxx/complex_cxx.cc +++ b/src/tests/eolian_cxx/complex_cxx.cc @@ -38,25 +38,25 @@ struct test_param_type }; test_param_type> inclasscont; -test_param_type >> incontcont; -test_param_type >const&> incontcontown; -test_param_type >const&> incontowncontown; -test_param_type >> incontowncont; +test_param_type >> incontcont; +test_param_type >const&> incontcontown; +test_param_type >const&> incontowncontown; +test_param_type >> incontowncont; test_param_type> instringcont; test_param_type> instringowncont; test_param_typeconst&> instringcontown; test_param_type&> outclasscont; -test_param_type >&> outcontcont; -test_param_type >&> outcontcontown; -test_param_type >&> outcontowncontown; -test_param_type >&> outcontowncont; +test_param_type >&> outcontcont; +test_param_type >&> outcontcontown; +test_param_type >&> outcontowncontown; +test_param_type >&> outcontowncont; test_param_type&> outstringcont; test_param_type&> outstringowncont; test_param_type&> outstringcontown; -test_param_type > foo; -test_return_type > bar; +test_param_type > foo; +test_return_type > bar; test_return_type wrapper_r; test_param_type wrapper_in; test_param_type wrapper_inout; diff --git a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc index faa161bb9e..370619d6a7 100644 --- a/src/tests/eolian_cxx/eolian_cxx_test_binding.cc +++ b/src/tests/eolian_cxx/eolian_cxx_test_binding.cc @@ -85,15 +85,8 @@ EFL_START_TEST(eolian_cxx_test_type_generation_in) name1::name2::Type_Generation g(efl::eo::instantiate); - int v = 42; - g.inrefint(v); - g.inrefintown(42); - g.inrefintownfree(42); g.invoidptr(nullptr); g.inint(42); - g.inintptr(42); - g.inintptrown(42); - g.inintptrownfree(42); g.instring("foobar"); g.instringown("foobar"); } @@ -105,10 +98,6 @@ EFL_START_TEST(eolian_cxx_test_type_generation_return) name1::name2::Type_Generation g(efl::eo::instantiate); - { - int&i = g.returnrefint(); - ck_assert(i == 42); - } { int i = g.returnint(); ck_assert(i == 42); @@ -117,14 +106,6 @@ EFL_START_TEST(eolian_cxx_test_type_generation_return) void* p = g.returnvoidptr(); ck_assert(*(int*)p == 42); } - { - int& p = g.returnintptr(); - ck_assert(p == 42); - } - { - efl::eina::unique_malloc_ptr p = g.returnintptrown(); - ck_assert(*p == 42); - } { efl::eina::string_view string = g.returnstring(); ck_assert_str_eq(string.c_str(), "foobar"); @@ -152,33 +133,10 @@ EFL_START_TEST(eolian_cxx_test_type_generation_optional) g.optionalinint(nullptr); g.optionalinint(i); - g.optionalinintptr(i); - g.optionalinintptr(nullptr); - - g.optionalinintptrown(i); - g.optionalinintptrown(nullptr); - - g.optionalinintptrownfree(i); - g.optionalinintptrownfree(nullptr); - i = 0; g.optionaloutint(&i); ck_assert(i == 42); g.optionaloutint(nullptr); - - i = 0; - int* j = nullptr; - g.optionaloutintptr(&j); - ck_assert(j != nullptr); - ck_assert(*j == 42); - g.optionaloutintptr(nullptr); - - i = 0; - efl::eina::unique_malloc_ptr k = nullptr; - g.optionaloutintptrown(k); - ck_assert(!!k); - ck_assert(*k == 42); - g.optionaloutintptrown(nullptr); } EFL_END_TEST @@ -203,11 +161,12 @@ EFL_START_TEST(eolian_cxx_test_type_callback) event3 = true; ck_assert(v == 42); }); - efl::eolian::event_add(g.prefix_event4_event, g, [&] (nonamespace::Generic, efl::eina::range_array e) + efl::eolian::event_add(g.prefix_event4_event, g, [&] (nonamespace::Generic, efl::eina::range_array<::efl::eina::string_view> e) { event4 = true; ck_assert(e.size() == 1); - ck_assert(*e.begin() == 42); + // FIXME eina::range_array is incompatible with eina::string_view + //ck_assert(*e.begin() == efl::eina::string_view{"42"}); }); efl::eolian::event_add(g.prefix_event5_event, g, [&] (nonamespace::Generic, Generic_Event) { diff --git a/src/tests/eolian_cxx/generic.c b/src/tests/eolian_cxx/generic.c index 65f8025b57..ebc33aca25 100644 --- a/src/tests/eolian_cxx/generic.c +++ b/src/tests/eolian_cxx/generic.c @@ -114,16 +114,16 @@ static void _generic_call_event3(Eo *obj, Generic_Data* pd EINA_UNUSED) } static void _generic_call_event4(Eo *obj, Generic_Data* pd EINA_UNUSED) { - int i = 42; + static const char *s = "42"; Eina_Array* p = eina_array_new(1); - ck_assert(eina_array_push(p, &i)); + ck_assert(eina_array_push(p, s)); efl_event_callback_call(obj, GENERIC_EVENT_PREFIX_EVENT4, p); eina_array_free(p); } static void _generic_call_event5(Eo *obj, Generic_Data* pd EINA_UNUSED) { - int i = 42; - Eina_List* p = eina_list_append(NULL, &i); + const char *s = "42"; + Eina_List* p = eina_list_append(NULL, s); Generic_Event e = {.field1 = 42, .field2 = p}; efl_event_callback_call(obj, GENERIC_EVENT_PREFIX_EVENT5, &e); diff --git a/src/tests/eolian_cxx/generic.eo b/src/tests/eolian_cxx/generic.eo index 192765d7df..5bc284fc4a 100644 --- a/src/tests/eolian_cxx/generic.eo +++ b/src/tests/eolian_cxx/generic.eo @@ -2,7 +2,7 @@ struct Generic.Event { field1: int; - field2: list; + field2: list; } class Generic extends Efl.Object implements Generic_Interface @@ -108,7 +108,7 @@ class Generic extends Efl.Object implements Generic_Interface prefix,event1: void; prefix,event2: Generic; prefix,event3: int; - prefix,event4: const(array); + prefix,event4: const(array); prefix,event5: Generic.Event; protected,event1 @protected: void; beta,event1 @beta: void; diff --git a/src/tests/eolian_cxx/name1_name2_type_generation.c b/src/tests/eolian_cxx/name1_name2_type_generation.c index 2517bcdd85..9b03b36237 100644 --- a/src/tests/eolian_cxx/name1_name2_type_generation.c +++ b/src/tests/eolian_cxx/name1_name2_type_generation.c @@ -16,23 +16,6 @@ typedef struct _Type_Generation_Data Type_Generation_Data; #include "name1_name2_type_generation.eo.h" -void _name1_name2_type_generation_inrefint(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int* v EINA_UNUSED) -{ - ck_assert(*v == 42); -} - -void _name1_name2_type_generation_inrefintown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int* v EINA_UNUSED) -{ - ck_assert(*v == 42); - free(v); -} - -void _name1_name2_type_generation_inrefintownfree(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int* v EINA_UNUSED) -{ - ck_assert(*v == 42); - free(v); -} - void _name1_name2_type_generation_invoidptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, void *v) { ck_assert(v == NULL); @@ -43,36 +26,6 @@ void _name1_name2_type_generation_inint(Eo *obj EINA_UNUSED, Type_Generation_Dat ck_assert(v == 42); } -void _name1_name2_type_generation_inintptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int *v EINA_UNUSED) -{ - ck_assert(*v == 42); -} - -void _name1_name2_type_generation_inintptrown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int *v EINA_UNUSED) -{ - ck_assert(*v == 42); -} - -void _name1_name2_type_generation_inintptrownptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int **v EINA_UNUSED) -{ - ck_assert(**v == 42); -} - -void _name1_name2_type_generation_inintptrownptrptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int ***v EINA_UNUSED) -{ - ck_assert(***v == 42); -} - -void _name1_name2_type_generation_inintptrptrownptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int ***v EINA_UNUSED) -{ - ck_assert(***v == 42); -} - -void _name1_name2_type_generation_inintptrownfree(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int *v EINA_UNUSED) -{ - ck_assert(*v == 42); -} - void * _name1_name2_type_generation_returnvoidptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED) { static int i = 42; @@ -126,48 +79,11 @@ void _name1_name2_type_generation_instringownptr(Eo *obj EINA_UNUSED, Type_Gener free(v); } -int* _name1_name2_type_generation_returnrefint(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED) -{ - static int i = 42; - return &i; -} int _name1_name2_type_generation_returnint(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED) { return 42; } -int * _name1_name2_type_generation_returnintptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED) -{ - static int i = 42; - return &i; -} - -int * _name1_name2_type_generation_returnintptrown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED) -{ - int* i = malloc(sizeof(int)); - *i = 42; - return i; -} - -int ** _name1_name2_type_generation_returnintptrownptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED) -{ - return NULL; -} - -int *** _name1_name2_type_generation_returnintptrownptrptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED) -{ - return NULL; -} - -int *** _name1_name2_type_generation_returnintptrptrownptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED) -{ - return NULL; -} - -void _name1_name2_type_generation_returnintptrownfree(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int *v EINA_UNUSED) -{ -} - const char * _name1_name2_type_generation_returnstring(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED) { return "foobar"; @@ -216,18 +132,6 @@ void _name1_name2_type_generation_outint(Eo *obj EINA_UNUSED, Type_Generation_Da { } -void _name1_name2_type_generation_outintptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int **v EINA_UNUSED) -{ -} - -void _name1_name2_type_generation_outintptrown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int **v EINA_UNUSED) -{ -} - -void _name1_name2_type_generation_outintptrownfree(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int **v EINA_UNUSED) -{ -} - void _name1_name2_type_generation_outstringshare(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, Eina_Stringshare** v) { *v = eina_stringshare_add("foobar"); @@ -258,18 +162,6 @@ void _name1_name2_type_generation_optionalinint(Eo *obj EINA_UNUSED, Type_Genera { } -void _name1_name2_type_generation_optionalinintptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int *v EINA_UNUSED) -{ -} - -void _name1_name2_type_generation_optionalinintptrown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int *v EINA_UNUSED) -{ -} - -void _name1_name2_type_generation_optionalinintptrownfree(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int *v EINA_UNUSED) -{ -} - void _name1_name2_type_generation_optionaloutvoidptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, void **v EINA_UNUSED) { } @@ -280,27 +172,6 @@ void _name1_name2_type_generation_optionaloutint(Eo *obj EINA_UNUSED, Type_Gener *v = 42; } -void _name1_name2_type_generation_optionaloutintptr(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int **v EINA_UNUSED) -{ - static int i = 42; - if(v) - *v = &i; -} - -void _name1_name2_type_generation_optionaloutintptrown(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int **v EINA_UNUSED) -{ - int* i = malloc(sizeof(int)); - *i = 42; - if(v) *v = i; -} - -void _name1_name2_type_generation_optionaloutintptrownfree(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, int **v EINA_UNUSED) -{ - int* i = malloc(sizeof(int)); - *i = 42; - if(v) *v = i; -} - void _name1_name2_type_generation_optionalinclassname(Eo *obj EINA_UNUSED, Type_Generation_Data *pd EINA_UNUSED, Name1_Name2_Type_Generation *v EINA_UNUSED) { } diff --git a/src/tests/eolian_cxx/name1_name2_type_generation.eo b/src/tests/eolian_cxx/name1_name2_type_generation.eo index 920c75df58..dce2ff22d9 100644 --- a/src/tests/eolian_cxx/name1_name2_type_generation.eo +++ b/src/tests/eolian_cxx/name1_name2_type_generation.eo @@ -2,22 +2,6 @@ class Name1.Name2.Type_Generation extends Efl.Object { data: Type_Generation_Data; methods { - // inref - inrefint { - params { - @in v: ptr(int); - } - } - inrefintown { - params { - @in v: free(ptr(int),free) @owned; - } - } - inrefintownfree { - params { - @in v: free(ptr(int), free) @owned; - } - } // in void ptr invoidptr { params { @@ -29,21 +13,6 @@ class Name1.Name2.Type_Generation extends Efl.Object @in v: int; } } - inintptr { - params { - @in v: ptr(int); - } - } - inintptrown { - params { - @in v: free(ptr(int),free) @owned; - } - } - inintptrownfree { - params { - @in v: free(ptr(int), free) @owned; - } - } instring { params { @in v: string; @@ -65,26 +34,12 @@ class Name1.Name2.Type_Generation extends Efl.Object } } // return - returnrefint { - return: ptr(int); - } returnvoidptr { return: void_ptr; } returnint { return: int; } - returnintptr { - return: ptr(int); - } - returnintptrown { - return: free(ptr(int),free) @owned; - } - returnintptrownfree { - params { - @in v: free(ptr(int), free) @owned; - } - } returnstring { return: string; } @@ -108,21 +63,6 @@ class Name1.Name2.Type_Generation extends Efl.Object @out v: int; } } - outintptr { - params { - @out v: ptr(int); - } - } - outintptrown { - params { - @out v: free(ptr(int),free) @owned; - } - } - outintptrownfree { - params { - @out v: free(ptr(int), free) @owned; - } - } outstringshare { params { @out v: stringshare; @@ -159,21 +99,6 @@ class Name1.Name2.Type_Generation extends Efl.Object @in v: int @optional; } } - optionalinintptr { - params { - @in v: ptr(int) @optional; - } - } - optionalinintptrown { - params { - @in v: free(ptr(int),free) @owned @optional; - } - } - optionalinintptrownfree { - params { - @in v: free(ptr(int), free) @owned @optional; - } - } optionaloutvoidptr { params { @out v: void_ptr @optional; @@ -184,21 +109,6 @@ class Name1.Name2.Type_Generation extends Efl.Object @out v: int @optional; } } - optionaloutintptr { - params { - @out v: ptr(int) @optional; - } - } - optionaloutintptrown { - params { - @out v: free(ptr(int),free) @owned @optional; - } - } - optionaloutintptrownfree { - params { - @out v: free(ptr(int), free) @owned @optional; - } - } optionalinclassname { params { @in v: Name1.Name2.Type_Generation @optional; From cb6aa5334545f83360ba2c650fce4aad37290f40 Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Thu, 4 Jul 2019 18:22:53 -0300 Subject: [PATCH 2/6] eolian_cxx: update eolian_cxx to recognize slice and rw_slice Update eolian_cxx to recognize the new keywords `slice` and `rw_slice`, so it can generate the corresponding types `Eina_Slice` and `Eina_Rw_Slice`. --- src/lib/eolian_cxx/grammar/type_impl.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/eolian_cxx/grammar/type_impl.hpp b/src/lib/eolian_cxx/grammar/type_impl.hpp index ec8f5043f0..ca73a14bd0 100644 --- a/src/lib/eolian_cxx/grammar/type_impl.hpp +++ b/src/lib/eolian_cxx/grammar/type_impl.hpp @@ -329,6 +329,16 @@ struct visitor_generate (complex, regular_type_def{" ::efl::eina::accessor", complex.outer.base_qualifier, {}}); } } + , {"slice", nullptr, nullptr, [&] + { + return regular_type_def{" Eina_Slice", complex.outer.base_qualifier, {}}; + } + } + , {"rw_slice", nullptr, nullptr, [&] + { + return regular_type_def{" Eina_Rw_Slice", complex.outer.base_qualifier, {}}; + } + } }; auto default_match = [&] (attributes::complex_type_def const& complex) From 364b4f8dde6b8b16e2af97fcedaf44c3440d49de Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Thu, 4 Jul 2019 20:00:01 -0300 Subject: [PATCH 3/6] eolian_mono: fix non-beta compilation and support for slice/rw_slice keywords Add support for `slice` and `rw_slice` keywords in eolian_mono. Now it generates the proper manual binding type for these native types. Make unit tests use these keywords instead of native names. Remove some unnecessary `@beta` tags from eolian types in unit tests so now tests correctly compile without the `mono-beta` compilation flag. Also make tests that use `Eina.Binbuf` "beta only". In a future update, the external type `Eina.Binbuf` will be marked as beta, so we shield the binding in anticipation. --- src/bin/eolian_mono/eolian/mono/type_impl.hh | 10 +++ src/tests/efl_mono/Eina.cs | 8 +++ src/tests/efl_mono/EinaTestData.cs | 2 + src/tests/efl_mono/Events.cs | 2 + src/tests/efl_mono/StructHelpers.cs | 3 +- src/tests/efl_mono/Structs.cs | 4 ++ src/tests/efl_mono/dummy_event_manager.eo | 2 +- src/tests/efl_mono/dummy_part_holder.eo | 2 +- src/tests/efl_mono/dummy_test_object.eo | 64 ++++++++++---------- 9 files changed, 62 insertions(+), 35 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/type_impl.hh b/src/bin/eolian_mono/eolian/mono/type_impl.hh index 8991247782..41cdf92f19 100644 --- a/src/bin/eolian_mono/eolian/mono/type_impl.hh +++ b/src/bin/eolian_mono/eolian/mono/type_impl.hh @@ -393,6 +393,16 @@ struct visitor_generate return c; } } + , {"slice", nullptr, nullptr, [&] + { + return regular_type_def{" Eina.Slice", complex.outer.base_qualifier, {}}; + } + } + , {"rw_slice", nullptr, nullptr, [&] + { + return regular_type_def{" Eina.RwSlice", complex.outer.base_qualifier, {}}; + } + } }; auto default_match = [&] (attributes::complex_type_def const& complex) diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs index 90e8586d93..ace7fd980f 100644 --- a/src/tests/efl_mono/Eina.cs +++ b/src/tests/efl_mono/Eina.cs @@ -10,6 +10,8 @@ namespace TestSuite { +#if EFL_BETA + class TestEinaBinbuf { private static readonly byte[] test_string = System.Text.Encoding.UTF8.GetBytes("0123456789ABCDEF"); @@ -307,12 +309,15 @@ public static void test_inherit_eina_binbuf_return_own() } } +#endif + class TestEinaSlice { private static readonly byte[] base_seq = BaseSequence.Values(); private static readonly GCHandle pinnedData = GCHandle.Alloc(base_seq, GCHandleType.Pinned); private static readonly IntPtr pinnedPtr = pinnedData.AddrOfPinnedObject(); +#if EFL_BETA public static void eina_slice_marshalling() { var binbuf = new Eina.Binbuf(base_seq); @@ -323,6 +328,7 @@ public static void eina_slice_marshalling() Test.Assert(slc.GetBytes().SequenceEqual(base_seq)); Test.Assert(base_seq.Length == (int)(slc.Len)); } +#endif public static void eina_slice_size() { @@ -330,12 +336,14 @@ public static void eina_slice_size() Test.Assert(Marshal.SizeOf(typeof(Eina.RwSlice)) == Marshal.SizeOf(typeof(UIntPtr)) + Marshal.SizeOf(typeof(IntPtr))); } +#if EFL_BETA public static void pinned_data_set() { var binbuf = new Eina.Binbuf(); binbuf.Append(new Eina.Slice().PinnedDataSet(pinnedPtr, (UIntPtr)3)); Test.Assert(binbuf.GetBytes().SequenceEqual(base_seq)); } +#endif public static void test_eina_slice_in() { diff --git a/src/tests/efl_mono/EinaTestData.cs b/src/tests/efl_mono/EinaTestData.cs index b64040d5eb..81b318ffae 100644 --- a/src/tests/efl_mono/EinaTestData.cs +++ b/src/tests/efl_mono/EinaTestData.cs @@ -152,6 +152,7 @@ override public bool EinaRwSliceOut(ref Eina.RwSlice slice) // // // +#if EFL_BETA override public bool EinaBinbufIn(Eina.Binbuf binbuf) { binbuf_in_flag = true; @@ -280,6 +281,7 @@ public bool binbuf_return_own_no_longer_own() binbuf_return_own_binbuf = null; return r; } +#endif } } // EinaTestData diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs index b664e2bbbd..9e37649df1 100644 --- a/src/tests/efl_mono/Events.cs +++ b/src/tests/efl_mono/Events.cs @@ -176,6 +176,7 @@ public static void event_with_struct_payload() Test.AssertEquals(sent_struct.Fstring, received_struct.Fstring); } +#if EFL_BETA public static void event_with_struct_complex_payload() { var obj = new Dummy.TestObject(); @@ -191,6 +192,7 @@ public static void event_with_struct_complex_payload() Test.AssertEquals(sent_struct.Fobj, received_struct.Fobj); } +#endif public static void event_with_array_payload() { diff --git a/src/tests/efl_mono/StructHelpers.cs b/src/tests/efl_mono/StructHelpers.cs index 4debea53f1..73554f2d21 100644 --- a/src/tests/efl_mono/StructHelpers.cs +++ b/src/tests/efl_mono/StructHelpers.cs @@ -120,6 +120,7 @@ internal static void checkZeroedStructSimple(Dummy.StructSimple simple) Test.Assert(simple.Fstringshare == null); } +#if EFL_BETA internal static Dummy.StructComplex structComplexWithValues() { var complex = new Dummy.StructComplex(); @@ -211,7 +212,7 @@ internal static void checkZeroedStructComplex(Dummy.StructComplex complex) Test.Assert(complex.Fobj == null); } - +#endif } diff --git a/src/tests/efl_mono/Structs.cs b/src/tests/efl_mono/Structs.cs index 71246b3198..d632e7a4d7 100644 --- a/src/tests/efl_mono/Structs.cs +++ b/src/tests/efl_mono/Structs.cs @@ -20,11 +20,13 @@ private static void simple_default_instantiation() checkZeroedStructSimple(simple); } +#if EFL_BETA private static void complex_default_instantiation() { var complex = new Dummy.StructComplex(); checkZeroedStructComplex(complex); } +#endif public static void parameter_initialization() { @@ -283,6 +285,7 @@ public static void simple_ptr_return_own_virtual() } // Complex Structs +#if EFL_BETA public static void complex_in() { var complex = structComplexWithValues(); @@ -330,6 +333,7 @@ public static void complex_return() // public static void complex_ptr_return_own() // { // } +#endif } } diff --git a/src/tests/efl_mono/dummy_event_manager.eo b/src/tests/efl_mono/dummy_event_manager.eo index 78b9dec8df..cd8cdfeef9 100644 --- a/src/tests/efl_mono/dummy_event_manager.eo +++ b/src/tests/efl_mono/dummy_event_manager.eo @@ -1,6 +1,6 @@ import eina_types; -class @beta Dummy.Event_Manager extends Efl.Object { +class Dummy.Event_Manager extends Efl.Object { methods { @property emitter { diff --git a/src/tests/efl_mono/dummy_part_holder.eo b/src/tests/efl_mono/dummy_part_holder.eo index b95f1a5cdc..1ac88007fc 100644 --- a/src/tests/efl_mono/dummy_part_holder.eo +++ b/src/tests/efl_mono/dummy_part_holder.eo @@ -1,6 +1,6 @@ import eina_types; -class @beta Dummy.Part_Holder extends Dummy.Test_Object implements Efl.Part { +class Dummy.Part_Holder extends Dummy.Test_Object implements Efl.Part { parts { one: Dummy.Test_Object; [[ Part number one. ]] diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo index 22c9d69eb8..6aab6eda75 100644 --- a/src/tests/efl_mono/dummy_test_object.eo +++ b/src/tests/efl_mono/dummy_test_object.eo @@ -74,7 +74,7 @@ struct @free(free) Dummy.StructSimple fmyint: Dummy.MyInt; } -struct @free(free) Dummy.StructComplex { +struct @beta @free(free) Dummy.StructComplex { farray: array; flist: list; fhash: hash; @@ -82,7 +82,7 @@ struct @free(free) Dummy.StructComplex { fany_value: any_value; fany_value_ptr: any_value_ptr; fbinbuf: ptr(Eina.Binbuf); - fslice: Eina.Slice; + fslice: slice; // fslice: ptr(Eina.Slice); // TODO fobj: Dummy.Numberwrapper; } @@ -253,71 +253,71 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { eina_slice_in { params { - @in slice: Eina.Slice; + @in slice: slice; } return: bool; } eina_rw_slice_in { params { - @in slice: Eina.Rw_Slice; + @in slice: rw_slice; } return: bool; } eina_slice_out { params { - @out slice: Eina.Slice; + @out slice: slice; } return: bool; } eina_rw_slice_out { params { - @out slice: Eina.Rw_Slice; + @out slice: rw_slice; } return: bool; } eina_rw_slice_inout { params { - @inout slice: Eina.Rw_Slice; + @inout slice: rw_slice; } return: bool; } /* eina_slice_return { - return: Eina.Slice; + return: slice; } eina_rw_slice_return { - return: Eina.Rw_Slice; + return: rw_slice; } */ - eina_binbuf_in { + eina_binbuf_in @beta { params { @in binbuf: ptr(Eina.Binbuf); } return: bool; } - call_eina_binbuf_in { + call_eina_binbuf_in @beta { params { @in binbuf: ptr(Eina.Binbuf); } return: bool; } - eina_binbuf_in_own { + eina_binbuf_in_own @beta { params { @in binbuf: ptr(Eina.Binbuf) @owned; } return: bool; } - call_eina_binbuf_in_own { + call_eina_binbuf_in_own @beta { params { @in str: ptr(Eina.Binbuf) @owned; } @@ -328,14 +328,14 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: bool; } - eina_binbuf_out { + eina_binbuf_out @beta { params { @out binbuf: ptr(Eina.Binbuf); } return: bool; } - call_eina_binbuf_out { + call_eina_binbuf_out @beta { return: ptr(Eina.Binbuf); } @@ -343,22 +343,22 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: bool; } - eina_binbuf_out_own { + eina_binbuf_out_own @beta { params { @out binbuf: ptr(Eina.Binbuf) @owned; } return: bool; } - call_eina_binbuf_out_own { + call_eina_binbuf_out_own @beta { return: ptr(Eina.Binbuf) @owned; } - eina_binbuf_return { + eina_binbuf_return @beta { return: ptr(Eina.Binbuf); } - call_eina_binbuf_return { + call_eina_binbuf_return @beta { return: ptr(Eina.Binbuf); } @@ -366,11 +366,11 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: bool; } - eina_binbuf_return_own { + eina_binbuf_return_own @beta { return: ptr(Eina.Binbuf) @owned; } - call_eina_binbuf_return_own { + call_eina_binbuf_return_own @beta { return: ptr(Eina.Binbuf) @owned; } @@ -1400,57 +1400,57 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: ptr(Dummy.StructSimple) @owned; } - struct_complex_in { + struct_complex_in @beta { params { @in complex: Dummy.StructComplex; } return: bool; } - struct_complex_ptr_in { + struct_complex_ptr_in @beta { params { @in complex: ptr(Dummy.StructComplex); } return: bool; } - struct_complex_ptr_in_own { + struct_complex_ptr_in_own @beta { params { @in complex: ptr(Dummy.StructComplex) @owned; } return: bool; } - struct_complex_out { + struct_complex_out @beta { params { @out complex: Dummy.StructComplex; } return: bool; } - // struct_complex_ptr_out { + // struct_complex_ptr_out @beta { // params { // @out complex: ptr(Dummy.StructComplex); // } // return: bool; // } // - // struct_complex_ptr_out_own { + // struct_complex_ptr_out_own @beta { // params { // @out complex: ptr(Dummy.StructComplex) @owned; // } // return: bool; // } - struct_complex_return { + struct_complex_return @beta { return: Dummy.StructComplex; } - // struct_complex_ptr_return { + // struct_complex_ptr_return @beta { // return: ptr(Dummy.StructComplex); // } // - // struct_complex_ptr_return_own { + // struct_complex_ptr_return_own @beta { // return: ptr(Dummy.StructComplex) @owned; // } @@ -1502,7 +1502,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { } } - emit_event_with_struct_complex { + emit_event_with_struct_complex @beta { params { @in data: Dummy.StructComplex; } @@ -1627,7 +1627,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { evt,with,obj @hot: Dummy.Test_Object; evt,with,error @hot: Eina.Error; evt,with,struct @hot: Dummy.StructSimple; - evt,with,struct,complex @hot: Dummy.StructComplex; + evt,with,struct,complex @beta @hot: Dummy.StructComplex; evt,with,array @hot: const(array); evt_with,under @hot: void; From 3e50379a5d990a891bc7f3acac3e6b77ea6e6ea9 Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Fri, 5 Jul 2019 15:48:14 -0300 Subject: [PATCH 4/6] csharp: fix build warning related with an unused field in an unit test --- src/tests/efl_mono/Inheritance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/efl_mono/Inheritance.cs b/src/tests/efl_mono/Inheritance.cs index 74c1086e78..26f51c591b 100644 --- a/src/tests/efl_mono/Inheritance.cs +++ b/src/tests/efl_mono/Inheritance.cs @@ -54,7 +54,7 @@ protected override void Dispose(bool disposing) internal class Inherit3Child : Dummy.TestObject { - Inherit3Parent parent; + //Inherit3Parent parent; public Inherit3Child(Inherit3Parent parent) : base(parent) { // WARNING: Uncommenting the line below causes the parent-child cycle to leak. From 8cb80897308e1bc98989830860e5210f253b9cab Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Fri, 5 Jul 2019 15:50:02 -0300 Subject: [PATCH 5/6] csharp: fix some build warnings related with incorrect and missing documentation Some parameter names, tag names and cref identifiers in the documentation were incorrect and causing warnings during compilation. There were also warnings related with missing documentation in publicly visible elements in the manual binding. This commit fixes these incorrections and adds documentation to the manual binding in order to solve these compilation warnings. Warnings related with missing documentation in `.eo` files are still present. --- src/bin/eolian_mono/eolian/mono/klass.hh | 3 +- .../mono/eina_mono/eina_stringshare.cs | 68 +++++++++---------- src/bindings/mono/eo_mono/EoWrapper.cs | 30 +++++++- src/bindings/mono/eo_mono/iwrapper.cs | 4 +- 4 files changed, 66 insertions(+), 39 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index 8f9932664b..c34d7c06e0 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -214,6 +214,7 @@ struct klass << scope_tab << scope_tab << name_helpers::klass_get_name(cls) << "();\n" << scope_tab << "/// Initializes a new instance of the class.\n" << scope_tab << "/// Internal usage: This is used when interacting with C code and should not be used directly.\n" + << scope_tab << "/// The native pointer to be wrapped.\n" << scope_tab << "private " << concrete_name << "(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n" << scope_tab << "{\n" << scope_tab << "}\n\n" @@ -510,7 +511,7 @@ struct klass << scope_tab << "}\n\n" << scope_tab << "/// Initializes a new instance of the class.\n" << scope_tab << "/// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.\n" - << scope_tab << "/// The native pointer to be wrapped.\n" + << scope_tab << "/// The native pointer to be wrapped.\n" << scope_tab << "protected " << inherit_name << "(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n" << scope_tab << "{\n" << scope_tab << "}\n\n" diff --git a/src/bindings/mono/eina_mono/eina_stringshare.cs b/src/bindings/mono/eina_mono/eina_stringshare.cs index 087db51bce..5b97e731e4 100644 --- a/src/bindings/mono/eina_mono/eina_stringshare.cs +++ b/src/bindings/mono/eina_mono/eina_stringshare.cs @@ -47,29 +47,29 @@ public static partial class NativeMethods /// public class Stringshare : IEquatable, IEquatable { - /// + /// /// Main constructor. Wrap the given string. /// Have private acess to avoid wrapping a null reference, /// use convertion or the factory method to create a new instance. - /// - /// - /// + /// + /// + /// private Stringshare(string s) { Str = s; } - /// + /// /// Auto-implemented property that holds the wrapped string value. - /// + /// public string Str { get; private set; } - /// + /// /// Factory method to instantiate a new object. /// Get a wrappper for the given string or a null reference if the given /// string reference is also null. - /// - /// + /// + /// /// /// A new instance wrapping the given string, or a null reference if /// the given string reference is also null. @@ -84,9 +84,9 @@ public static Stringshare Create(string s) return new Stringshare(s); } - /// + /// /// Implicit convertion to string. - /// + /// public static implicit operator string(Stringshare ss) { if (ReferenceEquals(null, ss)) @@ -97,13 +97,13 @@ public static implicit operator string(Stringshare ss) return ss.Str; } - /// + /// /// Implicit convertion from string to Stringshare. - /// + /// /// /// Note that this method can be used to create an instance of this class, /// either via an explicit cast or an implicit convertion. - /// + /// /// public static implicit operator Stringshare(string s) { @@ -115,9 +115,9 @@ public static implicit operator Stringshare(string s) return new Stringshare(s); } - /// + /// /// Check two Stringshare objects for equality. - /// + /// /// /// True if both wrapped strings have the same content or if both /// references are null, false otherwise. @@ -128,9 +128,9 @@ public static implicit operator Stringshare(string s) } - /// + /// /// Check two Stringshare objects for inequality. - /// + /// /// /// True if the wrapped strings have different content or if one reference is null /// and the other is not, false otherwise. @@ -140,20 +140,20 @@ public static implicit operator Stringshare(string s) return !(ss1 == ss2); } - /// + /// /// Returns the wrapped string. - /// - /// - /// + /// + /// + /// /// The wrapped string. Same as the property Str. public override string ToString() { return Str; } - /// + /// /// Override of GetHashCode for consistency with user-defined equality methods. - /// + /// /// /// The wrapped string hash code. /// @@ -162,9 +162,9 @@ public override int GetHashCode() return Str.GetHashCode(); } - /// + /// /// Check the given object for equality. - /// + /// /// /// True if the given object is the same object or if it is another Stringshare object /// and both wrapped strings are equal or if it is a string object and its content @@ -191,9 +191,9 @@ public override bool Equals(object other) return other.GetType() == typeof(Stringshare) && this == ((Stringshare)other); } - /// + /// /// Check the given Stringshare for equality. - /// + /// /// /// True if the given Stringshare object is not null and its wrapped string /// have the same content of this.Str, false otherwise. @@ -203,9 +203,9 @@ public bool Equals(Stringshare other) return this == other; } - /// + /// /// Check the given Stringshare for equality. - /// + /// /// /// True if the given string is not null and the wrapped string have the same /// content of the given string, false otherwise. @@ -215,11 +215,11 @@ public bool Equals(string other) return this.Str == other; } - /// + /// /// Get the wrapped string. - /// - /// - /// + /// + /// + /// /// The wrapped string. Same as the property Str. public string Get() { diff --git a/src/bindings/mono/eo_mono/EoWrapper.cs b/src/bindings/mono/eo_mono/EoWrapper.cs index 5b14b48695..03edea018c 100644 --- a/src/bindings/mono/eo_mono/EoWrapper.cs +++ b/src/bindings/mono/eo_mono/EoWrapper.cs @@ -10,8 +10,15 @@ namespace Efl namespace Eo { +/// +/// Abstract class that delivers base level binding to Efl Objects. +/// +/// Most of it is protected functionalities to serve the generated +/// binding classes that inherit from it. +/// public abstract class EoWrapper : IWrapper, IDisposable { + /// Object used to synchronize access to EFL events. protected readonly object eflBindingEventLock = new object(); private bool generated = true; private System.IntPtr handle = IntPtr.Zero; @@ -49,7 +56,7 @@ protected EoWrapper(ConstructingHandle ch) /// Initializes a new instance of the class. /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly. /// Do not implement this constructor. - /// The native pointer to be wrapped. + /// The native pointer to be wrapped. protected EoWrapper(Efl.Eo.Globals.WrappingHandle wh) { handle = wh.NativeHandle; @@ -124,6 +131,15 @@ public abstract System.IntPtr NativeClass get; } + /// + /// Whether this object type is one of the generated binding classes or a custom + /// class defined by the user and that inherit from one of the generated ones. + /// + /// + /// True if this object type is one of the generated binding classes, + /// false if it is class that is manually defined and that inherits from + /// one of the generated ones, including user defined classes. + /// protected bool IsGeneratedBindingClass { get { return generated; } @@ -269,7 +285,7 @@ private static void OwnershipSharedCallback(IntPtr data, ref Efl.Event.NativeStr ws.MakeShared(); } - /// Create and set to the internal native state a C# supervisor for this Eo wrapper. For internal use only. + /// Create and set to the internal native state a C# supervisor for this Eo wrapper. For internal use only. private void AddWrapperSupervisor() { var ws = new Efl.Eo.WrapperSupervisor(this); @@ -291,16 +307,24 @@ private void AddOwnershipEventHandlers() Eina.Error.RaiseIfUnhandledException(); } + /// + /// Struct to be used when constructing objects from native code. + /// Wraps the pointer handle to the native object instance. + /// protected struct ConstructingHandle { + /// Constructor for wrapping the native handle. public ConstructingHandle(IntPtr h) { NativeHandle = h; } + /// Pointer to the native instance. public IntPtr NativeHandle { get; private set; } } + /// Wrapper for native methods and virtual method delegates. + /// For internal use by generated code only. public abstract class NativeMethods : Efl.Eo.NativeClass { private static EflConstructorDelegate csharpEflConstructorStaticDelegate = new EflConstructorDelegate(Constructor); @@ -308,6 +332,8 @@ public abstract class NativeMethods : Efl.Eo.NativeClass private delegate IntPtr EflConstructorDelegate(IntPtr obj, IntPtr pd); + /// Gets the list of Eo operations to override. + /// The list of Eo operations to be overload. public override System.Collections.Generic.List GetEoOps(Type type) { var descs = new System.Collections.Generic.List(); diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs index 7c2eeb452b..833ae78302 100644 --- a/src/bindings/mono/eo_mono/iwrapper.cs +++ b/src/bindings/mono/eo_mono/iwrapper.cs @@ -716,11 +716,11 @@ public static void ThreadSafeFreeCbExec(EinaFreeCb cbFreeCb, IntPtr cbData) Monitor.Exit(Efl.All.InitLock); } - /// + /// /// Internal struct used by the binding to pass the native handle pointer /// to the managed object wrapping constructor. /// Internal usage only: do not use this class in inherited classes. - /// + /// public struct WrappingHandle { public WrappingHandle(IntPtr h) From 136fae4e4267d37ab376938f2eda52a456ed1932 Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Fri, 5 Jul 2019 17:01:58 -0300 Subject: [PATCH 6/6] cxx: fix some compilation warnings in C++ examples Fix some warnings in the C++ examples for elementary. These examples are build by default in the normal meson compilation. Only accidental warnings were fixed, explicit warnings using the `#warning` preprocessor directive were maintained. --- src/examples/elementary/bg_cxx_example_01.cc | 2 ++ src/examples/elementary/button_cxx_example_00.cc | 2 ++ src/examples/elementary/button_cxx_example_01.cc | 2 ++ src/examples/elementary/calendar_cxx_example_02.cc | 1 + src/examples/elementary/radio_cxx_example_01.cc | 2 ++ src/examples/elementary/slider_cxx_example.cc | 2 ++ src/examples/elementary/toolbar_cxx_example_01.cc | 2 ++ 7 files changed, 13 insertions(+) diff --git a/src/examples/elementary/bg_cxx_example_01.cc b/src/examples/elementary/bg_cxx_example_01.cc index 5c8a61e198..4c1368a9b9 100644 --- a/src/examples/elementary/bg_cxx_example_01.cc +++ b/src/examples/elementary/bg_cxx_example_01.cc @@ -1,5 +1,7 @@ #define EFL_CXXPERIMENTAL // for background part +#ifndef EFL_BETA_API_SUPPORT #define EFL_BETA_API_SUPPORT +#endif #include using efl::eo::instantiate; diff --git a/src/examples/elementary/button_cxx_example_00.cc b/src/examples/elementary/button_cxx_example_00.cc index ff9f569c18..2d58c7fc03 100644 --- a/src/examples/elementary/button_cxx_example_00.cc +++ b/src/examples/elementary/button_cxx_example_00.cc @@ -1,7 +1,9 @@ // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` button_cxx_example_00.cc -o button_cxx_example_00 #define EFL_CXXPERIMENTAL +#ifndef EFL_BETA_API_SUPPORT #define EFL_BETA_API_SUPPORT +#endif #include #include diff --git a/src/examples/elementary/button_cxx_example_01.cc b/src/examples/elementary/button_cxx_example_01.cc index 4c53ba68c2..47b1b9deb3 100644 --- a/src/examples/elementary/button_cxx_example_01.cc +++ b/src/examples/elementary/button_cxx_example_01.cc @@ -1,7 +1,9 @@ // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` button_cxx_example_01.cc -o button_cxx_example_01 #define EFL_CXXPERIMENTAL +#ifndef EFL_BETA_API_SUPPORT #define EFL_BETA_API_SUPPORT +#endif #include using efl::eo::instantiate; diff --git a/src/examples/elementary/calendar_cxx_example_02.cc b/src/examples/elementary/calendar_cxx_example_02.cc index e666ae844a..dba2b1a3ec 100644 --- a/src/examples/elementary/calendar_cxx_example_02.cc +++ b/src/examples/elementary/calendar_cxx_example_02.cc @@ -39,6 +39,7 @@ struct appData }, _1, _2); // FIXME XAR: I broke this and I do not know how to fix it // cal.format_func_set(cb_a); + (void)cb_a; } void destroy() { diff --git a/src/examples/elementary/radio_cxx_example_01.cc b/src/examples/elementary/radio_cxx_example_01.cc index 90a508e4e4..b561d028a9 100644 --- a/src/examples/elementary/radio_cxx_example_01.cc +++ b/src/examples/elementary/radio_cxx_example_01.cc @@ -1,7 +1,9 @@ // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` radio_cxx_example_01.cc -o radio_cxx_example_01 #define EFL_CXXPERIMENTAL +#ifndef EFL_BETA_API_SUPPORT #define EFL_BETA_API_SUPPORT +#endif #include #include diff --git a/src/examples/elementary/slider_cxx_example.cc b/src/examples/elementary/slider_cxx_example.cc index bc6bd76bdb..2540516572 100644 --- a/src/examples/elementary/slider_cxx_example.cc +++ b/src/examples/elementary/slider_cxx_example.cc @@ -1,7 +1,9 @@ // g++ -g `pkg-config --cflags --libs elementary-cxx efl-cxx eina-cxx eo-cxx ecore-cxx evas-cxx edje-cxx` slider_cxx_example.cc -o slider_cxx_example #define EFL_CXXPERIMENTAL +#ifndef EFL_BETA_API_SUPPORT #define EFL_BETA_API_SUPPORT +#endif #include using namespace std::placeholders; diff --git a/src/examples/elementary/toolbar_cxx_example_01.cc b/src/examples/elementary/toolbar_cxx_example_01.cc index 278a1bf9dd..19a99317c4 100644 --- a/src/examples/elementary/toolbar_cxx_example_01.cc +++ b/src/examples/elementary/toolbar_cxx_example_01.cc @@ -7,7 +7,9 @@ #warning This example requires yet unfinished EO APIs +#ifndef EFL_BETA_API_SUPPORT #define EFL_BETA_API_SUPPORT +#endif #include EAPI int