Blame toonz/sources/toonzqt/fxiconmanager.cpp
|
Toshihiro Shimizu |
890ddd |
#include "toonzqt/fxiconmanager.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include <qpixmap></qpixmap>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxIconPixmapManager::FxIconPixmapManager()
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
FxIconPixmapManager *FxIconPixmapManager::instance()
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
static FxIconPixmapManager _instance;
|
|
Toshihiro Shimizu |
890ddd |
return &_instance;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
3bfa54 |
const QPixmap &FxIconPixmapManager::getFxIconPm(std::string type)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Shinya Kitaoka |
3bfa54 |
std::map<std::string, qpixmap="">::iterator it;</std::string,>
|
|
Toshihiro Shimizu |
890ddd |
it = m_pms.find(type);
|
|
Toshihiro Shimizu |
890ddd |
if (it != m_pms.end())
|
|
Toshihiro Shimizu |
890ddd |
return it->second;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int i;
|
|
Toshihiro Shimizu |
890ddd |
for (i = 0; fxTypeInfo[i].pixmapFilename; i++)
|
|
Toshihiro Shimizu |
890ddd |
if (strcmp(type.c_str(), fxTypeInfo[i].fxType) == 0) {
|
|
Toshihiro Shimizu |
890ddd |
QString path = QString(":Resources/fxicons/") + fxTypeInfo[i].pixmapFilename + ".png";
|
|
Toshihiro Shimizu |
890ddd |
it = m_pms.insert(std::make_pair(type, QPixmap(path))).first;
|
|
Toshihiro Shimizu |
890ddd |
return it->second;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
static const QPixmap unidentifiedFxPixmap(":Resources/fxicons/fx_unidentified.png");
|
|
Toshihiro Shimizu |
890ddd |
it = m_pms.insert(std::make_pair(type, unidentifiedFxPixmap)).first;
|
|
Toshihiro Shimizu |
890ddd |
return it->second;
|
|
Toshihiro Shimizu |
890ddd |
}
|