aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_ui_win.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-10-10 18:59:42 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-10-12 11:25:56 +0900
commit97c9fa64a461ccf60e63fd8a8982c9b8c5c6290e (patch)
tree2f4b7ef2760ce39d6951fffee8f69b62d3cbc041 /src/lib/elementary/efl_ui_win.c
parentevas: Move clip_unset to legacy, remove group_clip (diff)
downloadefl-97c9fa64a461ccf60e63fd8a8982c9b8c5c6290e.tar.gz
evas/elm: Remove group_show and group_hide
These should be just overrides of Efl.Gfx.visible.set. Many widgets were handling smart show() and hide() manually, which means this patch is quite large. Hopefully this doesn't break anything, obviously. But here are some widgets known to be problematic, as the old code flow was really strange (sometimes not calling the efl_super function): - window - notify
Diffstat (limited to 'src/lib/elementary/efl_ui_win.c')
-rw-r--r--src/lib/elementary/efl_ui_win.c56
1 files changed, 42 insertions, 14 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 1f7281a2ab..24cf2995ea 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -2107,19 +2107,28 @@ _deferred_ecore_evas_free(void *data)
_elm_win_deferred_free--;
}
-EOLIAN static void
-_efl_ui_win_efl_canvas_group_group_show(Eo *obj, Efl_Ui_Win_Data *sd)
+static void
+_efl_ui_win_show(Eo *obj, Efl_Ui_Win_Data *sd)
{
- if (sd->modal_count) return;
- const Eina_List *l;
- Evas_Object *current;
Eina_Bool do_eval = EINA_FALSE;
+ if (sd->modal_count)
+ {
+ /* FIXME FIXME FIXME
+ * Ugly code flow: legacy code had an early return in smart_show, ie.
+ * evas object show would be processed but smart object show would be
+ * aborted. This super call tries to simulate that. */
+ efl_gfx_visible_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), EINA_TRUE);
+ return;
+ }
+
if (!evas_object_visible_get(obj)) do_eval = EINA_TRUE;
- efl_canvas_group_show(efl_super(obj, MY_CLASS));
+ efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_TRUE);
if ((sd->modal) && (!evas_object_visible_get(obj)))
{
+ const Eina_List *l;
+ Evas_Object *current;
INCREMENT_MODALITY()
}
@@ -2150,19 +2159,26 @@ _efl_ui_win_efl_canvas_group_group_show(Eo *obj, Efl_Ui_Win_Data *sd)
if (sd->shot.info) _shot_handle(sd);
}
-EOLIAN static void
-_efl_ui_win_efl_canvas_group_group_hide(Eo *obj, Efl_Ui_Win_Data *sd)
+static void
+_efl_ui_win_hide(Eo *obj, Efl_Ui_Win_Data *sd)
{
- if (sd->modal_count) return;
- const Eina_List *l;
- Evas_Object *current;
+ if (sd->modal_count)
+ {
+ /* FIXME FIXME FIXME
+ * Ugly code flow: legacy code had an early return in smart_show, ie.
+ * evas object show would be processed but smart object show would be
+ * aborted. This super call tries to simulate that. */
+ efl_gfx_visible_set(efl_super(obj, EFL_CANVAS_GROUP_CLASS), EINA_FALSE);
+ return;
+ }
- if (evas_object_visible_get(obj))
- _elm_win_state_eval_queue();
- efl_canvas_group_hide(efl_super(obj, MY_CLASS));
+ _elm_win_state_eval_queue();
+ efl_gfx_visible_set(efl_super(obj, MY_CLASS), EINA_FALSE);
if ((sd->modal) && (evas_object_visible_get(obj)))
{
+ const Eina_List *l;
+ Evas_Object *current;
DECREMENT_MODALITY()
}
@@ -2197,6 +2213,16 @@ _efl_ui_win_efl_canvas_group_group_hide(Eo *obj, Efl_Ui_Win_Data *sd)
}
EOLIAN static void
+_efl_ui_win_efl_gfx_visible_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool vis)
+{
+ if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
+ return;
+
+ if (vis) _efl_ui_win_show(obj, sd);
+ else _efl_ui_win_hide(obj, sd);
+}
+
+EOLIAN static void
_efl_ui_win_efl_input_interface_pointer_xy_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int *x, int *y)
{
evas_pointer_canvas_xy_get(sd->evas, x, y);
@@ -2711,6 +2737,8 @@ _elm_win_obj_intercept_show(void *data,
{
ELM_WIN_DATA_GET(data, sd);
+ /* FIXME: this intercept needs to be implemented in proper EO */
+
// this is called to make sure all smart containers have calculated their
// sizes BEFORE we show the window to make sure it initially appears at
// our desired size (ie min size is known first)