1 #ifndef _ECORE_SDL_H
2 #define _ECORE_SDL_H
3 
4 #ifdef EAPI
5 # undef EAPI
6 #endif
7 
8 #ifdef _WIN32
9 # ifdef EFL_BUILD
10 #  ifdef DLL_EXPORT
11 #   define EAPI __declspec(dllexport)
12 #  else
13 #   define EAPI
14 #  endif
15 # else
16 #  define EAPI __declspec(dllimport)
17 # endif
18 #else
19 # ifdef __GNUC__
20 #  if __GNUC__ >= 4
21 #   define EAPI __attribute__ ((visibility("default")))
22 #  else
23 #   define EAPI
24 #  endif
25 # else
26 #  define EAPI
27 # endif
28 #endif
29 
30 /**
31  * @file
32  * @brief Ecore SDL system functions.
33  */
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 EAPI extern int ECORE_SDL_EVENT_GOT_FOCUS;
40 EAPI extern int ECORE_SDL_EVENT_LOST_FOCUS;
41 EAPI extern int ECORE_SDL_EVENT_RESIZE;
42 EAPI extern int ECORE_SDL_EVENT_EXPOSE;
43 
44 typedef struct _Ecore_Sdl_Event_Video_Resize Ecore_Sdl_Event_Video_Resize;
45 struct _Ecore_Sdl_Event_Video_Resize
46 {
47    unsigned int    windowID;
48    int             w;
49    int             h;
50 };
51 
52 typedef struct _Ecore_Sdl_Event_Window Ecore_Sdl_Event_Window;
53 struct _Ecore_Sdl_Event_Window
54 {
55    unsigned int    windowID;
56 };
57 
58 EAPI int        ecore_sdl_init(const char *name);
59 EAPI int        ecore_sdl_shutdown(void);
60 EAPI void       ecore_sdl_feed_events(void);
61 
62   /* The following data structure have been deprecated since a long time */
63 
64 typedef struct _Ecore_Sdl_Event_Key_Down Ecore_Sdl_Event_Key_Down;
65 struct _Ecore_Sdl_Event_Key_Down /** SDL Key Down event */
66 {
67    const char      *keyname; /**< The name of the key that was pressed */
68    const char      *keycompose; /**< The UTF-8 string conversion if any */
69    unsigned int    time;
70 };
71 
72 typedef struct _Ecore_Sdl_Event_Key_Up Ecore_Sdl_Event_Key_Up;
73 struct _Ecore_Sdl_Event_Key_Up /** SDL Key Up event */
74 {
75    const char      *keyname; /**< The name of the key that was released */
76    const char      *keycompose; /**< The UTF-8 string conversion if any */
77    unsigned int    time;
78 };
79 
80 typedef struct _Ecore_Sdl_Event_Mouse_Button_Down Ecore_Sdl_Event_Mouse_Button_Down;
81 struct _Ecore_Sdl_Event_Mouse_Button_Down /** SDL Mouse Down event */
82 {
83    int             button; /**< Mouse button that was pressed (1 - 32) */
84    int             x; /**< Mouse co-ordinates when mouse button was pressed */
85    int             y; /**< Mouse co-ordinates when mouse button was pressed */
86    int             double_click : 1; /**< Set if click was a double click */
87    int             triple_click : 1; /**< Set if click was a triple click  */
88    unsigned int    time;
89 };
90 
91 typedef struct _Ecore_Sdl_Event_Mouse_Button_Up Ecore_Sdl_Event_Mouse_Button_Up;
92 struct _Ecore_Sdl_Event_Mouse_Button_Up /** SDL Mouse Up event */
93 {
94    int             button; /**< Mouse button that was released (1 - 32) */
95    int             x; /**< Mouse co-ordinates when mouse button was raised */
96    int             y; /**< Mouse co-ordinates when mouse button was raised */
97    int             double_click : 1; /**< Set if click was a double click */
98    int             triple_click : 1; /**< Set if click was a triple click  */
99    unsigned int    time;
100 };
101 
102 typedef struct _Ecore_Sdl_Event_Mouse_Move Ecore_Sdl_Event_Mouse_Move;
103 struct _Ecore_Sdl_Event_Mouse_Move /** SDL Mouse Move event */
104 {
105    int             x; /**< Mouse co-ordinates where the mouse cursor moved to */
106    int             y; /**< Mouse co-ordinates where the mouse cursor moved to */
107    unsigned int    time;
108 };
109 
110 typedef struct _Ecore_Sdl_Event_Mouse_Wheel Ecore_Sdl_Event_Mouse_Wheel;
111 struct _Ecore_Sdl_Event_Mouse_Wheel /** SDL Mouse Wheel event */
112 {
113    int             x,y;
114    int             direction; /* 0 = vertical, 1 = horizontal */
115    int             wheel; /* value 1 (left/up), -1 (right/down) */
116    unsigned int    time;
117 };
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #undef EAPI
124 #define EAPI
125 
126 #endif
127