summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertise.dev>2020-10-24 09:01:36 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-12-14 13:22:33 -0300
commit21674baf68b2bb719a20d6827e69a1d56970308c (patch)
treed874f45f2824aafd02801c85a3a545c0717542f4
parent1dba2f717ac6671c121df6c021e0e1ea9f01b42c (diff)
downloadefl-21674baf68b2bb719a20d6827e69a1d56970308c.tar.gz
ecore_win32: Rename EAPI macro to ECORE_WIN32_API in Ecore Win32 library
Patch 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 EAPI is the only solution that worked for MSVC. Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com> Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev> Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>
-rw-r--r--src/lib/ecore_win32/Ecore_Win32.h166
-rw-r--r--src/lib/ecore_win32/ecore_win32.c12
-rw-r--r--src/lib/ecore_win32/ecore_win32_api.h34
-rw-r--r--src/lib/ecore_win32/ecore_win32_clipboard.c6
-rw-r--r--src/lib/ecore_win32/ecore_win32_cursor.c12
-rw-r--r--src/lib/ecore_win32/ecore_win32_dnd.c10
-rw-r--r--src/lib/ecore_win32/ecore_win32_monitor.c2
-rw-r--r--src/lib/ecore_win32/ecore_win32_window.c64
-rw-r--r--src/lib/ecore_win32/meson.build2
9 files changed, 157 insertions, 151 deletions
diff --git a/src/lib/ecore_win32/Ecore_Win32.h b/src/lib/ecore_win32/Ecore_Win32.h
index b83f8dae54..78b8d6ac07 100644
--- a/src/lib/ecore_win32/Ecore_Win32.h
+++ b/src/lib/ecore_win32/Ecore_Win32.h
@@ -20,32 +20,7 @@
#include <Eina.h>
-#ifdef EAPI
-# undef EAPI
-#endif
-
-#ifdef _WIN32
-# ifdef EFL_BUILD
-# ifdef DLL_EXPORT
-# define EAPI __declspec(dllexport)
-# else
-# define EAPI
-# endif
-# else
-# define EAPI __declspec(dllimport)
-# endif
-#else
-# ifdef __GNUC__
-# if __GNUC__ >= 4
-# define EAPI __attribute__ ((visibility("default")))
-# else
-# define EAPI
-# endif
-# else
-# define EAPI
-# endif
-#endif
-
+#include <ecore_win32_api.h>
#ifdef __cplusplus
extern "C" {
@@ -504,176 +479,176 @@ struct _Ecore_Win32_Event_Selection_Notify
*/
typedef int (*Ecore_Win32_Dnd_DropTarget_Callback)(void *window, int event, int pt_x, int pt_y, void *data, int size);
-EAPI extern int ECORE_WIN32_EVENT_MOUSE_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_In event */
-EAPI extern int ECORE_WIN32_EVENT_MOUSE_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_Out event */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_In event */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_Out event */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_DAMAGE; /**< Ecore_Event for the Ecore_Win32_Event_Damage event */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_CREATE; /**< Ecore_Event for the Ecore_Win32_Event_Create event */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_DESTROY; /**< Ecore_Event for the Ecore_Win32_Event_Destroy event */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_HIDE; /**< Ecore_Event for the Ecore_Win32_Event_Hide event */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_SHOW; /**< Ecore_Event for the Ecore_Win32_Event_Show event */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_CONFIGURE; /**< Ecore_Event for the Ecore_Win32_Event_Configure event */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_RESIZE; /**< Ecore_Event for the Ecore_Win32_Event_Resize event */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_PROPERTY; /**< Ecore_Event for the Ecore_Win32_Event_Property event @since 1.20 */
-EAPI extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Delete_Request event */
-EAPI extern int ECORE_WIN32_EVENT_SELECTION_CLEAR; /**< Ecore_Event for the #Ecore_Win32_Event_Selection_Clear event @since 1.16 */
-EAPI extern int ECORE_WIN32_EVENT_SELECTION_NOTIFY; /**< Ecore_Event for the #Ecore_Win32_Event_Selection_Notify event @since 1.16 */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_MOUSE_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_In event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_MOUSE_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Mouse_Out event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_IN; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_In event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_FOCUS_OUT; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Focus_Out event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_DAMAGE; /**< Ecore_Event for the Ecore_Win32_Event_Damage event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_CREATE; /**< Ecore_Event for the Ecore_Win32_Event_Create event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_DESTROY; /**< Ecore_Event for the Ecore_Win32_Event_Destroy event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_HIDE; /**< Ecore_Event for the Ecore_Win32_Event_Hide event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_SHOW; /**< Ecore_Event for the Ecore_Win32_Event_Show event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_CONFIGURE; /**< Ecore_Event for the Ecore_Win32_Event_Configure event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_RESIZE; /**< Ecore_Event for the Ecore_Win32_Event_Resize event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_PROPERTY; /**< Ecore_Event for the Ecore_Win32_Event_Property event @since 1.20 */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_WINDOW_DELETE_REQUEST; /**< Ecore_Event for the #Ecore_Win32_Event_Window_Delete_Request event */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_SELECTION_CLEAR; /**< Ecore_Event for the #Ecore_Win32_Event_Selection_Clear event @since 1.16 */
+ECORE_WIN32_API extern int ECORE_WIN32_EVENT_SELECTION_NOTIFY; /**< Ecore_Event for the #Ecore_Win32_Event_Selection_Notify event @since 1.16 */
/* Core */
-EAPI int ecore_win32_init();
-EAPI int ecore_win32_shutdown();
-EAPI int ecore_win32_screen_depth_get();
-EAPI void ecore_win32_double_click_time_set(double t);
-EAPI double ecore_win32_double_click_time_get(void);
-EAPI unsigned long ecore_win32_current_time_get(void);
+ECORE_WIN32_API int ecore_win32_init();
+ECORE_WIN32_API int ecore_win32_shutdown();
+ECORE_WIN32_API int ecore_win32_screen_depth_get();
+ECORE_WIN32_API void ecore_win32_double_click_time_set(double t);
+ECORE_WIN32_API double ecore_win32_double_click_time_get(void);
+ECORE_WIN32_API unsigned long ecore_win32_current_time_get(void);
/* Window */
-EAPI Ecore_Win32_Window *ecore_win32_window_new(Ecore_Win32_Window *parent,
+ECORE_WIN32_API Ecore_Win32_Window *ecore_win32_window_new(Ecore_Win32_Window *parent,
int x,
int y,
int width,
int height);
-EAPI Ecore_Win32_Window *ecore_win32_window_override_new(Ecore_Win32_Window *parent,
+ECORE_WIN32_API Ecore_Win32_Window *ecore_win32_window_override_new(Ecore_Win32_Window *parent,
int x,
int y,
int width,
int height);
-EAPI void ecore_win32_window_free(Ecore_Win32_Window *window);
+ECORE_WIN32_API void ecore_win32_window_free(Ecore_Win32_Window *window);
-EAPI void *ecore_win32_window_hwnd_get(Ecore_Win32_Window *window);
+ECORE_WIN32_API void *ecore_win32_window_hwnd_get(Ecore_Win32_Window *window);
-EAPI void ecore_win32_window_move(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_move(Ecore_Win32_Window *window,
int x,
int y);
-EAPI void ecore_win32_window_resize(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_resize(Ecore_Win32_Window *window,
int width,
int height);
-EAPI void ecore_win32_window_move_resize(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_move_resize(Ecore_Win32_Window *window,
int x,
int y,
int width,
int height);
-EAPI void ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
int *x,
int *y,
int *width,
int *height);
-EAPI void ecore_win32_window_size_get(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_size_get(Ecore_Win32_Window *window,
int *width,
int *height);
-EAPI void ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
int min_width,
int min_height);
-EAPI void ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
int *min_width,
int *min_height);
-EAPI void ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
int max_width,
int max_height);
-EAPI void ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
int *max_width,
int *max_height);
-EAPI void ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
int base_width,
int base_height);
-EAPI void ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
int *base_width,
int *base_height);
-EAPI void ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
int step_width,
int step_height);
-EAPI void ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
int *step_width,
int *step_height);
-EAPI void ecore_win32_window_show(Ecore_Win32_Window *window);
+ECORE_WIN32_API void ecore_win32_window_show(Ecore_Win32_Window *window);
-EAPI void ecore_win32_window_hide(Ecore_Win32_Window *window);
+ECORE_WIN32_API void ecore_win32_window_hide(Ecore_Win32_Window *window);
-EAPI void ecore_win32_window_raise(Ecore_Win32_Window *window);
+ECORE_WIN32_API void ecore_win32_window_raise(Ecore_Win32_Window *window);
-EAPI void ecore_win32_window_lower(Ecore_Win32_Window *window);
+ECORE_WIN32_API void ecore_win32_window_lower(Ecore_Win32_Window *window);
-EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_title_set(Ecore_Win32_Window *window,
const char *title);
-EAPI void ecore_win32_window_focus(Ecore_Win32_Window *window);
+ECORE_WIN32_API void ecore_win32_window_focus(Ecore_Win32_Window *window);
-EAPI void *ecore_win32_window_focus_get(void);
+ECORE_WIN32_API void *ecore_win32_window_focus_get(void);
-EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
Eina_Bool on);
-EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
Eina_Bool on);
-EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
Eina_Bool on);
-EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
Ecore_Win32_Cursor *cursor);
-EAPI void ecore_win32_window_state_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_state_set(Ecore_Win32_Window *window,
Ecore_Win32_Window_State *state,
unsigned int num);
-EAPI void ecore_win32_window_state_get(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_state_get(Ecore_Win32_Window *window,
Ecore_Win32_Window_State **state,
unsigned int *num);
-EAPI void ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
Ecore_Win32_Window_State state,
unsigned int set);
-EAPI void ecore_win32_window_type_set(Ecore_Win32_Window *window,
+ECORE_WIN32_API void ecore_win32_window_type_set(Ecore_Win32_Window *window,
Ecore_Win32_Window_Type type);
/* Cursor */
-EAPI Ecore_Win32_Cursor *ecore_win32_cursor_new(const void *pixels_and,
+ECORE_WIN32_API Ecore_Win32_Cursor *ecore_win32_cursor_new(const void *pixels_and,
const void *pixels_xor,
int width,
int height,
int hot_x,
int hot_y);
-EAPI void ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
+ECORE_WIN32_API void ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor);
-EAPI Ecore_Win32_Cursor *ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape);
+ECORE_WIN32_API Ecore_Win32_Cursor *ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape);
-EAPI const Ecore_Win32_Cursor *ecore_win32_cursor_x11_shaped_get(Ecore_Win32_Cursor_X11_Shape shape);
+ECORE_WIN32_API const Ecore_Win32_Cursor *ecore_win32_cursor_x11_shaped_get(Ecore_Win32_Cursor_X11_Shape shape);
-EAPI void ecore_win32_cursor_size_get(int *width, int *height);
+ECORE_WIN32_API void ecore_win32_cursor_size_get(int *width, int *height);
-EAPI void ecore_win32_cursor_show(Eina_Bool show);
+ECORE_WIN32_API void ecore_win32_cursor_show(Eina_Bool show);
/* Drag and drop */
-EAPI int ecore_win32_dnd_init();
-EAPI int ecore_win32_dnd_shutdown();
-EAPI Eina_Bool ecore_win32_dnd_begin(const char *data,
+ECORE_WIN32_API int ecore_win32_dnd_init();
+ECORE_WIN32_API int ecore_win32_dnd_shutdown();
+ECORE_WIN32_API Eina_Bool ecore_win32_dnd_begin(const char *data,
int size);
-EAPI Eina_Bool ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
+ECORE_WIN32_API Eina_Bool ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
Ecore_Win32_Dnd_DropTarget_Callback callback);
-EAPI void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window);
+ECORE_WIN32_API void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window);
/* Clipboard */
@@ -693,7 +668,7 @@ EAPI void ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window
*
* @since 1.24
*/
-EAPI Eina_Bool ecore_win32_clipboard_set(const Ecore_Win32_Window *window,
+ECORE_WIN32_API Eina_Bool ecore_win32_clipboard_set(const Ecore_Win32_Window *window,
const void *data,
size_t size,
const char *mime_type);
@@ -711,7 +686,7 @@ EAPI Eina_Bool ecore_win32_clipboard_set(const Ecore_Win32_Window *window,
*
* @since 1.24
*/
-EAPI void * ecore_win32_clipboard_get(const Ecore_Win32_Window *window,
+ECORE_WIN32_API void * ecore_win32_clipboard_get(const Ecore_Win32_Window *window,
size_t *size,
const char *mime_type);
@@ -726,7 +701,7 @@ EAPI void * ecore_win32_clipboard_get(const Ecore_Win32_Window *window,
*
* @since 1.24
*/
-EAPI void ecore_win32_clipboard_clear(const Ecore_Win32_Window *window);
+ECORE_WIN32_API void ecore_win32_clipboard_clear(const Ecore_Win32_Window *window);
/**
* @typedef Ecore_Win32_Monitor
@@ -755,7 +730,7 @@ typedef struct
*
* @since 1.20
*/
-EAPI Eina_Iterator *ecore_win32_monitors_get(void);
+ECORE_WIN32_API Eina_Iterator *ecore_win32_monitors_get(void);
/**
* @}
@@ -765,7 +740,4 @@ EAPI Eina_Iterator *ecore_win32_monitors_get(void);
}
#endif
-#undef EAPI
-#define EAPI
-
#endif /* __ECORE_WIN32_H__ */
diff --git a/src/lib/ecore_win32/ecore_win32.c b/src/lib/ecore_win32/ecore_win32.c
index 1ee8b2fbdf..b5cbf7c6e9 100644
--- a/src/lib/ecore_win32/ecore_win32.c
+++ b/src/lib/ecore_win32/ecore_win32.c
@@ -470,7 +470,7 @@ int ECORE_WIN32_EVENT_SELECTION_NOTIFY = 0;
* When Ecore_Win32 is not used anymore, call ecore_win32_shutdown()
* to shut down the Ecore_Win32 library.
*/
-EAPI int
+ECORE_WIN32_API int
ecore_win32_init()
{
WNDCLASSEX wc;
@@ -595,7 +595,7 @@ ecore_win32_init()
* been called the same number of times than ecore_win32_init(). In that case
* it shuts down all the Windows graphic system.
*/
-EAPI int
+ECORE_WIN32_API int
ecore_win32_shutdown()
{
int i;
@@ -650,7 +650,7 @@ ecore_win32_shutdown()
* This function returns the depth of the screen. If an error occurs,
* it returns 0.
*/
-EAPI int
+ECORE_WIN32_API int
ecore_win32_screen_depth_get()
{
HDC dc;
@@ -683,7 +683,7 @@ ecore_win32_screen_depth_get()
* double_click flag is set in a button down event. If 3 clicks occur
* within double this time, the triple_click flag is also set.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_double_click_time_set(double t)
{
if (t < 0.0) t = 0.0;
@@ -700,7 +700,7 @@ ecore_win32_double_click_time_set(double t)
* default value is returned. See ecore_win32_double_click_time_set()
* for more informations.
*/
-EAPI double
+ECORE_WIN32_API double
ecore_win32_double_click_time_get(void)
{
return _ecore_win32_double_click_time;
@@ -713,7 +713,7 @@ ecore_win32_double_click_time_get(void)
*
* This function returns the last event time.
*/
-EAPI unsigned long
+ECORE_WIN32_API unsigned long
ecore_win32_current_time_get(void)
{
return _ecore_win32_event_last_time;
diff --git a/src/lib/ecore_win32/ecore_win32_api.h b/src/lib/ecore_win32/ecore_win32_api.h
new file mode 100644
index 0000000000..1540131361
--- /dev/null
+++ b/src/lib/ecore_win32/ecore_win32_api.h
@@ -0,0 +1,34 @@
+#ifndef _EFL_ECORE_WIN32_API_H
+#define _EFL_ECORE_WIN32_API_H
+
+#ifdef ECORE_WIN32_API
+#error ECORE_WIN32_API should not be already defined
+#endif
+
+#ifdef _WIN32
+# ifndef ECORE_WIN32_STATIC
+# ifdef ECORE_WIN32_BUILD
+# define ECORE_WIN32_API __declspec(dllexport)
+# else
+# define ECORE_WIN32_API __declspec(dllimport)
+# endif
+# else
+# define ECORE_WIN32_API
+# endif
+# define ECORE_WIN32_API_WEAK
+#else
+# ifdef __GNUC__
+# if __GNUC__ >= 4
+# define ECORE_WIN32_API __attribute__ ((visibility("default")))
+# define ECORE_WIN32_API_WEAK __attribute__ ((weak))
+# else
+# define ECORE_WIN32_API
+# define ECORE_WIN32_API_WEAK
+# endif
+# else
+# define ECORE_WIN32_API
+# define ECORE_WIN32_API_WEAK
+# endif
+#endif
+
+#endif
diff --git a/src/lib/ecore_win32/ecore_win32_clipboard.c b/src/lib/ecore_win32/ecore_win32_clipboard.c
index da4960370a..abe5141929 100644
--- a/src/lib/ecore_win32/ecore_win32_clipboard.c
+++ b/src/lib/ecore_win32/ecore_win32_clipboard.c
@@ -37,7 +37,7 @@
*============================================================================*/
-EAPI Eina_Bool
+ECORE_WIN32_API Eina_Bool
ecore_win32_clipboard_set(const Ecore_Win32_Window *window,
const void *data,
size_t size,
@@ -121,7 +121,7 @@ ecore_win32_clipboard_set(const Ecore_Win32_Window *window,
return res;
}
-EAPI void *
+ECORE_WIN32_API void *
ecore_win32_clipboard_get(const Ecore_Win32_Window *window,
size_t *size,
const char *mime_type)
@@ -225,7 +225,7 @@ ecore_win32_clipboard_get(const Ecore_Win32_Window *window,
return NULL;
}
-EAPI void
+ECORE_WIN32_API void
ecore_win32_clipboard_clear(const Ecore_Win32_Window *window)
{
INF("clearing the clipboard");
diff --git a/src/lib/ecore_win32/ecore_win32_cursor.c b/src/lib/ecore_win32/ecore_win32_cursor.c
index 490e4f4ec9..53483858c7 100644
--- a/src/lib/ecore_win32/ecore_win32_cursor.c
+++ b/src/lib/ecore_win32/ecore_win32_cursor.c
@@ -181,7 +181,7 @@ _ecore_win32_cursor_x11_shaped_new(Ecore_Win32_Cursor_X11_Shape shape)
* @see ecore_win32_cursor_free()
* @see ecore_win32_window_cursor_set()
*/
-EAPI Ecore_Win32_Cursor *
+ECORE_WIN32_API Ecore_Win32_Cursor *
ecore_win32_cursor_new(const void *pixels_and,
const void *pixels_xor,
int width,
@@ -226,7 +226,7 @@ ecore_win32_cursor_new(const void *pixels_and,
* @see ecore_win32_cursor_new()
* @see ecore_win32_cursor_x11_shaped_new()
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor)
{
INF("destroying cursor");
@@ -247,7 +247,7 @@ ecore_win32_cursor_free(Ecore_Win32_Cursor *cursor)
* @p shape. This cursor does not need to be freed, as it is loaded
* from an existing resource. On error @c NULL is returned.
*/
-EAPI Ecore_Win32_Cursor *
+ECORE_WIN32_API Ecore_Win32_Cursor *
ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape)
{
Ecore_Win32_Cursor *cursor = NULL;
@@ -324,7 +324,7 @@ ecore_win32_cursor_shaped_new(Ecore_Win32_Cursor_Shape shape)
*
* @since 1.16
*/
-EAPI const Ecore_Win32_Cursor *
+ECORE_WIN32_API const Ecore_Win32_Cursor *
ecore_win32_cursor_x11_shaped_get(Ecore_Win32_Cursor_X11_Shape shape)
{
INF("getting X11 shaped cursor");
@@ -346,7 +346,7 @@ ecore_win32_cursor_x11_shaped_get(Ecore_Win32_Cursor_X11_Shape shape)
* ecore_win32_cursor_new(). @p width and @p height are buffers that
* will be filled with the correct size. They can be @c NULL.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_cursor_size_get(int *width, int *height)
{
INF("geting size cursor");
@@ -355,7 +355,7 @@ ecore_win32_cursor_size_get(int *width, int *height)
if (*height) *height = GetSystemMetrics(SM_CYCURSOR);
}
-EAPI void
+ECORE_WIN32_API void
ecore_win32_cursor_show(Eina_Bool show)
{
INF("show cursor");
diff --git a/src/lib/ecore_win32/ecore_win32_dnd.c b/src/lib/ecore_win32/ecore_win32_dnd.c
index a99d26c524..5a28ea69b8 100644
--- a/src/lib/ecore_win32/ecore_win32_dnd.c
+++ b/src/lib/ecore_win32/ecore_win32_dnd.c
@@ -58,7 +58,7 @@ static HANDLE DataToHandle(const char *data, int size)
* When the Drag and Drop module is not used anymore, call
* ecore_win32_dnd_shutdown() to shut down the module.
*/
-EAPI int
+ECORE_WIN32_API int
ecore_win32_dnd_init()
{
HRESULT res;
@@ -91,7 +91,7 @@ ecore_win32_dnd_init()
* been called the same number of times than ecore_win32_dnd_init(). In that case
* it shut down the module.
*/
-EAPI int
+ECORE_WIN32_API int
ecore_win32_dnd_shutdown()
{
_ecore_win32_dnd_init_count--;
@@ -116,7 +116,7 @@ ecore_win32_dnd_shutdown()
* @c 0, it is set to the length (as strlen()) of @p data. On success the
* function returns @c EINA_TRUE, otherwise it returns @c EINA_FALSE.
*/
-EAPI Eina_Bool
+ECORE_WIN32_API Eina_Bool
ecore_win32_dnd_begin(const char *data,
int size)
{
@@ -187,7 +187,7 @@ ecore_win32_dnd_begin(const char *data,
* the function returns @c EINA_FALSE. On success, it returns @c EINA_TRUE,
* otherwise it returns @c EINA_FALSE.
*/
-EAPI Eina_Bool
+ECORE_WIN32_API Eina_Bool
ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
Ecore_Win32_Dnd_DropTarget_Callback callback)
{
@@ -210,7 +210,7 @@ ecore_win32_dnd_register_drop_target(Ecore_Win32_Window *window,
* This function unregister a Drop operation on @p window. If
* @p window is @c NULL, the function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_dnd_unregister_drop_target(Ecore_Win32_Window *window)
{
Ecore_Win32_Window *wnd = (Ecore_Win32_Window *)window;
diff --git a/src/lib/ecore_win32/ecore_win32_monitor.c b/src/lib/ecore_win32/ecore_win32_monitor.c
index 36d136908e..63ce931095 100644
--- a/src/lib/ecore_win32/ecore_win32_monitor.c
+++ b/src/lib/ecore_win32/ecore_win32_monitor.c
@@ -217,7 +217,7 @@ ecore_win32_monitor_update(int d)
* API *
*============================================================================*/
-EAPI Eina_Iterator *
+ECORE_WIN32_API Eina_Iterator *
ecore_win32_monitors_get(void)
{
return eina_list_iterator_new(ecore_win32_monitors);
diff --git a/src/lib/ecore_win32/ecore_win32_window.c b/src/lib/ecore_win32/ecore_win32_window.c
index 628264d7b3..2378e356d9 100644
--- a/src/lib/ecore_win32/ecore_win32_window.c
+++ b/src/lib/ecore_win32/ecore_win32_window.c
@@ -445,7 +445,7 @@ ecore_win32_window_drag(Ecore_Win32_Window *w, int ptx, int pty)
* title bar). This function returns a newly created window on
* success, and @c NULL on failure.
*/
-EAPI Ecore_Win32_Window *
+ECORE_WIN32_API Ecore_Win32_Window *
ecore_win32_window_new(Ecore_Win32_Window *parent,
int x,
int y,
@@ -473,7 +473,7 @@ ecore_win32_window_new(Ecore_Win32_Window *parent,
* This function is the same than ecore_win32_window_override_new()
* but the returned window is borderless.
*/
-EAPI Ecore_Win32_Window *
+ECORE_WIN32_API Ecore_Win32_Window *
ecore_win32_window_override_new(Ecore_Win32_Window *parent,
int x,
int y,
@@ -496,7 +496,7 @@ ecore_win32_window_override_new(Ecore_Win32_Window *parent,
* This function frees @p window. If @p window is @c NULL, this
* function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_free(Ecore_Win32_Window *window)
{
if (!window) return;
@@ -520,7 +520,7 @@ ecore_win32_window_free(Ecore_Win32_Window *window)
*
* @note The returned value is of type HWND.
*/
-EAPI void *
+ECORE_WIN32_API void *
ecore_win32_window_hwnd_get(Ecore_Win32_Window *window)
{
if (!window) return NULL;
@@ -571,7 +571,7 @@ ecore_win32_window_configure(Ecore_Win32_Window *window,
* and @p y. If @p window is @c NULL, or if it is fullscreen, or on
* error, this function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_move(Ecore_Win32_Window *window,
int x,
int y)
@@ -609,7 +609,7 @@ ecore_win32_window_move(Ecore_Win32_Window *window,
* If @p window is @c NULL, or if it is fullscreen, or on error, this
* function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_resize(Ecore_Win32_Window *window,
int width,
int height)
@@ -673,7 +673,7 @@ ecore_win32_window_resize(Ecore_Win32_Window *window,
* and @p y and the new @p width and @p height. If @p window is @c NULL,
* or if it is fullscreen, or on error, this function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_move_resize(Ecore_Win32_Window *window,
int x,
int y,
@@ -732,7 +732,7 @@ ecore_win32_window_move_resize(Ecore_Win32_Window *window,
* buffers are not @c NULL, they will be filled with respectively 0,
* 0, the size of the screen and the height of the screen.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
int *x,
int *y,
@@ -802,7 +802,7 @@ ecore_win32_window_geometry_get(Ecore_Win32_Window *window,
* @c NULL, they will be filled with respectively the size of the screen
* and the height of the screen.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_size_get(Ecore_Win32_Window *window,
int *width,
int *height)
@@ -842,7 +842,7 @@ ecore_win32_window_size_get(Ecore_Win32_Window *window,
* and *p min_height. If @p window is @c NULL, this functions does
* nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
int min_width,
int min_height)
@@ -878,7 +878,7 @@ ecore_win32_window_size_min_set(Ecore_Win32_Window *window,
* @p min_width and *p min_height. They both can be @c NULL. If
* @p window is @c NULL, this functions does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
int *min_width,
int *min_height)
@@ -907,7 +907,7 @@ ecore_win32_window_size_min_get(Ecore_Win32_Window *window,
* and *p max_height. If @p window is @c NULL, this functions does
* nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
int max_width,
int max_height)
@@ -935,7 +935,7 @@ ecore_win32_window_size_max_set(Ecore_Win32_Window *window,
* @p max_width and *p max_height. They both can be @c NULL. If
* @p window is @c NULL, this functions does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
int *max_width,
int *max_height)
@@ -964,7 +964,7 @@ ecore_win32_window_size_max_get(Ecore_Win32_Window *window,
* and *p base_height. If @p window is @c NULL, this functions does
* nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
int base_width,
int base_height)
@@ -992,7 +992,7 @@ ecore_win32_window_size_base_set(Ecore_Win32_Window *window,
* @p base_width and *p base_height. They both can be @c NULL. If
* @p window is @c NULL, this functions does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
int *base_width,
int *base_height)
@@ -1021,7 +1021,7 @@ ecore_win32_window_size_base_get(Ecore_Win32_Window *window,
* and *p step_height. If @p window is @c NULL, this functions does
* nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
int step_width,
int step_height)
@@ -1049,7 +1049,7 @@ ecore_win32_window_size_step_set(Ecore_Win32_Window *window,
* @p step_width and *p step_height. They both can be @c NULL. If
* @p window is @c NULL, this functions does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
int *step_width,
int *step_height)
@@ -1075,7 +1075,7 @@ ecore_win32_window_size_step_get(Ecore_Win32_Window *window,
* This function shows @p window. If @p window is @c NULL, or on
* error, this function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_show(Ecore_Win32_Window *window)
{
if (!window) return;
@@ -1098,7 +1098,7 @@ ecore_win32_window_show(Ecore_Win32_Window *window)
* This function hides @p window. If @p window is @c NULL, or on
* error, this function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_hide(Ecore_Win32_Window *window)
{
if (!window) return;
@@ -1116,7 +1116,7 @@ ecore_win32_window_hide(Ecore_Win32_Window *window)
* This function places @p window at the top of the Z order. If
* @p window is @c NULL, this function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_raise(Ecore_Win32_Window *window)
{
if (!window) return;
@@ -1139,7 +1139,7 @@ ecore_win32_window_raise(Ecore_Win32_Window *window)
* This function places @p window at the bottom of the Z order. If
* @p window is @c NULL, this function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_lower(Ecore_Win32_Window *window)
{
if (!window) return;
@@ -1164,7 +1164,7 @@ ecore_win32_window_lower(Ecore_Win32_Window *window)
* is @c NULL, or if @p title is @c NULL or empty, or on error, this
* function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_title_set(Ecore_Win32_Window *window,
const char *title)
{
@@ -1188,7 +1188,7 @@ ecore_win32_window_title_set(Ecore_Win32_Window *window,
* This function gives the focus to @p window. If @p window is
* @c NULL, this function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_focus(Ecore_Win32_Window *window)
{
if (!window) return;
@@ -1215,7 +1215,7 @@ ecore_win32_window_focus(Ecore_Win32_Window *window)
*
* @note The returned value is of type HWND.
*/
-EAPI void *
+ECORE_WIN32_API void *
ecore_win32_window_focus_get(void)
{
HWND focused;
@@ -1244,7 +1244,7 @@ ecore_win32_window_focus_get(void)
* (like iconifying the window while it is already iconified), this function
* does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
Eina_Bool on)
{
@@ -1272,7 +1272,7 @@ ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
* change (like setting to borderless while the window has no border), this
* function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
Eina_Bool on)
{
@@ -1348,7 +1348,7 @@ ecore_win32_window_borderless_set(Ecore_Win32_Window *window,
* does not change (like setting to fullscreen while the window is already
* fullscreen), this function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
Eina_Bool on)
{
@@ -1447,7 +1447,7 @@ ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
* @see ecore_win32_cursor_shaped_new()
* @see ecore_win32_cursor_x11_shaped_new()
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
Ecore_Win32_Cursor *cursor)
{
@@ -1470,7 +1470,7 @@ ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
* states of size @p num. If @p window or @p state are @c NULL, or if
* @p num is less or equal than 0, the function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_state_set(Ecore_Win32_Window *window,
Ecore_Win32_Window_State *state,
unsigned int num)
@@ -1543,7 +1543,7 @@ ecore_win32_window_state_set(Ecore_Win32_Window *window,
*
* @since 1.20
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_state_get(Ecore_Win32_Window *window,
Ecore_Win32_Window_State **state,
unsigned int *num)
@@ -1634,7 +1634,7 @@ ecore_win32_window_state_get(Ecore_Win32_Window *window,
* #ECORE_WIN32_WINDOW_STATE_FULLSCREEN. If @p window is @c NULL, the
* function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
Ecore_Win32_Window_State state,
unsigned int set)
@@ -1775,7 +1775,7 @@ ecore_win32_window_state_request_send(Ecore_Win32_Window *window,
* This function sets the type of @p window to @p type. If
* @p window is @c NULL, the function does nothing.
*/
-EAPI void
+ECORE_WIN32_API void
ecore_win32_window_type_set(Ecore_Win32_Window *window,
Ecore_Win32_Window_Type type)
{
diff --git a/src/lib/ecore_win32/meson.build b/src/lib/ecore_win32/meson.build
index b105dbae91..7130d28b1d 100644
--- a/src/lib/ecore_win32/meson.build
+++ b/src/lib/ecore_win32/meson.build
@@ -31,7 +31,7 @@ if sys_windows == true
dependencies: [ecore_win32_deps, ecore_win32_pub_deps, ecore_win32_ext_deps],
include_directories : config_dir,
install: true,
- c_args : package_c_args,
+ c_args : [package_c_args, '-DECORE_WIN32_BUILD'],
)
ecore_win32 = declare_dependency(