summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-05-05 16:18:18 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-05-05 17:03:07 -0700
commit05424556b0974ef5695f6f6305658cb62f479f27 (patch)
tree3d4cb4bcacc9c5f4f81350f11514400db85e50c7 /src
parente282ab61d74bfa919afc0d36338d4edcc7d546ab (diff)
ecore: add an efl.loop_user class.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Ecore.am8
-rw-r--r--src/lib/ecore/Ecore_Eo.h2
-rw-r--r--src/lib/ecore/efl_loop_user.c29
-rw-r--r--src/lib/ecore/efl_loop_user.eo15
4 files changed, 51 insertions, 3 deletions
diff --git a/src/Makefile_Ecore.am b/src/Makefile_Ecore.am
index b48d49f495..371f981e42 100644
--- a/src/Makefile_Ecore.am
+++ b/src/Makefile_Ecore.am
@@ -2,15 +2,16 @@
2### Library 2### Library
3 3
4ecore_eolian_files_legacy = \ 4ecore_eolian_files_legacy = \
5 lib/ecore/efl_timer.eo \
6 lib/ecore/ecore_poller.eo \ 5 lib/ecore/ecore_poller.eo \
7 lib/ecore/ecore_exe.eo \ 6 lib/ecore/ecore_exe.eo \
8 lib/ecore/ecore_animator.eo 7 lib/ecore/ecore_animator.eo
9 8
10ecore_eolian_files = \ 9ecore_eolian_files = \
11 $(ecore_eolian_files_legacy) \
12 lib/ecore/efl_loop.eo \ 10 lib/ecore/efl_loop.eo \
13 lib/ecore/ecore_parent.eo 11 lib/ecore/efl_loop_user.eo \
12 lib/ecore/efl_timer.eo \
13 lib/ecore/ecore_parent.eo \
14 $(ecore_eolian_files_legacy)
14 15
15ecore_eolian_type_files = \ 16ecore_eolian_type_files = \
16 lib/ecore/ecore_types.eot 17 lib/ecore/ecore_types.eot
@@ -58,6 +59,7 @@ lib/ecore/ecore_idle_exiter.c \
58lib/ecore/ecore_idler.c \ 59lib/ecore/ecore_idler.c \
59lib/ecore/ecore_job.c \ 60lib/ecore/ecore_job.c \
60lib/ecore/ecore_main.c \ 61lib/ecore/ecore_main.c \
62lib/ecore/efl_loop_user.c \
61lib/ecore/ecore_pipe.c \ 63lib/ecore/ecore_pipe.c \
62lib/ecore/ecore_poller.c \ 64lib/ecore/ecore_poller.c \
63lib/ecore/ecore_time.c \ 65lib/ecore/ecore_time.c \
diff --git a/src/lib/ecore/Ecore_Eo.h b/src/lib/ecore/Ecore_Eo.h
index 9db6e795b2..3106489696 100644
--- a/src/lib/ecore/Ecore_Eo.h
+++ b/src/lib/ecore/Ecore_Eo.h
@@ -62,6 +62,8 @@ extern "C" {
62 62
63#include "efl_loop.eo.h" 63#include "efl_loop.eo.h"
64 64
65#include "efl_loop_user.eo.h"
66
65/* We ue the factory pattern here, so you shouldn't call eo_add directly. */ 67/* We ue the factory pattern here, so you shouldn't call eo_add directly. */
66EAPI Eo *ecore_main_loop_get(void); 68EAPI Eo *ecore_main_loop_get(void);
67 69
diff --git a/src/lib/ecore/efl_loop_user.c b/src/lib/ecore/efl_loop_user.c
new file mode 100644
index 0000000000..6aef76afe8
--- /dev/null
+++ b/src/lib/ecore/efl_loop_user.c
@@ -0,0 +1,29 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Ecore.h>
6
7#include "ecore_private.h"
8
9typedef struct _Efl_Loop_User_Data Efl_Loop_User_Data;
10struct _Efl_Loop_User_Data
11{
12};
13
14static Efl_Loop *
15_efl_loop_user_loop_get(Eo *obj, Efl_Loop_User_Data *pd EINA_UNUSED)
16{
17 return eo_provider_find(obj, EFL_LOOP_CLASS);
18}
19
20static void
21_efl_loop_user_eo_base_parent_set(Eo *obj, Efl_Loop_User_Data *pd EINA_UNUSED, Eo_Base *parent)
22{
23 if (parent != NULL && eo_provider_find(parent, EFL_LOOP_CLASS) == NULL)
24 return ;
25
26 eo_parent_set(eo_super(obj, EFL_LOOP_USER_CLASS), parent);
27}
28
29#include "efl_loop_user.eo.c"
diff --git a/src/lib/ecore/efl_loop_user.eo b/src/lib/ecore/efl_loop_user.eo
new file mode 100644
index 0000000000..a4068a7c40
--- /dev/null
+++ b/src/lib/ecore/efl_loop_user.eo
@@ -0,0 +1,15 @@
1class Efl.Loop_User (Eo.Base)
2{
3 [[An Efl.Loop_User is a class that require one of the parent to provide
4 an Efl.Loop interface when doing provider_find. It will enforce this by
5 only allowing parent that provide such interface or NULL.]]
6 legacy_prefix: null;
7 methods {
8 loop_get {
9 return: Efl.Loop *;
10 }
11 }
12 implements {
13 Eo.Base.parent.set;
14 }
15} \ No newline at end of file