aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_object_image.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-05-19 11:41:27 +0100
committerTom Hacohen <tom@stosb.com>2015-05-20 13:03:24 +0100
commit6efbfe227aaaa24eda7bcb7df916d4daf0a74400 (patch)
treec96e166b7348c5e825aca2d4af084675172e0cec /src/lib/evas/canvas/evas_object_image.c
parentEcore audio: Remove redundant constructor/destructor. (diff)
downloadefl-6efbfe227aaaa24eda7bcb7df916d4daf0a74400.tar.gz
Eo: Add a return value to eo_constructor().
From now on, constructors should return a value, usually the object being worked on, or NULL (if the constructor failed). This can also be used for implementing singletons, by just always returning the same object from the constructor. This is one of the final steps towards stabilizing Eo. @feature
Diffstat (limited to 'src/lib/evas/canvas/evas_object_image.c')
-rw-r--r--src/lib/evas/canvas/evas_object_image.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index cabeebbb0c..5e59dbb835 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -342,7 +342,7 @@ _init_cow(Eo *eo_obj)
return EINA_TRUE;
}
-EOLIAN static void
+EOLIAN static Eo *
_evas_image_eo_base_constructor(Eo *eo_obj, Evas_Image_Data *o)
{
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
@@ -350,7 +350,7 @@ _evas_image_eo_base_constructor(Eo *eo_obj, Evas_Image_Data *o)
Eo *parent = NULL;
Evas_Colorspace cspace;
- eo_do_super(eo_obj, MY_CLASS, eo_constructor());
+ eo_obj = eo_do_super_ret(eo_obj, MY_CLASS, eo_obj, eo_constructor());
eo_do(eo_obj, parent = eo_parent_get());
eo_e = evas_object_evas_get(parent);
@@ -359,7 +359,7 @@ _evas_image_eo_base_constructor(Eo *eo_obj, Evas_Image_Data *o)
evas_object_inject(eo_obj, obj, eo_e);
if (!_init_cow(eo_obj))
- return;
+ return NULL;
o->load_opts = eina_cow_alloc(evas_object_image_load_opts_cow);
o->pixels = eina_cow_alloc(evas_object_image_pixels_cow);
@@ -377,6 +377,8 @@ _evas_image_eo_base_constructor(Eo *eo_obj, Evas_Image_Data *o)
state_write->filter = eina_cow_alloc(evas_object_filter_cow);
EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
}
+
+ return eo_obj;
}
EAPI Evas_Object *