From 98a6ce2871ee522e4636990638c39da07d762901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 15 Oct 2024 18:41:41 +0200 Subject: [PATCH] Platform: drop support for Android < 4.0. 4.0 is from 2011, I think it's safe to assume that nobody really needs support for anything older nowadays. Of course I can add that back if needed, but I doubt anyone will ask. --- doc/changelog.dox | 2 + src/Magnum/Platform/AndroidApplication.h | 60 ++---------------------- 2 files changed, 6 insertions(+), 56 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 3e9b453f3..11e25a15f 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -52,6 +52,8 @@ See also: - Minimal supported Emscripten version is now 1.39.5 which implicitly sets `-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1`, as the deprecated code paths were removed. +- Support for Android API versions older than 14 (i.e., before Android 4.0, + which is from 2011) has been dropped from @ref Platform::AndroidApplication. @subsection changelog-latest-new New features diff --git a/src/Magnum/Platform/AndroidApplication.h b/src/Magnum/Platform/AndroidApplication.h index 22a87f7ac..6918b4a73 100644 --- a/src/Magnum/Platform/AndroidApplication.h +++ b/src/Magnum/Platform/AndroidApplication.h @@ -755,45 +755,19 @@ class AndroidApplication::MouseEvent: public InputEvent { /** * Left mouse button. Note that this button is not set if only * touch or stylus event occurred. - * @attention Available since Android 4.0 (API level 14), not - * detectable in earlier versions. */ - #if defined(DOXYGEN_GENERATING_OUTPUT) || __ANDROID_API__ >= 14 Left = AMOTION_EVENT_BUTTON_PRIMARY, - #else - Left = 1 << 0, - #endif - /** - * Middle mouse button or second stylus button - * @attention Available since Android 4.0 (API level 14), not - * detectable in earlier versions. - */ - #if defined(DOXYGEN_GENERATING_OUTPUT) || __ANDROID_API__ >= 14 + /** Middle mouse button or second stylus button */ Middle = AMOTION_EVENT_BUTTON_TERTIARY, - #else - Middle = 1 << 1, - #endif - /** - * Right mouse button or first stylus button - * @attention Available since Android 4.0 (API level 14), not - * detectable in earlier versions. - */ - #if defined(DOXYGEN_GENERATING_OUTPUT) || __ANDROID_API__ >= 14 + /** Right mouse button or first stylus button */ Right = AMOTION_EVENT_BUTTON_SECONDARY - #else - Right = 1 << 2 - #endif }; /** @brief Button */ Button button() { - #if __ANDROID_API__ >= 14 return Button(AMotionEvent_getButtonState(_event)); - #else - return Button::None; - #endif } /** @brief Position */ @@ -824,36 +798,14 @@ class AndroidApplication::MouseMoveEvent: public InputEvent { /** * Left mouse button. Note that this button is not set if only * touch or stylus event occurred. - * @attention Available since Android 4.0 (API level 14), not - * detectable in earlier versions. */ - #if defined(DOXYGEN_GENERATING_OUTPUT) || __ANDROID_API__ >= 14 Left = AMOTION_EVENT_BUTTON_PRIMARY, - #else - Left = 1 << 0, - #endif - /** - * Middle mouse button or second stylus button - * @attention Available since Android 4.0 (API level 14), not - * detectable in earlier versions. - */ - #if defined(DOXYGEN_GENERATING_OUTPUT) || __ANDROID_API__ >= 14 + /** Middle mouse button or second stylus button */ Middle = AMOTION_EVENT_BUTTON_TERTIARY, - #else - Middle = 1 << 1, - #endif - /** - * Right mouse button or first stylus button - * @attention Available since Android 4.0 (API level 14), not - * detectable in earlier versions. - */ - #if defined(DOXYGEN_GENERATING_OUTPUT) || __ANDROID_API__ >= 14 + /** Right mouse button or first stylus button */ Right = AMOTION_EVENT_BUTTON_SECONDARY - #else - Right = 1 << 2 - #endif }; /** @@ -882,11 +834,7 @@ class AndroidApplication::MouseMoveEvent: public InputEvent { /** @brief Mouse buttons */ Buttons buttons() const { - #if __ANDROID_API__ >= 14 return Button(AMotionEvent_getButtonState(_event)); - #else - return {}; - #endif } private: