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