aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-07-14 16:55:10 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-04 10:24:03 +0900
commit569ad0bac4590e8a18800741ea2345174c3683f3 (patch)
tree3c5853579dd35760b89bf397ad2e7e2675b4d7db
parenteo: Add debug_name read-only property to ease debugging (diff)
downloadefl-569ad0bac4590e8a18800741ea2345174c3683f3.tar.gz
evas/edje/elm: Override debug_name in core classes
This is really only a demonstration of what kind of information we can print with efl_debug_name_get(). Hopefully this can help debugging with printf/ERR logs and even help with live debugging inside gdb. This shouldn't be used for other purposes than debugging, as the exact string format is not defined. @feature
-rw-r--r--src/lib/edje/edje_object.eo1
-rw-r--r--src/lib/edje/edje_smart.c11
-rw-r--r--src/lib/elementary/efl_ui_win.c9
-rw-r--r--src/lib/elementary/efl_ui_win.eo1
-rw-r--r--src/lib/elementary/elm_widget.c10
-rw-r--r--src/lib/elementary/elm_widget.eo1
-rw-r--r--src/lib/evas/canvas/efl_canvas_group.eo1
-rw-r--r--src/lib/evas/canvas/efl_canvas_object.eo1
-rw-r--r--src/lib/evas/canvas/evas_main.c5
-rw-r--r--src/lib/evas/canvas/evas_name.c20
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c9
11 files changed, 68 insertions, 1 deletions
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 42314c3555..c294d43f66 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -1176,6 +1176,7 @@ class Edje.Object (Efl.Canvas.Group.Clipped, Efl.File, Efl.Container, Efl.Part,
Efl.Gfx.size { set; }
Efl.Object.constructor;
Efl.Object.destructor;
+ Efl.Object.debug_name_override { get; }
Efl.Canvas.Object.no_render { set; }
Efl.Canvas.Object.paragraph_direction { set; }
Efl.Canvas.Group.group_calculate;
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index 8c6800fded..4f105ff595 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -60,6 +60,17 @@ _edje_object_efl_object_destructor(Eo *obj, Edje *class_data)
efl_data_unref(obj, class_data->base);
}
+EOLIAN static const char *
+_edje_object_efl_object_debug_name_override_get(Eo *obj, Edje *ed)
+{
+ const char *base;
+
+ base = efl_debug_name_get(efl_super(obj, MY_CLASS));
+ return eina_slstr_printf("%s:file='%s':group='%s'", base,
+ ed->file ? eina_file_filename_get(ed->file->f) : NULL,
+ ed->group);
+}
+
EOLIAN static void
_edje_object_efl_object_dbg_info_get(Eo *eo_obj, Edje *_pd EINA_UNUSED, Efl_Dbg_Info *root) EINA_ARG_NONNULL(3)
{
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 63f3957dd5..7456cb87d4 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -6608,6 +6608,15 @@ _efl_ui_win_class_constructor(Efl_Class *klass)
}
}
+EOLIAN static const char *
+_efl_ui_win_efl_object_debug_name_override_get(Eo *obj, Efl_Ui_Win_Data *pd)
+{
+ const char *base;
+
+ base = efl_debug_name_get(efl_super(obj, MY_CLASS));
+ return eina_slstr_printf("%s:'%s':'%s'", base, pd->name, pd->title);
+}
+
EOLIAN static Eo*
_efl_ui_win_elm_interface_atspi_accessible_parent_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd EINA_UNUSED)
{
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index bbc1a7f4fc..21b8d86c5a 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -930,6 +930,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Object.finalize;
+ Efl.Object.debug_name_override { get; }
Efl.Gfx.visible { set; }
Efl.Gfx.position { set; }
Efl.Gfx.size { set; }
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 3780475bdf..7e5380de9c 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -6234,6 +6234,16 @@ _elm_widget_efl_object_destructor(Eo *obj, Elm_Widget_Smart_Data *sd)
sd->on_destroy = EINA_FALSE;
}
+EOLIAN static const char *
+_elm_widget_efl_object_debug_name_override_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED)
+{
+ const char *base, *focus = "";
+
+ if (elm_obj_widget_focus_get(obj)) focus = ":focused";
+ base = efl_debug_name_get(efl_super(obj, MY_CLASS));
+ return eina_slstr_printf("%s%s", base, focus);
+}
+
EOLIAN static Eina_Bool
_elm_widget_on_focus(Eo *obj, Elm_Widget_Smart_Data *sd, Elm_Object_Item *item EINA_UNUSED)
{
diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo
index 5efd4ddb89..9dfda78bc5 100644
--- a/src/lib/elementary/elm_widget.eo
+++ b/src/lib/elementary/elm_widget.eo
@@ -787,6 +787,7 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible,
Efl.Object.finalize;
Efl.Object.destructor;
Efl.Object.provider_find;
+ Efl.Object.debug_name_override { get; }
Efl.Gfx.color { set; }
Efl.Gfx.visible { set; }
Efl.Gfx.position { set; }
diff --git a/src/lib/evas/canvas/efl_canvas_group.eo b/src/lib/evas/canvas/efl_canvas_group.eo
index 356ad5e19c..3235dadd97 100644
--- a/src/lib/evas/canvas/efl_canvas_group.eo
+++ b/src/lib/evas/canvas/efl_canvas_group.eo
@@ -102,6 +102,7 @@ class Efl.Canvas.Group (Efl.Canvas.Object)
class.destructor;
Efl.Object.constructor;
Efl.Object.destructor;
+ Efl.Object.debug_name_override { get; }
Efl.Canvas.Object.no_render { set; }
Efl.Canvas.Object.paragraph_direction { get; set; }
}
diff --git a/src/lib/evas/canvas/efl_canvas_object.eo b/src/lib/evas/canvas/efl_canvas_object.eo
index b49a42addf..bf06f31f8c 100644
--- a/src/lib/evas/canvas/efl_canvas_object.eo
+++ b/src/lib/evas/canvas/efl_canvas_object.eo
@@ -662,6 +662,7 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
Efl.Object.destructor;
Efl.Object.finalize;
Efl.Object.provider_find;
+ Efl.Object.debug_name_override { get; }
Efl.Gfx.visible { get; set; }
Efl.Gfx.color { get; set; }
Efl.Gfx.color_part { get; set; }
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 1a6f22a337..000f52e08b 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -312,7 +312,10 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
{
if ((o->ref > 0) || (efl_ref_get(o->object) > 0))
{
- ERR("obj(%p, %s) ref count(%d) is bigger than 0. This object couldn't be deleted", o, o->type, efl_ref_get(o->object));
+ ERR("obj(%s) ref count(%d) is bigger than 0. This "
+ "object couldn't be deleted",
+ efl_debug_name_get(o->object),
+ efl_ref_get(o->object));
continue;
}
unrefs = eina_list_append(unrefs, o->object);
diff --git a/src/lib/evas/canvas/evas_name.c b/src/lib/evas/canvas/evas_name.c
index 1e75884894..a048bff0f5 100644
--- a/src/lib/evas/canvas/evas_name.c
+++ b/src/lib/evas/canvas/evas_name.c
@@ -66,3 +66,23 @@ evas_object_name_child_find(const Evas_Object *eo_obj, const char *name, int rec
return (!name ? NULL : _priv_evas_object_name_child_find(eo_obj, name, recurse));
}
+/* new in EO */
+EOLIAN const char *
+_efl_canvas_object_efl_object_debug_name_override_get(Eo *eo_obj, Evas_Object_Protected_Data *obj)
+{
+ const char *norend = obj->no_render ? ":no_render" : "";
+ const char *clip = obj->clip.clipees ? ":clipper" : "";
+ const char *base;
+
+ base = efl_debug_name_get(efl_super(eo_obj, EFL_CANVAS_OBJECT_CLASS));
+ if (obj->cur->visible)
+ {
+ return eina_slstr_printf("%s%s%s:(%d,%d %dx%d)", base, norend, clip,
+ obj->cur->geometry.x, obj->cur->geometry.y,
+ obj->cur->geometry.w, obj->cur->geometry.h);
+ }
+ else
+ {
+ return eina_slstr_printf("%s:hidden%s%s", base, norend, clip);
+ }
+}
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index eedccc04cd..9a6e725e3b 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -647,6 +647,15 @@ _efl_canvas_group_efl_object_destructor(Eo *eo_obj, Evas_Smart_Data *o)
}
}
+EOLIAN static const char *
+_efl_canvas_group_efl_object_debug_name_override_get(Eo *eo_obj, Evas_Smart_Data *o)
+{
+ const char *base;
+
+ base = efl_debug_name_get(efl_super(eo_obj, MY_CLASS));
+ return eina_slstr_printf("%s:children=%d", base, eina_inlist_count(o->contained));
+}
+
static inline void
_evas_object_smart_move_relative_internal(Evas_Smart_Data *o, Evas_Coord dx, Evas_Coord dy)
{