summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongjong Lee <cleanlyj@naver.com>2017-10-06 11:14:17 +0300
committerVyacheslav Reutskiy <v.reutskiy@samsung.com>2017-10-06 11:15:36 +0300
commit720bf7ff93bf88933dfdd4ad9f3e908a551ac9f5 (patch)
tree2e55d5d37c7c12fc1c543a145d45df0e62d43714
parent28295ecb2e8c0f5e663fe403860bc48e42a4cc55 (diff)
ewe: Add missing constructor/destructor code
Summary: the constructor/destructor code seem to have been deleted this add the missing code now, the ruler come back and this fixes broken tests of eflete also see 694ee5a7590265eed33ed986c2f95271d6bb36a7 Test Plan: 1. Open project 2. Check that ruler is shown and make check Reviewers: rimmed Differential Revision: https://phab.enlightenment.org/D5254
-rw-r--r--src/lib/ewe_ruler.c62
-rw-r--r--src/lib/ewe_ruler.eo1
2 files changed, 63 insertions, 0 deletions
diff --git a/src/lib/ewe_ruler.c b/src/lib/ewe_ruler.c
index 87b08cc0f..e2caf2678 100644
--- a/src/lib/ewe_ruler.c
+++ b/src/lib/ewe_ruler.c
@@ -1005,14 +1005,76 @@ ewe_ruler_add(Evas_Object *parent)
1005EOLIAN static Eo* 1005EOLIAN static Eo*
1006_ewe_ruler_efl_object_constructor(Eo *obj, Ewe_Ruler_Smart_Data *sd) 1006_ewe_ruler_efl_object_constructor(Eo *obj, Ewe_Ruler_Smart_Data *sd)
1007{ 1007{
1008 const char *data_dir = NULL;
1009 Eina_Strbuf *theme_path = NULL;
1010
1008 obj = efl_constructor(efl_super(obj, MY_CLASS)); 1011 obj = efl_constructor(efl_super(obj, MY_CLASS));
1009 sd->obj = obj; 1012 sd->obj = obj;
1010 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); 1013 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
1011 1014
1015 elm_widget_sub_object_parent_add(obj);
1016
1017 data_dir = elm_app_data_dir_get();
1018 if (data_dir && strcmp(data_dir, ""))
1019 {
1020 theme_path = eina_strbuf_new();
1021 eina_strbuf_append_printf(theme_path,
1022 "%s"EINA_PATH_SEP_S"themes"EINA_PATH_SEP_S"default"EINA_PATH_SEP_S"ewe.edj",
1023 data_dir);
1024 sd->theme_file = eina_strbuf_string_steal(theme_path);
1025 eina_strbuf_free(theme_path);
1026 }
1027 else
1028 {
1029 sd->theme_file = strdup(EWE_THEME);
1030 }
1031
1032 sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj));
1033 evas_object_smart_member_add(sd->clip, obj);
1034 sd->bg = elm_layout_add(obj);
1035 elm_layout_file_set(sd->bg, sd->theme_file,
1036 "ewe/ruler/horizontal_background/default");
1037 evas_object_smart_member_add(sd->bg, obj);
1038
1039 sd->horizontal = EINA_TRUE;
1040 sd->geometry.width = 0;
1041 sd->geometry.height = 0;
1042 sd->geometry.x = 0;
1043 sd->geometry.y = 0;
1044 sd->ruler_visible = EINA_FALSE;
1045 sd->size_changed = EINA_TRUE;
1046 sd->text_changed = EINA_TRUE;
1047 sd->position_changed = EINA_TRUE;
1048 ewe_ruler_scale_add(obj, NULL);
1049
1012 return obj; 1050 return obj;
1013} 1051}
1014 1052
1015EOLIAN static void 1053EOLIAN static void
1054_ewe_ruler_efl_object_destructor(Eo *obj, Ewe_Ruler_Smart_Data *sd)
1055{
1056 Ewe_Ruler_Scale *scale;
1057 Ewe_Ruler_Marker *marker;
1058 Eina_List *l, *ls;
1059
1060 EINA_LIST_FOREACH_SAFE(sd->markers, l, ls, marker)
1061 ewe_ruler_marker_del(obj, marker);
1062
1063 EINA_LIST_FOREACH_SAFE(sd->scales, l, ls, scale)
1064 ewe_ruler_scale_del(obj, scale);
1065
1066 evas_object_smart_member_del(sd->clip);
1067 evas_object_del(sd->clip);
1068
1069 evas_object_smart_member_del(sd->bg);
1070 evas_object_del(sd->bg);
1071
1072 free(sd->theme_file);
1073
1074 efl_destructor(efl_super(obj, MY_CLASS));
1075}
1076
1077EOLIAN static void
1016_ewe_ruler_class_constructor(Efl_Class *klass) 1078_ewe_ruler_class_constructor(Efl_Class *klass)
1017{ 1079{
1018 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); 1080 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
diff --git a/src/lib/ewe_ruler.eo b/src/lib/ewe_ruler.eo
index 6b27ca66a..bf791e04d 100644
--- a/src/lib/ewe_ruler.eo
+++ b/src/lib/ewe_ruler.eo
@@ -314,6 +314,7 @@ class Ewe.Ruler (Efl.Ui.Layout)
314 implements { 314 implements {
315 class.constructor; 315 class.constructor;
316 Efl.Object.constructor; 316 Efl.Object.constructor;
317 Efl.Object.destructor;
317 Efl.Gfx.size { set; } 318 Efl.Gfx.size { set; }
318 Efl.Gfx.position { set; } 319 Efl.Gfx.position { set; }
319 Efl.Gfx.visible { set; } 320 Efl.Gfx.visible { set; }