summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-04-03 17:24:22 -0700
committerCedric BAIL <cedric.bail@free.fr>2019-04-18 15:26:39 -0700
commit3730447f0c60f89b81e05f00dafe7aa5f55a370f (patch)
tree34671823cea58fe6c218c182a8c9a8b9d8190e64 /src/lib/ecore
parenta3f4f615999455ba76b5f8aa3315faa1e2803c58 (diff)
ecore: move property string definition to shared headers for Efl.Composite_Model.
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com> Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D8568
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/efl_composite_model.c13
-rw-r--r--src/lib/ecore/efl_composite_model_private.h5
2 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/ecore/efl_composite_model.c b/src/lib/ecore/efl_composite_model.c
index 668b382dfb..a0457729ac 100644
--- a/src/lib/ecore/efl_composite_model.c
+++ b/src/lib/ecore/efl_composite_model.c
@@ -8,10 +8,9 @@
8 8
9#include "ecore_private.h" 9#include "ecore_private.h"
10 10
11#include "efl_composite_model_private.h"
11#include "efl_composite_model.eo.h" 12#include "efl_composite_model.eo.h"
12 13
13#define _CHILD_INDEX "child.index"
14
15typedef struct _Efl_Composite_Model_Data Efl_Composite_Model_Data; 14typedef struct _Efl_Composite_Model_Data Efl_Composite_Model_Data;
16 15
17struct _Efl_Composite_Model_Data 16struct _Efl_Composite_Model_Data
@@ -148,7 +147,7 @@ _efl_composite_model_index_get(const Eo *obj, Efl_Composite_Model_Data *pd)
148 if (pd->need_index) 147 if (pd->need_index)
149 return 0xFFFFFFFF; 148 return 0xFFFFFFFF;
150 149
151 fetch = efl_model_property_get(obj, _CHILD_INDEX); 150 fetch = efl_model_property_get(obj, EFL_COMPOSITE_MODEL_CHILD_INDEX);
152 if (!eina_value_uint_convert(fetch, &r)) 151 if (!eina_value_uint_convert(fetch, &r))
153 return 0xFFFFFFFF; 152 return 0xFFFFFFFF;
154 eina_value_free(fetch); 153 eina_value_free(fetch);
@@ -179,7 +178,7 @@ _efl_composite_model_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Efl_Composite_Mo
179 properties = efl_model_properties_get(pd->source); 178 properties = efl_model_properties_get(pd->source);
180 EINA_ITERATOR_FOREACH(properties, property) 179 EINA_ITERATOR_FOREACH(properties, property)
181 { 180 {
182 if (!strcmp(property, _CHILD_INDEX)) 181 if (!strcmp(property, EFL_COMPOSITE_MODEL_CHILD_INDEX))
183 { 182 {
184 pd->need_index = EINA_FALSE; 183 pd->need_index = EINA_FALSE;
185 break; 184 break;
@@ -198,7 +197,7 @@ static Eina_Future *
198_efl_composite_model_efl_model_property_set(Eo *obj, Efl_Composite_Model_Data *pd, 197_efl_composite_model_efl_model_property_set(Eo *obj, Efl_Composite_Model_Data *pd,
199 const char *property, Eina_Value *value) 198 const char *property, Eina_Value *value)
200{ 199{
201 if (pd->need_index && !strcmp(property, _CHILD_INDEX)) 200 if (pd->need_index && !strcmp(property, EFL_COMPOSITE_MODEL_CHILD_INDEX))
202 { 201 {
203 if (pd->set_index || !pd->source) 202 if (pd->set_index || !pd->source)
204 return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_READ_ONLY); 203 return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_READ_ONLY);
@@ -214,7 +213,7 @@ static Eina_Value *
214_efl_composite_model_efl_model_property_get(const Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd, 213_efl_composite_model_efl_model_property_get(const Eo *obj EINA_UNUSED, Efl_Composite_Model_Data *pd,
215 const char *property) 214 const char *property)
216{ 215{
217 if (pd->need_index && !strcmp(property, _CHILD_INDEX)) 216 if (pd->need_index && !strcmp(property, EFL_COMPOSITE_MODEL_CHILD_INDEX))
218 { 217 {
219 if (pd->set_index) 218 if (pd->set_index)
220 return eina_value_uint_new(pd->index); 219 return eina_value_uint_new(pd->index);
@@ -229,7 +228,7 @@ _efl_composite_model_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Com
229 if (pd->need_index) 228 if (pd->need_index)
230 { 229 {
231 static const char *composite_properties[] = { 230 static const char *composite_properties[] = {
232 _CHILD_INDEX 231 EFL_COMPOSITE_MODEL_CHILD_INDEX
233 }; 232 };
234 233
235 return eina_multi_iterator_new(efl_model_properties_get(pd->source), 234 return eina_multi_iterator_new(efl_model_properties_get(pd->source),
diff --git a/src/lib/ecore/efl_composite_model_private.h b/src/lib/ecore/efl_composite_model_private.h
index c9e3783b9d..b780326c8b 100644
--- a/src/lib/ecore/efl_composite_model_private.h
+++ b/src/lib/ecore/efl_composite_model_private.h
@@ -1,3 +1,7 @@
1#ifndef EFL_COMPOSITE_MODEL_PRIVATE_H_
2# define EFL_COMPOSITE_MODEL_PRIVATE_H_
3
4#define EFL_COMPOSITE_MODEL_CHILD_INDEX "child.index"
1 5
2#define EFL_COMPOSITE_MODEL_PROPERTIES(name, dyn, sta, ...) \ 6#define EFL_COMPOSITE_MODEL_PROPERTIES(name, dyn, sta, ...) \
3 EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(name, NULL, NULL, (dyn), sta, ##__VA_ARGS__) 7 EFL_COMPOSITE_MODEL_PROPERTIES_SUPER(name, NULL, NULL, (dyn), sta, ##__VA_ARGS__)
@@ -36,3 +40,4 @@ _efl_composite_model_properties_mix(Eina_Iterator *super, Eina_Iterator *dyn, Ei
36 }; 40 };
37} 41}
38 42
43#endif