From b30a2dfba7952046db8c332c46541a63cac785f1 Mon Sep 17 00:00:00 2001 From: Savio Sena Date: Thu, 17 Jul 2014 04:14:01 -0300 Subject: [PATCH] eolian-cxx: Updated the examples according to the new syntax. --- eolian_cxx/eolian_cxx_complex_types_01.cc | 28 +++++++++---------- eolian_cxx/eolian_cxx_eo_events_01.cc | 24 ++++++++-------- .../eolian_cxx/eolian_cxx_callbacks_01.cc | 4 +-- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/eolian_cxx/eolian_cxx_complex_types_01.cc b/eolian_cxx/eolian_cxx_complex_types_01.cc index cc2c7604..d2eaac2b 100644 --- a/eolian_cxx/eolian_cxx_complex_types_01.cc +++ b/eolian_cxx/eolian_cxx_complex_types_01.cc @@ -17,19 +17,19 @@ #include #include -#include +#include #include #include #include namespace efl { namespace evas { // XXX only while we don't have namespaces in EFL -using evas_base = ::evas; -using ::evas_object; -using ::evas_text; -using ::evas_grid; -using ::evas_rectangle; -using ::evas_common_interface; -using ::evas_zoomable_interface; +using ::evas::canvas; +using ::evas::object; +using ::evas::text; +using ::evas::grid; +using ::evas::rectangle; +using ::evas::common_interface; +using ::evas::zoomable_interface; } } namespace { @@ -64,21 +64,21 @@ void example_complex_types() { _ecore_evas_init(); - efl::evas::evas_base canvas(::eo_ref(::ecore_evas_get(ee))); + efl::evas::canvas canvas(::eo_ref(::ecore_evas_get(ee))); - ::evas_rectangle bg(efl::eo::parent = canvas); + efl::evas::rectangle bg(efl::eo::parent = canvas); bg.color_set(255, 255, 255, 255); bg.position_set(0, 0); bg.size_set(500, 250); bg.visibility_set(true); - efl::evas::evas_grid grid(efl::eo::parent = canvas); + efl::evas::grid grid(efl::eo::parent = canvas); grid.position_set(0, 0); grid.color_set(0, 0, 0, 255); grid.size_set(5, 5); grid.visibility_set(true); - efl::evas::evas_text text1(efl::eo::parent = canvas); + efl::evas::text text1(efl::eo::parent = canvas); text1.style_set(EVAS_TEXT_STYLE_OUTLINE); text1.color_set(255, 0, 0, 255); text1.font_set("DejaVu", 32); @@ -86,9 +86,9 @@ example_complex_types() text1.visibility_set(true); int t1w, t1h; text1.size_get(&t1w, &t1h); - grid.pack(text1, 1, 1, t1w, t1h); + grid.pack(text1._eo_ptr(), 1, 1, t1w, t1h); - efl::evas::evas_text text2(efl::eo::parent = canvas); + efl::evas::text text2(efl::eo::parent = canvas); text2.style_set(EVAS_TEXT_STYLE_PLAIN); text2.color_set(0, 120, 0, 255); text2.position_set(t1w+50, t1h+50); diff --git a/eolian_cxx/eolian_cxx_eo_events_01.cc b/eolian_cxx/eolian_cxx_eo_events_01.cc index e3563cee..abb23c2e 100644 --- a/eolian_cxx/eolian_cxx_eo_events_01.cc +++ b/eolian_cxx/eolian_cxx_eo_events_01.cc @@ -17,20 +17,20 @@ #include #include -#include +#include #include #include #include namespace efl { namespace evas { -using evas_base = ::evas; -using ::evas_object; -using ::evas_text; -using ::evas_grid; -using ::evas_rectangle; -using ::evas_common_interface; -using ::evas_zoomable_interface; +using ::evas::canvas; +using ::evas::object; +using ::evas::text; +using ::evas::grid; +using ::evas::rectangle; +using ::evas::common_interface; +using ::evas::zoomable_interface; } } namespace { @@ -67,9 +67,9 @@ example_complex_types() _ecore_evas_init(); { - efl::evas::evas_base canvas(::eo_ref(::ecore_evas_get(ee))); + efl::evas::canvas canvas(::eo_ref(::ecore_evas_get(ee))); - ::evas_rectangle bg(efl::eo::parent = canvas); + efl::evas::rectangle bg(efl::eo::parent = canvas); bg.color_set(255, 255, 255, 255); bg.position_set(0, 0); bg.size_set(500, 250); @@ -77,9 +77,9 @@ example_complex_types() efl::eo::signal_connection conn = bg.event_mouse_down_callback_add - ([] (::evas_object obj, Eo_Event_Description const& desc, void* info) + ([] (efl::evas::object obj, Eo_Event_Description const& desc, void* info) { - std::cout << "evas_box::mouse_down" << std::endl; + std::cout << "evas::box::mouse_down" << std::endl; return EO_CALLBACK_CONTINUE; }); diff --git a/unsorted/eolian_cxx/eolian_cxx_callbacks_01.cc b/unsorted/eolian_cxx/eolian_cxx_callbacks_01.cc index 4efff009..58377fe7 100644 --- a/unsorted/eolian_cxx/eolian_cxx_callbacks_01.cc +++ b/unsorted/eolian_cxx/eolian_cxx_callbacks_01.cc @@ -20,14 +20,14 @@ #include namespace efl { namespace ecore { -using ::ecore_poller; +using ::ecore::poller; } } void example_callbacks() { int count = 0; - efl::ecore::ecore_poller poller + efl::ecore::poller poller (ECORE_POLLER_CORE, 1, [&count, &poller] {