events: Add logging support for several missing event types
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c
index d3e219d..9609fb6 100644
--- a/src/events/SDL_events.c
+++ b/src/events/SDL_events.c
@@ -206,11 +206,28 @@ SDL_LogEvent(const SDL_Event *event)
SDL_EVENT_CASE(SDL_APP_DIDENTERBACKGROUND) break;
SDL_EVENT_CASE(SDL_APP_WILLENTERFOREGROUND) break;
SDL_EVENT_CASE(SDL_APP_DIDENTERFOREGROUND) break;
+ SDL_EVENT_CASE(SDL_LOCALECHANGED) break;
SDL_EVENT_CASE(SDL_KEYMAPCHANGED) break;
SDL_EVENT_CASE(SDL_CLIPBOARDUPDATE) break;
SDL_EVENT_CASE(SDL_RENDER_TARGETS_RESET) break;
SDL_EVENT_CASE(SDL_RENDER_DEVICE_RESET) break;
+ SDL_EVENT_CASE(SDL_DISPLAYEVENT) {
+ char name2[64];
+ switch (event->display.event) {
+ case SDL_DISPLAYEVENT_NONE: SDL_strlcpy(name2, "SDL_DISPLAYEVENT_NONE (THIS IS PROBABLY A BUG!)", sizeof(name2)); break;
+ #define SDL_DISPLAYEVENT_CASE(x) case x: SDL_strlcpy(name2, #x, sizeof (name2)); break
+ SDL_DISPLAYEVENT_CASE(SDL_DISPLAYEVENT_ORIENTATION);
+ SDL_DISPLAYEVENT_CASE(SDL_DISPLAYEVENT_CONNECTED);
+ SDL_DISPLAYEVENT_CASE(SDL_DISPLAYEVENT_DISCONNECTED);
+ #undef SDL_DISPLAYEVENT_CASE
+ default: SDL_strlcpy(name2, "UNKNOWN (bug? fixme?)", sizeof(name2)); break;
+ }
+ SDL_snprintf(details, sizeof (details), " (timestamp=%u display=%u event=%s data1=%d)",
+ (uint) event->display.timestamp, (uint) event->display.display, name2, (int) event->display.data1);
+ break;
+ }
+
SDL_EVENT_CASE(SDL_WINDOWEVENT) {
char name2[64];
switch(event->window.event) {
@@ -232,6 +249,8 @@ SDL_LogEvent(const SDL_Event *event)
SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_CLOSE);
SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_TAKE_FOCUS);
SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_HIT_TEST);
+ SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_ICCPROF_CHANGED);
+ SDL_WINDOWEVENT_CASE(SDL_WINDOWEVENT_DISPLAY_CHANGED);
#undef SDL_WINDOWEVENT_CASE
default: SDL_strlcpy(name2, "UNKNOWN (bug? fixme?)", sizeof (name2)); break;
}