Rev 8209 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8209 | Rev 9956 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | /* Include file for SDL joystick event handling */ |
28 | /* Include file for SDL joystick event handling */ |
Line 29... | Line 29... | ||
29 | 29 | ||
30 | #ifndef _SDL_joystick_h |
30 | #ifndef _SDL_joystick_h |
Line -... | Line 31... | ||
- | 31 | #define _SDL_joystick_h |
|
- | 32 | ||
31 | #define _SDL_joystick_h |
33 | #include |
- | 34 | ||
- | 35 | #include "SDL_types.h" |
|
Line 32... | Line 36... | ||
32 | 36 | #include "SDL_error.h" |
|
33 | #include "SDL_types.h" |
37 | #include "SDL_events.h" |
34 | 38 | ||
35 | #include "begin_code.h" |
39 | #include "begin_code.h" |
Line 45... | Line 49... | ||
45 | 49 | ||
46 | /* The joystick structure used to identify an SDL joystick */ |
50 | /* The joystick structure used to identify an SDL joystick */ |
47 | struct _SDL_Joystick; |
51 | struct _SDL_Joystick; |
Line -... | Line 52... | ||
- | 52 | typedef struct _SDL_Joystick SDL_Joystick; |
|
Line 48... | Line 53... | ||
48 | typedef struct _SDL_Joystick SDL_Joystick; |
53 | |
49 | 54 | #warning "Joysticks are not supported in KolibriOS. All functions are stubs!" |
|
50 | 55 | ||
51 | /* Function prototypes */ |
56 | /* Function prototypes */ |
52 | /* |
57 | /* |
- | 58 | * Count the number of joysticks attached to the system |
|
- | 59 | */ |
|
- | 60 | static inline DECLSPEC int SDL_NumJoysticks(void) |
|
Line 53... | Line 61... | ||
53 | * Count the number of joysticks attached to the system |
61 | { |
54 | */ |
62 | return 0; |
55 | extern DECLSPEC int SDL_NumJoysticks(void); |
63 | } |
56 | 64 | ||
57 | /* |
65 | /* |
58 | * Get the implementation dependent name of a joystick. |
66 | * Get the implementation dependent name of a joystick. |
- | 67 | * This can be called before any joysticks are opened. |
|
- | 68 | * If no name can be found, this function returns NULL. |
|
- | 69 | */ |
|
Line 59... | Line 70... | ||
59 | * This can be called before any joysticks are opened. |
70 | static inline DECLSPEC const char *SDL_JoystickName(int device_index) |
60 | * If no name can be found, this function returns NULL. |
71 | { |
61 | */ |
72 | return NULL; |
62 | extern DECLSPEC const char *SDL_JoystickName(int device_index); |
73 | } |
63 | 74 | ||
64 | /* |
75 | /* |
65 | * Open a joystick for use - the index passed as an argument refers to |
76 | * Open a joystick for use - the index passed as an argument refers to |
66 | * the N'th joystick on the system. This index is the value which will |
77 | * the N'th joystick on the system. This index is the value which will |
- | 78 | * identify this joystick in future joystick events. |
|
- | 79 | * |
|
- | 80 | * This function returns a joystick identifier, or NULL if an error occurred. |
|
Line 67... | Line 81... | ||
67 | * identify this joystick in future joystick events. |
81 | */ |
68 | * |
82 | static inline DECLSPEC SDL_Joystick *SDL_JoystickOpen(int device_index) |
69 | * This function returns a joystick identifier, or NULL if an error occurred. |
83 | { |
70 | */ |
84 | return NULL; |
- | 85 | } |
|
- | 86 | ||
- | 87 | /* |
|
Line 71... | Line 88... | ||
71 | extern DECLSPEC SDL_Joystick *SDL_JoystickOpen(int device_index); |
88 | * Returns 1 if the joystick has been opened, or 0 if it has not. |
72 | 89 | */ |
|
73 | /* |
90 | static inline DECLSPEC int SDL_JoystickOpened(int device_index) |
74 | * Returns 1 if the joystick has been opened, or 0 if it has not. |
91 | { |
- | 92 | return 0; |
|
- | 93 | } |
|
- | 94 | ||
Line 75... | Line 95... | ||
75 | */ |
95 | /* |
76 | extern DECLSPEC int SDL_JoystickOpened(int device_index); |
96 | * Get the device index of an opened joystick. |
77 | 97 | */ |
|
78 | /* |
98 | static inline DECLSPEC int SDL_JoystickIndex(SDL_Joystick *joystick) |
- | 99 | { |
|
- | 100 | return -1; |
|
- | 101 | } |
|
Line 79... | Line 102... | ||
79 | * Get the device index of an opened joystick. |
102 | |
80 | */ |
103 | /* |
81 | extern DECLSPEC int SDL_JoystickIndex(SDL_Joystick *joystick); |
104 | * Get the number of general axis controls on a joystick |
82 | 105 | */ |
|
83 | /* |
106 | static inline DECLSPEC int SDL_JoystickNumAxes(SDL_Joystick *joystick) |
84 | * Get the number of general axis controls on a joystick |
107 | { |
- | 108 | return -1; |
|
- | 109 | } |
|
- | 110 | ||
Line 85... | Line 111... | ||
85 | */ |
111 | /* |
86 | extern DECLSPEC int SDL_JoystickNumAxes(SDL_Joystick *joystick); |
112 | * Get the number of trackballs on a joystick |
87 | 113 | * Joystick trackballs have only relative motion events associated |
|
88 | /* |
114 | * with them and their state cannot be polled. |
- | 115 | */ |
|
- | 116 | static inline DECLSPEC int SDL_JoystickNumBalls(SDL_Joystick *joystick) |
|
- | 117 | { |
|
Line 89... | Line 118... | ||
89 | * Get the number of trackballs on a joystick |
118 | return -1; |
90 | * Joystick trackballs have only relative motion events associated |
119 | } |
91 | * with them and their state cannot be polled. |
120 | |
92 | */ |
121 | /* |
- | 122 | * Get the number of POV hats on a joystick |
|
- | 123 | */ |
|
- | 124 | static inline DECLSPEC int SDL_JoystickNumHats(SDL_Joystick *joystick) |
|
Line 93... | Line 125... | ||
93 | extern DECLSPEC int SDL_JoystickNumBalls(SDL_Joystick *joystick); |
125 | { |
94 | 126 | return -1; |
|
95 | /* |
127 | } |
96 | * Get the number of POV hats on a joystick |
128 | |
97 | */ |
129 | /* |
98 | extern DECLSPEC int SDL_JoystickNumHats(SDL_Joystick *joystick); |
130 | * Get the number of buttons on a joystick |
- | 131 | */ |
|
- | 132 | static inline DECLSPEC int SDL_JoystickNumButtons(SDL_Joystick *joystick) |
|
- | 133 | { |
|
Line 99... | Line 134... | ||
99 | 134 | return -1; |
|
100 | /* |
135 | } |
101 | * Get the number of buttons on a joystick |
136 | |
102 | */ |
137 | /* |
103 | extern DECLSPEC int SDL_JoystickNumButtons(SDL_Joystick *joystick); |
138 | * Update the current state of the open joysticks. |
104 | 139 | * This is called automatically by the event loop if any joystick |
|
105 | /* |
140 | * events are enabled. |
106 | * Update the current state of the open joysticks. |
141 | */ |
- | 142 | static inline DECLSPEC void SDL_JoystickUpdate(void) |
|
- | 143 | { |
|
- | 144 | /* STUB! */ |
|
Line 107... | Line 145... | ||
107 | * This is called automatically by the event loop if any joystick |
145 | } |
108 | * events are enabled. |
146 | |
109 | */ |
147 | /* |
110 | extern DECLSPEC void SDL_JoystickUpdate(void); |
148 | * Enable/disable joystick event polling. |
111 | 149 | * If joystick events are disabled, you must call SDL_JoystickUpdate() |
|
112 | /* |
150 | * yourself and check the state of the joystick when you want joystick |
- | 151 | * information. |
|
- | 152 | * The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. |
|
- | 153 | */ |
|
Line 113... | Line 154... | ||
113 | * Enable/disable joystick event polling. |
154 | static inline DECLSPEC int SDL_JoystickEventState(int state) |
114 | * If joystick events are disabled, you must call SDL_JoystickUpdate() |
155 | { |
115 | * yourself and check the state of the joystick when you want joystick |
156 | return SDL_IGNORE; |
116 | * information. |
157 | } |
Line 139... | Line 180... | ||
139 | #define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) |
180 | #define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) |
140 | #define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) |
181 | #define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) |
141 | /* |
182 | /* |
142 | * The hat indices start at index 0. |
183 | * The hat indices start at index 0. |
143 | */ |
184 | */ |
144 | extern DECLSPEC Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); |
185 | static inline DECLSPEC Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat) |
- | 186 | { |
|
- | 187 | return 0; |
|
- | 188 | } |
|
Line 145... | Line 189... | ||
145 | 189 | ||
146 | /* |
190 | /* |
147 | * Get the ball axis change since the last poll |
191 | * Get the ball axis change since the last poll |
148 | * This returns 0, or -1 if you passed it invalid parameters. |
192 | * This returns 0, or -1 if you passed it invalid parameters. |
149 | * The ball indices start at index 0. |
193 | * The ball indices start at index 0. |
150 | */ |
194 | */ |
- | 195 | static inline DECLSPEC int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy) |
|
- | 196 | { |
|
151 | extern DECLSPEC int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); |
197 | return -1; |
152 | 198 | } |
|
153 | /* |
199 | /* |
154 | * Get the current state of a button on a joystick |
200 | * Get the current state of a button on a joystick |
155 | * The button indices start at index 0. |
201 | * The button indices start at index 0. |
156 | */ |
202 | */ |
- | 203 | static inline DECLSPEC Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button) |
|
- | 204 | { |
|
- | 205 | return 0; |
|
Line 157... | Line 206... | ||
157 | extern DECLSPEC Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button); |
206 | } |
158 | 207 | ||
159 | /* |
208 | /* |
160 | * Close a joystick previously opened with SDL_JoystickOpen() |
209 | * Close a joystick previously opened with SDL_JoystickOpen() |
161 | */ |
210 | */ |
- | 211 | static inline DECLSPEC void SDL_JoystickClose(SDL_Joystick *joystick) |
|
- | 212 | { |
|
Line 162... | Line 213... | ||
162 | extern DECLSPEC void SDL_JoystickClose(SDL_Joystick *joystick); |
213 | /* STUB! */ |
163 | 214 | } |
|
164 | 215 | ||
165 | /* Ends C function definitions when using C++ */ |
216 | /* Ends C function definitions when using C++ */ |