From 12d383709d92742b7bf6c9771b23a9108a560632 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 12 Jan 2015 10:13:34 +0000 Subject: [PATCH] Elm win: Fix added internal parameter to the win constructor. Internal hacks should not affect user facing API. This commit adds a new API to do the internal hack. This is still bad, but it's much less than what was there before. This fixes the main issue introduced by commit: 63a5cdf0f8516c16a62233da0c2af0e10a13264b --- legacy/elementary/src/lib/elm_win.c | 17 +++++++++++++---- legacy/elementary/src/lib/elm_win.eo | 9 ++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c index c2d13c1765..233e17b93c 100644 --- a/legacy/elementary/src/lib/elm_win.c +++ b/legacy/elementary/src/lib/elm_win.c @@ -4,6 +4,7 @@ #define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED #define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED +#define ELM_WIN_PROTECTED #include #include @@ -2913,14 +2914,16 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) { - Evas_Object *obj = eo_add(MY_CLASS, parent, elm_obj_win_constructor(name, type, NULL)); + Evas_Object *obj = eo_add(MY_CLASS, parent, elm_obj_win_constructor(name, type)); return obj; } EAPI Evas_Object * elm_win_fake_add(Ecore_Evas *ee) { - return eo_add(MY_CLASS, NULL, elm_obj_win_constructor(NULL, ELM_WIN_FAKE, ee)); + return eo_add(MY_CLASS, NULL, + elm_obj_win_fake_canvas_set(ee), + elm_obj_win_constructor(NULL, ELM_WIN_FAKE)); } static void @@ -3019,7 +3022,7 @@ _accel_is_gl(void) } EOLIAN static void -_elm_win_constructor(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type type, Ecore_Evas *oee) +_elm_win_constructor(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type type) { sd->obj = obj; // in ctor @@ -3039,7 +3042,7 @@ _elm_win_constructor(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_Type t switch (type) { case ELM_WIN_FAKE: - tmp_sd.ee = oee; + tmp_sd.ee = sd->ee; break; case ELM_WIN_INLINED_IMAGE: if (!parent) break; @@ -3587,6 +3590,12 @@ _elm_win_eo_base_constructor(Eo *obj EINA_UNUSED, Elm_Win_Data *_pd EINA_UNUSED) /* Do nothing. */ } +EOLIAN static void +_elm_win_fake_canvas_set(Eo *obj EINA_UNUSED, Elm_Win_Data *pd, Ecore_Evas *oee) +{ + pd->ee = oee; +} + EOLIAN static Elm_Win_Type _elm_win_type_get(Eo *obj EINA_UNUSED, Elm_Win_Data *sd) { diff --git a/legacy/elementary/src/lib/elm_win.eo b/legacy/elementary/src/lib/elm_win.eo index 9cea8eabb6..75ca045af8 100644 --- a/legacy/elementary/src/lib/elm_win.eo +++ b/legacy/elementary/src/lib/elm_win.eo @@ -1185,6 +1185,14 @@ class Elm_Win (Elm_Widget, Elm_Interface_Atspi_Window, void *trap_data; /*@ The trap data of the window */ } } + fake_canvas @protected { + set { + /*@ Internal. Used to completent the fake window type. */ + } + values { + Ecore_Evas *oee; + } + } } methods { constructor { @@ -1193,7 +1201,6 @@ class Elm_Win (Elm_Widget, Elm_Interface_Atspi_Window, params { @in const(char)* name; @in Elm_Win_Type type; - @in Ecore_Evas *oee; } } wm_manual_rotation_done_manual {