[ecore] merged svn latest code (svn54830)
[profile/ivi/ecore.git] / src / lib / ecore_sdl / Ecore_Sdl.h
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_ECORE_SDL_BUILD
10 #  ifdef DLL_EXPORT
11 #   define EAPI __declspec(dllexport)
12 #  else
13 #   define EAPI
14 #  endif /* ! DLL_EXPORT */
15 # else
16 #  define EAPI __declspec(dllimport)
17 # endif /* ! EFL_ECORE_SDL_BUILD */
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 /* ! _WIN32 */
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_KEY_DOWN; /**< SDL Key Down event */
40 EAPI extern int ECORE_SDL_EVENT_KEY_UP; /**< SDL Key Up event */
41 EAPI extern int ECORE_SDL_EVENT_MOUSE_BUTTON_DOWN; /**< SDL Mouse Down event */
42 EAPI extern int ECORE_SDL_EVENT_MOUSE_BUTTON_UP; /**< SDL Mouse Up event */
43 EAPI extern int ECORE_SDL_EVENT_MOUSE_MOVE; /**< SDL Mouse Move event */
44 EAPI extern int ECORE_SDL_EVENT_MOUSE_WHEEL; /**< SDL Mouse Wheel event */
45 EAPI extern int ECORE_SDL_EVENT_GOT_FOCUS; /**< SDL Mouse Wheel event */
46 EAPI extern int ECORE_SDL_EVENT_LOST_FOCUS; /**< SDL Mouse Wheel event */
47 EAPI extern int ECORE_SDL_EVENT_RESIZE;
48 EAPI extern int ECORE_SDL_EVENT_EXPOSE;
49
50 typedef struct _Ecore_Sdl_Event_Key_Down Ecore_Sdl_Event_Key_Down;
51 struct _Ecore_Sdl_Event_Key_Down /** SDL Key Down event */
52 {
53    const char      *keyname; /**< The name of the key that was pressed */
54    const char      *keycompose; /**< The UTF-8 string conversion if any */
55    unsigned int    time;
56 };
57
58 typedef struct _Ecore_Sdl_Event_Key_Up Ecore_Sdl_Event_Key_Up;
59 struct _Ecore_Sdl_Event_Key_Up /** SDL Key Up event */
60 {
61    const char      *keyname; /**< The name of the key that was released */
62    const char      *keycompose; /**< The UTF-8 string conversion if any */
63    unsigned int    time;
64 };
65
66 typedef struct _Ecore_Sdl_Event_Mouse_Button_Down Ecore_Sdl_Event_Mouse_Button_Down;
67 struct _Ecore_Sdl_Event_Mouse_Button_Down /** SDL Mouse Down event */
68 {
69    int             button; /**< Mouse button that was pressed (1 - 32) */
70    int             x; /**< Mouse co-ordinates when mouse button was pressed */
71    int             y; /**< Mouse co-ordinates when mouse button was pressed */
72    int             double_click : 1; /**< Set if click was a double click */
73    int             triple_click : 1; /**< Set if click was a triple click  */
74    unsigned int    time;
75 };
76
77 typedef struct _Ecore_Sdl_Event_Mouse_Button_Up Ecore_Sdl_Event_Mouse_Button_Up;
78 struct _Ecore_Sdl_Event_Mouse_Button_Up /** SDL Mouse Up event */
79 {
80    int             button; /**< Mouse button that was released (1 - 32) */
81    int             x; /**< Mouse co-ordinates when mouse button was raised */
82    int             y; /**< Mouse co-ordinates when mouse button was raised */
83    int             double_click : 1; /**< Set if click was a double click */
84    int             triple_click : 1; /**< Set if click was a triple click  */
85    unsigned int    time;
86 };
87
88 typedef struct _Ecore_Sdl_Event_Mouse_Move Ecore_Sdl_Event_Mouse_Move;
89 struct _Ecore_Sdl_Event_Mouse_Move /** SDL Mouse Move event */ 
90 {
91    int             x; /**< Mouse co-ordinates where the mouse cursor moved to */
92    int             y; /**< Mouse co-ordinates where the mouse cursor moved to */
93    unsigned int    time;
94 };
95
96 typedef struct _Ecore_Sdl_Event_Mouse_Wheel Ecore_Sdl_Event_Mouse_Wheel;
97 struct _Ecore_Sdl_Event_Mouse_Wheel /** SDL Mouse Wheel event */
98 {
99    int             x,y;
100    int             direction; /* 0 = vertical, 1 = horizontal */
101    int             wheel; /* value 1 (left/up), -1 (right/down) */
102    unsigned int    time;
103 };
104
105 typedef struct _Ecore_Sdl_Event_Video_Resize Ecore_Sdl_Event_Video_Resize;
106 struct _Ecore_Sdl_Event_Video_Resize
107 {
108    int             w;
109    int             h;
110 };
111
112 EAPI int        ecore_sdl_init(const char *name);
113 EAPI int        ecore_sdl_shutdown(void);
114 EAPI void       ecore_sdl_feed_events(void);
115
116 #ifdef __cplusplus
117 }
118 #endif
119
120 #endif