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