Diffstat (limited to 'noncore/multimedia/opieplayer2/skin.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.h | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/noncore/multimedia/opieplayer2/skin.h b/noncore/multimedia/opieplayer2/skin.h index 5ab6574..060ff73 100644 --- a/noncore/multimedia/opieplayer2/skin.h +++ b/noncore/multimedia/opieplayer2/skin.h | |||
@@ -21,25 +21,24 @@ | |||
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 <qmap.h> | 28 | #include <qmap.h> |
29 | #include <qdict.h> | 29 | #include <qdict.h> |
30 | 30 | ||
31 | #include "mediawidget.h" | 31 | #include "mediawidget.h" |
32 | #include "threadutil.h" | 32 | #include "threadutil.h" |
33 | #include "singleton.h" | ||
34 | 33 | ||
35 | struct SkinData; | 34 | struct SkinData; |
36 | 35 | ||
37 | class Skin | 36 | class Skin |
38 | { | 37 | { |
39 | public: | 38 | public: |
40 | Skin( const QString &name, const QString &fileNameInfix ); | 39 | Skin( const QString &name, const QString &fileNameInfix ); |
41 | Skin( const QString &fileNameInfix ); | 40 | Skin( const QString &fileNameInfix ); |
42 | ~Skin(); | 41 | ~Skin(); |
43 | 42 | ||
44 | void preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ); | 43 | void preload( const MediaWidget::SkinButtonInfo *skinButtonInfo, uint buttonCount ); |
45 | 44 | ||
@@ -58,39 +57,24 @@ private: | |||
58 | 57 | ||
59 | void addButtonToMask( int tag, const QImage &maskImage ) const; | 58 | void addButtonToMask( int tag, const QImage &maskImage ) const; |
60 | 59 | ||
61 | QString m_fileNameInfix; | 60 | QString m_fileNameInfix; |
62 | QString m_skinPath; | 61 | QString m_skinPath; |
63 | 62 | ||
64 | SkinData *d; | 63 | SkinData *d; |
65 | 64 | ||
66 | Skin( const Skin & ); | 65 | Skin( const Skin & ); |
67 | Skin &operator=( const Skin & ); | 66 | Skin &operator=( const Skin & ); |
68 | }; | 67 | }; |
69 | 68 | ||
70 | class SkinCache : public Singleton<SkinCache> | ||
71 | { | ||
72 | public: | ||
73 | SkinCache(); | ||
74 | |||
75 | QImage loadImage( const QString &name ); | ||
76 | |||
77 | private: | ||
78 | typedef QDict<QImage> ImageCache; | ||
79 | |||
80 | ImageCache m_cache; | ||
81 | |||
82 | ThreadUtil::Mutex m_cacheGuard; | ||
83 | }; | ||
84 | |||
85 | class SkinLoader : public ThreadUtil::Thread | 69 | class SkinLoader : public ThreadUtil::Thread |
86 | { | 70 | { |
87 | public: | 71 | public: |
88 | SkinLoader(); | 72 | SkinLoader(); |
89 | 73 | ||
90 | void schedule( const QString &skinName, const QString &fileNameInfix, | 74 | void schedule( const QString &skinName, const QString &fileNameInfix, |
91 | const MediaWidget::SkinButtonInfo *skinButtonInfo, const uint buttonCount ); | 75 | const MediaWidget::SkinButtonInfo *skinButtonInfo, const uint buttonCount ); |
92 | 76 | ||
93 | protected: | 77 | protected: |
94 | virtual void run(); | 78 | virtual void run(); |
95 | 79 | ||
96 | private: | 80 | private: |