summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-03-16 19:37:04 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-03-17 13:10:35 +0900
commit8367f497b8f1e9a7b365c815f12deeab9c92e1a5 (patch)
tree97adbbe04befc36d413cb68dd5f5524ab3f6a813 /src
parentedafd4ec34629d8200b04e4fda074ac0f5dadf92 (diff)
Evas.Image: Create Efl.Canvas.Image for file & data images
This replaces standard Evas_Object_Image when it is used "normally", ie. it's an image from a file or from a pixel buffer. All other APIs (proxy, snapshot, 3d, gl, ...) are disabled on this object. Also, reduce number of failing calls when the object is not a legacy object, but a legacy function is called. This is because a lot of image APIs are called internally using the legacy APIs, often in order to reset the state of the image object (eg. set file to NULL, etc...)
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Evas.am2
-rw-r--r--src/examples/evas/evas-3d-proxy.c2
-rw-r--r--src/lib/evas/Evas_Eo.h2
-rw-r--r--src/lib/evas/canvas/efl_canvas_proxy.c2
-rw-r--r--src/lib/evas/canvas/evas_image.eo38
-rw-r--r--src/lib/evas/canvas/evas_image_legacy.c217
-rw-r--r--src/lib/evas/canvas/evas_image_private.h50
-rw-r--r--src/lib/evas/canvas/evas_object_image.c462
-rw-r--r--src/lib/evas/canvas/evas_object_main.c4
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_preload.c2
10 files changed, 251 insertions, 530 deletions
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 57fe9c4546..4f5656470b 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -41,6 +41,7 @@ evas_eolian_pub_files = \
41 lib/evas/canvas/efl_vg_gradient.eo \ 41 lib/evas/canvas/efl_vg_gradient.eo \
42 lib/evas/canvas/efl_vg_gradient_radial.eo \ 42 lib/evas/canvas/efl_vg_gradient_radial.eo \
43 lib/evas/canvas/efl_vg_gradient_linear.eo \ 43 lib/evas/canvas/efl_vg_gradient_linear.eo \
44 lib/evas/canvas/efl_canvas_image.eo \
44 lib/evas/canvas/efl_canvas_snapshot.eo \ 45 lib/evas/canvas/efl_canvas_snapshot.eo \
45 lib/evas/canvas/efl_canvas_proxy.eo \ 46 lib/evas/canvas/efl_canvas_proxy.eo \
46 lib/evas/canvas/efl_canvas_scene3d.eo \ 47 lib/evas/canvas/efl_canvas_scene3d.eo \
@@ -183,6 +184,7 @@ lib/evas/canvas/evas_touch_point.c \
183lib/evas/canvas/evas_map.c \ 184lib/evas/canvas/evas_map.c \
184lib/evas/canvas/evas_gl.c \ 185lib/evas/canvas/evas_gl.c \
185lib/evas/canvas/evas_out.c \ 186lib/evas/canvas/evas_out.c \
187lib/evas/canvas/efl_canvas_image.c \
186lib/evas/canvas/efl_canvas_proxy.c \ 188lib/evas/canvas/efl_canvas_proxy.c \
187lib/evas/canvas/efl_canvas_snapshot.c \ 189lib/evas/canvas/efl_canvas_snapshot.c \
188lib/evas/canvas/efl_canvas_scene3d.c \ 190lib/evas/canvas/efl_canvas_scene3d.c \
diff --git a/src/examples/evas/evas-3d-proxy.c b/src/examples/evas/evas-3d-proxy.c
index 0ae5693a58..06ff5bb2cd 100644
--- a/src/examples/evas/evas-3d-proxy.c
+++ b/src/examples/evas/evas-3d-proxy.c
@@ -90,7 +90,7 @@ _animate_scene(void *data)
90 } 90 }
91 91
92 //efl_gfx_buffer_set(source, pixels, 0, 0, stride, 0, 0, 0, 0, 0, 0); 92 //efl_gfx_buffer_set(source, pixels, 0, 0, stride, 0, 0, 0, 0, 0, 0);
93 //evas_obj_image_data_update_add(source, 0, 0, IMG_WIDTH, IMG_HEIGHT); 93 //evas_object_image_data_update_add(source, 0, 0, IMG_WIDTH, IMG_HEIGHT);
94 evas_object_image_data_set(source, pixels); 94 evas_object_image_data_set(source, pixels);
95 evas_object_image_data_update_add(source, 0, 0, IMG_WIDTH, IMG_HEIGHT); 95 evas_object_image_data_update_add(source, 0, 0, IMG_WIDTH, IMG_HEIGHT);
96 96
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index 718c984c85..02d01b7710 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -341,7 +341,7 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x,
341#include "canvas/evas_canvas3d_scene.eo.h" 341#include "canvas/evas_canvas3d_scene.eo.h"
342 342
343#include "canvas/evas_image.eo.h" 343#include "canvas/evas_image.eo.h"
344 344#include "canvas/efl_canvas_image.eo.h"
345#include "canvas/efl_canvas_snapshot.eo.h" 345#include "canvas/efl_canvas_snapshot.eo.h"
346#include "canvas/efl_canvas_proxy.eo.h" 346#include "canvas/efl_canvas_proxy.eo.h"
347#include "canvas/efl_canvas_scene3d.eo.h" 347#include "canvas/efl_canvas_scene3d.eo.h"
diff --git a/src/lib/evas/canvas/efl_canvas_proxy.c b/src/lib/evas/canvas/efl_canvas_proxy.c
index af94ec0806..9648027424 100644
--- a/src/lib/evas/canvas/efl_canvas_proxy.c
+++ b/src/lib/evas/canvas/efl_canvas_proxy.c
@@ -219,7 +219,7 @@ _evas_image_proxy_set(Evas_Object *eo_proxy, Evas_Object *eo_src)
219 Evas_Object_Protected_Data *proxy = eo_data_scope_get(eo_proxy, EVAS_OBJECT_CLASS); 219 Evas_Object_Protected_Data *proxy = eo_data_scope_get(eo_proxy, EVAS_OBJECT_CLASS);
220 Evas_Image_Data *o = eo_data_scope_get(eo_proxy, EVAS_IMAGE_CLASS); 220 Evas_Image_Data *o = eo_data_scope_get(eo_proxy, EVAS_IMAGE_CLASS);
221 221
222 evas_object_image_file_set(eo_proxy, NULL, NULL); 222 _evas_image_file_set(eo_proxy, NULL, NULL);
223 223
224 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, proxy->proxy, Evas_Object_Proxy_Data, proxy_write) 224 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, proxy->proxy, Evas_Object_Proxy_Data, proxy_write)
225 proxy_write->is_proxy = EINA_TRUE; 225 proxy_write->is_proxy = EINA_TRUE;
diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo
index bf48249a75..576138459d 100644
--- a/src/lib/evas/canvas/evas_image.eo
+++ b/src/lib/evas/canvas/evas_image.eo
@@ -1,9 +1,12 @@
1type @extern Evas_Object_Image_Pixels_Get_Cb: __undefined_type; /* FIXME: func pointers are not supported. */ 1type @extern Evas_Object_Image_Pixels_Get_Cb: __undefined_type; /* FIXME: func pointers are not supported. */
2 2
3class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Load, Efl.Image_Animated, Efl.Gfx.Buffer, Efl.Gfx.Fill, Efl.Gfx.View, Evas.Filter) 3class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Load,
4 Efl.Image_Animated, Efl.Gfx.Buffer, Efl.Gfx.Fill,
5 Efl.Gfx.View, Evas.Filter)
4{ 6{
7 /* Legacy is implement inside Efl.Canvas.Image */
5 legacy_prefix: evas_object_image; 8 legacy_prefix: evas_object_image;
6 eo_prefix: evas_obj_image; 9 eo_prefix: null;
7 methods { 10 methods {
8 /* GL View */ 11 /* GL View */
9 @property pixels_dirty { 12 @property pixels_dirty {
@@ -46,10 +49,6 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Load, Efl.Image_An
46 Eo.Base.destructor; 49 Eo.Base.destructor;
47 Eo.Base.dbg_info_get; 50 Eo.Base.dbg_info_get;
48 Eo.Base.finalize; 51 Eo.Base.finalize;
49 Efl.File.file.set;
50 Efl.File.file.get;
51 Efl.File.mmap.set;
52 Efl.File.mmap.get;
53 Efl.File.save; 52 Efl.File.save;
54 Efl.Image.orientation.get; 53 Efl.Image.orientation.get;
55 Efl.Image.orientation.set; 54 Efl.Image.orientation.set;
@@ -66,27 +65,6 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Load, Efl.Image_An
66 Efl.Image.scale_hint.set; 65 Efl.Image.scale_hint.set;
67 Efl.Image.content_hint.get; 66 Efl.Image.content_hint.get;
68 Efl.Image.content_hint.set; 67 Efl.Image.content_hint.set;
69 Efl.Image_Animated.animated.get;
70 Efl.Image_Animated.animated_frame.get;
71 Efl.Image_Animated.animated_frame.set;
72 Efl.Image_Animated.animated_frame_count.get;
73 Efl.Image_Animated.animated_loop_type.get;
74 Efl.Image_Animated.animated_loop_count.get;
75 Efl.Image_Animated.animated_frame_duration.get;
76 Efl.Image_Load.load_error.get;
77 Efl.Image_Load.load_async_start;
78 Efl.Image_Load.load_async_cancel;
79 Efl.Image_Load.load_dpi.get;
80 Efl.Image_Load.load_dpi.set;
81 Efl.Image_Load.load_size.set;
82 Efl.Image_Load.load_size.get;
83 Efl.Image_Load.load_orientation.get;
84 Efl.Image_Load.load_orientation.set;
85 Efl.Image_Load.load_scale_down.get;
86 Efl.Image_Load.load_scale_down.set;
87 Efl.Image_Load.load_region.get;
88 Efl.Image_Load.load_region.set;
89 Efl.Image_Load.load_region_support.get;
90 Efl.Gfx.Buffer.alpha.get; 68 Efl.Gfx.Buffer.alpha.get;
91 Efl.Gfx.Buffer.alpha.set; 69 Efl.Gfx.Buffer.alpha.set;
92 Efl.Gfx.Buffer.buffer_update_add; 70 Efl.Gfx.Buffer.buffer_update_add;
@@ -104,5 +82,11 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Load, Efl.Image_An
104 Evas.Filter.filter_input_alpha; 82 Evas.Filter.filter_input_alpha;
105 Evas.Filter.filter_input_render; 83 Evas.Filter.filter_input_render;
106 Evas.Filter.filter_dirty; 84 Evas.Filter.filter_dirty;
85
86 /* FIXME: Efl.File does not belong here */
87 Efl.File.file.set;
88 Efl.File.file.get;
89 Efl.File.mmap.set;
90 Efl.File.mmap.get;
107 } 91 }
108} 92}
diff --git a/src/lib/evas/canvas/evas_image_legacy.c b/src/lib/evas/canvas/evas_image_legacy.c
index 351ae9112d..9b510ddba0 100644
--- a/src/lib/evas/canvas/evas_image_legacy.c
+++ b/src/lib/evas/canvas/evas_image_legacy.c
@@ -1,11 +1,15 @@
1#include "evas_image_private.h" 1#include "evas_image_private.h"
2 2
3#define EVAS_IMAGE_LEGACY_API(_o, ...) \ 3#define EVAS_IMAGE_API(_o, ...) do { \
4 do { EVAS_OBJECT_LEGACY_API(_o, __VA_ARGS__); \ 4 if (EINA_UNLIKELY(!eo_isa(_o, EVAS_IMAGE_CLASS))) { \
5 if (EINA_UNLIKELY(!eo_isa(_o, EVAS_IMAGE_CLASS))) { \ 5 EINA_SAFETY_ERROR("object is not an image!"); \
6 EINA_SAFETY_ERROR("object is not an image!"); \ 6 return __VA_ARGS__; \
7 return __VA_ARGS__; \ 7 } } while (0)
8 } } while(0) 8
9#define EVAS_IMAGE_LEGACY_API(_o, ...) do { \
10 EVAS_OBJECT_LEGACY_API(_o, __VA_ARGS__); \
11 EVAS_IMAGE_API(_o, __VA_ARGS__); \
12 } while (0)
9 13
10EAPI Evas_Object * 14EAPI Evas_Object *
11evas_object_image_add(Evas *eo_e) 15evas_object_image_add(Evas *eo_e)
@@ -29,7 +33,7 @@ evas_object_image_memfile_set(Evas_Object *eo_obj, void *data, int size, char *f
29{ 33{
30 Eina_File *f; 34 Eina_File *f;
31 35
32 EVAS_IMAGE_LEGACY_API(eo_obj); 36 EVAS_IMAGE_API(eo_obj);
33 37
34 f = eina_file_virtualize(NULL, data, size, EINA_TRUE); 38 f = eina_file_virtualize(NULL, data, size, EINA_TRUE);
35 if (!f) return ; 39 if (!f) return ;
@@ -38,284 +42,327 @@ evas_object_image_memfile_set(Evas_Object *eo_obj, void *data, int size, char *f
38} 42}
39 43
40EAPI void 44EAPI void
41evas_object_image_fill_set(Evas_Image *obj, 45evas_object_image_fill_set(Evas_Object *obj,
42 Evas_Coord x, Evas_Coord y, 46 Evas_Coord x, Evas_Coord y,
43 Evas_Coord w, Evas_Coord h) 47 Evas_Coord w, Evas_Coord h)
44{ 48{
45 efl_gfx_fill_set((Evas_Image *)obj, x, y, w, h); 49 EVAS_IMAGE_API(obj);
50 efl_gfx_fill_set(obj, x, y, w, h);
46} 51}
47 52
48EAPI void 53EAPI void
49evas_object_image_preload(Evas_Object *eo_obj, Eina_Bool cancel) 54evas_object_image_preload(Evas_Object *eo_obj, Eina_Bool cancel)
50{ 55{
56 EVAS_IMAGE_API(eo_obj);
51 if (cancel) 57 if (cancel)
52 efl_image_load_async_cancel(eo_obj); 58 _evas_image_load_async_cancel(eo_obj);
53 else 59 else
54 efl_image_load_async_start(eo_obj); 60 _evas_image_load_async_start(eo_obj);
55} 61}
56 62
57EAPI Eina_Bool 63EAPI Eina_Bool
58evas_object_image_filled_get(const Evas_Object *eo_obj) 64evas_object_image_filled_get(const Evas_Object *eo_obj)
59{ 65{
66 EVAS_IMAGE_API(eo_obj, EINA_FALSE);
60 return efl_gfx_fill_filled_get(eo_obj); 67 return efl_gfx_fill_filled_get(eo_obj);
61} 68}
62 69
63EAPI void 70EAPI void
64evas_object_image_filled_set(Evas_Object *eo_obj, Eina_Bool value) 71evas_object_image_filled_set(Evas_Object *eo_obj, Eina_Bool value)
65{ 72{
73 EVAS_IMAGE_API(eo_obj);
66 efl_gfx_fill_filled_set(eo_obj, value); 74 efl_gfx_fill_filled_set(eo_obj, value);
67} 75}
68 76
69EAPI void 77EAPI void
70evas_object_image_fill_get(const Evas_Image *obj, 78evas_object_image_fill_get(const Evas_Object *obj,
71 Evas_Coord *x, Evas_Coord *y, 79 Evas_Coord *x, Evas_Coord *y,
72 Evas_Coord *w, Evas_Coord *h) 80 Evas_Coord *w, Evas_Coord *h)
73{ 81{
82 EVAS_IMAGE_API(obj);
74 efl_gfx_fill_get(obj, x, y, w, h); 83 efl_gfx_fill_get(obj, x, y, w, h);
75} 84}
76 85
77EAPI void 86EAPI void
78evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool alpha) 87evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool alpha)
79{ 88{
80 EVAS_IMAGE_LEGACY_API(obj); 89 EVAS_IMAGE_API(obj);
81 efl_gfx_buffer_alpha_set(obj, alpha); 90 efl_gfx_buffer_alpha_set(obj, alpha);
82} 91}
83 92
84EAPI Eina_Bool 93EAPI Eina_Bool
85evas_object_image_alpha_get(const Evas_Object *obj) 94evas_object_image_alpha_get(const Evas_Object *obj)
86{ 95{
87 EVAS_IMAGE_LEGACY_API(obj, EINA_FALSE); 96 EVAS_IMAGE_API(obj, EINA_FALSE);
88 return efl_gfx_buffer_alpha_get(obj); 97 return efl_gfx_buffer_alpha_get(obj);
89} 98}
90 99
91EAPI void 100EAPI void
92evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b) 101evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b)
93{ 102{
103 EVAS_IMAGE_API(obj);
94 efl_image_border_set(obj, l, r, t, b); 104 efl_image_border_set(obj, l, r, t, b);
95} 105}
96 106
97EAPI void 107EAPI void
98evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b) 108evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b)
99{ 109{
110 EVAS_IMAGE_API(obj);
100 efl_image_border_get(obj, l, r, t, b); 111 efl_image_border_get(obj, l, r, t, b);
101} 112}
102 113
103EAPI void 114EAPI void
104evas_object_image_border_scale_set(Evas_Object *obj, double scale) 115evas_object_image_border_scale_set(Evas_Object *obj, double scale)
105{ 116{
117 EVAS_IMAGE_API(obj);
106 efl_image_border_scale_set(obj, scale); 118 efl_image_border_scale_set(obj, scale);
107} 119}
108 120
109EAPI double 121EAPI double
110evas_object_image_border_scale_get(const Evas_Object *obj) 122evas_object_image_border_scale_get(const Evas_Object *obj)
111{ 123{
124 EVAS_IMAGE_API(obj, 1.0);
112 return efl_image_border_scale_get(obj); 125 return efl_image_border_scale_get(obj);
113} 126}
114 127
115EAPI void 128EAPI void
116evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill) 129evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill)
117{ 130{
131 EVAS_IMAGE_API(obj);
118 efl_image_border_center_fill_set(obj, (Efl_Gfx_Border_Fill_Mode) fill); 132 efl_image_border_center_fill_set(obj, (Efl_Gfx_Border_Fill_Mode) fill);
119} 133}
120 134
121EAPI Evas_Border_Fill_Mode 135EAPI Evas_Border_Fill_Mode
122evas_object_image_border_center_fill_get(const Evas_Object *obj) 136evas_object_image_border_center_fill_get(const Evas_Object *obj)
123{ 137{
138 EVAS_IMAGE_API(obj, EVAS_BORDER_FILL_DEFAULT);
124 return (Evas_Border_Fill_Mode) efl_image_border_center_fill_get(obj); 139 return (Evas_Border_Fill_Mode) efl_image_border_center_fill_get(obj);
125} 140}
126 141
127EAPI void 142EAPI void
128evas_object_image_size_get(const Evas_Image *obj, int *w, int *h) 143evas_object_image_size_get(const Evas_Object *obj, int *w, int *h)
129{ 144{
145 EVAS_IMAGE_API(obj);
130 efl_gfx_view_size_get(obj, w, h); 146 efl_gfx_view_size_get(obj, w, h);
131} 147}
132 148
133EAPI Evas_Colorspace 149EAPI Evas_Colorspace
134evas_object_image_colorspace_get(const Evas_Object *obj) 150evas_object_image_colorspace_get(const Evas_Object *obj)
135{ 151{
152 EVAS_IMAGE_API(obj, EVAS_COLORSPACE_ARGB8888);
136 return (Evas_Colorspace) efl_gfx_buffer_colorspace_get(obj); 153 return (Evas_Colorspace) efl_gfx_buffer_colorspace_get(obj);
137} 154}
138 155
139EAPI int 156EAPI int
140evas_object_image_stride_get(const Evas_Object *obj) 157evas_object_image_stride_get(const Evas_Object *obj)
141{ 158{
159 EVAS_IMAGE_API(obj, 0);
142 return efl_gfx_buffer_stride_get(obj); 160 return efl_gfx_buffer_stride_get(obj);
143} 161}
144 162
145EAPI void 163EAPI void
146evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h) 164evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h)
147{ 165{
166 EVAS_IMAGE_API(obj);
148 efl_gfx_buffer_update_add(obj, x, y, w, h); 167 efl_gfx_buffer_update_add(obj, x, y, w, h);
149} 168}
150 169
151EAPI void 170EAPI void
152evas_object_image_file_set(Eo *obj, const char *file, const char *key) 171evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key)
153{ 172{
154 efl_file_set(obj, file, key); 173 EVAS_IMAGE_API(obj);
174 _evas_image_file_set(obj, file, key);
155} 175}
156 176
157EAPI void 177EAPI void
158evas_object_image_file_get(const Eo *obj, const char **file, const char **key) 178evas_object_image_file_get(const Evas_Object *obj, const char **file, const char **key)
159{ 179{
160 efl_file_get(obj, file, key); 180 EVAS_IMAGE_API(obj);
181 _evas_image_file_get(obj, file, key);
161} 182}
162 183
163EAPI void 184EAPI void
164evas_object_image_mmap_set(Evas_Image *obj, const Eina_File *f, const char *key) 185evas_object_image_mmap_set(Evas_Object *obj, const Eina_File *f, const char *key)
165{ 186{
166 efl_file_mmap_set(obj, f, key); 187 EVAS_IMAGE_API(obj);
188 _evas_image_mmap_set(obj, f, key);
167} 189}
168 190
169EAPI void 191EAPI void
170evas_object_image_mmap_get(const Evas_Image *obj, const Eina_File **f, const char **key) 192evas_object_image_mmap_get(const Evas_Object *obj, const Eina_File **f, const char **key)
171{ 193{
172 efl_file_mmap_get(obj, f, key); 194 EVAS_IMAGE_API(obj);
195 _evas_image_mmap_get(obj, f, key);
173} 196}
174 197
175EAPI Eina_Bool 198EAPI Eina_Bool
176evas_object_image_save(const Eo *obj, const char *file, const char *key, const char *flags) 199evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags)
177{ 200{
201 EVAS_IMAGE_API(obj, EINA_FALSE);
178 return efl_file_save(obj, file, key, flags); 202 return efl_file_save(obj, file, key, flags);
179} 203}
180 204
181EAPI Eina_Bool 205EAPI Eina_Bool
182evas_object_image_animated_get(const Eo *obj) 206evas_object_image_animated_get(const Evas_Object *obj)
183{ 207{
184 return efl_image_animated_get(obj); 208 EVAS_IMAGE_API(obj, EINA_FALSE);
209 return _evas_image_animated_get(obj);
185} 210}
186 211
187EAPI void 212EAPI void
188evas_object_image_animated_frame_set(Evas_Object *obj, int frame_index) 213evas_object_image_animated_frame_set(Evas_Object *obj, int frame_index)
189{ 214{
190 efl_image_animated_frame_set(obj, frame_index); 215 EVAS_IMAGE_API(obj);
216 _evas_image_animated_frame_set(obj, frame_index);
191} 217}
192 218
193EAPI int 219EAPI int
194evas_object_image_animated_frame_count_get(const Evas_Object *obj) 220evas_object_image_animated_frame_count_get(const Evas_Object *obj)
195{ 221{
196 return efl_image_animated_frame_count_get(obj); 222 EVAS_IMAGE_API(obj, 0);
223 return _evas_image_animated_frame_count_get(obj);
197} 224}
198 225
199EAPI Evas_Image_Animated_Loop_Hint 226EAPI Evas_Image_Animated_Loop_Hint
200evas_object_image_animated_loop_type_get(const Evas_Object *obj) 227evas_object_image_animated_loop_type_get(const Evas_Object *obj)
201{ 228{
202 return (Evas_Image_Animated_Loop_Hint) efl_image_animated_loop_type_get(obj); 229 EVAS_IMAGE_API(obj, EVAS_IMAGE_ANIMATED_HINT_NONE);
230 return (Evas_Image_Animated_Loop_Hint) _evas_image_animated_loop_type_get(obj);
203} 231}
204 232
205EAPI int 233EAPI int
206evas_object_image_animated_loop_count_get(const Evas_Object *obj) 234evas_object_image_animated_loop_count_get(const Evas_Object *obj)
207{ 235{
208 return efl_image_animated_loop_count_get(obj); 236 EVAS_IMAGE_API(obj, 0);
237 return _evas_image_animated_loop_count_get(obj);
209} 238}
210 239
211EAPI double 240EAPI double
212evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int frame_num) 241evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int frame_num)
213{ 242{
214 return efl_image_animated_frame_duration_get(obj, start_frame, frame_num); 243 EVAS_IMAGE_API(obj, 0.0);
244 return _evas_image_animated_frame_duration_get(obj, start_frame, frame_num);
215} 245}
216 246
217EAPI void 247EAPI void
218evas_object_image_load_size_set(Eo *obj, int w, int h) 248evas_object_image_load_size_set(Evas_Object *obj, int w, int h)
219{ 249{
220 efl_image_load_size_set(obj, w, h); 250 EVAS_IMAGE_API(obj);
251 _evas_image_load_size_set(obj, w, h);
221} 252}
222 253
223EAPI void 254EAPI void
224evas_object_image_load_size_get(const Eo *obj, int *w, int *h) 255evas_object_image_load_size_get(const Evas_Object *obj, int *w, int *h)
225{ 256{
226 efl_image_load_size_get(obj, w, h); 257 EVAS_IMAGE_API(obj);
258 _evas_image_load_size_get(obj, w, h);
227} 259}
228 260
229EAPI void 261EAPI void
230evas_object_image_load_dpi_set(Evas_Object *obj, double dpi) 262evas_object_image_load_dpi_set(Evas_Object *obj, double dpi)
231{ 263{
232 efl_image_load_dpi_set(obj, dpi); 264 EVAS_IMAGE_API(obj);
265 _evas_image_load_dpi_set(obj, dpi);
233} 266}
234 267
235EAPI double 268EAPI double
236evas_object_image_load_dpi_get(const Evas_Object *obj) 269evas_object_image_load_dpi_get(const Evas_Object *obj)
237{ 270{
238 return efl_image_load_dpi_get(obj); 271 EVAS_IMAGE_API(obj, 0.0);
272 return _evas_image_load_dpi_get(obj);
239} 273}
240 274
241EAPI void 275EAPI void
242evas_object_image_load_region_set(Evas_Object *obj, int x, int y, int w, int h) 276evas_object_image_load_region_set(Evas_Object *obj, int x, int y, int w, int h)
243{ 277{
244 efl_image_load_region_set(obj, x, y, w, h); 278 EVAS_IMAGE_API(obj);
279 _evas_image_load_region_set(obj, x, y, w, h);
245} 280}
246 281
247EAPI void 282EAPI void
248evas_object_image_load_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h) 283evas_object_image_load_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h)
249{ 284{
250 efl_image_load_region_get(obj, x, y, w, h); 285 EVAS_IMAGE_API(obj);
286 _evas_image_load_region_get(obj, x, y, w, h);
251} 287}
252 288
253EAPI Eina_Bool 289EAPI Eina_Bool
254evas_object_image_region_support_get(const Evas_Image *obj) 290evas_object_image_region_support_get(const Evas_Object *obj)
255{ 291{
256 return efl_image_load_region_support_get(obj); 292 EVAS_IMAGE_API(obj, EINA_FALSE);
293 return _evas_image_load_region_support_get(obj);
257} 294}
258 295
259EAPI void 296EAPI void
260evas_object_image_load_orientation_set(Evas_Object *obj, Eina_Bool enable) 297evas_object_image_load_orientation_set(Evas_Object *obj, Eina_Bool enable)
261{ 298{
262 efl_image_load_orientation_set(obj, enable); 299 EVAS_IMAGE_API(obj);
300 _evas_image_load_orientation_set(obj, enable);
263} 301}
264 302
265EAPI Eina_Bool 303EAPI Eina_Bool
266evas_object_image_load_orientation_get(const Evas_Object *obj) 304evas_object_image_load_orientation_get(const Evas_Object *obj)
267{ 305{
268 return efl_image_load_orientation_get(obj); 306 EVAS_IMAGE_API(obj, EINA_FALSE);
307 return _evas_image_load_orientation_get(obj);
269} 308}
270 309
271EAPI void 310EAPI void
272evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down) 311evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down)
273{ 312{
274 efl_image_load_scale_down_set(obj, scale_down); 313 EVAS_IMAGE_API(obj);
314 _evas_image_load_scale_down_set(obj, scale_down);
275} 315}
276 316
277EAPI int 317EAPI int
278evas_object_image_load_scale_down_get(const Evas_Object *obj) 318evas_object_image_load_scale_down_get(const Evas_Object *obj)
279{ 319{
280 return efl_image_load_scale_down_get(obj); 320 EVAS_IMAGE_API(obj, 1);
321 return _evas_image_load_scale_down_get(obj);
281} 322}
282 323
283EAPI Evas_Load_Error 324EAPI Evas_Load_Error
284evas_object_image_load_error_get(const Evas_Object *obj) 325evas_object_image_load_error_get(const Evas_Object *obj)
285{ 326{
286 return (Evas_Load_Error) efl_image_load_error_get(obj); 327 EVAS_IMAGE_API(obj, EVAS_LOAD_ERROR_GENERIC);
328 return (Evas_Load_Error) _evas_image_load_error_get(obj);
287} 329}
288 330
289EAPI void 331EAPI void
290evas_object_image_smooth_scale_set(Eo *obj, Eina_Bool smooth_scale) 332evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth_scale)
291{ 333{
334 EVAS_IMAGE_API(obj);
292 efl_image_smooth_scale_set(obj, smooth_scale); 335 efl_image_smooth_scale_set(obj, smooth_scale);
293} 336}
294 337
295EAPI Eina_Bool 338EAPI Eina_Bool
296evas_object_image_smooth_scale_get(const Eo *obj) 339evas_object_image_smooth_scale_get(const Evas_Object *obj)
297{ 340{
341 EVAS_IMAGE_API(obj, EINA_FALSE);
298 return efl_image_smooth_scale_get(obj); 342 return efl_image_smooth_scale_get(obj);
299} 343}
300 344
301EAPI void 345EAPI void
302evas_object_image_orient_set(Evas_Image *obj, Evas_Image_Orient orient) 346evas_object_image_orient_set(Evas_Object *obj, Evas_Image_Orient orient)
303{ 347{
348 EVAS_IMAGE_API(obj);
304 efl_image_orientation_set(obj, (Efl_Gfx_Orientation) orient); 349 efl_image_orientation_set(obj, (Efl_Gfx_Orientation) orient);
305} 350}
306 351
307EAPI Evas_Image_Orient 352EAPI Evas_Image_Orient
308evas_object_image_orient_get(const Evas_Image *obj) 353evas_object_image_orient_get(const Evas_Object *obj)
309{ 354{
355 EVAS_IMAGE_API(obj, EVAS_IMAGE_ORIENT_NONE);
310 return (Evas_Image_Orient) efl_image_orientation_get(obj); 356 return (Evas_Image_Orient) efl_image_orientation_get(obj);
311} 357}
312 358
313EAPI void 359EAPI void
314evas_object_image_snapshot_set(Evas_Object *eo, Eina_Bool s) 360evas_object_image_snapshot_set(Evas_Object *eo, Eina_Bool s)
315{ 361{
362 EVAS_IMAGE_API(eo);
363
316 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo, EVAS_OBJECT_CLASS); 364 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo, EVAS_OBJECT_CLASS);
317 365
318 EVAS_IMAGE_LEGACY_API(eo);
319 if (obj->cur->snapshot == s) return; 366 if (obj->cur->snapshot == s) return;
320 367
321 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur) 368 EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
@@ -326,105 +373,111 @@ evas_object_image_snapshot_set(Evas_Object *eo, Eina_Bool s)
326EAPI Eina_Bool 373EAPI Eina_Bool
327evas_object_image_snapshot_get(const Evas_Object *eo) 374evas_object_image_snapshot_get(const Evas_Object *eo)
328{ 375{
376 EVAS_IMAGE_API(eo, EINA_FALSE);
377
329 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo, EVAS_OBJECT_CLASS); 378 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo, EVAS_OBJECT_CLASS);
330 EVAS_IMAGE_LEGACY_API(eo, EINA_FALSE);
331 return obj->cur->snapshot; 379 return obj->cur->snapshot;
332} 380}
333 381
334EAPI Eina_Bool 382EAPI Eina_Bool
335evas_object_image_source_set(Evas_Object *eo, Evas_Object *src) 383evas_object_image_source_set(Evas_Object *eo, Evas_Object *src)
336{ 384{
337 EVAS_IMAGE_LEGACY_API(eo, EINA_FALSE); 385 EVAS_IMAGE_API(eo, EINA_FALSE);
338 return _evas_image_proxy_source_set(eo, src); 386 return _evas_image_proxy_source_set(eo, src);
339} 387}
340 388
341EAPI Evas_Object * 389EAPI Evas_Object *
342evas_object_image_source_get(const Evas_Object *eo) 390evas_object_image_source_get(const Evas_Object *eo)
343{ 391{
344 EVAS_IMAGE_LEGACY_API(eo, NULL); 392 EVAS_IMAGE_API(eo, NULL);
345 return _evas_image_proxy_source_get(eo); 393 return _evas_image_proxy_source_get(eo);
346} 394}
347 395
348EAPI Eina_Bool 396EAPI Eina_Bool
349evas_object_image_source_unset(Evas_Object *eo_obj) 397evas_object_image_source_unset(Evas_Object *eo_obj)
350{ 398{
351 EVAS_IMAGE_LEGACY_API(eo_obj, EINA_FALSE); 399 EVAS_IMAGE_API(eo_obj, EINA_FALSE);
352 return _evas_image_proxy_source_set(eo_obj, NULL); 400 return _evas_image_proxy_source_set(eo_obj, NULL);
353} 401}
354 402
355EAPI void 403EAPI void
356evas_object_image_source_clip_set(Evas_Object *eo, Eina_Bool source_clip) 404evas_object_image_source_clip_set(Evas_Object *eo, Eina_Bool source_clip)
357{ 405{
358 EVAS_IMAGE_LEGACY_API(eo); 406 EVAS_IMAGE_API(eo);
359 _evas_image_proxy_source_clip_set(eo, source_clip); 407 _evas_image_proxy_source_clip_set(eo, source_clip);
360} 408}
361 409
362EAPI Eina_Bool 410EAPI Eina_Bool
363evas_object_image_source_clip_get(const Evas_Object *eo) 411evas_object_image_source_clip_get(const Evas_Object *eo)
364{ 412{
365 EVAS_IMAGE_LEGACY_API(eo, EINA_FALSE); 413 EVAS_IMAGE_API(eo, EINA_FALSE);
366 return _evas_image_proxy_source_clip_get(eo); 414 return _evas_image_proxy_source_clip_get(eo);
367} 415}
368 416
369EAPI void 417EAPI void
370evas_object_image_source_events_set(Evas_Object *eo, Eina_Bool repeat) 418evas_object_image_source_events_set(Evas_Object *eo, Eina_Bool repeat)
371{ 419{
372 EVAS_IMAGE_LEGACY_API(eo); 420 EVAS_IMAGE_API(eo);
373 _evas_image_proxy_source_events_set(eo, repeat); 421 _evas_image_proxy_source_events_set(eo, repeat);
374} 422}
375 423
376EAPI Eina_Bool 424EAPI Eina_Bool
377evas_object_image_source_events_get(const Evas_Object *eo) 425evas_object_image_source_events_get(const Evas_Object *eo)
378{ 426{
379 EVAS_IMAGE_LEGACY_API(eo, EINA_FALSE); 427 EVAS_IMAGE_API(eo, EINA_FALSE);
380 return _evas_image_proxy_source_events_get(eo); 428 return _evas_image_proxy_source_events_get(eo);
381} 429}
382 430
383EAPI void 431EAPI void
384evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint) 432evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint)
385{ 433{
434 EVAS_IMAGE_API(obj);
386 return efl_image_content_hint_set(obj, hint); 435 return efl_image_content_hint_set(obj, hint);
387} 436}
388 437
389EAPI Evas_Image_Content_Hint 438EAPI Evas_Image_Content_Hint
390evas_object_image_content_hint_get(const Evas_Object *obj) 439evas_object_image_content_hint_get(const Evas_Object *obj)
391{ 440{
441 EVAS_IMAGE_API(obj, EVAS_IMAGE_CONTENT_HINT_NONE);
392 return efl_image_content_hint_get(obj); 442 return efl_image_content_hint_get(obj);
393} 443}
394 444
395EAPI void 445EAPI void
396evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint) 446evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint)
397{ 447{
448 EVAS_IMAGE_API(obj);
398 return efl_image_scale_hint_set(obj, (Efl_Image_Scale_Hint) hint); 449 return efl_image_scale_hint_set(obj, (Efl_Image_Scale_Hint) hint);
399} 450}
400 451
401EAPI Evas_Image_Scale_Hint 452EAPI Evas_Image_Scale_Hint
402evas_object_image_scale_hint_get(const Evas_Object *obj) 453evas_object_image_scale_hint_get(const Evas_Object *obj)
403{ 454{
455 EVAS_IMAGE_API(obj, EVAS_IMAGE_SCALE_HINT_NONE);
404 return (Evas_Image_Scale_Hint) efl_image_scale_hint_get(obj); 456 return (Evas_Image_Scale_Hint) efl_image_scale_hint_get(obj);
405} 457}
406 458
407EAPI void 459EAPI void
408evas_object_image_native_surface_set(Evas_Object *eo_obj, Evas_Native_Surface *surf) 460evas_object_image_native_surface_set(Evas_Object *eo_obj, Evas_Native_Surface *surf)
409{ 461{
410 EVAS_IMAGE_LEGACY_API(eo_obj); 462 EVAS_IMAGE_API(eo_obj);
411 _evas_image_native_surface_set(eo_obj, surf); 463 _evas_image_native_surface_set(eo_obj, surf);
412} 464}
413 465
414EAPI Evas_Native_Surface * 466EAPI Evas_Native_Surface *
415evas_object_image_native_surface_get(const Evas_Object *eo_obj) 467evas_object_image_native_surface_get(const Evas_Object *eo_obj)
416{ 468{
417 EVAS_IMAGE_LEGACY_API(eo_obj, NULL); 469 EVAS_IMAGE_API(eo_obj, NULL);
418 return _evas_image_native_surface_get(eo_obj); 470 return _evas_image_native_surface_get(eo_obj);
419} 471}
420 472
421/* eo equivalent: pixels_set(null, w, h, cspace) to (re)allocate an image */ 473/* Evas_Object equivalent: pixels_set(null, w, h, cspace) to (re)allocate an image */
422EAPI void 474EAPI void
423evas_object_image_size_set(Eo *eo_obj, int w, int h) 475evas_object_image_size_set(Evas_Object *eo_obj, int w, int h)
424{ 476{
477 EVAS_IMAGE_API(eo_obj);
478
425 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 479 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
426 Evas_Image_Data *o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS); 480 Evas_Image_Data *o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
427
428 int stride = 0; 481 int stride = 0;
429 482
430 if (o->cur->scene) return; 483 if (o->cur->scene) return;
@@ -484,14 +537,16 @@ evas_object_image_size_set(Eo *eo_obj, int w, int h)
484 evas_object_change(eo_obj, obj); 537 evas_object_change(eo_obj, obj);
485} 538}
486 539
487/* eo equivalent: pixels_set(null, w, h, cspace) to (re)allocate an image */ 540/* Evas_Object equivalent: pixels_set(null, w, h, cspace) to (re)allocate an image */
488EAPI void 541EAPI void
489evas_object_image_colorspace_set(Evas_Object *eo_obj, Evas_Colorspace cspace) 542evas_object_image_colorspace_set(Evas_Object *eo_obj, Evas_Colorspace cspace)
490{ 543{
544 EVAS_IMAGE_API(eo_obj);
545
491 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 546 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
492 Evas_Image_Data *o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS); 547 Evas_Image_Data *o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
493 evas_object_async_block(obj);
494 548
549 evas_object_async_block(obj);
495 _evas_image_cleanup(eo_obj, obj, o); 550 _evas_image_cleanup(eo_obj, obj, o);
496 551
497 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) 552 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
@@ -604,7 +659,7 @@ evas_object_image_video_surface_caps_get(const Evas_Object *eo_obj)
604 659
605/* deprecated */ 660/* deprecated */
606EAPI void 661EAPI void
607evas_object_image_fill_spread_set(Evas_Image *obj EINA_UNUSED, Evas_Fill_Spread spread) 662evas_object_image_fill_spread_set(Evas_Object *obj EINA_UNUSED, Evas_Fill_Spread spread)
608{ 663{
609 /* not implemented! */ 664 /* not implemented! */
610 if (spread != EFL_GFX_FILL_REPEAT) 665 if (spread != EFL_GFX_FILL_REPEAT)
@@ -613,7 +668,7 @@ evas_object_image_fill_spread_set(Evas_Image *obj EINA_UNUSED, Evas_Fill_Spread
613 668
614/* deprecated */ 669/* deprecated */
615EAPI Evas_Fill_Spread 670EAPI Evas_Fill_Spread
616evas_object_image_fill_spread_get(const Evas_Image *obj EINA_UNUSED) 671evas_object_image_fill_spread_get(const Evas_Object *obj EINA_UNUSED)
617{ 672{
618 return EFL_GFX_FILL_REPEAT; 673 return EFL_GFX_FILL_REPEAT;
619} 674}
@@ -629,12 +684,12 @@ evas_object_image_source_visible_set(Evas_Object *eo, Eina_Bool visible)
629 * -- jpeg, 2016/03/07 684 * -- jpeg, 2016/03/07
630 */ 685 */
631 686
687 EVAS_IMAGE_LEGACY_API(eo);
688
632 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo, EVAS_OBJECT_CLASS); 689 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo, EVAS_OBJECT_CLASS);
633 Evas_Object_Protected_Data *src_obj; 690 Evas_Object_Protected_Data *src_obj;
634 Evas_Image_Data *o; 691 Evas_Image_Data *o;
635 692
636 EVAS_IMAGE_LEGACY_API(eo);
637
638 o = eo_data_scope_get(eo, EVAS_IMAGE_CLASS); 693 o = eo_data_scope_get(eo, EVAS_IMAGE_CLASS);
639 if (!o->cur->source) return; 694 if (!o->cur->source) return;
640 695
@@ -661,12 +716,12 @@ evas_object_image_source_visible_get(const Evas_Object *eo)
661{ 716{
662 /* FIXME: see evas_object_image_source_visible_set */ 717 /* FIXME: see evas_object_image_source_visible_set */
663 718
719 EVAS_IMAGE_LEGACY_API(eo, EINA_FALSE);
720
664 Evas_Object_Protected_Data *src_obj; 721 Evas_Object_Protected_Data *src_obj;
665 Evas_Image_Data *o; 722 Evas_Image_Data *o;
666 Eina_Bool visible; 723 Eina_Bool visible;
667 724
668 EVAS_IMAGE_LEGACY_API(eo, EINA_FALSE);
669
670 o = eo_data_scope_get(eo, EVAS_IMAGE_CLASS); 725 o = eo_data_scope_get(eo, EVAS_IMAGE_CLASS);
671 if (!o->cur->source) visible = EINA_FALSE; 726 if (!o->cur->source) visible = EINA_FALSE;
672 src_obj = eo_data_scope_get(o->cur->source, EVAS_OBJECT_CLASS); 727 src_obj = eo_data_scope_get(o->cur->source, EVAS_OBJECT_CLASS);
@@ -680,14 +735,13 @@ evas_object_image_source_visible_get(const Evas_Object *eo)
680EAPI void* 735EAPI void*
681evas_object_image_data_convert(Evas_Object *eo_obj, Evas_Colorspace to_cspace) 736evas_object_image_data_convert(Evas_Object *eo_obj, Evas_Colorspace to_cspace)
682{ 737{
738 EVAS_IMAGE_LEGACY_API(eo_obj, NULL);
739
683 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 740 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
684 Evas_Image_Data *o; 741 Evas_Image_Data *o;
685 DATA32 *data; 742 DATA32 *data;
686 void* result = NULL; 743 void* result = NULL;
687 744
688 EVAS_IMAGE_LEGACY_API(eo_obj, NULL);
689 EINA_SAFETY_ON_FALSE_RETURN_VAL(eo_isa(eo_obj, EVAS_IMAGE_CLASS), NULL);
690
691 evas_object_async_block(obj); 745 evas_object_async_block(obj);
692 o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS); 746 o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
693 if ((o->preloading) && (o->engine_data)) 747 if ((o->preloading) && (o->engine_data))
@@ -712,14 +766,13 @@ evas_object_image_data_convert(Evas_Object *eo_obj, Evas_Colorspace to_cspace)
712 766
713/* deprecated */ 767/* deprecated */
714EAPI void 768EAPI void
715evas_object_image_reload(Eo *eo_obj) 769evas_object_image_reload(Evas_Object *eo_obj)
716{ 770{
771 EVAS_IMAGE_LEGACY_API(eo_obj);
772
717 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 773 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
718 Evas_Image_Data *o; 774 Evas_Image_Data *o;
719 775
720 EVAS_IMAGE_LEGACY_API(eo_obj);
721 EINA_SAFETY_ON_FALSE_RETURN(eo_isa(eo_obj, EVAS_IMAGE_CLASS));
722
723 evas_object_async_block(obj); 776 evas_object_async_block(obj);
724 o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS); 777 o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
725 if ((o->preloading) && (o->engine_data)) 778 if ((o->preloading) && (o->engine_data))
@@ -751,12 +804,11 @@ evas_object_image_reload(Eo *eo_obj)
751EAPI Eina_Bool 804EAPI Eina_Bool
752evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *pixels) 805evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *pixels)
753{ 806{
807 EVAS_IMAGE_LEGACY_API(eo_obj, EINA_FALSE);
808
754 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 809 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
755 Evas_Image_Data *o; 810 Evas_Image_Data *o;
756 811
757 EVAS_IMAGE_LEGACY_API(eo_obj, EINA_FALSE);
758 EINA_SAFETY_ON_FALSE_RETURN_VAL(eo_isa(eo_obj, EVAS_IMAGE_CLASS), EINA_FALSE);
759
760 evas_object_async_block(obj); 812 evas_object_async_block(obj);
761 o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS); 813 o = eo_data_scope_get(eo_obj, EVAS_IMAGE_CLASS);
762 _evas_image_cleanup(eo_obj, obj, o); 814 _evas_image_cleanup(eo_obj, obj, o);
@@ -821,4 +873,5 @@ EAPI void
821evas_object_image_alpha_mask_set(Evas_Object *eo_obj EINA_UNUSED, Eina_Bool ismask EINA_UNUSED) 873evas_object_image_alpha_mask_set(Evas_Object *eo_obj EINA_UNUSED, Eina_Bool ismask EINA_UNUSED)
822{ 874{
823 DBG("This function is not implemented, has never been and never will be."); 875 DBG("This function is not implemented, has never been and never will be.");
876 EVAS_IMAGE_LEGACY_API(eo_obj);
824} 877}
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index 3a33961a93..ff7ffcded4 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -25,6 +25,7 @@
25#include "../common/evas_convert_colorspace.h" 25#include "../common/evas_convert_colorspace.h"
26#include "../common/evas_convert_yuv.h" 26#include "../common/evas_convert_yuv.h"
27 27
28#include "canvas/evas_image.eo.h"
28#include "evas_filter.eo.h" 29#include "evas_filter.eo.h"
29#include "evas_filter.h" 30#include "evas_filter.h"
30 31
@@ -140,18 +141,55 @@ struct _Evas_Image_Data
140void _evas_image_init_set(const Eina_File *f, const char *file, const char *key, Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o, Evas_Image_Load_Opts *lo); 141void _evas_image_init_set(const Eina_File *f, const char *file, const char *key, Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o, Evas_Image_Load_Opts *lo);
141void _evas_image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o); 142void _evas_image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o);
142void _evas_image_cleanup(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o); 143void _evas_image_cleanup(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o);
144
145/* Efl.File */
146Eina_Bool _evas_image_mmap_set(Eo *eo_obj, const Eina_File *f, const char *key);
147void _evas_image_mmap_get(const Eo *eo_obj, const Eina_File **f, const char **key);
148Eina_Bool _evas_image_file_set(Eo *eo_obj, const char *file, const char *key);
149void _evas_image_file_get(const Eo *eo_obj, const char **file, const char **key);
150
151/* Efl.Image.Load */
152Efl_Image_Load_Error _evas_image_load_error_get(const Eo *eo_obj);
153void _evas_image_load_async_start(Eo *eo_obj);
154void _evas_image_load_async_cancel(Eo *eo_obj);
155void _evas_image_load_dpi_set(Eo *eo_obj, double dpi);
156double _evas_image_load_dpi_get(const Eo *eo_obj);
157void _evas_image_load_size_set(Eo *eo_obj, int w, int h);
158void _evas_image_load_size_get(const Eo *eo_obj, int *w, int *h);
159void _evas_image_load_scale_down_set(Eo *eo_obj, int scale_down);
160int _evas_image_load_scale_down_get(const Eo *eo_obj);
161void _evas_image_load_region_set(Eo *eo_obj, int x, int y, int w, int h);
162void _evas_image_load_region_get(const Eo *eo_obj, int *x, int *y, int *w, int *h);
163void _evas_image_load_orientation_set(Eo *eo_obj, Eina_Bool enable);
164Eina_Bool _evas_image_load_orientation_get(const Eo *eo_obj);
165Eina_Bool _evas_image_load_region_support_get(const Eo *eo_obj);
166
167/* Efl.Image.Animated */
168Eina_Bool _evas_image_animated_get(const Eo *eo_obj);
169int _evas_image_animated_frame_count_get(const Eo *eo_obj);
170Efl_Image_Animated_Loop_Hint _evas_image_animated_loop_type_get(const Eo *eo_obj);
171int _evas_image_animated_loop_count_get(const Eo *eo_obj);
172double _evas_image_animated_frame_duration_get(const Eo *eo_obj, int start_frame, int frame_num);
173Eina_Bool _evas_image_animated_frame_set(Eo *eo_obj, int frame_index);
174int _evas_image_animated_frame_get(const Eo *eo_obj);
175
176/* Efl.Canvas.Proxy */
143void _evas_image_proxy_unset(Evas_Object *proxy, Evas_Object_Protected_Data *obj, Evas_Image_Data *o); 177void _evas_image_proxy_unset(Evas_Object *proxy, Evas_Object_Protected_Data *obj, Evas_Image_Data *o);
144void _evas_image_proxy_set(Evas_Object *proxy, Evas_Object *src); 178void _evas_image_proxy_set(Evas_Object *proxy, Evas_Object *src);
145void _evas_image_proxy_error(Evas_Object *proxy, void *context, void *output, void *surface, int x, int y, Eina_Bool do_async); 179void _evas_image_proxy_error(Evas_Object *proxy, void *context, void *output, void *surface, int x, int y, Eina_Bool do_async);
146void _evas_image_3d_render(Evas *eo_e, Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o, Evas_Canvas3D_Scene *scene);
147void _evas_image_3d_set(Evas_Object *eo_obj, Evas_Canvas3D_Scene *scene);
148void _evas_image_3d_unset(Evas_Object *eo_obj, Evas_Object_Protected_Data *image, Evas_Image_Data *o);
149Eina_Bool _evas_image_proxy_source_set(Eo *eo_obj, Evas_Object *eo_src); 180Eina_Bool _evas_image_proxy_source_set(Eo *eo_obj, Evas_Object *eo_src);
150Evas_Object *_evas_image_proxy_source_get(const Eo *eo_obj); 181Evas_Object *_evas_image_proxy_source_get(const Eo *eo_obj);
151void _evas_image_proxy_source_clip_set(Eo *eo_obj, Eina_Bool source_clip); 182void _evas_image_proxy_source_clip_set(Eo *eo_obj, Eina_Bool source_clip);
152Eina_Bool _evas_image_proxy_source_clip_get(const Eo *eo_obj); 183Eina_Bool _evas_image_proxy_source_clip_get(const Eo *eo_obj);
153void _evas_image_proxy_source_events_set(Eo *eo_obj, Eina_Bool source_events); 184void _evas_image_proxy_source_events_set(Eo *eo_obj, Eina_Bool source_events);
154Eina_Bool _evas_image_proxy_source_events_get(const Eo *eo_obj); 185Eina_Bool _evas_image_proxy_source_events_get(const Eo *eo_obj);
186
187/* Efl.Canvas.Scene3d */
188void _evas_image_3d_render(Evas *eo_e, Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o, Evas_Canvas3D_Scene *scene);
189void _evas_image_3d_set(Evas_Object *eo_obj, Evas_Canvas3D_Scene *scene);
190void _evas_image_3d_unset(Evas_Object *eo_obj, Evas_Object_Protected_Data *image, Evas_Image_Data *o);
191
192/* Efl.Canvas.Surface */
155Eina_Bool _evas_image_native_surface_set(Eo *eo_obj, Evas_Native_Surface *surf); 193Eina_Bool _evas_image_native_surface_set(Eo *eo_obj, Evas_Native_Surface *surf);
156Evas_Native_Surface *_evas_image_native_surface_get(const Evas_Object *eo_obj); 194Evas_Native_Surface *_evas_image_native_surface_get(const Evas_Object *eo_obj);
157 195
@@ -176,6 +214,12 @@ void _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas
176# define EINA_COW_PIXEL_WRITE_END(Obj, Write) \ 214# define EINA_COW_PIXEL_WRITE_END(Obj, Write) \
177 EINA_COW_WRITE_END(evas_object_image_pixels_cow, Obj->pixels, Write) 215 EINA_COW_WRITE_END(evas_object_image_pixels_cow, Obj->pixels, Write)
178 216
217# define EINA_COW_LOAD_OPTS_WRITE_BEGIN(Obj, Write) \
218 EINA_COW_WRITE_BEGIN(evas_object_image_load_opts_cow, Obj->load_opts, Evas_Object_Image_Load_Opts, Write)
219
220# define EINA_COW_LOAD_OPTS_WRITE_END(Obj, Write) \
221 EINA_COW_WRITE_END(evas_object_image_load_opts_cow, Obj->load_opts, Write)
222
179#define FRAME_MAX 1024 223#define FRAME_MAX 1024
180 224
181#endif // EVAS_IMAGE_PRIVATE_H 225#endif // EVAS_IMAGE_PRIVATE_H
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 9abf1c9d6d..2320f6fb54 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -23,7 +23,7 @@ static void _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
23static void evas_object_image_free(Evas_Object *eo_obj, 23static void evas_object_image_free(Evas_Object *eo_obj,
24 Evas_Object_Protected_Data *obj); 24 Evas_Object_Protected_Data *obj);
25static void evas_object_image_render_pre(Evas_Object *eo_obj, 25static void evas_object_image_render_pre(Evas_Object *eo_obj,
26 Evas_Object_Protected_Data *obj, 26 Evas_Object_Protected_Data *obj,
27 void *type_private_data); 27 void *type_private_data);
28static void evas_object_image_render_post(Evas_Object *eo_obj, 28static void evas_object_image_render_post(Evas_Object *eo_obj,
29 Evas_Object_Protected_Data *obj, 29 Evas_Object_Protected_Data *obj,
@@ -111,12 +111,6 @@ Eina_Cow *evas_object_image_load_opts_cow = NULL;
111Eina_Cow *evas_object_image_pixels_cow = NULL; 111Eina_Cow *evas_object_image_pixels_cow = NULL;
112Eina_Cow *evas_object_image_state_cow = NULL; 112Eina_Cow *evas_object_image_state_cow = NULL;
113 113
114# define EINA_COW_LOAD_OPTS_WRITE_BEGIN(Obj, Write) \
115 EINA_COW_WRITE_BEGIN(evas_object_image_load_opts_cow, Obj->load_opts, Evas_Object_Image_Load_Opts, Write)
116
117# define EINA_COW_LOAD_OPTS_WRITE_END(Obj, Write) \
118 EINA_COW_WRITE_END(evas_object_image_load_opts_cow, Obj->load_opts, Write)
119
120# define EVAS_OBJECT_WRITE_IMAGE_FREE_FILE_AND_KEY(Obj) \ 114# define EVAS_OBJECT_WRITE_IMAGE_FREE_FILE_AND_KEY(Obj) \
121 if ((!Obj->cur->mmaped_source && Obj->cur->u.file) || Obj->cur->key) \ 115 if ((!Obj->cur->mmaped_source && Obj->cur->u.file) || Obj->cur->key) \
122 { \ 116 { \
@@ -354,79 +348,6 @@ _evas_image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Dat
354 evas_object_change(eo_obj, obj); 348 evas_object_change(eo_obj, obj);
355} 349}
356 350
357EOLIAN static Eina_Bool
358_evas_image_efl_file_mmap_set(Eo *eo_obj,
359 Evas_Image_Data *o,
360 const Eina_File *f, const char *key)
361{
362 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
363 Evas_Image_Load_Opts lo;
364
365 if (o->cur->u.f == f)
366 {
367 if ((!o->cur->key) && (!key))
368 return EINA_FALSE;
369 if ((o->cur->key) && (key) && (!strcmp(o->cur->key, key)))
370 return EINA_FALSE;
371 }
372 evas_object_async_block(obj);
373 _evas_image_init_set(f, NULL, key, eo_obj, obj, o, &lo);
374 o->engine_data = ENFN->image_mmap(ENDT, o->cur->u.f, o->cur->key, &o->load_error, &lo);
375 _evas_image_done_set(eo_obj, obj, o);
376
377 return EINA_TRUE;
378}
379
380EOLIAN static void
381_evas_image_efl_file_mmap_get(Eo *eo_obj EINA_UNUSED,
382 Evas_Image_Data *o,
383 const Eina_File **f, const char **key)
384{
385 if (f)
386 *f = o->cur->mmaped_source ? o->cur->u.f : NULL;
387 if (key)
388 *key = o->cur->key;
389}
390
391EOLIAN static Eina_Bool
392_evas_image_efl_file_file_set(Eo *eo_obj, Evas_Image_Data *o, const char *file, const char *key)
393{
394 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
395 Evas_Image_Load_Opts lo;
396
397 if ((o->cur->u.file) && (file) && (!strcmp(o->cur->u.file, file)))
398 {
399 if ((!o->cur->key) && (!key))
400 return EINA_FALSE;
401 if ((o->cur->key) && (key) && (!strcmp(o->cur->key, key)))
402 return EINA_FALSE;
403 }
404 /*
405 * WTF? why cancel a null image preload? this is just silly (tm)
406 if (!o->engine_data)
407 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
408 */
409 evas_object_async_block(obj);
410 _evas_image_init_set(NULL, file, key, eo_obj, obj, o, &lo);
411 o->engine_data = ENFN->image_load(ENDT, o->cur->u.file, o->cur->key, &o->load_error, &lo);
412 _evas_image_done_set(eo_obj, obj, o);
413
414 return EINA_TRUE;
415}
416
417EOLIAN static void
418_evas_image_efl_file_file_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, const char **file, const char **key)
419{
420 if (file)
421 {
422 if (o->cur->mmaped_source)
423 *file = eina_file_filename_get(o->cur->u.f);
424 else
425 *file = o->cur->u.file;
426 }
427 if (key) *key = o->cur->key;
428}
429
430EOLIAN static void 351EOLIAN static void
431_evas_image_efl_image_orientation_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Gfx_Orientation _orient) 352_evas_image_efl_image_orientation_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Gfx_Orientation _orient)
432{ 353{
@@ -483,7 +404,6 @@ _evas_image_efl_image_orientation_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o
483 return (Efl_Gfx_Orientation) o->cur->orient; 404 return (Efl_Gfx_Orientation) o->cur->orient;
484} 405}
485 406
486
487EOLIAN static void 407EOLIAN static void
488_evas_image_eo_base_dbg_info_get(Eo *eo_obj, Evas_Image_Data *o, Eo_Dbg_Info *root) 408_evas_image_eo_base_dbg_info_get(Eo *eo_obj, Evas_Image_Data *o, Eo_Dbg_Info *root)
489{ 409{
@@ -505,9 +425,9 @@ _evas_image_eo_base_dbg_info_get(Eo *eo_obj, Evas_Image_Data *o, Eo_Dbg_Info *ro
505 if (efl_image_load_error_get(eo_obj) != EVAS_LOAD_ERROR_NONE) 425 if (efl_image_load_error_get(eo_obj) != EVAS_LOAD_ERROR_NONE)
506 { 426 {
507 Evas_Load_Error error = EVAS_LOAD_ERROR_GENERIC; 427 Evas_Load_Error error = EVAS_LOAD_ERROR_GENERIC;
508 error = (Evas_Load_Error) efl_image_load_error_get(eo_obj); 428 error = (Evas_Load_Error) _evas_image_load_error_get(eo_obj);
509 EO_DBG_INFO_APPEND(group, "Load Error", EINA_VALUE_TYPE_STRING, 429 EO_DBG_INFO_APPEND(group, "Load Error", EINA_VALUE_TYPE_STRING,
510 evas_load_error_str(error)); 430 evas_load_error_str(error));
511 } 431 }
512} 432}
513 433
@@ -711,60 +631,6 @@ _evas_image_efl_gfx_buffer_stride_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o
711 return o->cur->image.stride; 631 return o->cur->image.stride;
712} 632}
713 633
714EOLIAN static Efl_Image_Load_Error
715_evas_image_efl_image_load_load_error_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
716{
717 return (Efl_Image_Load_Error) o->load_error;
718}
719
720static void
721_image_preload_internal(Eo *eo_obj, void *_pd, Eina_Bool cancel)
722{
723 Evas_Image_Data *o = _pd;
724
725 if (!o->engine_data)
726 {
727 o->preloading = EINA_TRUE;
728 evas_object_inform_call_image_preloaded(eo_obj);
729 return;
730 }
731 // FIXME: if already busy preloading, then dont request again until
732 // preload done
733 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
734 if (cancel)
735 {
736 if (o->preloading)
737 {
738 o->preloading = EINA_FALSE;
739 ENFN->image_data_preload_cancel(ENDT, o->engine_data, eo_obj);
740 }
741 }
742 else
743 {
744 if (!o->preloading)
745 {
746 o->preloading = EINA_TRUE;
747 ENFN->image_data_preload_request(ENDT, o->engine_data, eo_obj);
748 }
749 }
750}
751
752EOLIAN static void
753_evas_image_efl_image_load_load_async_start(Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED)
754{
755 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
756 evas_object_async_block(obj);
757 _image_preload_internal(eo_obj, _pd, EINA_FALSE);
758}
759
760EOLIAN static void
761_evas_image_efl_image_load_load_async_cancel(Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED)
762{
763 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
764 evas_object_async_block(obj);
765 _image_preload_internal(eo_obj, _pd, EINA_TRUE);
766}
767
768EOLIAN static void 634EOLIAN static void
769_evas_image_efl_gfx_buffer_buffer_update_add(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h) 635_evas_image_efl_gfx_buffer_buffer_update_add(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h)
770{ 636{
@@ -1104,142 +970,6 @@ _evas_image_pixels_dirty_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
1104 return (o->dirty_pixels ? 1 : 0); 970 return (o->dirty_pixels ? 1 : 0);
1105} 971}
1106 972
1107EOLIAN static void
1108_evas_image_efl_image_load_load_dpi_set(Eo *eo_obj, Evas_Image_Data *o, double dpi)
1109{
1110 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1111 if (dpi == o->load_opts->dpi) return;
1112 evas_object_async_block(obj);
1113 EINA_COW_LOAD_OPTS_WRITE_BEGIN(o, low)
1114 low->dpi = dpi;
1115 EINA_COW_LOAD_OPTS_WRITE_END(o, low);
1116
1117 if (o->cur->u.file)
1118 {
1119 _evas_image_unload(eo_obj, obj, 0);
1120 evas_object_inform_call_image_unloaded(eo_obj);
1121 _evas_image_load(eo_obj, obj, o);
1122 o->changed = EINA_TRUE;
1123 evas_object_change(eo_obj, obj);
1124 }
1125}
1126
1127EOLIAN static double
1128_evas_image_efl_image_load_load_dpi_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
1129{
1130 return o->load_opts->dpi;
1131}
1132
1133EOLIAN static void
1134_evas_image_efl_image_load_load_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, int h)
1135{
1136 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1137 if ((o->load_opts->w == w) && (o->load_opts->h == h)) return;
1138 evas_object_async_block(obj);
1139 EINA_COW_LOAD_OPTS_WRITE_BEGIN(o, low)
1140 {
1141 low->w = w;
1142 low->h = h;
1143 }
1144 EINA_COW_LOAD_OPTS_WRITE_END(o, low);
1145
1146 if (o->cur->u.file)
1147 {
1148 _evas_image_unload(eo_obj, obj, 0);
1149 evas_object_inform_call_image_unloaded(eo_obj);
1150 _evas_image_load(eo_obj, obj, o);
1151 o->changed = EINA_TRUE;
1152 evas_object_change(eo_obj, obj);
1153 }
1154 o->proxyerror = 0;
1155}
1156
1157EOLIAN static void
1158_evas_image_efl_image_load_load_size_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *w, int *h)
1159{
1160 if (w) *w = o->load_opts->w;
1161 if (h) *h = o->load_opts->h;
1162}
1163
1164EOLIAN static void
1165_evas_image_efl_image_load_load_scale_down_set(Eo *eo_obj, Evas_Image_Data *o, int scale_down)
1166{
1167 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1168 if (o->load_opts->scale_down_by == scale_down) return;
1169 evas_object_async_block(obj);
1170 EINA_COW_LOAD_OPTS_WRITE_BEGIN(o, low)
1171 low->scale_down_by = scale_down;
1172 EINA_COW_LOAD_OPTS_WRITE_END(o, low);
1173
1174 if (o->cur->u.file)
1175 {
1176 _evas_image_unload(eo_obj, obj, 0);
1177 evas_object_inform_call_image_unloaded(eo_obj);
1178 _evas_image_load(eo_obj, obj, o);
1179 o->changed = EINA_TRUE;
1180 evas_object_change(eo_obj, obj);
1181 }
1182}
1183
1184EOLIAN static int
1185_evas_image_efl_image_load_load_scale_down_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
1186{
1187 return o->load_opts->scale_down_by;
1188}
1189
1190EOLIAN static void
1191_evas_image_efl_image_load_load_region_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h)
1192{
1193 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1194 if ((o->load_opts->region.x == x) && (o->load_opts->region.y == y) &&
1195 (o->load_opts->region.w == w) && (o->load_opts->region.h == h)) return;
1196 evas_object_async_block(obj);
1197 EINA_COW_LOAD_OPTS_WRITE_BEGIN(o, low)
1198 {
1199 low->region.x = x;
1200 low->region.y = y;
1201 low->region.w = w;
1202 low->region.h = h;
1203 }
1204 EINA_COW_LOAD_OPTS_WRITE_END(o, low);
1205
1206 if (o->cur->u.file)
1207 {
1208 _evas_image_unload(eo_obj, obj, 0);
1209 evas_object_inform_call_image_unloaded(eo_obj);
1210 _evas_image_load(eo_obj, obj, o);
1211 o->changed = EINA_TRUE;
1212 evas_object_change(eo_obj, obj);
1213 }
1214}
1215
1216EOLIAN static void
1217_evas_image_efl_image_load_load_region_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *x, int *y, int *w, int *h)
1218{
1219 if (x) *x = o->load_opts->region.x;
1220 if (y) *y = o->load_opts->region.y;
1221 if (w) *w = o->load_opts->region.w;
1222 if (h) *h = o->load_opts->region.h;
1223}
1224
1225EOLIAN static void
1226_evas_image_efl_image_load_load_orientation_set(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, Eina_Bool enable)
1227{
1228 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1229 if (o->load_opts->orientation == !!enable) return;
1230 evas_object_async_block(obj);
1231
1232 EINA_COW_LOAD_OPTS_WRITE_BEGIN(o, low)
1233 low->orientation = !!enable;
1234 EINA_COW_LOAD_OPTS_WRITE_END(o, low);
1235}
1236
1237EOLIAN static Eina_Bool
1238_evas_image_efl_image_load_load_orientation_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
1239{
1240 return o->load_opts->orientation;;
1241}
1242
1243EOLIAN static Efl_Gfx_Colorspace 973EOLIAN static Efl_Gfx_Colorspace
1244_evas_image_efl_gfx_buffer_colorspace_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) 974_evas_image_efl_gfx_buffer_colorspace_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
1245{ 975{
@@ -1353,136 +1083,6 @@ _evas_image_efl_image_content_hint_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *
1353 return o->content_hint; 1083 return o->content_hint;
1354} 1084}
1355 1085
1356EOLIAN static Eina_Bool
1357_evas_image_efl_image_load_load_region_support_get(Eo *eo_obj, Evas_Image_Data *o)
1358{
1359 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1360
1361 return ENFN->image_can_region_get(ENDT, o->engine_data);
1362}
1363
1364/* animated feature */
1365EOLIAN static Eina_Bool
1366_evas_image_efl_image_animated_animated_get(Eo *eo_obj, Evas_Image_Data *o)
1367{
1368 Eina_Bool animated;
1369 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1370
1371 animated =
1372 ENFN->image_animated_get ?
1373 ENFN->image_animated_get(ENDT, o->engine_data) :
1374 EINA_FALSE;
1375
1376 return animated;
1377}
1378
1379EOLIAN static int
1380_evas_image_efl_image_animated_animated_frame_count_get(Eo *eo_obj, Evas_Image_Data *o)
1381{
1382 int frame_count;
1383 frame_count = -1;
1384
1385 if (!evas_object_image_animated_get(eo_obj)) return frame_count;
1386 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1387
1388 if (ENFN->image_animated_frame_count_get)
1389 frame_count = ENFN->image_animated_frame_count_get(ENDT, o->engine_data);
1390
1391 return frame_count;
1392}
1393
1394EOLIAN static Efl_Image_Animated_Loop_Hint
1395_evas_image_efl_image_animated_animated_loop_type_get(Eo *eo_obj, Evas_Image_Data *o)
1396{
1397 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1398 Efl_Image_Animated_Loop_Hint hint = EFL_IMAGE_ANIMATED_LOOP_HINT_NONE;
1399
1400 if (!evas_object_image_animated_get(eo_obj)) return hint;
1401
1402 if (ENFN->image_animated_loop_type_get)
1403 hint = (Efl_Image_Animated_Loop_Hint) ENFN->image_animated_loop_type_get(ENDT, o->engine_data);
1404
1405 return hint;
1406}
1407
1408EOLIAN static int
1409_evas_image_efl_image_animated_animated_loop_count_get(Eo *eo_obj, Evas_Image_Data *o)
1410{
1411 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1412
1413 int loop_count;
1414 loop_count = -1;
1415 if (!evas_object_image_animated_get(eo_obj)) return loop_count;
1416
1417 loop_count =
1418 ENFN->image_animated_loop_count_get ?
1419 ENFN->image_animated_loop_count_get(ENDT, o->engine_data) :
1420 -1;
1421
1422 return loop_count;
1423}
1424
1425EOLIAN static double
1426_evas_image_efl_image_animated_animated_frame_duration_get(Eo *eo_obj, Evas_Image_Data *o, int start_frame, int frame_num)
1427{
1428 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1429 double frame_duration = -1;
1430 int frame_count = 0;
1431
1432 if (!ENFN->image_animated_frame_count_get) return frame_duration;
1433
1434 frame_count = ENFN->image_animated_frame_count_get(ENDT, o->engine_data);
1435
1436 if ((start_frame + frame_num) > frame_count) return frame_duration;
1437 if (ENFN->image_animated_frame_duration_get)
1438 frame_duration = ENFN->image_animated_frame_duration_get(ENDT, o->engine_data, start_frame, frame_num);
1439
1440 return frame_duration;
1441}
1442
1443EOLIAN static Eina_Bool
1444_evas_image_efl_image_animated_animated_frame_set(Eo *eo_obj, Evas_Image_Data *o, int frame_index)
1445{
1446 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1447 int frame_count = 0;
1448
1449 if (!o->cur->u.file) return EINA_FALSE;
1450 if (o->cur->frame == frame_index) return EINA_TRUE;
1451
1452 if (!evas_object_image_animated_get(eo_obj)) return EINA_FALSE;
1453 evas_object_async_block(obj);
1454 frame_count = evas_object_image_animated_frame_count_get(eo_obj);
1455
1456 /* limit the size of frame to FRAME_MAX */
1457 if ((frame_count > FRAME_MAX) || (frame_count < 0) || (frame_index > frame_count))
1458 return EINA_FALSE;
1459
1460 if (!ENFN->image_animated_frame_set) return EINA_FALSE;
1461 ENFN->image_animated_frame_set(ENDT, o->engine_data, frame_index);
1462// if (!ENFN->image_animated_frame_set(ENDT, o->engine_data, frame_index)) return;
1463
1464 EINA_COW_WRITE_BEGIN(evas_object_image_state_cow, o->prev, Evas_Object_Image_State, prev_write)
1465 prev_write->frame = o->cur->frame;
1466 EINA_COW_WRITE_END(evas_object_image_state_cow, o->prev, prev_write);
1467
1468 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
1469 state_write->frame = frame_index;
1470 EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
1471
1472 o->changed = EINA_TRUE;
1473 evas_object_change(eo_obj, obj);
1474
1475 return EINA_TRUE;
1476}
1477
1478EOLIAN static int
1479_evas_image_efl_image_animated_animated_frame_get(Eo *eo_obj, Evas_Image_Data *o)
1480{
1481 if (!o->cur->u.file) return EINA_FALSE;
1482 if (!evas_object_image_animated_get(eo_obj)) return EINA_FALSE;
1483 return o->cur->frame;
1484}
1485
1486EOLIAN void 1086EOLIAN void
1487_evas_canvas_image_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) 1087_evas_canvas_image_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
1488{ 1088{
@@ -1500,24 +1100,24 @@ _evas_canvas_image_cache_reload(Eo *eo_e, Evas_Public_Data *e)
1500 evas_image_cache_flush(eo_e); 1100 evas_image_cache_flush(eo_e);
1501 EINA_INLIST_FOREACH(e->layers, layer) 1101 EINA_INLIST_FOREACH(e->layers, layer)
1502 { 1102 {
1503 Evas_Object_Protected_Data *obj; 1103 Evas_Object_Protected_Data *obj;
1504 1104
1505 EINA_INLIST_FOREACH(layer->objects, obj) 1105 EINA_INLIST_FOREACH(layer->objects, obj)
1506 { 1106 {
1507 if (eo_isa(obj->object, MY_CLASS)) 1107 if (eo_isa(obj->object, MY_CLASS))
1508 { 1108 {
1509 _evas_image_unload(obj->object, obj, 1); 1109 _evas_image_unload(obj->object, obj, 1);
1510 evas_object_inform_call_image_unloaded(obj->object); 1110 evas_object_inform_call_image_unloaded(obj->object);
1511 } 1111 }
1512 } 1112 }
1513 } 1113 }
1514 evas_image_cache_flush(eo_e); 1114 evas_image_cache_flush(eo_e);
1515 EINA_INLIST_FOREACH(e->layers, layer) 1115 EINA_INLIST_FOREACH(e->layers, layer)
1516 { 1116 {
1517 Evas_Object_Protected_Data *obj; 1117 Evas_Object_Protected_Data *obj;
1518 1118
1519 EINA_INLIST_FOREACH(layer->objects, obj) 1119 EINA_INLIST_FOREACH(layer->objects, obj)
1520 { 1120 {
1521 if (eo_isa(obj->object, MY_CLASS)) 1121 if (eo_isa(obj->object, MY_CLASS))
1522 { 1122 {
1523 Evas_Image_Data *o = eo_data_scope_get(obj->object, MY_CLASS); 1123 Evas_Image_Data *o = eo_data_scope_get(obj->object, MY_CLASS);
@@ -1525,7 +1125,7 @@ _evas_canvas_image_cache_reload(Eo *eo_e, Evas_Public_Data *e)
1525 o->changed = EINA_TRUE; 1125 o->changed = EINA_TRUE;
1526 evas_object_change(obj->object, obj); 1126 evas_object_change(obj->object, obj);
1527 } 1127 }
1528 } 1128 }
1529 } 1129 }
1530 evas_image_cache_flush(eo_e); 1130 evas_image_cache_flush(eo_e);
1531} 1131}
@@ -1718,11 +1318,12 @@ evas_object_image_init(Evas_Object *eo_obj)
1718} 1318}
1719 1319
1720EOLIAN static void 1320EOLIAN static void
1721_evas_image_eo_base_destructor(Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED) 1321_evas_image_eo_base_destructor(Eo *eo_obj, Evas_Image_Data *o EINA_UNUSED)
1722{ 1322{
1723 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 1323 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1724 1324
1725 evas_object_image_video_surface_set(eo_obj, NULL); 1325 if (obj->legacy)
1326 evas_object_image_video_surface_set(eo_obj, NULL);
1726 evas_object_image_free(eo_obj, obj); 1327 evas_object_image_free(eo_obj, obj);
1727 eo_destructor(eo_super(eo_obj, MY_CLASS)); 1328 eo_destructor(eo_super(eo_obj, MY_CLASS));
1728} 1329}
@@ -3913,6 +3514,41 @@ evas_object_image_data_copy_set(Eo *eo_obj, void *data)
3913 EVAS_OBJECT_WRITE_IMAGE_FREE_FILE_AND_KEY(o); 3514 EVAS_OBJECT_WRITE_IMAGE_FREE_FILE_AND_KEY(o);
3914} 3515}
3915 3516
3517/* FIXME: Temporarily allow efl_file_ APIs on Evas.Image.
3518 * They don't belong here, as only Efl.Canvas.Image should support them.
3519 * Elm.Image uses them, though, instead of using the legacy APIs...
3520 */
3521
3522EOLIAN static Eina_Bool
3523_evas_image_efl_file_file_set(Eo *obj, Evas_Image_Data *pd EINA_UNUSED, const char *file, const char *key)
3524{
3525 DBG("efl_file_set shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image");
3526 return _evas_image_file_set(obj, file, key);
3527}
3528
3529EOLIAN static void
3530_evas_image_efl_file_file_get(Eo *obj, Evas_Image_Data *pd EINA_UNUSED, const char **file, const char **key)
3531{
3532 DBG("efl_file_get shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image");
3533 _evas_image_file_get(obj, file, key);
3534}
3535
3536EOLIAN static Eina_Bool
3537_evas_image_efl_file_mmap_set(Eo *obj, Evas_Image_Data *pd EINA_UNUSED, const Eina_File *f, const char *key)
3538{
3539 DBG("efl_file_mmap_set shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image");
3540 return _evas_image_mmap_set(obj, f, key);
3541}
3542
3543
3544EOLIAN static void
3545_evas_image_efl_file_mmap_get(Eo *obj, Evas_Image_Data *pd EINA_UNUSED, const Eina_File **f, const char **key)
3546{
3547 DBG("efl_file_mmap_get shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image");
3548 _evas_image_mmap_get(obj, f, key);
3549}
3550
3551
3916#include "canvas/evas_image.eo.c" 3552#include "canvas/evas_image.eo.c"
3917 3553
3918/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ 3554/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index 71e0276437..c423567c43 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -788,11 +788,13 @@ _evas_object_eo_base_destructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
788 evas_object_clip_unset(tmp->object); 788 evas_object_clip_unset(tmp->object);
789 } 789 }
790 } 790 }
791
792 /* FIXME: Proxies should listen to source death */
791 EINA_LIST_FOREACH_SAFE(obj->proxy->proxies, l, l2, proxy) 793 EINA_LIST_FOREACH_SAFE(obj->proxy->proxies, l, l2, proxy)
792 { 794 {
793 if (eo_isa(proxy, EVAS_IMAGE_CLASS)) 795 if (eo_isa(proxy, EVAS_IMAGE_CLASS))
794 evas_object_image_source_unset(proxy); 796 evas_object_image_source_unset(proxy);
795 else if (eo_isa(proxy, EVAS_TEXT_CLASS)) 797 if (eo_isa(proxy, EFL_GFX_FILTER_INTERFACE))
796 efl_gfx_filter_source_set(proxy, NULL, eo_obj); 798 efl_gfx_filter_source_set(proxy, NULL, eo_obj);
797 } 799 }
798 800
diff --git a/src/modules/evas/engines/gl_common/evas_gl_preload.c b/src/modules/evas/engines/gl_common/evas_gl_preload.c
index 52a8429092..d97ce950d8 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_preload.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_preload.c
@@ -105,7 +105,7 @@ _evas_gl_preload_main_loop_wakeup(void)
105 if (async->tex) 105 if (async->tex)
106 { 106 {
107 EINA_LIST_FREE(async->tex->targets, target) 107 EINA_LIST_FREE(async->tex->targets, target)
108 evas_obj_image_pixels_dirty_set(target, EINA_TRUE); 108 evas_object_image_pixels_dirty_set(target, EINA_TRUE);
109 } 109 }
110 async->im->cache_entry.flags.preload_done = 0; 110 async->im->cache_entry.flags.preload_done = 0;
111 if (async->tex) 111 if (async->tex)