00001 /* 00002 This file is part of the KDE games library 00003 00004 Copyright 2008 Andreas Pakulat <apaku@gmx.de> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License version 2 as published by the Free Software Foundation. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef __CARDCACHE_P_H_ 00022 #define __CARDCACHE_P_H_ 00023 00024 #include <QThread> 00025 #include <QString> 00026 #include <QSize> 00027 #include "cardcache.h" 00028 00029 class KPixmapCache; 00030 class QMutex; 00031 class KSvgRenderer; 00032 class LoadThread; 00033 00034 class KCardCachePrivate 00035 { 00036 public: 00037 KPixmapCache* frontcache; 00038 KPixmapCache* backcache; 00039 QMutex* frontcacheMutex; 00040 QMutex* backcacheMutex; 00041 QMutex* backRendererMutex; 00042 QMutex* frontRendererMutex; 00043 LoadThread* loadThread; 00044 QSize size; 00045 QString frontTheme; 00046 QString backTheme; 00047 KSvgRenderer* backRenderer; 00048 KSvgRenderer* frontRenderer; 00049 QPixmap renderFrontSvg( const QString& element ); 00050 QPixmap renderBackSvg( const QString& element ); 00051 void ensureNonNullPixmap( QPixmap& pix ); 00052 }; 00053 00054 class LoadThread : public QThread 00055 { 00056 Q_OBJECT 00057 public: 00058 LoadThread( KCardCache::LoadInfos infos, KCardCachePrivate* d ); 00059 void setSize( const QSize& s ); 00060 void setFrontTheme( const QString& frontTheme ); 00061 void setBackTheme( const QString& backTheme ); 00062 void run(); 00063 void kill(); 00064 private: 00065 KCardCachePrivate* d; 00066 QString backTheme; 00067 QString frontTheme; 00068 QSize size; 00069 KCardCache::LoadInfos infos; 00070 bool doKill; 00071 QMutex* killMutex; 00072 }; 00073 00074 #endif
1.5.3