diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_sdl/Ecore_Sdl.h | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/libraries/ecore/src/lib/ecore_sdl/Ecore_Sdl.h b/libraries/ecore/src/lib/ecore_sdl/Ecore_Sdl.h new file mode 100644 index 0000000..359e974 --- /dev/null +++ b/libraries/ecore/src/lib/ecore_sdl/Ecore_Sdl.h | |||
@@ -0,0 +1,114 @@ | |||
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_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_Key_Down Ecore_Sdl_Event_Key_Down; | ||
45 | struct _Ecore_Sdl_Event_Key_Down /** SDL Key Down event */ | ||
46 | { | ||
47 | const char *keyname; /**< The name of the key that was pressed */ | ||
48 | const char *keycompose; /**< The UTF-8 string conversion if any */ | ||
49 | unsigned int time; | ||
50 | }; | ||
51 | |||
52 | typedef struct _Ecore_Sdl_Event_Key_Up Ecore_Sdl_Event_Key_Up; | ||
53 | struct _Ecore_Sdl_Event_Key_Up /** SDL Key Up event */ | ||
54 | { | ||
55 | const char *keyname; /**< The name of the key that was released */ | ||
56 | const char *keycompose; /**< The UTF-8 string conversion if any */ | ||
57 | unsigned int time; | ||
58 | }; | ||
59 | |||
60 | typedef struct _Ecore_Sdl_Event_Mouse_Button_Down Ecore_Sdl_Event_Mouse_Button_Down; | ||
61 | struct _Ecore_Sdl_Event_Mouse_Button_Down /** SDL Mouse Down event */ | ||
62 | { | ||
63 | int button; /**< Mouse button that was pressed (1 - 32) */ | ||
64 | int x; /**< Mouse co-ordinates when mouse button was pressed */ | ||
65 | int y; /**< Mouse co-ordinates when mouse button was pressed */ | ||
66 | int double_click : 1; /**< Set if click was a double click */ | ||
67 | int triple_click : 1; /**< Set if click was a triple click */ | ||
68 | unsigned int time; | ||
69 | }; | ||
70 | |||
71 | typedef struct _Ecore_Sdl_Event_Mouse_Button_Up Ecore_Sdl_Event_Mouse_Button_Up; | ||
72 | struct _Ecore_Sdl_Event_Mouse_Button_Up /** SDL Mouse Up event */ | ||
73 | { | ||
74 | int button; /**< Mouse button that was released (1 - 32) */ | ||
75 | int x; /**< Mouse co-ordinates when mouse button was raised */ | ||
76 | int y; /**< Mouse co-ordinates when mouse button was raised */ | ||
77 | int double_click : 1; /**< Set if click was a double click */ | ||
78 | int triple_click : 1; /**< Set if click was a triple click */ | ||
79 | unsigned int time; | ||
80 | }; | ||
81 | |||
82 | typedef struct _Ecore_Sdl_Event_Mouse_Move Ecore_Sdl_Event_Mouse_Move; | ||
83 | struct _Ecore_Sdl_Event_Mouse_Move /** SDL Mouse Move event */ | ||
84 | { | ||
85 | int x; /**< Mouse co-ordinates where the mouse cursor moved to */ | ||
86 | int y; /**< Mouse co-ordinates where the mouse cursor moved to */ | ||
87 | unsigned int time; | ||
88 | }; | ||
89 | |||
90 | typedef struct _Ecore_Sdl_Event_Mouse_Wheel Ecore_Sdl_Event_Mouse_Wheel; | ||
91 | struct _Ecore_Sdl_Event_Mouse_Wheel /** SDL Mouse Wheel event */ | ||
92 | { | ||
93 | int x,y; | ||
94 | int direction; /* 0 = vertical, 1 = horizontal */ | ||
95 | int wheel; /* value 1 (left/up), -1 (right/down) */ | ||
96 | unsigned int time; | ||
97 | }; | ||
98 | |||
99 | typedef struct _Ecore_Sdl_Event_Video_Resize Ecore_Sdl_Event_Video_Resize; | ||
100 | struct _Ecore_Sdl_Event_Video_Resize | ||
101 | { | ||
102 | int w; | ||
103 | int h; | ||
104 | }; | ||
105 | |||
106 | EAPI int ecore_sdl_init(const char *name); | ||
107 | EAPI int ecore_sdl_shutdown(void); | ||
108 | EAPI void ecore_sdl_feed_events(void); | ||
109 | |||
110 | #ifdef __cplusplus | ||
111 | } | ||
112 | #endif | ||
113 | |||
114 | #endif | ||