// This file is generated by kconfig_compiler_kf5 from showfps.kcfg.
// All changes you do to this file will be lost.

#include "showfpsconfig.h"

#include <qglobal.h>
#include <QFile>

#include <QDebug>

using namespace KWin;

namespace KWin {

class ShowFpsConfigHelper
{
  public:
    ShowFpsConfigHelper() : q(nullptr) {}
    ~ShowFpsConfigHelper() { delete q; }
    ShowFpsConfigHelper(const ShowFpsConfigHelper&) = delete;
    ShowFpsConfigHelper& operator=(const ShowFpsConfigHelper&) = delete;
    ShowFpsConfig *q;
};
}

Q_GLOBAL_STATIC(ShowFpsConfigHelper, s_globalShowFpsConfig)
ShowFpsConfig *ShowFpsConfig::self()
{
  if (!s_globalShowFpsConfig()->q)
     qFatal("you need to call ShowFpsConfig::instance before using");
  return s_globalShowFpsConfig()->q;
}

void ShowFpsConfig::instance(const QString& cfgfilename)
{
  if (s_globalShowFpsConfig()->q) {
     qDebug() << "ShowFpsConfig::instance called after the first use - ignoring";
     return;
  }
  new ShowFpsConfig(KSharedConfig::openConfig(cfgfilename));
  s_globalShowFpsConfig()->q->read();
}

void ShowFpsConfig::instance(KSharedConfig::Ptr config)
{
  if (s_globalShowFpsConfig()->q) {
     qDebug() << "ShowFpsConfig::instance called after the first use - ignoring";
     return;
  }
  new ShowFpsConfig(config);
  s_globalShowFpsConfig()->q->read();
}

ShowFpsConfig::ShowFpsConfig(  KSharedConfig::Ptr config  )
  : KConfigSkeleton( config )
{
  Q_ASSERT(!s_globalShowFpsConfig()->q);
  s_globalShowFpsConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-ShowFps" ) );

  KConfigSkeleton::ItemInt  *itemTextPosition;
  itemTextPosition = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "TextPosition" ), mTextPosition, 0 );
  addItem( itemTextPosition, QStringLiteral( "TextPosition" ) );
  KConfigSkeleton::ItemFont  *itemTextFont;
  itemTextFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "TextFont" ), mTextFont );
  addItem( itemTextFont, QStringLiteral( "TextFont" ) );
  KConfigSkeleton::ItemColor  *itemTextColor;
  itemTextColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "TextColor" ), mTextColor, QColor( "invalid" ) );
  addItem( itemTextColor, QStringLiteral( "TextColor" ) );
  KConfigSkeleton::ItemDouble  *itemTextAlpha;
  itemTextAlpha = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "TextAlpha" ), mTextAlpha, 1.0 );
  addItem( itemTextAlpha, QStringLiteral( "TextAlpha" ) );
  KConfigSkeleton::ItemDouble  *itemAlpha;
  itemAlpha = new KConfigSkeleton::ItemDouble( currentGroup(), QStringLiteral( "Alpha" ), mAlpha, 0.5 );
  addItem( itemAlpha, QStringLiteral( "Alpha" ) );
  KConfigSkeleton::ItemInt  *itemX;
  itemX = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "X" ), mX, -10000 );
  addItem( itemX, QStringLiteral( "X" ) );
  KConfigSkeleton::ItemInt  *itemY;
  itemY = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "Y" ), mY, 0 );
  addItem( itemY, QStringLiteral( "Y" ) );
}

ShowFpsConfig::~ShowFpsConfig()
{
  s_globalShowFpsConfig()->q = nullptr;
}

