author | simon <simon> | 2002-12-14 18:18:20 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-14 18:18:20 (UTC) |
commit | 7c854ad1b909f37c7314ef4ac2061500d02af16d (patch) (unidiff) | |
tree | 24528d72c0f2d36d6777090d7d93e2536ffb120d /noncore/multimedia/opieplayer2/skin.h | |
parent | ae7a270c56fa0fff6d3f530c80532c54c51be596 (diff) | |
download | opie-7c854ad1b909f37c7314ef4ac2061500d02af16d.zip opie-7c854ad1b909f37c7314ef4ac2061500d02af16d.tar.gz opie-7c854ad1b909f37c7314ef4ac2061500d02af16d.tar.bz2 |
- reduce memory usage a little bit by not storing the images after they
got converted to pixmaps
Diffstat (limited to 'noncore/multimedia/opieplayer2/skin.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/skin.h b/noncore/multimedia/opieplayer2/skin.h index bafebd3..067b6c4 100644 --- a/noncore/multimedia/opieplayer2/skin.h +++ b/noncore/multimedia/opieplayer2/skin.h | |||
@@ -17,67 +17,71 @@ | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; see the file COPYING. If not, write to | 18 | along with this program; see the file COPYING. If not, write to |
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. | 20 | Boston, MA 02111-1307, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #ifndef SKIN_H | 23 | #ifndef SKIN_H |
24 | #define SKIN_H | 24 | #define SKIN_H |
25 | 25 | ||
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qimage.h> | 27 | #include <qimage.h> |
28 | #include <qobject.h> | 28 | #include <qobject.h> |
29 | 29 | ||
30 | #include "mediawidget.h" | 30 | #include "mediawidget.h" |
31 | 31 | ||
32 | struct SkinData; | 32 | struct SkinData; |
33 | 33 | ||
34 | class Skin | 34 | class Skin |
35 | { | 35 | { |
36 | public: | 36 | public: |
37 | Skin( const QString &name, const QString &fileNameInfix ); | 37 | Skin( const QString &name, const QString &fileNameInfix ); |
38 | Skin( const QString &fileNameInfix ); | 38 | Skin( const QString &fileNameInfix ); |
39 | ~Skin(); | 39 | ~Skin(); |
40 | 40 | ||
41 | bool isCachable() const { return m_isCachable; } | ||
42 | void setCachable( bool cachable ) { m_isCachable = cachable; } | ||
43 | |||
41 | QPixmap backgroundPixmap() const; | 44 | QPixmap backgroundPixmap() const; |
42 | QImage buttonUpImage() const; | 45 | QImage buttonUpImage() const; |
43 | QImage buttonDownImage() const; | 46 | QImage buttonDownImage() const; |
44 | 47 | ||
45 | QImage buttonMask( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ) const; | 48 | QImage buttonMask( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ) const; |
46 | 49 | ||
47 | QImage buttonMaskImage( const QString &fileName ) const; | 50 | QImage buttonMaskImage( const QString &fileName ) const; |
48 | 51 | ||
49 | static QString defaultSkinName(); | 52 | static QString defaultSkinName(); |
50 | 53 | ||
51 | private: | 54 | private: |
52 | void init( const QString &name ); | 55 | void init( const QString &name ); |
53 | 56 | ||
54 | void addButtonToMask( int tag, const QImage &maskImage ) const; | 57 | void addButtonToMask( int tag, const QImage &maskImage ) const; |
55 | 58 | ||
56 | static QImage loadImage( const QString &fileName ); | 59 | static QImage loadImage( const QString &fileName ); |
57 | 60 | ||
58 | QString m_fileNameInfix; | 61 | QString m_fileNameInfix; |
59 | QString m_skinPath; | 62 | QString m_skinPath; |
63 | bool m_isCachable : 1; | ||
60 | 64 | ||
61 | SkinData *d; | 65 | SkinData *d; |
62 | 66 | ||
63 | Skin( const Skin & ); | 67 | Skin( const Skin & ); |
64 | Skin &operator=( const Skin & ); | 68 | Skin &operator=( const Skin & ); |
65 | }; | 69 | }; |
66 | 70 | ||
67 | class SkinLoader : public QObject | 71 | class SkinLoader : public QObject |
68 | { | 72 | { |
69 | Q_OBJECT | 73 | Q_OBJECT |
70 | public: | 74 | public: |
71 | SkinLoader(); | 75 | SkinLoader(); |
72 | virtual ~SkinLoader(); | 76 | virtual ~SkinLoader(); |
73 | 77 | ||
74 | void schedule( const MediaWidget::GUIInfo &guiInfo ); | 78 | void schedule( const MediaWidget::GUIInfo &guiInfo ); |
75 | void schedule( const QString &skinName, const MediaWidget::GUIInfo &guiInfo ); | 79 | void schedule( const QString &skinName, const MediaWidget::GUIInfo &guiInfo ); |
76 | 80 | ||
77 | void start(); | 81 | void start(); |
78 | 82 | ||
79 | protected: | 83 | protected: |
80 | virtual void timerEvent( QTimerEvent *ev ); | 84 | virtual void timerEvent( QTimerEvent *ev ); |
81 | 85 | ||
82 | private slots: | 86 | private slots: |
83 | void deleteMe(); | 87 | void deleteMe(); |