forked from enlightenment/efl
eolian-cxx: Updated the examples according to the new syntax.
This commit is contained in:
parent
04d90ae131
commit
f60394c1af
|
@ -20,14 +20,14 @@
|
|||
#include <ecore_poll.eo.hh>
|
||||
|
||||
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]
|
||||
{
|
||||
|
|
|
@ -17,19 +17,19 @@
|
|||
#include <Ecore.hh>
|
||||
#include <Evas.hh>
|
||||
|
||||
#include <canvas/evas.eo.hh>
|
||||
#include <canvas/evas_canvas.eo.hh>
|
||||
#include <canvas/evas_text.eo.hh>
|
||||
#include <canvas/evas_rectangle.eo.hh>
|
||||
#include <canvas/evas_zoomable_interface.eo.hh>
|
||||
|
||||
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);
|
||||
|
|
|
@ -17,20 +17,20 @@
|
|||
#include <Ecore.hh>
|
||||
#include <Evas.hh>
|
||||
|
||||
#include <canvas/evas.eo.hh>
|
||||
#include <canvas/evas_canvas.eo.hh>
|
||||
#include <canvas/evas_text.eo.hh>
|
||||
#include <canvas/evas_image.eo.hh>
|
||||
#include <canvas/evas_box.eo.hh>
|
||||
|
||||
|
||||
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;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue