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)
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 @@
2#define _EVAS_IMAGE_H 2#define _EVAS_IMAGE_H
3 3
4 4
5EAPI void evas_common_image_init (void); 5EVAS_API void evas_common_image_init (void);
6EAPI void evas_common_image_shutdown (void); 6EVAS_API void evas_common_image_shutdown (void);
7 7
8EAPI void evas_common_image_image_all_unload (void); 8EVAS_API void evas_common_image_image_all_unload (void);
9 9
10EAPI void evas_common_rgba_pending_unloads_cleanup (void); 10EVAS_API void evas_common_rgba_pending_unloads_cleanup (void);
11EAPI void evas_common_rgba_pending_unloads_remove (Image_Entry *ie); 11EVAS_API void evas_common_rgba_pending_unloads_remove (Image_Entry *ie);
12 12
13EAPI void evas_common_rgba_image_free (Image_Entry *ie); 13EVAS_API void evas_common_rgba_image_free (Image_Entry *ie);
14EAPI void evas_common_rgba_image_unload (Image_Entry *ie); 14EVAS_API void evas_common_rgba_image_unload (Image_Entry *ie);
15EAPI void evas_common_image_colorspace_normalize (RGBA_Image *im); 15EVAS_API void evas_common_image_colorspace_normalize (RGBA_Image *im);
16EAPI void evas_common_image_colorspace_dirty (RGBA_Image *im); 16EVAS_API void evas_common_image_colorspace_dirty (RGBA_Image *im);
17EAPI void evas_common_image_cache_free (void); /*2*/ 17EVAS_API void evas_common_image_cache_free (void); /*2*/
18EAPI void evas_common_image_premul (Image_Entry *ie); /*2*/ 18EVAS_API void evas_common_image_premul (Image_Entry *ie); /*2*/
19EAPI void evas_common_image_set_alpha_sparse (Image_Entry *ie); /*2*/ 19EVAS_API void evas_common_image_set_alpha_sparse (Image_Entry *ie); /*2*/
20/* EAPI RGBA_Image *evas_common_image_alpha_create (int w, int h); */ 20/* EVAS_API RGBA_Image *evas_common_image_alpha_create (int w, int h); */
21/* EAPI RGBA_Image *evas_common_image_create (int w, int h); */ 21/* EVAS_API RGBA_Image *evas_common_image_create (int w, int h); */
22EAPI RGBA_Image *evas_common_image_new (unsigned int w, unsigned int h, unsigned int alpha); 22EVAS_API RGBA_Image *evas_common_image_new (unsigned int w, unsigned int h, unsigned int alpha);
23EAPI Evas_Cache_Image *evas_common_image_cache_get (void); 23EVAS_API Evas_Cache_Image *evas_common_image_cache_get (void);
24 24
25EAPI void evas_common_image_set_cache (unsigned int size); 25EVAS_API void evas_common_image_set_cache (unsigned int size);
26EAPI int evas_common_image_get_cache (void); 26EVAS_API int evas_common_image_get_cache (void);
27 27
28EAPI RGBA_Image *evas_common_image_line_buffer_obtain (int len); 28EVAS_API RGBA_Image *evas_common_image_line_buffer_obtain (int len);
29EAPI void evas_common_image_line_buffer_release (RGBA_Image *im); 29EVAS_API void evas_common_image_line_buffer_release (RGBA_Image *im);
30 30
31EAPI RGBA_Image *evas_common_image_alpha_line_buffer_obtain (int len); 31EVAS_API RGBA_Image *evas_common_image_alpha_line_buffer_obtain (int len);
32EAPI void evas_common_image_alpha_line_buffer_release (RGBA_Image *im); 32EVAS_API void evas_common_image_alpha_line_buffer_release (RGBA_Image *im);
33EAPI void evas_common_image_alpha_line_buffer_free (RGBA_Image *im); 33EVAS_API void evas_common_image_alpha_line_buffer_free (RGBA_Image *im);
34 34
35EAPI RGBA_Image *evas_common_load_image_from_file (const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error); 35EVAS_API RGBA_Image *evas_common_load_image_from_file (const char *file, const char *key, Evas_Image_Load_Opts *lo, int *error);
36EAPI RGBA_Image *evas_common_load_image_from_mmap (Eina_File *f, const char *key, Evas_Image_Load_Opts *lo, int *error); 36EVAS_API RGBA_Image *evas_common_load_image_from_mmap (Eina_File *f, const char *key, Evas_Image_Load_Opts *lo, int *error);
37EAPI int evas_common_save_image_to_file (RGBA_Image *im, const char *file, const char *key, int quality, int compress, const char *encoding); 37EVAS_API int evas_common_save_image_to_file (RGBA_Image *im, const char *file, const char *key, int quality, int compress, const char *encoding);
38 38
39EAPI void evas_common_rgba_image_scalecache_init(Image_Entry *ie); 39EVAS_API void evas_common_rgba_image_scalecache_init(Image_Entry *ie);
40EAPI void evas_common_rgba_image_scalecache_shutdown(Image_Entry *ie); 40EVAS_API void evas_common_rgba_image_scalecache_shutdown(Image_Entry *ie);
41EAPI void evas_common_rgba_image_scalecache_size_set(unsigned int size); 41EVAS_API void evas_common_rgba_image_scalecache_size_set(unsigned int size);
42EAPI unsigned int evas_common_rgba_image_scalecache_size_get(void); 42EVAS_API unsigned int evas_common_rgba_image_scalecache_size_get(void);
43EAPI void evas_common_rgba_image_scalecache_flush(void); 43EVAS_API void evas_common_rgba_image_scalecache_flush(void);
44EAPI void evas_common_rgba_image_scalecache_dump(void); 44EVAS_API void evas_common_rgba_image_scalecache_dump(void);
45EAPI void evas_common_rgba_image_scalecache_prune(void); 45EVAS_API void evas_common_rgba_image_scalecache_prune(void);
46EAPI Eina_Bool 46EVAS_API Eina_Bool
47 evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst, 47 evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst,
48 RGBA_Draw_Context *dc, int smooth, 48 RGBA_Draw_Context *dc, int smooth,
49 int src_region_x, int src_region_y, 49 int src_region_x, int src_region_y,
50 int src_region_w, int src_region_h, 50 int src_region_w, int src_region_h,
51 int dst_region_x, int dst_region_y, 51 int dst_region_x, int dst_region_y,
52 int dst_region_w, int dst_region_h); 52 int dst_region_w, int dst_region_h);
53EAPI void 53EVAS_API void
54 evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst, 54 evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
55 RGBA_Draw_Context *dc, int smooth, 55 RGBA_Draw_Context *dc, int smooth,
56 int src_region_x, int src_region_y, 56 int src_region_x, int src_region_y,
57 int src_region_w, int src_region_h, 57 int src_region_w, int src_region_h,
58 int dst_region_x, int dst_region_y, 58 int dst_region_x, int dst_region_y,
59 int dst_region_w, int dst_region_h); 59 int dst_region_w, int dst_region_h);
60EAPI Eina_Bool 60EVAS_API Eina_Bool
61 evas_common_rgba_image_scalecache_do_cbs(Image_Entry *ie, RGBA_Image *dst, 61 evas_common_rgba_image_scalecache_do_cbs(Image_Entry *ie, RGBA_Image *dst,
62 RGBA_Draw_Context *dc, int smooth, 62 RGBA_Draw_Context *dc, int smooth,
63 int src_region_x, int src_region_y, 63 int src_region_x, int src_region_y,
@@ -68,15 +68,15 @@ EAPI Eina_Bool
68 Evas_Common_Scale_In_To_Out_Clip_Cb cb_smooth); 68 Evas_Common_Scale_In_To_Out_Clip_Cb cb_smooth);
69 69
70 70
71EAPI int evas_common_load_rgba_image_module_from_file (Image_Entry *im); 71EVAS_API int evas_common_load_rgba_image_module_from_file (Image_Entry *im);
72EAPI int evas_common_load_rgba_image_data_from_file (Image_Entry *im); 72EVAS_API int evas_common_load_rgba_image_data_from_file (Image_Entry *im);
73EAPI double evas_common_load_rgba_image_frame_duration_from_file(Image_Entry *im, int start_frame, int frame_num); 73EVAS_API double evas_common_load_rgba_image_frame_duration_from_file(Image_Entry *im, int start_frame, int frame_num);
74 74
75void _evas_common_rgba_image_post_surface(Image_Entry *ie); 75void _evas_common_rgba_image_post_surface(Image_Entry *ie);
76EAPI 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); 76EVAS_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);
77EAPI int _evas_common_rgba_image_data_offset(int rx, int ry, int rw, int rh, int plane, const RGBA_Image *im); 77EVAS_API int _evas_common_rgba_image_data_offset(int rx, int ry, int rw, int rh, int plane, const RGBA_Image *im);
78EAPI Eina_Bool _evas_common_rgba_image_plane_get(const RGBA_Image *im, int plane, Eina_Slice *slice); 78EVAS_API Eina_Bool _evas_common_rgba_image_plane_get(const RGBA_Image *im, int plane, Eina_Slice *slice);
79 79
80EAPI Eina_Bool evas_common_extension_can_load_get(const char *file); 80EVAS_API Eina_Bool evas_common_extension_can_load_get(const char *file);
81 81
82#endif /* _EVAS_IMAGE_H */ 82#endif /* _EVAS_IMAGE_H */