cxx: Fix examples compilation.
authorLauro Moura <lauromoura@expertisesolutions.com.br>
Mon, 11 Mar 2019 15:34:45 +0000 (11:34 -0400)
committerJunsuChoi <jsuya.choi@samsung.com>
Fri, 15 Mar 2019 04:23:19 +0000 (13:23 +0900)
Summary:
- Changed beta methods guards from CLASS_NAME_GUARD to
  EFL_BETA_API_SUPPORT to use the same scheme as C.
- Removed some includes to Efl_Ui.h from the examples. These were
  causing C's efl_part_get to not be generated due to EFL_PART_PROTECTED
  not being yet defined (it is defined in Elementary.hh, included
  afterwards). This was leading to Efl.Part.impl.hh trying to use a
  non-existent method.

Fixes T7716 partially (missing stringshare issue)

Test Plan: make examples

Reviewers: stefan_schmidt, felipealmeida, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7716

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

src/examples/elementary/bg_cxx_example_01.cc
src/examples/elementary/bg_cxx_example_02.cc
src/examples/elementary/button_cxx_example_00.cc
src/examples/elementary/button_cxx_example_01.cc
src/examples/elementary/radio_cxx_example_01.cc
src/examples/elementary/slider_cxx_example.cc
src/examples/elementary/toolbar_cxx_example_01.cc
src/lib/eolian_cxx/grammar/function_declaration.hpp
src/lib/eolian_cxx/grammar/function_definition.hpp

index 7e0724c3cac5fae6d5c7034ac107218783f036cc..5919d185312161c7ff1febd2e7dfff086198b00c 100644 (file)
@@ -1,4 +1,5 @@
 #define EFL_CXXPERIMENTAL // for background part
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 
 using efl::eo::instantiate;
index 94c17e3dcfca2c47f43299711a2cb25a33149454..f88329d2ebd8a8a199032521b6645c31941d707d 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #define EFL_CXXPERIMENTAL
+#define EFL_BETA_API_SUPPORT
 
 #include <Elementary.hh>
 
index d44f18a92464970d313514baaf79034da9203641..a0cdb1c566cd2fe5a3122d80ca84d0825f97731c 100644 (file)
@@ -1,6 +1,7 @@
 // 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
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 #include <iostream>
 
index c818897fbb3ed1ec752b1e1c58baaccb698d2691..3136f6ac04e938bdd01cc84a30972319e5c2c5fa 100644 (file)
@@ -1,7 +1,7 @@
 // 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
-#include <Efl_Ui.h>
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 
 using efl::eo::instantiate;
index 2ad30b20973c904544618235f7c0f9612e8089c8..e72fe9f55edf6bb908e889a43f1a84a3aa630c5a 100644 (file)
@@ -1,7 +1,7 @@
 // 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
-#include <Efl_Ui.h>
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 #include <iostream>
 
index 1df1903bf5854cee659a06d13c160e639b91dd1f..82846257cfd94922264797150c1bad25492c60be 100644 (file)
@@ -1,8 +1,7 @@
 // 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
-
-#include <Efl_Ui.h>
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 
 using namespace std::placeholders;
index 77ad3eb5692a6abcc2d563e0bfd68a5b8acfe32b..6f4e83be89ad5e8fd758bfca5fce86e3135990d4 100644 (file)
@@ -7,7 +7,7 @@
 
 #warning This example requires yet unfinished EO APIs
 
-#include <Efl_Ui.h>
+#define EFL_BETA_API_SUPPORT
 #include <Elementary.hh>
 
 EAPI int
index dc6a969a58f366c6a54868c7082537c04623f269..1ae63df857a39b9be423663e6af3a813ea9ec130 100644 (file)
@@ -44,8 +44,8 @@ struct function_declaration_generator
         }
 
       if(f.is_beta &&
-            !as_generator("#ifdef " << *(string << "_") << string << "_BETA\n")
-            .generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name), add_upper_case_context(ctx)))
+            !as_generator(lit("#ifdef EFL_BETA_API_SUPPORT\n"))
+            .generate(sink, attributes::unused, ctx))
         return false;
       if(f.is_protected &&
             !as_generator("#ifdef " << *(string << "_") << string << "_PROTECTED\n")
index 893218155c77f34f8583de11a1037e36f2a29b4e..c5de8ce531c032bbb9a70310b9ebdc99aa317820 100644 (file)
@@ -50,8 +50,8 @@ struct function_definition_generator
         }
       
       if(f.is_beta &&
-         !as_generator("#ifdef " << *(string << "_") << string << "_BETA\n")
-         .generate(sink, std::make_tuple(_klass_name.namespaces, _klass_name.eolian_name), add_upper_case_context(ctx)))
+         !as_generator(lit("#ifdef EFL_BETA_API_SUPPORT\n"))
+         .generate(sink, attributes::unused, ctx))
         return false;
       if(f.is_protected &&
          !as_generator("#ifdef " << *(string << "_") << string << "_PROTECTED\n")