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

#include "resizeconfig.h"

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

#include <QDebug>

using namespace KWin;

namespace KWin {

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

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

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

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

ResizeConfig::ResizeConfig(  KSharedConfig::Ptr config  )
  : KConfigSkeleton( config )
{
  Q_ASSERT(!s_globalResizeConfig()->q);
  s_globalResizeConfig()->q = this;
  setCurrentGroup( QStringLiteral( "Effect-Resize" ) );

  KConfigSkeleton::ItemBool  *itemTextureScale;
  itemTextureScale = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "TextureScale" ), mTextureScale, true );
  addItem( itemTextureScale, QStringLiteral( "TextureScale" ) );
  KConfigSkeleton::ItemBool  *itemOutline;
  itemOutline = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "Outline" ), mOutline, false );
  addItem( itemOutline, QStringLiteral( "Outline" ) );
}

ResizeConfig::~ResizeConfig()
{
  s_globalResizeConfig()->q = nullptr;
}

