1 | /*************************************************************************** |
2 | * KBlocks, a falling blocks game for KDE * |
3 | * Copyright (C) 2010 Mauricio Piacentini <mauricio@tabuleiro.com> * |
4 | * Zhongjie Cai <squall.leonhart.cai@gmail.com> * |
5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License as published by * |
8 | * the Free Software Foundation; either version 2 of the License, or * |
9 | * (at your option) any later version. * |
10 | ***************************************************************************/ |
11 | #ifndef KBLOCKSGRAPHICS_H |
12 | #define KBLOCKSGRAPHICS_H |
13 | |
14 | #include <QHash> |
15 | #include <QSvgRenderer> |
16 | #include <QPixmap> |
17 | |
18 | #define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API |
19 | #include <libkdegamesprivate/kgametheme.h> |
20 | |
21 | class KBlocksGraphics |
22 | { |
23 | public: |
24 | explicit KBlocksGraphics( const QString& themeFile ); |
25 | virtual ~KBlocksGraphics(); |
26 | |
27 | public: |
28 | bool loadTheme ( const QString& themeFile ); |
29 | void readThemeValues(); |
30 | void adjustForSize(const QSize& newsize); |
31 | KGameTheme * theme() { return m_theme; } |
32 | QSvgRenderer * renderer() { return m_renderer; } |
33 | //QPixmap elementPixmap(int width, int height, const QString & elementid); |
34 | |
35 | int m_Block_Size; |
36 | int m_View_Size_Width; |
37 | int m_View_Size_Height; |
38 | int m_PlayArea_OffsetPoint_X; |
39 | int m_PlayArea_OffsetPoint_Y; |
40 | int m_PlayArea_NumberOfBlocks_X; |
41 | int m_PlayArea_NumberOfBlocks_Y; |
42 | int m_PreviewArea_CenterPoint_X; |
43 | int m_PreviewArea_CenterPoint_Y; |
44 | |
45 | private: |
46 | KGameTheme * m_theme; |
47 | QSvgRenderer *m_renderer; |
48 | |
49 | //QPixmap renderElement(int width, int height, const QString & elementid); |
50 | //QString pixmapCacheNameFromElementId(int width, int height, const QString & elementid); |
51 | }; |
52 | |
53 | #endif |
54 | |