summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_win.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 14:00:43 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 14:50:31 +0900
commitd39bbc149113da5d842f30d046dc04302e54275b (patch)
treebf4fb87d6af59bfd2720a15293362a64ad7f3815 /src/lib/elementary/efl_ui_win.c
parent6cea4993e0ea7425a1dde2b38bcdb63687a7eaad (diff)
elm: Create legacy widgets with elm_legacy_add
This will be used to solve issues around style_set: if the widget is legacy or pure eo we may need to select a different style. So in the constructor we need to know whether we are legacy or eo. Note that calling style_set in finalize only is too late as we would lose information such as efl_text_set() called inside efl_add().
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_win.c44
1 files changed, 16 insertions, 28 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 87e7e9624d..1b7ad802e0 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -5342,13 +5342,6 @@ _efl_ui_win_efl_object_finalize(Eo *obj, Efl_Ui_Win_Data *sd)
5342 return obj; 5342 return obj;
5343} 5343}
5344 5344
5345EOLIAN static void
5346_efl_ui_win_efl_canvas_object_legacy_ctor(Eo *obj, Efl_Ui_Win_Data *sd)
5347{
5348 sd->legacy.ctor = EINA_TRUE;
5349 efl_canvas_object_legacy_ctor(efl_super(obj, MY_CLASS));
5350}
5351
5352EOLIAN static Efl_Ui_Focus_Manager* 5345EOLIAN static Efl_Ui_Focus_Manager*
5353_efl_ui_win_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root) 5346_efl_ui_win_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root)
5354{ 5347{
@@ -8089,20 +8082,18 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
8089 default: break; 8082 default: break;
8090 } 8083 }
8091 8084
8092 return efl_add(klass, parent, 8085 return elm_legacy_add(klass, parent,
8093 efl_canvas_object_legacy_ctor(efl_added), 8086 efl_ui_win_name_set(efl_added, name),
8094 efl_ui_win_name_set(efl_added, name), 8087 efl_ui_win_type_set(efl_added, type));
8095 efl_ui_win_type_set(efl_added, type));
8096} 8088}
8097 8089
8098EAPI Evas_Object * 8090EAPI Evas_Object *
8099elm_win_fake_add(Ecore_Evas *ee) 8091elm_win_fake_add(Ecore_Evas *ee)
8100{ 8092{
8101 return efl_add(MY_CLASS, NULL, 8093 return elm_legacy_add(MY_CLASS, NULL,
8102 efl_canvas_object_legacy_ctor(efl_added), 8094 _fake_canvas_set(efl_added, ee),
8103 _fake_canvas_set(efl_added, ee), 8095 efl_ui_win_name_set(efl_added, NULL),
8104 efl_ui_win_name_set(efl_added, NULL), 8096 efl_ui_win_type_set(efl_added, ELM_WIN_FAKE));
8105 efl_ui_win_type_set(efl_added, ELM_WIN_FAKE));
8106} 8097}
8107 8098
8108EAPI Evas_Object * 8099EAPI Evas_Object *
@@ -8110,11 +8101,10 @@ elm_win_util_standard_add(const char *name, const char *title)
8110{ 8101{
8111 Evas_Object *win; 8102 Evas_Object *win;
8112 8103
8113 win = efl_add(EFL_UI_WIN_CLASS, NULL, 8104 win = elm_legacy_add(EFL_UI_WIN_CLASS, NULL,
8114 efl_canvas_object_legacy_ctor(efl_added), 8105 efl_text_set(efl_added, title),
8115 efl_text_set(efl_added, title), 8106 efl_ui_win_name_set(efl_added, name),
8116 efl_ui_win_name_set(efl_added, name), 8107 efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC));
8117 efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC));
8118 if (!win) return NULL; 8108 if (!win) return NULL;
8119 8109
8120 _elm_win_standard_init(win); 8110 _elm_win_standard_init(win);
@@ -8126,11 +8116,10 @@ elm_win_util_dialog_add(Evas_Object *parent, const char *name, const char *title
8126{ 8116{
8127 Evas_Object *win; 8117 Evas_Object *win;
8128 8118
8129 win = efl_add(EFL_UI_WIN_CLASS, parent, 8119 win = elm_legacy_add(EFL_UI_WIN_CLASS, parent,
8130 efl_canvas_object_legacy_ctor(efl_added), 8120 efl_text_set(efl_added, title),
8131 efl_text_set(efl_added, title), 8121 efl_ui_win_name_set(efl_added, name),
8132 efl_ui_win_name_set(efl_added, name), 8122 efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC));
8133 efl_ui_win_type_set(efl_added, EFL_UI_WIN_DIALOG_BASIC));
8134 if (!win) return NULL; 8123 if (!win) return NULL;
8135 8124
8136 _elm_win_standard_init(win); 8125 _elm_win_standard_init(win);
@@ -8427,7 +8416,6 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_win, Efl_Ui_Win_Data)
8427 8416
8428#define EFL_UI_WIN_EXTRA_OPS \ 8417#define EFL_UI_WIN_EXTRA_OPS \
8429 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_win), \ 8418 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_win), \
8430 ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_win), \ 8419 ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_win)
8431 EFL_OBJECT_OP_FUNC(efl_canvas_object_legacy_ctor, _efl_ui_win_efl_canvas_object_legacy_ctor)
8432 8420
8433#include "efl_ui_win.eo.c" 8421#include "efl_ui_win.eo.c"