summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-05-30 12:28:18 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-05-30 13:35:34 +0900
commit3092e08a83f754ba8d49cfda83e9c5408ed3e04a (patch)
tree94f76a7ada52f18bea6b2bd275cda53fa6bd0ecd
parent945932e1b1c66a2a19f0410c4f95c4449bf767d7 (diff)
elm: Fix efl_part inheritance
So, I was storing a single "sd" pointer (class private data) but using it in two different places, ie. as if it were two different classes. Crashes happened, complaints were heard. See T3714.
-rw-r--r--src/lib/elementary/elm_hover.c8
-rw-r--r--src/lib/elementary/elm_hover_internal_part.eo5
-rw-r--r--src/lib/elementary/elm_part_helper.h9
-rw-r--r--src/lib/elementary/elm_scroller.c9
-rw-r--r--src/lib/elementary/elm_scroller_internal_part.eo5
5 files changed, 14 insertions, 22 deletions
diff --git a/src/lib/elementary/elm_hover.c b/src/lib/elementary/elm_hover.c
index b669da3b1d..d83efb055d 100644
--- a/src/lib/elementary/elm_hover.c
+++ b/src/lib/elementary/elm_hover.c
@@ -845,10 +845,10 @@ _elm_hover_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED
845 845
846/* Efl.Part begin */ 846/* Efl.Part begin */
847 847
848ELM_PART_IMPLEMENT(elm_hover, ELM_HOVER, Elm_Hover_Data, Elm_Part_Data) 848ELM_PART_OVERRIDE(elm_hover, ELM_HOVER, ELM_LAYOUT, Elm_Hover_Data, Elm_Part_Data)
849ELM_PART_IMPLEMENT_CONTENT_SET(elm_hover, ELM_HOVER, Elm_Hover_Data, Elm_Part_Data) 849ELM_PART_OVERRIDE_CONTENT_SET(elm_hover, ELM_HOVER, ELM_LAYOUT, Elm_Hover_Data, Elm_Part_Data)
850ELM_PART_IMPLEMENT_CONTENT_GET(elm_hover, ELM_HOVER, Elm_Hover_Data, Elm_Part_Data) 850ELM_PART_OVERRIDE_CONTENT_GET(elm_hover, ELM_HOVER, ELM_LAYOUT, Elm_Hover_Data, Elm_Part_Data)
851ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_hover, ELM_HOVER, Elm_Hover_Data, Elm_Part_Data) 851ELM_PART_OVERRIDE_CONTENT_UNSET(elm_hover, ELM_HOVER, ELM_LAYOUT, Elm_Hover_Data, Elm_Part_Data)
852#include "elm_hover_internal_part.eo.c" 852#include "elm_hover_internal_part.eo.c"
853 853
854/* Efl.Part end */ 854/* Efl.Part end */
diff --git a/src/lib/elementary/elm_hover_internal_part.eo b/src/lib/elementary/elm_hover_internal_part.eo
index 6506561d95..80df3ae486 100644
--- a/src/lib/elementary/elm_hover_internal_part.eo
+++ b/src/lib/elementary/elm_hover_internal_part.eo
@@ -1,8 +1,7 @@
1class Elm.Hover.Internal.Part (Eo.Base, Efl.Container) 1class Elm.Hover.Internal.Part (Elm.Layout.Internal.Part)
2{ 2{
3 data: Elm_Part_Data; 3 data: null;
4 implements { 4 implements {
5 Eo.Base.destructor;
6 Efl.Container.content.set; 5 Efl.Container.content.set;
7 Efl.Container.content.get; 6 Efl.Container.content.get;
8 Efl.Container.content_unset; 7 Efl.Container.content_unset;
diff --git a/src/lib/elementary/elm_part_helper.h b/src/lib/elementary/elm_part_helper.h
index f180acd4c5..b20af6b743 100644
--- a/src/lib/elementary/elm_part_helper.h
+++ b/src/lib/elementary/elm_part_helper.h
@@ -103,7 +103,8 @@ static EOLIAN Eina_Bool \
103_ ## type ## _internal_part_efl_container_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content) \ 103_ ## type ## _internal_part_efl_container_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content) \
104{ \ 104{ \
105 partdata *pd = eo_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \ 105 partdata *pd = eo_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \
106 ELM_PART_RETURN_VAL(_ ## type ## _content_set(pd->obj, pd->sd, pd->part, content)); \ 106 typedata *sd = eo_data_scope_get(pd->obj, TYPE ## _CLASS); \
107 ELM_PART_RETURN_VAL(_ ## type ## _content_set(pd->obj, sd, pd->part, content)); \
107} 108}
108 109
109#define ELM_PART_OVERRIDE_CONTENT_GET(type, TYPE, SUPER, typedata, partdata) \ 110#define ELM_PART_OVERRIDE_CONTENT_GET(type, TYPE, SUPER, typedata, partdata) \
@@ -111,7 +112,8 @@ static EOLIAN Efl_Gfx * \
111_ ## type ## _internal_part_efl_container_content_get(Eo *obj, void *_pd EINA_UNUSED) \ 112_ ## type ## _internal_part_efl_container_content_get(Eo *obj, void *_pd EINA_UNUSED) \
112{ \ 113{ \
113 partdata *pd = eo_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \ 114 partdata *pd = eo_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \
114 ELM_PART_RETURN_VAL(_ ## type ## _content_get(pd->obj, pd->sd, pd->part)); \ 115 typedata *sd = eo_data_scope_get(pd->obj, TYPE ## _CLASS); \
116 ELM_PART_RETURN_VAL(_ ## type ## _content_get(pd->obj, sd, pd->part)); \
115} 117}
116 118
117#define ELM_PART_OVERRIDE_CONTENT_UNSET(type, TYPE, SUPER, typedata, partdata) \ 119#define ELM_PART_OVERRIDE_CONTENT_UNSET(type, TYPE, SUPER, typedata, partdata) \
@@ -119,7 +121,8 @@ static EOLIAN Efl_Gfx * \
119_ ## type ## _internal_part_efl_container_content_unset(Eo *obj, void *_pd EINA_UNUSED) \ 121_ ## type ## _internal_part_efl_container_content_unset(Eo *obj, void *_pd EINA_UNUSED) \
120{ \ 122{ \
121 partdata *pd = eo_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \ 123 partdata *pd = eo_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \
122 ELM_PART_RETURN_VAL(_ ## type ## _content_unset(pd->obj, pd->sd, pd->part)); \ 124 typedata *sd = eo_data_scope_get(pd->obj, TYPE ## _CLASS); \
125 ELM_PART_RETURN_VAL(_ ## type ## _content_unset(pd->obj, sd, pd->part)); \
123} 126}
124 127
125#endif 128#endif
diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c
index 2862ae5150..9e4d8e9582 100644
--- a/src/lib/elementary/elm_scroller.c
+++ b/src/lib/elementary/elm_scroller.c
@@ -1414,19 +1414,10 @@ _elm_scroller_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNU
1414 1414
1415/* Efl.Part begin */ 1415/* Efl.Part begin */
1416 1416
1417/* FIXME: Should be OVERRIDE, but... it doesn't work (buggy scrollers in
1418 * elm_test). Why? No idea! */
1419#if 0
1420ELM_PART_OVERRIDE(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data) 1417ELM_PART_OVERRIDE(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data)
1421ELM_PART_OVERRIDE_CONTENT_SET(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data) 1418ELM_PART_OVERRIDE_CONTENT_SET(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data)
1422ELM_PART_OVERRIDE_CONTENT_GET(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data) 1419ELM_PART_OVERRIDE_CONTENT_GET(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data)
1423ELM_PART_OVERRIDE_CONTENT_UNSET(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data) 1420ELM_PART_OVERRIDE_CONTENT_UNSET(elm_scroller, ELM_SCROLLER, ELM_LAYOUT, Elm_Scroller_Data, Elm_Part_Data)
1424#else
1425ELM_PART_IMPLEMENT(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data, Elm_Part_Data)
1426ELM_PART_IMPLEMENT_CONTENT_SET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data, Elm_Part_Data)
1427ELM_PART_IMPLEMENT_CONTENT_GET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data, Elm_Part_Data)
1428ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_scroller, ELM_SCROLLER, Elm_Scroller_Data, Elm_Part_Data)
1429#endif
1430#include "elm_scroller_internal_part.eo.c" 1421#include "elm_scroller_internal_part.eo.c"
1431 1422
1432/* Efl.Part end */ 1423/* Efl.Part end */
diff --git a/src/lib/elementary/elm_scroller_internal_part.eo b/src/lib/elementary/elm_scroller_internal_part.eo
index 52604360d4..b67a86aebd 100644
--- a/src/lib/elementary/elm_scroller_internal_part.eo
+++ b/src/lib/elementary/elm_scroller_internal_part.eo
@@ -1,8 +1,7 @@
1class Elm.Scroller.Internal.Part (Eo.Base, Efl.Container) // FIXME: (Elm.Layout.Internal.Part) 1class Elm.Scroller.Internal.Part (Elm.Layout.Internal.Part)
2{ 2{
3 data: Elm_Part_Data; // FIXME: null; 3 data: null;
4 implements { 4 implements {
5 Eo.Base.destructor; // FIXME: remove
6 Efl.Container.content.set; 5 Efl.Container.content.set;
7 Efl.Container.content.get; 6 Efl.Container.content.get;
8 Efl.Container.content_unset; 7 Efl.Container.content_unset;