summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/eolian_cxx/eolian_cxx_inherit_01.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc b/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc
index b258f05d1c..0e6fce92f0 100644
--- a/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc
+++ b/src/examples/eolian_cxx/eolian_cxx_inherit_01.cc
@@ -30,7 +30,7 @@ struct ColourableCircle
30 } 30 }
31}; 31};
32 32
33 33/*
34struct ColourableFoo 34struct ColourableFoo
35 : efl::eo::inherit<ColourableFoo, 35 : efl::eo::inherit<ColourableFoo,
36 ::colourable, 36 ::colourable,
@@ -40,6 +40,24 @@ struct ColourableFoo
40 : inherit_base(efl::eo::args<::colourable>(size) 40 : inherit_base(efl::eo::args<::colourable>(size)
41 , efl::eo::args<::colourablesquare>(rgb)) 41 , efl::eo::args<::colourablesquare>(rgb))
42 {} 42 {}
43};*/
44
45struct ColourableBar
46 : efl::eo::inherit<ColourableBar, ::colourablesquare>
47{
48 ColourableBar()
49 : inherit_base(efl::eo::args<::colourablesquare>(0))
50 {}
51
52 int colour_get()
53 {
54 int rgb = 0;
55 eo_do_super(_eo_ptr(), _eo_class(), rgb = ::colourable_colour_get());
56 std::cout << "ColourableBar::colour_get(" << this << ") ==> "
57 << std::hex << rgb << std::endl;
58 return rgb;
59 }
60
43}; 61};
44 62
45int 63int
@@ -55,6 +73,10 @@ main()
55 int r, g, b; 73 int r, g, b;
56 obj2.composite_colour_get(&r, &g, &b); 74 obj2.composite_colour_get(&r, &g, &b);
57 75
76
77 ColourableBar obj3;
78 obj3.composite_colour_get(&r, &g, &b);
79
58 assert(r == 0xc0); 80 assert(r == 0xc0);
59 assert(g == 0xff); 81 assert(g == 0xff);
60 assert(b == 0xee); 82 assert(b == 0xee);