diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-24 13:26:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-24 13:31:01 +0300 |
commit | bd231fc40ca54f7dd2e091c5ab414f4cebb3b05e (patch) | |
tree | f5bd340d41e7d0d7dda89c2c614ad1e5ff44fbc1 /src/guichan/include | |
parent | 64ed19bc03e994b54abc39532c72ed6e374948b9 (diff) | |
download | plus-bd231fc40ca54f7dd2e091c5ab414f4cebb3b05e.tar.gz plus-bd231fc40ca54f7dd2e091c5ab414f4cebb3b05e.tar.bz2 plus-bd231fc40ca54f7dd2e091c5ab414f4cebb3b05e.tar.xz plus-bd231fc40ca54f7dd2e091c5ab414f4cebb3b05e.zip |
Remove unused guichan classes.
Diffstat (limited to 'src/guichan/include')
-rw-r--r-- | src/guichan/include/guichan/defaultfont.hpp | 100 | ||||
-rw-r--r-- | src/guichan/include/guichan/image.hpp | 48 | ||||
-rw-r--r-- | src/guichan/include/guichan/imageloader.hpp | 101 | ||||
-rw-r--r-- | src/guichan/include/guichan/widget.hpp | 6 | ||||
-rw-r--r-- | src/guichan/include/guichan/widgets/icon.hpp | 119 |
5 files changed, 0 insertions, 374 deletions
diff --git a/src/guichan/include/guichan/defaultfont.hpp b/src/guichan/include/guichan/defaultfont.hpp deleted file mode 100644 index c09802ee3..000000000 --- a/src/guichan/include/guichan/defaultfont.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2012 The ManaPlus Developers - * - * - * 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_DEFAULTFONT_HPP -#define GCN_DEFAULTFONT_HPP - -#include "guichan/font.hpp" -#include "guichan/platform.hpp" - -#include "localconsts.h" - -namespace gcn -{ - /** - * A font only capable of drawing rectangles. It is used by default - * in Guichan if no font has been set merely to show that no font has - * been set. - */ - class GCN_CORE_DECLSPEC DefaultFont final : public Font - { - public: - - /** - * Destructor. - */ - virtual ~DefaultFont(){} - - /** - * Draws a glyph as a rectangle. The glyphs will always be drawn as - * rectangles no matter the glyph. - * - * NOTE: You normally won't use this function to draw text since - * the Graphics class contains better functions for drawing - * text. - * - * @param graphics A Graphics object to be used for drawing. - * @param glyph The glyph to draw. - * @param x The x coordinate where to draw the glyph. - * @param y The y coordinate where to draw the glyph. - * @return The width of the drawn glyph in pixels. - */ - virtual int drawGlyph(Graphics* graphics, unsigned char glyph, - int x, int y); - - - // Inherited from Font - - virtual void drawString(Graphics* graphics, const std::string& text, - int x, int y); - - virtual int getWidth(const std::string& text) const; - - virtual int getHeight() const; - - virtual int getStringIndexAt(const std::string& text, int x) const; - }; -} - -#endif // end GCN_DEFAULTFONT_HPP diff --git a/src/guichan/include/guichan/image.hpp b/src/guichan/include/guichan/image.hpp index f4de86679..7e4ad7b78 100644 --- a/src/guichan/include/guichan/image.hpp +++ b/src/guichan/include/guichan/image.hpp @@ -52,7 +52,6 @@ namespace gcn { class Color; - class ImageLoader; /** * Holds an image. To be able to use this class you must first set an @@ -83,47 +82,6 @@ namespace gcn virtual ~Image(); /** - * Loads an image by using the class' image loader. All image loaders - * implemented in Guichan return a newly instantiated image which must - * be deleted in order to avoid a memory leak. - * - * NOTE: The functions getPixel and putPixel are only guaranteed to work - * before an image has been converted to display format. - * - * @param filename The file to load. - * @param convertToDisplayFormat True if the image should be converted - * to display, false otherwise. - * @since 0.5.0 - */ - static Image* load(const std::string& filename, - bool convertToDisplayFormat = true); - - /** - * Gets the image loader used for loading images. - * - * @return The image loader used for loading images. - * @see setImageLoader, AllegroImageLoader, HGEImageLoader, - * OpenLayerImageLoader, OpenGLAllegroImageLoader, - * OpenGLSDLImageLoader, SDLImageLoader - * @since 0.1.0 - */ - static ImageLoader* getImageLoader(); - - /** - * Sets the ImageLoader to be used for loading images. - * - * IMPORTANT: The image loader is static and MUST be set before - * loading images! - * - * @param imageLoader The image loader to be used for loading images. - * @see getImageLoader, AllegroImageLoader, HGEImageLoader, - * OpenLayerImageLoader, OpenGLAllegroImageLoader, - * OpenGLSDLImageLoader, SDLImageLoader - * @since 0.1.0 - */ - static void setImageLoader(ImageLoader* imageLoader); - - /** * Frees an image. * * @since 0.5.0 @@ -180,12 +138,6 @@ namespace gcn * @since 0.5.0 */ virtual void convertToDisplayFormat() = 0; - - protected: - /** - * Holds the image loader to be used when loading images. - */ - static ImageLoader* mImageLoader; }; } diff --git a/src/guichan/include/guichan/imageloader.hpp b/src/guichan/include/guichan/imageloader.hpp deleted file mode 100644 index d8fef4f6a..000000000 --- a/src/guichan/include/guichan/imageloader.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2012 The ManaPlus Developers - * - * - * 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_IMAGELOADER_HPP -#define GCN_IMAGELOADER_HPP - -#include <string> - -#include "guichan/platform.hpp" - -namespace gcn -{ - class Image; - - /** - * Abstract class for providing functions for loading images. - * - * Guichan contains implementations of ImageLoader for common - * libraries like the Allegro library, the HGE library, - * he OpenLayer library, and the SDL library. - * To make Guichan usable with other libraries, an ImageLoader - * class must be implemented. - * - * To make Guichan use an image loader, the image loader needs - * to be passed to the Image class using the static method - * Image::setImageLoader. - * - * @see Image::setImageLoader, Image::getImageLoader, - * AllegroImageLoader, HGEImageLoader, OpenLayerImageLoader, - * OpenGLAllegroImageLoader, OpenGLSDLImageLoader, - * SDLImageLoader - * @since 0.1.0 - */ - class GCN_CORE_DECLSPEC ImageLoader - { - public: - - /** - * Destructor. - */ - virtual ~ImageLoader() - { } - - /** - * Loads an image. - * - * NOTE: The functions Image::getPixel and Image::putPixel - * are only guaranteed to work before an image has - * been converted to display format. - * - * @param filename The filename of the image to load. - * @param convertToDisplayFormat True if the image should be converted - * to display, false otherwise. - */ - virtual Image* load(const std::string& filename, - bool convertToDisplayFormat = true) = 0; - }; -} - -#endif // end GCN_IMAGELOADER_HPP diff --git a/src/guichan/include/guichan/widget.hpp b/src/guichan/include/guichan/widget.hpp index f4429dbee..69dfd1fc4 100644 --- a/src/guichan/include/guichan/widget.hpp +++ b/src/guichan/include/guichan/widget.hpp @@ -59,7 +59,6 @@ namespace gcn class ActionListener; class BasicContainer; class DeathListener; - class DefaultFont; class FocusHandler; class FocusListener; class Font; @@ -1188,11 +1187,6 @@ namespace gcn Font* mCurrentFont; /** - * Holds the default font used by the widget. - */ - static DefaultFont mDefaultFont; - - /** * Holds the global font used by the widget. */ static Font* mGlobalFont; diff --git a/src/guichan/include/guichan/widgets/icon.hpp b/src/guichan/include/guichan/widgets/icon.hpp deleted file mode 100644 index ed010c31a..000000000 --- a/src/guichan/include/guichan/widgets/icon.hpp +++ /dev/null @@ -1,119 +0,0 @@ -/* _______ __ __ __ ______ __ __ _______ __ __ - * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ - * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / - * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / - * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / - * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / - * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ - * - * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2012 The ManaPlus Developers - * - * - * 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_ICON_HPP -#define GCN_ICON_HPP - -#include "guichan/image.hpp" -#include "guichan/platform.hpp" -#include "guichan/widget.hpp" - -namespace gcn -{ - /** - * Implements an icon capable of displaying an image. - */ - class GCN_CORE_DECLSPEC Icon: public Widget - { - public: - /** - * Default constructor. - */ - Icon(); - - /** - * Constructor. - * - * @param filename The filename of the image to display. - */ - Icon(const std::string& filename); - - /** - * Constructor. - * - * @param image The image to display. - */ - Icon(const Image *const image); - - /** - * Descructor. - */ - virtual ~Icon(); - - /** - * Sets the image to display. Existing image is freed automatically - * if it was loaded internally. - * - * @param image The image to display. - */ - void setImage(const Image* image); - - /** - * Gets the current image. - * - * @return The current image. - */ - const Image* getImage() const; - - - // Inherited from Widget - - virtual void draw(Graphics* graphics); - - protected: - /** - * The image to display. - */ - const Image* mImage; - - /** - * True if the image has been loaded internally, false otherwise. - * An image not loaded internally should not be deleted in the - * destructor. - */ - bool mInternalImage; - }; -} - -#endif // end GCN_ICON_HPP |