summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-24 14:09:42 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-26 11:42:08 +0100
commit37c115542c6d723f3aa03af92dacbcdd400b8e4d (patch)
treed57304083c495237b132d3a5bb8cf4c715bd6344 /src/lib
parent2dacf8a69b58c22263e4060119ccf7a97d12b61d (diff)
efl_ui_pan: implement content interface
the last two functions for the content interface have been missing. Now the pan object can also unset and set new content ref T5719 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D7757
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_pan.c33
-rw-r--r--src/lib/elementary/efl_ui_pan.eo3
2 files changed, 27 insertions, 9 deletions
diff --git a/src/lib/elementary/efl_ui_pan.c b/src/lib/elementary/efl_ui_pan.c
index 062e94cfad..b84e0ba9d6 100644
--- a/src/lib/elementary/efl_ui_pan.c
+++ b/src/lib/elementary/efl_ui_pan.c
@@ -156,14 +156,7 @@ _efl_ui_pan_efl_content_content_set(Evas_Object *obj, Efl_Ui_Pan_Data *psd, Evas
156 if (content == psd->content) return EINA_TRUE; 156 if (content == psd->content) return EINA_TRUE;
157 if (psd->content) 157 if (psd->content)
158 { 158 {
159 efl_canvas_group_member_del(obj, psd->content); 159 efl_content_unset(obj);
160 evas_object_event_callback_del_full
161 (psd->content, EVAS_CALLBACK_DEL, _efl_ui_pan_content_del_cb, obj);
162 evas_object_event_callback_del_full
163 (psd->content, EVAS_CALLBACK_RESIZE, _efl_ui_pan_content_resize_cb,
164 obj);
165 psd->content = NULL;
166 psd->content_w = psd->content_h = psd->px = psd->py = 0;
167 } 160 }
168 if (!content) goto end; 161 if (!content) goto end;
169 162
@@ -189,6 +182,30 @@ end:
189 return EINA_TRUE; 182 return EINA_TRUE;
190} 183}
191 184
185EOLIAN static Efl_Gfx_Entity*
186_efl_ui_pan_efl_content_content_get(const Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *pd)
187{
188 return pd->content;
189}
190
191EOLIAN static Efl_Gfx_Entity*
192_efl_ui_pan_efl_content_content_unset(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *pd)
193{
194 Efl_Gfx_Stack *old_content = pd->content;
195
196 efl_canvas_group_member_del(obj, pd->content);
197 evas_object_event_callback_del_full
198 (pd->content, EVAS_CALLBACK_DEL, _efl_ui_pan_content_del_cb, obj);
199 evas_object_event_callback_del_full
200 (pd->content, EVAS_CALLBACK_RESIZE, _efl_ui_pan_content_resize_cb,
201 obj);
202 pd->content = NULL;
203 pd->content_w = pd->content_h = pd->px = pd->py = 0;
204 efl_event_callback_call(obj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, NULL);
205
206 return old_content;
207}
208
192EOLIAN static void 209EOLIAN static void
193_efl_ui_pan_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd) 210_efl_ui_pan_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Pan_Data *psd)
194{ 211{
diff --git a/src/lib/elementary/efl_ui_pan.eo b/src/lib/elementary/efl_ui_pan.eo
index bd47b60e2e..907d50b197 100644
--- a/src/lib/elementary/efl_ui_pan.eo
+++ b/src/lib/elementary/efl_ui_pan.eo
@@ -43,7 +43,8 @@ class Efl.Ui.Pan extends Efl.Canvas.Group implements Efl.Content
43 Efl.Gfx.Entity.visible { set; } 43 Efl.Gfx.Entity.visible { set; }
44 Efl.Gfx.Entity.position { set; } 44 Efl.Gfx.Entity.position { set; }
45 Efl.Gfx.Entity.size { set; } 45 Efl.Gfx.Entity.size { set; }
46 Efl.Content.content { set; } 46 Efl.Content.content { set; get; }
47 Efl.Content.content_unset;
47 Efl.Canvas.Group.group_calculate; 48 Efl.Canvas.Group.group_calculate;
48 } 49 }
49 events { 50 events {