Browse Source

Platform: remove deprecated wheel-reported-as-button events.

Deprecated in 2a77856df2 (June 2016). Use
the dedicated mouseScrollEvent() API instead.
simd
Vladimír Vondruš 8 years ago
parent
commit
8f55880b6b
  1. 5
      doc/changelog.dox
  2. 14
      src/Magnum/Platform/GlfwApplication.cpp
  3. 14
      src/Magnum/Platform/GlfwApplication.h
  4. 18
      src/Magnum/Platform/Sdl2Application.cpp
  5. 14
      src/Magnum/Platform/Sdl2Application.h

5
doc/changelog.dox

@ -178,6 +178,11 @@ See also:
- Removed @cpp Math::normalize() @ce and @cpp Math::denormalize() @ce - Removed @cpp Math::normalize() @ce and @cpp Math::denormalize() @ce
functions, deprecated since December 2016. Use @ref Math::pack() and functions, deprecated since December 2016. Use @ref Math::pack() and
@ref Math::unpack() instead. @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 @section changelog-2018-10 2018.10

14
src/Magnum/Platform/GlfwApplication.cpp

@ -497,20 +497,6 @@ void GlfwApplication::setupCallbacks() {
MouseScrollEvent e(window, Vector2{Float(xoffset), Float(yoffset)}); MouseScrollEvent e(window, Vector2{Float(xoffset), Float(yoffset)});
instance->mouseScrollEvent(e); 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) { glfwSetCharCallback(_window, [](GLFWwindow* window, unsigned int codepoint) {
const auto instance = static_cast<GlfwApplication*>(glfwGetWindowUserPointer(window)); const auto instance = static_cast<GlfwApplication*>(glfwGetWindowUserPointer(window));

14
src/Magnum/Platform/GlfwApplication.h

@ -1488,20 +1488,6 @@ class GlfwApplication::MouseEvent: public GlfwApplication::InputEvent {
Button6 = GLFW_MOUSE_BUTTON_6, /**< Mouse button 6 */ Button6 = GLFW_MOUSE_BUTTON_6, /**< Mouse button 6 */
Button7 = GLFW_MOUSE_BUTTON_7, /**< Mouse button 7 */ Button7 = GLFW_MOUSE_BUTTON_7, /**< Mouse button 7 */
Button8 = GLFW_MOUSE_BUTTON_8, /**< Mouse button 8 */ 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 */ /** @brief Button */

18
src/Magnum/Platform/Sdl2Application.cpp

@ -687,24 +687,6 @@ void Sdl2Application::mainLoopIteration() {
case SDL_MOUSEWHEEL: { case SDL_MOUSEWHEEL: {
MouseScrollEvent e{{Float(event.wheel.x), Float(event.wheel.y)}}; MouseScrollEvent e{{Float(event.wheel.x), Float(event.wheel.y)}};
mouseScrollEvent(e); 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; } break;
case SDL_MOUSEMOTION: { case SDL_MOUSEMOTION: {

14
src/Magnum/Platform/Sdl2Application.h

@ -2000,20 +2000,6 @@ class Sdl2Application::MouseEvent: public Sdl2Application::InputEvent {
/** Second extra button (e.g. wheel right) */ /** Second extra button (e.g. wheel right) */
X2 = SDL_BUTTON_X2, 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 */ /** @brief Button */

Loading…
Cancel
Save