summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-12-20 14:19:56 -0800
committerCedric BAIL <cedric@osg.samsung.com>2018-04-30 14:21:12 -0700
commit9e2493760b3908228c3c3971ae3a0309befccab7 (patch)
treee94dd43a331591efb871dc5aa25d0cb0898c8b4a /src
parent3edb4ca6975946b7cfd3b261f5c1c7a46d681710 (diff)
ecore: move efl_model_list_value_get to be an internal function.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore/ecore_internal.h28
-rw-r--r--src/lib/ecore/efl_model_container.c2
-rw-r--r--src/lib/ecore/efl_model_item.c2
-rw-r--r--src/lib/efl/Efl_Model_Common.h30
-rw-r--r--src/lib/eldbus/eldbus_model_private.h2
5 files changed, 34 insertions, 30 deletions
diff --git a/src/lib/ecore/ecore_internal.h b/src/lib/ecore/ecore_internal.h
index 5f34ade..5bb5754 100644
--- a/src/lib/ecore/ecore_internal.h
+++ b/src/lib/ecore/ecore_internal.h
@@ -31,6 +31,34 @@
31EAPI void ecore_loop_arguments_send(int argc, const char **argv); 31EAPI void ecore_loop_arguments_send(int argc, const char **argv);
32EAPI Eina_Bool efl_loop_message_process(Eo *obj); 32EAPI Eina_Bool efl_loop_message_process(Eo *obj);
33 33
34static inline Eina_Value
35efl_model_list_value_get(Eina_List *childrens,
36 unsigned int start,
37 unsigned int count)
38{
39 Eina_Value v = EINA_VALUE_EMPTY;
40 Eina_List *l;
41 Eo *child;
42
43 eina_value_array_setup(&v, EINA_VALUE_TYPE_OBJECT, eina_list_count(childrens));
44
45 EINA_LIST_FOREACH(childrens, l, child)
46 {
47 if (start != 0)
48 {
49 start--;
50 continue;
51 }
52 if (count == 0)
53 continue;
54 count--;
55
56 eina_value_array_append(&v, child);
57 }
58
59 return v;
60}
61
34#undef EAPI 62#undef EAPI
35#define EAPI 63#define EAPI
36 64
diff --git a/src/lib/ecore/efl_model_container.c b/src/lib/ecore/efl_model_container.c
index 78749db..7fd940f 100644
--- a/src/lib/ecore/efl_model_container.c
+++ b/src/lib/ecore/efl_model_container.c
@@ -7,6 +7,8 @@
7#include <Eo.h> 7#include <Eo.h>
8#include <Ecore.h> 8#include <Ecore.h>
9 9
10#include "ecore_internal.h"
11
10#include "efl_model_container_private.h" 12#include "efl_model_container_private.h"
11 13
12#define MY_CLASS EFL_MODEL_CONTAINER_CLASS 14#define MY_CLASS EFL_MODEL_CONTAINER_CLASS
diff --git a/src/lib/ecore/efl_model_item.c b/src/lib/ecore/efl_model_item.c
index 091eabe..84faf75 100644
--- a/src/lib/ecore/efl_model_item.c
+++ b/src/lib/ecore/efl_model_item.c
@@ -5,6 +5,8 @@
5#include <Efl.h> 5#include <Efl.h>
6#include <Ecore.h> 6#include <Ecore.h>
7 7
8#include "ecore_internal.h"
9
8#define MY_CLASS EFL_MODEL_ITEM_CLASS 10#define MY_CLASS EFL_MODEL_ITEM_CLASS
9 11
10typedef struct _Efl_Model_Item_Data Efl_Model_Item_Data; 12typedef struct _Efl_Model_Item_Data Efl_Model_Item_Data;
diff --git a/src/lib/efl/Efl_Model_Common.h b/src/lib/efl/Efl_Model_Common.h
index b4b5690..7a064f0 100644
--- a/src/lib/efl/Efl_Model_Common.h
+++ b/src/lib/efl/Efl_Model_Common.h
@@ -91,34 +91,4 @@ EAPI Eina_Value_Struct_Desc *efl_model_value_struct_description_new(unsigned int
91 */ 91 */
92EAPI void efl_model_value_struct_description_free(Eina_Value_Struct_Desc *desc); 92EAPI void efl_model_value_struct_description_free(Eina_Value_Struct_Desc *desc);
93 93
94
95static inline Eina_Value
96efl_model_list_value_get(Eina_List *childrens,
97 unsigned int start,
98 unsigned int count)
99{
100 Eina_Value v = EINA_VALUE_EMPTY;
101 Eina_List *l;
102 Eo *child;
103
104 eina_value_array_setup(&v, EINA_VALUE_TYPE_OBJECT, eina_list_count(childrens));
105
106 EINA_LIST_FOREACH(childrens, l, child)
107 {
108 if (start != 0)
109 {
110 start--;
111 continue;
112 }
113 if (count == 0)
114 continue;
115 count--;
116
117 eina_value_array_append(&v, child);
118 }
119
120 return v;
121}
122
123
124#endif 94#endif
diff --git a/src/lib/eldbus/eldbus_model_private.h b/src/lib/eldbus/eldbus_model_private.h
index 5b155a1..3f66859 100644
--- a/src/lib/eldbus/eldbus_model_private.h
+++ b/src/lib/eldbus/eldbus_model_private.h
@@ -8,6 +8,8 @@
8#include <Eo.h> 8#include <Eo.h>
9#include <Efl.h> 9#include <Efl.h>
10 10
11#include "ecore_internal.h"
12
11typedef struct _Eldbus_Children_Slice_Promise Eldbus_Children_Slice_Promise; 13typedef struct _Eldbus_Children_Slice_Promise Eldbus_Children_Slice_Promise;
12typedef struct _Eldbus_Model_Data Eldbus_Model_Data; 14typedef struct _Eldbus_Model_Data Eldbus_Model_Data;
13 15