diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-16 14:22:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-16 15:19:51 +0300 |
commit | 8406b00588070266ae8af2bf25776f2fa716af69 (patch) | |
tree | f3515975feaf7dad0a7fa6ee33f6c88d1c6579b3 | |
parent | f880384018ee23efdc5cc072789e176208956a06 (diff) | |
download | mv-8406b00588070266ae8af2bf25776f2fa716af69.tar.gz mv-8406b00588070266ae8af2bf25776f2fa716af69.tar.bz2 mv-8406b00588070266ae8af2bf25776f2fa716af69.tar.xz mv-8406b00588070266ae8af2bf25776f2fa716af69.zip |
move mouseevent into events directory.
109 files changed, 367 insertions, 754 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1714b01c5..e3bf7ae5c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -176,7 +176,6 @@ SET(SRCS gui/widgets/linkhandler.h gui/widgets/listbox.cpp gui/widgets/listbox.h - gui/widgets/mouseevent.h gui/widgets/namesmodel.cpp gui/widgets/namesmodel.h gui/widgets/passwordfield.cpp @@ -786,7 +785,7 @@ SET(SRCS gui/base/keyinput.hpp listeners/keylistener.h gui/base/listmodel.hpp - gui/base/mouseevent.hpp + events/mouseevent.h gui/base/mouseinput.hpp listeners/mouselistener.h gui/base/rectangle.hpp @@ -815,7 +814,6 @@ SET(SRCS gui/base/gui.cpp gui/base/key.cpp gui/base/keyinput.cpp - gui/base/mouseevent.cpp gui/base/mouseinput.cpp gui/base/rectangle.cpp gui/base/selectionevent.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 268344f2d..3b199ba44 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -174,7 +174,7 @@ manaplus_SOURCES += events/actionevent.h \ gui/base/keyinput.hpp \ listeners/keylistener.h \ gui/base/listmodel.hpp \ - gui/base/mouseevent.hpp \ + events/mouseevent.h \ gui/base/mouseinput.hpp \ listeners/mouselistener.h \ gui/base/rectangle.hpp \ @@ -203,7 +203,6 @@ manaplus_SOURCES += events/actionevent.h \ gui/base/gui.cpp \ gui/base/key.cpp \ gui/base/keyinput.cpp \ - gui/base/mouseevent.cpp \ gui/base/mouseinput.cpp \ gui/base/rectangle.cpp \ gui/base/selectionevent.cpp \ @@ -293,7 +292,6 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ gui/widgets/linkhandler.h \ gui/widgets/listbox.cpp \ gui/widgets/listbox.h \ - gui/widgets/mouseevent.h \ gui/widgets/namesmodel.cpp \ gui/widgets/namesmodel.h \ gui/widgets/passwordfield.cpp \ diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp index 4b6d80981..5b02e4aba 100644 --- a/src/actionmanager.cpp +++ b/src/actionmanager.cpp @@ -219,7 +219,7 @@ impHandler0(mouseClick) int mouseX, mouseY; Gui::getMouseState(&mouseX, &mouseY); - guiInput->simulateMouseClick(mouseX, mouseY, gcn::MouseEvent::RIGHT); + guiInput->simulateMouseClick(mouseX, mouseY, MouseEvent::RIGHT); return true; } diff --git a/src/gui/base/gui.hpp b/src/gui/base/gui.hpp index 5198b066a..b853a4210 100644 --- a/src/gui/base/gui.hpp +++ b/src/gui/base/gui.hpp @@ -68,7 +68,8 @@ #include <deque> #include "events/keyevent.h" -#include "gui/base/mouseevent.hpp" +#include "events/mouseevent.h" + #include "gui/base/mouseinput.hpp" class Graphics; diff --git a/src/gui/base/mouseevent.cpp b/src/gui/base/mouseevent.cpp deleted file mode 100644 index 9577059cc..000000000 --- a/src/gui/base/mouseevent.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2014 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * - * - * Per Larsson a.k.a finalman - * Olof Naessén a.k.a jansem/yakslem - * - * Visit: http://guichan.sourceforge.net - * - * License: (BSD) - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of Guichan nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * For comments regarding functions please see the header file. - */ - -#include "gui/base/mouseevent.hpp" - -#include "debug.h" - -namespace gcn -{ - MouseEvent::MouseEvent(Widget *const source, - const bool shiftPressed, - const bool controlPressed, - const bool altPressed, - const bool metaPressed, - const unsigned int type, - const unsigned int button, - const int x, - const int y, - const int clickCount) : - InputGuiEvent(source, - shiftPressed, - controlPressed, - altPressed, - metaPressed), - mType(type), - mButton(button), - mX(x), - mY(y), - mClickCount(clickCount) - { - } - - unsigned int MouseEvent::getButton() const - { - return mButton; - } - - int MouseEvent::getX() const - { - return mX; - } - - int MouseEvent::getY() const - { - return mY; - } - - int MouseEvent::getClickCount() const - { - return mClickCount; - } - - unsigned int MouseEvent::getType() const - { - return mType; - } -} // namespace gcn diff --git a/src/gui/base/mouseevent.hpp b/src/gui/base/mouseevent.hpp deleted file mode 100644 index 2853d01bf..000000000 --- a/src/gui/base/mouseevent.hpp +++ /dev/null @@ -1,217 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2014 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * - * - * Per Larsson a.k.a finalman - * Olof Naessén a.k.a jansem/yakslem - * - * Visit: http://guichan.sourceforge.net - * - * License: (BSD) - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of Guichan nor the names of its contributors may - * be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef GCN_MOUSEEVENT_HPP -#define GCN_MOUSEEVENT_HPP - -#include "events/inputguievent.h" - -namespace gcn -{ - class Gui; - class Widget; - - /** - * Represents a mouse event. - * - * @author Olof Naessén - * @since 0.6.0 - */ - class MouseEvent: public InputGuiEvent - { - public: - /** - * Constructor. - * - * @param source The source widget of the mouse event. - * @param shiftPressed True if shift is pressed, false otherwise. - * @param controlPressed True if control is pressed, false otherwise. - * @param altPressed True if alt is pressed, false otherwise. - * @param metaPressed True if meta is pressed, false otherwise. - * @param type The type of the mouse event. - * @param button The button of the mouse event. - * @param x The x coordinate of the event relative to the source widget. - * @param y The y coordinate of the event relative the source widget. - * @param clickCount The number of clicks generated with the same button. - * It's set to zero if another button is used. - */ - MouseEvent(Widget *const source, - const bool shiftPressed, - const bool controlPressed, - const bool altPressed, - const bool metaPressed, - const unsigned int type, - const unsigned int button, - const int x, - const int y, - const int clickCount); - - /** - * Gets the button of the mouse event. - * - * @return The button of the mouse event. - */ - unsigned int getButton() const A_WARN_UNUSED; - - /** - * Gets the x coordinate of the mouse event. - * The coordinate relative to widget the mouse listener - * receiving the events have registered to. - * - * @return The x coordinate of the mouse event. - * @see Widget::addMouseListener, Widget::removeMouseListener - */ - int getX() const A_WARN_UNUSED; - - /** - * Gets the y coordinate of the mouse event. - * The coordinate relative to widget the mouse listener - * receiving the events have registered to. - * - * @return The y coordinate of the mouse event. - * @see Widget::addMouseListener, Widget::removeMouseListener - */ - int getY() const A_WARN_UNUSED; - - /** - * Gets the number of clicks generated with the same button. - * It's set to zero if another button is used. - * - * @return The number of clicks generated with the same button. - */ - int getClickCount() const A_WARN_UNUSED; - - /** - * Gets the type of the event. - * - * @return The type of the event. - */ - unsigned int getType() const A_WARN_UNUSED; - - /** - * Mouse event types. - */ - enum - { - MOVED = 0, - PRESSED, - RELEASED, - WHEEL_MOVED_DOWN, - WHEEL_MOVED_UP, - CLICKED, - ENTERED, - EXITED, - DRAGGED - }; - - /** - * Mouse button types. - */ - enum - { - EMPTY = 0, - LEFT, - RIGHT, - MIDDLE - }; - - protected: - /** - * Holds the type of the mouse event. - */ - unsigned int mType; - - /** - * Holds the button of the mouse event. - */ - unsigned int mButton; - - /** - * Holds the x-coordinate of the mouse event. - */ - int mX; - - /** - * Holds the y-coordinate of the mouse event. - */ - int mY; - - /** - * The number of clicks generated with the same button. - * It's set to zero if another button is used. - */ - int mClickCount; - - /** - * Gui is a friend of this class in order to be able to manipulate - * the protected member variables of this class and at the same time - * keep the MouseEvent class as const as possible. Gui needs to - * update the x och y coordinates for the coordinates to be relative - * to widget the mouse listener receiving the events have registered - * to. - */ - friend class Gui; - }; -} // namespace gcn - -#endif // GCN_MOUSEEVENT_HPP diff --git a/src/gui/base/widgets/button.cpp b/src/gui/base/widgets/button.cpp index 7f1aea668..8cf49da4b 100644 --- a/src/gui/base/widgets/button.cpp +++ b/src/gui/base/widgets/button.cpp @@ -70,9 +70,10 @@ #include "gui/base/exception.hpp" #include "gui/base/font.hpp" #include "gui/base/key.hpp" -#include "gui/base/mouseevent.hpp" #include "gui/base/mouseinput.hpp" +#include "events/mouseevent.h" + #include "render/graphics.h" #include "debug.h" diff --git a/src/gui/base/widgets/button.hpp b/src/gui/base/widgets/button.hpp index c81fec14f..6fee7f3b3 100644 --- a/src/gui/base/widgets/button.hpp +++ b/src/gui/base/widgets/button.hpp @@ -70,7 +70,8 @@ #include "listeners/keylistener.h" #include "listeners/mouselistener.h" -#include "gui/base/mouseevent.hpp" +#include "events/mouseevent.h" + #include "gui/base/widget.hpp" #include "render/graphics.h" diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 7708183e5..649e547d7 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -31,7 +31,8 @@ #include "gui/theme.h" #include "gui/viewport.h" -#include "gui/widgets/mouseevent.h" +#include "events/mouseevent.h" + #include "gui/widgets/window.h" #include "client.h" @@ -708,32 +709,32 @@ void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button, { switch (mouseEvent.getType()) { - case gcn::MouseEvent::ENTERED: + case MouseEvent::ENTERED: (*it)->mouseEntered(mouseEvent); break; - case gcn::MouseEvent::EXITED: + case MouseEvent::EXITED: (*it)->mouseExited(mouseEvent); break; - case gcn::MouseEvent::MOVED: + case MouseEvent::MOVED: (*it)->mouseMoved(mouseEvent); break; - case gcn::MouseEvent::PRESSED: + case MouseEvent::PRESSED: (*it)->mousePressed(mouseEvent); break; - case gcn::MouseEvent::RELEASED: + case MouseEvent::RELEASED: case 100: // manual hack for release on target after drag (*it)->mouseReleased(mouseEvent); break; - case gcn::MouseEvent::WHEEL_MOVED_UP: + case MouseEvent::WHEEL_MOVED_UP: (*it)->mouseWheelMovedUp(mouseEvent); break; - case gcn::MouseEvent::WHEEL_MOVED_DOWN: + case MouseEvent::WHEEL_MOVED_DOWN: (*it)->mouseWheelMovedDown(mouseEvent); break; - case gcn::MouseEvent::DRAGGED: + case MouseEvent::DRAGGED: (*it)->mouseDragged(mouseEvent); break; - case gcn::MouseEvent::CLICKED: + case MouseEvent::CLICKED: (*it)->mouseClicked(mouseEvent); break; default: @@ -749,7 +750,7 @@ void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button, widget = parent; parent = swap->getParent(); - if (type == gcn::MouseEvent::RELEASED) + if (type == MouseEvent::RELEASED) dragDrop.clear(); // If a non modal focused widget has been reach diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp index 07c950706..f7939b666 100644 --- a/src/gui/popups/itempopup.cpp +++ b/src/gui/popups/itempopup.cpp @@ -265,7 +265,7 @@ void ItemPopup::setLabelColor(Label *label, const ItemType type) const } #undef caseSetColor -void ItemPopup::mouseMoved(gcn::MouseEvent &event) +void ItemPopup::mouseMoved(MouseEvent &event) { Popup::mouseMoved(event); diff --git a/src/gui/popups/itempopup.h b/src/gui/popups/itempopup.h index ac4683938..714e0305c 100644 --- a/src/gui/popups/itempopup.h +++ b/src/gui/popups/itempopup.h @@ -60,7 +60,7 @@ class ItemPopup final : public Popup void setItem(const Item *const item, const bool showImage = false); - void mouseMoved(gcn::MouseEvent &mouseEvent) override final; + void mouseMoved(MouseEvent &mouseEvent) override final; private: Label *mItemName; diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 197a9f716..45551d165 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -839,7 +839,7 @@ void PopupMenu::showChangePos(const int x, const int y) } void PopupMenu::handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED) + MouseEvent *event A_UNUSED) { Being *being = nullptr; if (actorManager) diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h index 235c809ba..1ebb0dd89 100644 --- a/src/gui/popups/popupmenu.h +++ b/src/gui/popups/popupmenu.h @@ -187,7 +187,7 @@ class PopupMenu final : public Popup, public LinkHandler * Handles link action. */ void handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED) override final; + MouseEvent *event A_UNUSED) override final; void clear(); diff --git a/src/gui/popups/spellpopup.cpp b/src/gui/popups/spellpopup.cpp index df25739f2..cc55fef57 100644 --- a/src/gui/popups/spellpopup.cpp +++ b/src/gui/popups/spellpopup.cpp @@ -109,7 +109,7 @@ void SpellPopup::view(const int x, const int y) requestMoveToTop(); } -void SpellPopup::mouseMoved(gcn::MouseEvent &event) +void SpellPopup::mouseMoved(MouseEvent &event) { Popup::mouseMoved(event); diff --git a/src/gui/popups/spellpopup.h b/src/gui/popups/spellpopup.h index c8123a4ce..152dfb306 100644 --- a/src/gui/popups/spellpopup.h +++ b/src/gui/popups/spellpopup.h @@ -60,7 +60,7 @@ class SpellPopup final : public Popup */ void view(const int x, const int y); - void mouseMoved(gcn::MouseEvent &mouseEvent) override final; + void mouseMoved(MouseEvent &mouseEvent) override final; private: Label *mItemName; diff --git a/src/gui/popups/textpopup.cpp b/src/gui/popups/textpopup.cpp index 14f31f84f..245bf58b0 100644 --- a/src/gui/popups/textpopup.cpp +++ b/src/gui/popups/textpopup.cpp @@ -100,7 +100,7 @@ void TextPopup::show(const int x, const int y, const std::string &str1, requestMoveToTop(); } -void TextPopup::mouseMoved(gcn::MouseEvent &event) +void TextPopup::mouseMoved(MouseEvent &event) { Popup::mouseMoved(event); diff --git a/src/gui/popups/textpopup.h b/src/gui/popups/textpopup.h index 131921b7b..eb29cba61 100644 --- a/src/gui/popups/textpopup.h +++ b/src/gui/popups/textpopup.h @@ -72,7 +72,7 @@ class TextPopup final : public Popup void show(const int x, const int y, const std::string &str1, const std::string &str2, const std::string &str3); - void mouseMoved(gcn::MouseEvent &mouseEvent) override final; + void mouseMoved(MouseEvent &mouseEvent) override final; private: Label *mText[TEXTPOPUPCOUNT]; diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index b3cafa104..c3da988b7 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -280,13 +280,13 @@ void Viewport::_followMouse() if (mPlayerFollowMouse && (button & SDL_BUTTON(1))) { // We create a mouse event and send it to mouseDragged. - gcn::MouseEvent mouseEvent(nullptr, + MouseEvent mouseEvent(nullptr, 0, false, false, false, - gcn::MouseEvent::DRAGGED, - gcn::MouseEvent::LEFT, + MouseEvent::DRAGGED, + MouseEvent::LEFT, mMouseX, mMouseY, 0); @@ -385,7 +385,7 @@ void Viewport::_drawPath(Graphics *const graphics, const Path &path, #endif } -void Viewport::mousePressed(gcn::MouseEvent &event) +void Viewport::mousePressed(MouseEvent &event) { if (event.getSource() != this) return; @@ -406,7 +406,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event) const int pixelY = eventY + mPixelViewY; // Right click might open a popup - if (eventButton == gcn::MouseEvent::RIGHT) + if (eventButton == MouseEvent::RIGHT) { mPlayerFollowMouse = false; if (mHoverBeing) @@ -460,7 +460,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event) } // Left click can cause different actions - if (eventButton == gcn::MouseEvent::LEFT) + if (eventButton == MouseEvent::LEFT) { // Interact with some being if (mHoverBeing) @@ -532,7 +532,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event) _followMouse(); } } - else if (eventButton == gcn::MouseEvent::MIDDLE) + else if (eventButton == MouseEvent::MIDDLE) { mPlayerFollowMouse = false; validateSpeed(); @@ -548,7 +548,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event) } } -void Viewport::mouseDragged(gcn::MouseEvent &event) +void Viewport::mouseDragged(MouseEvent &event) { if (!mMap || !player_node) return; @@ -685,7 +685,7 @@ void Viewport::mouseDragged(gcn::MouseEvent &event) } } -void Viewport::mouseReleased(gcn::MouseEvent &event A_UNUSED) +void Viewport::mouseReleased(MouseEvent &event A_UNUSED) { mPlayerFollowMouse = false; // Only useful for eAthena but doesn't hurt under ManaServ @@ -838,7 +838,7 @@ void Viewport::optionChanged(const std::string &name) mMouseDirectionMove = config.getBoolValue("mouseDirectionMove"); } -void Viewport::mouseMoved(gcn::MouseEvent &event A_UNUSED) +void Viewport::mouseMoved(MouseEvent &event A_UNUSED) { // Check if we are on the map if (!mMap || !player_node || !actorManager) diff --git a/src/gui/viewport.h b/src/gui/viewport.h index 6fd062c35..2b297de37 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -103,22 +103,22 @@ class Viewport final : public WindowContainer, /** * Handles mouse press on map. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; /** * Handles mouse move on map */ - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; /** * Handles mouse button release on map. */ - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; /** * Handles mouse move on map. */ - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; /** * Shows a popup for an item. diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 9a1aa40ab..8e4d9e483 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -310,7 +310,7 @@ void AvatarListBox::draw(Graphics *graphics) BLOCK_END("AvatarListBox::draw") } -void AvatarListBox::mousePressed(gcn::MouseEvent &event) +void AvatarListBox::mousePressed(MouseEvent &event) { if (!actorManager || !player_node || !viewport || !getFont()->getHeight()) @@ -334,7 +334,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) return; const unsigned int eventButton = event.getButton(); - if (eventButton == gcn::MouseEvent::LEFT) + if (eventButton == MouseEvent::LEFT) { if (ava->getType() == AVATAR_PLAYER) { @@ -348,7 +348,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) player_node->navigateTo(ava->getX(), ava->getY()); } } - else if (eventButton == gcn::MouseEvent::RIGHT) + else if (eventButton == MouseEvent::RIGHT) { switch (ava->getType()) { @@ -407,7 +407,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) } } } - else if (eventButton == gcn::MouseEvent::MIDDLE) + else if (eventButton == MouseEvent::MIDDLE) { if (ava->getType() == AVATAR_PLAYER && chatWindow) { @@ -419,7 +419,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) } } -void AvatarListBox::mouseReleased(gcn::MouseEvent &event A_UNUSED) +void AvatarListBox::mouseReleased(MouseEvent &event A_UNUSED) { } diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h index ec384368c..d0449231b 100644 --- a/src/gui/widgets/avatarlistbox.h +++ b/src/gui/widgets/avatarlistbox.h @@ -55,9 +55,9 @@ public: */ void draw(Graphics *gcnGraphics) override final; - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; - void mouseReleased(gcn::MouseEvent &event A_UNUSED) override final; + void mouseReleased(MouseEvent &event A_UNUSED) override final; void optionChanged(const std::string &value) override final; diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index cfbc0ec41..c158171c0 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -423,7 +423,7 @@ struct MouseOverLink int mX, mY; }; -void BrowserBox::mousePressed(gcn::MouseEvent &event) +void BrowserBox::mousePressed(MouseEvent &event) { if (!mLinkHandler) return; @@ -438,7 +438,7 @@ void BrowserBox::mousePressed(gcn::MouseEvent &event) } } -void BrowserBox::mouseMoved(gcn::MouseEvent &event) +void BrowserBox::mouseMoved(MouseEvent &event) { const LinkIterator i = std::find_if(mLinks.begin(), mLinks.end(), MouseOverLink(event.getX(), event.getY())); diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h index fa3b90963..f1c1aa1f6 100644 --- a/src/gui/widgets/browserbox.h +++ b/src/gui/widgets/browserbox.h @@ -158,9 +158,9 @@ class BrowserBox final : public gcn::Widget, /** * Handles mouse actions. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; /** * Draws the browser box. diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index fecf551b2..8bc3d7540 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -525,9 +525,9 @@ void Button::draw(Graphics *graphics) BLOCK_END("Button::draw") } -void Button::mouseReleased(gcn::MouseEvent& mouseEvent) +void Button::mouseReleased(MouseEvent& mouseEvent) { - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() == MouseEvent::LEFT) { if (mStick) mPressed = !mPressed; diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index 5dc89ea4d..a9722f6a2 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -109,7 +109,7 @@ class Button final : public gcn::Button, */ static void updateAlpha(); - void mouseReleased(gcn::MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& mouseEvent) override final; void setDescription(std::string text) { mDescription = text; } diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp index 3f4a672f0..bdd740874 100644 --- a/src/gui/widgets/characterdisplay.cpp +++ b/src/gui/widgets/characterdisplay.cpp @@ -115,12 +115,12 @@ void CharacterDisplay::widgetHidden(const Event &event A_UNUSED) mPopup->setVisible(false); } -void CharacterDisplay::mouseExited(gcn::MouseEvent &event A_UNUSED) +void CharacterDisplay::mouseExited(MouseEvent &event A_UNUSED) { mPopup->setVisible(false); } -void CharacterDisplay::mouseMoved(gcn::MouseEvent &event A_UNUSED) +void CharacterDisplay::mouseMoved(MouseEvent &event A_UNUSED) { if (!gui) return; @@ -142,7 +142,7 @@ void CharacterDisplay::mouseMoved(gcn::MouseEvent &event A_UNUSED) } } -void CharacterDisplay::mousePressed(gcn::MouseEvent &event) +void CharacterDisplay::mousePressed(MouseEvent &event) { if (event.getClickCount() == 2) distributeActionEvent(); diff --git a/src/gui/widgets/characterdisplay.h b/src/gui/widgets/characterdisplay.h index 84a288ab0..8571363c3 100644 --- a/src/gui/widgets/characterdisplay.h +++ b/src/gui/widgets/characterdisplay.h @@ -75,11 +75,11 @@ class CharacterDisplay final : public Container, void widgetHidden(const Event &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; private: void update(); diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index 20310c4bc..9b67b0359 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -172,12 +172,12 @@ void CheckBox::drawBox(Graphics *const graphics) } } -void CheckBox::mouseEntered(gcn::MouseEvent& event A_UNUSED) +void CheckBox::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; } -void CheckBox::mouseExited(gcn::MouseEvent& event A_UNUSED) +void CheckBox::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; } diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index 2d1502552..3b0830cee 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -74,12 +74,12 @@ class CheckBox final : public gcn::CheckBox, /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event) override final; + void mouseEntered(MouseEvent& event) override final; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event) override final; + void mouseExited(MouseEvent& event) override final; void keyPressed(KeyEvent& keyEvent) override final; diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 9e3bca2fa..aca82cef4 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -357,10 +357,10 @@ void DropDown::hideDrop(bool event) mPopup->setVisible(false); } -void DropDown::mousePressed(gcn::MouseEvent& mouseEvent) +void DropDown::mousePressed(MouseEvent& mouseEvent) { // If we have a mouse press on the widget. - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT + if (mouseEvent.getButton() == MouseEvent::LEFT && !mDroppedDown && mouseEvent.getSource() == this) { mPushed = true; @@ -374,7 +374,7 @@ void DropDown::mousePressed(gcn::MouseEvent& mouseEvent) } } -void DropDown::mouseReleased(gcn::MouseEvent &mouseEvent) +void DropDown::mouseReleased(MouseEvent &mouseEvent) { if (mIsDragged) mPushed = false; @@ -385,12 +385,12 @@ void DropDown::mouseReleased(gcn::MouseEvent &mouseEvent) // Released outside of widget. Can happen when we have modal // input focus. if ((0 > y || y >= mDimension.height || x < 0 || x >= mDimension.width) - && button == gcn::MouseEvent::LEFT) + && button == MouseEvent::LEFT) { if (mIsDragged) foldUp(); } - else if (button == gcn::MouseEvent::LEFT) + else if (button == MouseEvent::LEFT) { mPushed = false; } @@ -398,19 +398,19 @@ void DropDown::mouseReleased(gcn::MouseEvent &mouseEvent) mIsDragged = false; } -void DropDown::mouseDragged(gcn::MouseEvent &mouseEvent) +void DropDown::mouseDragged(MouseEvent &mouseEvent) { mIsDragged = true; mouseEvent.consume(); } -void DropDown::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) +void DropDown::mouseWheelMovedUp(MouseEvent& mouseEvent) { setSelected(getSelected() - 1); mouseEvent.consume(); } -void DropDown::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) +void DropDown::mouseWheelMovedDown(MouseEvent& mouseEvent) { setSelected(getSelected() + 1); mouseEvent.consume(); diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index 58942bdb5..dd38a1730 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -93,15 +93,15 @@ class DropDown final : public ActionListener, // Inherited from MouseListener - void mousePressed(gcn::MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& mouseEvent) override final; - void mouseReleased(gcn::MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& mouseEvent) override final; - void mouseDragged(gcn::MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& mouseEvent) override final; - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; void setSelectedString(const std::string &str); diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 4b991bc34..693245c2f 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -157,12 +157,12 @@ void DropShortcutContainer::draw(Graphics *graphics) BLOCK_END("DropShortcutContainer::draw") } -void DropShortcutContainer::mouseDragged(gcn::MouseEvent &event) +void DropShortcutContainer::mouseDragged(MouseEvent &event) { if (!dropShortcut) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (dragDrop.isEmpty() && mItemClicked) { @@ -196,7 +196,7 @@ void DropShortcutContainer::mouseDragged(gcn::MouseEvent &event) } } -void DropShortcutContainer::mousePressed(gcn::MouseEvent &event) +void DropShortcutContainer::mousePressed(MouseEvent &event) { if (!dropShortcut || !inventoryWindow) return; @@ -207,7 +207,7 @@ void DropShortcutContainer::mousePressed(gcn::MouseEvent &event) return; const int eventButton = event.getButton(); - if (eventButton == gcn::MouseEvent::LEFT) + if (eventButton == MouseEvent::LEFT) { if (dropShortcut->getItem(index) > 0) { @@ -223,7 +223,7 @@ void DropShortcutContainer::mousePressed(gcn::MouseEvent &event) } } } - else if (eventButton == gcn::MouseEvent::RIGHT) + else if (eventButton == MouseEvent::RIGHT) { const Inventory *const inv = PlayerInfo::getInventory(); if (!inv) @@ -237,12 +237,12 @@ void DropShortcutContainer::mousePressed(gcn::MouseEvent &event) } } -void DropShortcutContainer::mouseReleased(gcn::MouseEvent &event) +void DropShortcutContainer::mouseReleased(MouseEvent &event) { if (!dropShortcut) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (dropShortcut->isItemSelected()) dropShortcut->setItemSelected(-1); @@ -269,7 +269,7 @@ void DropShortcutContainer::mouseReleased(gcn::MouseEvent &event) } // Show ItemTooltip -void DropShortcutContainer::mouseMoved(gcn::MouseEvent &event) +void DropShortcutContainer::mouseMoved(MouseEvent &event) { if (!dropShortcut) return; @@ -302,7 +302,7 @@ void DropShortcutContainer::mouseMoved(gcn::MouseEvent &event) } } -void DropShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) +void DropShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { if (mItemPopup) mItemPopup->setVisible(false); diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index 26cbdffa7..9880f526d 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -55,23 +55,23 @@ class DropShortcutContainer final : public ShortcutContainer /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; void widgetHidden(const Event &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; void setWidget2(const Widget2 *const widget) override final; diff --git a/src/gui/widgets/emotepage.cpp b/src/gui/widgets/emotepage.cpp index e255afc30..6456913a9 100644 --- a/src/gui/widgets/emotepage.cpp +++ b/src/gui/widgets/emotepage.cpp @@ -116,7 +116,7 @@ void EmotePage::draw(Graphics *graphics) BLOCK_END("EmotePage::draw") } -void EmotePage::mousePressed(gcn::MouseEvent &mouseEvent) +void EmotePage::mousePressed(MouseEvent &mouseEvent) { mSelectedIndex = getIndexFromGrid(mouseEvent.getX(), mouseEvent.getY()); distributeActionEvent(); diff --git a/src/gui/widgets/emotepage.h b/src/gui/widgets/emotepage.h index cb6fd8711..74f93e8d3 100644 --- a/src/gui/widgets/emotepage.h +++ b/src/gui/widgets/emotepage.h @@ -44,7 +44,7 @@ class EmotePage final : public gcn::Widget, void draw(Graphics *graphics) override final; - void mousePressed(gcn::MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &mouseEvent) override final; int getIndexFromGrid(const int x, const int y) const; diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index d00f01495..38c76060b 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -148,11 +148,11 @@ void EmoteShortcutContainer::draw(Graphics *graphics) BLOCK_END("EmoteShortcutContainer::draw") } -void EmoteShortcutContainer::mouseDragged(gcn::MouseEvent &event A_UNUSED) +void EmoteShortcutContainer::mouseDragged(MouseEvent &event A_UNUSED) { } -void EmoteShortcutContainer::mousePressed(gcn::MouseEvent &event) +void EmoteShortcutContainer::mousePressed(MouseEvent &event) { if (!emoteShortcut) return; @@ -174,12 +174,12 @@ void EmoteShortcutContainer::mousePressed(gcn::MouseEvent &event) } } -void EmoteShortcutContainer::mouseReleased(gcn::MouseEvent &event) +void EmoteShortcutContainer::mouseReleased(MouseEvent &event) { if (!emoteShortcut) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { const int index = getIndexFromGrid(event.getX(), event.getY()); @@ -206,7 +206,7 @@ void EmoteShortcutContainer::mouseReleased(gcn::MouseEvent &event) } } -void EmoteShortcutContainer::mouseMoved(gcn::MouseEvent &event) +void EmoteShortcutContainer::mouseMoved(MouseEvent &event) { if (!emoteShortcut || !mEmotePopup) return; @@ -226,7 +226,7 @@ void EmoteShortcutContainer::mouseMoved(gcn::MouseEvent &event) } } -void EmoteShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) +void EmoteShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { if (mEmotePopup) mEmotePopup->setVisible(false); diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h index 37ebe0cf9..ed6b4c8b3 100644 --- a/src/gui/widgets/emoteshortcutcontainer.h +++ b/src/gui/widgets/emoteshortcutcontainer.h @@ -58,21 +58,21 @@ class EmoteShortcutContainer final : public ShortcutContainer /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; void widgetHidden(const Event &event) override final; diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index bca93e7c2..5873ef4ce 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -463,12 +463,12 @@ void GuiTable::keyPressed(KeyEvent& keyEvent) } // -- MouseListener notifications -void GuiTable::mousePressed(gcn::MouseEvent& mouseEvent) +void GuiTable::mousePressed(MouseEvent& mouseEvent) { if (!mModel || !mSelectable) return; - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() == MouseEvent::LEFT) { const int row = getRowForY(mouseEvent.getY()); const int column = getColumnForX(mouseEvent.getX()); @@ -484,7 +484,7 @@ void GuiTable::mousePressed(gcn::MouseEvent& mouseEvent) } } -void GuiTable::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) +void GuiTable::mouseWheelMovedUp(MouseEvent& mouseEvent) { if (isFocused()) { @@ -495,7 +495,7 @@ void GuiTable::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) } } -void GuiTable::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) +void GuiTable::mouseWheelMovedDown(MouseEvent& mouseEvent) { if (isFocused()) { @@ -504,9 +504,9 @@ void GuiTable::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) } } -void GuiTable::mouseDragged(gcn::MouseEvent& mouseEvent) +void GuiTable::mouseDragged(MouseEvent& mouseEvent) { - if (mouseEvent.getButton() != gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() != MouseEvent::LEFT) return; // Make table selection update on drag diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index 766f7a3de..da367dd94 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -146,13 +146,13 @@ public: { return mOpaque; } // Inherited from MouseListener - void mousePressed(gcn::MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& mouseEvent) override final; - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; - void mouseDragged(gcn::MouseEvent& mouseEvent) override final; + void mouseDragged(MouseEvent& mouseEvent) override final; // Constraints inherited from TableModelListener void modelUpdated(const bool completed) override final; diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index b2fa6a47e..27a00798e 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -394,7 +394,7 @@ void ItemContainer::keyReleased(KeyEvent &event A_UNUSED) { } -void ItemContainer::mousePressed(gcn::MouseEvent &event) +void ItemContainer::mousePressed(MouseEvent &event) { if (!mInventory) return; @@ -402,7 +402,7 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) const int button = event.getButton(); mClicks = event.getClickCount(); - if (button == gcn::MouseEvent::LEFT || button == gcn::MouseEvent::RIGHT) + if (button == MouseEvent::LEFT || button == MouseEvent::RIGHT) { const int index = getSlotIndex(event.getX(), event.getY()); if (index == Inventory::NO_SLOT_INDEX) @@ -468,13 +468,13 @@ void ItemContainer::mousePressed(gcn::MouseEvent &event) } } -void ItemContainer::mouseDragged(gcn::MouseEvent &event A_UNUSED) +void ItemContainer::mouseDragged(MouseEvent &event A_UNUSED) { if (mSelectionStatus != SEL_NONE) mSelectionStatus = SEL_DRAGGING; } -void ItemContainer::mouseReleased(gcn::MouseEvent &event) +void ItemContainer::mouseReleased(MouseEvent &event) { if (mClicks == 2) return; @@ -594,7 +594,7 @@ void ItemContainer::mouseReleased(gcn::MouseEvent &event) } } -void ItemContainer::mouseMoved(gcn::MouseEvent &event) +void ItemContainer::mouseMoved(MouseEvent &event) { if (!mInventory) return; @@ -613,7 +613,7 @@ void ItemContainer::mouseMoved(gcn::MouseEvent &event) } } -void ItemContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) +void ItemContainer::mouseExited(MouseEvent &event A_UNUSED) { mItemPopup->setVisible(false); } diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index bc1bee695..4f530320d 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -89,11 +89,11 @@ class ItemContainer final : public gcn::Widget, void keyReleased(KeyEvent &event) override final; // MouseListener - void mousePressed(gcn::MouseEvent &event) override final; - void mouseDragged(gcn::MouseEvent &event) override final; - void mouseReleased(gcn::MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; // WidgetListener void widgetResized(const Event &event) override final; diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index 108444bb0..deb3b4451 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -75,8 +75,7 @@ ItemLinkHandler::~ItemLinkHandler() mItemPopup = nullptr; } -void ItemLinkHandler::handleLink(const std::string &link, - gcn::MouseEvent *event) +void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event) { if (strStartWith(link, "http://") || strStartWith(link, "https://")) { diff --git a/src/gui/widgets/itemlinkhandler.h b/src/gui/widgets/itemlinkhandler.h index 4e55a8f72..39e811721 100644 --- a/src/gui/widgets/itemlinkhandler.h +++ b/src/gui/widgets/itemlinkhandler.h @@ -39,7 +39,7 @@ class ItemLinkHandler final : public LinkHandler ~ItemLinkHandler(); void handleLink(const std::string &link, - gcn::MouseEvent *event) override final; + MouseEvent *event) override final; private: ItemPopup *mItemPopup; diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index ef4d8ebfa..984803a99 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -233,13 +233,13 @@ void ItemShortcutContainer::draw(Graphics *graphics) BLOCK_END("ItemShortcutContainer::draw") } -void ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event) +void ItemShortcutContainer::mouseDragged(MouseEvent &event) { ItemShortcut *const selShortcut = itemShortcut[mNumber]; if (!selShortcut) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (dragDrop.isEmpty() && mItemClicked) { @@ -321,7 +321,7 @@ void ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event) } } -void ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) +void ItemShortcutContainer::mousePressed(MouseEvent &event) { ItemShortcut *const selShortcut = itemShortcut[mNumber]; if (!selShortcut) @@ -332,7 +332,7 @@ void ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) if (index == -1) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { // Stores the selected item if theirs one. if (selShortcut->isItemSelected() && inventoryWindow && @@ -350,7 +350,7 @@ void ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) mItemClicked = true; } } - else if (event.getButton() == gcn::MouseEvent::RIGHT) + else if (event.getButton() == MouseEvent::RIGHT) { if (viewport && selShortcut) { @@ -360,13 +360,13 @@ void ItemShortcutContainer::mousePressed(gcn::MouseEvent &event) } } -void ItemShortcutContainer::mouseReleased(gcn::MouseEvent &event) +void ItemShortcutContainer::mouseReleased(MouseEvent &event) { ItemShortcut *const selShortcut = itemShortcut[mNumber]; if (!selShortcut) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (selShortcut->isItemSelected()) selShortcut->setItemSelected(-1); @@ -402,7 +402,7 @@ void ItemShortcutContainer::mouseReleased(gcn::MouseEvent &event) } } -void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event) +void ItemShortcutContainer::mouseMoved(MouseEvent &event) { const ItemShortcut *const selShortcut = itemShortcut[mNumber]; if (!selShortcut) @@ -459,7 +459,7 @@ void ItemShortcutContainer::mouseMoved(gcn::MouseEvent &event) } // Hide ItemTooltip -void ItemShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) +void ItemShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { if (mItemPopup) mItemPopup->setVisible(false); diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index 5efda0433..f01c2779c 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -56,23 +56,23 @@ class ItemShortcutContainer final : public ShortcutContainer /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; void widgetHidden(const Event &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; void setWidget2(const Widget2 *const widget); diff --git a/src/gui/widgets/linkhandler.h b/src/gui/widgets/linkhandler.h index 2f3a6e53f..b373162a3 100644 --- a/src/gui/widgets/linkhandler.h +++ b/src/gui/widgets/linkhandler.h @@ -38,7 +38,7 @@ class LinkHandler { } virtual void handleLink(const std::string &link, - gcn::MouseEvent *event) = 0; + MouseEvent *event) = 0; }; #endif // GUI_WIDGETS_LINKHANDLER_H diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 1e97b6e8a..52ff775be 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -214,20 +214,20 @@ void ListBox::keyPressed(KeyEvent &keyEvent) // Don't do anything on scrollwheel. ScrollArea will deal with that. -void ListBox::mouseWheelMovedUp(gcn::MouseEvent &mouseEvent A_UNUSED) +void ListBox::mouseWheelMovedUp(MouseEvent &mouseEvent A_UNUSED) { } -void ListBox::mouseWheelMovedDown(gcn::MouseEvent &mouseEvent A_UNUSED) +void ListBox::mouseWheelMovedDown(MouseEvent &mouseEvent A_UNUSED) { } -void ListBox::mousePressed(gcn::MouseEvent &event) +void ListBox::mousePressed(MouseEvent &event) { mPressedIndex = getSelectionByMouse(event.getY()); } -void ListBox::mouseReleased(gcn::MouseEvent &event) +void ListBox::mouseReleased(MouseEvent &event) { if (mPressedIndex != getSelectionByMouse(event.getY())) return; @@ -262,18 +262,18 @@ void ListBox::mouseReleased(gcn::MouseEvent &event) mPressedIndex = -2; } -void ListBox::mouseReleased1(const gcn::MouseEvent &mouseEvent) +void ListBox::mouseReleased1(const MouseEvent &mouseEvent) { - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() == MouseEvent::LEFT) { setSelected(std::max(0, getSelectionByMouse(mouseEvent.getY()))); distributeActionEvent(); } } -void ListBox::mouseDragged(gcn::MouseEvent &event) +void ListBox::mouseDragged(MouseEvent &event) { - if (event.getButton() != gcn::MouseEvent::LEFT || getRowHeight() == 0) + if (event.getButton() != MouseEvent::LEFT || getRowHeight() == 0) return; // Make list selection update on drag, but guard against negative y diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index 883814456..adf266f7e 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -71,17 +71,17 @@ class ListBox : public gcn::ListBox, // Inherited from MouseListener - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; - void mousePressed(gcn::MouseEvent &event) override; + void mousePressed(MouseEvent &event) override; - void mouseReleased(gcn::MouseEvent &event) override; + void mouseReleased(MouseEvent &event) override; - void mouseReleased1(const gcn::MouseEvent &event); + void mouseReleased1(const MouseEvent &event); - void mouseDragged(gcn::MouseEvent &event) override; + void mouseDragged(MouseEvent &event) override; void refocus(); diff --git a/src/gui/widgets/mouseevent.h b/src/gui/widgets/mouseevent.h deleted file mode 100644 index d98a70130..000000000 --- a/src/gui/widgets/mouseevent.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2014 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef GUI_WIDGETS_MOUSEEVENT_H -#define GUI_WIDGETS_MOUSEEVENT_H - -#include "gui/base/mouseevent.hpp" -#include "gui/base/widget.hpp" - -class MouseEvent final : public gcn::MouseEvent -{ - public: - MouseEvent(gcn::Widget* source, bool shiftPressed, - bool controlPressed, bool altPressed, - bool metaPressed, unsigned int type, unsigned int button, - int x, int y, int clickCount) : - gcn::MouseEvent(source, shiftPressed, controlPressed, - altPressed, metaPressed, type, button, x, y, - clickCount) - { - } - - void setX(int n) - { mX = n; } - - void setY(int n) - { mY = n; } -}; - -#endif // GUI_WIDGETS_MOUSEEVENT_H diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index 0639fe1b0..3bcb8476e 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -147,10 +147,10 @@ void PlayerBox::drawFrame(Graphics *graphics) BLOCK_END("PlayerBox::drawFrame") } -void PlayerBox::mouseReleased(gcn::MouseEvent& event) +void PlayerBox::mouseReleased(MouseEvent& event) { ScrollArea::mouseReleased(event); - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (!mActionEventId.empty()) distributeActionEvent(); diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h index 9671715b0..30d79ff2f 100644 --- a/src/gui/widgets/playerbox.h +++ b/src/gui/widgets/playerbox.h @@ -84,7 +84,7 @@ class PlayerBox final : public Widget2, void setSelected(bool b) { mSelected = b; } - void mouseReleased(gcn::MouseEvent& event) override final; + void mouseReleased(MouseEvent& event) override final; private: Being *mBeing; diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 7036968ad..a61ba5275 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -231,7 +231,7 @@ void Popup::position(const int x, const int y) mRedraw = true; } -void Popup::mouseMoved(gcn::MouseEvent &event A_UNUSED) +void Popup::mouseMoved(MouseEvent &event A_UNUSED) { if (viewport) viewport->hideBeingPopup(); diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index e467783ef..d64bc4b3f 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -88,7 +88,7 @@ class Popup : public Container, */ void setLocationRelativeTo(const gcn::Widget *const widget); - void mouseMoved(gcn::MouseEvent &event) override; + void mouseMoved(MouseEvent &event) override; /** * Sets the minimum width of the popup. diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp index 37dd6b1ec..62bc2f448 100644 --- a/src/gui/widgets/popuplist.cpp +++ b/src/gui/widgets/popuplist.cpp @@ -129,13 +129,13 @@ void PopupList::adjustSize() mListBox->setWidth(width); } -void PopupList::mousePressed(gcn::MouseEvent& mouseEvent) +void PopupList::mousePressed(MouseEvent& mouseEvent) { mPressedIndex = mListBox->getSelectionByMouse( mouseEvent.getY() + mPadding); } -void PopupList::mouseReleased(gcn::MouseEvent& mouseEvent) +void PopupList::mouseReleased(MouseEvent& mouseEvent) { if (mPressedIndex != mListBox->getSelectionByMouse( mouseEvent.getY() + mPadding)) diff --git a/src/gui/widgets/popuplist.h b/src/gui/widgets/popuplist.h index 31308fff8..45f52d3b3 100644 --- a/src/gui/widgets/popuplist.h +++ b/src/gui/widgets/popuplist.h @@ -66,9 +66,9 @@ class PopupList final : public Popup, void focusLost(const Event& event A_UNUSED) override final; - void mousePressed(gcn::MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& mouseEvent) override final; - void mouseReleased(gcn::MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& mouseEvent) override final; private: gcn::ListModel *mListModel; diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index afcd98d67..2fec7a9f6 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -168,12 +168,12 @@ void RadioButton::draw(Graphics* graphics) BLOCK_END("RadioButton::draw") } -void RadioButton::mouseEntered(gcn::MouseEvent& event A_UNUSED) +void RadioButton::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; } -void RadioButton::mouseExited(gcn::MouseEvent& event A_UNUSED) +void RadioButton::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; } diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h index 9802fb5fd..6c33447c4 100644 --- a/src/gui/widgets/radiobutton.h +++ b/src/gui/widgets/radiobutton.h @@ -67,12 +67,12 @@ class RadioButton final : public gcn::RadioButton, /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event) override final; + void mouseEntered(MouseEvent& event) override final; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event) override final; + void mouseExited(MouseEvent& event) override final; void keyPressed(KeyEvent& keyEvent) override final; diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 73ff82be0..0ee2c3357 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -651,18 +651,18 @@ void ScrollArea::calcHMarker(Graphics *const graphics) } } -void ScrollArea::mouseMoved(gcn::MouseEvent& event) +void ScrollArea::mouseMoved(MouseEvent& event) { mX = event.getX(); mY = event.getY(); } -void ScrollArea::mouseEntered(gcn::MouseEvent& event A_UNUSED) +void ScrollArea::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; } -void ScrollArea::mouseExited(gcn::MouseEvent& event A_UNUSED) +void ScrollArea::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; } @@ -684,7 +684,7 @@ void ScrollArea::widgetMoved(const Event& event A_UNUSED) mRedraw = true; } -void ScrollArea::mousePressed(gcn::MouseEvent& event) +void ScrollArea::mousePressed(MouseEvent& event) { const int x = event.getX(); const int y = event.getY(); @@ -754,16 +754,16 @@ void ScrollArea::mousePressed(gcn::MouseEvent& event) } } - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { mClickX = event.getX(); mClickY = event.getY(); } } -void ScrollArea::mouseReleased(gcn::MouseEvent& event) +void ScrollArea::mouseReleased(MouseEvent& event) { - if (event.getButton() == gcn::MouseEvent::LEFT && mClickX && mClickY) + if (event.getButton() == MouseEvent::LEFT && mClickX && mClickY) { if (!event.isConsumed()) { @@ -822,7 +822,7 @@ void ScrollArea::mouseReleased(gcn::MouseEvent& event) mRedraw = true; } -void ScrollArea::mouseDragged(gcn::MouseEvent &event) +void ScrollArea::mouseDragged(MouseEvent &event) { if (mIsVerticalMarkerDragged) { diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 7bf7e811c..3f6195271 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -106,23 +106,23 @@ class ScrollArea final : public gcn::ScrollArea, /** * Called when the mouse moves in the widget area. */ - void mouseMoved(gcn::MouseEvent& event) override final; + void mouseMoved(MouseEvent& event) override final; /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event) override final; + void mouseEntered(MouseEvent& event) override final; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event) override final; + void mouseExited(MouseEvent& event) override final; - void mousePressed(gcn::MouseEvent& event) override final; + void mousePressed(MouseEvent& event) override final; - void mouseReleased(gcn::MouseEvent& event) override final; + void mouseReleased(MouseEvent& event) override final; - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; void widgetResized(const Event &event) override final; diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index 8f45abeb3..f364aaf46 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -189,7 +189,7 @@ void ShopListBox::setPriceCheck(const bool check) mPriceCheck = check; } -void ShopListBox::mouseMoved(gcn::MouseEvent &event) +void ShopListBox::mouseMoved(MouseEvent &event) { if (!mItemPopup || !mRowHeight) return; @@ -221,10 +221,10 @@ void ShopListBox::mouseMoved(gcn::MouseEvent &event) } } -void ShopListBox::mouseReleased(gcn::MouseEvent& mouseEvent) +void ShopListBox::mouseReleased(MouseEvent& mouseEvent) { ListBox::mouseReleased(mouseEvent); - if (mouseEvent.getButton() == gcn::MouseEvent::RIGHT) + if (mouseEvent.getButton() == MouseEvent::RIGHT) { setSelected(std::max(0, getSelectionByMouse(mouseEvent.getY()))); @@ -236,7 +236,7 @@ void ShopListBox::mouseReleased(gcn::MouseEvent& mouseEvent) } } -void ShopListBox::mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) +void ShopListBox::mouseExited(MouseEvent& mouseEvent A_UNUSED) { if (!mItemPopup) return; diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h index 509af8393..1cf628cca 100644 --- a/src/gui/widgets/shoplistbox.h +++ b/src/gui/widgets/shoplistbox.h @@ -74,11 +74,11 @@ class ShopListBox final : public ListBox */ void setPriceCheck(const bool check); - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mouseReleased(gcn::MouseEvent& mouseEvent) override final; + void mouseReleased(MouseEvent& mouseEvent) override final; - void mouseExited(gcn::MouseEvent& mouseEvent) override final; + void mouseExited(MouseEvent& mouseEvent) override final; void setProtectItems(bool p) { mProtectItems = p; } diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h index 2c237f513..e7ec2ff62 100644 --- a/src/gui/widgets/shortcutcontainer.h +++ b/src/gui/widgets/shortcutcontainer.h @@ -66,21 +66,21 @@ class ShortcutContainer : public gcn::Widget, /** * Handles mouse when dragged. */ - virtual void mouseDragged(gcn::MouseEvent &event A_UNUSED) override + virtual void mouseDragged(MouseEvent &event A_UNUSED) override { } /** * Handles mouse when pressed. */ - virtual void mousePressed(gcn::MouseEvent &event A_UNUSED) override + virtual void mousePressed(MouseEvent &event A_UNUSED) override { } /** * Handles mouse release. */ - virtual void mouseReleased(gcn::MouseEvent &event A_UNUSED) override + virtual void mouseReleased(MouseEvent &event A_UNUSED) override { } diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index 8cc454c10..02ebc2ccb 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -272,21 +272,21 @@ void Slider::draw(Graphics *graphics) BLOCK_END("Slider::draw") } -void Slider::mouseEntered(gcn::MouseEvent& event A_UNUSED) +void Slider::mouseEntered(MouseEvent& event A_UNUSED) { mHasMouse = true; mRedraw = true; } -void Slider::mouseExited(gcn::MouseEvent& event A_UNUSED) +void Slider::mouseExited(MouseEvent& event A_UNUSED) { mHasMouse = false; mRedraw = true; } -void Slider::mousePressed(gcn::MouseEvent &mouseEvent) +void Slider::mousePressed(MouseEvent &mouseEvent) { - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT + if (mouseEvent.getButton() == MouseEvent::LEFT && mouseEvent.getX() >= 0 && mouseEvent.getX() <= getWidth() && mouseEvent.getY() >= 0 @@ -307,7 +307,7 @@ void Slider::mousePressed(gcn::MouseEvent &mouseEvent) } } -void Slider::mouseDragged(gcn::MouseEvent &mouseEvent) +void Slider::mouseDragged(MouseEvent &mouseEvent) { if (getOrientation() == HORIZONTAL) { @@ -325,7 +325,7 @@ void Slider::mouseDragged(gcn::MouseEvent &mouseEvent) mouseEvent.consume(); } -void Slider::mouseWheelMovedUp(gcn::MouseEvent &mouseEvent) +void Slider::mouseWheelMovedUp(MouseEvent &mouseEvent) { setValue2(getValue() + getStepLength()); distributeActionEvent(); @@ -333,7 +333,7 @@ void Slider::mouseWheelMovedUp(gcn::MouseEvent &mouseEvent) mouseEvent.consume(); } -void Slider::mouseWheelMovedDown(gcn::MouseEvent &mouseEvent) +void Slider::mouseWheelMovedDown(MouseEvent &mouseEvent) { setValue2(getValue() - getStepLength()); distributeActionEvent(); diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h index 38c149560..2d4853539 100644 --- a/src/gui/widgets/slider.h +++ b/src/gui/widgets/slider.h @@ -70,20 +70,20 @@ class Slider final : public gcn::Slider, /** * Called when the mouse enteres the widget area. */ - void mouseEntered(gcn::MouseEvent& event) override final; + void mouseEntered(MouseEvent& event) override final; /** * Called when the mouse leaves the widget area. */ - void mouseExited(gcn::MouseEvent& event) override final; + void mouseExited(MouseEvent& event) override final; - void mousePressed(gcn::MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &mouseEvent) override final; - void mouseDragged(gcn::MouseEvent &mouseEvent) override final; + void mouseDragged(MouseEvent &mouseEvent) override final; - void mouseWheelMovedUp(gcn::MouseEvent &mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent &mouseEvent) override final; - void mouseWheelMovedDown(gcn::MouseEvent &mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent &mouseEvent) override final; void keyPressed(KeyEvent& keyEvent) override final; diff --git a/src/gui/widgets/sliderlist.cpp b/src/gui/widgets/sliderlist.cpp index eee012120..988db85dd 100644 --- a/src/gui/widgets/sliderlist.cpp +++ b/src/gui/widgets/sliderlist.cpp @@ -80,13 +80,13 @@ void SliderList::updateAlpha() Button::updateAlpha(); } -void SliderList::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) +void SliderList::mouseWheelMovedUp(MouseEvent& mouseEvent) { setSelected(mSelectedIndex - 1); mouseEvent.consume(); } -void SliderList::mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) +void SliderList::mouseWheelMovedDown(MouseEvent& mouseEvent) { setSelected(mSelectedIndex + 1); mouseEvent.consume(); diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h index 952b6c337..785ada74b 100644 --- a/src/gui/widgets/sliderlist.h +++ b/src/gui/widgets/sliderlist.h @@ -50,9 +50,9 @@ class SliderList final : public Container, void updateAlpha(); - void mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedUp(MouseEvent& mouseEvent) override final; - void mouseWheelMovedDown(gcn::MouseEvent& mouseEvent) override final; + void mouseWheelMovedDown(MouseEvent& mouseEvent) override final; void resize(); diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index ee76ee5dd..511360b91 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -146,9 +146,9 @@ void SpellShortcutContainer::draw(Graphics *graphics) BLOCK_END("SpellShortcutContainer::draw") } -void SpellShortcutContainer::mouseDragged(gcn::MouseEvent &event) +void SpellShortcutContainer::mouseDragged(MouseEvent &event) { - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (dragDrop.isEmpty() && mSpellClicked) { @@ -177,7 +177,7 @@ void SpellShortcutContainer::mouseDragged(gcn::MouseEvent &event) } } -void SpellShortcutContainer::mousePressed(gcn::MouseEvent &event) +void SpellShortcutContainer::mousePressed(MouseEvent &event) { const int index = getIndexFromGrid(event.getX(), event.getY()); @@ -185,16 +185,16 @@ void SpellShortcutContainer::mousePressed(gcn::MouseEvent &event) return; const unsigned int eventButton = event.getButton(); - if (eventButton == gcn::MouseEvent::LEFT) + if (eventButton == MouseEvent::LEFT) { const int itemId = getItemByIndex(index); if (itemId > 0) mSpellClicked = true; } - else if (eventButton == gcn::MouseEvent::RIGHT) + else if (eventButton == MouseEvent::RIGHT) { } - else if (eventButton == gcn::MouseEvent::MIDDLE) + else if (eventButton == MouseEvent::MIDDLE) { if (!spellShortcut || !spellManager) return; @@ -204,7 +204,7 @@ void SpellShortcutContainer::mousePressed(gcn::MouseEvent &event) } } -void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event) +void SpellShortcutContainer::mouseReleased(MouseEvent &event) { if (!spellShortcut || !spellManager) return; @@ -220,7 +220,7 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event) const int itemId = getItemByIndex(index); const unsigned int eventButton = event.getButton(); - if (eventButton == gcn::MouseEvent::LEFT) + if (eventButton == MouseEvent::LEFT) { mSpellClicked = false; @@ -272,7 +272,7 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event) } } } - else if (eventButton == gcn::MouseEvent::RIGHT) + else if (eventButton == MouseEvent::RIGHT) { TextCommand *spell = nullptr; if (itemId >= 0) @@ -284,7 +284,7 @@ void SpellShortcutContainer::mouseReleased(gcn::MouseEvent &event) } // Show ItemTooltip -void SpellShortcutContainer::mouseMoved(gcn::MouseEvent &event) +void SpellShortcutContainer::mouseMoved(MouseEvent &event) { if (!mSpellPopup || !spellShortcut || !spellManager) return; @@ -308,7 +308,7 @@ void SpellShortcutContainer::mouseMoved(gcn::MouseEvent &event) } } -void SpellShortcutContainer::mouseExited(gcn::MouseEvent &event A_UNUSED) +void SpellShortcutContainer::mouseExited(MouseEvent &event A_UNUSED) { if (mSpellPopup) mSpellPopup->setVisible(false); diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h index b5968dfe5..d8f5d22b4 100644 --- a/src/gui/widgets/spellshortcutcontainer.h +++ b/src/gui/widgets/spellshortcutcontainer.h @@ -55,23 +55,23 @@ class SpellShortcutContainer final : public ShortcutContainer /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; /** * Handles mouse release. */ - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; void widgetHidden(const Event &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; void setWidget2(const Widget2 *const widget) override final; diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 6a5febea6..83df191d1 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -324,12 +324,12 @@ void TabbedArea::logic() BLOCK_END("TabbedArea::logic") } -void TabbedArea::mousePressed(gcn::MouseEvent &mouseEvent) +void TabbedArea::mousePressed(MouseEvent &mouseEvent) { if (mouseEvent.isConsumed()) return; - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() == MouseEvent::LEFT) { gcn::Widget *const widget = mTabContainer->getWidgetAt( mouseEvent.getX(), mouseEvent.getY()); diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index de470e89d..2fb894f6f 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -155,7 +155,7 @@ class TabbedArea final : public Widget2, // Inherited from MouseListener - void mousePressed(gcn::MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &mouseEvent) override final; void enableScrollButtons(const bool enable); diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp index db5ddf6b4..a85b7927b 100644 --- a/src/gui/widgets/tabs/tab.cpp +++ b/src/gui/widgets/tabs/tab.cpp @@ -327,12 +327,12 @@ const std::string &Tab::getCaption() const return mLabel->getCaption(); } -void Tab::mouseEntered(gcn::MouseEvent& mouseEvent A_UNUSED) +void Tab::mouseEntered(MouseEvent& mouseEvent A_UNUSED) { mHasMouse = true; } -void Tab::mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) +void Tab::mouseExited(MouseEvent& mouseEvent A_UNUSED) { mHasMouse = false; } diff --git a/src/gui/widgets/tabs/tab.h b/src/gui/widgets/tabs/tab.h index e979c71b8..d22c6bea5 100644 --- a/src/gui/widgets/tabs/tab.h +++ b/src/gui/widgets/tabs/tab.h @@ -149,9 +149,9 @@ class Tab : public gcn::BasicContainer, const std::string &getCaption() const A_WARN_UNUSED; - void mouseEntered(gcn::MouseEvent &mouseEvent) override final; + void mouseEntered(MouseEvent &mouseEvent) override final; - void mouseExited(gcn::MouseEvent &mouseEvent) override final; + void mouseExited(MouseEvent &mouseEvent) override final; void setImage(Image *const image); diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index aa554b30f..0d01df51d 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -726,13 +726,13 @@ void TextField::fontChanged() fixScroll(); } -void TextField::mousePressed(gcn::MouseEvent &mouseEvent) +void TextField::mousePressed(MouseEvent &mouseEvent) { #ifdef ANDROID if (!client->isKeyboardVisible()) inputManager.executeAction(Input::KEY_SHOW_KEYBOARD); #endif - if (mouseEvent.getButton() == gcn::MouseEvent::RIGHT) + if (mouseEvent.getButton() == MouseEvent::RIGHT) { if (viewport) { diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index 71285bd64..ed08de2fa 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -118,7 +118,7 @@ class TextField : public gcn::TextField, void setCaretPosition(unsigned int position); - void mousePressed(gcn::MouseEvent &mouseEvent) override final; + void mousePressed(MouseEvent &mouseEvent) override final; void handlePaste(); diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 54c18bd52..e9e1ed71e 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -631,7 +631,7 @@ void Window::setVisible(const bool visible, const bool forceSticky) soundManager.playGuiSound(SOUND_SHOW_WINDOW); if (gui) { - gcn::MouseEvent *const event = reinterpret_cast<gcn::MouseEvent*>( + MouseEvent *const event = reinterpret_cast<MouseEvent*>( gui->createMouseEvent(this)); if (event) { @@ -658,12 +658,12 @@ void Window::scheduleDelete() windowContainer->scheduleDelete(this); } -void Window::mousePressed(gcn::MouseEvent &event) +void Window::mousePressed(MouseEvent &event) { // Let Guichan move window to top and figure out title bar drag gcn::Window::mousePressed(event); - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { const int x = event.getX(); const int y = event.getY(); @@ -701,7 +701,7 @@ void Window::close() setVisible(false); } -void Window::mouseReleased(gcn::MouseEvent &event A_UNUSED) +void Window::mouseReleased(MouseEvent &event A_UNUSED) { if (mGrip && mouseResize) { @@ -714,18 +714,18 @@ void Window::mouseReleased(gcn::MouseEvent &event A_UNUSED) mMoved = false; } -void Window::mouseEntered(gcn::MouseEvent &event) +void Window::mouseEntered(MouseEvent &event) { updateResizeHandler(event); } -void Window::mouseExited(gcn::MouseEvent &event A_UNUSED) +void Window::mouseExited(MouseEvent &event A_UNUSED) { if (mGrip && !mouseResize && gui) gui->setCursorType(Cursor::CURSOR_POINTER); } -void Window::updateResizeHandler(gcn::MouseEvent &event) +void Window::updateResizeHandler(MouseEvent &event) { if (!gui) return; @@ -760,7 +760,7 @@ void Window::updateResizeHandler(gcn::MouseEvent &event) } } -void Window::mouseMoved(gcn::MouseEvent &event) +void Window::mouseMoved(MouseEvent &event) { updateResizeHandler(event); if (viewport) @@ -772,7 +772,7 @@ bool Window::canMove() const return !mStickyButtonLock || !mSticky; } -void Window::mouseDragged(gcn::MouseEvent &event) +void Window::mouseDragged(MouseEvent &event) { if (canMove()) { @@ -1088,7 +1088,7 @@ void Window::adjustSizeToScreen() widgetResized(Event(this)); } -int Window::getResizeHandles(const gcn::MouseEvent &event) +int Window::getResizeHandles(const MouseEvent &event) { if (event.getX() < 0 || event.getY() < 0) return 0; @@ -1125,7 +1125,7 @@ int Window::getResizeHandles(const gcn::MouseEvent &event) return resizeHandles; } -bool Window::isResizeAllowed(const gcn::MouseEvent &event) const +bool Window::isResizeAllowed(const MouseEvent &event) const { const int y = event.getY(); diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 0c3b69880..a5b6be83c 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -257,35 +257,35 @@ class Window : public gcn::Window, /** * Starts window resizing when appropriate. */ - void mousePressed(gcn::MouseEvent &event) override; + void mousePressed(MouseEvent &event) override; /** * Implements window resizing and makes sure the window is not * dragged/resized outside of the screen. */ - void mouseDragged(gcn::MouseEvent &event) override; + void mouseDragged(MouseEvent &event) override; /** * Implements custom cursor image changing context, based on mouse * relative position. */ - void mouseMoved(gcn::MouseEvent &event) override; + void mouseMoved(MouseEvent &event) override; /** * When the mouse button has been let go, this ensures that the mouse * custom cursor is restored back to it's standard image. */ - void mouseReleased(gcn::MouseEvent &event) override; + void mouseReleased(MouseEvent &event) override; /** * When the mouse leaves the window this ensures that the custom cursor * is restored back to it's standard image. */ - void mouseExited(gcn::MouseEvent &event) override; + void mouseExited(MouseEvent &event) override; - void mouseEntered(gcn::MouseEvent &event) override; + void mouseEntered(MouseEvent &event) override; - void updateResizeHandler(gcn::MouseEvent &event); + void updateResizeHandler(MouseEvent &event); /** * Sets the name of the window. This is not the window title. @@ -410,7 +410,7 @@ class Window : public gcn::Window, gcn::Rectangle getWindowArea() const A_WARN_UNUSED; - bool isResizeAllowed(const gcn::MouseEvent &event) const A_WARN_UNUSED; + bool isResizeAllowed(const MouseEvent &event) const A_WARN_UNUSED; void setCaptionFont(gcn::Font *font) { mCaptionFont = font; } @@ -474,7 +474,7 @@ class Window : public gcn::Window, * * @see ResizeHandles */ - int getResizeHandles(const gcn::MouseEvent &event) A_WARN_UNUSED; + int getResizeHandles(const MouseEvent &event) A_WARN_UNUSED; Image *mGrip; /**< Resize grip */ Window *mParent; /**< The parent window */ diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index e04eb210f..4417f18a6 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -248,12 +248,12 @@ void WindowMenu::addButton(const char *const text, mButtonTexts.push_back(new ButtonText(description, key)); } -void WindowMenu::mousePressed(gcn::MouseEvent &event) +void WindowMenu::mousePressed(MouseEvent &event) { if (!viewport) return; - if (!mSmallWindow && event.getButton() == gcn::MouseEvent::RIGHT) + if (!mSmallWindow && event.getButton() == MouseEvent::RIGHT) { Button *const btn = dynamic_cast<Button*>(event.getSource()); if (!btn) @@ -266,7 +266,7 @@ void WindowMenu::mousePressed(gcn::MouseEvent &event) } } -void WindowMenu::mouseMoved(gcn::MouseEvent &event) +void WindowMenu::mouseMoved(MouseEvent &event) { mHaveMouse = true; @@ -305,7 +305,7 @@ void WindowMenu::mouseMoved(gcn::MouseEvent &event) } } -void WindowMenu::mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) +void WindowMenu::mouseExited(MouseEvent& mouseEvent A_UNUSED) { mHaveMouse = false; if (!mTextPopup) diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h index 9375eb15d..1f2d8adb2 100644 --- a/src/gui/windowmenu.h +++ b/src/gui/windowmenu.h @@ -90,11 +90,11 @@ class WindowMenu final : public Container, void action(const ActionEvent &event) override final; - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) override final; + void mouseExited(MouseEvent& mouseEvent A_UNUSED) override final; std::map <std::string, ButtonInfo*> &getButtonNames() A_WARN_UNUSED { return mButtonNames; } diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 1e71c50ae..cbff544fc 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -771,12 +771,12 @@ void ChatWindow::scroll(const int amount) const tab->scroll(amount); } -void ChatWindow::mousePressed(gcn::MouseEvent &event) +void ChatWindow::mousePressed(MouseEvent &event) { if (event.isConsumed()) return; - if (event.getButton() == gcn::MouseEvent::RIGHT) + if (event.getButton() == MouseEvent::RIGHT) { if (viewport) { @@ -805,7 +805,7 @@ void ChatWindow::mousePressed(gcn::MouseEvent &event) if (event.isConsumed()) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { const ChatTab *const tab = getFocused(); if (tab) @@ -816,7 +816,7 @@ void ChatWindow::mousePressed(gcn::MouseEvent &event) mDragOffsetY = event.getY(); } -void ChatWindow::mouseDragged(gcn::MouseEvent &event) +void ChatWindow::mouseDragged(MouseEvent &event) { Window::mouseDragged(event); @@ -1885,19 +1885,19 @@ void ChatWindow::optionChanged(const std::string &name) parseGlobalsFilter(); } -void ChatWindow::mouseMoved(gcn::MouseEvent &event) +void ChatWindow::mouseMoved(MouseEvent &event) { mHaveMouse = true; Window::mouseMoved(event); } -void ChatWindow::mouseEntered(gcn::MouseEvent& mouseEvent) +void ChatWindow::mouseEntered(MouseEvent& mouseEvent) { mHaveMouse = true; Window::mouseEntered(mouseEvent); } -void ChatWindow::mouseExited(gcn::MouseEvent& mouseEvent) +void ChatWindow::mouseExited(MouseEvent& mouseEvent) { updateVisibility(); Window::mouseExited(mouseEvent); diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index e664e63ce..2ec4e6bec 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -186,12 +186,12 @@ class ChatWindow final : public Window, /** * Handles mouse when dragged. */ - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; /** * Handles mouse when pressed. */ - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; void processEvent(const Channels channel, const DepricatedEvent &event) override final; @@ -274,11 +274,11 @@ class ChatWindow final : public Window, void optionChanged(const std::string &name) override final; - void mouseEntered(gcn::MouseEvent& mouseEvent) override final; + void mouseEntered(MouseEvent& mouseEvent) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) override final; + void mouseExited(MouseEvent& mouseEvent A_UNUSED) override final; void draw(Graphics* graphics) override final; diff --git a/src/gui/windows/didyouknowwindow.cpp b/src/gui/windows/didyouknowwindow.cpp index 89b1eda26..9b3ba857c 100644 --- a/src/gui/windows/didyouknowwindow.cpp +++ b/src/gui/windows/didyouknowwindow.cpp @@ -129,7 +129,7 @@ void DidYouKnowWindow::action(const ActionEvent &event) } void DidYouKnowWindow::handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED) + MouseEvent *event A_UNUSED) { if (strStartWith(link, "http://") || strStartWith(link, "https://")) openBrowser(link); diff --git a/src/gui/windows/didyouknowwindow.h b/src/gui/windows/didyouknowwindow.h index 4f88b3f1c..fd539e360 100644 --- a/src/gui/windows/didyouknowwindow.h +++ b/src/gui/windows/didyouknowwindow.h @@ -59,7 +59,7 @@ class DidYouKnowWindow final : public Window, * Handles link action. */ void handleLink(const std::string &link, - gcn::MouseEvent *event) override final; + MouseEvent *event) override final; void loadData(int num = 0); diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 68ef56826..5caf30df1 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -291,7 +291,7 @@ Item *EquipmentWindow::getItem(const int x, const int y) const return nullptr; } -void EquipmentWindow::mousePressed(gcn::MouseEvent& mouseEvent) +void EquipmentWindow::mousePressed(MouseEvent& mouseEvent) { if (!mEquipment) { @@ -302,7 +302,7 @@ void EquipmentWindow::mousePressed(gcn::MouseEvent& mouseEvent) const int x = mouseEvent.getX(); const int y = mouseEvent.getY(); - if (mouseEvent.getButton() == gcn::MouseEvent::LEFT) + if (mouseEvent.getButton() == MouseEvent::LEFT) { if (mForing) { @@ -337,7 +337,7 @@ void EquipmentWindow::mousePressed(gcn::MouseEvent& mouseEvent) return; } } - else if (mouseEvent.getButton() == gcn::MouseEvent::RIGHT) + else if (mouseEvent.getButton() == MouseEvent::RIGHT) { if (Item *const item = getItem(x, y)) { @@ -362,7 +362,7 @@ void EquipmentWindow::mousePressed(gcn::MouseEvent& mouseEvent) Window::mousePressed(mouseEvent); } -void EquipmentWindow::mouseReleased(gcn::MouseEvent &mouseEvent) +void EquipmentWindow::mouseReleased(MouseEvent &mouseEvent) { Window::mouseReleased(mouseEvent); const DragDropSource src = dragDrop.getSource(); @@ -417,7 +417,7 @@ void EquipmentWindow::mouseReleased(gcn::MouseEvent &mouseEvent) } // Show ItemTooltip -void EquipmentWindow::mouseMoved(gcn::MouseEvent &event) +void EquipmentWindow::mouseMoved(MouseEvent &event) { Window::mouseMoved(event); @@ -441,7 +441,7 @@ void EquipmentWindow::mouseMoved(gcn::MouseEvent &event) } // Hide ItemTooltip -void EquipmentWindow::mouseExited(gcn::MouseEvent &event A_UNUSED) +void EquipmentWindow::mouseExited(MouseEvent &event A_UNUSED) { if (mItemPopup) mItemPopup->setVisible(false); diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index bade666ad..c9ca12bbd 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -86,7 +86,7 @@ class EquipmentWindow final : public Window, void action(const ActionEvent &event) override final; - void mousePressed(gcn::MouseEvent& mouseEvent) override final; + void mousePressed(MouseEvent& mouseEvent) override final; const Item* getEquipment(const int i) const A_WARN_UNUSED { return mEquipment ? mEquipment->getEquipment(i) : nullptr; } @@ -97,11 +97,11 @@ class EquipmentWindow final : public Window, void resetBeing(const Being *const being); - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; void recalcSize(); diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp index 9738378ea..95bea6e00 100644 --- a/src/gui/windows/helpwindow.cpp +++ b/src/gui/windows/helpwindow.cpp @@ -104,7 +104,7 @@ void HelpWindow::action(const ActionEvent &event) } void HelpWindow::handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED) + MouseEvent *event A_UNUSED) { if (!strStartWith(link, "http://") && !strStartWith(link, "https://")) { diff --git a/src/gui/windows/helpwindow.h b/src/gui/windows/helpwindow.h index d8b873408..4290c99f9 100644 --- a/src/gui/windows/helpwindow.h +++ b/src/gui/windows/helpwindow.h @@ -65,7 +65,7 @@ class HelpWindow final : public Window, * Handles link action. */ void handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED) override final; + MouseEvent *event A_UNUSED) override final; /** * Loads help in the dialog. diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index a1eb83e7a..09368e2ad 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -466,7 +466,7 @@ void InventoryWindow::widgetHidden(const Event &event) mItems->hidePopup(); } -void InventoryWindow::mouseClicked(gcn::MouseEvent &event) +void InventoryWindow::mouseClicked(MouseEvent &event) { Window::mouseClicked(event); @@ -482,7 +482,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) && inputManager.isActionActive(static_cast<int>( Input::KEY_STOP_ATTACK))); - if (!mod && !mod2 && event.getButton() == gcn::MouseEvent::RIGHT) + if (!mod && !mod2 && event.getButton() == MouseEvent::RIGHT) { Item *const item = mItems->getSelectedItem(); @@ -502,8 +502,8 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) if (!mInventory) return; - if (event.getButton() == gcn::MouseEvent::LEFT - || event.getButton() == gcn::MouseEvent::RIGHT) + if (event.getButton() == MouseEvent::LEFT + || event.getButton() == MouseEvent::RIGHT) { Item *const item = mItems->getSelectedItem(); @@ -514,7 +514,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) { if (mInventory->isMainInventory()) { - if (event.getButton() == gcn::MouseEvent::RIGHT) + if (event.getButton() == MouseEvent::RIGHT) { ItemAmountWindow::showWindow(ItemAmountWindow::StoreAdd, inventoryWindow, item); @@ -528,7 +528,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) } else { - if (event.getButton() == gcn::MouseEvent::RIGHT) + if (event.getButton() == MouseEvent::RIGHT) { ItemAmountWindow::showWindow(ItemAmountWindow::StoreRemove, inventoryWindow, item); @@ -545,7 +545,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) { if (PlayerInfo::isItemProtected(item->getId())) return; - if (event.getButton() == gcn::MouseEvent::RIGHT) + if (event.getButton() == MouseEvent::RIGHT) { ItemAmountWindow::showWindow(ItemAmountWindow::TradeAdd, tradeWindow, item); @@ -589,7 +589,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) } } -void InventoryWindow::mouseMoved(gcn::MouseEvent &event) +void InventoryWindow::mouseMoved(MouseEvent &event) { Window::mouseMoved(event); const gcn::Widget *const src = event.getSource(); @@ -608,7 +608,7 @@ void InventoryWindow::mouseMoved(gcn::MouseEvent &event) } } -void InventoryWindow::mouseExited(gcn::MouseEvent &event A_UNUSED) +void InventoryWindow::mouseExited(MouseEvent &event A_UNUSED) { mTextPopup->hide(); } diff --git a/src/gui/windows/inventorywindow.h b/src/gui/windows/inventorywindow.h index 03f64b562..96d9d04fb 100644 --- a/src/gui/windows/inventorywindow.h +++ b/src/gui/windows/inventorywindow.h @@ -97,7 +97,7 @@ class InventoryWindow final : public Window, /** * Handles the mouse clicks. */ - void mouseClicked(gcn::MouseEvent &event) override final; + void mouseClicked(MouseEvent &event) override final; /** * Handles the key presses. @@ -147,9 +147,9 @@ class InventoryWindow final : public Window, void widgetResized(const Event &event) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; void setVisible(bool visible) override final; diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index 2158c4dd9..6b7d10173 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -313,7 +313,7 @@ ItemAmountWindow::~ItemAmountWindow() } // Show ItemTooltip -void ItemAmountWindow::mouseMoved(gcn::MouseEvent &event) +void ItemAmountWindow::mouseMoved(MouseEvent &event) { Window::mouseMoved(event); @@ -328,7 +328,7 @@ void ItemAmountWindow::mouseMoved(gcn::MouseEvent &event) } // Hide ItemTooltip -void ItemAmountWindow::mouseExited(gcn::MouseEvent &event A_UNUSED) +void ItemAmountWindow::mouseExited(MouseEvent &event A_UNUSED) { if (mItemPopup) mItemPopup->setVisible(false); diff --git a/src/gui/windows/itemamountwindow.h b/src/gui/windows/itemamountwindow.h index 76d53eeeb..cf721ee30 100644 --- a/src/gui/windows/itemamountwindow.h +++ b/src/gui/windows/itemamountwindow.h @@ -73,9 +73,9 @@ class ItemAmountWindow final : public Window, void resetAmount(); // MouseListener - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; /** * Schedules the Item Amount window for deletion. diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index 691506753..0f0938e20 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -434,14 +434,14 @@ void Minimap::draw(Graphics *graphics) BLOCK_END("Minimap::draw") } -void Minimap::mouseReleased(gcn::MouseEvent &event) +void Minimap::mouseReleased(MouseEvent &event) { Window::mouseReleased(event); if (!player_node || !viewport) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { int x = event.getX(); int y = event.getY(); @@ -449,7 +449,7 @@ void Minimap::mouseReleased(gcn::MouseEvent &event) player_node->navigateTo(x, y); } - else if (event.getButton() == gcn::MouseEvent::RIGHT) + else if (event.getButton() == MouseEvent::RIGHT) { int x = event.getX(); int y = event.getY(); @@ -458,7 +458,7 @@ void Minimap::mouseReleased(gcn::MouseEvent &event) } } -void Minimap::mouseMoved(gcn::MouseEvent &event) +void Minimap::mouseMoved(MouseEvent &event) { Window::mouseMoved(event); const int x = event.getX(); @@ -467,7 +467,7 @@ void Minimap::mouseMoved(gcn::MouseEvent &event) mTextPopup->show(x + rect.x, y + rect.y, mCaption); } -void Minimap::mouseExited(gcn::MouseEvent &event) +void Minimap::mouseExited(MouseEvent &event) { Window::mouseExited(event); mTextPopup->hide(); diff --git a/src/gui/windows/minimap.h b/src/gui/windows/minimap.h index 661412c57..d99aea13d 100644 --- a/src/gui/windows/minimap.h +++ b/src/gui/windows/minimap.h @@ -62,11 +62,11 @@ class Minimap final : public Window, public ConfigListener */ void draw(Graphics *graphics) override final; - void mouseMoved(gcn::MouseEvent &event) override final; + void mouseMoved(MouseEvent &event) override final; - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; void screenToMap(int &x, int &y); diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index 3513bb2ff..b8f2fd7ea 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -315,7 +315,7 @@ void MiniStatusWindow::draw(Graphics *graphics) BLOCK_END("MiniStatusWindow::draw") } -void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event) +void MiniStatusWindow::mouseMoved(MouseEvent &event) { Popup::mouseMoved(event); @@ -433,12 +433,12 @@ void MiniStatusWindow::mouseMoved(gcn::MouseEvent &event) } } -void MiniStatusWindow::mousePressed(gcn::MouseEvent &event) +void MiniStatusWindow::mousePressed(MouseEvent &event) { if (!viewport) return; - if (event.getButton() == gcn::MouseEvent::RIGHT) + if (event.getButton() == MouseEvent::RIGHT) { const ProgressBar *const bar = dynamic_cast<ProgressBar*>( event.getSource()); @@ -452,7 +452,7 @@ void MiniStatusWindow::mousePressed(gcn::MouseEvent &event) } } -void MiniStatusWindow::mouseExited(gcn::MouseEvent &event) +void MiniStatusWindow::mouseExited(MouseEvent &event) { Popup::mouseExited(event); diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h index 5fccae02e..bb1991c19 100644 --- a/src/gui/windows/ministatuswindow.h +++ b/src/gui/windows/ministatuswindow.h @@ -71,11 +71,11 @@ class MiniStatusWindow final : public Popup, void draw(Graphics *graphics) override final; - void mouseMoved(gcn::MouseEvent &mouseEvent) override final; + void mouseMoved(MouseEvent &mouseEvent) override final; - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; - void mouseExited(gcn::MouseEvent &event) override final; + void mouseExited(MouseEvent &event) override final; void showBar(const std::string &name, const bool visible); diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 4ee8f3b29..a883406e7 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -965,10 +965,10 @@ void NpcDialog::clearDialogs() mNpcDialogs.clear(); } -void NpcDialog::mousePressed(gcn::MouseEvent &event) +void NpcDialog::mousePressed(MouseEvent &event) { Window::mousePressed(event); - if (event.getButton() == gcn::MouseEvent::RIGHT + if (event.getButton() == MouseEvent::RIGHT && event.getSource() == mTextBox) { if (viewport) diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h index 1fdd4a444..b7b036659 100644 --- a/src/gui/windows/npcdialog.h +++ b/src/gui/windows/npcdialog.h @@ -210,7 +210,7 @@ class NpcDialog final : public Window, void clearRows(); - void mousePressed(gcn::MouseEvent &event); + void mousePressed(MouseEvent &event); int isCloseState() const { return mActionState == NPC_ACTION_CLOSE; } diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index 6fbb34390..d1413cc0a 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -366,9 +366,9 @@ void OutfitWindow::draw(Graphics *graphics) BLOCK_END("OutfitWindow::draw") } -void OutfitWindow::mouseDragged(gcn::MouseEvent &event) +void OutfitWindow::mouseDragged(MouseEvent &event) { - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (dragDrop.isEmpty() && mItemClicked) { @@ -409,12 +409,12 @@ void OutfitWindow::mouseDragged(gcn::MouseEvent &event) Window::mouseDragged(event); } -void OutfitWindow::mousePressed(gcn::MouseEvent &event) +void OutfitWindow::mousePressed(MouseEvent &event) { const int index = getIndexFromGrid(event.getX(), event.getY()); if (index == -1) { - if (event.getButton() == gcn::MouseEvent::RIGHT && viewport) + if (event.getButton() == MouseEvent::RIGHT && viewport) { viewport->showOutfitsPopup(); event.consume(); @@ -446,9 +446,9 @@ void OutfitWindow::mousePressed(gcn::MouseEvent &event) Window::mousePressed(event); } -void OutfitWindow::mouseReleased(gcn::MouseEvent &event) +void OutfitWindow::mouseReleased(MouseEvent &event) { - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (mCurrentOutfit < 0 || mCurrentOutfit >= static_cast<signed int>(OUTFITS_COUNT)) diff --git a/src/gui/windows/outfitwindow.h b/src/gui/windows/outfitwindow.h index f27852a8c..909b84a41 100644 --- a/src/gui/windows/outfitwindow.h +++ b/src/gui/windows/outfitwindow.h @@ -54,11 +54,11 @@ class OutfitWindow final : public Window, void draw(Graphics *graphics) override final; - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; - void mouseReleased(gcn::MouseEvent &event) override final; + void mouseReleased(MouseEvent &event) override final; void load(const bool oldConfig = false); diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index c4bd7c79f..4ad0e8360 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -506,7 +506,7 @@ void ServerDialog::valueChanged(const gcn::SelectionEvent &) mDeleteButton->setEnabled(true); } -void ServerDialog::mouseClicked(gcn::MouseEvent &mouseEvent) +void ServerDialog::mouseClicked(MouseEvent &mouseEvent) { if (mouseEvent.getClickCount() == 2 && mouseEvent.getSource() == mServersList) diff --git a/src/gui/windows/serverdialog.h b/src/gui/windows/serverdialog.h index d14360b88..41ef8bcf1 100644 --- a/src/gui/windows/serverdialog.h +++ b/src/gui/windows/serverdialog.h @@ -125,7 +125,7 @@ class ServerDialog final : public Window, */ void valueChanged(const gcn::SelectionEvent &event) override final; - void mouseClicked(gcn::MouseEvent &mouseEvent) override final; + void mouseClicked(MouseEvent &mouseEvent) override final; void logic() override final; diff --git a/src/gui/windows/shortcutwindow.cpp b/src/gui/windows/shortcutwindow.cpp index 7916ce8e4..50bc6fcd1 100644 --- a/src/gui/windows/shortcutwindow.cpp +++ b/src/gui/windows/shortcutwindow.cpp @@ -195,21 +195,21 @@ void ShortcutWindow::widgetHidden(const Event &event) } } -void ShortcutWindow::mousePressed(gcn::MouseEvent &event) +void ShortcutWindow::mousePressed(MouseEvent &event) { Window::mousePressed(event); if (event.isConsumed()) return; - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { mDragOffsetX = event.getX(); mDragOffsetY = event.getY(); } } -void ShortcutWindow::mouseDragged(gcn::MouseEvent &event) +void ShortcutWindow::mouseDragged(MouseEvent &event) { Window::mouseDragged(event); diff --git a/src/gui/windows/shortcutwindow.h b/src/gui/windows/shortcutwindow.h index 707a0a1d7..5e36e68d7 100644 --- a/src/gui/windows/shortcutwindow.h +++ b/src/gui/windows/shortcutwindow.h @@ -64,9 +64,9 @@ class ShortcutWindow final : public Window void widgetMoved(const Event& event) override final; - void mousePressed(gcn::MouseEvent &event) override final; + void mousePressed(MouseEvent &event) override final; - void mouseDragged(gcn::MouseEvent &event) override final; + void mouseDragged(MouseEvent &event) override final; void nextTab(); diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index deeffb9a0..8ec8486e3 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -157,7 +157,7 @@ class SkillListBox final : public ListBox unsigned int getRowHeight() const override { return mRowHeight; } - const SkillInfo *getSkillByEvent(const gcn::MouseEvent &event) const + const SkillInfo *getSkillByEvent(const MouseEvent &event) const { const int y = (event.getY() + mPadding) / getRowHeight(); if (!mModel || y >= mModel->getNumberOfElements()) @@ -168,7 +168,7 @@ class SkillListBox final : public ListBox return skill; } - void mouseMoved(gcn::MouseEvent &event) override + void mouseMoved(MouseEvent &event) override { ListBox::mouseMoved(event); if (!viewport || !dragDrop.isEmpty()) @@ -182,9 +182,9 @@ class SkillListBox final : public ListBox skill->data->dispName, skill->data->description); } - void mouseDragged(gcn::MouseEvent &event) + void mouseDragged(MouseEvent &event) { - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { if (dragDrop.isEmpty()) { @@ -206,10 +206,10 @@ class SkillListBox final : public ListBox } } - void mousePressed(gcn::MouseEvent &event) + void mousePressed(MouseEvent &event) { ListBox::mousePressed(event); - if (event.getButton() == gcn::MouseEvent::LEFT) + if (event.getButton() == MouseEvent::LEFT) { const SkillInfo *const skill = getSkillByEvent(event); if (!skill) @@ -218,12 +218,12 @@ class SkillListBox final : public ListBox } } - void mouseReleased(gcn::MouseEvent &event) + void mouseReleased(MouseEvent &event) { ListBox::mouseReleased(event); } - void mouseExited(gcn::MouseEvent &event A_UNUSED) override + void mouseExited(MouseEvent &event A_UNUSED) override { mPopup->hide(); } diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 4df0ab6f1..704bf0ca6 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -1242,7 +1242,7 @@ public: A_DELETE_COPY(CreatePopup) void handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED) override final + MouseEvent *event A_UNUSED) override final { if (link == "guild" && socialWindow) { diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 109858a07..8e31939ff 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -971,7 +971,7 @@ unsigned long UpdaterWindow::getFileHash(const std::string &filePath) } void UpdaterWindow::handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED) + MouseEvent *event A_UNUSED) { if (strStartWith(link, "http://") || strStartWith(link, "https://")) openBrowser(link); diff --git a/src/gui/windows/updaterwindow.h b/src/gui/windows/updaterwindow.h index ffd5b3103..79d764752 100644 --- a/src/gui/windows/updaterwindow.h +++ b/src/gui/windows/updaterwindow.h @@ -126,7 +126,7 @@ class UpdaterWindow final : public Window, void logic() override final; void handleLink(const std::string &link, - gcn::MouseEvent *event A_UNUSED) override final; + MouseEvent *event A_UNUSED) override final; void loadFile(std::string file); diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 201a5e11e..1af21866d 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -159,9 +159,9 @@ WhoIsOnline::~WhoIsOnline() mOnlineNicks.clear(); } -void WhoIsOnline::handleLink(const std::string& link, gcn::MouseEvent *event) +void WhoIsOnline::handleLink(const std::string& link, MouseEvent *event) { - if (!event || event->getButton() == gcn::MouseEvent::LEFT) + if (!event || event->getButton() == MouseEvent::LEFT) { if (chatWindow) { @@ -177,7 +177,7 @@ void WhoIsOnline::handleLink(const std::string& link, gcn::MouseEvent *event) } } } - else if (event->getButton() == gcn::MouseEvent::RIGHT) + else if (event->getButton() == MouseEvent::RIGHT) { if (player_node && link == player_node->getName()) return; diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h index 99eeb1911..bc04c8066 100644 --- a/src/gui/windows/whoisonline.h +++ b/src/gui/windows/whoisonline.h @@ -128,7 +128,7 @@ public: void loadList(std::vector<OnlinePlayer*> &list); void handleLink(const std::string& link, - gcn::MouseEvent *event) override final; + MouseEvent *event) override final; void logic() override final; diff --git a/src/listeners/mouselistener.h b/src/listeners/mouselistener.h index e95d2ca01..d294e4dd6 100644 --- a/src/listeners/mouselistener.h +++ b/src/listeners/mouselistener.h @@ -64,7 +64,7 @@ #ifndef GCN_MOUSELISTENER_HPP #define GCN_MOUSELISTENER_HPP -#include "gui/base/mouseevent.hpp" +#include "events/mouseevent.h" #include "localconsts.h" @@ -89,7 +89,7 @@ class MouseListener * @param mouseEvent Describes the event. * @since 0.6.0 */ - virtual void mouseEntered(gcn::MouseEvent &mouseEvent A_UNUSED) + virtual void mouseEntered(MouseEvent &mouseEvent A_UNUSED) { } @@ -99,7 +99,7 @@ class MouseListener * @param mouseEvent Describes the event. * @since 0.6.0 */ - virtual void mouseExited(gcn::MouseEvent &mouseEvent A_UNUSED) + virtual void mouseExited(MouseEvent &mouseEvent A_UNUSED) { } @@ -112,7 +112,7 @@ class MouseListener * @param mouseEvent Describes the event. * @since 0.6.0 */ - virtual void mousePressed(gcn::MouseEvent &mouseEvent A_UNUSED) + virtual void mousePressed(MouseEvent &mouseEvent A_UNUSED) { } @@ -122,7 +122,7 @@ class MouseListener * @param mouseEvent Describes the event. * @since 0.6.0 */ - virtual void mouseReleased(gcn::MouseEvent &mouseEvent A_UNUSED) + virtual void mouseReleased(MouseEvent &mouseEvent A_UNUSED) { } @@ -133,7 +133,7 @@ class MouseListener * @param mouseEvent Describes the event. * @since 0.6.0 */ - virtual void mouseClicked(gcn::MouseEvent &mouseEvent A_UNUSED) + virtual void mouseClicked(MouseEvent &mouseEvent A_UNUSED) { } @@ -143,7 +143,7 @@ class MouseListener * @param mouseEvent Describes the event. * @since 0.6.0 */ - virtual void mouseWheelMovedUp(gcn::MouseEvent &mouseEvent A_UNUSED) + virtual void mouseWheelMovedUp(MouseEvent &mouseEvent A_UNUSED) { } @@ -153,7 +153,7 @@ class MouseListener * @param mousEvent Describes the event. * @since 0.6.0 */ - virtual void mouseWheelMovedDown(gcn::MouseEvent &mouseEvent A_UNUSED) + virtual void mouseWheelMovedDown(MouseEvent &mouseEvent A_UNUSED) { } @@ -164,7 +164,7 @@ class MouseListener * @param mouseEvent Describes the event. * @since 0.6.0 */ - virtual void mouseMoved(gcn::MouseEvent &mouseEvent A_UNUSED) + virtual void mouseMoved(MouseEvent &mouseEvent A_UNUSED) { } @@ -175,7 +175,7 @@ class MouseListener * @param mouseEvent Describes the event. * @since 0.6.0 */ - virtual void mouseDragged(gcn::MouseEvent &mouseEvent A_UNUSED) + virtual void mouseDragged(MouseEvent &mouseEvent A_UNUSED) { } |