summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile_Efl.am2
-rw-r--r--src/lib/efl/Efl.h1
-rw-r--r--src/lib/efl/interfaces/efl_image.eo64
-rw-r--r--src/lib/evas/Evas_Common.h5
-rw-r--r--src/lib/evas/Evas_Legacy.h49
-rw-r--r--src/lib/evas/cache2/evas_cache2.c2
-rw-r--r--src/lib/evas/canvas/evas_image.eo51
-rw-r--r--src/lib/evas/canvas/evas_image_private.h6
-rw-r--r--src/lib/evas/canvas/evas_object_image.c39
-rw-r--r--src/lib/evas/canvas/evas_types.eot9
10 files changed, 160 insertions, 68 deletions
diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am
index e507a38c5d..ae1ee1a5cf 100644
--- a/src/Makefile_Efl.am
+++ b/src/Makefile_Efl.am
@@ -2,13 +2,13 @@
2efl_eolian_legacy_files = \ 2efl_eolian_legacy_files = \
3 lib/efl/interfaces/efl_gfx_fill.eo \ 3 lib/efl/interfaces/efl_gfx_fill.eo \
4 lib/efl/interfaces/efl_gfx_base.eo \ 4 lib/efl/interfaces/efl_gfx_base.eo \
5 lib/efl/interfaces/efl_image.eo \
5 lib/efl/interfaces/efl_image_animated.eo \ 6 lib/efl/interfaces/efl_image_animated.eo \
6 $(NULL) 7 $(NULL)
7 8
8efl_eolian_files = \ 9efl_eolian_files = \
9 lib/efl/interfaces/efl_control.eo \ 10 lib/efl/interfaces/efl_control.eo \
10 lib/efl/interfaces/efl_file.eo \ 11 lib/efl/interfaces/efl_file.eo \
11 lib/efl/interfaces/efl_image.eo \
12 lib/efl/interfaces/efl_image_load.eo \ 12 lib/efl/interfaces/efl_image_load.eo \
13 lib/efl/interfaces/efl_player.eo \ 13 lib/efl/interfaces/efl_player.eo \
14 lib/efl/interfaces/efl_text.eo \ 14 lib/efl/interfaces/efl_text.eo \
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index fccce5df31..2cb0bd7a0c 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -103,6 +103,7 @@ static inline void efl_gfx_color16_type_set(Efl_Gfx_Color *color,
103#include "interfaces/efl_gfx_types.eot.h" 103#include "interfaces/efl_gfx_types.eot.h"
104#include "interfaces/efl_gfx_fill.eo.legacy.h" 104#include "interfaces/efl_gfx_fill.eo.legacy.h"
105#include "interfaces/efl_gfx_base.eo.legacy.h" 105#include "interfaces/efl_gfx_base.eo.legacy.h"
106#include "interfaces/efl_image.eo.legacy.h"
106#include "interfaces/efl_image_animated.eo.legacy.h" 107#include "interfaces/efl_image_animated.eo.legacy.h"
107#endif 108#endif
108 109
diff --git a/src/lib/efl/interfaces/efl_image.eo b/src/lib/efl/interfaces/efl_image.eo
index 619d17c302..8a5d015c95 100644
--- a/src/lib/efl/interfaces/efl_image.eo
+++ b/src/lib/efl/interfaces/efl_image.eo
@@ -1,3 +1,20 @@
1enum Efl.Image.Content_Hint
2{
3 [[How an image's data is to be treated by EFL, for optimization.]]
4 none = 0, [[No hint on the content (default).]]
5 dynamic = 1, [[The content will change over time.]]
6 static = 2 [[The content won't change over time.]]
7}
8
9enum Efl.Image.Scale_Hint
10{
11 /* FIXME: Legacy is in Emile, where it does not belong. */
12 [[How an image's data is to be treated by EFL, with regard to scaling cache.]]
13 none = 0, [[No hint on the scaling (default).]]
14 dynamic = 1, [[Image will be re-scaled over time, thus turning scaling cache OFF for its data.]]
15 static = 2 [[Image will not be re-scaled over time, thus turning scaling cache ON for its data.]]
16}
17
1interface Efl.Image () 18interface Efl.Image ()
2{ 19{
3 [[Common APIs for all 2D images that can be rendered on the canvas.]] 20 [[Common APIs for all 2D images that can be rendered on the canvas.]]
@@ -132,5 +149,52 @@ interface Efl.Image ()
132 fill: Efl.Gfx.Border_Fill_Mode; [[Fill mode of the center region.]] 149 fill: Efl.Gfx.Border_Fill_Mode; [[Fill mode of the center region.]]
133 } 150 }
134 } 151 }
152
153 /* Note: those are obscure features of evas image. Expose in Efl.Image? */
154 @property content_hint {
155 set {
156 [[Set the content hint setting of a given image object of the
157 canvas.
158
159 This function sets the content hint value of the given image
160 of the canvas. For example, if you're on the GL engine and
161 your driver implementation supports it, setting this hint to
162 #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need zero copies
163 at texture upload time, which is an "expensive" operation.
164 ]]
165 }
166 get {
167 [[Get the content hint setting of a given image object of the
168 canvas.
169
170 This returns #EVAS_IMAGE_CONTENT_HINT_NONE on error.
171 ]]
172 }
173 values {
174 hint: Efl.Image.Content_Hint; [[Dynamic or static content hint,
175 see @Efl.Image.Content_Hint]]
176 }
177 }
178 @property scale_hint {
179 set {
180 [[Set the scale hint of a given image of the canvas.
181
182 This function sets the scale hint value of the given image
183 object in the canvas, which will affect how Evas is to cache
184 scaled versions of its original source image.
185 ]]
186 }
187 get {
188 [[Get the scale hint of a given image of the canvas.
189
190 This function returns the scale hint value of the given image
191 object of the canvas.
192 ]]
193 }
194 values {
195 hint: Efl.Image.Scale_Hint; [[Scalable or static size hint,
196 see @Efl.Image.Scale_Hint]]
197 }
198 }
135 } 199 }
136} 200}
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index d3a1844181..cf6fb1bbf9 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -246,6 +246,11 @@ typedef struct _Evas_Event_Hold Evas_Event_Hold; /**< Event structure f
246typedef struct _Evas_Event_Render_Post Evas_Event_Render_Post; /**< Event structure that may come with #EVAS_CALLBACK_RENDER_POST event callbacks @since 1.8 */ 246typedef struct _Evas_Event_Render_Post Evas_Event_Render_Post; /**< Event structure that may come with #EVAS_CALLBACK_RENDER_POST event callbacks @since 1.8 */
247typedef struct _Evas_Event_Axis_Update Evas_Event_Axis_Update; /**< Event structure for #EVAS_CALLBACK_AXIS_UPDATE event callbacks @since 1.13 */ 247typedef struct _Evas_Event_Axis_Update Evas_Event_Axis_Update; /**< Event structure for #EVAS_CALLBACK_AXIS_UPDATE event callbacks @since 1.13 */
248 248
249typedef Efl_Image_Content_Hint Evas_Image_Content_Hint;
250#define EVAS_IMAGE_CONTENT_HINT_NONE EFL_IMAGE_CONTENT_HINT_NONE
251#define EVAS_IMAGE_CONTENT_HINT_DYNAMIC EFL_IMAGE_CONTENT_HINT_DYNAMIC
252#define EVAS_IMAGE_CONTENT_HINT_STATIC EFL_IMAGE_CONTENT_HINT_STATIC
253
249typedef enum _Evas_Alloc_Error 254typedef enum _Evas_Alloc_Error
250{ 255{
251 EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */ 256 EVAS_ALLOC_ERROR_NONE = 0, /**< No allocation error */
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index e53f0549c9..9f92dddbd4 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -3379,6 +3379,55 @@ EAPI void evas_object_image_orient_set(Evas_Object *obj, Evas_Image_Orient orien
3379EAPI Evas_Image_Orient evas_object_image_orient_get(const Evas_Object *obj); 3379EAPI Evas_Image_Orient evas_object_image_orient_get(const Evas_Object *obj);
3380 3380
3381/** 3381/**
3382 * @brief Set the content hint setting of a given image object of the canvas.
3383 *
3384 * This function sets the content hint value of the given image of the canvas.
3385 * For example, if you're on the GL engine and your driver implementation
3386 * supports it, setting this hint to #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make
3387 * it need zero copies at texture upload time, which is an "expensive"
3388 * operation.
3389 *
3390 * @param[in] hint The content hint value, one of the
3391 * @ref Evas_Image_Content_Hint ones.
3392 */
3393EAPI void evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint);
3394
3395/**
3396 * @brief Get the content hint setting of a given image object of the canvas.
3397 *
3398 * This returns #EVAS_IMAGE_CONTENT_HINT_NONE on error.
3399 *
3400 * @return The content hint value, one of the @ref Evas_Image_Content_Hint
3401 * ones.
3402 */
3403EAPI Evas_Image_Content_Hint evas_object_image_content_hint_get(const Evas_Object *obj);
3404
3405/**
3406 * @brief Set the scale hint of a given image of the canvas.
3407 *
3408 * This function sets the scale hint value of the given image object in the
3409 * canvas, which will affect how Evas is to cache scaled versions of its
3410 * original source image.
3411 *
3412 * @param[in] hint The scale hint, a value in @ref Evas_Image_Scale_Hint.
3413 *
3414 * @ingroup Evas_Image
3415 */
3416EAPI void evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint);
3417
3418/**
3419 * @brief Get the scale hint of a given image of the canvas.
3420 *
3421 * This function returns the scale hint value of the given image object of the
3422 * canvas.
3423 *
3424 * @return The scale hint, a value in @ref Evas_Image_Scale_Hint.
3425 *
3426 * @ingroup Evas_Image
3427 */
3428EAPI Evas_Image_Scale_Hint evas_object_image_scale_hint_get(const Evas_Object *obj);
3429
3430/**
3382 * 3431 *
3383 * Sets the size of the given image object. 3432 * Sets the size of the given image object.
3384 * 3433 *
diff --git a/src/lib/evas/cache2/evas_cache2.c b/src/lib/evas/cache2/evas_cache2.c
index 4603aae120..d9788aac31 100644
--- a/src/lib/evas/cache2/evas_cache2.c
+++ b/src/lib/evas/cache2/evas_cache2.c
@@ -913,7 +913,7 @@ evas_cache2_image_scale_load(Image_Entry *im,
913 lo.scale_load.dst_w = dst_w; 913 lo.scale_load.dst_w = dst_w;
914 lo.scale_load.dst_h = dst_h; 914 lo.scale_load.dst_h = dst_h;
915 lo.scale_load.smooth = smooth; 915 lo.scale_load.smooth = smooth;
916 lo.scale_load.scale_hint = im->scale_hint; 916 lo.scale_load.scale_hint = (Emile_Image_Scale_Hint) im->scale_hint;
917 917
918 evas_cache2_image_cache_key_create(hkey, im->file, pathlen, 918 evas_cache2_image_cache_key_create(hkey, im->file, pathlen,
919 im->key, keylen, &lo); 919 im->key, keylen, &lo);
diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo
index 60109ac134..f71d822b6a 100644
--- a/src/lib/evas/canvas/evas_image.eo
+++ b/src/lib/evas/canvas/evas_image.eo
@@ -5,53 +5,6 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Load, Efl.Image_An
5 legacy_prefix: evas_object_image; 5 legacy_prefix: evas_object_image;
6 eo_prefix: evas_obj_image; 6 eo_prefix: evas_obj_image;
7 methods { 7 methods {
8 /* weird stuff - hints */
9 @property content_hint {
10 set {
11 [[Set the content hint setting of a given image object of the
12 canvas.
13
14 This function sets the content hint value of the given image
15 of the canvas. For example, if you're on the GL engine and
16 your driver implementation supports it, setting this hint to
17 #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need zero copies
18 at texture upload time, which is an "expensive" operation.
19 ]]
20 }
21 get {
22 [[Get the content hint setting of a given image object of the
23 canvas.
24
25 This returns #EVAS_IMAGE_CONTENT_HINT_NONE on error.
26 ]]
27 }
28 values {
29 hint: Evas.Image_Content_Hint; [[The content hint value, one of
30 the @Evas.Image_Content_Hint ones.]]
31 }
32 }
33 @property scale_hint {
34 set {
35 [[Set the scale hint of a given image of the canvas.
36
37 This function sets the scale hint value of the given image
38 object in the canvas, which will affect how Evas is to cache
39 scaled versions of its original source image.
40 ]]
41 }
42 get {
43 [[Get the scale hint of a given image of the canvas.
44
45 This function returns the scale hint value of the given image
46 object of the canvas.
47 ]]
48 }
49 values {
50 hint: Evas.Image_Scale_Hint; [[The scale hint, a value in
51 @Evas.Image_Scale_Hint.]]
52 }
53 }
54
55 /* GL View */ 8 /* GL View */
56 @property pixels_dirty { 9 @property pixels_dirty {
57 set { 10 set {
@@ -111,6 +64,10 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Load, Efl.Image_An
111 Efl.Image.border_scale.set; 64 Efl.Image.border_scale.set;
112 Efl.Image.border_center_fill.get; 65 Efl.Image.border_center_fill.get;
113 Efl.Image.border_center_fill.set; 66 Efl.Image.border_center_fill.set;
67 Efl.Image.scale_hint.get;
68 Efl.Image.scale_hint.set;
69 Efl.Image.content_hint.get;
70 Efl.Image.content_hint.set;
114 Efl.Image_Animated.animated.get; 71 Efl.Image_Animated.animated.get;
115 Efl.Image_Animated.animated_frame.get; 72 Efl.Image_Animated.animated_frame.get;
116 Efl.Image_Animated.animated_frame.set; 73 Efl.Image_Animated.animated_frame.set;
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index 68fa686c2d..9ccff4a736 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -109,8 +109,8 @@ struct _Evas_Image_Data
109 int pixels_checked_out; 109 int pixels_checked_out;
110 int load_error; 110 int load_error;
111 111
112 Evas_Image_Scale_Hint scale_hint; 112 Efl_Image_Scale_Hint scale_hint;
113 Evas_Image_Content_Hint content_hint; 113 Efl_Image_Content_Hint content_hint;
114 114
115 Eina_Bool changed : 1; 115 Eina_Bool changed : 1;
116 Eina_Bool dirty_pixels : 1; 116 Eina_Bool dirty_pixels : 1;
@@ -165,4 +165,6 @@ Evas_Native_Surface *_evas_image_native_surface_get(const Evas_Object *eo_obj);
165# define EINA_COW_IMAGE_STATE_WRITE_END(Obj, Write) \ 165# define EINA_COW_IMAGE_STATE_WRITE_END(Obj, Write) \
166 EINA_COW_WRITE_END(evas_object_image_state_cow, Obj->cur, Write) 166 EINA_COW_WRITE_END(evas_object_image_state_cow, Obj->cur, Write)
167 167
168#define FRAME_MAX 1024
169
168#endif // EVAS_IMAGE_PRIVATE_H 170#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 ddd71ae0e5..4666d6a659 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1657,7 +1657,7 @@ evas_object_image_native_surface_get(const Evas_Object *eo_obj)
1657} 1657}
1658 1658
1659EOLIAN static void 1659EOLIAN static void
1660_evas_image_scale_hint_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Scale_Hint hint) 1660_evas_image_efl_image_scale_hint_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Image_Scale_Hint hint)
1661{ 1661{
1662 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 1662 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1663 evas_object_async_block(obj); 1663 evas_object_async_block(obj);
@@ -1683,14 +1683,14 @@ _evas_image_scale_hint_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Scale_Hint
1683 } 1683 }
1684} 1684}
1685 1685
1686EOLIAN static Evas_Image_Scale_Hint 1686EOLIAN static Efl_Image_Scale_Hint
1687_evas_image_scale_hint_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) 1687_evas_image_efl_image_scale_hint_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
1688{ 1688{
1689 return o->scale_hint;; 1689 return o->scale_hint;
1690} 1690}
1691 1691
1692EOLIAN static void 1692EOLIAN static void
1693_evas_image_content_hint_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Content_Hint hint) 1693_evas_image_efl_image_content_hint_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Image_Content_Hint hint)
1694{ 1694{
1695 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 1695 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
1696 evas_object_async_block(obj); 1696 evas_object_async_block(obj);
@@ -1716,9 +1716,8 @@ _evas_image_content_hint_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Content_
1716 } 1716 }
1717} 1717}
1718 1718
1719#define FRAME_MAX 1024 1719EOLIAN static Efl_Image_Content_Hint
1720EOLIAN static Evas_Image_Content_Hint 1720_evas_image_efl_image_content_hint_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
1721_evas_image_content_hint_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
1722{ 1721{
1723 return o->content_hint; 1722 return o->content_hint;
1724} 1723}
@@ -4699,6 +4698,30 @@ evas_object_image_source_events_get(const Evas_Object *eo)
4699} 4698}
4700 4699
4701EAPI void 4700EAPI void
4701evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint)
4702{
4703 return efl_image_content_hint_set(obj, hint);
4704}
4705
4706EAPI Evas_Image_Content_Hint
4707evas_object_image_content_hint_get(const Evas_Object *obj)
4708{
4709 return efl_image_content_hint_get(obj);
4710}
4711
4712EAPI void
4713evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint)
4714{
4715 return efl_image_scale_hint_set(obj, (Efl_Image_Scale_Hint) hint);
4716}
4717
4718EAPI Evas_Image_Scale_Hint
4719evas_object_image_scale_hint_get(const Evas_Object *obj)
4720{
4721 return (Evas_Image_Scale_Hint) efl_image_scale_hint_get(obj);
4722}
4723
4724EAPI void
4702evas_object_image_source_visible_set(Evas_Object *eo, Eina_Bool visible) 4725evas_object_image_source_visible_set(Evas_Object *eo, Eina_Bool visible)
4703{ 4726{
4704 /* FIXME: I'd love to remove this feature and replace by no_render. 4727 /* FIXME: I'd love to remove this feature and replace by no_render.
diff --git a/src/lib/evas/canvas/evas_types.eot b/src/lib/evas/canvas/evas_types.eot
index 138b319769..6f37537347 100644
--- a/src/lib/evas/canvas/evas_types.eot
+++ b/src/lib/evas/canvas/evas_types.eot
@@ -1,5 +1,4 @@
1type @extern Evas.Load_Error: int; /* FIXME: Need to migrate emile. */ 1type @extern Evas.Load_Error: int; /* FIXME: Need to migrate emile. */
2type @extern Evas.Image_Scale_Hint: int; /* FIXME: Need to migrate emile. */
3struct @extern Evas.Video_Surface; /* FIXME: The structure is full of the unsupported func pointers. */ 2struct @extern Evas.Video_Surface; /* FIXME: The structure is full of the unsupported func pointers. */
4 3
5/* FIXME: Unsupported annonymous structures inside */ 4/* FIXME: Unsupported annonymous structures inside */
@@ -231,14 +230,6 @@ enum Evas.Callback_Type
231 last [[kept as last element/sentinel -- not really an event]] 230 last [[kept as last element/sentinel -- not really an event]]
232} 231}
233 232
234enum Evas.Image_Content_Hint
235{
236 [[How an image's data is to be treated by Evas, for optimization]]
237 none = 0, [[No hint at all]]
238 dynamic = 1, [[The contents will change over time]]
239 static = 2 [[The contents won't change over time]]
240}
241
242enum Evas.Image_Orient 233enum Evas.Image_Orient
243{ 234{
244 [[Possible orientation options for evas_object_image_orient_set(). 235 [[Possible orientation options for evas_object_image_orient_set().