2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
11 #ifndef SPRITELOADER_H
12 #define SPRITELOADER_H
16 #include "loader/theme.h"
19 * @class SpriteLoader <spriteloader.h>
20 * @brief The simple pixmap loading facility.
22 * This is the utility class used by the interface to load pixmap from resource ids.
23 * It acts simply as a wrapper around PixmapLoader::Loader, making it possible to
24 * use it in a simple and afficient way.
26 * Note that pixmaps will not be all of the specified size, the size is only the base size.
33 /** static cache of the loaders, there should be only one for each (theme,variant) pair */
34 static LoadersCache loaders
;
36 /** the current loader, or NULL */
39 /** the current size */
42 /** the current theme */
45 /** internal, clears references to the currently used loader, if any. */
48 /** internal, gets or creates a loader good for the current
49 (theme,variant) pair and refs the size */
57 /** set the theme path */
58 void setBasePath(const QString
& base
);
60 /** set the base size of the pixmaps. Note that returned pixmaps's size can be different.
61 * For instance, if the size is 100 the "background" generated by the
62 * chess variant will be 200x200 (and it will be tiled on the Board)
66 /** looks up a string id (for instance a predefined id, like "background" or "highlighting") */
67 QPixmap
operator()(const QString
& id
);
69 /** looks up a string id (for instance a predefined id, like "background" or "highlighting") */
70 ::Loader::PixmapOrMap
getPixmapMap(const QString
& id
);
72 /** looks up a font + char */
73 ::Loader::Glyph
getGlyph(const QString
& id
);
76 #endif // SPRITELOADER_H