summaryrefslogtreecommitdiff
path: root/src/gui/base
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-17 00:09:12 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-17 00:09:12 +0300
commite78036b3372e5773fac4207ea48bb61e2fd7873e (patch)
treef792fc5ecc4bc5a1fd1c3af7cded74229fbfab10 /src/gui/base
parente8270acbc5118aabbf10738eb9deee07457ea56d (diff)
downloadplus-e78036b3372e5773fac4207ea48bb61e2fd7873e.tar.gz
plus-e78036b3372e5773fac4207ea48bb61e2fd7873e.tar.bz2
plus-e78036b3372e5773fac4207ea48bb61e2fd7873e.tar.xz
plus-e78036b3372e5773fac4207ea48bb61e2fd7873e.zip
combine mouseinput into one file.
Diffstat (limited to 'src/gui/base')
-rw-r--r--src/gui/base/basiccontainer.cpp2
-rw-r--r--src/gui/base/gui.cpp2
-rw-r--r--src/gui/base/gui.hpp2
-rw-r--r--src/gui/base/input.hpp3
-rw-r--r--src/gui/base/mouseinput.cpp136
-rw-r--r--src/gui/base/mouseinput.hpp260
-rw-r--r--src/gui/base/widget.cpp2
-rw-r--r--src/gui/base/widget.hpp2
-rw-r--r--src/gui/base/widgets/button.cpp3
-rw-r--r--src/gui/base/widgets/checkbox.cpp3
-rw-r--r--src/gui/base/widgets/listbox.cpp3
-rw-r--r--src/gui/base/widgets/radiobutton.cpp3
-rw-r--r--src/gui/base/widgets/slider.cpp3
-rw-r--r--src/gui/base/widgets/textbox.cpp3
-rw-r--r--src/gui/base/widgets/textfield.cpp3
-rw-r--r--src/gui/base/widgets/window.cpp2
16 files changed, 21 insertions, 411 deletions
diff --git a/src/gui/base/basiccontainer.cpp b/src/gui/base/basiccontainer.cpp
index 4a745dc63..82ef1c025 100644
--- a/src/gui/base/basiccontainer.cpp
+++ b/src/gui/base/basiccontainer.cpp
@@ -70,7 +70,7 @@
#include <algorithm>
#include "gui/base/focushandler.hpp"
-#include "gui/base/mouseinput.hpp"
+#include "input/mouseinput.h"
#include "render/graphics.h"
diff --git a/src/gui/base/gui.cpp b/src/gui/base/gui.cpp
index 56e40291a..e5291cb60 100644
--- a/src/gui/base/gui.cpp
+++ b/src/gui/base/gui.cpp
@@ -70,10 +70,10 @@
#include "gui/base/basiccontainer.hpp"
#include "gui/base/focushandler.hpp"
#include "gui/base/input.hpp"
-#include "gui/base/mouseinput.hpp"
#include "gui/base/widget.hpp"
#include "input/keyinput.h"
+#include "input/mouseinput.h"
#include "listeners/keylistener.h"
#include "listeners/mouselistener.h"
diff --git a/src/gui/base/gui.hpp b/src/gui/base/gui.hpp
index b853a4210..2ec5d7082 100644
--- a/src/gui/base/gui.hpp
+++ b/src/gui/base/gui.hpp
@@ -70,7 +70,7 @@
#include "events/keyevent.h"
#include "events/mouseevent.h"
-#include "gui/base/mouseinput.hpp"
+#include "input/mouseinput.h"
class Graphics;
class KeyListener;
diff --git a/src/gui/base/input.hpp b/src/gui/base/input.hpp
index 40aed4d84..1643482d3 100644
--- a/src/gui/base/input.hpp
+++ b/src/gui/base/input.hpp
@@ -67,11 +67,10 @@
#include "localconsts.h"
class KeyInput;
+class MouseInput;
namespace gcn
{
- class MouseInput;
-
/**
* Abstract class for providing functions for user input.
*
diff --git a/src/gui/base/mouseinput.cpp b/src/gui/base/mouseinput.cpp
deleted file mode 100644
index bc5d6c8e0..000000000
--- a/src/gui/base/mouseinput.cpp
+++ /dev/null
@@ -1,136 +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/mouseinput.hpp"
-
-#include "debug.h"
-
-namespace gcn
-{
- MouseInput::MouseInput(const unsigned int button,
- const unsigned int type,
- const int x,
- const int y,
- const int timeStamp) :
- mType(type),
- mButton(button),
- mTimeStamp(timeStamp),
- mX(x),
- mY(y)
- {
- }
-
- void MouseInput::setType(unsigned int type)
- {
- mType = type;
- }
-
- unsigned int MouseInput::getType() const
- {
- return mType;
- }
-
- void MouseInput::setButton(unsigned int button)
- {
- mButton = button;
- }
-
- unsigned int MouseInput::getButton() const
- {
- return mButton;
- }
-
- int MouseInput::getTimeStamp() const
- {
- return mTimeStamp;
- }
-
- void MouseInput::setTimeStamp(int timeStamp)
- {
- mTimeStamp = timeStamp;
- }
-
- void MouseInput::setX(int x)
- {
- mX = x;
- }
-
- int MouseInput::getX() const
- {
- return mX;
- }
-
- void MouseInput::setY(int y)
- {
- mY = y;
- }
-
- int MouseInput::getY() const
- {
- return mY;
- }
-} // namespace gcn
diff --git a/src/gui/base/mouseinput.hpp b/src/gui/base/mouseinput.hpp
deleted file mode 100644
index 018205740..000000000
--- a/src/gui/base/mouseinput.hpp
+++ /dev/null
@@ -1,260 +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_MOUSEINPUT_HPP
-#define GCN_MOUSEINPUT_HPP
-
-#include "localconsts.h"
-
-namespace gcn
-{
-
- /**
- * Internal class that represents mouse input. Generally you won't have to
- * bother using this class unless you implement an Input class for
- * a back end.
- *
- * @author Olof Naessén
- * @author Per Larsson
- * @since 0.1.0
- */
- class MouseInput
- {
- public:
- /**
- * Constructor.
- */
- MouseInput() :
- mType(0),
- mButton(0),
- mTimeStamp(0),
- mX(0),
- mY(0)
- { }
-
- /**
- * Constructor.
- *
- * @param button The button pressed.
- * @param type The type of mouse input.
- * @param x The mouse x coordinate.
- * @param y The mouse y coordinate.
- * @param timeStamp The timestamp of the mouse input. Used to
- * check for double clicks.
- */
- MouseInput(const unsigned int button,
- const unsigned int type,
- const int x,
- const int y,
- const int timeStamp);
-
- /**
- * Sets the type of the mouse input.
- *
- * @param type The type of the mouse input. Should be a value from the
- * mouse event type enum
- * @see getType
- * @since 0.1.0
- */
- void setType(unsigned int type);
-
- /**
- * Gets the type of the mouse input.
- *
- * @return The type of the mouse input. A value from the mouse event
- * type enum.
- * @see setType
- * @since 0.1.0
- */
- unsigned int getType() const A_WARN_UNUSED;
-
- /**
- * Sets the button pressed.
- *
- * @param button The button pressed. Should be one of the values
- * in the mouse event button enum.
- * @see getButton.
- * @since 0.1.0
- */
- void setButton(unsigned int button);
-
- /**
- * Gets the button pressed.
- *
- * @return The button pressed. A value from the mouse event
- * button enum.
- * @see setButton
- * @since 0.1.0
- */
- unsigned int getButton() const A_WARN_UNUSED;
-
- /**
- * Sets the timestamp for the mouse input.
- * Used to check for double clicks.
- *
- * @param timeStamp The timestamp of the mouse input.
- * @see getTimeStamp
- * @since 0.1.0
- */
- void setTimeStamp(int timeStamp);
-
- /**
- * Gets the time stamp of the input.
- * Used to check for double clicks.
- *
- * @return The time stamp of the mouse input.
- * @see setTimeStamp
- * @since 0.1.0
- */
- int getTimeStamp() const A_WARN_UNUSED;
-
- /**
- * Sets the x coordinate of the mouse input.
- *
- * @param x The x coordinate of the mouse input.
- * @see getX
- * @since 0.6.0
- */
- void setX(int x);
-
- /**
- * Gets the x coordinate of the mouse input.
- *
- * @return The x coordinate of the mouse input.
- * @see setX
- * @since 0.6.0
- */
- int getX() const A_WARN_UNUSED;
-
- /**
- * Sets the y coordinate of the mouse input.
- *
- * @param y The y coordinate of the mouse input.
- * @see getY
- * @since 0.6.0
- */
- void setY(int y);
-
- /**
- * Gets the y coordinate of the mouse input.
- *
- * @return The y coordinate of the mouse input.
- * @see setY
- * @since 0.6.0
- */
- int getY() const A_WARN_UNUSED;
-
- /**
- * Mouse input event types. This enum partially corresponds
- * to the enum with event types in MouseEvent for easy mapping.
- */
- enum
- {
- MOVED = 0,
- PRESSED,
- RELEASED,
- WHEEL_MOVED_DOWN,
- WHEEL_MOVED_UP
- };
-
- /**
- * Mouse button types.
- */
- enum
- {
- EMPTY = 0,
- LEFT,
- RIGHT,
- MIDDLE
- };
-
- protected:
- /**
- * Holds the type of the mouse input.
- */
- unsigned int mType;
-
- /**
- * Holds the button of the mouse input.
- */
- unsigned int mButton;
-
- /**
- * Holds the timestamp of the mouse input. Used to
- * check for double clicks.
- */
- int mTimeStamp;
-
- /**
- * Holds the x coordinate of the mouse input.
- */
- int mX;
-
- /**
- * Holds the y coordinate of the mouse input.
- */
- int mY;
- };
-} // namespace gcn
-
-#endif // end GCN_MOUSEINPUT_HPP
diff --git a/src/gui/base/widget.cpp b/src/gui/base/widget.cpp
index cf3605446..5b4ada76e 100644
--- a/src/gui/base/widget.cpp
+++ b/src/gui/base/widget.cpp
@@ -73,9 +73,9 @@
#include "gui/base/basiccontainer.hpp"
#include "gui/base/focushandler.hpp"
-#include "gui/base/mouseinput.hpp"
#include "input/keyinput.h"
+#include "input/mouseinput.h"
#include "listeners/actionlistener.h"
#include "listeners/deathlistener.h"
diff --git a/src/gui/base/widget.hpp b/src/gui/base/widget.hpp
index 4043c959a..f2718697e 100644
--- a/src/gui/base/widget.hpp
+++ b/src/gui/base/widget.hpp
@@ -80,6 +80,7 @@ class Font;
class Graphics;
class KeyInput;
class KeyListener;
+class MouseInput;
class MouseListener;
class WidgetListener;
@@ -87,7 +88,6 @@ namespace gcn
{
class BasicContainer;
class FocusHandler;
- class MouseInput;
/**
* Abstract class for widgets of Guichan. It contains basic functions
diff --git a/src/gui/base/widgets/button.cpp b/src/gui/base/widgets/button.cpp
index 9b7473293..56ba72590 100644
--- a/src/gui/base/widgets/button.cpp
+++ b/src/gui/base/widgets/button.cpp
@@ -70,7 +70,8 @@
#include "gui/font.h"
#include "gui/base/key.hpp"
-#include "gui/base/mouseinput.hpp"
+
+#include "input/mouseinput.h"
#include "events/mouseevent.h"
diff --git a/src/gui/base/widgets/checkbox.cpp b/src/gui/base/widgets/checkbox.cpp
index 0a3171fe8..18f635052 100644
--- a/src/gui/base/widgets/checkbox.cpp
+++ b/src/gui/base/widgets/checkbox.cpp
@@ -70,7 +70,8 @@
#include "gui/font.h"
#include "gui/base/key.hpp"
-#include "gui/base/mouseinput.hpp"
+
+#include "input/mouseinput.h"
#include "render/graphics.h"
diff --git a/src/gui/base/widgets/listbox.cpp b/src/gui/base/widgets/listbox.cpp
index 6c6472636..f13a96e39 100644
--- a/src/gui/base/widgets/listbox.cpp
+++ b/src/gui/base/widgets/listbox.cpp
@@ -72,7 +72,8 @@
#include "gui/base/basiccontainer.hpp"
#include "gui/base/key.hpp"
#include "gui/base/listmodel.hpp"
-#include "gui/base/mouseinput.hpp"
+
+#include "input/mouseinput.h"
#include "listeners/selectionlistener.h"
diff --git a/src/gui/base/widgets/radiobutton.cpp b/src/gui/base/widgets/radiobutton.cpp
index f0430c7a2..ff6a39db0 100644
--- a/src/gui/base/widgets/radiobutton.cpp
+++ b/src/gui/base/widgets/radiobutton.cpp
@@ -70,7 +70,8 @@
#include "gui/font.h"
#include "gui/base/key.hpp"
-#include "gui/base/mouseinput.hpp"
+
+#include "input/mouseinput.h"
#include "render/graphics.h"
diff --git a/src/gui/base/widgets/slider.cpp b/src/gui/base/widgets/slider.cpp
index 91c054e7d..d61f2766c 100644
--- a/src/gui/base/widgets/slider.cpp
+++ b/src/gui/base/widgets/slider.cpp
@@ -68,7 +68,8 @@
#include "gui/base/widgets/slider.hpp"
#include "gui/base/key.hpp"
-#include "gui/base/mouseinput.hpp"
+
+#include "input/mouseinput.h"
#include "render/graphics.h"
diff --git a/src/gui/base/widgets/textbox.cpp b/src/gui/base/widgets/textbox.cpp
index e994804d8..db5d91b92 100644
--- a/src/gui/base/widgets/textbox.cpp
+++ b/src/gui/base/widgets/textbox.cpp
@@ -71,7 +71,8 @@
#include "gui/base/basiccontainer.hpp"
#include "gui/base/key.hpp"
-#include "gui/base/mouseinput.hpp"
+
+#include "input/mouseinput.h"
#include "render/graphics.h"
diff --git a/src/gui/base/widgets/textfield.cpp b/src/gui/base/widgets/textfield.cpp
index 1514d3afb..891e7e86b 100644
--- a/src/gui/base/widgets/textfield.cpp
+++ b/src/gui/base/widgets/textfield.cpp
@@ -70,7 +70,8 @@
#include "gui/font.h"
#include "gui/base/key.hpp"
-#include "gui/base/mouseinput.hpp"
+
+#include "input/mouseinput.h"
#include "render/graphics.h"
diff --git a/src/gui/base/widgets/window.cpp b/src/gui/base/widgets/window.cpp
index fbd42aff2..8d33c1dd5 100644
--- a/src/gui/base/widgets/window.cpp
+++ b/src/gui/base/widgets/window.cpp
@@ -69,7 +69,7 @@
#include "gui/font.h"
-#include "gui/base/mouseinput.hpp"
+#include "input/mouseinput.h"
#include "render/graphics.h"