summaryrefslogtreecommitdiff
path: root/src/lib/emotion
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-08-29 09:26:15 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-29 17:17:08 +0200
commit9e0a285eea9753ed8f6999c1813d43724faf0c31 (patch)
tree6bc9977f44e6c9940bc887efb20ccfe4c9d8c01f /src/lib/emotion
parent0ef9228e5ff0b5b506ebb95136998463d6d0091c (diff)
efl: implement efl.file::unload for classes that implement load
unload is a crucial method for classes that implement load, as this is the method which is called during e.g., efl_file_simple_load() when a new file is specified in order to destroy the previous object data Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9786
Diffstat (limited to 'src/lib/emotion')
-rw-r--r--src/lib/emotion/efl_canvas_video.eo1
-rw-r--r--src/lib/emotion/emotion_smart.c17
2 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/emotion/efl_canvas_video.eo b/src/lib/emotion/efl_canvas_video.eo
index 3aa165f..be94fcc 100644
--- a/src/lib/emotion/efl_canvas_video.eo
+++ b/src/lib/emotion/efl_canvas_video.eo
@@ -52,6 +52,7 @@ class @beta Efl.Canvas.Video extends Efl.Canvas.Group implements Efl.File, Efl.P
52 Efl.Gfx.Entity.position { set; } 52 Efl.Gfx.Entity.position { set; }
53 Efl.Gfx.Entity.size { set; } 53 Efl.Gfx.Entity.size { set; }
54 Efl.File.load; 54 Efl.File.load;
55 Efl.File.unload;
55 Efl.File.file { set; } 56 Efl.File.file { set; }
56 Efl.File.loaded { get; } 57 Efl.File.loaded { get; }
57 Efl.Player.play { get; set; } 58 Efl.Player.play { get; set; }
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c
index d733e41..a7a8fa8 100644
--- a/src/lib/emotion/emotion_smart.c
+++ b/src/lib/emotion/emotion_smart.c
@@ -366,6 +366,22 @@ _efl_canvas_video_efl_file_loaded_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vide
366 return sd->open && sd->loaded; 366 return sd->open && sd->loaded;
367} 367}
368 368
369EOLIAN static void
370_efl_canvas_video_efl_file_unload(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
371{
372 if (sd->engine_instance) emotion_engine_instance_file_close(sd->engine_instance);
373 sd->engine_instance = NULL;
374 evas_object_image_data_set(sd->obj, NULL);
375 evas_object_image_size_set(sd->obj, 1, 1);
376 _emotion_image_data_zero(sd->obj);
377
378 if (sd->anim) ecore_animator_del(sd->anim);
379 sd->anim = NULL;
380
381 _xattr_data_cancel(sd->xattr);
382 sd->loaded = 0;
383}
384
369EOLIAN static Eina_Error 385EOLIAN static Eina_Error
370_efl_canvas_video_efl_file_load(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd) 386_efl_canvas_video_efl_file_load(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
371{ 387{
@@ -410,7 +426,6 @@ _efl_canvas_video_efl_file_load(Eo *obj EINA_UNUSED, Efl_Canvas_Video_Data *sd)
410 evas_object_image_data_set(sd->obj, NULL); 426 evas_object_image_data_set(sd->obj, NULL);
411 evas_object_image_size_set(sd->obj, 1, 1); 427 evas_object_image_size_set(sd->obj, 1, 1);
412 _emotion_image_data_zero(sd->obj); 428 _emotion_image_data_zero(sd->obj);
413 eina_stringshare_replace(&sd->file, NULL);
414 } 429 }
415 430
416 if (sd->anim) ecore_animator_del(sd->anim); 431 if (sd->anim) ecore_animator_del(sd->anim);