Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 8 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | Simple DirectMedia Layer |
2 | Simple DirectMedia Layer |
3 | Copyright (C) 1997- |
3 | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
4 | 4 | ||
5 | This software is provided 'as-is', without any express or implied |
5 | This software is provided 'as-is', without any express or implied |
6 | warranty. In no event will the authors be held liable for any damages |
6 | warranty. In no event will the authors be held liable for any damages |
7 | arising from the use of this software. |
7 | arising from the use of this software. |
8 | 8 | ||
Line 82... | Line 82... | ||
82 | */ |
82 | */ |
83 | SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive |
83 | SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive |
84 | Called on iOS in applicationDidBecomeActive() |
84 | Called on iOS in applicationDidBecomeActive() |
85 | Called on Android in onResume() |
85 | Called on Android in onResume() |
86 | */ |
86 | */ |
- | 87 | ||
- | 88 | /* Display events */ |
|
- | 89 | SDL_DISPLAYEVENT = 0x150, /**< Display state change */ |
|
87 | 90 | ||
88 | /* Window events */ |
91 | /* Window events */ |
89 | SDL_WINDOWEVENT = 0x200, /**< Window state change */ |
92 | SDL_WINDOWEVENT = 0x200, /**< Window state change */ |
90 | SDL_SYSWMEVENT, /**< System specific event */ |
93 | SDL_SYSWMEVENT, /**< System specific event */ |
91 | 94 | ||
Line 141... | Line 144... | ||
141 | SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */ |
144 | SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */ |
142 | 145 | ||
143 | /* Audio hotplug events */ |
146 | /* Audio hotplug events */ |
144 | SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */ |
147 | SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */ |
145 | SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */ |
148 | SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */ |
- | 149 | ||
- | 150 | /* Sensor events */ |
|
- | 151 | SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */ |
|
146 | 152 | ||
147 | /* Render events */ |
153 | /* Render events */ |
148 | SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */ |
154 | SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */ |
149 | SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */ |
155 | SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */ |
150 | 156 | ||
Line 165... | Line 171... | ||
165 | typedef struct SDL_CommonEvent |
171 | typedef struct SDL_CommonEvent |
166 | { |
172 | { |
167 | Uint32 type; |
173 | Uint32 type; |
168 | Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ |
174 | Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ |
169 | } SDL_CommonEvent; |
175 | } SDL_CommonEvent; |
- | 176 | ||
- | 177 | /** |
|
- | 178 | * \brief Display state change event data (event.display.*) |
|
- | 179 | */ |
|
- | 180 | typedef struct SDL_DisplayEvent |
|
- | 181 | { |
|
- | 182 | Uint32 type; /**< ::SDL_DISPLAYEVENT */ |
|
- | 183 | Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ |
|
- | 184 | Uint32 display; /**< The associated display index */ |
|
- | 185 | Uint8 event; /**< ::SDL_DisplayEventID */ |
|
- | 186 | Uint8 padding1; |
|
- | 187 | Uint8 padding2; |
|
- | 188 | Uint8 padding3; |
|
- | 189 | Sint32 data1; /**< event dependent data */ |
|
- | 190 | } SDL_DisplayEvent; |
|
170 | 191 | ||
171 | /** |
192 | /** |
172 | * \brief Window state change event data (event.window.*) |
193 | * \brief Window state change event data (event.window.*) |
173 | */ |
194 | */ |
174 | typedef struct SDL_WindowEvent |
195 | typedef struct SDL_WindowEvent |
Line 468... | Line 489... | ||
468 | Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ |
489 | Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ |
469 | char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */ |
490 | char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */ |
470 | Uint32 windowID; /**< The window that was dropped on, if any */ |
491 | Uint32 windowID; /**< The window that was dropped on, if any */ |
471 | } SDL_DropEvent; |
492 | } SDL_DropEvent; |
472 | 493 | ||
- | 494 | ||
- | 495 | /** |
|
- | 496 | * \brief Sensor event structure (event.sensor.*) |
|
- | 497 | */ |
|
- | 498 | typedef struct SDL_SensorEvent |
|
- | 499 | { |
|
- | 500 | Uint32 type; /**< ::SDL_SENSORUPDATE */ |
|
- | 501 | Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ |
|
- | 502 | Sint32 which; /**< The instance ID of the sensor */ |
|
- | 503 | float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */ |
|
- | 504 | } SDL_SensorEvent; |
|
473 | 505 | ||
474 | /** |
506 | /** |
475 | * \brief The "quit requested" event |
507 | * \brief The "quit requested" event |
476 | */ |
508 | */ |
477 | typedef struct SDL_QuitEvent |
509 | typedef struct SDL_QuitEvent |
Line 524... | Line 556... | ||
524 | */ |
556 | */ |
525 | typedef union SDL_Event |
557 | typedef union SDL_Event |
526 | { |
558 | { |
527 | Uint32 type; /**< Event type, shared with all events */ |
559 | Uint32 type; /**< Event type, shared with all events */ |
528 | SDL_CommonEvent common; /**< Common event data */ |
560 | SDL_CommonEvent common; /**< Common event data */ |
- | 561 | SDL_DisplayEvent display; /**< Window event data */ |
|
529 | SDL_WindowEvent window; /**< Window event data */ |
562 | SDL_WindowEvent window; /**< Window event data */ |
530 | SDL_KeyboardEvent key; /**< Keyboard event data */ |
563 | SDL_KeyboardEvent key; /**< Keyboard event data */ |
531 | SDL_TextEditingEvent edit; /**< Text editing event data */ |
564 | SDL_TextEditingEvent edit; /**< Text editing event data */ |
532 | SDL_TextInputEvent text; /**< Text input event data */ |
565 | SDL_TextInputEvent text; /**< Text input event data */ |
533 | SDL_MouseMotionEvent motion; /**< Mouse motion event data */ |
566 | SDL_MouseMotionEvent motion; /**< Mouse motion event data */ |
Line 540... | Line 573... | ||
540 | SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ |
573 | SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ |
541 | SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ |
574 | SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ |
542 | SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ |
575 | SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ |
543 | SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ |
576 | SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ |
544 | SDL_AudioDeviceEvent adevice; /**< Audio device event data */ |
577 | SDL_AudioDeviceEvent adevice; /**< Audio device event data */ |
- | 578 | SDL_SensorEvent sensor; /**< Sensor event data */ |
|
545 | SDL_QuitEvent quit; /**< Quit request event data */ |
579 | SDL_QuitEvent quit; /**< Quit request event data */ |
546 | SDL_UserEvent user; /**< Custom event data */ |
580 | SDL_UserEvent user; /**< Custom event data */ |
547 | SDL_SysWMEvent syswm; /**< System dependent window event data */ |
581 | SDL_SysWMEvent syswm; /**< System dependent window event data */ |
548 | SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ |
582 | SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ |
549 | SDL_MultiGestureEvent mgesture; /**< Gesture event data */ |
583 | SDL_MultiGestureEvent mgesture; /**< Gesture event data */ |