/// @{
struct instantiate_t {
+#ifdef EFL_CXXPERIMENTAL
/// @brief A helper to create objects with a different syntax
///
/// @param obj The object to instantiate
obj = T(*this);
return obj;
}
+#endif
};
/// @brief The handle to use to create real EFL objects
/// to trigger a real EFL object creation. The following syntax is preferred:
/// T obj(instantiate, ...);
instantiate_t const instantiate = {};
+
+#ifdef EFL_CXXPERIMENTAL
+instantiate_t const add = {};
+#endif
/// @brief Creates concrete versions for <em>Eo</em> wrappers.
///
-#define EFL_CXX_WREF_EASY
+#define EFL_CXXPERIMENTAL
#include <Elementary.hh>
-using efl::eo::instantiate;
using namespace std::placeholders;
+using efl::eo::add;
struct appData
{
void create() {
std::cout << "Hello!" << std::endl;
- instantiate(m_win);
+ add(m_win);
m_win.text_set("Calendar Layout Formatting Example");
m_win.delete_request_event_cb_add([&](){ destroy(); });
- efl::ui::Calendar cal(instantiate, m_win);
+ efl::ui::Calendar cal(add, m_win);
m_win.content_set(cal);
auto wcal(cal._get_wref());
<< scope_tab << "} const " << string_replace(',', '_') << "_event;\n"
))).generate(sink, std::vector<attributes::event_def>{e}, context))
return false;
+
+ /* EXPERIMENTAL: event_cb_add */
+ if (!as_generator("#ifdef EFL_CXXPERIMENTAL\n").generate(sink, attributes::unused, context))
+ return false;
if (!as_generator(
scope_tab << "template <typename F>\n"
<< scope_tab << "typename std::enable_if<std::is_bind_expression<F>::value, ::efl::eolian::signal_connection>::type\n"
<< scope_tab << "}\n")
.generate(sink, std::make_tuple(e.name, e.name), context))
return false;
+ if (!as_generator("#endif\n").generate(sink, attributes::unused, context))
+ return false;
+
if (e.beta && !as_generator("#endif\n").generate(sink, attributes::unused, context))
return false;
if (e.protect && !as_generator("#endif\n").generate(sink, attributes::unused, context))
"return ::efl::eo::wref<" << string << ">(*this); }\n"
).generate(sink, std::make_tuple(cls.cxx_name, cls.cxx_name), context)) return false;
- if(!as_generator("#ifdef EFL_CXX_WREF_EASY\n").generate(sink, attributes::unused, context)) return false;
+ // EXPERIMENTAL
+ if(!as_generator("#ifdef EFL_CXXPERIMENTAL\n").generate(sink, attributes::unused, context)) return false;
if(!as_generator( scope_tab << "const " << string << "* operator->() const { return this; }\n"
).generate(sink, std::make_tuple(cls.cxx_name, cls.cxx_name), context)) return false;
if(!as_generator( scope_tab << string << "* operator->() { return this; }\n"
).generate(sink, std::make_tuple(cls.cxx_name, cls.cxx_name), context)) return false;
- if(!as_generator("#endif \n").generate(sink, attributes::unused, context)) return false;
+ if(!as_generator("#endif \n").generate(sink, attributes::unused, context)) return false;
if(!as_generator( scope_tab << "::efl::eo::concrete const& _get_concrete() const { return *this; }\n"
<< scope_tab << "::efl::eo::concrete& _get_concrete() { return *this; }\n"