Evas_Coord rw, rh;
const void *data;
Evas_Load_Error err;
+ Evas_Object *_img;
ee = ecore_evas_buffer_new(part_w, part_h);
if (!ee) {
ErrPrint("Failed to create a EE\n");
- evas_object_del(img);
- return NULL;
+ return img;
}
ecore_evas_alpha_set(ee, EINA_TRUE);
if (!e) {
ErrPrint("Unable to get Evas\n");
ecore_evas_free(ee);
- evas_object_del(img);
- return NULL;
+ return img;
}
src_img = evas_object_image_filled_add(e);
if (!src_img) {
ErrPrint("Unable to add an image\n");
ecore_evas_free(ee);
- evas_object_del(img);
- return NULL;
+ return img;
}
evas_object_image_alpha_set(src_img, EINA_TRUE);
ErrPrint("Load error: %s\n", evas_load_error_str(err));
evas_object_del(src_img);
ecore_evas_free(ee);
- evas_object_del(img);
- return NULL;
+ return img;
}
evas_object_image_size_get(src_img, &rw, &rh);
evas_object_image_fill_set(src_img, 0, 0, rw, rh);
ErrPrint("Unable to get pixels\n");
evas_object_del(src_img);
ecore_evas_free(ee);
- evas_object_del(img);
- return NULL;
+ return img;
}
e = evas_object_evas_get(img);
- evas_object_del(img);
- img = evas_object_image_filled_add(e);
- if (!img) {
+ _img = evas_object_image_filled_add(e);
+ if (!_img) {
evas_object_del(src_img);
ecore_evas_free(ee);
- return NULL;
+ return img;
}
- evas_object_image_colorspace_set(img, EVAS_COLORSPACE_ARGB8888);
- evas_object_image_smooth_scale_set(img, EINA_TRUE);
- evas_object_image_alpha_set(img, EINA_TRUE);
- evas_object_image_data_set(img, NULL);
- evas_object_image_size_set(img, part_w, part_h);
- evas_object_resize(img, part_w, part_h);
- evas_object_image_data_copy_set(img, (void *)data);
- evas_object_image_fill_set(img, 0, 0, part_w, part_h);
- evas_object_image_data_update_add(img, 0, 0, part_w, part_h);
+ evas_object_image_colorspace_set(_img, EVAS_COLORSPACE_ARGB8888);
+ evas_object_image_smooth_scale_set(_img, EINA_TRUE);
+ evas_object_image_alpha_set(_img, EINA_TRUE);
+ evas_object_image_data_set(_img, NULL);
+ evas_object_image_size_set(_img, part_w, part_h);
+ evas_object_resize(_img, part_w, part_h);
+ evas_object_image_data_copy_set(_img, (void *)data);
+ evas_object_image_fill_set(_img, 0, 0, part_w, part_h);
+ evas_object_image_data_update_add(_img, 0, 0, part_w, part_h);
evas_object_del(src_img);
ecore_evas_free(ee);
- return img;
+ evas_object_del(img);
+ return _img;
}
PUBLIC int script_update_image(void *_h, const char *id, const char *part, const char *path, const char *option)