summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-04-18 09:31:14 -0700
committerCedric BAIL <cedric.bail@free.fr>2019-04-26 11:32:43 -0700
commitd9d5846db68f19c17af444e3485f5f0d4f3cd35f (patch)
tree1a0decf1a8c9adfa325cea529cb54627506d1c89 /src/lib/ecore
parent805128dbf38483ae6bd9ef531b4e002d564ca391 (diff)
ecore: add infrastructure to create children Model once and avoid duplicated view of the same data.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D8656
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/efl_composite_model_private.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/ecore/efl_composite_model_private.h b/src/lib/ecore/efl_composite_model_private.h
index b780326c8b..f4872416d3 100644
--- a/src/lib/ecore/efl_composite_model_private.h
+++ b/src/lib/ecore/efl_composite_model_private.h
@@ -40,4 +40,20 @@ _efl_composite_model_properties_mix(Eina_Iterator *super, Eina_Iterator *dyn, Ei
40 }; 40 };
41} 41}
42 42
43#define EFL_COMPOSITE_LOOKUP_RETURN(Remember, Parent, View, Base) \
44 Efl_Model *Remember; \
45 char buf[1024]; \
46 \
47 snprintf(buf, sizeof (buf), Base"-%p", Parent); \
48 Remember = efl_key_wref_get(View, buf); \
49 if (Remember) \
50 { \
51 efl_ref(Remember); \
52 return Remember; \
53 }
54
55#define EFL_COMPOSITE_REMEMBER_RETURN(Remember, View) \
56 efl_key_wref_set(View, buf, Remember); \
57 return Remember;
58
43#endif 59#endif