Browse Source

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.
pull/651/head
Vladimír Vondruš 2 years ago
parent
commit
98a6ce2871
  1. 2
      doc/changelog.dox
  2. 60
      src/Magnum/Platform/AndroidApplication.h

2
doc/changelog.dox

@ -52,6 +52,8 @@ See also:
- Minimal supported Emscripten version is now 1.39.5 which implicitly sets - Minimal supported Emscripten version is now 1.39.5 which implicitly sets
`-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1`, as the deprecated `-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1`, as the deprecated
code paths were removed. 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 @subsection changelog-latest-new New features

60
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 * Left mouse button. Note that this button is not set if only
* touch or stylus event occurred. * 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, Left = AMOTION_EVENT_BUTTON_PRIMARY,
#else
Left = 1 << 0,
#endif
/** /** Middle mouse button or second stylus button */
* 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 = AMOTION_EVENT_BUTTON_TERTIARY, Middle = AMOTION_EVENT_BUTTON_TERTIARY,
#else
Middle = 1 << 1,
#endif
/** /** Right mouse button or first stylus button */
* 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 = AMOTION_EVENT_BUTTON_SECONDARY Right = AMOTION_EVENT_BUTTON_SECONDARY
#else
Right = 1 << 2
#endif
}; };
/** @brief Button */ /** @brief Button */
Button button() { Button button() {
#if __ANDROID_API__ >= 14
return Button(AMotionEvent_getButtonState(_event)); return Button(AMotionEvent_getButtonState(_event));
#else
return Button::None;
#endif
} }
/** @brief Position */ /** @brief Position */
@ -824,36 +798,14 @@ class AndroidApplication::MouseMoveEvent: public InputEvent {
/** /**
* Left mouse button. Note that this button is not set if only * Left mouse button. Note that this button is not set if only
* touch or stylus event occurred. * 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, Left = AMOTION_EVENT_BUTTON_PRIMARY,
#else
Left = 1 << 0,
#endif
/** /** Middle mouse button or second stylus button */
* 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 = AMOTION_EVENT_BUTTON_TERTIARY, Middle = AMOTION_EVENT_BUTTON_TERTIARY,
#else
Middle = 1 << 1,
#endif
/** /** Right mouse button or first stylus button */
* 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 = AMOTION_EVENT_BUTTON_SECONDARY Right = AMOTION_EVENT_BUTTON_SECONDARY
#else
Right = 1 << 2
#endif
}; };
/** /**
@ -882,11 +834,7 @@ class AndroidApplication::MouseMoveEvent: public InputEvent {
/** @brief Mouse buttons */ /** @brief Mouse buttons */
Buttons buttons() const { Buttons buttons() const {
#if __ANDROID_API__ >= 14
return Button(AMotionEvent_getButtonState(_event)); return Button(AMotionEvent_getButtonState(_event));
#else
return {};
#endif
} }
private: private:

Loading…
Cancel
Save