From aa3f63fd497558a02feb3ddbc44f31eac091f39b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Oct 2017 22:14:45 +0300 Subject: Remove most unused files. --- src/events/actionevent.h | 137 ------------------------------ src/events/event.h | 113 ------------------------- src/events/inputevent.h | 75 ----------------- src/events/inputguievent.h | 118 -------------------------- src/events/keyevent.h | 159 ----------------------------------- src/events/mouseevent.h | 199 -------------------------------------------- src/events/selectionevent.h | 99 ---------------------- 7 files changed, 900 deletions(-) delete mode 100644 src/events/actionevent.h delete mode 100644 src/events/event.h delete mode 100644 src/events/inputevent.h delete mode 100644 src/events/inputguievent.h delete mode 100644 src/events/keyevent.h delete mode 100644 src/events/mouseevent.h delete mode 100644 src/events/selectionevent.h (limited to 'src/events') diff --git a/src/events/actionevent.h b/src/events/actionevent.h deleted file mode 100644 index 11655fa03..000000000 --- a/src/events/actionevent.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 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 . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * 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 EVENTS_ACTIONEVENT_H -#define EVENTS_ACTIONEVENT_H - -#include "events/event.h" - -#include - -#include "localconsts.h" - -class Widget; - -/** - * Represents an action event. An action event is an event - * that can be fired by a widget whenever an action has occured. - * What exactly an action is is up to the widget that fires - * the action event. An example is a Button which fires an action - * event as soon as the Button is clicked, another example is - * TextField which fires an action event as soon as the enter - * key is pressed. - * - * Any object can listen for actions from widgets by implementing - * the ActionListener interface. - * - * If you have implement a widget of your own it's a good idea to - * let the widget fire action events whenever you feel an action - * has occured so action listeners of the widget can be informed - * of the state of the widget. - * - * @see Widget::addActionListener, Widget::removeActionListener, - * Widget::distributeActionEvent - * @author Olof Naessén - */ -class ActionEvent final : public Event -{ - public: - /** - * Constructor. - * - * @param source The source widget of the event. - * @param id An identifier of the event. - */ - ActionEvent(Widget *const source, const std::string &id) : - Event(source), - mId(id) - { - } - - A_DELETE_COPY(ActionEvent) - - /** - * Destructor. - */ - virtual ~ActionEvent() - { } - - /** - * Gets the identifier of the event. An identifier can - * be used to distinguish from two actions from the same - * widget or to let many widgets fire the same widgets - * that should be treated equally. - * - * @return The identifier of the event. - */ - const std::string &getId() const noexcept2 A_WARN_UNUSED - { return mId; } - - protected: - /** - * Holds the identifier of the event. - */ - std::string mId; -}; - -#endif // EVENTS_ACTIONEVENT_H diff --git a/src/events/event.h b/src/events/event.h deleted file mode 100644 index 78a7b7ada..000000000 --- a/src/events/event.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 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 . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * 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 EVENTS_EVENT_H -#define EVENTS_EVENT_H - -#include "localconsts.h" - -class Widget; - -/** - * Base class for all events. All events in Guichan should - * inherit from this class. - * - * @author Olof Naessén - */ -class Event notfinal -{ - public: - /** - * Constructor. - * - * @param source The source widget of the event. - */ - explicit Event(Widget *const source) : - mSource(source) - { } - - A_DELETE_COPY(Event) - - /** - * Destructor. - */ - virtual ~Event() - { } - - /** - * Gets the source widget of the event. The function - * is used to tell which widget fired an event. - * - * @return The source widget of the event. - */ - Widget* getSource() const noexcept2 A_WARN_UNUSED - { return mSource; } - - protected: - /** - * Holds the source widget of the event. - */ - Widget* mSource; -}; - -#endif // EVENTS_EVENT_H diff --git a/src/events/inputevent.h b/src/events/inputevent.h deleted file mode 100644 index 68600143b..000000000 --- a/src/events/inputevent.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2017 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 . - */ - -#ifndef EVENTS_INPUTEVENT_H -#define EVENTS_INPUTEVENT_H - -#include "enums/input/inputaction.h" - -#include "utils/vector.h" - -#include -#include - -#include "localconsts.h" - -class ChatTab; - -typedef STD_VECTOR KeysVector; -typedef KeysVector::iterator KeysVectorIter; -typedef KeysVector::const_iterator KeysVectorCIter; - -typedef std::map KeyToActionMap; -typedef KeyToActionMap::iterator KeyToActionMapIter; - -typedef std::map KeyToIdMap; -typedef KeyToIdMap::iterator KeyToIdMapIter; - -typedef std::map KeyTimeMap; -typedef KeyTimeMap::iterator KeyTimeMapIter; - -struct InputEvent final -{ - InputEvent(const InputActionT action0, - const int mask0) : - args(), - tab(nullptr), - action(action0), - mask(mask0) - { } - - InputEvent(const std::string &args0, - ChatTab *const tab0, - const int mask0) : - args(args0), - tab(tab0), - action(InputAction::NO_VALUE), - mask(mask0) - { } - - A_DELETE_COPY(InputEvent) - - const std::string args; - ChatTab *const tab; - const InputActionT action; - const int mask; -}; - -#endif // EVENTS_INPUTEVENT_H diff --git a/src/events/inputguievent.h b/src/events/inputguievent.h deleted file mode 100644 index 2a702db91..000000000 --- a/src/events/inputguievent.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 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 . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * 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 EVENTS_INPUTGUIEVENT_H -#define EVENTS_INPUTGUIEVENT_H - -#include "events/event.h" - -/** - * Base class for all events concerning input. - * - * @author Olof Naessén - */ -class InputGuiEvent: public Event -{ - public: - /** - * Constructor. - * - * @param source The source widget of the event. - */ - explicit InputGuiEvent(Widget *const source) : - Event(source), - mIsConsumed(false) - { } - - /** - * Marks the event as consumed. Input event listeners may discard - * consumed input or act on consumed input. An example of a widget - * that discards consumed input is the ScrollArea widget that - * discards consumed mouse wheel events so the ScrollArea will not - * scroll if for instance a Slider's value inside the ScrollArea was - * changed with the mouse wheel. - * - * @see isConsumed - */ - void consume() - { mIsConsumed = true; } - - /** - * Checks if the input event is consumed. - * - * @return True if the input event is consumed, - * false otherwise. - * @see consume - */ - bool isConsumed() const noexcept2 A_WARN_UNUSED - { return mIsConsumed; } - - protected: - /** - * True if the input event is consumed, - * false otherwise. - */ - bool mIsConsumed; -}; - -#endif // EVENTS_INPUTGUIEVENT_H diff --git a/src/events/keyevent.h b/src/events/keyevent.h deleted file mode 100644 index 191bc1849..000000000 --- a/src/events/keyevent.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 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 . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * 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 EVENTS_KEYEVENT_H -#define EVENTS_KEYEVENT_H - -#include "enums/events/keyeventtype.h" - -#include "enums/input/inputaction.h" - -#include "events/inputguievent.h" - -#include "input/key.h" - -#ifdef USE_SDL2 -#include -#endif // USE_SDL2 - -class Widget; - -/** - * Represents a key event. - */ -class KeyEvent: public InputGuiEvent -{ - public: - /** - * Constructor. - * - * @param source The source widget of the event. - * @param type The type of the event. A value from KeyEventType. - * false otherwise. - * @param key The key of the event. - */ - KeyEvent(Widget *const source, - KeyEventTypeT type, - const InputActionT actionId, - const Key &key) : - InputGuiEvent(source), - mKey(key), -#ifdef USE_SDL2 - mText(), -#endif // USE_SDL2 - mType(type), - mActionId(actionId) - { } - - /** - * Destructor. - */ - virtual ~KeyEvent() - { } - - /** - * Gets the type of the event. - * - * @return The type of the event. - */ - KeyEventTypeT getType() const noexcept2 A_WARN_UNUSED - { return mType; } - - /** - * Gets the key of the event. - * - * @return The key of the event. - */ - const Key &getKey() const noexcept2 A_WARN_UNUSED - { return mKey; } - - InputActionT getActionId() const noexcept2 A_WARN_UNUSED - { return mActionId; } - -#ifdef USE_SDL2 - void setText(const std::string &text) - { mText = text; } - - std::string getText() const - { return mText; } -#endif // USE_SDL2 - - protected: - /** - * Holds the key of the key event. - */ - Key mKey; - -#ifdef USE_SDL2 - std::string mText; -#endif // USE_SDL2 - - /** - * Holds the type of the key event. - */ - KeyEventTypeT mType; - - InputActionT mActionId; -}; - -#endif // EVENTS_KEYEVENT_H diff --git a/src/events/mouseevent.h b/src/events/mouseevent.h deleted file mode 100644 index 3a3a70f0a..000000000 --- a/src/events/mouseevent.h +++ /dev/null @@ -1,199 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 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 . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * 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 EVENTS_MOUSEEVENT_H -#define EVENTS_MOUSEEVENT_H - -#include "events/inputguievent.h" - -#include "enums/events/mousebutton.h" -#include "enums/events/mouseeventtype.h" - -class Widget; - -/** - * Represents a mouse event. - * - * @author Olof Naessén - */ -class MouseEvent: public InputGuiEvent -{ - public: - /** - * Constructor. - * - * @param source The source widget of the mouse event. - * @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 MouseEventTypeT type, - const MouseButtonT button, - const int x, - const int y, - const int clickCount) : - InputGuiEvent(source), - mType(type), - mButton(button), - mX(x), - mY(y), - mClickCount(clickCount) - { - } - - /** - * Gets the button of the mouse event. - * - * @return The button of the mouse event. - */ - MouseButtonT getButton() const noexcept2 A_WARN_UNUSED - { return mButton; } - - /** - * 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 noexcept2 A_WARN_UNUSED - { return mX; } - - /** - * 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 noexcept2 A_WARN_UNUSED - { return mY; } - - /** - * 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 noexcept2 A_WARN_UNUSED - { return mClickCount; } - - /** - * Gets the type of the event. - * - * @return The type of the event. - */ - MouseEventTypeT getType() const noexcept2 A_WARN_UNUSED - { return mType; } - - void setX(int n) - { mX = n; } - - void setY(int n) - { mY = n; } - - protected: - /** - * Holds the type of the mouse event. - */ - MouseEventTypeT mType; - - /** - * Holds the button of the mouse event. - */ - MouseButtonT 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; -}; - -#endif // EVENTS_MOUSEEVENT_H diff --git a/src/events/selectionevent.h b/src/events/selectionevent.h deleted file mode 100644 index 02682af07..000000000 --- a/src/events/selectionevent.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2011-2017 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 . - */ - -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * 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 EVENTS_SELECTIONEVENT_H -#define EVENTS_SELECTIONEVENT_H - -#include "events/event.h" - -#include "localconsts.h" - -class Widget; - -/** - * Represents a selection event. - * - * @author Olof Naessén - */ -class SelectionEvent final: public Event -{ - public: - /** - * Constructor. - * - * @param source source The widget of the selection event. - */ - explicit SelectionEvent(Widget *const source) : - Event(source) - { } - - A_DELETE_COPY(SelectionEvent) - - /** - * Destructor. - */ - virtual ~SelectionEvent() - { } -}; - -#endif // EVENTS_SELECTIONEVENT_H -- cgit v1.2.3-60-g2f50