evas: Add debug_name to image objects

This commit is contained in:
Jean-Philippe Andre 2017-07-25 14:42:54 +09:00
parent b290cb5de0
commit 0353eb5b7f
3 changed files with 29 additions and 2 deletions

View File

@ -10,6 +10,7 @@ abstract Efl.Canvas.Image.Internal (Efl.Canvas.Object, Efl.Canvas.Filter.Interna
Efl.Object.constructor;
Efl.Object.destructor;
Efl.Object.finalize;
Efl.Object.debug_name_override;
Efl.File.save;
Efl.Orientation.orientation { get; set; }
Efl.Flipable.flip { get; set; }

View File

@ -84,8 +84,8 @@ struct _Evas_Object_Image_State
Evas_Canvas3D_Scene *scene;
union {
const char *file;
Eina_File *f;
const char *file; // used if !mmaped_source
Eina_File *f; // used if mmaped_source
} u;
const char *key;
int frame;

View File

@ -3664,6 +3664,32 @@ _evas_object_image_surface_get(Evas_Object_Protected_Data *obj, Eina_Bool create
return pd->engine_data;
}
EOLIAN static Eina_Strbuf *
_efl_canvas_image_internal_efl_object_debug_name_override(Eo *eo_obj, Evas_Image_Data *o, Eina_Strbuf *sb)
{
sb = efl_debug_name_override(efl_super(eo_obj, MY_CLASS), sb);
if (o->cur->u.f)
{
const char *fname = o->cur->mmaped_source ?
eina_file_filename_get(o->cur->u.f) : o->cur->u.file;
eina_strbuf_append_printf(sb, ":file='%s',key='%s'", fname, o->cur->key);
}
else if (o->pixels && o->pixels->func.get_pixels)
{
eina_strbuf_append_printf(sb, ":get_pixels=%p:dirty=%d",
o->pixels->func.get_pixels, o->dirty_pixels);
}
else if (o->cur->source)
{
eina_strbuf_append_printf(sb, ":proxy_source=%p", o->cur->source);
}
else
{
eina_strbuf_append_printf(sb, ":unknown_image");
}
return sb;
}
#define EFL_CANVAS_IMAGE_INTERNAL_EXTRA_OPS \
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_canvas_image_internal_efl_object_dbg_info_get)