From b305f5e473e3d00d7abf71f9cdba5c102c855668 Mon Sep 17 00:00:00 2001 From: Maurizio Monge Date: Thu, 12 Jul 2007 00:53:19 +0200 Subject: [PATCH] renamed SpriteLoader to PixmapLoader --- src/board.h | 8 ++++---- src/movelist_textual.h | 4 ++-- src/movelist_widget.h | 4 ++-- src/piecegroup.h | 12 ++++++------ src/{spriteloader.cpp => pixmaploader.cpp} | 28 ++++++++++++++-------------- src/{spriteloader.h => pixmaploader.h} | 14 +++++++------- 6 files changed, 35 insertions(+), 35 deletions(-) rename src/{spriteloader.cpp => pixmaploader.cpp} (75%) rename src/{spriteloader.h => pixmaploader.h} (92%) diff --git a/src/board.h b/src/board.h index 9222fc4..a9dd899 100644 --- a/src/board.h +++ b/src/board.h @@ -60,7 +60,7 @@ private: bool droppedOut; InteractionType action; - DragInfo(Point from, const QPoint& real, + DragInfo(Point from, const QPoint& real, const boost::shared_ptr& sprite, InteractionType action) : sprite(sprite) @@ -98,8 +98,8 @@ private: /** all the tags on the board */ BoardTagsPtr m_tags; - /** the @a SpriteLoader used to create tags */ - SpriteLoader m_tags_loader; + /** the @a PixmapLoader used to create tags */ + PixmapLoader m_tags_loader; /** the entity responsible of all the interctions with the board */ boost::weak_ptr m_entity; @@ -198,7 +198,7 @@ public: Point p5 = Point::invalid(), Point p6 = Point::invalid() ); /** returns a reference to the loader used to load tag pixmaps */ - SpriteLoader* tagsLoader() { return &m_tags_loader; } + PixmapLoader* tagsLoader() { return &m_tags_loader; } void cancelPremove(); diff --git a/src/movelist_textual.h b/src/movelist_textual.h index 27e139a..4a507aa 100644 --- a/src/movelist_textual.h +++ b/src/movelist_textual.h @@ -15,7 +15,7 @@ #include #include #include "decoratedmove.h" -#include "spriteloader.h" +#include "pixmaploader.h" #include "movelist_notifier.h" class KHTMLPart; @@ -28,7 +28,7 @@ Q_OBJECT Index m_curr_selected; int m_layout_style; Notifier *m_notifier; - SpriteLoader m_loader; + PixmapLoader m_loader; public: Textual(QWidget *parent = NULL); diff --git a/src/movelist_widget.h b/src/movelist_widget.h index d4a926a..78812cf 100644 --- a/src/movelist_widget.h +++ b/src/movelist_widget.h @@ -21,7 +21,7 @@ #include #include "index.h" #include "decoratedmove.h" -#include "spriteloader.h" +#include "pixmaploader.h" #include "canvas/widget.h" namespace MoveList { @@ -80,7 +80,7 @@ private: QHash loaded_pixmaps; Table *owner_table; Settings *m_settings; - SpriteLoader m_loader; + PixmapLoader m_loader; History* fetchRef(const Index& ix, int* idx = NULL); EntryPtr fetch(const Index& ix); diff --git a/src/piecegroup.h b/src/piecegroup.h index 829ed03..b2dd4d5 100644 --- a/src/piecegroup.h +++ b/src/piecegroup.h @@ -19,12 +19,12 @@ #include "sprite.h" #include "mainanimation.h" #include "pointconverter.h" -#include "spriteloader.h" +#include "pixmaploader.h" #include "clickablecanvas.h" class MainAnimation; class PointConverter; -class SpriteLoader; +class PixmapLoader; //BEGIN PieceGroup @@ -54,7 +54,7 @@ protected: int m_square_size; /** loader class, to load pieces */ - SpriteLoader m_loader; + PixmapLoader m_loader; /** main animation structure */ MainAnimation* m_main_animation; @@ -92,10 +92,10 @@ public: const PointConverter* converter() const { return static_cast(this); } /** returns the sprite loader */ - SpriteLoader* loader() { return &m_loader; } + PixmapLoader* loader() { return &m_loader; } /** returns the sprite loader */ - const SpriteLoader* loader() const { return &m_loader; } + const PixmapLoader* loader() const { return &m_loader; } /** returns the flipped value */ virtual bool flipped() const { return m_flipped; } @@ -129,7 +129,7 @@ public: /** changed settings handler */ virtual void settingsChanged(); - + /** create a sprite from a pixmap */ virtual boost::shared_ptr createSprite(const QPixmap& pix, const Point& pos); }; diff --git a/src/spriteloader.cpp b/src/pixmaploader.cpp similarity index 75% rename from src/spriteloader.cpp rename to src/pixmaploader.cpp index 43ff011..5c5772f 100644 --- a/src/spriteloader.cpp +++ b/src/pixmaploader.cpp @@ -10,9 +10,9 @@ #include #include "loader/theme.h" -#include "spriteloader.h" +#include "pixmaploader.h" -class SpriteLoader::Loader : public ::Loader::Theme { +class PixmapLoader::Loader : public ::Loader::Theme { public: int m_ref_count; Loader(const QString& s) @@ -22,23 +22,23 @@ public: }; /* inherit instead of typedef to ease forward declaration :) */ -class SpriteLoader::LoadersCache : public - std::map { +class PixmapLoader::LoadersCache : public + std::map { }; -SpriteLoader::LoadersCache SpriteLoader::loaders; +PixmapLoader::LoadersCache PixmapLoader::loaders; -SpriteLoader::SpriteLoader() +PixmapLoader::PixmapLoader() : m_loader(NULL) , m_size(0) { } -SpriteLoader::~SpriteLoader() { +PixmapLoader::~PixmapLoader() { flush(); } -void SpriteLoader::flush() { +void PixmapLoader::flush() { if(m_loader) { /* unref the size */ if(m_size) @@ -53,7 +53,7 @@ void SpriteLoader::flush() { } } -void SpriteLoader::setBasePath(const QString& base) { +void PixmapLoader::setBasePath(const QString& base) { //QString base = PixmapLoader::Loader::resolveBasePath(__base); if(base == m_base) @@ -63,7 +63,7 @@ void SpriteLoader::setBasePath(const QString& base) { m_base = base; } -void SpriteLoader::setSize(int s) { +void PixmapLoader::setSize(int s) { if(m_loader) { if(s) m_loader->refSize(s); @@ -73,7 +73,7 @@ void SpriteLoader::setSize(int s) { m_size = s; } -void SpriteLoader::initialize() { +void PixmapLoader::initialize() { if(m_loader) return; @@ -89,7 +89,7 @@ void SpriteLoader::initialize() { m_loader->refSize(m_size); } -QPixmap SpriteLoader::operator()(const QString& id) { +QPixmap PixmapLoader::operator()(const QString& id) { if(!m_size || m_base.isEmpty()) return QPixmap(); @@ -99,7 +99,7 @@ QPixmap SpriteLoader::operator()(const QString& id) { return m_loader->getPixmap(id, m_size); } -::Loader::PixmapOrMap SpriteLoader::getPixmapMap(const QString& id) { +::Loader::PixmapOrMap PixmapLoader::getPixmapMap(const QString& id) { if(!m_size || m_base.isEmpty()) return ::Loader::PixmapOrMap(); @@ -109,7 +109,7 @@ QPixmap SpriteLoader::operator()(const QString& id) { return m_loader->getPixmapMap(id, m_size); } -::Loader::Glyph SpriteLoader::getGlyph(const QString& id) { +::Loader::Glyph PixmapLoader::getGlyph(const QString& id) { if(!m_size || m_base.isEmpty()) return ::Loader::Glyph(); diff --git a/src/spriteloader.h b/src/pixmaploader.h similarity index 92% rename from src/spriteloader.h rename to src/pixmaploader.h index 82563fc..2accd45 100644 --- a/src/spriteloader.h +++ b/src/pixmaploader.h @@ -8,15 +8,15 @@ (at your option) any later version. */ -#ifndef SPRITELOADER_H -#define SPRITELOADER_H +#ifndef PIXMAPLOADER_H +#define PIXMAPLOADER_H #include #include #include "loader/theme.h" /** - * @class SpriteLoader + * @class PixmapLoader * @brief The simple pixmap loading facility. * * This is the utility class used by the interface to load pixmap from resource ids. @@ -25,7 +25,7 @@ * * Note that pixmaps will not be all of the specified size, the size is only the base size. */ -class SpriteLoader { +class PixmapLoader { private: class Loader; class LoadersCache; @@ -51,8 +51,8 @@ private: public: /** constructor */ - SpriteLoader(); - ~SpriteLoader(); + PixmapLoader(); + ~PixmapLoader(); /** set the theme path */ void setBasePath(const QString& base); @@ -73,4 +73,4 @@ public: ::Loader::Glyph getGlyph(const QString& id); }; -#endif // SPRITELOADER_H +#endif // PIXMAPLOADER_H -- 2.11.4.GIT