summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-06-16 14:24:45 +0100
committerTom Hacohen <tom@stosb.com>2014-08-21 11:02:10 +0100
commit17e99e6750795ade36afd8e80a30e5c0e15e874f (patch)
tree26e7a21daf758048a0cd0bc72ebde3506f767e6d /src
parent9969737640c52c691f81e6395e54720f875511c0 (diff)
Ecore mainloop: Add .eo implementation.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Ecore.am4
-rw-r--r--src/lib/ecore/Ecore_Eo.h15
-rw-r--r--src/lib/ecore/ecore_main.c55
-rw-r--r--src/lib/ecore/ecore_mainloop.eo34
4 files changed, 108 insertions, 0 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index c5170e061c..3cd93208f0 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -21,6 +21,8 @@ BUILT_SOURCES += \
21 lib/ecore/ecore_animator.eo.c \ 21 lib/ecore/ecore_animator.eo.c \
22 lib/ecore/ecore_animator.eo.h \ 22 lib/ecore/ecore_animator.eo.h \
23 lib/ecore/ecore_animator.eo.legacy.h \ 23 lib/ecore/ecore_animator.eo.legacy.h \
24 lib/ecore/ecore_mainloop.eo.c \
25 lib/ecore/ecore_mainloop.eo.h \
24 lib/ecore/ecore_parent.eo.c \ 26 lib/ecore/ecore_parent.eo.c \
25 lib/ecore/ecore_parent.eo.h 27 lib/ecore/ecore_parent.eo.h
26 28
@@ -33,6 +35,7 @@ ecoreeolianfiles_DATA = \
33 lib/ecore/ecore_idle_enterer.eo \ 35 lib/ecore/ecore_idle_enterer.eo \
34 lib/ecore/ecore_idle_exiter.eo \ 36 lib/ecore/ecore_idle_exiter.eo \
35 lib/ecore/ecore_animator.eo \ 37 lib/ecore/ecore_animator.eo \
38 lib/ecore/ecore_mainloop.eo \
36 lib/ecore/ecore_parent.eo 39 lib/ecore/ecore_parent.eo
37 40
38EXTRA_DIST += \ 41EXTRA_DIST += \
@@ -56,6 +59,7 @@ nodist_installed_ecoremainheaders_DATA = \
56 lib/ecore/ecore_idle_enterer.eo.h \ 59 lib/ecore/ecore_idle_enterer.eo.h \
57 lib/ecore/ecore_idle_exiter.eo.h \ 60 lib/ecore/ecore_idle_exiter.eo.h \
58 lib/ecore/ecore_animator.eo.h \ 61 lib/ecore/ecore_animator.eo.h \
62 lib/ecore/ecore_mainloop.eo.h \
59 lib/ecore/ecore_parent.eo.h \ 63 lib/ecore/ecore_parent.eo.h \
60 lib/ecore/ecore_timer.eo.legacy.h \ 64 lib/ecore/ecore_timer.eo.legacy.h \
61 lib/ecore/ecore_poller.eo.legacy.h \ 65 lib/ecore/ecore_poller.eo.legacy.h \
diff --git a/src/lib/ecore/Ecore_Eo.h b/src/lib/ecore/Ecore_Eo.h
index 8974a5e680..e74d1f87a7 100644
--- a/src/lib/ecore/Ecore_Eo.h
+++ b/src/lib/ecore/Ecore_Eo.h
@@ -67,6 +67,21 @@ extern "C" {
67 * @} 67 * @}
68 */ 68 */
69 69
70/**
71 * @ingroup Ecore_MainLoop_Group
72 *
73 * @{
74 */
75
76#include "ecore_mainloop.eo.h"
77
78/* We ue the factory pattern here, so you shouldn't call eo_add directly. */
79EAPI Eo *ecore_main_loop_get(void);
80
81/**
82 * @}
83 */
84
70#ifdef __cplusplus 85#ifdef __cplusplus
71} 86}
72#endif 87#endif
diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c
index adb6ae3a66..6a9ee1d6c7 100644
--- a/src/lib/ecore/ecore_main.c
+++ b/src/lib/ecore/ecore_main.c
@@ -2309,3 +2309,58 @@ _ecore_main_win32_select(int nfds EINA_UNUSED,
2309} 2309}
2310 2310
2311#endif 2311#endif
2312
2313static Eo *_mainloop_singleton = NULL;
2314
2315EAPI Eo *ecore_main_loop_get(void)
2316{
2317 if (!_mainloop_singleton)
2318 {
2319 _mainloop_singleton = eo_add(ECORE_MAINLOOP_CLASS, NULL);
2320 }
2321
2322 return _mainloop_singleton;
2323}
2324
2325EOLIAN static void
2326_ecore_mainloop_select_func_set(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Ecore_Select_Function select_func)
2327{
2328 ecore_main_loop_select_func_set(select_func);
2329}
2330
2331EOLIAN static Ecore_Select_Function
2332_ecore_mainloop_select_func_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
2333{
2334 return ecore_main_loop_select_func_get();
2335}
2336
2337EOLIAN static void
2338_ecore_mainloop_iterate(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
2339{
2340 ecore_main_loop_iterate();
2341}
2342
2343EOLIAN static int _ecore_mainloop_iterate_may_block(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, int may_block)
2344{
2345 return ecore_main_loop_iterate_may_block(may_block);
2346}
2347
2348EOLIAN static void
2349_ecore_mainloop_begin(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
2350{
2351 ecore_main_loop_begin();
2352}
2353
2354EOLIAN static void
2355_ecore_mainloop_quit(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
2356{
2357 ecore_main_loop_quit();
2358}
2359
2360EOLIAN static Eina_Bool
2361_ecore_mainloop_animator_ticked(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
2362{
2363 return ecore_main_loop_animator_ticked_get();
2364}
2365
2366#include "ecore_mainloop.eo.c"
diff --git a/src/lib/ecore/ecore_mainloop.eo b/src/lib/ecore/ecore_mainloop.eo
new file mode 100644
index 0000000000..c33568f7b1
--- /dev/null
+++ b/src/lib/ecore/ecore_mainloop.eo
@@ -0,0 +1,34 @@
1class Ecore_Mainloop (Eo_Base)
2{
3 legacy_prefix: null;
4 data: null;
5 properties {
6 select_func {
7 set {
8 }
9 get {
10 }
11 values {
12 Ecore_Select_Function select_func;
13 }
14 }
15 }
16 methods {
17 iterate {
18 }
19 iterate_may_block {
20 return int;
21 params {
22 int may_block;
23 }
24 }
25 begin {
26 }
27 quit {
28 }
29 animator_ticked {
30 /* FIXME: Should it be a prooperty? */
31 return Eina_Bool;
32 }
33 }
34}