Elm win: Fix added internal parameter to the win constructor.
authorTom Hacohen <tom@stosb.com>
Mon, 12 Jan 2015 10:13:34 +0000 (10:13 +0000)
committerTom Hacohen <tom@stosb.com>
Mon, 12 Jan 2015 10:13:34 +0000 (10:13 +0000)
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

src/lib/elm_win.c
src/lib/elm_win.eo

index c2d13c1..233e17b 100644 (file)
@@ -4,6 +4,7 @@
 
 #define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
 #define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
+#define ELM_WIN_PROTECTED
 
 #include <Elementary.h>
 #include <Elementary_Cursor.h>
@@ -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)
 {
index 9cea8ea..75ca045 100644 (file)
@@ -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 {