From 8f55880b6ba599d21076be0fc3ee2b4d4283f04e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 12 Dec 2018 01:10:55 +0100 Subject: [PATCH] Platform: remove deprecated wheel-reported-as-button events. Deprecated in 2a77856df2e7d55ec587306f6184072865ba20b2 (June 2016). Use the dedicated mouseScrollEvent() API instead. --- doc/changelog.dox | 5 +++++ src/Magnum/Platform/GlfwApplication.cpp | 14 -------------- src/Magnum/Platform/GlfwApplication.h | 14 -------------- src/Magnum/Platform/Sdl2Application.cpp | 18 ------------------ src/Magnum/Platform/Sdl2Application.h | 14 -------------- 5 files changed, 5 insertions(+), 60 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index c2adb08c3..f755f1d90 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -178,6 +178,11 @@ See also: - Removed @cpp Math::normalize() @ce and @cpp Math::denormalize() @ce functions, deprecated since December 2016. Use @ref Math::pack() and @ref Math::unpack() instead. +- Removed @cpp Platform::*Application::MouseEvent::BUtton::WheelUp @ce and + @cpp Platform::*Application::MouseEvent::BUtton::WheelDown @ce, deprecated + since June 2016. Use the dedicated + @ref Platform::Sdl2Application::mouseScrollEvent() "mouseScrollEvent()" + API instead. @section changelog-2018-10 2018.10 diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index f2139b633..3d035dc9f 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -497,20 +497,6 @@ void GlfwApplication::setupCallbacks() { MouseScrollEvent e(window, Vector2{Float(xoffset), Float(yoffset)}); instance->mouseScrollEvent(e); - - #ifdef MAGNUM_BUILD_DEPRECATED - if(yoffset != 0.0) { - #ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif - MouseEvent e1((yoffset > 0.0) ? MouseEvent::Button::WheelUp : MouseEvent::Button::WheelDown, {}, currentGlfwModifiers(window)); - #ifdef __GNUC__ - #pragma GCC diagnostic pop - #endif - instance->mousePressEvent(e1); - } - #endif }); glfwSetCharCallback(_window, [](GLFWwindow* window, unsigned int codepoint) { const auto instance = static_cast(glfwGetWindowUserPointer(window)); diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 474e11d64..83296085e 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -1488,20 +1488,6 @@ class GlfwApplication::MouseEvent: public GlfwApplication::InputEvent { Button6 = GLFW_MOUSE_BUTTON_6, /**< Mouse button 6 */ Button7 = GLFW_MOUSE_BUTTON_7, /**< Mouse button 7 */ Button8 = GLFW_MOUSE_BUTTON_8, /**< Mouse button 8 */ - - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * Wheel up - * @deprecated Use @ref MouseScrollEvent and @ref mouseScrollEvent() instead. - */ - WheelUp CORRADE_DEPRECATED_ENUM("use mouseScrollEvent() and MouseScrollEvent instead") = GLFW_MOUSE_BUTTON_LAST + 1, - - /** - * Wheel down - * @deprecated Use @ref MouseScrollEvent and @ref mouseScrollEvent() instead. - */ - WheelDown CORRADE_DEPRECATED_ENUM("use mouseScrollEvent() and MouseScrollEvent instead") = GLFW_MOUSE_BUTTON_LAST + 2 - #endif }; /** @brief Button */ diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index b4689078a..d042efaf8 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/src/Magnum/Platform/Sdl2Application.cpp @@ -687,24 +687,6 @@ void Sdl2Application::mainLoopIteration() { case SDL_MOUSEWHEEL: { MouseScrollEvent e{{Float(event.wheel.x), Float(event.wheel.y)}}; mouseScrollEvent(e); - - #ifdef MAGNUM_BUILD_DEPRECATED - if(event.wheel.y != 0) { - #ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif - MouseEvent ew(event.wheel.y > 0 ? MouseEvent::Button::WheelUp : MouseEvent::Button::WheelDown, {event.wheel.x, event.wheel.y} - #ifndef CORRADE_TARGET_EMSCRIPTEN - , 0 - #endif - ); - #ifdef __GNUC__ - #pragma GCC diagnostic pop - #endif - mousePressEvent(ew); - } - #endif } break; case SDL_MOUSEMOTION: { diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index 519fa071f..89e5bf8b8 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -2000,20 +2000,6 @@ class Sdl2Application::MouseEvent: public Sdl2Application::InputEvent { /** Second extra button (e.g. wheel right) */ X2 = SDL_BUTTON_X2, - - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * Wheel up - * @deprecated Use @ref MouseScrollEvent and @ref mouseScrollEvent() instead. - */ - WheelUp CORRADE_DEPRECATED_ENUM("use mouseScrollEvent() and MouseScrollEvent instead") = SDL_BUTTON_X2 + 1, - - /** - * Wheel down - * @deprecated Use @ref MouseScrollEvent and @ref mouseScrollEvent() instead. - */ - WheelDown CORRADE_DEPRECATED_ENUM("use mouseScrollEvent() and MouseScrollEvent instead") = SDL_BUTTON_X2 + 2 - #endif }; /** @brief Button */