summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_image.h
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertise.dev>2020-12-15 23:02:20 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-12-15 23:06:12 -0300
commit0363fd8238c3df734c856a48cbb831b9651ed089 (patch)
tree951895156f0a5dd6aa7e88d8a602c58d79251c50 /src/lib/evas/common/evas_image.h
parent75f07e41c0242123f9e4e5dcbc303ad46ea0849b (diff)
downloadefl-0363fd8238c3df734c856a48cbb831b9651ed089.tar.gz
evas: Rename EAPI macro to EVAS_API in Evas library
Summary: Patch from a series of patches to rename EAPI symbols to specific library DSOs. = The Rationale = This patch is from a series of patches to rename EAPI symbols to specific library DSOs. EAPI was designed to be able to pass `__attribute__ ((visibility ("default")))` for symbols with GCC, which would mean that even if -fvisibility=hidden was used when compiling the library, the needed symbols would get exported. MSVC __almost__ works like GCC (or mingw) in which you can declare everything as export and it will just work (slower, but it will work). But there's a caveat: global variables will not work the same way for MSVC, but works for mingw and GCC. For global variables (as opposed to functions), MSVC requires correct DSO visibility for MSVC: instead of declaring a symbol as export for everything, you need to declare it as import when importing from another DSO and export when defining it locally. With current EAPI definitions, we get the following example working in mingw and MSVC (observe it doesn't define any global variables as exported symbols). Example 1: dll1: ``` EAPI void foo(void); EAPI void bar() { foo(); } ``` dll2: ``` EAPI void foo() { printf ("foo\n"); } ``` This works fine with API defined as __declspec(dllexport) in both cases and for gcc defining as `__atttribute__((visibility("default")))`. However, the following: Example 2: dll1: ``` EAPI extern int foo; EAPI void foobar(void); EAPI void bar() { foo = 5; foobar(); } ``` dll2: ``` EAPI int foo = 0; EAPI void foobar() { printf ("foo %d\n", foo); } ``` This will work on mingw but will not work for MSVC. And that's why LIBAPI is the only solution that works for MSVC. Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com> Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com> Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev> Reviewers: vtorri, woohyun, jptiz, lucas Reviewed By: vtorri, lucas Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12214
Diffstat (limited to 'src/lib/evas/common/evas_image.h')
-rw-r--r--src/lib/evas/common/evas_image.h86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/lib/evas/common/evas_image.h b/src/lib/evas/common/evas_image.h
index 68f4686d59..c5a512dab6 100644
--- a/src/lib/evas/common/evas_image.h
+++ b/src/lib/evas/common/evas_image.h
@@ -2,62 +2,62 @@
#define _EVAS_IMAGE_H
-EAPI void evas_common_image_init (void);
-EAPI void evas_common_image_shutdown (void);
+EVAS_API void evas_common_image_init (void);
+EVAS_API void evas_common_image_shutdown (void);
-EAPI void evas_common_image_image_all_unload (void);
+EVAS_API void evas_common_image_image_all_unload (void);
-EAPI void evas_common_rgba_pending_unloads_cleanup (void);
-EAPI void evas_common_rgba_pending_unloads_remove (Image_Entry *ie);
+EVAS_API void evas_common_rgba_pending_unloads_cleanup (void);
+EVAS_API void evas_common_rgba_pending_unloads_remove (Image_Entry *ie);
-EAPI void evas_common_rgba_image_free (Image_Entry *ie);
-EAPI void evas_common_rgba_image_unload (Image_Entry *ie);
-EAPI void evas_common_image_colorspace_normalize (RGBA_Image *im);
-EAPI void evas_common_image_colorspace_dirty (RGBA_Image *im);
-EAPI void evas_common_image_cache_free (void); /*2*/
-EAPI void evas_common_image_premul (Image_Entry *ie); /*2*/
-EAPI void evas_common_image_set_alpha_sparse (Image_Entry *ie); /*2*/
-/* EAPI RGBA_Image *evas_common_image_alpha_create (int w, int h); */
-/* EAPI RGBA_Image *evas_common_image_create (int w, int h); */
-EAPI RGBA_Image *evas_common_image_new (unsigned int w, unsigned int h, unsigned int alpha);
-EAPI Evas_Cache_Image *evas_common_image_cache_get (void);
+EVAS_API void evas_common_rgba_image_free (Image_Entry *ie);
+EVAS_API void evas_common_rgba_image_unload (Image_Entry *ie);
+EVAS_API void evas_common_image_colorspace_normalize (RGBA_Image *im);
+EVAS_API void evas_common_image_colorspace_dirty (RGBA_Image *im);
+EVAS_API void evas_common_image_cache_free (void); /*2*/
+EVAS_API void evas_common_image_premul (Image_Entry *ie); /*2*/
+EVAS_API void evas_common_image_set_alpha_sparse (Image_Entry *ie); /*2*/
+/* EVAS_API RGBA_Image *evas_common_image_alpha_create (int w, int h); */
+/* EVAS_API RGBA_Image *evas_common_image_create (int w, int h); */
+EVAS_API RGBA_Image *evas_common_image_new (unsigned int w, unsigned int h, unsigned int alpha);
+EVAS_API Evas_Cache_Image *evas_common_image_cache_get (void);
-EAPI void evas_common_image_set_cache (unsigned int size);
-EAPI int evas_common_image_get_cache (void);
+EVAS_API void evas_common_image_set_cache (unsigned int size);
+EVAS_API int evas_common_image_get_cache (void);
-EAPI RGBA_Image *evas_common_image_line_buffer_obtain (int len);
-EAPI void evas_common_image_line_buffer_release (RGBA_Image *im);
+EVAS_API RGBA_Image *evas_common_image_line_buffer_obtain (int len);
+EVAS_API void evas_common_image_line_buffer_release (RGBA_Image *im);
-EAPI RGBA_Image *evas_common_image_alpha_line_buffer_obtain (int len);
-EAPI void evas_common_image_alpha_line_buffer_release (RGBA_Image *im);
-EAPI void evas_common_image_alpha_line_buffer_free (RGBA_Image *im);
+EVAS_API RGBA_Image *evas_common_image_alpha_line_buffer_obtain (int len);
+EVAS_API void evas_common_image_alpha_line_buffer_release (RGBA_Image *im);
+EVAS_API void evas_common_image_alpha_line_buffer_free (RGBA_Image *im);
-EAPI RGBA_Image *evas_common_load_image_from_file (const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
-EAPI RGBA_Image *evas_common_load_image_from_mmap (Eina_File *f, const char *key, Evas_Image_Load_Opts *lo, int *error);
-EAPI int evas_common_save_image_to_file (RGBA_Image *im, const char *file, const char *key, int quality, int compress, const char *encoding);
+EVAS_API RGBA_Image *evas_common_load_image_from_file (const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
+EVAS_API RGBA_Image *evas_common_load_image_from_mmap (Eina_File *f, const char *key, Evas_Image_Load_Opts *lo, int *error);
+EVAS_API int evas_common_save_image_to_file (RGBA_Image *im, const char *file, const char *key, int quality, int compress, const char *encoding);
-EAPI void evas_common_rgba_image_scalecache_init(Image_Entry *ie);
-EAPI void evas_common_rgba_image_scalecache_shutdown(Image_Entry *ie);
-EAPI void evas_common_rgba_image_scalecache_size_set(unsigned int size);
-EAPI unsigned int evas_common_rgba_image_scalecache_size_get(void);
-EAPI void evas_common_rgba_image_scalecache_flush(void);
-EAPI void evas_common_rgba_image_scalecache_dump(void);
-EAPI void evas_common_rgba_image_scalecache_prune(void);
-EAPI Eina_Bool
+EVAS_API void evas_common_rgba_image_scalecache_init(Image_Entry *ie);
+EVAS_API void evas_common_rgba_image_scalecache_shutdown(Image_Entry *ie);
+EVAS_API void evas_common_rgba_image_scalecache_size_set(unsigned int size);
+EVAS_API unsigned int evas_common_rgba_image_scalecache_size_get(void);
+EVAS_API void evas_common_rgba_image_scalecache_flush(void);
+EVAS_API void evas_common_rgba_image_scalecache_dump(void);
+EVAS_API void evas_common_rgba_image_scalecache_prune(void);
+EVAS_API Eina_Bool
evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst,
RGBA_Draw_Context *dc, int smooth,
int src_region_x, int src_region_y,
int src_region_w, int src_region_h,
int dst_region_x, int dst_region_y,
int dst_region_w, int dst_region_h);
-EAPI void
+EVAS_API void
evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
RGBA_Draw_Context *dc, int smooth,
int src_region_x, int src_region_y,
int src_region_w, int src_region_h,
int dst_region_x, int dst_region_y,
int dst_region_w, int dst_region_h);
-EAPI Eina_Bool
+EVAS_API Eina_Bool
evas_common_rgba_image_scalecache_do_cbs(Image_Entry *ie, RGBA_Image *dst,
RGBA_Draw_Context *dc, int smooth,
int src_region_x, int src_region_y,
@@ -68,15 +68,15 @@ EAPI Eina_Bool
Evas_Common_Scale_In_To_Out_Clip_Cb cb_smooth);
-EAPI int evas_common_load_rgba_image_module_from_file (Image_Entry *im);
-EAPI int evas_common_load_rgba_image_data_from_file (Image_Entry *im);
-EAPI double evas_common_load_rgba_image_frame_duration_from_file(Image_Entry *im, int start_frame, int frame_num);
+EVAS_API int evas_common_load_rgba_image_module_from_file (Image_Entry *im);
+EVAS_API int evas_common_load_rgba_image_data_from_file (Image_Entry *im);
+EVAS_API double evas_common_load_rgba_image_frame_duration_from_file(Image_Entry *im, int start_frame, int frame_num);
void _evas_common_rgba_image_post_surface(Image_Entry *ie);
-EAPI int _evas_common_rgba_image_surface_size(unsigned int w, unsigned int h, Evas_Colorspace cspace, /* inout */ int *l, int *r, int *t, int *b);
-EAPI int _evas_common_rgba_image_data_offset(int rx, int ry, int rw, int rh, int plane, const RGBA_Image *im);
-EAPI Eina_Bool _evas_common_rgba_image_plane_get(const RGBA_Image *im, int plane, Eina_Slice *slice);
+EVAS_API int _evas_common_rgba_image_surface_size(unsigned int w, unsigned int h, Evas_Colorspace cspace, /* inout */ int *l, int *r, int *t, int *b);
+EVAS_API int _evas_common_rgba_image_data_offset(int rx, int ry, int rw, int rh, int plane, const RGBA_Image *im);
+EVAS_API Eina_Bool _evas_common_rgba_image_plane_get(const RGBA_Image *im, int plane, Eina_Slice *slice);
-EAPI Eina_Bool evas_common_extension_can_load_get(const char *file);
+EVAS_API Eina_Bool evas_common_extension_can_load_get(const char *file);
#endif /* _EVAS_IMAGE_H */