summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2015-03-26 11:48:09 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-04-14 01:06:57 -0300
commitce36f0be936f218d87055cf21b643ab327f07853 (patch)
treefde18f8d5e3e33b57583ba321e61e7f4a07de224 /src/examples
parent72604d49574dba6d540d631895facbbc9b12bb2f (diff)
eolain_cxx: Fix C++ support for new Eolian features
Added optional constructor methods for C++ Eolian wrappers. Changed the interface of wrappers' main constructors. If there are optional constructor methods they should be passed as variadic template argument at the end of the constructor. To support variadic template arguments, the optional "parent" parameter is now the first parameter and there is another constructor without the "parent" parameter. Checking for @optinal and @nullable attributes instead of @nonull. Now @nonull is the default, and eina::optional is only used when @optional or @nullable attribute is specified. The names of constructor methods no longer have the class name prefixed. Added unit tests for checking the binding of optional constructors. Added new .eo file to be used in the test. Changed the generated documentation of constructors. Changed the efl::eo::inherit accordingly, to address these new features. Now the constructor methods should be explicit called in the efl::eo::inherit constructor, which will receive them via variadic template arguments. Added another constructor to efl::eo::inherit for passing the parent object. Updated some tests and examples to follow the new interface. Removed some code that is no longer necessary. Also, fix Eolian C++ support for constructing properties. fix assertion when parsing constructing properties. Now if a property is a constructing property eolian_cxx will generate a constructor method that have the property name (without the "_set" suffix).
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_callbacks_01.cc2
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_inherit_01.cc4
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_simple_01.cc4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/examples/eolian_cxx/eolian_cxx_callbacks_01.cc b/src/examples/eolian_cxx/eolian_cxx_callbacks_01.cc
index 8c41c0e..c9334bc 100644
--- a/src/examples/eolian_cxx/eolian_cxx_callbacks_01.cc
+++ b/src/examples/eolian_cxx/eolian_cxx_callbacks_01.cc
@@ -28,7 +28,7 @@ example_callbacks()
28{ 28{
29 int count = 0; 29 int count = 0;
30 efl::ecore::poller poller( 30 efl::ecore::poller poller(
31 poller.ecore_poller_constructor(ECORE_POLLER_CORE, 1, 31 poller.constructor(ECORE_POLLER_CORE, 1,
32 [&count, &poller] 32 [&count, &poller]
33 { 33 {
34 if (++count == 5) 34 if (++count == 5)
diff --git a/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc b/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc
index 0e6fce9..bdfa3ad 100644
--- a/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc
+++ b/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc
@@ -17,7 +17,7 @@ struct ColourableCircle
17 : efl::eo::inherit<ColourableCircle, ::colourable> 17 : efl::eo::inherit<ColourableCircle, ::colourable>
18{ 18{
19 ColourableCircle(int rgb) 19 ColourableCircle(int rgb)
20 : inherit_base(efl::eo::args<::colourable>(rgb)) 20 : inherit_base(::colourable::rgb_24bits_constructor(rgb))
21 {} 21 {}
22 22
23 int colour_get() 23 int colour_get()
@@ -46,7 +46,7 @@ struct ColourableBar
46 : efl::eo::inherit<ColourableBar, ::colourablesquare> 46 : efl::eo::inherit<ColourableBar, ::colourablesquare>
47{ 47{
48 ColourableBar() 48 ColourableBar()
49 : inherit_base(efl::eo::args<::colourablesquare>(0)) 49 : inherit_base(::colourable::rgb_24bits_constructor(0))
50 {} 50 {}
51 51
52 int colour_get() 52 int colour_get()
diff --git a/src/examples/eolian_cxx/eolian_cxx_simple_01.cc b/src/examples/eolian_cxx/eolian_cxx_simple_01.cc
index 47b98cb..04acebb 100644
--- a/src/examples/eolian_cxx/eolian_cxx_simple_01.cc
+++ b/src/examples/eolian_cxx/eolian_cxx_simple_01.cc
@@ -19,13 +19,13 @@ main()
19 19
20 int r, g, b; 20 int r, g, b;
21 ::colourable obj1( 21 ::colourable obj1(
22 obj1.colourable_rgb_24bits_constructor(0x123456) 22 obj1.rgb_24bits_constructor(0x123456)
23 ); 23 );
24 obj1.colour_set(0xc0ffee); 24 obj1.colour_set(0xc0ffee);
25 obj1.composite_colour_get(&r, &g, &b); 25 obj1.composite_colour_get(&r, &g, &b);
26 26
27 ::colourablesquare obj2( 27 ::colourablesquare obj2(
28 obj2.colourablesquare_size_constructor(10) 28 obj2.size_constructor(10)
29 ); 29 );
30 obj2.composite_colour_set(r, g, b); 30 obj2.composite_colour_set(r, g, b);
31 obj2.size_set(11); 31 obj2.size_set(11);