summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_bg_widget.c
diff options
context:
space:
mode:
authorSungtaek Hong <sth253.hong@samsung.com>2018-01-24 15:50:58 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2018-01-24 18:14:26 +0900
commitcb25699dacde420a0e0c3434065ab8dac242ee6e (patch)
treeaadf195322243f48771eb3235e9079c5a25891b5 /src/lib/elementary/efl_ui_bg_widget.c
parentf6ba674cd8ada4e018fd205dab2e877e9a19a820 (diff)
efl_ui_legacy: add new interface to indicate legacy widget
Summary: For now, how to check whether a widget is legacy or not is to check flags in private data or static flag, which is set during elm_legacy_add. If Efl.Ui.Legacy interface is added, it can be easilly checked by efl_isa(obj, EFL_UI_LEGACY_INTERFACE) Reviewers: woohyun, jpeg, cedric, Jaehyun_Cho Subscribers: conr2d, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5748
Diffstat (limited to 'src/lib/elementary/efl_ui_bg_widget.c')
-rw-r--r--src/lib/elementary/efl_ui_bg_widget.c44
1 files changed, 29 insertions, 15 deletions
diff --git a/src/lib/elementary/efl_ui_bg_widget.c b/src/lib/elementary/efl_ui_bg_widget.c
index def31d0..dba5dd7 100644
--- a/src/lib/elementary/efl_ui_bg_widget.c
+++ b/src/lib/elementary/efl_ui_bg_widget.c
@@ -13,7 +13,6 @@
13#define MY_CLASS_PFX efl_ui_bg_widget 13#define MY_CLASS_PFX efl_ui_bg_widget
14 14
15#define MY_CLASS_NAME "Efl.Ui.Bg_Widget" 15#define MY_CLASS_NAME "Efl.Ui.Bg_Widget"
16#define MY_CLASS_NAME_LEGACY "elm_bg"
17 16
18static const Elm_Layout_Part_Alias_Description _content_aliases[] = 17static const Elm_Layout_Part_Alias_Description _content_aliases[] =
19{ 18{
@@ -21,13 +20,6 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
21 {NULL, NULL} 20 {NULL, NULL}
22}; 21};
23 22
24EAPI Evas_Object *
25elm_bg_add(Evas_Object *parent)
26{
27 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
28 return elm_legacy_add(MY_CLASS, parent);
29}
30
31EOLIAN static Eo * 23EOLIAN static Eo *
32_efl_ui_bg_widget_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Widget_Data *pd) 24_efl_ui_bg_widget_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Widget_Data *pd)
33{ 25{
@@ -54,7 +46,6 @@ _efl_ui_bg_widget_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Widget_Data *pd)
54 efl_image_scale_type_set(efl_added, EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE), 46 efl_image_scale_type_set(efl_added, EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE),
55 efl_content_set(efl_part(obj, "elm.swallow.background"), efl_added)); 47 efl_content_set(efl_part(obj, "elm.swallow.background"), efl_added));
56 48
57 efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
58 efl_access_type_set(obj, EFL_ACCESS_TYPE_DISABLED); 49 efl_access_type_set(obj, EFL_ACCESS_TYPE_DISABLED);
59 50
60 efl_ui_widget_focus_allow_set(obj, EINA_FALSE); 51 efl_ui_widget_focus_allow_set(obj, EINA_FALSE);
@@ -191,12 +182,6 @@ _efl_ui_bg_widget_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Wi
191 return efl_image_load_size_get(sd->img); 182 return efl_image_load_size_get(sd->img);
192} 183}
193 184
194static void
195_efl_ui_bg_widget_class_constructor(Efl_Class *klass)
196{
197 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
198}
199
200EAPI Eina_Bool 185EAPI Eina_Bool
201elm_bg_file_set(Eo *obj, const char *file, const char *group) 186elm_bg_file_set(Eo *obj, const char *file, const char *group)
202{ 187{
@@ -242,3 +227,32 @@ ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
242 ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX) 227 ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX)
243 228
244#include "efl_ui_bg_widget.eo.c" 229#include "efl_ui_bg_widget.eo.c"
230
231
232#include "efl_ui_bg_widget_legacy.eo.h"
233
234#define MY_CLASS_NAME_LEGACY "elm_bg"
235
236static void
237_efl_ui_bg_widget_legacy_class_constructor(Efl_Class *klass)
238{
239 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
240}
241
242EOLIAN static Eo *
243_efl_ui_bg_widget_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED)
244{
245 obj = efl_constructor(efl_super(obj, EFL_UI_BG_WIDGET_LEGACY_CLASS));
246 efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
247
248 return obj;
249}
250
251EAPI Evas_Object *
252elm_bg_add(Evas_Object *parent)
253{
254 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
255 return elm_legacy_add(EFL_UI_BG_WIDGET_LEGACY_CLASS, parent);
256}
257
258#include "efl_ui_bg_widget_legacy.eo.c"