summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_image.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-03-02 16:38:57 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-03-15 11:11:59 +0900
commit544ae716edc226ad252b54dfd4cd9d679d82554b (patch)
treec934fd1badcbbbe8f2299744624878f04815aa4e /src/lib/evas/canvas/evas_object_image.c
parentb5d87aef1c6a0c296a33d8e5c0177e9f1b8e814f (diff)
Efl.Image: Improve documentation a bit
This interface needs to be extended and cleaned up... this will happen in the following patches.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/evas_object_image.c135
1 files changed, 70 insertions, 65 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 7c663b3698..9d674c2732 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -247,8 +247,11 @@ static const Evas_Object_Image_State default_state = {
247 EVAS_COLORSPACE_ARGB8888, 247 EVAS_COLORSPACE_ARGB8888,
248 EVAS_IMAGE_ORIENT_NONE, 248 EVAS_IMAGE_ORIENT_NONE,
249 249
250 // flags 250 EINA_TRUE, // smooth
251 EINA_TRUE, EINA_FALSE, EINA_FALSE, EINA_FALSE, EINA_FALSE 251 EINA_FALSE, // has_alpha
252 EINA_FALSE, // opaque_valid
253 EINA_FALSE, // opaque
254 EINA_FALSE // mmapped_source
252}; 255};
253 256
254Eina_Cow *evas_object_image_load_opts_cow = NULL; 257Eina_Cow *evas_object_image_load_opts_cow = NULL;
@@ -381,21 +384,6 @@ _evas_image_eo_base_finalize(Eo *eo_obj, Evas_Image_Data *o)
381 return eo_finalize(eo_super(eo_obj, MY_CLASS)); 384 return eo_finalize(eo_super(eo_obj, MY_CLASS));
382} 385}
383 386
384EAPI Evas_Object *
385evas_object_image_add(Evas *eo_e)
386{
387 EINA_SAFETY_ON_FALSE_RETURN_VAL(eo_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
388 return eo_add(EVAS_IMAGE_CLASS, eo_e,
389 efl_gfx_fill_filled_set(eo_obj, EINA_FALSE));
390}
391
392EAPI Evas_Object *
393evas_object_image_filled_add(Evas *eo_e)
394{
395 EINA_SAFETY_ON_FALSE_RETURN_VAL(eo_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
396 return eo_add(EVAS_IMAGE_CLASS, eo_e);
397}
398
399EAPI void 387EAPI void
400evas_object_image_memfile_set(Evas_Object *eo_obj, void *data, int size, char *format EINA_UNUSED, char *key) 388evas_object_image_memfile_set(Evas_Object *eo_obj, void *data, int size, char *format EINA_UNUSED, char *key)
401{ 389{
@@ -961,18 +949,6 @@ _evas_image_efl_gfx_fill_filled_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
961 return o->filled; 949 return o->filled;
962} 950}
963 951
964EAPI void
965evas_object_image_filled_set(Evas_Object *eo_obj, Eina_Bool value)
966{
967 efl_gfx_fill_filled_set(eo_obj, value);
968}
969
970EAPI Eina_Bool
971evas_object_image_filled_get(const Evas_Object *eo_obj)
972{
973 return efl_gfx_fill_filled_get(eo_obj);
974}
975
976EOLIAN static void 952EOLIAN static void
977_evas_image_border_scale_set(Eo *eo_obj, Evas_Image_Data *o, double scale) 953_evas_image_border_scale_set(Eo *eo_obj, Evas_Image_Data *o, double scale)
978{ 954{
@@ -1033,14 +1009,6 @@ _evas_image_efl_gfx_fill_fill_set(Eo *eo_obj, Evas_Image_Data *o,
1033 evas_object_change(eo_obj, obj); 1009 evas_object_change(eo_obj, obj);
1034} 1010}
1035 1011
1036EAPI void
1037evas_object_image_fill_get(const Evas_Image *obj,
1038 Evas_Coord *x, Evas_Coord *y,
1039 Evas_Coord *w, Evas_Coord *h)
1040{
1041 efl_gfx_fill_get((Evas_Image *)obj, x, y, w, h);
1042}
1043
1044EOLIAN static void 1012EOLIAN static void
1045_evas_image_efl_gfx_fill_fill_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, 1013_evas_image_efl_gfx_fill_fill_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o,
1046 int *x, int *y, int *w, int *h) 1014 int *x, int *y, int *w, int *h)
@@ -1051,26 +1019,6 @@ _evas_image_efl_gfx_fill_fill_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o,
1051 if (h) *h = o->cur->fill.h; 1019 if (h) *h = o->cur->fill.h;
1052} 1020}
1053 1021
1054EAPI void
1055evas_object_image_fill_spread_set(Evas_Image *obj EINA_UNUSED, Evas_Fill_Spread spread)
1056{
1057 /* not implemented! */
1058 if (spread != EFL_GFX_FILL_REPEAT)
1059 WRN("Fill spread support is not implemented!");
1060}
1061
1062EAPI Evas_Fill_Spread
1063evas_object_image_fill_spread_get(const Evas_Image *obj EINA_UNUSED)
1064{
1065 return EFL_GFX_FILL_REPEAT;
1066}
1067
1068EAPI void
1069evas_object_image_size_set(Evas_Image *obj, int w, int h)
1070{
1071 efl_gfx_view_size_set((Evas_Image *)obj, w, h);
1072}
1073
1074EOLIAN static void 1022EOLIAN static void
1075_evas_image_efl_gfx_view_view_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, int h) 1023_evas_image_efl_gfx_view_view_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, int h)
1076{ 1024{
@@ -3209,6 +3157,14 @@ _evas_image_evas_filter_filter_input_alpha(Eo *eo_obj EINA_UNUSED, Evas_Image_Da
3209 return EINA_FALSE; 3157 return EINA_FALSE;
3210} 3158}
3211 3159
3160EOLIAN static void
3161_evas_image_efl_gfx_filter_filter_program_set(Eo *obj, Evas_Image_Data *pd EINA_UNUSED,
3162 const char *code, const char *name)
3163{
3164 pd->has_filter = (code != NULL);
3165 efl_gfx_filter_program_set(eo_super(obj, MY_CLASS), code, name);
3166}
3167
3212EOLIAN static Eina_Bool 3168EOLIAN static Eina_Bool
3213_evas_image_evas_filter_filter_input_render(Eo *eo_obj, Evas_Image_Data *o, 3169_evas_image_evas_filter_filter_input_render(Eo *eo_obj, Evas_Image_Data *o,
3214 void *_filter, void *context, 3170 void *_filter, void *context,
@@ -4900,6 +4856,63 @@ _evas_object_image_surface_get(Evas_Object *eo, Evas_Object_Protected_Data *obj)
4900 return pd->engine_data; 4856 return pd->engine_data;
4901} 4857}
4902 4858
4859/* Legacy wrappers */
4860
4861EAPI Evas_Object *
4862evas_object_image_add(Evas *eo_e)
4863{
4864 EINA_SAFETY_ON_FALSE_RETURN_VAL(eo_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
4865 return eo_add(EVAS_IMAGE_CLASS, eo_e,
4866 efl_gfx_fill_filled_set(eoid, EINA_FALSE));
4867}
4868
4869EAPI Evas_Object *
4870evas_object_image_filled_add(Evas *eo_e)
4871{
4872 EINA_SAFETY_ON_FALSE_RETURN_VAL(eo_isa(eo_e, EVAS_CANVAS_CLASS), NULL);
4873 return eo_add(EVAS_IMAGE_CLASS, eo_e);
4874}
4875
4876EAPI void
4877evas_object_image_filled_set(Evas_Object *eo_obj, Eina_Bool value)
4878{
4879 efl_gfx_fill_filled_set(eo_obj, value);
4880}
4881
4882EAPI Eina_Bool
4883evas_object_image_filled_get(const Evas_Object *eo_obj)
4884{
4885 return efl_gfx_fill_filled_get((Eo *) eo_obj);
4886}
4887
4888EAPI void
4889evas_object_image_fill_get(const Evas_Image *obj,
4890 Evas_Coord *x, Evas_Coord *y,
4891 Evas_Coord *w, Evas_Coord *h)
4892{
4893 efl_gfx_fill_get((Evas_Image *)obj, x, y, w, h);
4894}
4895
4896EAPI void
4897evas_object_image_fill_spread_set(Evas_Image *obj EINA_UNUSED, Evas_Fill_Spread spread)
4898{
4899 /* not implemented! */
4900 if (spread != EFL_GFX_FILL_REPEAT)
4901 WRN("Fill spread support is not implemented!");
4902}
4903
4904EAPI Evas_Fill_Spread
4905evas_object_image_fill_spread_get(const Evas_Image *obj EINA_UNUSED)
4906{
4907 return EFL_GFX_FILL_REPEAT;
4908}
4909
4910EAPI void
4911evas_object_image_size_set(Evas_Image *obj, int w, int h)
4912{
4913 efl_gfx_view_size_set((Evas_Image *)obj, w, h);
4914}
4915
4903EAPI void 4916EAPI void
4904evas_object_image_file_set(Eo *obj, const char *file, const char *key) 4917evas_object_image_file_set(Eo *obj, const char *file, const char *key)
4905{ 4918{
@@ -4960,14 +4973,6 @@ evas_object_image_smooth_scale_get(const Eo *obj)
4960 return efl_image_smooth_scale_get((Eo *) obj); 4973 return efl_image_smooth_scale_get((Eo *) obj);
4961} 4974}
4962 4975
4963EOLIAN static void
4964_evas_image_efl_gfx_filter_filter_program_set(Eo *obj, Evas_Image_Data *pd EINA_UNUSED,
4965 const char *code, const char *name)
4966{
4967 pd->has_filter = (code != NULL);
4968 efl_gfx_filter_program_set(eo_super(obj, MY_CLASS), code, name);
4969}
4970
4971#include "canvas/evas_image.eo.c" 4976#include "canvas/evas_image.eo.c"
4972 4977
4973/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ 4978/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/