2014-07-16 12:32:56 -07:00
|
|
|
#include <iostream>
|
|
|
|
#include <thread>
|
|
|
|
#include <cassert>
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Eo.h>
|
|
|
|
#include <Ecore.h>
|
|
|
|
#include <Evas.h>
|
|
|
|
#include <Ecore_Evas.h>
|
|
|
|
|
|
|
|
#include <Eina.hh>
|
|
|
|
#include <Eo.hh>
|
|
|
|
#include <Ecore.hh>
|
|
|
|
#include <Evas.hh>
|
|
|
|
|
2014-09-03 11:13:38 -07:00
|
|
|
#include <ecore_poller.eo.hh>
|
2014-07-16 12:32:56 -07:00
|
|
|
|
|
|
|
namespace efl { namespace ecore {
|
2014-07-17 00:14:01 -07:00
|
|
|
using ::ecore::poller;
|
2014-07-16 12:32:56 -07:00
|
|
|
} }
|
|
|
|
|
|
|
|
void
|
|
|
|
example_callbacks()
|
|
|
|
{
|
|
|
|
int count = 0;
|
2014-11-11 14:37:47 -08:00
|
|
|
efl::ecore::poller poller(
|
|
|
|
poller.ecore_poller_constructor(ECORE_POLLER_CORE, 1,
|
2014-07-16 12:32:56 -07:00
|
|
|
[&count, &poller]
|
2014-11-11 14:37:47 -08:00
|
|
|
{
|
|
|
|
if (++count == 5)
|
|
|
|
{
|
|
|
|
std::cout << std::endl;
|
|
|
|
ecore_main_loop_quit();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
poller.interval_set(2*poller.interval_get());
|
|
|
|
std::cout << "." << std::flush;
|
|
|
|
return true;
|
|
|
|
})
|
|
|
|
);
|
2014-07-16 12:32:56 -07:00
|
|
|
::ecore_main_loop_begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
efl::eina::eina_init eina_;
|
|
|
|
efl::eo::eo_init eo_;
|
|
|
|
efl::ecore::ecore_init ecore_;
|
|
|
|
|
|
|
|
std::cerr << "[+] Running EFL++ example: Callbacks" << std::endl;
|
|
|
|
example_callbacks();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|