discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5337d908e433b926572e19f0fd6ee1f66340990a

commit 5337d908e433b926572e19f0fd6ee1f66340990a
Author: Marcel Hollerbach <[email protected]>
Date:   Tue Jun 26 12:21:54 2018 -0400

    elm: register legacy_type correctly
    
    Summary:
    What happened before is that we registered efl_ui_leyout_legacy for
    "elm_layout", which is not that good, since checking a (lets say) 
elm_button, for the type "elm_layout" would result in false. The same is with 
elm_button.
    
    fixes T7081
    
    Reviewers: devilhorns, zmike
    
    Reviewed By: zmike
    
    Subscribers: cedric, #committers, zmike
    
    Tags: #efl
    
    Maniphest Tasks: T7081
    
    Differential Revision: https://phab.enlightenment.org/D6430
---
 src/lib/elementary/efl_ui_button.c         | 16 ++++++++--------
 src/lib/elementary/efl_ui_button.eo        |  1 +
 src/lib/elementary/efl_ui_button_legacy.eo |  1 -
 src/lib/elementary/efl_ui_layout_legacy.eo |  1 -
 src/lib/elementary/efl_ui_layout_object.c  | 17 +++++++++--------
 src/lib/elementary/efl_ui_layout_object.eo |  1 +
 6 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/src/lib/elementary/efl_ui_button.c 
b/src/lib/elementary/efl_ui_button.c
index 4a8067f022..ea644b6277 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -48,6 +48,14 @@ static const Elm_Action key_actions[] = {
    {NULL, NULL}
 };
 
+#define MY_CLASS_NAME_LEGACY "elm_button"
+
+static void
+_efl_ui_button_class_constructor(Efl_Class *klass)
+{
+   evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
 static void
 _activate(Evas_Object *obj)
 {
@@ -405,14 +413,6 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
 #include "efl_ui_button_legacy.eo.h"
 #include "efl_ui_button_legacy_part.eo.h"
 
-#define MY_CLASS_NAME_LEGACY "elm_button"
-
-static void
-_efl_ui_button_legacy_class_constructor(Efl_Class *klass)
-{
-   evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
-
 EOLIAN static Eo *
 _efl_ui_button_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
 {
diff --git a/src/lib/elementary/efl_ui_button.eo 
b/src/lib/elementary/efl_ui_button.eo
index 27b3ba4181..3ce8c7dcc3 100644
--- a/src/lib/elementary/efl_ui_button.eo
+++ b/src/lib/elementary/efl_ui_button.eo
@@ -9,6 +9,7 @@ class Efl.Ui.Button (Efl.Ui.Layout.Object, Efl.Ui.Clickable, 
Efl.Ui.Autorepeat,
    ]]
    legacy_prefix: elm_button;
    implements {
+      class.constructor;
       Efl.Object.constructor;
       Efl.Ui.Autorepeat.autorepeat_initial_timeout { set; get; }
       Efl.Ui.Autorepeat.autorepeat_gap_timeout { set; get; }
diff --git a/src/lib/elementary/efl_ui_button_legacy.eo 
b/src/lib/elementary/efl_ui_button_legacy.eo
index f1d5d3af68..bf01ef88ce 100644
--- a/src/lib/elementary/efl_ui_button_legacy.eo
+++ b/src/lib/elementary/efl_ui_button_legacy.eo
@@ -7,7 +7,6 @@ class Efl.Ui.Button_Legacy (Efl.Ui.Button, Efl.Ui.Legacy)
    ]]
    data: null;
    implements {
-      class.constructor;
       Efl.Object.constructor;
       Efl.Ui.Widget.theme_apply;
       Efl.Ui.Widget.widget_sub_object_del;
diff --git a/src/lib/elementary/efl_ui_layout_legacy.eo 
b/src/lib/elementary/efl_ui_layout_legacy.eo
index 012d3e2168..383f461584 100644
--- a/src/lib/elementary/efl_ui_layout_legacy.eo
+++ b/src/lib/elementary/efl_ui_layout_legacy.eo
@@ -3,7 +3,6 @@ class Efl.Ui.Layout_Legacy (Efl.Ui.Layout.Object, Efl.Ui.Legacy)
    [[Elementary layout class]]
    data: null;
    implements {
-      class.constructor;
       Efl.Object.constructor;
    }
 }
diff --git a/src/lib/elementary/efl_ui_layout_object.c 
b/src/lib/elementary/efl_ui_layout_object.c
index 8d512a0177..a98e5c3b57 100644
--- a/src/lib/elementary/efl_ui_layout_object.c
+++ b/src/lib/elementary/efl_ui_layout_object.c
@@ -120,6 +120,14 @@ struct _Efl_Ui_Layout_Sub_Object_Cursor
    Eina_Bool    engine_only : 1;
 };
 
+#define MY_CLASS_NAME_LEGACY "elm_layout"
+
+static void
+_efl_ui_layout_object_class_constructor(Efl_Class *klass)
+{
+   evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
+}
+
 static void
 _on_sub_object_size_hint_change(void *data,
                                 Evas *e EINA_UNUSED,
@@ -443,7 +451,7 @@ _efl_ui_layout_theme_internal(Eo *obj, 
Efl_Ui_Layout_Object_Data *sd)
      {
         ret = elm_widget_theme_object_set
                 (obj, wd->resize_obj,
-                elm_widget_theme_klass_get(obj), 
+                elm_widget_theme_klass_get(obj),
                 elm_widget_theme_element_get(obj),
                 elm_widget_theme_style_get(obj));
      }
@@ -2472,13 +2480,6 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
 
 #include "efl_ui_layout_legacy.eo.h"
 
-#define MY_CLASS_NAME_LEGACY "elm_layout"
-
-static void
-_efl_ui_layout_legacy_class_constructor(Efl_Class *klass)
-{
-   evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
-}
 
 EOLIAN static Eo *
 _efl_ui_layout_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
diff --git a/src/lib/elementary/efl_ui_layout_object.eo 
b/src/lib/elementary/efl_ui_layout_object.eo
index 04a47805fa..1aa121b10b 100644
--- a/src/lib/elementary/efl_ui_layout_object.eo
+++ b/src/lib/elementary/efl_ui_layout_object.eo
@@ -45,6 +45,7 @@ class Efl.Ui.Layout.Object (Efl.Ui.Widget, Efl.Part, 
Efl.Container, Efl.File,
       }
    }
    implements {
+      class.constructor;
       Efl.Object.constructor;
       Efl.Object.finalize;
       Efl.File.file { get; set; }

-- 


Reply via email to