aboutsummaryrefslogtreecommitdiffstats
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
parentewe: fix eo compilation (diff)
downloadeflete-720bf7ff93bf88933dfdd4ad9f3e908a551ac9f5.tar.gz
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)
EOLIAN static Eo*
_ewe_ruler_efl_object_constructor(Eo *obj, Ewe_Ruler_Smart_Data *sd)
{
+ const char *data_dir = NULL;
+ Eina_Strbuf *theme_path = NULL;
+
obj = efl_constructor(efl_super(obj, MY_CLASS));
sd->obj = obj;
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
+ elm_widget_sub_object_parent_add(obj);
+
+ data_dir = elm_app_data_dir_get();
+ if (data_dir && strcmp(data_dir, ""))
+ {
+ theme_path = eina_strbuf_new();
+ eina_strbuf_append_printf(theme_path,
+ "%s"EINA_PATH_SEP_S"themes"EINA_PATH_SEP_S"default"EINA_PATH_SEP_S"ewe.edj",
+ data_dir);
+ sd->theme_file = eina_strbuf_string_steal(theme_path);
+ eina_strbuf_free(theme_path);
+ }
+ else
+ {
+ sd->theme_file = strdup(EWE_THEME);
+ }
+
+ sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj));
+ evas_object_smart_member_add(sd->clip, obj);
+ sd->bg = elm_layout_add(obj);
+ elm_layout_file_set(sd->bg, sd->theme_file,
+ "ewe/ruler/horizontal_background/default");
+ evas_object_smart_member_add(sd->bg, obj);
+
+ sd->horizontal = EINA_TRUE;
+ sd->geometry.width = 0;
+ sd->geometry.height = 0;
+ sd->geometry.x = 0;
+ sd->geometry.y = 0;
+ sd->ruler_visible = EINA_FALSE;
+ sd->size_changed = EINA_TRUE;
+ sd->text_changed = EINA_TRUE;
+ sd->position_changed = EINA_TRUE;
+ ewe_ruler_scale_add(obj, NULL);
+
return obj;
}
EOLIAN static void
+_ewe_ruler_efl_object_destructor(Eo *obj, Ewe_Ruler_Smart_Data *sd)
+{
+ Ewe_Ruler_Scale *scale;
+ Ewe_Ruler_Marker *marker;
+ Eina_List *l, *ls;
+
+ EINA_LIST_FOREACH_SAFE(sd->markers, l, ls, marker)
+ ewe_ruler_marker_del(obj, marker);
+
+ EINA_LIST_FOREACH_SAFE(sd->scales, l, ls, scale)
+ ewe_ruler_scale_del(obj, scale);
+
+ evas_object_smart_member_del(sd->clip);
+ evas_object_del(sd->clip);
+
+ evas_object_smart_member_del(sd->bg);
+ evas_object_del(sd->bg);
+
+ free(sd->theme_file);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
+}
+
+EOLIAN static void
_ewe_ruler_class_constructor(Efl_Class *klass)
{
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)
implements {
class.constructor;
Efl.Object.constructor;
+ Efl.Object.destructor;
Efl.Gfx.size { set; }
Efl.Gfx.position { set; }
Efl.Gfx.visible { set; }