diff options
Diffstat (limited to 'src/gui/base')
-rw-r--r-- | src/gui/base/gui.cpp | 2 | ||||
-rw-r--r-- | src/gui/base/mouselistener.hpp | 196 | ||||
-rw-r--r-- | src/gui/base/widget.cpp | 2 | ||||
-rw-r--r-- | src/gui/base/widget.hpp | 2 | ||||
-rw-r--r-- | src/gui/base/widgets/button.cpp | 4 | ||||
-rw-r--r-- | src/gui/base/widgets/button.hpp | 2 | ||||
-rw-r--r-- | src/gui/base/widgets/checkbox.cpp | 4 | ||||
-rw-r--r-- | src/gui/base/widgets/checkbox.hpp | 2 | ||||
-rw-r--r-- | src/gui/base/widgets/listbox.cpp | 4 | ||||
-rw-r--r-- | src/gui/base/widgets/listbox.hpp | 2 | ||||
-rw-r--r-- | src/gui/base/widgets/radiobutton.cpp | 4 | ||||
-rw-r--r-- | src/gui/base/widgets/radiobutton.hpp | 2 | ||||
-rw-r--r-- | src/gui/base/widgets/scrollarea.cpp | 6 | ||||
-rw-r--r-- | src/gui/base/widgets/scrollarea.hpp | 2 | ||||
-rw-r--r-- | src/gui/base/widgets/slider.cpp | 4 | ||||
-rw-r--r-- | src/gui/base/widgets/slider.hpp | 2 | ||||
-rw-r--r-- | src/gui/base/widgets/textbox.cpp | 4 | ||||
-rw-r--r-- | src/gui/base/widgets/textbox.hpp | 2 | ||||
-rw-r--r-- | src/gui/base/widgets/textfield.cpp | 4 | ||||
-rw-r--r-- | src/gui/base/widgets/textfield.hpp | 2 | ||||
-rw-r--r-- | src/gui/base/widgets/window.cpp | 4 | ||||
-rw-r--r-- | src/gui/base/widgets/window.hpp | 3 |
22 files changed, 32 insertions, 227 deletions
diff --git a/src/gui/base/gui.cpp b/src/gui/base/gui.cpp index e85a17d97..f16048bbb 100644 --- a/src/gui/base/gui.cpp +++ b/src/gui/base/gui.cpp @@ -76,7 +76,7 @@ #include "gui/base/widget.hpp" #include "listeners/keylistener.h" -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" #include "render/graphics.h" diff --git a/src/gui/base/mouselistener.hpp b/src/gui/base/mouselistener.hpp deleted file mode 100644 index 32486e56f..000000000 --- a/src/gui/base/mouselistener.hpp +++ /dev/null @@ -1,196 +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_MOUSELISTENER_HPP -#define GCN_MOUSELISTENER_HPP - -#include "gui/base/mouseevent.hpp" - -#include "localconsts.h" - -namespace gcn -{ - /** - * Interface for listening for mouse events from widgets. - * - * @see Widget::addMouseListener, Widget::removeMouseListener - * @since 0.1.0 - */ - class MouseListener - { - public: - /** - * Destructor. - */ - virtual ~MouseListener() - { } - - /** - * Called when the mouse has entered into the widget area. - * - * @param mouseEvent Describes the event. - * @since 0.6.0 - */ - virtual void mouseEntered(MouseEvent& mouseEvent A_UNUSED) - { - } - - /** - * Called when the mouse has exited the widget area. - * - * @param mouseEvent Describes the event. - * @since 0.6.0 - */ - virtual void mouseExited(MouseEvent& mouseEvent A_UNUSED) - { - } - - /** - * Called when a mouse button has been pressed on the widget area. - * - * NOTE: A mouse press is NOT equal to a mouse click. - * Use mouseClickMessage to check for mouse clicks. - * - * @param mouseEvent Describes the event. - * @since 0.6.0 - */ - virtual void mousePressed(MouseEvent& mouseEvent A_UNUSED) - { - } - - /** - * Called when a mouse button has been released on the widget area. - * - * @param mouseEvent Describes the event. - * @since 0.6.0 - */ - virtual void mouseReleased(MouseEvent& mouseEvent A_UNUSED) - { - } - - /** - * Called when a mouse button is pressed and released (clicked) on - * the widget area. - * - * @param mouseEvent Describes the event. - * @since 0.6.0 - */ - virtual void mouseClicked(MouseEvent& mouseEvent A_UNUSED) - { - } - - /** - * Called when the mouse wheel has moved up on the widget area. - * - * @param mouseEvent Describes the event. - * @since 0.6.0 - */ - virtual void mouseWheelMovedUp(MouseEvent& mouseEvent A_UNUSED) - { - } - - /** - * Called when the mouse wheel has moved down on the widget area. - * - * @param mousEvent Describes the event. - * @since 0.6.0 - */ - virtual void mouseWheelMovedDown(MouseEvent& mouseEvent A_UNUSED) - { - } - - /** - * Called when the mouse has moved in the widget area and no mouse button - * has been pressed (i.e no widget is being dragged). - * - * @param mouseEvent Describes the event. - * @since 0.6.0 - */ - virtual void mouseMoved(MouseEvent& mouseEvent A_UNUSED) - { - } - - /** - * Called when the mouse has moved and the mouse has previously been - * pressed on the widget. - * - * @param mouseEvent Describes the event. - * @since 0.6.0 - */ - virtual void mouseDragged(MouseEvent& mouseEvent A_UNUSED) - { - } - - protected: - /** - * Constructor. - * - * You should not be able to make an instance of MouseListener, - * therefore its constructor is protected. - */ - MouseListener() - { } - }; -} // namespace gcn - -#endif // end GCN_MOUSELISTENER_HPP diff --git a/src/gui/base/widget.cpp b/src/gui/base/widget.cpp index c72a06e8b..b05a0d5b1 100644 --- a/src/gui/base/widget.cpp +++ b/src/gui/base/widget.cpp @@ -78,7 +78,7 @@ #include "listeners/deathlistener.h" #include "listeners/keylistener.h" -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" #include "gui/base/widgetlistener.hpp" #include "render/graphics.h" diff --git a/src/gui/base/widget.hpp b/src/gui/base/widget.hpp index 583ade076..af04714f6 100644 --- a/src/gui/base/widget.hpp +++ b/src/gui/base/widget.hpp @@ -78,6 +78,7 @@ class DeathListener; class FocusListener; class Graphics; class KeyListener; +class MouseListener; namespace gcn { @@ -86,7 +87,6 @@ namespace gcn class Font; class KeyInput; class MouseInput; - class MouseListener; class WidgetListener; /** diff --git a/src/gui/base/widgets/button.cpp b/src/gui/base/widgets/button.cpp index 4631ed80f..7f1aea668 100644 --- a/src/gui/base/widgets/button.cpp +++ b/src/gui/base/widgets/button.cpp @@ -81,7 +81,7 @@ namespace gcn { Button::Button() : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), FocusListener(), mCaption(), @@ -102,7 +102,7 @@ namespace gcn Button::Button(const std::string& caption) : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), FocusListener(), mCaption(caption), diff --git a/src/gui/base/widgets/button.hpp b/src/gui/base/widgets/button.hpp index 779a75aa5..c81fec14f 100644 --- a/src/gui/base/widgets/button.hpp +++ b/src/gui/base/widgets/button.hpp @@ -68,7 +68,7 @@ #include "listeners/focuslistener.h" #include "listeners/keylistener.h" -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" #include "gui/base/mouseevent.hpp" #include "gui/base/widget.hpp" diff --git a/src/gui/base/widgets/checkbox.cpp b/src/gui/base/widgets/checkbox.cpp index ceb59a1eb..5f2477b4d 100644 --- a/src/gui/base/widgets/checkbox.cpp +++ b/src/gui/base/widgets/checkbox.cpp @@ -80,7 +80,7 @@ namespace gcn CheckBox::CheckBox() : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mSelected(false), mCaption() @@ -92,7 +92,7 @@ namespace gcn CheckBox::CheckBox(const std::string &caption, bool selected) : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mSelected(selected), mCaption() diff --git a/src/gui/base/widgets/checkbox.hpp b/src/gui/base/widgets/checkbox.hpp index 4904a022f..c03187bba 100644 --- a/src/gui/base/widgets/checkbox.hpp +++ b/src/gui/base/widgets/checkbox.hpp @@ -67,7 +67,7 @@ #include <string> #include "listeners/keylistener.h" -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" #include "gui/base/widget.hpp" diff --git a/src/gui/base/widgets/listbox.cpp b/src/gui/base/widgets/listbox.cpp index 771f22f64..3ae4caa91 100644 --- a/src/gui/base/widgets/listbox.cpp +++ b/src/gui/base/widgets/listbox.cpp @@ -82,7 +82,7 @@ namespace gcn { ListBox::ListBox() : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mSelected(-1), mListModel(nullptr), @@ -98,7 +98,7 @@ namespace gcn ListBox::ListBox(ListModel *listModel) : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mSelected(-1), mListModel(listModel), diff --git a/src/gui/base/widgets/listbox.hpp b/src/gui/base/widgets/listbox.hpp index 11983262f..793aba840 100644 --- a/src/gui/base/widgets/listbox.hpp +++ b/src/gui/base/widgets/listbox.hpp @@ -70,7 +70,7 @@ #include "gui/base/widget.hpp" #include "listeners/keylistener.h" -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" namespace gcn { diff --git a/src/gui/base/widgets/radiobutton.cpp b/src/gui/base/widgets/radiobutton.cpp index f7145fd55..e42773de1 100644 --- a/src/gui/base/widgets/radiobutton.cpp +++ b/src/gui/base/widgets/radiobutton.cpp @@ -81,7 +81,7 @@ namespace gcn RadioButton::RadioButton() : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mSelected(false), mCaption(), @@ -98,7 +98,7 @@ namespace gcn const std::string &group, bool selected) : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mSelected(false), mCaption(), diff --git a/src/gui/base/widgets/radiobutton.hpp b/src/gui/base/widgets/radiobutton.hpp index 98b562676..8a9a8b585 100644 --- a/src/gui/base/widgets/radiobutton.hpp +++ b/src/gui/base/widgets/radiobutton.hpp @@ -68,7 +68,7 @@ #include <string> #include "listeners/keylistener.h" -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" #include "gui/base/widget.hpp" diff --git a/src/gui/base/widgets/scrollarea.cpp b/src/gui/base/widgets/scrollarea.cpp index 308cee473..ffcaffdb1 100644 --- a/src/gui/base/widgets/scrollarea.cpp +++ b/src/gui/base/widgets/scrollarea.cpp @@ -77,7 +77,7 @@ namespace gcn { ScrollArea::ScrollArea() : gcn::BasicContainer(), - gcn::MouseListener(), + MouseListener(), mVScroll(0), mHScroll(0), mScrollbarWidth(12), @@ -104,7 +104,7 @@ namespace gcn ScrollArea::ScrollArea(Widget *const content) : gcn::BasicContainer(), - gcn::MouseListener(), + MouseListener(), mVScroll(0), mHScroll(0), mScrollbarWidth(12), @@ -134,7 +134,7 @@ namespace gcn ScrollPolicy hPolicy, ScrollPolicy vPolicy) : gcn::BasicContainer(), - gcn::MouseListener(), + MouseListener(), mVScroll(0), mHScroll(0), mScrollbarWidth(12), diff --git a/src/gui/base/widgets/scrollarea.hpp b/src/gui/base/widgets/scrollarea.hpp index e75390ec0..1d4c0dd54 100644 --- a/src/gui/base/widgets/scrollarea.hpp +++ b/src/gui/base/widgets/scrollarea.hpp @@ -67,7 +67,7 @@ #include <string> #include "gui/base/basiccontainer.hpp" -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" namespace gcn { diff --git a/src/gui/base/widgets/slider.cpp b/src/gui/base/widgets/slider.cpp index 2a3fb8c24..91c054e7d 100644 --- a/src/gui/base/widgets/slider.cpp +++ b/src/gui/base/widgets/slider.cpp @@ -78,7 +78,7 @@ namespace gcn { Slider::Slider(const double scaleEnd) : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mDragged(false), mValue(0), @@ -97,7 +97,7 @@ namespace gcn Slider::Slider(const double scaleStart, const double scaleEnd) : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mDragged(false), mValue(scaleStart), diff --git a/src/gui/base/widgets/slider.hpp b/src/gui/base/widgets/slider.hpp index fa047a739..f77d3f5dd 100644 --- a/src/gui/base/widgets/slider.hpp +++ b/src/gui/base/widgets/slider.hpp @@ -65,7 +65,7 @@ #define GCN_SLIDER_HPP #include "listeners/keylistener.h" -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" #include "gui/base/widget.hpp" diff --git a/src/gui/base/widgets/textbox.cpp b/src/gui/base/widgets/textbox.cpp index c146c4f08..06d0e6379 100644 --- a/src/gui/base/widgets/textbox.cpp +++ b/src/gui/base/widgets/textbox.cpp @@ -80,7 +80,7 @@ namespace gcn { TextBox::TextBox() : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mTextRows(), mCaretColumn(0), @@ -98,7 +98,7 @@ namespace gcn TextBox::TextBox(const std::string& text) : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mTextRows(), mCaretColumn(0), diff --git a/src/gui/base/widgets/textbox.hpp b/src/gui/base/widgets/textbox.hpp index 894616360..8fc788816 100644 --- a/src/gui/base/widgets/textbox.hpp +++ b/src/gui/base/widgets/textbox.hpp @@ -69,7 +69,7 @@ #include <vector> #include "listeners/keylistener.h" -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" #include "gui/base/widget.hpp" diff --git a/src/gui/base/widgets/textfield.cpp b/src/gui/base/widgets/textfield.cpp index 178a012b7..df1b844d4 100644 --- a/src/gui/base/widgets/textfield.cpp +++ b/src/gui/base/widgets/textfield.cpp @@ -79,7 +79,7 @@ namespace gcn { TextField::TextField() : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mText(), mCaretPosition(0), @@ -93,7 +93,7 @@ namespace gcn TextField::TextField(const std::string& text) : gcn::Widget(), - gcn::MouseListener(), + MouseListener(), KeyListener(), mText(text), mCaretPosition(0), diff --git a/src/gui/base/widgets/textfield.hpp b/src/gui/base/widgets/textfield.hpp index 56d60b7aa..099ed1356 100644 --- a/src/gui/base/widgets/textfield.hpp +++ b/src/gui/base/widgets/textfield.hpp @@ -65,7 +65,7 @@ #define GCN_TEXTFIELD_HPP #include "listeners/keylistener.h" -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" #include "gui/base/widget.hpp" diff --git a/src/gui/base/widgets/window.cpp b/src/gui/base/widgets/window.cpp index 6373bcb63..02611f819 100644 --- a/src/gui/base/widgets/window.cpp +++ b/src/gui/base/widgets/window.cpp @@ -79,7 +79,7 @@ namespace gcn { Window::Window() : Container(), - gcn::MouseListener(), + MouseListener(), mCaption(), mAlignment(Graphics::CENTER), mPadding(2), @@ -96,7 +96,7 @@ namespace gcn Window::Window(const std::string& caption) : Container(), - gcn::MouseListener(), + MouseListener(), mCaption(caption), mAlignment(Graphics::CENTER), mPadding(2), diff --git a/src/gui/base/widgets/window.hpp b/src/gui/base/widgets/window.hpp index 9c7e6bcbf..030d57edc 100644 --- a/src/gui/base/widgets/window.hpp +++ b/src/gui/base/widgets/window.hpp @@ -66,7 +66,8 @@ #include <string> -#include "gui/base/mouselistener.hpp" +#include "listeners/mouselistener.h" + #include "gui/base/widgets/container.hpp" namespace gcn |