#include <thememanager.h>
Public Member Functions | |
| ThemeManager (QString cards, QString deck, QString themefile, QObject *parent, int initialSize=1) | |
| Constructor for the theme manager. | |
| const QPixmap | getCard (int suite, int cardtype, double width) |
| Get the pixmap for a card. | |
| const QPixmap | getCardback (double width) |
| Get a backside of the card. | |
| const QPixmap | getPixmap (QString svgid, QSize size) |
| Load a pixmap from the SVG theme file. | |
| const QPixmap | getPixmap (QString svgid, double width) |
| Load a pixmap from the SVG theme file. | |
| const QPixmap | getPixmap (QString svgid, QString svgref, double refwidth) |
| Load a pixmap from the SVG theme file. | |
| double | getScale () |
| Retreive the current scale of the theme. | |
| KConfigGroup | config (QString id) |
| Retrieve the current theme configuration object. | |
| void | registerTheme (Themable *ob) |
| Register an object with the theme manager. | |
| void | unregisterTheme (Themable *ob) |
| Unregister an object with the theme manager. | |
| void | updateTheme (Themable *ob) |
| Forces an update to a theme objects. | |
| void | updateCardTheme (QString cards, QString deck) |
| Forces an update to the card theme objects. | |
| void | updateTheme (QString themefile) |
| Forces an update to all theme objects. | |
| void | rescale (int scale) |
| Change the scale of the theme and update all registered theme objects. | |
| double | aspectRatio () |
| Retrieve the theme's apsect ratio. | |
Protected Member Functions | |
| const QPixmap | getPixmap (KSvgRenderer *renderer, QString svgid, QSize size) |
| Load a pixmap from the SVG theme file. | |
| void | updateCardTheme (QString themefile, QString cards, QString deck) |
| Forces an update to the card theme objects. | |
| QString | calcCardSVGId (int no) |
| Retrive the SVGid for a card number. | |
The theme manager holds a list of all Themable objects and notifies them in the event of a theme change so that the objects can then redraw. It also allows access to the theme configuration file and reads pixmaps from an SVG file given a certain size or scale. The pixmaps are cached so that the same pixmap is retrieved from the cache on not rendered again.
Definition at line 105 of file thememanager.h.
|
||||||||||||||||||||||||
|
Constructor for the theme manager.
Definition at line 46 of file thememanager.cpp. References updateCardTheme(). Here is the call graph for this function: ![]() |
|
|
Retrieve the theme's apsect ratio. This is stored as 'aspect-ratio' key in the 'general' group of the theme.
Definition at line 213 of file thememanager.h. Referenced by DisplayIntro::loop(), and GameView::resizeEvent(). |
|
|
Retrive the SVGid for a card number. This effectively maps the 'old' PNG cards to the new SVG card ids. For example Ace of clubs is PNG card '1' or SVG id'1_club'
Definition at line 236 of file thememanager.cpp. Referenced by getCard(). |
|
|
Retrieve the current theme configuration object.
Definition at line 228 of file thememanager.cpp. Referenced by TextSprite::changeTheme(), ScoreSprite::changeTheme(), PixmapSprite::changeTheme(), DisplayTwo::changeTheme(), DisplayIntro::changeTheme(), CardSprite::changeTheme(), DisplayTwo::convertMousePress(), DisplayTwo::deal(), PixmapSprite::getDoubleValue(), DisplayIntro::loop(), DisplayTwo::play(), DisplayTwo::remove(), and updateTheme(). |
|
||||||||||||||||
|
Get the pixmap for a card.
Definition at line 258 of file thememanager.cpp. References calcCardSVGId(), and getPixmap(). Referenced by CardSprite::calcFrame(). Here is the call graph for this function: ![]() |
|
|
Get a backside of the card.
Definition at line 308 of file thememanager.cpp. References CARDBACK_SVGID, and getPixmap(). Referenced by CardSprite::calcFrame(). Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Load a pixmap from the SVG theme file. Its filename is given in the "general" section of the theme file as "svgfile". The pixmap is scaled to the given size.
Definition at line 353 of file thememanager.cpp. |
|
||||||||||||||||
|
Load a pixmap from the SVG theme file. Its filename is given in the "general" section of the theme file as "svgfile". The pixmap is scaled with reference to another SVG item. This allows to generate a set of pixmaps with related sizes.
Definition at line 405 of file thememanager.cpp. References getPixmap(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Load a pixmap from the SVG theme file. Its filename is given in the "general" section of the theme file as "svgfile". The pixmap is scaled to the given width. The height is relative to the width as given in the SVG file.
Definition at line 394 of file thememanager.cpp. References getPixmap(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Load a pixmap from the SVG theme file. Its filename is given in the "general" section of the theme file as "svgfile". The pixmap is scaled to the given size.
Definition at line 387 of file thememanager.cpp. Referenced by DisplayTwo::changeTheme(), DisplayIntro::changeTheme(), getCard(), getCardback(), and getPixmap(). |
|
|
Retreive the current scale of the theme.
Definition at line 221 of file thememanager.cpp. Referenced by TextSprite::changeTheme(), PixmapSprite::changeTheme(), CardSprite::changeTheme(), and DisplayTwo::convertMousePress(). |
|
|
Register an object with the theme manager.
Definition at line 64 of file thememanager.cpp. Referenced by Themable::Themable(). |
|
|
Change the scale of the theme and update all registered theme objects. If the scale did not change no action is performed!
Definition at line 199 of file thememanager.cpp. References Themable::changeTheme(), and global_debug. Referenced by GameView::GameView(), and GameView::resizeEvent(). Here is the call graph for this function: ![]() |
|
|
Unregister an object with the theme manager.
Definition at line 71 of file thememanager.cpp. Referenced by Themable::~Themable(). |
|
||||||||||||||||
|
Forces an update to the card theme objects.
Definition at line 89 of file thememanager.cpp. |
|
||||||||||||
|
Forces an update to the card theme objects.
Definition at line 85 of file thememanager.cpp. Referenced by ThemeManager(). |
|
|
Forces an update to all theme objects. That is their changeTheme() method is called. Before this a (new) theme file is loaded and all cached pixmaps deleted. This is used to really change one theme over to another one.
Definition at line 158 of file thememanager.cpp. References Themable::changeTheme(), and config(). Here is the call graph for this function: ![]() |
|
|
Forces an update to a theme objects. That is its changeTheme() method is called.
Definition at line 78 of file thememanager.cpp. References Themable::changeTheme(). Referenced by DisplayIntro::DisplayIntro(), DisplayTwo::DisplayTwo(), PixmapSprite::PixmapSprite(), ScoreSprite::ScoreSprite(), TextSprite::setText(), and TextSprite::TextSprite(). Here is the call graph for this function: ![]() |
1.4.6