Efl.Gfx.size { set; }
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Object.debug_name_override { get; }
+ Efl.Object.debug_name_override;
Efl.Canvas.Object.no_render { set; }
Efl.Canvas.Object.paragraph_direction { set; }
Efl.Canvas.Group.group_calculate;
efl_data_unref(obj, class_data->base);
}
-EOLIAN static const char *
-_edje_object_efl_object_debug_name_override_get(Eo *obj, Edje *ed)
+EOLIAN static Eina_Strbuf *
+_edje_object_efl_object_debug_name_override(Eo *obj, Edje *ed, Eina_Strbuf *sb)
{
- 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);
+ sb = efl_debug_name_override(efl_super(obj, MY_CLASS), sb);
+ eina_strbuf_append_printf(sb, ":file='%s':group='%s'",
+ ed->file ? eina_file_filename_get(ed->file->f) : NULL,
+ ed->group);
+ return sb;
}
EOLIAN static void
}
}
-EOLIAN static const char *
-_efl_ui_win_efl_object_debug_name_override_get(Eo *obj, Efl_Ui_Win_Data *pd)
+EOLIAN static Eina_Strbuf *
+_efl_ui_win_efl_object_debug_name_override(Eo *obj, Efl_Ui_Win_Data *pd, Eina_Strbuf *sb)
{
- 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);
+ sb = efl_debug_name_override(efl_super(obj, MY_CLASS), sb);
+ eina_strbuf_append_printf(sb, ":'%s':'%s'", pd->name, pd->title);
+ return sb;
}
EOLIAN static Eo*
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Object.finalize;
- Efl.Object.debug_name_override { get; }
+ Efl.Object.debug_name_override;
Efl.Gfx.visible { set; }
Efl.Gfx.position { set; }
Efl.Gfx.size { set; }
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)
+EOLIAN static Eina_Strbuf *
+_elm_widget_efl_object_debug_name_override(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Strbuf *sb)
{
- const char *base, *focus = "";
+ const char *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);
+ sb = efl_debug_name_override(efl_super(obj, MY_CLASS), sb);
+ eina_strbuf_append_printf(sb, "%s", focus);
+ return sb;
}
EOLIAN static Eina_Bool
Efl.Object.finalize;
Efl.Object.destructor;
Efl.Object.provider_find;
- Efl.Object.debug_name_override { get; }
+ Efl.Object.debug_name_override;
Efl.Gfx.color { set; }
Efl.Gfx.visible { set; }
Efl.Gfx.position { set; }
comment: string @nullable; [[The comment]]
}
}
- @property debug_name_override {
- [[ A read-only name for this object used for debugging.
+ debug_name_override {
+ [[ Build a read-only name for this object used for debugging.
+
+ Multiple calls using efl_super() can be chained in order to build
+ the entire debug name, from parent to child classes. In C the usual
+ way to build the string is as follows:
+
+ sb = efl_debug_name_override(efl_super(obj, MY_CLASS), sb);
+ eina_strbuf_append_printf(sb, "new_information");
+ return sb;
+
+ The receiving function should always either free the strbuf or
+ returning it back to the caller, as ownership is transferred.
@since 1.21
]]
- get {}
- values {
- name: string; [[A name including class name and object name.]]
+ params {
+ @in sb: own(ptr(Eina.Strbuf)); [[A string buffer, must not be $null.]]
}
+ return: own(ptr(Eina.Strbuf)); [[Should not be $null, may be $sb.]]
}
@property event_global_freeze_count @class {
get {
type @extern Eina.Error: int; [[Eina error type]]
struct @extern @free(eina_binbuf_free) Eina.Binbuf; [[Eina binbuf data structure]]
+struct @extern @free(eina_strbuf_free) Eina.Strbuf; [[Eina strbuf data structure]]
struct @extern Eina.Slice {
[[A linear, read-only, memory segment]]
efl_debug_name_get(const Eo *obj_id)
{
const char *override = "";
- const char *name, *clsname, *ret;
+ const char *name, *clsname;
+ Eina_Strbuf *sb;
if (!obj_id) return "(null)";
EO_OBJ_POINTER(obj_id, obj);
if (!obj) return eina_slstr_printf("Invalid_Object_ID@%p", obj_id);
+ sb = eina_strbuf_new();
+ name = efl_name_get(obj_id);
+ clsname = obj->klass->desc->name;
+ if (_obj_is_override(obj)) override = "(override)";
+
+ if (name)
+ eina_strbuf_append_printf(sb, "%s%s@%p[%d]:'%s'", clsname, override, obj_id, (int) obj->refcount, name);
+ else
+ eina_strbuf_append_printf(sb, "%s%s@%p[%d]", clsname, override, obj_id, (int) obj->refcount);
+
if (!obj->cur_klass)
{
- ret = efl_debug_name_override_get(obj_id);
- if (ret) goto end;
+ sb = efl_debug_name_override((Eo *) obj_id, sb);
}
else
{
if (obj->super)
- ret = efl_debug_name_override_get(efl_super(obj_id, (Efl_Class *) obj->cur_klass->header.id));
+ sb = efl_debug_name_override(efl_super(obj_id, (Efl_Class *) obj->cur_klass->header.id), sb);
else
- ret = efl_debug_name_override_get(efl_cast(obj_id, (Efl_Class *) obj->cur_klass->header.id));
+ sb = efl_debug_name_override(efl_cast(obj_id, (Efl_Class *) obj->cur_klass->header.id), sb);
obj->super = EINA_FALSE;
obj->cur_klass = NULL;
- if (ret) goto end;
}
- name = efl_name_get(obj_id);
- clsname = obj->klass->desc->name;
- if (_obj_is_override(obj)) override = "(override)";
-
- if (name)
- ret = eina_slstr_printf("%s%s@%p[%d]:'%s'", clsname, override, obj_id, (int) obj->refcount, name);
- else
- ret = eina_slstr_printf("%s%s@%p[%d]", clsname, override, obj_id, (int) obj->refcount);
-
-end:
EO_OBJ_DONE(obj_id);
- return ret;
+ return eina_slstr_strbuf_new(sb);
}
EAPI int
return pd->ext->comment;
}
-EOLIAN static const char *
-_efl_object_debug_name_override_get(Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd EINA_UNUSED)
+EOLIAN static Eina_Strbuf *
+_efl_object_debug_name_override(Eo *obj_id EINA_UNUSED, Efl_Object_Data *pd EINA_UNUSED, Eina_Strbuf *sb)
{
- return NULL;
+ return sb;
}
EOLIAN static void
class.destructor;
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Object.debug_name_override { get; }
+ Efl.Object.debug_name_override;
Efl.Canvas.Object.no_render { set; }
Efl.Canvas.Object.paragraph_direction { get; set; }
}
Efl.Object.destructor;
Efl.Object.finalize;
Efl.Object.provider_find;
- Efl.Object.debug_name_override { get; }
+ Efl.Object.debug_name_override;
Efl.Gfx.visible { get; set; }
Efl.Gfx.color { get; set; }
Efl.Gfx.color_part { get; set; }
EINA_LIST_FREE(unrefs, eo_obj)
{
- ERR("Killing Zombie Object [%s@%p]. Refs: %i:%i",
- efl_class_name_get(eo_obj), eo_obj, efl_ref_get(eo_obj), ___efl_ref2_get(eo_obj));
+ ERR("Killing Zombie Object [%s]. Refs: %i:%i",
+ efl_debug_name_get(eo_obj), efl_ref_get(eo_obj), ___efl_ref2_get(eo_obj));
___efl_ref2_reset(eo_obj);
while (efl_ref_get(eo_obj) > 1) efl_unref(eo_obj);
while (efl_ref_get(eo_obj) < 1) efl_ref(eo_obj);
EINA_INLIST_FOREACH(lay->objects, o)
if (o && (o->object == eo_obj))
{
- ERR("Zombie Object [%s@%p] could not be removed "
+ ERR("Zombie Object [%s] could not be removed "
"from the list of objects. Maybe this object "
"was deleted but the call to efl_destructor() "
"was not propagated to all the parent classes? "
"Forcibly removing it. This may leak! Refs: %i:%i",
- efl_class_name_get(eo_obj), eo_obj, efl_ref_get(eo_obj), ___efl_ref2_get(eo_obj));
+ efl_debug_name_get(eo_obj), efl_ref_get(eo_obj), ___efl_ref2_get(eo_obj));
lay->objects = (Evas_Object_Protected_Data *)
eina_inlist_remove(EINA_INLIST_GET(lay->objects), EINA_INLIST_GET(o));
goto next_zombie;
}
/* new in EO */
-EOLIAN const char *
-_efl_canvas_object_efl_object_debug_name_override_get(Eo *eo_obj, Evas_Object_Protected_Data *obj)
+EOLIAN Eina_Strbuf *
+_efl_canvas_object_efl_object_debug_name_override(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Strbuf *sb)
{
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));
+ sb = efl_debug_name_override(efl_super(eo_obj, EFL_CANVAS_OBJECT_CLASS), sb);
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);
+ eina_strbuf_append_printf(sb, "%s%s:(%d,%d %dx%d)", 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);
+ eina_strbuf_append_printf(sb, ":hidden%s%s", norend, clip);
}
+ return sb;
}
}
}
-EOLIAN static const char *
-_efl_canvas_group_efl_object_debug_name_override_get(Eo *eo_obj, Evas_Smart_Data *o)
+EOLIAN static Eina_Strbuf *
+_efl_canvas_group_efl_object_debug_name_override(Eo *eo_obj, Evas_Smart_Data *o, Eina_Strbuf *sb)
{
- 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));
+ sb = efl_debug_name_override(efl_super(eo_obj, MY_CLASS), sb);
+ eina_strbuf_append_printf(sb, ":children=%d", eina_inlist_count(o->contained));
+ return sb;
}
static inline void